From 63edd7a8ea87041ff5e5bf2a9b9b6e5cb17ac387 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 17:16:09 +0800 Subject: [PATCH 001/285] PART 1 --- ...e for programming hardware abstractions.md | 87 +++++++++---------- 1 file changed, 42 insertions(+), 45 deletions(-) rename {sources => translated}/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md (67%) diff --git a/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md similarity index 67% rename from sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md rename to translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index b8a72997df..a7aecd1397 100644 --- a/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -7,25 +7,25 @@ [#]: via: (https://opensource.com/article/20/1/c-vs-rust-abstractions) [#]: author: (Dan Pittman https://opensource.com/users/dan-pittman) -C vs. Rust: Which to choose for programming hardware abstractions +C 还是 Rust:选择哪个用于编程硬件抽象 ====== -Using type-level programming in Rust can make hardware abstractions -safer. + +> 在 Rust 中使用类型级编程可以使硬件抽象更加安全。 + ![Tools illustration][1] -Rust is an increasingly popular programming language positioned to be the best choice for hardware interfaces. It's often compared to C for its level of abstraction. This article explains how Rust can handle bitwise operations in a number of ways and offers a solution that provides both safety and ease of use. +Rust 是一种日益流行的编程语言,被视为硬件接口的最佳选择。通常会将其与 C 的抽象级别进行比较。本文介绍了 Rust 如何以多种方式处理按位运算,并提供了既安全又易于使用的解决方案。 -Language | Origin | Official description | Overview +语言 | 源自 | 官方说明 | 总览 ---|---|---|--- -C | 1972 | C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. (Source: [CS Fundamentals][2]) | C is [an] imperative language and designed to compile in a relatively straightforward manner which provides low-level access to the memory. (Source: [W3schools.in][3]) -Rust | 2010 | A language empowering everyone to build reliable and efficient software (Source: [Rust website][4]) | Rust is a multi-paradigm system programming language focused on safety, especially safe concurrency. (Source: [Wikipedia][5]) +C | 1972 年 | C 是一种通用编程语言,具有表达式简约、现代的控制流和数据结构,以及丰富的运算符集等特点。(来源:[CS 基础知识] [2])| C 是(一种)命令式语言,旨在以相对简单的方式进行编译,从而提供对内存的低级访问。(来源:[W3schools.in] [3]) +Rust | 2010 年 | 一种使所有人都能构建可靠、高效的软件的语言(来源:[Rust 网站] [4])| Rust 是一种专注于安全性(尤其是安全并发性)的多范式系统编程语言。(来源:[维基百科] [5]) -### Bitwise operation over register values in C +### 在 C 中对寄存器值进行按位运算 -In the world of systems programming, where you may find yourself writing hardware drivers or interacting directly with memory-mapped devices, interaction is almost always done through memory-mapped registers provided by the hardware. You typically interact with these things through bitwise operations on some fixed-width numeric type. - -For instance, imagine an 8-bit register with three fields: +在系统编程领域,你可能经常需要编写硬件驱动程序或直接与内存映射的设备进行交互,而这些交互几乎总是通过硬件提供的内存映射的寄存器来完成的。通常,你通过对某些固定宽度的数字类型进行按位运算来与这些寄存器进行交互。 +例如,假设一个具有三个字段的 8 位寄存器: ``` +----------+------+-----------+---------+ @@ -34,28 +34,25 @@ For instance, imagine an 8-bit register with three fields:    5-7       2-4        1          0 ``` -The number below the field name prescribes the bits used by that field in the register. To enable this register, you would write the value **1**, represented in binary as **0000_0001**, to set the enabled field's bit. Often, though, you also have an existing configuration in the register that you don't want to disturb. Say you want to enable interrupts on the device but also want to be sure the device remains enabled. To do that, you must combine the Interrupt field's value with the Enabled field's value. You would do that with bitwise operations: - +字段名称下方的数字规定了该字段在寄存器中使用的位。要启用该寄存器,你将写入值 `1`(以二进制表示为`0000_0001`)来设置 `Enabled` 字段的位。但是,通常情况下,你也不想干扰寄存器中的现有配置。假设你要在设备上启用中断功能,但也要确保设备保持启用状态。为此,必须将 `Interrupt` 字段的值与 `Enabled` 字段的值结合起来。你可以通过按位操作来做到这一点: ``` -`1 | (1 << 1)` +1 | (1 << 1) ``` -This gives you the binary value **0000_0011** by **or**-ing 1 with 2, which you get by shifting 1 left by 1. You can write this to your register, leaving it enabled but also enabling interrupts. +通过将 1 和 2(左移 `1` 一位得到)进行“或”运算得到二进制值 `0000_0011` 。你可以将其写入寄存器,使其保持启用状态,但也允许中断。 -This is a lot to keep in your head, especially when you're dealing with potentially hundreds of registers for a complete system. In practice, you do this with mnemonics which track a field's position in a register and how wide the field is—i.e., _what's its upper bound?_ - -Here's an example of one of these mnemonics. They are C macros that replace their occurrences with the code on the right-hand side. This is the shorthand for the register laid out above. The left-hand side of the **&** puts you in position for that field, and the right-hand side limits you to only that field's bits: +有很多事情要记住,特别是当你要为一个完整的系统处理可能有数百个之多的寄存器时。实际上,你可以使用助记符来执行此操作,助记符可跟踪字段在寄存器中的位置以及字段的宽度(即它的上边界是什么?) +这是这些助记符之一的示例。它们是 C 语言的宏,用右侧的代码替换它们的出现的地方。这是上面列出的寄存器的简写。`&` 的左侧是该字段的位置,而右侧则限制该字段的位: ``` -#define REG_ENABLED_FIELD(x) (x << 0) & 1 -#define REG_INTERRUPT_FIELD(x) (x << 1) & 2 -#define REG_KIND_FIELD(x) (x << 2) & (7 << 2) +#define REG_ENABLED_FIELD(x) (x << 0) & 1 +#define REG_INTERRUPT_FIELD(x) (x << 1) & 2 +#define REG_KIND_FIELD(x) (x << 2) & (7 << 2) ``` -You'd then use these to abstract over the derivation of a register's value with something like: - +然后,你将使用这些通过类似以下方式来抽象化寄存器值的操作: ``` void set_reg_val(reg* u8, val u8); @@ -65,9 +62,9 @@ fn enable_reg_with_interrupt(reg* u8) { } ``` -This is the state of the art. In fact, this is how the bulk of drivers appear in the Linux kernel. +这就是现在的做法。实际上,这就是大多数驱动程序出现在 Linux 内核中的方式。 -Is there a better way? Consider the boon to safety and expressibility if the type system was borne out of research on modern programming languages. That is, what could you do with a richer, more expressive type system to make this process safer and more tenable? +有没有更好的办法?如果能够基于对现代编程语言研究得出新的类型系统,就可能能够获得安全性和可表达性的好处。也就是说,如何使用更丰富、更具表现力的类型系统来使此过程更安全、更持久? ### Bitwise operation over register values in Rust @@ -114,7 +111,7 @@ impl Field { } ``` -Finally, you'll use a **Register** type, which wraps around a numeric type that matches the width of your register. **Register** has an **update** function that updates the register with the given field: +Finally, you'll use a `Register` type, which wraps around a numeric type that matches the width of your register. `Register` has an `update` function that updates the register with the given field: ``` @@ -139,7 +136,7 @@ The first rewrite in Rust is nice, but it's not ideal. You have to remember to b Second, thinking more structurally: What if there were a way to have the field's type carry the mask and offset information? What if you could catch mistakes in your implementation for how you access and interact with hardware registers at compile time instead of discovering them at runtime? Perhaps you can lean on one of the strategies commonly used to suss out issues at compile time, like types. -You can modify the earlier example by using [**typenum**][6], a library that provides numbers and arithmetic at the type level. Here, you'll parameterize the **Field** type with its mask and offset, making it available for any instance of **Field** without having to include it at the call site: +You can modify the earlier example by using [`typenum`][6], a library that provides numbers and arithmetic at the type level. Here, you'll parameterize the `Field` type with its mask and offset, making it available for any instance of `Field` without having to include it at the call site: ``` @@ -164,7 +161,7 @@ type RegInterrupt = Field<U2, U1>; type RegKind = Field<op!(U7 << U2), U2>; ``` -Now, when revisiting **Field**'s constructor, you can elide the mask and offset parameters because the type contains that information: +Now, when revisiting `Field`'s constructor, you can elide the mask and offset parameters because the type contains that information: ``` @@ -184,7 +181,7 @@ fn enable_register(&mut reg) { } ``` -It looks pretty good, but… what happens when you make a mistake regarding whether a given value will _fit_ into a field? Consider a simple typo where you put **10** instead of **1**: +It looks pretty good, but… what happens when you make a mistake regarding whether a given value will _fit_ into a field? Consider a simple typo where you put `10` instead of `1`: ``` @@ -193,13 +190,13 @@ fn enable_register(&mut reg) { } ``` -In the code above, what is the expected outcome? Well, the code will set that enabled bit to 0 because **10 & 1 = 0**. That's unfortunate; it would be nice to know whether a value you're trying to write into a field will fit into the field before attempting a write. As a matter of fact, I'd consider lopping off the high bits of an errant field value _undefined behavior_ (gasps). +In the code above, what is the expected outcome? Well, the code will set that enabled bit to 0 because `10 & 1 = 0`. That's unfortunate; it would be nice to know whether a value you're trying to write into a field will fit into the field before attempting a write. As a matter of fact, I'd consider lopping off the high bits of an errant field value _undefined behavior_ (gasps). ### Using Rust with safety in mind How can you check that a field's value fits in its prescribed position in a general way? More type-level numbers! -You can add a **Width** parameter to **Field** and use it to verify that a given value can fit into the field: +You can add a `Width` parameter to `Field` and use it to verify that a given value can fit into the field: ``` @@ -230,11 +227,11 @@ impl<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> Field<Width, Ma } ``` -Now you can construct a **Field** only if the given value fits! Otherwise, you have **None**, which signals that an error has occurred, rather than lopping off the high bits of the value and silently writing an unexpected value. +Now you can construct a `Field` only if the given value fits! Otherwise, you have `None`, which signals that an error has occurred, rather than lopping off the high bits of the value and silently writing an unexpected value. Note, though, this will raise an error at runtime. However, we knew the value we wanted to write beforehand, remember? Given that, we can teach the compiler to reject entirely a program which has an invalid field value—we don’t have to wait until we run it! -This time, you'll add a _trait bound_ (the **where** clause) to a new realization of new, called **new_checked**, that asks the incoming value to be less than or equal to the maximum possible value a field with the given **Width** can hold: +This time, you'll add a _trait bound_ (the `where` clause) to a new realization of new, called `new_checked`, that asks the incoming value to be less than or equal to the maximum possible value a field with the given `Width` can hold: ``` @@ -278,7 +275,7 @@ fn enable_register(&mut reg) {            found type `typenum::B1` ``` -**new_checked** will fail to produce a program that has an errant too-high value for a field. Your typo won't blow up at runtime because you could never have gotten an artifact to run. +`new_checked` will fail to produce a program that has an errant too-high value for a field. Your typo won't blow up at runtime because you could never have gotten an artifact to run. You're nearing Peak Rust in terms of how safe you can make memory-mapped hardware interactions. However, what you wrote back in the first example in C was far more succinct than the type parameter salad you ended up with. Is doing such a thing even tractable when you're talking about potentially hundreds or even thousands of registers? @@ -311,7 +308,7 @@ register! { } ``` -From this, you can generate register and field types like the previous example where the indices—the **Width**, **Mask**, and **Offset**—are derived from the values input in the **WIDTH** and **OFFSET** sections of a field's definition. Also, notice that all of these numbers are **typenums**; they're going to go directly into your **Field** definitions! +From this, you can generate register and field types like the previous example where the indices—the `Width`, `Mask`, and `Offset`—are derived from the values input in the `WIDTH` and `OFFSET` sections of a field's definition. Also, notice that all of these numbers are `typenums`; they're going to go directly into your `Field` definitions! The generated code provides namespaces for registers and their associated fields through the name given for the register and the fields. That's a mouthful; here's what it looks like: @@ -341,7 +338,7 @@ What does it look like to use these definitions for a real device? Will the code No! By using type synonyms and type inference, you effectively never have to think about the type-level part of the program at all. You get to interact with the hardware in a straightforward way and get those bounds-related assurances automatically. -Here's an example of a [UART][10] register block. I'll skip the declaration of the registers themselves, as that would be too much to include here. Instead, it starts with a register "block" then helps the compiler know how to look up the registers from a pointer to the head of the block. We do that by implementing **Deref** and **DerefMut**: +Here's an example of a [UART][10] register block. I'll skip the declaration of the registers themselves, as that would be too much to include here. Instead, it starts with a register "block" then helps the compiler know how to look up the registers from a pointer to the head of the block. We do that by implementing `Deref` and `DerefMut`: ``` @@ -373,7 +370,7 @@ impl DerefMut for Regs { } ``` -Once this is in place, using these registers is as simple as **read()** and **modify()**: +Once this is in place, using these registers is as simple as `read()` and `modify()`: ``` @@ -398,7 +395,7 @@ fn main() { } ``` -When we're working with runtime values we use **Option** like we saw earlier. Here I'm using **unwrap**, but in a real program with unknown inputs, you'd probably want to check that you got a **Some** back from that new call:[1][11],[2][12] +When we're working with runtime values we use `Option` like we saw earlier. Here I'm using `unwrap`, but in a real program with unknown inputs, you'd probably want to check that you got a `Some` back from that new call:[1][11],[2][12] ``` @@ -434,9 +431,9 @@ error[E0271]: type mismatch resolving `<typenum::UInt<typenum::UInt<typ        found type `typenum::B1` ``` -The **expected typenum::B0 found typenum::B1** part kind of makes sense, but what on earth is the **typenum::UInt<typenum::UInt, typenum::UInt…** nonsense? Well, **typenum** represents numbers as binary [cons][13] cells! Errors like this make it hard, especially when you have several of these type-level numbers confined to tight quarters, to know which number it's talking about. Unless, of course, it's second nature for you to translate baroque binary representations to decimal ones. +The `expected typenum::B0 found typenum::B1` part kind of makes sense, but what on earth is the `typenum::UInt<typenum::UInt, typenum::UInt…` nonsense? Well, `typenum` represents numbers as binary [cons][13] cells! Errors like this make it hard, especially when you have several of these type-level numbers confined to tight quarters, to know which number it's talking about. Unless, of course, it's second nature for you to translate baroque binary representations to decimal ones. -After the **U100**th time attempting to decipher any meaning from this mess, a teammate got Mad As Hell And Wasn't Going To Take It Anymore and made a little utility, **tnfilt**, to parse the meaning out from the misery that is namespaced binary cons cells. **tnfilt** takes the cons cell-style notation and replaces it with sensible decimal numbers. We imagine that others will face similar difficulties, so we shared [**tnfilt**][14]. You can use it like this: +After the `U100`th time attempting to decipher any meaning from this mess, a teammate got Mad As Hell And Wasn't Going To Take It Anymore and made a little utility, `tnfilt`, to parse the meaning out from the misery that is namespaced binary cons cells. `tnfilt` takes the cons cell-style notation and replaces it with sensible decimal numbers. We imagine that others will face similar difficulties, so we shared [`tnfilt`][14]. You can use it like this: ``` @@ -454,22 +451,22 @@ Now _that_ makes sense! ### In conclusion -Memory-mapped registers are used ubiquitously when interacting with hardware from software, and there are myriad ways to portray those interactions, each of which has a different place on the spectra of ease-of-use and safety. We found that the use of type-level programming to get compile-time checking on memory-mapped register interactions gave us the necessary information to make safer software. That code is available in the **[bounded-registers][15] crate** (Rust package). +Memory-mapped registers are used ubiquitously when interacting with hardware from software, and there are myriad ways to portray those interactions, each of which has a different place on the spectra of ease-of-use and safety. We found that the use of type-level programming to get compile-time checking on memory-mapped register interactions gave us the necessary information to make safer software. That code is available in the `[bounded-registers][15] crate` (Rust package). -Our team started out right at the edge of the more-safe side of that safety spectrum and then tried to figure out how to move the ease-of-use slider closer to the easy end. From those ambitions, **bounded-registers** was born, and we use it anytime we encounter memory-mapped devices in our adventures at Auxon. +Our team started out right at the edge of the more-safe side of that safety spectrum and then tried to figure out how to move the ease-of-use slider closer to the easy end. From those ambitions, `bounded-registers` was born, and we use it anytime we encounter memory-mapped devices in our adventures at Auxon. * * * - 1. Technically, a read from a register field, by definition, will only give a value within the prescribed bounds, but none of us lives in a pure world, and you never know what's going to happen when external systems come into play. You're at the behest of the Hardware Gods here, so instead of forcing you into a "might panic" situation, it gives you the **Option** to handle a "This Should Never Happen" case. + 1. Technically, a read from a register field, by definition, will only give a value within the prescribed bounds, but none of us lives in a pure world, and you never know what's going to happen when external systems come into play. You're at the behest of the Hardware Gods here, so instead of forcing you into a "might panic" situation, it gives you the `Option` to handle a "This Should Never Happen" case. - 2. **get_field** looks a little weird. I'm looking at the **Field::Read** part, specifically. **Field** is a type, and you need an instance of that type to pass to **get_field**. A cleaner API might be something like: + 2. `get_field` looks a little weird. I'm looking at the `Field::Read` part, specifically. `Field` is a type, and you need an instance of that type to pass to `get_field`. A cleaner API might be something like: ``` `regs.rx.get_field::();` ``` -But remember that **Field** is a type synonym that has fixed indices for width, offset, etc. To be able to parameterize **get_field** like this, you'd need higher-kinded types. +But remember that `Field` is a type synonym that has fixed indices for width, offset, etc. To be able to parameterize `get_field` like this, you'd need higher-kinded types. From 231f5085971e304cf3ec05e0f5688cbcba1044eb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 17:28:59 +0800 Subject: [PATCH 002/285] PART 2 --- ...e for programming hardware abstractions.md | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index a7aecd1397..5e5d33f4a7 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -21,7 +21,7 @@ Rust 是一种日益流行的编程语言,被视为硬件接口的最佳选择 C | 1972 年 | C 是一种通用编程语言,具有表达式简约、现代的控制流和数据结构,以及丰富的运算符集等特点。(来源:[CS 基础知识] [2])| C 是(一种)命令式语言,旨在以相对简单的方式进行编译,从而提供对内存的低级访问。(来源:[W3schools.in] [3]) Rust | 2010 年 | 一种使所有人都能构建可靠、高效的软件的语言(来源:[Rust 网站] [4])| Rust 是一种专注于安全性(尤其是安全并发性)的多范式系统编程语言。(来源:[维基百科] [5]) -### 在 C 中对寄存器值进行按位运算 +### 在 C 语言中对寄存器值进行按位运算 在系统编程领域,你可能经常需要编写硬件驱动程序或直接与内存映射的设备进行交互,而这些交互几乎总是通过硬件提供的内存映射的寄存器来完成的。通常,你通过对某些固定宽度的数字类型进行按位运算来与这些寄存器进行交互。 @@ -66,10 +66,9 @@ fn enable_reg_with_interrupt(reg* u8) { 有没有更好的办法?如果能够基于对现代编程语言研究得出新的类型系统,就可能能够获得安全性和可表达性的好处。也就是说,如何使用更丰富、更具表现力的类型系统来使此过程更安全、更持久? -### Bitwise operation over register values in Rust - -Continuing with the register above as an example: +### 在 Rust 语言中对寄存器值进行按位运算 +继续用上面的寄存器作为例子: ``` +----------+------+-----------+---------+ @@ -78,10 +77,9 @@ Continuing with the register above as an example:    5-7       2-4        1          0 ``` -How might you want to express such a thing in Rust types? - -You'll start in a similar way, by defining constants for each field's _offset_—that is, how far it is from the least significant bit—and its mask. A _mask_ is a value whose binary representation can be used to update or read the field from inside the register: +你可能想如何用 Rust 类型来表示它? +你将以类似的方式开始,为每个字段的*偏移*定义常量(即,距最低有效位有多远)及其掩码。*掩码*是一个值,其二进制表示形式可用于更新或读取寄存器内部的字段: ``` const ENABLED_MASK: u8 = 1; @@ -90,45 +88,43 @@ const ENABLED_OFFSET: u8 = 0; const INTERRUPT_MASK: u8 = 2; const INTERRUPT_OFFSET: u8 = 1; -const KIND_MASK: u8 = 7 << 2; +const KIND_MASK: u8 = 7 << 2; const KIND_OFFSET: u8 = 2; ``` -Next, you'll declare a field type and do your operations to convert a given value into its position-relevant value for use inside the register: - +接下来,你将声明一个 `Field` 类型,并进行操作以将给定值转换为与其位置相关的值以供在寄存器内使用: ``` struct Field { -    value: u8, + value: u8, } impl Field { -    fn new(mask: u8, offset: u8, val: u8) -> Self { -        Field { -            value: (val << offset) & mask, -        } -    } + fn new(mask: u8, offset: u8, val: u8) -> Self { + Field { + value: (val << offset) & mask, + } + } } ``` -Finally, you'll use a `Register` type, which wraps around a numeric type that matches the width of your register. `Register` has an `update` function that updates the register with the given field: - +最后,你将使用一个 `Register` 类型,该类型会封装一个与你的寄存器宽度匹配的数字类型。 `Register` 具有 `update` 函数,可使用给定字段来更新寄存器: ``` struct Register(u8); impl Register { -    fn update(&mut self, val: Field) { -        self.0 = self.0 | field.value; -    } + fn update(&mut self, val: Field) { + self.0 = self.0 | field.value; + } } -fn enable_register(&mut reg) { -    reg.update(Field::new(ENABLED_MASK, ENABLED_OFFSET, 1)); +fn enable_register(&mut reg) { + reg.update(Field::new(ENABLED_MASK, ENABLED_OFFSET, 1)); } ``` -With Rust, you can use data structures to represent fields, attach them to specific registers, and provide concise and sensible ergonomics while interacting with the hardware. This example uses the most basic facilities provided by Rust; regardless, the added structure alleviates some of the density from the C example above. Now a field is a named thing, not a number derived from shadowy bitwise operators, and registers are types with state—one extra layer of abstraction over the hardware. +使用 Rust,你可以使用数据结构来表示字段,将它们附加到特定的寄存器,并在与硬件交互时提供简洁明了的人机工程学。这个例子使用了 Rust 提供的最基本的功能。无论如何,添加的结构都会减轻上述 C 示例中的某些密度。现在,字段是个已命名的事物,而不是从模糊的按位运算符派生而来的数字,并且寄存器是具有状态的类型 —— 这在硬件上多了一层抽象。 ### A Rust implementation for ease of use From 2bc97881fa69499253c6258973c0ca6cf709742e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 22:44:12 +0800 Subject: [PATCH 003/285] PART 3 --- ...e for programming hardware abstractions.md | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index 5e5d33f4a7..fc7077f3c2 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -126,14 +126,13 @@ fn enable_register(&mut reg) { 使用 Rust,你可以使用数据结构来表示字段,将它们附加到特定的寄存器,并在与硬件交互时提供简洁明了的人机工程学。这个例子使用了 Rust 提供的最基本的功能。无论如何,添加的结构都会减轻上述 C 示例中的某些密度。现在,字段是个已命名的事物,而不是从模糊的按位运算符派生而来的数字,并且寄存器是具有状态的类型 —— 这在硬件上多了一层抽象。 -### A Rust implementation for ease of use +### 一个易用的 Rust 实现 -The first rewrite in Rust is nice, but it's not ideal. You have to remember to bring the mask and offset, and you're calculating them ad hoc, by hand, which is error-prone. Humans aren't great at precise and repetitive tasks—we tend to get tired or lose focus, and this leads to mistakes. Transcribing the masks and offsets by hand, one register at a time, will almost certainly end badly. This is the kind of task best left to a machine. +用 Rust 重写的第一个版本很好,但是并不理想。你必须记住要带上掩码和偏移量,并且要手工进行临时计算,这容易出错。人类不擅长精确且重复的任务 —— 我们往往会感到疲劳或失去专注力,这会导致错误。一次一个寄存器地手动记录掩码和偏移量几乎可以肯定会很糟糕。这是最好留给机器的任务。 -Second, thinking more structurally: What if there were a way to have the field's type carry the mask and offset information? What if you could catch mistakes in your implementation for how you access and interact with hardware registers at compile time instead of discovering them at runtime? Perhaps you can lean on one of the strategies commonly used to suss out issues at compile time, like types. - -You can modify the earlier example by using [`typenum`][6], a library that provides numbers and arithmetic at the type level. Here, you'll parameterize the `Field` type with its mask and offset, making it available for any instance of `Field` without having to include it at the call site: +其次,从结构上进行思考:如果有一种方法可以让字段的类型携带掩码和偏移信息呢?如果你要在访问硬件寄存器并与之交互的实现过程中就能发现错误,而不是在运行时才发现,该怎么办?也许你可以依靠一种通常用于在编译时解决问题的策略,例如类型。 +你可以使用 [typenum][6] 来修改前面的示例,该库在类型级别提供数字和算术。在这里,你将使用掩码和偏移量对 `Field` 类型进行参数化,使其可用于任何 `Field` 实例,而不必在调用站点中将其包括在内: ``` #[macro_use] @@ -144,49 +143,47 @@ use core::marker::PhantomData; use typenum::*; // Now we'll add Mask and Offset to Field's type -struct Field<Mask: Unsigned, Offset: Unsigned> { -    value: u8, -    _mask: PhantomData<Mask>, -    _offset: PhantomData<Offset>, +struct Field { + value: u8, + _mask: PhantomData, + _offset: PhantomData, } // We can use type aliases to give meaningful names to // our fields (and not have to remember their offsets and masks). -type RegEnabled = Field<U1, U0>; -type RegInterrupt = Field<U2, U1>; -type RegKind = Field<op!(U7 << U2), U2>; +type RegEnabled = Field; +type RegInterrupt = Field; +type RegKind = Field; ``` -Now, when revisiting `Field`'s constructor, you can elide the mask and offset parameters because the type contains that information: - +现在,当重新访问 `Field` 的构造函数时,你可以忽略掩码和偏移量参数,因为类型中包含该信息: ``` -impl<Mask: Unsigned, Offset: Unsigned> Field<Mask, Offset> { -    fn new(val: u8) -> Self { -        Field { -            value: (val << Offset::U8) & Mask::U8, -            _mask: PhantomData, -            _offset: PhantomData, -        } -    } +impl Field { + fn new(val: u8) -> Self { + Field { + value: (val << Offset::U8) & Mask::U8, + _mask: PhantomData, + _offset: PhantomData, + } + } } // And to enable our register... -fn enable_register(&mut reg) { -    reg.update(RegEnabled::new(1)); +fn enable_register(&mut reg) { + reg.update(RegEnabled::new(1)); } ``` -It looks pretty good, but… what happens when you make a mistake regarding whether a given value will _fit_ into a field? Consider a simple typo where you put `10` instead of `1`: - +看起来不错,但是……如果你对给定的值是否*适合*某个字段犯了错误,会发生什么?考虑一个简单的输入错误,你在其中放置了 `10` 而不是 `1`: ``` -fn enable_register(&mut reg) { +fn enable_register(&mut reg) {     reg.update(RegEnabled::new(10)); } ``` -In the code above, what is the expected outcome? Well, the code will set that enabled bit to 0 because `10 & 1 = 0`. That's unfortunate; it would be nice to know whether a value you're trying to write into a field will fit into the field before attempting a write. As a matter of fact, I'd consider lopping off the high bits of an errant field value _undefined behavior_ (gasps). +在上面的代码中,预期结果是什么?好吧,代码会将启用位设置为 0,因为 `10&1 = 0`。那真不幸;最好在尝试写入之前知道你要写入字段的值是否适合该字段。事实上,我会考虑放弃错误字段值的高位*未定义行为*(喘气)。 ### Using Rust with safety in mind From e4b485d5b8bc22d41f664be5567e8b4a67ce71ac Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 20 Jan 2020 00:52:18 +0800 Subject: [PATCH 004/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200119=20Open?= =?UTF-8?q?=20source=20fights=20cancer,=20Tesla=20adopts=20Coreboot,=20Ube?= =?UTF-8?q?r=20and=20Lyft=20release=20open=20source=20machine=20learning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md --- ...ft release open source machine learning.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md diff --git a/sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md b/sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md new file mode 100644 index 0000000000..90b5c18537 --- /dev/null +++ b/sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning) +[#]: via: (https://opensource.com/article/20/1/news-january-19) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning +====== +Catch up on the biggest open source headlines from the past two weeks. +![Weekly news roundup with TV][1] + +In this edition of our open source news roundup, we take a look machine learning tools from Uber and Lyft, open source software to fight cancer, saving students money with open textbooks, and more! + +### Uber and Lyft release machine learning tools + +It's hard to a growing company these days that doesn't take advantage of machine learning to streamline its business and make sense of the data it amasses. Ridesharing companies, which gather massive amounts of data, have enthusiastically embraced the promise of machine learning. Two of the biggest players in the ridesharing sector have made some of their machine learning code open source. + +Uber recently [released the source code][2] for its Manifold tool for debugging machine learning models. According to Uber software engineer Lezhi Li, Manifold will "benefit the machine learning (ML) community by providing interpretability and debuggability for ML workflows." If you're interested, you can browse Manifold's source code [on GitHub][3]. + +Lyft has also upped its open source stakes by releasing Flyte. Flyte, whose source code is [available on GitHub][4], manages machine learning pipelines and "is an essential backbone to (Lyft's) operations." Lyft has been using it to train AI models and process data "across pricing, logistics, mapping, and autonomous projects." + +### Software to detect cancer cells + +In a study recently published in _Nature Biotechnology_, a team of medical researchers from around the world announced [new open source software][5] that "could make it easier to create personalised cancer treatment plans." + +The software assesses "the proportion of cancerous cells in a tumour sample" and can help clinicians "judge the accuracy of computer predictions and establish benchmarks" across tumor samples. Maxime Tarabichi, one of the lead authors of [the study][6], said that the software "provides a foundation which will hopefully become a much-needed, unbiased, gold-standard benchmarking tool for assessing models that aim to characterise a tumour’s genetic diversity." + +### University of Regina saves students over $1 million with open textbooks + +If rising tuition costs weren't enough to send university student spiralling into debt, the high prices of textbooks can deepen the crater in their bank accounts. To help ease that financial pain, many universities turn to open textbooks. One of those schools is the University of Regina. By offering open text books, the university [expects to save a huge amount for students][7] over the next five years. + +The expected savings are in the region of $1.5 million (CAD), or around $1.1 million USD (at the time of writing). The textbooks, according to a report by radio station CKOM, are "provided free for (students) and they can be printed off or used as e-books." Students aren't getting inferior-quality textbooks, though. Nilgun Onder of the University of Regina said that the "textbooks and other open education resources the university published are all peer-reviewed resources. In other words, they are reliable and credible." + +### Tesla adopts Coreboot + +Much of the software driving (no pun intended) the electric vehicles made by Tesla Motors is open source. So it's not surprising to learn that the company has [adopted Coreboot][8] "as part of their electric vehicle computer systems." + +Coreboot was developed as a replacement for proprietary BIOS and is used to boot hardware and the Linux kernel. The code, which is in [Tesla's GitHub repository][9], "is from Tesla Motors and Samsung," according to Phoronix. Samsung, in case you're wondering, makes the chip on which Tesla's self-driving software runs. + +#### In other news + + * [Arduino launches new modular platform for IoT development][10] + * [SUSE and Karunya Institute of Technology and Sciences collaborate to enhance cloud and open source learning][11] + * [How open-source code could help us survive natural disasters][12] + * [The hottest thing in robotics is an open source project you've never heard of][13] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week. Make sure to check out [our event calendar][14], to see what's happening next week in open source._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/news-january-19 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV) +[2]: https://venturebeat.com/2020/01/07/uber-open-sources-manifold-a-visual-tool-for-debugging-ai-models/ +[3]: https://github.com/uber/manifold +[4]: https://github.com/lyft/flyte +[5]: https://www.cbronline.com/industry/healthcare/open-source-cancer-cells/ +[6]: https://www.nature.com/articles/s41587-019-0364-z +[7]: https://www.ckom.com/2020/01/07/open-source-program-to-save-u-of-r-students-1-5m/ +[8]: https://www.phoronix.com/scan.php?page=news_item&px=Tesla-Uses-Coreboot +[9]: https://github.com/teslamotors/coreboot +[10]: https://techcrunch.com/2020/01/07/arduino-launches-a-new-modular-platform-for-iot-development/ +[11]: https://www.crn.in/news/suse-and-karunya-institute-of-technology-and-sciences-collaborate-to-enhance-cloud-and-open-source-learning/ +[12]: https://qz.com/1784867/open-source-data-could-help-save-lives-during-natural-disasters/ +[13]: https://www.techrepublic.com/article/the-hottest-thing-in-robotics-is-an-open-source-project-youve-never-heard-of/ +[14]: https://opensource.com/resources/conferences-and-events-monthly From 88fee6a70e2880ae72b19f57f360b5189bf7fda8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 20 Jan 2020 00:52:50 +0800 Subject: [PATCH 005/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200119=20One=20?= =?UTF-8?q?open=20source=20chat=20tool=20to=20rule=20them=20all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200119 One open source chat tool to rule them all.md --- ... open source chat tool to rule them all.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20200119 One open source chat tool to rule them all.md diff --git a/sources/tech/20200119 One open source chat tool to rule them all.md b/sources/tech/20200119 One open source chat tool to rule them all.md new file mode 100644 index 0000000000..963b7246d0 --- /dev/null +++ b/sources/tech/20200119 One open source chat tool to rule them all.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (One open source chat tool to rule them all) +[#]: via: (https://opensource.com/article/20/1/open-source-chat-tool) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +One open source chat tool to rule them all +====== +BitlBee brings multiple chat applications into a single interface. Find +out how to set up and use BitlBee in the ninth in our series on 20 ways +to be more productive with open source in 2020. +![Person using a laptop][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Bring all your chats into one interface with BitlBee + +Instant messaging and chat have become a staple of the online world. And if you are like me, you probably have about five or six different apps running to talk to your friends, co-workers, and others. It really is a pain to keep up with it all. Thankfully, you can use one app (OK, two apps) to consolidate a lot of those chats into a single point. + +![BitlBee on XChat][2] + +[BitlBee][3] is an application that you run as a service that can bridge a standard IRC client with a whole bunch of messaging services. And since it is essentially an IRC server, you have a wealth of clients to choose from. + +BitlBee is included with almost all Linux distributions. Installing on Ubuntu (my Linux desktop of choice) goes something like this: + + +``` +`sudo apt install bitlbee-libpurple` +``` + +On  other distributions, the name of the package may be slightly different, but a search for _bitlbee_ should reveal your options. + +You'll notice I use the libpurple version of BitlBee. This version allows me to use all the protocols available in the [libpurple][4] instant messaging library, which was originally developed for [Pidgin][5]. + +Once the package is installed, the service should start automatically. Now, using an IRC client ([XChat][6] in these pictures), I can connect to the service on port 6667 (the standard IRC port). + +![Initial BitlBee connection][7] + +You will be automatically connected to the control channel **&bitlbee**. This channel is unique to you—every person gets their own on multi-user systems. This is where you can configure the services. + +The full documentation is available at any time by typing **help** in the control channel. Explore here, then register an account on the server with the **register** command. + + +``` +`register ` +``` + +Now, any configuration changes you make on the server—IM accounts, settings, etc.—will be saved when you type **save**. Whenever you connect, use **identify <mypassword>** to connect to your account and load all those settings. + +![purple settings][8] + +The command **help purple** will show you all the available protocols that libpurple provides. For example, I've installed the [**telegram-purple**][9] package, which adds the ability to connect to Telegram. I can add an account by using my phone number with the **account add** command. + + +``` +`account add telegram +15555555` +``` + +BitlBee will show that it has added the account. You can list your accounts with **account list**. Since I only have one account, I can log into it with **account 0 on**, and it will go through the Telegram login process, list all my friends and chats, and I am good to go. + +But what about Slack, one of the most common chat systems out there? Well, you can install the [**slack-libpurple**][10] plugin, and do the same for Slack. If you aren't comfortable compiling and installing things, this may not be for you. + +Follow the instructions on the plugin page, and after you have installed it, restart the BitlBee service. Now when you run **help purple**, Slack should be listed. Adding a Slack account happens the same as with all the other protocols. + + +``` +account add slack [ksonney@myslack.slack.com][11] +account 1 set password my_legcay_API_token +account 1 on +``` + +And what do you know? You're connected to Slack, and you can add the Slack channels you're interested in with the **chat add** command. For example: + + +``` +`chat add 1 happyparty` +``` + +adds the Slack channel happyparty as the local channel #happyparty. You can use the standard IRC **/join** command to access the channel now. Pretty cool. + +BitlBee and an IRC client help me keep (most of) my chats and instant messages in a single place and reduces my distractions because I no longer have to find and switch to whichever app just pinged me. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-chat-tool + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/uploads/productivity_9-1.png (BitlBee on XChat) +[3]: https://www.bitlbee.org/ +[4]: https://developer.pidgin.im/wiki/WhatIsLibpurple +[5]: http://pidgin.im/ +[6]: http://xchat.org/ +[7]: https://opensource.com/sites/default/files/uploads/productivity_9-2.png (Initial BitlBee connection) +[8]: https://opensource.com/sites/default/files/uploads/productivity_9-3.png (purple settings) +[9]: https://github.com/majn/telegram-purple +[10]: https://github.com/dylex/slack-libpurple +[11]: mailto:ksonney@myslack.slack.com From 0646f033893b79df7806385a8d2e28a03b7495c7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 20 Jan 2020 00:53:17 +0800 Subject: [PATCH 006/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200119=20What's?= =?UTF-8?q?=20your=20favorite=20Linux=20terminal=20trick=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200119 What-s your favorite Linux terminal trick.md --- ...at-s your favorite Linux terminal trick.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200119 What-s your favorite Linux terminal trick.md diff --git a/sources/tech/20200119 What-s your favorite Linux terminal trick.md b/sources/tech/20200119 What-s your favorite Linux terminal trick.md new file mode 100644 index 0000000000..d830c65072 --- /dev/null +++ b/sources/tech/20200119 What-s your favorite Linux terminal trick.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's your favorite Linux terminal trick?) +[#]: via: (https://opensource.com/article/20/1/linux-terminal-trick) +[#]: author: (Opensource.com https://opensource.com/users/admin) + +What's your favorite Linux terminal trick? +====== +Take our poll or tell us about your favorite terminal trick. Is it a +nifty productivity shortcut or a fun Easter egg? +![Terminal command prompt on orange background][1] + +The beginning of a new year is always a great time to evaluate new ways to become more efficient. Many people try out new productivity tools or figure out how to optimize their most mundane processes. One area to assess is the terminal. Especially in the world of open source, there are tons of ways to make life at the terminal more efficient (and fun!) with shortcuts and commands.  + +  + +We asked our writers about their favorite terminal trick. They shared their time-saving tips and even a fun terminal Easter egg. Will you adopt one of these keyboard shortcuts or command line hacks? Do you have a favorite you'd like to share? Tell us about it by taking our poll or leaving a comment.  + +  + +"I couldn't choose a favorite; I use all three of these daily:  + + * **Ctrl + L** to clear screen (instead of typing "clear"). + * **sudo !!** to run previous command with sudo privileges.  + * **grep -Ev '^#|^$' <file>** will display file content without comments or empty lines." + + + +—Mars Toktonaliev + +  + +"For me, if I'm in a terminal text editor and I want to make it go away so I can quickly do something else, I background it with **Ctrl + Z**, do whatever I need to do, and then bring it back with **fg**. I will also sometimes do the same thing with **top** or **htop.** I can background it, and bring it back anytime I want to check current performance. I don't see backgrounding and foregrounding done in the wild very often, and it can really enhance multitasking on the terminal." + +—Jay LaCroix + +  + +"Because I tend to do much of the same things at the terminal on a given day, two things are constants in my day: + + * **Ctrl + R** to reverse search my Bash history for a command that I have already run and wish to do so again + * Caret substitution is the best as I often do things like **sudo dnf** **search <package name>** then if I find a suitable package that way I then do **^search^install** to rerun the command replacing the search with install. + + + +Sure these things are basic but so time-saving for me." + +—Steve Morris + +  + +"My cool terminal trick isn't something I do in the terminal, but _which terminal_ I use. Sometimes I just want the feeling of using an Apple II, or an old amber-on-black terminal. That's when I fire up Cool Retro Term. Screenshots are on the [website][2]." + +—Jim Hall + +  + +"Probably **ssh -X** to run graphical programs on other machines. Copy/pasting (on some terminal emulators, like gnome-terminal) C-S c and C-S v. I'm not sure if this counts (as it goes graphical in the interesting part, but starts with **ssh**). Most recently I had a need to log in to another machine but have my kids be able to follow along on the bigger screen from my laptop. This [link][3] showed me something I'd never before seen: mirroring the active session from another computer screen on my laptop over the local network (x11vnc -desktop) and being able to control it from both machines at the same time." + +—Kyle R. Conway + +  + +"You can install **Install 'sl' $ sudo apt install sl** or **$ sudo dnf install sl**, and when the command **sl** is entered at the Bash prompt a text-based steam locomotive moves across the display." + +—Don Watkins + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/linux-terminal-trick + +作者:[Opensource.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/admin +[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://github.com/Swordfish90/cool-retro-term +[3]: https://elinux.org/Screen_Casting_on_a_Raspberry_Pi From 83bbc1f6c15055c19201079e2815ddf305a7b9f6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 20 Jan 2020 21:29:12 +0800 Subject: [PATCH 007/285] Rename sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md to sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md --- ...oreboot, Uber and Lyft release open source machine learning.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md (100%) diff --git a/sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md b/sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md similarity index 100% rename from sources/tech/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md rename to sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md From 4ed6ab3f94245e674639c886748661d821f9cef1 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 20 Jan 2020 21:52:17 +0800 Subject: [PATCH 008/285] translating --- ...nto Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md index 68ede9acfa..a2bca0089f 100644 --- a/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md +++ b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Morisun029) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5845e14467093912b9f002183b4ad6198ce899fe Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 20 Jan 2020 21:56:18 +0800 Subject: [PATCH 009/285] translating --- .../20191227 Top CI-CD resources to set you up for success.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191227 Top CI-CD resources to set you up for success.md b/sources/tech/20191227 Top CI-CD resources to set you up for success.md index 77d2391a5d..d3da7c4d09 100644 --- a/sources/tech/20191227 Top CI-CD resources to set you up for success.md +++ b/sources/tech/20191227 Top CI-CD resources to set you up for success.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Morisun029) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From da2a26b7ada53ddc46d4ac0aed1245559b0104df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Jan 2020 22:38:07 +0800 Subject: [PATCH 010/285] PRF @Morisun029 --- ...4 ways to volunteer this holiday season.md | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/translated/tech/20191220 4 ways to volunteer this holiday season.md b/translated/tech/20191220 4 ways to volunteer this holiday season.md index 47ba22d002..7da97feaf3 100644 --- a/translated/tech/20191220 4 ways to volunteer this holiday season.md +++ b/translated/tech/20191220 4 ways to volunteer this holiday season.md @@ -1,54 +1,52 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 ways to volunteer this holiday season) [#]: via: (https://opensource.com/article/19/12/ways-volunteer) [#]: author: (John Jones https://opensource.com/users/johnjones4) -假期志愿服务的4种方式 +假期志愿服务的 4 种方式 ====== -想要洒播些节日的快乐吗?为开源组织做贡献,帮助有需要的社区。 -![Gift box opens with colors coming out][1] +> 想要洒播些节日的快乐吗?为开源组织做贡献,帮助有需要的社区。 + +![](https://img.linux.net.cn/data/attachment/album/202001/20/223730f7983z8atxp1tf4l.jpg) 当领导者们配置人员和资源以做出积极改变时,就会产生社会影响。但是,许多社会努力都缺乏能够为这些改变者提供服务的技术资源。然而,有些组织通过将想要做出改变的开发人员与迫切需要更好技术的社区和非营利组织联系起来,来促进技术进步。这些组织通常为特定的受众提供服务,并招募特定种类的技术人员,它们有一个共同点:开源。 作为开发人员,我们出于各种原因试图加入开源社区。有些是为了专业发展,有些是为了能够与广阔的网络上令人印象深刻的技术人员合作,还有其他人则是因为他们清楚自己的贡献对于项目的成功的必要性。为什么不将你作为开发人员的才华投入到需要它的地方,而同时又为开源组织做贡献呢?以下组织是实现此目标的一些主要事例。 - - ### Code for America -Code for America 是在数字时代,政府如何依靠人民为人民服务的一个例子。通过其Brigade Network,该组织在美国各个城市中组织了一个由志愿程序员,数据科学家,相关公民和设计师组成的全国联盟。这些本地分支机构定期举行聚会,向社区开放。这样既可以向小组推出新项目,又可以协调正在进行的工作。为了使志愿者与项目相匹配,各网站经常列出项目所需的特定技能,例如数据分析,内容创建和JavaScript。同时,Brigade网站也会关注当地问题,分享自然灾害等共同经验,这些都可以促进成员之间的合作。例如,新奥尔良,休斯敦和坦帕湾团队合作开发了一个飓风响应网站,当灾难发生时,该网站可以快速响应不同的城市灾难情况。 +“Code for America” 是在数字时代,政府如何依靠人民为人民服务的一个例子。通过其 Brigade Network,该组织在美国各个城市中组织了一个由志愿程序员、数据科学家、相关公民和设计师组成的全国联盟。这些本地分支机构定期举行聚会,向社区开放。这样既可以向小组推出新项目,又可以协调正在进行的工作。为了使志愿者与项目相匹配,该网站经常列出项目所需的特定技能,例如数据分析、内容创建和JavaScript。同时,Brigade 网站也会关注当地问题,分享自然灾害等共同经验,这些都可以促进成员之间的合作。例如,新奥尔良、休斯敦和坦帕湾团队合作开发了一个飓风响应网站,当灾难发生时,该网站可以快速响应不同的城市灾难情况。 -想要加入该组织,请访问 [网站][2] 获取70 多个 Brigade 的清单,以及个人加入组织的指南。 +想要加入该组织,请访问 [该网站][2] 获取 70 多个 Brigade 的清单,以及个人加入组织的指南。 ### Code for Change -Code for Change 显示了即使在高中时期,也可以为社会做贡献。印第安纳波利斯的一群高中编码员成立了自己的俱乐部,他们通过创建针对社区问题的开源软件解决方案来回馈当地组织。 Code for Change 鼓励当地组织提出项目构想,学生团体加入并开发完全免费和开源的解决方案。该小组已经开发了诸如“蓝宝石”之类的项目,该项目优化了当地难民组织的志愿者管理系统,并建立了民权委员会的投诉表格,方便公民就他们所关心的问题在网上发表意见。 +“Code for Change” 显示了即使在高中时期,也可以为社会做贡献。印第安纳波利斯的一群高中开发爱好者成立了自己的俱乐部,他们通过创建针对社区问题的开源软件解决方案来回馈当地组织。“Code for Change” 鼓励当地组织提出项目构想,学生团体加入并开发完全自由和开源的解决方案。该小组已经开发了诸如“蓝宝石”之类的项目,该项目优化了当地难民组织的志愿者管理系统,并建立了民权委员会的投诉表格,方便公民就他们所关心的问题在网上发表意见。 -有关如何在你自己的社区中创建 Code for Change,[访问他们的网站][3]. +有关如何在你自己的社区中创建 “Code for Change”,[访问他们的网站][3]。 ### Python for Good/Ruby for Good -Python for Good and Ruby for Good 是在俄勒冈州波特兰市和弗吉尼亚州费尔法克斯市举办的双年展活动,该活动将人们聚集在一起,为各自的社区开发和制定解决方案。 +“Python for Good” 和 “Ruby for Good” 是在俄勒冈州波特兰市和弗吉尼亚州费尔法克斯市举办的双年展活动,该活动将人们聚集在一起,为各自的社区开发和制定解决方案。 -在周末,人们聚在一起聆听当地非营利组织的建议,并通过构建开源解决方案来解决他们的问题。 2017年,Ruby For Good参与者创建了“ Justice for Juniors”,该计划指导当前和以前被监禁的年轻人,并将他们重新融入社区。参与者还创建了“ Diaperbase”,这是一种库存管理系统,已被美国各地的尿布银行使用。这些活动的主要目标之一是将看似不同的行业和思维方式的组织和个人聚集在一起,以谋求共同利益。公司可以赞助活动,非营利组织可以提交项目构想,各种技能的人都可以注册参加活动并做出贡献。通过两岸(美国大西洋和太平洋东西海岸)的努力,Ruby for Good 和Python for Good 一直恪守“使世界变得更好”的座右铭。 +在周末,人们聚在一起聆听当地非营利组织的建议,并通过构建开源解决方案来解决他们的问题。 2017 年,“Ruby For Good” 参与者创建了 “Justice for Juniors”,该计划指导当前和以前被监禁的年轻人,并将他们重新融入社区。参与者还创建了 “Diaperbase”,这是一种库存管理系统,为美国各地的尿布库diaper bank所使用。这些活动的主要目标之一是将看似不同的行业和思维方式的组织和个人聚集在一起,以谋求共同利益。公司可以赞助活动,非营利组织可以提交项目构想,各种技能的人都可以注册参加活动并做出贡献。通过两岸(美国大西洋和太平洋东西海岸)的努力,“Ruby for Good” 和 “Python for Good” 一直恪守“使世界变得更好”的座右铭。 -[Ruby for Good][4] 在夏天举行,举办地点在弗吉尼亚州费尔法克斯的乔治•梅森(George Mason)大学。 +“[Ruby for Good][4]” 在夏天举行,举办地点在弗吉尼亚州费尔法克斯的乔治•梅森大学。 ### Social Coder -英国的Ed Guiness创建了Social Coder,将志愿者和慈善机构召集在一起,为六大洲的非营利组织创建和使用开源项目。 Social Coder积极招募来自世界各地的熟练IT志愿者,并将其与通过Social Coder注册的慈善机构和非营利组织进行匹配。项目范围从简单的网站更新到整个移动应用程序的开发。 +英国的 Ed Guiness 创建了 “Social Coder”,将志愿者和慈善机构召集在一起,为六大洲的非营利组织创建和使用开源项目。“Social Coder” 积极招募来自世界各地的熟练 IT 志愿者,并将其与通过 Social Coder 注册的慈善机构和非营利组织进行匹配。项目范围从简单的网站更新到整个移动应用程序的开发。 -例如,PHASE Worldwide 是一个在尼泊尔支持工作的小型非政府组织,因为Social Coder,它获得了利用开源技术的关键支持和专业知识。 +例如,PHASE Worldwide 是一个在尼泊尔支持工作的小型非政府组织,因为 “Social Coder”,它获得了利用开源技术的关键支持和专业知识。 -有许多慈善机构已经与英国的Social Coder进行了合作,也欢迎其它国家的组织加入。通过他们的网站,个人可以注册为社会软件项目工作,找到寻求帮助的组织和慈善机构。 +有许多慈善机构已经与英国的 “Social Coder”进行了合作,也欢迎其它国家的组织加入。通过他们的网站,个人可以注册为社会软件项目工作,找到寻求帮助的组织和慈善机构。 - -对 Social Coder 的志愿服务感兴趣的个人可以 [在此][5]注册. +对 “Social Coder” 的志愿服务感兴趣的个人可以 [在此][5]注册. -------------------------------------------------------------------------------- @@ -57,8 +55,8 @@ via: https://opensource.com/article/19/12/ways-volunteer 作者:[John Jones][a] 选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6e35d595b911954bc6b28d164dee3e9832a37551 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Jan 2020 22:39:44 +0800 Subject: [PATCH 011/285] PUB @Morisun029 https://linux.cn/article-11803-1.html --- .../20191220 4 ways to volunteer this holiday season.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191220 4 ways to volunteer this holiday season.md (98%) diff --git a/translated/tech/20191220 4 ways to volunteer this holiday season.md b/published/20191220 4 ways to volunteer this holiday season.md similarity index 98% rename from translated/tech/20191220 4 ways to volunteer this holiday season.md rename to published/20191220 4 ways to volunteer this holiday season.md index 7da97feaf3..ca2c8fb8e0 100644 --- a/translated/tech/20191220 4 ways to volunteer this holiday season.md +++ b/published/20191220 4 ways to volunteer this holiday season.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11803-1.html) [#]: subject: (4 ways to volunteer this holiday season) [#]: via: (https://opensource.com/article/19/12/ways-volunteer) [#]: author: (John Jones https://opensource.com/users/johnjones4) From fbc71c83a8e9c15a9b84a42c269bdadc43fb1181 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Jan 2020 23:53:43 +0800 Subject: [PATCH 012/285] PRF @geekpi --- ...eep your email in sync with OfflineIMAP.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md b/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md index c5b20565ad..bca35ab20d 100644 --- a/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md +++ b/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Keep your email in sync with OfflineIMAP) @@ -9,21 +9,22 @@ 使用 OfflineIMAP 同步邮件 ====== -将邮件镜像保存到本地是整理消息的第一步。在我们的 20 个使用开源提升生产力的系列的第三篇文章中了解该如何做。 -![email or newsletters via inbox and browser][1] + +> 将邮件镜像保存到本地是整理消息的第一步。在我们的 20 个使用开源提升生产力的系列的第三篇文章中了解该如何做。 + +![](https://img.linux.net.cn/data/attachment/album/202001/20/235324nbgfyuwl98syowta.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 OfflineIMAP 在本地同步你的邮件 -我与邮件之间存在爱恨交织的关系。我喜欢它让我与世界各地的人交流的方式。但是,像你们中的许多人一样,我收到过很多邮件,许多是来自列表中的人,但也有很多垃圾邮件、广告等。这些积累了很多。 +我与邮件之间存在爱恨交织的关系。我喜欢它让我与世界各地的人交流的方式。但是,像你们中的许多人一样,我收到过很多邮件,许多是来自邮件列表的,但也有很多垃圾邮件、广告等。这些积累了很多。 ![The OfflineIMAP "blinkenlights" UI][2] -我尝试过的大多数工具(除了大型提供商外)都可以很好地处理大量邮件,它们都有一个共同点:它们都依赖于以 [Maildir][3] 格式存储的本地邮件副本。这其中最有用的是 [OfflineIMAP][4]。OfflineIMAP 是将 IMAP 邮箱镜像到本地 Maildir 文件夹树的 Python 脚本。我用它来创建邮件的本地副本并使其保持同步。大多数 Linux 发行版都包含它,并且可以通过 Python 的 pip 包管理器获得。 - -示例的最小配置文件是一个很好的模板。首先将其复制到 **~/.offlineimaprc**。我的看起来像这样: +我尝试过的大多数工具(除了大型邮件服务商外)都可以很好地处理大量邮件,它们都有一个共同点:它们都依赖于以 [Maildir][3] 格式存储的本地邮件副本。这其中最有用的是 [OfflineIMAP][4]。OfflineIMAP 是将 IMAP 邮箱镜像到本地 Maildir 文件夹树的 Python 脚本。我用它来创建邮件的本地副本并使其保持同步。大多数 Linux 发行版都包含它,并且可以通过 Python 的 pip 包管理器获得。 +示例的最小配置文件是一个很好的模板。首先将其复制到 `~/.offlineimaprc`。我的看起来像这样: ``` [general] @@ -54,9 +55,9 @@ createfolder = true 我的配置要做的是定义两个仓库:远程 IMAP 服务器和本地 Maildir 文件夹。还有一个**帐户**,告诉 OfflineIMAP 运行时要同步什么。你可以定义链接到不同仓库的多个帐户。除了本地复制外,这还允许你从一台 IMAP 服务器复制到另一台作为备份。 -如果你有很多邮件,那么首次运行 OfflineIMAP 将花费一些时间。但是完成后,下次会花_少得多_的时间。你也可以将 CoffeeIMAP 作为 cron 任务(我的偏好)或作为守护程序在仓库之间不断进行同步。文档涵盖了所有这些内容以及 Gmail 等高级配置选项。 +如果你有很多邮件,那么首次运行 OfflineIMAP 将花费一些时间。但是完成后,下次会花*少得多*的时间。你也可以将 OfflineIMAP 作为 cron 任务(我的偏好)或作为守护程序在仓库之间不断进行同步。其文档涵盖了所有这些内容以及 Gmail 等高级配置选项。 -现在,我的邮件已在本地复制,并有多种工具用来加快搜索、归档和管理邮件的速度。我明天再说。 +现在,我的邮件已在本地复制,并有多种工具用来加快搜索、归档和管理邮件的速度。这些我明天再说。 -------------------------------------------------------------------------------- @@ -65,7 +66,7 @@ via: https://opensource.com/article/20/1/sync-email-offlineimap 作者:[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 ddacd9f1c25e19e14a96c66f3ffc083d136aebc1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Jan 2020 23:54:54 +0800 Subject: [PATCH 013/285] PUB @geekpi https://linux.cn/article-11804-1.html --- .../20200113 Keep your email in sync with OfflineIMAP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200113 Keep your email in sync with OfflineIMAP.md (98%) diff --git a/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md b/published/20200113 Keep your email in sync with OfflineIMAP.md similarity index 98% rename from translated/tech/20200113 Keep your email in sync with OfflineIMAP.md rename to published/20200113 Keep your email in sync with OfflineIMAP.md index bca35ab20d..64ecd19ab6 100644 --- a/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md +++ b/published/20200113 Keep your email in sync with OfflineIMAP.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11804-1.html) [#]: subject: (Keep your email in sync with OfflineIMAP) [#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From b5f17f7093b413d62e7c4919d076d70c5e2e0c54 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Jan 2020 00:53:02 +0800 Subject: [PATCH 014/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=20Ansibl?= =?UTF-8?q?e=20Automation=20Tool=20Installation,=20Configuration=20and=20Q?= =?UTF-8?q?uick=20Start=20Guide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md --- ...on, Configuration and Quick Start Guide.md | 360 ++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md diff --git a/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md b/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md new file mode 100644 index 0000000000..76cf181ff2 --- /dev/null +++ b/sources/tech/20200121 Ansible Automation Tool Installation, Configuration and Quick Start Guide.md @@ -0,0 +1,360 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ansible Automation Tool Installation, Configuration and Quick Start Guide) +[#]: via: (https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Ansible Automation Tool Installation, Configuration and Quick Start Guide +====== + +There are many automation tools on the market. + +I can name a few of them, and they are widely used by many organizations, such as Puppet, Chef, CFEngine, Foreman, Katello, Saltstock, Space Walk. + +### What Automation Tool Does? + +Automation tools make the life of a Linux administrator much easier by automating routine tasks without human intervention. + +These tools allow users to perform configuration management, application deployment and provisioning. + +### Why do you like Ansible? + +Ansible is an agent-less automation tool that uses SSH to perform all tasks, but others require agents on client nodes. + +### What is Ansible? + +Ansible is an open source, easy-to-use, powerful IT automation tool that performs tasks on client nodes over SSH. + +It is built in Python and is one of the most popular and robust programming languages in the world today’s. + +The Python package is required on both ends to perform all the modules. + +It can configure systems, deploy software, and schedule advanced IT tasks such as continuous deployment or zero downtime rolling updates. + +You can easily perform any kind of automation tasks with simple and complex tasks through Ansible. + +Before you get started, you need to understand some of the Ansible terminology that helps you to make a task easier. + +### How Ansible Works? + +Ansible works by pushing small programs known as ansible modules on the client nodes, and these modules are temporarily stored in the client nodes, which are used to communicate with the Ansible server via a JSON protocol. + +Ansible runs these modules via SSH and remove them when finished. + +Modules are nothing but scripts written in Python, Perl, etc,. + +![][1] + +The control node, which controls the entire functionality of the playbook, including client nodes (hosts). + + * **Control node:** The host you use Ansible to execute tasks on managed nodes. You can have multiple control nodes, but you cannot use a Windows machine as a control node. + * **Managed nodes:** List of hosts configured by the control node + * **Inventory:** A list of hosts managed by the control nodes, these nodes are configured in the **“/etc/ansible/hosts”** file. It contains information about each node, such as an IP address or its hostname, and these nodes can be grouped as needed. + * **Modules:** Each module is used to perform a specific task, which currently supports 3387 modules. + * **ad-hoc:** It allows you to run one task at a time (it uses the **/usr/bin/ansible** binary). + * **Tasks:** There is a list of tasks in each play. Tasks are executed in order, one at a time in the managed nodes. + * **Playbooks:** You can perform multiple tasks simultaneously using playbooks, whereas you can only perform one task using an ad-hoc command. Playbooks are written in YAML and are easy to read (which uses the **/usr/bin/ansible-playbook** binary). In the future we will create an article about playbooks that you can use to perform complex tasks. + + + +### Testing Environment: + +This environment contains one control node (**server.2g.lab**) and three managed nodes (**node1.2g.lab, node2.2g.lab, node3.2g.lab**), all running in the virtual environment with the following operating systems. + +``` ++----------------------+---------------+-------------+---------------+ +| System Purpose | Hostname | IP Address | OS | ++----------------------+---------------+-------------+---------------+ +|Ansible Control Node | server.2g.lab | 192.168.1.7 | Manjaro 18 | +|Managed Node1 | node1.2g.lab | 192.168.1.6 | CentOS7 | +|Managed Node2 | node2.2g.lab | 192.168.1.5 | CentOS8 | +|Managed Node3 | node3.2g.lab | 192.168.1.9 | Ubuntu 18.04 | +|User: daygeek | ++--------------------------------------------------------------------+ +``` + +### Prerequisites: + + * Enable password-less authentication between Ansible control node and managed nodes. + * The control node must be Python 2 (version 2.7) or Python 3 (versions 3.5 and higher). + * The managed node must be Python 2 (version 2.6 or later) or Python 3 (version 3.5 or later). + * If you have SELinux enabled on remote nodes, you will also want to install **libselinux-python** on them before using any copy/file/template related functions in Ansible. + + + +### How to Install the Ansible on Control Node + +The Ansible package is available in the distribution official repository, so you can easily install it. + +For **“Fedora/RHEL 8/CentOS 8”** system, use the **[DNF Command][2]** to install ansible. + +Make a note: You need to enable the **[EPEL repository][3]** on RHEL/CentOS systems because the Ansible package is not available in the distribution official repository. + +``` +$ sudo dnf install ansible +``` + +For **“Debian/Ubuntu”** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install ansible. + +Configure the blow PPA to install the latest stable version of ansible on Ubuntu. + +``` +$ sudo apt update +$ sudo apt install software-properties-common +$ sudo apt-add-repository --yes --update ppa:ansible/ansible +$ sudo apt install ansible +``` + +For Debian system, configure the blow source list: + +``` +$ echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/ansible.list +$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 +$ sudo apt update +$ sudo apt install ansible +``` + +For **“Arch Linux”** based systems, use **[Pacman Command][6]** to install ansible. + +``` +$ sudo pacman -S ansible +``` + +For **“RHEL/CentOS”** systems, use **[YUM Command][7]** to install ansible. + +``` +$ sudo yum install ansible +``` + +For **“openSUSE”** system, use **[Zypper Command][8]** to install ansible. + +``` +$ sudo zypper install ansible +``` + +Alternatively, you can install it using the **[PIP Python package manager][9]** + +``` +$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py +$ sudo python get-pip.py +$ sudo pip install ansible +``` + +Check the version of Ansible installed on the control node as follows: + +``` +$ ansible --version + +ansible 2.9.2 + config file = /etc/ansible/ansible.cfg + configured module search path = ['/home/daygeek/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] + ansible python module location = /usr/lib/python3.8/site-packages/ansible + executable location = /usr/bin/ansible + python version = 3.8.1 (default, Jan 8 2020, 23:09:20) [GCC 9.2.0] +``` + +### How to Install Python Package on Managed Nodes + +Use the following command to install the python package on managed nodes. + +``` +$ sudo yum install -y python +$ sudo dnf install -y python +$ sudo zypper install -y python +$ sudo pacman -S python +$ sudo apt install -y python +``` + +### How to Setup SSH key authentication (Password-less Authentication) on Linux + +Use the following command to create an ssh key, and then copy them to remote machines. + +``` +$ ssh-keygen +$ ssh-copy-id [email protected] +$ ssh-copy-id [email protected] +$ ssh-copy-id [email protected] +``` + +Refer the following article to **[setup SSH key authentication (Password-less Authentication) on Linux][10]** + +### How to Create Ansible Inventory + +Add the list of nodes you want to manage in the **“/etc/ansible/hosts”** file. If you do not find an existing one you can create a new file. This is a sample inventory file for my test environment. + +``` +$ sudo vi /etc/ansible/hosts + +[web] +node1.2g.lab +node2.2g.lab + +[app] +node3.2g.lab +``` + +Let’s see if we can find all hosts using the following command. + +``` +$ ansible all --list-hosts + + hosts (3): + node1.2g.lab + node2.2g.lab + node3.2g.lab +``` + +Run the below command for individual groups. + +``` +$ ansible web --list-hosts + + hosts (2): + node1.2g.lab + node2.2g.lab +``` + +### How to Perform a Task Using the ad-hoc Command + +Once the host inventory validation check is done, you are ready to drive a car. Here you go..! + +**Syntax:** + +``` +ansible [pattern] -m [module] -a "[module options]" + +Details: +======== +ansible: A command +pattern: Enter the entire inventory or a specific group +-m [module]: Run the given module name +-a [module options]: Specify the module arguments +``` + +Use the Ping module to ping all nodes in your inventory: + +``` +$ ansible all -m ping + +node3.2g.lab | SUCCESS => { + "ansible_facts": { + "discovered_interpreter_python": "/usr/bin/python" + }, + "changed": false, + "ping": "pong" +} +node1.2g.lab | SUCCESS => { + "ansible_facts": { + "discovered_interpreter_python": "/usr/bin/python" + }, + "changed": false, + "ping": "pong" +} +node2.2g.lab | SUCCESS => { + "ansible_facts": { + "discovered_interpreter_python": "/usr/libexec/platform-python" + }, + "changed": false, + "ping": "pong" +} +``` + +All systems have given a successful result, nothing has changed, and return `pong’ on success. + +You can get a list of available modules using the following command. + +``` +$ ansible-doc -l +``` + +Currently supports 3387 built-in modules, which will grow with each Ansible release: + +``` +$ ansible-doc -l | wc -l +3387 +``` + +Use the command module to execute commands against all nodes in your inventory: + +``` +$ ansible all -m command -a "uptime" + +node3.2g.lab | CHANGED | rc=0 >> + 18:05:07 up 1:21, 3 users, load average: 0.12, 0.06, 0.01 +node1.2g.lab | CHANGED | rc=0 >> + 06:35:06 up 1:21, 4 users, load average: 0.01, 0.03, 0.05 +node2.2g.lab | CHANGED | rc=0 >> + 18:05:07 up 1:25, 3 users, load average: 0.01, 0.01, 0.00 +``` + +Execute the command module for a specific group. + +To check the memory usage for the **“app”** group. + +``` +$ ansible app -m command -a "free -m" + +node3.2g.lab | CHANGED | rc=0 >> + total used free shared buff/cache available +Mem: 1993 1065 91 6 836 748 +Swap: 1425 0 1424 +``` + +To run the hostnamectl command against the **“web”** group, use the following format. + +``` +$ ansible web -m command -a "hostnamectl" + +node1.2g.lab | CHANGED | rc=0 >> + Static hostname: CentOS7.2daygeek.com + Icon name: computer-vm + Chassis: vm + Machine ID: 002f47b82af248f5be1d67b67e03514c + Boot ID: dc38f9b8089d4b2d9304e526e00c6a8f + Virtualization: kvm + Operating System: CentOS Linux 7 (Core) + CPE OS Name: cpe:/o:centos:centos:7 + Kernel: Linux 3.10.0-957.el7.x86_64 + Architecture: x86-64 +node2.2g.lab | CHANGED | rc=0 >> + Static hostname: node2.2g.lab + Icon name: computer-vm + Chassis: vm + Machine ID: e39e3a27005d44d8bcbfcab201480b45 + Boot ID: 27b46a09dde546da95ace03420fe12cb + Virtualization: oracle + Operating System: CentOS Linux 8 (Core) + CPE OS Name: cpe:/o:centos:centos:8 + Kernel: Linux 4.18.0-80.el8.x86_64 + Architecture: x86-64 +``` + +**Reference:** [Ansible Docs][11] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/ +[3]: https://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-oracle-linux/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[9]: https://www.2daygeek.com/install-pip-manage-python-packages-linux/ +[10]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/ +[11]: https://docs.ansible.com/ansible/latest/user_guide/index.html From dca9fef3e2cdc24a6c88bc731c9f3dc22bded075 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Jan 2020 00:53:39 +0800 Subject: [PATCH 015/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200120=20Learni?= =?UTF-8?q?ng=20about=20Partitions=20and=20How=20to=20Create=20Them=20for?= =?UTF-8?q?=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200120 Learning about Partitions and How to Create Them for Fedora.md --- ...tions and How to Create Them for Fedora.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20200120 Learning about Partitions and How to Create Them for Fedora.md diff --git a/sources/tech/20200120 Learning about Partitions and How to Create Them for Fedora.md b/sources/tech/20200120 Learning about Partitions and How to Create Them for Fedora.md new file mode 100644 index 0000000000..93fa25b3ef --- /dev/null +++ b/sources/tech/20200120 Learning about Partitions and How to Create Them for Fedora.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learning about Partitions and How to Create Them for Fedora) +[#]: via: (https://fedoramagazine.org/learning-about-partitions-and-how-to-create-them-for-fedora/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Learning about Partitions and How to Create Them for Fedora +====== + +![][1] + +Operating system distributions try to craft a one size fits all partition layout for their file systems. Distributions cannot know the details about how your hardware is configured or how you use your system though. Do you have more than one storage drive? If so, you might be able to get a performance benefit by putting the write-heavy partitions (_var_ and _swap_ for example) on a separate drive from the others that tend to be more read-intensive since most drives cannot read and write at the same time. Or maybe you are running a database and have a small solid-state drive that would improve the database’s performance if its files are stored on the SSD. + +The following sections attempt to describe in brief some of the historical reasons for separating some parts of the file system out into separate partitions so that you can make a more informed decision when you install your Linux operating system. + +If you know more (or contradictory) historical details about the partitioning decisions that shaped the Linux operating systems used today, contribute what you know below in the comments section! + +### Common partitions and why or why not to create them + +#### The boot partition + +One of the reasons for putting the ***/*_boot_ directory on a separate partition was to ensure that the boot loader and kernel were located within [the first 1024 cylinders of the disk][2]. Most modern computers do not have the 1024 cylinder restriction. So for most people, this concern is no longer relevant. However, modern UEFI-based computers have [a different restriction][3] that makes it necessary to have a separate partition for the boot loader. UEFI-based computers require that the boot loader ([which can be the Linux kernel directly][4]) be on a FAT-formatted file system. The Linux operating system, however, requires a POSIX-compliant file system that can designate access permissions to individual files. Since [FAT file systems do not support access permissions][5], the boot loader must be on a separate file system than the rest of the operating system on modern UEFI-based computers. A single partition cannot be [formatted][6] with more than one type of file system. + +#### The var partition + +One of the historical reasons for [putting the /var directory on a separate partition][7] was to prevent files that were frequently written to (_/var/log/*_ for example) from filling up the entire drive. Since modern drives tend to be much larger and since other means like [log rotation][8] and [disk quotas][9] are available to manage storage utilization, putting _/var_ on a separate partition may not be necessary. It is much easier to change a disk quota than it is to re-partition a drive. + +Another reason for isolating _/var_ was that file system corruption was much more common in the original version of the Linux [Extended File System (EXT)][10]. The file systems that had more write activity were much more likely to be irreversibly corrupted by a power outage than those that did not. By partitioning the disk into separate file systems, one could limit the scope of the damage in the event of file system corruption. This concern is no longer as significant because modern file systems support [journaling][11]. + +#### The home partition + +Having ***/*_home_ on a separate partition makes it possible to re-format the other partitions without overwriting your home directories. However, because modern Linux distributions are much better at doing in-place operating system upgrades, re-formatting shouldn’t be needed as frequently as it might have been in the past. + +It can still be useful to have _/home_ on a separate partition if you have a dual-boot setup and want both operating systems to share the same home directories. Or if your operating system is installed on a file system that supports snapshots and rollbacks and you want to be able to rollback your operating system to an older snapshot without reverting the content in your user profiles. Even then, some file systems allow their descendant file systems to be rolled back independently, so it still may not be necessary to have a separate partition for _/home_. On ZFS, for example, one pool/partition can have multiple descendant file systems. + +#### The swap partition + +The _swap_ partition reserves space for the contents of RAM to be written to permanent storage. There are pros and cons to having a swap partition. A pro of having swap memory is that it theoretically gives you time to gracefully shutdown unneeded applications before [the OOM killer][12] takes matters into its own hands. This might be important if the system is running mission-critical software that you don’t want abruptly terminated. A con might be that your system runs so slow when it starts swapping memory to disk that you’d rather the OOM killer take care of the problem for you. + +Another use for swap memory is [hibernation mode][13]. This might be where the rule that the swap partition should be twice the size of your computer’s RAM originated. Ideally, you should be able to put a system into hibernation even if nearly all of its RAM is in use. Beware that Linux’s support for hibernation is not perfect. It is not uncommon that after a Linux system is resumed from hibernation some hardware devices are left in an inoperable state (for example, no video from the video card or no internet from the WiFi card). + +In any case, having a swap partition is more a matter of taste. It is not required. + +#### The root partition + +The _root_ partition (/) is the catch-all for all directories that have not been assigned to a separate partition. There is always at least one root partition. BIOS-based systems that are new enough to not have the 1024 cylinder limit can be configured with only a root partition and no others so that there is never a need to resize a partition or file system if space requirements change. + +#### The EFI system partition + +The [EFI System Partition (ESP)][14] serves the same purpose on UEFI-based computers as the _boot_ partition did on the older BIOS-based computers. It contains the boot loader and kernel. Because the files on the ESP need to be accessible by the computer’s firmware, the ESP has a few restrictions that the older boot partition did not have. The restrictions are: + + 1. The ESP must be formatted with a FAT file system (_vfat_ in Anaconda) + 2. The ESP must have a special [type-code][15] (_EF00_ when using [gdisk][16]) + + + +Because the older boot partition did not have file system or type-code restrictions, it is permissible to apply the above properties to the _boot_ partition and use it as your ESP. Note, however, that the GRUB boot loader does not support combining the boot and ESP partitions. If you use GRUB, you will have to create a separate partition and mount it beneath the _/boot_ directory. + +The [Boot Loader Specification (BLS)][17] lists several reasons why it is ideal to use the legacy boot partition as your ESP. The reasons include: + + 1. The UEFI firmware should be able to load the kernel directly. Having a separate, non-ESP compliant boot partition for the kernel prevents the UEFI firmware from being able to directly load the kernel. + 2. Nesting the ESP mount point three mount levels deep increases the likelihood that an intermediate mount could fail or otherwise be unavailable when needed. That is, requiring _root_ (/), then _boot_ (/boot), then _efi_ (/efi) to be consecutively mounted is unnecessarily complex and prone to error. + 3. Requiring the boot loader to be able to read other partitions/disks which may be formatted with arbitrary file systems is non-trivial. Even when the boot loader does contain such code, the code that works at installation time can become outdated and fail to access the kernel/initrd after a file system update. This is currently true of GRUB’s _ZFS_ file system driver, for example. You must be careful not to update your _ZFS_ file system if you use the GRUB boot loader or else your system may not come back up the next time you reboot. + + + +Besides the concerns listed above, it is a good idea to have your startup environment — up to and including your [initramfs][18] — on a single self-contained file system for recovery purposes. Suppose, for example, that you need to rollback your root file system because it has become corrupted or it has become infected with malware. If your _kernel_ and _initramfs_ are on the _root_ file system, you may be unable to perform the recovery. By having the _boot loader_, _kernel_, and _initramfs_ all on a single file system that is rarely accessed or updated, you can increase your chances of being able to recover the rest of your system. + +In summary, there are many ways that you can layout your partitions and the type of hardware (BIOS or UEFI) and the brand of boot loader (GRUB, Syslinux or [systemd-boot][19]) are among the factors that will influence which layouts will work. + +### Other considerations + +#### MBR vs. GPT + +[GUID Partition Table (GPT)][20] is the newer partition format that supports larger disks. GPT was designed to work with the newer UEFI firmware. It is backward-compatible with the older [Master Boot Record (MBR)][21] partition format but not all boot loaders support the [MBR boot method][21]. _GRUB_ and _Syslinux_ support both MBR and UEFI, but _systemd-boot_ only supports the newer [UEFI boot method][22]. + +By using GPT now, you can increase the likelihood that your storage device, or an image of it, can be transferred over to a newer computer in the future should you wish to do so. If you have an older computer that natively supports only MBR-partitioned drives, you may need to add the _inst.gpt_ parameter to **Anaconda** when starting the installer to get it to use the newer format. How to add the _inst.gpt_ parameter is shown in the below video titled **“Partitioning a BIOS Computer”**. + +If you use the _GPT_ partition format on a BIOS-based computer, and you use the _GRUB_ boot loader, you must additionally create a one megabyte _biosboot_ partition at the start of your storage device. The _biosboot_ partition is not needed by any other brand of boot loader. How to create the _biosboot_ partition is demonstrated in the below video titled **“Partitioning a BIOS Computer”**. + +#### LVM + +One last thing to consider when manually partitioning your Linux system is whether to use standard partitions or logical volumes. Logical volumes are managed by the [Logical Volume Manager (LVM)][23]. You can setup LVM volumes directly on your disk without first creating standard partitions to hold them. However, most computers still require that the boot partition be a standard partition and not an LVM volume. Consequently, having LVM volumes only increases the complexity of the system because the LVM volumes must be created within standard partitions. + +The main features of LVM — online storage resizing and clustering — are not really applicable to the typical end user. Most laptops do not have hot-swappable drive bays for adding or reconfiguring storage while the system is running. And not many laptop or desktop users have [clvmd][24] configured so they can access a centralized storage device concurrently from multiple client computers. + +LVM is great for servers and clusters. But it adds extra complexity for the typical end user. Go with standard partitions unless you are a server admin who needs the more advanced features. + +### Video demonstrations + +Now that you know which partitions you need, you can watch the sort video demonstrations below to see how to manually partition a Fedora Linux computer from the Anaconda installer. + +These videos demonstrate creating only the minimally required partitions. You can add more if you choose. + +Because the _GRUB_ boot loader requires a more complex partition layout on UEFI systems, the below video titled **“Partitioning a UEFI Computer”** additionally demonstrates how to install the _systemd-boot_ boot loader. By using the _systemd-boot_ boot loader, you can reduce the number of needed partitions to just two — _boot_ and _root_. How to use a boot loader other than the default (GRUB) with Fedora’s Anaconda installer is officially documented [here][25]. + +**Partitioning a UEFI Computer** + +**Partitioning a BIOS Computer** + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/learning-about-partitions-and-how-to-create-them-for-fedora/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/partitions-fedora-816x346.png +[2]: https://en.wikipedia.org/wiki/Cylinder_1024 +[3]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface#EFI_system_partition +[4]: https://www.kernel.org/doc/Documentation/efi-stub.txt +[5]: https://en.wikipedia.org/wiki/File_system_permissions#Operating_system_variations +[6]: https://en.wikipedia.org/wiki/Disk_formatting#Formatting +[7]: https://access.redhat.com/discussions/641923 +[8]: https://linuxconfig.org/setting-up-logrotate-on-redhat-linux +[9]: https://docs.oracle.com/cd/E19253-01/819-5461/gazud/index.html +[10]: https://en.wikipedia.org/wiki/Extended_file_system +[11]: https://en.wikipedia.org/wiki/Journaling_file_system +[12]: https://lwn.net/Articles/317814/ +[13]: https://www.fosslinux.com/184/what-is-difference-between-suspend-and-hibernate-in-linux.htm +[14]: https://en.wikipedia.org/wiki/EFI_system_partition +[15]: https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs +[16]: https://fedoramagazine.org/managing-partitions-with-sgdisk/ +[17]: https://systemd.io/BOOT_LOADER_SPECIFICATION/ +[18]: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ +[19]: https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/ +[20]: https://en.wikipedia.org/wiki/GUID_Partition_Table +[21]: https://en.wikipedia.org/wiki/Master_boot_record +[22]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface#UEFIBOOT +[23]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) +[24]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/logical_volume_manager_administration/lvm_cluster_overview +[25]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/install/Installing_Using_Anaconda/#sect-installation-gui-storage-partitioning-bootloader From 9fcfc5c97f5378852c2a62ea7f6551c97dcc73c7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Jan 2020 00:54:09 +0800 Subject: [PATCH 016/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=20Syncth?= =?UTF-8?q?ing:=20Open=20Source=20P2P=20File=20Syncing=20Tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md --- ...hing- Open Source P2P File Syncing Tool.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md diff --git a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md new file mode 100644 index 0000000000..aa87c0f873 --- /dev/null +++ b/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Syncthing: Open Source P2P File Syncing Tool) +[#]: via: (https://itsfoss.com/syncthing/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Syncthing: Open Source P2P File Syncing Tool +====== + +_**Brief: Syncthing is an open-source peer-to-peer file synchronization tool that you can use for syncing files between multiple devices (including an Android phone).**_ + +Usually, we have a cloud sync solution like [MEGA][1] or Dropbox to have a backup of our files on the cloud while making it easier to share it. + +But, what do you do if you want to sync your files across multiple devices without storing them on the cloud? + +That is where [Syncthing][2] comes to the rescue. + +### Syncthing: An open source tool to synchronize files across devices + +![][3] + +Syncthing lets you sync your files across multiple devices (including the support for Android smartphones). It primarily works through a web UI on Linux but also offers a GUI (to separately install). + +However, Syncthing does not utilize the cloud at all – it is a [peer-to-peer][4] file synchronization tool. Your data doesn’t go to a central server. Instead, the data is synced with all the devices between them. So, it does not really replace the [typical cloud storage services on Linux][5]. + +To add remote devices, you just need the device ID (or simply scan the QR code), no IP addresses involved. + +If you want a remote backup of your files – you should probably rely on the cloud. + +![Syncthing GUI][6] + +All things considered, Syncthing can come in handy for a lot of things. Technically, you can have your important files accessible on multiple systems securely and privately without worrying about anyone spying on your data. + +For instance, you may not want to store some of the sensitive files on the cloud – so you can add other trusted devices to sync and keep a copy of those files. + +Even though I described it briefly, there’s more to it and than meets the eye. I’d also recommend reading the [official FAQ][7] to clear some confusion on how it works – if you’re interested. + +### Features of Syncthing + +You probably do not want a lot of options in a synchronization tool – it should be dead simple to work reliably to sync your files. + +Syncthing is indeed quite simple and easy to understand – even though it is recommended that you should go through the [documentation][8] if you want to use every bit of its functionality. + +Here, I’ll highlight a few useful features of Syncthing: + +#### Cross-Platform Support + +![Syncthing on Android][9] + +Being an open-source solution, it does support Windows, Linux, and macOS. + +In addition to that, it also supports Android smartphones. You’ll be disappointed if you have an iOS device – so far, no plans for iOS support. + +#### File Versioning + +![Syncthing File Versioning][10] + +Syncthing utilizes a variety of [File Versioning methods][11] to archive the old files if they are replaced or deleted. + +By default, you won’t find it enabled. But, when you create a folder to sync, that’s when you will find the option to toggle the file versioning to your preferred method. + +#### Easy To Use + +While being a peer-to-peer file synchronization tool, it just works out of the box with no advanced tweaks. + +However, it does let you configure advanced settings when needed. + +#### Security & Privacy + +Even though you do not share your data with any cloud service providers, there are still some connections made that might gain the attention of an eavesdropper. So, Syncthing makes sure the communication is secured using TLS. + +In addition to that, there are solid authentication methods to ensure that only the devices/connections you allow explicitly will be granted access to sync/read data. + +For Android smartphones, you can also force the traffic through Tor if you’re using the [Orbot app][12]. You’ll find several other options for Android as well. + +#### Other Functionalities + +![][13] + +When exploring the tool yourself, you will notice that there are no limits to how many folders you can sync and the number of devices that you can sync. + +So, being a free and open-source solution with lots of useful features makes it an impressive choice for Linux users looking to have a peer-to-peer sync client. + +### Installing Syncthing on Linux + +You may not observe a .deb file or an .AppImage file for it on its official download webpage. But, you do get a snap package on the [Snap store][14] – if you’re curious you can read about [using snap apps][15] on Linux to get started. + +You may not find it in the software center (if you do – it may not be the latest version). + +**Note:** _There’s also a [Syncthing-GTK][16] available if you want a GUI to manage that – instead of a browser._ + +[Syncthing][2] + +You can also utilize the terminal to get it installed if you have a Debian-based distro – the instructions are on the [official download page][17]. + +### My experience with Syncthing + +Personally, I got it installed on Pop!_OS 19.10 and used it for a while before writing this up. + +I tried syncing folders, removing them, adding duplicate files to see how the file versioning works, and so on. It worked just fine. + +However, when I tried syncing it to a phone (Android) – the sync started a bit late, it wasn’t very quick. So, if we could have an option to explicitly force sync, that could help. Or, did I miss the option? Let me know in the comments if I did. + +Technically, it uses the resources of your system to work – so if you have a number of devices connected to sync, it should potentially improve the sync speed (upload/download). + +Overall, it works quite well – but I must say that you shouldn’t rely on it as the only backup solution to your data. + +**Wrapping Up** + +Have you tried Syncthing yet? If yes, how was your experience with it? Feel free to share it in the comments below. + +Also, if you know about some awesome alternatives to this – let me know about it as well. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/syncthing/ + +作者:[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/install-mega-cloud-storage-linux/ +[2]: https://syncthing.net/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/Peer-to-peer +[5]: https://itsfoss.com/cloud-services-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-gtk.png?ssl=1 +[7]: https://docs.syncthing.net/users/faq.html +[8]: https://docs.syncthing.net/users/index.html +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-android.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-file-versioning.jpg?ssl=1 +[11]: https://docs.syncthing.net/users/versioning.html +[12]: https://play.google.com/store/apps/details?id=org.torproject.android&hl=en_IN +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot1.jpg?ssl=1 +[14]: https://snapcraft.io/syncthing +[15]: https://itsfoss.com/install-snap-linux/ +[16]: https://github.com/syncthing/syncthing-gtk/releases/latest +[17]: https://syncthing.net/downloads/ From 0fa02709dc4dca1af132a44ca5277700e2a42e2b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Jan 2020 00:55:05 +0800 Subject: [PATCH 017/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200120=20Use=20?= =?UTF-8?q?this=20Twitter=20client=20for=20Linux=20to=20tweet=20from=20the?= =?UTF-8?q?=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md --- ...nt for Linux to tweet from the terminal.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md diff --git a/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md b/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md new file mode 100644 index 0000000000..c49b45ace4 --- /dev/null +++ b/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this Twitter client for Linux to tweet from the terminal) +[#]: via: (https://opensource.com/article/20/1/tweet-terminal-rainbow-stream) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use this Twitter client for Linux to tweet from the terminal +====== +Keep up with your Twitter feed without leaving the terminal by using +Rainbow Stream in the tenth in our series on 20 ways to be more +productive with open source in 2020. +![Chat bubbles][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Keep up with Twitter with Rainbow Stream + +I love social networking and microblogging. It's quick, it's easy, and I can share my thoughts with the world really quickly. The drawback is, of course, that almost all the desktop options for non-Windows users are wrappers around the website. [Twitter][2] has a lot of clients, but what I really want is something lightweight, easy to use, and most importantly, attractive. + +![Rainbow Stream for Twitter][3] + +[Rainbow Stream][4] is one of the prettier Twitter clients. It is easy to use and installs quickly with a simple **pip3 install rainbowstream**. On the first run, it will open a browser window and have you authorize with Twitter. Once that is done, you land at a prompt, and your Twitter timeline will start scrolling by. + +![Rainbow Stream first run][5] + +The most important commands to know are **p** to pause the stream, **r** to resume the stream, **h** to get help, and **t** to post a new tweet. For example, **h tweets** will give you all the options for sending and replying to tweets. Another useful help screen is **h messages**, which gives the commands for working with direct messages, which is something my wife and I use a lot. There are a lot of other commands, and I refer back to help a lot. + +As your timeline scrolls by, you can see that it has full UTF-8 support and, with the right font, will show indicators for how many times something was retweeted and liked, as well as icons and emojis. + +![Kill this love][6] + +One of the _best_ things about Rainbow Stream is that you don't have to give up on photos and images. This feature is off by default, but you can try it out with the **config** command. + + +``` +`config IMAGE_ON_TERM = true` +``` + +This command renders any images as ASCII art. If you have a photo-heavy stream, this may be a bit much, but I like it. It has a very retro-1990s BBS feel, and I did love the BBS scene in the 1990s. + +You can also use Rainbow Stream to manage lists, mute people, block people, follow, unfollow, and everything else that is available with the Twitter API. There is also theme support, so you can customize the stream to your favorite color scheme. + +When I'm working and don't want to have yet-another-tab open on my browser, Rainbow Stream lets me keep up in a terminal off to the side. + +Without open source, Twitter wouldn't exist. Every Tweet you send and receive touches open source... + +Sergey Bronnikov shares why the OpenVZ team created Twisource, an open source social media tool. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream + +作者:[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/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://twitter.com/home +[3]: https://opensource.com/sites/default/files/uploads/productivity_10-1.png (Rainbow Stream for Twitter) +[4]: https://rainbowstream.readthedocs.io/en/latest/ +[5]: https://opensource.com/sites/default/files/uploads/productivity_10-2.png (Rainbow Stream first run) +[6]: https://opensource.com/sites/default/files/uploads/day10-image3_1.png (Kill this love) From b74628396a159e5cdbc6f6cbf1bc47b43e1cd241 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Jan 2020 00:55:38 +0800 Subject: [PATCH 018/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200120=20Use=20?= =?UTF-8?q?Wireshark=20at=20the=20Linux=20command=20line=20with=20TShark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200120 Use Wireshark at the Linux command line with TShark.md --- ...k at the Linux command line with TShark.md | 768 ++++++++++++++++++ 1 file changed, 768 insertions(+) create mode 100644 sources/tech/20200120 Use Wireshark at the Linux command line with TShark.md diff --git a/sources/tech/20200120 Use Wireshark at the Linux command line with TShark.md b/sources/tech/20200120 Use Wireshark at the Linux command line with TShark.md new file mode 100644 index 0000000000..d582ca77f0 --- /dev/null +++ b/sources/tech/20200120 Use Wireshark at the Linux command line with TShark.md @@ -0,0 +1,768 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Wireshark at the Linux command line with TShark) +[#]: via: (https://opensource.com/article/20/1/wireshark-linux-tshark) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +Use Wireshark at the Linux command line with TShark +====== +Learning to analyze network packets is a powerful skill. +![Multi-colored and directional network computer cables][1] + +Most of the time when we connect to the internet, we don't think about the network protocols at work underneath that make it all possible. Right now, while you are reading this article, numerous packets are being exchanged by your computer and traveling across the internet. + +To understand these protocols, you need a tool that can capture and help you analyze these packets. [Wireshark][2] is a popular open source graphical user interface (GUI) tool for analyzing packets. However, it also provides a powerful command-line utility called [TShark][3] for people who prefer to work on the Linux command line. + +To try the examples in this article, you need to be connected to the internet. For any changes to TShark's command-line options or flags, please refer to the appropriate man pages and online [documentation][4]. Also, I am using Fedora for these examples. + + +``` +[gaurav@testbox ~]$ cat /etc/fedora-release +Fedora release 30 (Thirty) +[gaurav@testbox ~]$ +``` + +### Check your installation + +First, ensure the required packages are installed: + + +``` +[gaurav@testbox ~]$ rpm -qa | grep -i wireshark +wireshark-cli-3.0.1-1.fc30.x86_64 +[gaurav@testbox ~]$ +``` + +If the Wireshark package is installed, check whether the TShark utility is installed and, if so, which version: + + +``` +[gaurav@testbox ~]$ tshark -v +TShark (Wireshark) 3.0.1 (23f278e2) + +Built using gcc 9.0.1 20190312 (Red Hat 9.0.1-0.10). +[gaurav@testbox ~]$ +``` + +If you are logged in as a regular, non-root user, you need sudo rights to use the TShark utility. Root users can skip sudo and directly run the **tshark** command. + +### Find network devices available to TShark + +Before TShark can analyze packets, it needs to capture those packets. Network packets are processed via a network interface card (NIC) on servers, workstations, or desktops or a WiFi card on laptops. Begin by identifying the NIC or WiFi card used to connect to the internet. + +To identify what network devices are available to TShark, run the following command. My laptop (which I am using for these examples) shows: + + +``` +[gaurav@testbox ~]$ sudo tshark -D +Running as user "root" and group "root". This could be dangerous. +1\. wlp61s0 +2\. lo (Loopback) +3\. any +4\. virbr0 +5\. enp0s31f6 +6\. bluetooth-monitor +7\. nflog +8\. nfqueue +[gaurav@testbox ~]$ +``` + +I am using my WiFi card to connect to my home router for accessing the internet. You can use the **ifconfig -a** command to view all network interfaces on a system. If the **ifconfig** command is not installed, you can use the newer **ip addr show** command instead. One of the interfaces should have an IP address assigned to it. For a specific interface, you can use **ifconfig <interface-name>**, for example: + + +``` +`ifconfig wlp61s0` +``` + +### Capture some packets + +Now that you know which interface is being used to connect to the internet, you can start capturing some packets using it. The **-i** option can be used to capture packets on this specific interface. You'll see a bunch of output that shows the network packets being transmitted via the interface, but you can stop it with the **Ctrl+C** command: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 0.000000000  192.168.1.9 → 192.168.1.1  DNS 77 Standard query 0xa02b AAAA fedoraproject.org +    2 0.000128115  192.168.1.9 → 192.168.1.1  DNS 77 Standard query 0xcc47 A fedoraproject.org +    3 0.000316195  192.168.1.9 → 192.168.1.1  DNS 77 Standard query 0xe29d A fedoraproject.org +    4 0.000616019  192.168.1.9 → 192.168.1.1  DNS 77 Standard query 0xac7c AAAA fedoraproject.org +    5 0.007963200  192.168.1.1 → 192.168.1.9  DNS 93 Standard query response 0xcc47 A fedoraproject.org A 185.141.165.254 +    6 0.009171815  192.168.1.1 → 192.168.1.9  DNS 93 Standard query response 0xe29d A fedoraproject.org A 185.141.165.254 +    7 0.011075350  192.168.1.1 → 192.168.1.9  DNS 322 Standard query response 0xa02b AAAA fedoraproject.org AAAA 2610:28:3090:3001:dead:beef:cafe:fed3 AAAA 2605:bc80:3010:600:dead:beef:cafe:fed9 AAAA 2604:1580:fe00:0:dead:beef:cafe:fed1 NS ns04.fedoraproject.org NS ns05.fedoraproject.org NS ns02.fedoraproject.org A 152.19.134.139 AAAA 2610:28:3090:3001:dead:beef:cafe:fed5 A 209.132.181.17 A 85.236.55.10 AAAA 2001:4178:2:1269:dead:beef:cafe:fed5 +    8 0.012458151  192.168.1.1 → 192.168.1.9  DNS 322 Standard query response 0xac7c AAAA fedoraproject.org AAAA 2605:bc80:3010:600:dead:beef:cafe:fed9 AAAA 2610:28:3090:3001:dead:beef:cafe:fed3 AAAA 2604:1580:fe00:0:dead:beef:cafe:fed1 NS ns05.fedoraproject.org NS ns02.fedoraproject.org NS ns04.fedoraproject.org A 152.19.134.139 AAAA 2610:28:3090:3001:dead:beef:cafe:fed5 A 209.132.181.17 A 85.236.55.10 AAAA 2001:4178:2:1269:dead:beef:cafe:fed5 +^C8 packets captured +[gaurav@testbox ~]$ +``` + +Look at the first two packets above; they are denoted by numbers at the beginning of the line: + + +``` +1 0.000000000  192.168.1.9 → 192.168.1.1  DNS 77 Standard query 0xa02b AAAA fedoraproject.org +2 0.000128115  192.168.1.9 → 192.168.1.1  DNS 77 Standard query 0xcc47 A fedoraproject.org +``` + +These lines include two IP addresses on either side of an arrow—these are the hosts that are exchanging the packet. The arrow's direction indicates which direction the packet is going. Therefore, **192.168.1.9 → 192.168.1.1** means the packet originated at host **192.168.1.9**, which is my laptop, and is headed for destination **192.168.1.1**, which is my home router. After the destination IP address, you see **DNS**, which is just the Domain Name System protocol, followed by a DNS query. More about that later. + +You can limit the number of packets captured and displayed on the screen using the **-c** (count) option. The following example shows 10 packets being captured. Notice the protocols—you saw DNS above, and here there are other protocols like NTP and TCP: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 -c 10 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 0.000000000  192.168.1.9 → 10.5.26.10   NTP 90 NTP Version 4, client +    2 0.803303963  192.168.1.9 → 10.5.27.10   NTP 90 NTP Version 4, client +    3 3.524867645  192.168.1.9 → 192.168.1.1  DNS 69 Standard query 0x3837 A testbox +    4 6.227373094  192.168.1.9 → 192.168.1.1  DNS 89 Standard query 0x0814 A location.services.mozilla.com +    5 6.227395145  192.168.1.9 → 192.168.1.1  DNS 89 Standard query 0x5e1c AAAA location.services.mozilla.com +    6 6.234878912  192.168.1.1 → 192.168.1.9  DNS 105 Standard query response 0x0814 A location.services.mozilla.com A 34.253.23.107 +    7 6.238110416  192.168.1.1 → 192.168.1.9  DNS 223 Standard query response 0x5e1c AAAA location.services.mozilla.com CNAME locprod1-elb-eu-west-1.prod.mozaws.net SOA ns-1260.awsdns-29.org +    8 6.238446999  192.168.1.9 → 34.253.23.107 TCP 74 35326 → 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=2832002333 TSecr=0 WS=128 +    9 6.438833991 34.253.23.107 → 192.168.1.9  TCP 74 443 → 35326 [SYN, ACK] Seq=0 Ack=1 Win=26847 Len=0 MSS=1440 SACK_PERM=1 TSval=2056252981 TSecr=2832002333 WS=256 +   10 6.438947001  192.168.1.9 → 34.253.23.107 TCP 66 35326 → 443 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=2832002533 TSecr=2056252981 +10 packets captured +[gaurav@testbox ~]$ +``` + +The DNS protocol converts the hostname to an IP address and the IP address to a hostname. There are dedicated DNS (or name) servers, which you can query with either a hostname or an IP address. The example below uses the **nslookup** command to query the name servers to resolve a hostname to an IP address. Before you proceed, ensure the **bind-utils** package is installed: + + +``` +[gaurav@testbox ~]$ rpm -qa | grep -i bind-utils +bind-utils-9.11.5-13.P4.fc30.x86_64 +[gaurav@testbox ~]$ +``` + +In order to query your name server, you need to find out which one your machine is talking to. You can find that information in the **/etc/resolv.conf** file. In my case, the name server is pointed to **1.1.1.1**, which is a public DNS service provided by Cloudflare: + + +``` +[gaurav@testbox ~]$ cat /etc/resolv.conf +# Generated by NetworkManager +nameserver 1.1.1.1 +[gaurav@testbox ~]$ +``` + +Hostnames like Opensource.com are easy for humans to understand, but machines use IP addresses to connect to other machines over a network or the internet. For your computer to connect to opensource.com, it needs to find the site's IP address; you can find it with the command: + + +``` +`nslookup opensource.com` +``` + +If **nslookup** is not available on your machine, you can use the **dig** command instead: + + +``` +`dig opensource.com` +``` + +But—_before you hit Enter_—open another terminal and type the following command to tell TShark to capture any traffic that goes to your name server (e.g., 1.1.1.1): + + +``` +`sudo tshark -i wlp61s0 host 1.1.1.1` +``` + +Keep that terminal running and return to the other one, then run **nslookup** (or **dig**). When the command completes, it gives Opensource.com's IP address, which is 54.204.39.132. Here is **nslookup**'s output: + + +``` +[gaurav@testbox ~]$ nslookup opensource.com +Server:         1.1.1.1 +Address:        1.1.1.1#53 + +Non-authoritative answer: +Name:   opensource.com +Address: 54.204.39.132 + +[gaurav@testbox ~]$ +``` + +And **dig**'s output: + + +``` +[gaurav@testbox ~]$ dig opensource.com + +; <<>> DiG 9.11.5-P4-RedHat-9.11.5-13.P4.fc30 <<>> opensource.com +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<\- opcode: QUERY, status: NOERROR, id: 33030 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 1452 +;; QUESTION SECTION: +;opensource.com.                        IN      A + +;; ANSWER SECTION: +opensource.com.         206     IN      A       54.204.39.132 + +;; Query time: 30 msec +;; SERVER: 1.1.1.1#53(1.1.1.1) +;; WHEN: Sat Nov 02 21:05:54 IST 2019 +;; MSG SIZE  rcvd: 59 + +[gaurav@testbox ~]$ +``` + +So far, so good, but what is happening at the packet level? Move to the terminal where you entered the **tshark** command. It captured a few packets: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 host 1.1.1.1 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    2 1.798275687  192.168.1.9 → 1.1.1.1      DNS 74 Standard query 0xcda0 A opensource.com +    3 1.827143443      1.1.1.1 → 192.168.1.9  DNS 90 Standard query response 0xcda0 A opensource.com A 54.204.39.132 +    ^C packets captured +[gaurav@testbox ~]$ +``` + +The packet below originated from my laptop **192.168.1.9** and is headed for destination **1.1.1.1**. The packet is for the DNS protocol, and it's querying (Standard query) the name server for Opensource.com: + + +``` +`2 1.798275687 192.168.1.9 → 1.1.1.1 DNS 74 Standard query 0xcda0 A opensource.com` +``` + +The packet below is a reply coming from my name server **1.1.1.1** to my machine **192.168.1.9**. Again, it's DNS, but now it's a response for the query (Standard query response) for Opensource.com's IP address: + + +``` +`3 1.827143443      1.1.1.1 → 192.168.1.9  DNS 90 Standard query response 0xcda0 A opensource.com A 54.204.39.132` +``` + +If you know beforehand what protocol you are looking for, you can add it to the **tshark** command. The following example is looking only for UDP packets, but it captured DNS packets. This is because DNS packets use the UDP protocol underneath: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 udp +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 0.000000000  192.168.1.9 → 1.1.1.1      DNS 89 Standard query 0xcc6d A location.services.mozilla.com +    2 0.000068640  192.168.1.9 → 1.1.1.1      DNS 89 Standard query 0x6484 AAAA location.services.mozilla.com +    3 0.032616053      1.1.1.1 → 192.168.1.9  DNS 189 Standard query response 0xcc6d A location.services.mozilla.com CNAME locprod1-elb-eu-west-1.prod.mozaws.net A 52.215.71.87 A 54.72.168.141 A 34.253.23.107 +    4 0.108203529      1.1.1.1 → 192.168.1.9  DNS 241 Standard query response 0x6484 AAAA location.services.mozilla.com CNAME locprod1-elb-eu-west-1.prod.mozaws.net SOA ns-1260.awsdns-29.org +    5 1.268489014  192.168.1.9 → 1.1.1.1      DNS 69 Standard query 0x74be A testbox +    6 1.302652455      1.1.1.1 → 192.168.1.9  DNS 144 Standard query response 0x74be No such name A testbox SOA a.root-servers.net +    7 6.268558254  192.168.1.9 → 1.1.1.1      DNS 79 Standard query 0xc47a A cups.pnq.redhat.com +    8 6.268618039  192.168.1.9 → 1.1.1.1      DNS 79 Standard query 0xb08b AAAA cups.pnq.redhat.com +    9 6.664992312      1.1.1.1 → 192.168.1.9  DNS 143 Standard query response 0xb08b AAAA cups.pnq.redhat.com SOA a1-68.akam.net +   10 6.665088305      1.1.1.1 → 192.168.1.9  DNS 143 Standard query response 0xc47a A cups.pnq.redhat.com SOA a1-68.akam.net +^C10 packets captured +[gaurav@testbox ~]$ +``` + +The **ping** command is often used to check if a machine is up or accessible over a network. You can run the **ping** command against Opensource.com's IP address to see if the server is up and running. + +Before you do that, start a packet capture so you can analyze the packet later. Open a terminal and run the following command, which will keep running and looking for packets that are originating in or destined for IP address 54.204.39.132: + + +``` +`sudo tshark -i wlp61s0 host 54.204.39.132` +``` + +In another terminal, run the following **ping** command. The **-c** is for count, so **-c 2** means it should send only two packets to the given host: + + +``` +`ping -c 2 54.204.39.132` +``` + +From the terminal where you ran the **ping** command, you can see two packets were sent and two were received. It also says that there was 0% packet loss, which suggests that the destination 54.204.39.132 responded to the **ping** requests: + + +``` +[gaurav@testbox ~]$ ping -c 2 54.204.39.132 +PING 54.204.39.132 (54.204.39.132) 56(84) bytes of data. +64 bytes from 54.204.39.132: icmp_seq=1 ttl=43 time=357 ms +64 bytes from 54.204.39.132: icmp_seq=2 ttl=43 time=278 ms + +\--- 54.204.39.132 ping statistics --- +2 packets transmitted, 2 received, 0% packet loss, time 1ms +rtt min/avg/max/mdev = 278.045/317.410/356.776/39.369 ms +[gaurav@testbox ~]$ +``` + +Move back to the terminal where TShark is running. It shows four packets: the requests in the **ping** command (**-c 2**) and two replies, hence a total of four packets: + + +``` +Packet 1 - request (1st request) +Packet 2 - reply (to Packet 1) +Packet 3 - request (2nd request) +Packet 4 - reply (to Packet 3) +``` + +The output shows that it is using the [ICMP][5] protocol. **Ping** works over ICMP to complete its tasks: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 host 54.204.39.132 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 0.000000000  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1749, seq=1/256, ttl=64 +    2 0.356750411 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1749, seq=1/256, ttl=43 (request in 1) +    3 1.000295229  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1749, seq=2/512, ttl=64 +    4 1.278267790 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1749, seq=2/512, ttl=43 (request in 3) +^C4 packets captured +[gaurav@testbox ~]$ +``` + +Network packets are sent in binary format, so if you want to see how they look on the network, you can dump the packet's hexadecimal format by simply adding an **-x** to the **tshark** command, and you will see the hexadecimal output. The following output shows a **ping** request sent by running the command **ping -c 1 54.204.39.132**: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 -x -c 2 host 54.204.39.132 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +0000  28 c6 8e 3e 39 3a 48 89 e7 a0 33 db 08 00 45 00   (..>9:H...3...E. +0010  00 54 e6 29 40 00 40 01 34 7e c0 a8 01 09 36 cc   .T.)@.@.4~....6. +0020  27 84 08 00 25 5f 27 d1 00 01 7e aa bd 5d 00 00   '...%_'...~..].. +0030  00 00 a2 f3 0d 00 00 00 00 00 10 11 12 13 14 15   ................ +0040  16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25   .......... !"#$% +0050  26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35   &'()*+,-./012345 +0060  36 37                                             67 + +0000  48 89 e7 a0 33 db 28 c6 8e 3e 39 3a 08 00 45 00   H...3.(..>9:..E. +0010  00 54 31 06 00 00 2b 01 3e a2 36 cc 27 84 c0 a8   .T1...+.>.6.'... +0020  01 09 00 00 2d 5f 27 d1 00 01 7e aa bd 5d 00 00   ....-_'...~..].. +0030  00 00 a2 f3 0d 00 00 00 00 00 10 11 12 13 14 15   ................ +0040  16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25   .......... !"#$% +0050  26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35   &'()*+,-./012345 +0060  36 37                                             67 + +2 packets captured +[gaurav@testbox ~]$ +``` + +### Save your output + +Seeing output on the screen is OK, but often you need to save data to a file to use it later. Use the **ping** command but add **-w** to tell TShark to dump the output to a file. For example, the following saves the output to file named **nlog.pcap** within the **/tmp** directory: + + +``` +`sudo tshark -w /tmp/nlog.pcap -i wlp61s0 host 54.204.39.132` +``` + +Now run the **ping** command again from another terminal, but this time with a count of five packets: + + +``` +`ping -c 5 54.204.39.132` +``` + +The TShark terminal shows that 10 packets were captured. Why 10? Because you asked **ping** to send five requests, and you got five replies, hence 10 packets. Use **Ctrl+C** to stop the packet capture: + + +``` +[gaurav@testbox ~]$ sudo tshark -w /tmp/nlog.pcap -i wlp61s0 host 54.204.39.132 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +10 ^C +[gaurav@testbox ~]$ +``` + +TShark saved the output to the file **/tmp/nlog.pcap**: + + +``` +[gaurav@testbox ~]$ ls -l /tmp/nlog.pcap +-rw-------. 1 root root 1692 Nov  2 21:10 /tmp/nlog.pcap +[gaurav@testbox ~]$ +``` + +The **file** command shows the file type is a **pcapng** capture file, so you can't just open the file using an editor like Vim and start reading; all you'll see is a bunch of garbage characters: + + +``` +[gaurav@testbox ~]$ sudo file /tmp/nlog.pcap +/tmp/nlog.pcap: pcapng capture file - version 1.0 +[gaurav@testbox ~]$ +``` + +Since TShark wrote the data to the file, it can read it back from the file as well using the **-r** option followed by the filename. The following shows all 10 packets (five requests and five replies): + + +``` +[gaurav@testbox ~]$ sudo tshark -r /tmp/nlog.pcap +Running as user "root" and group "root". This could be dangerous. +    1 0.000000000  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1875, seq=1/256, ttl=64 +    2 0.270098703 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1875, seq=1/256, ttl=43 (request in 1) +    3 1.000485186  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1875, seq=2/512, ttl=64 +    4 1.323571769 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1875, seq=2/512, ttl=43 (request in 3) +    5 2.000955585  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1875, seq=3/768, ttl=64 +    6 2.347737132 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1875, seq=3/768, ttl=43 (request in 5) +    7 3.000912998  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1875, seq=4/1024, ttl=64 +    8 3.269412434 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1875, seq=4/1024, ttl=43 (request in 7) +    9 4.001573635  192.168.1.9 → 54.204.39.132 ICMP 98 Echo (ping) request  id=0x1875, seq=5/1280, ttl=64 +   10 4.293431592 54.204.39.132 → 192.168.1.9  ICMP 98 Echo (ping) reply    id=0x1875, seq=5/1280, ttl=43 (request in 9) +[gaurav@testbox ~]$ + +#TCP handshake +``` + +A [TCP handshake][6] is done before establishing a connection over a network. The examples above just queried a name server or tried to determine whether a machine is reachable via a **ping** command, neither of which requires establishing a connection with the host. Try to fetch [www.opensource.com][7] via the **wget** command. + +Before you run **wget**, run the following command in another terminal to capture packets. I have deliberately kept the count to three since the handshake involves initial packets: + + +``` +`sudo tshark -i wlp61s0 -c 3 host 54.204.39.132` +``` + +Next, run the **wget** command to download the index file: + + +``` +[gaurav@testbox ~]$ wget +\--2019-11-02 21:13:54--   +Resolving [www.opensource.com][7] ([www.opensource.com][7])... 54.204.39.132 +Connecting to [www.opensource.com][7] ([www.opensource.com)|54.204.39.132|:443][8]... connected. +HTTP request sent, awaiting response... 301 Moved Permanently +Location: [following] +\--2019-11-02 21:13:56--   +Resolving opensource.com (opensource.com)... 54.204.39.132 +Connecting to opensource.com (opensource.com)|54.204.39.132|:80... connected. +HTTP request sent, awaiting response... 302 Found +Location: [following] +\--2019-11-02 21:13:57--   +Connecting to opensource.com (opensource.com)|54.204.39.132|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: 71561 (70K) [text/html] +Saving to: ‘index.html’ + +index.html                        100%[=============================================================>]  69.88K   105KB/s    in 0.7s     + +2019-11-02 21:13:59 (105 KB/s) - ‘index.html’ saved [71561/71561] + +[gaurav@testbox ~]$ ^C +``` + +You can view the three packets below. The first packet sends a **SYN** request from my laptop to the Opensource.com server. The second packet is the Opensource.com server replying with a **SYN, ACK** flag set. Finally, the third packet is my laptop sending an **ACK** request to acknowledge receiving the second packet. This is called a TCP handshake. After this handshake, both nodes (i.e., my laptop and the Opensource.com server) can exchange data. + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 -c 3 host 54.204.39.132 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 0.000000000  192.168.1.9 → 54.204.39.132 TCP 74 58784 → 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=790376430 TSecr=0 WS=128 +    2 0.306538226 54.204.39.132 → 192.168.1.9  TCP 74 443 → 58784 [SYN, ACK] Seq=0 Ack=1 Win=26847 Len=0 MSS=1440 SACK_PERM=1 TSval=1306268046 TSecr=790376430 WS=512 +    3 0.306671608  192.168.1.9 → 54.204.39.132 TCP 66 58784 → 443 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=790376737 TSecr=1306268046 +3 packets captured +[gaurav@testbox ~]$ +``` + +If you exclude **-c 3**, it will capture all packets, and you will see a similar ritual to close a connection. Only this time, my laptop sent a **FIN, ACK** packet to Opensource.com (in packet 1 below), followed by a **FIN, ACK** from Opensource.com to my laptop (in packet 2 below), and finally an **ACK** packet sent by my laptop to the Opensource.com server. This concludes the network connection that was established earlier, and any future connections will have to set up a TCP handshake again. + + +``` +   73 4.505715716  192.168.1.9 → 54.204.39.132 TCP 66 59574 → 443 [FIN, ACK] Seq=814 Ack=76239 Win=69888 Len=0 TSval=792384514 TSecr=1306769989 +   74 4.737227282 54.204.39.132 → 192.168.1.9  TCP 66 443 → 59574 [FIN, ACK] Seq=76239 Ack=815 Win=29184 Len=0 TSval=1306770066 TSecr=792384514 +   75 4.737389399  192.168.1.9 → 54.204.39.132 TCP 66 59574 → 443 [ACK] Seq=815 Ack=76240 Win=69888 Len=0 TSval=792384745 TSecr=1306770066 +``` + +### Encrypt handshake data + +These days, most websites are accessed over HTTPS instead of HTTP. This ensures the data passed between the two nodes is encrypted on the wire as it passes through the internet. To ensure data is encrypted, a [TLS handshake][9] method, which is similar to the TCP handshake, happens. + +Fire another **wget** command, but this time it captures 11 packets from the beginning: + + +``` +[gaurav@testbox ~]$ wget +\--2019-11-02 21:15:21--   +Resolving [www.opensource.com][7] ([www.opensource.com][7])... 54.204.39.132 +Connecting to [www.opensource.com][7] ([www.opensource.com)|54.204.39.132|:443][8]... connected. +HTTP request sent, awaiting response... 301 Moved Permanently +Location: [following] +\--2019-11-02 21:15:23--   +Resolving opensource.com (opensource.com)... 54.204.39.132 +Connecting to opensource.com (opensource.com)|54.204.39.132|:80... connected. +HTTP request sent, awaiting response... 302 Found +Location: [following] +\--2019-11-02 21:15:28--   +Connecting to opensource.com (opensource.com)|54.204.39.132|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: 71561 (70K) [text/html] +Saving to: ‘index.html’ + +index.html                        100%[=============================================================>]  69.88K   114KB/s    in 0.6s     + +2019-11-02 21:15:31 (114 KB/s) - ‘index.html’ saved [71561/71561] + +[gaurav@testbox ~]$ +``` + +The TCP handshake concludes in the first three packets, and the fourth to the ninth have various packets that have TLS strings, which follow a similar handshake ritual to set up a secure, encrypted connection between the two hosts: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 -c 11 host 54.204.39.132 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 0.000000000  192.168.1.9 → 54.204.39.132 TCP 74 58800 → 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=790462858 TSecr=0 WS=128 +    2 0.305006506 54.204.39.132 → 192.168.1.9  TCP 74 443 → 58800 [SYN, ACK] Seq=0 Ack=1 Win=26847 Len=0 MSS=1440 SACK_PERM=1 TSval=1306289652 TSecr=790462858 WS=512 +    3 0.305135180  192.168.1.9 → 54.204.39.132 TCP 66 58800 → 443 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=790463163 TSecr=1306289652 +    4 0.308282152  192.168.1.9 → 54.204.39.132 TLSv1 583 Client Hello +    5 0.613210220 54.204.39.132 → 192.168.1.9  TCP 66 443 → 58800 [ACK] Seq=1 Ack=518 Win=28160 Len=0 TSval=1306289729 TSecr=790463166 +    6 0.613298883 54.204.39.132 → 192.168.1.9  TLSv1.2 3139 Server Hello, Certificate, Server Key Exchange, Server Hello Done +    7 0.613356054  192.168.1.9 → 54.204.39.132 TCP 66 58800 → 443 [ACK] Seq=518 Ack=3074 Win=61184 Len=0 TSval=790463472 TSecr=1306289729 +    8 0.617318607  192.168.1.9 → 54.204.39.132 TLSv1.2 192 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message +    9 0.919718195 54.204.39.132 → 192.168.1.9  TLSv1.2 324 New Session Ticket, Change Cipher Spec, Encrypted Handshake Message +   10 0.940858609  192.168.1.9 → 54.204.39.132 TLSv1.2 240 Application Data +   11 1.228530079 54.204.39.132 → 192.168.1.9  TLSv1.2 754 Application Data +11 packets captured +[gaurav@testbox ~]$ +``` + +Because HTTPS works on port 443 by default, you can use it as a filter in TShark to capture traffic going to that specific port: + + +``` +`sudo tshark -i wlp61s0 host 54.204.39.132 and port 443` +``` + +Timestamps are essential when you need to analyze packets offline to reconstruct events from the past, e.g., for debugging. Adding a **-t ad** flag to TShark will add timestamps to the beginning of each packet capture: + + +``` +[gaurav@testbox ~]$ sudo tshark -n -i wlp61s0 -t ad +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +    1 2019-11-02 21:43:58.344158174 25:c9:8e:3f:38:3a → 48:89:e7:a0:33:db ARP 42 Who has 192.168.1.9? Tell 192.168.1.1 +    2 2019-11-02 21:43:58.344194844 48:89:e7:a0:33:db → 25:c9:8e:3f:38:3a ARP 42 192.168.1.9 is at 48:89:e7:a0:33:db +    3 2019-11-02 21:44:00.223393961  192.168.1.9 → 1.1.1.1      DNS 79 Standard query 0x00fb A cups.pnq.redhat.com +    4 2019-11-02 21:44:00.223460961  192.168.1.9 → 1.1.1.1      DNS 79 Standard query 0x1814 AAAA cups.pnq.redhat.com +    5 2019-11-02 21:44:00.266325914      1.1.1.1 → 192.168.1.9  DNS 143 Standard query response 0x00fb A cups.pnq.redhat.com SOA a1-68.akam.net +    6 2019-11-02 21:44:00.269102767      1.1.1.1 → 192.168.1.9  DNS 143 Standard query response 0x1814 AAAA cups.pnq.redhat.com SOA a1-68.akam.net +^C6 packets captured +[gaurav@testbox ~]$ +``` + +### View an entire packet + +So far, you have seen several examples of packets and ways to interpret them but not an entire packet. Here's how to use **ping** and the **nslookup** utility to dump an entire packet: + + +``` +[gaurav@testbox ~]$ ping -c 1 54.204.39.132 +PING 54.204.39.132 (54.204.39.132) 56(84) bytes of data. +64 bytes from 54.204.39.132: icmp_seq=1 ttl=43 time=357 ms + +\--- 54.204.39.132 ping statistics --- +1 packets transmitted, 1 received, 0% packet loss, time 0ms +rtt min/avg/max/mdev = 356.961/356.961/356.961/0.000 ms +[gaurav@testbox ~]$ +``` + +In another window, run the following command and then the **ping** command above. Notice the additional **-V** flag—it is used to dump the entire packet information on the screen. The output is divided into various sections, starting with Frames, then moving to Ethernet, then to Internet Protocol, and so on. + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 -c 1 -V host 54.204.39.132 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +Frame 1: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0 +    Interface id: 0 (wlp61s0) +        Interface name: wlp61s0 +    Encapsulation type: Ethernet (1) +    Arrival Time: Nov  2, 2019 21:17:55.556150846 IST +    [Time shift for this packet: 0.000000000 seconds] +    Epoch Time: 1572709675.556150846 seconds +    [Time delta from previous captured frame: 0.000000000 seconds] +    [Time delta from previous displayed frame: 0.000000000 seconds] +    [Time since reference or first frame: 0.000000000 seconds] +    Frame Number: 1 +    Frame Length: 98 bytes (784 bits) +    Capture Length: 98 bytes (784 bits) +    [Frame is marked: False] +    [Frame is ignored: False] +    [Protocols in frame: eth:ethertype:ip:icmp:data] +Ethernet II, Src: IntelCor_a0:33:db (48:89:e7:a0:33:db), Dst: Netgear_3f:38:3a (25:c9:8e:3f:38:3a) +    Destination: Netgear_3f:38:3a (25:c9:8e:3f:38:3a) +        Address: Netgear_3f:38:3a (25:c9:8e:3f:38:3a) +        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) +        .... ...0 .... .... .... .... = IG bit: Individual address (unicast) +    Source: IntelCor_a0:33:db (48:89:e7:a0:33:db) +        Address: IntelCor_a0:33:db (48:89:e7:a0:33:db) +        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) +        .... ...0 .... .... .... .... = IG bit: Individual address (unicast) +    Type: IPv4 (0x0800) +Internet Protocol Version 4, Src: 192.168.1.9, Dst: 54.204.39.132 +    0100 .... = Version: 4 +    .... 0101 = Header Length: 20 bytes (5) +    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) +        0000 00.. = Differentiated Services Codepoint: Default (0) +        .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) +    Total Length: 84 +    Identification: 0x8f68 (36712) +    Flags: 0x4000, Don't fragment +        0... .... .... .... = Reserved bit: Not set +        .1.. .... .... .... = Don't fragment: Set +        ..0. .... .... .... = More fragments: Not set +        ...0 0000 0000 0000 = Fragment offset: 0 +    Time to live: 64 +    Protocol: ICMP (1) +    Header checksum: 0x8b3f [validation disabled] +    [Header checksum status: Unverified] +    Source: 192.168.1.9 +    Destination: 54.204.39.132 +Internet Control Message Protocol +    Type: 8 (Echo (ping) request) +    Code: 0 +    Checksum: 0xcfc5 [correct] +    [Checksum Status: Good] +    Identifier (BE): 7399 (0x1ce7) +    Identifier (LE): 59164 (0xe71c) +    Sequence number (BE): 1 (0x0001) +    Sequence number (LE): 256 (0x0100) +    Timestamp from icmp data: Nov  2, 2019 21:17:55.000000000 IST +    [Timestamp from icmp data (relative): 0.556150846 seconds] +    Data (48 bytes) + +0000  5b 7c 08 00 00 00 00 00 10 11 12 13 14 15 16 17   [|.............. +0010  18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27   ........ !"#$%&' +0020  28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37   ()*+,-./01234567 +        Data: 5b7c080000000000101112131415161718191a1b1c1d1e1f… +        [Length: 48] + +1 packet captured +[gaurav@testbox ~] +``` + +Similarly, run the following **nslookup** command and, on the side, dump the entire packet via TShark: + + +``` +[gaurav@testbox ~]$ nslookup opensource.com +Server:         1.1.1.1 +Address:        1.1.1.1#53 + +Non-authoritative answer: +Name:   opensource.com +Address: 54.204.39.132 + +[gaurav@testbox ~]$ +``` + +Here is how the packet looks when you do a DNS lookup—notice the UDP protocol is being used: + + +``` +[gaurav@testbox ~]$ sudo tshark -i wlp61s0 -c 1 -V host 1.1.1.1 +Running as user "root" and group "root". This could be dangerous. +Capturing on 'wlp61s0' +Frame 1: 88 bytes on wire (704 bits), 88 bytes captured (704 bits) on interface 0 +    Interface id: 0 (wlp61s0) +        Interface name: wlp61s0 +    Encapsulation type: Ethernet (1) +    Arrival Time: Nov  2, 2019 21:19:32.161216715 IST +    [Time shift for this packet: 0.000000000 seconds] +    Epoch Time: 1572709772.161216715 seconds +    [Time delta from previous captured frame: 0.000000000 seconds] +    [Time delta from previous displayed frame: 0.000000000 seconds] +    [Time since reference or first frame: 0.000000000 seconds] +    Frame Number: 1 +    Frame Length: 88 bytes (704 bits) +    Capture Length: 88 bytes (704 bits) +    [Frame is marked: False] +    [Frame is ignored: False] +    [Protocols in frame: eth:ethertype:ip:udp:dns] +Ethernet II, Src: IntelCor_a0:33:db (48:89:e7:a0:33:db), Dst: Netgear_3f:38:3a (25:c9:8e:3f:38:3a) +    Destination: Netgear_3f:38:3a (25:c9:8e:3f:38:3a) +        Address: Netgear_3f:38:3a (25:c9:8e:3f:38:3a) +        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) +        .... ...0 .... .... .... .... = IG bit: Individual address (unicast) +    Source: IntelCor_a0:33:db (48:89:e7:a0:33:db) +        Address: IntelCor_a0:33:db (48:89:e7:a0:33:db) +        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) +        .... ...0 .... .... .... .... = IG bit: Individual address (unicast) +    Type: IPv4 (0x0800) +Internet Protocol Version 4, Src: 192.168.1.9, Dst: 1.1.1.1 +    0100 .... = Version: 4 +    .... 0101 = Header Length: 20 bytes (5) +    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) +        0000 00.. = Differentiated Services Codepoint: Default (0) +        .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) +    Total Length: 74 +    Identification: 0x907d (36989) +    Flags: 0x4000, Don't fragment +        0... .... .... .... = Reserved bit: Not set +        .1.. .... .... .... = Don't fragment: Set +        ..0. .... .... .... = More fragments: Not set +        ...0 0000 0000 0000 = Fragment offset: 0 +    Time to live: 64 +    Protocol: UDP (17) +    Header checksum: 0xe672 [validation disabled] +    [Header checksum status: Unverified] +    Source: 192.168.1.9 +    Destination: 1.1.1.1 +User Datagram Protocol, Src Port: 60656, Dst Port: 53 +    Source Port: 60656 +    Destination Port: 53 +    Length: 54 +    Checksum: 0x2fd2 [unverified] +    [Checksum Status: Unverified] +    [Stream index: 0] +    [Timestamps] +        [Time since first frame: 0.000000000 seconds] +        [Time since previous frame: 0.000000000 seconds] +Domain Name System (query) +    Transaction ID: 0x303c +    Flags: 0x0100 Standard query +        0... .... .... .... = Response: Message is a query +        .000 0... .... .... = Opcode: Standard query (0) +        .... ..0. .... .... = Truncated: Message is not truncated +        .... ...1 .... .... = Recursion desired: Do query recursively +        .... .... .0.. .... = Z: reserved (0) +        .... .... ...0 .... = Non-authenticated data: Unacceptable +    Questions: 1 +    Answer RRs: 0 +    Authority RRs: 0 +    Additional RRs: 0 +    Queries +        clock01.util.phx2.redhat.com: type A, class IN +            Name: clock01.util.phx2.redhat.com +            [Name Length: 28] +            [Label Count: 5] +            Type: A (Host Address) (1) +            Class: IN (0x0001) + +1 packet captured +[gaurav@testbox ~]$ +``` + +### Next steps + +Once you are comfortable with these basics of packet capturing and analysis, you can utilize TShark's various capture and display filters when working on more advanced use cases. Refer to the online documentation for more information on these filters. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/wireshark-linux-tshark + +作者:[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/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: https://www.wireshark.org/ +[3]: https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html +[4]: https://www.wireshark.org/docs/man-pages/tshark.html +[5]: https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol +[6]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Connection_establishment +[7]: http://www.opensource.com +[8]: http://www.opensource.com)|54.204.39.132|:443 +[9]: https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake From cb78502d5a011ac5ab00cc833d9b57451d03fa5d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Jan 2020 08:25:30 +0800 Subject: [PATCH 019/285] APL --- sources/talk/20191015 How GNOME uses Git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20191015 How GNOME uses Git.md b/sources/talk/20191015 How GNOME uses Git.md index f64057287e..5cf183f2e8 100644 --- a/sources/talk/20191015 How GNOME uses Git.md +++ b/sources/talk/20191015 How GNOME uses Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c98195bdd0cee9646945f652b133caed6d013847 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Jan 2020 09:15:36 +0800 Subject: [PATCH 020/285] TSL --- sources/talk/20191015 How GNOME uses Git.md | 60 ------------------ .../talk/20191015 How GNOME uses Git.md | 61 +++++++++++++++++++ 2 files changed, 61 insertions(+), 60 deletions(-) delete mode 100644 sources/talk/20191015 How GNOME uses Git.md create mode 100644 translated/talk/20191015 How GNOME uses Git.md diff --git a/sources/talk/20191015 How GNOME uses Git.md b/sources/talk/20191015 How GNOME uses Git.md deleted file mode 100644 index 5cf183f2e8..0000000000 --- a/sources/talk/20191015 How GNOME uses Git.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How GNOME uses Git) -[#]: via: (https://opensource.com/article/19/10/how-gnome-uses-git) -[#]: author: (Molly de Blanc https://opensource.com/users/mollydb) - -How GNOME uses Git -====== -The GNOME project's decision to centralize on GitLab is creating -benefits across the community—even beyond the developers. -![red panda][1] - -“What’s your GitLab?” is one of the first questions I was asked on my first day working for the [GNOME Foundation][2]—the nonprofit that supports GNOME projects, including the [desktop environment][3], [GTK][4], and [GStreamer][5]. The person was referring to my username on [GNOME’s GitLab instance][6]. In my time with GNOME, I’ve been asked for my GitLab a lot. - -We use GitLab for basically everything. In a typical day, I get several issues and reference bug reports, and I occasionally need to modify a file. I don’t do this in the capacity of being a developer or a sysadmin. I’m involved with the Engagement and Inclusion & Diversity (I&D) teams. I write newsletters for Friends of GNOME and interview contributors to the project. I work on sponsorships for GNOME events. I don’t write code, and I use GitLab every day. - -The GNOME project has been managed a lot of ways over the past two decades. Different parts of the project used different systems to track changes to code, collaborate, and share information both as a project and as a social space. However, the project made the decision that it needed to become more integrated and it took about a year from conception to completion. - -There were a number of reasons GNOME wanted to switch to a single tool for use across the community. External projects touch GNOME, and providing them an easier way to interact with resources was important for the project, both to support the community and to grow the ecosystem. We also wanted to better track metrics for GNOME—the number of contributors, the type and number of contributions, and the developmental progress of different parts of the project. - -When it came time to pick a collaboration tool, we considered what we needed. One of the most important requirements was that it must be hosted by the GNOME community; being hosted by a third party didn’t feel like an option, so that discounted services like GitHub and Atlassian. And, of course, it had to be free software. It quickly became obvious that the only real contender was GitLab. We wanted to make sure contribution would be easy. GitLab has features like single sign-on, which allows people to use GitHub, Google, GitLab.com, and GNOME accounts. - -We agreed that GitLab was the way to go, and we began to migrate from many tools to a single tool. GNOME board member [Carlos Soriano][7] led the charge. With lots of support from GitLab and the GNOME community, we completed the process in May 2018. - -There was a lot of hope that moving to GitLab would help grow the community and make contributing easier. Because GNOME previously used so many different tools, including Bugzilla and CGit, it’s hard to quantitatively measure how the switch has impacted the number of contributions. We can more clearly track some statistics though, such as the nearly 10,000 issues closed and 7,085 merge requests merged between June and November 2018. People feel that the community has grown and become more welcoming and that contribution is, in fact, easier. - -People come to free software from all sorts of different starting points, and it’s important to try to even out the playing field by providing better resources and extra support for people who need them. Git, as a tool, is widely used, and more people are coming to participate in free software with those skills ready to go. Self-hosting GitLab provides the perfect opportunity to combine the familiarity of Git with the feature-rich, user-friendly environment provided by GitLab. - -It’s been a little over a year, and the change is really noticeable. Continuous integration (CI) has been a huge benefit for development, and it has been completely integrated into nearly every part of GNOME. Teams that aren’t doing code development have also switched to using the GitLab ecosystem for their work. Whether it’s using issue tracking to manage assigned tasks or version control to share and manage assets, even teams like Engagement and I&D have taken up using GitLab. - -It can be hard for a community, even one developing free software, to adapt to a new technology or tool. It is especially hard in a case like GNOME, a project that [recently turned 22][8]. After more than two decades of building a project like GNOME, with so many parts used by so many people and organizations, the migration was an endeavor that was only possible thanks to the hard work of the GNOME community and generous assistance from GitLab. - -I find a lot of convenience in working for a project that uses Git for version control. It’s a system that feels comfortable and is familiar—it’s a tool that is consistent across workplaces and hobby projects. As a new member of the GNOME community, it was great to be able to jump in and just use GitLab. As a community builder, it’s inspiring to see the results: more associated projects coming on board and entering the ecosystem; new contributors and community members making their first contributions to the project; and increased ability to measure the work we’re doing to know it’s effective and successful. - -It’s great that so many teams doing completely different things (such as what they’re working on and what skills they’re using) agree to centralize on any tool—especially one that is considered a standard across open source. As a contributor to GNOME, I really appreciate that we’re using GitLab. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/10/how-gnome-uses-git - -作者:[Molly de Blanc][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mollydb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/redpanda_firefox_pet_animal.jpg?itok=aSpKsyna (red panda) -[2]: https://www.gnome.org/foundation/ -[3]: https://gnome.org/ -[4]: https://www.gtk.org/ -[5]: https://gstreamer.freedesktop.org/ -[6]: https://gitlab.gnome.org/ -[7]: https://twitter.com/csoriano1618?lang=en -[8]: https://opensource.com/article/19/8/poll-favorite-gnome-version diff --git a/translated/talk/20191015 How GNOME uses Git.md b/translated/talk/20191015 How GNOME uses Git.md new file mode 100644 index 0000000000..e9b82aa7d1 --- /dev/null +++ b/translated/talk/20191015 How GNOME uses Git.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How GNOME uses Git) +[#]: via: (https://opensource.com/article/19/10/how-gnome-uses-git) +[#]: author: (Molly de Blanc https://opensource.com/users/mollydb) + +GNOME 项目是如何使用 Git 的? +====== + +将 GNOME 项目集中在 GitLab 上的决定为整个社区(不只是开发人员)带来了好处。 + +![red panda][1] + +“您的 GitLab 是什么?”这是我在 [GNOME 基金会][2]工作的第一天被问到的第一个问题之一,该基金会是支持 GNOME 项目的非盈利组织,包括[桌面环境][3]、[GTK][4] 和 [GStreamer][5]。此人指的是我在 [GNOME 的 GitLab 实例][6上的用户名。我在 GNOME 期间,经常有人要求我提供我的 GitLab。 + +我们使用 GitLab 进行几乎所有操作。通常情况下,我会收到一些提案和参考错误报告,有时还需要修改文件。我不是以开发人员或系统管理员的身份进行此操作的。我参与了“参与度、包容性和多样性(I&D)”团队。我为 GNOME 朋友们撰写新闻通讯,并采访该项目的贡献者。我为 GNOME 活动提供赞助。我不写代码,但我每天都使用 GitLab。 + +在过去的二十年中,GNOME 项目的管理采用了各种方式。该项目的不同部分使用不同的系统来跟踪代码更改、协作以及作为项目和社交空间共享信息。但是,该项目决定,它需要更加一体化,这从构思到完成大约花费了一年的时间。 + +GNOME 希望切换到单个工具供整个社区使用的原因很多。外部项目与 GNOME 息息相关,并为它们提供与资源交互的更简单的方式对于项目至关重要,无论是支持社区还是发展生态系统。我们还希望更好地跟踪 GNOME 的指标,即贡献者的数量、贡献的类型和数量以及项目不同部分的开发进度。 + +当需要选择一种协作工具时,我们考虑了我们需要的东西。最重要的要求之一是它必须由 GNOME 社区托管。由第三方托管并不是一种选择,因此像 GitHub 和 Atlassian 这样的服务就不在考虑之中。而且,当然了,它必须是自由软件。很快,唯一真正的竞争者就是 GitLab。我们希望确保进行贡献很容易。GitLab 具有诸如单点登录的功能,该功能允许人们使用 GitHub、Google、GitLab.com 和 GNOME 帐户登录。 + +我们认为 GitLab 是一条出路,我们开始从许多工具迁移到单个工具。GNOME 董事会成员 [Carlos Soriano][7] 领导这项改变。在 GitLab 和 GNOME 社区的大力支持下,我们于 2018 年 5 月完成了该过程。 + +人们非常希望迁移到 GitLab 有助于社区的发展,并使贡献更容易。由于 GNOME 以前使用了许多不同的工具,包括 Bugzilla 和 CGit,因此很难定量地评估这次切换对贡献量的影响。但是,我们可以更清楚地跟踪一些统计数据,例如在 2018 年 6 月至 2018 年 11 月之间关闭了近 10,000 个提案,合并了 7,085 个合并请求。人们感到社区在发展壮大,越来越受欢迎,而且贡献实际上也更容易。 + +人们因不同的原因而开始使用自由软件,重要的是,可以通过为需要软件的人提供更好的资源和更多的支持来公平竞争。Git 作为一种工具已被广泛使用,并且越来越多的人使用这些技能来参与到自由软件当中。自托管的 GitLab 提供了将 Git 的熟悉度与 GitLab 提供的功能丰富、用户友好的环境相结合的绝佳机会。 + +已经一年多了,变化确实很明显。持续集成(CI)为开发带来了巨大的好处,并且已经完全集成到 GNOME 的几乎每个部分当中。不进行代码开发的团队也转而使用 GitLab 生态系统进行工作。无论是使用问题跟踪来管理分配的任务,还是使用版本控制来共享和管理资产,就连“参与度、包容性和多样性(I&D)”这样的团队都已经使用了 GitLab。 + +一个社区,即使是一个正在开发的自由软件,也很难适应新技术或新工具。在类似 GNOME 的情况下,这尤其困难,该项目[最近已经 22 岁了] [8]。像 GNOME 这样经过了 20 多年建设的项目,太多的人和组织使用了太多的部件,但迁移工作之所以能实现,这要归功于 GNOME 社区的辛勤工作和 GitLab 的慷慨帮助。 + +在为使用 Git 进行版本控制的项目工作时,我发现很方便。这是一个令人感觉舒适和熟悉的系统,是一个在工作场所和爱好项目之间保持一致的工具。作为 GNOME 社区的新成员,能够参与并使用 GitLab 真是太好了。作为社区建设者,看到这样结果是令人鼓舞的:越来越多的相关项目加入并进入生态系统;新的贡献者和社区成员对该项目做出了首次贡献;以及增强了衡量我们正在做的工作以了解其成功和成功的能力。 + +如此多的做着完全不同的事情(例如他们正在从事的不同工作以及所使用的不同技能)的团队同意集中在一个工具上(尤其是被认为是跨开源的标准工具),这一点很棒。 作为 GNOME 的贡献者,我真的非常感谢我们使用了 GitLab。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/10/how-gnome-uses-git + +作者:[Molly de Blanc][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/mollydb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/redpanda_firefox_pet_animal.jpg?itok=aSpKsyna (red panda) +[2]: https://www.gnome.org/foundation/ +[3]: https://gnome.org/ +[4]: https://www.gtk.org/ +[5]: https://gstreamer.freedesktop.org/ +[6]: https://gitlab.gnome.org/ +[7]: https://twitter.com/csoriano1618?lang=en +[8]: https://opensource.com/article/19/8/poll-favorite-gnome-version From 292bd2260937aebe9c2688948b10cd490b22fb9d Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 Jan 2020 09:23:22 +0800 Subject: [PATCH 021/285] translated --- ...ith this open source to-do list manager.md | 109 ------------------ ...ith this open source to-do list manager.md | 107 +++++++++++++++++ 2 files changed, 107 insertions(+), 109 deletions(-) delete mode 100644 sources/tech/20200117 Get started with this open source to-do list manager.md create mode 100644 translated/tech/20200117 Get started with this open source to-do list manager.md diff --git a/sources/tech/20200117 Get started with this open source to-do list manager.md b/sources/tech/20200117 Get started with this open source to-do list manager.md deleted file mode 100644 index 210c8508c1..0000000000 --- a/sources/tech/20200117 Get started with this open source to-do list manager.md +++ /dev/null @@ -1,109 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get started with this open source to-do list manager) -[#]: via: (https://opensource.com/article/20/1/open-source-to-do-list) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Get started with this open source to-do list manager -====== -Todo is a powerful way to keep track of your task list. Learn how to use -it in the seventh in our series on 20 ways to be more productive with -open source in 2020. -![Team checklist][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Track your tasks with todo - -Tasks and to-do lists are very near and dear to my heart. I'm a big fan of productivity (so much so that I do a [podcast][2] about it) and try all sorts of different applications. I've even [given presentations][3] and [written articles][4] about them. So it only makes sense that, when I talk about being productive, task and to-do list tools are certain to come up. - -![Getting fancy with Todo.txt][5] - -In all honesty, for being simple, cross-platform, and easily synchronized, you cannot go wrong with [todo.txt][6]. It is one of the two to-do list and task management apps that I keep coming back to over and over again (the other is [Org mode][7]). And what keeps me coming back is that it is simple, portable, understandable, and has many great add-ons that don't break it if one machine has them and the others don't. And since it is a Bash shell script, I have never found a system that cannot support it. - -#### Set up todo.txt - -First things first, you need to install the base shell script and copy the default configuration file to the **~/.todo** directory: - - -``` -git clone -cd todo.txt-cli -make -sudo make install -mkdir ~/.todo -cp todo.cfg ~/.todo/config -``` - -Next, set up the configuration file. I like to uncomment the color settings at this point, but the only thing that must be set up right away is the **TODO_DIR** variable: - - -``` -`export TODO_DIR="$HOME/.todo"` -``` - -#### Add to-do's - -To add your first to-do item, simply type **todo.sh add <NewTodo>**, and it will be added. This will also create three files in **$HOME/.todo/**: todo.txt, done.txt, and reports.txt. - -After adding a few items, run **todo.sh ls** to see your to-do list. - -![Basic todo.txt list][8] - -#### Manage your tasks - -You can improve it a little by prioritizing the items. To add a priority to an item, run **todo.sh pri # A**. The number is the number of the task on the list, and the letter "A" is the priority. You can set the priority as anything from A to Z since that's how it will get sorted. - -To complete a task, run **todo.sh do #** to mark the item done and move the item to done.txt. Running **todo.sh report** will write a count of done and not done items to reports.txt. - -The file format used for all three files is well documented, so you can make changes with your text editor of choice. The basic format of todo.txt is: - - -``` -`(Priority) YYYY-MM-DD Task` -``` - -The date indicates the due date of a task, if one is set. When editing the file manually, just put an "x" in front of the task to mark it as done. Running **todo.sh archive** will move these items to done.txt, and you can work in that text file and archive the done items when you have time. - -#### Set up recurring tasks - -I have a lot of recurring tasks that I need to schedule every day/week/month. - -![Recurring tasks with the ice_recur add-on][9] - -This is where todo.txt's flexibility comes in. By using [add-ons][10] in **~/.todo.actions.d/**, you can add commands and extend the functionality of the base todo.sh. The add-ons are basically scripts that implement specific commands. For recurring tasks, the plugin [ice_recur][11] should fit the bill. By following the instructions on the page, you can set up tasks to recur in a very flexible manner. - -![Todour on MacOS][12] - -There are a lot of add-ons in the directory, including syncing to some cloud services. There are also links to desktop and mobile apps, so you can keep your to-do list with you on the go. - -I've only scratched the surface of todo's functionality, so take some time to dig in and see how powerful this tool is! It really helps me keep on task every day. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-to-do-list - -作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://productivityalchemy.com/ -[3]: https://www.slideshare.net/AllThingsOpen/getting-to-done-on-the-command-line -[4]: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-line -[5]: https://opensource.com/sites/default/files/uploads/productivity_7-1.png -[6]: http://todotxt.org/ -[7]: https://orgmode.org/ -[8]: https://opensource.com/sites/default/files/uploads/productivity_7-2.png (Basic todo.txt list) -[9]: https://opensource.com/sites/default/files/uploads/productivity_7-3.png (Recurring tasks with the ice_recur add-on) -[10]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory -[11]: https://github.com/rlpowell/todo-text-stuff -[12]: https://opensource.com/sites/default/files/uploads/productivity_7-4.png (Todour on MacOS) diff --git a/translated/tech/20200117 Get started with this open source to-do list manager.md b/translated/tech/20200117 Get started with this open source to-do list manager.md new file mode 100644 index 0000000000..5845325fde --- /dev/null +++ b/translated/tech/20200117 Get started with this open source to-do list manager.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with this open source to-do list manager) +[#]: via: (https://opensource.com/article/20/1/open-source-to-do-list) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +开始使用开源待办清单管理器 +====== +Todo 是跟踪任务列表的强大方法。在我们的 20 个使用开源提升生产力的系列的第七篇文章中了解如何使用它。 +![Team checklist][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 todo 跟踪任务 + +任务和待办事项列表离我很近。我是生产力的狂热粉丝(以至于我为此做了一个[播客][2]),我尝试了各种不同的应用。我甚至为此[做了演讲][3]并[写了些文章][4]。因此,当我谈到提高工作效率时,肯定会出现任务和待办事项清单工具。 + +![Getting fancy with Todo.txt][5] + +说实话,由于简单、跨平台且易于同步,你用 [todo.txt][6] 不会错。它是两个我经常使用的待办列表以及任务管理应用之一(另一个是 [Org mode][7])。让我继续使用它的原因它简单、便携、易于理解,并且有许多很好的附加组件,并且当一台机器有附加组件,而另一台没有,也不会破坏程序。由于它是一个 Bash shell 脚本,我还没发现一个无法支持它的系统。 + +#### 设置 todo.txt + +首先,你需要安装基本 shell 脚本并将默认配置文件复制到 **~/.todo** 目录: + + +``` +git clone +cd todo.txt-cli +make +sudo make install +mkdir ~/.todo +cp todo.cfg ~/.todo/config +``` + +接下来,设置配置文件。此时,我想取消注释颜色设置,但必须马上设置的是 **TODO_DIR** 变量: + + +``` +`export TODO_DIR="$HOME/.todo"` +``` + +#### 添加待办事件 + +要添加第一个待办事件,只需输入 **todo.sh add <NewTodo>** 就能添加。这还将在 **$HOME/.todo/** 中创建三个文件:todo.txt、todo.txt 和 reports.txt。 + +添加几个项目后,运行 **todo.sh ls** 查看你的待办事项。 + +![Basic todo.txt list][8] + +#### 管理任务 + +你可以通过给项目设置优先级来稍微改善它。要向项目添加优先级,运行 **todo.sh pri # A**。数字是列表中任务的数量,而字母 ”A“ 是优先级。你可以将优先级设置为从 A 到 Z,因为这是它的排序方式。 + +要完成任务,运行**todo.sh do #** 来标记项目已完成,并将项目移动到 done.txt。运行 **todo.sh report** 会向 report.txt 写入已完成和未完成项的数量。 + +所有三个文件的格式都有详细记录,因此你可以选择自己的文本编辑器修改。todo.txt 的基本格式是: + + +``` +`(Priority) YYYY-MM-DD Task` +``` + +如果设置了任务,那么日期表示任务的到期日期。手动编辑文件时,只需在任务前面加一个 ”x“ 来标记为已完成。运行 **todo.sh archive** 会将这些项目移动到 done.txt,你可以在该文本文件编辑,并在有时间时将已完成的项目归档。 + +#### 设置重复任务 + +我有很多重复任务,我需要以每天/周/月来计划。 + +![Recurring tasks with the ice_recur add-on][9] + +这就是 todo.txt 的灵活性所在。通过在 **~/.todo.actions.d/** 中使用[附加组件][10],你可以添加命令并扩展基本 todo.sh 的功能。附加组件基本上是实现特定命令的脚本。对于重复执行的任务,插件 [ice_recur][11] 可以满足。按照页面上的说明操作,你可以以非常灵活的方式设置要重复处理的任务。 + +![Todour on MacOS][12] + +目录中有很多附加组件,包括同步到某些云服务。也有链接到桌面或移动端应用的组件,这样你可以随时看到待办列表。 + +我只介绍了这个 todo 功能的表面,所以请花点时间深入了解这个工具的强大!它真的帮助我跟上每天的任务。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-to-do-list + +作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://productivityalchemy.com/ +[3]: https://www.slideshare.net/AllThingsOpen/getting-to-done-on-the-command-line +[4]: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-line +[5]: https://opensource.com/sites/default/files/uploads/productivity_7-1.png +[6]: http://todotxt.org/ +[7]: https://orgmode.org/ +[8]: https://opensource.com/sites/default/files/uploads/productivity_7-2.png (Basic todo.txt list) +[9]: https://opensource.com/sites/default/files/uploads/productivity_7-3.png (Recurring tasks with the ice_recur add-on) +[10]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory +[11]: https://github.com/rlpowell/todo-text-stuff +[12]: https://opensource.com/sites/default/files/uploads/productivity_7-4.png (Todour on MacOS) \ No newline at end of file From 38356fac22520e687090afcc34661e06de2a07a3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 Jan 2020 09:26:25 +0800 Subject: [PATCH 022/285] translating --- ... this Twitter client for Linux to tweet from the terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md b/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md index c49b45ace4..1e9eda911f 100644 --- a/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md +++ b/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ebb37f710d3fd3262a22784f5a893c08b16ce25b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Jan 2020 09:27:45 +0800 Subject: [PATCH 023/285] PRF --- .../talk/20191015 How GNOME uses Git.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/talk/20191015 How GNOME uses Git.md b/translated/talk/20191015 How GNOME uses Git.md index e9b82aa7d1..adca6f09e9 100644 --- a/translated/talk/20191015 How GNOME uses Git.md +++ b/translated/talk/20191015 How GNOME uses Git.md @@ -1,42 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How GNOME uses Git) [#]: via: (https://opensource.com/article/19/10/how-gnome-uses-git) [#]: author: (Molly de Blanc https://opensource.com/users/mollydb) -GNOME 项目是如何使用 Git 的? +一个非技术人员对 GNOME 项目使用 GitLab 的感受 ====== -将 GNOME 项目集中在 GitLab 上的决定为整个社区(不只是开发人员)带来了好处。 +> 将 GNOME 项目集中在 GitLab 上的决定为整个社区(不只是开发人员)带来了好处。 ![red panda][1] -“您的 GitLab 是什么?”这是我在 [GNOME 基金会][2]工作的第一天被问到的第一个问题之一,该基金会是支持 GNOME 项目的非盈利组织,包括[桌面环境][3]、[GTK][4] 和 [GStreamer][5]。此人指的是我在 [GNOME 的 GitLab 实例][6上的用户名。我在 GNOME 期间,经常有人要求我提供我的 GitLab。 +“您的 GitLab 是什么?”这是我在 [GNOME 基金会][2]工作的第一天被问到的第一个问题之一,该基金会是支持 GNOME 项目(包括[桌面环境][3]、[GTK][4] 和 [GStreamer][5])的非盈利组织。此人问的是我在 [GNOME 的 GitLab 实例][6]上的用户名。我在 GNOME 期间,经常有人要求我提供我的 GitLab。 -我们使用 GitLab 进行几乎所有操作。通常情况下,我会收到一些提案和参考错误报告,有时还需要修改文件。我不是以开发人员或系统管理员的身份进行此操作的。我参与了“参与度、包容性和多样性(I&D)”团队。我为 GNOME 朋友们撰写新闻通讯,并采访该项目的贡献者。我为 GNOME 活动提供赞助。我不写代码,但我每天都使用 GitLab。 +我们使用 GitLab 进行几乎所有操作。通常情况下,我会收到一些提案issue和参考错误报告,有时还需要修改文件。我不是以开发人员或系统管理员的身份进行此操作的。我参与了“参与度、包容性和多样性(I&D)”团队。我为 GNOME 朋友们撰写新闻通讯,并采访该项目的贡献者。我为 GNOME 活动提供赞助。我不写代码,但我每天都使用 GitLab。 -在过去的二十年中,GNOME 项目的管理采用了各种方式。该项目的不同部分使用不同的系统来跟踪代码更改、协作以及作为项目和社交空间共享信息。但是,该项目决定,它需要更加一体化,这从构思到完成大约花费了一年的时间。 +在过去的二十年中,GNOME 项目的管理采用了各种方式。该项目的不同部分使用不同的系统来跟踪代码更改、协作以及作为项目和社交空间共享信息。但是,该项目决定,它需要更加地一体化,这从构思到完成大约花费了一年的时间。 -GNOME 希望切换到单个工具供整个社区使用的原因很多。外部项目与 GNOME 息息相关,并为它们提供与资源交互的更简单的方式对于项目至关重要,无论是支持社区还是发展生态系统。我们还希望更好地跟踪 GNOME 的指标,即贡献者的数量、贡献的类型和数量以及项目不同部分的开发进度。 +GNOME 希望切换到单个工具供整个社区使用的原因很多。外部项目与 GNOME 息息相关,并为它们提供更简单的与资源交互的方式对于项目至关重要,无论是支持社区还是发展生态系统。我们还希望更好地跟踪 GNOME 的指标,即贡献者的数量、贡献的类型和数量以及项目不同部分的开发进度。 -当需要选择一种协作工具时,我们考虑了我们需要的东西。最重要的要求之一是它必须由 GNOME 社区托管。由第三方托管并不是一种选择,因此像 GitHub 和 Atlassian 这样的服务就不在考虑之中。而且,当然了,它必须是自由软件。很快,唯一真正的竞争者就是 GitLab。我们希望确保进行贡献很容易。GitLab 具有诸如单点登录的功能,该功能允许人们使用 GitHub、Google、GitLab.com 和 GNOME 帐户登录。 +当需要选择一种协作工具时,我们考虑了我们需要的东西。最重要的要求之一是它必须由 GNOME 社区托管。由第三方托管并不是一种选择,因此像 GitHub 和 Atlassian 这样的服务就不在考虑之中。而且,当然了,它必须是自由软件。很快,唯一真正的竞争者出现了,它就是 GitLab。我们希望确保进行贡献很容易。GitLab 具有诸如单点登录的功能,该功能允许人们使用 GitHub、Google、GitLab.com 和 GNOME 帐户登录。 我们认为 GitLab 是一条出路,我们开始从许多工具迁移到单个工具。GNOME 董事会成员 [Carlos Soriano][7] 领导这项改变。在 GitLab 和 GNOME 社区的大力支持下,我们于 2018 年 5 月完成了该过程。 -人们非常希望迁移到 GitLab 有助于社区的发展,并使贡献更容易。由于 GNOME 以前使用了许多不同的工具,包括 Bugzilla 和 CGit,因此很难定量地评估这次切换对贡献量的影响。但是,我们可以更清楚地跟踪一些统计数据,例如在 2018 年 6 月至 2018 年 11 月之间关闭了近 10,000 个提案,合并了 7,085 个合并请求。人们感到社区在发展壮大,越来越受欢迎,而且贡献实际上也更容易。 +人们非常希望迁移到 GitLab 有助于社区的发展,并使贡献更加容易。由于 GNOME 以前使用了许多不同的工具,包括 Bugzilla 和 CGit,因此很难定量地评估这次切换对贡献量的影响。但是,我们可以更清楚地跟踪一些统计数据,例如在 2018 年 6 月至 2018 年 11 月之间关闭了近 10,000 个提案,合并了 7,085 个合并请求。人们感到社区在发展壮大,越来越受欢迎,而且贡献实际上也更加容易。 人们因不同的原因而开始使用自由软件,重要的是,可以通过为需要软件的人提供更好的资源和更多的支持来公平竞争。Git 作为一种工具已被广泛使用,并且越来越多的人使用这些技能来参与到自由软件当中。自托管的 GitLab 提供了将 Git 的熟悉度与 GitLab 提供的功能丰富、用户友好的环境相结合的绝佳机会。 -已经一年多了,变化确实很明显。持续集成(CI)为开发带来了巨大的好处,并且已经完全集成到 GNOME 的几乎每个部分当中。不进行代码开发的团队也转而使用 GitLab 生态系统进行工作。无论是使用问题跟踪来管理分配的任务,还是使用版本控制来共享和管理资产,就连“参与度、包容性和多样性(I&D)”这样的团队都已经使用了 GitLab。 +切换到 GitLab 已经一年多了,变化确实很明显。持续集成(CI)为开发带来了巨大的好处,并且已经完全集成到 GNOME 的几乎每个部分当中。不进行代码开发的团队也转而使用 GitLab 生态系统进行工作。无论是使用问题跟踪来管理分配的任务,还是使用版本控制来共享和管理资产,就连“参与度、包容性和多样性(I&D)”这样的团队都已经使用了 GitLab。 一个社区,即使是一个正在开发的自由软件,也很难适应新技术或新工具。在类似 GNOME 的情况下,这尤其困难,该项目[最近已经 22 岁了] [8]。像 GNOME 这样经过了 20 多年建设的项目,太多的人和组织使用了太多的部件,但迁移工作之所以能实现,这要归功于 GNOME 社区的辛勤工作和 GitLab 的慷慨帮助。 在为使用 Git 进行版本控制的项目工作时,我发现很方便。这是一个令人感觉舒适和熟悉的系统,是一个在工作场所和爱好项目之间保持一致的工具。作为 GNOME 社区的新成员,能够参与并使用 GitLab 真是太好了。作为社区建设者,看到这样结果是令人鼓舞的:越来越多的相关项目加入并进入生态系统;新的贡献者和社区成员对该项目做出了首次贡献;以及增强了衡量我们正在做的工作以了解其成功和成功的能力。 -如此多的做着完全不同的事情(例如他们正在从事的不同工作以及所使用的不同技能)的团队同意集中在一个工具上(尤其是被认为是跨开源的标准工具),这一点很棒。 作为 GNOME 的贡献者,我真的非常感谢我们使用了 GitLab。 +如此多的做着完全不同的事情(例如他们正在从事的不同工作以及所使用的不同技能)的团队同意汇集在一个工具上(尤其是被认为是跨开源的标准工具),这一点很棒。作为 GNOME 的贡献者,我真的非常感谢我们使用了 GitLab。 -------------------------------------------------------------------------------- @@ -45,7 +45,7 @@ via: https://opensource.com/article/19/10/how-gnome-uses-git 作者:[Molly de Blanc][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 8312cbc74e97a06e300817bbd6fb99e1f12a1940 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Jan 2020 09:28:35 +0800 Subject: [PATCH 024/285] PUB @wxy https://linux.cn/article-11806-1.html --- {translated/talk => published}/20191015 How GNOME uses Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20191015 How GNOME uses Git.md (98%) diff --git a/translated/talk/20191015 How GNOME uses Git.md b/published/20191015 How GNOME uses Git.md similarity index 98% rename from translated/talk/20191015 How GNOME uses Git.md rename to published/20191015 How GNOME uses Git.md index adca6f09e9..d39600f1ef 100644 --- a/translated/talk/20191015 How GNOME uses Git.md +++ b/published/20191015 How GNOME uses Git.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11806-1.html) [#]: subject: (How GNOME uses Git) [#]: via: (https://opensource.com/article/19/10/how-gnome-uses-git) [#]: author: (Molly de Blanc https://opensource.com/users/mollydb) From 0ef0271f2d5b900e73321257916bdb2d28a0e11c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Jan 2020 22:48:02 +0800 Subject: [PATCH 025/285] PART 4 --- ...e for programming hardware abstractions.md | 117 +++++++++--------- 1 file changed, 57 insertions(+), 60 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index fc7077f3c2..6f41779697 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -185,92 +185,89 @@ fn enable_register(&mut reg) { 在上面的代码中,预期结果是什么?好吧,代码会将启用位设置为 0,因为 `10&1 = 0`。那真不幸;最好在尝试写入之前知道你要写入字段的值是否适合该字段。事实上,我会考虑放弃错误字段值的高位*未定义行为*(喘气)。 -### Using Rust with safety in mind +### 出于安全考虑使用 Rust -How can you check that a field's value fits in its prescribed position in a general way? More type-level numbers! - -You can add a `Width` parameter to `Field` and use it to verify that a given value can fit into the field: +如何以一般方式检查字段的值是否适合其规定的位置?需要更多类型级别的数字! +你可以在 `Field` 中添加 `Width` 参数,并使用它来验证给定的值是否适合该字段: ``` -struct Field<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> { -    value: u8, -    _mask: PhantomData<Mask>, -    _offset: PhantomData<Offset>, -    _width: PhantomData<Width>, +struct Field { + value: u8, + _mask: PhantomData, + _offset: PhantomData, + _width: PhantomData, } -type RegEnabled = Field<U1,U1, U0>; -type RegInterrupt = Field<U1, U2, U1>; -type RegKind = Field<U3, op!(U7 << U2), U2>; +type RegEnabled = Field; +type RegInterrupt = Field; +type RegKind = Field; -impl<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> Field<Width, Mask, Offset> { -    fn new(val: u8) -> Option<Self> { -        if val <= (1 << Width::U8) - 1 { -            Some(Field { -                value: (val << Offset::U8) & Mask::U8, -                _mask: PhantomData, -                _offset: PhantomData, -                _width: PhantomData, -            }) -        } else { -            None -        } -    } +impl Field { + fn new(val: u8) -> Option { + if val <= (1 << Width::U8) - 1 { + Some(Field { + value: (val << Offset::U8) & Mask::U8, + _mask: PhantomData, + _offset: PhantomData, + _width: PhantomData, + }) + } else { + None + } + } } ``` -Now you can construct a `Field` only if the given value fits! Otherwise, you have `None`, which signals that an error has occurred, rather than lopping off the high bits of the value and silently writing an unexpected value. +现在,只有给定值适合时,您才能构造一个 `Field`!否则,你将得到 `None` 信号,该信号指示发生了错误,而不是放弃该值的高位并静默写入意外的值。 -Note, though, this will raise an error at runtime. However, we knew the value we wanted to write beforehand, remember? Given that, we can teach the compiler to reject entirely a program which has an invalid field value—we don’t have to wait until we run it! - -This time, you'll add a _trait bound_ (the `where` clause) to a new realization of new, called `new_checked`, that asks the incoming value to be less than or equal to the maximum possible value a field with the given `Width` can hold: +但是请注意,这将在运行时引发错误。但是,我们知道我们想事先写入的值,还记得吗?鉴于此,我们可以教编译器完全拒绝具有无效字段值的程序 —— 我们不必等到运行它! +这次,您将向 `new` 的新实现 `new_checked` 中添加一个特征绑定(`where` 子句),该函数要求输入值小于或等于给定字段用 ``Width` 所控制的最大可能值: ``` -struct Field<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> { -    value: u8, -    _mask: PhantomData<Mask>, -    _offset: PhantomData<Offset>, -    _width: PhantomData<Width>, +struct Field { + value: u8, + _mask: PhantomData, + _offset: PhantomData, + _width: PhantomData, } -type RegEnabled = Field<U1, U1, U0>; -type RegInterrupt = Field<U1, U2, U1>; -type RegKind = Field<U3, op!(U7 << U2), U2>; +type RegEnabled = Field; +type RegInterrupt = Field; +type RegKind = Field; -impl<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> Field<Width, Mask, Offset> { -    const fn new_checked<V: Unsigned>() -> Self -    where -        V: IsLessOrEqual<op!((U1 << Width) - U1), Output = True>, -    { -        Field { -            value: (V::U8 << Offset::U8) & Mask::U8, -            _mask: PhantomData, -            _offset: PhantomData, -            _width: PhantomData, -        } -    } +impl Field { + const fn new_checked() -> Self + where + V: IsLessOrEqual, + { + Field { + value: (V::U8 << Offset::U8) & Mask::U8, + _mask: PhantomData, + _offset: PhantomData, + _width: PhantomData, + } + } } ``` -Only numbers for which this property holds has an implementation of this trait, so if you use a number that does not fit, it will fail to compile. Take a look! - +只有拥有此属性的数字才具有此特征的实现,因此,如果使用不适合的数字,它将无法编译。让我们看一看! ``` -fn enable_register(&mut reg) { -    reg.update(RegEnabled::new_checked::<U10>()); +fn enable_register(&mut reg) { + reg.update(RegEnabled::new_checked::()); } -12 |     reg.update(RegEnabled::new_checked::<U10>()); -   |                           ^^^^^^^^^^^^^^^^ expected struct `typenum::B0`, found struct `typenum::B1` -   | -   = note: expected type `typenum::B0` -           found type `typenum::B1` +12 | reg.update(RegEnabled::new_checked::()); + | ^^^^^^^^^^^^^^^^ expected struct `typenum::B0`, found struct `typenum::B1` + | + = note: expected type `typenum::B0` + found type `typenum::B1` ``` -`new_checked` will fail to produce a program that has an errant too-high value for a field. Your typo won't blow up at runtime because you could never have gotten an artifact to run. +`new_checked` 将无法生成一个程序,因为该字段的值错误地过高。你的输入错误不会在运行时爆炸,因为你永远无法获得一个可以运行的工件。 -You're nearing Peak Rust in terms of how safe you can make memory-mapped hardware interactions. However, what you wrote back in the first example in C was far more succinct than the type parameter salad you ended up with. Is doing such a thing even tractable when you're talking about potentially hundreds or even thousands of registers? +就使内存映射的硬件进行交互的安全性而言,你已经接近 Peak Rust。但是,你在 C 的第一个示例中所写的内容比最终得到的一锅粥类型参数更简洁。当你谈论潜在的数百甚至数千个寄存器时,这样做是否容易处理? ### Just right with Rust: both safe and accessible From 2f6b53dc8c43cbe6b25048d9b8b3ee664674a1d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Jan 2020 23:43:30 +0800 Subject: [PATCH 026/285] PART 5 --- ...e for programming hardware abstractions.md | 199 ++++++++---------- 1 file changed, 90 insertions(+), 109 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index 6f41779697..98215f6a9f 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -269,124 +269,119 @@ fn enable_register(&mut reg) { 就使内存映射的硬件进行交互的安全性而言,你已经接近 Peak Rust。但是,你在 C 的第一个示例中所写的内容比最终得到的一锅粥类型参数更简洁。当你谈论潜在的数百甚至数千个寄存器时,这样做是否容易处理? -### Just right with Rust: both safe and accessible +### Rust 恰到好处:既安全又方便使用 -Earlier, I called out calculating masks by hand as being problematic, but I just did that same problematic thing—albeit at the type level. While using such an approach is nice, getting to the point when you can write any code requires quite a bit of boilerplate and manual transcription (I'm talking about the type synonyms here). - -Our team wanted something like the [TockOS mmio registers][7], but one that would generate typesafe implementations with the least amount of manual transcription possible. The result we came up with is a macro that generates the necessary boilerplate to get a Tock-like API plus type-based bounds checking. To use it, write down some information about a register, its fields, their width and offsets, and optional [enum][8]-like values (should you want to give "meaning" to the possible values a field can have): +早些时候,我认为手工计算掩码有问题,但我只是做了同样有问题的事情 —— 尽管是在类型级别。虽然使用这种方法很不错,但要达到编写任何代码的地步,则需要大量样板和手动转录(我在这里谈论的是类型同义词)。 +我们的团队想要像 [TockOS mmio 寄存器][7]之类的东西,但是他们会以最少的手动转录生成类型安全的实现。我们得出的结果是一个宏,该宏生成必要的样板以获得类似 Tock 的 API 以及基于类型的边界检查。 要使用它,请写下一些有关寄存器的信息,其字段、宽度和偏移量以及可选的[枚举][8]类的值(你应该为字段可能具有的值赋予“含义”): ``` register! { -    // The register's name -    Status, -    // The type which represents the whole register. -    u8, -    // The register's mode, ReadOnly, ReadWrite, or WriteOnly. -    RW, -    // And the fields in this register. -    Fields [ -        On    WIDTH(U1) OFFSET(U0), -        Dead  WIDTH(U1) OFFSET(U1), -        Color WIDTH(U3) OFFSET(U2) [ -            Red    = U1, -            Blue   = U2, -            Green  = U3, -            Yellow = U4 -        ] -    ] + // The register's name + Status, + // The type which represents the whole register. + u8, + // The register's mode, ReadOnly, ReadWrite, or WriteOnly. + RW, + // And the fields in this register. + Fields [ + On WIDTH(U1) OFFSET(U0), + Dead WIDTH(U1) OFFSET(U1), + Color WIDTH(U3) OFFSET(U2) [ + Red = U1, + Blue = U2, + Green = U3, + Yellow = U4 + ] + ] } ``` -From this, you can generate register and field types like the previous example where the indices—the `Width`, `Mask`, and `Offset`—are derived from the values input in the `WIDTH` and `OFFSET` sections of a field's definition. Also, notice that all of these numbers are `typenums`; they're going to go directly into your `Field` definitions! - -The generated code provides namespaces for registers and their associated fields through the name given for the register and the fields. That's a mouthful; here's what it looks like: +由此,你可以生成寄存器和字段类型,如上例所示,其中索引:`Width`、`Mask` 和 `Offset` 是从一个字段定义的 `WIDTH` 和 `OFFSET` 部分的输入的值派生的。另外,请注意,所有这些数字都是 “类型数字”;他们将直接进入你的 `Field` 定义! +生成的代码通过为寄存器及字段指定名称来为寄存器及其相关字段提供名称空间。这很绕口,看起来是这样的: ``` mod Status { -    struct Register(u8); -    mod On { -        struct Field; // There is of course more to this definition -    } -    mod Dead { -        struct Field; -    } -    mod Color { -        struct Field; -        pub const Red: Field = Field::<U1>new(); -        // &c. -    } + struct Register(u8); + mod On { + struct Field; // There is of course more to this definition + } + mod Dead { + struct Field; + } + mod Color { + struct Field; + pub const Red: Field = Field::new(); + // &c. + } } ``` -The generated API contains the nominally expected read and write primitives to get at the raw register value, but it also has ways to get a single field's value, do collective actions, and find out if any (or all) of a collection of bits is set. You can read the documentation on the [complete generated API][9]. +生成的 API 包含名义上期望的读取和写入的原语,以获取原始寄存器的值,但它也有办法获取单个字段的值、执行集体操作以及确定是否有任何(或全部)位集合的方法。你可以阅读[完整生成的 API][9]上的文档。 -### Kicking the tires +### 粗略检查 -What does it look like to use these definitions for a real device? Will the code be littered with type parameters, obscuring any real logic from view? +将这些定义用于实际设备会是什么样?代码中是否会充斥着类型参数,从而掩盖了视图中的实际逻辑? -No! By using type synonyms and type inference, you effectively never have to think about the type-level part of the program at all. You get to interact with the hardware in a straightforward way and get those bounds-related assurances automatically. - -Here's an example of a [UART][10] register block. I'll skip the declaration of the registers themselves, as that would be too much to include here. Instead, it starts with a register "block" then helps the compiler know how to look up the registers from a pointer to the head of the block. We do that by implementing `Deref` and `DerefMut`: +不会!通过使用类型同义词和类型推断,你实际上根本不必考虑程序的类型级别部分。你可以直接与硬件交互,并自动获得与边界相关的保证。 +这是一个 [UART] [10] 寄存器块的示例。我将跳过寄存器本身的声明,因为包括在这里就太多了。而是从寄存器“块”开始,然后帮助编译器知道如何从指向该块开头的指针中查找寄存器。我们通过实现 `Deref` 和 `DerefMut` 来做到这一点: ``` #[repr(C)] pub struct UartBlock { -    rx: UartRX::Register, -    _padding1: [u32; 15], -    tx: UartTX::Register, -    _padding2: [u32; 15], -    control1: UartControl1::Register, + rx: UartRX::Register, + _padding1: [u32; 15], + tx: UartTX::Register, + _padding2: [u32; 15], + control1: UartControl1::Register, } pub struct Regs { -    addr: usize, + addr: usize, } impl Deref for Regs { -    type Target = UartBlock; + type Target = UartBlock; -    fn deref(&self) -> &UartBlock { -        unsafe { &*(self.addr as *const UartBlock) } -    } + fn deref(&self) -> &UartBlock { + unsafe { &*(self.addr as *const UartBlock) } + } } impl DerefMut for Regs { -    fn deref_mut(&mut self) -> &mut UartBlock { -        unsafe { &mut *(self.addr as *mut UartBlock) } -    } + fn deref_mut(&mut self) -> &mut UartBlock { + unsafe { &mut *(self.addr as *mut UartBlock) } + } } ``` -Once this is in place, using these registers is as simple as `read()` and `modify()`: - +一旦到位,使用这些寄存器就像 `read()` 和 `modify()` 一样简单: ``` fn main() { -    // A pretend register block. -    let mut x = [0_u32; 33]; + // A pretend register block. + let mut x = [0_u32; 33]; -    let mut regs = Regs { -        // Some shenanigans to get at `x` as though it were a -        // pointer. Normally you'd be given some address like -        // `0xDEADBEEF` over which you'd instantiate a `Regs`. -        addr: &mut x as *mut [u32; 33] as usize, -    }; + let mut regs = Regs { + // Some shenanigans to get at `x` as though it were a + // pointer. Normally you'd be given some address like + // `0xDEADBEEF` over which you'd instantiate a `Regs`. + addr: &mut x as *mut [u32; 33] as usize, + }; -    assert_eq!(regs.rx.read(), 0); + assert_eq!(regs.rx.read(), 0); -    regs.control1 -        .modify(UartControl1::Enable::Set + UartControl1::RecvReadyInterrupt::Set); + regs.control1 + .modify(UartControl1::Enable::Set + UartControl1::RecvReadyInterrupt::Set); -    // The first bit and the 10th bit should be set. -    assert_eq!(regs.control1.read(), 0b_10_0000_0001); + // The first bit and the 10th bit should be set. + assert_eq!(regs.control1.read(), 0b_10_0000_0001); } ``` -When we're working with runtime values we use `Option` like we saw earlier. Here I'm using `unwrap`, but in a real program with unknown inputs, you'd probably want to check that you got a `Some` back from that new call:[1][11],[2][12] - +当我们使用运行时值时,我们使用如前所述的 `Option`。这里我使用的是 `unwrap`,但是在一个实际的输入未知的程序中,你可能想检查一下从新调用中返回的 “Some”: [^1] [^2] ``` fn main() { @@ -405,65 +400,51 @@ fn main() { } ``` -### Decoding failure conditions - -Depending on your personal pain threshold, you may have noticed that the errors are nearly unintelligible. Take a look at a not-so-subtle reminder of what I'm talking about: +### 解码失败条件 +根据你的个人痛苦阈值,你可能已经注意到错误几乎是无法理解的。看一下我在说什么的微妙提醒: ``` -error[E0271]: type mismatch resolving `<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UTerm, typenum::B1>, typenum::B0>, typenum::B1>, typenum::B0>, typenum::B0> as typenum::IsLessOrEqual<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UTerm, typenum::B1>, typenum::B0>, typenum::B1>, typenum::B0>>>::Output == typenum::B1` -  --> src/main.rs:12:5 -   | -12 |     less_than_ten::<U20>(); -   |     ^^^^^^^^^^^^^^^^^^^^ expected struct `typenum::B0`, found struct `typenum::B1` -   | -   = note: expected type `typenum::B0` -       found type `typenum::B1` +error[E0271]: type mismatch resolving `, typenum::B0>, typenum::B1>, typenum::B0>, typenum::B0> as typenum::IsLessOrEqual, typenum::B0>, typenum::B1>, typenum::B0>>>::Output == typenum::B1` + --> src/main.rs:12:5 + | +12 | less_than_ten::(); + | ^^^^^^^^^^^^^^^^^^^^ expected struct `typenum::B0`, found struct `typenum::B1` + | + = note: expected type `typenum::B0` + found type `typenum::B1` ``` -The `expected typenum::B0 found typenum::B1` part kind of makes sense, but what on earth is the `typenum::UInt<typenum::UInt, typenum::UInt…` nonsense? Well, `typenum` represents numbers as binary [cons][13] cells! Errors like this make it hard, especially when you have several of these type-level numbers confined to tight quarters, to know which number it's talking about. Unless, of course, it's second nature for you to translate baroque binary representations to decimal ones. - -After the `U100`th time attempting to decipher any meaning from this mess, a teammate got Mad As Hell And Wasn't Going To Take It Anymore and made a little utility, `tnfilt`, to parse the meaning out from the misery that is namespaced binary cons cells. `tnfilt` takes the cons cell-style notation and replaces it with sensible decimal numbers. We imagine that others will face similar difficulties, so we shared [`tnfilt`][14]. You can use it like this: +` expected typenum::B0 found typenum::B1` 部分是有意义的,但是 ` typenum::UInt&1 | tnfilt` +$ cargo build 2>&1 | tnfilt ``` -It transforms the output above into something like this: - +它将上面的输出转换为如下所示: ``` -`error[E0271]: type mismatch resolving `>::Output == typenum::B1`` +error[E0271]: type mismatch resolving `>::Output == typenum::B1` ``` -Now _that_ makes sense! +现在*这*很有意义! -### In conclusion +### 结论 -Memory-mapped registers are used ubiquitously when interacting with hardware from software, and there are myriad ways to portray those interactions, each of which has a different place on the spectra of ease-of-use and safety. We found that the use of type-level programming to get compile-time checking on memory-mapped register interactions gave us the necessary information to make safer software. That code is available in the `[bounded-registers][15] crate` (Rust package). +当与软件中的硬件进行交互时,普遍使用内存映射寄存器,并且有无数种方法来描述这些交互,每种方法在易用性和安全性上都有不同的权衡。我们发现使用类型级编程来获取内存映射寄存器交互的编译时检查为我们提供了制作更安全软件的必要信息。该代码可在 [bounded-registers][15] crate(Rust包)中找到。 -Our team started out right at the edge of the more-safe side of that safety spectrum and then tried to figure out how to move the ease-of-use slider closer to the easy end. From those ambitions, `bounded-registers` was born, and we use it anytime we encounter memory-mapped devices in our adventures at Auxon. +我们的团队从安全性较高的一面开始,然后尝试找出如何将易用滑块移近易用端。从这些雄心壮志中,“边界寄存器”就诞生了,我们在 Auxon 冒险中遇到遇到内存映射设备的任何时候都可以使用它。 * * * - 1. Technically, a read from a register field, by definition, will only give a value within the prescribed bounds, but none of us lives in a pure world, and you never know what's going to happen when external systems come into play. You're at the behest of the Hardware Gods here, so instead of forcing you into a "might panic" situation, it gives you the `Option` to handle a "This Should Never Happen" case. - - 2. `get_field` looks a little weird. I'm looking at the `Field::Read` part, specifically. `Field` is a type, and you need an instance of that type to pass to `get_field`. A cleaner API might be something like: - - -``` -`regs.rx.get_field::();` -``` - -But remember that `Field` is a type synonym that has fixed indices for width, offset, etc. To be able to parameterize `get_field` like this, you'd need higher-kinded types. - - - +[^1]: 从技术上讲,从定义上看,从寄存器字段读取的值只能在规定的范围内,但是我们当中没有一个人生活在一个纯净的世界中,而且你永远都不知道外部系统发挥作用时会发生什么。你是在这里接受硬件之神的命令,因此与其强迫你进入“可能的恐慌”状态,还不如给你提供处理“这将永远不会发生”的机会。 +[^2]: `get_field` 看起来有点奇怪。我正在专门查看 `Field::Read` 部分。`Field` 是一种类型,你需要该类型的实例才能传递给 `get_field`。更干净的 API 可能类似于:`regs.rx.get_field::();`但是请记住,`Field` 是类型的同义词,它具有固定的宽度、偏移量等索引。要像这样对 `get_field` 进行参数化,你需要使用更高级的类型。 * * * -_This originally appeared on the [Auxon Engineering blog][16] and is edited and republished with permission._ +此内容最初出现在 [Auxon Engineering 博客] [16]上,并经许可进行编辑和重新发布。 -------------------------------------------------------------------------------- @@ -471,7 +452,7 @@ via: https://opensource.com/article/20/1/c-vs-rust-abstractions 作者:[Dan Pittman][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 54af0d82109dd2bec8c2d8a94b50f05e295404bc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Jan 2020 00:55:43 +0800 Subject: [PATCH 027/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=20Read?= =?UTF-8?q?=20Reddit=20from=20the=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200121 Read Reddit from the Linux terminal.md --- ...121 Read Reddit from the Linux terminal.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20200121 Read Reddit from the Linux terminal.md diff --git a/sources/tech/20200121 Read Reddit from the Linux terminal.md b/sources/tech/20200121 Read Reddit from the Linux terminal.md new file mode 100644 index 0000000000..81c7e9d35e --- /dev/null +++ b/sources/tech/20200121 Read Reddit from the Linux terminal.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Read Reddit from the Linux terminal) +[#]: via: (https://opensource.com/article/20/1/open-source-reddit-client) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Read Reddit from the Linux terminal +====== +Take brief mental breaks from your work with Reddit client Tuir in the +eleventh in our series on 20 ways to be more productive with open source +in 2020. +![Digital creative of a browser on the internet][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Read Reddit with Tuir + +Taking short breaks is essential in staying productive. One of the places I like to go when taking a break is [Reddit][2], which can be a great resource if you want it to be. I find all kinds of articles there about DevOps, productivity, Emacs, chickens, and some ChromeOS projects I play with. These discussions can be valuable. I also follow a couple of subreddits that are just pictures of animals because I like pictures of animals (and not just chickens), and sometimes after a long work session, what I really need are kitten pictures. + +![/r/emacs in Tuir][3] + +When I'm reading Reddit (and not just looking at pictures of baby animals), I use [Tuir][4], which stands for Terminal UI for Reddit. Tuir is a feature-complete Reddit client and can be run on any system that runs Python. Installation is done through the pip Python installer and is exceptionally painless. + +On its first run, Tuir will take you to the default article list on Reddit. The top and bottom of the screen have bars that list different commands. The top bar shows your location on Reddit, and the second line shows the commands filtered by the Reddit "Hot/New/Controversial/etc." categories. Filtering is invoked by pressing the number next to the filter you want to use. + +![Filtering by Reddit's "top" category][5] + +You can navigate through the list with the arrow keys, or with the **j**, **k**, **h**, and **l** keys, the same ones you use for Vi/Vim. The bottom bar has commands for navigating the app. If you want to jump to another subreddit, simply hit the **/** key to open a prompt and type the name of the subreddit you want to interact with. + +![Logging in][6] + +Some things aren't accessible unless you are logged in. Tuir will prompt you if you try to do something that requires logging in, like posting a new article (**c**) or up/down voting (**a** and **z**, respectively). To log in, press the **u** key. This will launch a browser to log in via OAuth2, and Tuir will save the token. Afterward, your username should appear in the top-right of the screen. + +Tuir can also launch your browser to view images, load links, and so on. With a little tuning, it can even show images on the terminal (although I didn't manage to get that to work properly). + +Overall, I'm pretty happy with Tuir for quickly catching up on Reddit when I need a break. + +Tuir is one of two forks of the now-defunct [RTV][7]. The other is [TTRV][8], which isn't available via pip (yet) but has the same features. I'm looking forward to seeing how they differentiate themselves over time. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-reddit-client + +作者:[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_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://www.reddit.com/ +[3]: https://opensource.com/sites/default/files/uploads/productivity_11-1.png (/r/emacs in Tuir) +[4]: https://gitlab.com/ajak/tuir +[5]: https://opensource.com/sites/default/files/uploads/productivity_11-2.png (Filtering by Reddit's "top" category) +[6]: https://opensource.com/sites/default/files/uploads/productivity_11-3.png (Logging in) +[7]: https://github.com/michael-lazar/rtv +[8]: https://github.com/tildeclub/ttrv From 0d4c1fc5d3a4596d9eaadf4194bec5dc05bb0ef6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Jan 2020 00:56:31 +0800 Subject: [PATCH 028/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=2013=20o?= =?UTF-8?q?f=20the=20best=20React=20JavaScript=20frameworks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200121 13 of the best React JavaScript frameworks.md --- ...of the best React JavaScript frameworks.md | 496 ++++++++++++++++++ 1 file changed, 496 insertions(+) create mode 100644 sources/tech/20200121 13 of the best React JavaScript frameworks.md diff --git a/sources/tech/20200121 13 of the best React JavaScript frameworks.md b/sources/tech/20200121 13 of the best React JavaScript frameworks.md new file mode 100644 index 0000000000..e82ef14a8a --- /dev/null +++ b/sources/tech/20200121 13 of the best React JavaScript frameworks.md @@ -0,0 +1,496 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (13 of the best React JavaScript frameworks) +[#]: via: (https://opensource.com/article/20/1/react-javascript-frameworks) +[#]: author: (Amit Dua https://opensource.com/users/amitdua) + +13 of the best React JavaScript frameworks +====== +If you're using React.js or React Native to create user interfaces, try +these frameworks. +![Javascript code close-up with neon graphic overlay][1] + +React.js and React Native are popular open source platforms for developing user interfaces (UIs); both rank well for desirability and use in StackOverflow's 2019 Developer Survey. React.js was developed by Facebook in 2011 as a JavaScript library to address the need for cross-platform, dynamic, and high-performing UIs, while React Native, which Facebook released in 2015, is used for building native applications using JavaScript. + +The following are 13 of the best React JavaScript frameworks; all are open source—the first 11 (like React) are licensed under the MIT license and the latter two are licensed under Apache 2.0. + +### 1\. Create React App + +This command-line interface from Facebook developers is a must-have for every React Native project. The reason is that the [Create React App][2] is easy to use and prevents you from having to manually set up and configure your app, thereby saving you a lot of time and effort. With just a simple command, everything will be ready for you to create a React native project easily. You can use it to build a catalog and files, and the framework also includes tools to build, test, and launch your application. + + +``` +# Install package +$ npm install -g create-react-native-web-app +  +# Run create-react-native-web-app <project-directory> +$ create-react-native-web-app myApp +  +# cd into your <project-directory> +$ cd myApp +  +# Run Web/Ios/Android development +# Web +$ npm run web +  +# IOS (simulator) +$ npm run ios +  +# Android (connected device) +$ npm run android +``` + +#### Why opt for Create React App + + 1. Top-notch tool developed with a configure bundle, transpiler, and test runner + 2. No configuration and no extra files at the app structure + 3. Fixed Development stack + 4. Effective Fast developing tool + + + +### 2\. Material Kit React + +Inspired by Google's Material Design system, [Material Kit React][3] can be an excellent choice for building React UI components. The best thing about this library is that it offers a lot of components that are built to fit together and look incredible. There are over 1,000 fully coded components, and each one comes with separate layers organized in folders. This means you have thousands of options to choose from. There are several example pages as well, in case you want to get inspiration or share an idea or concept with someone. + +#### Installing the Material Kit + + +``` +`  $ npm install @material-ui/core` +``` + +#### Implementation + + +``` +import React from 'react'; +import Button from '@material-ui/core/Button'; + +const App = () => ( +  <Button variant="contained" color="primary"> +    Hello World +  </Button> +); +``` + +The Material-UI component work without any additional setup, and do not pollute the global scope. + +#### Advantage + +The React component supports easier and faster web development. With it, you can build your own design system, or start with Material Design. + +### 3\. Shards React + +This modern React UI kit has been built from scratch to achieve fast performance. It has a modern design system that lets you customize things the way you want. You can even download the source files to customize things at the code level. Also, the SCSS syntax used for styling enhances the development experience. + +[Shards React][4] is based on Shards and uses React Datepicker, React Popper (a positioning engine), and noUISlider. It also supports incredible Material Design icons. There are some pre-made versions to help you gain some inspiration and get started. + +#### Installation Shards with Yarn or NPM + + +``` +# Yarn +yarn add shards-react + +# NPM +npm i shards-react +``` + +#### Advantages + + 1. Shards is lightweight having a small footprint and weighting ~13kb minified and gzipped + 2. Shards is responsive by default being able to adapt and reflow its layout to any screen size + 3. Shards is well documented so you can start building beautiful interfaces as soon as possible + + + +### 4\. Styled Components + +This efficient CSS tool helps build small, reusable components that are responsible for an app's visual interface. With traditional CSS, you can accidentally overwrite the selectors used in other places on the website, but [Styled Components][5] can help you completely avoid this problem by using a CSS syntax directly inside your components. + +#### Installation + + +``` +`npm install --save styled-components` +``` + +#### Implementation + + +``` +const Button = styled.button` +  background: background_type; +  border-radius: radius_value; +  border: abc; +  color: name_of_color; +  Margin: margin_value; +  padding: value; +``` + +#### Advantage + + 1. Make components more readable + 2. Components rely on JavaScript for their style + 3. Build custom components with CSS + 4. Inline styling + 5. Convert component even the custom component to a styled component by simply invoking styled() + + + +### 5\. Redux + +[Redux][6] is a state-management solution for JavaScript applications. While it is mostly used for React.js, you can also use it for other React-like frameworks. + +#### Installation + + +``` +sudo npm install redux +sudo npm install react-redux +``` + +#### Implementation + + +``` +import { createStore } from "redux"; +import rotateReducer from "reducers/rotateReducer"; + +function configureStore(state = { rotating: value}) { +  return createStore(rotateReducer,state); +} + +export default configureStore; +``` + +#### Advantage + + 1. Predictable state update helps in defining the data flow of the application + 2. Logic easier to test and time-travel debugging with reducer functions + 3. Centralizing the state + + + +### 6\. React Virtualized + +This React Native JavaScript framework helps in large-list and tabular-data rendering. Using [React Virtualized][7], you can restrict the number of requests and Document Object Model (DOM) elements, thus enhancing the performance of React apps. + +#### Installation + + +``` +`npm install react-virtualized` +``` + +#### Implementation + + +``` +import 'react-virtualized/styles.css' +import { Column, Table } from 'react-virtualized' +import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer' +import List from 'react-virtualized/dist/commonjs/List' +{ +  alias: { +    'react-virtualized/List': 'react-virtualized/dist/es/List', +  }, +  ...rest +} +``` + +#### Advantages + + 1. Display a large amount of data efficiently + 2. Rendering a huge data set + 3. Implements virtual rendering with a set of components + + + +### 7\. React DnD + +[ReactDnD][8] is responsible for the creation of complex drag-and-drop interfaces. There are dozens of drag-and-drop libraries, but React DnD stands out because it is built on top of modern HTML5's drag-and-drop API, making the process of creating interfaces easy. + +#### Installation + + +``` +`npm install react-dnd-preview` +``` + +#### Implementation + + +``` + import Preview from 'react-dnd-preview'; +  +  const generatePreview = ({itemType, item, style}) => { +    return <div class="item-list" style={style}>{itemType}</div>; +  }; +  +  class App extends React.Component { +    ... +  +    render() { +      return ( +        <DndProvider backend={MyBackend}> +          <ItemList /> +          <Preview generator={generatePreview} /> +          // or +          <Preview>{generatePreview}</Preview> +        </DndProvider> +      ); +    } +  } +``` + +#### Advantages + + 1. Beautiful and natural movement of items bouquet + 2. Powerful keyboard and screen reader support wheelchair + 3. Extremely performant + 4. Clean and powerful api + 5. Plays extremely well with standard browser interactions + 6. Unopinionated styling + 7. No creation of additional wrapper dom nodes + + + +### 8\. React Bootstrap + +This UI Kit library replaces Bootstrap's JavaScript with React, giving you more control over the functions of each component. Because each component is built to be easily accessible, [React Bootstrap][9] can be beneficial for frontend framework building. There are thousands of bootstrap themes to choose from. + +#### Installation + + +``` +`npm install react-bootstrap bootstrap` +``` + +#### Implementation + + +``` +import 'bootstrap/dist/css/bootstrap.min.css'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import './index.css'; +import App from './App'; +import registerServiceWorker from './registerServiceWorker'; + +ReactDOM.render(<App />, document.getElementById('root')); +registerServiceWorker(); +``` + +#### Advantages + + 1. Can easily import required code/component + 2. Saves typing and bugs by compressing the Bootstrap + 3. Reduces typing efforts and conflicts by compressing the Bootstrap + 4. It is easy to use + 5. It encapsulates in elements + + + +### 9\. React Suite + +[React Suite][10] is another efficient React.js framework that contains a wide range of component libraries for enterprise system products. It supports all major browsers and platforms, making it suitable for just about any system. It also supports server-side rendering. + +#### Installation + + +``` +`npm i rsuite --save` +``` + +#### Implementation + + +``` +import { Button } from 'rsuite'; +import 'rsuite/styles/less/index.less'; +ReactDOM.render(<Button>Button</Button>, mountNode); +``` + +#### Advantages + + 1. Easily manage the application easily by the help of global accessing features + 2. Redux library centralizes the state management + 3. Redux is flexible with all the UI layers and has a large ecosystem + 4. Redux reduces this complexity and provides global accessibility + + + +### 10\. PrimeReact + +The best thing about [PrimeReact][11] is that it provides components that cover almost all of a UI's basic requirements, such as input options, menus, data presentations, messages, etc. The framework also pays close attention to the mobile experience, thus helping you design touch-optimized elements. + +#### Installation + + +``` +npm install primereact --save +npm install primeicons --save +``` + +#### Implementation + + +``` +import {Dialog} from 'primereact/dialog'; +import {Accordion,AccordionTab} from 'primereact/accordion'; +dependencies: { +    "react": "^16.0.0", +    "react-dom": "^16.0.0", +    "react-transition-group": "^2.2.1", +    "classnames": "^2.2.5", +    "primeicons": "^2.0.0" +} +``` + +#### Advantages + + 1. Simplicity and Performance + 2. Ease of Use + 3. Spring Applications + 4. Create rich user interfaces + 5. Usability and simplicity + + + +### 11\. React Router + +[React Router][12] is quite popular in the React Native developer community because it is very easy to start working with. All you need is Git and the npm package manager installed on your PC, a basic knowledge of React, and a willingness to learn. There is nothing too complicated. + +#### Installation + + +``` +`$ npm install --save react-router` +``` + +#### Implementation + + +``` +import { Router, Route, Switch } from "react-router"; +  +// using CommonJS modules +var Router = require("react-router").Router; +var Route = require("react-router").Route; +var Switch = require("react-router").Switch; +``` + +#### Advantages + + 1. Dynamic route matching + 2. CSS transitions on views when navigating + 3. Standardized app structure and behavior + + + +### 12\. Grommet + +[Grommet][13] is used for creating responsive and accessible mobile-first web apps. The best thing about this Apache 2.0-licensed JavaScript framework is that it offers accessibility, modularity, responsiveness, and theming in one small package. Perhaps this is one of the major reasons it is widely used by companies like Netflix, GE, Uber, and Boeing. + +#### Installation for yarn and npm + + +``` +` $ npm install grommet styled-components --save` +``` + +#### Implementation + + +``` +"grommet-controls/chartjs": { +          "transform": "grommet-controls/es6/chartjs/${member}", +          "preventFullImport": true, +          "skipDefaultConversion": true +``` + +#### Advantages + + 1. Create one toolkit as a packaged deal + 2. Take the open-door policy to the extreme + 3. Restructuring can help influence an established org + + + +### 13\. Onsen UI + +[Onsen UI][14] is another mobile app development framework that uses HTML5 and JavaScript and offers integration with Angular, Vue, and React. It is licensed under Apache 2.0. + +Onsen offers tabs, a side menu, stack navigation, and other components. The best thing about the framework is that all of its components have iOS and Android Material Design support along with automatic styling, which changes the app's appearance depending on the platform. + +#### Installation + + +``` +`npm install onsenui` +``` + +#### Implementation + + +``` +(function() { +    'use strict'; +    var module = angular.module('app', ['onsen']); + +    module.controller('AppController', function($scope) { +      // more to come here +    }); + +})(); +``` + +#### Advantages + + 1. Onsen UI is built on free and open-source code + 2. Doesn't force any type of DRM on apps developed with it + 3. Compiles JavaScript and HTML5 code + 4. Offers end users the native experience + + + +* * * + +What are your favorite React JavaScript frameworks? Please share them in the comments. + +Learn more about React Native, a framework for building native apps using React and JavaScript. + +Whether you are new to JavaScript or an experienced JavaScript developer, using libraries and... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/react-javascript-frameworks + +作者:[Amit Dua][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amitdua +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_javascript.jpg?itok=60evKmGl (Javascript code close-up with neon graphic overlay) +[2]: https://github.com/facebook/create-react-app +[3]: https://github.com/creativetimofficial/material-kit-react +[4]: https://github.com/DesignRevision/shards-react +[5]: https://github.com/styled-components/styled-components +[6]: https://github.com/reduxjs/redux +[7]: https://github.com/bvaughn/react-virtualized +[8]: https://github.com/react-dnd/react-dnd/ +[9]: https://github.com/react-bootstrap/react-bootstrap +[10]: https://github.com/rsuite/rsuite +[11]: https://github.com/primefaces/primereact +[12]: https://github.com/ReactTraining/react-router +[13]: https://github.com/grommet/grommet +[14]: https://github.com/OnsenUI/OnsenUI From 98aa3020a33c981fc754a0324537b088cba4053e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Jan 2020 00:57:00 +0800 Subject: [PATCH 029/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=20What?= =?UTF-8?q?=20you=20need=20to=20know=20about=20System76's=20open=20source?= =?UTF-8?q?=20firmware=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200121 What you need to know about System76-s open source firmware project.md --- ...System76-s open source firmware project.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20200121 What you need to know about System76-s open source firmware project.md diff --git a/sources/tech/20200121 What you need to know about System76-s open source firmware project.md b/sources/tech/20200121 What you need to know about System76-s open source firmware project.md new file mode 100644 index 0000000000..5e391d05c2 --- /dev/null +++ b/sources/tech/20200121 What you need to know about System76-s open source firmware project.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about System76's open source firmware project) +[#]: via: (https://opensource.com/article/20/1/system76-open-source-firmware) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +What you need to know about System76's open source firmware project +====== +This Q&A with System76 principal engineer Jeremy Soller discusses the +company's project for an open source embedded controller. +![Person using a laptop][1] + +When you power on your computer, there’s a lot more going on than you might think. One of the most important elements involved is the embedded controller (EC). This is what is responsible for providing abstractions for the battery, charging system, keyboard, touchpad, suspend/resume, and thermal control, among others. These controllers are typically proprietary and usually run proprietary firmware. + +System76 is about to change that paradigm. Recently, the company adopted [coreboot][2] for their Galago Pro and Darter Pro laptop models. Now they intend to extend the open source approach to the EC. There is a project associated with Chrome OS devices called [Chromium EC][3] that is open source; however, it is only available for Chromebooks and specific EC chips. System76 wanted to supply their customers with an open source embedded controller firmware, too. + +They had to start from scratch with a project that can compile for the EC architecture they have in their laptops, the [Intel 8051][4]. Their project for an [open source EC][5], the System76 EC, is a GPLv3-licensed embedded controller firmware for System76 laptops. It is designed to be portable to boards using several 8-bit microcontrollers. This project has grown to the point where it is now possible to boot a System76 Galago Pro and have the battery, keyboard, touchpad, suspend/resume, and thermal control mentioned earlier. + +Eager to learn more, I emailed [Jeremy Soller][6], who is Principal Engineer at System76, for a deeper dive. Below are some highlights from our conversation. + +### Q: What is the importance of the Intel 8051? Do all laptops use that chipset? + +A: The embedded controller in our laptops, the ITE IT8587E, uses the Intel 8051 instruction set. Not all laptops use this instruction set, but many do. This is important because we need a toolchain that can compile firmware for the 8051 instruction set, as well as firmware that is written for that toolchain. + +### Q: What is involved in writing open code to utilize the Intel 8051? + +A: Mostly we have to define the registers for utilizing hardware on the embedded controller. There are protocols like SMBus and PECI that are implemented in hardware and need drivers for them. These drivers often have to be written for each embedded controller to abstract its hardware, so there is a common interface. Our EC firmware has abstractions for some Arduinos as well as the EC in our laptops, so we can write firmware that is portable. + +### Q: Google developed an open EC. Why not fork that project? + +A: Our initial concept was to utilize Chromium EC for our open EC firmware, but this was not possible. After discussions with members of the team at Google working on it, it became clear that the firmware was not capable of being ported to 8-bit microcontrollers like the 8051 used in our EC, or the AVR used in many Arduinos. It was mostly targeted to ARM microcontrollers. We mutually concluded that it was better to start a new project targeting 8-bit microcontrollers, which is a new codebase that is GPLv3, as opposed to the BSD license used by Chromium EC. + +### Q: How significant is it that System76 is open sourcing the code? + +A: The only other x86_64 laptops with open source EC firmware are certain Chromebooks using Chromium EC. However, these laptops have poor support for full desktop Linux distributions such as Ubuntu. We are providing users of our laptops with significant capabilities to view and modify the behavior of the laptop to their needs, all while running a full desktop operating system. When it is paired with our open system firmware, there is very little that a user cannot do with one of these laptops. + +### Q: What implications does open code have for firmware and other developers? + +A: I strongly believe that open EC firmware will be just as important for hardware customization as open system firmware. The user can adjust keyboard mappings, change fan curves, modify battery charging settings, and more. The most exciting thing about this is that I cannot predict all that is possible with this change. Many of the components in the system are tied to the EC firmware. Having the ability to change the EC and system firmware means these components could potentially be modified in a large number of different, unpredictable ways. + +### Q: What is really important about developing software for this EC, and what sets it apart? + +A: Something particularly important is that the EC we are using is the IT8587E, and its instruction set architecture is Intel 8051. Chromium EC cannot be compiled for the 8051, due to being targeted toward 32-bit microcontrollers. Our project aims to support the ubiquitous 8-bit microcontrollers from many vendors, as well as Arduino’s for easy prototyping. In addition, this unifies the work we were doing on [Thelio Io][7] with the work we have done on laptop firmware. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/system76-open-source-firmware + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/article/19/11/coreboot-system76-laptops +[3]: https://chromium.googlesource.com/chromiumos/platform/ec/+/master/README.md +[4]: https://en.wikipedia.org/wiki/Intel_MCS-51 +[5]: https://github.com/system76/ec +[6]: https://www.linkedin.com/in/jeremy-soller-0475a117/ +[7]: https://opensource.com/article/18/11/system76-thelio-desktop-computer From 4f16cc0aa33d7bf3b337f8e4e1d0af79cfecd2ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Jan 2020 00:57:20 +0800 Subject: [PATCH 030/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=20Never?= =?UTF-8?q?=20enough:=20Working=20openly=20with=20anxiety?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200121 Never enough- Working openly with anxiety.md --- ...ver enough- Working openly with anxiety.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20200121 Never enough- Working openly with anxiety.md diff --git a/sources/tech/20200121 Never enough- Working openly with anxiety.md b/sources/tech/20200121 Never enough- Working openly with anxiety.md new file mode 100644 index 0000000000..5fb89e3bc1 --- /dev/null +++ b/sources/tech/20200121 Never enough- Working openly with anxiety.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Never enough: Working openly with anxiety) +[#]: via: (https://opensource.com/open-organization/20/1/leading-openly-anxiety) +[#]: author: (Sam Knuth https://opensource.com/users/samfw) + +Never enough: Working openly with anxiety +====== +Open organizations reward initiative. For leaders with anxiety, that may +fuel some exhausting patterns. +![A graph of a wave.][1] + +_Editor's note: This article is part of a series on working with mental health conditions. It details the author's personal experiences and is not meant to convey professional medical advice or guidance._ + +Something in [a recent podcast interview][2] with food writer Melissa Clark caught my ear. Asked if she was a "productive person,'' Clark replied by saying: "I am an anxious person. I have a lot of anxiety, and my way of coping with it is to be very, very busy […]. That's how I deal with the world. I [pause] _do_." + +Clark's point resonated with me, because I live with multiple mental health conditions that have a fundamental impact on how I approach my work. And I believe they've played a role in the career success I've experienced. + +I have [generalized anxiety disorder][3] and [obsessive-compulsive disorder][4] (OCD). Both of these conditions have had serious impacts on my life. Some of those impacts have been disruptive. At the same time, some have contributed positively to my success and my development as a leader in a growing organization. + +I've spent most of my career in an organization built on openness and transparency, and yet I have rarely spoken about my mental health and how it might impact my work. In sharing these stories now, I hope to help reduce the [stigma of mental health at work][5] and connect with others who may be experiencing similar or related situations. Given the prevalence of [mental illness globally][6], chances are good that if you don't experience a mental health condition first hand, then you're likely working on a daily basis with someone who does. + +Learning about how mental illness manifests at work may help you navigate relationships with others as well as your own challenges. As a leader in an open organization, I feel compelled to share my experiences in the hope that they are useful to others. Working openly has specific implications for me—and, I suspect, for others with similar mental health conditions—which I'll detail in this series. + +### How it started + +My anxiety and OCD started shortly after I graduated from college and was living in New York City (though I could probably trace their histories further, this was the moment when they became apparent). The wave of confidence I rode during the dot com boom was crushed in the bubble-bursting crash in March of 2001. The memory of coming into work, being called into an all hands meeting (the first we'd ever had at my small company), and being told that as of today there was no money to make payroll, is etched into my mind. + +My girlfriend and I had just moved into a $2100-per-month apartment. Fear of not being able to pay the rent, or being otherwise swallowed up by the city, resulted in a general sense of unease and nervousness in my gut, combined with very real symptoms of OCD. + +For example, while walking to work at a temp job I took after my company folded, I would wonder if I had remembered to lock the apartment door. I would retrace the steps of my morning routine in my mind, trying to find that moment when I turned the key. If I couldn't specifically remember, the sense of unease and worry in my gut would build to the point that I couldn't think about anything else. Frequently, I would turn around, rush back home, and double check that the door was locked. When I did so, I would have to do something memorable, like repeat a phrase out loud, so that I could mark the moment in my memory. Then, back on the way to work, I would again wonder if I had locked the door, and I could say "Yes, and when you did it, you said out loud 'It's Tuesday morning and I'm locking the door!'" + +I've spent most of my career in an organization built on openness and transparency, and yet I have rarely spoken about my mental health and how it might impact my work. + +### So, how does this translate to an advantage at work? + +One of the primary factors contributing to success at my company is an ability to take initiative. Much work needs to be done, and we're in an environment of continual growth and change—which means it's not always clear _what_ needs to be done or _who_ should be doing it. That creates the opportunity for people to observe a need then step up to fill it. This is true in many open organizations, where everyone, regardless of job title or level, is encouraged to step forward. + +Living with anxiety, I continually feel like I need to be doing something, or worry that I'm not doing enough. This motivates me to seek opportunities for contributing. In other words, the anxiety makes me proactive. Being "proactive" or a "self starter" is something you'll find in the "qualifications" section of many job postings! + +I'm very fortunate to have built my career at a successful company, where continual growth creates financial incentives. One of my largest anxieties is about money—the fear of not having enough of it. Being in a leadership role at a quickly growing, profitable company exponentially multiplies what I call the anxiety performance loop (see Figure 1). A high quarterly bonus or other financial reward for a job well done is an invitation to do more, to raise the bar higher, to double down on the behaviors that seem to provide positive outcomes at work. Quarter after quarter after quarter. + +![][7] + +You can observe in all this a virtuous cycle: Opportunities I find at work satisfy my mental needs, and as a result I experience success and rewards. And this, on the face of it, is true. + +So, what's the problem? + +The anxiety-driven performance loop presents two challenges: it never ends, and it is based on a negative emotional state (fear and worry). + +Perhaps the best phrase to illustrate this would be "What have you done for me lately?" In my mental landscape, this is what everyone is thinking about me all the time. No matter what I achieve, no matter what reward or recognition I receive, I imagine that within minutes the person acknowledging my achievement is thinking, "Now, why are you still sitting there? Get out and go do some more!" + +People are not, of course, really thinking this. But my mind can locate enough truth in it to justify a quick return to the fear of not doing enough, which restarts the cycle. + +The anxiety-driven performance loop presents two challenges: it never ends, and it is based on a negative emotional state (fear and worry). + +We live in a world of short attention spans, high expectations, and significant competitive pressures. All of these are real challenges that fuel the idea that after each accomplishment we need to raise the bar higher and keep going. Having anxiety causes me to internalize these pressures, which triggers the "looping" effect. + +The result is that both my company and my career benefit. Mentally, though, I get exhausted. + +I have developed a few coping mechanisms to help me maintain balance: + + * **Mediation.** After I was first diagnosed with my conditions almost 20 years ago, I saw a therapist. After a round of sessions, the therapist referred me to a mediation center, which opened up a new world of thought for me. I've recently been working to reinvigorate my daily practice. + * **Exercise.** I'm a bit compulsive about exercise. I make time every single day for at least one hour of exercise (for me it's walking, cross country skiing, or running). + * **Self awareness, reality checks, and reminders.** Anxiety and OCD can lead to a distorted view of reality. I may overstate stakes, read too much into other people's motivations, or imagine consequences that are just not realistic. Reminding myself of the _true_ worst case scenario (which usually isn't that bad), realizing that other people have more important things to worry about than me, or reminding myself that this is "just a job" can all help bring me back to a realistic perspective. I also have a few other people who can help with this. + + + +So far I've focused primarily on the performance-enhancing aspects of anxiety. In future articles, I'll discuss some of its performance-reducing aspects, as well as the impact my condition has on my colleagues. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/1/leading-openly-anxiety + +作者:[Sam Knuth][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/samfw +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_wavegraph.png?itok=z4pXCf_c (A graph of a wave.) +[2]: http://www.third-story.com/listen/melissaclark +[3]: https://www.mayoclinic.org/diseases-conditions/generalized-anxiety-disorder/symptoms-causes/syc-20360803 +[4]: https://www.mayoclinic.org/diseases-conditions/obsessive-compulsive-disorder/symptoms-causes/syc-20354432 +[5]: https://www.bloomberg.com/news/articles/2019-11-13/mental-health-is-still-a-don-t-ask-don-t-tell-subject-at-work +[6]: https://ourworldindata.org/mental-health +[7]: https://opensource.com/sites/default/files/images/open-org/anxiety_performance_loop.png From 52ff94e4ead43565dbd8599ebed0134b7f177ac2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Jan 2020 00:57:58 +0800 Subject: [PATCH 031/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200121=20Beyond?= =?UTF-8?q?=20Moore's=20Law:=20Neuromorphic=20computing=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200121 Beyond Moore-s Law- Neuromorphic computing.md --- ...ond Moore-s Law- Neuromorphic computing.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/talk/20200121 Beyond Moore-s Law- Neuromorphic computing.md diff --git a/sources/talk/20200121 Beyond Moore-s Law- Neuromorphic computing.md b/sources/talk/20200121 Beyond Moore-s Law- Neuromorphic computing.md new file mode 100644 index 0000000000..cf2595c012 --- /dev/null +++ b/sources/talk/20200121 Beyond Moore-s Law- Neuromorphic computing.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Beyond Moore's Law: Neuromorphic computing?) +[#]: via: (https://www.networkworld.com/article/3514692/beyond-moores-law-neuromorphic-computing.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Beyond Moore's Law: Neuromorphic computing? +====== +Some researchers think brain-copying architectures should replace traditional computing. One group explains how that might work. +4x-image / Getty Images + +With the conceivable exhaustion of [Moore’s Law][1] – that the number of transistors on a microchip doubles every two years – the search is on for new paths that lead to reliable incremental processing gains over time. + +One possibility is that machines inspired by how the brain works could take over, fundamentally shifting computing to a revolutionary new tier, according to an explainer study released this month by Applied Physics Reviews. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +“Today’s state-of-the-art computers process roughly as many instructions per second as an insect brain,” say [the paper’s][3] authors Jack Kendall, of Rain Neuromorphics, and Suhas Kumar, of Hewlett Packard Labs. The two write that processor architecture must now be completely re-thought if Moore’s law is to be perpetuated, and that replicating the “natural processing system of a [human] brain” is the way forward. + +[][4] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][4] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +Deep neural networks (DNNs) should be the foundation, the group believes. A DNN is basically dynamic deep learning where layers pull high- and low-level detail features (edges and shapes, for example) from data. Kendall and Kumar explain that a human brain, which DNN copies, can sort through massive datasets and generally identify data  better than a traditional computer, so therefore it should be the starting point. + +This kind of thing is being attempted already. Existing artificial intelligence (AI) is a stab at getting computers to learn like a human brain. Much like the brain, AI engines learn from patterns in data. Algorithms are combined with processing power, and rewards are dished out when the machine gets it right. + +A brain-inspired neuromorphic computer, however, would take computing a step further, the team believes. Neuromorphic computing mimics neuro-biological architectures in a kind of hybrid digital-analog circuit, in a way like a body does biologically. + +The group says that they think there are 10 basics that need to be gotten right to get to this next level: + +**Parellelism** – Similar to how a brain works rapidly, numerous mathematical operations must be made to occur simultaneously. It’s an extension of what we see now in graphical processing units (GPUs) where large scale graphics are created using concurrent calculations called matrix multiplications. + +**In-memory computing** – It wastes resources to fetch data from remote places, and human brains, indeed, don’t do that; they store information in the same synapses that perform the thought. The introduction of electronic processing semiconductors that combine memory – [Memristors –][5] could help here. (I wrote a few weeks ago about [progress being made combining transistors with storage][6]. That combo could have similar resource advantages.) + +**Analog computing** – Numbers are analog, not digital, the authors point out. Most real-world numbers aren’t zeros and ones, so, for efficiency, any new computing architecture needs to accept that concept, adapt and handle the inherent precision problems that result. + +**Plasticity** – Real-time tuning needs to take place to account for things changing. + +**Probabilistic computing** – The authors suggest computers should get less precise, just like the human brain. Coming up with certain degrees of probability is faster than precise calculation, and it requires less information. + +**Scalability** – The depth of the network allows for complexity. By introducing more layers, one gains more scaling. + +**Sparsity** – Large-scale networks, including neural computers, can’t connect every node, just as not all neurons are connected to each other in the brain. It’s a redundancy that wastes resources. Hub-and-spoke topology works better and allows for better scaling. The same should happen in the next computers, the researchers say. + +**Learning (credit assignment)** – The adjustment of synaptic weights (the strength and amount of influence synapses have) needs attention related to new information presented. + +**Causality** – The relationship between cause and effect in a result has to be addressed. Causal interference is a problem, and machine learning generally has had problems with getting this bit right. + +**Nonlinearity** – The brain isn’t linear like a computer is. “The brain operates at the edge of chaos to produce the most optimal learning and computation,” the team says. The next computer architecture needs to encompass that brain-like nonlinearity, but also operate within linearity, like today’s electronics. + +“Our present hardware is not able to keep up,” Kendall and Kumar say in their paper, which also looks at materials. “The future of computing will not be about cramming more components on a chip but in rethinking processor architecture,” which should be neuromorphic. + +**Now see** [10 of the world's fastest supercomputers][7] + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3514692/beyond-moores-law-neuromorphic-computing.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3189051/its-time-to-dump-moores-law-to-advance-computing-researcher-says.html +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://aip.scitation.org/doi/10.1063/1.5129306 +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://www.networkworld.com/article/2931818/brain-uploads-coming-as-pcs-get-more-powerful.html +[6]: https://www.networkworld.com/article/3510638/researchers-aim-to-build-transistors-that-can-compute-and-store-information-in-one-component.html +[7]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From b1498b9516849ebc7738b52927f2315c35caa130 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Jan 2020 09:17:27 +0800 Subject: [PATCH 032/285] translated --- ...our activities with this Python program.md | 77 ------------------- ...our activities with this Python program.md | 75 ++++++++++++++++++ 2 files changed, 75 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20200118 Keep a journal of your activities with this Python program.md create mode 100644 translated/tech/20200118 Keep a journal of your activities with this Python program.md diff --git a/sources/tech/20200118 Keep a journal of your activities with this Python program.md b/sources/tech/20200118 Keep a journal of your activities with this Python program.md deleted file mode 100644 index bfa79a8893..0000000000 --- a/sources/tech/20200118 Keep a journal of your activities with this Python program.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Keep a journal of your activities with this Python program) -[#]: via: (https://opensource.com/article/20/1/python-journal) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Keep a journal of your activities with this Python program -====== -Jrnl creates a searchable, timestamped, exportable, and (if you want) -encrypted log of your daily activities. Learn more in the eighth in our -series on 20 ways to be more productive with open source in 2020. -![Writing in a notebook][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Journaling with jrnl - -At my workplace, many of us post an "end of day" status to Slack before we leave for the day. With a lot of projects going on and a global team, it is a pretty good way to share what you got done, what isn't done, and what you need help with. But some days are so busy, so hectic that I can't remember what I did. And this is where journaling comes in. - -![jrnl][2] - -It's pretty easy to keep a text editor open and just add a line when you do something. But it can be challenging to go back and figure out when you make a particular note or pull out related lines quickly and easily. Fortunately, [jrnl][3] is here to help. - -Jrnl allows you to enter a quick entry from your command line, search past entries, and export to rich text formats like HTML and Markdown. You can have multiple journals, meaning you can keep your work entries separated from private ones. It stores entries as plain text, so even if jrnl stops working, you have your data. - -Since jrnl is a Python program, the easiest way to install it is with **pip3 install jrnl**; this will make sure you get the latest and greatest version. On its first run, it will ask some questions, and then you are good to go. - -![jrnl's first run][4] - -Now, whenever you need to make a note or log work, simply type **jrnl <some text>,** and it will be logged with a timestamp to the default file. You can search for entries on a specific date with **jrnl -on YYYY-MM-DD**, entries since a date with **jrnl -from YYYY-MM-DD**, and entries up to a specific date with **jrnl -to YYYY-MM-DD**. Search terms can be combined with the **-and** parameter, allowing for searches like **jrnl -from 2019-01-01 -and -to 2019-12-31**. - -You can also edit entries in the journal with the **\--edit** command-line flag. Before you do, set up your default editor for entries by editing the file **~/.config/jrnl/jrnl.yaml**. This is also where you can specify what files to use for journals, what special character to use for tags, and a few other options. Right now, the important thing is to set the editor. I use Vim, and jrnl's documentation has some [helpful hints][5] for using other editors like VSCode and Sublime Text. - -![Example jrnl config file][6] - -Jrnl can also encrypt journal files. By setting the global **encrypt** variable, you'll tell jrnl to encrypt all the journals you have defined. Encryption can also be set per file by adding **encrypt: true** to the definition in the configuration file. - - -``` -journals: -  default: ~/journals/journal.txt -  work: ~/journals/work.txt -  private: -    journal: ~/journals/private.txt -    encrypt: true -``` - -If a journal isn't already encrypted, you will be prompted for the password on any actions for that journal. The journal file will be stored encrypted on disk and safe from prying eyes. [The jrnl documentation][7] has a lot more information on how it works, what ciphers it uses, and so on. - -![Encrypted jrnl file][8] - -Journaling helps me remember what I did when and find it later when I need it. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/python-journal - -作者:[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/notebook-writing-pen.jpg?itok=uA3dCfu_ (Writing in a notebook) -[2]: https://opensource.com/sites/default/files/uploads/productivity_8-1.png (jrnl) -[3]: https://jrnl.sh/ -[4]: https://opensource.com/sites/default/files/uploads/productivity_8-2.png (jrnl's first run) -[5]: https://jrnl.sh/recipes/#external-editors -[6]: https://opensource.com/sites/default/files/uploads/productivity_8-3.png (Example jrnl config file) -[7]: https://jrnl.sh/encryption/ -[8]: https://opensource.com/sites/default/files/uploads/productivity_8-4.png (Encrypted jrnl file) diff --git a/translated/tech/20200118 Keep a journal of your activities with this Python program.md b/translated/tech/20200118 Keep a journal of your activities with this Python program.md new file mode 100644 index 0000000000..ef9d39a396 --- /dev/null +++ b/translated/tech/20200118 Keep a journal of your activities with this Python program.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keep a journal of your activities with this Python program) +[#]: via: (https://opensource.com/article/20/1/python-journal) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用这个 Python 程序记录你的活动 +====== +Jrnl 可以创建可搜索、带时间戳、可导出、加密的(如果需要)的日常活动日志。在我们的 20 个使用开源提升生产力的系列的第八篇文章中了解更多。 +![Writing in a notebook][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 jrnl 记录日志 + +在我的公司,许多人会在下班之前发送一个“一天结束”的状态。在有着许多项目和全球化的团队里,这是一个分享你已完成、未完成以及你需要哪些帮助的一个很好的方式。但有时候我太忙了,以至于我忘了做了什么。这时候就需要记录日志了。 + +![jrnl][2] + +打开一个文本编辑器并在你做一些事的时候添加一行很容易。但是在需要找出你在什么时候做的笔记,或者要快速提取相关的行时会有挑战。幸运的是,[jrnl][3] 可以提供帮助,。 + +Jrnl 能让你在命令行中快速输入条目、搜索过去的条目并导出为 HTML 和 Markdown 等富文本格式。你可以有多个日志,这意味着你可以将工作条目与私有条目分开。它将条目存储为纯文本,因此即使 jrnl 停止工作,数据也不会丢失。 + +由于 jrnl 是一个 Python 程序,最简单的安装方法是使用 **pip3 install jrnl**。这将确保你获得最新和最好的版本。第一次运行它会询问一些问题,接下来就能正常使用。 + +![jrnl's first run][4] + +现在,每当你需要做笔记或记录日志时,只需输入 **jrnl <some text>**,它将带有时间戳的记录保存到默认文件中。你可以使用 **jrnl -on YYYY-MM-DD** 搜索特定日期条目,**jrnl -from YYYY-MM-DD** 搜索在那日期之后的条目,以及用 **jrnl -to YYYY-MM-DD** 搜索自那日期之后的条目。搜索词可以与 **-and** 参数结合使用,允许像 **jrnl -from 2019-01-01 -and -to 2019-12-31** 这类搜索。 + +你还可以使用 **\--edit** 标志编辑日志中的条目。开始之前,通过编辑文件 **~/.config/jrnl/jrnl.yaml** 来设置默认编辑器。你还可以指定使用什么日志文件、用于标签的特殊字符以及一些其他选项。现在,重要的是设置编辑器。我使用 Vim,jrnl 的文档中有一些使用其他编辑器如 VSCode 和 Sublime Text 的[有用提示][5] + +![Example jrnl config file][6] + +Jrnl 还可以加密日志文件。通过设置全局 **encrypt** 变量,你将告诉 jrnl 加密你定义的所有日志。还可在配置文件中的每个文件中设置 **encrypt: true** 来加密文件。 + + +``` +journals: +  default: ~/journals/journal.txt +  work: ~/journals/work.txt +  private: +    journal: ~/journals/private.txt +    encrypt: true +``` + +如果日志尚未加密,系统将提示你输入对它任何操作的密码。日志文件将加密保存在磁盘上,并免受窥探。[jrnl 文档][7] 中包含其工作原理、使用哪些加密方式等的更多信息。 + +![Encrypted jrnl file][8] + +日志记录帮助我记住什么时候做了什么事,并在我需要的时候能够找到它。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/python-journal + +作者:[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/notebook-writing-pen.jpg?itok=uA3dCfu_ (Writing in a notebook) +[2]: https://opensource.com/sites/default/files/uploads/productivity_8-1.png (jrnl) +[3]: https://jrnl.sh/ +[4]: https://opensource.com/sites/default/files/uploads/productivity_8-2.png (jrnl's first run) +[5]: https://jrnl.sh/recipes/#external-editors +[6]: https://opensource.com/sites/default/files/uploads/productivity_8-3.png (Example jrnl config file) +[7]: https://jrnl.sh/encryption/ +[8]: https://opensource.com/sites/default/files/uploads/productivity_8-4.png (Encrypted jrnl file) From 31d0d65c6842a5069beb2ed02e8af31c1b94aa56 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Jan 2020 09:23:10 +0800 Subject: [PATCH 033/285] translating --- .../20200116 3 open source tools to manage your contacts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200116 3 open source tools to manage your contacts.md b/sources/tech/20200116 3 open source tools to manage your contacts.md index eeb7877de1..e763954bcc 100644 --- a/sources/tech/20200116 3 open source tools to manage your contacts.md +++ b/sources/tech/20200116 3 open source tools to manage your contacts.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d873de95346783768a34688fb1c3a82ef9f2b2f8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 22 Jan 2020 11:08:04 +0800 Subject: [PATCH 034/285] Rename sources/tech/20200121 What you need to know about System76-s open source firmware project.md to sources/talk/20200121 What you need to know about System76-s open source firmware project.md --- ... need to know about System76-s open source firmware project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200121 What you need to know about System76-s open source firmware project.md (100%) diff --git a/sources/tech/20200121 What you need to know about System76-s open source firmware project.md b/sources/talk/20200121 What you need to know about System76-s open source firmware project.md similarity index 100% rename from sources/tech/20200121 What you need to know about System76-s open source firmware project.md rename to sources/talk/20200121 What you need to know about System76-s open source firmware project.md From a17fbce9ec61adcbdd960c6e67b470a73a84c79a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 11:24:07 +0800 Subject: [PATCH 035/285] PRF @geekpi --- ...200114 Organize your email with Notmuch.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200114 Organize your email with Notmuch.md b/translated/tech/20200114 Organize your email with Notmuch.md index 1d81905ea3..41467a81a3 100644 --- a/translated/tech/20200114 Organize your email with Notmuch.md +++ b/translated/tech/20200114 Organize your email with Notmuch.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Organize your email with Notmuch) @@ -9,8 +9,10 @@ 使用 Notmuch 组织你的邮件 ====== -Notmuch 索引、标记和排序电子邮件。在我们的 20 个使用开源提升生产力的系列的第四篇文章中了解该如何使用。 -![Filing cabinet for organization][1] + +> Notmuch 可以索引、标记和排序电子邮件。在我们的 20 个使用开源提升生产力的系列的第四篇文章中了解该如何使用它。 + +![](https://img.linux.net.cn/data/attachment/album/202001/22/112231xg5dgv6f6g5a1iv1.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 @@ -26,12 +28,11 @@ Notmuch 索引、标记和排序电子邮件。在我们的 20 个使用开源 ![Notmuch's first run][7] -Notmuch 首次运行时,它将询问你一些问题,并在家目录中创建 **.notmuch-config** 文件。接下来,运行 **notmuch new** 来索引并标记所有邮件。你可以使用 **notmuch search tag:new** 进行验证,它会找到所有带有 “new” 标签的消息。这可能会有很多邮件,因为 Notmuch 使用 “new” 标签来指示新邮件,因此你需要对其进行清理。 +Notmuch 首次运行时,它将询问你一些问题,并在家目录中创建 `.notmuch-config` 文件。接下来,运行 `notmuch new` 来索引并标记所有邮件。你可以使用 `notmuch search tag:new` 进行验证,它会找到所有带有 `new` 标签的消息。这可能会有很多邮件,因为 Notmuch 使用 `new` 标签来指示新邮件,因此你需要对其进行清理。 -运行 **notmuch search tag:unread** 来查找未读消息,这会减少很多邮件。要从你已阅读的消息中删除 “new” 标签,请运行 **notmuch tag -new not tag:unread**,它将搜索所有没有 “unread” 标签的消息,并从其中删除 “new” 标签。现在,当你运行 **notmuch search tag:new**时,它将仅显示未读邮件。 - -但是,批量标记消息可能更有用,因为在每次运行时手动更新标记可能非常繁琐。**\--batch** 命令行选项告诉 Notmuch 读取多行命令并执行它们。还有一个 **\--input=filename** 选项,该选项从文件中读取命令并应用它们。我有一个名为 **tagmail.notmuch** 的文件,用于给”新“邮件添加标签;它看起来像这样: +运行 `notmuch search tag:unread` 来查找未读消息,这会减少很多邮件。要从你已阅读的消息中删除 `new` 标签,请运行 `notmuch tag -new not tag:unread`,它将搜索所有没有 `unread` 标签的消息,并从其中删除 `new` 标签。现在,当你运行 `notmuch search tag:new` 时,它将仅显示未读邮件。 +但是,批量标记消息可能更有用,因为在每次运行时手动更新标记可能非常繁琐。`--batch` 命令行选项告诉 Notmuch 读取多行命令并执行它们。还有一个 `--input=filename` 选项,该选项从文件中读取命令并应用它们。我有一个名为 `tagmail.notmuch` 的文件,用于给“新”邮件添加标签;它看起来像这样: ``` # Manage sent, spam, and trash folders @@ -49,9 +50,9 @@ Notmuch 首次运行时,它将询问你一些问题,并在家目录中创建 -new tag:new ``` -我可以在运行 **notmuch new** 后运行 **notmuch tag --input=tagmail.notmuch** 批量处理我的邮件,之后我也可以搜索这些标签。 +我可以在运行 `notmuch new` 后运行 `notmuch tag --input=tagmail.notmuch` 批量处理我的邮件,之后我也可以搜索这些标签。 -Notmuch 还支持 pre-new 和 post-new 钩子。这些脚本存放在 **Maildir/.notmuch/hooks** 中,它们定义了在使用 **notmuch new** 索引新邮件之前(pre-new)和之后(post-new)要做的操作。在昨天的文章中,我谈到了使用 [OfflineIMAP][8] 同步来自 IMAP 服务器的邮件。从 “pre-new” 钩子运行它非常容易: +Notmuch 还支持 `pre-new` 和 `post-new` 钩子。这些脚本存放在 `Maildir/.notmuch/hooks` 中,它们定义了在使用 `notmuch new` 索引新邮件之前(`pre-new`)和之后(`post-new`)要做的操作。在昨天的文章中,我谈到了使用 [OfflineIMAP][8] 同步来自 IMAP 服务器的邮件。从 `pre-new` 钩子运行它非常容易: ``` @@ -63,8 +64,7 @@ notmuch tag -new tag:new offlineimap -a LocalSync -u quiet ``` -你还可以使用可以操作 Notmuch 数据库的 Python 应用 [afew][9],来为你标记_邮件列表_和_垃圾邮件_。你可以用类似的方法在 post-new 钩子中使用 afew: - +你还可以使用可以操作 Notmuch 数据库的 Python 应用 [afew][9],来为你标记*邮件列表*和*垃圾邮件*。你可以用类似的方法在 `post-new` 钩子中使用 `afew`: ``` #!/bin/bash @@ -75,7 +75,7 @@ notmuch tag --input=~/tagmail.notmuch afew -t -n ``` -我建议你在使用 afew 标记邮件时,不要使用 **[ListMailsFilter]**,因为某些邮件处理程序会在邮件中添加模糊或者完全的垃圾列表中的标头(我说的是你 Google)。 +我建议你在使用 `afew` 标记邮件时,不要使用 `[ListMailsFilter]`,因为某些邮件处理程序会在邮件中添加模糊或者彻头彻尾是垃圾的列表标头(我说的就是你 Google)。 ![alot email client][10] @@ -90,14 +90,14 @@ via: https://opensource.com/article/20/1/organize-email-notmuch 作者:[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/) 荣誉推出 [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/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) -[2]: https://opensource.com/article/20/1/sync-email-offlineimap +[2]: https://linux.cn/article-11804-1.html [3]: https://opensource.com/sites/default/files/uploads/productivity_4-1.png (Notmuch) [4]: https://en.wikipedia.org/wiki/Maildir [5]: https://notmuchmail.org/ From c9ed6792836850877c48c39be0088497a7671986 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 22 Jan 2020 11:30:45 +0800 Subject: [PATCH 036/285] Rename sources/tech/20200121 Never enough- Working openly with anxiety.md to sources/talk/20200121 Never enough- Working openly with anxiety.md --- .../20200121 Never enough- Working openly with anxiety.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200121 Never enough- Working openly with anxiety.md (100%) diff --git a/sources/tech/20200121 Never enough- Working openly with anxiety.md b/sources/talk/20200121 Never enough- Working openly with anxiety.md similarity index 100% rename from sources/tech/20200121 Never enough- Working openly with anxiety.md rename to sources/talk/20200121 Never enough- Working openly with anxiety.md From 3260bfae7acce228ee6fe4e61a209f218ba63a1c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 11:42:23 +0800 Subject: [PATCH 037/285] PUB @geekpi https://linux.cn/article-11807-1.html --- .../20200114 Organize your email with Notmuch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200114 Organize your email with Notmuch.md (98%) diff --git a/translated/tech/20200114 Organize your email with Notmuch.md b/published/20200114 Organize your email with Notmuch.md similarity index 98% rename from translated/tech/20200114 Organize your email with Notmuch.md rename to published/20200114 Organize your email with Notmuch.md index 41467a81a3..dc9a67f7d6 100644 --- a/translated/tech/20200114 Organize your email with Notmuch.md +++ b/published/20200114 Organize your email with Notmuch.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11807-1.html) [#]: subject: (Organize your email with Notmuch) [#]: via: (https://opensource.com/article/20/1/organize-email-notmuch) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From af07e34d55fd86693675a397cdea5adfd907deda Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 11:56:12 +0800 Subject: [PATCH 038/285] APL --- ...0190619 Getting started with OpenSSL- Cryptography basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md index 0f3da1b13e..02d9f6f004 100644 --- a/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md +++ b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c8ba19eaaa506838d57191c97fd5a02028d47aab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 14:28:38 +0800 Subject: [PATCH 039/285] PART 1 --- ...arted with OpenSSL- Cryptography basics.md | 342 ------------------ ...arted with OpenSSL- Cryptography basics.md | 341 +++++++++++++++++ 2 files changed, 341 insertions(+), 342 deletions(-) delete mode 100644 sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md create mode 100644 translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md diff --git a/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md deleted file mode 100644 index 02d9f6f004..0000000000 --- a/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md +++ /dev/null @@ -1,342 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with OpenSSL: Cryptography basics) -[#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-1) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen) - -Getting started with OpenSSL: Cryptography basics -====== -Need a primer on cryptography basics, especially regarding OpenSSL? Read -on. -![A lock on the side of a building][1] - -This article is the first of two on cryptography basics using [OpenSSL][2], a production-grade library and toolkit popular on Linux and other systems. (To install the most recent version of OpenSSL, see [here][3].) OpenSSL utilities are available at the command line, and programs can call functions from the OpenSSL libraries. The sample program for this article is in C, the source language for the OpenSSL libraries. - -The two articles in this series cover—collectively—cryptographic hashes, digital signatures, encryption and decryption, and digital certificates. You can find the code and command-line examples in a ZIP file from [my website][4]. - -Let’s start with a review of the SSL in the OpenSSL name. - -### A quick history - -[Secure Socket Layer (SSL)][5] is a cryptographic protocol that [Netscape][6] released in 1995. This protocol layer can sit atop HTTP, thereby providing the _S_ for _secure_ in HTTPS. The SSL protocol provides various security services, including two that are central in HTTPS: - - * Peer authentication (aka mutual challenge): Each side of a connection authenticates the identity of the other side. If Alice and Bob are to exchange messages over SSL, then each first authenticates the identity of the other. - * Confidentiality: A sender encrypts messages before sending these over a channel. The receiver then decrypts each received message. This process safeguards network conversations. Even if eavesdropper Eve intercepts an encrypted message from Alice to Bob (a _man-in-the-middle_ attack), Eve finds it computationally infeasible to decrypt this message. - - - -These two key SSL services, in turn, are tied to others that get less attention. For example, SSL supports message integrity, which assures that a received message is the same as the one sent. This feature is implemented with hash functions, which likewise come with the OpenSSL toolkit. - -SSL is versioned (e.g., SSLv2 and SSLv3), and in 1999 Transport Layer Security (TLS) emerged as a similar protocol based upon SSLv3. TLSv1 and SSLv3 are alike, but not enough so to work together. Nonetheless, it is common to refer to SSL/TLS as if they are one and the same protocol. For example, OpenSSL functions often have SSL in the name even when TLS rather than SSL is in play. Furthermore, calling OpenSSL command-line utilities begins with the term **openssl**. - -The documentation for OpenSSL is spotty beyond the **man** pages, which become unwieldy given how big the OpenSSL toolkit is. Command-line and code examples are one way to bring the main topics into focus together. Let’s start with a familiar example—accessing a web site with HTTPS—and use this example to pick apart the cryptographic pieces of interest. - -### An HTTPS client - -The **client** program shown here connects over HTTPS to Google: - - -``` -/* compilation: gcc -o client client.c -lssl -lcrypto */ - -#include <stdio.h> - -#include <stdlib.h> - -#include <openssl/bio.h> /* BasicInput/Output streams */ - -#include <openssl/err.h> /* errors */ - -#include <openssl/ssl.h> /* core library */ - -#define BuffSize 1024 - -void report_and_exit(const char* msg) { -  [perror][7](msg); -  ERR_print_errors_fp(stderr); -  [exit][8](-1); -} - -void init_ssl() { -  SSL_load_error_strings(); -  SSL_library_init(); -} - -void cleanup(SSL_CTX* ctx, BIO* bio) { -  SSL_CTX_free(ctx); -  BIO_free_all(bio); -} - -void secure_connect(const char* hostname) { -  char name[BuffSize]; -  char request[BuffSize]; -  char response[BuffSize]; - -  const SSL_METHOD* method = TLSv1_2_client_method(); -  if (NULL == method) report_and_exit("TLSv1_2_client_method..."); - -  SSL_CTX* ctx = SSL_CTX_new(method); -  if (NULL == ctx) report_and_exit("SSL_CTX_new..."); - -  BIO* bio = BIO_new_ssl_connect(ctx); -  if (NULL == bio) report_and_exit("BIO_new_ssl_connect..."); - -  SSL* ssl = NULL; - -  /* link bio channel, SSL session, and server endpoint */ - -  [sprintf][9](name, "%s:%s", hostname, "https"); -  BIO_get_ssl(bio, &ssl); /* session */ -  SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* robustness */ -  BIO_set_conn_hostname(bio, name); /* prepare to connect */ - -  /* try to connect */ -  if (BIO_do_connect(bio) <= 0) { -    cleanup(ctx, bio); -    report_and_exit("BIO_do_connect..."); -  } - -  /* verify truststore, check cert */ -  if (!SSL_CTX_load_verify_locations(ctx, -                                      "/etc/ssl/certs/ca-certificates.crt", /* truststore */ -                                      "/etc/ssl/certs/")) /* more truststore */ -    report_and_exit("SSL_CTX_load_verify_locations..."); - -  long verify_flag = SSL_get_verify_result(ssl); -  if (verify_flag != X509_V_OK) -    [fprintf][10](stderr, -            "##### Certificate verification error (%i) but continuing...\n", -            (int) verify_flag); - -  /* now fetch the homepage as sample data */ -  [sprintf][9](request, -          "GET / HTTP/1.1\x0D\x0AHost: %s\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0A", -          hostname); -  BIO_puts(bio, request); - -  /* read HTTP response from server and print to stdout */ -  while (1) { -    [memset][11](response, '\0', sizeof(response)); -    int n = BIO_read(bio, response, BuffSize); -    if (n <= 0) break; /* 0 is end-of-stream, < 0 is an error */ -  [puts][12](response); -  } - -  cleanup(ctx, bio); -} - -int main() { -  init_ssl(); - -  const char* hostname = "www.google.com:443"; -  [fprintf][10](stderr, "Trying an HTTPS connection to %s...\n", hostname); -  secure_connect(hostname); - -return 0; -} -``` - -This program can be compiled and executed from the command line (note the lowercase L in **-lssl** and **-lcrypto**): - -**gcc** **-o** **client client.c -lssl** **-lcrypto** - -This program tries to open a secure connection to the web site [www.google.com][13]. As part of the TLS handshake with the Google web server, the **client** program receives one or more digital certificates, which the program tries (but, on my system, fails) to verify. Nonetheless, the **client** program goes on to fetch the Google homepage through the secure channel. This program depends on the security artifacts mentioned earlier, although only a digital certificate stands out in the code. The other artifacts remain behind the scenes and are clarified later in detail. - -Generally, a client program in C or C++ that opened an HTTP (non-secure) channel would use constructs such as a _file descriptor_ for a _network socket_, which is an endpoint in a connection between two processes (e.g., the client program and the Google web server). A file descriptor, in turn, is a non-negative integer value that identifies, within a program, any file-like construct that the program opens. Such a program also would use a structure to specify details about the web server’s address. - -None of these relatively low-level constructs occurs in the client program, as the OpenSSL library wraps the socket infrastructure and address specification in high-level security constructs. The result is a straightforward API. Here’s a first look at the security details in the example **client** program. - - * The program begins by loading the relevant OpenSSL libraries, with my function **init_ssl** making two calls into OpenSSL: - -**SSL_library_init(); SSL_load_error_strings();** - - * The next initialization step tries to get a security _context_, a framework of information required to establish and maintain a secure channel to the web server. **TLS 1.2** is used in the example, as shown in this call to an OpenSSL library function: - -**const SSL_METHOD* method = TLSv1_2_client_method(); /* TLS 1.2 */** - -If the call succeeds, then the **method** pointer is passed to the library function that creates the context of type **SSL_CTX**: - -**SSL_CTX*** **ctx** **= SSL_CTX_new(method);** - -The **client** program checks for errors on each of these critical library calls, and then the program terminates if either call fails. - - * Two other OpenSSL artifacts now come into play: a security session of type **SSL**, which manages the secure connection from start to finish; and a secured stream of type **BIO** (Basic Input/Output), which is used to communicate with the web server. The **BIO** stream is generated with this call: - -**BIO* bio = BIO_new_ssl_connect(ctx);** - -Note that the all-important context is the argument. The **BIO** type is the OpenSSL wrapper for the **FILE** type in C. This wrapper secures the input and output streams between the **client** program and Google's web server. - - * With the **SSL_CTX** and **BIO** in hand, the program then links these together in an **SSL** session. Three library calls do the work: - -**BIO_get_ssl(bio, &ssl); /* get a TLS session */** - -**SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* for robustness */** - -**BIO_set_conn_hostname(bio, name); /* prepare to connect to Google */** - -The secure connection itself is established through this call: - -**BIO_do_connect(bio);** - -If this last call does not succeed, the **client** program terminates; otherwise, the connection is ready to support a confidential conversation between the **client** program and the Google web server. - - - - -During the handshake with the web server, the **client** program receives one or more digital certificates that authenticate the server’s identity. However, the **client** program does not send a certificate of its own, which means that the authentication is one-way. (Web servers typically are configured _not_ to expect a client certificate.) Despite the failed verification of the web server’s certificate, the **client** program continues by fetching the Google homepage through the secure channel to the web server. - -Why does the attempt to verify a Google certificate fail? A typical OpenSSL installation has the directory **/etc/ssl/certs**, which includes the **ca-certificates.crt** file. The directory and the file together contain digital certificates that OpenSSL trusts out of the box and accordingly constitute a _truststore_. The truststore can be updated as needed, in particular, to include newly trusted certificates and to remove ones no longer trusted. - -The client program receives three certificates from the Google web server, but the OpenSSL truststore on my machine does not contain exact matches. As presently written, the **client** program does not pursue the matter by, for example, verifying the digital signature on a Google certificate (a signature that vouches for the certificate). If that signature were trusted, then the certificate containing it should be trusted as well. Nonetheless, the client program goes on to fetch and then to print Google’s homepage. The next section gets into more detail. - -### The hidden security pieces in the client program - -Let’s start with the visible security artifact in the client example—the digital certificate—and consider how other security artifacts relate to it. The dominant layout standard for a digital certificate is X509, and a production-grade certificate is issued by a certificate authority (CA) such as [Verisign][14]. - -A digital certificate contains various pieces of information (e.g., activation and expiration dates, and a domain name for the owner), including the issuer’s identity and _digital signature_, which is an encrypted _cryptographic hash_ value. A certificate also has an unencrypted hash value that serves as its identifying _fingerprint_. - -A hash value results from mapping an arbitrary number of bits to a fixed-length digest. What the bits represent (an accounting report, a novel, or maybe a digital movie) is irrelevant. For example, the Message Digest version 5 (MD5) hash algorithm maps input bits of whatever length to a 128-bit hash value, whereas the SHA1 (Secure Hash Algorithm version 1) algorithm maps input bits to a 160-bit value. Different input bits result in different—indeed, statistically unique—hash values. The next article goes into further detail and focuses on what makes a hash function _cryptographic_. - -Digital certificates differ in type (e.g., _root_, _intermediate_, and _end-entity_ certificates) and form a hierarchy that reflects these types. As the name suggests, a _root_ certificate sits atop the hierarchy, and the certificates under it inherit whatever trust the root certificate has. The OpenSSL libraries and most modern programming languages have an X509 type together with functions that deal with such certificates. The certificate from Google has an X509 format, and the **client** program checks whether this certificate is **X509_V_OK**. - -X509 certificates are based upon public-key infrastructure (PKI), which includes algorithms—RSA is the dominant one—for generating _key pairs_: a public key and its paired private key. A public key is an identity: [Amazon’s][15] public key identifies it, and my public key identifies me. A private key is meant to be kept secret by its owner. - -The keys in a pair have standard uses. A public key can be used to encrypt a message, and the private key from the same pair can then be used to decrypt the message. A private key also can be used to sign a document or other electronic artifact (e.g., a program or an email), and the public key from the pair can then be used to verify the signature. The following two examples fill in some details. - -In the first example, Alice distributes her public key to the world, including Bob. Bob then encrypts a message with Alice’s public key, sending the encrypted message to Alice. The message encrypted with Alice’s public key is decrypted with her private key, which (by assumption) she alone has, like so: - - -``` -             +------------------+ encrypted msg  +-------------------+ -Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's msg -             +------------------+                +-------------------+ -``` - -Decrypting the message without Alice’s private key is possible in principle, but infeasible in practice given a sound cryptographic key-pair system such as RSA. - -Now, for the second example, consider signing a document to certify its authenticity. The signature algorithm uses a private key from a pair to process a cryptographic hash of the document to be signed: - - -``` -                    +-------------------+ -Hash of document--->|Alice's private key|--->Alice's digital signature of the document -                    +-------------------+ -``` - -Assume that Alice digitally signs a contract sent to Bob. Bob then can use Alice’s public key from the key pair to verify the signature: - - -``` -                                             +------------------+ -Alice's digital signature of the document--->|Alice's public key|--->verified or not -                                             +------------------+ -``` - -It is infeasible to forge Alice’s signature without Alice’s private key: hence, it is in Alice’s interest to keep her private key secret. - -None of these security pieces, except for digital certificates, is explicit in the **client** program. The next article fills in the details with examples that use the OpenSSL utilities and library functions. - -### OpenSSL from the command line - -In the meantime, let’s take a look at OpenSSL command-line utilities: in particular, a utility to inspect the certificates from a web server during the TLS handshake. Invoking the OpenSSL utilities begins with the **openssl** command and then adds a combination of arguments and flags to specify the desired operation. - -Consider this command: - -**openssl list-cipher-algorithms** - -The output is a list of associated algorithms that make up a _cipher suite_. Here’s the start of the list, with comments to clarify the acronyms: - - -``` -AES-128-CBC ## Advanced Encryption Standard, Cipher Block Chaining -AES-128-CBC-HMAC-SHA1 ## Hash-based Message Authentication Code with SHA1 hashes -AES-128-CBC-HMAC-SHA256 ## ditto, but SHA256 rather than SHA1 -... -``` - -The next command, using the argument **s_client**, opens a secure connection to **[www.google.com][13]** and prints screens full of information about this connection: - -**openssl s_client -connect [www.google.com:443][16] -showcerts** - -The port number 443 is the standard one used by web servers for receiving HTTPS rather than HTTP connections. (For HTTP, the standard port is 80.) The network address **[www.google.com:443][16]** also occurs in the **client** program's code. If the attempted connection succeeds, the three digital certificates from Google are displayed together with information about the secure session, the cipher suite in play, and related items. For example, here is a slice of output from near the start, which announces that a _certificate chain_ is forthcoming. The encoding for the certificates is base64: - - -``` -Certificate chain - 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com - i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3 -\-----BEGIN CERTIFICATE----- -MIIEijCCA3KgAwIBAgIQdCea9tmy/T6rK/dDD1isujANBgkqhkiG9w0BAQsFADBU -MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw -... -``` - -A major web site such as Google usually sends multiple certificates for authentication. - -The output ends with summary information about the TLS session, including specifics on the cipher suite: - - -``` -SSL-Session: -    Protocol : TLSv1.2 -    Cipher : ECDHE-RSA-AES128-GCM-SHA256 -    Session-ID: A2BBF0E4991E6BBBC318774EEE37CFCB23095CC7640FFC752448D07C7F438573 -... -``` - -The protocol **TLS 1.2** is used in the **client** program, and the **Session-ID** uniquely identifies the connection between the **openssl** utility and the Google web server. The **Cipher** entry can be parsed as follows: - - * **ECDHE** (Elliptic Curve Diffie Hellman Ephemeral) is an effective and efficient algorithm for managing the TLS handshake. In particular, ECDHE solves the _key-distribution problem_ by ensuring that both parties in a connection (e.g., the client program and the Google web server) use the same encryption/decryption key, which is known as the _session key_. The follow-up article digs into the details. - - * **RSA** (Rivest Shamir Adleman) is the dominant public-key cryptosystem and named after the three academics who first described the system in the late 1970s. The key-pairs in play are generated with the RSA algorithm. - - * **AES128** (Advanced Encryption Standard) is a _block cipher_ that encrypts and decrypts blocks of bits. (The alternative is a _stream cipher_, which encrypts and decrypts bits one at a time.) The cipher is _symmetric_ in that the same key is used to encrypt and to decrypt, which raises the key-distribution problem in the first place. AES supports key sizes of 128 (used here), 192, and 256 bits: the larger the key, the better the protection. - -Key sizes for symmetric cryptosystems such as AES are, in general, smaller than those for asymmetric (key-pair based) systems such as RSA. For example, a 1024-bit RSA key is relatively small, whereas a 256-bit key is currently the largest for AES. - - * **GCM** (Galois Counter Mode) handles the repeated application of a cipher (in this case, AES128) during a secured conversation. AES128 blocks are only 128-bits in size, and a secure conversation is likely to consist of multiple AES128 blocks from one side to the other. GCM is efficient and commonly paired with AES128. - - * **SHA256** (Secure Hash Algorithm 256 bits) is the cryptographic hash algorithm in play. The hash values produced are 256 bits in size, although even larger values are possible with SHA. - - - - -Cipher suites are in continual development. Not so long ago, for example, Google used the RC4 stream cipher (Ron’s Cipher version 4 after Ron Rivest from RSA). RC4 now has known vulnerabilities, which presumably accounts, at least in part, for Google’s switch to AES128. - -### Wrapping up - -This first look at OpenSSL, through a secure C web client and various command-line examples, has brought to the fore a handful of topics in need of more clarification. [The next article gets into the details][17], starting with cryptographic hashes and ending with a fuller discussion of how digital certificates address the key distribution challenge. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 - -作者:[Marty Kalin][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) -[2]: https://www.openssl.org/ -[3]: https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/ -[4]: http://condor.depaul.edu/mkalin -[5]: https://en.wikipedia.org/wiki/Transport_Layer_Security -[6]: https://en.wikipedia.org/wiki/Netscape -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/memset.html -[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html -[13]: http://www.google.com -[14]: https://www.verisign.com -[15]: https://www.amazon.com -[16]: http://www.google.com:443 -[17]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 diff --git a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md new file mode 100644 index 0000000000..02b9005801 --- /dev/null +++ b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -0,0 +1,341 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with OpenSSL: Cryptography basics) +[#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-1) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen) + +OpenSSL 入门:密码学基础知识 +====== + +> 需要有关基础的密码学入门知识,尤其是有关 OpenSSL 的入门知识吗?继续阅读。 + +![A lock on the side of a building][1] + +本文是两篇使用 [OpenSSL][2] 的密码学基础知识的第一篇,OpenSSL 是在 Linux 和其他系统上流行的生产级库和工具包。(要安装 OpenSSL 的最新版本,请参阅[这里][3]。)OpenSSL 实用程序可在命令行使用,而程序可以从 OpenSSL 库中调用函数。本文的示例程序使用 C 语言,即 OpenSSL 库的源语言。 + +本系列的两篇文章共同介绍了加密哈希、数字签名、加密和解密以及数字证书。你可以从[我的网站][4]的 ZIP 文件中找到代码和命令行示例。 + +让我们首先回顾一下 OpenSSL 名称中的 SSL。 + +### OpenSSL 简史 + +[安全套接字层][5](SSL)是 Netscape 在 1995 年发布的一种加密协议。该协议层可以位于 HTTP 之上,从而为 HTTPS 提供了 S:安全。SSL 协议提供了各种安全服务,其中包括两项在 HTTPS 中至关重要的服务: + +* 对等身份验证Peer authentication(也称为相互挑战):连接的每一边都对另一边的身份进行身份验证。如果 Alice 和 Bob 要通过 SSL 交换消息,则每个人首先验证彼此的身份。 +* 机密性Confidentiality:发送者在通过通道发送消息之前先对其进行加密。接收者然后解密每个接收到的消息。此过程可保护网络对话。即使窃听者 Eve 截获了从 Alice 到 Bob 的加密消息(*中间人*攻击),Eve 仍发现他在计算上无法解密此消息。 +   +反过来,这两个关键 SSL 服务与其他获得较少关注的服务捆绑在一起。例如,SSL 支持消息完整性,从而确保接收到的消息与发送的消息相同。此功能是通过散列函数实现的,散列函数也随 OpenSSL 工具箱一起提供。 + +SSL 已版本化(例如 SSLv2 和 SSLv3),并且在 1999 年,传输层安全性Transport Layer Security(TLS)成为基于 SSLv3 的类似协议。TLSv1 和 SSLv3 相似,但不足以相互配合。 但是,通常将 SSL/TLS 称为同一协议。例如,即使正在使用的是 TLS(而非 SSL),OpenSSL 函数也经常在名称中包含 SSL。此外,调用 OpenSSL 命令行实用程序以术语 `openssl` 开始。 + +OpenSSL 在其 man 页面之外的文档是零散的,鉴于 OpenSSL 工具包有多大,这些页面变得难以查找使用。命令行和代码示例是将主要主题集中起来的一种方法。让我们从一个熟悉的示例开始(使用 HTTPS 访问网站),然后使用该示例来挑选我们感兴趣的加密部分。 + + + +### 一个 HTTPS 客户端 + +此处显示的 `client` 程序通过 HTTPS 连接到 Google: + +``` +/* compilation: gcc -o client client.c -lssl -lcrypto */ +#include +#include +#include /* BasicInput/Output streams */ +#include /* errors */ +#include /* core library */ +#define BuffSize 1024 + +void report_and_exit(const char* msg) { + perror(msg); + ERR_print_errors_fp(stderr); + exit(-1); +} + +void init_ssl() { + SSL_load_error_strings(); + SSL_library_init(); +} + +void cleanup(SSL_CTX* ctx, BIO* bio) { + SSL_CTX_free(ctx); + BIO_free_all(bio); +} + +void secure_connect(const char* hostname) { + char name[BuffSize]; + char request[BuffSize]; + char response[BuffSize]; + + const SSL_METHOD* method = TLSv1_2_client_method(); + if (NULL == method) report_and_exit("TLSv1_2_client_method..."); + + SSL_CTX* ctx = SSL_CTX_new(method); + if (NULL == ctx) report_and_exit("SSL_CTX_new..."); + + BIO* bio = BIO_new_ssl_connect(ctx); + if (NULL == bio) report_and_exit("BIO_new_ssl_connect..."); + + SSL* ssl = NULL; + + /* link bio channel, SSL session, and server endpoint */ + + sprintf(name, "%s:%s", hostname, "https"); + BIO_get_ssl(bio, &ssl); /* session */ + SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* robustness */ + BIO_set_conn_hostname(bio, name); /* prepare to connect */ + + /* try to connect */ + if (BIO_do_connect(bio) <= 0) { + cleanup(ctx, bio); + report_and_exit("BIO_do_connect..."); + } + + /* verify truststore, check cert */ + if (!SSL_CTX_load_verify_locations(ctx, + "/etc/ssl/certs/ca-certificates.crt", /* truststore */ + "/etc/ssl/certs/")) /* more truststore */ + report_and_exit("SSL_CTX_load_verify_locations..."); + + long verify_flag = SSL_get_verify_result(ssl); + if (verify_flag != X509_V_OK) + fprintf(stderr, + "##### Certificate verification error (%i) but continuing...\n", + (int) verify_flag); + + /* now fetch the homepage as sample data */ + sprintf(request, + "GET / HTTP/1.1\x0D\x0AHost: %s\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0A", + hostname); + BIO_puts(bio, request); + + /* read HTTP response from server and print to stdout */ + while (1) { + memset(response, '\0', sizeof(response)); + int n = BIO_read(bio, response, BuffSize); + if (n <= 0) break; /* 0 is end-of-stream, < 0 is an error */ + puts(response); + } + + cleanup(ctx, bio); +} + +int main() { + init_ssl(); + + const char* hostname = "www.google.com:443"; + fprintf(stderr, "Trying an HTTPS connection to %s...\n", hostname); + secure_connect(hostname); + +return 0; +} +``` + +可以从命令行编译和执行该程序(请注意 `-lssl` 和 `-lcrypto` 中的小写字母 `L`): + + +``` +gcc -o client client.c -lssl -lcrypto +``` + +该程序尝试打开与网站 [www.google.com][13] 的安全连接。作为与 Google Web 服务器的 TLS 握手的一部分,`client` 程序会接收一个或多个数字证书,该程序会尝试对其进行验证(但在我的系统上失败了)。尽管如此,`client` 程序仍继续通过安全通道获取 Google 主页。该程序取决于前面提到的安全工件,尽管在代码中只突出了数字证书。其他工件仍在幕后,稍后将对其进行详细说明。 + +通常,打开 HTTP(非安全)通道的 C 或 C++ 客户端程序将使用诸如*文件描述符*或*网络套接字*之类的结构,这些是两个进程(例如,客户端程序和 Google Web 服务器)之间连接的端点。另一方面,文件描述符是一个非负整数值,它在程序中标识该程序打开的任何文件类的结构。这样的程序还将使用一种结构来指定有关 Web 服务器地址的详细信息。 + +这些相对较低级别的结构都不会出现在客户端程序中,因为 OpenSSL 库会将套接字基础设施和地址规范等封装在高级的安全结构中。其结果是一个简单的 API。下面首先看一下 `client` 程序示例中的安全性详细信息。 + +* 该程序首先加载相关的 OpenSSL 库,而我的函数 `init_ssl` 则对 OpenSSL 进行了两次调用: + + ``` +SSL_library_init(); SSL_load_error_strings(); +``` +* 下一个初始化步骤尝试获取安全*上下文*,这是建立和维护通往 Web 服务器的安全通道所需的信息框架。 在示例中使用了 TLS 1.2,如对 OpenSSL 库函数的调用所示: + + ``` +const SSL_METHOD* method = TLSv1_2_client_method(); /* TLS 1.2 */ +``` + + 如果调用成功,则将 `method ` 指针被传递给库函数,该函数创建类型为 `SSL_CTX` 的上下文: + + ``` +SSL_CTX* ctx = SSL_CTX_new(method); +``` + + `client` 程序检查每个关键库调用中的错误,然后如果其中一个调用失败,则程序终止。 +* 现在还有另外两个 OpenSSL 工件在起作用:SSL 类型的安全会话,从头到尾管理安全连接;以及类型为BIO(基本输入/输出)的安全流,用于与 Web 服务器进行通信。BIO 流是通过以下调用生成的: + + ``` +BIO* bio = BIO_new_ssl_connect(ctx); +``` + 请注意,最重要的上下文是参数。`BIO` 类型是 C 语言中 `FILE` 类型的 OpenSSL 封装器。此封装器可保护 `client` 程序与 Google 的网络服务器之间的输入和输出流。 +* 有了 `SSL_CTX` 和 `BIO`,然后程序在 SSL 会话中将它们组合在一起。三个库调用可以完成工作: + + ``` +BIO_get_ssl(bio, &ssl); /* get a TLS session */ +SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* for robustness */ +BIO_set_conn_hostname(bio, name); /* prepare to connect to Google */ +``` + 安全连接本身是通过以下调用建立的: + + ``` +BIO_do_connect(bio); +``` + 如果最后一次调用不成功,则 `client` 程序终止;否则,该连接已准备就绪,可以支持 `client` 程序与Google Web 服务器之间的机密对话。 + + +During the handshake with the web server, the `client` program receives one or more digital certificates that authenticate the server’s identity. However, the `client` program does not send a certificate of its own, which means that the authentication is one-way. (Web servers typically are configured _not_ to expect a client certificate.) Despite the failed verification of the web server’s certificate, the `client` program continues by fetching the Google homepage through the secure channel to the web server. + +Why does the attempt to verify a Google certificate fail? A typical OpenSSL installation has the directory `/etc/ssl/certs`, which includes the `ca-certificates.crt` file. The directory and the file together contain digital certificates that OpenSSL trusts out of the box and accordingly constitute a _truststore_. The truststore can be updated as needed, in particular, to include newly trusted certificates and to remove ones no longer trusted. + +The client program receives three certificates from the Google web server, but the OpenSSL truststore on my machine does not contain exact matches. As presently written, the `client` program does not pursue the matter by, for example, verifying the digital signature on a Google certificate (a signature that vouches for the certificate). If that signature were trusted, then the certificate containing it should be trusted as well. Nonetheless, the client program goes on to fetch and then to print Google’s homepage. The next section gets into more detail. + +### The hidden security pieces in the client program + +Let’s start with the visible security artifact in the client example—the digital certificate—and consider how other security artifacts relate to it. The dominant layout standard for a digital certificate is X509, and a production-grade certificate is issued by a certificate authority (CA) such as [Verisign][14]. + +A digital certificate contains various pieces of information (e.g., activation and expiration dates, and a domain name for the owner), including the issuer’s identity and _digital signature_, which is an encrypted _cryptographic hash_ value. A certificate also has an unencrypted hash value that serves as its identifying _fingerprint_. + +A hash value results from mapping an arbitrary number of bits to a fixed-length digest. What the bits represent (an accounting report, a novel, or maybe a digital movie) is irrelevant. For example, the Message Digest version 5 (MD5) hash algorithm maps input bits of whatever length to a 128-bit hash value, whereas the SHA1 (Secure Hash Algorithm version 1) algorithm maps input bits to a 160-bit value. Different input bits result in different—indeed, statistically unique—hash values. The next article goes into further detail and focuses on what makes a hash function _cryptographic_. + +Digital certificates differ in type (e.g., _root_, _intermediate_, and _end-entity_ certificates) and form a hierarchy that reflects these types. As the name suggests, a _root_ certificate sits atop the hierarchy, and the certificates under it inherit whatever trust the root certificate has. The OpenSSL libraries and most modern programming languages have an X509 type together with functions that deal with such certificates. The certificate from Google has an X509 format, and the `client` program checks whether this certificate is `X509_V_OK`. + +X509 certificates are based upon public-key infrastructure (PKI), which includes algorithms—RSA is the dominant one—for generating _key pairs_: a public key and its paired private key. A public key is an identity: [Amazon’s][15] public key identifies it, and my public key identifies me. A private key is meant to be kept secret by its owner. + +The keys in a pair have standard uses. A public key can be used to encrypt a message, and the private key from the same pair can then be used to decrypt the message. A private key also can be used to sign a document or other electronic artifact (e.g., a program or an email), and the public key from the pair can then be used to verify the signature. The following two examples fill in some details. + +In the first example, Alice distributes her public key to the world, including Bob. Bob then encrypts a message with Alice’s public key, sending the encrypted message to Alice. The message encrypted with Alice’s public key is decrypted with her private key, which (by assumption) she alone has, like so: + + +``` +             +------------------+ encrypted msg  +-------------------+ +Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's msg +             +------------------+                +-------------------+ +``` + +Decrypting the message without Alice’s private key is possible in principle, but infeasible in practice given a sound cryptographic key-pair system such as RSA. + +Now, for the second example, consider signing a document to certify its authenticity. The signature algorithm uses a private key from a pair to process a cryptographic hash of the document to be signed: + + +``` +                    +-------------------+ +Hash of document--->|Alice's private key|--->Alice's digital signature of the document +                    +-------------------+ +``` + +Assume that Alice digitally signs a contract sent to Bob. Bob then can use Alice’s public key from the key pair to verify the signature: + + +``` +                                             +------------------+ +Alice's digital signature of the document--->|Alice's public key|--->verified or not +                                             +------------------+ +``` + +It is infeasible to forge Alice’s signature without Alice’s private key: hence, it is in Alice’s interest to keep her private key secret. + +None of these security pieces, except for digital certificates, is explicit in the `client` program. The next article fills in the details with examples that use the OpenSSL utilities and library functions. + +### OpenSSL from the command line + +In the meantime, let’s take a look at OpenSSL command-line utilities: in particular, a utility to inspect the certificates from a web server during the TLS handshake. Invoking the OpenSSL utilities begins with the `openssl` command and then adds a combination of arguments and flags to specify the desired operation. + +Consider this command: + +`openssl list-cipher-algorithms` + +The output is a list of associated algorithms that make up a _cipher suite_. Here’s the start of the list, with comments to clarify the acronyms: + + +``` +AES-128-CBC ## Advanced Encryption Standard, Cipher Block Chaining +AES-128-CBC-HMAC-SHA1 ## Hash-based Message Authentication Code with SHA1 hashes +AES-128-CBC-HMAC-SHA256 ## ditto, but SHA256 rather than SHA1 +... +``` + +The next command, using the argument `s_client`, opens a secure connection to `[www.google.com][13]` and prints screens full of information about this connection: + +`openssl s_client -connect [www.google.com:443][16] -showcerts` + +The port number 443 is the standard one used by web servers for receiving HTTPS rather than HTTP connections. (For HTTP, the standard port is 80.) The network address `[www.google.com:443][16]` also occurs in the `client` program's code. If the attempted connection succeeds, the three digital certificates from Google are displayed together with information about the secure session, the cipher suite in play, and related items. For example, here is a slice of output from near the start, which announces that a _certificate chain_ is forthcoming. The encoding for the certificates is base64: + + +``` +Certificate chain + 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com + i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3 +\-----BEGIN CERTIFICATE----- +MIIEijCCA3KgAwIBAgIQdCea9tmy/T6rK/dDD1isujANBgkqhkiG9w0BAQsFADBU +MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw +... +``` + +A major web site such as Google usually sends multiple certificates for authentication. + +The output ends with summary information about the TLS session, including specifics on the cipher suite: + + +``` +SSL-Session: +    Protocol : TLSv1.2 +    Cipher : ECDHE-RSA-AES128-GCM-SHA256 +    Session-ID: A2BBF0E4991E6BBBC318774EEE37CFCB23095CC7640FFC752448D07C7F438573 +... +``` + +The protocol `TLS 1.2` is used in the `client` program, and the `Session-ID` uniquely identifies the connection between the `openssl` utility and the Google web server. The `Cipher` entry can be parsed as follows: + + * `ECDHE` (Elliptic Curve Diffie Hellman Ephemeral) is an effective and efficient algorithm for managing the TLS handshake. In particular, ECDHE solves the _key-distribution problem_ by ensuring that both parties in a connection (e.g., the client program and the Google web server) use the same encryption/decryption key, which is known as the _session key_. The follow-up article digs into the details. + + * `RSA` (Rivest Shamir Adleman) is the dominant public-key cryptosystem and named after the three academics who first described the system in the late 1970s. The key-pairs in play are generated with the RSA algorithm. + + * `AES128` (Advanced Encryption Standard) is a _block cipher_ that encrypts and decrypts blocks of bits. (The alternative is a _stream cipher_, which encrypts and decrypts bits one at a time.) The cipher is _symmetric_ in that the same key is used to encrypt and to decrypt, which raises the key-distribution problem in the first place. AES supports key sizes of 128 (used here), 192, and 256 bits: the larger the key, the better the protection. + +Key sizes for symmetric cryptosystems such as AES are, in general, smaller than those for asymmetric (key-pair based) systems such as RSA. For example, a 1024-bit RSA key is relatively small, whereas a 256-bit key is currently the largest for AES. + + * `GCM` (Galois Counter Mode) handles the repeated application of a cipher (in this case, AES128) during a secured conversation. AES128 blocks are only 128-bits in size, and a secure conversation is likely to consist of multiple AES128 blocks from one side to the other. GCM is efficient and commonly paired with AES128. + + * `SHA256` (Secure Hash Algorithm 256 bits) is the cryptographic hash algorithm in play. The hash values produced are 256 bits in size, although even larger values are possible with SHA. + + + + +Cipher suites are in continual development. Not so long ago, for example, Google used the RC4 stream cipher (Ron’s Cipher version 4 after Ron Rivest from RSA). RC4 now has known vulnerabilities, which presumably accounts, at least in part, for Google’s switch to AES128. + +### Wrapping up + +This first look at OpenSSL, through a secure C web client and various command-line examples, has brought to the fore a handful of topics in need of more clarification. [The next article gets into the details][17], starting with cryptographic hashes and ending with a fuller discussion of how digital certificates address the key distribution challenge. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://www.openssl.org/ +[3]: https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/ +[4]: http://condor.depaul.edu/mkalin +[5]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[6]: https://en.wikipedia.org/wiki/Netscape +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/memset.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[13]: http://www.google.com +[14]: https://www.verisign.com +[15]: https://www.amazon.com +[16]: http://www.google.com:443 +[17]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 From fb1a20e4a977b5982618084d16fea02e2557e038 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 14:45:41 +0800 Subject: [PATCH 040/285] APL --- sources/tech/20200108 How to setup multiple monitors in sway.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200108 How to setup multiple monitors in sway.md b/sources/tech/20200108 How to setup multiple monitors in sway.md index f156d204dc..8113f29c95 100644 --- a/sources/tech/20200108 How to setup multiple monitors in sway.md +++ b/sources/tech/20200108 How to setup multiple monitors in sway.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 68f6fcf5b8303d3d04ef6ab54ecc3b26a7bc10be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 15:01:16 +0800 Subject: [PATCH 041/285] TSL --- ... How to setup multiple monitors in sway.md | 85 ------------------- ... How to setup multiple monitors in sway.md | 85 +++++++++++++++++++ 2 files changed, 85 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20200108 How to setup multiple monitors in sway.md create mode 100644 translated/tech/20200108 How to setup multiple monitors in sway.md diff --git a/sources/tech/20200108 How to setup multiple monitors in sway.md b/sources/tech/20200108 How to setup multiple monitors in sway.md deleted file mode 100644 index 8113f29c95..0000000000 --- a/sources/tech/20200108 How to setup multiple monitors in sway.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to setup multiple monitors in sway) -[#]: via: (https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/) -[#]: author: (arte219 https://fedoramagazine.org/author/arte219/) - -How to setup multiple monitors in sway -====== - -![][1] - -Sway is a tiling Wayland compositor which has mostly the same features, look and workflow as the [i3 X11 window manager][2]. Because Sway uses Wayland instead of X11, the tools to setup X11 don’t always work in sway. This includes tools like _xrandr_, which are used in X11 window managers or desktops to setup monitors. This is why monitors have to be setup by editing the sway config file, and that’s what this article is about. - -## **Getting your monitor ID’s** - -First, you have to get the names sway uses to refer to your monitors. You can do this by running: - -``` -$ swaymsg -t get_outputs -``` - -You will get information about all of your monitors, every monitor separated by an empty line. - -You have to look for the first line of every section, and for what’s after “Output”. For example, when you see a line like “_Output DVI-D-1 ‘Philips Consumer Electronics Company’_”, the output ID is “DVI-D-1”. Note these ID’s and which physical monitors they belong to. - -## **Editing the config file** - -If you haven’t edited the Sway config file before, you have to copy it to your home directory by running this command: - -``` -cp -r /etc/sway/config ~/.config/sway/config -``` - -Now the default config file is located in _~/.config/sway_ and called “config”. You can edit it using any text editor. - -Now you have to do a little bit of math. Imagine a grid with the origin in the top left corner. The units of the X and Y coordinates are pixels. The Y axis is inverted. This means that if you, for example, start at the origin and you move 100 pixels to the right and 80 pixels down, your coordinates will be (100, 80). - -You have to calculate where your displays are going to end up on this grid. The locations of the displays are specified with the top left pixel. For example, if we want to have a monitor with name HDMI1 and a resolution of 1920×1080, and to the right of it a laptop monitor with name eDP1 and a resolution of 1600×900, you have to type this in your config file: - -``` -output HDMI1 pos 0 0 -output eDP1 pos 1920 0 -``` - -You can also specify the resolutions manually by using the _res_ option:  - -``` -output HDMI1 pos 0 0 res 1920x1080 -output eDP1 pos 1920 0 res 1600x900 -``` - -## **Binding workspaces to monitors** - -Using sway with multiple monitors can be a little bit tricky with workspace management. Luckily, you can bind workspaces to a specific monitor, so you can easily switch to that monitor and use your displays more efficiently. This can simply be done by the workspace command in your config file. For example, if you want to bind workspace 1 and 2 to monitor DVI-D-1 and workspace 8 and 9 to monitor HDMI-A-1, you can do that by using: - -``` -workspace 1 output DVI-D-1 -workspace 2 output DVI-D-1 -``` - -``` -workspace 8 output HDMI-A-1 -workspace 9 output HDMI-A-1 -``` - -That’s it! These are the basics of multi monitor setup in sway. A more detailed guide can be found at . - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/ - -作者:[arte219][a] -选题:[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/arte219/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/sway-multiple-monitors-816x345.png -[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ diff --git a/translated/tech/20200108 How to setup multiple monitors in sway.md b/translated/tech/20200108 How to setup multiple monitors in sway.md new file mode 100644 index 0000000000..b27ab5fe98 --- /dev/null +++ b/translated/tech/20200108 How to setup multiple monitors in sway.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to setup multiple monitors in sway) +[#]: via: (https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/) +[#]: author: (arte219 https://fedoramagazine.org/author/arte219/) + +如何在 sway 中设置多个显示器 +====== + +![][1] + +Sway 是一种平铺式 Wayland 合成器,具有与 [i3 X11 窗口管理器][2]相同的功能、外观和工作流程。 由于 Sway 使用 Wayland 而不是 X11,因此就不能一如既往地使用设置 X11 的工具。这包括 `xrandr` 之类的工具,这些工具在 X11 窗口管理器或桌面中用于设置监视器。这就是为什么必须通过编辑 Sway 配置文件来设置显示器的原因,这就是本文的目的。 + +### 获取你的显示器 ID + +首先,你必须获得 Sway 用来指代显示器的名称。你可以通过运行以下命令进行操作: + +``` +$ swaymsg -t get_outputs +``` + +你将获得所有显示器的相关信息,每个显示器都用空行分隔。 + +你必须查看每个部分的第一行,以及 “Output” 之后的内容。例如,当你看到 `Output DVI-D-1 'Philips Consumer Electronics Company'` 之类的行时,则该输出 ID 为 `DVI-D-1`。注意这些 ID 及其所属的物理监视器。 + +### 编辑配置文件 + +如果你之前没有编辑过 Sway 配置文件,则必须通过运行以下命令将其复制到主目录中: + +``` +cp -r /etc/sway/config ~/.config/sway/config +``` + +现在,默认配置文件位于 `~/.config/sway` 中,名为 `config`。你可以使用任何文本编辑器进行编辑。 + +现在你需要做一点数学。想象有一个网格,其原点在左上角。X 和 Y 坐标的单位是像素。Y 轴反转。这意味着,例如,如果你从原点开始,向右移动 100 像素,向下移动 80 像素,则坐标将为 `(100, 80)`。 + +你必须计算最终显示在此网格上的位置。显示器的位置由左上方的像素指定。例如,如果我们要使用名称为“HDMI1”且分辨率为 1920×1080 的显示器,并在其右侧使用名称为 “eDP1” 且分辨率为 1600×900 的笔记本电脑显示器,则必须在配置文件中键入 : + +``` +output HDMI1 pos 0 0 +output eDP1 pos 1920 0 +``` + +你还可以使用 `res` 选项手动指定分辨率: + +``` +output HDMI1 pos 0 0 res 1920x1080 +output eDP1 pos 1920 0 res 1600x900 +``` + +### 将工作空间绑定到显示器上 + +与多个监视器一起使用 Sway 在工作区管理中可能会有些棘手。幸运的是,你可以将工作区绑定到特定的监视器,因此你可以轻松地切换到该显示器并更有效地使用它。只需通过配置文件中的工作区命令即可完成。例如,如果要绑定工作区 1 和 2 到显示器 “DVI-D-1”,绑定工作区 8 和 9 到显示器 “HDMI-A-1”,则可以使用以下方法: + +``` +workspace 1 output DVI-D-1 +workspace 2 output DVI-D-1 +``` + +``` +workspace 8 output HDMI-A-1 +workspace 9 output HDMI-A-1 +``` + +就是这样。这就在 Sway 中多显示器设置的基础知识。可以在 中找到更详细的指南。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/ + +作者:[arte219][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/arte219/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/sway-multiple-monitors-816x345.png +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ From 4f32c39367defe03262aa390ea8462e4c9d9527f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 15:09:57 +0800 Subject: [PATCH 042/285] PRF @wxy --- ...0200108 How to setup multiple monitors in sway.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20200108 How to setup multiple monitors in sway.md b/translated/tech/20200108 How to setup multiple monitors in sway.md index b27ab5fe98..c6f5b216e7 100644 --- a/translated/tech/20200108 How to setup multiple monitors in sway.md +++ b/translated/tech/20200108 How to setup multiple monitors in sway.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to setup multiple monitors in sway) [#]: via: (https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/) [#]: author: (arte219 https://fedoramagazine.org/author/arte219/) -如何在 sway 中设置多个显示器 +如何在 Sway 中设置多个显示器 ====== ![][1] -Sway 是一种平铺式 Wayland 合成器,具有与 [i3 X11 窗口管理器][2]相同的功能、外观和工作流程。 由于 Sway 使用 Wayland 而不是 X11,因此就不能一如既往地使用设置 X11 的工具。这包括 `xrandr` 之类的工具,这些工具在 X11 窗口管理器或桌面中用于设置监视器。这就是为什么必须通过编辑 Sway 配置文件来设置显示器的原因,这就是本文的目的。 +Sway 是一种平铺式 Wayland 合成器,具有与 [i3 X11 窗口管理器][2]相同的功能、外观和工作流程。由于 Sway 使用 Wayland 而不是 X11,因此就不能一如既往地使用设置 X11 的工具。这包括 `xrandr` 之类的工具,这些工具在 X11 窗口管理器或桌面中用于设置显示器。这就是为什么必须通过编辑 Sway 配置文件来设置显示器的原因,这就是本文的目的。 ### 获取你的显示器 ID @@ -24,7 +24,7 @@ $ swaymsg -t get_outputs 你将获得所有显示器的相关信息,每个显示器都用空行分隔。 -你必须查看每个部分的第一行,以及 “Output” 之后的内容。例如,当你看到 `Output DVI-D-1 'Philips Consumer Electronics Company'` 之类的行时,则该输出 ID 为 `DVI-D-1`。注意这些 ID 及其所属的物理监视器。 +你必须查看每个部分的第一行,以及 `Output` 之后的内容。例如,当你看到 `Output DVI-D-1 'Philips Consumer Electronics Company'` 之类的行时,则该输出 ID 为 `DVI-D-1`。注意这些 ID 及其所属的物理监视器。 ### 编辑配置文件 @@ -54,7 +54,7 @@ output eDP1 pos 1920 0 res 1600x900 ### 将工作空间绑定到显示器上 -与多个监视器一起使用 Sway 在工作区管理中可能会有些棘手。幸运的是,你可以将工作区绑定到特定的监视器,因此你可以轻松地切换到该显示器并更有效地使用它。只需通过配置文件中的工作区命令即可完成。例如,如果要绑定工作区 1 和 2 到显示器 “DVI-D-1”,绑定工作区 8 和 9 到显示器 “HDMI-A-1”,则可以使用以下方法: +与多个监视器一起使用 Sway 在工作区管理中可能会有些棘手。幸运的是,你可以将工作区绑定到特定的显示器上,因此你可以轻松地切换到该显示器并更有效地使用它。只需通过配置文件中的 `workspace` 命令即可完成。例如,如果要绑定工作区 1 和 2 到显示器 “DVI-D-1”,绑定工作区 8 和 9 到显示器 “HDMI-A-1”,则可以使用以下方法: ``` workspace 1 output DVI-D-1 @@ -75,7 +75,7 @@ via: https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/ 作者:[arte219][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 21d4784af8cea630c3a5ee60807c9c08440015f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Jan 2020 15:10:33 +0800 Subject: [PATCH 043/285] PUB @wxy https://linux.cn/article-11809-1.html --- .../20200108 How to setup multiple monitors in sway.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200108 How to setup multiple monitors in sway.md (98%) diff --git a/translated/tech/20200108 How to setup multiple monitors in sway.md b/published/20200108 How to setup multiple monitors in sway.md similarity index 98% rename from translated/tech/20200108 How to setup multiple monitors in sway.md rename to published/20200108 How to setup multiple monitors in sway.md index c6f5b216e7..153933d6be 100644 --- a/translated/tech/20200108 How to setup multiple monitors in sway.md +++ b/published/20200108 How to setup multiple monitors in sway.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11809-1.html) [#]: subject: (How to setup multiple monitors in sway) [#]: via: (https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/) [#]: author: (arte219 https://fedoramagazine.org/author/arte219/) From c31282e5bdbc3961e5d7dca105d55e2351999bcd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 00:08:14 +0800 Subject: [PATCH 044/285] TSL --- ...arted with OpenSSL- Cryptography basics.md | 114 ++++++++---------- 1 file changed, 53 insertions(+), 61 deletions(-) diff --git a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md index 02b9005801..3fa15783dd 100644 --- a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md +++ b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -185,69 +185,67 @@ BIO_do_connect(bio); 如果最后一次调用不成功,则 `client` 程序终止;否则,该连接已准备就绪,可以支持 `client` 程序与Google Web 服务器之间的机密对话。 -During the handshake with the web server, the `client` program receives one or more digital certificates that authenticate the server’s identity. However, the `client` program does not send a certificate of its own, which means that the authentication is one-way. (Web servers typically are configured _not_ to expect a client certificate.) Despite the failed verification of the web server’s certificate, the `client` program continues by fetching the Google homepage through the secure channel to the web server. +在与 Web 服务器握手期间,`client` 程序会接收一个或多个数字证书,以认证服务器的身份。 但是,`client` 程序不会发送自己的证书,这意味着身份验证是单向的。(通常将 Web 服务器配置为**不**需要客户端证书。)尽管对 Web 服务器证书的验证失败,但 `client` 程序仍通过到 Web 服务器的安全通道继续获取 Google 主页。 -Why does the attempt to verify a Google certificate fail? A typical OpenSSL installation has the directory `/etc/ssl/certs`, which includes the `ca-certificates.crt` file. The directory and the file together contain digital certificates that OpenSSL trusts out of the box and accordingly constitute a _truststore_. The truststore can be updated as needed, in particular, to include newly trusted certificates and to remove ones no longer trusted. +为什么验证 Google 证书的尝试失败?典型的 OpenSSL 安装目录为 `/etc/ssl/certs`,其中包含 `ca-certificates.crt` 文件。该目录和文件包含着 OpenSSL 自带的数字证书,以此构成信任库。可以根据需要更新信任库,尤其是可以包括新信任的证书,并删除不再受信任的证书。 -The client program receives three certificates from the Google web server, but the OpenSSL truststore on my machine does not contain exact matches. As presently written, the `client` program does not pursue the matter by, for example, verifying the digital signature on a Google certificate (a signature that vouches for the certificate). If that signature were trusted, then the certificate containing it should be trusted as well. Nonetheless, the client program goes on to fetch and then to print Google’s homepage. The next section gets into more detail. +`client` 程序从 Google Web 服务器接收了三个证书,但是我的计算机上的 OpenSSL 信任库不包含完全匹配项。如目前所写,`client` 程序不会通过例如验证 Google 证书上的数字签名(一个用来证明该证书的签名)来解决此问题。如果该签名是受信任的,则包含该签名的证书也应受信任。尽管如此,`client` 程序仍继续进行获取页面,然后打印 Google 的主页。下一节将更详细地介绍。 -### The hidden security pieces in the client program +### 客户端程序中隐藏的安全性 -Let’s start with the visible security artifact in the client example—the digital certificate—and consider how other security artifacts relate to it. The dominant layout standard for a digital certificate is X509, and a production-grade certificate is issued by a certificate authority (CA) such as [Verisign][14]. +让我们从客户端示例中的可见安全工件(数字证书)开始,然后考虑其他安全工件如何与之相关。数字证书的主要布局标准是 X509,生产级证书由诸如 [Verisign][14] 的证书颁发机构(CA)颁发。 -A digital certificate contains various pieces of information (e.g., activation and expiration dates, and a domain name for the owner), including the issuer’s identity and _digital signature_, which is an encrypted _cryptographic hash_ value. A certificate also has an unencrypted hash value that serves as its identifying _fingerprint_. +数字证书包含各种信息(例如,激活和有效日期以及所有者的域名),包括发行者的身份和*数字签名*(这是加密过的*加密哈希*值)。证书还具有未加密的哈希值,用作其标识*指纹*。 -A hash value results from mapping an arbitrary number of bits to a fixed-length digest. What the bits represent (an accounting report, a novel, or maybe a digital movie) is irrelevant. For example, the Message Digest version 5 (MD5) hash algorithm maps input bits of whatever length to a 128-bit hash value, whereas the SHA1 (Secure Hash Algorithm version 1) algorithm maps input bits to a 160-bit value. Different input bits result in different—indeed, statistically unique—hash values. The next article goes into further detail and focuses on what makes a hash function _cryptographic_. +哈希值来自将任意数量的位映射到固定长度的摘要。这些位代表什么(会计报告、小说或数字电影)无关紧要。例如,消息摘要版本 5Message Digest version 5(MD5)哈希算法将任意长度的输入位映射到 128 位哈希值,而 SHA1(安全哈希算法版本 1Secure Hash Algorithm version 1)算法将输入位映射到 160 位值。不同的输入位会导致不同的(实际上是统计学上唯一的)哈希值。下一篇文章将进行更详细的介绍,并着重介绍什么使哈希函数具有加密功能。 -Digital certificates differ in type (e.g., _root_, _intermediate_, and _end-entity_ certificates) and form a hierarchy that reflects these types. As the name suggests, a _root_ certificate sits atop the hierarchy, and the certificates under it inherit whatever trust the root certificate has. The OpenSSL libraries and most modern programming languages have an X509 type together with functions that deal with such certificates. The certificate from Google has an X509 format, and the `client` program checks whether this certificate is `X509_V_OK`. +数字证书的类型有所不同(例如根证书、中间证书和最终实体证书),并形成了反映这些类型的层次结构。 顾名思义,*根*证书位于层次结构的顶部,其下的证书继承了根证书所具有的信任。OpenSSL 库和大多数现代编程语言都具有 X509 类型以及处理此类证书的函数。来自 Google 的证书具有 X509 格式,`client` 程序会检查该证书是否为 `X509_V_OK`。 -X509 certificates are based upon public-key infrastructure (PKI), which includes algorithms—RSA is the dominant one—for generating _key pairs_: a public key and its paired private key. A public key is an identity: [Amazon’s][15] public key identifies it, and my public key identifies me. A private key is meant to be kept secret by its owner. +X509 证书基于公共密钥基础结构public-key infrastructure(PKI),其中包括的算法(RSA 是占主导地位的算法)用于生成*密钥对*:公共密钥及其配对的私有密钥。公钥是一种身份:[Amazon][15] 的公钥对其进行标识,而我的公钥对我进行标识。私钥应由其所有者保密。 -The keys in a pair have standard uses. A public key can be used to encrypt a message, and the private key from the same pair can then be used to decrypt the message. A private key also can be used to sign a document or other electronic artifact (e.g., a program or an email), and the public key from the pair can then be used to verify the signature. The following two examples fill in some details. - -In the first example, Alice distributes her public key to the world, including Bob. Bob then encrypts a message with Alice’s public key, sending the encrypted message to Alice. The message encrypted with Alice’s public key is decrypted with her private key, which (by assumption) she alone has, like so: +成对出现的密钥具有标准用途。可以使用公钥对消息进行加密,然后可以使用同一个密钥对中的私钥对消息进行解密。私钥也可以用于对文档或其他电子产品(例如程序或电子邮件)进行签名,然后可以使用该对密钥中的公钥来验证签名。以下两个示例填充了一些细节。 +在第一个示例中,Alice 将她的公钥分发给世界,包括 Bob。然后,Bob 用 Alice 的公钥加密邮件,然后将加密的邮件发送给 Alice。用 Alice 的公钥加密的邮件将用她的私钥解密(假设是她自己的私钥),如下所示: ``` -             +------------------+ encrypted msg  +-------------------+ -Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's msg -             +------------------+                +-------------------+ + +------------------+ encrypted msg +-------------------+ +Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's msg + +------------------+ +-------------------+ ``` -Decrypting the message without Alice’s private key is possible in principle, but infeasible in practice given a sound cryptographic key-pair system such as RSA. - -Now, for the second example, consider signing a document to certify its authenticity. The signature algorithm uses a private key from a pair to process a cryptographic hash of the document to be signed: +原则上可以在没有 Alice 的私钥的情况下解密消息,但在实际情况下,如果使用像 RSA 这样的加密密钥对系统,则无法实现。 +现在,对于第二个示例,请考虑对文档签名以证明其真实性。签名算法使用密钥对中的私钥来处理要签名的文档的加密哈希: ``` -                    +-------------------+ -Hash of document--->|Alice's private key|--->Alice's digital signature of the document -                    +-------------------+ + +-------------------+ +Hash of document--->|Alice's private key|--->Alice's digital signature of the document + +-------------------+ ``` -Assume that Alice digitally signs a contract sent to Bob. Bob then can use Alice’s public key from the key pair to verify the signature: - +假设 Alice 以数字方式签署了发送给 Bob 的合同。然后,Bob 可以使用密钥对中的 Alice 的公钥来验证签名: ``` -                                             +------------------+ -Alice's digital signature of the document--->|Alice's public key|--->verified or not -                                             +------------------+ + +------------------+ +Alice's digital signature of the document--->|Alice's public key|--->verified or not + +------------------+ ``` -It is infeasible to forge Alice’s signature without Alice’s private key: hence, it is in Alice’s interest to keep her private key secret. +假若没有 Alice 的私钥,就无法伪造 Alice 的签名:因此,Alice 有必要保密她的私钥。 -None of these security pieces, except for digital certificates, is explicit in the `client` program. The next article fills in the details with examples that use the OpenSSL utilities and library functions. +在 `client` 程序中,除了数字证书以外,这些安全性都没有明确规定。下一篇文章使用使用 OpenSSL 实用程序和库函数的示例填充详细信息。 -### OpenSSL from the command line +### 命令行的 OpenSSL -In the meantime, let’s take a look at OpenSSL command-line utilities: in particular, a utility to inspect the certificates from a web server during the TLS handshake. Invoking the OpenSSL utilities begins with the `openssl` command and then adds a combination of arguments and flags to specify the desired operation. +同时,让我们看一下 OpenSSL 命令行实用程序:特别是在 TLS 握手期间检查来自 Web 服务器的证书的实用程序。调用 OpenSSL 实用程序从`openssl` 命令开始,然后添加参数和标志的组合以指定所需的操作。 -Consider this command: +看看以下命令: -`openssl list-cipher-algorithms` - -The output is a list of associated algorithms that make up a _cipher suite_. Here’s the start of the list, with comments to clarify the acronyms: +``` +openssl list-cipher-algorithms +``` +该输出是组成加密算法套件cipher suite的相关算法的列表。下面是列表的开头,注释以澄清首字母缩写词: ``` AES-128-CBC ## Advanced Encryption Standard, Cipher Block Chaining @@ -256,27 +254,28 @@ AES-128-CBC-HMAC-SHA256 ## ditto, but SHA256 rather than SHA1 ... ``` -The next command, using the argument `s_client`, opens a secure connection to `[www.google.com][13]` and prints screens full of information about this connection: +使用参数 `s_client` 的下一条命令将打开到 [www.google.com][13] 的安全连接,并在屏幕上显示有关此连接的所有信息: -`openssl s_client -connect [www.google.com:443][16] -showcerts` +``` +openssl s_client -connect www.google.com:443 -showcerts +``` -The port number 443 is the standard one used by web servers for receiving HTTPS rather than HTTP connections. (For HTTP, the standard port is 80.) The network address `[www.google.com:443][16]` also occurs in the `client` program's code. If the attempted connection succeeds, the three digital certificates from Google are displayed together with information about the secure session, the cipher suite in play, and related items. For example, here is a slice of output from near the start, which announces that a _certificate chain_ is forthcoming. The encoding for the certificates is base64: +端口号 443 是 Web 服务器用于接收 HTTPS 而不是 HTTP 连接的标准端口号。(对于 HTTP,标准端口为 80)网络地址 [www.google.com:443 也出现在 `client` 程序的代码中。如果尝试的连接成功,则将显示来自 Google 的三个数字证书以及有关安全会话、正在使用的加密算法套件以及相关项目的信息。例如,这是从头开始的一部分输出,它声明*证书链*即将到来。证书的编码为 base64: ``` Certificate chain - 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com - i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3 -\-----BEGIN CERTIFICATE----- + 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com + i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3 +-----BEGIN CERTIFICATE----- MIIEijCCA3KgAwIBAgIQdCea9tmy/T6rK/dDD1isujANBgkqhkiG9w0BAQsFADBU MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw ... ``` -A major web site such as Google usually sends multiple certificates for authentication. - -The output ends with summary information about the TLS session, including specifics on the cipher suite: +诸如 Google 之类的主要网站通常会发送多个证书进行身份验证。 +输出以有关 TLS 会话的摘要信息结尾,包括加密算法套件的详细信息: ``` SSL-Session: @@ -286,28 +285,21 @@ SSL-Session: ... ``` -The protocol `TLS 1.2` is used in the `client` program, and the `Session-ID` uniquely identifies the connection between the `openssl` utility and the Google web server. The `Cipher` entry can be parsed as follows: +`client` 程序中使用了协议 TLS 1.2,`Session-ID` 唯一地标识了 `openssl` 实用程序和 Google Web 服务器之间的连接。 `Cipher` 条目可以按以下方式进行解析: - * `ECDHE` (Elliptic Curve Diffie Hellman Ephemeral) is an effective and efficient algorithm for managing the TLS handshake. In particular, ECDHE solves the _key-distribution problem_ by ensuring that both parties in a connection (e.g., the client program and the Google web server) use the same encryption/decryption key, which is known as the _session key_. The follow-up article digs into the details. +* `ECDHE`(Elliptic Curve Diffie Hellman Ephemeral椭圆曲线 Diffie-Hellman(临时))是一种用于管理 TLS 握手的有效而高效的算法。尤其是,ECDHE 通过确保连接双方(例如,`client` 程序和 Google Web 服务器)使用相同的加密/解密密钥(称为*会话密钥*)来解决“密钥分发问题”。后续文章会深入探讨该细节。 +* `RSA`(Rivest Shamir Adleman)是主要的公共密钥密码系统,并以 1970 年代后期首次描述该系统的三位学者的名字命名。这个正在使用的密钥对是使用 RSA 算法生成的。 +* `AES128`(高级加密标准Advanced Encryption Standard)是一种块式加密算法block cipher,用于加密和解密位块blocks of bits。(另一种算法是流式加密算法stream cipher,它一次加密和解密一个位。)该加密算法是对称加密算法,因为使用同一个密钥进行加密和解密,这首先引起了密钥分发问题。AES 支持 128(此处使用)、192 和 256 位的密钥大小:密钥越大,保护越好。 - * `RSA` (Rivest Shamir Adleman) is the dominant public-key cryptosystem and named after the three academics who first described the system in the late 1970s. The key-pairs in play are generated with the RSA algorithm. + 通常,像 AES 这样的对称加密系统的密钥大小要小于像 RSA 这样的非对称(基于密钥对)系统的密钥大小。例如,1024 位 RSA 密钥相对较小,而 256 位密钥当前是 AES 最大的密钥。 +* `GCM`(伽罗瓦计数器模式Galois Counter Mode)处理在安全对话期间重复应用加密算法(在这种情况下为 AES128)。AES128 块的大小仅为 128 位,安全对话很可能包含从一侧到另一侧的多个 AES128 块。GCM 非常有效,通常与 AES128 搭配使用。 +* `SHA256` (256 位安全哈希算法Secure Hash Algorithm 256 bits)是正在使用的加密哈希算法。生成的哈希值的大小为 256 位,尽管使用 SHA 甚至可以更大。 - * `AES128` (Advanced Encryption Standard) is a _block cipher_ that encrypts and decrypts blocks of bits. (The alternative is a _stream cipher_, which encrypts and decrypts bits one at a time.) The cipher is _symmetric_ in that the same key is used to encrypt and to decrypt, which raises the key-distribution problem in the first place. AES supports key sizes of 128 (used here), 192, and 256 bits: the larger the key, the better the protection. +加密算法套件正在不断发展中。例如,不久前,Google 使用 RC4 流加密算法(是 RSA 的 Ron Rivest 后来开发的 Ron's Cipher 版本 4)。 RC4 现在有已知的漏洞,这至少部分导致了 Google 转换为 AES128。 -Key sizes for symmetric cryptosystems such as AES are, in general, smaller than those for asymmetric (key-pair based) systems such as RSA. For example, a 1024-bit RSA key is relatively small, whereas a 256-bit key is currently the largest for AES. +### 总结 - * `GCM` (Galois Counter Mode) handles the repeated application of a cipher (in this case, AES128) during a secured conversation. AES128 blocks are only 128-bits in size, and a secure conversation is likely to consist of multiple AES128 blocks from one side to the other. GCM is efficient and commonly paired with AES128. - - * `SHA256` (Secure Hash Algorithm 256 bits) is the cryptographic hash algorithm in play. The hash values produced are 256 bits in size, although even larger values are possible with SHA. - - - - -Cipher suites are in continual development. Not so long ago, for example, Google used the RC4 stream cipher (Ron’s Cipher version 4 after Ron Rivest from RSA). RC4 now has known vulnerabilities, which presumably accounts, at least in part, for Google’s switch to AES128. - -### Wrapping up - -This first look at OpenSSL, through a secure C web client and various command-line examples, has brought to the fore a handful of topics in need of more clarification. [The next article gets into the details][17], starting with cryptographic hashes and ending with a fuller discussion of how digital certificates address the key distribution challenge. +通过安全的 C Web 客户端和各种命令行示例对 OpenSSL 的首次了解,使一些需要进一步阐明的主题脱颖而出。[下一篇文章会详细介绍][17],从加密散列开始,到结束时对数字证书如何应对密钥分发挑战的更全面讨论。 -------------------------------------------------------------------------------- @@ -315,7 +307,7 @@ via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 作者:[Marty Kalin][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1b372605e701c665eac47d0938515ffea7475bd2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Jan 2020 00:58:09 +0800 Subject: [PATCH 045/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200123=20Wine?= =?UTF-8?q?=205.0=20is=20Released!=20Here=E2=80=99s=20How=20to=20Install?= =?UTF-8?q?=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md --- ...0 is Released- Here-s How to Install it.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md diff --git a/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md new file mode 100644 index 0000000000..4c82b48a5d --- /dev/null +++ b/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Wine 5.0 is Released! Here’s How to Install it) +[#]: via: (https://itsfoss.com/wine-5-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Wine 5.0 is Released! Here’s How to Install it +====== + +_**Brief: A new major release of Wine is here. With Wine 5.0, running Windows applications and games on Linux is further improved.**_ + +With some efforts, you can [run Windows applications on Linux][1] using Wine. Wine is a tool that you may try when you must use a software that is available only on Windows. It supports a number of such software. + +A new major release for Wine has landed i.e Wine 5.0, almost after a year of its 4.0 release. + +Wine 5.0 release introduces a couple of major features and a lot of significant changes/improvements. In this article, I’ll highlight what’s new and also mention the installation instructions. + +### What’s New In Wine 5.0? + +![][2] + +The key changes in 5.0 release as mentioned in their [official announcement][3]: + + * Builtin modules in PE format. + * Multi-monitor support. + * XAudio2 reimplementation. + * Vulkan 1.1 support. + * Microsoft Installer (MSI) Patch Files are supported. + * Performance improvements. + + + +So, with Vulkan 1.1 support and multi-monitor support – Wine 5.0 release is a big deal. + +In addition to the key highlights, you can also expect better controller support in the new version considering thousands of changes/improvements involved in the new release. + +It is also worth noting that this release is being dedicated to the memory of **Józef Kucia** (_lead developer of the vkd3d project_) + +They’ve also mentioned this in their [release notes][4]: + +> This release is dedicated to the memory of Józef Kucia, who passed away in August 2019 at the young age of 30. Józef was a major contributor to Wine’s Direct3D implementation, and the lead developer of the vkd3d project. His skills and his kindness are sorely missed by all of us. + +### How to install Wine 5.0 on Ubuntu and Linux Mint + +Note + +_If you have Wine installed before, you should remove it completely to avoid any conflict (as you wish). Also, the WineHQ key repository key was changed recently, you should refer to its_ [_download page_][5] _for additional instructions on that according to your Linux distribution._ + +The source for Wine 5.0 is available on its [official website][3]. You can read more about [building wine][6] in order to make it work. Arch-based users should be getting it soon. + +Here’ I’ll show you the steps to install Wine 5.0 on Ubuntu and other Ubuntu-based distributions. + +First, remove existing Wine install with this command: + +``` +sudo apt remove winehq-stable wine-stable wine1.6 +``` + +Download the official Wine repository key and add it: + +``` +wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - +``` + +_**Now the next step involves adding the repository and for that, you need to [know your Ubuntu version][7] first.**_ + +For **Ubuntu 19.10**, add this repository: + +``` +sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main' +``` + +If you are using **Ubuntu 18.04** or **Linux Mint 19.x**, use this command to add the repository: + +``` +sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' +``` + +For **Ubuntu 16.04 and Linux Mint 18.x series**, you can use this command: + +``` +sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main' +``` + +Now that you have added the correct repository, you can install Wine 5.0 using this command: + +``` +sudo apt update && sudo apt install --install-recommends winehq-stable +``` + +**Wrapping Up** + +Have you tried the latest Wine 5.0 release yet? If yes, what improvements do you see in action? + +Let me know your thoughts on the new release in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wine-5-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/use-windows-applications-linux/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/wine_5.png?ssl=1 +[3]: https://www.winehq.org/news/2020012101 +[4]: https://www.winehq.org/announce/5.0 +[5]: https://wiki.winehq.org/Download +[6]: https://wiki.winehq.org/Building_Wine +[7]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ From 49f2d59ecd57b88973b0adfb1c08aadb96c1e001 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Jan 2020 00:59:28 +0800 Subject: [PATCH 046/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200122=209=20fa?= =?UTF-8?q?vorite=20open=20source=20tools=20for=20Node.js=20developers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200122 9 favorite open source tools for Node.js developers.md --- ...pen source tools for Node.js developers.md | 249 ++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 sources/tech/20200122 9 favorite open source tools for Node.js developers.md diff --git a/sources/tech/20200122 9 favorite open source tools for Node.js developers.md b/sources/tech/20200122 9 favorite open source tools for Node.js developers.md new file mode 100644 index 0000000000..7885b9f642 --- /dev/null +++ b/sources/tech/20200122 9 favorite open source tools for Node.js developers.md @@ -0,0 +1,249 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 favorite open source tools for Node.js developers) +[#]: via: (https://opensource.com/article/20/1/open-source-tools-nodejs) +[#]: author: (Hiren Dhadhuk https://opensource.com/users/hirendhadhuk) + +9 favorite open source tools for Node.js developers +====== +Of the wide range of tools available to simplify Node.js development, +here are the 10 best. +![Tools illustration][1] + +I recently read a survey on [StackOverflow][2] that said more than 49% of developers use Node.js for their projects. This came as no surprise to me. + +As an avid user of technology, I think it's safe to say that the introduction of Node.js led to a new era of software development. It is now one of the most preferred technologies for software development, right next to JavaScript. + +### What is Node.js, and why is it so popular? + +Node.js is a cross-platform, open source runtime environment for executing JavaScript code outside of the browser. It is also a preferred runtime environment built on Chrome's JavaScript runtime and is mainly used for building fast, scalable, and efficient network applications. + +I remember when we used to sit for hours and hours coordinating between front-end and back-end developers who were writing different scripts for each side. All of this changed as soon as Node.js came into the picture. I believe that the one thing that drives developers towards this technology is its two-way efficiency. + +With Node.js, you can run your code simultaneously on both the client and the server side, speeding up the whole process of development. Node.js bridges the gap between front-end and back-end development and makes the development process much more efficient. + +### A wave of Node.js tools + +For 49% of all developers (including me), Node.js is at the top of the pyramid when it comes to front-end and back-end development. There are tons of [Node.js use cases][3] that have helped me and my team deliver complex projects within our deadlines. Fortunately, Node.js' rising popularity has also produced a wave of open source projects and tools to help developers working with the environment. + +Recently, there has been a sudden increase in demand for projects built with Node.js. Sometimes, I find it quite challenging to manage these projects and keep up the pace while delivering high-quality results. So I decided to automate certain aspects of development using some of the most efficient of the many open source tools available for Node.js developers. + +In my extensive experience with Node.js, I've worked with a wide range of tools that have helped me with the overall development process—from streamlining the coding process to monitoring to content management. + +To help my fellow Node.js developers, I compiled this list of 9 of my favorite open source tools for simplifying Node.js development. + +### Webpack + +[Webpack][4] is a handy JavaScript module bundler used to simplify front-end development. It detects modules with dependencies and transforms them into static assets that represent the modules. + +You can install the tool through either the npm or Yarn package manager. + +With npm: + + +``` +`npm install --save-dev webpack` +``` + +With Yarn: + + +``` +`yarn add webpack --dev` +``` + +Webpack creates single bundles or multiple chains of assets that can be loaded asynchronously at runtime. Each asset does not have to be loaded individually. Bundling and serving assets becomes quick and efficient with the Webpack tool, making the overall user experience better and reducing the developer's hassle in managing load time. + +### Strapi + +[Strapi][5] is an open source headless content management system (CMS). A headless CMS is basically software that lets you manage your content devoid of a prebuilt frontend. It is a backend-only system that functions using RESTful APIs. + +You can install Strapi through Yarn or npx packages. + +With Yarn: + + +``` +`yarn create strapi-app my-project --quickstart` +``` + +With npx: + + +``` +`npx create-strapi-app my-project --quickstart` +``` + +Strapi's goal is to fetch and deliver your content in a structured manner across any device. The CMS makes it easy to manage your applications' content and make sure they are dynamic and accessible across any device. + +It provides a lot of features, including file upload, a built-in email system, JSON Web Token (JWT) authentication, and auto-generated documentation. I find it very convenient, as it simplifies the overall CMS and gives me full autonomy in editing, creating, or deleting all types of contents. + +In addition, the content structure built through Strapi is extremely flexible because you can create and reuse groups of content and customizable APIs. + +### Broccoli + +[Broccoli][6] is a powerful build tool that runs on an [ES6][7] module. Build tools are software that let you assemble all the different assets within your application or website, e.g., images, CSS, JavaScript, etc., into one distributable format. Broccoli brands itself as the "asset pipeline for ambitious applications." + +You need a project directory to work with Broccoli. Once you have the project directory in place, you can install Broccoli with npm using: + + +``` +npm install --save-dev broccoli +npm install --global broccoli-cli +``` + +You can also use Yarn for installation.  + +The current version of Node.js would be the best version for the tool as it provides long-time support. This helps you avoid the hassle of updating and reinstalling as you go. Once the installation process is completed, you can include the build specification in your Brocfile.js. + +In Broccoli, the unit of abstraction is a tree, which stores files and subdirectories within specific subdirectories. Therefore, before you build, you must have a specific idea of what you want your build to look like. + +The best part about Broccoli is that it comes with a built-in server for development that lets you host your assets on a local HTTP server. Broccoli is great for streamlined rebuilds, as its concise architecture and flexible ecosystem boost rebuild and compilation speeds. Broccoli lets you get organized to save time and maximize productivity during development. + +### Danger + +[Danger][8] is a very handy open source tool for streamlining your pull request (PR) checks. As Danger's library description says, the tool helps you "formalize" your code review system by managing PR checks. Danger integrates with your CI and helps you speed up the review process. + +Integrating Danger with your project is an easy step-by-step process—you just need to include the Danger module and create a Danger file for each project. However, it's more convenient to create a Danger account (easy to do through GitHub or Bitbucket), then set up access tokens for your open source software projects. + +Danger can be installed via NPM or Yarn. To use Yarn, add danger -D to add it to your package.JSON. + +After you add Danger to your CI, you can: + + * Highlight build artifacts of importance + * Manage sprints by enforcing links to tools like Trello and Jira + * Enforce changelogs + * Utilize descriptive labels + * And much more + + + +For example, you can design a system that defines the team culture and sets out specific rules for code review and PR checks. Common issues can be solved based on the metadata Danger provides along with its extensive plugin ecosystem. + +### Snyk + +Cybersecurity is a major concern for developers. [Snyk][9] is one of the most well-known tools to fix vulnerabilities in open source components. It started as a project to fix vulnerabilities in Node.js projects and has evolved to detect and fix vulnerabilities in Ruby, Java, Python, and Scala apps as well. Snyk mainly runs in four stages: + + * Finding vulnerability dependencies + * Fixing specific vulnerabilities + * Preventing security risks by PR checks + * Monitoring apps continuously + + + +Snyk can be integrated with your project at any stage, including coding, CI/CD, and reporting. I find it extremely helpful for testing Node.js projects to test out npm packages for security risks or at build-time. You can also run PR checks for your applications in GitHub to make your projects more secure. Synx also provides a range of integrations that you can use to monitor dependencies and fix specific problems. + +To run Snyk on your machine locally, you can install it through NPM: + + +``` +`npm install -g snyk` +``` + +### Migrat + +[Migrat][10] is an extremely easy to use data-migration tool that uses plain text. It works across a diverse range of stacks and processes that make it even more convenient. You can install Migrat with a simple line of code: + + +``` +`$ npm install -g migrat` +``` + +Migrat is not specific to a particular database engine. It supports multi-node environments, as migrations can run on one node globally or once per server. What makes Migrat convenient is the facilitation of passing context to each migration. + +You can define what each migration is for (e.g.,. database sets, connections, logging interfaces, etc.). Moreover, to avoid haphazard migrations, where multiple servers are running migrations globally, Migrat facilitates global lockdown while the process is running so that it can run only once globally. It also comes with a range of plug-ins for SQL databases, Slack, HipChat, and the Datadog dashboard. You can send live migrations to any of these platforms. + +### Clinic.js + +[Clinic.js][11] is an open source monitoring tool for Node.js projects. It combines three different tools—Doctor, Bubbleprof, and Flame—that help you monitor, detect, and solve performance issues with Node.js. + +You can install Clinic.js from npm by running this command: + + +``` +`$ npm install clinic` +``` + +You can choose which of the three tools that comprise Clinic.js you want to use based on which aspect of your project you want to monitor and the report you want to generate: + + * Doctor provides detailed metrics by injecting probes and provides recommendations on the overall health of your project. + * Bubbleprof is great for profiling and generates metrics using async_hooks. + * Flame is great for uncovering hot paths and bottlenecks in your code. + + + +### PM2 + +Monitoring is one of the most important aspects of any backend development process. [PM2][12] is a process management tool for Node.js that helps developers monitor multiple aspects of their projects such as logs, delays, and speed. The tool is compatible with Linux, MacOS, and Windows and supports all Node.js versions starting from Node.js 8.X. + +You can install PM2 with npm using: + + +``` +`$ npm install pm2 --g` +``` + +If you do not already have Node.js installed, you can use: + + +``` +`wget -qO- https://getpm2.com/install.sh | bash` +``` + +Once it's installed, start the application with: + + +``` +`$ pm2 start app.js` +``` + +The best part about PM2 is that it lets you run your apps in cluster mode. You can spawn a process for multiple CPU cores at a time. This makes it easy to enhance application performance and maximize reliability. PM2 is also great for updates, as you can update your apps and reload them with zero downtime using the "hot reload" option. Overall, it's a great tool to simplify process management for Node.js applications. + +### Electrode + +[Electrode][13] is an open source application platform from Walmart Labs. The platform helps you build large-scale, universal React/Node.js applications in a structured manner. + +The Electrode app generator lets you build a flexible core focused on the code, provides some great modules to add complex features to the app, and comes with a wide range of tools to optimize your app's Node.js bundle. + +Electrode can be installed using npm. Once the installation is finished, you can start the app using Ignite and dive right in with the Electrode app generator. + +You can install Electrode using NPM: + + +``` +`npm install -g electrode-ignite xclap-cli` +``` + +### Which are your favorite? + +These are just a few of the always-growing list of open source tools that can come in handy at different stages when working with Node.js. Which are your go-to open source Node.js tools? Please share your recommendations in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-tools-nodejs + +作者:[Hiren Dhadhuk][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hirendhadhuk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_hardware_purple.png?itok=3NdVoYhl (Tools illustration) +[2]: https://insights.stackoverflow.com/survey/2019#technology-_-other-frameworks-libraries-and-tools +[3]: https://www.simform.com/nodejs-use-case/ +[4]: https://webpack.js.org/ +[5]: https://strapi.io/ +[6]: https://broccoli.build/ +[7]: https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_-_ECMAScript_2015 +[8]: https://danger.systems/ +[9]: https://snyk.io/ +[10]: https://github.com/naturalatlas/migrat +[11]: https://clinicjs.org/ +[12]: https://pm2.keymetrics.io/ +[13]: https://www.electrode.io/ From 338b1755aa743a62ae70ddb551512a6b5e9df765 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Jan 2020 00:59:58 +0800 Subject: [PATCH 047/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200122=20Get=20?= =?UTF-8?q?your=20RSS=20feeds=20and=20podcasts=20in=20one=20place=20with?= =?UTF-8?q?=20this=20open=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md --- ...in one place with this open source tool.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md diff --git a/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md new file mode 100644 index 0000000000..994523d830 --- /dev/null +++ b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get your RSS feeds and podcasts in one place with this open source tool) +[#]: via: (https://opensource.com/article/20/1/open-source-rss-feed-reader) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Get your RSS feeds and podcasts in one place with this open source tool +====== +Keep up with your news feed and podcasts with Newsboat in the twelfth in +our series on 20 ways to be more productive with open source in 2020. +![Ship captain sailing the Kubernetes seas][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Access your RSS feeds and podcasts with Newsboat + +RSS news feeds are an exceptionally handy way to keep up to date on various websites. In addition to Opensource.com, I follow the annual [SysAdvent][2] sysadmin tools feed, some of my favorite authors, and several webcomics. RSS readers allow me to "batch up" my reading, so I'm not spending every day on a bunch of different websites. + +![Newsboat][3] + +[Newsboat][4] is a terminal-based RSS feed reader that looks and feels a lot like the email program [Mutt][5]. It makes news reading easy and has a lot of nice features. + +Installing Newsboat is pretty easy since it is included with most distributions (and Homebrew on MacOS). Once it is installed, adding the first feed is as easy as adding the URL to the **~/.newsboat/urls** file. If you are migrating from another feed reader and have an OPML file export of your feeds, you can import that file with: + + +``` +`newsboat -i ` +``` + +After you've added your feeds, the Newsboat interface is _very_ familiar, especially if you've used Mutt. You can scroll up and down with the arrow keys, check for new items in a feed with **r**, check for new items in all feeds with **R**, press **Enter** to open a feed and select an article to read. + +![Newsboat article list][6] + +You are not limited to just the local URL list, though. Newsboat is also a client for news reading services like [Tiny Tiny RSS][7], ownCloud and Nextcloud News, and a few Google Reader successors. Details on that and a whole host of other configuration options are covered in [Newsboat's documentation][8]. + +![Reading an article in Newsboat][9] + +#### Podcasts + +Newsboat also provides [podcast support][10] through Podboat, an included application that facilitates downloading and queuing podcast episodes. While viewing a podcast feed in Newsboat, press **e** to add the episode to your download queue. All the information will be stored in a queue file in the **~/.newsboat** directory. Podboat reads this queue and downloads the episode(s) to your local drive. You can do this from the Podboat user interface (which looks and acts like Newsboat), or you can tell Podboat to download them all with **podboat -a**. As a podcaster and podcast listener, I think this is _really_ handy. + +![Podboat][11] + +Overall, Newsboat has some really great features and is a nice, lightweight alternative to web-based or desktop apps. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-rss-feed-reader + +作者:[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/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://sysadvent.blogspot.com/ +[3]: https://opensource.com/sites/default/files/uploads/productivity_12-1.png (Newsboat) +[4]: https://newsboat.org +[5]: http://mutt.org/ +[6]: https://opensource.com/sites/default/files/uploads/productivity_12-2.png (Newsboat article list) +[7]: https://tt-rss.org/ +[8]: https://newsboat.org/releases/2.18/docs/newsboat.html +[9]: https://opensource.com/sites/default/files/uploads/productivity_12-3.png (Reading an article in Newsboat) +[10]: https://newsboat.org/releases/2.18/docs/newsboat.html#_podcast_support +[11]: https://opensource.com/sites/default/files/uploads/productivity_12-4.png (Podboat) From 809602127fcf0197029c38e9697f27c64338fd2f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Jan 2020 01:00:37 +0800 Subject: [PATCH 048/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200122=20Screen?= =?UTF-8?q?shot=20your=20Linux=20system=20configuration=20with=20Bash=20to?= =?UTF-8?q?ols?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md --- ...ux system configuration with Bash tools.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md diff --git a/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md b/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md new file mode 100644 index 0000000000..325b3aa019 --- /dev/null +++ b/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Screenshot your Linux system configuration with Bash tools) +[#]: via: (https://opensource.com/article/20/1/screenfetch-neofetch) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +Screenshot your Linux system configuration with Bash tools +====== +ScreenFetch and Neofetch make it easy to share your Linux environment +with others. +![metrics and data shown on a computer screen][1] + +There are many reasons you might want to share your Linux configuration with other people. You might be looking for help troubleshooting a problem on your system, or maybe you're so proud of the environment you've created that you want to showcase it to fellow open source enthusiasts. + +You could get some of that information with a **cat /proc/cpuinfo** or **lscpu** command at the Bash prompt. But if you want to share more details, such as your operating system, kernel, uptime, shell environment, screen resolution, etc., you have two great tools to choose: screenFetch and Neofetch. + +### ScreenFetch + +[ScreenFetch][2] is a Bash command-line utility that can produce a very nice screenshot of your system configuration and uptime. It is an easy way to share your system's configuration with others in a colorful way. + +It's simple to install screenFetch for many Linux distributions.  + +On Fedora, enter: + + +``` +`$ sudo dnf install screenfetch` +``` + +On Ubuntu, enter: + + +``` +`$ sudo apt install screenfetch` +``` + +For other operating systems, including FreeBSD, MacOS, and more, consult the screenFetch wiki's [installation page][3]. Once screenFetch is installed, it can produce a detailed and colorful screenshot like this: + +![screenFetch][4] + +ScreenFetch also provides various command-line options to fine-tune your results. For example, **screenfetch -v** returns verbose output that presents each option line-by-line along with the display shown above. + +And **screenfetch -n** eliminates the operating system icon when it displays your system information. + +![screenfetch -n option][5] + +Other options include **screenfetch -N**, which strips all color from the output; **screenfetch -t**, which truncates the output depending on the size of the terminal; and **screenFetch -E**, which suppresses errors. + +Be sure to check the man page on your system for other options. ScreenFetch is open source under the GPLv3, and you can learn more about the project in its [GitHub repository][6]. + +### Neofetch + +[Neofetch][7] is another tool to create a screenshot with your system information. It is written in Bash 3.2 and is open source under the [MIT License][8]. + +According to the project's website, "Neofetch supports almost 150 different operating systems. From Linux to Windows, all the way to more obscure operating systems like Minix, AIX, and Haiku." + +![Neofetch][9] + +The project maintains a wiki with excellent [installation documentation][10] for a variety of distributions and operating systems. + +If you are on Fedora, RHEL, or CentOS, you can install Neofetch at the Bash prompt with: + + +``` +`$ sudo dnf install neofetch` +``` + +On Ubuntu 17.10 and greater, you can use: + + +``` +`$ sudo apt install neofetch` +``` + +On its first run, Neofetch writes a **~/.config/neofetch/config.conf** file to your home directory (**.config/config.conf**), which enables you to [customize and control][11] every aspect of Neofetch's output. For example, you can configure Neofetch to use the image, ASCII file, or wallpaper of your choice—or nothing at all. The config.conf file also makes it easy to share your customization with others. + +If Neofetch doesn't support your operating system or provide all the options you are looking for, be sure to open up an issue in the project's [GitHub repo][12]. + +### Conclusion + +No matter why you want to share your system configuration, screenFetch or Neofetch should enable you to do so. Do you know of another open source tool that provides this functionality on Linux? Please share your favorite in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/screenfetch-neofetch + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://github.com/KittyKatt/screenFetch +[3]: https://github.com/KittyKatt/screenFetch/wiki/Installation +[4]: https://opensource.com/sites/default/files/uploads/screenfetch.png (screenFetch) +[5]: https://opensource.com/sites/default/files/uploads/screenfetch-n.png (screenfetch -n option) +[6]: http://github.com/KittyKatt/screenFetch +[7]: https://github.com/dylanaraps/neofetch +[8]: https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md +[9]: https://opensource.com/sites/default/files/uploads/neofetch.png (Neofetch) +[10]: https://github.com/dylanaraps/neofetch/wiki/Installation +[11]: https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +[12]: https://github.com/dylanaraps/neofetch/issues From 3e88d02a61fb8b571b4087922b99dfb8cc6626bf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Jan 2020 01:02:11 +0800 Subject: [PATCH 049/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200122=20Settin?= =?UTF-8?q?g=20up=20passwordless=20Linux=20logins=20using=20public/private?= =?UTF-8?q?=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md --- ... Linux logins using public-private keys.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md diff --git a/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md b/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md new file mode 100644 index 0000000000..2c61a4942b --- /dev/null +++ b/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -0,0 +1,212 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Setting up passwordless Linux logins using public/private keys) +[#]: via: (https://www.networkworld.com/article/3514607/setting-up-passwordless-linux-logins-using-publicprivate-keys.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Setting up passwordless Linux logins using public/private keys +====== +Using a set of public/private keys to allow you to log into a remote Linux system or run commands using ssh without a password can be very convenient, but setup is just tad tricky. Here's how and a script to help. +Ivanastar / Getty Images + +Setting up an account on a [Linux][1] system that allows you to log in or run commands remotely without a password isn’t all that hard, but there are some tedious details that you need to get right if you want it to work. In this post, we’re going to run through the process and then show a script that can help manage the details. + +Once set up, passwordless access is especially useful if you want to run ssh commands within a script, especially one that you might want to schedule to run automatically. + +It’s important to note that you do not have to be using the same user account on both systems. In fact, you can use your public key for a number of accounts on a system or for different accounts on multiple systems. + +[][2] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][2] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +Here’s how to set this up. + +### Which system to start on? + +First, you need to start on the system from which you want to issue commands. That's the system that you will use to create the ssh keys.  You also need to have access to the account on the remote system on which those commands will be run. + +To keep the roles clear, we’ll call that first system in our scenario the “boss” since it will issue commands to be run on the other system. + +Thus, the command prompt: + +[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][3] + +``` +boss$ +``` + +If you do not already have a public/private key pair set up for your account on the boss system, create one using a command like that shown below. Note that you can choose between the various encryption algorithms. (Either RSA or DSA is generally used.) Note that to access the system without typing a password, you will need to enter no password for the two prompts shown in the dialog below. + +If you already have a public/private key pair associated with this account, skip this step. + +``` +boss$ ssh-keygen -t rsa +Generating public/private rsa key pair. +Enter file in which to save the key (/home/myself/.ssh/id_rsa): +Enter passphrase (empty for no passphrase): <== just press the enter key +Enter same passphrase again: <== just press the enter key +Your identification has been saved in /home/myself/.ssh/id_rsa. +Your public key has been saved in /home/myself/.ssh/id_rsa.pub. +The key fingerprint is: +SHA256:1zz6pZcMjA1av8iyojqo6NVYgTl1+cc+N43kIwGKOUI myself@boss +The key's randomart image is: ++---[RSA 3072]----+ +| . .. | +| E+ .. . | +| .+ .o + o | +| ..+.. .o* . | +| ... So+*B o | +| + ...==B . | +| . o . ....++. | +|o o . . o..o+ | +|=..o.. ..o o. | ++----[SHA256]-----+ +``` + +The command shown above will create both a public and a private key. What one encrypts, the other will decrypt. So, the relationship between these keys is critical and the private key should **never** be shared. Instead, it should stay in your .ssh folder on the boss system. + +Notice that your public and private keys, on creation, will be saved in your .ssh folder. + +The next step is to copy the **public** key to the system you want to access from the boss system without using a password. You can use **scp** to do this though, at this point, you’ll still need to enter your password. In this example, that system is called “target”. + +``` +boss$ scp .ssh/id_rsa.pub myacct@target:/home/myaccount +myacct@target's password: +``` + +On the target system (the one on which the commands will be run), you will need to install your public key. If you don’t have a .ssh directory (e.g., if you’ve never used ssh on that system), running a command like this will set one up for you: + +``` +target$ ssh localhost date +target$ ls -la .ssh +total 12 +drwx------ 2 myacct myacct 4096 Jan 19 11:48 . +drwxr-xr-x 6 myacct myacct 4096 Jan 19 11:49 .. +-rw-r--r-- 1 myacct myacct 222 Jan 19 11:48 known_hosts +``` + +Still on the target system, you then need to add the public key you transferred from the “boss” system to your .ssh/authorized_keys file. The command below will add the key to the end of the file if it exists already or create the file and add the key if the file does not exist. + +``` +target$ cat id_rsa.pub >> .ssh/authorized_keys +``` + +Next, you need to make sure that the permissions on your authorized_keys file are set to 600. If not, run the **chmod 600 .ssh/authorized_keys** command. + +``` +target$ ls -l authorized_keys +-rw------- 1 myself myself 569 Jan 19 12:10 authorized_keys +``` + +Also check to be sure that permissions on your .ssh directory on the target system are set to 700. Fix the permissions with **chmod 700 .ssh** if needed. + +``` +target$ ls -ld .ssh +drwx------ 2 myacct myacct 4096 Jan 14 15:54 .ssh +``` + +At this point, you should be able to run a command remotely from your boss system to your target system without entering a password. This should work unless the target user account on the target system has an old public key for the same user and host as the one you’re trying to connect from. If so, you should be able to remove the earlier (and conflicting) entry. + +### Using a script + +Using a script can make some work a lot easier. In the example script below, however, the one annoying problem that you’ll run into is that you’ll have to enter the target user’s password numerous times before the password-free access is configured. One option would be to break the script into two parts – the commands that need to be run on the boss system and the commands that need to be run on the target system. + +Here’s the do-it-all version of the script: + +``` +#!/bin/bash +# NOTE: This script requires that you have the password for the remote acct +# in order to set up password-free access using your public key + +LOC=`hostname` # the local system from which you want to run commands from + # wo a password + +# get target system and account +echo -n "target system> " +read REM +echo -n "target user> " +read user + +# create a key pair if no public key exists +if [ ! -f ~/.ssh/id_rsa.pub ]; then + ssh-keygen -t rsa +fi + +# ensure a .ssh directory exists in the remote account +echo checking for .ssh directory on remote system +ssh $user@$REM "if [ ! -d /home/$user/.ssh ]; then mkdir /home/$user/.ssh; fi" + +# share the public key (using local hostname) +echo copying the public key +scp ~/.ssh/id_rsa.pub $user@$REM:/home/$user/$user-$LOC.pub + +# put the public key into the proper location +echo adding key to authorized_keys +ssh $user@$REM "cat /home/$user/$user-$LOC.pub >> /home/$user/.ssh/authorized_ke +ys" + +# set permissions on authorized_keys and .ssh (might be OK already) +echo setting permissions +ssh $user@$REM "chmod 600 ~/.ssh/authorized_keys" +ssh $user@$REM "chmod 700 ~/.ssh" + +# try it out -- should NOT ask for a password +echo testing -- if no password is requested, you are all set +ssh $user@$REM /bin/hostname +``` + +The script has been configured to tell you what it is doing each time you will have to enter a password. Interaction will look something like this: + +``` +$ ./rem_login_setup +target system> fruitfly +target user> lola +checking for .ssh directory on remote system +lola@fruitfly's password: +copying the public key +lola@fruitfly's password: +id_rsa.pub 100% 567 219.1KB/s 00:00 +adding key to authorized_keys +lola@fruitfly's password: +setting permissions +lola@fruitfly's password: +testing -- if no password is requested, you are all set +fruitfly +``` + +After the scenario shown above, you'd be able to log into lola's account on fruitfly like this: + +``` +$ ssh lola@fruitfly +[lola@fruitfly ~]$ +``` + +Once passwordless login is set up, you’ll both be able to log in from the boss system to the target system without a password and run arbitrary ssh commands. Running without a password in this way does not imply that your account is less secure. However, protecting your password on the boss system could become considerably more important depending on the nature of the target. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3514607/setting-up-passwordless-linux-logins-using-publicprivate-keys.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 0e6feae483d42cf5ebfafa17e23c87625915ed42 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 01:17:33 +0800 Subject: [PATCH 050/285] PRF --- ...arted with OpenSSL- Cryptography basics.md | 129 +++++++++--------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md index 3fa15783dd..be867e0f92 100644 --- a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md +++ b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -10,30 +10,28 @@ OpenSSL 入门:密码学基础知识 ====== -> 需要有关基础的密码学入门知识,尤其是有关 OpenSSL 的入门知识吗?继续阅读。 +> 需要入门密码学的基础知识,尤其是有关 OpenSSL 的入门知识吗?继续阅读。 ![A lock on the side of a building][1] -本文是两篇使用 [OpenSSL][2] 的密码学基础知识的第一篇,OpenSSL 是在 Linux 和其他系统上流行的生产级库和工具包。(要安装 OpenSSL 的最新版本,请参阅[这里][3]。)OpenSSL 实用程序可在命令行使用,而程序可以从 OpenSSL 库中调用函数。本文的示例程序使用 C 语言,即 OpenSSL 库的源语言。 +本文是使用 [OpenSSL][2] 的密码学基础知识的两篇文章中的第一篇,OpenSSL 是在 Linux 和其他系统上流行的生产级库和工具包。(要安装 OpenSSL 的最新版本,请参阅[这里][3]。)OpenSSL 实用程序可在命令行使用,程序也可以调用 OpenSSL 库中的函数。本文的示例程序使用的是 C 语言,即 OpenSSL 库的源语言。 -本系列的两篇文章共同介绍了加密哈希、数字签名、加密和解密以及数字证书。你可以从[我的网站][4]的 ZIP 文件中找到代码和命令行示例。 +本系列的两篇文章涵盖了加密哈希、数字签名、加密和解密以及数字证书。你可以从[我的网站][4]的 ZIP 文件中找到这些代码和命令行示例。 让我们首先回顾一下 OpenSSL 名称中的 SSL。 ### OpenSSL 简史 -[安全套接字层][5](SSL)是 Netscape 在 1995 年发布的一种加密协议。该协议层可以位于 HTTP 之上,从而为 HTTPS 提供了 S:安全。SSL 协议提供了各种安全服务,其中包括两项在 HTTPS 中至关重要的服务: +[安全套接字层][5]Secure Socket Layer(SSL)是 Netscape 在 1995 年发布的一种加密协议。该协议层可以位于 HTTP 之上,从而为 HTTPS 提供了 S:安全secure。SSL 协议提供了各种安全服务,其中包括两项在 HTTPS 中至关重要的服务: -* 对等身份验证Peer authentication(也称为相互挑战):连接的每一边都对另一边的身份进行身份验证。如果 Alice 和 Bob 要通过 SSL 交换消息,则每个人首先验证彼此的身份。 -* 机密性Confidentiality:发送者在通过通道发送消息之前先对其进行加密。接收者然后解密每个接收到的消息。此过程可保护网络对话。即使窃听者 Eve 截获了从 Alice 到 Bob 的加密消息(*中间人*攻击),Eve 仍发现他在计算上无法解密此消息。 +* 对等身份验证Peer authentication(也称为相互质询):连接的每一边都对另一边的身份进行身份验证。如果 Alice 和 Bob 要通过 SSL 交换消息,则每个人首先验证彼此的身份。 +* 机密性Confidentiality:发送者在通过通道发送消息之前先对其进行加密。然后,接收者解密每个接收到的消息。此过程可保护网络对话。即使窃听者 Eve 截获了从 Alice 到 Bob 的加密消息(即*中间人*攻击),Eve 会发现他在计算上无法解密此消息。    -反过来,这两个关键 SSL 服务与其他获得较少关注的服务捆绑在一起。例如,SSL 支持消息完整性,从而确保接收到的消息与发送的消息相同。此功能是通过散列函数实现的,散列函数也随 OpenSSL 工具箱一起提供。 - -SSL 已版本化(例如 SSLv2 和 SSLv3),并且在 1999 年,传输层安全性Transport Layer Security(TLS)成为基于 SSLv3 的类似协议。TLSv1 和 SSLv3 相似,但不足以相互配合。 但是,通常将 SSL/TLS 称为同一协议。例如,即使正在使用的是 TLS(而非 SSL),OpenSSL 函数也经常在名称中包含 SSL。此外,调用 OpenSSL 命令行实用程序以术语 `openssl` 开始。 - -OpenSSL 在其 man 页面之外的文档是零散的,鉴于 OpenSSL 工具包有多大,这些页面变得难以查找使用。命令行和代码示例是将主要主题集中起来的一种方法。让我们从一个熟悉的示例开始(使用 HTTPS 访问网站),然后使用该示例来挑选我们感兴趣的加密部分。 +反过来,这两个关键 SSL 服务与其他不太受关注的服务相关联。例如,SSL 支持消息完整性,从而确保接收到的消息与发送的消息相同。此功能是通过哈希函数实现的,哈希函数也随 OpenSSL 工具箱一起提供。 +SSL 有多个版本(例如 SSLv2 和 SSLv3),并且在 1999 年,传输层安全性Transport Layer Security(TLS)作为基于 SSLv3 的类似协议而出现。TLSv1 和 SSLv3 相似,但不足以相互配合工作。不过,通常将 SSL/TLS 称为同一协议。例如,即使正在使用的是 TLS(而非 SSL),OpenSSL 函数也经常在名称中包含 SSL。此外,调用 OpenSSL 命令行实用程序以 `openssl` 开始的。 +除了 man 页面之外,OpenSSL 的文档是零零散散的,鉴于 OpenSSL 工具包很大,这些页面很难以查找使用。命令行和代码示例可以将主要主题集中起来。让我们从一个熟悉的示例开始(使用 HTTPS 访问网站),然后使用该示例来选出我们感兴趣的加密部分进行讲述。 ### 一个 HTTPS 客户端 @@ -80,23 +78,23 @@ void secure_connect(const char* hostname) { SSL* ssl = NULL; - /* link bio channel, SSL session, and server endpoint */ + /* 链路 bio 通道,SSL 会话和服务器端点 */ sprintf(name, "%s:%s", hostname, "https"); - BIO_get_ssl(bio, &ssl); /* session */ - SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* robustness */ - BIO_set_conn_hostname(bio, name); /* prepare to connect */ + BIO_get_ssl(bio, &ssl); /* 会话 */ + SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* 鲁棒性 */ + BIO_set_conn_hostname(bio, name); /* 准备连接 */ - /* try to connect */ + /* 尝试连接 */ if (BIO_do_connect(bio) <= 0) { cleanup(ctx, bio); report_and_exit("BIO_do_connect..."); } - /* verify truststore, check cert */ + /* 验证信任库,检查证书 */ if (!SSL_CTX_load_verify_locations(ctx, - "/etc/ssl/certs/ca-certificates.crt", /* truststore */ - "/etc/ssl/certs/")) /* more truststore */ + "/etc/ssl/certs/ca-certificates.crt", /* 信任库 */ + "/etc/ssl/certs/")) /* 其它信任库 */ report_and_exit("SSL_CTX_load_verify_locations..."); long verify_flag = SSL_get_verify_result(ssl); @@ -105,17 +103,17 @@ void secure_connect(const char* hostname) { "##### Certificate verification error (%i) but continuing...\n", (int) verify_flag); - /* now fetch the homepage as sample data */ + /* 获取主页作为示例数据 */ sprintf(request, "GET / HTTP/1.1\x0D\x0AHost: %s\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0A", hostname); BIO_puts(bio, request); - /* read HTTP response from server and print to stdout */ + /* 从服务器读取 HTTP 响应并打印到输出 */ while (1) { memset(response, '\0', sizeof(response)); int n = BIO_read(bio, response, BuffSize); - if (n <= 0) break; /* 0 is end-of-stream, < 0 is an error */ + if (n <= 0) break; /* 0 代表流结束,< 0 代表有错误 */ puts(response); } @@ -135,77 +133,78 @@ return 0; 可以从命令行编译和执行该程序(请注意 `-lssl` 和 `-lcrypto` 中的小写字母 `L`): - ``` gcc -o client client.c -lssl -lcrypto ``` -该程序尝试打开与网站 [www.google.com][13] 的安全连接。作为与 Google Web 服务器的 TLS 握手的一部分,`client` 程序会接收一个或多个数字证书,该程序会尝试对其进行验证(但在我的系统上失败了)。尽管如此,`client` 程序仍继续通过安全通道获取 Google 主页。该程序取决于前面提到的安全工件,尽管在代码中只突出了数字证书。其他工件仍在幕后,稍后将对其进行详细说明。 +该程序尝试打开与网站 [www.google.com][13] 的安全连接。作为与 Google Web 服务器的 TLS 握手的一部分,`client` 程序会收到一个或多个数字证书,该程序会尝试对其进行验证(但在我的系统上失败了)。尽管如此,`client` 程序仍继续通过安全通道获取 Google 主页。该程序取决于前面提到的安全工件,尽管在代码中只着重突出了数字证书。但其它工件仍在幕后发挥作用,稍后将对它们进行详细说明。 -通常,打开 HTTP(非安全)通道的 C 或 C++ 客户端程序将使用诸如*文件描述符*或*网络套接字*之类的结构,这些是两个进程(例如,客户端程序和 Google Web 服务器)之间连接的端点。另一方面,文件描述符是一个非负整数值,它在程序中标识该程序打开的任何文件类的结构。这样的程序还将使用一种结构来指定有关 Web 服务器地址的详细信息。 +通常,打开 HTTP(非安全)通道的 C 或 C++ 客户端程序将使用诸如*文件描述符*或*网络套接字*之类的结构,它们是两个进程(例如,这个 `client` 程序和 Google Web 服务器)之间连接的端点。另一方面,文件描述符是一个非负整数值,用于在程序中标识该程序打开的任何文件类的结构。这样的程序还将使用一种结构来指定有关 Web 服务器地址的详细信息。 -这些相对较低级别的结构都不会出现在客户端程序中,因为 OpenSSL 库会将套接字基础设施和地址规范等封装在高级的安全结构中。其结果是一个简单的 API。下面首先看一下 `client` 程序示例中的安全性详细信息。 +这些相对较低级别的结构不会出现在客户端程序中,因为 OpenSSL 库会将套接字基础设施和地址规范等封装在更高层面的安全结构中。其结果是一个简单的 API。下面首先看一下 `client` 程序示例中的安全性详细信息。 -* 该程序首先加载相关的 OpenSSL 库,而我的函数 `init_ssl` 则对 OpenSSL 进行了两次调用: +* 该程序首先加载相关的 OpenSSL 库,我的函数 `init_ssl` 中对 OpenSSL 进行了两次调用: ``` -SSL_library_init(); SSL_load_error_strings(); +SSL_load_error_strings(); +SSL_library_init(); ``` -* 下一个初始化步骤尝试获取安全*上下文*,这是建立和维护通往 Web 服务器的安全通道所需的信息框架。 在示例中使用了 TLS 1.2,如对 OpenSSL 库函数的调用所示: +* 下一个初始化步骤尝试获取安全*上下文*,这是建立和维护通往 Web 服务器的安全通道所需的信息框架。如对 OpenSSL 库函数的调用所示,在示例中使用了 TLS 1.2: ``` const SSL_METHOD* method = TLSv1_2_client_method(); /* TLS 1.2 */ ``` - 如果调用成功,则将 `method ` 指针被传递给库函数,该函数创建类型为 `SSL_CTX` 的上下文: - + 如果调用成功,则将 `method` 指针被传递给库函数,该函数创建类型为 `SSL_CTX` 的上下文: ``` SSL_CTX* ctx = SSL_CTX_new(method); ``` - `client` 程序检查每个关键库调用中的错误,然后如果其中一个调用失败,则程序终止。 -* 现在还有另外两个 OpenSSL 工件在起作用:SSL 类型的安全会话,从头到尾管理安全连接;以及类型为BIO(基本输入/输出)的安全流,用于与 Web 服务器进行通信。BIO 流是通过以下调用生成的: + `client` 程序会检查每个关键的库调用中的错误,如果其中一个调用失败,则程序终止。 +* 现在还有另外两个 OpenSSL 工件也在发挥作用:SSL 类型的安全会话,从头到尾管理安全连接;以及类型为 BIO(基本输入/输出Basic Input/Output)的安全流,用于与 Web 服务器进行通信。BIO 流是通过以下调用生成的: ``` BIO* bio = BIO_new_ssl_connect(ctx); ``` - 请注意,最重要的上下文是参数。`BIO` 类型是 C 语言中 `FILE` 类型的 OpenSSL 封装器。此封装器可保护 `client` 程序与 Google 的网络服务器之间的输入和输出流。 + + 请注意,这个最重要的上下文是其参数。`BIO` 类型是 C 语言中 `FILE` 类型的 OpenSSL 封装器。此封装器可保护 `client` 程序与 Google 的网络服务器之间的输入和输出流的安全。 * 有了 `SSL_CTX` 和 `BIO`,然后程序在 SSL 会话中将它们组合在一起。三个库调用可以完成工作: ``` -BIO_get_ssl(bio, &ssl); /* get a TLS session */ -SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* for robustness */ -BIO_set_conn_hostname(bio, name); /* prepare to connect to Google */ +BIO_get_ssl(bio, &ssl); /* 会话 */ +SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* 鲁棒性 */ +BIO_set_conn_hostname(bio, name); /* 准备连接 */ ``` + 安全连接本身是通过以下调用建立的: ``` BIO_do_connect(bio); ``` - 如果最后一次调用不成功,则 `client` 程序终止;否则,该连接已准备就绪,可以支持 `client` 程序与Google Web 服务器之间的机密对话。 + 如果最后一个调用不成功,则 `client` 程序终止;否则,该连接已准备就绪,可以支持 `client` 程序与 Google Web 服务器之间的机密对话。 -在与 Web 服务器握手期间,`client` 程序会接收一个或多个数字证书,以认证服务器的身份。 但是,`client` 程序不会发送自己的证书,这意味着身份验证是单向的。(通常将 Web 服务器配置为**不**需要客户端证书。)尽管对 Web 服务器证书的验证失败,但 `client` 程序仍通过到 Web 服务器的安全通道继续获取 Google 主页。 +在与 Web 服务器握手期间,`client` 程序会接收一个或多个数字证书,以认证服务器的身份。但是,`client` 程序不会发送自己的证书,这意味着这个身份验证是单向的。(Web 服务器通常配置为**不**需要客户端证书)尽管对 Web 服务器证书的验证失败,但 `client` 程序仍通过了连接到 Web 服务器的安全通道继续获取 Google 主页。 -为什么验证 Google 证书的尝试失败?典型的 OpenSSL 安装目录为 `/etc/ssl/certs`,其中包含 `ca-certificates.crt` 文件。该目录和文件包含着 OpenSSL 自带的数字证书,以此构成信任库。可以根据需要更新信任库,尤其是可以包括新信任的证书,并删除不再受信任的证书。 +为什么验证 Google 证书的尝试会失败?典型的 OpenSSL 安装目录为 `/etc/ssl/certs`,其中包含 `ca-certificates.crt` 文件。该目录和文件包含着 OpenSSL 自带的数字证书,以此构成信任库。可以根据需要更新信任库,尤其是可以包括新信任的证书,并删除不再受信任的证书。 -`client` 程序从 Google Web 服务器接收了三个证书,但是我的计算机上的 OpenSSL 信任库不包含完全匹配项。如目前所写,`client` 程序不会通过例如验证 Google 证书上的数字签名(一个用来证明该证书的签名)来解决此问题。如果该签名是受信任的,则包含该签名的证书也应受信任。尽管如此,`client` 程序仍继续进行获取页面,然后打印 Google 的主页。下一节将更详细地介绍。 +`client` 程序从 Google Web 服务器收到了三个证书,但是我的计算机上的 OpenSSL 信任库并不包含完全匹配的证书。如目前所写,`client` 程序不会通过例如验证 Google 证书上的数字签名(一个用来证明该证书的签名)来解决此问题。如果该签名是受信任的,则包含该签名的证书也应受信任。尽管如此,`client` 程序仍继续获取页面,然后打印出 Google 的主页。下一节将更详细地介绍这些。 ### 客户端程序中隐藏的安全性 -让我们从客户端示例中的可见安全工件(数字证书)开始,然后考虑其他安全工件如何与之相关。数字证书的主要布局标准是 X509,生产级证书由诸如 [Verisign][14] 的证书颁发机构(CA)颁发。 +让我们从客户端示例中可见的安全工件(数字证书)开始,然后考虑其他安全工件如何与之相关。数字证书的主要格式标准是 X509,生产级的证书由诸如 [Verisign][14] 的证书颁发机构Certificate Authority(CA)颁发。 -数字证书包含各种信息(例如,激活和有效日期以及所有者的域名),包括发行者的身份和*数字签名*(这是加密过的*加密哈希*值)。证书还具有未加密的哈希值,用作其标识*指纹*。 +数字证书中包含各种信息(例如,激活日期和失效日期以及所有者的域名),也包括发行者的身份和*数字签名*(这是加密过的*加密哈希*值)。证书还具有未加密的哈希值,用作其标识*指纹*。 -哈希值来自将任意数量的位映射到固定长度的摘要。这些位代表什么(会计报告、小说或数字电影)无关紧要。例如,消息摘要版本 5Message Digest version 5(MD5)哈希算法将任意长度的输入位映射到 128 位哈希值,而 SHA1(安全哈希算法版本 1Secure Hash Algorithm version 1)算法将输入位映射到 160 位值。不同的输入位会导致不同的(实际上是统计学上唯一的)哈希值。下一篇文章将进行更详细的介绍,并着重介绍什么使哈希函数具有加密功能。 +哈希值来自将任意数量的二进制位映射到固定长度的摘要。这些位代表什么(会计报告、小说或数字电影)无关紧要。例如,消息摘要版本 5Message Digest version 5(MD5)哈希算法将任意长度的输入位映射到 128 位哈希值,而 SHA1(安全哈希算法版本 1Secure Hash Algorithm version 1)算法将输入位映射到 160 位哈希值。不同的输入位会导致不同的(实际上在统计学上是唯一的)哈希值。下一篇文章将会进行更详细的介绍,并着重介绍什么使哈希函数具有加密功能。 -数字证书的类型有所不同(例如根证书、中间证书和最终实体证书),并形成了反映这些类型的层次结构。 顾名思义,*根*证书位于层次结构的顶部,其下的证书继承了根证书所具有的信任。OpenSSL 库和大多数现代编程语言都具有 X509 类型以及处理此类证书的函数。来自 Google 的证书具有 X509 格式,`client` 程序会检查该证书是否为 `X509_V_OK`。 +数字证书的类型有所不同(例如根证书、中间证书和最终实体证书),并形成了反映这些类型的层次结构。顾名思义,*根*证书位于层次结构的顶部,其下的证书继承了根证书所具有的信任。OpenSSL 库和大多数现代编程语言都具有 X509 数据类型以及处理此类证书的函数。来自 Google 的证书具有 X509 格式,`client` 程序会检查该证书是否为 `X509_V_OK`。 -X509 证书基于公共密钥基础结构public-key infrastructure(PKI),其中包括的算法(RSA 是占主导地位的算法)用于生成*密钥对*:公共密钥及其配对的私有密钥。公钥是一种身份:[Amazon][15] 的公钥对其进行标识,而我的公钥对我进行标识。私钥应由其所有者保密。 +X509 证书基于公共密钥基础结构public-key infrastructure(PKI),其中包括的算法(RSA 是占主导地位的算法)用于生成*密钥对*:公共密钥及其配对的私有密钥。公钥是一种身份:[Amazon][15] 的公钥对其进行标识,而我的公钥对我进行标识。私钥应由其所有者负责保密。 -成对出现的密钥具有标准用途。可以使用公钥对消息进行加密,然后可以使用同一个密钥对中的私钥对消息进行解密。私钥也可以用于对文档或其他电子产品(例如程序或电子邮件)进行签名,然后可以使用该对密钥中的公钥来验证签名。以下两个示例填充了一些细节。 +成对出现的密钥具有标准用途。可以使用公钥对消息进行加密,然后可以使用同一个密钥对中的私钥对消息进行解密。私钥也可以用于对文档或其他电子工件(例如程序或电子邮件)进行签名,然后可以使用该对密钥中的公钥来验证签名。以下两个示例补充了一些细节。 -在第一个示例中,Alice 将她的公钥分发给世界,包括 Bob。然后,Bob 用 Alice 的公钥加密邮件,然后将加密的邮件发送给 Alice。用 Alice 的公钥加密的邮件将用她的私钥解密(假设是她自己的私钥),如下所示: +在第一个示例中,Alice 将她的公钥分发给全世界,包括 Bob。然后,Bob 用 Alice 的公钥加密邮件,然后将加密的邮件发送给 Alice。用 Alice 的公钥加密的邮件将可以用她的私钥解密(假设是她自己的私钥),如下所示: ``` +------------------+ encrypted msg +-------------------+ @@ -213,9 +212,9 @@ Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's +------------------+ +-------------------+ ``` -原则上可以在没有 Alice 的私钥的情况下解密消息,但在实际情况下,如果使用像 RSA 这样的加密密钥对系统,则无法实现。 +原则上可以在没有 Alice 的私钥的情况下解密消息,但在实际情况中,如果使用像 RSA 这样的加密密钥对系统,则做不到。 -现在,对于第二个示例,请考虑对文档签名以证明其真实性。签名算法使用密钥对中的私钥来处理要签名的文档的加密哈希: +现在,第二个示例,请对文档签名以证明其真实性。签名算法使用密钥对中的私钥来处理要签名的文档的加密哈希: ``` +-------------------+ @@ -231,13 +230,13 @@ Alice's digital signature of the document--->|Alice's public key|--->verified or +------------------+ ``` -假若没有 Alice 的私钥,就无法伪造 Alice 的签名:因此,Alice 有必要保密她的私钥。 +假若没有 Alice 的私钥,就无法轻松伪造 Alice 的签名:因此,Alice 有必要保密她的私钥。 -在 `client` 程序中,除了数字证书以外,这些安全性都没有明确规定。下一篇文章使用使用 OpenSSL 实用程序和库函数的示例填充详细信息。 +在 `client` 程序中,除了数字证书以外,这些安全性都没有明确展示。下一篇文章使用使用 OpenSSL 实用程序和库函数的示例填充更多详细的信息。 ### 命令行的 OpenSSL -同时,让我们看一下 OpenSSL 命令行实用程序:特别是在 TLS 握手期间检查来自 Web 服务器的证书的实用程序。调用 OpenSSL 实用程序从`openssl` 命令开始,然后添加参数和标志的组合以指定所需的操作。 +同时,让我们看一下 OpenSSL 命令行实用程序:特别是在 TLS 握手期间检查来自 Web 服务器的证书的实用程序。调用 OpenSSL 实用程序可以使用 `openssl` 命令,然后添加参数和标志的组合以指定所需的操作。 看看以下命令: @@ -245,7 +244,7 @@ Alice's digital signature of the document--->|Alice's public key|--->verified or openssl list-cipher-algorithms ``` -该输出是组成加密算法套件cipher suite的相关算法的列表。下面是列表的开头,注释以澄清首字母缩写词: +该输出是组成加密算法套件cipher suite的相关算法的列表。下面是列表的开头,加了澄清首字母缩写词的注释: ``` AES-128-CBC ## Advanced Encryption Standard, Cipher Block Chaining @@ -254,13 +253,13 @@ AES-128-CBC-HMAC-SHA256 ## ditto, but SHA256 rather than SHA1 ... ``` -使用参数 `s_client` 的下一条命令将打开到 [www.google.com][13] 的安全连接,并在屏幕上显示有关此连接的所有信息: +下一条命令使用参数 `s_client` 将打开到 [www.google.com][13] 的安全连接,并在屏幕上显示有关此连接的所有信息: ``` openssl s_client -connect www.google.com:443 -showcerts ``` -端口号 443 是 Web 服务器用于接收 HTTPS 而不是 HTTP 连接的标准端口号。(对于 HTTP,标准端口为 80)网络地址 [www.google.com:443 也出现在 `client` 程序的代码中。如果尝试的连接成功,则将显示来自 Google 的三个数字证书以及有关安全会话、正在使用的加密算法套件以及相关项目的信息。例如,这是从头开始的一部分输出,它声明*证书链*即将到来。证书的编码为 base64: +端口号 443 是 Web 服务器用于接收 HTTPS(而不是 HTTP 连接)的标准端口号。(对于 HTTP,标准端口为 80)Web 地址 www.google.com:443 也出现在 `client` 程序的代码中。如果尝试连接成功,则将显示来自 Google 的三个数字证书以及有关安全会话、正在使用的加密算法套件以及相关项目的信息。例如,这是开头的部分输出,它声明*证书链*即将到来。证书的编码为 base64: ``` @@ -285,21 +284,21 @@ SSL-Session: ... ``` -`client` 程序中使用了协议 TLS 1.2,`Session-ID` 唯一地标识了 `openssl` 实用程序和 Google Web 服务器之间的连接。 `Cipher` 条目可以按以下方式进行解析: +`client` 程序中使用了协议 TLS 1.2,`Session-ID` 唯一地标识了 `openssl` 实用程序和 Google Web 服务器之间的连接。`Cipher` 条目可以按以下方式进行解析: -* `ECDHE`(Elliptic Curve Diffie Hellman Ephemeral椭圆曲线 Diffie-Hellman(临时))是一种用于管理 TLS 握手的有效而高效的算法。尤其是,ECDHE 通过确保连接双方(例如,`client` 程序和 Google Web 服务器)使用相同的加密/解密密钥(称为*会话密钥*)来解决“密钥分发问题”。后续文章会深入探讨该细节。 -* `RSA`(Rivest Shamir Adleman)是主要的公共密钥密码系统,并以 1970 年代后期首次描述该系统的三位学者的名字命名。这个正在使用的密钥对是使用 RSA 算法生成的。 -* `AES128`(高级加密标准Advanced Encryption Standard)是一种块式加密算法block cipher,用于加密和解密位块blocks of bits。(另一种算法是流式加密算法stream cipher,它一次加密和解密一个位。)该加密算法是对称加密算法,因为使用同一个密钥进行加密和解密,这首先引起了密钥分发问题。AES 支持 128(此处使用)、192 和 256 位的密钥大小:密钥越大,保护越好。 +* `ECDHE`(椭圆曲线 Diffie-Hellman(临时)Elliptic Curve Diffie Hellman Ephemeral)是一种用于管理 TLS 握手的高效的有效算法。尤其是,ECDHE 通过确保连接双方(例如,`client` 程序和 Google Web 服务器)使用相同的加密/解密密钥(称为*会话密钥*)来解决“密钥分发问题”。后续文章会深入探讨该细节。 +* `RSA`(Rivest Shamir Adleman)是主要的公共密钥密码系统,并以 1970 年代末首次描述了该系统的三位学者的名字命名。这个正在使用的密钥对是使用 RSA 算法生成的。 +* `AES128`(高级加密标准Advanced Encryption Standard)是一种块式加密算法block cipher,用于加密和解密位块blocks of bits。(另一种算法是流式加密算法stream cipher,它一次加密和解密一个位。)这个加密算法是对称加密算法,因为使用同一个密钥进行加密和解密,这首先引起了密钥分发问题。AES 支持 128(此处使用)、192 和 256 位的密钥大小:密钥越大,安全性越好。 - 通常,像 AES 这样的对称加密系统的密钥大小要小于像 RSA 这样的非对称(基于密钥对)系统的密钥大小。例如,1024 位 RSA 密钥相对较小,而 256 位密钥当前是 AES 最大的密钥。 -* `GCM`(伽罗瓦计数器模式Galois Counter Mode)处理在安全对话期间重复应用加密算法(在这种情况下为 AES128)。AES128 块的大小仅为 128 位,安全对话很可能包含从一侧到另一侧的多个 AES128 块。GCM 非常有效,通常与 AES128 搭配使用。 -* `SHA256` (256 位安全哈希算法Secure Hash Algorithm 256 bits)是正在使用的加密哈希算法。生成的哈希值的大小为 256 位,尽管使用 SHA 甚至可以更大。 + 通常,像 AES 这样的对称加密系统的密钥大小要小于像 RSA 这样的非对称(基于密钥对)系统的密钥大小。例如,1024 位 RSA 密钥相对较小,而 256 位密钥则当前是 AES 最大的密钥。 +* `GCM`(伽罗瓦计数器模式Galois Counter Mode)处理在安全对话期间重复应用的加密算法(在这种情况下为 AES128)。AES128 块的大小仅为 128 位,安全对话很可能包含从一侧到另一侧的多个 AES128 块。GCM 非常有效,通常与 AES128 搭配使用。 +* `SHA256`(256 位安全哈希算法Secure Hash Algorithm 256 bits)是我们正在使用的加密哈希算法。生成的哈希值的大小为 256 位,尽管使用 SHA 甚至可以更大。 -加密算法套件正在不断发展中。例如,不久前,Google 使用 RC4 流加密算法(是 RSA 的 Ron Rivest 后来开发的 Ron's Cipher 版本 4)。 RC4 现在有已知的漏洞,这至少部分导致了 Google 转换为 AES128。 +加密算法套件正在不断发展中。例如,不久前,Google 使用 RC4 流加密算法(RSA 的 Ron Rivest 后来开发的 Ron's Cipher 版本 4)。 RC4 现在有已知的漏洞,这大概部分导致了 Google 转换为 AES128。 ### 总结 -通过安全的 C Web 客户端和各种命令行示例对 OpenSSL 的首次了解,使一些需要进一步阐明的主题脱颖而出。[下一篇文章会详细介绍][17],从加密散列开始,到结束时对数字证书如何应对密钥分发挑战的更全面讨论。 +我们通过安全的 C Web 客户端和各种命令行示例对 OpenSSL 做了首次了解,使一些需要进一步阐明的主题脱颖而出。[下一篇文章会详细介绍][17],从加密散列开始,到对数字证书如何应对密钥分发挑战为结束的更全面讨论。 -------------------------------------------------------------------------------- From 626245368750f013d2dc19ccefbfb58958009adb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 01:20:57 +0800 Subject: [PATCH 051/285] PRF --- ...90619 Getting started with OpenSSL- Cryptography basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md index be867e0f92..ac0e0222f6 100644 --- a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md +++ b/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with OpenSSL: Cryptography basics) @@ -307,7 +307,7 @@ via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 作者:[Marty Kalin][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 7f54abe36d01ae50815025e4d5dff3e2b203b7b8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 Jan 2020 09:17:22 +0800 Subject: [PATCH 052/285] translated --- ...nt for Linux to tweet from the terminal.md | 70 ------------------- ...nt for Linux to tweet from the terminal.md | 64 +++++++++++++++++ 2 files changed, 64 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md create mode 100644 translated/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md diff --git a/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md b/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md deleted file mode 100644 index 1e9eda911f..0000000000 --- a/sources/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use this Twitter client for Linux to tweet from the terminal) -[#]: via: (https://opensource.com/article/20/1/tweet-terminal-rainbow-stream) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use this Twitter client for Linux to tweet from the terminal -====== -Keep up with your Twitter feed without leaving the terminal by using -Rainbow Stream in the tenth in our series on 20 ways to be more -productive with open source in 2020. -![Chat bubbles][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Keep up with Twitter with Rainbow Stream - -I love social networking and microblogging. It's quick, it's easy, and I can share my thoughts with the world really quickly. The drawback is, of course, that almost all the desktop options for non-Windows users are wrappers around the website. [Twitter][2] has a lot of clients, but what I really want is something lightweight, easy to use, and most importantly, attractive. - -![Rainbow Stream for Twitter][3] - -[Rainbow Stream][4] is one of the prettier Twitter clients. It is easy to use and installs quickly with a simple **pip3 install rainbowstream**. On the first run, it will open a browser window and have you authorize with Twitter. Once that is done, you land at a prompt, and your Twitter timeline will start scrolling by. - -![Rainbow Stream first run][5] - -The most important commands to know are **p** to pause the stream, **r** to resume the stream, **h** to get help, and **t** to post a new tweet. For example, **h tweets** will give you all the options for sending and replying to tweets. Another useful help screen is **h messages**, which gives the commands for working with direct messages, which is something my wife and I use a lot. There are a lot of other commands, and I refer back to help a lot. - -As your timeline scrolls by, you can see that it has full UTF-8 support and, with the right font, will show indicators for how many times something was retweeted and liked, as well as icons and emojis. - -![Kill this love][6] - -One of the _best_ things about Rainbow Stream is that you don't have to give up on photos and images. This feature is off by default, but you can try it out with the **config** command. - - -``` -`config IMAGE_ON_TERM = true` -``` - -This command renders any images as ASCII art. If you have a photo-heavy stream, this may be a bit much, but I like it. It has a very retro-1990s BBS feel, and I did love the BBS scene in the 1990s. - -You can also use Rainbow Stream to manage lists, mute people, block people, follow, unfollow, and everything else that is available with the Twitter API. There is also theme support, so you can customize the stream to your favorite color scheme. - -When I'm working and don't want to have yet-another-tab open on my browser, Rainbow Stream lets me keep up in a terminal off to the side. - -Without open source, Twitter wouldn't exist. Every Tweet you send and receive touches open source... - -Sergey Bronnikov shares why the OpenVZ team created Twisource, an open source social media tool. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream - -作者:[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/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) -[2]: https://twitter.com/home -[3]: https://opensource.com/sites/default/files/uploads/productivity_10-1.png (Rainbow Stream for Twitter) -[4]: https://rainbowstream.readthedocs.io/en/latest/ -[5]: https://opensource.com/sites/default/files/uploads/productivity_10-2.png (Rainbow Stream first run) -[6]: https://opensource.com/sites/default/files/uploads/day10-image3_1.png (Kill this love) diff --git a/translated/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md b/translated/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md new file mode 100644 index 0000000000..d67793031e --- /dev/null +++ b/translated/tech/20200120 Use this Twitter client for Linux to tweet from the terminal.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this Twitter client for Linux to tweet from the terminal) +[#]: via: (https://opensource.com/article/20/1/tweet-terminal-rainbow-stream) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用这个 Twitter 客户端在 Linux 终端中发推特 +====== +在我们的 20 个使用开源提升生产力的系列的第十篇文章中使用 Rainbow Stream 跟上你的 Twitter 流而无需离开终端。 +![Chat bubbles][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 通过 Rainbow Stream 跟上Twitter + +我喜欢社交网络和微博。它快速、简单,还有我可以与世界分享我的想法。当然,缺点是几乎所有非 Windows 的桌面客户端都是网站的封装。[Twitter][2] 有很多客户端,但我真正想要的是轻量、易于使用,最重要的是吸引人的客户端。 + +![Rainbow Stream for Twitter][3] + +[Rainbow Stream][4] 是好看的 Twitter 客户端之一。它简单易用,并且可以通过 **pip3 install rainbowstream** 快速安装。第一次运行时,它将打开浏览器窗口,并让你通过 Twitter 授权。完成后,你将回到命令行,你的 Twitter 时间线将开始滚动。 + +![Rainbow Stream first run][5] + +要了解的最重要的命令是 **p** 暂停推流、**r** 继续推流、**h** 得帮助,以及 **t** 发布新的推文。例如,**h tweets** 将提供发送和回复推文的所有选项。另一个有用的帮助页面是 **h messages**,它提供了处理直接消息的命令,这是我妻子和我经常使用的东西。还有很多其他命令,我会回头获得很多帮助。 + +随着时间线的滚动,你可以看到它有完整的 UTF-8 支持,并以正确的字体显示推文被转推以及喜欢的次数,图标和 emoji 也能正确显示。 + +![Kill this love][6] + +关于 Rainbow Stream 的_最好_功能之一就是你不必放弃照片和图像。默认情况下,此功能是关闭的,但是你可以使用 **config** 命令尝试它。 + + +``` +`config IMAGE_ON_TERM = true` +``` + +此命令将任何图像渲染为 ASCII 艺术。如果你有大量照片流,它可能会有点多,但是我喜欢。它有非常复古的 1990 年代 BBS 感觉,我也确实喜欢 1990 年代的 BBS 场景。 + +你还可以使用 Rainbow Stream 管理列表、屏蔽某人、拉黑某人、关注、取消关注以及 Twitter API 的所有其他功能。它还支持主题,因此你可以用喜欢的颜色方案自定义流。 + +当我正在工作并且不想在浏览器上打开另一个选项卡时,Rainbow Stream 让我可以留在终端中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream + +作者:[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/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://twitter.com/home +[3]: https://opensource.com/sites/default/files/uploads/productivity_10-1.png (Rainbow Stream for Twitter) +[4]: https://rainbowstream.readthedocs.io/en/latest/ +[5]: https://opensource.com/sites/default/files/uploads/productivity_10-2.png (Rainbow Stream first run) +[6]: https://opensource.com/sites/default/files/uploads/day10-image3_1.png (Kill this love) From e4fb4a2d9cc5f1022cf908f93fb149099bf6f0de Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 Jan 2020 09:21:41 +0800 Subject: [PATCH 053/285] translating --- .../tech/20200119 One open source chat tool to rule them all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200119 One open source chat tool to rule them all.md b/sources/tech/20200119 One open source chat tool to rule them all.md index 963b7246d0..25f6728c84 100644 --- a/sources/tech/20200119 One open source chat tool to rule them all.md +++ b/sources/tech/20200119 One open source chat tool to rule them all.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 483b75a8a48eb39fed7acde25cf032217adbf6f1 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Thu, 23 Jan 2020 10:38:12 +0800 Subject: [PATCH 054/285] Update 20200117 Locking and unlocking accounts on Linux systems.md --- ...0200117 Locking and unlocking accounts on Linux systems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md b/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md index c1cb3a7be1..469874c4ed 100644 --- a/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md +++ b/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -103,7 +103,7 @@ via: https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[FSSlc](https://github.com/FSSlc) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e572119af8857c49f2d84ea6c35b3025d9b8e40a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 14:25:02 +0800 Subject: [PATCH 055/285] PUB @wxy https://linux.cn/article-11810-1.html --- ...arted with OpenSSL- Cryptography basics.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) rename {translated/tech => published}/20190619 Getting started with OpenSSL- Cryptography basics.md (88%) diff --git a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/published/20190619 Getting started with OpenSSL- Cryptography basics.md similarity index 88% rename from translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md rename to published/20190619 Getting started with OpenSSL- Cryptography basics.md index ac0e0222f6..d7cd09934e 100644 --- a/translated/tech/20190619 Getting started with OpenSSL- Cryptography basics.md +++ b/published/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11810-1.html) [#]: subject: (Getting started with OpenSSL: Cryptography basics) [#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-1) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen) @@ -10,9 +10,9 @@ OpenSSL 入门:密码学基础知识 ====== -> 需要入门密码学的基础知识,尤其是有关 OpenSSL 的入门知识吗?继续阅读。 +> 想要入门密码学的基础知识,尤其是有关 OpenSSL 的入门知识吗?继续阅读。 -![A lock on the side of a building][1] +![](https://img.linux.net.cn/data/attachment/album/202001/23/142249fpnhyqz9y2cz1exe.jpg) 本文是使用 [OpenSSL][2] 的密码学基础知识的两篇文章中的第一篇,OpenSSL 是在 Linux 和其他系统上流行的生产级库和工具包。(要安装 OpenSSL 的最新版本,请参阅[这里][3]。)OpenSSL 实用程序可在命令行使用,程序也可以调用 OpenSSL 库中的函数。本文的示例程序使用的是 C 语言,即 OpenSSL 库的源语言。 @@ -25,11 +25,11 @@ OpenSSL 入门:密码学基础知识 [安全套接字层][5]Secure Socket Layer(SSL)是 Netscape 在 1995 年发布的一种加密协议。该协议层可以位于 HTTP 之上,从而为 HTTPS 提供了 S:安全secure。SSL 协议提供了各种安全服务,其中包括两项在 HTTPS 中至关重要的服务: * 对等身份验证Peer authentication(也称为相互质询):连接的每一边都对另一边的身份进行身份验证。如果 Alice 和 Bob 要通过 SSL 交换消息,则每个人首先验证彼此的身份。 -* 机密性Confidentiality:发送者在通过通道发送消息之前先对其进行加密。然后,接收者解密每个接收到的消息。此过程可保护网络对话。即使窃听者 Eve 截获了从 Alice 到 Bob 的加密消息(即*中间人*攻击),Eve 会发现他在计算上无法解密此消息。 -   +* 机密性Confidentiality:发送者在通过通道发送消息之前先对其进行加密。然后,接收者解密每个接收到的消息。此过程可保护网络对话。即使窃听者 Eve 截获了从 Alice 到 Bob 的加密消息(即*中间人*攻击),Eve 会发现他无法在计算上解密此消息。 + 反过来,这两个关键 SSL 服务与其他不太受关注的服务相关联。例如,SSL 支持消息完整性,从而确保接收到的消息与发送的消息相同。此功能是通过哈希函数实现的,哈希函数也随 OpenSSL 工具箱一起提供。 -SSL 有多个版本(例如 SSLv2 和 SSLv3),并且在 1999 年,传输层安全性Transport Layer Security(TLS)作为基于 SSLv3 的类似协议而出现。TLSv1 和 SSLv3 相似,但不足以相互配合工作。不过,通常将 SSL/TLS 称为同一协议。例如,即使正在使用的是 TLS(而非 SSL),OpenSSL 函数也经常在名称中包含 SSL。此外,调用 OpenSSL 命令行实用程序以 `openssl` 开始的。 +SSL 有多个版本(例如 SSLv2 和 SSLv3),并且在 1999 年出现了一个基于 SSLv3 的类似协议传输层安全性Transport Layer Security(TLS)。TLSv1 和 SSLv3 相似,但不足以相互配合工作。不过,通常将 SSL/TLS 称为同一协议。例如,即使正在使用的是 TLS(而非 SSL),OpenSSL 函数也经常在名称中包含 SSL。此外,调用 OpenSSL 命令行实用程序以 `openssl` 开始。 除了 man 页面之外,OpenSSL 的文档是零零散散的,鉴于 OpenSSL 工具包很大,这些页面很难以查找使用。命令行和代码示例可以将主要主题集中起来。让我们从一个熟悉的示例开始(使用 HTTPS 访问网站),然后使用该示例来选出我们感兴趣的加密部分进行讲述。 @@ -137,9 +137,9 @@ return 0; gcc -o client client.c -lssl -lcrypto ``` -该程序尝试打开与网站 [www.google.com][13] 的安全连接。作为与 Google Web 服务器的 TLS 握手的一部分,`client` 程序会收到一个或多个数字证书,该程序会尝试对其进行验证(但在我的系统上失败了)。尽管如此,`client` 程序仍继续通过安全通道获取 Google 主页。该程序取决于前面提到的安全工件,尽管在代码中只着重突出了数字证书。但其它工件仍在幕后发挥作用,稍后将对它们进行详细说明。 +该程序尝试打开与网站 [www.google.com][13] 的安全连接。在与 Google Web 服务器的 TLS 握手过程中,`client` 程序会收到一个或多个数字证书,该程序会尝试对其进行验证(但在我的系统上失败了)。尽管如此,`client` 程序仍继续通过安全通道获取 Google 主页。该程序取决于前面提到的安全工件,尽管在上述代码中只着重突出了数字证书。但其它工件仍在幕后发挥作用,稍后将对它们进行详细说明。 -通常,打开 HTTP(非安全)通道的 C 或 C++ 客户端程序将使用诸如*文件描述符*或*网络套接字*之类的结构,它们是两个进程(例如,这个 `client` 程序和 Google Web 服务器)之间连接的端点。另一方面,文件描述符是一个非负整数值,用于在程序中标识该程序打开的任何文件类的结构。这样的程序还将使用一种结构来指定有关 Web 服务器地址的详细信息。 +通常,打开 HTTP(非安全)通道的 C 或 C++ 的客户端程序将使用诸如*文件描述符*或*网络套接字*之类的结构,它们是两个进程(例如,这个 `client` 程序和 Google Web 服务器)之间连接的端点。另一方面,文件描述符是一个非负整数值,用于在程序中标识该程序打开的任何文件类的结构。这样的程序还将使用一种结构来指定有关 Web 服务器地址的详细信息。 这些相对较低级别的结构不会出现在客户端程序中,因为 OpenSSL 库会将套接字基础设施和地址规范等封装在更高层面的安全结构中。其结果是一个简单的 API。下面首先看一下 `client` 程序示例中的安全性详细信息。 @@ -156,11 +156,12 @@ const SSL_METHOD* method = TLSv1_2_client_method(); /* TLS 1.2 */ ``` 如果调用成功,则将 `method` 指针被传递给库函数,该函数创建类型为 `SSL_CTX` 的上下文: + ``` SSL_CTX* ctx = SSL_CTX_new(method); ``` - `client` 程序会检查每个关键的库调用中的错误,如果其中一个调用失败,则程序终止。 + `client` 程序会检查每个关键的库调用的错误,如果其中一个调用失败,则程序终止。 * 现在还有另外两个 OpenSSL 工件也在发挥作用:SSL 类型的安全会话,从头到尾管理安全连接;以及类型为 BIO(基本输入/输出Basic Input/Output)的安全流,用于与 Web 服务器进行通信。BIO 流是通过以下调用生成的: ``` @@ -186,7 +187,7 @@ BIO_do_connect(bio); 在与 Web 服务器握手期间,`client` 程序会接收一个或多个数字证书,以认证服务器的身份。但是,`client` 程序不会发送自己的证书,这意味着这个身份验证是单向的。(Web 服务器通常配置为**不**需要客户端证书)尽管对 Web 服务器证书的验证失败,但 `client` 程序仍通过了连接到 Web 服务器的安全通道继续获取 Google 主页。 -为什么验证 Google 证书的尝试会失败?典型的 OpenSSL 安装目录为 `/etc/ssl/certs`,其中包含 `ca-certificates.crt` 文件。该目录和文件包含着 OpenSSL 自带的数字证书,以此构成信任库。可以根据需要更新信任库,尤其是可以包括新信任的证书,并删除不再受信任的证书。 +为什么验证 Google 证书的尝试会失败?典型的 OpenSSL 安装目录为 `/etc/ssl/certs`,其中包含 `ca-certificates.crt` 文件。该目录和文件包含着 OpenSSL 自带的数字证书,以此构成信任库truststore。可以根据需要更新信任库,尤其是可以包括新信任的证书,并删除不再受信任的证书。 `client` 程序从 Google Web 服务器收到了三个证书,但是我的计算机上的 OpenSSL 信任库并不包含完全匹配的证书。如目前所写,`client` 程序不会通过例如验证 Google 证书上的数字签名(一个用来证明该证书的签名)来解决此问题。如果该签名是受信任的,则包含该签名的证书也应受信任。尽管如此,`client` 程序仍继续获取页面,然后打印出 Google 的主页。下一节将更详细地介绍这些。 @@ -198,7 +199,7 @@ BIO_do_connect(bio); 哈希值来自将任意数量的二进制位映射到固定长度的摘要。这些位代表什么(会计报告、小说或数字电影)无关紧要。例如,消息摘要版本 5Message Digest version 5(MD5)哈希算法将任意长度的输入位映射到 128 位哈希值,而 SHA1(安全哈希算法版本 1Secure Hash Algorithm version 1)算法将输入位映射到 160 位哈希值。不同的输入位会导致不同的(实际上在统计学上是唯一的)哈希值。下一篇文章将会进行更详细的介绍,并着重介绍什么使哈希函数具有加密功能。 -数字证书的类型有所不同(例如根证书、中间证书和最终实体证书),并形成了反映这些类型的层次结构。顾名思义,*根*证书位于层次结构的顶部,其下的证书继承了根证书所具有的信任。OpenSSL 库和大多数现代编程语言都具有 X509 数据类型以及处理此类证书的函数。来自 Google 的证书具有 X509 格式,`client` 程序会检查该证书是否为 `X509_V_OK`。 +数字证书的类型有所不同(例如根证书、中间证书和最终实体证书),并形成了反映这些证书类型的层次结构。顾名思义,*根*证书位于层次结构的顶部,其下的证书继承了根证书所具有的信任。OpenSSL 库和大多数现代编程语言都具有 X509 数据类型以及处理此类证书的函数。来自 Google 的证书具有 X509 格式,`client` 程序会检查该证书是否为 `X509_V_OK`。 X509 证书基于公共密钥基础结构public-key infrastructure(PKI),其中包括的算法(RSA 是占主导地位的算法)用于生成*密钥对*:公共密钥及其配对的私有密钥。公钥是一种身份:[Amazon][15] 的公钥对其进行标识,而我的公钥对我进行标识。私钥应由其所有者负责保密。 @@ -212,7 +213,7 @@ Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's +------------------+ +-------------------+ ``` -原则上可以在没有 Alice 的私钥的情况下解密消息,但在实际情况中,如果使用像 RSA 这样的加密密钥对系统,则做不到。 +理论上可以在没有 Alice 的私钥的情况下解密消息,但在实际情况中,如果使用像 RSA 这样的加密密钥对系统,则在计算上做不到。 现在,第二个示例,请对文档签名以证明其真实性。签名算法使用密钥对中的私钥来处理要签名的文档的加密哈希: @@ -222,7 +223,7 @@ Hash of document--->|Alice's private key|--->Alice's digital signature of the do +-------------------+ ``` -假设 Alice 以数字方式签署了发送给 Bob 的合同。然后,Bob 可以使用密钥对中的 Alice 的公钥来验证签名: +假设 Alice 以数字方式签署了发送给 Bob 的合同。然后,Bob 可以使用 Alice 密钥对中的公钥来验证签名: ``` +------------------+ From 458c35e29d537171a922747ee331b560ffde1548 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 15:03:17 +0800 Subject: [PATCH 056/285] PRF --- ... your calendar with khal and vdirsyncer.md | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md index a84fc3c917..d9b618dc3c 100644 --- a/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md +++ b/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Organize and sync your calendar with khal and vdirsyncer) @@ -9,14 +9,16 @@ 使用 khal 和 vdirsyncer 组织和同步你的日历 ====== -保存和共享日历可能会有点麻烦。在我们的 20 个使用开源提升生产力的系列的第五篇文章中了解如何让它更简单。 -![Calendar close up snapshot][1] + +> 保存和共享日历可能会有点麻烦。在我们的 20 个使用开源提升生产力的系列的第五篇文章中了解如何让它更简单。 + +![](https://img.linux.net.cn/data/attachment/album/202001/23/150009wsr3d5ovg4g1vzws.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 khal 和 vdirsyncer 跟踪你的日程 -处理日历很_麻烦_,要找到好的工具总是很困难的。但是自从我去年将日历列为[我的“失败“之一][2]以来,我已经取得了一些进步。 +处理日历很*麻烦*,要找到好的工具总是很困难的。但是自从我去年将日历列为[我的“失败"之一][2]以来,我已经取得了一些进步。 目前使用日历最困难的是一直需要以某种方式在线共享。两种最受欢迎的在线日历是 Google Calendar 和 Microsoft Outlook/Exchange。两者都在公司环境中大量使用,这意味着我的日历必须支持其中之一或者两个。 @@ -28,10 +30,9 @@ ![vdirsyncer][6] -Vdirsyncer 是个 Python 3 程序,可以通过软件包管理器或 pip 安装。它可以同步 CalDAV、VCalendar/iCalendar、Google Calendar 和目录中的本地文件。由于我使用 Google Calendar,尽管这不是最简单的设置,我也将以它为例。 - -在 vdirsyncer 中设置 Google Calendar 是[有文档参考的][7],所以这里我不再赘述。重要的是确保同步对设置将 Google Calendar 设置为冲突解决的”赢家“。也就是说,如果同一事件有两个更新,那么需要知道哪个更新优先。类似这样做: +Vdirsyncer 是个 Python 3 程序,可以通过软件包管理器或 `pip` 安装。它可以同步 CalDAV、VCalendar/iCalendar、Google Calendar 和目录中的本地文件。由于我使用 Google Calendar,尽管这不是最简单的设置,我也将以它为例。 +在 vdirsyncer 中设置 Google Calendar 是[有文档参考的][7],所以这里我不再赘述。重要的是确保设置你的同步对,将 Google Calendar 设置为冲突解决的“赢家”。也就是说,如果同一事件有两个更新,那么需要知道哪个更新优先。类似这样做: ``` [general] @@ -56,12 +57,11 @@ path = "~/.calendars/Personal" fileext = ".ics" ``` -在第一次 vdirsyncer 同步之后,你将在存储路径中看到一系列目录。每个文件夹都将包含多个文件,日历中的每个事件都是一个文件。下一步是导入 khal。首先运行 **khal configure** 进行初始设置。 +在第一次 vdirsyncer 同步之后,你将在存储路径中看到一系列目录。每个文件夹都将包含多个文件,日历中的每个事件都是一个文件。下一步是导入 khal。首先运行 `khal configure` 进行初始设置。 ![Configuring khal][8] -现在,运行 **khal interactive** 将显示本文开头的界面。输入 **n** 将打开“新事件”对话框。这里要注意的一件事:日历的名称与 vdirsyncer 创建的目录匹配,但是你可以更改 khal 配置文件来指定更清晰的名称。根据条目所在的日历向条目添加颜色还可以帮助你确定日历内容: - +现在,运行 `khal interactive` 将显示本文开头的界面。输入 `n` 将打开“新事件”对话框。这里要注意的一件事:日历的名称与 vdirsyncer 创建的目录匹配,但是你可以更改 khal 配置文件来指定更清晰的名称。根据条目所在的日历,向条目添加颜色还可以帮助你确定日历内容: ``` [calendars] @@ -76,7 +76,7 @@ path = ~/.calendars/Personal/c5i68sj5edpm4rrfdchm6rreehgm6t3j81jn4rrle0n7cbj3c5m color = brown ``` -现在,当你运行 **khal interactive** 时,每个日历将被着色以区别于其他日历,并且当你添加新条目时,它将有更具描述性的名称。 +现在,当你运行 `khal interactive` 时,每个日历将被着色以区别于其他日历,并且当你添加新条目时,它将有更具描述性的名称。 ![Adding a new calendar entry][9] @@ -89,7 +89,7 @@ via: https://opensource.com/article/20/1/open-source-calendar 作者:[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/) 荣誉推出 @@ -103,3 +103,4 @@ via: https://opensource.com/article/20/1/open-source-calendar [6]: https://opensource.com/sites/default/files/uploads/productivity_5-2.png (vdirsyncer) [7]: https://vdirsyncer.pimutils.org/en/stable/config.html#google [8]: https://opensource.com/sites/default/files/uploads/productivity_5-3.png (Configuring khal) +[9]: https://opensource.com/sites/default/files/uploads/productivity_5-4.png From 4c8ab4d99ab79191d80aedfedf2eeb9795a2d07d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 15:03:47 +0800 Subject: [PATCH 057/285] PUB @geekpi https://linux.cn/article-11812-1.html --- ...rganize and sync your calendar with khal and vdirsyncer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200115 Organize and sync your calendar with khal and vdirsyncer.md (98%) diff --git a/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/published/20200115 Organize and sync your calendar with khal and vdirsyncer.md similarity index 98% rename from translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md rename to published/20200115 Organize and sync your calendar with khal and vdirsyncer.md index d9b618dc3c..5ddb647095 100644 --- a/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md +++ b/published/20200115 Organize and sync your calendar with khal and vdirsyncer.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11812-1.html) [#]: subject: (Organize and sync your calendar with khal and vdirsyncer) [#]: via: (https://opensource.com/article/20/1/open-source-calendar) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From e563950e4a348260579074b8aa9bb2ebce42708c Mon Sep 17 00:00:00 2001 From: FSSlc Date: Thu, 23 Jan 2020 17:49:35 +0800 Subject: [PATCH 058/285] [Translated] 20200117 Locking and unlocking accounts on Linux systems.md Signed-off-by: FSSlc --- ...and unlocking accounts on Linux systems.md | 118 ------------------ ...and unlocking accounts on Linux systems.md | 109 ++++++++++++++++ 2 files changed, 109 insertions(+), 118 deletions(-) delete mode 100644 sources/tech/20200117 Locking and unlocking accounts on Linux systems.md create mode 100644 translated/tech/20200117 Locking and unlocking accounts on Linux systems.md diff --git a/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md b/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md deleted file mode 100644 index 469874c4ed..0000000000 --- a/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (FSSlc) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Locking and unlocking accounts on Linux systems) -[#]: via: (https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Locking and unlocking accounts on Linux systems -====== -There are times when locking a Linux user account is necessary and times when you need to reverse that action. Here are commands for managing account access and what's behind them. -SQBack / Getty Images - -If you are administering a [Linux][1] system, there will likely be times that you need to lock an account. Maybe someone is changing positions and their continued need for the account is under question; maybe there’s reason to believe that access to the account has been compromised. In any event, knowing how to lock an account and how to unlock it should it be needed again is something you need to be able to do. - -One important thing to keep in mind is that there are multiple ways to lock an account, and they don't all have the same effect. If the account user is accessing an account using public/private keys instead of a password, some commands you might use to block access to an account will not be effective. - -### Locking an account using the passwd command - -One of the simplest ways to lock an account is with the **passwd -l** command. For example: - -[][2] - -BrandPost Sponsored by HPE - -[Take the Intelligent Route with Consumption-Based Storage][2] - -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. - -``` -$ sudo passwd -l tadpole -``` - -The effect of this command is to insert an exclamation point as the first character in the encrypted password field in the /etc/shadow file. This is enough to keep the password from working. What previously looked like this (note the first character): - -``` -$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: -``` - -will look like this: - -``` -!$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: -``` - -On his next login attempt (should there be one), tadpole would probably try his password numerous times and not gain access. You, on the other hand, would be able to check the status of his account with a command like this (-S = status): - -``` -$ sudo passwd -S tadpole -tadpole L 10/15/2019 0 99999 7 -1 -``` - -The "L" in the second field tells you that the account is locked. Before the account was locked, it would have been a "P". An "NP" would mean that no password was set. - -**[ Two-Minute Linux Tips: [Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** - -The **usermod -L** command would have the same effect (inserting the exclamation character to disable use of the password). - -One of the benefits of locking an account in this way is that it's very easy to unlock the account when and if needed. Just reverse the change by removing the added exclamation point with a text editor or, better yet, by using the **passwd -u** command. - -``` -$ sudo passwd -u tadpole -passwd: password expiry information changed. -``` - -The problem with this approach is that, if the user is accessing his or her account with public/private keys, this change will not block their use. - -### Locking accounts with the chage command - -Another way to lock a user account is to the the **chage** command that helps manage account expiration dates. - -``` -$ sudu chage -E0 tadpole -$ sudo passwd -S tadpole -tadpole P 10/15/2019 0 99999 7 -1 -``` - -The **chage** command is going to make a subtle change to the /etc/shadow file. The eighth field in that colon-separated file (shown below) will be set to zero (previously empty) and this means the account is essentially expired. The **chage** command tracks the number of days between password changes, but also provides account expiration information when this option is used. A zero in the eiighth field would mean that the account expires a day after January 1, 1970, but also simply locks it when a command like that shown above is used. - -``` -$ sudo grep tadpole /etc/shadow | fold -tadpole:$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPC -nXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::0: - ^ - | - +--- days until expiration -``` - -To reverse this change, you can simply remove the 0 that was placed in the /etc/shadow entry for the user with a command like this: - -``` -% sudo chage -E-1 tadpole -``` - -Once an account is expired in this way, even passwordless [SSH][4] will not provide access. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html -[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[4]: https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md b/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md new file mode 100644 index 0000000000..d22b9d114a --- /dev/null +++ b/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Locking and unlocking accounts on Linux systems) +[#]: via: (https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 系统中禁用与解禁用户的账号 +====== +总有这样的时候:有时你需要禁用某位 Linux 用户的账号,有时你还需要反过来解禁用户的账号。 +本文将介绍一些管理用户访问的命令,并介绍它们背后的原理。 + +假如你正管理着一台 [Linux][1] 系统,那么很有可能将遇到需要禁用一个账号的情况。可能是某人已经换了职位,他们是否还需要该账号仍是个问题;或许有理由相信再次使用该账号并没有大碍。不管上述哪种情况,知晓如何禁用账号并解禁账号都是你需要知道的知识。 + +需要你记住的一件重要的事是尽管有多种方法来禁用账号,但它们并不都达到相同的效果。假如用户使用公钥/私钥来使用该账号而不是使用密码来访问,那么你使用的某些命令来阻止用户获取该账号或许将不会生效。 + +### 使用 `passwd` 来禁用一个账号 + +最为简单的用来禁用一个账号的方法是使用 `passwd -l` 命令。例如: + +``` +$ sudo passwd -l tadpole +``` + +上面这个命令的效果是在加密后的密码文件 `/etc/shadow` 中,用户对应的那一行的最前面加上一个 `!` 符号。这样就足够阻止用户使用密码来访问账号了。 +在没有使用上述命令前,加密后的密码行如下所示(请注意第一个字符): + +``` +$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: +``` + +而禁用该账号后,这一行将变为: + +``` +!$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: +``` + +在 tadpole 下一次尝试登录时, 他可能会使用他原有的密码来尝试多次登录,但就是无法再登录成功了。另一方面,你则可以使用下面的命令来查看他这个账号的状态(-S = status): + +``` +$ sudo passwd -S tadpole +tadpole L 10/15/2019 0 99999 7 -1 +``` + +第二项的 `L` 告诉你这个账号已经被禁用了。在该账号被禁用前,这一项应该是 `P`。如果显示的是 `NP` 则意味着该账号还没有设置密码。 + +命令 `usermod -L` 也具有相同的效果(添加 `!` 来禁用账号的使用)。 + +使用这种方法来禁用某个账号的一个好处是当需要解禁某个账号时非常容易。只需要使用一个文本编辑器或者使用 `passwd -u` 命令来执行相反的操作,即将添加的 `!` 移除即可。 + +``` +$ sudo passwd -u tadpole +passwd: password expiry information changed. +``` + +但使用这种方式的问题是如果用户使用公钥/私钥对的方式来访问他/她的账号,这种方式将不能阻止他们使用该账号。 + +### 使用 `chage` 命令来禁用账号 + +另一种禁用用户账号的方法是使用 `chage` 命令,它可以帮助管理用户账号的过期日期。 + +``` +$ sudu chage -E0 tadpole +$ sudo passwd -S tadpole +tadpole P 10/15/2019 0 99999 7 -1 +``` + +`chage` 命令将对 `/etc/shadow` 文件做出显著的变化。在这个使用 `:` 来分隔的文件(下面将进行展示)中,某行的第 8 项将被设置为 `0` (先前为空),这就意味着这个账号已经过期了。 `chage` 命令将追踪密码更改期间的日期数目,但给出选项是它也可以提供账号过期信息。第 8 项如果是 0 则意味着这个账号在 1970 年 1 月 1 日后的一天过期,当使用上面显示的那个命令时也可以用来禁用账号。 + +``` +$ sudo grep tadpole /etc/shadow | fold +tadpole:$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPC +nXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::0: + ^ + | + +--- days until expiration +``` + +为了执行相反的操作,你可以简单地使用下面的命令将放置在 `/etc/shadow` 文件中的 `0` 移除掉: + +``` +% sudo chage -E-1 tadpole +``` + +一旦一个账号使用这种方式被禁用,即便是免密的 [SSH][4] 登录也不能再访问该账号了。 + +最后请加入我们在 [Facebook][5] 和 [LinkedIn][6] 上的社区来对你感兴趣的话题进行评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 23e43f683f53a0a0ea6a54a9f000501032a19b96 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 21:43:15 +0800 Subject: [PATCH 059/285] PRF @FSSlc --- ...and unlocking accounts on Linux systems.md | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md b/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md index d22b9d114a..a3cc947d1c 100644 --- a/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md +++ b/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Locking and unlocking accounts on Linux systems) @@ -9,14 +9,17 @@ 在 Linux 系统中禁用与解禁用户的账号 ====== -总有这样的时候:有时你需要禁用某位 Linux 用户的账号,有时你还需要反过来解禁用户的账号。 + +> 总有这样的时候:有时你需要禁用某位 Linux 用户的账号,有时你还需要反过来解禁用户的账号。 本文将介绍一些管理用户访问的命令,并介绍它们背后的原理。 +![](https://images.idgesg.net/images/article/2019/10/cso_cybersecurity_mysterious_padlock_complex_circuits_gold_by_sqback_gettyimages-1177918748_2400x1600-100813830-large.jpg) + 假如你正管理着一台 [Linux][1] 系统,那么很有可能将遇到需要禁用一个账号的情况。可能是某人已经换了职位,他们是否还需要该账号仍是个问题;或许有理由相信再次使用该账号并没有大碍。不管上述哪种情况,知晓如何禁用账号并解禁账号都是你需要知道的知识。 需要你记住的一件重要的事是尽管有多种方法来禁用账号,但它们并不都达到相同的效果。假如用户使用公钥/私钥来使用该账号而不是使用密码来访问,那么你使用的某些命令来阻止用户获取该账号或许将不会生效。 -### 使用 `passwd` 来禁用一个账号 +### 使用 passwd 来禁用一个账号 最为简单的用来禁用一个账号的方法是使用 `passwd -l` 命令。例如: @@ -25,6 +28,7 @@ $ sudo passwd -l tadpole ``` 上面这个命令的效果是在加密后的密码文件 `/etc/shadow` 中,用户对应的那一行的最前面加上一个 `!` 符号。这样就足够阻止用户使用密码来访问账号了。 + 在没有使用上述命令前,加密后的密码行如下所示(请注意第一个字符): ``` @@ -37,7 +41,7 @@ $6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7R !$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: ``` -在 tadpole 下一次尝试登录时, 他可能会使用他原有的密码来尝试多次登录,但就是无法再登录成功了。另一方面,你则可以使用下面的命令来查看他这个账号的状态(-S = status): +在 tadpole 下一次尝试登录时,他可能会使用他原有的密码来尝试多次登录,但就是无法再登录成功了。另一方面,你则可以使用下面的命令来查看他这个账号的状态(`-S` = status): ``` $ sudo passwd -S tadpole @@ -57,7 +61,7 @@ passwd: password expiry information changed. 但使用这种方式的问题是如果用户使用公钥/私钥对的方式来访问他/她的账号,这种方式将不能阻止他们使用该账号。 -### 使用 `chage` 命令来禁用账号 +### 使用 chage 命令来禁用账号 另一种禁用用户账号的方法是使用 `chage` 命令,它可以帮助管理用户账号的过期日期。 @@ -67,7 +71,7 @@ $ sudo passwd -S tadpole tadpole P 10/15/2019 0 99999 7 -1 ``` -`chage` 命令将对 `/etc/shadow` 文件做出显著的变化。在这个使用 `:` 来分隔的文件(下面将进行展示)中,某行的第 8 项将被设置为 `0` (先前为空),这就意味着这个账号已经过期了。 `chage` 命令将追踪密码更改期间的日期数目,但给出选项是它也可以提供账号过期信息。第 8 项如果是 0 则意味着这个账号在 1970 年 1 月 1 日后的一天过期,当使用上面显示的那个命令时也可以用来禁用账号。 +`chage` 命令将会稍微修改 `/etc/shadow` 文件。在这个使用 `:` 来分隔的文件(下面将进行展示)中,某行的第 8 项将被设置为 `0`(先前为空),这就意味着这个账号已经过期了。`chage` 命令会追踪密码更改期间的天数,通过选项也可以提供账号过期信息。第 8 项如果是 0 则意味着这个账号在 1970 年 1 月 1 日后的一天过期,当使用上面显示的那个命令时可以用来禁用账号。 ``` $ sudo grep tadpole /etc/shadow | fold @@ -84,9 +88,8 @@ nXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::0: % sudo chage -E-1 tadpole ``` -一旦一个账号使用这种方式被禁用,即便是免密的 [SSH][4] 登录也不能再访问该账号了。 +一旦一个账号使用这种方式被禁用,即便是无密码的 [SSH][4] 登录也不能再访问该账号了。 -最后请加入我们在 [Facebook][5] 和 [LinkedIn][6] 上的社区来对你感兴趣的话题进行评论。 -------------------------------------------------------------------------------- @@ -95,7 +98,7 @@ via: https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a4071ef5453eb88efcef2955696dd9fc8fff24d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 21:43:41 +0800 Subject: [PATCH 060/285] PUB @FSSlc https://linux.cn/article-11813-1.html --- ...0200117 Locking and unlocking accounts on Linux systems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200117 Locking and unlocking accounts on Linux systems.md (98%) diff --git a/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md b/published/20200117 Locking and unlocking accounts on Linux systems.md similarity index 98% rename from translated/tech/20200117 Locking and unlocking accounts on Linux systems.md rename to published/20200117 Locking and unlocking accounts on Linux systems.md index a3cc947d1c..64a19e1010 100644 --- a/translated/tech/20200117 Locking and unlocking accounts on Linux systems.md +++ b/published/20200117 Locking and unlocking accounts on Linux systems.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11813-1.html) [#]: subject: (Locking and unlocking accounts on Linux systems) [#]: via: (https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From f20cc28ac47206de6f579b328953af2ebc3ab5c2 Mon Sep 17 00:00:00 2001 From: algzjh Date: Thu, 23 Jan 2020 21:53:34 +0800 Subject: [PATCH 061/285] translated by algzjh --- ...esources for agile software development.md | 65 ------------------- ...esources for agile software development.md | 64 ++++++++++++++++++ 2 files changed, 64 insertions(+), 65 deletions(-) delete mode 100644 sources/tech/20191229 The best resources for agile software development.md create mode 100644 translated/tech/20191229 The best resources for agile software development.md diff --git a/sources/tech/20191229 The best resources for agile software development.md b/sources/tech/20191229 The best resources for agile software development.md deleted file mode 100644 index 84c8c09548..0000000000 --- a/sources/tech/20191229 The best resources for agile software development.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (algzjh) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The best resources for agile software development) -[#]: via: (https://opensource.com/article/19/12/agile-resources) -[#]: author: (Leigh Griffin https://opensource.com/users/lgriffin) - -The best resources for agile software development -====== -Read our top articles that highlight the discussion around agile's past, -present, and what it may look like in the future. -![Women programming][1] - -It has been a great year for agile topics on Opensource.com. As we approach the end of 2019, reviewed our top agile-related articles, as read by you, our readers! - -### Small Scale Scrum guide - -Opensource.com's six-part guide to [Small Scale Scrum][2] (which I helped co-author) advises smaller teams on how to bring agile into their work. The traditional scrum framework outlined in the official [Scrum Guide][3] recommends a minimum of three people for the framework to realize its full potential. However, it provides no guidance for how teams of one or two people can follow scrum successfully. Our six-part series aims to formalize Small Scale Scrum and examines our experience with it in the real world. The series was received very warmly by our readers—so much such that the six individual articles comprise 60% of our Top 10 list. So, if you haven't already, make sure to download them from our [_Introduction to Small Scale Scrum_ page][2]. - -### A comprehensive guide to agile project management - -Teams following traditional project management approaches, initially skeptical about agile, have warmed up to the agile way of working. Now agile has reached acceptance, and a more flexible, hybrid style has found a home. [_A comprehensive guide to agile project management_][4] by Matt Shealy covers 12 guiding principles of agile project management and is perfect for traditional project managers looking to bring some agility to their projects. - -### 4 steps to becoming an awesome agile developer - -A DevOps culture has emerged in many modern software teams that embrace agile software development principles that leverage cutting-edge tooling and automation. But this mechanically agile approach does not guarantee that developers are following agile practices in their day-to-day work. In [_4 steps to becoming an awesome agile developer_][5], Daniel Oh gives great tips for increasing your agility by focusing on design thinking, using predictable approaches, putting quality at the center, and continuously learning and exploring. Complementing these methods with your agile tooling will create very flexible and strong agile developers. - -### Scrum vs. kanban: Which agile framework is better? - -Scrum and kanban are two of the most popular approaches for teams running in an agile manner, and in [_Scrum vs. kanban: Which agile framework is better?_][6] Taz Brown explores the history and purpose of both. While reading this article, a great saying came to my mind: "If the only tool in your toolbox is a hammer, every problem looks like a nail." Knowing when to use kanban and when to use scrum is important, and this article helps show that both have a place, depending on your team, your challenge, and your goals. - -### 4 ways developers can have a say in what agile looks like - -Developers often have a fear of having a workstyle imposed upon them when the topic of adopting agile comes up. In [_4 ways developers can have a say in what agile looks like_][7], [Clément Verna][8] looks at ways that developers can flip that narrative by helping to determine what agile looks like on their team. Examining the origins and the basics of agile is a great starting point, but the real value is in having metrics to help guide your journey. Knowing what challenges you can expect to have will give you a firm ground to move forward. And making decisions empirically not only empowers teams but gives them a sense of ownership of the journey. Verna's article also examines the importance of putting people over processes and working as a team to achieve your goals. - -### Agile now and later - -This year, Opensource.com authors created a lot of discussion around agile's past, present, and what it may look like in the future. Thank you to all of them, and be sure to [share your own agile story][9] here in 2020. - -A look back at the tools Opensource.com covered in 2014 and 2015 , with updates on new releases,... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/agile-resources - -作者:[Leigh Griffin][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lgriffin -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming) -[2]: https://opensource.com/downloads/small-scale-scrum -[3]: https://scrumguides.org/scrum-guide.html -[4]: https://opensource.com/article/19/8/guide-agile-project-management -[5]: https://opensource.com/article/19/2/steps-agile-developer -[6]: https://opensource.com/article/19/8/scrum-vs-kanban -[7]: https://opensource.com/article/19/10/ways-developers-what-agile -[8]: https://twitter.com/clemsverna -[9]: https://opensource.com/how-submit-article diff --git a/translated/tech/20191229 The best resources for agile software development.md b/translated/tech/20191229 The best resources for agile software development.md new file mode 100644 index 0000000000..1f467430c7 --- /dev/null +++ b/translated/tech/20191229 The best resources for agile software development.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (algzjh) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The best resources for agile software development) +[#]: via: (https://opensource.com/article/19/12/agile-resources) +[#]: author: (Leigh Griffin https://opensource.com/users/lgriffin) + +敏捷软件开发的最佳资源 +====== +请阅读我们的热门文章,这些文章着重讨论了敏捷的过去、现在和未来。 +![Women programming][1] + +对于 Opensource.com 上的敏捷主题来说,今年是非常棒的一年。随着 2019 年的临近,我们回顾了我们读者所读的与敏捷相关的热门文章。 + +### 小规模 Scrum 指南 + +Opensource.com 关于[小规模 Scrum][2] 的指南(我曾参与合著)由六部分组成,为小型团队提供了关于如何将敏捷引入到他们的工作中的建议。在官方的 [Scrum 指南][3] 的概述中,传统的 Scrum 框架推荐至少三个人来实现,以充分发挥其潜力。但是,它并没有为一两个人的团队如何成功遵循 Scrum 提供指导。我们的六部分系列旨在规范化小规模的 Scrum,并检验我们在现实世界中使用它的经验。该系列受到了读者的热烈欢迎,以至于这六篇文章占据了前 10 名文章的 60%。因此,如果你还没有阅读的话,一定要从我们的[小规模 Scrum 介绍页面][2]下载。 + +### 全面的敏捷项目管理指南 + +遵循传统项目管理方法的团队最初对敏捷持怀疑态度,现在已经热衷于敏捷的工作方式。目前,敏捷已被接受,并且一种更加灵活的混合风格已经找到了归宿。Matt Shealy 撰写的[有关敏捷项目管理的综合指南][4]涵盖了敏捷项目管理的 12 条指导原则,对于希望为其项目带来敏捷性的传统项目经理而言,它是完美的选择。 + +### 成为出色的敏捷开发人员的 4 个步骤 + +DevOps 文化已经出现在许多现代软件团队中,这些团队采用了敏捷软件开发原则,利用了最先进的工具和自动化技术。但是,这种机械的敏捷方法并不能保证开发人员在日常工作中遵循敏捷实践。Daniel Oh 在[《成为出色的敏捷开发人员的 4 个步骤》][5]中给出了一些很棒的技巧,通过关注设计思维,使用可预测的方法,以质量为中心并不断学习和探索来提高你的敏捷性。用你的敏捷工具补充这些方法将形成非常灵活和强大的敏捷开发人员。 + +### Scrum 和 kanban:哪种敏捷框架更好? + +对于以敏捷方式运行的团队来说,Scrum 和 kanban 是两种最流行的方法。在 “[Scrum 与 kanban:哪种敏捷框架更好?][6]” 中,Taz Brown 探索了两者的历史和目的。在阅读本文时,我想起一句名言:“如果你的工具箱里只有锤子,那么所有问题看起来都像钉子。”知道何时使用 kanban 以及何时使用 Scrum 非常重要,本文有助于说明两者都有一席之地,这取决于你的团队、挑战和目标。 + +### 开发人员对敏捷发表意见的 4 种方式 + +当采用敏捷的话题出现时,开发人员常常会担心自己会被强加上一种工作风格。在“[开发人员对敏捷发表意见的 4 种方式][7]”中,[Clément Verna][8] 着眼于开发人员通过帮助确定敏捷在其团队中的表现形式来颠覆这种说法的方法。检查敏捷的起源和基础是一个很好的起点,但是真正的价值在于拥有可帮助指导你的过程的指标。知道你将面临什么样的挑战会给你的前进提供坚实的基础。根据经验进行决策不仅可以增强团队的能力,还可以使他们对整个过程有一种主人翁意识。Verna 的文章还探讨了将人置于过程之上并作为一个团队来实现目标的重要性。 + +### 敏捷的现在和未来 + +今年,Opensource.com 的作者围绕敏捷的过去、现在以及未来可能会是什么样子进行了大量的讨论。感谢他们所有人,请一定于 2020 年在这里分享[你自己的敏捷故事][9]。 + +回顾一下 Opensource.com 在 2014 年和 2015 年报道的工具,以及新版本的更新,…… + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/agile-resources + +作者:[Leigh Griffin][a] +选题:[lujun9972][b] +译者:[algzjh](https://github.com/algzjh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lgriffin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G "Women programming" +[2]: https://opensource.com/downloads/small-scale-scrum +[3]: https://scrumguides.org/scrum-guide.html +[4]: https://opensource.com/article/19/8/guide-agile-project-management +[5]: https://opensource.com/article/19/2/steps-agile-developer +[6]: https://opensource.com/article/19/8/scrum-vs-kanban +[7]: https://opensource.com/article/19/10/ways-developers-what-agile +[8]: https://twitter.com/clemsverna +[9]: https://opensource.com/how-submit-article From 82227a51a7f313bd6004f9b11f9d152a3422135c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Jan 2020 22:41:35 +0800 Subject: [PATCH 062/285] APL --- sources/tech/20191208 What-s your favorite terminal emulator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191208 What-s your favorite terminal emulator.md b/sources/tech/20191208 What-s your favorite terminal emulator.md index ff3ed8349d..a09a4d02b1 100644 --- a/sources/tech/20191208 What-s your favorite terminal emulator.md +++ b/sources/tech/20191208 What-s your favorite terminal emulator.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3f1a216f2502349ee8cfa6260f54f7e86c3050bb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Jan 2020 00:03:01 +0800 Subject: [PATCH 063/285] TSL --- ... What-s your favorite terminal emulator.md | 74 ------------------- ... What-s your favorite terminal emulator.md | 73 ++++++++++++++++++ 2 files changed, 73 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20191208 What-s your favorite terminal emulator.md create mode 100644 translated/tech/20191208 What-s your favorite terminal emulator.md diff --git a/sources/tech/20191208 What-s your favorite terminal emulator.md b/sources/tech/20191208 What-s your favorite terminal emulator.md deleted file mode 100644 index a09a4d02b1..0000000000 --- a/sources/tech/20191208 What-s your favorite terminal emulator.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What's your favorite terminal emulator?) -[#]: via: (https://opensource.com/article/19/12/favorite-terminal-emulator) -[#]: author: (Opensource.com https://opensource.com/users/admin) - -What's your favorite terminal emulator? -====== -We asked our community to tell us about their experience with terminal -emulators. Here are a few of the responses we received. Take our poll to -weigh in on your favorite. -![Terminal window with green text][1] - -Preference of a terminal emulator can say a lot about a person's workflow. Is the ability to drive mouseless a must-have? Do you like to navigate between tabs or windows? There's something to be said about how it makes you feel, too. Does it have that cool factor? Tell us about your favorite terminal emulator by taking our poll or leaving us a comment. How many have you tried? - -We asked our community to tell us about their experience with terminal emulators. Here are a few of the responses we received. - -"My favorite terminal emulator is Tilix, customized with Powerline. I love that it supports multiple terminals open in a single window." —Dan Arel - -"urxvt ([rxvt-unicode][2]). It's simple to configure via files, is lightweight, and readily available in most package manager repositories." —Brian Tomlinson - -"gnome-terminal is still my go-to even though I don't use GNOME anymore. :)" —Justin W. Flory - -"Terminator at this point on FC31.  I just started using it but like the split screen feature and it seems light enough for me. Investigating plugins." —Marc Maxwell - -"I switched over to Tilix a while back and it does everything I need terminals to do. :) Multiple panes, notifications, lean and runs my tmux sessions great." —Kevin Fenzi - -"alacritty. It's optimized for speed, implemented in Rust and generally feature packed, but, honestly speaking, I only care about one feature: configurable inter-glyph spacing that allows me to further condense my font. I'm so-o hooked." —Alexander Sosedkin -  - -"I am old and grumpy: KDE Konsole. With tmux in it if session is remote." —Marcin Juszkiewicz - -"iTerm2 for macOS. Yes, it's open source. :-) Terminator on Linux." —Patrick Mullins - - "I've been using alacritty for a year or two now, but recently I started also using cool-retro-term in fullscreen mode whenever I have to run a script that has a lot of output because it looks cool and makes me feel cool. This is important to me." —Nick Childers -  -"I love Tilix, partly because it's good at staying out of the way (I usually just run it full screen with tmux inside), but also for the custom hotlinking support: in my terminal, text like "rhbz#1234" is a hotlink that takes me to bugzilla. Similar for LaunchPad issues, Gerrit change ids for OpenStack, etc." —Lars Kellogg-Stedman -  -"Eterm, also presentations look best in cool-retro-term with Vintage profile." —Ivan Horvath -  -"+1 for Tilix. It’s the best for an option for GNOME users, IMO!"  —Eric Rich -  -"urxvt. Fast. Small. Configurable. Extendable via perl plugins, which can make it mouseless." —Roman Dobosz  -  -"Konsole is the best, the only app I use from KDE project. The highlight of all search result occurrences is a killer feature which afaik does not have any other Linux terminal (glad if you prove me wrong). Best for searching compilation errors and output logs." —Jan Horak -  -"I use Terminator in past a lot. Now I cloned the theme (dark one) in Tilix and I didn't miss a thing. Is easy to move between tabs. That's all." —Alberto Fanjul Alonso -  -"Started my journey in using Terminator, I have since (in the past 3 years or so) completely switched over to Tilix." —Mike Harris -  -"I use Drop Down Terminal X. It's a very simple extension for GNOME 3 that lets me have a terminal always at the stroke of a single key (F12 for me). And it also supports tabs, which is kind of all I need." —Germán Pulido -  -"xfce4-terminal: wayland support, zoom, no borders, no title bar, no scroll bar - that's all I want from terminal emulator, for everything else I have tmux. I want my terminal emulator to use as much screen space as possible as I usually have editor (Vim) and repl side by side in tmux panes." —Martin Kourim - -"Fish! Don’t ask! ;-)" —Eric Schabell - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/favorite-terminal-emulator - -作者:[Opensource.com][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/admin -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals_0.png?itok=XwIRERsn (Terminal window with green text) -[2]: https://opensource.com/article/19/10/why-use-rxvt-terminal diff --git a/translated/tech/20191208 What-s your favorite terminal emulator.md b/translated/tech/20191208 What-s your favorite terminal emulator.md new file mode 100644 index 0000000000..ccb9a6bbfc --- /dev/null +++ b/translated/tech/20191208 What-s your favorite terminal emulator.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's your favorite terminal emulator?) +[#]: via: (https://opensource.com/article/19/12/favorite-terminal-emulator) +[#]: author: (Opensource.com https://opensource.com/users/admin) + +你最喜欢的终端模拟器是什么? +====== + +> 我们让社区讲述他们在终端仿真器方面的经验。以下是我们收到的一些回复。 + +![Terminal window with green text][1] + +终端仿真器的偏好可以说明一个人的工作流程。无鼠标操作能力是否必须具备?你想要标签页还是窗口?对于终端仿真器你还有什么选择的原因?是否有酷的因素?欢迎参加调查或给我们留下评论,告诉我们你最喜欢的终端模拟器。你尝试过多少种终端仿真器呢? + +我们让社区讲述他们在终端仿真器方面的经验。以下是我们收到的一些回复。 + +“我最喜欢的终端仿真器是用 Powerline 定制的 Tilix。我喜欢它支持在一个窗口中打开多个终端。” —Dan Arel + +“[urxvt][2]。它可以通过文件简单配置,轻巧,并且在大多数程序包管理器存储库中都很容易找到。” —Brian Tomlinson + +“即使我不再使用 GNOME,gnome-terminal 仍然是我的首选。:)” —Justin W. Flory + +“现在 FC31 上的 Terminator。我刚刚开始使用它,我喜欢它的分屏功能,对我来说感觉很轻巧。我正在研究它的插件。” —Marc Maxwell + +“不久前,我切换到了 Tilix,它完成了我需要终端执行的所有工作。:) 多个窗格、通知,很精简,用来运行我的 tmux 会话很棒。” —Kevin Fenzi + +“alacritty。它针对速度进行了优化,是用 Rust 实现的,并且具有很多常规功能,但是老实说,我只关心一个功能:可配置的字形间距,使我可以进一步压缩字体。” —Alexander Sosedkin +  +“我是个老古板:KDE Konsole。如果是远程会话,请使用 tmux。” —Marcin Juszkiewicz + +“在 macOS 上用 iTerm2。是的,它是开源的。:-) 在 Linux 上是 Terminator。” —Patrick Mullins + +“我现在已经使用 alacritty 一两年了,但是最近我在全屏模式下使用 cool-retro-term,因为我必须运行一个输出内容有很多的脚本,而它看起来很酷,让我感觉很酷。这对我很重要。” —Nick Childers + +“我喜欢 Tilix,部分是因为它擅长免打扰(我通常全屏运行它,里面是 tmux),而且还提供自定义热链接支持:在我的终端中,像 ‘rhbz#1234’ 之类的文本是将我带到 Bugzilla 的热链接。类似的还有 LaunchPad 提案,OpenStack 的 Gerrit 更改 ID 等。” —Lars Kellogg-Stedman + +“Eterm,在使用 Vintage 配置文件的 cool-retro-term 中,演示效果也最好。” —Ivan Horvath + +“Tilix +1。这是 GNOME 用户最好的选择,我是这么觉得的!” —Eric Rich + +“urxvt。快速、小型、可配置、可通过 Perl 插件扩展,这使其可以无鼠标操作。” —Roman Dobosz  + +“Konsole 是最好的,也是 KDE 项目中我唯一使用的应用程序。所有搜索结果都高亮显示是一个杀手级功能,据我所知没有任何其它 Linux 终端有这个功能(如果能证明我错了,那我也很高兴)。最适合搜索编译错误和输出日志。” —Jan Horak + +“我过去经常使用 Terminator。现在我在 Tilix 中克隆了它的主题(深色主题),而感受一样好。它可以在选项卡之间轻松移动。就是这样。” —Alberto Fanjul Alonso + +“我开始使用的是 Terminator,自从差不多过去这三年,我已经完全切换到 Tilix。” —Mike Harris + +“我使用下拉式终端 X。这是 GNOME 3 的一个非常简单的扩展,使我始终可以通过一个按键(对于我来说是`F12`)拉出一个终端。它还支持制表符,这正是我所需要的。 ” —Germán Pulido + +“xfce4-terminal:支持 Wayland、缩放、无边框、无标题栏、无滚动条 —— 这就是我在 tmux 之外全部想要的终端仿真器的功能。我希望我的终端仿真器可以尽可能多地使用屏幕空间,我通常在 tmux 窗格中并排放着编辑器(Vim)和 repl。” —Martin Kourim + +“别问,问就是 Fish ! ;-)” —Eric Schabell + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/favorite-terminal-emulator + +作者:[Opensource.com][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/admin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals_0.png?itok=XwIRERsn (Terminal window with green text) +[2]: https://opensource.com/article/19/10/why-use-rxvt-terminal From 61400de5f81ca0370c94c9527760665377b36b07 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Jan 2020 00:09:18 +0800 Subject: [PATCH 064/285] PRF --- .../tech/20191208 What-s your favorite terminal emulator.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20191208 What-s your favorite terminal emulator.md b/translated/tech/20191208 What-s your favorite terminal emulator.md index ccb9a6bbfc..7a25309a53 100644 --- a/translated/tech/20191208 What-s your favorite terminal emulator.md +++ b/translated/tech/20191208 What-s your favorite terminal emulator.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What's your favorite terminal emulator?) @@ -12,7 +12,7 @@ > 我们让社区讲述他们在终端仿真器方面的经验。以下是我们收到的一些回复。 -![Terminal window with green text][1] +![](https://img.linux.net.cn/data/attachment/album/202001/24/000846qsmpz7s7spig77qg.jpg) 终端仿真器的偏好可以说明一个人的工作流程。无鼠标操作能力是否必须具备?你想要标签页还是窗口?对于终端仿真器你还有什么选择的原因?是否有酷的因素?欢迎参加调查或给我们留下评论,告诉我们你最喜欢的终端模拟器。你尝试过多少种终端仿真器呢? @@ -63,7 +63,7 @@ via: https://opensource.com/article/19/12/favorite-terminal-emulator 作者:[Opensource.com][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 62ed91ae4a937d04547759d433fbc7ab5ad24f3e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Jan 2020 00:09:53 +0800 Subject: [PATCH 065/285] PUB @wxy https://linux.cn/article-11814-1.html --- .../20191208 What-s your favorite terminal emulator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191208 What-s your favorite terminal emulator.md (98%) diff --git a/translated/tech/20191208 What-s your favorite terminal emulator.md b/published/20191208 What-s your favorite terminal emulator.md similarity index 98% rename from translated/tech/20191208 What-s your favorite terminal emulator.md rename to published/20191208 What-s your favorite terminal emulator.md index 7a25309a53..3979bb4a53 100644 --- a/translated/tech/20191208 What-s your favorite terminal emulator.md +++ b/published/20191208 What-s your favorite terminal emulator.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11814-1.html) [#]: subject: (What's your favorite terminal emulator?) [#]: via: (https://opensource.com/article/19/12/favorite-terminal-emulator) [#]: author: (Opensource.com https://opensource.com/users/admin) From b98f6cf7b453be6f5aa394fa10079d8f4e654cc9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Jan 2020 00:52:34 +0800 Subject: [PATCH 066/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200124=20Ansibl?= =?UTF-8?q?e=20Ad-hoc=20Command=20Quick=20Start=20Guide=20with=20Examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200124 Ansible Ad-hoc Command Quick Start Guide with Examples.md --- ...Command Quick Start Guide with Examples.md | 313 ++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100644 sources/tech/20200124 Ansible Ad-hoc Command Quick Start Guide with Examples.md diff --git a/sources/tech/20200124 Ansible Ad-hoc Command Quick Start Guide with Examples.md b/sources/tech/20200124 Ansible Ad-hoc Command Quick Start Guide with Examples.md new file mode 100644 index 0000000000..cb4783b6ab --- /dev/null +++ b/sources/tech/20200124 Ansible Ad-hoc Command Quick Start Guide with Examples.md @@ -0,0 +1,313 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ansible Ad-hoc Command Quick Start Guide with Examples) +[#]: via: (https://www.2daygeek.com/ansible-ad-hoc-command-quick-start-guide-with-examples/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Ansible Ad-hoc Command Quick Start Guide with Examples +====== + +Recently, we have written an article about the **[Ansible installation and configuration][1]**. + +Only a few examples of how to use it are included in that tutorial. + +If you are new to Ansible, I suggest you read the Installation and Configuration section by pressing the URL above. + +Once you’re good in that area, go ahead and play with this article. + +By default, Ansible uses only 5 parallel processes. If you want to perform a task on multiple hosts, you need to manually set the value of the fork count by adding **“-f [fork count]”**. + +### What is ad-hoc Command + +The ad-hoc command is used to automate a task on one or more managed nodes. Ad-hoc commands are very simple, but they are not re-usable. It uses the **“/usr/bin/ansible”** binary to perform all actions. + +Ad-hoc commands are best for tasks you run once. For example, if you want to check whether a given user is available or not, you can use the Ansible Quick One liner without writing a playbook. + +### Why Would You Like to Know About ad-hoc Commands? + +Ad-hoc commands prove the simplicity and power of the Ansible. It currently supports 3389 modules as of version 2.9, so you need to understand and learn the list of Ansible modules you want to use regularly. + +If you are new to Ansible, you can easily practice those modules and their arguments with the help of ad-hoc command. + +The concepts you learn here will port over directly to the playbook language. + +**General Syntax of ad-hoc command:** + +``` +ansible | [pattern] | -m [module] | -a "[module options]" + A | B | C | D +``` + +The ad-hoc command comes with four parts and the details are below. + +``` ++-----------------+--------------------------------------------------+ +| Details | Description | ++-----------------+--------------------------------------------------+ +|ansible | A command | +|pattern | Input the entire inventory or a specific group | +|module | Run the given module name | +|module options | Specify the module arguments | ++-----------------+--------------------------------------------------+ +``` + +### How To Use Ansible Inventory File + +If you use the default inventory file of Ansible **“/etc/ansible/hosts”**, you can call it directly. + +If not, the entire path of the Ansible Inventory file should be called with the **“-i”** option. + +### What’s Pattern and How to Use it? + +An Ansible pattern can refer to a single host, IP address, an inventory group, a set of groups, or all hosts in your inventory. + +It allows you to run commands and playbooks against them. Patterns are very flexible and you can use them according to your needs. + +For example, you can exclude hosts, use wildcards or regular expressions, and more. + +The table below describes common patterns and their use. But if it doesn’t meet your needs, you can use variables in patterns with the **“-e”** argument in the ansible-playbook. + +``` ++-----------------------+------------------------------+-----------------------------------------------------+ +| Description | Pattern(s) | Targets | ++-----------------------+------------------------------+-----------------------------------------------------+ +|All hosts | all (or *) | Run an Ansible against all servers in your inventory| +|One host | host1 | Run an Ansible against only the given host. | +|Multiple hosts | host1:host2 (or host1,host2) | Run an Ansible against the mentioned multiple hosts | +|One group | webservers | Run an Ansible against the webservers group | +|Multiple groups | webservers:dbservers | all hosts in webservers plus all hosts in dbservers | +|Excluding groups | webservers:!atlanta | all hosts in webservers except those in atlanta | +|Intersection of groups | webservers:&staging | any hosts in webservers that are also in staging | ++-----------------------+------------------------------+-----------------------------------------------------+ +``` + +### What is Ansible Modules and What it Does? + +Modules (also referred to as “task plugins” or “library plugins”) are units of code that can be used to perform a specific task directly on remote hosts or through Playbooks. + +Ansible executes the given module on the remote target node and collects the return values. + +Each module supports multiple arguments, allowing it to meet the user’s needs. Almost all modules take **“key=value”** arguments except few. + +You can add multiple arguments with the space at once, and the command/shell modules directly take the string of the command you want to run. + +We will add a table with the most frequently used **“module options”** arguments. + +To list all available modules, run the command below. + +``` +$ ansible-doc -l +``` + +Run the command below to read the documentation for the given module + +``` +$ ansible-doc [Module] +``` + +### 1) How to List the Contents of a Directory Using Ansible on Linux + +This can be done using the Ansible command module as follows. We have listed the contents of the **“daygeek”** user’s home directory on the **“node1.2g.lab”** and **“node2.2g.lab”** remote server. + +``` +$ ansible web -m command -a "ls -lh /home/daygeek" + +node1.2g.lab | CHANGED | rc=0 >> +total 12K +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Desktop +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Documents +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Downloads +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Music +-rwxr-xr-x. 1 daygeek daygeek 159 Mar 4 2019 passwd-up.sh +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Pictures +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Public +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Templates +-rwxrwxr-x. 1 daygeek daygeek 138 Mar 10 2019 user-add.sh +-rw-rw-r--. 1 daygeek daygeek 18 Mar 10 2019 user-list1.txt +drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Videos + +node2.2g.lab | CHANGED | rc=0 >> +total 0 +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Desktop +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Documents +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Downloads +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Music +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Pictures +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Public +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Templates +drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Videos +``` + +### 2) How to Manage Files Using Ansible on Linux + +Ansible “copy module” copies a file from a local system to a remote system. Use the Ansible command module to move or copy files to a remote machine. + +``` +$ ansible web -m copy -a "src=/home/daygeek/backup/CentOS7.2daygeek.com-20191025.tar dest=/home/u1" --become + +node1.2g.lab | CHANGED => { + "ansible_facts": { + "discovered_interpreter_python": "/usr/bin/python" + }, + "changed": true, + "checksum": "ad8aadc0542028676b5fe34c94347829f0485a8c", + "dest": "/home/u1/CentOS7.2daygeek.com-20191025.tar", + "gid": 0, + "group": "root", + "md5sum": "ee8e778646e00456a4cedd5fd6458cf5", + "mode": "0644", + "owner": "root", + "secontext": "unconfined_u:object_r:user_home_t:s0", + "size": 30720, + "src": "/home/daygeek/.ansible/tmp/ansible-tmp-1579726582.474042-118186643704900/source", + "state": "file", + "uid": 0 +} + +node2.2g.lab | CHANGED => { + "ansible_facts": { + "discovered_interpreter_python": "/usr/libexec/platform-python" + }, + "changed": true, + "checksum": "ad8aadc0542028676b5fe34c94347829f0485a8c", + "dest": "/home/u1/CentOS7.2daygeek.com-20191025.tar", + "gid": 0, + "group": "root", + "md5sum": "ee8e778646e00456a4cedd5fd6458cf5", + "mode": "0644", + "owner": "root", + "secontext": "unconfined_u:object_r:user_home_t:s0", + "size": 30720, + "src": "/home/daygeek/.ansible/tmp/ansible-tmp-1579726582.4793239-237229399335623/source", + "state": "file", + "uid": 0 +} +``` + +We can verify it by running the command below. + +``` +$ ansible web -m command -a "ls -lh /home/u1" --become + +node1.2g.lab | CHANGED | rc=0 >> +total 36K +-rw-r--r--. 1 root root 30K Jan 22 14:56 CentOS7.2daygeek.com-20191025.tar +-rw-r--r--. 1 root root 25 Dec 9 03:31 user-add.sh + +node2.2g.lab | CHANGED | rc=0 >> +total 36K +-rw-r--r--. 1 root root 30K Jan 23 02:26 CentOS7.2daygeek.com-20191025.tar +-rw-rw-r--. 1 u1 u1 18 Jan 23 02:21 magi.txt +``` + +To copy a file from one location to another on the remote machine, use the following command. + +``` +$ ansible web -m command -a "cp /home/u2/magi/ansible-1.txt /home/u2/magi/2g" --become +``` + +To move a file, use the following command. + +``` +$ ansible web -m command -a "mv /home/u2/magi/ansible.txt /home/u2/magi/2g" --become +``` + +To create a new file named **“ansible.txt”** under **“u1”** user, run the following command. + +``` +$ ansible web -m file -a "dest=/home/u1/ansible.txt owner=u1 group=u1 state=touch" --become +``` + +To create a new directory named **“magi”** under the **“u1”** user, run the following command. **_“**The file module can also create directories as follows**_“**. + +``` +$ ansible web -m file -a "dest=/home/u1/magi mode=755 owner=u2 group=u2 state=directory" --become +``` + +To change the permission of the **“ansible.txt”** file to **“777”** under **“u1”** user, run the following command. + +``` +$ ansible web -m file -a "dest=/home/u1/ansible.txt mode=777" --become +``` + +To delete the “ansible.txt” file under “u1” user, run the following command. + +``` +$ ansible web -m file -a "dest=/home/u2/magi/ansible-1.txt state=absent" --become +``` + +Use the following command to delete a directory and it will delete the given directory recursively. + +``` +$ ansible web -m file -a "dest=/home/u2/magi/2g state=absent" --become +``` + +### 3) User Management + +You can easily perform the user management activity through Ansible, such as user creation, deleting a user, and adding a user to the group. + +``` +$ ansible all -m user -a "name=foo password=[crypted password here]" +``` + +To remove a user, run the following command. + +``` +$ ansible all -m user -a "name=foo state=absent" +``` + +### 4) Managing Package + +Package installation can be easily managed using the appropriate Ansible Package Manager module. For example, we are going to use the yum module to manage packages on the CentOS system. + +To install the latest Apache (httpd) package. + +``` +$ ansible web -m yum -a "name=httpd state=latest" +``` + +To uninstall the Apache (httpd) package. + +``` +$ ansible web -m yum -a "name=httpd state=absent" +``` + +### 5) Managing Service + +Use the following Ansible module command to manage any service on Linux using Ansible + +To stop the httpd service + +``` +$ ansible web -m service -a "name=httpd state=stopped" +``` + +To start the httpd service + +``` +$ ansible web -m service -a "name=httpd state=started" +``` + +To restart the httpd service + +``` +$ ansible web -m service -a "name=httpd state=restarted" +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/ansible-ad-hoc-command-quick-start-guide-with-examples/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/ From ee2c4cf4fddbe63ab0967d6b90cc0aae38218b59 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Jan 2020 00:53:48 +0800 Subject: [PATCH 067/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200123=20Use=20?= =?UTF-8?q?this=20open=20source=20tool=20to=20get=20your=20local=20weather?= =?UTF-8?q?=20forecast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200123 Use this open source tool to get your local weather forecast.md --- ...tool to get your local weather forecast.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20200123 Use this open source tool to get your local weather forecast.md diff --git a/sources/tech/20200123 Use this open source tool to get your local weather forecast.md b/sources/tech/20200123 Use this open source tool to get your local weather forecast.md new file mode 100644 index 0000000000..644bd80331 --- /dev/null +++ b/sources/tech/20200123 Use this open source tool to get your local weather forecast.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this open source tool to get your local weather forecast) +[#]: via: (https://opensource.com/article/20/1/open-source-weather-forecast) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use this open source tool to get your local weather forecast +====== +Know whether you need a coat, an umbrella, or sunscreen before you go +out with wego in the thirteenth in our series on 20 ways to be more +productive with open source in 2020. +![Sky with clouds and grass][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Check the weather with wego + +One of the things I love about the past decade of my employment is that it mostly has been remote. I can work anywhere I happen to be in the world, although the reality is that I spend a lot of time in my home office. The downside is that when I leave the house, I base a lot of decisions on what the conditions look like outside my window. And where I live, "sunny and clear" can mean anything from "scorchingly hot" to "below freezing" to "it will rain in an hour." Being able to check the actual conditions and forecast quickly is pretty useful. + +![Wego][2] + +[Wego][3] is a program written in Go that will fetch and display your local weather. It even renders it in shiny ASCII art if you wish. + +To install wego, you need to make sure [Go][4] is installed on your system. After that, you can fetch the latest version with the **go get** command. You'll probably want to add the **~/go/bin** directory to your path as well: + + +``` +go get -u github.com/schachmat/wego +export PATH=~/go/bin:$PATH +wego +``` + +On its first run, wego will complain about missing API keys. Now you need to decide on a backend. The default backend is for [Forecast.io][5], which is part of [Dark Sky][6]. Wego also supports [OpenWeatherMap][7] and [WorldWeatherOnline][8]. I prefer OpenWeatherMap, so that's what I'll show you how to set up here. + +You'll need to [register for an API key][9] with OpenWeatherMap. Registration is free, although the free API key has a limit on how many queries you can make in a day; this should be fine for an average user. Once you have your API key, put it into the **~/.wegorc** file. Now is also a good time to fill in your location, language, and whether you use metric, imperial (US/UK), metric-ms, or International System of Units (SI). OpenWeatherMap supports locations by name, postal code, coordinates, and ID, which is one of the reasons I like it. + + +``` +# wego configuration for OEM +aat-coords=false +aat-monochrome=false +backend=openweathermap +days=3 +forecast-lang=en +frontend=ascii-art-table +jsn-no-indent=false +location=Pittsboro +owm-api-key=XXXXXXXXXXXXXXXXXXXXX +owm-debug=false +owm-lang=en +units=imperial +``` + +Now, running **wego** at the command line will show the local weather for the next three days. + +Wego can also show data as JSON output for consumption by programs and with emoji. You can choose a frontend with the **-f** command-line parameter or in the **.wegorc** file. + +![Wego at login][10] + +If you want to see the weather every time you open a new shell or log into a host, simply add wego to your **~/.bashrc** (or **~/.zshrc** in my case). + +The [wttr.in][11] project is a web-based wrapper around wego. It provides some additional display options and is available on the website of the same name. One cool thing about wttr.in is that you can fetch one-line information about the weather with **curl**. I have a little shell function called **get_wttr** that fetches the current forecast in a shortened form. + + +``` +get_wttr() { +  curl -s "wttr.in/Pittsboro?format=3"     +} +``` + +![weather tool for productivity][12] + +Now, before I leave the house, I have a quick and easy way to find out if I need a coat, an umbrella, or sunscreen—directly from the command line where I spend most of my time. + +I began paragliding a few years ago. It’s maybe the most weather-dependent sport in the world. We... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-weather-forecast + +作者:[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/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) +[2]: https://opensource.com/sites/default/files/uploads/productivity_13-1.png (Wego) +[3]: https://github.com/schachmat/wego +[4]: https://golang.org/doc/install +[5]: https://forecast.io +[6]: https://darksky.net +[7]: https://openweathermap.org/ +[8]: https://www.worldweatheronline.com/ +[9]: https://openweathermap.org/api +[10]: https://opensource.com/sites/default/files/uploads/productivity_13-2.png (Wego at login) +[11]: https://github.com/chubin/wttr.in +[12]: https://opensource.com/sites/default/files/uploads/day13-image3.png (weather tool for productivity) From ebe0cc31fe842c1b69ba069f5f31db8c34d66c51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Jan 2020 01:03:24 +0800 Subject: [PATCH 068/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200123=20How=20?= =?UTF-8?q?to=20stop=20typosquatting=20attacks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200123 How to stop typosquatting attacks.md --- ...00123 How to stop typosquatting attacks.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20200123 How to stop typosquatting attacks.md diff --git a/sources/tech/20200123 How to stop typosquatting attacks.md b/sources/tech/20200123 How to stop typosquatting attacks.md new file mode 100644 index 0000000000..66a87fd459 --- /dev/null +++ b/sources/tech/20200123 How to stop typosquatting attacks.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to stop typosquatting attacks) +[#]: via: (https://opensource.com/article/20/1/stop-typosquatting-attacks) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +How to stop typosquatting attacks +====== +Typosquatting is a way to lure users into divulging sensitive data to +cybercriminals. Learn how to protect your organization, your open source +project, and yourself. +![Gears above purple clouds][1] + +Cybercriminals are turning to social engineering to try to trick unsuspecting people into divulging private information or valuable credentials. It is behind many [phishing scams][2] where the attacker poses as a reputable company or organization and uses it as a front to distribute a virus or other piece of malware. + +One such risk is [typosquatting][3], a form of social engineering attack that tries to lure users into visiting malicious sites with URLs that are common misspellings of legitimate sites. These sites can cause significant damage to the reputation of organizations that are victimized by these attackers and harm users who are tricked into entering sensitive details into fake sites. Both system administrators and users need to be aware of the risks and take steps to protect themselves. + +Open source software, which is developed and tested by large groups in public repositories, is often lauded for its security benefits. However, when it comes to social engineering schemes and malware implantation, even open source tools can fall victim. + +This article looks at the rising trend of typosquatting and what these attacks could mean for open source software in the future. + +### What is typosquatting? + +Typosquatting is a very specific form of cybercrime that is often tied to a larger phishing attack. It begins with the cybercriminal buying and registering a domain name that is the misspelling of a popular site. For example, the cybercriminal might add an extra vowel or replace an "i" with a lowercase "l" character. Sometimes a cybercriminal obtains dozens of domain names, each with a different spelling variation. + +A typosquatting attack does not become dangerous until real users start visiting the site. To make that happen, the criminal runs a phishing scam, typically over email, to urge people to click a link and visit the typosquatting website. Normally these rogue pages have simple login screens bearing familiar logos that try to imitate the real company's design. + +If the user does not realize they are visiting a fake website and enters sensitive details, such as their password, username, or credit card number, into the page, the cybercriminal gets full access to that data. If a user is utilizing the same password across several sites, their other online accounts are likely to be exploited as well. This is a cybercriminal's payout: identity theft, ruined credit reports, stolen records, and sometimes worse. + +### Some recent attacks + +From a company perspective, having a typosquatting attack connected to your domain name can be a public relations disaster, even though you played no direct role in it, because it's seen as irresponsible internet stewardship. As a domain owner, you have a responsibility to be proactive in defending against typosquatting to limit the pain caused by this type of fraud. + +A few years ago, many [health insurance customers fell victim][4] to a typosquatting attack when they received a phishing email that pointed to we11point.com, with the number 1 replacing the character "l" in the URL. + +When the international domain name rules were changed to allow anyone to register a URL with an extension previously tied to specific countries, it created a brand new wave of typosquatting attacks. One of the most prevalent ones seen today is when a cybercriminal registers a .om domain that matches a popular .com domain to take advantage of accidental omissions of the letter "c" when entering a web address. + +### How to protect your website from typosquatting + +For companies, the best strategy is to try to stay ahead of typosquatting attacks. + +That means spending the money to trademark your domain and purchase all related URLs that could be easy misspellings. You don't need to buy all top-level domain variants of your site name, but at least focus on common misspellings to your primary site name. + +If you need to send your users to third-party sites, do so from your official website, not in a mass email. It's important to firmly establish a policy that official communication always and only sends users to your site. That way, should a cybercriminal attempt to spoof communication from you, your users will know something's amiss when they end up on an unfamiliar page or URL structure. + +Use an open source tool like [DNS Twist][5] to automatically scan your company's domain and determine whether there could already be a typosquatting attack in progress. DNS Twist runs on Linux operating systems and can be used through a series of shell commands. + +Some ISPs offer typosquatting protection as part of their product offering. This functions as an extra layer of web filtering—if a user in your organization accidentally misspells a common URL, they are alerted that the page is blocked and redirected to the proper domain. + +If you are a system administrator, consider running your own [DNS server][6] along with a blacklist of incorrect and forbidden domains. + +Another effective way to spot a typosquatting attack in progress is to monitor your site traffic closely and set an alert for a sudden decrease in visitors from a particular region. It could be that a large number of your regular users have been redirected to a fake site. + +As with almost any form of cyberattack, the key to stopping typosquatting is constant vigilance. Your users are counting on you to identify and shut down any fake sites that are operating under your name, and if you don't, you could lose your audience's trust. + +### Typosquatting threats to open source software + +Most major open source projects go through security and penetration testing, largely because the code is public. However, mistakes happen under even the best of conditions. Here are some things to watch for if you're involved in an open source project. + +When you get a merge request or patch from an unknown source, review it carefully before merging, especially if there's a networking stack involved. Don't fall prey to the temptation of only testing your build; look at the code to ensure that nothing nefarious has been embedded into an otherwise functional enhancement. + +Also, use the same rigor in protecting your project's identity as a business does for its domain. Don't let a cybercriminal create alternate download sites and offer a version of your project with additional harmful code. Use digital signatures, like the following, to create an assurance of authenticity for your software: + + +``` +gpg --armor --detach-sig \ +\--output advent-gnome.sig \ +example-0.0.1.tar.xz +``` + +You should also provide a checksum for the file you deliver: + + +``` +`sha256sum example-0.0.1.tar.xz > example-0.0.1.txt` +``` + +Provide these safeguards even if you don't believe your users will take advantage of them, because all it takes is one perceptive user to notice a missing signature on an alternative download to alert you that someone, somewhere is spoofing your project. + +### Final thoughts + +Humans are prone to making mistakes. When you have millions of people around the world typing in a common web address, it's no surprise that a certain percentage enter a typo in the URL. Cybercriminals are trying to capitalize on that trend with typosquatting. + +It's hard to stop cybercriminals from registering domains that are available for purchase, so mitigate against typosquatting attacks by focusing on the ways they spread. The best protection is to build trust with your users and to be diligent in detecting typosquatting attempts. Together, as a community, we can all help ensure that typosquatting attempts are ineffective. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/stop-typosquatting-attacks + +作者:[Sam Bocetta][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds) +[2]: https://www.cloudberrylab.com/resources/guides/types-of-phishing/ +[3]: https://en.wikipedia.org/wiki/Typosquatting +[4]: https://www.menlosecurity.com/blog/-a-new-approach-to-end-typosquatting +[5]: https://github.com/elceef/dnstwist +[6]: https://opensource.com/article/17/4/build-your-own-name-server From a1d1d958d658bf66ca822ad7e699a9b5e1a9b4e9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Jan 2020 01:09:29 +0800 Subject: [PATCH 069/285] add done: 20200123 How to stop typosquatting attacks.md --- ...6 things you should be doing with Emacs.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20200123 6 things you should be doing with Emacs.md diff --git a/sources/tech/20200123 6 things you should be doing with Emacs.md b/sources/tech/20200123 6 things you should be doing with Emacs.md new file mode 100644 index 0000000000..b01830cd8e --- /dev/null +++ b/sources/tech/20200123 6 things you should be doing with Emacs.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 things you should be doing with Emacs) +[#]: via: (https://opensource.com/article/20/1/emacs-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +6 things you should be doing with Emacs +====== +Here are six things you may not have realized you could do with Emacs. +Then, get our new cheat sheet to get the most out of Emacs. +![Text editor on a browser, in blue][1] + +Imagine using Python's IDLE interface to edit text. You would be able to load files into memory, edit them, and save changes. But every action you perform would be defined by a Python function. Making a word all capitals, for instance, calls **upper()**, opening a file calls **open**, and so on. Everything in your text document is a Python object and can be manipulated accordingly. From the user's perspective, it's the same experience as any text editor. For a Python developer, it's a rich Python environment that can be changed and developed with just a few custom functions in a config file. + +This is what [Emacs][2] does for the 1958 programming language [Lisp][3]. In Emacs, there's no separation between the Lisp engine running the application and the arbitrary text you type into it. To Emacs, everything is Lisp data, so everything can be analyzed and manipulated programmatically. + +That makes for a powerful user interface (UI). But if you're a casual Emacs user, you may only be scratching the surface of what it can do for you. Here are six things you may not have realized you could do with Emacs. + +## Use Tramp mode for cloud editing + +Emacs has been network-transparent for a lot longer than has been trendy, and today it still provides one of the smoothest remote editor experiences available. The [Tramp mode][4] in Emacs (formerly known as RPC mode) stands for "Transparent Remote (file) Access, Multiple Protocol," which spells out exactly what it offers: easy access to remote files you want to edit over most popular network protocols. The most popular and safest protocol for remote editing these days is [OpenSSH][5], so that's the default. + +Tramp is already included in Emacs 22.1 or greater, so to use Tramp, you just open a file in the Tramp syntax. In the **File** menu of Emacs, select **Open File**. When prompted in the mini-buffer at the bottom of the Emacs window, enter the file name using this syntax: + + +``` +`/ssh:user@example.com:/path/to/file` +``` + +If you are required to log in interactively, Tramp prompts you for your password. However, Tramp uses OpenSSH directly, so to avoid interactive prompts, you can also add your hostname, username, and SSH key path to your **~/.ssh/config** file. Like Git, Emacs uses your SSH config first and only stops to ask for more information in the event of an error. + +Tramp is great for editing files that don't exist on your computer, and the user experience is not noticeably any different from editing a local file. The next time you start to SSH into a server just to launch a Vim or Emacs session, try Tramp instead. + +## Calendaring + +If you parse text better than you parse graphical interfaces, you'll be happy to know that you can schedule your day (or life) in plain text with Emacs but still get fancy notifications on your mobile device with open source [Org mode][6] viewers. + +The process takes a little setup to create a convenient way to sync your agenda with your mobile device (I use Git, but you could invoke Bluetooth, KDE Connect, Nextcloud, or your file synchronization tool of choice), and you have to install an Org mode viewer (such as [Orgzly][7]) and a Git client app on your mobile. Once you've got your infrastructure sorted, though, the process is inherently perfectly integrated with your usual (or developing, if you're a new user) Emacs workflow. You can refer to your agenda easily in Emacs, make updates to your schedule, and generally stay on task. Pushing changes to your agenda is reflected on your mobile, so you can stay organized even when Emacs isn't available. + +![][8] + +Intrigued? Read my step-by-step guide about [calendaring with Org mode and Git][9]. + +## Access the terminal + +There are [lots of terminal emulators][10] available. Although the Elisp terminal emulator in Emacs isn't the greatest general-purpose one, it's got two notable advantages. + + 1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job. + 2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash. + + + +To try the Emacs terminal, type **Alt**+**x** (**M-x** in Emacs notation), then type **shell**, and press **Return**. + +## Use Racket mode + +[Racket][11] is an exciting emerging Lisp dialect with a dynamic programming environment, a GUI toolkit, and a passionate community. The default editor when learning Racket is DrRacket, which has a Definitions panel at the top and an Interactions panel at the bottom. Using this setup, the user writes definitions that affect the Racket runtime. Imagine the old [Logo Turtle][12] program, but with a terminal instead of just a turtle. + +![Racket-mode][13] + +LGPL sample code by PLT + +Emacs, being based on Lisp, makes a great integrated development environment (IDE) for advanced Racket coders. It doesn't ship with [Racket mode][14] (yet), but you can install Racket mode and several other helper extensions using the Emacs package installer. To install it, press **Alt**+**X** (**M-x** in Emacs notation), type **package-install**, and press **Return**. Then enter the package you want to install (**racket-mode**), and press **Return**. + +Enter Racket mode with **M-x racket-mode**. If you're new to Racket but not to Lisp or Emacs, start with the excellent [Quick introduction to Racket with pictures][15]. + +## Scripting + +You might know that Bash scripts are popular for automating and enhancing your Linux or Unix experience. You may have heard that Python does a pretty good job of that, too. But did you know that Lisp scripts can be run in much the same way? There's sometimes confusion about just how useful Lisp really is because many people are introduced to Lisp through Emacs, so there's the latent impression that the only way to run Lisp in the 21st century is to open an Emacs window. Luckily, that's not the case at all, and Emacs is a great IDE for the tools that enable you to run Lisp scripts as general system executables. + +There are two popular modern Lisps, aside from Elisp, that are easy to run as standalone scripts. + + 1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient. + + 2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s +!# + +(display "hello world") +     (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme +;;; compiling /home/seth/./hello.scheme +;;; compiled [...]/hello.scheme.go +hello world +$ guile ./hello.scheme +hello world +``` +## Run Elisp without Emacs + +Emacs can serve as an Elisp runtime, but you don't have to "open" Emacs in the traditional sense. The **\--script** option allows you to run Elisp scripts using Emacs as the engine but without launching the Emacs GUI (not even its terminal-based one). In this example, the **-Q** option causes Emacs to ignore your **.emacs** file to avoid any delays in executing the Elisp script (if your script relies upon something \ No newline at end of file From 401400d510d8246a0de58aef3a11e684a6995c34 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Jan 2020 01:20:52 +0800 Subject: [PATCH 070/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200123=20Survey?= =?UTF-8?q?:=20Digital=20transformation=20can=20reveal=20network=20weaknes?= =?UTF-8?q?ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200123 Survey- Digital transformation can reveal network weaknesses.md --- ...formation can reveal network weaknesses.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/talk/20200123 Survey- Digital transformation can reveal network weaknesses.md diff --git a/sources/talk/20200123 Survey- Digital transformation can reveal network weaknesses.md b/sources/talk/20200123 Survey- Digital transformation can reveal network weaknesses.md new file mode 100644 index 0000000000..c03da59858 --- /dev/null +++ b/sources/talk/20200123 Survey- Digital transformation can reveal network weaknesses.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Survey: Digital transformation can reveal network weaknesses) +[#]: via: (https://www.networkworld.com/article/3516030/survey-digital-transformation-can-reveal-network-weaknesses.html) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +Survey: Digital transformation can reveal network weaknesses +====== +When enterprises embraced digital transformation, some found their existing networks had a limited ability to address cloud connectivity or access for mobile users. +Metamorworks / Getty Images + +[Digital transformation][1] is a catch-all phrase that describes the process of using technology to modernize or even revolutionize how services are delivered to customers. Not only technology but also people and processes commonly undergo fundamental changes for the ultimate goal of significantly improving business performance. + +Such transformations have become so mainstream that IDC estimated that 40% of all technology spending now goes toward digital transformation projects, with enterprises spending in excess of $2 trillion on their efforts through 2019. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +Every company’s digital transformation project is unique. Whether it’s transforming a company’s marketing and sales processes by using machine learning to garner deep insights on each and every customer, or building a seamless experience across sales channels and revamping distribution channels to provide the best products and resources to customers, a digital-transformation project is going to be dependent on as well as have an impact on the enterprise’s network infrastructure. + +[][3] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][3] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +Many companies assume their networks can handle these changes. But can they? Do these new ways of working strain the existing network infrastructure by imposing new requirements for agility, cloud access, security and mobility? + +### Gauging Confidence in the Network Post-Digital Transformation + +A recent survey of more than 1,300 IT professionals dared to ask about the impact of digital transformation on each respondent’s enterprise network. Having just conducted its fourth annual state of the WAN survey at the end of 2019, Cato Networks issued the report, [Networking in 2020: Understanding Digital Transformation’s Impact on IT Confidence in Enterprise Networks][4]_._ Steve Taylor, publisher and editor-in-chief of Webtorials.Com, and Dr. Jim Metzler, principal at Ashton, Metzler, and Associates, were instrumental in designing and the analyzing the results from the portion of the survey relating to digital transformation. There are some worthy observations here for network managers. + +The study looked at networking and security priorities for IT professional in 2020. As part of that process, the study sought to identify how ready enterprise networks are for the digital era. According to the report, “The modern business has data and users residing everywhere. And just as the enterprise network provided performance and security to data centers and branch offices in the past, so, too, it must provide performance and security to the cloud and mobile users—both hallmarks of digital initiatives.” Without a network that delivers the right infrastructure with the right performance and security levels anywhere, digital transformation efforts can run aground. + +1,333 respondents took part in the survey in late 2019. Qualified respondents were those who work in IT and are involved in the purchase of telco services for enterprises with an SD-WAN or MPLS backbone (or a mix of MPLS and Internet VPN). The vast majority of the respondents say they are moderately or extremely involved in their organization’s digital transformation initiatives. + +More than half of respondents identified working for companies with a global or regional footprint. Nearly half of respondents work for companies with more than 2,500 employees. The vast majority said their organization spans 11 or more locations, with a quarter of the respondents from companies with more than 100 locations. All respondents’ companies have some cloud presence and most have two or more physical [data centers][5]. + +To gauge the impact of digital transformation on the network, the survey asked a number of qualitative questions pertaining to network characteristics that include agility, security, performance, and management and operations. For each characteristic, the study looked at the “network confidence level”; that is, whether the respondent feels more or less confident in the network’s capabilities in that area following the deployment of the transformation project. The study segmented respondents by the type of network they operate—[MPLS][6], hybrid (MPLS and Internet-based VPN), [SD-WAN][7], or [SASE][8] (secure access service edge, pronounced “sassy”). SASE converges SD-WAN and other networking capabilities and a complete security stack into a global, cloud-native platform. (Disclosure: Report publisher Cato Networks delivers an SD-WAN service and also bills itself as the world’s first SASE platform.) + +**Overall Findings** + +I’ll get to the results about network confidence level in a moment. First let’s look at some general information disclosed in the report: + + * Budgets are growing in 2020. Respondents report that both their network and their security budgets are expected to grow in 2020. That’s good news, considering both areas are being asked to do more. + * Site connectivity continues to drive the major networking challenges for 2020. This includes bandwidth costs, performance between locations, and managing the network. + * Mobility is becoming strategic for network buyers. The importance of managing mobile and remote access grew significantly since the last annual survey. Addressing this need has become another top networking challenge. + * Security is an essential consideration for [WAN][9] transformation. Enterprises must have a multi-edge security strategy that includes defending against emerging threats like malware/ransomware, enforcing corporate security policies on mobile users, and full awareness of the cost of buying and managing security appliances and software. + * The most critical applications are now in the cloud. More than half (60%) of all respondents indicate that their organization’s most critical applications will be hosted in the cloud over the next 12 months. This has a huge impact on how users will access the cloud via their WAN. + * Digital initiatives are driving a rethinking of legacy networks. More than half of the respondents whose organizations still rely on MPLS say their organizations are actively planning to deploy SD-WAN in the next 12 months to lower costs and support new business initiatives. + + + +### Digital transformations rattle network confidence + +To better understand why enterprises are abandoning MPLS and what lessons can be derived for any WAN transformation initiatives, respondents were asked to rate a series of statements evaluating their perceptions of their networks’ agility, management and operations, performance, and security. The respondents were then grouped by their network in order to assess the change in network confidence pre- and post-digital transformation. + +With one exception, respondents express lower confidence in their networks post-digital transformation. This is true in areas of MPLS’s presumed strength, such as performance, and it’s even true for hybrid networks as well as for SD-WAN. As organizations roll out digital initiatives, they uncover the weaknesses in their existing networks, such as a limited ability to address cloud connectivity or mobile user access. + +According to the report, the only exception is when respondents run a SASE architecture. They express greater confidence post-digital transformation. SASE’s convergence of SD-WAN with security, cloud connectivity, and mobility is well suited for digital transformation but may only be appreciated when required by the business. + +Going back to the network characteristics of agility, security, performance, and management and operations, let’s look at how each one is perceived in terms of respondents’ network confidence. + + * Network agility – This characteristic includes the ability to add new sites, adjust available bandwidth, add cloud resources, and generally adapt quickly to changing business needs. It’s understandable that respondents with an MPLS-based network would rate their confidence in network agility as low, but confidence among respondents who deployed an SD-WAN dropped the most when asked about rapidly delivering new public cloud infrastructure. The opposite is also true: SASE’s built-in cloud connectivity is a major factor in respondents being more confident in their network agility post-digital transformation. + * Security – It’s critical to protect users and resources regardless of the underlying network. MPLS does not protect resources and users, and certainly not those connected to the Internet, leading MPLS-only respondents to be significantly less confident in their network’s security post-digital transformation. SD-WAN respondents also demonstrate lower confidence in security post-digital transformation, largely because SD-WAN on its own fails to restrict access to specific applications or provide the advanced security tools needed to protect all edges – mobile devices, sites, and cloud resources. By contrast, SASE confidence grew post-digital transformation. Converging a complete security stack into the network allows SASE to bring granular control to sites, mobile, and cloud resources. + * Performance – Delivering cloud resources presents problems for MPLS and SD-WAN. Users expect their cloud application experience to be as responsive as on-premises applications. This point plays a significant role in performance confidence. When asked if respondents can provide access to cloud-based resources with the performance and availability comparable to internally hosted resources, respondents with MPLS, hybrid WAN, and SD-WAN networks showed significant drop-off in confidence post-digital transformation. On the other hand, SASE solutions that include native cloud optimization improve cloud performance out-of-the-box, making those network owners more confident that they can deliver what users need. + * Management and operations – Respondent confidence was high before digital transformation but dropped off post-digital transformation across all network types except for SASE. According to the report, the lack of redundant last mile connections with MPLS leaves sites susceptible to cable cuts and other last mile problems. Adding Internet VPNs to MPLS improves last mile access but still does not allow organizations to automatically overcome last mile issues without downtime. SD-WAN and SASE are better able to overcome last mile issues with active/active configurations. + + + +Digital transformation initiatives can vastly change network traffic patterns, bandwidth requirements, access locations, and security needs. These changes might not be apparent until the project is fully deployed. Every organization needs a network infrastructure that provides adequate performance, security, agility and manageability to support digital initiatives, now and into the future. Some network architectures are better at providing those characteristics than others are. IT organizations that want to be confident in their network’s ability to meet the future need to consider areas such as cloud, mobility and especially security when transforming their WANs today. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3516030/survey-digital-transformation-can-reveal-network-weaknesses.html + +作者:[Linda Musthaler][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3512830/how-to-deal-with-the-impact-of-digital-transformation-on-networks.html +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://go.catonetworks.com/Survey-Networking-in-2020.html +[5]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[6]: https://www.networkworld.com/article/2297171/network-security-mpls-explained.html +[7]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[8]: https://www.networkworld.com/article/3453030/sase-is-more-than-a-buzzword-for-bioivt.html +[9]: https://www.networkworld.com/article/3248989/what-is-a-wan-wide-area-network-definition-and-examples.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From 6810ed8b5bdc3a9c7a9c116b7eef33d19a5157c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 24 Jan 2020 10:59:35 +0800 Subject: [PATCH 071/285] Translated --- ...03 Add scorekeeping to your Python game.md | 181 +++++++++--------- 1 file changed, 91 insertions(+), 90 deletions(-) rename {sources => translated}/tech/20200103 Add scorekeeping to your Python game.md (52%) diff --git a/sources/tech/20200103 Add scorekeeping to your Python game.md b/translated/tech/20200103 Add scorekeeping to your Python game.md similarity index 52% rename from sources/tech/20200103 Add scorekeeping to your Python game.md rename to translated/tech/20200103 Add scorekeeping to your Python game.md index 0bcfe955c7..4d2ba00a4f 100644 --- a/sources/tech/20200103 Add scorekeeping to your Python game.md +++ b/translated/tech/20200103 Add scorekeeping to your Python game.md @@ -7,56 +7,56 @@ [#]: via: (https://opensource.com/article/20/1/add-scorekeeping-your-python-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Add scorekeeping to your Python game +添加计分到你的 Python 游戏 ====== -In the tenth article in this series on programming with Python's Pygame -module, display your game player's score when they collect loot or take -damage. +In the tenth article in this series on programming with 在这一系列关于使用 Python 的 Pygame +模块编程的第 11 篇文章中,当你的玩家收集战利品或受到伤害时,显示你的玩家的得分。 ![connecting yellow dots in a maze][1] -This is part 10 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are: +这是仍在进行中的关于使用 [Pygame][3] 模块来在 [Python 3][2] 在创建电脑游戏的第十一部分。先前的文章是: - * [Learn how to program in Python by building a simple dice game][4] - * [Build a game framework with Python using the Pygame module][5] - * [How to add a player to your Python game][6] - * [Using Pygame to move your game character around][7] - * [What's a hero without a villain? How to add one to your Python game][8] - * [Simulate gravity in your Python game][9] - * [Add jumping to your Python platformer game][10] - * [Enable your Python game player to run forward and backward][11] - * [Using Python to set up loot in Pygame][12] + * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][4] + * [使用 Python 和 Pygame 模块构建一个游戏框架][5] + * [如何在你的 Python 游戏中添加一个玩家][6] + * [用 Pygame 使你的游戏角色移动起来][7] + * [如何向你的 Python 游戏中添加一个敌人][8] + * [在 Pygame 游戏中放置平台][19] + * [在你的 Python 游戏中模拟引力][9] + * [为你的 Python 平台类游戏添加跳跃功能][10] + * [使你的 Python 游戏玩家能够向前和向后跑][11] + * [在你的 Python 平台类游戏中放一些奖励][12] -If you've followed along with this series, you've learned all the essential syntax and patterns you need to create a video game with Python. However, it still lacks one vital component. This component isn't important just for programming games in Python; it's something you must master no matter what branch of computing you explore: Learning new tricks as a programmer by reading a language's or library's documentation. +如果你已经跟随这一系列很久,那么你已经学习你需要使用 Python 创建一个电脑游戏的所有的基本语法和样本。然而,它仍然缺少一个至关重要的组成部分。这一组成部分不仅仅对用 Python 编程游戏重要;不管你探究哪个计算机分支,你都必需精通:作为一个程序员,通过阅读一种语言的或库的文档来学习新的技巧。 -Luckily, the fact that you're reading this article is a sign that you're comfortable with documentation. For the practical purpose of making your platform game more polished, in this article, you will add a score and health display to your game screen. But the not-so-secret agenda of this lesson is to teach you how to find out what a library offers and how you can use new features. +幸运的是,事实上,你正在阅读的这篇文章是你适应阅读文档的一个标记。为了实现使你的平台类游戏更加优雅的实际目标,在这篇文章中,你将添加一个得分和健康状况显示到你游戏屏幕中。不过,教你如何找到一个库的功能以及如何使用这些新的功能的这节课程并不是如此神秘。 -### Displaying the score in Pygame +### 在 Pygame 中显示得分 -Now that you have loot that your player can collect, there's every reason to keep score so that your player sees just how much loot they've collected. You can also track the player's health so that when they hit one of the enemies, it has a consequence. +现在,你有你的玩家收集的奖励,这里有足够的正当理由来维持分数,以便你的玩家恰好看到他们收集了多少奖励。你也可以跟踪玩家的健康度,以便当他们击中一个敌人时,会有一个结果。 -You already have variables that track score and health, but it all happens in the background. This article teaches you to display these statistics in a font of your choice on the game screen during gameplay. +你已经有了跟踪分数和健康度的变量,但是这一切都发生在后台。这篇文章教你在游戏过程期间在游戏屏幕上以你选择的一种字体来显示这些统计数字。 -### Read the docs +### 阅读文档 -Most Python modules have documentation, and even those that do not can be minimally documented by Python's Help function. [Pygame's main page][13] links to its documentation. However, Pygame is a big module with a lot of documentation, and its docs aren't exactly written in the same approachable (and friendly and elucidating and helpful) narrative style as articles on Opensource.com. They're technical documents, and they list each class and function available in the module, what kind of inputs each expects, and so on. If you're not comfortable referring to descriptions of code components, this can be overwhelming. +大多数 Python 模块都有文档,即使那些没有文档的模块,也能通过 Python 的帮助功能来进行最小化地文档化。[Pygame 的主页面][13] 链接到它的文档。不过,Pygame 是一个带有很多文档的大模块,并且它的文档不像在 Opensource.com 上的文章一样,以同样的易理解的(友好地,易解释地,有用地)叙述样式准确地编写。它们是技术文档,并且它们列出在模块中可用的每个类和函数,每个要求输入的类型等等。如果你不适应参考代码组件描述,这可能令人不知所措的。 -The first thing to do, before bothering with a library's documentation, is to think about what you are trying to achieve. In this case, you want to display the player's score and health on the screen. +在烦恼一个库的文档前,第一件要做的事,就是来想想你正在尝试达到的目标。在这种情况下,你想在屏幕上显示玩家的得分和健康状况。 -Once you've determined your desired outcome, think about what components are required for it. You can think of this in terms of variables and functions or, if that doesn't come naturally to you yet, you can think generically. You probably recognize that displaying a score requires some text, which you want Pygame to draw on the screen. If you think it through, you might realize that it's not very different from rendering a player or loot or a platform on screen. +在你确定你需要的结果后,想想它需要什么的组件。你可以从变量和函数的方面考虑这一点,或者,如果你还没有自然地想到这一点,你可以考虑一般情况。你可能意识到需要一些文本来显示一个分数,你希望 Pygame 在屏幕上绘制这些文本。如果你彻头彻尾地思考,你可能会意识到它与在屏幕上渲染一个玩家或奖励或一个平台并多么大的不同。 -Technically, you _could_ use graphics of numbers and have Pygame display those. It's not the easiest way to achieve your goal, but if it's the only way you know, then it's a valid way. However, if you refer to Pygame's docs, you see that one of the modules listed is **font**, which is Pygame's method for making printing text on the screen as easy as typing. +从技术上讲,你 _可以_ 使用数字图形,并让 Pygame 显示这些数字图形。它不是达到你目标的最容易的方法,但是如果它是你唯一知道的方法,那么它是一个有效的方法。不过,如果你参考 Pygame 的文档,你看到列出的模块之一是 **font** ,这是 Pygame 使得在屏幕上来使打印文本像输入文字一样容易的方法。 -### Deciphering technical documentation +### 解密技术文档 -The **font** documentation page starts with **pygame.font.init()**, which it lists as the function that is used to initialize the font module. It's called automatically by **pygame.init()**, which you already call in your code. Once again, you've reached a point that that's technically _good enough_. While you don't know _how_ yet, you know that you _can_ use the **pygame.font** functions to print text on the screen. +**font** 文档页面以 **pygame.font.init()** 开始,它被列为用于初始化字体模块的函数。它由 **pygame.init()** 自动地调用,你已经在代码中调用了它。再强调一次,点,从技术上讲,你已经到达一个 _足够好_ 的点。虽然你尚不知道 _如何做_ ,你知道你 _能够_ 使用 **pygame.font** 函数来在屏幕上打印文本。 -If you read further, however, you find that there's yet an even better way to print fonts. The **pygame.freetype** module is described in the docs this way: +然而,如果你阅读更多一些,你会找到这里还有一种更好的方法来打印字体。**pygame.freetype** 模块被以这种方式描述在文档中: -> The pygame.freetype module is a replacement for pygame.fontpygame module for loading and rendering fonts. It has all of the functionality of the original, plus many new features. +> pygame.freetype 模块是 pygame.fontpygame 模块的一个替代品,用于加载和渲染字体。它有原函数的所有功能,外加很多新的功能。 -Further down the **pygame.freetype** documentation page, there's some sample code: +向下进一步到 **pygame.freetype** 文档页面,这里有一些样本代码: ``` @@ -64,7 +64,7 @@ import pygame import pygame.freetype ``` -Your code already imports Pygame, but modify your **import** statements to include the Freetype module: +你的代码应该导入 Pygame ,尽管如此,修改你的 **import** 语句以包含 Freetype 模块: ``` @@ -74,34 +74,34 @@ import os import pygame.freetype ``` -### Using a font in Pygame +### 在 Pygame 中使用一种字体 -From the description of the font modules, it's clear that Pygame uses a font, whether it's one you provide or a default font built into Pygame, to render text on the screen. Scroll through the **pygame.freetype** documentation to find the **pygame.freetype.Font** function: +从字体模块的描述开始,使用一种字体是很明显是,不管它的你提供的或内置到 Pygame 的默认字体,我在屏幕上渲染字体。滚动 **pygame.freetype** 文档来找到 **pygame.freetype.Font** 函数: ``` pygame.freetype.Font -Create a new Font instance from a supported font file. +从支持的字体文件中创建一个新的字体实例。 -Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font +Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font pygame.freetype.Font.name -  Proper font name. +  符合规则的字体名称。 pygame.freetype.Font.path -  Font file path +  字体文件路径。 pygame.freetype.Font.size -  The default point size used in rendering +  在渲染中使用的默认点大小 ``` -This describes how to construct a font "object" in Pygame. It may not feel natural to you to think of a simple object onscreen as the combination of several code attributes, but it's very similar to how you built your hero and enemy sprites. Instead of an image file, you need a font file. Once you have a font file, you can create a font object in your code with the **pygame.freetype.Font** function and then use that object to render text on the screen. +这描述了如何在 Pygame 中构建一个字体"对象"。你可能不太自然能把屏幕上的一个简单的对象考虑为一些代码属性的组合,但是它非常类似于你如何构建你的英雄和敌人精灵。你需要一个字体文件,而不是一个图像文件。在你有一个字体文件后,你可以在你的代码中使用 **pygame.freetype.Font** 函数来创建一个字体对象,然后使用该对象来在屏幕上渲染文本。 -Because not everyone in the world has the exact same fonts on their computers, it's important to bundle your chosen font with your game. To bundle a font, first create a new directory in your game folder, right along with the directory you created for your images. Call it **fonts**. +因为并不是世界上的每个人的电脑上都有完全一样的字体,将你选择的字体与你的游戏绑定在一起是很重要的。为绑定一种字体,首先在你的游戏文件夹中创建一个新的目录,恰好跟你为图像而创建的文件目录在一起。 称其为 **fonts** 。 -Even though several fonts come with your computer, it's not legal to give those fonts away. It seems strange, but that's how the law works. If you want to ship a font with your game, you must find an open source or Creative Commons font that permits you to give the font away along with your game. +虽然一些字体是随你的计算机操作系统一起提供,但是将这些字体给予其他人是非法的。这看起来很奇怪,但法律就是这样运作的。如果想与你的游戏一起随附一种字体,你必需找到一种开放源码或知识共享字体,它允许与你的游戏一起提供字体。 -Sites that specialize in free and legal fonts include: +专门提供自由和合法字体的网站包括: * [Font Library][14] * [Font Squirrel][15] @@ -109,20 +109,20 @@ Sites that specialize in free and legal fonts include: -When you find a font that you like, download it. Extract the ZIP or [TAR][17] file and move the **.ttf** or **.otf** file into the **fonts** folder in your game project directory. +当你找到你喜欢是字体后,下载下来。解压缩 ZIP 或 [TAR][17] 文件,并移动 **.ttf** 或 **.otf** 文件到你一下项目目录下的 **fonts** 文件夹中。 -You aren't installing the font on your computer. You're just placing it in your game's **fonts** folder so that Pygame can use it. You _can_ install the font on your computer if you want, but it's not necessary. The important thing is to have it in your game directory, so Pygame can "trace" it onto the screen. +你没有安装字体到你的计算机上。你只是放置字体到你游戏的 **fonts** 文件夹中,以便 Pygame 可以使用它。如果你想,你 _可以_ 在你的计算机上安装字体,但是它是没有必要的。重要的是字体在你的游戏目录中,这样 Pygame 可以 "描绘" 字体到屏幕上。 -If the font file has a complicated name with spaces or special characters, just rename it. The filename is completely arbitrary, and the simpler it is, the easier it is for you to type into your code. +如果字体有一个使用空格或特殊字符的复杂名称,只需要重新命名它。文件名称是完全任意的,并且对你来说,文件名称越简单,越任意将其键入你的代码中。 -Now tell Pygame about your font. From the documentation, you know that you'll get a font object in return when you provide at least the path to a font file to **pygame.freetype.Font** (the docs state explicitly that all remaining attributes are optional): +现在告诉 Pygame 关于你的字体。从文档中,你知道,当你至少提供一种字体文件的路径到 **pygame.freetype.Font** 时,你将在返回中获得一个字体对象(文档讲明所有剩余的属性都是可选的): ``` `Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font` ``` -Create a new variable called **myfont** to serve as your font in the game, and place the results of the **Font** function into that variable. This example uses the **amazdoom.ttf** font, but you can use whatever font you want. Place this code in your Setup section: +创建一个称为 **myfont** 的新变量来充当你在游戏中字体,并放置 **Font** 函数的结果到这个变量中。这个示例使用 **amazdoom.ttf** 字体,但是你可以使用任何你想使用的字体。在你的 Setup 部分放置这些代码: ``` @@ -131,11 +131,11 @@ font_size = tx myfont = pygame.freetype.Font(font_path, font_size) ``` -### Displaying text in Pygame +### 在 Pygame 中显示文本 -Now that you've created a font object, you need a function to draw the text you want onto the screen. This is the same principle you used to draw the background and platforms in your game. +现在你已经创建一个字体对象,你需要一个函数来绘制你想绘制到屏幕上的文本。这和你在你的游戏中绘制背景和平台是相同的原理。 -First, create a function, and use the **myfont** object to create some text, setting the color to some RGB value. This must be a global function; it does not belong to any specific class: +首先,创建一个函数,并使用 **myfont** 对象来创建一些文本,设置颜色到一些 RGB 值。这必需是一个全局函数;它不属于任何具体的类: ``` @@ -144,7 +144,7 @@ def stats(score,health):     myfont.render_to(world, (4, 72), "Health:"+str(health), WHITE, None, size=64) ``` -Of course, you know by now that nothing happens in your game if it's not in the Main loop, so add a call to your **stats** function near the bottom of the file: +当然,你此刻已经知道,如果它不在主循环中,你的游戏将不会发生任何事,所以在文件的底部房间添加一个调用到你的 **stats** 函数: ``` @@ -154,21 +154,21 @@ Of course, you know by now that nothing happens in your game if it's not in the     pygame.display.flip() ``` -Try your game. +尝试你的游戏。 -When the player collects loot, the score goes up. When the player gets hit by an enemy, health goes down. Success! +当玩家收集奖励品时,得分上升。当玩家被敌人击中时,健康值下降。成功! ![Keeping score in Pygame][18] -There is one problem, though. When a player gets hit by an enemy, health goes _way_ down, and that's not fair. You have just discovered a non-fatal bug. Non-fatal bugs are those little problems in applications that don't keep the application from starting up or even from working (mostly), but they either don't make sense, or they annoy the user. Here's how to fix this one. +不过,这里有一个问题。当一个玩家被敌人击中时,健康度会 _大量_ 下降,这是不公平的。你刚刚发现一个非致命的错误。非致命的错误是这些在应用程序中小问题,(通常)不要延迟应用程序启动,或者甚至停止工作,但是它们两者要么讲不通,要么惹恼用户。这里是如何解决这个问题的方法。 -### Fixing the health counter +### 修复健康度计数 -The problem with the current health point system is that health is subtracted for every tick of the Pygame clock that the enemy is touching the player. That means that a slow-moving enemy can take a player down to –200 health in just one encounter, and that's not fair. You could, of course, just give your player a starting health score of 10,000 and not worry about it; that would work, and possibly no one would mind. But there is a better way. +当前健康度点系统的问题是,敌人接触玩家时,Pygame 时钟的每一次滴答,健康度都会减少。这意味着一个缓慢移动的敌人可能在一次遭遇中将一个玩家降低健康度至 -200 ,这不公平。当然,你可以给你的玩家一个 10000 的起始健康度得分,而不用担心它;这可以工作,并且可能没有人会注意。但是这里有一个更好的方法。 -Currently, your code detects when a player and an enemy collide. The fix for the health-point problem is to detect _two_ separate events: when the player and enemy collide and, once they have collided, when they _stop_ colliding. +当前,你的代码侦查出一个玩家和一个敌人碰撞的时候。健康度点问题的修复是侦查出 _两个_ 独立的事件:什么时候玩家和敌人碰撞,并且,在它们碰撞后,什么时候它们 _停止_ 碰撞。 -First, in your Player class, create a variable to represent when a player and enemy have collided: +首先,在你的玩家类中,创建一个变量来显示一个玩家和敌人碰撞在一起的时间: ``` @@ -177,7 +177,7 @@ First, in your Player class, create a variable to represent when a player and en         self.damage = 0 ``` -In the update function of your Player class, _remove_ this block of code: +在你的玩家类的更新函数中, _移除_ 这块代码块: ``` @@ -186,7 +186,7 @@ In the update function of your Player class, _remove_ this block of code:             #print(self.health) ``` -And in its place, check for collision as long as the player is not currently being hit: +并且在它的位置,只要玩家当前没有被击中,检查碰撞: ``` @@ -196,15 +196,15 @@ And in its place, check for collision as long as the player is not currently bei                     self.damage = self.rect.colliderect(enemy) ``` -You might see similarities between the block you deleted and the one you just added. They're both doing the same job, but the new code is more complex. Most importantly, the new code runs only if the player is not _currently_ being hit. That means that this code runs once when a player and enemy collide and not constantly for as long as the collision happens, the way it used to. +你可能会在你删除的语句块和你刚刚添加的语句块之间看到相似之处。它们都在做相同的工作,但是新的代码更复杂。最重要的是,只有当玩家 _当前_ 没有被击中时,新的代码运行。这意味着,当一个玩家和敌人碰撞时,这些代码运行一次,而不是像以前那样一直发生碰撞。 -The new code uses two new Pygame functions. The **self.rect.contains** function checks to see if an enemy is currently within the player's bounding box, and **self.rect.colliderect** sets your new **self.damage** variable to one when it is true, no matter how many times it is true. +新的代码使用两个新的 Pygame 函数。**self.rect.contains** 函数检查一个敌人当前是否在玩家的边界框内,并且当它是 true 时, **self.rect.colliderect** 设置你的新的 **self.damage** 变量为 1 ,而不管它多少次是 true 。 -Now even three seconds of getting hit by an enemy still looks like one hit to Pygame. +现在,即使被一个敌人击中 3 秒,对 Pygame 来说仍然看作一次击中。 -I discovered these functions by reading through Pygame's documentation. You don't have to read all the docs at once, and you don't have to read every word of each function. However, it's important to spend time with the documentation of a new library or module that you're using; otherwise, you run a high risk of reinventing the wheel. Don't spend an afternoon trying to hack together a solution to something that's already been solved by the framework you're using. Read the docs, find the functions, and benefit from the work of others! +我通过通读 Pygame 的文档而发现这些函数。你没有必要一次阅读完全部的文档,并且你也没有必要阅读每个函数的每个单词。不过,花费时间在你正在使用的新的库或模块的文档上是很重要的;否则,你将面临重新发明轮子的高风险。不要花费一个下午的时间来尝试修改拼接一个解决方案到一些东西,这些东西已经被你正在使用的框架的所解决。阅读文档,知悉函数,并从别人的工作中获益! -Finally, add another block of code to detect when the player and the enemy are no longer touching. Then and only then, subtract one point of health from the player. +最后,添加另一个代码语句块来侦查出什么时候玩家和敌人不再接触。只要那时,从玩家减少一点健康度点。 ``` @@ -215,19 +215,19 @@ Finally, add another block of code to detect when the player and the enemy are n                 self.health -= 1  # subtract 1 hp ``` -Notice that this new code gets triggered _only_ if the player has been hit. That means this code doesn't run while your player is running around your game world exploring or collecting loot. It only runs when the **self.damage** variable gets activated. +注意,_只有_ 当玩家被击中时,这个新的代码才会被触发。这意味着,在你的玩家在你的游戏世界正在探索或收集奖励时,这个代码不会运行。它仅当 **self.damage** 变量被激活时运行。 -When the code runs, it uses **self.rect.collidelist** to see whether or not the player is _still_ touching an enemy in your enemy list (**collidelist** returns negative one when it detects no collision). Once it is not touching an enemy, it's time to pay the **self.damage** debt: deactivate the **self.damage** variable by setting it back to zero and subtract one point of health. +当代码运行时,它使用 **self.rect.collidelist** 来查看玩家是否 _仍然_ 接触在你敌人列表中的一个敌人(当其未侦查到碰撞时,**collidelist** 返回 -1 )。在它没有接触一个敌人时,是来偿还 **self.damage** 负债的时机:通过设置 **self.damage** 变量回到 0 来使其无效,并减少一点健康度点。 -Try your game now. +现在尝试你的游戏。 -### Score reaction +### 得分反应 -Now that you have a way for your player to know their score and health, you can make certain events occur when your player reaches certain milestones. For instance, maybe there's a special loot item that restores some health points. And maybe a player who reaches zero health points has to start back at the beginning of a level. +现在,你有一个来让你的玩家知道它们分数和健康度的方法,当你的玩家达到某些里程碑时,你可以确保某些事件发生。例如,也许这里有一个特殊的恢复一些健康度点的奖励项目。也许一个到达 0 健康度点的玩家不得不从一个等级的起始位置重新开始。 -You can check for these events in your code and manipulate your game world accordingly. You already know how, so go skim the documentation for new tricks and try them out on your own. +你可以在你的代码中检查这些事件,并且相应地控制你的游戏世界。你也知道怎么做,所以去浏览文档来寻找新的技巧,并且独立地尝试这些技巧。 -Here's all the code so far: +这里是到目前为止所有的代码: ``` @@ -297,7 +297,7 @@ class Player(pygame.sprite.Sprite):     def gravity(self):         self.movey += 3.2 # how fast player falls         -        if self.rect.y > worldy and self.movey >= 0: +        if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty         @@ -317,16 +317,16 @@ class Player(pygame.sprite.Sprite):         self.rect.y = self.rect.y + self.movey         # moving left -        if self.movex < 0: +        if self.movex < 0:             self.frame += 1 -            if self.frame > ani*3: +            if self.frame > ani*3:                 self.frame = 0             self.image = self.images[self.frame//ani]         # moving right -        if self.movex > 0: +        if self.movex > 0:             self.frame += 1 -            if self.frame > ani*3: +            if self.frame > ani*3:                 self.frame = 0             self.image = self.images[(self.frame//ani)+4] @@ -353,7 +353,7 @@ class Player(pygame.sprite.Sprite):         for p in plat_hit_list:             self.collide_delta = 0 # stop jumping             self.movey = 0 -            if self.rect.y > p.rect.y: +            if self.rect.y > p.rect.y:                 self.rect.y = p.rect.y+ty             else:                 self.rect.y = p.rect.y-ty @@ -363,11 +363,11 @@ class Player(pygame.sprite.Sprite):             self.movey = 0             self.rect.y = worldy-ty-ty             self.collide_delta = 0 # stop jumping -            if self.rect.y > g.rect.y: +            if self.rect.y > g.rect.y:                 self.health -=1                 print(self.health)                 -        if self.collide_delta < 6 and self.jump_delta < 6: +        if self.collide_delta < 6 and self.jump_delta < 6:             self.jump_delta = 6*2             self.movey -= 33  # how high to jump             self.collide_delta += 6 @@ -398,22 +398,22 @@ class Enemy(pygame.sprite.Sprite):         self.movey += 3.2         -        if self.counter >= 0 and self.counter <= distance: +        if self.counter >= 0 and self.counter <= distance:             self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: +        elif self.counter >= distance and self.counter <= distance*2:             self.rect.x -= speed         else:             self.counter = 0                 self.counter += 1 -        if not self.rect.y >= worldy-ty-ty: +        if not self.rect.y >= worldy-ty-ty:             self.rect.y += self.movey         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False)         for p in plat_hit_list:             self.movey = 0 -            if self.rect.y > p.rect.y: +            if self.rect.y > p.rect.y:                 self.rect.y = p.rect.y+ty             else:                 self.rect.y = p.rect.y-ty @@ -450,7 +450,7 @@ class Level():         ground_list = pygame.sprite.Group()         i=0         if lvl == 1: -            while i < len(gloc): +            while i < len(gloc):                 ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png')                 ground_list.add(ground)                 i=i+1 @@ -469,9 +469,9 @@ class Level():             ploc.append((300,worldy-ty-256,3))             ploc.append((500,worldy-ty-128,4)) -            while i < len(ploc): +            while i < len(ploc):                 j=0 -                while j <= ploc[i][2]: +                while j <= ploc[i][2]:                     plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png')                     plat_list.add(plat)                     j=j+1 @@ -528,7 +528,7 @@ font_size = tx myfont = pygame.freetype.Font(font_path, font_size)     i=0 -while i <= (worldx/tx)+tx: +while i <= (worldx/tx)+tx:     gloc.append(i*tx)     i=i+1 @@ -570,7 +570,7 @@ while main == True:                 main = False     # scroll the world forward -    if player.rect.x >= forwardx: +    if player.rect.x >= forwardx:         scroll = player.rect.x - forwardx         player.rect.x = forwardx         for p in plat_list: @@ -582,7 +582,7 @@ while main == True:             l.rect.x -= scroll                     # scroll the world backward -    if player.rect.x <= backwardx: +    if player.rect.x >= backwardx:         scroll = backwardx - player.rect.x         player.rect.x = backwardx         for p in plat_list: @@ -613,7 +613,7 @@ via: https://opensource.com/article/20/1/add-scorekeeping-your-python-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[robsean](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -638,3 +638,4 @@ via: https://opensource.com/article/20/1/add-scorekeeping-your-python-game [16]: https://www.theleagueofmoveabletype.com/ [17]: https://opensource.com/article/17/7/how-unzip-targz-file [18]: https://opensource.com/sites/default/files/uploads/pygame-score.jpg (Keeping score in Pygame) +[19]:https://opensource.com/article/18/7/put-platforms-python-game From d22b605d1b67f7446cb823dbd1baad7f99a074a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 24 Jan 2020 11:03:37 +0800 Subject: [PATCH 072/285] Translating --- ...nable your Python game player to run forward and backward.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191211 Enable your Python game player to run forward and backward.md b/sources/tech/20191211 Enable your Python game player to run forward and backward.md index fb9b020278..bde74f1526 100644 --- a/sources/tech/20191211 Enable your Python game player to run forward and backward.md +++ b/sources/tech/20191211 Enable your Python game player to run forward and backward.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9b360278ecb3a267a217a68f592bfa48a4de3af1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Jan 2020 00:52:40 +0800 Subject: [PATCH 073/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200124=20Thunde?= =?UTF-8?q?rbolt=20=E2=80=93=20how=20to=20use=20keyboard=20during=20boot?= =?UTF-8?q?=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200124 Thunderbolt - how to use keyboard during boot time.md --- ... - how to use keyboard during boot time.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20200124 Thunderbolt - how to use keyboard during boot time.md diff --git a/sources/tech/20200124 Thunderbolt - how to use keyboard during boot time.md b/sources/tech/20200124 Thunderbolt - how to use keyboard during boot time.md new file mode 100644 index 0000000000..d8fc2ae581 --- /dev/null +++ b/sources/tech/20200124 Thunderbolt - how to use keyboard during boot time.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Thunderbolt – how to use keyboard during boot time) +[#]: via: (https://fedoramagazine.org/thunderbolt-how-to-use-keyboard-during-boot-time/) +[#]: author: (Martin Sehnoutka https://fedoramagazine.org/author/msehnout/) + +Thunderbolt – how to use keyboard during boot time +====== + +![][1] + +### Problem statement + +Imagine you bought a new laptop with a shiny new USB-C docking station. You install fresh Fedora, encrypt your hard drive because laptop is a travel equipment and you do not want to travel around with non-ecrypted hard drive. You finish the installation, close the lid because you have external monitor, reboot the machine, and finally you would like to enter the LUKS password using the external keyboard attached using USB 2.0 to the USB-C docking station but it does not work! + +The keyboard does not respond at all. So you open the lid, try the built-in keyboard which works just fine and once the machine boots the external keyboard works just fine as well. What is the problem? + +### What is this Thunderbolt anyway and why would anyone want it? + +Thunderbolt is a hardware interface to connect peripherals such as monitors, external network cards [1] or even graphic cards [1]. The physical connector is the same as USB-C, but there is usually a label with a little lightning right next to the port to differentiate “plain” USB-C from Thunderbolt ports. + +![][2] + +Of course it comes with very high transmission speed to support such demanding peripherals, but it also comes with a certain security risks. To achieve transmission speed like this, Thunderbolt uses Direct Memory Access (DMA) for the peripheral devices. As the name suggests, this method allows the external device to read and write memory directly without talking to the running operating system. + +I guess you can already spot the problem here. If some stranger is walking around my laptop (even with the screen locked), is it really possible to just attach a device and read content of my computer memory? Let’s discuss it in more detail. + +### User facing solution for Thunderbolt security + +In the recent versions, Gnome settings include a tab for Thunderbolt device configuration. You can enable and disable DMA access for external devices and you can also verify identity of the devices. + +![][3] + +_bolt_ is the component responsible for managing thunderbolt devices. See _man 8 boltd_ for more information. + +### CLI tools + +Of course it is possible to control the same via command line. I suggest you to read _man boltctl_ or check the upstream repository directly: + +### Pre-boot support – solution to the keyboard problem + +In pre-boot environment, the situation is slightly different. The userspace service responsible for device verification is not yet running so if a device is to be allowed, the firmware must to it. In order to enable this feature go to your BIOS and look for “support in pre boot environment”. For example this is how it looks on a Lenovo laptop: + +![][4] + +Once you enable this feature, bolt will add any verified device to a list of allowed devices. The next time you boot your machine, you should be able to use your external keyboard. + +Run _boltctl_ a look for “bootacl”. Make sure that the list of allowed devices contains the one you wish to use. + +![][5] + +Also note the “security: secure” line. If you see anything else, for instance “security: user” I recommend to reconfigure BIOS. + +### Technical details of the pre-boot support + +There is one unfortunate technical detail about this solution. Thunderbolt support different security levels. For running Fedora, I recommend you to use “secure” level to verify that the device is indeed the one that it claims to be by using a per-device key generated by the host and stored in the device. Firmware, on the other hand, will only use “user” level which uses simple UUID that is provided by the device. The difference is that a malicious device could claim to be a different one by providing the same UUID as a legitimate one. Anyway this should not be a problem as the memory does not contain any sensitive data yet. + +You can find more technical details in this blog post: + +### Conclusion + +As you can see, in recent enough Fedora version the solution is a simple switch in BIOS. So if you are still opening your laptop during boot, go ahead and configure it so you don’t have to do it next time. Meanwhile **check that the default security level is “secure”** instead of “user” [5]. + +### Sources: + +[1] + +[2] + +[3] + +[4] + +[5] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/thunderbolt-how-to-use-keyboard-during-boot-time/ + +作者:[Martin Sehnoutka][a] +选题:[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/msehnout/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/header-816x345.png +[2]: https://fedoramagazine.org/wp-content/uploads/2020/01/port-1024x165.jpg +[3]: https://fedoramagazine.org/wp-content/uploads/2020/01/Screenshot-from-2020-01-17-12-47-30.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/01/bios-1024x389.jpg +[5]: https://fedoramagazine.org/wp-content/uploads/2020/01/Screenshot-from-2020-01-17-13-18-21.png From ec5e2394feaa73597986d6bd75d504e640cea35b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Jan 2020 00:56:20 +0800 Subject: [PATCH 074/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200125=20Oh,=20?= =?UTF-8?q?Bummer!=20Rocket=20League=20is=20Ending=20Support=20For=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200125 Oh, Bummer- Rocket League is Ending Support For Linux.md --- ...cket League is Ending Support For Linux.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20200125 Oh, Bummer- Rocket League is Ending Support For Linux.md diff --git a/sources/tech/20200125 Oh, Bummer- Rocket League is Ending Support For Linux.md b/sources/tech/20200125 Oh, Bummer- Rocket League is Ending Support For Linux.md new file mode 100644 index 0000000000..ab18ff6d7a --- /dev/null +++ b/sources/tech/20200125 Oh, Bummer- Rocket League is Ending Support For Linux.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Oh, Bummer! Rocket League is Ending Support For Linux) +[#]: via: (https://itsfoss.com/rocket-league-ending-support-for-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Oh, Bummer! Rocket League is Ending Support For Linux +====== + +If you’ve enjoyed playing Rocket League on Linux, you will be disappointed to know that [Pysonix][1], the developer team behind Rocket League [announced][2] that they will be dropping support for Linux and Mac in March, 2020. + +If it was just another casual game on [Steam][3], I wouldn’t mind- but Rocket League is a quite popular online multiplayer game across every platform. + +![][4] + +In fact, Rocket League was one of my [favorite games to play on Linux][5] (in addition to CS: GO). Even though I haven’t played it for a while – it is a bummer that I won’t be able to play it either. + +So, this is definitely sad for Linux gamers who were looking forward to having fun in a popular online multiplayer game that required a decent hardware configuration to work flawlessly. + +### Why are they ending support? + +![][6] + +In their [announcement][2], they mentioned: + +> As we continue to upgrade _**Rocket League**_ with new technologies, it is no longer viable for us to maintain support for the macOS and Linux (SteamOS) platforms. As a result, the final patch for the macOS and Linux versions of the game will be in March. This update will disable online functionality (such as in-game purchases) for players on macOS and Linux, but offline features including Local Matches, and splitscreen play will still be accessible. + +Well, this certainly does not explain why they’re dropping support for Linux/Mac. But, it looks like the game will get its final patches in March. + +**After that, you will not be able to play multiplayer sessions – but will be restricted to the local multiplayer sessions (or split-screen)**. + +Maybe you can try using [Wine][7] or [Steam Play][8] to play it on Linux? Doesn’t sound good though. + +Some furious users/gamers on [Reddit][9] mentioned that this is a result of Epic Games acquiring Rocket League developer **Psyonix**. I wouldn’t comment on that one – feel free to share your thoughts in the comments though. + +### How to get a refund for your Rocket League purchase + +![][10] + +To get a refund for your purchase of the Rocket League, you need to open a ticket on the [Psyonix Support][11] page. + +If you’ve purchased it recently in the ongoing Steam sale – you might just get an instant refund from Steam if you initiate a refund. + +If you have no plans to play it on a Windows machine (or trying Proton/Wine) on Linux – you should apply for a refund. + +**Wrapping Up** + +While this may not be a big-shot game for the platform but dropping support for Linux is not helping to improve the gaming scene on Linux. + +If a game that worked quite well on Linux drops support for it – how can we expect newer games to consider adding support for Linux? + +Feel free to share your thoughts in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/rocket-league-ending-support-for-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.psyonix.com/ +[2]: https://www.rocketleague.com/news/ending-support-for-mac-and-linux/ +[3]: https://store.steampowered.com/app/252950/Rocket_League/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/rocket-league.jpg?ssl=1 +[5]: https://itsfoss.com/free-linux-games/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/rocket-league-shot.jpg?ssl=1 +[7]: https://itsfoss.com/use-windows-applications-linux/ +[8]: https://itsfoss.com/steam-play/ +[9]: https://www.reddit.com/r/linux/comments/esxil2/support_for_rocket_league_on_linux_is_ending/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/rocket-league-refund.jpg?ssl=1 +[11]: https://support.rocketleague.com/hc/en-us From 2c84e1cbe77f553d86707d5fd0b035b933faf1db Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Jan 2020 00:56:40 +0800 Subject: [PATCH 075/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200124=20Run=20?= =?UTF-8?q?multiple=20consoles=20at=20once=20with=20this=20open=20source?= =?UTF-8?q?=20window=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200124 Run multiple consoles at once with this open source window environment.md --- ...ith this open source window environment.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20200124 Run multiple consoles at once with this open source window environment.md diff --git a/sources/tech/20200124 Run multiple consoles at once with this open source window environment.md b/sources/tech/20200124 Run multiple consoles at once with this open source window environment.md new file mode 100644 index 0000000000..97c2849b60 --- /dev/null +++ b/sources/tech/20200124 Run multiple consoles at once with this open source window environment.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run multiple consoles at once with this open source window environment) +[#]: via: (https://opensource.com/article/20/1/multiple-consoles-twin) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Run multiple consoles at once with this open source window environment +====== +Simulate the old-school DESQview experience with twin in the fourteenth +in our series on 20 ways to be more productive with open source in 2020. +![Digital creative of a browser on the internet][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Overcome "one screen, one app" limits with twin + +Who remembers [DESQview][2]? It allowed for things in DOS we take for granted now in Windows, Linux, and MacOS—namely the ability to run and have multiple programs running onscreen at once. In my early days running a dial-up BBS, DESQview was a necessity—it enabled me to have the BBS running in the background while doing other things in the foreground. For example, I could be working on new features or setting up new external programs while someone was dialed in without impacting their experience. Later, in my early days in support, I could have my work email ([DaVinci email on MHS][3]), the support ticket system, and other DOS programs running all at once. It was amazing! + +![twin][4] + +Running multiple console applications has come a long way since then. But applications like [tmux][5] and [Screen][6] still follow the "one screen, one app" kind of display. OK, yes, tmux has screen splitting and panes, but not like DESQview, with the ability to "float" windows over others, and I, for one, miss that. + +Enter [twin][7], the text-mode window environment. This relatively young project is, in my opinion, a spiritual successor to DESQview. It supports console and graphical environments, as well as the ability to detach from and reattach to sessions. It's not as easy to set up as some things, but it will run on most modern operating systems. + +Twin is installed from source (for now). But first, you need to install the required development libraries. The library names will vary by operating system. The following example shows it for my Ubuntu 19.10 installation. Once the libraries are installed, check out the twin source from Git and run **./configure** and **make**, which should auto-detect everything and build twin: + + +``` +sudo apt install libx11-dev libxpm-dev libncurses-dev zlib1g-dev libgpm-dev +git clone [git@github.com][8]:cosmos72/twin.git +cd twin +./configure +make +sudo make install +``` + +Note: If you are compiling this on MacOS or BSD, you will need to comment out **#define socklen_t int** in the files **include/Tw/autoconf.h** and **include/twautoconf.h** before running **make**. This should be addressed by [twin issue number 57][9]. + +![twin text mode][10] + +Invoking twin for the first time can be a bit of a challenge. You need to tell it what kind of display it is using with the **\--hw** parameter. For example, to launch a text-mode version of twin, you would enter **twin --hw=tty,TERM=linux**. The **TERM** variable specifies an override to the current terminal variable in your shell. To launch a graphical version, run **twin --hw=X@$DISPLAY**. On Linux, twin mostly "just works," and on MacOS, it mostly only works in terminals. + +The _real_ fun comes with the ability to attach to running sessions with the **twattach** and **twdisplay** commands. They allow you to attach to a running twin session somewhere else. For example, on my Mac, I can run the following command to connect to the twin session running on my demo box: + + +``` +`twdisplay --twin@20days2020.local:0 --hw=tty,TERM=linux` +``` + +![remote twin session][11] + +With some extra work, you can also use it as a login shell in place of [getty][12] on consoles. This requires the gdm mouse daemon, the twdm application (included), and a little extra configuration. On systems that use systemd, start by installing and enabling gdm (if it isn't already installed). Then use systemctl to create an override for a console (I used tty6). The commands must be run as the root user; on Ubuntu, they look something like this: + + +``` +apt install gdm +systemctl enable gdm +systemctl start gdm +systemctl edit getty@tty6 +``` + +The **systemctl edit getty@tty6** command will open an empty file named **override.conf**. This defines systemd service settings to override the default for console 6. Update the contents to: + + +``` +[service] +ExecStart= +ExecStart=-/usr/local/sbin/twdm --hw=tty@/dev/tty6,TERM=linux +StandardInput=tty +StandardOutput=tty +``` + +Now, reload systemd and restart tty6 to get a twin login prompt: + + +``` +systemctl daemon-reload +systemctl restart getty@tty6 +``` + +![twin][13] + +This will launch a twin session for the user who logs in. I do not recommend this for a multi-user system, but it is pretty cool for a personal desktop. And, by using **twattach** and **twdisplay**, you can access that session from the local GUI or remote desktops. + +I think twin is pretty darn cool. It has some rough edges, but the basic functionality is there, and it has some pretty good documentation. Also, it scratches the itch I have for a DESQview-like experience on modern operating systems. I look forward to improvements over time, and I hope you like it as much as I do. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/multiple-consoles-twin + +作者:[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_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://en.wikipedia.org/wiki/DESQview +[3]: https://en.wikipedia.org/wiki/Message_Handling_System +[4]: https://opensource.com/sites/default/files/uploads/productivity_14-1.png (twin) +[5]: https://github.com/tmux/tmux/wiki +[6]: https://www.gnu.org/software/screen/ +[7]: https://github.com/cosmos72/twin +[8]: mailto:git@github.com +[9]: https://github.com/cosmos72/twin/issues/57 +[10]: https://opensource.com/sites/default/files/uploads/productivity_14-2.png (twin text mode) +[11]: https://opensource.com/sites/default/files/uploads/productivity_14-3.png (remote twin session) +[12]: https://en.wikipedia.org/wiki/Getty_(Unix) +[13]: https://opensource.com/sites/default/files/uploads/productivity_14-4.png (twin) From 71e9c5a46c47046a5e318fceef29a6cac4b5d88e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Jan 2020 00:57:11 +0800 Subject: [PATCH 076/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200124=203=20ha?= =?UTF-8?q?ndy=20command-line=20internet=20speed=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200124 3 handy command-line internet speed tests.md --- ...handy command-line internet speed tests.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20200124 3 handy command-line internet speed tests.md diff --git a/sources/tech/20200124 3 handy command-line internet speed tests.md b/sources/tech/20200124 3 handy command-line internet speed tests.md new file mode 100644 index 0000000000..ed9bdee828 --- /dev/null +++ b/sources/tech/20200124 3 handy command-line internet speed tests.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 handy command-line internet speed tests) +[#]: via: (https://opensource.com/article/20/1/internet-speed-tests) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +3 handy command-line internet speed tests +====== +Check your internet and network speeds with these three open source +tools. +![Old train][1] + +Being able to validate your network connection speed puts you in control of your computer. Three open source tools that enable you to check your internet and network speeds at the command line are Speedtest, Fast, and iPerf. + +### Speedtest + +[Speedtest][2] is an old favorite. It's implemented in Python, packaged in Apt, and also available with pip. You can use it as a command-line tool or within a Python script. + +Install it with: + + +``` +`sudo apt install speedtest-cli` +``` + +or + + +``` +`sudo pip3 install speedtest-cli` +``` + +Then run it with the command **speedtest**: + + +``` +$ speedtest +Retrieving speedtest.net configuration... +Testing from CenturyLink (65.128.194.58)... +Retrieving speedtest.net server list... +Selecting best server based on ping... +Hosted by CenturyLink (Cambridge, UK) [20.49 km]: 31.566 ms +Testing download speed................................................................................ +Download: 68.62 Mbit/s +Testing upload speed...................................................................................................... +Upload: 10.93 Mbit/s +``` + +This gives you your download and upload Internet speeds. It's fast and scriptable, so you can run it regularly and save the output to a file or database for a record of your network speed over time. + +### Fast + +[Fast][3] is a service provided by Netflix. Its web interface is located at [Fast.com][4], and it has a command-line interface available through npm: + + +``` +`npm install --global fast-cli` +``` + +Both the website and command-line utility provide the same basic interface: it's a simple-as-possible speed test: + + +``` +$ fast + +     82 Mbps ↓ +``` + +The command returns your Internet download speed. To get your upload speed, use the **-u** flag: + + +``` +$ fast -u + +   ⠧ 80 Mbps ↓ / 8.2 Mbps ↑ +``` + +### iPerf + +[iPerf][5] is a great way to test your LAN speed (rather than your Internet speed, as the two previous tools do). Debian, Raspbian, and Ubuntu users can install it with **apt**: + + +``` +`sudo apt install iperf` +``` + +It's also available for Mac and Windows. + +Once it's installed, you need two machines on the same network to use it (both must have iPerf installed). Designate one as the server. + +Obtain the IP address of the server machine: + + +``` +`ip addr show | grep inet.*brd` +``` + +Your local IP address (assuming an IPv4 local network) starts with either **192.168** or **10**. Take note of the IP address so you can use it on the other machine (the one designated as the client). + +Start **iperf** on the server: + + +``` +`iperf -s` +``` + +This waits for incoming connections from clients. Designate another machine as a client and run this command, substituting the IP address of your server machine for the sample one here: + + +``` +`iperf -c 192.168.1.2` +``` + +![iPerf][6] + +It only takes a few seconds to do a test, and it returns the transfer size and calculated bandwidth. I ran a few tests from my PC and my laptop, using my home server as the server machine. I recently put in Cat6 Ethernet around my house, so I get up to 1Gbps speeds from my wired connections but much lower speeds on WiFi connections. + +![iPerf][7] + +­You may notice where it recorded 16Gbps. That was me using the server to test itself, so it's just testing how fast it can write to its own disk. The server has hard disk drives, which are only 16Gbps, but my desktop PC gets 46Gbps, and my (newer) laptop gets over 60Gbps, as they have solid-state drives. + +![iPerf][8] + +### Wrapping up + +Knowing the speed of your network is a rather straightforward task with these tools. If you prefer to script or run these from the command line for the fun of it, any of the above projects will get you there. If you're after specific point-to-point metrics, iPerf is your go-to. + +What other tools do you use to measure the network at home? Share in the comments. + +* * * + +_This article was originally published on Ben Nuttall's [Tooling blog][9] and is used here with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/internet-speed-tests + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/train-plane-speed-big-machine.png?itok=f377dXKs (Old train) +[2]: https://github.com/sivel/speedtest-cli +[3]: https://github.com/sindresorhus/fast-cli +[4]: https://fast.com/ +[5]: https://iperf.fr/ +[6]: https://opensource.com/sites/default/files/uploads/iperf.png (iPerf) +[7]: https://opensource.com/sites/default/files/uploads/iperf2.png (iPerf) +[8]: https://opensource.com/sites/default/files/uploads/iperf3.png (iPerf) +[9]: https://tooling.bennuttall.com/command-line-speedtest-tools/ From 6d3e3b8c4914f97906463d45d790b43e8364c625 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Jan 2020 00:57:46 +0800 Subject: [PATCH 077/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200124=20Gartne?= =?UTF-8?q?r:=20Data-center=20spending=20will=20inch=20up=20this=20year?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200124 Gartner- Data-center spending will inch up this year.md --- ...-center spending will inch up this year.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/talk/20200124 Gartner- Data-center spending will inch up this year.md diff --git a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md new file mode 100644 index 0000000000..03fbef5355 --- /dev/null +++ b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Gartner: Data-center spending will inch up this year) +[#]: via: (https://www.networkworld.com/article/3515314/data-center-spending-will-inch-up-in-year-of-accelerated-it-investment-gartner.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Gartner: Data-center spending will inch up this year +====== +After a down year in 2019, IT spending will pick up this year, led by enterprise software and the cloud, according to IT research firm Gartner, including an uptick for data-center spending that had takend a dip. +Getty Images + +Global IT spending could reach $3.865 trillion in 2020, up 3.4% over 2019, according to newly released data from IT research firm Gartner. In comparison, 2019 saw just 0.5% growth over 2018 levels. Spending is expected to continue to climb into 2021, surpassing the $4 trillion mark with 3.7% growth. + +Spending on hardware – including edge devices and data center hardware – will be deemphasized, while investments in software and services, including cloud, will see an increase, the firm predicts. + +**READ MORE:** [Data centers in 2020 will feature greater automation, cheaper memory][1] + +"With the waning of global uncertainties, businesses are redoubling investments in IT as they anticipate revenue growth, but their spending patterns are continually shifting," said John-David Lovelock, distinguished research vice president at Gartner, in a statement. + +After a decline of 2.7% in 2019, data center systems sales will grow 1.9% in 2020, while devices – everything from laptops to printers to smartphones – will rise just 0.8% in 2020 after a 4.3% decline in 2019. + +IT services will rise 5.0%, increasing its momentum over 2019, which saw a rise of 3.6%. But the real action will be in enterprise software, which is expected to grow 10.5% this year. This includes both on-premises software (such as Microsoft, Oracle) and cloud services. More of the spending growth is aimed at SaaS than on-premises software, Gartner notes. + +"Almost all of the market segments with enterprise software are being driven by the adoption of software as a service (SaaS)," Lovelock said. "We even expect spending on forms of software that are not cloud to continue to grow, albeit at a slower rate. SaaS is gaining more of the new spending, although licensed-based software will still be purchased and its use expanded through 2023." + +In a conference call with clients, Lovelock said there has been a shift over the last three years, where the world is going from "'we like all tech' to 'we like softer tech and not all tech.'" The trend is toward consulting, software, and the cloud, the softest of tech. + +The weakest segment is mobile devices. It's not that people don’t want them any longer, but in the mobile device space there is no more must-have feature, nothing to make people line up for days in advance like we saw a decade ago with each new iPhone release. "People are happy with the devices they have. The market is down to a replacement market so they extend their spending," Lovelock said. + +In data center space, there's a similar pattern. Servers last longer, and at the same time, more work is being done outside the company at colocations and the cloud. + +"The cloud is taking a lot [of money] out of the data center," Lovelock said. "SaaS and IaaS are all viable for organizations but taking data center dollars. Where we keep saying software is growing most quickly, that’s very true. But recognize that it is also taking money from other areas. Budgets aren’t going up, concentrations in spending is where we are seeing things happen." + +Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3515314/data-center-spending-will-inch-up-in-year-of-accelerated-it-investment-gartner.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3487684/data-centers-in-2020-automation-cheaper-memory.html +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From 26de3be19f907b73d1da9f73b5edc321661b90bb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Jan 2020 00:58:06 +0800 Subject: [PATCH 078/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200124=20How=20?= =?UTF-8?q?Open-RAN=20could=20=E2=80=98white-box=E2=80=99=205G?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200124 How Open-RAN could ‘white-box- 5G.md --- ...00124 How Open-RAN could ‘white-box- 5G.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/talk/20200124 How Open-RAN could ‘white-box- 5G.md diff --git a/sources/talk/20200124 How Open-RAN could ‘white-box- 5G.md b/sources/talk/20200124 How Open-RAN could ‘white-box- 5G.md new file mode 100644 index 0000000000..c42a630540 --- /dev/null +++ b/sources/talk/20200124 How Open-RAN could ‘white-box- 5G.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Open-RAN could ‘white-box’ 5G) +[#]: via: (https://www.networkworld.com/article/3516075/how-open-ran-could-white-box-5g.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How Open-RAN could ‘white-box’ 5G +====== +Open-hardware, software-defined mobile radio infrastructure could kick-start private LTE and 5G and perhaps eventually lead to their supremacy over Wi-Fi for enterprises. +mrdoomits / Getty Images + +One of Britain’s principal mobile networks, O2, has just announced that it intends to deploy Open Radio Access Network technology (O-RAN) in places. + +O-RAN is a wireless industry initiative for designing and building radio network solutions using “a general-purpose, vendor-neutral hardware and software-defined technology,” explains Telecom Infra Project, the body responsible, on its website. + +TIP is the trade body that, along with Intel and Vodafone, conceived of the technology alternative – an attempt at toppling the dominance of Ericsson, Huawei and Nokia, which provide almost all mobile telco infrastructure now. + +[][1] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][1] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +O2 joins fellow UK mobile operator Vodafone, which is also experimenting with O-RAN. + +O2 is working with partners including; Mavenir, DenseAir and WaveMobile to introduce O-RAN solutions, [the Telefónica-owned network says in a press release][2]. + +What it means by that is that by encouraging less powerful, smaller vendors to provide infrastructure, the grip that Ericsson, Huawei and Nokia hold over mobile networks might be lessened. Costs could be reduced because those big three would have to reduce prices to remain competitive. + +But most interestingly, it also allows for the standardizing of telco infrastructure, possibly making future private mobile networks cheaper and easier to implement. Private LTE and 5G networks are expected to genearate $4.7 billion in revenue by the end of this year, [according to an SNS Telecom & IT report published in October][3]. That number is expected to be $8 billion by the end of 2023. + +**[ Don’t miss [customer reviews of top remote access tools][4] and see [the most powerful IoT companies][5] . | Get daily insights by [signing up for Network World newsletters][6]. ]** + +Indeed, white-box telco equipment might be the result. White-box IT hardware is used in enterprises, and could be advantageous in telco equipment, too. Conceivably, as telco equipment prices and availability became more within reach, along with the availability of new, unlicensed, shared spectrum, such as is being launched in the U.S. with Citizen Broadband Radio Service; then implementation of a an enterprise-level, private LTE or 5G network, with “white-box” hardware and programmable software-defined networks, may be one-day no harder than a Wi-Fi network install, common now. + +“By providing authority over wireless coverage and capacity, private LTE and 5G networks ensure guaranteed and secure connectivity, while supporting a wide range of applications,” SNS Telecom & IT says of private mobile networks in its report. Factory robotics and IoT sensor  networks will be driving that investment. LTE and 5G are being pitched as more reliable than Wi-Fi, in part because of less congestion. Private mobile networks can be provided by existing mobile-network operators or built independently. + +In the case of TIP’s O-RAN, the vision is for modular base stations with a software stack functioning on common, off-the-shelf hardware, called COTS. Field-programmable gate arrays (FPGAs) are also part of the concept. + +“Thus the main objective of this project is to have RAN solutions that benefit from the flexibility and pace of innovation associated with software-driven developments on fully programmable platforms,” [TIP said on its website][7] last year. The influence of Wi-Fi diminishes. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3516075/how-open-ran-could-white-box-5g.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[2]: https://news.o2.co.uk/press-release/o2-to-further-improve-network-service-for-customers-using-open-radio-access-network-ran-technology/ +[3]: https://www.snstelecom.com/private-lte +[4]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[5]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[7]: https://telecominfraproject.com/tip-project-group-feature-openran/ +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 26feddb86886d7c6f45a08a70b31734a51c31570 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 12:13:34 +0800 Subject: [PATCH 079/285] PRF @algzjh --- ...resources for agile software development.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20191229 The best resources for agile software development.md b/translated/tech/20191229 The best resources for agile software development.md index 1f467430c7..b45ff6ba14 100644 --- a/translated/tech/20191229 The best resources for agile software development.md +++ b/translated/tech/20191229 The best resources for agile software development.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (algzjh) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The best resources for agile software development) @@ -9,14 +9,16 @@ 敏捷软件开发的最佳资源 ====== -请阅读我们的热门文章,这些文章着重讨论了敏捷的过去、现在和未来。 -![Women programming][1] -对于 Opensource.com 上的敏捷主题来说,今年是非常棒的一年。随着 2019 年的临近,我们回顾了我们读者所读的与敏捷相关的热门文章。 +> 请阅读我们的热门文章,这些文章着重讨论了敏捷的过去、现在和未来。 + +![](https://img.linux.net.cn/data/attachment/album/202001/25/121308jrs4speu2y09u09e.jpg) + +对于 Opensource.com 上的敏捷主题来说,2019 年是非常棒的一年。随着 2020 年的到来,我们回顾了我们读者所读的与敏捷相关的热门文章。 ### 小规模 Scrum 指南 -Opensource.com 关于[小规模 Scrum][2] 的指南(我曾参与合著)由六部分组成,为小型团队提供了关于如何将敏捷引入到他们的工作中的建议。在官方的 [Scrum 指南][3] 的概述中,传统的 Scrum 框架推荐至少三个人来实现,以充分发挥其潜力。但是,它并没有为一两个人的团队如何成功遵循 Scrum 提供指导。我们的六部分系列旨在规范化小规模的 Scrum,并检验我们在现实世界中使用它的经验。该系列受到了读者的热烈欢迎,以至于这六篇文章占据了前 10 名文章的 60%。因此,如果你还没有阅读的话,一定要从我们的[小规模 Scrum 介绍页面][2]下载。 +Opensource.com 关于[小规模 Scrum][2] 的指南(我曾参与合著)由六部分组成,为小型团队提供了关于如何将敏捷引入到他们的工作中的建议。在官方的 [Scrum 指南][3]的概述中,传统的 Scrum 框架推荐至少三个人来实现,以充分发挥其潜力。但是,它并没有为一两个人的团队如何成功遵循 Scrum 提供指导。我们的六部分系列旨在规范化小规模的 Scrum,并检验我们在现实世界中使用它的经验。该系列受到了读者的热烈欢迎,以至于这六篇文章占据了前 10 名文章的 60%。因此,如果你还没有阅读的话,一定要从我们的[小规模 Scrum 介绍页面][2]下载。 ### 全面的敏捷项目管理指南 @@ -24,7 +26,7 @@ Opensource.com 关于[小规模 Scrum][2] 的指南(我曾参与合著)由 ### 成为出色的敏捷开发人员的 4 个步骤 -DevOps 文化已经出现在许多现代软件团队中,这些团队采用了敏捷软件开发原则,利用了最先进的工具和自动化技术。但是,这种机械的敏捷方法并不能保证开发人员在日常工作中遵循敏捷实践。Daniel Oh 在[《成为出色的敏捷开发人员的 4 个步骤》][5]中给出了一些很棒的技巧,通过关注设计思维,使用可预测的方法,以质量为中心并不断学习和探索来提高你的敏捷性。用你的敏捷工具补充这些方法将形成非常灵活和强大的敏捷开发人员。 +DevOps 文化已经出现在许多现代软件团队中,这些团队采用了敏捷软件开发原则,利用了最先进的工具和自动化技术。但是,这种机械的敏捷方法并不能保证开发人员在日常工作中遵循敏捷实践。Daniel Oh 在[成为出色的敏捷开发人员的 4 个步骤][5]中给出了一些很棒的技巧,通过关注设计思维,使用可预测的方法,以质量为中心并不断学习和探索来提高你的敏捷性。用你的敏捷工具补充这些方法将形成非常灵活和强大的敏捷开发人员。 ### Scrum 和 kanban:哪种敏捷框架更好? @@ -38,8 +40,6 @@ DevOps 文化已经出现在许多现代软件团队中,这些团队采用了 今年,Opensource.com 的作者围绕敏捷的过去、现在以及未来可能会是什么样子进行了大量的讨论。感谢他们所有人,请一定于 2020 年在这里分享[你自己的敏捷故事][9]。 -回顾一下 Opensource.com 在 2014 年和 2015 年报道的工具,以及新版本的更新,…… - -------------------------------------------------------------------------------- via: https://opensource.com/article/19/12/agile-resources @@ -47,7 +47,7 @@ via: https://opensource.com/article/19/12/agile-resources 作者:[Leigh Griffin][a] 选题:[lujun9972][b] 译者:[algzjh](https://github.com/algzjh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9db5898593f2d41c02015302d417fb3b6411a275 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 12:14:18 +0800 Subject: [PATCH 080/285] PUB @algzjh https://linux.cn/article-11816-1.html --- ...91229 The best resources for agile software development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191229 The best resources for agile software development.md (98%) diff --git a/translated/tech/20191229 The best resources for agile software development.md b/published/20191229 The best resources for agile software development.md similarity index 98% rename from translated/tech/20191229 The best resources for agile software development.md rename to published/20191229 The best resources for agile software development.md index b45ff6ba14..7ffc566009 100644 --- a/translated/tech/20191229 The best resources for agile software development.md +++ b/published/20191229 The best resources for agile software development.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (algzjh) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11816-1.html) [#]: subject: (The best resources for agile software development) [#]: via: (https://opensource.com/article/19/12/agile-resources) [#]: author: (Leigh Griffin https://opensource.com/users/lgriffin) From b43dfbf33f7a46788d0ab88f3f57b280dca4d007 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 12:37:51 +0800 Subject: [PATCH 081/285] APL --- .../tech/20200119 What-s your favorite Linux terminal trick.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200119 What-s your favorite Linux terminal trick.md b/sources/tech/20200119 What-s your favorite Linux terminal trick.md index d830c65072..91f6de51a2 100644 --- a/sources/tech/20200119 What-s your favorite Linux terminal trick.md +++ b/sources/tech/20200119 What-s your favorite Linux terminal trick.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 983228bab57a144f46fc792a791457553deb6c61 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 13:48:44 +0800 Subject: [PATCH 082/285] TSL --- ...at-s your favorite Linux terminal trick.md | 86 ------------------- ...at-s your favorite Linux terminal trick.md | 57 ++++++++++++ 2 files changed, 57 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20200119 What-s your favorite Linux terminal trick.md create mode 100644 translated/tech/20200119 What-s your favorite Linux terminal trick.md diff --git a/sources/tech/20200119 What-s your favorite Linux terminal trick.md b/sources/tech/20200119 What-s your favorite Linux terminal trick.md deleted file mode 100644 index 91f6de51a2..0000000000 --- a/sources/tech/20200119 What-s your favorite Linux terminal trick.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What's your favorite Linux terminal trick?) -[#]: via: (https://opensource.com/article/20/1/linux-terminal-trick) -[#]: author: (Opensource.com https://opensource.com/users/admin) - -What's your favorite Linux terminal trick? -====== -Take our poll or tell us about your favorite terminal trick. Is it a -nifty productivity shortcut or a fun Easter egg? -![Terminal command prompt on orange background][1] - -The beginning of a new year is always a great time to evaluate new ways to become more efficient. Many people try out new productivity tools or figure out how to optimize their most mundane processes. One area to assess is the terminal. Especially in the world of open source, there are tons of ways to make life at the terminal more efficient (and fun!) with shortcuts and commands.  - -  - -We asked our writers about their favorite terminal trick. They shared their time-saving tips and even a fun terminal Easter egg. Will you adopt one of these keyboard shortcuts or command line hacks? Do you have a favorite you'd like to share? Tell us about it by taking our poll or leaving a comment.  - -  - -"I couldn't choose a favorite; I use all three of these daily:  - - * **Ctrl + L** to clear screen (instead of typing "clear"). - * **sudo !!** to run previous command with sudo privileges.  - * **grep -Ev '^#|^$' <file>** will display file content without comments or empty lines." - - - -—Mars Toktonaliev - -  - -"For me, if I'm in a terminal text editor and I want to make it go away so I can quickly do something else, I background it with **Ctrl + Z**, do whatever I need to do, and then bring it back with **fg**. I will also sometimes do the same thing with **top** or **htop.** I can background it, and bring it back anytime I want to check current performance. I don't see backgrounding and foregrounding done in the wild very often, and it can really enhance multitasking on the terminal." - -—Jay LaCroix - -  - -"Because I tend to do much of the same things at the terminal on a given day, two things are constants in my day: - - * **Ctrl + R** to reverse search my Bash history for a command that I have already run and wish to do so again - * Caret substitution is the best as I often do things like **sudo dnf** **search <package name>** then if I find a suitable package that way I then do **^search^install** to rerun the command replacing the search with install. - - - -Sure these things are basic but so time-saving for me." - -—Steve Morris - -  - -"My cool terminal trick isn't something I do in the terminal, but _which terminal_ I use. Sometimes I just want the feeling of using an Apple II, or an old amber-on-black terminal. That's when I fire up Cool Retro Term. Screenshots are on the [website][2]." - -—Jim Hall - -  - -"Probably **ssh -X** to run graphical programs on other machines. Copy/pasting (on some terminal emulators, like gnome-terminal) C-S c and C-S v. I'm not sure if this counts (as it goes graphical in the interesting part, but starts with **ssh**). Most recently I had a need to log in to another machine but have my kids be able to follow along on the bigger screen from my laptop. This [link][3] showed me something I'd never before seen: mirroring the active session from another computer screen on my laptop over the local network (x11vnc -desktop) and being able to control it from both machines at the same time." - -—Kyle R. Conway - -  - -"You can install **Install 'sl' $ sudo apt install sl** or **$ sudo dnf install sl**, and when the command **sl** is entered at the Bash prompt a text-based steam locomotive moves across the display." - -—Don Watkins - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/linux-terminal-trick - -作者:[Opensource.com][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/admin -[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://github.com/Swordfish90/cool-retro-term -[3]: https://elinux.org/Screen_Casting_on_a_Raspberry_Pi diff --git a/translated/tech/20200119 What-s your favorite Linux terminal trick.md b/translated/tech/20200119 What-s your favorite Linux terminal trick.md new file mode 100644 index 0000000000..fc6f0a8ae2 --- /dev/null +++ b/translated/tech/20200119 What-s your favorite Linux terminal trick.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's your favorite Linux terminal trick?) +[#]: via: (https://opensource.com/article/20/1/linux-terminal-trick) +[#]: author: (Opensource.com https://opensource.com/users/admin) + +你有什么喜欢的 Linux 终端技巧? +====== + +> 告诉我们你最喜欢的终端技巧,无论是提高生产率的快捷方式还是有趣的彩蛋。 + +![Terminal command prompt on orange background][1] + +新年伊始始终是评估提高效率的新方法的好时机。许多人尝试使用新的生产力工具,或者想找出如何优化其最常用的流程。终端是一个需要评估的领域,尤其是在开源世界中,有无数种方法可以通过快捷键和命令使终端上的生活更加高效(又有趣!)。 + +我们向作者们询问了他们最喜欢的终端技巧。他们分享了一些节省时间的技巧,甚至还有一个有趣的终端彩蛋。你会采用这些键盘快捷键或命令行技巧吗?你有喜欢分享的最爱吗?请发表评论来告诉我们。 + +“我找不出哪个是我最喜欢的;每天我都会使用这三个: + +* `Ctrl + L` 来清除屏幕(而不是键入 `clear`)。 +* `sudo !!` 以 `sudo` 特权运行先前的命令。 +* `grep -Ev '^#|^$' ` 将显示文件内容,不带注释或空行。” —Mars Toktonaliev + +“对我来说,如果我正在使用终端文本编辑器,并且希望将其丢开,以便可以快速执行其他操作,则可以使用 `Ctrl + Z` 将其放到后台,接着执行我需要做的一切,然后用 `fg` 将其带回前台。有时我也会对 `top` 或 `htop` 做同样的事情。我可以将其丢到后台,并在我想检查当前性能时随时将其带回前台。我不会将通常很快能完成的任务在前后台之间切换,它确实可以增强终端上的多任务处理能力。” —Jay LaCroix + +“我经常在某一天在终端中做很多相同的事情,有两件事是每天都不变的: + +* `Ctrl + R` 反向搜索我的 Bash 历史记录以查找我已经运行并且希望再次执行的命令。 +* 插入号(`^`)替换是最好的,因为我经常做诸如 `sudo dnf search ` 之类的事情,然后,如果我以这种方式找到合适的软件包,则执行 `^search^install` 来重新运行该命令,以 `install` 替换 `search`。 + +这些东西肯定是很基本的,但是对我来说却节省了时间。” —Steve Morris + +“我的炫酷终端技巧不是我在终端上执行的操作,而是我使用的终端。有时候我只是想要使用 Apple II 或旧式琥珀色终端的感觉,那我就启动了 Cool-Retro-Term。它的截屏可以在这个[网站][2]上找到。” —Jim Hall + +“可能是用 `ssh -X` 来在其他计算机上运行图形程序。(在某些终端仿真器上,例如 gnome-terminal)用 `C-S c` 和 `C-S v` 复制/粘贴。我不确定这是否有价值(因为它有趣的是以 ssh 启动的图形化)。最近,我需要登录另一台计算机,但是我的孩子们可以在笔记本电脑的大屏幕上看到它。这个[链接][3]向我展示了一些我从未见过的内容:通过局域网从我的笔记本电脑上镜像来自另一台计算机屏幕上的活动会话(`x11vnc -desktop`),并能够同时从两台计算机上进行控制。” —Kyle R. Conway + +“你可以安装 `sl`(`$ sudo apt install sl` 或 `$ sudo dnf install sl`),并且当在 Bash 中输入命令 `sl` 时,一个基于文本的蒸汽机车就会在显示屏上移动。” —Don Watkins + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/linux-terminal-trick + +作者:[Opensource.com][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/admin +[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://github.com/Swordfish90/cool-retro-term +[3]: https://elinux.org/Screen_Casting_on_a_Raspberry_Pi From 57930a5094c5282267cdea32d9bf496b0a914cb7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 13:59:43 +0800 Subject: [PATCH 083/285] PRF @wxy --- .../20200119 What-s your favorite Linux terminal trick.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20200119 What-s your favorite Linux terminal trick.md b/translated/tech/20200119 What-s your favorite Linux terminal trick.md index fc6f0a8ae2..5acd642ad5 100644 --- a/translated/tech/20200119 What-s your favorite Linux terminal trick.md +++ b/translated/tech/20200119 What-s your favorite Linux terminal trick.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What's your favorite Linux terminal trick?) @@ -12,7 +12,7 @@ > 告诉我们你最喜欢的终端技巧,无论是提高生产率的快捷方式还是有趣的彩蛋。 -![Terminal command prompt on orange background][1] +![](https://img.linux.net.cn/data/attachment/album/202001/25/135858accxc70tfxuifxx1.jpg) 新年伊始始终是评估提高效率的新方法的好时机。许多人尝试使用新的生产力工具,或者想找出如何优化其最常用的流程。终端是一个需要评估的领域,尤其是在开源世界中,有无数种方法可以通过快捷键和命令使终端上的生活更加高效(又有趣!)。 @@ -46,7 +46,7 @@ via: https://opensource.com/article/20/1/linux-terminal-trick 作者:[Opensource.com][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 6b88060a2ca2a553c173c52d76f3b12eefa296b1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 14:00:31 +0800 Subject: [PATCH 084/285] PUB @wxy https://linux.cn/article-11817-1.html --- .../20200119 What-s your favorite Linux terminal trick.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200119 What-s your favorite Linux terminal trick.md (98%) diff --git a/translated/tech/20200119 What-s your favorite Linux terminal trick.md b/published/20200119 What-s your favorite Linux terminal trick.md similarity index 98% rename from translated/tech/20200119 What-s your favorite Linux terminal trick.md rename to published/20200119 What-s your favorite Linux terminal trick.md index 5acd642ad5..675f36a935 100644 --- a/translated/tech/20200119 What-s your favorite Linux terminal trick.md +++ b/published/20200119 What-s your favorite Linux terminal trick.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11817-1.html) [#]: subject: (What's your favorite Linux terminal trick?) [#]: via: (https://opensource.com/article/20/1/linux-terminal-trick) [#]: author: (Opensource.com https://opensource.com/users/admin) From d52a68e3c20ae227f4cc62080fd77786b081f6ca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 21:16:29 +0800 Subject: [PATCH 085/285] TSL @robsean --- ...game player to run forward and backward.md | 949 +++++++++--------- 1 file changed, 475 insertions(+), 474 deletions(-) rename {sources => translated}/tech/20191211 Enable your Python game player to run forward and backward.md (73%) diff --git a/sources/tech/20191211 Enable your Python game player to run forward and backward.md b/translated/tech/20191211 Enable your Python game player to run forward and backward.md similarity index 73% rename from sources/tech/20191211 Enable your Python game player to run forward and backward.md rename to translated/tech/20191211 Enable your Python game player to run forward and backward.md index bde74f1526..e55d24d051 100644 --- a/sources/tech/20191211 Enable your Python game player to run forward and backward.md +++ b/translated/tech/20191211 Enable your Python game player to run forward and backward.md @@ -1,474 +1,475 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Enable your Python game player to run forward and backward) -[#]: via: (https://opensource.com/article/19/12/python-platformer-game-run) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Enable your Python game player to run forward and backward -====== -Let your player run free by enabling the side-scroller effect in your -Python platformer using the Pygame module. -![Gaming artifacts with joystick, GameBoy, paddle][1] - -This is part 8 in an ongoing series about creating video games in Python 3 using the Pygame module. Previous articles are: - - * [Learn how to program in Python by building a simple dice game][2] - * [Build a game framework with Python using the Pygame module][3] - * [How to add a player to your Python game][4] - * [Using Pygame to move your game character around][5] - * [What's a hero without a villain? How to add one to your Python game][6] - * [Simulate gravity in your Python game][7] - * [Add jumping to your Python platformer game][8] - - - -In previous entries in this series about creating video games in [Python 3][9] using the [Pygame][10] module, you designed your level-design layout, but some portion of your level probably extended past your viewable screen. The ubiquitous solution to that problem in platformer games is, as the term "side-scroller" suggests, scrolling. - -The key to scrolling is to make the platforms around the player sprite move when the player sprite gets close to the edge of the screen. This provides the illusion that the screen is a "camera" panning across the game world. - -This scrolling trick requires two dead zones at either edge of the screen, at which point your avatar stands still while the world scrolls by. - -### Putting the scroll in side-scroller - -You need one trigger point to go forward and another if you want your player to be able to go backward. These two points are simply two variables. Set them each about 100 or 200 pixels from each screen edge. Create the variables in your **setup** section. In the following code, the first two lines are for context, so just add the last two lines: - - -``` -player_list.add(player) -steps = 10 -forwardX  = 600 -backwardX = 230 -``` - -In the main loop, check to see if your player sprite is at the **forwardx** or **backwardx** scroll point. If so, move all platforms either left or right, depending on whether the world is moving forward or backward. In the following code, the final three lines of code are only for your reference: - - -``` -        # scroll the world forward -        if player.rect.x >= forwardx: -                scroll = player.rect.x - forwardx -                player.rect.x = forwardx -                for p in plat_list: -                        p.rect.x -= scroll - -        # scroll the world backward -        if player.rect.x <= backwardx: -                scroll = backwardx - player.rect.x -                player.rect.x = backwardx -                for p in plat_list: -                        p.rect.x += scroll - -        ## scrolling code above -    world.blit(backdrop, backdropbox) -    player.gravity() # check gravity -    player.update() -``` - -Launch your game and try it out. - -![Scrolling the world in Pygame][11] - -Scrolling works as expected, but you may notice a small problem that happens when you scroll the world around your player and non-player sprites: the enemy sprite doesn't scroll along with the world. Unless you want - -your enemy sprite to pursue your player endlessly, you need to modify the enemy code so that when your player makes an expeditious retreat, the enemy is left behind. - -### Enemy scroll - -In your main loop, you must apply the same rules for scrolling platforms to your enemy's position. Because your game world will (presumably) have more than one enemy in it, the rules are applied to your enemy list rather than an individual enemy sprite. That's one of the advantages of grouping similar elements into lists. - -The first two lines are for context, so just add the final two to your main loop: - - -``` -    # scroll the world forward -    if player.rect.x >= forwardx: -        scroll = player.rect.x - forwardx -        player.rect.x = forwardx -        for p in plat_list: -            p.rect.x -= scroll -        for e in enemy_list: -            e.rect.x -= scroll -``` - -To scroll in the other direction: - - -``` -    # scroll the world backward -    if player.rect.x <= backwardx: -        scroll = backwardx - player.rect.x -        player.rect.x = backwardx -        for p in plat_list: -            p.rect.x += scroll -        for e in enemy_list: -            e.rect.x += scroll -``` - -Launch the game again and see what happens. - -Here's all the code you've written for this Python platformer so far: - - -``` -#!/usr/bin/env python3 -# draw a world -# add a player and player control -# add player movement -# add enemy and basic collision -# add platform -# add gravity -# add jumping -# add scrolling - -# GNU All-Permissive License -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved.  This file is offered as-is, -# without any warranty. - -import pygame -import sys -import os - -''' -Objects -''' - -class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     -    def __init__(self,xloc,yloc,imgw,imgh,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)).convert() -        self.image.convert_alpha() -        self.rect = self.image.get_rect() -        self.rect.y = yloc -        self.rect.x = xloc - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 -        self.movey = 0 -        self.frame = 0 -        self.health = 10 -        self.collide_delta = 0 -        self.jump_delta = 6 -        self.score = 1 -        self.images = [] -        for i in range(1,9): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha() -            img.set_colorkey(ALPHA) -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() - -    def jump(self,platform_list): -        self.jump_delta = 0 - -    def gravity(self): -        self.movey += 3.2 # how fast player falls -        -        if self.rect.y > worldy and self.movey >= 0: -            self.movey = 0 -            self.rect.y = worldy-ty -        -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -        -    def update(self): -        ''' -        Update sprite position -        ''' -        -        self.rect.x = self.rect.x + self.movex -        self.rect.y = self.rect.y + self.movey - -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[self.frame//ani] - -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] - -        # collisions -        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -        for enemy in enemy_hit_list: -            self.health -= 1 -            #print(self.health) - -        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) -        for p in plat_hit_list: -            self.collide_delta = 0 # stop jumping -            self.movey = 0 -            if self.rect.y > p.rect.y: -                self.rect.y = p.rect.y+ty -            else: -                self.rect.y = p.rect.y-ty -            -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.movey = 0 -            self.rect.y = worldy-ty-ty -            self.collide_delta = 0 # stop jumping -            if self.rect.y > g.rect.y: -                self.health -=1 -                print(self.health) -                -        if self.collide_delta < 6 and self.jump_delta < 6: -            self.jump_delta = 6*2 -            self.movey -= 33  # how high to jump -            self.collide_delta += 6 -            self.jump_delta    += 6 -            -class Enemy(pygame.sprite.Sprite): -    ''' -    Spawn an enemy -    ''' -    def __init__(self,x,y,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)) -        self.movey = 0 -        #self.image.convert_alpha() -        #self.image.set_colorkey(ALPHA) -        self.rect = self.image.get_rect() -        self.rect.x = x -        self.rect.y = y -        self.counter = 0 - -                -    def move(self): -        ''' -        enemy movement -        ''' -        distance = 80 -        speed = 8 - -        self.movey += 3.2 -        -        if self.counter >= 0 and self.counter <= distance: -            self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: -            self.rect.x -= speed -        else: -            self.counter = 0 -        -        self.counter += 1 - -        if not self.rect.y >= worldy-ty-ty: -            self.rect.y += self.movey - -        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) -        for p in plat_hit_list: -            self.movey = 0 -            if self.rect.y > p.rect.y: -                self.rect.y = p.rect.y+ty -            else: -                self.rect.y = p.rect.y-ty - -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.rect.y = worldy-ty-ty - -        -class Level(): -    def bad(lvl,eloc): -        if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group -            -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return enemy_list - -    def loot(lvl,lloc): -        print(lvl) - -    def ground(lvl,gloc,tx,ty): -        ground_list = pygame.sprite.Group() -        i=0 -        if lvl == 1: -            while i < len(gloc): -                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') -                ground_list.add(ground) -                i=i+1 - -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return ground_list - -    def platform(lvl,tx,ty): -        plat_list = pygame.sprite.Group() -        ploc = [] -        i=0 -        if lvl == 1: -            ploc.append((0,worldy-ty-128,3)) -            ploc.append((300,worldy-ty-256,3)) -            ploc.append((500,worldy-ty-128,4)) - -            while i < len(ploc): -                j=0 -                while j <= ploc[i][2]: -                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') -                    plat_list.add(plat) -                    j=j+1 -                print('run' + str(i) + str(ploc[i])) -                i=i+1 - -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return plat_list - -''' -Setup -''' -worldx = 960 -worldy = 720 - -fps = 40 # frame rate -ani = 4  # animation cycles -clock = pygame.time.Clock() -pygame.init() -main = True - -BLUE  = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -ALPHA = (0,255,0) - -world = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = world.get_rect() -player = Player() # spawn player -player.rect.x = 0 -player.rect.y = 0 -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10 -forwardx = 600 -backwardx = 230 - -eloc = [] -eloc = [200,20] -gloc = [] -#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] -tx = 64 #tile size -ty = 64 #tile size - -i=0 -while i <= (worldx/tx)+tx: -    gloc.append(i*tx) -    i=i+1 - -enemy_list = Level.bad( 1, eloc ) -ground_list = Level.ground( 1,gloc,tx,ty ) -plat_list = Level.platform( 1,tx,ty ) - -''' -Main loop -''' -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print("LEFT") -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print("RIGHT") -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                player.jump(plat_list) - -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False - -    # scroll the world forward -    if player.rect.x >= forwardx: -        scroll = player.rect.x - forwardx -        player.rect.x = forwardx -        for p in plat_list: -            p.rect.x -= scroll -        for e in enemy_list: -            e.rect.x -= scroll -                -    # scroll the world backward -    if player.rect.x <= backwardx: -        scroll = backwardx - player.rect.x -        player.rect.x = backwardx -        for p in plat_list: -            p.rect.x += scroll -        for e in enemy_list: -            e.rect.x += scroll - -    world.blit(backdrop, backdropbox) -    player.gravity() # check gravity -    player.update() -    player_list.draw(world) #refresh player position -    enemy_list.draw(world)  # refresh enemies -    ground_list.draw(world)  # refresh enemies -    plat_list.draw(world)   # refresh platforms -    for e in enemy_list: -        e.move() -    pygame.display.flip() -    clock.tick(fps) -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/python-platformer-game-run - -作者:[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/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) -[2]: https://opensource.com/article/17/10/python-101 -[3]: https://opensource.com/article/17/12/game-framework-python -[4]: https://opensource.com/article/17/12/game-python-add-a-player -[5]: https://opensource.com/article/17/12/game-python-moving-player -[6]: https://opensource.com/article/18/5/pygame-enemy -[7]: https://opensource.com/article/19/11/simulate-gravity-python -[8]: https://opensource.com/article/19/12/jumping-python-platformer-game -[9]: https://www.python.org/ -[10]: https://www.pygame.org/news -[11]: https://opensource.com/sites/default/files/uploads/pygame-scroll.jpg (Scrolling the world in Pygame) +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enable your Python game player to run forward and backward) +[#]: via: (https://opensource.com/article/19/12/python-platformer-game-run) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使你的 Python 游戏玩家能够向前和向后跑 +====== +使用 Pygame 模块来使你的 Python 平台开启侧滚效果,来让你的玩家自由奔跑。 +![Gaming artifacts with joystick, GameBoy, paddle][1] + +这是仍在进行中的关于使用 Pygame 模块来在 Python 3 中在创建电脑游戏的第八部分。先前的文章是: + + * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][2] + * [使用 Python 和 Pygame 模块构建一个游戏框架][3] + * [如何在你的 Python 游戏中添加一个玩家][4] + * [用 Pygame 使你的游戏角色移动起来][5] + * [如何向你的 Python 游戏中添加一个敌人][6] + * [在 Pygame 游戏中放置平台][12] + * [在你的 Python 游戏中模拟引力][7] + * [为你的 Python 平台类游戏添加跳跃功能][8] + + + +在这一系列关于使用 [Pygame][10] 模块来在 [Python 3][9]中创建电脑游戏的先前条目中,你已经设计了你的层设计布局,但是你的层的一些部分可能已近超出你的可视屏幕。在平台类游戏中,这个问题的普遍解决方案是,像术语"侧滚动"表明的一样,滚动。 + +滚动的关键是当玩家精灵接近屏的幕边缘时,使在玩家精灵周围的平台移动。这样给予一种错觉,屏幕是一个在游戏世界中穿梭追拍的"摄像机"。 + +这个滚动技巧需要两个在屏幕边缘的绝对区域,在绝对区域内的点处,在世界滚动期间,你的化身静止不动。 + +### 在侧滚动条中放置卷轴 + +如果你希望你的玩家能够后退,你需要一个触发点来向前和向后。这两个点仅仅是两个变量。设置它们各个距各个屏幕边缘大约 100 或 200 像素。在你的 **setup** 部分中创建变量。在下面的代码中,前两行用于背景说明,所以仅需要添加这行后的代码: + + +``` +player_list.add(player) +steps = 10 +forwardX  = 600 +backwardX = 230 +``` + +在主循环中,查看你的玩家精灵是否在 **前进** 或 **后退** 滚动点处。如果是这样,向左或向右移动使用的平台,取决于世界是向前或向后移动。在下面的代码中,代码的最后三行仅供你参考: + + +``` +        # scroll the world forward +        if player.rect.x >= forwardx: +                scroll = player.rect.x - forwardx +                player.rect.x = forwardx +                for p in plat_list: +                        p.rect.x -= scroll + +        # scroll the world backward +        if player.rect.x <= backwardx: +                scroll = backwardx - player.rect.x +                player.rect.x = backwardx +                for p in plat_list: +                        p.rect.x += scroll + +        ## scrolling code above +    world.blit(backdrop, backdropbox) +    player.gravity() # check gravity +    player.update() +``` + +启动你的游戏,并尝试它。 + +![Scrolling the world in Pygame][11] + +滚动工作像预期的一样,但是你可能注意到一个发生的小问题,当你滚动你的玩家和非玩家精灵周围的世界时:敌人精灵不随同世界滚动。除非你愿意。 + +你的敌人精灵要无休止地追逐你的玩家,你需要修改敌人代码,以便当你的玩家快速撤退时,敌人被留在hz后面。 + +### 敌人卷轴 + +在你的主循环中,你必需为你的敌人的位置的卷轴平台应用相同的规则。因为你的游戏世界将(很可能)有不止一个敌人在其中,该规则被应用于你的敌人列表,而不是一个单独的敌人精灵。 这是分组类似元素到列表中的优点之一。 + +前两行用于背景注释,所以只需添加这两行后面的代码到你的主循环中: + + +``` +    # scroll the world forward +    if player.rect.x >= forwardx: +        scroll = player.rect.x - forwardx +        player.rect.x = forwardx +        for p in plat_list: +            p.rect.x -= scroll +        for e in enemy_list: +            e.rect.x -= scroll +``` + +来滚向另一个方向: + + +``` +    # scroll the world backward +    if player.rect.x <= backwardx: +        scroll = backwardx - player.rect.x +        player.rect.x = backwardx +        for p in plat_list: +            p.rect.x += scroll +        for e in enemy_list: +            e.rect.x += scroll +``` + +再次启动游戏,看看发生什么。 + +这里是到目前为止你已经为这个 Python 平台所写所有的代码: + + +``` +#!/usr/bin/env python3 +# draw a world +# add a player and player control +# add player movement +# add enemy and basic collision +# add platform +# add gravity +# add jumping +# add scrolling + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved.  This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os + +''' +Objects +''' + +class Platform(pygame.sprite.Sprite): +    # x location, y location, img width, img height, img file     +    def __init__(self,xloc,yloc,imgw,imgh,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)).convert() +        self.image.convert_alpha() +        self.rect = self.image.get_rect() +        self.rect.y = yloc +        self.rect.x = xloc + +class Player(pygame.sprite.Sprite): +    ''' +    Spawn a player +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 +        self.movey = 0 +        self.frame = 0 +        self.health = 10 +        self.collide_delta = 0 +        self.jump_delta = 6 +        self.score = 1 +        self.images = [] +        for i in range(1,9): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha() +            img.set_colorkey(ALPHA) +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() + +    def jump(self,platform_list): +        self.jump_delta = 0 + +    def gravity(self): +        self.movey += 3.2 # how fast player falls +        +        if self.rect.y > worldy and self.movey >= 0: +            self.movey = 0 +            self.rect.y = worldy-ty +        +    def control(self,x,y): +        ''' +        control player movement +        ''' +        self.movex += x +        self.movey += y +        +    def update(self): +        ''' +        Update sprite position +        ''' +        +        self.rect.x = self.rect.x + self.movex +        self.rect.y = self.rect.y + self.movey + +        # moving left +        if self.movex < 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # moving right +        if self.movex > 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] + +        # collisions +        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) +        for enemy in enemy_hit_list: +            self.health -= 1 +            #print(self.health) + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.collide_delta = 0 # stop jumping +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty +            +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.movey = 0 +            self.rect.y = worldy-ty-ty +            self.collide_delta = 0 # stop jumping +            if self.rect.y > g.rect.y: +                self.health -=1 +                print(self.health) +                +        if self.collide_delta < 6 and self.jump_delta < 6: +            self.jump_delta = 6*2 +            self.movey -= 33  # how high to jump +            self.collide_delta += 6 +            self.jump_delta    += 6 +            +class Enemy(pygame.sprite.Sprite): +    ''' +    Spawn an enemy +    ''' +    def __init__(self,x,y,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)) +        self.movey = 0 +        #self.image.convert_alpha() +        #self.image.set_colorkey(ALPHA) +        self.rect = self.image.get_rect() +        self.rect.x = x +        self.rect.y = y +        self.counter = 0 + +                +    def move(self): +        ''' +        enemy movement +        ''' +        distance = 80 +        speed = 8 + +        self.movey += 3.2 +        +        if self.counter >= 0 and self.counter <= distance: +            self.rect.x += speed +        elif self.counter >= distance and self.counter <= distance*2: +            self.rect.x -= speed +        else: +            self.counter = 0 +        +        self.counter += 1 + +        if not self.rect.y >= worldy-ty-ty: +            self.rect.y += self.movey + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty + +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.rect.y = worldy-ty-ty + +        +class Level(): +    def bad(lvl,eloc): +        if lvl == 1: +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy +            enemy_list = pygame.sprite.Group() # create enemy group +            enemy_list.add(enemy)              # add enemy to group +            +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return enemy_list + +    def loot(lvl,lloc): +        print(lvl) + +    def ground(lvl,gloc,tx,ty): +        ground_list = pygame.sprite.Group() +        i=0 +        if lvl == 1: +            while i < len(gloc): +                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') +                ground_list.add(ground) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return ground_list + +    def platform(lvl,tx,ty): +        plat_list = pygame.sprite.Group() +        ploc = [] +        i=0 +        if lvl == 1: +            ploc.append((0,worldy-ty-128,3)) +            ploc.append((300,worldy-ty-256,3)) +            ploc.append((500,worldy-ty-128,4)) + +            while i < len(ploc): +                j=0 +                while j <= ploc[i][2]: +                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') +                    plat_list.add(plat) +                    j=j+1 +                print('run' + str(i) + str(ploc[i])) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return plat_list + +''' +Setup +''' +worldx = 960 +worldy = 720 + +fps = 40 # frame rate +ani = 4  # animation cycles +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # spawn player +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 +forwardx = 600 +backwardx = 230 + +eloc = [] +eloc = [200,20] +gloc = [] +#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] +tx = 64 #tile size +ty = 64 #tile size + +i=0 +while i <= (worldx/tx)+tx: +    gloc.append(i*tx) +    i=i+1 + +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) +plat_list = Level.platform( 1,tx,ty ) + +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print("LEFT") +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print("RIGHT") +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                player.jump(plat_list) + +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False + +    # scroll the world forward +    if player.rect.x >= forwardx: +        scroll = player.rect.x - forwardx +        player.rect.x = forwardx +        for p in plat_list: +            p.rect.x -= scroll +        for e in enemy_list: +            e.rect.x -= scroll +                +    # scroll the world backward +    if player.rect.x <= backwardx: +        scroll = backwardx - player.rect.x +        player.rect.x = backwardx +        for p in plat_list: +            p.rect.x += scroll +        for e in enemy_list: +            e.rect.x += scroll + +    world.blit(backdrop, backdropbox) +    player.gravity() # check gravity +    player.update() +    player_list.draw(world) #refresh player position +    enemy_list.draw(world)  # refresh enemies +    ground_list.draw(world)  # refresh enemies +    plat_list.draw(world)   # refresh platforms +    for e in enemy_list: +        e.move() +    pygame.display.flip() +    clock.tick(fps) +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/python-platformer-game-run + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) +[2]: https://opensource.com/article/17/10/python-101 +[3]: https://opensource.com/article/17/12/game-framework-python +[4]: https://opensource.com/article/17/12/game-python-add-a-player +[5]: https://opensource.com/article/17/12/game-python-moving-player +[6]: https://opensource.com/article/18/5/pygame-enemy +[7]: https://opensource.com/article/19/11/simulate-gravity-python +[8]: https://opensource.com/article/19/12/jumping-python-platformer-game +[9]: https://www.python.org/ +[10]: https://www.pygame.org/news +[11]: https://opensource.com/sites/default/files/uploads/pygame-scroll.jpg (Scrolling the world in Pygame) +[12]:https://opensource.com/article/18/7/put-platforms-python-game From a5ee878da3a4aaa9d2915cb8f52c077de6e91f25 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 22:07:02 +0800 Subject: [PATCH 086/285] PRF @robsean --- ...game player to run forward and backward.md | 714 +++++++++--------- 1 file changed, 353 insertions(+), 361 deletions(-) diff --git a/translated/tech/20191211 Enable your Python game player to run forward and backward.md b/translated/tech/20191211 Enable your Python game player to run forward and backward.md index e55d24d051..4efa93bd21 100644 --- a/translated/tech/20191211 Enable your Python game player to run forward and backward.md +++ b/translated/tech/20191211 Enable your Python game player to run forward and backward.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Enable your Python game player to run forward and backward) @@ -9,10 +9,11 @@ 使你的 Python 游戏玩家能够向前和向后跑 ====== -使用 Pygame 模块来使你的 Python 平台开启侧滚效果,来让你的玩家自由奔跑。 -![Gaming artifacts with joystick, GameBoy, paddle][1] +> 使用 Pygame 模块来使你的 Python 平台开启侧滚效果,来让你的玩家自由奔跑。 + +![](https://img.linux.net.cn/data/attachment/album/202001/25/220636x5mabbl47xvtsk55.jpg) -这是仍在进行中的关于使用 Pygame 模块来在 Python 3 中在创建电脑游戏的第八部分。先前的文章是: +这是仍在进行中的关于使用 Pygame 模块来在 Python 3 中在创建电脑游戏的第九部分。先前的文章是: * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][2] * [使用 Python 和 Pygame 模块构建一个游戏框架][3] @@ -23,9 +24,7 @@ * [在你的 Python 游戏中模拟引力][7] * [为你的 Python 平台类游戏添加跳跃功能][8] - - -在这一系列关于使用 [Pygame][10] 模块来在 [Python 3][9]中创建电脑游戏的先前条目中,你已经设计了你的层设计布局,但是你的层的一些部分可能已近超出你的可视屏幕。在平台类游戏中,这个问题的普遍解决方案是,像术语"侧滚动"表明的一样,滚动。 +在这一系列关于使用 [Pygame][10] 模块来在 [Python 3][9] 中创建电脑游戏的先前文章中,你已经设计了你的关卡设计布局,但是你的关卡的一些部分可能已近超出你的屏幕的可视区域。在平台类游戏中,这个问题的普遍解决方案是,像术语“侧滚side-scroller”表明的一样,滚动。 滚动的关键是当玩家精灵接近屏的幕边缘时,使在玩家精灵周围的平台移动。这样给予一种错觉,屏幕是一个在游戏世界中穿梭追拍的"摄像机"。 @@ -33,8 +32,7 @@ ### 在侧滚动条中放置卷轴 -如果你希望你的玩家能够后退,你需要一个触发点来向前和向后。这两个点仅仅是两个变量。设置它们各个距各个屏幕边缘大约 100 或 200 像素。在你的 **setup** 部分中创建变量。在下面的代码中,前两行用于背景说明,所以仅需要添加这行后的代码: - +如果你希望你的玩家能够后退,你需要一个触发点来向前和向后。这两个点仅仅是两个变量。设置它们各个距各个屏幕边缘大约 100 或 200 像素。在你的设置部分中创建变量。在下面的代码中,前两行用于上下文说明,所以仅需要添加这行后的代码: ``` player_list.add(player) @@ -43,8 +41,7 @@ forwardX  = 600 backwardX = 230 ``` -在主循环中,查看你的玩家精灵是否在 **前进** 或 **后退** 滚动点处。如果是这样,向左或向右移动使用的平台,取决于世界是向前或向后移动。在下面的代码中,代码的最后三行仅供你参考: - +在主循环中,查看你的玩家精灵是否在 `forwardx` 或 `backwardx` 滚动点处。如果是这样,向左或向右移动使用的平台,取决于世界是向前或向后移动。在下面的代码中,代码的最后三行仅供你参考: ```         # scroll the world forward @@ -71,16 +68,13 @@ backwardX = 230 ![Scrolling the world in Pygame][11] -滚动工作像预期的一样,但是你可能注意到一个发生的小问题,当你滚动你的玩家和非玩家精灵周围的世界时:敌人精灵不随同世界滚动。除非你愿意。 - -你的敌人精灵要无休止地追逐你的玩家,你需要修改敌人代码,以便当你的玩家快速撤退时,敌人被留在hz后面。 +滚动像预期的一样工作,但是你可能注意到一个发生的小问题,当你滚动你的玩家和非玩家精灵周围的世界时:敌人精灵不随同世界滚动。除非你要你的敌人精灵要无休止地追逐你的玩家,你需要修改敌人代码,以便当你的玩家快速撤退时,敌人被留在后面。 ### 敌人卷轴 -在你的主循环中,你必需为你的敌人的位置的卷轴平台应用相同的规则。因为你的游戏世界将(很可能)有不止一个敌人在其中,该规则被应用于你的敌人列表,而不是一个单独的敌人精灵。 这是分组类似元素到列表中的优点之一。 - -前两行用于背景注释,所以只需添加这两行后面的代码到你的主循环中: +在你的主循环中,你必须对卷轴平台为你的敌人的位置的应用相同的规则。因为你的游戏世界将(很可能)有不止一个敌人在其中,该规则应该被应用于你的敌人列表,而不是一个单独的敌人精灵。这是分组类似元素到列表中的优点之一。 +前两行用于上下文注释,所以只需添加这两行后面的代码到你的主循环中: ```     # scroll the world forward @@ -95,7 +89,6 @@ backwardX = 230 来滚向另一个方向: - ```     # scroll the world backward     if player.rect.x <= backwardx: @@ -111,341 +104,340 @@ backwardX = 230 这里是到目前为止你已经为这个 Python 平台所写所有的代码: - ``` -#!/usr/bin/env python3 -# draw a world -# add a player and player control -# add player movement -# add enemy and basic collision -# add platform -# add gravity -# add jumping -# add scrolling - -# GNU All-Permissive License -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved.  This file is offered as-is, -# without any warranty. - -import pygame -import sys -import os - -''' -Objects -''' - -class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     -    def __init__(self,xloc,yloc,imgw,imgh,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)).convert() -        self.image.convert_alpha() -        self.rect = self.image.get_rect() -        self.rect.y = yloc -        self.rect.x = xloc - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 -        self.movey = 0 -        self.frame = 0 -        self.health = 10 -        self.collide_delta = 0 -        self.jump_delta = 6 -        self.score = 1 -        self.images = [] -        for i in range(1,9): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha() -            img.set_colorkey(ALPHA) -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() - -    def jump(self,platform_list): -        self.jump_delta = 0 - -    def gravity(self): -        self.movey += 3.2 # how fast player falls -        -        if self.rect.y > worldy and self.movey >= 0: -            self.movey = 0 -            self.rect.y = worldy-ty -        -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -        -    def update(self): -        ''' -        Update sprite position -        ''' -        -        self.rect.x = self.rect.x + self.movex -        self.rect.y = self.rect.y + self.movey - -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[self.frame//ani] - -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] - -        # collisions -        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -        for enemy in enemy_hit_list: -            self.health -= 1 -            #print(self.health) - -        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) -        for p in plat_hit_list: -            self.collide_delta = 0 # stop jumping -            self.movey = 0 -            if self.rect.y > p.rect.y: -                self.rect.y = p.rect.y+ty -            else: -                self.rect.y = p.rect.y-ty -            -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.movey = 0 -            self.rect.y = worldy-ty-ty -            self.collide_delta = 0 # stop jumping -            if self.rect.y > g.rect.y: -                self.health -=1 -                print(self.health) -                -        if self.collide_delta < 6 and self.jump_delta < 6: -            self.jump_delta = 6*2 -            self.movey -= 33  # how high to jump -            self.collide_delta += 6 -            self.jump_delta    += 6 -            -class Enemy(pygame.sprite.Sprite): -    ''' -    Spawn an enemy -    ''' -    def __init__(self,x,y,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)) -        self.movey = 0 -        #self.image.convert_alpha() -        #self.image.set_colorkey(ALPHA) -        self.rect = self.image.get_rect() -        self.rect.x = x -        self.rect.y = y -        self.counter = 0 - -                -    def move(self): -        ''' -        enemy movement -        ''' -        distance = 80 -        speed = 8 - -        self.movey += 3.2 -        -        if self.counter >= 0 and self.counter <= distance: -            self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: -            self.rect.x -= speed -        else: -            self.counter = 0 -        -        self.counter += 1 - -        if not self.rect.y >= worldy-ty-ty: -            self.rect.y += self.movey - -        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) -        for p in plat_hit_list: -            self.movey = 0 -            if self.rect.y > p.rect.y: -                self.rect.y = p.rect.y+ty -            else: -                self.rect.y = p.rect.y-ty - -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.rect.y = worldy-ty-ty - -        -class Level(): -    def bad(lvl,eloc): -        if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group -            -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return enemy_list - -    def loot(lvl,lloc): -        print(lvl) - -    def ground(lvl,gloc,tx,ty): -        ground_list = pygame.sprite.Group() -        i=0 -        if lvl == 1: -            while i < len(gloc): -                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') -                ground_list.add(ground) -                i=i+1 - -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return ground_list - -    def platform(lvl,tx,ty): -        plat_list = pygame.sprite.Group() -        ploc = [] -        i=0 -        if lvl == 1: -            ploc.append((0,worldy-ty-128,3)) -            ploc.append((300,worldy-ty-256,3)) -            ploc.append((500,worldy-ty-128,4)) - -            while i < len(ploc): -                j=0 -                while j <= ploc[i][2]: -                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') -                    plat_list.add(plat) -                    j=j+1 -                print('run' + str(i) + str(ploc[i])) -                i=i+1 - -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return plat_list - -''' -Setup -''' -worldx = 960 -worldy = 720 - -fps = 40 # frame rate -ani = 4  # animation cycles -clock = pygame.time.Clock() -pygame.init() -main = True - -BLUE  = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -ALPHA = (0,255,0) - -world = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = world.get_rect() -player = Player() # spawn player -player.rect.x = 0 -player.rect.y = 0 -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10 -forwardx = 600 -backwardx = 230 - -eloc = [] -eloc = [200,20] -gloc = [] -#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] -tx = 64 #tile size -ty = 64 #tile size - -i=0 -while i <= (worldx/tx)+tx: -    gloc.append(i*tx) -    i=i+1 - -enemy_list = Level.bad( 1, eloc ) -ground_list = Level.ground( 1,gloc,tx,ty ) -plat_list = Level.platform( 1,tx,ty ) - -''' -Main loop -''' -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print("LEFT") -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print("RIGHT") -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                player.jump(plat_list) - -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False - -    # scroll the world forward -    if player.rect.x >= forwardx: -        scroll = player.rect.x - forwardx -        player.rect.x = forwardx -        for p in plat_list: -            p.rect.x -= scroll -        for e in enemy_list: -            e.rect.x -= scroll -                -    # scroll the world backward -    if player.rect.x <= backwardx: -        scroll = backwardx - player.rect.x -        player.rect.x = backwardx -        for p in plat_list: -            p.rect.x += scroll -        for e in enemy_list: -            e.rect.x += scroll - -    world.blit(backdrop, backdropbox) -    player.gravity() # check gravity -    player.update() -    player_list.draw(world) #refresh player position -    enemy_list.draw(world)  # refresh enemies -    ground_list.draw(world)  # refresh enemies -    plat_list.draw(world)   # refresh platforms -    for e in enemy_list: -        e.move() -    pygame.display.flip() -    clock.tick(fps) +#!/usr/bin/env python3 +# draw a world +# add a player and player control +# add player movement +# add enemy and basic collision +# add platform +# add gravity +# add jumping +# add scrolling + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os + +''' +Objects +''' + +class Platform(pygame.sprite.Sprite): + # x location, y location, img width, img height, img file + def __init__(self,xloc,yloc,imgw,imgh,img): + pygame.sprite.Sprite.__init__(self) + self.image = pygame.image.load(os.path.join('images',img)).convert() + self.image.convert_alpha() + self.rect = self.image.get_rect() + self.rect.y = yloc + self.rect.x = xloc + +class Player(pygame.sprite.Sprite): + ''' + Spawn a player + ''' + def __init__(self): + pygame.sprite.Sprite.__init__(self) + self.movex = 0 + self.movey = 0 + self.frame = 0 + self.health = 10 + self.collide_delta = 0 + self.jump_delta = 6 + self.score = 1 + self.images = [] + for i in range(1,9): + img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() + img.convert_alpha() + img.set_colorkey(ALPHA) + self.images.append(img) + self.image = self.images[0] + self.rect = self.image.get_rect() + + def jump(self,platform_list): + self.jump_delta = 0 + + def gravity(self): + self.movey += 3.2 # how fast player falls + + if self.rect.y > worldy and self.movey >= 0: + self.movey = 0 + self.rect.y = worldy-ty + + def control(self,x,y): + ''' + control player movement + ''' + self.movex += x + self.movey += y + + def update(self): + ''' + Update sprite position + ''' + + self.rect.x = self.rect.x + self.movex + self.rect.y = self.rect.y + self.movey + + # moving left + if self.movex < 0: + self.frame += 1 + if self.frame > ani*3: + self.frame = 0 + self.image = self.images[self.frame//ani] + + # moving right + if self.movex > 0: + self.frame += 1 + if self.frame > ani*3: + self.frame = 0 + self.image = self.images[(self.frame//ani)+4] + + # collisions + enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) + for enemy in enemy_hit_list: + self.health -= 1 + #print(self.health) + + plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) + for p in plat_hit_list: + self.collide_delta = 0 # stop jumping + self.movey = 0 + if self.rect.y > p.rect.y: + self.rect.y = p.rect.y+ty + else: + self.rect.y = p.rect.y-ty + + ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) + for g in ground_hit_list: + self.movey = 0 + self.rect.y = worldy-ty-ty + self.collide_delta = 0 # stop jumping + if self.rect.y > g.rect.y: + self.health -=1 + print(self.health) + + if self.collide_delta < 6 and self.jump_delta < 6: + self.jump_delta = 6*2 + self.movey -= 33 # how high to jump + self.collide_delta += 6 + self.jump_delta += 6 + +class Enemy(pygame.sprite.Sprite): + ''' + Spawn an enemy + ''' + def __init__(self,x,y,img): + pygame.sprite.Sprite.__init__(self) + self.image = pygame.image.load(os.path.join('images',img)) + self.movey = 0 + #self.image.convert_alpha() + #self.image.set_colorkey(ALPHA) + self.rect = self.image.get_rect() + self.rect.x = x + self.rect.y = y + self.counter = 0 + + + def move(self): + ''' + enemy movement + ''' + distance = 80 + speed = 8 + + self.movey += 3.2 + + if self.counter >= 0 and self.counter <= distance: + self.rect.x += speed + elif self.counter >= distance and self.counter <= distance*2: + self.rect.x -= speed + else: + self.counter = 0 + + self.counter += 1 + + if not self.rect.y >= worldy-ty-ty: + self.rect.y += self.movey + + plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) + for p in plat_hit_list: + self.movey = 0 + if self.rect.y > p.rect.y: + self.rect.y = p.rect.y+ty + else: + self.rect.y = p.rect.y-ty + + ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) + for g in ground_hit_list: + self.rect.y = worldy-ty-ty + + +class Level(): + def bad(lvl,eloc): + if lvl == 1: + enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy + enemy_list = pygame.sprite.Group() # create enemy group + enemy_list.add(enemy) # add enemy to group + + if lvl == 2: + print("Level " + str(lvl) ) + + return enemy_list + + def loot(lvl,lloc): + print(lvl) + + def ground(lvl,gloc,tx,ty): + ground_list = pygame.sprite.Group() + i=0 + if lvl == 1: + while i < len(gloc): + ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') + ground_list.add(ground) + i=i+1 + + if lvl == 2: + print("Level " + str(lvl) ) + + return ground_list + + def platform(lvl,tx,ty): + plat_list = pygame.sprite.Group() + ploc = [] + i=0 + if lvl == 1: + ploc.append((0,worldy-ty-128,3)) + ploc.append((300,worldy-ty-256,3)) + ploc.append((500,worldy-ty-128,4)) + + while i < len(ploc): + j=0 + while j <= ploc[i][2]: + plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') + plat_list.add(plat) + j=j+1 + print('run' + str(i) + str(ploc[i])) + i=i+1 + + if lvl == 2: + print("Level " + str(lvl) ) + + return plat_list + +''' +Setup +''' +worldx = 960 +worldy = 720 + +fps = 40 # frame rate +ani = 4 # animation cycles +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # spawn player +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 +forwardx = 600 +backwardx = 230 + +eloc = [] +eloc = [200,20] +gloc = [] +#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] +tx = 64 #tile size +ty = 64 #tile size + +i=0 +while i <= (worldx/tx)+tx: + gloc.append(i*tx) + i=i+1 + +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) +plat_list = Level.platform( 1,tx,ty ) + +''' +Main loop +''' +while main == True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit(); sys.exit() + main = False + + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT or event.key == ord('a'): + print("LEFT") + player.control(-steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + print("RIGHT") + player.control(steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') + + if event.type == pygame.KEYUP: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(-steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + player.jump(plat_list) + + if event.key == ord('q'): + pygame.quit() + sys.exit() + main = False + + # scroll the world forward + if player.rect.x >= forwardx: + scroll = player.rect.x - forwardx + player.rect.x = forwardx + for p in plat_list: + p.rect.x -= scroll + for e in enemy_list: + e.rect.x -= scroll + + # scroll the world backward + if player.rect.x <= backwardx: + scroll = backwardx - player.rect.x + player.rect.x = backwardx + for p in plat_list: + p.rect.x += scroll + for e in enemy_list: + e.rect.x += scroll + + world.blit(backdrop, backdropbox) + player.gravity() # check gravity + player.update() + player_list.draw(world) #refresh player position + enemy_list.draw(world) # refresh enemies + ground_list.draw(world) # refresh enemies + plat_list.draw(world) # refresh platforms + for e in enemy_list: + e.move() + pygame.display.flip() + clock.tick(fps) ``` -------------------------------------------------------------------------------- @@ -455,21 +447,21 @@ via: https://opensource.com/article/19/12/python-platformer-game-run 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) -[2]: https://opensource.com/article/17/10/python-101 -[3]: https://opensource.com/article/17/12/game-framework-python -[4]: https://opensource.com/article/17/12/game-python-add-a-player -[5]: https://opensource.com/article/17/12/game-python-moving-player -[6]: https://opensource.com/article/18/5/pygame-enemy -[7]: https://opensource.com/article/19/11/simulate-gravity-python -[8]: https://opensource.com/article/19/12/jumping-python-platformer-game +[2]: https://linux.cn/article-9071-1.html +[3]: https://linux.cn/article-10850-1.html +[4]: https://linux.cn/article-10858-1.html +[5]: https://linux.cn/article-10874-1.html +[6]: https://linux.cn/article-10883-1.html +[7]: https://linux.cn/article-11780-1.html +[8]: https://linux.cn/article-11790-1.html [9]: https://www.python.org/ [10]: https://www.pygame.org/news [11]: https://opensource.com/sites/default/files/uploads/pygame-scroll.jpg (Scrolling the world in Pygame) -[12]:https://opensource.com/article/18/7/put-platforms-python-game +[12]:https://linux.cn/article-10902-1.html From 244a6ec05a561390cbbdf887c1785efd05c26309 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Jan 2020 22:08:24 +0800 Subject: [PATCH 087/285] PUB @robsean https://linux.cn/article-11819-1.html --- ...ble your Python game player to run forward and backward.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191211 Enable your Python game player to run forward and backward.md (98%) diff --git a/translated/tech/20191211 Enable your Python game player to run forward and backward.md b/published/20191211 Enable your Python game player to run forward and backward.md similarity index 98% rename from translated/tech/20191211 Enable your Python game player to run forward and backward.md rename to published/20191211 Enable your Python game player to run forward and backward.md index 4efa93bd21..38d25cc1ab 100644 --- a/translated/tech/20191211 Enable your Python game player to run forward and backward.md +++ b/published/20191211 Enable your Python game player to run forward and backward.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11819-1.html) [#]: subject: (Enable your Python game player to run forward and backward) [#]: via: (https://opensource.com/article/19/12/python-platformer-game-run) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 354c69fd833d204d57e1d8d75d11361ad5dd23e6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 26 Jan 2020 00:55:46 +0800 Subject: [PATCH 088/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200125=20What?= =?UTF-8?q?=202020=20brings=20for=20the=20developer,=20and=20more=20indust?= =?UTF-8?q?ry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md --- ...the developer, and more industry trends.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md diff --git a/sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md b/sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md new file mode 100644 index 0000000000..e22735d21c --- /dev/null +++ b/sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What 2020 brings for the developer, and more industry trends) +[#]: via: (https://opensource.com/article/20/1/hybrid-developer-future-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +What 2020 brings for the developer, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [How developers will work in 2020][2] + +> Developers have been spending an enormous amount of time on everything *except* making software that solves problems. ‘DevOps’ has transmogrified from ‘developers releasing software’ into ‘developers building ever more complex infrastructure atop Kubernetes’ and ‘developers reinventing their software as distributed stateless functions.’ In 2020, ‘serverless’ will mature. Handle state. Handle data storage without requiring devs to learn yet-another-proprietary-database-service. Learning new stuff is fun-but shipping is even better, and we’ll finally see systems and services that support that. + +**The impact:** A lot of forces are converging to give developers superpowers. There are ever more open source building blocks in place; thousands of geniuses are collaborating to make developer workflows more fun and efficient, and artificial intelligences are being brought to bear solving the types of problems a developer might face. On the one hand, there is clear leverage to giving developer superpowers: if they can make magic with software they'll be able to make even bigger magic with all this help. On the other hand, imagine if teachers had the same level of investment and support. Makes ya wonder don't it? + +## [2020 forecast: Cloud-y with a chance of hybrid][3] + +> Behind this growth is an array of new themes and strategies that are pushing cloud further up business agendas the world over. With ‘emerging’ technologies, such as AI and machine learning, containers and functions, and even more flexibility available with hybrid cloud solutions being provided by the major providers, it’s no wonder cloud is set to take centre stage. + +**The impact:** Hybrid cloud finally has the same level of flesh that public cloud and on-premises have. Over the course of 2019 especially the competing visions offered for what it meant to be hybrid formed a composite that drove home why someone would want it. At the same time more and more of the technology pieces that make hybrid viable are in place and maturing. 2019 was the year that people truly "got" hybrid. 2020 will be the year that people start to take advantage of it. + +## [The no-code delusion][4] + +> Increasingly popular in the last couple of years, I think 2020 is going to be the year of “no code”: the movement that says you can write business logic and even entire applications without having the training of a software developer. I empathise with people doing this, and I think some of the “no code” tools are great. But I also thing it’s wrong at heart. + +**The impact:** I've heard many devs say it over many years: "software development is hard." It would be a mistake to interpret that as "all software development is equally hard." What I've always found hard about learning to code is trying to think in a way that a computer will understand. With or without code, making computers do complex things will always require a different kind of thinking. + +## [All things Java][5] + +> The open, multi-vendor model has been a major strength—it’s very hard for any single vendor to pioneer a market for a sustained period of time—and taking different perspectives from diverse industries has been a key strength of the [evolution of Java][6]. Choosing to open source Java in 2006 was also a decision that only worked to strengthen the Java ecosystem, as it allowed Sun Microsystems and later Oracle to share the responsibility of maintaining and evolving Java with many other organizations and individuals. + +**The impact:** The things that move quickly in technology are the things that can be thrown away. When you know you're going to keep something for a long time, you're likely to make different choices about what to prioritize when building it. Disposable and long-lived both have their places, and the Java community made enough good decisions over the years that the language itself can have a foot in both camps. + +_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/hybrid-developer-future-industry-trends + +作者:[Tim Hildred][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://thenextweb.com/readme/2020/01/15/how-developers-will-work-in-2020/ +[3]: https://www.itproportal.com/features/2020-forecast-cloud-y-with-a-chance-of-hybrid/ +[4]: https://www.alexhudson.com/2020/01/13/the-no-code-delusion/ +[5]: https://appdevelopermagazine.com/all-things-java/ +[6]: https://appdevelopermagazine.com/top-10-developer-technologies-in-2019/ From 3a1d79744d1f56579ed1128ea4a0fcfaa84c9552 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 26 Jan 2020 00:56:18 +0800 Subject: [PATCH 089/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200125=20Use=20?= =?UTF-8?q?tmux=20to=20create=20the=20console=20of=20your=20dreams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200125 Use tmux to create the console of your dreams.md --- ...ux to create the console of your dreams.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20200125 Use tmux to create the console of your dreams.md diff --git a/sources/tech/20200125 Use tmux to create the console of your dreams.md b/sources/tech/20200125 Use tmux to create the console of your dreams.md new file mode 100644 index 0000000000..adab130489 --- /dev/null +++ b/sources/tech/20200125 Use tmux to create the console of your dreams.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use tmux to create the console of your dreams) +[#]: via: (https://opensource.com/article/20/1/tmux-console) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use tmux to create the console of your dreams +====== +You can do a lot with tmux, especially when you add tmuxinator to the +mix. Check them out in the fifteenth in our series on 20 ways to be more +productive with open source in 2020. +![Person drinking a hat drink at the computer][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Do it all on the console with tmux and tmuxinator + +In this series so far, I've written about individual apps and tools. Starting today, I'll put them together into comprehensive setups to streamline things. Starting at the command line. Why the command line? Simply put, working at the command line allows me to access a lot of these tools and functions from anywhere I can run SSH. I can SSH into one of my personal machines and run the same setup on my work machine as I use on my personal one. And the primary tool I'm going to use for that is [tmux][2]. + +Most people use tmux for very basic functions, such as opening it on a remote server then starting a process, maybe opening a second session to watch log files or debug information, then disconnecting and coming back later. But you can do so much work with tmux. + +![tmux][3] + +First things first—if you have an existing tmux configuration file, back it up. The configuration file for tmux is **~/.tmux.conf**. Move it to another directory, like **~/tmp**. Now, clone the [Oh My Tmux][4] project with Git. Link to **.tmux.conf** from that and copy in the **.tmux.conf.local** file to make adjustments: + + +``` +cd ~ +mkdir ~/tmp +mv ~/.tmux.conf ~/tmp/ +git clone +ln -s ~/.tmux/.tmux.conf ./ +cp ~/.tmux.conf.local ./ +``` + +The **.tmux.conf.local** file contains local settings and overrides. For example, I changed the default colors a bit and turned on the [Powerline][5] dividers. This snippet shows only the things I changed: + + +``` +tmux_conf_theme_24b_colour=true +tmux_conf_theme_focused_pane_bg='default' +tmux_conf_theme_pane_border_style=fat +tmux_conf_theme_left_separator_main='\uE0B0' +tmux_conf_theme_left_separator_sub='\uE0B1' +tmux_conf_theme_right_separator_main='\uE0B2' +tmux_conf_theme_right_separator_sub='\uE0B3' +#tmux_conf_battery_bar_symbol_full='◼' +#tmux_conf_battery_bar_symbol_empty='◻' +tmux_conf_battery_bar_symbol_full='♥' +tmux_conf_battery_bar_symbol_empty='·' +tmux_conf_copy_to_os_clipboard=true +set -g mouse on +``` + +Note that you do not need to have Powerline installed—you just need a font that supports the Powerline symbols. I use [Hack Nerd Font][6] for almost everything console-related since it is easy for me to read and has many, many useful extra symbols. You'll also note that I turn on operating system clipboard support and mouse support. + +Now, when tmux starts up, the status bar at the bottom provides a bit more information—and in exciting colors. **Ctrl**+**b** is still the "leader" key for entering commands, but some others have changed. Splitting panes horizontally (top/bottom) is now **Ctrl**+**b**+**-** and vertically is now **Ctrl**+**b**+**_**. With mouse mode turned on, you can click to switch between the panes and drag the dividers to resize them. Opening a new window is still **Ctrl**+**b**+**n**, and you can now click on the window name on the bottom bar to switch between them. Also, **Ctrl**+**b**+**e** will open up the **.tmux.conf.local** file for editing. When you exit the editor, tmux will reload the configuration without reloading anything else. Very useful. + +So far, I've only made some simple changes to functionality and visual display and added mouse support. Now I'll set it up to launch the apps I want in a way that makes sense and without having to reposition and resize them every time. For that, I'll use [tmuxinator][7]. Tmuxinator is a launcher for tmux that allows you to specify and manage layouts and autostart applications with a YAML file. To use it, start tmux and create panes with the things you want running in them. Then, open a new window with **Ctrl**+**b**+**n**, and execute **tmux list-windows**. You will get detailed information about the layout. + +![tmux layout information][8] + +Note the first line in the code above where I set up four panes with an application in each one.** **Save the output from when you run it for later. Now, run **tmuxinator new 20days** to create a layout named **20days**. This will bring up a text editor with the default layout file. It has a lot of useful stuff in it, and I encourage you to read up on all the options. Start by putting in the layout information above and what apps you want where: + + +``` +# /Users/ksonney/.config/tmuxinator/20days.yml +name: 20days +root: ~/ +windows: +   - mail: +      layout: d9da,208x60,0,0[208x26,0,0{104x26,0,0,0,103x26,105,0,5},208x33,0,27{104x33,0,27,1,103x33,105,27,4}]] @0 +      panes: +        - alot +        - abook +        - ikhal +        - todo.sh ls +20days +``` + +Be careful with the spaces! Like Python code, the spaces and indentation matter to how the file is interpreted. Save the file and then run **tmuxinator 20days**. You should get four panes with the [alot][9] mail program, [abook][10], ikhal (a shortcut to [khal][11] interactive), and anything in [todo.txt][12] with the tag **+20days**. + +![sample layout launched by tmuxinator][13] + +You'll also notice that the window on the bottom bar is labeled Mail. You can click on the name (along with other named windows) to jump to that view. Nifty, right? I set up a second window named Social with [Tuir][14], [Newsboat][15], an IRC client connected to [BitlBee][16], and [Rainbow Stream][17] in the same file. + +Tmux is my productivity powerhouse for keeping track of all the things, and with tmuxinator, I don't have to worry about constantly resizing, placing, and launching my applications. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/tmux-console + +作者:[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/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://github.com/tmux/tmux +[3]: https://opensource.com/sites/default/files/uploads/productivity_15-1.png (tumux) +[4]: https://github.com/gpakosz/.tmux +[5]: https://github.com/powerline/powerline +[6]: https://www.nerdfonts.com/ +[7]: https://github.com/tmuxinator/tmuxinator +[8]: https://opensource.com/sites/default/files/uploads/productivity_15-2.png (tmux layout information) +[9]: https://opensource.com/article/20/1/organize-email-notmuch +[10]: https://opensource.com/article/20/1/sync-contacts-locally +[11]: https://opensource.com/article/20/1/open-source-calendar +[12]: https://opensource.com/article/20/1/open-source-to-do-list +[13]: https://opensource.com/sites/default/files/uploads/productivity_15-3.png (sample layout launched by tmuxinator) +[14]: https://opensource.com/article/20/1/open-source-reddit-client +[15]: https://opensource.com/article/20/1/open-source-rss-feed-reader +[16]: https://opensource.com/article/20/1/open-source-chat-tool +[17]: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream From c9d822b131fdeaf58cbb439a8b1d8c033d0ffe18 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 26 Jan 2020 09:19:05 +0800 Subject: [PATCH 090/285] Rename sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md to sources/news/20200125 What 2020 brings for the developer, and more industry trends.md --- ...hat 2020 brings for the developer, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200125 What 2020 brings for the developer, and more industry trends.md (100%) diff --git a/sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md b/sources/news/20200125 What 2020 brings for the developer, and more industry trends.md similarity index 100% rename from sources/tech/20200125 What 2020 brings for the developer, and more industry trends.md rename to sources/news/20200125 What 2020 brings for the developer, and more industry trends.md From 9f2a7520b7a153ac3ae20729dc1ba0684e2ce6cf Mon Sep 17 00:00:00 2001 From: laingke Date: Sun, 26 Jan 2020 16:49:36 +0800 Subject: [PATCH 091/285] 20200122-setting-up-passwordless-linux-logins-using-publicprivate-keys translating --- ... up passwordless Linux logins using public-private keys.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md b/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md index 2c61a4942b..54955ca562 100644 --- a/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md +++ b/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (laingke) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -198,7 +198,7 @@ via: https://www.networkworld.com/article/3514607/setting-up-passwordless-linux- 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[laingke](https://github.com/laingke) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 303716e43fa28d7b36fbf2ce9a9e99591e6c8998 Mon Sep 17 00:00:00 2001 From: laingke Date: Sun, 26 Jan 2020 17:53:16 +0800 Subject: [PATCH 092/285] 20200122-setting-up-passwordless-linux-logins-using-publicprivate-keys translated --- ... Linux logins using public-private keys.md | 69 ++++++++----------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md b/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md index 54955ca562..0e4a4de626 100644 --- a/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md +++ b/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -7,51 +7,40 @@ [#]: via: (https://www.networkworld.com/article/3514607/setting-up-passwordless-linux-logins-using-publicprivate-keys.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -Setting up passwordless Linux logins using public/private keys +使用公钥/私钥对设定免密的 Linux 登录方式 ====== -Using a set of public/private keys to allow you to log into a remote Linux system or run commands using ssh without a password can be very convenient, but setup is just tad tricky. Here's how and a script to help. -Ivanastar / Getty Images +使用一组公钥/私钥对让你不需要密码登录到远程 Linux 系统或使用 ssh 运行命令,这会非常方便,但是设置过程有点复杂。下面是帮助你的方法和脚本。 -Setting up an account on a [Linux][1] system that allows you to log in or run commands remotely without a password isn’t all that hard, but there are some tedious details that you need to get right if you want it to work. In this post, we’re going to run through the process and then show a script that can help manage the details. +在 [Linux][1] 系统上设置一个允许你无需密码即可远程登录或运行命令的帐户并不难,但是要使它正常工作,你还需要掌握一些繁琐的细节。在本文,我们将完成整个过程,然后给出一个可以帮助处理琐碎细节的脚本。 -Once set up, passwordless access is especially useful if you want to run ssh commands within a script, especially one that you might want to schedule to run automatically. +设置好之后,如果希望在脚本中运行 ssh 命令,尤其是希望配置自动运行的命令,那么免密访问特别有用。 -It’s important to note that you do not have to be using the same user account on both systems. In fact, you can use your public key for a number of accounts on a system or for different accounts on multiple systems. +需要注意的是,你不需要在两个系统上使用相同的用户帐户。实际上,你可以把公用密钥用于系统上的多个帐户或多个系统上的不同帐户。 -[][2] +设置方法如下。 -BrandPost Sponsored by HPE +### which system to start on?在哪个系统上启动? -[Take the Intelligent Route with Consumption-Based Storage][2] +首先,你需要从要发出命令的系统上着手。那就是你用来创建 ssh 密钥的系统。你还需要访问远程系统上的帐户并在其上运行这些命令。 -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. +为了使角色清晰明了,我们将场景中的第一个系统称为“boss”,因为它将发出要在另一个系统上运行的命令。 -Here’s how to set this up. - -### Which system to start on? - -First, you need to start on the system from which you want to issue commands. That's the system that you will use to create the ssh keys.  You also need to have access to the account on the remote system on which those commands will be run. - -To keep the roles clear, we’ll call that first system in our scenario the “boss” since it will issue commands to be run on the other system. - -Thus, the command prompt: - -[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][3] +因此,命令提示符如下: ``` boss$ ``` -If you do not already have a public/private key pair set up for your account on the boss system, create one using a command like that shown below. Note that you can choose between the various encryption algorithms. (Either RSA or DSA is generally used.) Note that to access the system without typing a password, you will need to enter no password for the two prompts shown in the dialog below. +如果您还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用RSA或DSA。)注意,要在不输入密码的情况下访问系统,您需要在下面的对话框中输入两个提示符的密码。 -If you already have a public/private key pair associated with this account, skip this step. +如果你已经有一个与此帐户关联的公钥/私钥对,请跳过此步骤。 ``` boss$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/myself/.ssh/id_rsa): -Enter passphrase (empty for no passphrase): <== just press the enter key -Enter same passphrase again: <== just press the enter key +Enter passphrase (empty for no passphrase): <== 按下回车键即可 +Enter same passphrase again: <== 按下回车键即可 Your identification has been saved in /home/myself/.ssh/id_rsa. Your public key has been saved in /home/myself/.ssh/id_rsa.pub. The key fingerprint is: @@ -70,18 +59,18 @@ The key's randomart image is: +----[SHA256]-----+ ``` -The command shown above will create both a public and a private key. What one encrypts, the other will decrypt. So, the relationship between these keys is critical and the private key should **never** be shared. Instead, it should stay in your .ssh folder on the boss system. +上面显示的命令将创建公钥和私钥。其中公钥用于加密,私钥用于解密。因此,这些密钥之间的关系是关键的,私有密钥**绝不**应该被共享。相反,它应该保存在 boss 系统的 .ssh 文件夹中。 -Notice that your public and private keys, on creation, will be saved in your .ssh folder. +注意,在创建时,你的公钥和私钥将会保存在 .ssh 文件夹中。 -The next step is to copy the **public** key to the system you want to access from the boss system without using a password. You can use **scp** to do this though, at this point, you’ll still need to enter your password. In this example, that system is called “target”. +下一步是将**公钥**复制到你希望从 boss 系统免密访问的系统。你可以使用 **scp** 命令来完成此操作,但此时你仍然需要输入密码。在本例中,该系统称为“target”。 ``` boss$ scp .ssh/id_rsa.pub myacct@target:/home/myaccount myacct@target's password: ``` -On the target system (the one on which the commands will be run), you will need to install your public key. If you don’t have a .ssh directory (e.g., if you’ve never used ssh on that system), running a command like this will set one up for you: +你需要安装公钥在 target 系统(将运行命令的系统)上。如果你没有 .ssh 目录(例如,你从未在该系统上使用过 ssh),运行这样的命令将为你设置一个目录: ``` target$ ssh localhost date @@ -92,33 +81,33 @@ drwxr-xr-x 6 myacct myacct 4096 Jan 19 11:49 .. -rw-r--r-- 1 myacct myacct 222 Jan 19 11:48 known_hosts ``` -Still on the target system, you then need to add the public key you transferred from the “boss” system to your .ssh/authorized_keys file. The command below will add the key to the end of the file if it exists already or create the file and add the key if the file does not exist. +仍然在目标系统上,你需要将从“boss”系统传输的公钥添加到 .ssh/authorized_keys 文件中。如果密钥已经存在,使用下面的命令将把它添加到文件的末尾;如果文件不存在,则创建文件并添加密钥。 ``` target$ cat id_rsa.pub >> .ssh/authorized_keys ``` -Next, you need to make sure that the permissions on your authorized_keys file are set to 600. If not, run the **chmod 600 .ssh/authorized_keys** command. +下一步,你需要确保你的 authorized_keys 文件权限为 600。如果还不是,执行命令 ```chmod 600 .ssh/authorized_keys```。 ``` target$ ls -l authorized_keys -rw------- 1 myself myself 569 Jan 19 12:10 authorized_keys ``` -Also check to be sure that permissions on your .ssh directory on the target system are set to 700. Fix the permissions with **chmod 700 .ssh** if needed. +还要检查目标系统上 .ssh 目录的权限是否设置为 700。如果需要,执行 ```chmod 700 .ssh``` 命令修改权限。 ``` target$ ls -ld .ssh drwx------ 2 myacct myacct 4096 Jan 14 15:54 .ssh ``` -At this point, you should be able to run a command remotely from your boss system to your target system without entering a password. This should work unless the target user account on the target system has an old public key for the same user and host as the one you’re trying to connect from. If so, you should be able to remove the earlier (and conflicting) entry. +此时,你应该能够从 boss 系统远程免密运行命令到目标系统。除非目标系统上的目标用户帐户拥有与你试图连接的用户和主机相同的旧公钥,否则这应该可以工作。如果是这样,你应该删除早期的(并冲突的)条目。 -### Using a script +### 使用脚本 -Using a script can make some work a lot easier. In the example script below, however, the one annoying problem that you’ll run into is that you’ll have to enter the target user’s password numerous times before the password-free access is configured. One option would be to break the script into two parts – the commands that need to be run on the boss system and the commands that need to be run on the target system. +使用脚本可以使某些工作变得更加容易。但是,在下面的示例脚本中,你会遇到的一个烦人的问题是,在配置免密访问权限之前,你必须多次输入目标用户的密码。一种选择是将脚本分为两部分——需要在 boss 系统上运行的命令和需要在 target 系统上运行的命令。 -Here’s the do-it-all version of the script: +这是“一步到位”版本的脚本: ``` #!/bin/bash @@ -162,7 +151,7 @@ echo testing -- if no password is requested, you are all set ssh $user@$REM /bin/hostname ``` -The script has been configured to tell you what it is doing each time you will have to enter a password. Interaction will look something like this: +脚本已经配置为在你每次必须输入密码时告诉你它正在做什么。交互看起来是这样的: ``` $ ./rem_login_setup @@ -181,16 +170,14 @@ testing -- if no password is requested, you are all set fruitfly ``` -After the scenario shown above, you'd be able to log into lola's account on fruitfly like this: +在上面的场景之后,你就可以像这样登录到 lola 的帐户: ``` $ ssh lola@fruitfly [lola@fruitfly ~]$ ``` -Once passwordless login is set up, you’ll both be able to log in from the boss system to the target system without a password and run arbitrary ssh commands. Running without a password in this way does not imply that your account is less secure. However, protecting your password on the boss system could become considerably more important depending on the nature of the target. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. +一旦设置了免密登录,你就可以不需要键入密码从 boss 系统登录到 target 系统,并且运行任意的 ssh 命令。以这种免密的方式运行并不意味着你的帐户不安全。然而,根据target 系统的性质,保护您在 boss 系统上的密码可能变得更加重要。 -------------------------------------------------------------------------------- From f2af0e43a98396f6ed51d5d515dc42a768a21745 Mon Sep 17 00:00:00 2001 From: laingke Date: Sun, 26 Jan 2020 17:55:57 +0800 Subject: [PATCH 093/285] 20200122-setting-up-passwordless-linux-logins-using-publicprivate-keys move to translated --- ...ting up passwordless Linux logins using public-private keys.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200122 Setting up passwordless Linux logins using public-private keys.md (100%) diff --git a/sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md b/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md similarity index 100% rename from sources/tech/20200122 Setting up passwordless Linux logins using public-private keys.md rename to translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md From 68ca7e0157b0004d5d91d3fae7c57704aa0ecc2e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Jan 2020 20:03:27 +0800 Subject: [PATCH 094/285] APL --- ...save your tasks - and your sanity - if SSH is interrupted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md b/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md index 5de0f02b79..53d5f1cd45 100644 --- a/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md +++ b/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 06dec5a5d50f16c14d7176d75b9ac17e1bf76753 Mon Sep 17 00:00:00 2001 From: laingke Date: Sun, 26 Jan 2020 20:52:35 +0800 Subject: [PATCH 095/285] 20200115-webassembly translating --- .../20200115 Why everyone is talking about WebAssembly.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200115 Why everyone is talking about WebAssembly.md b/sources/tech/20200115 Why everyone is talking about WebAssembly.md index 80b5a83060..5350f911b9 100644 --- a/sources/tech/20200115 Why everyone is talking about WebAssembly.md +++ b/sources/tech/20200115 Why everyone is talking about WebAssembly.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (laingke) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -62,7 +62,7 @@ via: https://opensource.com/article/20/1/webassembly 作者:[Mike Bursell][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[laingke](https://github.com/laingke) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9ef8e9bf3749687df3d3c9ff51fed22cc785ebf8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Jan 2020 21:21:08 +0800 Subject: [PATCH 096/285] TSL --- ...and your sanity - if SSH is interrupted.md | 119 ------------------ ...and your sanity - if SSH is interrupted.md | 107 ++++++++++++++++ 2 files changed, 107 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md create mode 100644 translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md diff --git a/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md b/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md deleted file mode 100644 index 53d5f1cd45..0000000000 --- a/sources/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How the Linux screen tool can save your tasks – and your sanity – if SSH is interrupted) -[#]: via: (https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How the Linux screen tool can save your tasks – and your sanity – if SSH is interrupted -====== -The Linux screen command can be a life-saver when you need to ensure long-running tasks don't get killed when an SSH session is interrupted. Here's how to use it. -Sandra Henry-Stocker - -If you’ve ever had to restart a time-consuming process because your SSH session was disconnected, you might be very happy to learn about an interesting tool that you can use to avoid this problem – the **screen** tool. - -Screen, which is a terminal multiplexor, allows you to run many terminal sessions within a single ssh session, detaching from them and reattaching them as needed. The process for doing this is surprising simple and involves only a handful of commands. - -**[ Two-Minute Linux Tips: [Learn how to master a host of Linux commands in these 2-minute video tutorials][1] ]** - -To start a screen session, you simply type **screen** within your ssh session. You then start your long-running process, type **Ctrl+A Ctrl+D** to detach from the session and **screen -r** to reattach when the time is right. - -[][2] - -BrandPost Sponsored by HPE - -[Take the Intelligent Route with Consumption-Based Storage][2] - -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. - -If you’re going to run more than one screen session, a better option is to give each session a meaningful name that will help you remember what task is being handled in it. Using this approach, you would name each session when you start it by using a command like this: - -``` -$ screen -S slow-build -``` - -Once you have multiple sessions running, reattaching to one then requires that you pick it from the list. In the commands below, we list the currently running sessions before reattaching one of them. Notice that initially both sessions are marked as being detached. - -Advertisement - -``` -$ screen -ls -There are screens on: - 6617.check-backups (09/26/2019 04:35:30 PM) (Detached) - 1946.slow-build (09/26/2019 02:51:50 PM) (Detached) -2 Sockets in /run/screen/S-shs -``` - -Reattaching to the session then requires that you supply the assigned name. For example: - -``` -$ screen -r slow-build -``` - -The process you left running should have continued processing while it was detached and you were doing some other work. If you ask about your screen sessions while using one of them, you should see that the session you’re currently reattached to is once again “attached.” - -``` -$ screen -ls -There are screens on: - 6617.check-backups (09/26/2019 04:35:30 PM) (Attached) - 1946.slow-build (09/26/2019 02:51:50 PM) (Detached) -2 Sockets in /run/screen/S-shs. -``` - -You can ask what version of screen you’re running with the **-version** option. - -``` -$ screen -version -Screen version 4.06.02 (GNU) 23-Oct-17 -``` - -### Installing screen - -If “which screen” doesn’t provide information on screen, it probably isn't installed on your system. - -``` -$ which screen -/usr/bin/screen -``` - -If you need to install it, one of the following commands is probably right for your system: - -``` -sudo apt install screen -sudo yum install screen -``` - -The screen tool comes in handy whenever you need to run time-consuming processes that could be interrupted if your SSH session for any reason disconnects. And, as you've just seen, it’s very easy to use and manage. - -Here's a recap of the commands used above: - -``` -screen -S start a session -Ctrl+A Ctrl+D detach from a session -screen -ls list sessions -screen -r reattach a session -``` - -While there is more to know about **screen**, including additional ways that you can maneuver between screen sessions, this should get you started using this handy tool. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md b/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md new file mode 100644 index 0000000000..1a21ab7cb8 --- /dev/null +++ b/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How the Linux screen tool can save your tasks – and your sanity – if SSH is interrupted) +[#]: via: (https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如果 SSH 被中断,Linux screen 工具如何拯救你的任务以及理智 +====== + +> 当你需要确保长时间运行的任务不会在 SSH 会话中断时被杀死时,Linux screen 命令可以成为救生员。以下是使用方法。 + +![](https://images.idgesg.net/images/article/2019/09/working_w_screen-shs-100812448-large.jpg) + +如果因 SSH 会话断开而不得不重启一个耗时的进程,那么你可能会很高兴了解一个有趣的工具,可以用来避免此问题:`screen` 工具。 + +`screen` 是一个终端多路复用器,它使你可以在单个 SSH 会话中运行多个终端会话,并随时从它们之中脱离或重新接驳。做到这一点的过程非常简单,仅涉及少数命令。 + +要启动 `screen` 会话,只需在 SSH 会话中键入 `screen`。 然后,你可以开始启动需要长时间运行的进程,并在适当的时候键入 `Ctrl + A Ctrl + D` 从会话中脱离,然后键入 `screen -r` 重新接驳。 + +如果你要运行多个 `screen` 会话,更好的选择是为每个会话指定一个有意义的名称,以帮助你记住正在处理的任务。使用这种方法,你可以在启动每个会话时使用如下命令命名: + +``` +$ screen -S slow-build +``` + +一旦运行了多个会话,要重新接驳到一个会话,需要从列表中选择它。在以下命令中,我们列出了当前正在运行的会话,然后再重新接驳其中一个。请注意,一开始这两个会话都被标记为已脱离。 + +``` +$ screen -ls +There are screens on: + 6617.check-backups (09/26/2019 04:35:30 PM) (Detached) + 1946.slow-build (09/26/2019 02:51:50 PM) (Detached) +2 Sockets in /run/screen/S-shs +``` + +然后,重新接驳到该会话要求你提供分配给会话的名称。例如: + +``` +$ screen -r slow-build +``` + +在脱离的会话中,保持运行状态的进程会继续进行处理,而你可以执行其他工作。如果你使用这些 `screen` 会话之一来查询 `screen` 会话情况,可以看到当前重新接驳的会话再次显示为 `Attached`。 + +``` +$ screen -ls +There are screens on: + 6617.check-backups (09/26/2019 04:35:30 PM) (Attached) + 1946.slow-build (09/26/2019 02:51:50 PM) (Detached) +2 Sockets in /run/screen/S-shs. +``` + +你可以使用 `-version` 选项查询正在运行的 `screen` 版本。 + +``` +$ screen -version +Screen version 4.06.02 (GNU) 23-Oct-17 +``` + +### 安装 screen + +如果 `which screen` 未在屏幕上提供信息,则可能你的系统上未安装该工具。 + +``` +$ which screen +/usr/bin/screen +``` + +如果你需要安装它,则以下命令之一可能适合你的系统: + +``` +sudo apt install screen +sudo yum install screen +``` + +当你需要运行耗时的进程时,如果你的 SSH 会话由于某种原因断开连接,则可能会中断这个耗时的进程,那么 `screen` 工具就会派上用场。而且,如你所见,它非常易于使用和管理。 + +以下是上面使用的命令的摘要: + +``` +screen -S 开始会话 +Ctrl+A Ctrl+D 从会话中脱离 +screen -ls 列出会话 +screen -r 重新接驳会话 +``` + +尽管还有更多关于 `screen` 的知识,包括可以在 `screen` 会话之间进行操作的其他方式,但这已经足够帮助你开始使用这个便捷的工具了。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 432ac402e1d5a34a852f8d861dd3f91a9ad888dc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Jan 2020 21:28:30 +0800 Subject: [PATCH 097/285] PRF --- ...ve your tasks - and your sanity - if SSH is interrupted.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md b/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md index 1a21ab7cb8..aab83633d3 100644 --- a/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md +++ b/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How the Linux screen tool can save your tasks – and your sanity – if SSH is interrupted) @@ -95,7 +95,7 @@ via: https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can- 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9216028c55acfbe265919ff0cb46496c62be92b2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Jan 2020 21:29:09 +0800 Subject: [PATCH 098/285] PUB @wxy https://linux.cn/article-11822-1.html --- ...ve your tasks - and your sanity - if SSH is interrupted.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md (98%) diff --git a/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md b/published/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md similarity index 98% rename from translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md rename to published/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md index aab83633d3..f52dbd55f6 100644 --- a/translated/tech/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md +++ b/published/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11822-1.html) [#]: subject: (How the Linux screen tool can save your tasks – and your sanity – if SSH is interrupted) [#]: via: (https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 88ddf5a0002c9a7d56cf08ea54b8dcec8d161abb Mon Sep 17 00:00:00 2001 From: laingke Date: Sun, 26 Jan 2020 22:56:14 +0800 Subject: [PATCH 099/285] 20200115-webassembly translated --- ...y everyone is talking about WebAssembly.md | 85 ------------------ ...y everyone is talking about WebAssembly.md | 86 +++++++++++++++++++ 2 files changed, 86 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20200115 Why everyone is talking about WebAssembly.md create mode 100644 translated/tech/20200115 Why everyone is talking about WebAssembly.md diff --git a/sources/tech/20200115 Why everyone is talking about WebAssembly.md b/sources/tech/20200115 Why everyone is talking about WebAssembly.md deleted file mode 100644 index 5350f911b9..0000000000 --- a/sources/tech/20200115 Why everyone is talking about WebAssembly.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (laingke) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why everyone is talking about WebAssembly) -[#]: via: (https://opensource.com/article/20/1/webassembly) -[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) - -Why everyone is talking about WebAssembly -====== -Learn more about the newest way to run any code in a web browser. -![Digital creative of a browser on the internet][1] - -If you haven’t heard of [WebAssembly][2] yet, then you will soon. It’s one of the industry’s best-kept secrets, but it’s everywhere. It’s supported by all the major browsers, and it’s coming to the server-side, too. It’s fast. It’s being used for gaming. It’s an open World Wide Web Consortium (W3C), the main international standards organization for the web, standard. It’s platform-neutral and can run on Linux, Macs, and Windows. - -"Wow," you may be saying, "this sounds like something I should learn to code in!" You’d be right, but you’d be wrong too; you don’t code in WebAssembly. Let’s take some time to learn about the technology that’s often fondly abbreviated to "Wasm." - -### Where did it come from? - -Going back about ten years, there was a growing recognition that the widely-used JavaScript wasn’t fast enough for many purposes. JavaScript was undoubtedly successful and convenient. It ran in any browser and enabled the type of dynamic web pages that we take for granted today. But it was a high-level language and wasn’t designed with compute-intensive workloads in mind. - -However, although engineers responsible for the leading web browsers were generally in agreement about the performance problem, they weren’t aligned on what to do about it. Two camps emerged. Google began its Native Client project and, later, its Portable Native Client variation, to focus on allowing games and other software written in C/C++ to run in a secure compartment within Chrome. Mozilla, meanwhile, won the backing of Microsoft for asm.js, an approach that updated the browser so it can run a low-level subset of JavaScript instructions very quickly (another project enabled the conversion of C/C++ code into these instructions). - -With neither camp gaining widespread adoption, the various parties agreed to join forces in 2015 around a new standard called WebAssembly that built on the basic approach taken by asm.js. [As CNET’s Stephen Shankland wrote at the time][3], "On today’s Web, the browser’s JavaScript translates those instructions into machine code. But with WebAssembly, the programmer does a lot of the work earlier in the process, producing a program that’s in between the two states. That frees the browser from a lot of the hard work of creating the machine code, but it also fulfills the promise of the Web—that software will run on any device with a browser regardless of the underlying hardware details." - -In 2017, Mozilla declared it to be a minimum viable product and brought it out of preview. All the main browsers had adopted it by the end of that year. [In December 2019][4], the WebAssembly Working Group published the three WebAssembly specifications as W3C recommendations. - -WebAssembly defines a portable binary code format for executable programs, a corresponding textual assembly language, and interfaces for facilitating interactions between such programs and their host environment. WebAssembly code runs within a low-level virtual machine that mimics the functionality of the many microprocessors upon which it can be run. Either through Just-In-Time (JIT) compilation or interpretation, the WebAssembly engine can perform at nearly the speed of code compiled for a native platform. - -### Why the interest now? - -Certainly, some of the recent interest in WebAssembly stems from that initial desire to run more compute-intensive code in browsers. Laptop users, in particular, are spending more and more of their time in a browser (or, in the case of Chromebooks, essentially all their time). This trend has created an urgency around removing barriers to running a broad range of applications within a browser. And one of those barriers is often some aspect of performance, which is what WebAssembly and its predecessors were originally conceived to address. - -However, WebAssembly isn’t just for browsers. In 2019, [Mozilla announced a project called WASI][5] (WebAssembly System Interface) to standardize how WebAssembly code interacts with operating systems outside of a browser context. With the combination of browser support for WebAssembly and WASI, compiled binaries will be able to run both within and without browsers, across different devices and operating systems, at near-native speeds. - -WebAssembly’s low overhead immediately makes it practical for use beyond browsers, but that’s arguably table stakes; there are obviously other ways to run applications that don’t introduce performance bottlenecks. Why use WebAssembly, specifically? - -One important reason is its portability. Widely used compiled languages like C++ and Rust are probably the ones most associated with WebAssembly today. However, [a wide range of other languages][6] compile to or have their virtual machines in WebAssembly. Furthermore, while WebAssembly [assumes certain prerequisites][7] for its execution environments, it is designed to execute efficiently on a variety of operating systems and instruction set architectures. WebAssembly code can, therefore, be written using a wide range of languages and run on a wide range of operating systems and processor types. - -Another WebAssembly advantage stems from the fact that code runs within a virtual machine. As a result, each WebAssembly module executes within a sandboxed environment, separated from the host runtime using fault isolation techniques. This implies, among other things, that applications execute in isolation from the rest of their host environment and can’t escape the sandbox without going through appropriate APIs. - -### WebAssembly in action - -What does all this mean in practice? - -One example of WebAssembly in action is [Enarx][8]. - -Enarx is a project that provides hardware independence for securing applications using Trusted Execution Environments (TEE). Enarx lets you securely deliver an application compiled into WebAssembly all the way into a cloud provider and execute it remotely. As Red Hat security engineer [Nathaniel McCallum puts it][9], "The way that we do this is, we take your application as inputs, and we perform an attestation process with the remote hardware. We validate that the remote hardware is, in fact, the hardware that it claims to be, using cryptographic techniques. The end result of that is not only an increased level of trust in the hardware that we’re speaking to; it’s also a session key, which we can then use to deliver encrypted code and data into this environment that we have just asked for cryptographic attestation on." - -Another example is OPA, the Open Policy Agent, which [announced][10] in November 2019 that you could [compile][11] their policy definition language, Rego, into WebAssembly. Rego lets you write logic to search and combine JSON/YAML data from different sources to ask questions like, "Is this API allowed?" - -OPA has been used to policy-enable software including, but not limited to, Kubernetes. Simplifying policy using tools like OPA [is considered an important step][12] for properly securing Kubernetes deployments across a variety of different environments. WebAssembly’s portability and built-in security features are a good match for these tools. - -Our last example is [Unity][13]. Remember, we mentioned at the beginning of the article that WebAssembly is used for gaming? Well, Unity, the cross-platform game engine, was an early adopter of WebAssembly, providing the first demo of Wasm running in browsers, and, since August 2018, [has used WebAssembly][14] as the output target for the Unity WebGL build target. - -These are just a few of the ways WebAssembly has already begun to make an impact. Find out more and keep up to date with all things Wasm at - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/webassembly - -作者:[Mike Bursell][a] -选题:[lujun9972][b] -译者:[laingke](https://github.com/laingke) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mikecamel -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://opensource.com/article/19/8/webassembly-speed-code-reuse -[3]: https://www.cnet.com/news/the-secret-alliance-that-could-give-the-web-a-massive-speed-boost/ -[4]: https://www.w3.org/blog/news/archives/8123 -[5]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ -[6]: https://github.com/appcypher/awesome-wasm-langs -[7]: https://webassembly.org/docs/portability/ -[8]: https://enarx.io -[9]: https://enterprisersproject.com/article/2019/9/application-security-4-facts-confidential-computing-consortium -[10]: https://blog.openpolicyagent.org/tagged/webassembly -[11]: https://github.com/open-policy-agent/opa/tree/master/wasm -[12]: https://enterprisersproject.com/article/2019/11/kubernetes-reality-check-3-takeaways-kubecon -[13]: https://opensource.com/article/20/1/www.unity.com -[14]: https://blogs.unity3d.com/2018/08/15/webassembly-is-here/ diff --git a/translated/tech/20200115 Why everyone is talking about WebAssembly.md b/translated/tech/20200115 Why everyone is talking about WebAssembly.md new file mode 100644 index 0000000000..5da77c0d4d --- /dev/null +++ b/translated/tech/20200115 Why everyone is talking about WebAssembly.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: (laingke) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why everyone is talking about WebAssembly) +[#]: via: (https://opensource.com/article/20/1/webassembly) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) + +为什么每个人都在谈论 WebAssembly +====== +了解有关在 Web 浏览器中运行任何代码的最新方法的更多信息。 +![Digital creative of a browser on the internet][1] + +如果你还没有听说过 [WebAssembly][2],那么你很快就会知道。这是业界保存最完好的秘密之一,但无处不在。所有主流的浏览器都支持它,并且它也将在服务器端使用。它很快。它被用于游戏。这是一个开放的万维网联盟(W3C),主要的国际网络标准组织。它与平台无关,可以在 Linux,Mac 和 Windows 上运行。 + +你可能会说:“哇,这听起来像是我应该学习编程的东西!” 你可能是对的,但你也可能是错的。你不需要用 WebAssembly 编码。让我们花一些时间来学习通常被缩写为“Wasm”的技术。 + +### 它从哪里来? + +大约十年前,人们越来越认识到,广泛使用的 JavaScript 不够快速,无法满足许多目的。JavaScript 无疑是成功和方便的。它可以在任何浏览器中运行,并启用了今天我们认为理所当然的动态网页类型。但这是一种高级语言,在设计时并没有考虑到计算密集型工作负载。 + +然而,尽管负责主流 web 浏览器的工程师们对性能问题的看法大体一致,但他们对如何解决这个问题却意见不一。两个阵营出现。谷歌开始了它的原生客户端Native Client项目,后来又推出了可移植原生客户端Portable Native Client变体,着重于允许用 C/C++ 编写的游戏和其它软件在 Chrome 的一个安全隔间中运行。与此同时,Mozilla 赢得了微软对 asm.js 的支持。该方法更新了浏览器,因此它可以非常快速地运行底层的 JavaScript 指令子集(另一个项目使 C/C++ 代码可以转换为这些指令)。 + +在这两个阵营都没有得到广泛采用的情况下,各方在 2015 年同意围绕一种称为 WebAssembly 的新标准,以 asm.js 所采用的基本方法为基础,共同努力。[如 CNET 的 Stephen Shankland 当时所写][3],“在当今的 Web 上,浏览器的 JavaScript 将这些指令转换为机器代码。但是,通过 WebAssembly,程序员可以在此过程的早期阶段完成很多工作,从而生成介于两种状态之间的程序。这使浏览器摆脱了创建机器代码的繁琐工作,但也实现了 Web 的承诺——该软件将在具有浏览器的任何设备上运行,而无需考虑基础硬件的详细信息。” + +在 2017 年,Mozilla 宣布了它的最小可行的产品,并使其脱离预览版。到该年年底,所有主流的浏览器都采用了它。[2019 年 12 月][4],WebAssembly 工作组发布了三个 W3C 推荐的 WebAssembly 规范。 + +WebAssembly 为可执行程序、相应的文本汇编语言以及用于促进此类程序与其主机环境之间的交互的接口定义了一种可移植的二进制代码格式。WebAssembly 代码在低级虚拟机中运行,该虚拟机模仿可以在其上运行的许多微处理器的功能。通过即时(JIT)编译或解释,WebAssembly 引擎可以以近乎原生平台编译代码的速度执行。 + +### 为什么现在感兴趣? + +当然,最近对 WebAssembly 感兴趣的部分原因是最初希望在浏览器中运行更多计算密集型代码。尤其是笔记本电脑用户,越来越多的时间都花在浏览器上(或者,对于 Chromebook 用户来说,基本上是所有时间)。这种趋势已经迫切需要消除在浏览器中运行各种应用程序的障碍。这些障碍之一通常是性能的某些方面,这正是 WebAssembly 及其前身最初旨在解决的问题。 + +但是,WebAssembly 并不仅仅适用于浏览器。在 2019 年,[Mozilla 宣布了一个名为 WASI][5](WebAssembly 系统接口)的项目,以标准化 WebAssembly 代码如何与浏览器上下文之外的操作系统进行交互。通过将浏览器对 WebAssembly 和 WASI 的支持结合在一起,编译后的二进制文件将能够以接近本机的速度跨不同的设备和操作系统在浏览器内外运行。 + +WebAssembly 的低开销立即使它可以在浏览器之外使用,但这无疑是赌注;显然,还有其它不会引入性能瓶颈的运行应用程序的方法。为什么要专门使用 WebAssembly? + +一个重要的原因是它的可移植性。如今,像 C++ 和 Rust 这样的广泛使用的编译语言可能是与 WebAssembly 关联最紧密的语言。但是,[各种各样的其他语言][6] 可以在 WebAssembly 中将其虚拟机编译或拥有它们的虚拟机。此外,尽管 WebAssembly 为其执行环境[假定了某些先决条件][7],但它被设计为在各种操作系统和指令集体系结构上有效执行。因此,WebAssembly 代码可以使用多种语言编写,并可以在多种操作系统和处理器类型上运行。 + +另一个 WebAssembly 优势源于这样一个事实:代码在虚拟机中运行。因此,每个 WebAssembly 模块都在沙盒环境中执行,并使用故障隔离技术将其与主机运行时分开。这意味着,对于其它部分而言,应用程序独立于其主机环境的其余部分执行,如果不调用适当的 API,就无法摆脱沙箱。 + +### WebAssembly 在行动 + +这一切在实践中意味着什么? + +WebAssembly 的一个例子是 [Enarx][8]。 + +Enarx 是一个提供硬件独立性的项目,可使用受信任的执行环境Trusted Execution Environments(TEE)保护应用程序的安全。Enarx 使你可以安全地将编译为 WebAssembly 的应用程序始终交付到云提供程序中,并远程执行它。正如 Red Hat 安全工程师 [Nathaniel McCallum 指出的那样][9]:“我们这样做的方式是,我们将你的应用程序作为输入,并使用远程硬件执行认证过程。我们使用加密技术验证了远程硬件实际上是它声称的硬件。最终的结果不仅是我们对硬件的信任度提高了;它也是一个会话密钥,我们可以使用它将加密的代码和数据传递到我们刚刚要求加密验证的环境中。” + +另一个例子是 OPA,开放政策代理,它在 2019 年 11 月[发布][10],你可以[编译][11]他们的政策定义语言,Rego,为 WebAssembly。 +Rego 允许你编写逻辑来搜索和组合来自不同来源的 JSON/YAML 数据,以询问诸如“是否允许使用此 API?”之类的问题。 + +OPA 已被用于支持策略的软件,包括但不限于 Kubernetes。使用 OPA 之类的工具简化策略[被认为是在各种不同环境中正确保护 Kubernetes 部署的重要步骤][12]。WebAssembly 的可移植性和内置的安全功能非常适合这些工具。 + +我们的最后一个例子是 [Unity][13]。还记得我们在文章开头提到过 WebAssembly 用于游戏吗?好吧,跨平台游戏引擎 Unity 是 WebAssembly 的较早采用者,它提供了在浏览器中运行的 Wasm 的首个演示,并且自 2018 年 8 月以来,[已使用 WebAssembly][14]作为 Unity WebGL 构建目标的输出目标。 + +这些只是 WebAssembly 已经开始产生影响的几种方式。你可以在 上查找更多信息并了解 Wasm 的所有最新信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/webassembly + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[laingke](https://github.com/laingke) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/article/19/8/webassembly-speed-code-reuse +[3]: https://www.cnet.com/news/the-secret-alliance-that-could-give-the-web-a-massive-speed-boost/ +[4]: https://www.w3.org/blog/news/archives/8123 +[5]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ +[6]: https://github.com/appcypher/awesome-wasm-langs +[7]: https://webassembly.org/docs/portability/ +[8]: https://enarx.io +[9]: https://enterprisersproject.com/article/2019/9/application-security-4-facts-confidential-computing-consortium +[10]: https://blog.openpolicyagent.org/tagged/webassembly +[11]: https://github.com/open-policy-agent/opa/tree/master/wasm +[12]: https://enterprisersproject.com/article/2019/11/kubernetes-reality-check-3-takeaways-kubecon +[13]: https://opensource.com/article/20/1/www.unity.com +[14]: https://blogs.unity3d.com/2018/08/15/webassembly-is-here/ From 5633a1ad209ea0ab7a6109a9636d33039ee9b76a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 27 Jan 2020 00:52:49 +0800 Subject: [PATCH 100/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200126=20Use=20?= =?UTF-8?q?Vim=20to=20send=20email=20and=20check=20your=20calendar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200126 Use Vim to send email and check your calendar.md --- ...m to send email and check your calendar.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20200126 Use Vim to send email and check your calendar.md diff --git a/sources/tech/20200126 Use Vim to send email and check your calendar.md b/sources/tech/20200126 Use Vim to send email and check your calendar.md new file mode 100644 index 0000000000..fdb709aaef --- /dev/null +++ b/sources/tech/20200126 Use Vim to send email and check your calendar.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Vim to send email and check your calendar) +[#]: via: (https://opensource.com/article/20/1/vim-email-calendar) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use Vim to send email and check your calendar +====== +Manage your email and calendar right from your text editor in the +sixteenth in our series on 20 ways to be more productive with open +source in 2020. +![Calendar close up snapshot][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Doing (almost) all the things with Vim, part 1 + +I use two text editors regularly—[Vim][2] and [Emacs][3]. Why both? They have different use cases, and I'll talk about some of them in the next few articles in this series. + +![][4] + +OK, so why do everything in Vim? Because if there is one application that is on every machine I have access to, it's Vim. And if you are like me, you probably already spend a lot of time in Vim. So why not use it for _all the things_? + +Before that, though, you need to do some things. The first is to make sure you have Ruby support in Vim. You can check that with **vim --version | grep ruby**. If the result is not **+ruby**, that needs to be fixed. This can be tricky, and you should check your distribution's documentation for the right package to install. On MacOS, this is the official MacVim (not from Brew), and on most Linux distributions, this is either vim-nox or vim-gtk—NOT vim-gtk3. + +I use [Pathogen][5] to autoload my plugins and bundles. If you use [Vundle][6] or another Vim package manager, you'll need to adjust the commands below to work with it. + +#### Do your email in Vim + +A good starting place for making Vim a bigger part of your productivity plan is using it to send and receive email with [Notmuch][7] using [abook][8] to access your contact list. You need to install some things for this. All the sample code below is on Ubuntu, so you'll need to adjust for that if you are using a different distribution. Do the setup with: + + +``` +sudo apt install notmuch-vim ruby-mail +curl -o ~/.vim/plugin/abook --create-dirs +``` + +So far, so good. Now start Vim and execute **:NotMuch**. There may be some warnings due to the older version of the mail library **notmuch-vim** was written for, but in general, Vim will now be a full-featured Notmuch mail client. + +![Reading Mail in Vim][9] + +If you want to perform a search for a specific tag, type **\t**, enter the name of the tag, and press Enter. This will pull up a list of all messages with that tag. The **\s** key combination brings up a **Search:** prompt that will do a full search of the Notmuch database. Navigate the message list with the arrow keys, press Enter to display the selected item, and enter **\q** to exit the current view. + +To compose mail, use the **\c** keystroke. You will see a blank message. This is where the **abook.vim** plugin comes in. Hit **Esc** and enter **:AbookQuery <SomeName>**, where <SomeName> is a part of the name or email address you want to look for. You will get a list of entries in the abook database that match your search. Select the address you want by typing its number to add it to the email's address line. Finish typing and editing the email, press **Esc** to exit edit mode, and enter **,s** to send. + +If you want to change the default folder view when **:NotMuch** starts up, you can add the variable **g:notmuch_folders** to your **.vimrc** file: + + +``` +let g:notmuch_folders = [ +      \ [ 'new', 'tag:inbox and tag:unread' ], +      \ [ 'inbox', 'tag:inbox' ], +      \ [ 'unread', 'tag:unread' ], +      \ [ 'News', 'tag:@sanenews' ], +      \ [ 'Later', 'tag:@sanelater' ], +      \ [ 'Patreon', 'tag:@patreon' ], +      \ [ 'LivestockConservancy', 'tag:livestock-conservancy' ], +    \ ] +``` + +There are many more settings covered in the Notmuch plugin's documentation, including setting up keys for tags and using alternate mail programs. + +#### Consult your calendar in Vim + +![][10] + +Sadly, there do not appear to be any calendar programs for Vim that use the vCalendar or iCalendar formats. There is [Calendar.vim][11], which is very well done. Set up Vim to access your calendar with: + + +``` +cd ~/.vim/bundle +git clone [git@github.com][12]:itchyny/calendar.vim.git +``` + +Now, you can see your calendar in Vim by entering **:Calendar**. You can switch between year, month, week, day, and clock views with the **<** and **>** keys. If you want to start with a particular view, use the **-view=** flag to tell it which one you wish to see. You can also add a date to any of the views. For example, if I want to see what is going on the week of July 4, 2020, I would enter **:Calendar -view week 7 4 2020**. The help is pretty good and can be accessed with the **?** key. + +![][13] + +Calendar.vim also supports Google Calendar (which I need), but in December 2019 Google disabled the access for it. The author has posted a workaround in [the issue on +GitHub][14]. + +So there you have it, your mail, addresses, and calendars in Vim. But you aren't done yet; you'll do even more with Vim tomorrow! + +Vim offers great benefits to writers, regardless of whether they are technically minded or not. + +Need to keep your schedule straight? Learn how to do it using open source with these free... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/vim-email-calendar + +作者:[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/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://opensource.com/sites/default/files/uploads/day16-image1.png +[5]: https://github.com/tpope/vim-pathogen +[6]: https://github.com/VundleVim/Vundle.vim +[7]: https://opensource.com/article/20/1/organize-email-notmuch +[8]: https://opensource.com/article/20/1/sync-contacts-locally +[9]: https://opensource.com/sites/default/files/uploads/productivity_16-2.png (Reading Mail in Vim) +[10]: https://opensource.com/sites/default/files/uploads/day16-image3.png +[11]: https://github.com/itchyny/calendar.vim +[12]: mailto:git@github.com +[13]: https://opensource.com/sites/default/files/uploads/day16-image4.png +[14]: https://github.com/itchyny/calendar.vim/issues/156 From 7fad82034332ac7d4552b67022ef46f21b16b3d9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 27 Jan 2020 00:53:20 +0800 Subject: [PATCH 101/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200126=20What's?= =?UTF-8?q?=20your=20favorite=20Linux=20distribution=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200126 What-s your favorite Linux distribution.md --- ...What-s your favorite Linux distribution.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/tech/20200126 What-s your favorite Linux distribution.md diff --git a/sources/tech/20200126 What-s your favorite Linux distribution.md b/sources/tech/20200126 What-s your favorite Linux distribution.md new file mode 100644 index 0000000000..029a4272e8 --- /dev/null +++ b/sources/tech/20200126 What-s your favorite Linux distribution.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's your favorite Linux distribution?) +[#]: via: (https://opensource.com/article/20/1/favorite-linux-distribution) +[#]: author: (Opensource.com https://opensource.com/users/admin) + +What's your favorite Linux distribution? +====== +Take our 7th annual poll to let us know your preference in Linux +distribution. +![Hand putting a Linux file folder into a drawer][1] + +What's your favorite Linux distribution? Take our 7th annual poll. Some have come and gone, but there are hundreds of [Linux distributions][2] alive and well today. The combination of distribution, package manager, and desktop creates an endless amount of customized environments for Linux users. + +We asked the community of writers what their favorite is and why. While there were some commonalities (Fedora and Ubuntu were popular choices for a variety of reasons), we heard a few surprises as well. Here are a few of their responses: + +"I use the Fedora distro! I love the community of people who work together to make an awesome operating system that showcases the greatest innovations in the free and open source software world." — Matthew Miller + +"I use Arch at home. As a gamer, I want easy access to the latest Wine versions and GFX drivers, as well as large amounts of control over my OS. Give me a rolling-release distro with every package at bleeding-edge." —Aimi Hobson + +"NixOS, with nothing coming close in the hobbyist niche." —Alexander Sosedkin + +"I have used every Fedora version as my primary work OS. Meaning, I started with the first one. Early on, I asked myself if there would ever come a time when I couldn't remember which number I was on. That time has arrived. What year is it, anyway?" —Hugh Brock + +"I usually have Ubuntu, CentOS, and Fedora boxes running around the house and the office. We depend on all of these distributions for various things. Fedora for speed and getting the latest versions of applications and libraries. Ubuntu for those that need easy of use with a large community of support. CentOS when we need a rock-solid server platform that just runs." —Steve Morris + +"My favorite? For the community, and how packages are built for the distribution (from source, not binaries), I choose Fedora. For pure breadth of packages available and elegance in how packages are defined and developed, I choose Debian. For documentation, I choose Arch. For newbies that ask, I used to recommend Ubuntu but now recommend Fedora." —Al Stone + +* * * + +We've been asking the community this question since 2014. With the exception of PCLinuxOS taking the lead in 2015, Ubuntu tends to be the fan-favorite from year to year. Other popular contenders have been Fedora, Debian, Mint, and Arch. Which distribution stands out to you in the new decade? If we didn't include your favorite in the list of choices, tell us about it in the comments.  + +Here's a look at your favorite Linux distributions throughout the last seven years. You can find this in our latest yearbook, [Best of a decade on Opensource.com][3]. To download the whole eBook, [click here][3]! + +![Poll results for favorite Linux distribution through the years][4] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/favorite-linux-distribution + +作者:[Opensource.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/admin +[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://distrowatch.com/ +[3]: https://opensource.com/downloads/2019-yearbook-special-edition +[4]: https://opensource.com/sites/default/files/pictures/linux-distributions-through-the-years.jpg (favorite Linux distribution through the years) From 501973fc5da016d6942468ee73bf346b9b9c03e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Mon, 27 Jan 2020 08:31:28 +0800 Subject: [PATCH 102/285] translating --- .../20200123 Wine 5.0 is Released- Here-s How to Install it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md index 4c82b48a5d..3a06b5b5cb 100644 --- a/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md +++ b/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 44ca927bb7b9a004ba873e5379177a3b6b213fc1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Jan 2020 12:54:04 +0800 Subject: [PATCH 103/285] PRF @laingke --- ...y everyone is talking about WebAssembly.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200115 Why everyone is talking about WebAssembly.md b/translated/tech/20200115 Why everyone is talking about WebAssembly.md index 5da77c0d4d..3f3bc274e8 100644 --- a/translated/tech/20200115 Why everyone is talking about WebAssembly.md +++ b/translated/tech/20200115 Why everyone is talking about WebAssembly.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (laingke) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why everyone is talking about WebAssembly) @@ -9,51 +9,52 @@ 为什么每个人都在谈论 WebAssembly ====== -了解有关在 Web 浏览器中运行任何代码的最新方法的更多信息。 -![Digital creative of a browser on the internet][1] -如果你还没有听说过 [WebAssembly][2],那么你很快就会知道。这是业界保存最完好的秘密之一,但无处不在。所有主流的浏览器都支持它,并且它也将在服务器端使用。它很快。它被用于游戏。这是一个开放的万维网联盟(W3C),主要的国际网络标准组织。它与平台无关,可以在 Linux,Mac 和 Windows 上运行。 +> 了解有关在 Web 浏览器中运行任何代码的最新方法的更多信息。 -你可能会说:“哇,这听起来像是我应该学习编程的东西!” 你可能是对的,但你也可能是错的。你不需要用 WebAssembly 编码。让我们花一些时间来学习通常被缩写为“Wasm”的技术。 +![](https://img.linux.net.cn/data/attachment/album/202001/27/125343ch0hxdfbzibrihfn.jpg) + +如果你还没有听说过 [WebAssembly][2],那么你很快就会知道。这是业界最保密的秘密之一,但它无处不在。所有主流的浏览器都支持它,并且它也将在服务器端使用。它很快,它能用于游戏编程。这是主要的国际网络标准组织万维网联盟(W3C)的一个开放标准。 + +你可能会说:“哇,这听起来像是我应该学习编程的东西!”你可能是对的,但也是错的。你不需要用 WebAssembly 编程。让我们花一些时间来学习这种通常被缩写为“Wasm”的技术。 ### 它从哪里来? 大约十年前,人们越来越认识到,广泛使用的 JavaScript 不够快速,无法满足许多目的。JavaScript 无疑是成功和方便的。它可以在任何浏览器中运行,并启用了今天我们认为理所当然的动态网页类型。但这是一种高级语言,在设计时并没有考虑到计算密集型工作负载。 -然而,尽管负责主流 web 浏览器的工程师们对性能问题的看法大体一致,但他们对如何解决这个问题却意见不一。两个阵营出现。谷歌开始了它的原生客户端Native Client项目,后来又推出了可移植原生客户端Portable Native Client变体,着重于允许用 C/C++ 编写的游戏和其它软件在 Chrome 的一个安全隔间中运行。与此同时,Mozilla 赢得了微软对 asm.js 的支持。该方法更新了浏览器,因此它可以非常快速地运行底层的 JavaScript 指令子集(另一个项目使 C/C++ 代码可以转换为这些指令)。 +然而,尽管负责主流 web 浏览器的工程师们对性能问题的看法大体一致,但他们对如何解决这个问题却意见不一。出现了两个阵营,谷歌开始了它的原生客户端Native Client项目,后来又推出了可移植原生客户端Portable Native Client变体,着重于允许用 C/C++ 编写的游戏和其它软件在 Chrome 的一个安全隔间中运行。与此同时,Mozilla 赢得了微软对 asm.js 的支持。该方法更新了浏览器,因此它可以非常快速地运行 JavaScript 指令的低级子集(有另一个项目可以将 C/C++ 代码转换为这些指令)。 -在这两个阵营都没有得到广泛采用的情况下,各方在 2015 年同意围绕一种称为 WebAssembly 的新标准,以 asm.js 所采用的基本方法为基础,共同努力。[如 CNET 的 Stephen Shankland 当时所写][3],“在当今的 Web 上,浏览器的 JavaScript 将这些指令转换为机器代码。但是,通过 WebAssembly,程序员可以在此过程的早期阶段完成很多工作,从而生成介于两种状态之间的程序。这使浏览器摆脱了创建机器代码的繁琐工作,但也实现了 Web 的承诺——该软件将在具有浏览器的任何设备上运行,而无需考虑基础硬件的详细信息。” +由于这两个阵营都没有得到广泛采用,各方在 2015 年同意围绕一种称为 WebAssembly 的新标准,以 asm.js 所采用的基本方法为基础,联合起来。[如 CNET 的 Stephen Shankland 当时所写][3],“在当今的 Web 上,浏览器的 JavaScript 将这些指令转换为机器代码。但是,通过 WebAssembly,程序员可以在此过程的早期阶段完成很多工作,从而生成介于两种状态之间的程序。这使浏览器摆脱了创建机器代码的繁琐工作,但也实现了 Web 的承诺 —— 该软件将在具有浏览器的任何设备上运行,而无需考虑基础硬件的细节。” -在 2017 年,Mozilla 宣布了它的最小可行的产品,并使其脱离预览版。到该年年底,所有主流的浏览器都采用了它。[2019 年 12 月][4],WebAssembly 工作组发布了三个 W3C 推荐的 WebAssembly 规范。 +在 2017 年,Mozilla 宣布了它的最小可行的产品(MVP),并使其脱离预览版阶段。到该年年底,所有主流的浏览器都采用了它。[2019 年 12 月][4],WebAssembly 工作组发布了三个 W3C 推荐的 WebAssembly 规范。 -WebAssembly 为可执行程序、相应的文本汇编语言以及用于促进此类程序与其主机环境之间的交互的接口定义了一种可移植的二进制代码格式。WebAssembly 代码在低级虚拟机中运行,该虚拟机模仿可以在其上运行的许多微处理器的功能。通过即时(JIT)编译或解释,WebAssembly 引擎可以以近乎原生平台编译代码的速度执行。 +WebAssembly 定义了一种可执行程序的可移植二进制代码格式、相应的文本汇编语言以及用于促进此类程序与其宿主环境之间的交互接口。WebAssembly 代码在低级虚拟机中运行,这个可运行于许多微处理器之上的虚拟机可模仿这些处理器的功能。通过即时(JIT)编译或解释,WebAssembly 引擎可以以近乎原生平台编译代码的速度执行。 ### 为什么现在感兴趣? 当然,最近对 WebAssembly 感兴趣的部分原因是最初希望在浏览器中运行更多计算密集型代码。尤其是笔记本电脑用户,越来越多的时间都花在浏览器上(或者,对于 Chromebook 用户来说,基本上是所有时间)。这种趋势已经迫切需要消除在浏览器中运行各种应用程序的障碍。这些障碍之一通常是性能的某些方面,这正是 WebAssembly 及其前身最初旨在解决的问题。 -但是,WebAssembly 并不仅仅适用于浏览器。在 2019 年,[Mozilla 宣布了一个名为 WASI][5](WebAssembly 系统接口)的项目,以标准化 WebAssembly 代码如何与浏览器上下文之外的操作系统进行交互。通过将浏览器对 WebAssembly 和 WASI 的支持结合在一起,编译后的二进制文件将能够以接近本机的速度跨不同的设备和操作系统在浏览器内外运行。 +但是,WebAssembly 并不仅仅适用于浏览器。在 2019 年,[Mozilla 宣布了一个名为 WASI][5](WebAssembly 系统接口WebAssembly System Interface)的项目,以标准化 WebAssembly 代码如何与浏览器上下文之外的操作系统进行交互。通过将浏览器对 WebAssembly 和 WASI 的支持结合在一起,编译后的二进制文件将能够以接近原生的速度,跨不同的设备和操作系统在浏览器内外运行。 WebAssembly 的低开销立即使它可以在浏览器之外使用,但这无疑是赌注;显然,还有其它不会引入性能瓶颈的运行应用程序的方法。为什么要专门使用 WebAssembly? -一个重要的原因是它的可移植性。如今,像 C++ 和 Rust 这样的广泛使用的编译语言可能是与 WebAssembly 关联最紧密的语言。但是,[各种各样的其他语言][6] 可以在 WebAssembly 中将其虚拟机编译或拥有它们的虚拟机。此外,尽管 WebAssembly 为其执行环境[假定了某些先决条件][7],但它被设计为在各种操作系统和指令集体系结构上有效执行。因此,WebAssembly 代码可以使用多种语言编写,并可以在多种操作系统和处理器类型上运行。 +一个重要的原因是它的可移植性。如今,像 C++ 和 Rust 这样的广泛使用的编译语言可能是与 WebAssembly 关联最紧密的语言。但是,[各种各样的其他语言][6]可以编译为 WebAssembly 或拥有它们的 WebAssembly 虚拟机。此外,尽管 WebAssembly 为其执行环境[假定了某些先决条件][7],但它被设计为在各种操作系统和指令集体系结构上有效执行。因此,WebAssembly 代码可以使用多种语言编写,并可以在多种操作系统和处理器类型上运行。 -另一个 WebAssembly 优势源于这样一个事实:代码在虚拟机中运行。因此,每个 WebAssembly 模块都在沙盒环境中执行,并使用故障隔离技术将其与主机运行时分开。这意味着,对于其它部分而言,应用程序独立于其主机环境的其余部分执行,如果不调用适当的 API,就无法摆脱沙箱。 +另一个 WebAssembly 优势源于这样一个事实:代码在虚拟机中运行。因此,每个 WebAssembly 模块都在沙盒环境中执行,并使用故障隔离技术将其与宿主机运行时环境分开。这意味着,对于其它部分而言,应用程序独立于其宿主机环境的其余部分执行,如果不调用适当的 API,就无法摆脱沙箱。 -### WebAssembly 在行动 +### WebAssembly 现状 这一切在实践中意味着什么? -WebAssembly 的一个例子是 [Enarx][8]。 +如今在运作中的 WebAssembly 的一个例子是 [Enarx][8]。 -Enarx 是一个提供硬件独立性的项目,可使用受信任的执行环境Trusted Execution Environments(TEE)保护应用程序的安全。Enarx 使你可以安全地将编译为 WebAssembly 的应用程序始终交付到云提供程序中,并远程执行它。正如 Red Hat 安全工程师 [Nathaniel McCallum 指出的那样][9]:“我们这样做的方式是,我们将你的应用程序作为输入,并使用远程硬件执行认证过程。我们使用加密技术验证了远程硬件实际上是它声称的硬件。最终的结果不仅是我们对硬件的信任度提高了;它也是一个会话密钥,我们可以使用它将加密的代码和数据传递到我们刚刚要求加密验证的环境中。” +Enarx 是一个提供硬件独立性的项目,可使用受信任的执行环境Trusted Execution Environments(TEE)保护应用程序的安全。Enarx 使你可以安全地将编译为 WebAssembly 的应用程序始终交付到云服务商,并远程执行它。正如 Red Hat 安全工程师 [Nathaniel McCallum 指出的那样][9]:“我们这样做的方式是,我们将你的应用程序作为输入,并使用远程硬件执行认证过程。我们使用加密技术验证了远程硬件实际上是它声称的硬件。最终的结果不仅是我们对硬件的信任度提高了;它也是一个会话密钥,我们可以使用它将加密的代码和数据传递到我们刚刚要求加密验证的环境中。” -另一个例子是 OPA,开放政策代理,它在 2019 年 11 月[发布][10],你可以[编译][11]他们的政策定义语言,Rego,为 WebAssembly。 -Rego 允许你编写逻辑来搜索和组合来自不同来源的 JSON/YAML 数据,以询问诸如“是否允许使用此 API?”之类的问题。 +另一个例子是 OPA,开放策略代理Open Policy Agent,它[发布][10]于 2019 年 11 月,你可以[编译][11]他们的策略定义语言 Rego 为 WebAssembly。Rego 允许你编写逻辑来搜索和组合来自不同来源的 JSON/YAML 数据,以询问诸如“是否允许使用此 API?”之类的问题。 -OPA 已被用于支持策略的软件,包括但不限于 Kubernetes。使用 OPA 之类的工具简化策略[被认为是在各种不同环境中正确保护 Kubernetes 部署的重要步骤][12]。WebAssembly 的可移植性和内置的安全功能非常适合这些工具。 +OPA 已被用于支持策略的软件,包括但不限于 Kubernetes。使用 OPA 之类的工具来简化策略[被认为是在各种不同环境中正确保护 Kubernetes 部署的重要步骤][12]。WebAssembly 的可移植性和内置的安全功能非常适合这些工具。 -我们的最后一个例子是 [Unity][13]。还记得我们在文章开头提到过 WebAssembly 用于游戏吗?好吧,跨平台游戏引擎 Unity 是 WebAssembly 的较早采用者,它提供了在浏览器中运行的 Wasm 的首个演示,并且自 2018 年 8 月以来,[已使用 WebAssembly][14]作为 Unity WebGL 构建目标的输出目标。 +我们的最后一个例子是 [Unity][13]。还记得我们在文章开头提到过 WebAssembly 可用于游戏吗?好吧,跨平台游戏引擎 Unity 是 WebAssembly 的较早采用者,它提供了在浏览器中运行的 Wasm 的首个演示品,并且自 2018 年 8 月以来,[已将 WebAssembly][14]用作 Unity WebGL 构建目标的输出目标。 这些只是 WebAssembly 已经开始产生影响的几种方式。你可以在 上查找更多信息并了解 Wasm 的所有最新信息。 @@ -64,7 +65,7 @@ via: https://opensource.com/article/20/1/webassembly 作者:[Mike Bursell][a] 选题:[lujun9972][b] 译者:[laingke](https://github.com/laingke) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08d75831224b3fb961b231009a20eb6bb4bba42e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Jan 2020 12:54:51 +0800 Subject: [PATCH 104/285] PUB @laingke https://linux.cn/article-11823-1.html --- .../20200115 Why everyone is talking about WebAssembly.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200115 Why everyone is talking about WebAssembly.md (99%) diff --git a/translated/tech/20200115 Why everyone is talking about WebAssembly.md b/published/20200115 Why everyone is talking about WebAssembly.md similarity index 99% rename from translated/tech/20200115 Why everyone is talking about WebAssembly.md rename to published/20200115 Why everyone is talking about WebAssembly.md index 3f3bc274e8..e8fdb04ce0 100644 --- a/translated/tech/20200115 Why everyone is talking about WebAssembly.md +++ b/published/20200115 Why everyone is talking about WebAssembly.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (laingke) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11823-1.html) [#]: subject: (Why everyone is talking about WebAssembly) [#]: via: (https://opensource.com/article/20/1/webassembly) [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) From 6763227775c6eb152c157353903c1bcca59c72c8 Mon Sep 17 00:00:00 2001 From: laingke Date: Mon, 27 Jan 2020 13:35:05 +0800 Subject: [PATCH 105/285] 20200103-inter-process-communication-linux translating --- ...ucing the guide to inter-process communication in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md index c0b7eee940..1d0ad46667 100644 --- a/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md +++ b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (laingke) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -162,7 +162,7 @@ via: https://opensource.com/article/20/1/inter-process-communication-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[laingke](https://github.com/laingke) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 06dc5110d3f5c857f949a9426b9f495d3d139369 Mon Sep 17 00:00:00 2001 From: laingke Date: Mon, 27 Jan 2020 14:20:51 +0800 Subject: [PATCH 106/285] 20200103-inter-process-communication-linux translated --- ...to inter-process communication in Linux.md | 176 ------------------ ...to inter-process communication in Linux.md | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 176 deletions(-) delete mode 100644 sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md create mode 100644 translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md diff --git a/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md deleted file mode 100644 index 1d0ad46667..0000000000 --- a/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md +++ /dev/null @@ -1,176 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (laingke) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Introducing the guide to inter-process communication in Linux) -[#]: via: (https://opensource.com/article/20/1/inter-process-communication-linux) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Introducing the guide to inter-process communication in Linux -====== -This free eBook gives seasoned and occasional coders insight into the -core concepts and mechanisms of inter-process communication (IPC) in -Linux. -![Inter-process Communication in Linux][1] - -Getting one software process to talk to another software process is a delicate balancing act. It can be a vital function for an application, though, so it's a problem any programmer embarking on a complex project has to solve. Whether your application needs to kick off a job being handled by someone else's software; to monitor an action being performed by a peripheral or over a network; or to detect a signal from some other source, when your software relies on something outside of its own code to know what to do next or when to do it, you need to think about inter-process communication (IPC). - -The Unix operating system accounted for this long ago, possibly because of an early expectation that software would originate from diverse sources. In the same tradition, Linux provides many of the same interfaces for IPC and some new ones. The Linux kernel features several IPC methods, and the [util-linux package][2] contains the **ipcmk**, **ipcrm**, **ipcs**, and **lsipc** commands for monitoring and managing IPC messages. - -### Show IPC information - -Before experimenting with IPC, you should know what IPC facilities are already on your system. The **lsipc** command provides that information. - - -``` -RESOURCE DESCRIPTION               LIMIT  USED  USE% -MSGMNI   Number of message queues  32000     0 0.00% -MSGMAX   Max size of message (byt.. 8192     -     - -MSGMNB   Default max size of queue 16384     -     - -SHMMNI   Shared memory segments     4096    79 1.93% -SHMALL   Shared memory pages       184[...] 25452 0.00% -SHMMAX   Max size of shared memory 18446744073692774399 -SHMMIN   Min size of shared memory     1     -     - -SEMMNI   Number of semaphore ident 32000     0 0.00% -SEMMNS   Total number of semaphore 1024000.. 0 0.00% -SEMMSL   Max semaphores per semap  32000     -     - -SEMOPM   Max number of operations p  500     -     - -SEMVMX   Semaphore max value       32767     -     - -``` - -You may notice that this sample listing includes three different types of IPC mechanisms, each available in the Linux kernel: messages (MSG), shared memory (SHM), and semaphores (SEM). You can view current activity in each of those subsystems with the **ipcs** command: - - -``` -$ ipcs - -\------ Message Queues Creators/Owners --- -msqid     perms     cuid      cgid  [...] - -\------ Shared Memory Segment Creators/Owners -shmid     perms    cuid    cgid  [...] -557056    700      seth    users [...] -3571713   700      seth    users [...] -2654210   600      seth    users [...] -2457603   700      seth    users [...] - -\------ Semaphore Arrays Creators/Owners --- -semid     perms     cuid      cgid  [...] -``` - -This shows that there currently are no messages or semaphore arrays, but a number of shared memory segments are in use. - -There's a simple example you can perform on your system so you can see one of these systems at work. It involves some C code, so you must have build tools on your system. The names of the packages you must install to be able to build from source code vary depending on your distro, so refer to your documentation for specifics. For example, on Debian-based distributions, you can learn about build requirements on the [BuildingTutorial][3] section of the wiki, and on Fedora-based distributions, refer to the [Installing software from source][4] section of the docs. - -### Create a message queue - -Your system has a default message queue already, but you can create your own using the **ipcmk** command: - - -``` -$ ipcmk --queue -Message queue id: 32764 -``` - -Write a simple IPC message sender, hard-coding in the queue ID for simplicity: - - -``` -#include <sys/ipc.h> -#include <sys/msg.h> -#include <stdio.h> -#include <string.h> - -struct msgbuffer { -  char text[24]; -} message; - -int main() { -    int msqid = 32764; -    strcpy(message.text,"opensource.com"); -    msgsnd(msqid, &message, sizeof(message), 0); -    printf("Message: %s\n",message.text); -    printf("Queue: %d\n",msqid); -    return 0; -        } -``` - -Compile the application and run it: - - -``` -$ gcc msgsend.c -o msg.bin -$ ./msg.bin -Message: opensource.com -Queue: 32769 -``` - -You just sent a message to your message queue. You can verify that with the **ipcs** command, using the **\--queue** option to limit output to the message queue: - - -``` -$ ipcs -q - -\------ Message Queues -------- -key        msqid   owner  perms  used-bytes  messages -0x7b341ab9 0       seth   666    0          0 -0x72bd8410 32764   seth   644    24         1 -``` - -You can also retrieve those messages with: - - -``` -#include <sys/ipc.h> -#include <sys/msg.h> -#include <stdio.h> - -struct msgbuffer { -    char text[24]; -} message; - -int main() { -    int msqid = 32764; -    msgrcv(msqid, &message, sizeof(message),0,0); -    printf("\nQueue: %d\n",msqid); -    printf("Got this message: %s\n", message.text); -    msgctl(msqid,IPC_RMID,NULL); -    return 0; -``` - -Compile and run with: - - -``` -$ gcc get.c -o get.bin -$ ./get.bin - -Queue: 32764 -Got this message: opensource.com -``` - -### Download [the eBook][5] - -This is just one example of the lessons available in Marty Kalin's [A guide to inter-process communication in Linux][5], the latest free (and Creative Commons) downloadable eBook from Opensource.com. In just a few short lessons, you will learn about POSIX methods of IPC from message queues, shared memory and semaphores, sockets, signals, and much more. Sit down with Marty's book, and you'll emerge a better-informed programmer. But it isn't just for seasoned coders—if all you ever write are shell scripts, there's plenty of practical knowledge about pipes (named and unnamed) and shared files, as well as important concepts you need to know when you use a shared file or an external message queue. - -If you're interested in making great software that's written to be dynamic and system-aware, you need to know about IPC. Let [this book][5] be your guide. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/inter-process-communication-linux - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[laingke](https://github.com/laingke) -校对:[校对者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/coverimage_inter-process_communication_linux_520x292.png?itok=hPoen7oI (Inter-process Communication in Linux) -[2]: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/ -[3]: https://wiki.debian.org/BuildingTutorial -[4]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html -[5]: https://opensource.com/downloads/guide-inter-process-communication-linux diff --git a/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md new file mode 100644 index 0000000000..b88af1f2ca --- /dev/null +++ b/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: (laingke) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Introducing the guide to inter-process communication in Linux) +[#]: via: (https://opensource.com/article/20/1/inter-process-communication-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Linux 进程间通信介绍指南 +====== +这本免费的电子书使经验丰富的程序员更深入了解 Linux 中进程间通信(IPC)的核心概念和机制。 +![Inter-process Communication in Linux][1] + +让一个软件过程与另一个软件过程进行对话是一个微妙的平衡行为。但是,它对于应用程序而言可能是至关重要的功能,因此这是任何从事复杂项目的程序员都必须解决的问题。你的应用程序是否需要启动由其它软件处理的工作;监视外设或网络上正在执行的操作;或者检测来自其它来源的信号,当你的软件需要依赖其自身代码之外的东西来知道下一步做什么或什么时候做时,你就需要考虑进程间通信(IPC)。 + +Unix 操作系统在很久以前就说明了这一点,这可能是因为人们早就期望软件会来自各种来源。按照相同的传统,Linux 为 IPC 和一些新接口提供了许多相同的接口。Linux 内核具有几个 IPC 方法,[util-linux 包][2]包含 `ipcmk`、`ipcrm`、`ipcs` 和 `lsipc` 命令,用于监视和管理 IPC 消息。 + +### 显示进程间通信信息 + +在尝试 IPC 之前,你应该知道系统上已经有哪些 IPC 工具。`lsipc` 命令提供了该信息。 + +``` +RESOURCE DESCRIPTION LIMIT USED USE% +MSGMNI Number of message queues 32000 0 0.00% +MSGMAX Max size of message (byt.. 8192 - - +MSGMNB Default max size of queue 16384 - - +SHMMNI Shared memory segments 4096 79 1.93% +SHMALL Shared memory pages 184[...] 25452 0.00% +SHMMAX Max size of shared memory 18446744073692774399 +SHMMIN Min size of shared memory 1 - - +SEMMNI Number of semaphore ident 32000 0 0.00% +SEMMNS Total number of semaphore 1024000.. 0 0.00% +SEMMSL Max semaphores per semap 32000 - - +SEMOPM Max number of operations p 500 - - +SEMVMX Semaphore max value 32767 - - +``` + +你可能注意到,这个示例清单包含三种不同类型的 IPC 机制,每种机制在 Linux 内核中都是可用的:消息(MSG)、共享内存(SHM)和信号量(SEM)。你可以用 `ipcs` 命令查看每个子系统的当前活动: + +``` +$ ipcs + +\------ Message Queues Creators/Owners --- +msqid perms cuid cgid [...] + +\------ Shared Memory Segment Creators/Owners +shmid perms cuid cgid [...] +557056 700 seth users [...] +3571713 700 seth users [...] +2654210 600 seth users [...] +2457603 700 seth users [...] + +\------ Semaphore Arrays Creators/Owners --- +semid perms cuid cgid [...] +``` + +这表明当前没有消息或信号量数组,但是使用了一些共享内存段。 + +你可以在系统上执行一个简单的示例,这样就可以看到其中一个系统正在工作。它涉及到一些 C 代码,所以你必须在系统上有构建工具。必须安装才能从源代码构建的软件包的名称取决于发行版,因此请参考文档以获取详细信息。例如,在基于 Debian 的发行版上,你可以在 wiki 的[构建教程][3]部分了解构建需求,而在基于 Fedora 的发行版上,你可以参考文档的[从源代码安装软件][4]部分。 + +### 创建一个消息队列 + +你的系统已经有一个默认的消息队列,但是你可以使用 `ipcmk` 命令创建你自己的消息队列: + +``` +$ ipcmk --queue +Message queue id: 32764 +``` + +编写一个简单的 IPC 消息发送器,为了简单,在队列 ID 中硬编码: + +``` +#include +#include +#include +#include + +struct msgbuffer { + char text[24]; +} message; + +int main() { + int msqid = 32764; + strcpy(message.text,"opensource.com"); + msgsnd(msqid, &message, sizeof(message), 0); + printf("Message: %s\n",message.text); + printf("Queue: %d\n",msqid); + return 0; +} +``` + +编译应用程序并运行: + + +``` +$ gcc msgsend.c -o msg.bin +$ ./msg.bin +Message: opensource.com +Queue: 32769 +``` + +你刚刚向消息队列发送了一条消息。你可以使用 `ipcs` 命令验证这一点,使用 `\——queue` 选项将输出限制到消息队列: + + +``` +$ ipcs -q + +\------ Message Queues -------- +key msqid owner perms used-bytes messages +0x7b341ab9 0 seth 666 0 0 +0x72bd8410 32764 seth 644 24 1 +``` + +你也可以检索这些讯息: + +``` +#include +#include +#include + +struct msgbuffer { + char text[24]; +} message; + +int main() { + int msqid = 32764; + msgrcv(msqid, &message, sizeof(message),0,0); + printf("\nQueue: %d\n",msqid); + printf("Got this message: %s\n", message.text); + msgctl(msqid,IPC_RMID,NULL); + return 0; +``` + +编译并运行: + +``` +$ gcc get.c -o get.bin +$ ./get.bin + +Queue: 32764 +Got this message: opensource.com +``` + +### 下载[电子书][5] + +这只是 Marty Kalin 的 [Linux 内进程间通信指南][5]中课程的一个例子,这是可从 Opensource.com 下载的最新免费(和知识共享)电子书。在短短的几节课中,你将从消息队列、共享内存和信号量、套接字、信号等中了解 IPC 的 POSIX 方法。认真阅读 Marty 的书,您将成为一个消息灵通的程序员。而这不仅适用于经验丰富的编码人员,如果你编写的只是 shell 脚本,那么你将拥有有关管道(命名和未命名)和共享文件的大量实践知识,以及使用共享文件或外部消息队列时需要了解的重要概念。 + +如果你对制作具有动态和系统意识的优秀软件感兴趣,那么你需要了解 IPC。让[这本书][5]做你的向导。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/inter-process-communication-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[laingke](https://github.com/laingke) +校对:[校对者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/coverimage_inter-process_communication_linux_520x292.png?itok=hPoen7oI (Inter-process Communication in Linux) +[2]: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/ +[3]: https://wiki.debian.org/BuildingTutorial +[4]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html +[5]: https://opensource.com/downloads/guide-inter-process-communication-linux From d17cd544d35574715dfdf05434e511697f31bae5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Jan 2020 23:09:09 +0800 Subject: [PATCH 107/285] PRF --- ...e for programming hardware abstractions.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index 98215f6a9f..ffee4807f9 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -7,25 +7,25 @@ [#]: via: (https://opensource.com/article/20/1/c-vs-rust-abstractions) [#]: author: (Dan Pittman https://opensource.com/users/dan-pittman) -C 还是 Rust:选择哪个用于编程硬件抽象 +C 还是 Rust:选择哪个用于硬件抽象编程 ====== > 在 Rust 中使用类型级编程可以使硬件抽象更加安全。 ![Tools illustration][1] -Rust 是一种日益流行的编程语言,被视为硬件接口的最佳选择。通常会将其与 C 的抽象级别进行比较。本文介绍了 Rust 如何以多种方式处理按位运算,并提供了既安全又易于使用的解决方案。 +Rust 是一种日益流行的编程语言,被视为硬件接口的最佳选择。通常会将其与 C 的抽象级别相比较。本文介绍了 Rust 如何通过多种方式处理按位运算,并提供了既安全又易于使用的解决方案。 -语言 | 源自 | 官方说明 | 总览 +语言 | 诞生于 | 官方描述 | 总览 ---|---|---|--- C | 1972 年 | C 是一种通用编程语言,具有表达式简约、现代的控制流和数据结构,以及丰富的运算符集等特点。(来源:[CS 基础知识] [2])| C 是(一种)命令式语言,旨在以相对简单的方式进行编译,从而提供对内存的低级访问。(来源:[W3schools.in] [3]) -Rust | 2010 年 | 一种使所有人都能构建可靠、高效的软件的语言(来源:[Rust 网站] [4])| Rust 是一种专注于安全性(尤其是安全并发性)的多范式系统编程语言。(来源:[维基百科] [5]) +Rust | 2010 年 | 一种赋予所有人构建可靠、高效的软件的能力的语言(来源:[Rust 网站] [4])| Rust 是一种专注于安全性(尤其是安全并发性)的多范式系统编程语言。(来源:[维基百科] [5]) ### 在 C 语言中对寄存器值进行按位运算 -在系统编程领域,你可能经常需要编写硬件驱动程序或直接与内存映射的设备进行交互,而这些交互几乎总是通过硬件提供的内存映射的寄存器来完成的。通常,你通过对某些固定宽度的数字类型进行按位运算来与这些寄存器进行交互。 +在系统编程领域,你可能经常需要编写硬件驱动程序或直接与内存映射设备进行交互,而这些交互几乎总是通过硬件提供的内存映射寄存器来完成的。通常,你通过对某些固定宽度的数字类型进行按位运算来与这些寄存器进行交互。 -例如,假设一个具有三个字段的 8 位寄存器: +例如,假设一个 8 位寄存器具有三个字段: ``` +----------+------+-----------+---------+ @@ -34,17 +34,17 @@ Rust | 2010 年 | 一种使所有人都能构建可靠、高效的软件的语    5-7       2-4        1          0 ``` -字段名称下方的数字规定了该字段在寄存器中使用的位。要启用该寄存器,你将写入值 `1`(以二进制表示为`0000_0001`)来设置 `Enabled` 字段的位。但是,通常情况下,你也不想干扰寄存器中的现有配置。假设你要在设备上启用中断功能,但也要确保设备保持启用状态。为此,必须将 `Interrupt` 字段的值与 `Enabled` 字段的值结合起来。你可以通过按位操作来做到这一点: +字段名称下方的数字规定了该字段在寄存器中使用的位。要启用该寄存器,你将写入值 `1`(以二进制表示为 `0000_0001`)来设置 `Enabled` 字段的位。但是,通常情况下,你也不想干扰寄存器中的现有配置。假设你要在设备上启用中断功能,但也要确保设备保持启用状态。为此,必须将 `Interrupt` 字段的值与 `Enabled` 字段的值结合起来。你可以通过按位操作来做到这一点: ``` 1 | (1 << 1) ``` -通过将 1 和 2(左移 `1` 一位得到)进行“或”运算得到二进制值 `0000_0011` 。你可以将其写入寄存器,使其保持启用状态,但也允许中断。 +通过将 1 和 2(`1` 左移一位得到)进行“或”(`|`)运算得到二进制值 `0000_0011` 。你可以将其写入寄存器,使其保持启用状态,但也启用中断功能。 -有很多事情要记住,特别是当你要为一个完整的系统处理可能有数百个之多的寄存器时。实际上,你可以使用助记符来执行此操作,助记符可跟踪字段在寄存器中的位置以及字段的宽度(即它的上边界是什么?) +你的头脑中要记住很多事情,特别是当你要在一个完整的系统上和可能有数百个之多的寄存器打交道时。在实践上,你可以使用助记符来执行此操作,助记符可跟踪字段在寄存器中的位置以及字段的宽度(即它的上边界是什么) -这是这些助记符之一的示例。它们是 C 语言的宏,用右侧的代码替换它们的出现的地方。这是上面列出的寄存器的简写。`&` 的左侧是该字段的位置,而右侧则限制该字段的位: +下面是这些助记符之一的示例。它们是 C 语言的宏,用右侧的代码替换它们的出现的地方。这是上面列出的寄存器的简写。`&` 的左侧是该字段的起始位置,而右侧则限制该字段所占的位: ``` #define REG_ENABLED_FIELD(x) (x << 0) & 1 @@ -52,7 +52,7 @@ Rust | 2010 年 | 一种使所有人都能构建可靠、高效的软件的语 #define REG_KIND_FIELD(x) (x << 2) & (7 << 2) ``` -然后,你将使用这些通过类似以下方式来抽象化寄存器值的操作: +然后,你可以使用这些来抽象化寄存器值的操作,如下所示: ``` void set_reg_val(reg* u8, val u8); @@ -62,7 +62,7 @@ fn enable_reg_with_interrupt(reg* u8) { } ``` -这就是现在的做法。实际上,这就是大多数驱动程序出现在 Linux 内核中的方式。 +这就是现在的做法。实际上,这就是大多数驱动程序在 Linux 内核中的使用方式。 有没有更好的办法?如果能够基于对现代编程语言研究得出新的类型系统,就可能能够获得安全性和可表达性的好处。也就是说,如何使用更丰富、更具表现力的类型系统来使此过程更安全、更持久? @@ -77,7 +77,7 @@ fn enable_reg_with_interrupt(reg* u8) {    5-7       2-4        1          0 ``` -你可能想如何用 Rust 类型来表示它? +你想如何用 Rust 类型来表示它呢? 你将以类似的方式开始,为每个字段的*偏移*定义常量(即,距最低有效位有多远)及其掩码。*掩码*是一个值,其二进制表示形式可用于更新或读取寄存器内部的字段: @@ -92,7 +92,7 @@ const KIND_MASK: u8 = 7 << 2; const KIND_OFFSET: u8 = 2; ``` -接下来,你将声明一个 `Field` 类型,并进行操作以将给定值转换为与其位置相关的值以供在寄存器内使用: +接下来,你将声明一个 `Field` 类型并进行操作,将给定值转换为与其位置相关的值,以供在寄存器内使用: ``` struct Field { @@ -124,15 +124,15 @@ fn enable_register(&mut reg) { } ``` -使用 Rust,你可以使用数据结构来表示字段,将它们附加到特定的寄存器,并在与硬件交互时提供简洁明了的人机工程学。这个例子使用了 Rust 提供的最基本的功能。无论如何,添加的结构都会减轻上述 C 示例中的某些密度。现在,字段是个已命名的事物,而不是从模糊的按位运算符派生而来的数字,并且寄存器是具有状态的类型 —— 这在硬件上多了一层抽象。 +使用 Rust,你可以使用数据结构来表示字段,将它们附加到特定的寄存器,并在与硬件交互时提供简洁明了的工效。这个例子使用了 Rust 提供的最基本的功能。无论如何,添加的结构都会减轻上述 C 示例中的某些晦涩的地方。现在,字段是个带有名字的事物,而不是从模糊的按位运算符派生而来的数字,并且寄存器是具有状态的类型 —— 这在硬件上多了一层抽象。 ### 一个易用的 Rust 实现 -用 Rust 重写的第一个版本很好,但是并不理想。你必须记住要带上掩码和偏移量,并且要手工进行临时计算,这容易出错。人类不擅长精确且重复的任务 —— 我们往往会感到疲劳或失去专注力,这会导致错误。一次一个寄存器地手动记录掩码和偏移量几乎可以肯定会很糟糕。这是最好留给机器的任务。 +用 Rust 重写的第一个版本很好,但是并不理想。你必须记住要带上掩码和偏移量,并且要手工进行临时计算,这容易出错。人类不擅长精确且重复的任务 —— 我们往往会感到疲劳或失去专注力,这会导致错误。一次一个寄存器地手动记录掩码和偏移量几乎可以肯定会以糟糕的结局而告终。这是最好留给机器的任务。 -其次,从结构上进行思考:如果有一种方法可以让字段的类型携带掩码和偏移信息呢?如果你要在访问硬件寄存器并与之交互的实现过程中就能发现错误,而不是在运行时才发现,该怎么办?也许你可以依靠一种通常用于在编译时解决问题的策略,例如类型。 +其次,从结构上进行思考:如果有一种方法可以让字段的类型携带掩码和偏移信息呢?如果可以在编译时就发现所实现的硬件寄存器的访问和交互中存在错误,而不是在运行时才发现,该怎么办?也许你可以依靠一种常用的策略在编译时解决问题,例如类型。 -你可以使用 [typenum][6] 来修改前面的示例,该库在类型级别提供数字和算术。在这里,你将使用掩码和偏移量对 `Field` 类型进行参数化,使其可用于任何 `Field` 实例,而不必在调用站点中将其包括在内: +你可以使用 [typenum][6] 来修改前面的示例,该库在类型级别提供数字和算术。在这里,你将使用掩码和偏移量对 `Field` 类型进行参数化,使其可用于任何 `Field` 实例,而无需将其包括在调用处: ``` #[macro_use] @@ -175,7 +175,7 @@ fn enable_register(&mut reg) { } ``` -看起来不错,但是……如果你对给定的值是否*适合*某个字段犯了错误,会发生什么?考虑一个简单的输入错误,你在其中放置了 `10` 而不是 `1`: +看起来不错,但是……如果你在给定的值是否*适合*字段方面犯了错误,会发生什么?考虑一个简单的输入错误,你在其中放置了 `10` 而不是 `1`: ``` fn enable_register(&mut reg) { @@ -219,11 +219,11 @@ impl Field { @@ -252,7 +252,7 @@ impl Field Date: Tue, 28 Jan 2020 09:47:52 +0800 Subject: [PATCH 108/285] Translating --- ...to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md b/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md index 869e8b1d79..889155174e 100644 --- a/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md +++ b/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f95e330888af9cef038122a9460f032b43718a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 28 Jan 2020 10:03:28 +0800 Subject: [PATCH 109/285] Translated --- ...0 is Released- Here-s How to Install it.md | 119 ------------------ ...0 is Released- Here-s How to Install it.md | 119 ++++++++++++++++++ 2 files changed, 119 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md create mode 100644 translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md diff --git a/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md deleted file mode 100644 index 3a06b5b5cb..0000000000 --- a/sources/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Wine 5.0 is Released! Here’s How to Install it) -[#]: via: (https://itsfoss.com/wine-5-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Wine 5.0 is Released! Here’s How to Install it -====== - -_**Brief: A new major release of Wine is here. With Wine 5.0, running Windows applications and games on Linux is further improved.**_ - -With some efforts, you can [run Windows applications on Linux][1] using Wine. Wine is a tool that you may try when you must use a software that is available only on Windows. It supports a number of such software. - -A new major release for Wine has landed i.e Wine 5.0, almost after a year of its 4.0 release. - -Wine 5.0 release introduces a couple of major features and a lot of significant changes/improvements. In this article, I’ll highlight what’s new and also mention the installation instructions. - -### What’s New In Wine 5.0? - -![][2] - -The key changes in 5.0 release as mentioned in their [official announcement][3]: - - * Builtin modules in PE format. - * Multi-monitor support. - * XAudio2 reimplementation. - * Vulkan 1.1 support. - * Microsoft Installer (MSI) Patch Files are supported. - * Performance improvements. - - - -So, with Vulkan 1.1 support and multi-monitor support – Wine 5.0 release is a big deal. - -In addition to the key highlights, you can also expect better controller support in the new version considering thousands of changes/improvements involved in the new release. - -It is also worth noting that this release is being dedicated to the memory of **Józef Kucia** (_lead developer of the vkd3d project_) - -They’ve also mentioned this in their [release notes][4]: - -> This release is dedicated to the memory of Józef Kucia, who passed away in August 2019 at the young age of 30. Józef was a major contributor to Wine’s Direct3D implementation, and the lead developer of the vkd3d project. His skills and his kindness are sorely missed by all of us. - -### How to install Wine 5.0 on Ubuntu and Linux Mint - -Note - -_If you have Wine installed before, you should remove it completely to avoid any conflict (as you wish). Also, the WineHQ key repository key was changed recently, you should refer to its_ [_download page_][5] _for additional instructions on that according to your Linux distribution._ - -The source for Wine 5.0 is available on its [official website][3]. You can read more about [building wine][6] in order to make it work. Arch-based users should be getting it soon. - -Here’ I’ll show you the steps to install Wine 5.0 on Ubuntu and other Ubuntu-based distributions. - -First, remove existing Wine install with this command: - -``` -sudo apt remove winehq-stable wine-stable wine1.6 -``` - -Download the official Wine repository key and add it: - -``` -wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - -``` - -_**Now the next step involves adding the repository and for that, you need to [know your Ubuntu version][7] first.**_ - -For **Ubuntu 19.10**, add this repository: - -``` -sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main' -``` - -If you are using **Ubuntu 18.04** or **Linux Mint 19.x**, use this command to add the repository: - -``` -sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' -``` - -For **Ubuntu 16.04 and Linux Mint 18.x series**, you can use this command: - -``` -sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main' -``` - -Now that you have added the correct repository, you can install Wine 5.0 using this command: - -``` -sudo apt update && sudo apt install --install-recommends winehq-stable -``` - -**Wrapping Up** - -Have you tried the latest Wine 5.0 release yet? If yes, what improvements do you see in action? - -Let me know your thoughts on the new release in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/wine-5-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/use-windows-applications-linux/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/wine_5.png?ssl=1 -[3]: https://www.winehq.org/news/2020012101 -[4]: https://www.winehq.org/announce/5.0 -[5]: https://wiki.winehq.org/Download -[6]: https://wiki.winehq.org/Building_Wine -[7]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ diff --git a/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md new file mode 100644 index 0000000000..24c1077236 --- /dev/null +++ b/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Wine 5.0 is Released! Here’s How to Install it) +[#]: via: (https://itsfoss.com/wine-5-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Wine 5.0 发布了!这里是如何安装它的方法 +====== + +_**简介:在这里,Wine 的一个新的主要版本发布。使用 Wine 5.0 ,在 Linux 上运行 Windows 应用程序和游戏得到进一步改进。**_ + +因为一些努力,你可以使用 Wine [在 Linux 上运行 Windows 应用程序][1] 。Wine 是一个当你必需使用一个仅在 Windows 上可用的软件时你可以尝试的工具。它支持许多这样的软件。 + +Wine 的一个新的主要发布版本已经降临,即 Wine 5.0 ,几乎在它的 4.0 发布一年之后。 + +Wine 5.0 发布版本引进了几个主要的特色和很多有重大意义的更改/改进。我将重点介绍新的特色是什么,并且也将提到安装说明。 + +### 在 Wine 5.0 中有什么新的特色? + +![][2] + +在 5.0 发布版本中的关键更改,正如在他们的[官方声明][3]所述一样: + + * PE 格式的内置模块。 + * 多监视器支持。 + * XAudio2 重新实施。 + * Vulkan 1.1 支持。 + * 支持微软安装程序(MSI)补丁文件。 + * 性能改进。 + + + +因此,随着 Vulkan 1.1 和多监视器的支持 – Wine 5.0 发布版本是一件大事。 + +除了关键强调以外,就在新的版本中包含成千上万的更改/改进而言,你同样可以期待在新的版本中有更好的控制器支持。 + +这个发布版本致力于纪念 **Józef Kucia** (_vkd3d 项目的首席开发人员_)也是值得注意的 + +他们也已经在[发布说明][4]中提到这一点: + +> 这个发布版本致力于纪念 Józef Kucia ,他在 2019 年 8 月去世,年仅 30 岁。Józef 是 Wine 的 Direct3D 实施的一个主要贡献者,并且是 vkd3d 项目的首席开发人员。我们都非常怀念他的技能和善良。 + +### 如何在 Ubuntu 和 Linux Mint 上安装 Wine 5.0 + +注意 + +_如果你在以前安装过 Wine ,你应该将其完全移除,以避免一些冲突(像你希望的一样)。此外,WineHQ 秘钥存储库最近已被更改,对于额外的操作指南,你可以根据你的 Linux 发行版来参考它的_ [_下载页面_][5]。_ + +Wine 5.0 的源码可在它的[官方网站][3]上获得。为了使其工作,你可以阅读更多关于[构建 wine][6]的信息。基于 Arch 的用户应该很快就会得到它。 + +在这里,我将向你展示在 Ubuntu 和其它基于 Ubuntu 的发行版上安装 Wine 5.0 的步骤。 + +首先,使用这个命令来移除现存的 Wine 安装: + +``` +sudo apt remove winehq-stable wine-stable wine1.6 +``` + +下载并添加官方 Wine 存储库秘钥: + +``` +wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - +``` + +_**现在,接下来的步骤需要添加存储库,为此, 你需要首先[知道你的 Ubuntu 版本][7]。**_ + +对于 **Ubuntu 19.10** ,添加这个存储库: + +``` +sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main' +``` + +如果你正在使用 **Ubuntu 18.04** 或 **Linux Mint 19.x** ,使用这个命令来添加存储库: + +``` +sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' +``` + +对于 **Ubuntu 16.04 和 Linux Mint 18.x 系列** ,你可以使用这个命令: + +``` +sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main' +``` + +现在,你已经添加了正确的存储库,你可以使用这个命令来安装 Wine 5.0 : + +``` +sudo apt update && sudo apt install --install-recommends winehq-stable +``` + +**总结** + +你尝试过最新的 Wine 5.0 发布版本吗?如果是的话,在运行中你看到什么改进? + +在下面的评论区域,让我知道你对新的发布版本的看法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wine-5-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/use-windows-applications-linux/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/wine_5.png?ssl=1 +[3]: https://www.winehq.org/news/2020012101 +[4]: https://www.winehq.org/announce/5.0 +[5]: https://wiki.winehq.org/Download +[6]: https://wiki.winehq.org/Building_Wine +[7]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ From aa8840bd82eab656d16349a80a885df01075a430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 28 Jan 2020 10:08:19 +0800 Subject: [PATCH 110/285] Translating --- .../20191022 How to Go About Linux Boot Time Optimisation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191022 How to Go About Linux Boot Time Optimisation.md b/sources/tech/20191022 How to Go About Linux Boot Time Optimisation.md index 9e99bcdb7c..7d5721625b 100644 --- a/sources/tech/20191022 How to Go About Linux Boot Time Optimisation.md +++ b/sources/tech/20191022 How to Go About Linux Boot Time Optimisation.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3e5cef3f4a46bbae2e70aafdf700659f455a3b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 28 Jan 2020 10:09:36 +0800 Subject: [PATCH 111/285] Translating --- ...115 Root User in Ubuntu- Important Things You Should Know.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md b/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md index 247391ff82..f58ada5c58 100644 --- a/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md +++ b/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0826a4308b02a3c9254ceaec09c443b613e64128 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Jan 2020 12:22:46 +0800 Subject: [PATCH 112/285] TSL --- ...e for programming hardware abstractions.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index ffee4807f9..9250524c2f 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -124,13 +124,13 @@ fn enable_register(&mut reg) { } ``` -使用 Rust,你可以使用数据结构来表示字段,将它们附加到特定的寄存器,并在与硬件交互时提供简洁明了的工效。这个例子使用了 Rust 提供的最基本的功能。无论如何,添加的结构都会减轻上述 C 示例中的某些晦涩的地方。现在,字段是个带有名字的事物,而不是从模糊的按位运算符派生而来的数字,并且寄存器是具有状态的类型 —— 这在硬件上多了一层抽象。 +使用 Rust,你可以使用数据结构来表示字段,将它们与特定的寄存器联系起来,并在与硬件交互时提供简洁明了的工效。这个例子使用了 Rust 提供的最基本的功能。无论如何,添加的结构都会减轻上述 C 示例中的某些晦涩的地方。现在,字段是个带有名字的事物,而不是从模糊的按位运算符派生而来的数字,并且寄存器是具有状态的类型 —— 这在硬件上多了一层抽象。 ### 一个易用的 Rust 实现 用 Rust 重写的第一个版本很好,但是并不理想。你必须记住要带上掩码和偏移量,并且要手工进行临时计算,这容易出错。人类不擅长精确且重复的任务 —— 我们往往会感到疲劳或失去专注力,这会导致错误。一次一个寄存器地手动记录掩码和偏移量几乎可以肯定会以糟糕的结局而告终。这是最好留给机器的任务。 -其次,从结构上进行思考:如果有一种方法可以让字段的类型携带掩码和偏移信息呢?如果可以在编译时就发现所实现的硬件寄存器的访问和交互中存在错误,而不是在运行时才发现,该怎么办?也许你可以依靠一种常用的策略在编译时解决问题,例如类型。 +其次,从结构上进行思考:如果有一种方法可以让字段的类型携带掩码和偏移信息呢?如果可以在编译时就发现硬件寄存器的访问和交互的实现代码中存在错误,而不是在运行时才发现,该怎么办?也许你可以依靠一种在编译时解决问题的常用策略,例如类型。 你可以使用 [typenum][6] 来修改前面的示例,该库在类型级别提供数字和算术。在这里,你将使用掩码和偏移量对 `Field` 类型进行参数化,使其可用于任何 `Field` 实例,而无需将其包括在调用处: @@ -175,7 +175,7 @@ fn enable_register(&mut reg) { } ``` -看起来不错,但是……如果你在给定的值是否*适合*字段方面犯了错误,会发生什么?考虑一个简单的输入错误,你在其中放置了 `10` 而不是 `1`: +看起来不错,但是……如果你在给定的值是否*适合*该字段方面犯了错误,会发生什么?考虑一个简单的输入错误,你在其中放置了 `10` 而不是 `1`: ``` fn enable_register(&mut reg) { @@ -183,7 +183,7 @@ fn enable_register(&mut reg) { } ``` -在上面的代码中,预期结果是什么?好吧,代码会将启用位设置为 0,因为 `10&1 = 0`。那真不幸;最好在尝试写入之前知道你要写入字段的值是否适合该字段。事实上,我会考虑放弃错误字段值的高位*未定义行为*(喘气)。 +在上面的代码中,预期结果是什么?好吧,代码会将启用位设置为 0,因为 `10&1 = 0`。那真不幸;最好在尝试写入之前知道你要写入字段的值是否适合该字段。事实上,我认为截掉错误字段值的高位是一种 1*未定义的行为*(哈)。 ### 出于安全考虑使用 Rust @@ -219,11 +219,11 @@ impl Field { @@ -252,7 +252,7 @@ impl Field, typenum::B0>, typenum::B1>, typenum::B0>, typenum::B0> as typenum::IsLessOrEqual, typenum::B0>, typenum::B1>, typenum::B0>>>::Output == typenum::B1` @@ -415,9 +415,9 @@ error[E0271]: type mismatch resolving `疯了,地狱了,不要再忍受了Mad As Hell And Wasn't Going To Take It Anymore》,并做了一个小工具 `tnfilt`,从这种命名空间的二进制 cons 单元的痛苦中解脱出来。`tnfilt` 将 cons 单元格式的表示法替换为可让人看懂的十进制数字。我们认为其他人也会遇到类似的困难,所以我们分享了 [tnfilt][14]。你可以像这样使用它: ``` $ cargo build 2>&1 | tnfilt @@ -429,22 +429,22 @@ $ cargo build 2>&1 | tnfilt error[E0271]: type mismatch resolving `>::Output == typenum::B1` ``` -现在*这*很有意义! +现在*这*才有意义! ### 结论 -当与软件中的硬件进行交互时,普遍使用内存映射寄存器,并且有无数种方法来描述这些交互,每种方法在易用性和安全性上都有不同的权衡。我们发现使用类型级编程来获取内存映射寄存器交互的编译时检查为我们提供了制作更安全软件的必要信息。该代码可在 [bounded-registers][15] crate(Rust包)中找到。 +当在软件与硬件进行交互时,普遍使用内存映射寄存器,并且有无数种方法来描述这些交互,每种方法在易用性和安全性上都有不同的权衡。我们发现使用类型级编程来取得内存映射寄存器交互的编译时检查可以为我们提供制作更安全软件的必要信息。该代码可在 [bounded-registers][15] crate(Rust 包)中找到。 -我们的团队从安全性较高的一面开始,然后尝试找出如何将易用滑块移近易用端。从这些雄心壮志中,“边界寄存器”就诞生了,我们在 Auxon 冒险中遇到遇到内存映射设备的任何时候都可以使用它。 +我们的团队从安全性较高的一面开始,然后尝试找出如何将易用性滑块移近易用端。从这些雄心壮志中,“边界寄存器”就诞生了,我们在 Auxon 公司的冒险中遇到内存映射设备的任何时候都可以使用它。 * * * [^1]: 从技术上讲,从定义上看,从寄存器字段读取的值只能在规定的范围内,但是我们当中没有一个人生活在一个纯净的世界中,而且你永远都不知道外部系统发挥作用时会发生什么。你是在这里接受硬件之神的命令,因此与其强迫你进入“可能的恐慌”状态,还不如给你提供处理“这将永远不会发生”的机会。 -[^2]: `get_field` 看起来有点奇怪。我正在专门查看 `Field::Read` 部分。`Field` 是一种类型,你需要该类型的实例才能传递给 `get_field`。更干净的 API 可能类似于:`regs.rx.get_field::();`但是请记住,`Field` 是类型的同义词,它具有固定的宽度、偏移量等索引。要像这样对 `get_field` 进行参数化,你需要使用更高级的类型。 +[^2]: `get_field` 看起来有点奇怪。我正在专门查看 `Field::Read` 部分。`Field` 是一种类型,你需要该类型的实例才能传递给 `get_field`。更干净的 API 可能类似于:`regs.rx.get_field::();` 但是请记住,`Field` 是一种具有固定的宽度、偏移量等索引的类型的同义词。要像这样对 `get_field` 进行参数化,你需要使用更高级的类型。 * * * -此内容最初出现在 [Auxon Engineering 博客] [16]上,并经许可进行编辑和重新发布。 +此内容最初发布在 [Auxon Engineering 博客][16]上,并经许可进行编辑和重新发布。 -------------------------------------------------------------------------------- From d0ee13e5455bb8e30baf5923dd15a3d7d1b756aa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Jan 2020 12:35:43 +0800 Subject: [PATCH 113/285] PRF @wxy --- ...Which to choose for programming hardware abstractions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index 9250524c2f..9c504f2c63 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (C vs. Rust: Which to choose for programming hardware abstractions) @@ -12,7 +12,7 @@ C 还是 Rust:选择哪个用于硬件抽象编程 > 在 Rust 中使用类型级编程可以使硬件抽象更加安全。 -![Tools illustration][1] +![](https://img.linux.net.cn/data/attachment/album/202001/28/123350k2w4mr3tp7crd4m2.jpg) Rust 是一种日益流行的编程语言,被视为硬件接口的最佳选择。通常会将其与 C 的抽象级别相比较。本文介绍了 Rust 如何通过多种方式处理按位运算,并提供了既安全又易于使用的解决方案。 @@ -453,7 +453,7 @@ via: https://opensource.com/article/20/1/c-vs-rust-abstractions 作者:[Dan Pittman][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 ee8392676be727ebffa843d8ca1a096a37077311 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Jan 2020 12:36:11 +0800 Subject: [PATCH 114/285] PUB @wxy https://linux.cn/article-11825-1.html --- ...- Which to choose for programming hardware abstractions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md (99%) diff --git a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/published/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md similarity index 99% rename from translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md rename to published/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index 9c504f2c63..dcdbc98b5a 100644 --- a/translated/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/published/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11825-1.html) [#]: subject: (C vs. Rust: Which to choose for programming hardware abstractions) [#]: via: (https://opensource.com/article/20/1/c-vs-rust-abstractions) [#]: author: (Dan Pittman https://opensource.com/users/dan-pittman) From e8e118e81a1ff74efa5d6d33260f83ad15bb419b Mon Sep 17 00:00:00 2001 From: laingke Date: Tue, 28 Jan 2020 13:01:19 +0800 Subject: [PATCH 115/285] 20200102-javastream translating --- ...00102 Data streaming and functional programming in Java.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200102 Data streaming and functional programming in Java.md b/sources/tech/20200102 Data streaming and functional programming in Java.md index 0349de9072..c3e914001b 100644 --- a/sources/tech/20200102 Data streaming and functional programming in Java.md +++ b/sources/tech/20200102 Data streaming and functional programming in Java.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (laingke) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -474,7 +474,7 @@ via: https://opensource.com/article/20/1/javastream 作者:[Marty Kalin][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[laingke](https://github.com/laingke) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6489c1205015ae9a9da1682d928c4f8e925e9214 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Jan 2020 14:15:15 +0800 Subject: [PATCH 116/285] PRF @robsean --- ...0 is Released- Here-s How to Install it.md | 128 ++++++++++++------ 1 file changed, 87 insertions(+), 41 deletions(-) diff --git a/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md index 24c1077236..78f0909d4a 100644 --- a/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md +++ b/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md @@ -1,97 +1,141 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Wine 5.0 is Released! Here’s How to Install it) [#]: via: (https://itsfoss.com/wine-5-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Wine 5.0 发布了!这里是如何安装它的方法 +Wine 5.0 发布了! ====== -_**简介:在这里,Wine 的一个新的主要版本发布。使用 Wine 5.0 ,在 Linux 上运行 Windows 应用程序和游戏得到进一步改进。**_ +> Wine 的一个新的主要版本发布了。使用 Wine 5.0,在 Linux 上运行 Windows 应用程序和游戏的体验得到进一步改进。 -因为一些努力,你可以使用 Wine [在 Linux 上运行 Windows 应用程序][1] 。Wine 是一个当你必需使用一个仅在 Windows 上可用的软件时你可以尝试的工具。它支持许多这样的软件。 +通过一些努力,你可以使用 Wine [在 Linux 上运行 Windows 应用程序][1]。当你必须使用一个仅在 Windows 上可用的软件时,Wine 是一个可以尝试的工具。它支持许多这样的软件。 -Wine 的一个新的主要发布版本已经降临,即 Wine 5.0 ,几乎在它的 4.0 发布一年之后。 +Wine 的一个新的主要发布版本已经降临,即 Wine 5.0,几乎距它的 4.0 发布一年之后。 -Wine 5.0 发布版本引进了几个主要的特色和很多有重大意义的更改/改进。我将重点介绍新的特色是什么,并且也将提到安装说明。 +Wine 5.0 发布版本引进了几个主要特性和很多显著的更改/改进。在这篇文章中,我将重点介绍新的特性是什么,并且也将提到安装说明。 -### 在 Wine 5.0 中有什么新的特色? +### 在 Wine 5.0 中有什么新的特性? ![][2] -在 5.0 发布版本中的关键更改,正如在他们的[官方声明][3]所述一样: +如他们的[官方声明][3]所述,这是 5.0 发布版本中的关键更改: - * PE 格式的内置模块。 - * 多监视器支持。 - * XAudio2 重新实施。 - * Vulkan 1.1 支持。 - * 支持微软安装程序(MSI)补丁文件。 - * 性能改进。 +* PE 格式的内置模块。 +* 支持多显示器。 +* 重新实现了 XAudio2。 +* 支持 Vulkan 1.1。 +* 支持微软安装程序(MSI)补丁文件。 +* 性能提升。 +因此,随着 Vulkan 1.1 和对多显示器的支持 —— Wine 5.0 发布版本是一件大事。 +除了上面强调的这些关键内容以外,在新的版本中包含成千上万的更改/改进中,你还可以期待对控制器的支持更好。 -因此,随着 Vulkan 1.1 和多监视器的支持 – Wine 5.0 发布版本是一件大事。 - -除了关键强调以外,就在新的版本中包含成千上万的更改/改进而言,你同样可以期待在新的版本中有更好的控制器支持。 - -这个发布版本致力于纪念 **Józef Kucia** (_vkd3d 项目的首席开发人员_)也是值得注意的 +值得注意的是,此版本特别纪念了 **Józef Kucia**(vkd3d 项目的首席开发人员)。 他们也已经在[发布说明][4]中提到这一点: -> 这个发布版本致力于纪念 Józef Kucia ,他在 2019 年 8 月去世,年仅 30 岁。Józef 是 Wine 的 Direct3D 实施的一个主要贡献者,并且是 vkd3d 项目的首席开发人员。我们都非常怀念他的技能和善良。 +> 这个发布版本特别纪念了 Józef Kucia,他于 2019 年 8 月去世,年仅 30 岁。Józef 是 Wine 的 Direct3D 实现的一个主要贡献者,并且是 vkd3d 项目的首席开发人员。我们都非常怀念他的技能和友善。 ### 如何在 Ubuntu 和 Linux Mint 上安装 Wine 5.0 -注意 +> 注意: -_如果你在以前安装过 Wine ,你应该将其完全移除,以避免一些冲突(像你希望的一样)。此外,WineHQ 秘钥存储库最近已被更改,对于额外的操作指南,你可以根据你的 Linux 发行版来参考它的_ [_下载页面_][5]。_ +> 如果你在以前安装过 Wine,你应该将其完全移除,以(如你希望的)避免一些冲突。此外,WineHQ 存储库的密钥最近已被更改,针对你的 Linux 发行版的更多的操作指南,你可以参考它的[下载页面][5]。 -Wine 5.0 的源码可在它的[官方网站][3]上获得。为了使其工作,你可以阅读更多关于[构建 wine][6]的信息。基于 Arch 的用户应该很快就会得到它。 +Wine 5.0 的源码可在它的[官方网站][3]上获得。为了使其工作,你可以阅读更多关于[构建 Wine][6] 的信息。基于 Arch 的用户应该很快就会得到它。 -在这里,我将向你展示在 Ubuntu 和其它基于 Ubuntu 的发行版上安装 Wine 5.0 的步骤。 +在这里,我将向你展示在 Ubuntu 和其它基于 Ubuntu 的发行版上安装 Wine 5.0 的步骤。请耐心,并按照步骤一步一步安装和使用 Wine。这里涉及几个步骤。 -首先,使用这个命令来移除现存的 Wine 安装: +请记住,Wine 安装了太多软件包。你会看到大量的软件包列表,下载大小约为 1.3 GB。 + +### 在 Ubuntu 上安装 Wine 5.0(不适用于 Linux Mint) + +首先,使用这个命令来移除现存的 Wine: ``` -sudo apt remove winehq-stable wine-stable wine1.6 +sudo apt remove winehq-stable wine-stable wine1.6 wine-mono wine-geco winetricks ``` -下载并添加官方 Wine 存储库秘钥: +然后确保添加 32 位体系结构支持: + +``` +sudo dpkg --add-architecture i386 +``` + +下载并添加官方 Wine 存储库密钥: ``` wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - ``` -_**现在,接下来的步骤需要添加存储库,为此, 你需要首先[知道你的 Ubuntu 版本][7]。**_ +现在,接下来的步骤需要添加存储库,为此, 你需要首先[知道你的 Ubuntu 版本][7]。 -对于 **Ubuntu 19.10** ,添加这个存储库: +对于 **Ubuntu 18.04 和 19.04**,用这个 PPA 添加 FAudio 依赖, **Ubuntu 19.10** 不需要它: ``` -sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main' +sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport ``` -如果你正在使用 **Ubuntu 18.04** 或 **Linux Mint 19.x** ,使用这个命令来添加存储库: +现在使用此命令添加存储库: ``` -sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' +sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu $(lsb_release -cs) main" ``` -对于 **Ubuntu 16.04 和 Linux Mint 18.x 系列** ,你可以使用这个命令: - -``` -sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main' -``` - -现在,你已经添加了正确的存储库,你可以使用这个命令来安装 Wine 5.0 : +现在你已经添加了正确的存储库,可以使用以下命令安装 Wine 5.0: ``` sudo apt update && sudo apt install --install-recommends winehq-stable ``` -**总结** +请注意,尽管[在软件包列表中将 Wine 5 列为稳定版][8],但你仍可能会看到 winehq-stable 的 wine 4.0.3。也许它不会传播到所有地理位置。从今天早上开始,我可以看到 Wine 5.0。 + +### 在 Linux Mint 19.1、19.2 和 19.3 中安装 Wine 5.0 + +正如一些读者通知我的那样,[apt-add 存储库命令][9]不适用于 Linux Mint 19.x 系列。 + +这是添加自定义存储库的另一种方法。你必须执行与 Ubuntu 相同的步骤。如删除现存的 Wine 包: + +``` +sudo apt remove winehq-stable wine-stable wine1.6 wine-mono wine-geco winetricks +``` + +添加 32 位支持: + +``` +sudo dpkg --add-architecture i386 +``` + +然后添加 GPG 密钥: + +``` +wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - +``` + +添加 FAudio 依赖: + +``` +sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport +``` + +现在为 Wine 存储库创建一个新条目: + +``` +sudo sh -c "echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' >> /etc/apt/sources.list.d/winehq.list" +``` + +更新软件包列表并安装Wine: + +``` +sudo apt update && sudo apt install --install-recommends winehq-stable +``` + +### 总结 你尝试过最新的 Wine 5.0 发布版本吗?如果是的话,在运行中你看到什么改进? @@ -104,7 +148,7 @@ via: https://itsfoss.com/wine-5-release/ 作者:[Ankush Das][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/) 荣誉推出 @@ -117,3 +161,5 @@ via: https://itsfoss.com/wine-5-release/ [5]: https://wiki.winehq.org/Download [6]: https://wiki.winehq.org/Building_Wine [7]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[8]: https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-amd64/ +[9]: https://itsfoss.com/add-apt-repository-command-not-found/ From 0f6c9206e83df2770d447759b8f2f1562a74ee2b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Jan 2020 14:15:50 +0800 Subject: [PATCH 117/285] PUB @robsean https://linux.cn/article-11827-1.html --- ...20200123 Wine 5.0 is Released- Here-s How to Install it.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200123 Wine 5.0 is Released- Here-s How to Install it.md (98%) diff --git a/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/published/20200123 Wine 5.0 is Released- Here-s How to Install it.md similarity index 98% rename from translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md rename to published/20200123 Wine 5.0 is Released- Here-s How to Install it.md index 78f0909d4a..683f033104 100644 --- a/translated/tech/20200123 Wine 5.0 is Released- Here-s How to Install it.md +++ b/published/20200123 Wine 5.0 is Released- Here-s How to Install it.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11827-1.html) [#]: subject: (Wine 5.0 is Released! Here’s How to Install it) [#]: via: (https://itsfoss.com/wine-5-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From bd0cd29fdfa9daea6b126db74f8056f26552f3e3 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 28 Jan 2020 16:26:54 +0800 Subject: [PATCH 118/285] [translated]20191108 My Linux story- Learning Linux in the 90s --- ... Linux story- Learning Linux in the 90s.md | 61 ------------------- ... Linux story- Learning Linux in the 90s.md | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+), 61 deletions(-) delete mode 100644 sources/talk/20191108 My Linux story- Learning Linux in the 90s.md create mode 100644 translated/talk/20191108 My Linux story- Learning Linux in the 90s.md diff --git a/sources/talk/20191108 My Linux story- Learning Linux in the 90s.md b/sources/talk/20191108 My Linux story- Learning Linux in the 90s.md deleted file mode 100644 index 11ba748cc8..0000000000 --- a/sources/talk/20191108 My Linux story- Learning Linux in the 90s.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (My Linux story: Learning Linux in the 90s) -[#]: via: (https://opensource.com/article/19/11/learning-linux-90s) -[#]: author: (Mike Harris https://opensource.com/users/mharris) - -My Linux story: Learning Linux in the 90s -====== -This is the story of how I learned Linux before the age of WiFi, when -distributions came in the form of a CD. -![Sky with clouds and grass][1] - -Most people probably don't remember where they, the computing industry, or the everyday world were in 1996. But I remember that year very clearly. I was a sophomore in high school in the middle of Kansas, and it was the start of my journey into free and open source software (FOSS). - -I'm getting ahead of myself here. I was interested in computers even before 1996. I was born and raised on my family's first Apple ][e, followed many years later by the IBM Personal System/2. (Yes, there were definitely some generational skips along the way.) The IBM PS/2 had a very exciting feature: a 1200 baud Hayes modem. - -I don't remember how, but early on, I got the phone number of a local [BBS][2]. Once I dialed into it, I could get a list of other BBSes in the local area, and my adventure into networked computing began. - -In 1995, the people [lucky enough][3] to have a home internet connection spent less than 30 minutes a month using it. That internet was nothing like our modern services that operate over satellite, fiber, CATV coax, or any version of copper lines. Most homes dialed in with a modem, which tied up their phone line. (This was also long before cellphones were pervasive, and most people had just one home phone line.) I don't think there were many independent internet service providers (ISPs) back then, although that may have depended upon where you were located, so most people got service from a handful of big names, including America Online, CompuServe, and Prodigy. - -And the service you did get was very slow; even at dial-up's peak evolution at 56K, you could only expect to get a maximum of about 3.5 Kbps. If you wanted to try Linux, downloading a 200MB to 800MB ISO image or (more realistically) a disk image set was a dedication to time, determination, and lack of phone usage. - -I went with the easier route: In 1996, I ordered a "tri-Linux" CD set from a major Linux distributor. These tri-Linux disks provided three distributions; mine included Debian 1.1 (the first stable release of Debian), Red Hat Linux 3.0.3, and Slackware 3.1 (nicknamed Slackware '96). As I recall, the discs were purchased from an online store called [Linux Systems Labs][4]. The online store doesn't exist now, but in the 90s and early 00s, such distributors were common. And so were multi-disc sets of Linux. This one's from 1998 but gives you an idea of what they involved: - -![A tri-linux CD set][5] - -![A tri-linux CD set][6] - -On a fateful day in the summer of 1996, while living in a new and relatively rural city in Kansas, I made my first attempt at installing and working with Linux. Throughout the summer of '96, I tried all three distributions on that tri-Linux CD set. They all ran beautifully on my mom's older Pentium 75MHz computer. - -I ended up choosing [Slackware][7] 3.1 as my preferred distribution, probably more because of the terminal's appearance than the other, more important reasons one should consider before deciding on a distribution. - -I was up and running. I was connecting to an "off-brand" ISP (a local provider in the area), dialing in on my family's second phone line (ordered to accommodate all my internet use). I was in heaven. I had a dual-boot (Microsoft Windows 95 and Slackware 3.1) computer that worked wonderfully. I was still dialing into the BBSes that I knew and loved and playing online BBS games like Trade Wars, Usurper, and Legend of the Red Dragon. - -I can remember spending days upon days of time in #Linux on EFNet (IRC), helping other users answer their Linux questions and interacting with the moderation crew. - -More than 20 years after taking my first swing at using the Linux OS at home, I am now entering my fifth year as a consultant for Red Hat, still using Linux (now Fedora) as my daily driver, and still on IRC helping people looking to use Linux. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/11/learning-linux-90s - -作者:[Mike Harris][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mharris -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) -[2]: https://en.wikipedia.org/wiki/Bulletin_board_system -[3]: https://en.wikipedia.org/wiki/Global_Internet_usage#Internet_users -[4]: https://web.archive.org/web/19961221003003/http://lsl.com/ -[5]: https://opensource.com/sites/default/files/20191026_142009.jpg (A tri-linux CD set) -[6]: https://opensource.com/sites/default/files/20191026_142020.jpg (A tri-linux CD set) -[7]: http://slackware.com diff --git a/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md b/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md new file mode 100644 index 0000000000..ea0847761d --- /dev/null +++ b/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (alim0x) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My Linux story: Learning Linux in the 90s) +[#]: via: (https://opensource.com/article/19/11/learning-linux-90s) +[#]: author: (Mike Harris https://opensource.com/users/mharris) + +我的 Linux 故事:在 90 年代学习 Linux +====== +这是一个关于我如何在 WiFi 时代之前学习 Linux 的故事,那时的发行版还以 CD 的形式出现。 +![Sky with clouds and grass][1] + +大部分人可能不记得 1996 年时计算产业或日常生活世界的样子。但我很清楚地记得那一年。我那时候是堪萨斯中部一所高中的二年级学生,那是我的自由与开源软件(FOSS)旅程的开端。 + +我从这里开始进步。我在 1996 年之前就开始对计算机感兴趣。我出生并成长于我家的第一台 Apple ][e,然后多年之后是 IBM Personal System/2。(是的,在这过程中有一些代际的跨越。)IBM PS/2 有一个非常激动人心的特性:一个 1200 波特的 Hayes 调制解调器。 + +我不记得是怎样了,但在那不久之前,我得到了一个本地 [BBS][2] 的电话号码。一旦我拨号进去,我可以得到本地的一些其他 BBS 的列表,我的网络探险就此开始了。 + +在 1995 年,[足够幸运][3]的人拥有了家庭互联网连接,每月可以使用不到 30 分钟。这个互联网不像我们现代的服务那样,通过卫星、光纤、有线电视同轴电缆或任何版本的铜线提供。大多数家庭通过一个调制解调器拨号,它连接到他们的电话线上。(这时离移动电话无处不在的时代还早得很,大多数人只有一部家庭电话。)尽管这还要取决你所在的位置,但我不认为那时有很多独立的互联网服务提供商(ISP),所以大多数人从仅有的几家大公司获得服务,包括 America Online,CompuServe 以及 Prodigy。 + +你获取到的服务速率非常低,甚至在拨号上网演变的顶峰 56K,你也只能期望得到最高 3.5Kbps 的速率。如果你想要尝试 Linux,下载一个 200MB 到 800MB 的 ISO 镜像或(更加切合实际的)磁盘镜像要贡献出时间,决心,以及面临电话不可用的情形。 + +我走了一条简单一点的路:在 1996 年,我从一家主要的 Linux 分发商订购了一套“tri-Linux”CD。这些光盘提供了三个发行版,我的这套包含了 Debian 1.1 (Debian 的第一个稳定版本),Red Hat Linux 3.0.3 以及 Slackware 3.1(代号 Slackware '96)。据我回忆,这些光盘是从一家叫做 [Linux Systems Labs][4] 的在线商店购买的。这家在线商店如今已经不存在了,但在 90 年代和 00 年代早期,这样的分发商很常见。对于多光盘 Linux 套件也是如此。这是 1998 年的一套光盘,你可以了解到他们都包含了什么: + +![A tri-linux CD set][5] + +![A tri-linux CD set][6] + +在 1996 年夏天一个命中注定般的日子,那时我住在堪萨斯一个新的并且相对较为乡村的城市,我做出了安装并使用 Linux 的第一次尝试。在 1996 年的整个夏天,我尝试了那套三 Linux CD 套件里的全部三个发行版。他们都在我母亲的老 Pentium 75MHz 电脑上完美运行。 + +我最终选择了 [Slackware][7] 3.1 作为我喜欢的发行版,相比其他发行版可能更多的是因为它的终端的外观,这是决定选择一个发行版前需要考虑的重要因素。 + +我将系统设置完毕并运行了起来。我连接到一家“杂牌”ISP(一家这个区域的本地服务商),通过我家的第二条电话线拨号(为了满足我的所有互联网使用而订购)。那就像在天堂一样。我有一台完美运行的双系统(Microsoft Windows 95 和 Slackware 3.1)电脑。我依然拨号进入我所知道和喜爱的 BBS,游玩在线 BBS 游戏,比如 Trade Wars,Usurper 以及 Legend of the Red Dragon。 + +我能够记得花在 EFNet(IRC)上 #Linux 频道的一天天时光,帮助其他用户,回答他们的 Linux 问题以及和审核人员互动。 + +在我第一次在家尝试使用 Linux 系统的 20 多年后,我现在正进入作为 Red Hat 顾问的第五年,仍然在使用 Linux(现在是 Fedora)作为我的日常系统,并且依然在 IRC 上帮助想要使用 Linux 的人们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/11/learning-linux-90s + +作者:[Mike Harris][a] +选题:[lujun9972][b] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mharris +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) +[2]: https://en.wikipedia.org/wiki/Bulletin_board_system +[3]: https://en.wikipedia.org/wiki/Global_Internet_usage#Internet_users +[4]: https://web.archive.org/web/19961221003003/http://lsl.com/ +[5]: https://opensource.com/sites/default/files/20191026_142009.jpg (A tri-linux CD set) +[6]: https://opensource.com/sites/default/files/20191026_142020.jpg (A tri-linux CD set) +[7]: http://slackware.com From c86d2bf7e564e4267d671d41997d2b9bdd9c74a2 Mon Sep 17 00:00:00 2001 From: lixin <56751837+lixin555@users.noreply.github.com> Date: Tue, 28 Jan 2020 23:32:10 +0800 Subject: [PATCH 119/285] lixin555 is translating lixin555 is translating --- .../20190503 Mirror your System Drive using Software RAID.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190503 Mirror your System Drive using Software RAID.md b/sources/tech/20190503 Mirror your System Drive using Software RAID.md index 1b5936dfa0..e72f3a5722 100644 --- a/sources/tech/20190503 Mirror your System Drive using Software RAID.md +++ b/sources/tech/20190503 Mirror your System Drive using Software RAID.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lixin555) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -272,7 +272,7 @@ via: https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lixin555](https://github.com/lixin555) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 06071a54cfe5dcd1a56a8441626d537903ee70eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 00:57:16 +0800 Subject: [PATCH 120/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=20Ansibl?= =?UTF-8?q?e=20Playbooks=20Quick=20Start=20Guide=20with=20Examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md --- ...aybooks Quick Start Guide with Examples.md | 349 ++++++++++++++++++ 1 file changed, 349 insertions(+) create mode 100644 sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md diff --git a/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md b/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md new file mode 100644 index 0000000000..93b17b0fd3 --- /dev/null +++ b/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md @@ -0,0 +1,349 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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 +====== + +We have already written two articles about Ansible, this is the third article. + +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. + + * **Part-1: [How to Install and Configure Ansible on Linux][1]** + * **Part-2: [Ansible ad-hoc Command Quick Start Guide][2]** + + + +If you have finished them, you will feel the continuity as you read this article. + +### What is the 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. + +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. + +![][3] + +### Understanding the Ansible Playbooks Terminology + + * **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. + + + +### 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] + module_options-2: value + . + module_options-N: value +``` + +### How to Understand Ansible Output + +The Ansible Playbook output comes with 4 colors, see below for color definitions. + + * **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 + + + +To do so, create a playbook directory to keep them all in one place. + +``` +$ sudo mkdir /etc/ansible/playbooks +``` + +### Playbook-1: Ansible Playbook to Install Apache Web Server on RHEL Based Systems + +This sample playbook allows you to install the Apache web server on a given target node. + +``` +$ sudo nano /etc/ansible/playbooks/apache.yml + +--- +- hosts: web + become: yes + name: "Install and Configure Apache Web server" + tasks: + - name: "Install Apache Web Server" + yum: + name: httpd + state: latest + - name: "Ensure Apache Web Server is Running" + service: + name: httpd + state: started +``` + +``` +$ ansible-playbook apache1.yml +``` + +![][3] + +### How to Understand Playbook Execution in 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. + +``` +$ ansible-playbook apache1.yml --syntax-check + +ERROR! Syntax Error while loading YAML. + found a tab character that violate indentation +The error appears to be in '/etc/ansible/playbooks/apache1.yml': line 10, column 1, but may +be elsewhere in the file depending on the exact syntax problem. +The offending line appears to be: + state: latest +^ here +There appears to be a tab character at the start of the line. + +YAML does not use tabs for formatting. Tabs should be replaced with spaces. +For example: + - name: update tooling + vars: + version: 1.2.3 +# ^--- there is a tab there. +Should be written as: + - name: update tooling + vars: + version: 1.2.3 +# ^--- all spaces here. +``` + +Alternatively, you can check your ansible-playbook content from online using the following url @ [YAML Lint][4] + +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. + +``` +$ ansible-playbook apache.yml --check + +PLAY [Install and Configure Apache Webserver] ******************************************************************** + +TASK [Gathering Facts] ******************************************************************************************* +ok: [node2.2g.lab] +ok: [node1.2g.lab] + +TASK [Install Apache Web Server] ********************************************************************************* +changed: [node2.2g.lab] +changed: [node1.2g.lab] + +TASK [Ensure Apache Web Server is Running] *********************************************************************** +changed: [node1.2g.lab] +changed: [node2.2g.lab] + +PLAY RECAP ******************************************************************************************************* +node1.2g.lab : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +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-playbook apache.yml --check -vv + +ansible-playbook 2.9.2 + config file = /etc/ansible/ansible.cfg + configured module search path = ['/home/daygeek/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] + ansible python module location = /usr/lib/python3.8/site-packages/ansible + executable location = /usr/bin/ansible-playbook + python version = 3.8.1 (default, Jan 8 2020, 23:09:20) [GCC 9.2.0] +Using /etc/ansible/ansible.cfg as config file + +PLAYBOOK: apache.yml ***************************************************************************************************** +1 plays in apache.yml + +PLAY [Install and Configure Apache Webserver] **************************************************************************** + +TASK [Gathering Facts] *************************************************************************************************** +task path: /etc/ansible/playbooks/apache.yml:2 +ok: [node2.2g.lab] +ok: [node1.2g.lab] +META: ran handlers + +TASK [Install Apache Web Server] ***************************************************************************************** +task path: /etc/ansible/playbooks/apache.yml:6 +changed: [node2.2g.lab] => {"changed": true, "msg": "Check mode: No changes made, but would have if not in check mod +e", "rc": 0, "results": ["Installed: httpd"]} +changed: [node1.2g.lab] => {"changed": true, "changes": {"installed": ["httpd"], "updated": []}, "msg": "", "obsolet +es": {"urw-fonts": {"dist": "noarch", "repo": "@anaconda", "version": "2.4-16.el7"}}, "rc": 0, "results": []} + +TASK [Ensure Apache Web Server is Running] ******************************************************************************* +task path: /etc/ansible/playbooks/apache.yml:10 +changed: [node1.2g.lab] => {"changed": true, "msg": "Service httpd not found on host, assuming it will exist on full run"} +changed: [node2.2g.lab] => {"changed": true, "msg": "Service httpd not found on host, assuming it will exist on full run"} +META: ran handlers +META: ran handlers + +PLAY RECAP *************************************************************************************************************** +node1.2g.lab : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +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 + +This sample playbook allows you to install the Apache web server on a given target node. + +``` +$ sudo nano /etc/ansible/playbooks/apache-ubuntu.yml + +--- +- hosts: web + become: yes + name: "Install and Configure Apache Web Server" + tasks: + - name: "Install Apache Web Server" + yum: + name: apache2 + state: latest + + - name: "Start the Apache Web Server" + service: + name: apaceh2 + state: started + + - name: "Enable mod_rewrite module" + apache2_module: + name: rewrite + state: present + + notify: + - start apache + + handlers: + - name: "Ensure Apache Web Server is Running" + service: + name: apache2 + state: restarted + enabled: yes +``` + +### Playbook-3: Ansible Playbook to Install a List of Packages on Red Hat Based Systems + +This sample playbook allows you to install a list of packages on a given target node. + +**Method-1:** + +``` +$ sudo nano /etc/ansible/playbooks/packages-redhat.yml + +--- +- hosts: web + become: yes + name: "Install a List of Packages on Red Hat Based System" + tasks: + - name: "Installing a list of packages" + yum: + name: + - curl + - httpd + - nano + - htop +``` + +**Method-2:** + +``` +$ sudo nano /etc/ansible/playbooks/packages-redhat-1.yml + +--- +- hosts: web + become: yes + name: "Install a List of Packages on Red Hat Based System" + tasks: + - name: "Installing a list of packages" + yum: name={{ item }} state=latest + with_items: + - curl + - httpd + - nano + - htop +``` + +**Method-3: Using Array Variable** + +``` +$ sudo nano /etc/ansible/playbooks/packages-redhat-2.yml + +--- +- hosts: web + become: yes + name: "Install a List of Packages on Red Hat Based System" + vars: + packages: [ 'curl', 'git', 'htop' ] + tasks: + - name: Install a list of packages + yum: name={{ item }} state=latest + with_items: "{{ packages }}" +``` + +### Playbook-4: Ansible Playbook to Install Updates on Linux Systems + +This sample playbook allows you to install updates on your Linux systems, running Red Hat and Debian-based client nodes. + +``` +$ sudo nano /etc/ansible/playbooks/security-update.yml + +--- +- hosts: web + become: yes + name: "Install Security Update" + tasks: + - name: "Installing Security Update on Red Hat Based System" + yum: name=* update_cache=yes security=yes state=latest + when: ansible_facts['distribution'] == "CentOS" + + - name: "Installing Security Update on Ubuntu Based System" + apt: upgrade=dist update_cache=yes + when: ansible_facts['distribution'] == "Ubuntu" +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/ +[2]: https://www.2daygeek.com/ansible-ad-hoc-command-quick-start-guide-with-examples/ +[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[4]: http://www.yamllint.com/ From 475869c5a8f6af61dd6288f28f83ba5206cc72bc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 00:57:58 +0800 Subject: [PATCH 121/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20Build?= =?UTF-8?q?=20your=20own=20cloud=20with=20Fedora=2031=20and=20Nextcloud=20?= =?UTF-8?q?Server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md --- ...oud with Fedora 31 and Nextcloud Server.md | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md diff --git a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md new file mode 100644 index 0000000000..69b8ad9e06 --- /dev/null +++ b/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -0,0 +1,226 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build your own cloud with Fedora 31 and Nextcloud Server) +[#]: via: (https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/) +[#]: author: (storyteller https://fedoramagazine.org/author/storyteller/) + +Build your own cloud with Fedora 31 and Nextcloud Server +====== + +![][1] + +[Nextcloud][2] is a software suite for storing and syncing your data across multiple devices. You can learn more about Nextcloud Server’s features from [https://github.com/nextcloud/server][3]. + +This article demonstrates how to build a personal cloud using Fedora and Nextcloud in a few simple steps. For this tutorial you will need a dedicated computer or a virtual machine running Fedora 31 server edition and an internet connection. + +### Step 1: Install the prerequisites + +Before installing and configuring Nextcloud, a few prerequisites must be satisfied. + +First, install Apache web server: + +``` +# dnf install httpd +``` + +Next, install PHP and some additional modules. Make sure that the PHP version being installed meets [Nextcloud’s requirements][4]: + +``` +# dnf install php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-pecl-redis php-opcache php-imagick php-zip php-process +``` + +After PHP is installed enable and start the Apache web server: + +``` +# systemctl enable --now httpd +``` + +Next, allow _HTTP_ traffic through the firewall: + +``` +# firewall-cmd --permanent --add-service=http +# firewall-cmd --reload +``` + +Next, install the MariaDB server and client: + +``` +# dnf install mariadb mariadb-server +``` + +Then enable and start the MariaDB server: + +``` +# systemctl enable --now mariadb +``` + +Now that MariaDB is running on your server, you can run the _mysql_secure_installation_ command to secure it: + +``` +# mysql_secure_installation + +NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL + MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP + CAREFULLY! + +In order to log into MariaDB to secure it, we'll need the +current password for the root user. If you've just installed +MariaDB, and you haven't set the root password yet, the password +will be blank, so you should just press enter here. + +Enter current password for root (enter for none): +OK, successfully used password, moving on... + +Setting the root password ensures that nobody can log into +the MariaDB root user without the proper authorization. + +Set root password? [Y/n] +New password: Your_Password_Here +Re-enter new password: Your_Password_Here + +Password updated successfully! + +Reloading privilege tables... + ... Success! + +By default, a MariaDB installation has an anonymous user, +allowing anyone to log into MariaDB without having to have +a user account created for them. This is intended only for +testing, and to make the installation go a bit smoother. You +should remove them before moving into a production environment. + +Remove anonymous users? [Y/n] + ... Success! + +Normally, root should only be allowed to connect from +'localhost'. This ensures that someone cannot guess at the +root password from the network. + +Disallow root login remotely? [Y/n] + ... Success! + +By default, MariaDB comes with a database named 'test' that +anyone can access. This is also intended only for testing, and +should be removed before moving into a production environment. + +Remove test database and access to it? [Y/n] + + - Dropping test database... + ... Success! + + - Removing privileges on test database... + ... Success! + +Reloading the privilege tables will ensure that all changes +made so far will take effect immediately. + +Reload privilege tables now? [Y/n] + ... Success! + +Cleaning up... + +All done! If you've completed all of the above steps, your +MariaDB installation should now be secure. + +Thanks for using MariaDB! +``` + +Next, create a dedicated user and database for your Nextcloud instance: + +``` +# mysql -p +> create database nextcloud; +> create user 'nc_admin'@'localhost' identified by 'SeCrEt'; +> grant all privileges on nextcloud.* to 'nc_admin'@'localhost'; +> flush privileges; +> exit; +``` + +### Step 2: Install Nextcloud Server + +Now that the prerequisites for your Nextcloud installation have been satisfied, download and unzip [the Nextcloud archive][5]: + +``` +# wget https://download.nextcloud.com/server/releases/nextcloud-17.0.2.zip +# unzip nextcloud-17.0.2.zip -d /var/www/html/ +``` + +Next, create a data folder and grant Apache read and write access to the _nextcloud_ directory tree: + +``` +# mkdir /var/www/html/nextcloud/data +# chown -R apache:apache /var/www/html/nextcloud +``` + +SELinux must be configured to work with Nextcloud. The basic commands are those bellow, but a lot more, by features used on nexcloud installation, are posted here: [Nextcloud SELinux configuration][6] + +``` +# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' +# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?' +# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?' +# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini' +# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?' +# restorecon -Rv '/var/www/html/nextcloud/' +``` + +### Step 3: Configure N**extclou**d + +Nextcloud can be configured using its web interface or from the command line. + +#### Using the web interface + +From your favorite browser, access __ and fill the fields: + +![][7] + +#### Using the command line + +From the command line, just enter the following, substituting the values you used when you created a dedicated Nextcloud user in MariaDB earlier: + +``` +# sudo -u apache php occ maintenance:install --data-dir /var/www/html/nextcloud/data/ --database "mysql" --database-name "nextcloud" --database-user "nc_admin" --database-pass "DB_SeCuRe_PaSsWoRd" --admin-user "admin" --admin-pass "Admin_SeCuRe_PaSsWoRd" +``` + +### Final Notes + + * I used the _http_ protocol, but Nextcloud also works over _https_. I might write a follow-up about securing Nextcloud in a future article. + * I disabled SELinux, but your server will be more secure if you configure it. + * The recommend PHP memory limit for Nextcloud is 512M. To change it, edit the _memory_limit_ variable in the _/etc/php.ini_ configuration file and restart your _httpd_ service. + * By default, the web interface can only be accessed using the __ URL. If you want to allow access using other domain names, [you can do so by editing the _/var/www/html/nextcloud/config/config.php_ file][8]. The * character can be used to bypass the domain name restriction and allow the use of any URL that resolves to one of your server’s IP addresses. + + + +``` +'trusted_domains' => + array ( + 0 => 'localhost', + 1 => '*', + ), +``` + +_— Updated on January 28th, 2020 to include SELinux configuration —_ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/ + +作者:[storyteller][a] +选题:[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/storyteller/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/nextcloud-1-816x345.png +[2]: https://nextcloud.com/ +[3]: https://github.com/nextcloud/server#nextcloud-server- +[4]: https://docs.nextcloud.com/server/17/admin_manual/installation/system_requirements.html#server +[5]: https://nextcloud.com/install/#instructions-server +[6]: https://docs.nextcloud.com/server/17/admin_manual/installation/selinux_configuration.html +[7]: https://fedoramagazine.org/wp-content/uploads/2019/11/image.png +[8]: https://help.nextcloud.com/t/adding-a-new-trusted-domain/26 From b079c802edfc1ac53d9908a73b598324da20903b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 00:59:24 +0800 Subject: [PATCH 122/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20Buildi?= =?UTF-8?q?ng=20Zero=20Trust=20authentication=20for=20multi-cloud=20applic?= =?UTF-8?q?ation=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200127 Building Zero Trust authentication for multi-cloud application services.md --- ...on for multi-cloud application services.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20200127 Building Zero Trust authentication for multi-cloud application services.md diff --git a/sources/tech/20200127 Building Zero Trust authentication for multi-cloud application services.md b/sources/tech/20200127 Building Zero Trust authentication for multi-cloud application services.md new file mode 100644 index 0000000000..009b39108f --- /dev/null +++ b/sources/tech/20200127 Building Zero Trust authentication for multi-cloud application services.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building Zero Trust authentication for multi-cloud application services) +[#]: via: (https://www.linux.com/articles/building-zero-trust-authentication-for-multi-cloud-application-services/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Building Zero Trust authentication for multi-cloud application services +====== + +[![][1]][2] + +[![][1]][2] + +One of the fundamental challenges organizations have about multi-cloud and hybrid cloud environments, is how to easily establish secure communication across different clouds and environments. Cloud providers have their own identity and access management solutions, such as AWS IAM, to manage what access an instance should and should not have. But as soon as the applications or services  need to communicate from AWS to GCP or from AWS to their on-prem infrastructure, it becomes a challenge because it’s AWS-specific and not interoperable. Engineering and operations teams need something secure that could work across environments and at the same time should not add any friction to the deployment cycles + +This is the problem [Scytale][3], a is trying to address with Secure Production Identity Framework for Everyone ([SPIFFE][4]) and SPIFFE Runtime Environment ([SPIRE][5]). Both of these open-source  projects originated at Scytale but now are part of  the Cloud Native Computing Foundation (CNCF). These projects have grown in popularity within the cloud native community and have seen contributions from organizations such as Amazon, Bloomberg, Google, Pinterest, Square , Uber and more. + +“Scytale is the primary driver of these projects that offer ‘interoperable identity’ between different cloud providers and different platforms,” Evan Gilman, Senior Engineer at Scytale.io and co-author of _[Zero Trust Networks][6]_. “From the commercial angle, we have built solutions to help organizations adopt these projects faster and  extend their functionalities to address the needs of enterprise customers .” + +**Vendor and technology neutral identity solution** +The passport analogy best explains interoperable identity. Passports from different countries all look different, but they all have the same size and meet the same specifications. They all have a picture of the passport holder at the same spot, they all have a barcode at the bottom. Regardless of what country issued the passport, it works across the globe. + +A “country” can be a particular software stack, platform, or a cloud provider. Regardless of the environment, the identities that exist within and between those silos can communicate. + +Interoperable identity becomes even more critical in the multi-cloud and hybrid cloud deployments, as they raise this fundamental challenge of how users secure communication across those boundaries. + +“We are bringing in a platform-agnostic service identity that is not specific to a cloud provider, platform, and technology,” said Gilman. It levels the playing field and allows users to talk across boundaries. Users won’t talk in AWS or GCP specifics; they communicate on the SPIFFE level. “SPIFFE provides users with what is sometimes referred to as a secure dial tone: you pick up the phone, it rings the other side irrespective of where it’s running and what platform it’s running on,” added Gilman. + +**SPIFFE based service** authentication **foundational for zero trust networks** +SPIFFE is a standard, a set of documents whereas SPIRE is the software implementation of that standard. SPIRE implements the SPIFFE specifications and enables workloads or services to get these “passports” as soon as they boot, in a way that is very reliable, scalable, and highly automated. This identity centric authentication is also critical for building a zero trust-based security model  , which removes reliance on networks to deliver trustworthy information. + +“Networks have been historically fairly manipulable. So instead we build systems in such a way that it doesn’t rely on that network to deliver trustworthy information,” said Gilman, “We use protocols and strong authentication and authorization to try to mitigate any kind of business that might happen on the wire. It also mitigates what we call lateral movement. So if a neighbor is compromised, just because you’re attached to the same network, that should not mean that you should gain access that you would not have otherwise.” + +Gilman explains, “Part of the SPIFFE specification set deals with what we call ‘federation’. There is usually a centralized authority that issues these identities. In reality, there are different companies that have their own authorities. Even different software stacks have their own authorities. There is a need to bridge these gaps.” + +That’s where the SPIFFE Federation enters the picture. It swaps these cryptographic keys between different domains. It allows users with different identity providers to communicate effortlessly. + +One key design principle of the SPIFFE Federation is that it is compatible with OIDC, which is a similar identity federation spec, but is more focused around users. It allows for server-to-server and service-to-service communication. Any existing OIDC can take advantage of it and pass one of its SPIFFE identity documents to a public cloud like AWS, which will be able to validate it using this OIDC SPIFFE Federation mechanism. + +While SPIFFE as a specification doesn’t change, SPIRE has a monthly release cadence. It continues to add new features on a regular basis. + +The latest release introduced integration with the AWS Private CA Manager, which means that SPIRE deployments living inside AWS can use it to protect the sign-in keys for identities. These identities are cryptographically backed so there is a key that is used to sign these identities. One of the biggest challenges is to secure these sign-in keys. Being able to bury that key inside the AWS service, which is backed by hardware protection, is an incredible feature. + +The community is also working on a feature called Nested SPIRE, which allows users to have multiple SPIRE server clusters that form a tree and chain up to each other. + +Together, these new features give a lot of flexibility in terms of architecting for failure modes and failure domains, and architecting around different security domains. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/building-zero-trust-authentication-for-multi-cloud-application-services/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2020/01/buffer-1143485_1920-1068x638.jpg (passport) +[2]: https://www.linux.com/wp-content/uploads/2020/01/buffer-1143485_1920.jpg +[3]: https://scytale.io/ +[4]: https://spiffe.io/ +[5]: https://spiffe.io/spire/ +[6]: https://www.amazon.com/Zero-Trust-Networks-Building-Untrusted/dp/1491962194 From cae653c69b2e520ad6b83a69ff5469a165315f95 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:04:35 +0800 Subject: [PATCH 123/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=20What?= =?UTF-8?q?=20Amazon=20Kindle=3F=20Here=E2=80=99s=20an=20Open=20Source=20e?= =?UTF-8?q?Book=20Reader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 What Amazon Kindle- Here-s an Open Source eBook Reader.md --- ...dle- Here-s an Open Source eBook Reader.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20200129 What Amazon Kindle- Here-s an Open Source eBook Reader.md diff --git a/sources/tech/20200129 What Amazon Kindle- Here-s an Open Source eBook Reader.md b/sources/tech/20200129 What Amazon Kindle- Here-s an Open Source eBook Reader.md new file mode 100644 index 0000000000..7106bb596b --- /dev/null +++ b/sources/tech/20200129 What Amazon Kindle- Here-s an Open Source eBook Reader.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What Amazon Kindle? Here’s an Open Source eBook Reader) +[#]: via: (https://itsfoss.com/open-book/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +What Amazon Kindle? Here’s an Open Source eBook Reader +====== + +When it comes to an eBook reader, the choices are limited. The market is dominated by [Amazon's proprietary Kindle][1] along with a few other options like Kobo, Nook and Onyx. + +An interesting news for open source enthusiasts is that a developer, [Joey Castillo][2], is working on creating an open source eBook reader appropriately named Open Book. + +### Open Book: An open source eBook reader + +![][3] + +The [Open Book][4] aims to be a simple ‘open’ device that “anyone with a soldering iron can build for themselves”. + +It’s hackable so if you are into DIY stuff and you have some knowledge, you may tweak it to your liking. For example, Joey use [TensorFlow Lite][5] to give voice commands for flipping the pages on Open Book. You can do things like this on your own on this open hardware device. + +> Voice commands on the [#OpenBook][6] with [#TensorFlowLite][7]. When I added a mic amp for voice, I considered this a “someday” feature; I didn’t imagine one could hack it together in an evening! Major credit to [@adafruit][8]; their TFL Arduino port makes this possible. [pic.twitter.com/PfXZx99A9y][9] +> +> — joey castillo (@josecastillo) [December 13, 2019][10] + +If that kind of scares you because you are not really into tinkering with hardware, I have a good news for you. Open Book was named winner of [Hackaday’s Take Flight with Feather contest][11]! + +This means that when the hardware is ready, you should be able to purchase it from [DigiKey][12]. You should be able to fit the device as an eBook reader or experiment with it, if you feel like doing it. + +It kind of reminds me of [Game Shell][13], a single board computer based retro gaming console that could be tinkered into many other things. + +### Open Book specifications + +![][14] + +There are two versions of Open Book: Open Book Feather and E-Book Feather Wing. The eBook wing does less than the Open Book Feather, mainly because it’s limited to using only the pins available via the Feather header. + +You may guess from the name that the project uses [Adafruit’s Feather development boards][15]. + +Here are the main specifications for the Open Book (both versions): + + * 4.2 inch, 400 x 300 pixel ePaper display + * SAMD51 ARM Cortex-M4 32-bit processor + * 7 buttons for navigation (directional pad, select button and page turn buttons) + * status LED lights + * A microSD card reader + * Headphone jack + + + +The display seems a bit small, isn’t it? + +### Open Book release, pricing and availability + +![][16] + +Open Book is the winner of [Take Flight with Feather competition by Hackaday][11]. This means that at least 100 Open Book boards will be manufactured and made available for purchase. + +[Liliputing][17] noted that [Adafruit][18] will be handling the manufacturing, and [Digi-Key][19] will eventually be selling Open Book boards. + +At this point, it’s not clear how much will it cost and exactly when it will be available. + +Remember that it’s an open source project. You can find all the circuit designs, source code on its GitHub page and if you have the skills, get the required hardware components and build an Open Book on your own. + +[Open Book on GitHub][4] + +Otherwise, wait for a couple of months (hopefully) for the release of the Open Book boards and then go about experimenting with the device. + +If you like the project and want to support it, you can help [Joey on Pateron][20]. You can follow the updates on the Open Book on the Patreon page, [Joey’s mailing list][21] or Joey’s [Twitter account][2]. + +_Do you think the project has potential? Would you buy one when it is available? What do you think of it?_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-book/ + +作者:[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.amazon.com/dp/B07DLPWYB7?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Amazon's proprietary Kindle) +[2]: https://twitter.com/josecastillo +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/open-book-under-development-feature.jpeg?ssl=1 +[4]: https://github.com/joeycastillo/The-Open-Book +[5]: https://www.tensorflow.org/lite +[6]: https://twitter.com/hashtag/OpenBook?src=hash&ref_src=twsrc%5Etfw +[7]: https://twitter.com/hashtag/TensorFlowLite?src=hash&ref_src=twsrc%5Etfw +[8]: https://twitter.com/adafruit?ref_src=twsrc%5Etfw +[9]: https://t.co/PfXZx99A9y +[10]: https://twitter.com/josecastillo/status/1205549284403355648?ref_src=twsrc%5Etfw +[11]: https://hackaday.io/contest/168107-take-flight-with-feather +[12]: https://www.digikey.com/ +[13]: https://itsfoss.com/gameshell-console/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/open-book-board.jpg?ssl=1 +[15]: https://www.adafruit.com/feather +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/open-book-demo.jpeg?ssl=1 +[17]: https://liliputing.com/2020/01/the-open-book-ereader-will-be-a-real-thing-you-can-buy-eventually.html +[18]: https://www.adafruit.com/ +[19]: https://www.digikey.com/en/resources/beta-1 +[20]: https://www.patreon.com/joeycastillo +[21]: http://eepurl.com/gKOpQ9 From 74aab96c7fa9e100b9e53350249677dd8d64e715 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:05:03 +0800 Subject: [PATCH 124/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=20Joplin?= =?UTF-8?q?:=20The=20True=20Open=20Source=20Evernote=20Alternative?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 Joplin- The True Open Source Evernote Alternative.md --- ...e True Open Source Evernote Alternative.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20200129 Joplin- The True Open Source Evernote Alternative.md diff --git a/sources/tech/20200129 Joplin- The True Open Source Evernote Alternative.md b/sources/tech/20200129 Joplin- The True Open Source Evernote Alternative.md new file mode 100644 index 0000000000..61d48785af --- /dev/null +++ b/sources/tech/20200129 Joplin- The True Open Source Evernote Alternative.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Joplin: The True Open Source Evernote Alternative) +[#]: via: (https://itsfoss.com/joplin/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Joplin: The True Open Source Evernote Alternative +====== + +_**Brief: Joplin is an open source note taking and to-do application. You can organize notes into notebooks and tag them. Joplin also provides a web-clipper to save articles from the internet.**_ + +### Joplin: Open source note organizer + +![][1] + +If you like [Evernote][2], you won’t be too uncomfortable with the open source software, [Joplin][3]. + +Joplin is an excellent open source note taking application with plenty of features. You can take notes, make to-do list and sync your notes across devices by linking it with cloud services like Dropbox and NextCloud. The synchronization is protected with end to end encryption. + +Joplin also has a web clipper that allows you to save webpages as notes. The web clipper is available for Firefox and Chrome/Chromium browsers. + +Joplin makes the switch from Evernote easier by allowing importing Evernote files in Enex format. + +Since you own the data, you can export all your files either in Joplin format or in the raw format. + +### Features of Joplin + +![][4] + +Here’s a list of all the features Joplin provides: + + * Save notes into notebooks and sub-notebooks for better organization + * Create to-do list + * Notes can be tagged and searched + * Offline first, so the entire data is always available on the device even without an internet connection + * Markdown notes with pictures, math notation and checkboxes support + * File attachment support + * Application available for desktop, mobile and terminal (CLI) + * [Web Clipper][5] for Firefox and Chrome + * End To End Encryption + * Keeps note history + * Notes sorting based on name, time etc + * Synchronisation with various [cloud services][6] like [Nextcloud][7], Dropbox, WebDAV and OneDrive + * Import files from Evernote + * Export JEX files (Joplin Export format) and raw files. + * Support notes, to-dos, tags and notebooks. + * Goto Anything feature. + * Support for notifications in mobile and desktop applications. + * Geo-location support. + * Supports multiple languages + * External editor support – open notes in your favorite external editor with one click in Joplin. + + + +**Recommended Read:** + +![][8] + +#### [EncryptPad – Encrypted Text Editor For Linux][9] + +Looking for a text editor with encryption in Linux? Meet EncryptPad, a text editor with built-in encryption. + +### Installing Joplin on Linux and other platforms + +![][10] + +[Joplin][11] is a cross-platform application available for Linux, macOS and Windows. On the mobile, you can [get the APK file][12] to install it on Android and Android-based ROMs. You can also [get it from the Google Play store][13]. + +For Linux, you can [use AppImage][14] file for Joplin and run the application as an executable. You’ll have to give execute permission to the downloaded file. + +[Download Joplin][15] + +### Experiencing Joplin + +Notes in Joplin use markdown but you don’t have to know markdown notations to use it. The editor has a top panel that lets you graphically choose the bullet points, headings, images, link etc. + +Though Joplin provides many interesting features, you have to fiddle around on your own to check things out. For example, the web clipper is not enabled by default and I had to figure out how to do it. + +You have to enable the clipper from the desktop application. From the top menu, go to Tools->Options. You’ll find the Web Clipper option here: + +![Enable Web Clipper from the desktop application first][16] + +The web clipper is not as smart as Evernote’s web clipper that allows to clip portion of a web article graphically. However, you still have good enough options here. + +It is an open source software under active development and I do hope that it gets more improvement over the time. + +**Conclusion** + +If you are looking for a good note taking application with web-clipper feature, do give Joplin a try. And if you like it and would continue using, try to help Joplin development by making a donation or improving its code and documentation. I made a sweet little [donation][17] of 25 Euro on behalf of It’s FOSS. + +If you have used Joplin in the past or still using it, how’s your experience with it? If you use some other note taking application, would you switch to Joplin? Feel free to share your views. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/joplin/ + +作者:[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/2020/01/joplin_logo.png?ssl=1 +[2]: https://evernote.com/ +[3]: https://joplinapp.org/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/joplin_featured.jpg?ssl=1 +[5]: https://joplinapp.org/clipper/ +[6]: https://itsfoss.com/cloud-services-linux/ +[7]: https://nextcloud.com/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/encryptpad-text-editor-with-encryption.jpg?fit=800%2C450&ssl=1 +[9]: https://itsfoss.com/encryptpad-encrypted-text-editor-linux/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/joplin_ubuntu.jpg?ssl=1 +[11]: https://github.com/laurent22/joplin +[12]: https://itsfoss.com/download-apk-ubuntu/ +[13]: https://play.google.com/store/apps/details?id=net.cozic.joplin&hl=en_US +[14]: https://itsfoss.com/use-appimage-linux/ +[15]: https://github.com/laurent22/joplin/releases +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/joplin_web_clipper.jpg?ssl=1 +[17]: https://itsfoss.com/donations-foss/ From 98b2548752d61501bcd491aaa874f209f5b3d2ed Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:05:43 +0800 Subject: [PATCH 125/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200128=20Send?= =?UTF-8?q?=20email=20and=20check=20your=20calendar=20with=20Emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200128 Send email and check your calendar with Emacs.md --- ...mail and check your calendar with Emacs.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20200128 Send email and check your calendar with Emacs.md diff --git a/sources/tech/20200128 Send email and check your calendar with Emacs.md b/sources/tech/20200128 Send email and check your calendar with Emacs.md new file mode 100644 index 0000000000..48be7e8e45 --- /dev/null +++ b/sources/tech/20200128 Send email and check your calendar with Emacs.md @@ -0,0 +1,152 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Send email and check your calendar with Emacs) +[#]: via: (https://opensource.com/article/20/1/emacs-mail-calendar) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Send email and check your calendar with Emacs +====== +Manage your email and view your schedule with the Emacs text editor in +the eighteenth in our series on 20 ways to be more productive with open +source in 2020. +![Document sending][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Doing (almost) all the things with Emacs, part 1 + +Two days ago, I shared that I use both [Vim][2] and [Emacs][3] regularly, and on days [16][4] and [17][5] of this series, I explained how to do almost everything in Vim. Now, it's time for Emacs! + +![Mail and calendar in Emacs][6] + +Before I get too far, I should explain two things. First, I'm doing everything here using the default Emacs configuration, not [Spacemacs][7], which I have [written about][8]. Why? Because I will be using the default keyboard mappings so that you can refer back to the documentation and not have to translate things from "native Emacs" to Spacemacs. Second, I'm not setting up Org mode in this series. Org mode almost needs an entire series on its own, and, while it is very powerful, the setup can be quite complex. + +#### Configure Emacs + +Configuring Emacs is a little bit more complicated than configuring Vim, but in my opinion, it is worth it in the long run. Start by creating a configuration file and opening it in Emacs: + + +``` +mkdir ~/.emacs.d +emacs ~/.emacs.d/init.el +``` + +Next, add some additional package sources to the built-in package manager. Add the following to **init.el**: + + +``` +(package-initialize) +(add-to-list 'package-archives '("melpa" . "")) +(add-to-list 'package-archives '("org" . "") t) +(add-to-list 'package-archives '("gnu" . "")) +(package-refresh-contents) +``` + +Save the file with **Ctrl**+**x** **Ctrl**+**s**, exit with **Ctrl**+**x** **Ctrl**+**c**, and restart Emacs. It will download all the package lists at startup, and then you should be ready to install things with the built-in package manager. Start by typing **Meta**+**x** to bring up a command prompt (the **Meta** key is the **Alt** key on most keyboards or **Option** on MacOS). At the command prompt, type **package-list-packages** to bring up a list of packages you can install. Go through the list and select the following packages with the **i** key: + + +``` +bbdb +bbdb-vcard +calfw +calfw-ical +notmuch +``` + +Once the packages are selected, press **x** to install them. Depending on your internet connection, this could take a while. You may see some compile errors, but it's safe to ignore them. Once it completes, open **~/.emacs.d/init.el** with the key combination **Ctrl**+**x** **Ctrl**+**f**, and add the following lines to the file after **(package-refresh-packages)** and before **(custom-set-variables**. Emacs uses the **(custom-set-variables** line internally, and you should never, ever modify anything below it. Lines beginning with **;;** are comments. + + +``` +;; Set up bbdb +(require 'bbdb) +(bbdb-initialize 'message) +(bbdb-insinuate-message) +(add-hook 'message-setup-hook 'bbdb-insinuate-mail) +;; set up calendar +(require 'calfw) +(require 'calfw-ical) +;; Set this to the URL of your calendar. Google users will use +;; the Secret Address in iCalendar Format from the calendar settings +(cfw:open-ical-calendar "") +;; Set up notmuch +(require 'notmuch) +;; set up mail sending using sendmail +(setq send-mail-function (quote sendmail-send-it)) +(setq user-mail-address "[myemail@mydomain.com][9]" +      user-full-name "My Name") +``` + +Now you are ready to start Emacs with your setup! Save the **init.el** file (**Ctrl**+**x** **Ctrl**+**s**), exit Emacs (**Ctrl**+**x** **Ctrl**+**c**), and then restart it. It will take a little longer to start this time. + +#### Read and write email in Emacs with Notmuch + +Once you are at the Emacs splash screen, you can start reading your email with [Notmuch][10]. Type **Meta**+**x notmuch**, and you'll get Notmuch's Emacs interface. + +![Reading mail with Notmuch][11] + +All the items in bold type are links to email views. You can access them with either a mouse click or by tabbing between them and pressing **Return** or **Enter**. You can use the search bar to + +search Notmuch's database using the [same syntax][12] as you use on Notmuch's command line. If you want, you can save any searches for later use with the **[save]** button, and they will be added to the list at the top of the screen. If you follow one of the links, you will get a list of the relevant email messages. You can navigate the list with the **Arrow** keys, and press **Enter** on the message you want to read. Pressing **r** will reply to a message, **f** will forward the message, and **q** will exit the current screen. + +You can write a new message by typing **Meta**+**x compose-mail**. Composing, replying, and forwarding all bring up the mail writing interface. When you are done writing your email, press **Ctrl**+**c Ctrl**+**c** to send it. If you decide you don't want to send it, press **Ctrl**+**c Ctrl**+**k** to kill the message compose buffer (window). + +#### Autocomplete email addresses in Emacs with BBDB + +![Composing a message with BBDB addressing][13] + +But what about your address book? That's where [BBDB][14] comes in. But first, import all your addresses from [abook][15] by opening a command line and running the following export command: + + +``` +`abook --convert --outformat vcard --outfile ~/all-my-addresses.vcf --infile ~/.abook/addresses` +``` + +Once Emacs starts, run **Meta**+**x bbdb-vcard-import-file**. It will prompt you for the file name you want to import, which is **~/all-my-addresses.vcf**. After the import finishes, when you compose a message, you can start typing a name and use **Tab** to search and autocomplete the "To" field. BBDB will also open a buffer for the contact so you can make sure it's the correct one. + +Why do it this way when you already have each address as a **vcf.** file from [vdirsyncer][16]? If you are like me, you have a LOT of addresses, and doing them one at a time is a lot of work. This way, you can take everything you have in abook and make one big file. + +#### View your calendar in Emacs with calfw + +![calfw calendar][17] + +Finally, you can use Emacs to look at your calendar. In the configuration section above, you installed the [calfw][18] package and added lines to tell it where to find the calendars to load. Calfw is short for the Calendar Framework for Emacs, and it supports many calendar formats. Since I use Google calendar, that is the link I put into my config. Your calendar will auto-load at startup, and you can view it by switching the **cfw-calendar** buffer with the **Ctrl**+**x**+**b** command. + +Calfw offers views by the day, week, two weeks, and month. You can select the view from the top of the calendar and navigate your calendar with the **Arrow** keys. Unfortunately, calfw can only view calendars, so you'll still need to use something like [khal][19] or a web interface to add, delete, and modify events. + +So there you have it: mail, calendars, and addresses in Emacs. Tomorrow I'll do even more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/emacs-mail-calendar + +作者:[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/email_paper_envelope_document.png?itok=uPj_kouJ (Document sending) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://opensource.com/article/20/1/vim-email-calendar +[5]: https://opensource.com/article/20/1/vim-task-list-reddit-twitter +[6]: https://opensource.com/sites/default/files/uploads/productivity_18-1.png (Mail and calendar in Emacs) +[7]: https://www.spacemacs.org/ +[8]: https://opensource.com/article/19/12/spacemacs +[9]: mailto:myemail@mydomain.com +[10]: https://notmuchmail.org/ +[11]: https://opensource.com/sites/default/files/uploads/productivity_18-2.png (Reading mail with Notmuch) +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://opensource.com/sites/default/files/uploads/productivity_18-3.png (Composing a message with BBDB addressing) +[14]: https://www.jwz.org/bbdb/ +[15]: https://opensource.com/article/20/1/sync-contacts-locally +[16]: https://opensource.com/article/20/1/open-source-calendar +[17]: https://opensource.com/sites/default/files/uploads/productivity_18-4.png (calfw calendar) +[18]: https://github.com/kiwanami/emacs-calfw +[19]: https://khal.readthedocs.io/en/v0.9.2/index.html From 7e61c0b24faa3656f7051fde71f1eef49b839f59 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:06:50 +0800 Subject: [PATCH 126/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200128=20How=20?= =?UTF-8?q?I=20had=20a=20nerdy=20date=20night=20with=20StreetComplete=20qu?= =?UTF-8?q?ests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200128 How I had a nerdy date night with StreetComplete quests.md --- ...y date night with StreetComplete quests.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20200128 How I had a nerdy date night with StreetComplete quests.md diff --git a/sources/tech/20200128 How I had a nerdy date night with StreetComplete quests.md b/sources/tech/20200128 How I had a nerdy date night with StreetComplete quests.md new file mode 100644 index 0000000000..73f163fc01 --- /dev/null +++ b/sources/tech/20200128 How I had a nerdy date night with StreetComplete quests.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I had a nerdy date night with StreetComplete quests) +[#]: via: (https://opensource.com/article/20/1/streetcomplete-crowdsource-maps) +[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) + +How I had a nerdy date night with StreetComplete quests +====== +Find an adventure in your own backyard with this fun app. +![A map with a route highlighted][1] + +StreetComplete is an Android app that makes it fun and easy to contribute to open data by completing quests. + +Quests are used to fill in incomplete or inaccurate information on [OpenStreetMap][2], an open data project dedicated to mapping the world through crowdsourcing. Anyone can contribute to the map and, thanks to free culture and open source licenses, that data can then be used by anyone for anything, from video games to custom map applications and artwork. + +![hands holding phone][3] + +My first intro to StreetComplete was on a charmingly unique date night with my partner. Instead of dinner and a movie, we explored the streets of our town, both the familiar and unfamiliar, answering questions about features of topography, shopfronts, pedestrian crossing, and more. We got to see our town in a new light, and we felt we were ultimately helping others discover it along with us. + +If this sounds like something you’d like to get involved with, it’s super simple to get started. Just follow the steps below: + + 1. [Download the app][4] to your phone from F-Droid or Google Play. It’s licensed under GPLv3. + 2. Allow StreetComplete to access your device’s location. + 3. Click the menu in the upper right corner, and select Settings. + 4. In the Settings menu, select Authorize OSM access. This will open OpenStreetMap in your browser, where you can register for an account or login if you already have one. + 5. Authorize access to your account. + + + +Now you’re ready to go! + +### Completing quests + +To complete quests, walk around the area of your choosing. Quests appear as pins on the map. Symbols inside pins denote the type of task, such as a wheelchair for an accessibility quest or leaf for a plant-based quest. Quests involve simple questions about various features, with clear multiple choice answers and visuals when necessary. + +Quests can be chosen at random, though the app will question your response if you try to complete a quest when you are not nearby. I live in a small town, so I especially enjoyed quests that required us to ask questions of shop owners because it allowed us to connect with the community in real life while contributing to the global community online. + +![StreetComplete map image][5] + +If you live in a mobile deadzone or have a limited mobile plan, you can still have fun questing for map data; StreetComplete has an offline mode. To use it, activate the offline download option in the app settings menu. Once your region has downloaded, perform a search for nearby quests, then go out and explore. + +When you are back online, the data you’ve input as quest responses are uploaded to the OpenStreetMap servers. + +StreetComplete is a great way to investigate new areas or even locations you may already be somewhat familiar with. With its graphical, flat design and simple quests, it makes a perfect activity for couples, friends, and families to complete together. + +Maps touch our lives daily. Whether you are trying to find a nearby point of interest or directions... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/streetcomplete-crowdsource-maps + +作者:[Jess Weichler][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cyanide-cupcake +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/map_route_location_gps_path.png?itok=RwtS4DsU (A map with a route highlighted) +[2]: https://www.openstreetmap.org +[3]: https://opensource.com/sites/default/files/uploads/image1_street.png (hands holding phone) +[4]: https://github.com/westnordost/StreetComplete +[5]: https://opensource.com/sites/default/files/uploads/image2_street.jpeg (StreetComplete map image) From 16da5754741caa2e4e59a305f2a38d7da659106a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:07:18 +0800 Subject: [PATCH 127/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200128=20How=20?= =?UTF-8?q?I=20teach=20physics=20using=20open=20source=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200128 How I teach physics using open source tools.md --- ...I teach physics using open source tools.md | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 sources/tech/20200128 How I teach physics using open source tools.md diff --git a/sources/tech/20200128 How I teach physics using open source tools.md b/sources/tech/20200128 How I teach physics using open source tools.md new file mode 100644 index 0000000000..a1e695781d --- /dev/null +++ b/sources/tech/20200128 How I teach physics using open source tools.md @@ -0,0 +1,175 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I teach physics using open source tools) +[#]: via: (https://opensource.com/article/20/1/teach-physics-open-source) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +How I teach physics using open source tools +====== +A roundup of open source tools ideal for teaching physics (and other +subjects). +![Person reading a book and digital copy][1] + +The nice aspect of being a physicist and a researcher is the openness of our community. There is a lot of collaboration and sharing of ideas (especially during coffee breaks). We also tend to share the software we write. Since we are very picky about algorithms, we want to modify other people’s code to fix the obvious errors that we find. It feels frustrating when I have to use proprietary tools since I cannot understand their inner workings. Having grown up professionally in such an environment, open source has been my go-to solution for all the software I use. + +When I became the regular teacher of the Physics and Biophysics course at the [medical school][2] at my [university][3], I decided to use only open source software to prepare my lectures. Here is my experience so far and the solutions I found. + +### Study material + +Teaching is not easy. You should first understand the subject and then figure out how to communicate with somebody that knows nothing about the subject; therefore, it is of paramount importance to study the subject in depth and prepare the lectures well in advance. There are countless books about physics, but there are also some interesting, freely available resources. Most of these do not count as open source, as they cannot be modified, but they are useful anyways. + + * [HyperPhysics][4] may have an outdated look, but it is a treasure trove of interesting concepts and insights by Carl R. Nave, Department of Physics and Astronomy Georgia State University. + * [Open Source Physics][5] has a fabulous collection of applets and support material. I met some of the maintainers at various conferences, and they are remarkable people. + * [OpenStax][6] is a nonprofit educational initiative based at Rice University that publishes textbooks that are free online. They have a good library and several works about physics in their [scientific section][7]. + * [Open Textbook Library][8] provides a catalog of free textbooks with a [physics section][9] as well. Some of the titles have reviews by users. + * [Motion Mountain][10] is a collection of books about physics in general by C. Schiller that has also been translated into several languages. + * [Light and Matter][11] is another collection of writings about different aspects of physics, all authored by B. Crowell of Fullerton College, CA. + * [Wikipedia][12], what more can I say? + + + +### Lecturing style + +Before preparing my support material, I had to decide whether I preferred to use the blackboard or slideshows during the lectures. I opted to use both with the idea of showing hard-to-draw graphics in the slideshows and writing down equations on the blackboard. Eventually, the slideshows became much more prevalent. I use them as the draft of my lecture, helping me to keep track of what I want to say. I also added the mathematical proofs that I want to show to have a correct reference during the lecture. + +Instead of using a blackboard, I ended up using a [graphics tablet][13] for all the notes I write during the lectures. I use the tablet for three main purposes: to draw additional drawings to explain myself better, to write down equations and proofs, and to write down the key messages that I want my students to remember. Even if what I write is already on the slideshows, actually writing it by hand during the lectures gives the students the time to write it down in their notes. After the lectures, I share, on my website, both the slideshows and my notes. + +![Figure: Example of notes taken during class with the graphics tablet and Krita][14] + +Figure: Example of notes taken during class with the graphics tablet and Krita + +### Material preparation + +#### Slideshows + +Since math is the language of physics, I needed a practical way to write down equations in my slideshows. Probably, the best tool for that is [LaTeX][15], but it was designed to typeset books and not slides. Luckily, there is the [Beamer class][16] that allows you to typeset slideshows with LaTeX. The resulting file is a very portable PDF. The layout is nice and clean and forces me not to overstuff each slide. From the same source code, I can prepare two versions of the file. The lecture version follows the guidelines of the university’s [corporate identity][17] (_i.e.,_ with a thick red border), while the handout version has a cleaner layout (_e.g.,_ without the thick borders), thus allowing it to be printed without wasting printer toner. I have also seen students taking notes directly on the PDFs of the handouts on their tablets and computers. + +The only drawback of using LaTeX and Beamer is the impossibility of embedding videos in the produced presentation. I, therefore, have to keep as a separate file the occasional videos that I show during class. + +![Figure: Examples of slides created with LaTeX and Beamer][18] + +Figure: Examples of slides created with LaTeX and Beamer + +![Figure: Examples of slides created with LaTeX and Beamer][19] + +Figure: Examples of slides created with LaTeX and Beamer + +#### Images and diagrams + +Something that I am careful about is the licensing of the graphics I use. As such, I never use graphics that do not allow me to redistribute my modifications. I drew most of the images in my slideshows. If I use other people’s work, I always reference it in my slide. + +I prefer to use [vector graphics][20] whenever practicable because they can be easily modified and adjusted afterward. I use the exceptional [Inkscape][21] for my vector graphics. On the other hand, for my [raster graphics][22], I use [GIMP][23]. When I need a 3D looking diagram, I use [Blender][24] to draw the scene; then I trace the rendered image with Inkscape to convert it to vectorial. I recently discovered [FreeCAD][25], which has the striking feature that it can directly export the 3D scene to some vectorial format. I can then adjust the image with Inkscape without having to trace the raster image. + +In all my diagrams, I am trying to keep a consistent look, and therefore I limit myself to a 10-[color palette][26], both from [d3][27] and [matplotlib][28]. I also use the same palette in my slides to highlight quantities in reference to the illustrations. To produce [plots][29] and [graphs][30], I write Python scripts and employ the matplotlib graphical library. + +![Figure: Diagram example created with Inkscape by tracing a Blender 3D diagram][31] + +Figure: Diagram example created with Inkscape by tracing a Blender 3D diagram + +#### Multimedia support + +I have prepared a few pages with applets that demonstrate some phenomena that I describe during my lectures (e.g., [modeling radioactive decay with dice][32]). I opted to offer these applets on my institutional webpage to easily reach all the students instead of requiring them to install software to run them. The necessary choice was to employ [JavaScript][33] and some supporting libraries, such as [jQuery][34] for compatibility between browsers, [MathJax][35] for typesetting math in the webpages, or [d3][27] for graphics display. Since my institution does not provide the capability of writing dynamic webpages, I am using [Jekyll][36], which is a static site generator. Jekyll allows me to have a consistent look and feel across all the pages without having to write HTML code. + +![Figure: Dice modeling radioactive decay, image of the interactive simulation][37] + +Figure: Dice modeling radioactive decay, image of the [interactive simulation][32] + +### Lecturing software + +Since my slideshows are PDF files, to show them during the lecture, I use the [default document viewer][38] of my [GNOME 3][39] desktop environment. There is also the alternative of using [Okular][40], which allows annotating the PDFs, but I prefer not to use it, as the annotations would not be carried over to the handouts. In conjunction with the graphical tablet, I use the excellent painting program [Krita][41]. I use the image layers as new pages of my notes. This approach is more practical during the lecture than creating a series of new files. I can also duplicate layers and edit them or load vectorial images and draw over them. Krita has the possibility of writing custom [Python plugins][42], so I prepared a script that exports a PDF file with a new page for each layer. + +![Figure: Screenshot of Krita used in class to write notes][43] + +Figure: Screenshot of Krita used in class to write notes + +When we go through exercises in class, I use the calculator [Qalculate][44] to obtain numerical results. Its particular feature is that it can perform calculations with units associated with the numbers. I can focus more on the exercise resolution than on the units’ conversions. This is a double-edged sword, though, as the students would not learn how to do the conversions themselves. Therefore, I normally start to use Qalculate halfway through the course. [wxMaxima][45] can also support exercise resolution, symbolically solving some difficult equations. + +![Figure: Screenshot of Qalculate][46] + +Figure: Screenshot of Qalculate + +### Video lectures + +Sometimes I offer streaming lectures on YouTube, or I upload a video with additional mini-lectures. It has happened that the students have wanted a more in-depth explanation of some subjects. Offering these as a video allows them to take their time to listen and understand the subjects. For these videos, I use [OBS studio][47], which can record or directly stream videos to YouTube. OBS can put on the video scene the screen image and some additional video sources, such as a web camera. To edit the videos, I have been using [OpenShot][48]. + +![Figure: Screenshot of OBS studio recording the screen][49] + +Figure: Screenshot of OBS studio recording the screen + +### Conclusions + +This is the set of open source tools that I have been using to prepare and support my lectures. Over the years, I changed some of them whenever I discovered some better fitting tools or if I changed my lecturing style. To be frank, due to laziness, one of the requirements for all the tools is that they have to be easily installable. I use [Fedora][50] on my laptop, and its repository has packages for all this software. On the [CentOS][51] installation of my desktop computer, I had worse luck. For instance, Krita and OBS are available only through [Flatpak][52]. + +Writing this article just made me realize how many tools I am actively using for my lectures. Maybe there are some all-in-one solutions, such as [LibreOffice Impress][53], but I am very satisfied with the results I am getting. Besides, all this software has other useful applications. + +Leave comments if you have questions. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/teach-physics-open-source + +作者:[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/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) +[2]: https://www.medicinachirurgia.unipd.it/ +[3]: https://www.unipd.it/ +[4]: http://hyperphysics.phy-astr.gsu.edu/ +[5]: https://www.compadre.org/osp/ +[6]: https://openstax.org/ +[7]: https://openstax.org/subjects/science +[8]: https://open.umn.edu/opentextbooks +[9]: https://open.umn.edu/opentextbooks/subjects/physics +[10]: http://www.motionmountain.net/ +[11]: http://www.lightandmatter.com/ +[12]: https://en.wikipedia.org/wiki/Main_Page +[13]: https://en.wikipedia.org/wiki/Graphics_tablet +[14]: https://opensource.com/sites/default/files/uploads/circuit_notes_0.jpg (Figure: Example of notes taken during class with the graphics tablet and Krita) +[15]: https://www.latex-project.org/ +[16]: https://github.com/josephwright/beamer +[17]: https://en.wikipedia.org/wiki/Corporate_identity +[18]: https://opensource.com/sites/default/files/uploads/slide_laplace.png (Figure: Examples of slides created with LaTeX and Beamer) +[19]: https://opensource.com/sites/default/files/uploads/slide_faraday.png (Figure: Examples of slides created with LaTeX and Beamer) +[20]: https://en.wikipedia.org/wiki/Vector_graphics +[21]: https://inkscape.org/ +[22]: https://en.wikipedia.org/wiki/Raster_graphics +[23]: https://www.gimp.org/ +[24]: https://www.blender.org/ +[25]: https://www.freecadweb.org/ +[26]: https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md#category10 +[27]: https://d3js.org/ +[28]: https://matplotlib.org/ +[29]: https://en.wikipedia.org/wiki/Plot_(graphics) +[30]: https://en.wikipedia.org/wiki/Graph_of_a_function +[31]: https://opensource.com/sites/default/files/uploads/electromagnetic_wave.png (Figure: Diagram example created with Inkscape by tracing a Blender 3D diagram) +[32]: http://www2.pd.infn.it/~fontana/project/teaching/2018/01/02/dice-decay.html +[33]: https://en.wikipedia.org/wiki/JavaScript +[34]: https://jquery.com/ +[35]: https://www.mathjax.org/ +[36]: https://jekyllrb.com/ +[37]: https://opensource.com/sites/default/files/uploads/dice_decay.png (Figure: Dice modeling radioactive decay, image of the interactive simulation) +[38]: https://wiki.gnome.org/Apps/Evince +[39]: https://www.gnome.org/gnome-3/ +[40]: https://okular.kde.org/ +[41]: https://krita.org/en/ +[42]: https://docs.krita.org/en/user_manual/python_scripting.html +[43]: https://opensource.com/sites/default/files/uploads/krita_screenshot_0.png (Figure: Screenshot of Krita used in class to write notes) +[44]: https://qalculate.github.io/ +[45]: https://wxmaxima-developers.github.io/wxmaxima/ +[46]: https://opensource.com/sites/default/files/uploads/qalculate_screenshot.png (Figure: Screenshot of Qalculate) +[47]: https://obsproject.com/ +[48]: https://www.openshot.org/ +[49]: https://opensource.com/sites/default/files/uploads/obs_screenshot.png (Figure: Screenshot of OBS studio recording the screen) +[50]: https://getfedora.org/ +[51]: https://www.centos.org/ +[52]: https://flatpak.org/ +[53]: https://www.libreoffice.org/discover/impress/ From 77f28a5cbc77096859a67bc72cf170aa74e58845 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:07:50 +0800 Subject: [PATCH 128/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200128=20Commun?= =?UTF-8?q?ication=20superstars:=20A=20model=20for=20understanding=20your?= =?UTF-8?q?=20organization's=20approach=20to=20new=20technologies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md --- ...nization-s approach to new technologies.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md diff --git a/sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md b/sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md new file mode 100644 index 0000000000..632c290741 --- /dev/null +++ b/sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Communication superstars: A model for understanding your organization's approach to new technologies) +[#]: via: (https://opensource.com/open-organization/20/1/communication-technology-superstars) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) + +Communication superstars: A model for understanding your organization's approach to new technologies +====== +Adopting new communication technologies can make your organization more +open. But are your people ready? +![Different cell phones][1] + +Multiple books in [the _Open Organization_ series][2] discuss the many ways new communication technologies are changing the nature of both work and management. I've seen these changes firsthand during my nearly three decades working for Japanese corporations. Over time, I've been able to classify and characterize some of the impacts these technologies—particularly new telecommunication technologies and social media—are having on daily life in many organizations. And in April 2016, I shared those observations in an article called _[How new communication technologies are affecting peer-to-peer engagement][3]_. + +But a lot can change in a little under four years. + +[The Open Organization Ambassadors][4] have learned a great deal about the ways open principles are impacting organizational practices. In particular, we've developed an [Open Organization Definition][5] that specifies the five principles that distinguish open organizations from other types of organization—namely, more transparency, more inclusivity, greater adaptability, deeper collaboration and a sense of purpose teams/community. I've also delivered [a presentation on this topic][6] several times since 2016 and learned new insights along the way. So I'd like to update this article with a few comments that reflect those findings. And then, in a follow-up article, I'd like to offer readers some guidelines on how _they_ can determine their organization's level of comfort with communication technology and use it to increase their success relative to industry competitors. + +Simply put: New communication technologies are affecting the way peer-to-peer decision-making practices function in organizations today. And that's affecting several important organizational dimensions: peers' transparency with each other when making decisions, the sense of inclusivity between members in decisions-making activities, their adaptability when situations change, their ability to collaborate with more individuals in the decision-making process, and their ability to build teams, groups, and communities to decide how to achieve their goals. + +### Four approaches to communication technology + +In Japan, I see companies that heavily promote today's communication technologies, as well as some that avoid them. Imagine four types of companies currently making use of today's communication technologies as they compete with other firms. These technologies are key, because they influence the environment in which certain peer-to-peer communities must work. It affects their collaboration and transparency with each other, their inclusivity with members they couldn't consider before because of location, their adaptability in a crisis, and their ability to build a sense of community among their members. This, in turn, affects members' enthusiasm, desire, and engagement—so _investment_ and _utilization_ are critical considerations. In fact, we can actually chart the four types of technology-adopters according to those two variables: investment and utilization. + +Some companies are underinvested in new communication technologies, considering their needs and the relatively lower costs of these technologies today. And what they _do_ have, they're not using to capacity. I call these companies communication technology **"slow movers" (low investment/low utilization)**. Others buy whatever is available at any cost, but don't fully put what they've purchased to full use. I call these communication technology **"fashion followers" (high investment/low utilization)**. Still other companies invest in the very minimum amount of communication technology, but what they do have they use to full capacity. I call these communication technology **"conservative investors" (low investment/high utilization)**. Lastly, there are some companies that invest heavily in communication technology and work very hard to put it to full use. I call these communication technology **"communication superstars" (high investment/high utilization)**. + +These "communication superstars" have the ideal environment for peer-to-peer, front-line discussions and decision making. They have greater collaboration and transparency with each other. They include members on their teams that they wouldn't (or couldn't) consider before because of location. They are more adaptable in a crisis. And they have the ability to build a stronger sense of community among their members. Unfortunately, in Japan, particularly among smaller companies, I'd say more than 70 percent are "slow movers" or "conservative investors." If companies would pay more attention to investing in communication technology, and simultaneously increase their efforts at training staff to use the technology to its full potential, then peer-to-peer, front-line employees could explode with creativity and better leverage all five of the open organization principles I mentioned above. + +New communication technologies are affecting the way peer-to-peer decision-making practices function in organizations today. + +These technologies affect four aspects of information today: volume, speed, quality, and distribution. + +### Increased capacity for decision-making (volume) + +In "communication superstar" environments, communication technologies can actually increase the amount of information that can be made available quickly. Gone are the days in which only researchers or professors have access to in-depth information. Now, front-line people can obtain volumes of information if they know what they're looking for. With more and greater in-depth information in communication superstar company environments, front-line people working there can have more educated discussions, leading to greater inclusivity and collaboration, which can allow them to make the types of decisions that only top management (supported by consultants and researchers) could have made in the past. + +### Faster pace of decision-making and execution (speed) + +New technologies in these "communication superstar" companies are leading to quicker information acquisition, feedback, and flow between the front-line members in the organizations, even if they are very widely disbursed. + +Using the metaphor of adjusting the temperature of water coming out of a faucet, I would describe the effect this way: If you move the handle but the temperature changes very slowly, then finding the temperature you want becomes difficult, because the pace of temperature change is very slow, and differences between settings are difficult to determine. But if you move the handle and water temperature change is more immediate, you'll find that getting the correct temperature is much easier; you're moving quicker and making more rapid adjustments. + +The same logic applies to peer-to-peer discussions and feedback. I have a five-minute-to-twenty-four-hour goal when replying to my worldwide customers. That means that if I receive an email from a customer (something that arrives on my desktop computer at home, my desktop computer in the office, or on my mobile phone), I like to reply within five minutes. This really surprises customers, as they're probably still sitting in front of their computer! In the worst case, I try to reply within 24 hours. This gives me a competitive advantage when attempting to get customers to work with me. Front-line, peer-to-peer communities in these "communication superstar" companies can have that same competitive advantage in making quality decisions and executing them faster. The capacity for speedier replies allows us to make more adjustments quicker. It keeps both employees and customers involved, motivated and engaged. They become more transparent with information, include members they hadn't considered before. They can adapt more rapidly when redirection is required. They can collaborate at a more in-depth level and can build tighter, more trusting project communities. Information arriving too slowly can cause people to "turn off" and direct their attention elsewhere. This weakens the passion, dedication, and engagement of the project. + +### Toward wiser decisions (quality) + +Information not only travels more quickly when the business communication channels are adequate, but it's also subjected to more scrutiny through greater group collaboration and inclusivity. People can share second opinions and gather additional empirical data using these technologies. Furthermore, new communication technologies allow employees and managers to deliver data in new ways. With my years in sales training around the world, I've learned that using multiple visual aids, infographics, and so forth have greatly enhanced communication when English language barriers could have impeded it. All this can lead to high levels of peer-to-peer, front-line engagement, as up-to-date status reports can be quickly distributed and easily understood, making everyone more responsive. + +New technologies in these "communication superstar" companies are leading to quicker information acquisition, feedback, and flow between the front-line members in the organizations, even if they are very widely disbursed. + +### Maximal reach (distribution) + +Not long ago, teammates had to be physically close to one another and know each other well in order to communicate successfully. That's no longer the case, as communication channels can be developed with people literally all over the world. This has led to greater global inclusivity and collaboration. Good communication is the outcome of developing a trusting relationship. For me, building trust with people I've never met face-to-face has taken a bit longer, but I've done it with modern technology. Developing trust this way has led to great peer-to-peer transparency. + +Let me explain. Good communication starts with initial contact, whether meeting someone in person or virtually (via social media or some telecommunication format). Over some period of time and through several exchanges, a relationship starts to develop, and a level of trust is reached. People evaluate one another's character and integrity, and they also judge each other's competence and skills. With this deepening of trust over time, greater communication and collaboration can evolve. At that point, open and in-depth discussions and transparency on very difficult, complex, and sometimes uncomfortable topics can take place. With the ability to communicate at that level, peer-to-peer discussions and decisions can be made. With today's communication technology, greater information exchange can be made among a group of widely disbursed members leading to an expanded team community. I currently have approximately 20 customers around the world. Some I have never met in person; most I have just met in person once. Being stationed in Japan can make regular get-togethers with Europeans and Americans rather difficult. Fortunately, with today's communication technology, I can find solutions for many problems without physically getting together, as I have built a trusting relationship with them. + +### Concluding comments + +With all the benefits of this "communication superstar" working environment, in open organizations that promote peer-to-peer discussions, decision-making and management, I recommend the other three groups to move in that direction. The "slow movers" more than likely have managerial barriers to open information exchange. They should be convinced of the benefits of a more opened organization and the value of greater information exchange. If they don't improve their communication environment, they may lose their competitive advantage. The "fashion followers" should more carefully study their communication needs and time their investments with their in-company training capacities. The "conservative investors" should study their communication bottlenecks and find the technologies that are available to eliminate them. That's the path to super-stardom. + +As I mentioned at the beginning of this article, it's important to determine exactly which of these categories a company falls into with regard to communication technology ["slow movers" (low investment/low utilization), "fashion followers" (high investment/low utilization), "conservative investors" (low investment/high utilization) or "communication superstars" (high investment/high utilization)] against their competitors. Therefore, I would like to address that issue in a future article. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/1/communication-technology-superstars + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_mobilemashup3.png?itok=v1gVY8RJ (Different cell phones) +[2]: https://opensource.com/open-organization/resources/book-series +[3]: https://opensource.com/open-organization/16/4/how-new-communication-technologies-are-affecting-peer-peer-engagement +[4]: https://opensource.com/open-organization/resources/meet-ambassadors +[5]: https://opensource.com/open-organization/resources/open-org-definition +[6]: https://www.slideshare.net/RonMcFarland1/competitive-advantage-through-digital-investment-utilization?qid=9fbb4c4b-f2c2-4468-9f0a-3ebaa6efc91d&v=&b=&from_search=1 From 6300e18b48e8aebe88f570b86144a1486baca51c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:09:25 +0800 Subject: [PATCH 129/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20Use=20?= =?UTF-8?q?Vim=20to=20manage=20your=20task=20list=20and=20access=20Reddit?= =?UTF-8?q?=20and=20Twitter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md --- ...task list and access Reddit and Twitter.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md diff --git a/sources/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md b/sources/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md new file mode 100644 index 0000000000..30d51d321a --- /dev/null +++ b/sources/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Vim to manage your task list and access Reddit and Twitter) +[#]: via: (https://opensource.com/article/20/1/vim-task-list-reddit-twitter) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use Vim to manage your task list and access Reddit and Twitter +====== +Handle your to-do list and get social from the text editor in the +seventeenth in our series on 20 ways to be more productive with open +source in 2020. +![Chat via email][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Doing (almost) all the things with Vim, part 2 + +In [yesterday's article][2], you started reading mail and checking your calendars with Vim. Today, you're going to do even more. First, you'll take care of your task tracking, and then you'll get social, directly in the Vim text editor. + +#### Track your to-do's in Vim with todo.txt-vim + +![to-dos and Twitter with Vim][3] + +Editing a text-based to-do file with Vim is a natural fit, and the [todo.txt-vim][4] package makes it even easier. Start by installing the todo.txt-vim package: + + +``` +git clone ~/.vim/bundle/todo.txt-vim +vim ~/path/to/your/todo.txt +``` + +Todo.txt-vim automatically recognizes files ending in todo.txt and done.txt as [todo.txt][5] files. It adds key bindings specific to the todo.txt format. You can mark things "done" with **\x**, set them to the current date with **\d**, and change the priority with **\a**, **\b**, and **\c**. You can bump the priorities up (**\k**) or down (**\j**) and sort (**\s**) based on project (**\s+**), context (**\s@**), or date (**\sd**). And when you are finished, you can close and save the file like normal. + +The todo.txt-vim package is a great addition to the [todo.sh program][6] I wrote about a few days ago, and with the [todo edit][7] add-on, it can really supercharge your to-do list tracking. + +#### Read Reddit in Vim with vim-reddit + +![Reddit in Vim][8] + +Vim also has a nice add-on for [Reddit][9] called [vim-reddit][10]. It isn't as nice as [Tuir][11], but for a quick review of the latest posts, it works really well. Start by installing the bundle: + + +``` +git clone ~/.vim/bundle/vim-reddit +vim +``` + +Now type **:Reddit** and the Reddit frontpage will load. You can load a specific subreddit with **:Reddit name**. Once the article list is onscreen, navigate with the arrow keys or scroll with the mouse. Pressing **o** will open the article in Vim (unless it is a media post, in which case it opens a browser), and pressing **c** brings up the comments. If you want to go right to the page, press **O** instead of **o**. Going back a screen is as easy as **u**. And when you are done with Reddit, type **:bd**. The only drawback is vim-reddit cannot log in or post new stories or comments. Then again, sometimes that is a good thing. + +#### Tweet from Vim with twitvim + +![Twitter in Vim][12] + +And last, we have [twitvim][13], a Vim package for reading and posting to Twitter. This one takes a bit more to set up. Start by installing twitvim from GitHub: + + +``` +`git clone https://github.com/twitvim/twitvim.git ~/.vim/bundle/twitvim` +``` + +Now you need to edit the **.vimrc** file and set some options. These help the plugin know which libraries it can use to talk to Twitter. Run **vim --version** and see what languages have a **+** next to them—those languages are supported by your copy of Vim. + +![Enabled and Disabled things in vim][14] + +Since mine says **+perl -python +python3**, I know I can enable Perl and Python 3, but not Python 2 (python). + + +``` +" TwitVim Settings +let twitvim_enable_perl = 1 +" let twitvim_enable_python = 1 +let twitvim_enable_python3 = 1 +``` + +Now you can start up Vim and log into Twitter by running **:SetLoginTwitter**, which launches a browser window asking you to authorize VimTwit as an application with access to your account. Once you enter + +the supplied PIN into Vim, you're good to go. + +Twitvim's commands are not as simple as in the other packages. To load up the timeline of your friends and followers, type in **:FriendsTwitter**. To list your mentions and replies, use **:MentionsTwitter**. Posting a new tweet is **:PosttoTwitter <Your message>**. You can scroll through the list and reply to a specific tweet by typing **\r**, and you can start a direct message with someone using **\d**. + +And there you have it; you're doing (almost) all the things in Vim! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/vim-task-list-reddit-twitter + +作者:[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/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) +[2]: https://opensource.com/article/20/1/send-email-and-check-your-calendar-vim +[3]: https://opensource.com/sites/default/files/uploads/productivity_17-1.png (to-dos and Twitter with Vim) +[4]: https://github.com/freitass/todo.txt-vim +[5]: http://todotxt.org +[6]: https://opensource.com/article/20/1/open-source-to-do-list +[7]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory#edit-open-in-text-editor +[8]: https://opensource.com/sites/default/files/uploads/productivity_17-2.png (Reddit in Vim) +[9]: https://reddit.com +[10]: https://github.com/DougBeney/vim-reddit +[11]: https://opensource.com/article/20/1/open-source-reddit-client +[12]: https://opensource.com/sites/default/files/uploads/productivity_17-3.png (Twitter in Vim) +[13]: https://github.com/twitvim/twitvim +[14]: https://opensource.com/sites/default/files/uploads/productivity_17-4.png (Enabled and Disabled things in vim) From ab1eb0c02f52593b257292a11c1a6245d4d68855 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:10:04 +0800 Subject: [PATCH 130/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20Managi?= =?UTF-8?q?ng=20processes=20on=20Linux=20with=20kill=20and=20killall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200127 Managing processes on Linux with kill and killall.md --- ...rocesses on Linux with kill and killall.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20200127 Managing processes on Linux with kill and killall.md diff --git a/sources/tech/20200127 Managing processes on Linux with kill and killall.md b/sources/tech/20200127 Managing processes on Linux with kill and killall.md new file mode 100644 index 0000000000..339d97f307 --- /dev/null +++ b/sources/tech/20200127 Managing processes on Linux with kill and killall.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing processes on Linux with kill and killall) +[#]: via: (https://opensource.com/article/20/1/linux-kill-killall) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +Managing processes on Linux with kill and killall +====== +Know how to terminate processes and reclaim system resources with the +ps, kill, and killall commands. +![Penguin with green background][1] + +In Linux, every program and daemon is a "process." Most processes represent a single running program. Other programs can fork off other processes, such as processes to listen for certain things to happen and then respond to them. And each process requires a certain amount of memory and processing power. The more processes you have running, the more memory and CPU cycles you'll need. On older systems, like my seven-year-old laptop, or smaller computers, like the Raspberry Pi, you can get the most out of your system if you keep an eye on what processes you have running in the background. + +You can get a list of running processes with the **ps** command. You'll usually want to give **ps** some options to show more information in its output. I like to use the **-e** option to see every process running on my system, and the **-f** option to get full details about each process. Here are some examples: + + +``` +$ ps +    PID TTY          TIME CMD +  88000 pts/0    00:00:00 bash +  88052 pts/0    00:00:00 ps +  88053 pts/0    00:00:00 head + +[/code] [code] + +$ ps -e | head +    PID TTY          TIME CMD +      1 ?        00:00:50 systemd +      2 ?        00:00:00 kthreadd +      3 ?        00:00:00 rcu_gp +      4 ?        00:00:00 rcu_par_gp +      6 ?        00:00:02 kworker/0:0H-events_highpri +      9 ?        00:00:00 mm_percpu_wq +     10 ?        00:00:01 ksoftirqd/0 +     11 ?        00:00:12 rcu_sched +     12 ?        00:00:00 migration/0 + +[/code] [code] + +$ ps -ef | head +UID          PID    PPID  C STIME TTY          TIME CMD +root           1       0  0 13:51 ?        00:00:50 /usr/lib/systemd/systemd --switched-root --system --deserialize 36 +root           2       0  0 13:51 ?        00:00:00 [kthreadd] +root           3       2  0 13:51 ?        00:00:00 [rcu_gp] +root           4       2  0 13:51 ?        00:00:00 [rcu_par_gp] +root           6       2  0 13:51 ?        00:00:02 [kworker/0:0H-kblockd] +root           9       2  0 13:51 ?        00:00:00 [mm_percpu_wq] +root          10       2  0 13:51 ?        00:00:01 [ksoftirqd/0] +root          11       2  0 13:51 ?        00:00:12 [rcu_sched] +root          12       2  0 13:51 ?        00:00:00 [migration/0] +``` + +The last example shows the most detail. On each line, the UID (user ID) shows the user that owns the process. The PID (process ID) represents the numerical ID of each process, and PPID (parent process ID) shows the ID of the process that spawned this one. In any Unix system, processes count up from PID 1, the first process to run once the kernel starts up. Here, **systemd** is the first process, which spawned **kthreadd**. And **kthreadd** created other processes including **rcu_gp**, **rcu_par_gp**, and a bunch of other ones. + +### Process management with the kill command + +The system will take care of most background processes on its own, so you don't need to worry about them. You should only have to get involved in managing any processes that you create, usually by running applications. While many applications run one process at a time (think about your music player or terminal emulator or game), other applications might create background processes. Some of these might keep running when you exit the application so they can get back to work quickly the next time you start the application. + +Process management is an issue when I run Chromium, the open source base for Google's Chrome browser. Chromium works my laptop pretty hard and fires off a lot of extra processes. Right now, I can see these Chromium processes running with only five tabs open: + + +``` +$ ps -ef | fgrep chromium +jhall      66221   [...]  /usr/lib64/chromium-browser/chromium-browser [...] +jhall      66230   [...]  /usr/lib64/chromium-browser/chromium-browser [...] +[...] +jhall      66861   [...]  /usr/lib64/chromium-browser/chromium-browser [...] +jhall      67329   65132  0 15:45 pts/0    00:00:00 grep -F chromium +``` + +I've omitted some lines, but there are 20 Chromium processes and one **grep** process that is searching for the string "chromium." + + +``` +$ ps -ef | fgrep chromium | wc -l +21 +``` + +But after I exit Chromium, those processes remain open. How do you shut them down and reclaim the memory and CPU that those processes are taking up? + +The **kill** command lets you terminate a process. In the simplest case, you tell **kill** the PID of what you want to stop. For example, to terminate each of these processes, I would need to execute the **kill** command against each of the 20 Chromium process IDs. One way to do that is with a command line that gets the Chromium PIDs and another that runs **kill** against that list: + + +``` +$ ps -ef | fgrep /usr/lib64/chromium-browser/chromium-browser | awk '{print $2}' +66221 +66230 +66239 +66257 +66262 +66283 +66284 +66285 +66324 +66337 +66360 +66370 +66386 +66402 +66503 +66539 +66595 +66734 +66848 +66861 +69702 + +$ ps -ef | fgrep /usr/lib64/chromium-browser/chromium-browser | awk '{print $2}' > /tmp/pids +$ kill $( cat /tmp/pids) +``` + +Those last two lines are the key. The first command line generates a list of process IDs for the Chromium browser. The second command line runs the **kill** command against that list of process IDs. + +### Introducing the killall command + +A simpler way to stop a bunch of processes all at once is to use the **killall** command. As you might guess by the name, **killall** terminates all processes that match a name. That means we can use this command to stop all of our rogue Chromium processes. This is as simple as: + + +``` +`$ killall /usr/lib64/chromium-browser/chromium-browser` +``` + +But be careful with **killall**. This command can terminate any process that matches what you give it. That's why I like to first use **ps -ef** to check my running processes, then run **killall** against the exact path to the command that I want to stop. + +You might also want to use the **-i** or **\--interactive** option to ask **killall** to prompt you before it stops each process. + +**killall** also supports options to select processes that are older than a specific time using the **-o** or **\--older-than** option. This can be helpful if you discover a set of rogue processes that have been running unattended for several days, for example. Or you can select processes that are younger than a specific time, such as runaway processes you recently started. Use the **-y** or **\--younger-than** option to select these processes. + +### Other ways to manage processes + +Process management can be an important part of system maintenance. In my early career as a Unix and Linux systems administrator, the ability to kill escaped jobs was a useful tool to keep systems running properly. You may not need to kill rogue processes in a modern Linux desktop, but knowing **kill** and **killall** can help you when things eventually go awry. + +You can also look for other ways to manage processes. In my case, I didn't really need to use **kill** or **killall** to stop the background Chromium processes after I exited the browser. There's a simple setting in Chromium to control that: + +![Chromium background processes setting][2] + +Still, it's always a good idea to keep an eye on what processes are running on your system and know how to manage them when needed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/linux-kill-killall + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) +[2]: https://opensource.com/sites/default/files/uploads/chromium-settings-continue-running.png (Chromium background processes setting) From c79db94a1654811cbc006d4e394788e0a10b1ce4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:11:13 +0800 Subject: [PATCH 131/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20How=20?= =?UTF-8?q?to=20get=20started=20with=20test-driven=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200127 How to get started with test-driven development.md --- ...et started with test-driven development.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20200127 How to get started with test-driven development.md diff --git a/sources/tech/20200127 How to get started with test-driven development.md b/sources/tech/20200127 How to get started with test-driven development.md new file mode 100644 index 0000000000..2986deee9a --- /dev/null +++ b/sources/tech/20200127 How to get started with test-driven development.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to get started with test-driven development) +[#]: via: (https://opensource.com/article/20/1/test-driven-development) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +How to get started with test-driven development +====== +Learn when, what, and how to test in a TDD system. +![Penguin driving a car with a yellow background][1] + +I am often approached by software developers who are on board with the switch to test-driven development (TDD). They understand that describing expectations first and then writing code to meet those expectations is the best way to write software. And they agree that writing tests first does not introduce any overhead since they must write tests anyway. Still, they find themselves stuck, not being clear on what to test, when to test it, and how to test it. This article will answer those questions. + +### First, an analogy + +Imagine you're working on a team that has been asked to build a race car. The goal is to deliver a product that will enable a crew to drive the car from one city (say, Portland, Oregon) to another city (say, Seattle, Washington). + +Your team could go about designing and building that car in several different ways. One way would be to handcraft a unique, monolithic vehicle where all parts are home-grown and tightly coupled. Another way would be to use only prefabricated parts and stitch them together. And there are many other permutations of these two extreme approaches. + +Suppose your team goes with hand-building the constituent components of the race car. A car needs a battery to run. For the purposes of this analogy, focus on the custom-made car battery. How would you go about testing it? + +### Testing strategies + +One way to the test custom-made car battery would be to hire a testing crew, ship the car with the battery to Portland, and then get the testing crew to drive the car from Portland to Seattle. If the car arrives in Seattle, you can confirm that, yes, the car battery functions as expected. + +Another way to test the custom-made car battery would be to install it in the car and see if the engine turns over. If the engine starts, you can confirm that, yes, the car battery functions as expected. + +Still another way would be to use a voltmeter and connect the positive (+) and the negative (-) terminals to see if the voltmeter registers voltage output in the range of 12.6 to 14.7 volts. If it does, you can confirm that, yes, the car battery functions as expected. + +The above three hypothetical examples illustrate how different ways of testing the car battery align with three categories of testing strategies: + + 1. Employing the testing crew to drive the car from Portland to Seattle aligns with the **system or end-to-end testing strategy**. + 2. Installing the battery in the car and verifying if the engine starts aligns with the **integration testing strategy**. + 3. Measuring the voltage output of the car battery to verify if it falls within the expected range aligns with the **unit testing strategy**. + + + +### TDD is all about unit testing + +I hope these examples provide simple guiding principles for discerning between unit, integration, and system end-to-end testing. + +Keeping those guidelines in mind, it is very important _never_ to include integration nor system tests in your TDD practice. In TDD, the expected outcomes are always micro-outcomes. Measuring the voltage output of a car battery is a good example of a micro-outcome. A car battery is a unit of functionality that cannot easily be broken down into a few smaller units of functionality. As such, it is a perfect candidate for writing a unit test (i.e., describing the expected measurable output). + +You could also write a description of your expectations in the form of: "I expect the car engine to start on the event of turning the key." However, that description wouldn't qualify as a unit test. Why? Because the car is not at a sufficiently low level of granularity. In software engineering parlance, the car does not embody the [single responsibility principle][2] (SRP). + +And of course, while you could also write a description of your expectation in the form of: "I expect the car, which begins its journey in Portland, to arrive in Seattle after x number of hours," that description wouldn't qualify as a unit test. Many aspects of the car's journey from Portland to Seattle could be measured, so such end-to-end descriptions should never be part of TDD. + +### Simulating real conditions + +In the case of a car battery, just by using a simple voltmeter, you can simulate the operational environment of a car battery. You don't have to go into the expense of providing a full-blown experience (e.g., a fully functional car, a long and treacherous trip from Portland to Seattle) to be convinced that, indeed, your car battery functions as expected. + +That's the beauty of unit testing's simplicity. It's easy to simulate, easy to measure, easy to leave the exercise being convinced that everything works as expected. + +So what is it that enables this magic? The answer is simple—the _absence of dependencies_. A car battery does not depend on anything related to the automobile. Nor does it depend on anything related to the road trip from Portland to Seattle. Keep in mind that as your decomposed system components become less and less dependent on other components, your solution gets more and more reliable. + +### Conclusion + +The art of software engineering consists of the ability to decompose complex systems into small constituent elements. Each individual element must be reduced to the smallest possible surface. Once you reach that point in your process of decomposing a system, you can quite easily focus your attention on describing your expectations about the output of each unit. You can do that by following a formalized pattern, in which you first describe the _preconditions_ (i.e., given that such-and-such values are present), the _action_ (i.e., given that such-and-such _event_ arrives), and the _outcome_ or the _post-condition_ (i.e., you expect such-and-such values to be measurable). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/test-driven-development + +作者:[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/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://en.wikipedia.org/wiki/Single_responsibility_principle From 0e2d087f633bea34a28504af9cfec830a712d4c8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:15:41 +0800 Subject: [PATCH 132/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20IBM=20?= =?UTF-8?q?Power-based=20cloud=20instances=20available=E2=80=A6=20from=20G?= =?UTF-8?q?oogle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200127 IBM Power-based cloud instances available- from Google.md --- ... cloud instances available- from Google.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/talk/20200127 IBM Power-based cloud instances available- from Google.md diff --git a/sources/talk/20200127 IBM Power-based cloud instances available- from Google.md b/sources/talk/20200127 IBM Power-based cloud instances available- from Google.md new file mode 100644 index 0000000000..95ba1965c7 --- /dev/null +++ b/sources/talk/20200127 IBM Power-based cloud instances available- from Google.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM Power-based cloud instances available… from Google) +[#]: via: (https://www.networkworld.com/article/3516409/ibm-power-based-cloud-instances-available-from-google.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +IBM Power-based cloud instances available… from Google +====== +IBM’s high-performance RISC processors are now available to Google Cloud Platform users as a service. +Oak Ridge National Laboratory + +IBM and Google may be competitors in the cloud platform business, but that doesn't prevent them from working together. Google is partnering with IBM to offer "Power Systems as a service" on its Google Cloud platform. + +IBM’s Power processor line is the last man standing in the RISC/Unix war, surviving Sun Microsystems’ SPARC and HP’s PA-RISC. Along with mainframes it’s the last server hardware business IBM has, having divested its x86 server line in 2014. + +IBM already sells cloud instances of Power to its IBM Cloud customers, so this is just an expansion of existing offerings to a competitor with a considerable data center footprint. Google said that customers can run Power-based workloads on GCP on all of its operating systems save mainframes — AIX, IBM i, and Linux on IBM Power. + +This gives GCP customers the option of moving legacy IT systems running on IBM Power Systems to a hybrid cloud and the option of using Google or IBM, which have their respective strengths. IBM is focused on IBM customers, while Google is more focused on containerization, AI and ML, and low latency. + +IBM gains because its customers now have a second option, and customers like choice. GCP wins because it gives the company access to legacy IBM customers, something it never had as a relatively new company. It has no on-premises legacy, after all. + +"For organizations using a hybrid cloud strategy, especially, IBM Power Systems are an important tool. Because of their performance and ability to support mission critical workloads—such as SAP applications and Oracle databases—enterprise customers have been consistently looking for options to run IBM Power Systems in the cloud," wrote Kevin Ichhpurani, GCP's corporate vice president of global ecosystem in a [blog post][1] announcing the deal. + +"IBM Power Systems for Google Cloud offers a path to do just that, providing the best of both the cloud and on-premise worlds. You can run enterprise workloads like SAP and Oracle on the IBM Power servers that you’ve come to trust, while starting to take advantage of all the technical capabilities and favorable economics that Google Cloud offers," Ichhpurani added. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +Ichhpurani also noted several other benefits for customers: + + * Integrated billing: GCP customers can deploy the solution through the Google Cloud Marketplace and get a single bill for their GCP and IBM Power use. + * Private API access: IBM Power resources can access Google Cloud’s Private API Access technology securely and at low latency + * Integrated customer support: Customer support for both GCP and IBM have a single point of contact for any issues. + * Rapid deployment: An intuitive new management console enables quick ramp-up and rapid deployment of the solution. + + + +IBM Power is available to GCP customers now. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3516409/ibm-power-based-cloud-instances-available-from-google.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://cloud.google.com/blog/products/gcp/ibm-power-systems-now-available-on-google-cloud +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 7e292b03352af58e854c36c2ac58f524c7c8bd3b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Jan 2020 01:18:46 +0800 Subject: [PATCH 133/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200127=20Some?= =?UTF-8?q?=20Useful=20Probability=20Facts=20for=20Systems=20Programming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200127 Some Useful Probability Facts for Systems Programming.md --- ...obability Facts for Systems Programming.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/talk/20200127 Some Useful Probability Facts for Systems Programming.md diff --git a/sources/talk/20200127 Some Useful Probability Facts for Systems Programming.md b/sources/talk/20200127 Some Useful Probability Facts for Systems Programming.md new file mode 100644 index 0000000000..143516dd21 --- /dev/null +++ b/sources/talk/20200127 Some Useful Probability Facts for Systems Programming.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some Useful Probability Facts for Systems Programming) +[#]: via: (https://theartofmachinery.com/2020/01/27/systems_programming_probability.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Some Useful Probability Facts for Systems Programming +====== + +Probability problems come up a lot in systems programming, and I’m using that term loosely to mean everything from operating systems programming and networking, to building large online services, to creating virtual worlds like in games. Here’s a bunch of rough-and-ready probability rules of thumb that are deeply related and have many practical applications when designing systems. + +## (\frac{1}{N}) chance tried (N) times + +Retries are everywhere in systems programming. For example, imagine you’re designing a world for a roleplaying game. When monsters in one particular forest are defeated, they have a small chance of dropping some special item. Suppose that chance is (\frac{1}{10}). Basic probability says that players are expected to need 10 victories before gaining a special item. But in probability, “expected value” is just a kind of average value, and there’s no guarantee that players will get the item even if they do win 10 battles. + +What’s a player’s chance of getting at least one special item after 10 battles? Let’s just try getting a computer to calculate the probability of getting at least one success for (N) tries at a (\frac{1}{N}) chance, for a range of values of (N): + +![Plot of probability of at least one success after trying a 1/N chance N times. The probability starts at 100% and drops, but quickly flattens out to a value just below 65%.][1] + +Eyeballing the graph, it looks like the probability is roughly constant for (N) greater than about 3. In fact, it converges on (1 - e^{- 1}), where (e) is Euler’s constant, 2.718281828459… This number (along with (e^{- 1})) is extremely common in engineering, so here’s a table of practical values: + +exp(-1.0) | 1.0-exp(-1.0) +---|--- +36.7% | 63.2% +A bit over a third | A bit under two thirds + +So, if you don’t need an exact answer (and you often don’t) you could just say that if the drop probability is (\frac{1}{10}), most players will get a special item within 10 battles, but (close enough) about a third won’t. Because the monster battles are statistically independent, we can make a rough guess that about 1 in 9 players still won’t have a special item after 20 battles. Also, roughly 60% won’t after 5 battles because (0.6 \times 0.6 = 0.36), so 60% is close to the square root of 36.7%. + +> If you have (\frac{1}{N}) chance of success, then you’re more likely than not to have succeeded after (N) tries, but the probability is only about two thirds (or your favourite approximation to (1 - e^{- 1})). The value of (N) doesn’t affect the approximation much as long as it’s at least 3. + +Here’s the proof: The chance of the player failing to get a special item after all (10) battles is ((\frac{9}{10})^{10} = .349), so the chance of getting at least one is (1 - .349 = .651). More generally, the chance of succeeding at least once is (1 - (1 - \frac{1}{N})^{N}), which converges on (1 - e^{- 1}) (by [one of the definitions of (e)][2]). + +By the way, this rule is handy for quick mental estimates in board games, too. Suppose a player needs to get at least one 6 from rolling 8 six-sided dice. What’s probability of failure? It’s about (\frac{1}{3}) for the first 6 dice, and (\frac{5}{6} \times \frac{5}{6}) for the remaining two, so all up it’s about (\frac{1}{3} \times \frac{25}{36} \approx \frac{8}{36} \approx \frac{1}{4}). A calculator says ((\frac{5}{6})^{8} = .233), so the rough approximation was good enough for gameplay. + +## (N) balls in (N) buckets + +I’ll state this one up front: + +> Suppose you throw (N) balls randomly (independently and one at a time) into (N) buckets. On average, a bit over a third ((e^{- 1})) of the buckets will stay empty, a bit over a third ((e^{- 1}) again) will have exactly one ball, and the remaining quarter or so ((1 - 2e^{- 1})) will contain multiple balls. + +The balls-and-buckets abstract model has plenty of concrete engineering applications. For example, suppose you have a load balancer randomly assigning requests to 12 backends. If 12 requests come in during some time window, on average about 4 of the backends will be idle, only about 4 will have a balanced single-request load, and the remaining (average) 3 or 4 will be under higher load. Of course, all of these are averages, and there’ll be fluctuations in practice. + +As another example, if a hash table has (N) slots, then if you put (N) different values into it, about a third of the slots will still be empty and about a quarter of the slots will have collisions. + +If an online service has a production incident once every 20 days on average, then (assuming unrelated incidents) just over a third of 20-day periods will be dead quiet, just over a third will have the “ideal” single incident, while a quarter of 20-day periods will be extra stressful. In the real world, production incidents are even more tightly clustered because they’re not always independent. + +This rule of thumb also hints at why horizontally scaled databases tend to have hot and cold shards, and why low-volume businesses (like consulting) can suffer from feast/famine patterns of customer demand. + +Random allocation is much more unbalanced than we intuitively expect. A famous example comes from World War II when, late in the war, the Germans launched thousands of V-1 and V-2 flying bombs at London. Hitting a city with a rocket from across the Channel already required pushing 1940s technology to new limits, but several British analysts looked at maps of bomb damage and concluded that the Germans were somehow targetting specific areas of London, implying an incredible level of technological advancement. In 1946, however, an actuary did the proper statistical analysis and said that, no, [the clustering of bomb damage was simply what you’d expect from random chance][3]. (That analysis is based on the [Poisson distribution][4], and the ratios in the rule for (N) balls and (N) buckets can be calculated from a Poisson distribution with (\lambda = \frac{N}{N} = 1).) + +![25 points uniformly randomly placed on a 5x5 grid, showing spurious clustering. 8 boxes are empty, 10 boxes contain one point and 7 boxes contain two or more points.][5] + +Random allocation only balances out when the number of “balls” is much larger than the number of “buckets”, i.e., when averaging over a large number of items, or a long time period. That’s one of the many reasons that engineering solutions that work well for large-scale FAANG companies can be problematic when used by companies that are orders of magnitude smaller. + +Proving the third-third-quarter rule is pretty easy if you look at just one bucket. Each of the (N) balls represents a (\frac{1}{N}) chance of adding a ball to the bucket, so the chance of the bucket staying empty is just the (e^{- 1} \approx 36.7%) from the first rule. Linearity of expectation means we can combine the results for each bucket and say that 36.7% of _all_ buckets are expected to be empty, even though the bucket counts aren’t independent. Also, there are (N) possible ways of exactly one ball landing in the bucket, and each way requires one ball to fall in (with probability (\frac{1}{N})) and the other (N - 1) balls to miss (with probability (1 - \frac{1}{N})). So the probably of exactly one ball falling in is (\left. N \times \frac{1}{N} \times (1 - \frac{1}{N})^{N - 1}\rightarrow e^{- 1} \right.). + +### Fixed points of random permutations + +I don’t think this rule has as many practical applications as the (N) balls/buckets rule, but it’s kind of a freebie. + +Think of a battle game in which 6 players start from 6 spawn/home points. If the players play a second round, what’s the chance that someone starts from the same point? Mathematically, that’s asking about the chance of a random permutation having a “fixed point”. + +> If a group of things are randomly shuffled, a bit of over a third ((e^{- 1})) of the time there’ll be no fixed points, a bit of over a third ((e^{- 1})) of the time there’ll be just one fixed point, and the remaining quarter or so of the time there’ll be two or more. + +The number of fixed points in a random shuffle happens to approximate the same distribution as the number of balls in the buckets before, which can be [proven from first principles using the inclusion-exclusion principle][6]. But there’s an even simpler proof for a related fact: + +> A random permutation has exactly one fixed point on average, regardless of size. + +If there are (N) things, each one has a (\frac{1}{N}) chance of ending up in its original location after the shuffle, so on average there’ll be (N \times \frac{1}{N} = 1) fixed points. Note that it’s impossible to get exactly one fixed point by shuffling a two element set (try it!) but 1 is still the average of 2 and 0. (“Average” doesn’t always mean what we want it to mean.) + +That proof might seem too simple, but it’s a demonstration of how powerful linearity of expectation is. Trying to calculate statistics for permutations can be tricky because the places any item can go depend on the places all the other items have gone. Linearity of expectation means we don’t have to care about all the interactions as long as we only need to know the average. The average isn’t always the most useful statistic to calculate, but it’s often the easiest by far. + +## The coupon collector’s problem + +Let’s look at [the common “loot box” mechanism][7]. Specifically, suppose there are 10 collector items (say, one for each hero in a franchise) that are sold in blind boxes. Let’s take the fairest case in which there are no rare items and each item has an equal (\frac{1}{10}) chance of being in a given box. How many boxes will a collector buy on average before getting a complete set? This is the called the coupon collector’s problem, and for 10 items the answer is about 29. + +> The answer to the coupon collector’s problem is a bit more than (N\ln N) (add (\frac{N}{2}) for some more accuracy). + +((\ln N) is (\log) base (e), or just `log(N)` in most programming languages.) + +The coupon collector’s problem hints at why the loot box mechanism is so powerful. The (N) balls in (N) buckets rule tells us that the collector will have about two thirds of the items after buying 10 boxes. It feels like the collector is most of the way there, and it would be a shame to give up and let so much progress go to waste, but actually 10 boxes is only about a third of the expected number of boxes needed. That’s a simplistic model, but item rarity, variation of box type and (in computer games) making some items “unlockable” by completing sets of other items (or fulfilling other dependencies) only make it easier to get collectors to buy more than they originally expect. + +The (N\ln N) rule is very rough, so here’s a plot for comparison: + +![Plot of approximations to the coupon collector's problem. N ln N underestimates significantly, but has the right growth rate. N ln N + N/2 still underestimates slightly, but the error is less than 10%. The 1:1 slope N is also included to show that, beyond small values of N, multiple times N purchases are needed to get all items on average.][8] + +The exact value is rarely needed, but it’s useful to know that you’ll quickly need multiple times (N) trials to get all (N) hits. Any application of the (N) balls/buckets rule naturally extends to a coupon collector’s problem (e.g., on average you’ll need to put over (N\ln N) items into a hash table before all (N) slots are full) but the coupon collector’s problem comes up in other places, too. Often it’s tempting to use randomness to solve a problem statelessly, and then you find yourself doing a coupon collector problem. A cool example is [the FizzleFade effect in the classic 90s first-person shooter Wolfenstein 3D][9]. When the player character died, the screen would fill up with red pixels in what looks like random order. A simple and obvious way to implement that would be to plot red pixels at random coordinates in a loop, but filling the screen that way would be boring. With (320 \times 200 = 64000) pixels, most (~63.2%) of the screen would be filled red after 64000 iterations, but then the player would have to wait over (\ln(64000) \approx 11) times longer than that watching the last patches of screen fade away. The developers of Wolfenstein had to come up with a way to calculate a pseudo-random permutation of pixels on the screen, without explicitly storing the permutation in memory. + +Here’s a loose explanation of where the (\ln N) factor comes from: We know already that any pixel has approximately (\frac{1}{e}) chance of not being coloured by any batch of (N) pixel plots. So, after a batch of (N) pixel plots, the number of unfilled pixels goes down by a factor of (e) on average. If we assume we can multiply the average because it’s close enough to the geometric mean, the number of unfilled pixels will drop from (N) to something like (\frac{N}{e^{k}}) after (k) batches. That means the number of batches needed to go from (N) unfilled pixels to 1 is something like (\ln N), from the basic definition of logarithms. + +In the computer age it’s easy to get an answer once we know we have a specific probability problem to solve. But rough rules like the ones in this post are still useful during the design phase, or for getting an intuitive understanding for why a system behaves the way it does. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2020/01/27/systems_programming_probability.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://theartofmachinery.com/images/systems_programming_probability/one_on_n_tried_n_times.svg +[2]: https://en.wikipedia.org/wiki/Characterizations_of_the_exponential_function#Characterizations +[3]: https://www.cambridge.org/core/journals/journal-of-the-institute-of-actuaries/article/an-application-of-the-poisson-distribution/F75111847FDA534103BD4941BD96A78E +[4]: https://en.wikipedia.org/wiki/Poisson_distribution +[5]: https://theartofmachinery.com/images/systems_programming_probability/london_v1_simulation.svg +[6]: https://golem.ph.utexas.edu/category/2019/11/random_permutations_part_1.html +[7]: https://www.pcgamer.com/au/the-evolution-of-loot-boxes/ +[8]: https://theartofmachinery.com/images/systems_programming_probability/coupon_collector.svg +[9]: http://fabiensanglard.net/fizzlefade/index.php From 5d61850718995399fb18c9162b22fac64233accb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Jan 2020 13:12:21 +0800 Subject: [PATCH 134/285] PRF @heguangzhi --- ...ome loot in your Python platformer game.md | 583 +++++++++--------- 1 file changed, 292 insertions(+), 291 deletions(-) diff --git a/translated/tech/20200102 Put some loot in your Python platformer game.md b/translated/tech/20200102 Put some loot in your Python platformer game.md index 14d2715438..a22c330ade 100644 --- a/translated/tech/20200102 Put some loot in your Python platformer game.md +++ b/translated/tech/20200102 Put some loot in your Python platformer game.md @@ -1,60 +1,61 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Put some loot in your Python platformer game) [#]: via: (https://opensource.com/article/20/1/loot-python-platformer-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Put some loot in your Python platformer game 在你的 Python 平台类游戏中放一些奖励 ====== -这部分是关于在使用 Python 的 Pygame 模块开发视频游戏给你的玩家提供收集的宝物和经验值的内容。 -![Hearts, stars, and dollar signs][1] +> 这部分是关于在使用 Python 的 Pygame 模块开发的视频游戏总给你的玩家提供收集的宝物和经验值的内容。 -这是正在进行的关于使用 [Python 3][2]的[Pygame][3]模块创建视频游戏的系列文章的第9部分。以前的文章有: +![](https://img.linux.net.cn/data/attachment/album/202001/29/131158jkwnhgd1nnawzn86.jpg) - * [通过构建一个简单的骰子游戏学习如何用 Python 编程][4] - * [使用 Pygame 模块用 Python 构建游戏框架][5] - * [如何在 Python 游戏中添加玩家][6] - * [使用 Pygame 移动你的游戏角色][7] - * [没有恶棍的哪里来的英雄?如何在您的 Python 游戏中添加一个][8] - * [在你的 Python 游戏中模拟重力][9] - * [将跳跃添加到您的 Python 平台游戏中][10] +这是正在进行的关于使用 [Python 3][2] 的 [Pygame][3] 模块创建视频游戏的系列文章的第十部分。以前的文章有: + + * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][4] + * [使用 Python 和 Pygame 模块构建一个游戏框架][5] + * [如何在你的 Python 游戏中添加一个玩家][6] + * [用 Pygame 使你的游戏角色移动起来][7] + * [如何向你的 Python 游戏中添加一个敌人][8] + * [在 Pygame 游戏中放置平台][13] + * [在你的 Python 游戏中模拟引力][9] + * [为你的 Python 平台类游戏添加跳跃功能][10] * [使你的 Python 游戏玩家能够向前和向后跑][11] 如果你已经阅读了本系列的前几篇文章,那么你已经了解了编写游戏的所有基础知识。现在你可以在这些基础上,创造一个全功能的游戏。当你第一次学习时,遵循本系列代码示例,这样的“用例”是有帮助的,但是,用例也会约束你。现在是时候运用你学到的知识,以新的方式应用它们了。 如果说,说起来容易做起来难,这篇文章展示了一个如何将你已经了解的内容用于新目的的例子中。具体来说,就是它涵盖了如何使用你以前的课程中已经了解到的来实现奖励系统。 -在大多数电子游戏中,你有机会在游戏世界中获得“奖励”或收集到宝物和其他物品。奖励通常会增加你的分数或者你的健康指数,或者为你的下一次任务提供信息。 +在大多数电子游戏中,你有机会在游戏世界中获得“奖励”或收集到宝物和其他物品。奖励通常会增加你的分数或者你的生命值,或者为你的下一次任务提供信息。 游戏中包含的奖励类似于编程平台。像平台一样,奖励没有用户控制,随着游戏世界的滚动进行,并且必须检查与玩家的碰撞。 ### 创建奖励函数 -奖励和平台非常相似,你甚至不需要奖励类。您可以重用 **Platform** 类,并将结果称为奖励。 +奖励和平台非常相似,你甚至不需要一个奖励的类。你可以重用 `Platform` 类,并将结果称为“奖励”。 -由于奖励类型和位置可能因关卡不同而不同,如果你还没有一个新的功能,请在你的 **Level** 中创建一个名为 **Level** 的新功能。因为奖励物品不是平台,你也必须创建一个新的 **loot_list** 组,然后添加奖励物品。与平台、地面和敌人一样,该组用于检查玩家碰撞: +由于奖励类型和位置可能因关卡不同而不同,如果你还没有,请在你的 `Level` 中创建一个名为 `loot` 的新函数。因为奖励物品不是平台,你也必须创建一个新的 `loot_list` 组,然后添加奖励物品。与平台、地面和敌人一样,该组用于检查玩家碰撞: ``` -    def loot(lvl,lloc): -        if lvl == 1: -            loot_list = pygame.sprite.Group() -            loot = Platform(300,ty*7,tx,ty, 'loot_1.png') -            loot_list.add(loot) + def loot(lvl,lloc): + if lvl == 1: + loot_list = pygame.sprite.Group() + loot = Platform(300,ty*7,tx,ty, 'loot_1.png') + loot_list.add(loot) -        if lvl == 2: -            print(lvl) + if lvl == 2: + print(lvl) -        return loot_list + return loot_list ``` -你可以随意添加任意数量的奖励对象;记住把每一个都加到你的奖励清单上。***Platform** 类的参数是奖励图标的X位置、Y位置、宽度和高度(通常最容易让你的奖励图标保持和所有其他方块一样的大小),以及你想要用作的奖励图标。奖励的放置可以和贴图平台一样复杂,所以使用创建关卡时需要创建关卡设计文档。 +你可以随意添加任意数量的奖励对象;记住把每一个都加到你的奖励清单上。`Platform` 类的参数是奖励图标的 X 位置、Y 位置、宽度和高度(通常让你的奖励精灵保持和所有其他方块一样的大小最为简单),以及你想要用作的奖励的图片。奖励的放置可以和贴图平台一样复杂,所以使用创建关卡时需要的关卡设计文档。 -在脚本的 **Setup** 部分调用新的奖励函数。在下面的代码中,前三行是上下文,所以只需添加第四行: +在脚本的设置部分调用新的奖励函数。在下面的代码中,前三行是上下文,所以只需添加第四行: ``` enemy_list = Level.bad( 1, eloc ) @@ -91,7 +92,6 @@ loot_list = Level.loot(1,tx,ty) 要向后滚动,请添加最后两行: - ```         for e in enemy_list:             e.rect.x += scroll @@ -103,11 +103,11 @@ loot_list = Level.loot(1,tx,ty) ### 检测碰撞 -就像平台和敌人一样,你可以检查奖励物品和玩家之间的碰撞。逻辑与其他碰撞相同,除了撞击不会(必然)影响重力或健康。取而代之的是,命中会导致奖励物品会消失并增加玩家的分数。 +就像平台和敌人一样,你可以检查奖励物品和玩家之间的碰撞。逻辑与其他碰撞相同,除了撞击不会(必然)影响重力或生命值。取而代之的是,命中会导致奖励物品会消失并增加玩家的分数。 -当你的玩家触摸到一个奖励对象时,你可以从 **奖励列表** 中移除该对象。这意味着当你的主循环在 **loot_list** 中重绘所有奖励物品时,它不会重绘那个特定的对象,所以看起来玩家已经获得了奖励物品。 +当你的玩家触摸到一个奖励对象时,你可以从 `loot_list` 中移除该对象。这意味着当你的主循环在 `loot_list` 中重绘所有奖励物品时,它不会重绘那个特定的对象,所以看起来玩家已经获得了奖励物品。 -在 **Player** 类的 **update** 函数中的平台碰撞检测之上添加以下代码(最后一行仅用于上下文): +在 `Player` 类的 `update` 函数中的平台碰撞检测之上添加以下代码(最后一行仅用于上下文): ```                 loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) @@ -119,7 +119,7 @@ loot_list = Level.loot(1,tx,ty)         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) ``` -当碰撞发生时,你不仅要把奖励从它的组中移除,还要给你的玩家一个分数提升。你还没有创建分数变量,所以请将它添加到你的玩家属性中,该属性是在***Player** 类的**__init__**函数中创建的。在下面的代码中,前两行是上下文,所以只需添加分数变量: +当碰撞发生时,你不仅要把奖励从它的组中移除,还要给你的玩家一个分数提升。你还没有创建分数变量,所以请将它添加到你的玩家属性中,该属性是在 `Player` 类的 `__init__` 函数中创建的。在下面的代码中,前两行是上下文,所以只需添加分数变量: ```         self.frame = 0 @@ -127,7 +127,7 @@ loot_list = Level.loot(1,tx,ty)         self.score = 0 ``` -当在主循环中调用**update**函数时,需要包括**loot_list**: +当在主循环中调用 `update` 函数时,需要包括 `loot_list`: ```         player.gravity() @@ -136,7 +136,7 @@ loot_list = Level.loot(1,tx,ty) 如你所见,你已经掌握了所有的基本知识。你现在要做的就是用新的方式使用你所知道的。 -在下一篇文章中还有一些提示,但是与此同时,用你学到的知识来制作一些简单的单层游戏。限制你试图创造的东西的范围是很重要的,这样你就不会埋没自己。这也使得最终的成品看起来和感觉上更容易完成。 +在下一篇文章中还有一些提示,但是与此同时,用你学到的知识来制作一些简单的单关卡游戏。限制你试图创造的东西的范围是很重要的,这样你就不会埋没自己。这也使得最终的成品看起来和感觉上更容易完成。 以下是迄今为止你为这个 Python 平台编写的所有代码: @@ -154,7 +154,7 @@ loot_list = Level.loot(1,tx,ty) # GNU All-Permissive License # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved.  This file is offered as-is, +# notice and this notice are preserved. This file is offered as-is, # without any warranty. import pygame @@ -166,221 +166,221 @@ Objects ''' class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     -    def __init__(self,xloc,yloc,imgw,imgh,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)).convert() -        self.image.convert_alpha() -        self.rect = self.image.get_rect() -        self.rect.y = yloc -        self.rect.x = xloc + # x location, y location, img width, img height, img file + def __init__(self,xloc,yloc,imgw,imgh,img): + pygame.sprite.Sprite.__init__(self) + self.image = pygame.image.load(os.path.join('images',img)).convert() + self.image.convert_alpha() + self.rect = self.image.get_rect() + self.rect.y = yloc + self.rect.x = xloc class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 -        self.movey = 0 -        self.frame = 0 -        self.health = 10 -        self.collide_delta = 0 -        self.jump_delta = 6 -        self.score = 1 -        self.images = [] -        for i in range(1,9): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha() -            img.set_colorkey(ALPHA) -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() + ''' + Spawn a player + ''' + def __init__(self): + pygame.sprite.Sprite.__init__(self) + self.movex = 0 + self.movey = 0 + self.frame = 0 + self.health = 10 + self.collide_delta = 0 + self.jump_delta = 6 + self.score = 1 + self.images = [] + for i in range(1,9): + img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() + img.convert_alpha() + img.set_colorkey(ALPHA) + self.images.append(img) + self.image = self.images[0] + self.rect = self.image.get_rect() -    def jump(self,platform_list): -        self.jump_delta = 0 + def jump(self,platform_list): + self.jump_delta = 0 -    def gravity(self): -        self.movey += 3.2 # how fast player falls -        -        if self.rect.y > worldy and self.movey >= 0: -            self.movey = 0 -            self.rect.y = worldy-ty -        -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -        -    def update(self): -        ''' -        Update sprite position -        ''' -        -        self.rect.x = self.rect.x + self.movex -        self.rect.y = self.rect.y + self.movey + def gravity(self): + self.movey += 3.2 # how fast player falls + + if self.rect.y > worldy and self.movey >= 0: + self.movey = 0 + self.rect.y = worldy-ty + + def control(self,x,y): + ''' + control player movement + ''' + self.movex += x + self.movey += y + + def update(self): + ''' + Update sprite position + ''' + + self.rect.x = self.rect.x + self.movex + self.rect.y = self.rect.y + self.movey -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[self.frame//ani] + # moving left + if self.movex < 0: + self.frame += 1 + if self.frame > ani*3: + self.frame = 0 + self.image = self.images[self.frame//ani] -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] + # moving right + if self.movex > 0: + self.frame += 1 + if self.frame > ani*3: + self.frame = 0 + self.image = self.images[(self.frame//ani)+4] -        # collisions -        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -        for enemy in enemy_hit_list: -            self.health -= 1 -            #print(self.health) + # collisions + enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) + for enemy in enemy_hit_list: + self.health -= 1 + #print(self.health) -        loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) -        for loot in loot_hit_list: -            loot_list.remove(loot) -            self.score += 1 -            print(self.score) + loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) + for loot in loot_hit_list: + loot_list.remove(loot) + self.score += 1 + print(self.score) -        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) -        for p in plat_hit_list: -            self.collide_delta = 0 # stop jumping -            self.movey = 0 -            if self.rect.y > p.rect.y: -                self.rect.y = p.rect.y+ty -            else: -                self.rect.y = p.rect.y-ty -            -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.movey = 0 -            self.rect.y = worldy-ty-ty -            self.collide_delta = 0 # stop jumping -            if self.rect.y > g.rect.y: -                self.health -=1 -                print(self.health) -                -        if self.collide_delta < 6 and self.jump_delta < 6: -            self.jump_delta = 6*2 -            self.movey -= 33  # how high to jump -            self.collide_delta += 6 -            self.jump_delta    += 6 -            + plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) + for p in plat_hit_list: + self.collide_delta = 0 # stop jumping + self.movey = 0 + if self.rect.y > p.rect.y: + self.rect.y = p.rect.y+ty + else: + self.rect.y = p.rect.y-ty + + ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) + for g in ground_hit_list: + self.movey = 0 + self.rect.y = worldy-ty-ty + self.collide_delta = 0 # stop jumping + if self.rect.y > g.rect.y: + self.health -=1 + print(self.health) + + if self.collide_delta < 6 and self.jump_delta < 6: + self.jump_delta = 6*2 + self.movey -= 33 # how high to jump + self.collide_delta += 6 + self.jump_delta += 6 + class Enemy(pygame.sprite.Sprite): -    ''' -    Spawn an enemy -    ''' -    def __init__(self,x,y,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)) -        self.movey = 0 -        #self.image.convert_alpha() -        #self.image.set_colorkey(ALPHA) -        self.rect = self.image.get_rect() -        self.rect.x = x -        self.rect.y = y -        self.counter = 0 + ''' + Spawn an enemy + ''' + def __init__(self,x,y,img): + pygame.sprite.Sprite.__init__(self) + self.image = pygame.image.load(os.path.join('images',img)) + self.movey = 0 + #self.image.convert_alpha() + #self.image.set_colorkey(ALPHA) + self.rect = self.image.get_rect() + self.rect.x = x + self.rect.y = y + self.counter = 0 -                -    def move(self): -        ''' -        enemy movement -        ''' -        distance = 80 -        speed = 8 + + def move(self): + ''' + enemy movement + ''' + distance = 80 + speed = 8 -        self.movey += 3.2 -        -        if self.counter >= 0 and self.counter <= distance: -            self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: -            self.rect.x -= speed -        else: -            self.counter = 0 -        -        self.counter += 1 + self.movey += 3.2 + + if self.counter >= 0 and self.counter <= distance: + self.rect.x += speed + elif self.counter >= distance and self.counter <= distance*2: + self.rect.x -= speed + else: + self.counter = 0 + + self.counter += 1 -        if not self.rect.y >= worldy-ty-ty: -            self.rect.y += self.movey + if not self.rect.y >= worldy-ty-ty: + self.rect.y += self.movey -        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) -        for p in plat_hit_list: -            self.movey = 0 -            if self.rect.y > p.rect.y: -                self.rect.y = p.rect.y+ty -            else: -                self.rect.y = p.rect.y-ty + plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) + for p in plat_hit_list: + self.movey = 0 + if self.rect.y > p.rect.y: + self.rect.y = p.rect.y+ty + else: + self.rect.y = p.rect.y-ty -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.rect.y = worldy-ty-ty + ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) + for g in ground_hit_list: + self.rect.y = worldy-ty-ty -        + class Level(): -    def bad(lvl,eloc): -        if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group -            -        if lvl == 2: -            print("Level " + str(lvl) ) + def bad(lvl,eloc): + if lvl == 1: + enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy + enemy_list = pygame.sprite.Group() # create enemy group + enemy_list.add(enemy) # add enemy to group + + if lvl == 2: + print("Level " + str(lvl) ) -        return enemy_list + return enemy_list -    def loot(lvl,tx,ty): -        if lvl == 1: -            loot_list = pygame.sprite.Group() -            loot = Platform(200,ty*7,tx,ty, 'loot_1.png') -            loot_list.add(loot) + def loot(lvl,tx,ty): + if lvl == 1: + loot_list = pygame.sprite.Group() + loot = Platform(200,ty*7,tx,ty, 'loot_1.png') + loot_list.add(loot) -        if lvl == 2: -            print(lvl) + if lvl == 2: + print(lvl) -        return loot_list + return loot_list -    def ground(lvl,gloc,tx,ty): -        ground_list = pygame.sprite.Group() -        i=0 -        if lvl == 1: -            while i < len(gloc): -                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') -                ground_list.add(ground) -                i=i+1 + def ground(lvl,gloc,tx,ty): + ground_list = pygame.sprite.Group() + i=0 + if lvl == 1: + while i < len(gloc): + ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') + ground_list.add(ground) + i=i+1 -        if lvl == 2: -            print("Level " + str(lvl) ) + if lvl == 2: + print("Level " + str(lvl) ) -        return ground_list + return ground_list -    def platform(lvl,tx,ty): -        plat_list = pygame.sprite.Group() -        ploc = [] -        i=0 -        if lvl == 1: -            ploc.append((20,worldy-ty-128,3)) -            ploc.append((300,worldy-ty-256,3)) -            ploc.append((500,worldy-ty-128,4)) + def platform(lvl,tx,ty): + plat_list = pygame.sprite.Group() + ploc = [] + i=0 + if lvl == 1: + ploc.append((20,worldy-ty-128,3)) + ploc.append((300,worldy-ty-256,3)) + ploc.append((500,worldy-ty-128,4)) -            while i < len(ploc): -                j=0 -                while j <= ploc[i][2]: -                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') -                    plat_list.add(plat) -                    j=j+1 -                print('run' + str(i) + str(ploc[i])) -                i=i+1 + while i < len(ploc): + j=0 + while j <= ploc[i][2]: + plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') + plat_list.add(plat) + j=j+1 + print('run' + str(i) + str(ploc[i])) + i=i+1 -        if lvl == 2: -            print("Level " + str(lvl) ) + if lvl == 2: + print("Level " + str(lvl) ) -        return plat_list + return plat_list ''' Setup @@ -389,12 +389,12 @@ worldx = 960 worldy = 720 fps = 40 # frame rate -ani = 4  # animation cycles +ani = 4 # animation cycles clock = pygame.time.Clock() pygame.init() main = True -BLUE  = (25,25,200) +BLUE = (25,25,200) BLACK = (23,23,23 ) WHITE = (254,254,254) ALPHA = (0,255,0) @@ -419,9 +419,9 @@ tx = 64 #tile size ty = 64 #tile size i=0 -while i <= (worldx/tx)+tx: -    gloc.append(i*tx) -    i=i+1 +while i <= (worldx/tx)+tx: + gloc.append(i*tx) + i=i+1 enemy_list = Level.bad( 1, eloc ) ground_list = Level.ground( 1,gloc,tx,ty ) @@ -432,69 +432,69 @@ loot_list = Level.loot(1,tx,ty) Main loop ''' while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit(); sys.exit() + main = False -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print("LEFT") -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print("RIGHT") -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT or event.key == ord('a'): + print("LEFT") + player.control(-steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + print("RIGHT") + player.control(steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                player.jump(plat_list) + if event.type == pygame.KEYUP: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(-steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + player.jump(plat_list) -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False + if event.key == ord('q'): + pygame.quit() + sys.exit() + main = False -    # scroll the world forward -    if player.rect.x >= forwardx: -        scroll = player.rect.x - forwardx -        player.rect.x = forwardx -        for p in plat_list: -            p.rect.x -= scroll -        for e in enemy_list: -            e.rect.x -= scroll -        for l in loot_list: -            l.rect.x -= scroll -                -    # scroll the world backward -    if player.rect.x <= backwardx: -        scroll = backwardx - player.rect.x -        player.rect.x = backwardx -        for p in plat_list: -            p.rect.x += scroll -        for e in enemy_list: -            e.rect.x += scroll -        for l in loot_list: -            l.rect.x += scroll + # scroll the world forward + if player.rect.x >= forwardx: + scroll = player.rect.x - forwardx + player.rect.x = forwardx + for p in plat_list: + p.rect.x -= scroll + for e in enemy_list: + e.rect.x -= scroll + for l in loot_list: + l.rect.x -= scroll + + # scroll the world backward + if player.rect.x <= backwardx: + scroll = backwardx - player.rect.x + player.rect.x = backwardx + for p in plat_list: + p.rect.x += scroll + for e in enemy_list: + e.rect.x += scroll + for l in loot_list: + l.rect.x += scroll -    world.blit(backdrop, backdropbox)     -    player.gravity() # check gravity -    player.update() -    player_list.draw(world) #refresh player position -    enemy_list.draw(world)  # refresh enemies -    ground_list.draw(world)  # refresh enemies -    plat_list.draw(world)   # refresh platforms -    loot_list.draw(world)   # refresh loot + world.blit(backdrop, backdropbox) + player.gravity() # check gravity + player.update() + player_list.draw(world) #refresh player position + enemy_list.draw(world) # refresh enemies + ground_list.draw(world) # refresh enemies + plat_list.draw(world) # refresh platforms + loot_list.draw(world) # refresh loot -    for e in enemy_list: -        e.move() -    pygame.display.flip() -    clock.tick(fps) + for e in enemy_list: + e.move() + pygame.display.flip() + clock.tick(fps) ``` -------------------------------------------------------------------------------- @@ -504,7 +504,7 @@ via: https://opensource.com/article/20/1/loot-python-platformer-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -513,12 +513,13 @@ via: https://opensource.com/article/20/1/loot-python-platformer-game [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_lovemoneyglory2.png?itok=AvneLxFp (Hearts, stars, and dollar signs) [2]: https://www.python.org/ [3]: https://www.pygame.org/news -[4]: https://opensource.com/article/17/10/python-101 -[5]: https://opensource.com/article/17/12/game-framework-python -[6]: https://opensource.com/article/17/12/game-python-add-a-player -[7]: https://opensource.com/article/17/12/game-python-moving-player -[8]: https://opensource.com/article/18/5/pygame-enemy -[9]: https://opensource.com/article/19/11/simulate-gravity-python -[10]: https://opensource.com/article/19/12/jumping-python-platformer-game -[11]: https://opensource.com/article/19/12/python-platformer-game-run +[4]: https://linux.cn/article-9071-1.html +[5]: https://linux.cn/article-10850-1.html +[6]: https://linux.cn/article-10858-1.html +[7]: https://linux.cn/article-10874-1.html +[8]: https://linux.cn/article-10883-1.html +[9]: https://linux.cn/article-11780-1.html +[10]: https://linux.cn/article-11790-1.html +[11]: https://linux.cn/article-11819-1.html [12]: https://opensource.com/sites/default/files/uploads/pygame-loot.jpg (Loot in Python platformer) +[13]: https://linux.cn/article-10902-1.html From d06326c26576a9d7ce26320c460952d6636a84c4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Jan 2020 13:13:05 +0800 Subject: [PATCH 135/285] PUB @heguangzhi https://linux.cn/article-11828-1.html --- .../20200102 Put some loot in your Python platformer game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200102 Put some loot in your Python platformer game.md (99%) diff --git a/translated/tech/20200102 Put some loot in your Python platformer game.md b/published/20200102 Put some loot in your Python platformer game.md similarity index 99% rename from translated/tech/20200102 Put some loot in your Python platformer game.md rename to published/20200102 Put some loot in your Python platformer game.md index a22c330ade..e379cc1307 100644 --- a/translated/tech/20200102 Put some loot in your Python platformer game.md +++ b/published/20200102 Put some loot in your Python platformer game.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11828-1.html) [#]: subject: (Put some loot in your Python platformer game) [#]: via: (https://opensource.com/article/20/1/loot-python-platformer-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From af91cf44c8ee8bc072f881fc87df0f9ea21a0953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Wed, 29 Jan 2020 13:34:30 +0800 Subject: [PATCH 136/285] Translated --- ...imezone in Ubuntu Linux -Beginner-s Tip.md | 130 ------------------ ...imezone in Ubuntu Linux -Beginner-s Tip.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md create mode 100644 translated/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md diff --git a/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md b/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md deleted file mode 100644 index 889155174e..0000000000 --- a/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Set or Change Timezone in Ubuntu Linux [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/change-timezone-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Set or Change Timezone in Ubuntu Linux [Beginner’s Tip] -====== - -[When you install Ubuntu][1], it asks you to set timezone. If you chose a wrong timezone or if you have moved to some other part of the world, you can easily change it later. - -### How to change Timezone in Ubuntu and other Linux distributions - -There are two ways to change the timezone in Ubuntu. You can use the graphical settings or use the timedatectl command in the terminal. You may also change the /etc/timezone file directly but I won’t advise that. - -I’ll show you both graphical and terminal way in this beginner’s tutorial: - - * [Change timezone in Ubuntu via GUI][2] (suitable for desktop users) - * [Change timezone in Ubuntu via command line][3] (works for both desktop and servers) - - - -![][4] - -#### Method 1: Change Ubuntu timezone via terminal - -[Ubuntu][5] or any other distributions using systemd can use the timedatectl command to set timezone in Linux terminal. - -You can check the current date and timezone setting using timedatectl command without any option: - -``` -[email protected]:~$ timedatectl - Local time: Sat 2020-01-18 17:39:52 IST - Universal time: Sat 2020-01-18 12:09:52 UTC - RTC time: Sat 2020-01-18 12:09:52 - Time zone: Asia/Kolkata (IST, +0530) - System clock synchronized: yes -systemd-timesyncd.service active: yes - RTC in local TZ: no -``` - -As you can see in the output above, my system uses Asia/Kolkata. It also tells me that it is 5:30 hours ahead of GMT. - -To set a timezone in Linux, you need to know the exact timezone. You must use the correct format of the timezone (which is Continent/City). - -To get the timezone list, use the _list-timezones_ option of _timedatectl_ command: - -``` -timedatectl list-timezones -``` - -It will show you a huge list of the available time zones. - -![Timezones List][6] - -You can use the up and down arrow or PgUp and PgDown key to move between the pages. - -You may also grep the output and search for your timezone. For example, if you are looking for time zones in Europe, you may use: - -``` -timedatectl list-timezones | grep -i europe -``` - -Let’s say you want to set the timezone to Paris. The timezone value to be used here is Europe/Paris: - -``` -timedatectl set-timezone Europe/Paris -``` - -It won’t show any success message but the timezone is changed instantly. You don’t need to restart or log out. - -Keep in mind that though you don’t need to become root user and use sudo with the command but your account still need to have admin rights in order to change the timezone. - -You can verify the changed time and timezone by using the [date command][7]: - -``` -[email protected]:~$ date -Sat Jan 18 13:56:26 CET 2020 -``` - -#### Method 2: Change Ubuntu timezone via GUI - -Press the super key (Windows key) and search for Settings: - -![Applications Menu Settings][8] - -Scroll down a little and look for Details in the left sidebar: - -![Go to Settings -> Details][9] - -In Details, you’ll fine Date & Time in the left sidebar. Here, you should turn off Automatic Time Zone option (if it is enabled) and then click on the Time Zone: - -![In Details -> Date & Time, turn off the Automatic Time Zone][10] - -When you click the Time Zone, it will open an interactive map and you can click on the geographical location of your choice and close the window. - -![Select a timezone][11] - -You don’t have to do anything other than closing this map after selecting the new timezone. No need to logout or [shutdown Ubuntu][12]. - -I hope this quick tutorial helped you to change timezone in Ubuntu and other Linux distributions. If you have questions or suggestions, please let me know. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/change-timezone-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://itsfoss.com/install-ubuntu/ -[2]: tmp.bHvVztzy6d#change-timezone-gui -[3]: tmp.bHvVztzy6d#change-timezone-command-line -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/Ubuntu_Change-_Time_Zone.png?ssl=1 -[5]: https://ubuntu.com/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/timezones_in_ubuntu.jpg?ssl=1 -[7]: https://linuxhandbook.com/date-command/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/settings_detail_ubuntu.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/change_timezone_in_ubuntu.jpg?ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/change_timezone_in_ubuntu_2.jpg?ssl=1 -[12]: https://itsfoss.com/schedule-shutdown-ubuntu/ diff --git a/translated/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md b/translated/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md new file mode 100644 index 0000000000..fb342a2101 --- /dev/null +++ b/translated/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Set or Change Timezone in Ubuntu Linux [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/change-timezone-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu Linux 中设置或更改时区 [初学者技巧] +====== + +[当你安装 Ubuntu 时][1],它要求你设置时区。如果你选择一个错误的时区,或者你移动到世界的一些其它地方,你可以很容易地在以后更改它。 + +### 如何在 Ubuntu 和其它 Linux 发行版中更改时区 + +这里有两种方法来更改 Ubuntu 中的时区。你可以使用图形化设置或在终端中使用 timedatectl 命令。你也可以直接更改 /etc/timezone 文件,但是我不建议这样做。 + +在这篇初学者教程中,我将向你展示图形化和终端两种方法: + + * [通过 GUI 更改 Ubuntu 中的时区][2] (适合桌面用户) + * [通过命令行更改 Ubuntu 中的时区][3] (桌面和服务器都工作) + + + +![][4] + +#### 方法 1: 通过终端更改 Ubuntu 时区 + +[Ubuntu][5] 或一些使用 systemd 的其它发行版可以在 Linux 终端中使用 timedatectl 命令来设置时区。 + +你可以使用没有任何参数的 timedatectl 命令来检查当前是日期和时区设置: + +``` +[email protected]:~$ timedatectl + Local time: Sat 2020-01-18 17:39:52 IST + Universal time: Sat 2020-01-18 12:09:52 UTC + RTC time: Sat 2020-01-18 12:09:52 + Time zone: Asia/Kolkata (IST, +0530) + System clock synchronized: yes +systemd-timesyncd.service active: yes + RTC in local TZ: no +``` + +正如你在上面的输出中所看,我的系统使用 Asia/Kolkata 。它也告诉我现在比世界时早 5 小时 30 分钟。 + +为在 Linux 中设置时区,你需要知道准确的时区。你必需使用时区的正确的格式 (时区格式是 大陆/城市)。 + +为获取时区列表,使用 _timedatectl_ 命令的 _list-timezones_ 参数: + +``` +timedatectl list-timezones +``` + +它将向你显示大量可用的时区列表。 + +![Timezones List][6] + +你可以使用向上箭头和向下箭头或 PgUp 和 PgDown 键来在页面之间移动。 + +你也可以 grep 输出,并搜索你的时区。例如,假如你正在寻找欧洲的时区,你可以使用: + +``` +timedatectl list-timezones | grep -i europe +``` + +比方说,你想设置时区为巴黎。在这里,使用的时区值的 Europe/Paris : + +``` +timedatectl set-timezone Europe/Paris +``` + +它虽然不显示任何成功信息,但是时区会立即更改。你不需要重新启动或注销。 + +记住,虽然你不需要成为 root 用户,并且对命令使用 sudo ,但是你的账户仍然需要拥有管理器权限来更改时区。 + +你可以使用 [date 命令][7] 来验证更改的时间好时区: + +``` +[email protected]:~$ date +Sat Jan 18 13:56:26 CET 2020 +``` + +#### 方法 2: 通过 GUI 更改 Ubuntu 时区 + +按下 super 键 (Windows 键) ,并搜索设置: + +![Applications Menu Settings][8] + +在左侧边栏中,向下滚动一点,查看详细信息: + +![Go to Settings -> Details][9] + +在详细信息中,你将在左侧边栏中找到 日期和时间 。在这里,你应该关闭自动时区选项(如果它已经被启用),然后在时区上单击: + +![In Details -> Date & Time, turn off the Automatic Time Zone][10] + +当你单击时区时,它将打开一个交互式地图,你可以在你选择的地理位置上单击,关闭窗口。 + +![Select a timezone][11] + +在选择新的时区后,除了关闭这个地图后,你不必做任何事情。不需要注销或 [关闭 Ubuntu][12] 。 + +我希望这篇快速教程能帮助你在 Ubuntu 和其它 Linux 发行版中更改时区。如果你有问题或建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-timezone-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-ubuntu/ +[2]: tmp.bHvVztzy6d#change-timezone-gui +[3]: tmp.bHvVztzy6d#change-timezone-command-line +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/Ubuntu_Change-_Time_Zone.png?ssl=1 +[5]: https://ubuntu.com/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/timezones_in_ubuntu.jpg?ssl=1 +[7]: https://linuxhandbook.com/date-command/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/settings_detail_ubuntu.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/change_timezone_in_ubuntu.jpg?ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/change_timezone_in_ubuntu_2.jpg?ssl=1 +[12]: https://itsfoss.com/schedule-shutdown-ubuntu/ From 7b5fd655ee61d5a9303f07ad4cd260ef95030884 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Jan 2020 14:10:13 +0800 Subject: [PATCH 137/285] PRF @laingke --- ... Linux logins using public-private keys.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md b/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md index 0e4a4de626..f98da38ced 100644 --- a/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md +++ b/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (laingke) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Setting up passwordless Linux logins using public/private keys) @@ -9,21 +9,24 @@ 使用公钥/私钥对设定免密的 Linux 登录方式 ====== -使用一组公钥/私钥对让你不需要密码登录到远程 Linux 系统或使用 ssh 运行命令,这会非常方便,但是设置过程有点复杂。下面是帮助你的方法和脚本。 + +> 使用一组公钥/私钥对让你不需要密码登录到远程 Linux 系统或使用 ssh 运行命令,这会非常方便,但是设置过程有点复杂。下面是帮助你的方法和脚本。 + +![](https://images.idgesg.net/images/article/2020/01/cso_lock_question_mark-shaped_keyhole_amid_binary_network_circuits_digital_transformation_by_ivanastar_getty_images_1200x800-100826595-large.jpg) 在 [Linux][1] 系统上设置一个允许你无需密码即可远程登录或运行命令的帐户并不难,但是要使它正常工作,你还需要掌握一些繁琐的细节。在本文,我们将完成整个过程,然后给出一个可以帮助处理琐碎细节的脚本。 -设置好之后,如果希望在脚本中运行 ssh 命令,尤其是希望配置自动运行的命令,那么免密访问特别有用。 +设置好之后,如果希望在脚本中运行 `ssh` 命令,尤其是希望配置自动运行的命令,那么免密访问特别有用。 需要注意的是,你不需要在两个系统上使用相同的用户帐户。实际上,你可以把公用密钥用于系统上的多个帐户或多个系统上的不同帐户。 设置方法如下。 -### which system to start on?在哪个系统上启动? +### 在哪个系统上启动? -首先,你需要从要发出命令的系统上着手。那就是你用来创建 ssh 密钥的系统。你还需要访问远程系统上的帐户并在其上运行这些命令。 +首先,你需要从要发出命令的系统上着手。那就是你用来创建 `ssh` 密钥的系统。你还需要可以访问远程系统上的帐户并在其上运行这些命令。 -为了使角色清晰明了,我们将场景中的第一个系统称为“boss”,因为它将发出要在另一个系统上运行的命令。 +为了使角色清晰明了,我们将场景中的第一个系统称为 “boss”,因为它将发出要在另一个系统上运行的命令。 因此,命令提示符如下: @@ -31,7 +34,7 @@ boss$ ``` -如果您还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用RSA或DSA。)注意,要在不输入密码的情况下访问系统,您需要在下面的对话框中输入两个提示符的密码。 +如果你还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用 RSA 或 DSA。)注意,要在不输入密码的情况下访问系统,你需要在下面的对话框中的两个提示符出不输入密码。 如果你已经有一个与此帐户关联的公钥/私钥对,请跳过此步骤。 @@ -59,18 +62,18 @@ The key's randomart image is: +----[SHA256]-----+ ``` -上面显示的命令将创建公钥和私钥。其中公钥用于加密,私钥用于解密。因此,这些密钥之间的关系是关键的,私有密钥**绝不**应该被共享。相反,它应该保存在 boss 系统的 .ssh 文件夹中。 +上面显示的命令将创建公钥和私钥。其中公钥用于加密,私钥用于解密。因此,这些密钥之间的关系是关键的,私有密钥**绝不**应该被共享。相反,它应该保存在 boss 系统的 `.ssh` 文件夹中。 -注意,在创建时,你的公钥和私钥将会保存在 .ssh 文件夹中。 +注意,在创建时,你的公钥和私钥将会保存在 `.ssh` 文件夹中。 -下一步是将**公钥**复制到你希望从 boss 系统免密访问的系统。你可以使用 **scp** 命令来完成此操作,但此时你仍然需要输入密码。在本例中,该系统称为“target”。 +下一步是将**公钥**复制到你希望从 boss 系统免密访问的系统。你可以使用 `scp` 命令来完成此操作,但此时你仍然需要输入密码。在本例中,该系统称为 “target”。 ``` boss$ scp .ssh/id_rsa.pub myacct@target:/home/myaccount myacct@target's password: ``` -你需要安装公钥在 target 系统(将运行命令的系统)上。如果你没有 .ssh 目录(例如,你从未在该系统上使用过 ssh),运行这样的命令将为你设置一个目录: +你需要安装公钥在 target 系统(将运行命令的系统)上。如果你没有 `.ssh` 目录(例如,你从未在该系统上使用过 `ssh`),运行这样的命令将为你设置一个目录: ``` target$ ssh localhost date @@ -81,20 +84,20 @@ drwxr-xr-x 6 myacct myacct 4096 Jan 19 11:49 .. -rw-r--r-- 1 myacct myacct 222 Jan 19 11:48 known_hosts ``` -仍然在目标系统上,你需要将从“boss”系统传输的公钥添加到 .ssh/authorized_keys 文件中。如果密钥已经存在,使用下面的命令将把它添加到文件的末尾;如果文件不存在,则创建文件并添加密钥。 +仍然在目标系统上,你需要将从“boss”系统传输的公钥添加到 `.ssh/authorized_keys` 文件中。如果该文件已经存在,使用下面的命令将把它添加到文件的末尾;如果文件不存在,则创建该文件并添加密钥。 ``` target$ cat id_rsa.pub >> .ssh/authorized_keys ``` -下一步,你需要确保你的 authorized_keys 文件权限为 600。如果还不是,执行命令 ```chmod 600 .ssh/authorized_keys```。 +下一步,你需要确保你的 `authorized_keys` 文件权限为 600。如果还不是,执行命令 `chmod 600 .ssh/authorized_keys`。 ``` target$ ls -l authorized_keys -rw------- 1 myself myself 569 Jan 19 12:10 authorized_keys ``` -还要检查目标系统上 .ssh 目录的权限是否设置为 700。如果需要,执行 ```chmod 700 .ssh``` 命令修改权限。 +还要检查目标系统上 `.ssh` 目录的权限是否设置为 700。如果需要,执行 `chmod 700 .ssh` 命令修改权限。 ``` target$ ls -ld .ssh @@ -177,7 +180,7 @@ $ ssh lola@fruitfly [lola@fruitfly ~]$ ``` -一旦设置了免密登录,你就可以不需要键入密码从 boss 系统登录到 target 系统,并且运行任意的 ssh 命令。以这种免密的方式运行并不意味着你的帐户不安全。然而,根据target 系统的性质,保护您在 boss 系统上的密码可能变得更加重要。 +一旦设置了免密登录,你就可以不需要键入密码从 boss 系统登录到 target 系统,并且运行任意的 `ssh` 命令。以这种免密的方式运行并不意味着你的帐户不安全。然而,根据 target 系统的性质,保护你在 boss 系统上的密码可能变得更加重要。 -------------------------------------------------------------------------------- @@ -186,7 +189,7 @@ via: https://www.networkworld.com/article/3514607/setting-up-passwordless-linux- 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[laingke](https://github.com/laingke) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 54dd9dd0eed1a89660ae71ce071c8a1200cca6eb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 29 Jan 2020 14:12:08 +0800 Subject: [PATCH 138/285] Rename sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md to sources/talk/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md --- ...erstanding your organization-s approach to new technologies.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md (100%) diff --git a/sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md b/sources/talk/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md similarity index 100% rename from sources/tech/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md rename to sources/talk/20200128 Communication superstars- A model for understanding your organization-s approach to new technologies.md From b627720a648e4335aa840f6a4ebe3aec7ff7026f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Jan 2020 14:14:07 +0800 Subject: [PATCH 139/285] PUB @laingke https://linux.cn/article-11830-1.html --- ...p passwordless Linux logins using public-private keys.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200122 Setting up passwordless Linux logins using public-private keys.md (97%) diff --git a/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md b/published/20200122 Setting up passwordless Linux logins using public-private keys.md similarity index 97% rename from translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md rename to published/20200122 Setting up passwordless Linux logins using public-private keys.md index f98da38ced..89f54a6b45 100644 --- a/translated/tech/20200122 Setting up passwordless Linux logins using public-private keys.md +++ b/published/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (laingke) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11830-1.html) [#]: subject: (Setting up passwordless Linux logins using public/private keys) [#]: via: (https://www.networkworld.com/article/3514607/setting-up-passwordless-linux-logins-using-publicprivate-keys.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) @@ -12,7 +12,7 @@ > 使用一组公钥/私钥对让你不需要密码登录到远程 Linux 系统或使用 ssh 运行命令,这会非常方便,但是设置过程有点复杂。下面是帮助你的方法和脚本。 -![](https://images.idgesg.net/images/article/2020/01/cso_lock_question_mark-shaped_keyhole_amid_binary_network_circuits_digital_transformation_by_ivanastar_getty_images_1200x800-100826595-large.jpg) +![](https://img.linux.net.cn/data/attachment/album/202001/29/141343ldps4muy4kp64k4l.jpg) 在 [Linux][1] 系统上设置一个允许你无需密码即可远程登录或运行命令的帐户并不难,但是要使它正常工作,你还需要掌握一些繁琐的细节。在本文,我们将完成整个过程,然后给出一个可以帮助处理琐碎细节的脚本。 From e10ed7653fff555d5287cc9abcfac109bee1197f Mon Sep 17 00:00:00 2001 From: laingke Date: Wed, 29 Jan 2020 17:22:45 +0800 Subject: [PATCH 140/285] 20200102-javastream translated --- ...ming and functional programming in Java.md | 496 ------------------ ...ming and functional programming in Java.md | 455 ++++++++++++++++ 2 files changed, 455 insertions(+), 496 deletions(-) delete mode 100644 sources/tech/20200102 Data streaming and functional programming in Java.md create mode 100644 translated/tech/20200102 Data streaming and functional programming in Java.md diff --git a/sources/tech/20200102 Data streaming and functional programming in Java.md b/sources/tech/20200102 Data streaming and functional programming in Java.md deleted file mode 100644 index c3e914001b..0000000000 --- a/sources/tech/20200102 Data streaming and functional programming in Java.md +++ /dev/null @@ -1,496 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (laingke) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Data streaming and functional programming in Java) -[#]: via: (https://opensource.com/article/20/1/javastream) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Data streaming and functional programming in Java -====== -Learn how to use the stream API and functional programming constructs in -Java 8. -![computer screen ][1] - -When Java SE 8 (aka core Java 8) was introduced in 2014, it introduced changes that fundamentally impact programming in it. The changes have two closely linked parts: the stream API and the functional programming constructs. This article uses code examples, from the basics through advanced features, to introduce each part and illustrate the interplay between them. - -### The basics - -The stream API is a concise and high-level way to iterate over the elements in a data sequence. The packages **java.util.stream** and **java.util.function** house the new libraries for the stream API and related functional programming constructs. Of course, a code example is worth a thousand words. - -The code segment below populates a **List** with about 2,000 random integer values: - - -``` -[Random][2] rand = new [Random][2](); -List<Integer> list = new ArrayList<Integer>();           // empty list -for (int i = 0; i < 2048; i++) list.add(rand.nextInt()); // populate it -``` - -Another **for** loop could be used to iterate over the populated list to collect the even values into another list. The stream API is a cleaner way to do the same: - - -``` -[List][3] <Integer> evens = list -   .stream()                      // streamify the list -   .filter(n -> (n & 0x1) == 0)   // filter out odd values -   .collect(Collectors.toList()); // collect even values -``` - -The example has three functions from the stream API: - - * The **stream** function can turn a **Collection** into a stream, which is a conveyor belt of values accessible one at a time. The streamification is lazy (and therefore efficient) in that the values are produced as needed rather than all at once. - - * The **filter** function determines which streamed values, if any, get through to the next stage in the processing pipeline, the **collect** stage. The **filter** function is _higher-order_ in that its argument is a function—in this example, a lambda, which is an unnamed function and at the center of Java's new functional programming constructs. - -The lambda syntax departs radically from traditional Java: - - -``` -`n -> (n & 0x1) == 0` -``` - -The arrow (a minus sign followed immediately by a greater-than sign) separates the argument list on the left from the function's body on the right. The argument **n** is not explicitly typed, although it could be; in any case, the compiler figures out that **n** is an **Integer**. If there were multiple arguments, these would be enclosed in parentheses and separated by commas. - -The body, in this example, checks whether an integer's lowest-order (rightmost) bit is a zero, which indicates an even value. A filter should return a boolean value. There is no explicit **return** in the function's body, although there could be. If the body has no explicit **return**, then the body's last expression is the returned value. In this example, written in the spirit of lambda programming, the body consists of the single, simple boolean expression **(n & 0x1) == 0**. - - * The **collect** function gathers the even values into a list whose reference is **evens**. As an example below illustrates, the **collect** function is thread-safe and, therefore, would work correctly even if the filtering operation was shared among multiple threads. - - - - -### Convenience functions and easy multi-threading - -In a production environment, a data stream might have a file or a network connection as its source. For learning the stream API, Java provides types such as **IntStream**, which can generate streams with elements of various types. Here is an **IntStream** example: - - -``` -IntStream                         // integer stream -   .range(1, 2048)                // generate a stream of ints in this range -   .parallel()                    // partition the data for multiple threads -   .filter(i -> ((i & 0x1) > 0))  // odd parity? pass through only odds -   .forEach([System][4].out::println); // print each -``` - -The **IntStream** type includes a **range** function that generates a stream of integer values within a specified range, in this case, from 1 through 2,048, with increments of 1. The **parallel** function automatically partitions the work to be done among multiple threads, each of which does the filtering and printing. (The number of threads typically matches the number of CPUs on the host system.) The argument to the **forEach** function is a _method reference_, in this case, a reference to the **println** method encapsulated in **System.out**, which is of type **PrintStream**. The syntax for method and constructor references will be discussed shortly. - -Because of the multi-threading, the integer values are printed in an arbitrary order overall but in sequence within a given thread. For example, if thread T1 prints 409 and 411, then T1 does so in the order 409–411, but some other thread might print 2,045 beforehand. The threads behind the **parallel** call execute concurrently, and the order of their output is therefore indeterminate. - -### The map/reduce pattern - -The _map/reduce_ pattern has become popular in processing large datasets. A map/reduce macro operation is built from two micro-operations. The data first are scattered (_mapped_) among various workers, and the separate results then are gathered together—perhaps as a single value, which would be the _reduction_. Reduction can take different forms, as the following examples illustrate. - -Instances of the **Number** class below represent integer values with either **EVEN** or **ODD** parity: - - -``` -public class [Number][5] { -    enum Parity { EVEN, ODD } -    private int value; -    public [Number][5](int n) { setValue(n); } -    public void setValue(int value) { this.value = value; } -    public int getValue() { return this.value; } -    public Parity getParity() { -        return ((value & 0x1) == 0) ? Parity.EVEN : Parity.ODD; -    } -    public void dump() { -        [System][4].out.format("Value: %2d (parity: %s)\n", getValue(), -                          (getParity() == Parity.ODD ? "odd" : "even")); -    } -} -``` - -The following code illustrates map/reduce with a **Number** stream, thereby showing that the stream API can handle not only primitive types such as **int** and **float** but programmer-defined class types as well. - -In the code segment below, a list of random integer values is streamified using the **parallelStream** rather than the **stream** function. The **parallelStream** variant, like the **parallel** function introduced earlier, does automatic multithreading. - - -``` -final int howMany = 200; -[Random][2] r = new [Random][2](); -[Number][5][ ] nums = new [Number][5][howMany]; -for (int i = 0; i < howMany; i++) nums[i] = new [Number][5](r.nextInt(100)); -List<Number> listOfNums = [Arrays][6].asList(nums);  // listify the array - -[Integer][7] sum4All = listOfNums -   .parallelStream()           // automatic multi-threading -   .mapToInt([Number][5]::getValue) // method reference rather than lambda -   .sum();                     // reduce streamed values to a single value -[System][4].out.println("The sum of the randomly generated values is: " + sum4All); -``` - -The higher-order **mapToInt** function could take a lambda as an argument, but in this case, it takes a method reference instead, which is **Number::getValue**. The **getValue** method expects no arguments and returns its **int** value for a given **Number** instance. The syntax is uncomplicated: the class name **Number** followed by a double colon and the method's name. Recall the earlier **System.out::println** example, which has the double colon after the **static** field **out** in the **System** class. - -The method reference **Number::getValue** could be replaced by the lambda below. The argument **n** is one of the **Number** instances in the stream: - - -``` -`mapToInt(n -> n.getValue())` -``` - -In general, lambdas and method references are interchangeable: if a higher-order function such as **mapToInt** can take one form as an argument, then this function could take the other as well. The two functional programming constructs have the same purpose—to perform some customized operation on data passed in as arguments. Choosing between the two is often a matter of convenience. For example, a lambda can be written without an encapsulating class, whereas a method cannot. My habit is to use a lambda unless the appropriate encapsulated method is already at hand. - -The **sum** function at the end of the current example does the reduction in a thread-safe manner by combining the partial sums from the **parallelStream** threads. However, the programmer is responsible for ensuring that, in the course of the multi-threading induced by the **parallelStream** call, the programmer's own function calls (in this case, to **getValue**) are thread-safe. - -The last point deserves emphasis. Lambda syntax encourages the writing of _pure functions_, which are functions whose return values depend only on the arguments, if any, passed in; a pure function has no side effects such as updating a **static** field in a class. Pure functions are thereby thread-safe, and the stream API works best if the functional arguments passed to higher-order functions, such as **filter** and **map**, are pure functions. - -For finer-grained control, there is another stream API function, named **reduce**, that could be used for summing the values in the **Number** stream: - - -``` -[Integer][7] sum4AllHarder = listOfNums -   .parallelStream()                           // multi-threading -   .map([Number][5]::getValue)                      // value per Number -   .reduce(0, (sofar, next) -> sofar + next);  // reduction to a sum -``` - -This version of the **reduce** function takes two arguments, the second of which is a function: - - * The first argument (in this case, zero) is the _identity_ value, which serves as the initial value for the reduction operation and as the default value should the stream run dry during the reduction. - * The second argument is the _accumulator_, in this case, a lambda with two arguments: the first argument (**sofar**) is the running sum, and the second argument (**next**) is the next value from the stream. The running sum and next value then are added to update the accumulator. Keep in mind that both the **map** and the **reduce** functions now execute in a multi-threaded context because of the **parallelStream** call at the start. - - - -In the examples so far, stream values are collected and then reduced, but, in general, the **Collectors** in the stream API can accumulate values without reducing them to a single value. The collection activity can produce arbitrarily rich data structures, as the next code segment illustrates. The example uses the same **listOfNums** as the preceding examples: - - -``` -Map<[Number][5].Parity, List<Number>> numMap = listOfNums -   .parallelStream() -   .collect(Collectors.groupingBy([Number][5]::getParity)); - -List<Number> evens = numMap.get([Number][5].Parity.EVEN); -List<Number> odds = numMap.get([Number][5].Parity.ODD); -``` - -The **numMap** in the first line refers to a **Map** whose key is a **Number** parity (**ODD** or **EVEN**) and whose value is a **List** of **Number** instances with values having the designated parity. Once again, the processing is multi-threaded through the **parallelStream** call, and the **collect** call then assembles (in a thread-safe manner) the partial results into the single **Map** to which **numMap** refers. The **get** method then is called twice on the **numMap**, once to get the **evens** and a second time to get the **odds**. - -The utility function **dumpList** again uses the higher-order **forEach** function from the stream API: - - -``` -private void dumpList([String][8] msg, List<Number> list) { -   [System][4].out.println("\n" + msg); -   list.stream().forEach(n -> n.dump()); // or: forEach(Number::dump) -} -``` - -Here is a slice of the program's output from a sample run: - - -``` -The sum of the randomly generated values is: 3322 -The sum again, using a different method:     3322 - -Evens: - -Value: 72 (parity: even) -Value: 54 (parity: even) -... -Value: 92 (parity: even) - -Odds: - -Value: 35 (parity: odd) -Value: 37 (parity: odd) -... -Value: 41 (parity: odd) -``` - -### Functional constructs for code simplification - -Functional constructs, such as method references and lambdas, fit nicely into the stream API. These constructs represent a major simplification of higher-order functions in Java. Even in the bad old days, Java technically supported higher-order functions through the **Method** and **Constructor** types, instances of which could be passed as arguments to other functions. These types were used—but rarely in production-grade Java precisely because of their complexity. Invoking a **Method**, for example, requires either an object reference (if the method is non-**static**) or at least a class identifier (if the method is **static**). The arguments for the invoked **Method** then are passed to it as **Object** instances, which may require explicit downcasting if polymorphism (another complexity!) is not in play. By contrast, lambdas and method references are easy to pass as arguments to other functions. - -The new functional constructs have uses beyond the stream API, however. Consider a Java GUI program with a button for the user to push, for example, to get the current time. The event handler for the button push might be written as follows: - - -``` -[JButton][9] updateCurrentTime = new [JButton][9]("Update current time"); -updateCurrentTime.addActionListener(new [ActionListener][10]() { -   @Override -   public void actionPerformed([ActionEvent][11] e) { -      currentTime.setText(new [Date][12]().toString()); -   } -}); -``` - -This short code segment is a challenge to explain. Consider the second line in which the argument to the method **addActionListener** begins as follows: - - -``` -`new ActionListener() {` -``` - -This seems wrong in that **ActionListener** is an **abstract** interface, and **abstract** types cannot be instantiated with a call to **new**. However, it turns out that something else entirely is being instantiated: an unnamed inner class that implements this interface. If the code above were encapsulated in a class named **OldJava**, then this unnamed inner class would be compiled as **OldJava$1.class**. The **actionPerformed** method is overridden in the unnamed inner class. - -Now consider this refreshing change with the new functional constructs: - - -``` -`updateCurrentTime.addActionListener(e -> currentTime.setText(new Date().toString()));` -``` - -The argument **e** in the lambda is an **ActionEvent** instance, and the lambda's body is a simple call to **setText** on the button. - -### Functional interfaces and composition - -The lambdas used so far have been written in place. For convenience, however, there can be references to lambdas just as there are to encapsulated methods. The following series of short examples illustrate this. - -Consider this interface definition: - - -``` -@FunctionalInterface // optional, usually omitted -interface BinaryIntOp { -    abstract int compute(int arg1, int arg2); // abstract could be dropped -} -``` - -The annotation **@FunctionalInterface** applies to any interface that declares a _single_ abstract method; in this case, **compute**. Several standard interfaces (e.g., the **Runnable** interface with its single declared method, **run**) fit the bill. In this example, **compute** is the declared method. The interface can be used as the target type in a reference declaration: - - -``` -BinaryIntOp div = (arg1, arg2) -> arg1 / arg2; -div.compute(12, 3); // 4 -``` - -The package **java.util.function** provides various functional interfaces. Some examples follow. - -The code segment below introduces the parameterized **Predicate** functional interface. In this example, the type **Predicate<String>** with parameter **String** can refer to either a lambda with a **String** argument or a **String** method such as **isEmpty**. In general, a _predicate_ is a function that returns a boolean value. - - -``` -Predicate<String> pred = [String][8]::isEmpty; // predicate for a String method -[String][8][ ] strings = {"one", "two", "", "three", "four"}; -[Arrays][6].asList(strings) -   .stream() -   .filter(pred)                  // filter out non-empty strings -   .forEach([System][4].out::println); // only the empty string is printed -``` - -The **isEmpty** predicate evaluates to **true** just in case a string's length is zero; hence, only the empty string makes it through to the **forEach** stage in the pipeline. - -The next code segments illustrate how simple lambdas or method references can be composed into richer ones. Consider this series of assignments to references of the **IntUnaryOperator** type, which takes an integer argument and returns an integer value: - - -``` -IntUnaryOperator doubled = n -> n * 2; -IntUnaryOperator tripled = n -> n * 3; -IntUnaryOperator squared = n -> n * n; -``` - -**IntUnaryOperator** is a **FunctionalInterface** whose single declared method is **applyAsInt**. The three references **doubled**, **tripled**, and **squared** now can be used standalone or in various compositions: - - -``` -int arg = 5; -doubled.applyAsInt(arg); // 10 -tripled.applyAsInt(arg); // 15 -squared.applyAsInt(arg); // 25 -``` - -Here are some sample compositions: - - -``` -int arg = 5; -doubled.compose(squared).applyAsInt(arg); // doubled-the-squared: 50 -tripled.compose(doubled).applyAsInt(arg); // tripled-the-doubled: 30 -doubled.andThen(squared).applyAsInt(arg); // doubled-andThen-squared: 100 -squared.andThen(tripled).applyAsInt(arg); // squared-andThen-tripled: 75 -``` - -Compositions could be done with in-place lambdas, but the references make the code cleaner. - -### Constructor references - -Constructor references are yet another of the functional programming constructs, but these references are useful in more subtle contexts than lambdas and method references. Once again, a code example seems the best way to clarify. - -Consider this [POJO][13] class: - - -``` -public class BedRocker { // resident of Bedrock -    private [String][8] name; -    public BedRocker([String][8] name) { this.name = name; } -    public [String][8] getName() { return this.name; } -    public void dump() { [System][4].out.println(getName()); } -} -``` - -The class has a single constructor, which requires a **String** argument. Given an array of names, the goal is to generate an array of **BedRocker** elements, one per name. Here is the code segment that uses functional constructs to do so: - - -``` -[String][8][ ] names = {"Fred", "Wilma", "Peebles", "Dino", "Baby Puss"}; - -Stream<BedRocker> bedrockers = [Arrays][6].asList(names).stream().map(BedRocker::new); -BedRocker[ ] arrayBR = bedrockers.toArray(BedRocker[]::new); - -[Arrays][6].asList(arrayBR).stream().forEach(BedRocker::dump); -``` - -At a high level, this code segment transforms names into **BedRocker** array elements. In detail, the code works as follows. The **Stream** interface (in the package **java.util.stream**) can be parameterized, in this case, to generate a stream of **BedRocker** items named **bedrockers**. - -The **Arrays.asList** utility again is used to streamify an array, **names**, with each stream item then passed to the **map** function whose argument now is the constructor reference **BedRocker::new**. This constructor reference acts as an object factory by generating and initializing, on each call, a **BedRocker** instance. After the second line executes, the stream named **bedrockers** consists of five **BedRocker** items. - -The example can be clarified further by focusing on the higher-order **map** function. In a typical case, a mapping transforms a value of one type (e.g., an **int**) into a different value of the _same_ type (e.g., an integer's successor): - - -``` -`map(n -> n + 1) // map n to its successor` -``` - -In the **BedRocker** example, however, the transformation is more dramatic because a value of one type (a **String** representing a name) is mapped to a value of a _different_ type, in this case, a **BedRocker** instance with the string as its name. The transformation is done through a constructor call, which is enabled by the constructor reference: - - -``` -`map(BedRocker::new) // map a String to a BedRocker` -``` - -The value passed to the constructor is one of the names in the **names** array. - -The second line of this code example also illustrates the by-now-familiar transformation of an array first into a **List** and then into a **Stream**: - - -``` -`Stream bedrockers = Arrays.asList(names).stream().map(BedRocker::new);` -``` - -The third line goes the other way—the stream **bedrockers** is transformed into an array by invoking the **toArray** method with the _array_ constructor reference **BedRocker[]::new**: - - -``` -`BedRocker[ ] arrayBR = bedrockers.toArray(BedRocker[]::new);` -``` - -This constructor reference does not create a single **BedRocker** instance, but rather an entire array of these: the constructor reference is now **BedRocker[]::new** rather than **BedRocker::new**. For confirmation, the **arrayBR** is transformed into a **List**, which again is streamified so that **forEach** can be used to print the **BedRocker** names: - - -``` -Fred -Wilma -Peebles -Dino -Baby Puss -``` - -The example's subtle transformations of data structures are done with but few lines of code, underscoring the power of various higher-order functions that can take a lambda, a method reference, or a constructor reference as an argument - -### Currying - -To _curry_ a function is to reduce (typically by one) the number of explicit arguments required for whatever work the function does. (The term honors the logician Haskell Curry.) In general, functions are easier to call and are more robust if they have fewer arguments. (Recall some nightmarish function that expects a half-dozen or so arguments!) Accordingly, currying should be seen as an effort to simplify a function call. The interface types in the **java.util.function** package are suited for currying, as the next example shows. - -References of the **IntBinaryOperator** interface type are for functions that take two integer arguments and return an integer value: - - -``` -IntBinaryOperator mult2 = (n1, n2) -> n1 * n2; -mult2.applyAsInt(10, 20); // 200 -mult2.applyAsInt(10, 30); // 300 -``` - -The reference name **mult2** underscores that two explicit arguments are required, in this example, 10 and 20. - -The previously introduced **IntUnaryOperator** is simpler than an **IntBinaryOperator** because the former requires just one argument, whereas the latter requires two arguments. Both return an integer value. The goal, therefore, is to curry the two-argument **IntBinraryOperator** named **mult2** into a one-argument **IntUnaryOperator** version **curriedMult2**. - -Consider the type **IntFunction<R>**. A function of this type takes an integer argument and returns a result of type **R**, which could be another function—indeed, an **IntBinaryOperator**. Having a lambda return another lambda is straightforward: - - -``` -`arg1 -> (arg2 -> arg1 * arg2) // parentheses could be omitted` -``` - -The full lambda starts with **arg1,** and this lambda's body—and returned value—is another lambda, which starts with **arg2**. The returned lambda takes just one argument (**arg2**) but returns the product of two numbers (**arg1** and **arg2**). The following overview, followed by the code, should clarify. - -Here is an overview of how **mult2** can be curried: - - * A lambda of type **IntFunction<IntUnaryOperator>** is written and called with an integer value such as 10. The returned **IntUnaryOperator** caches the value 10 and thereby becomes the curried version of **mult2**, in this example, **curriedMult2**. - * The **curriedMult2** function then is called with a single explicit argument (e.g., 20), which is multiplied with the cached argument (in this case, 10) to produce the product returned. - - - -Here are the details in code: - - -``` -// Create a function that takes one argument n1 and returns a one-argument -// function n2 -> n1 * n2 that returns an int (the product n1 * n2). -IntFunction<IntUnaryOperator> curriedMult2Maker = n1 -> (n2 -> n1 * n2); -``` - -Calling the **curriedMult2Maker** generates the desired **IntUnaryOperator** function: - - -``` -// Use the curriedMult2Maker to get a curried version of mult2. -// The argument 10 is n1 from the lambda above. -IntUnaryOperator curriedMult2 = curriedMult2Maker2.apply(10); -``` - -The value 10 is now cached in the **curriedMult2** function so that the explicit integer argument in a **curriedMult2** call will be multiplied by 10: - - -``` -curriedMult2.applyAsInt(20); // 200 = 10 * 20 -curriedMult2.applyAsInt(80); // 800 = 10 * 80 -``` - -The cached value can be changed at will: - - -``` -curriedMult2 = curriedMult2Maker.apply(50); // cache 50 -curriedMult2.applyAsInt(101);               // 5050 = 101 * 50 -``` - -Of course, multiple curried versions of **mult2**, each an **IntUnaryOperator**, can be created in this way. - -Currying takes advantage of a powerful feature about lambdas: a lambda is easily written to return whatever type of value is needed, including another lambda. - -### Wrapping up - -Java remains a class-based object-oriented programming language. But with the stream API and its supporting functional constructs, Java takes a decisive (and welcomed) step toward functional languages such as Lisp. The result is a Java better suited to process the massive data streams so common in modern programming. This step in the functional direction also makes it easier to write clear, concise Java in the pipeline style highlighted in previous code examples: - - -``` -dataStream -   .parallelStream() // multi-threaded for efficiency -   .filter(...)      // stage 1 -   .map(...)         // stage 2 -   .filter(...)      // stage 3 -   ... -   .collect(...);    // or, perhaps, reduce: stage N -``` - -The automatic multi-threading, illustrated with the **parallel** and **parallelStream** calls, is built upon Java's fork/join framework, which supports _task stealing_ for efficiency. Suppose that the thread pool behind a **parallelStream** call consists of eight threads and that the **dataStream** is partitioned eight ways. Some thread (e.g., T1) might work faster than another (e.g., T7), which means that some of T7's tasks ought to be moved into T1's work queue. This happens automatically at runtime. - -The programmer's chief responsibility in this easy multi-threading world is to write thread-safe functions passed as arguments to the higher-order functions that dominate in the stream API. Lambdas, in particular, encourage the writing of pure—and, therefore, thread-safe—functions. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/javastream - -作者:[Marty Kalin][a] -选题:[lujun9972][b] -译者:[laingke](https://github.com/laingke) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/features_solutions_command_data.png?itok=4_VQN3RK (computer screen ) -[2]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+random -[3]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+list -[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+number -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+arrays -[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+integer -[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jbutton -[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionlistener -[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionevent -[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+date -[13]: https://en.wikipedia.org/wiki/Plain_old_Java_object diff --git a/translated/tech/20200102 Data streaming and functional programming in Java.md b/translated/tech/20200102 Data streaming and functional programming in Java.md new file mode 100644 index 0000000000..fe114a73ef --- /dev/null +++ b/translated/tech/20200102 Data streaming and functional programming in Java.md @@ -0,0 +1,455 @@ +[#]: collector: (lujun9972) +[#]: translator: (laingke) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data streaming and functional programming in Java) +[#]: via: (https://opensource.com/article/20/1/javastream) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Java 中的数据流和函数式编程 +====== +学习如何使用 Java 8 中的流 API 和函数式编程结构。 +![computer screen ][1] + +当 Java SE 8(又名核心 Java 8)在 2014 年被推出时,它引入了一些从根本上影响 IT 编程的更改。这些更改中有两个紧密相连的部分:流API和功能编程构造。本文使用代码示例,从基础到高级特性,介绍每个部分并说明它们之间的相互作用。 + +### 基础特性 + +流 API 是在数据序列中迭代元素的简洁而高级的方法。包 `java.util.stream` 和 `java.util.function` 包含用于流 API 和相关函数式编程构造的新库。当然,一个代码示例胜过千言万语。 + +下面的代码段用大约 2,000 个随机整数值填充了一个 `List`: + +``` +Random rand = new Random2(); +List list = new ArrayList(); // 空 list +for (int i = 0; i < 2048; i++) list.add(rand.nextInt()); // 填充它 +``` + +另一个 `for` 循环可用于遍历填充 list,以将偶数值收集到另一个 list 中。流 API 提供了一种更简洁的方法来执行此操作: + +``` +List evens = list + .stream() // 流化 list + .filter(n -> (n & 0x1) == 0) // 过滤出奇数值 + .collect(Collectors.toList()); // 收集偶数值 +``` + +这个例子有三个来自流 API 的函数: + +> `stream` 函数可以将**集合**转换为流,而流是一个每次可访问一个值的传送带。流化是惰性的(因此也是高效的),因为值是根据需要产生的,而不是一次性产生的。 + +> `filter` 函数确定哪些流的值(如果有的话)通过了处理管道中的下一个阶段,即 `collect` 阶段。`filter` 函数是 _高阶的higher-order_,因为它的参数是一个函数 —— 在这个例子中是一个 lambda 表达式,它是一个未命名的函数,并且是 Java 新的函数式编程结构的核心。 + +lambda 语法与传统的 Java 完全不同: + +``` +`n -> (n & 0x1) == 0` +``` + +箭头(一个减号后面紧跟着一个大于号)将左边的参数列表与右边的函数体分隔开。参数 `n` 虽未明确输入,但可以显式输入。在任何情况下,编译器都会计算出 `n` 是 `Integer`。如果有多个参数,这些参数将被括在括号中,并用逗号分隔。 + +在本例中,函数体检查一个整数的最低顺序(最右)位是否为零,以表示为偶数。过滤器应返回一个布尔值。尽管可以,但函数的主体中没有显式的 `return`。如果主体没有显式的 `return`,则主体的最后一个表达式是返回值。在这个例子中,主体按照 lambda 编程的思想编写,由一个简单的布尔表达式 `(n & 0x1) == 0` 组成。 + +> `collect` 函数将偶数值收集到引用为 `evens` 的 list 中。如下例所示,`collect` 函数是线程安全的,因此,即使在多个线程之间共享了过滤操作,该函数也可以正常工作。 + +### 方便的功能和轻松实现多线程 + +在生产环境中,数据流的源可能是文件或网络连接。为了学习流 API, Java 提供了诸如 `IntStream` 这样的类型,它可以用各种类型的元素生成流。这里有一个 `IntStream` 的例子: + +``` +IntStream // 整型流 + .range(1, 2048) // 生成此范围内的整型流 + .parallel() // 为多个线程分区数据 + .filter(i -> ((i & 0x1) > 0)) // 奇偶校验 - 只允许奇数通过 + .forEach(System.out::println); // 打印每个值 +``` + +`IntStream` 类型包括一个 `range` 函数,该函数在指定的范围内生成一个整数值流,在本例中,以 1 为增量,从 1 递增到 2,048。`parallel` 函数自动工作划分到多个线程中,在各个线程中进行过滤和打印。(线程数通常与主机系统上的 CPU 数量匹配。)函数 `forEach` 参数是一个_方法引用_,在本例中是对封装在 `System.out` 中的 `println` 方法的引用,方法输出类型为 `PrintStream`。方法和构造器引用的语法将在稍后讨论。 + +由于具有多线程,因此整数值整体上以任意顺序打印,但在给定线程中按顺序打印。例如,如果线程 T1 打印 409 和 411,那么 T1 将按照顺序 409-411 打印,但是其它某个线程可能会预先打印 2,045。`parallel` 调用后面的线程是并发执行的,因此它们的输出顺序是不确定的。 + +### map/reduce 模式 + +_map/reduce_ 模式在处理大型数据集方面已变得很流行。一个 map/reduce 宏操作由两个微操作构成。首先,将数据分散(_mapped_)到各个工作程序中,然后将单独的结果收集在一起 —— 也可能收集统计起来成为一个值,即 _reduction_。Reduction 可以采用不同的形式,如以下示例所示。 + +下面 `Number` 类的实例用 **EVEN** 或 **ODD** 表示有奇偶校验的整数值: + +``` +public class Number { + enum Parity { EVEN, ODD } + private int value; + public Number(int n) { setValue(n); } + public void setValue(int value) { this.value = value; } + public int getValue() { return this.value; } + public Parity getParity() { + return ((value & 0x1) == 0) ? Parity.EVEN : Parity.ODD; + } + public void dump() { + System.out.format("Value: %2d (parity: %s)\n", getValue(), + (getParity() == Parity.ODD ? "odd" : "even")); + } +} +``` + +下面的代码演示了带有 `Number` 流进行 map/reduce 的情形,从而表明流 API 不仅可以处理 `int` 和 `float` 等基本类型,还可以处理程序员自定义的类类型。 + +在下面的代码段中,使用了 `parallelStream` 而不是 `stream` 函数对随机整数值列表进行流化处理。与前面介绍的 `parallel` 函数一样,`parallelStream` 变体也可以自动执行多线程。 + +``` +final int howMany = 200; +Random r = new Random(); +Number[] nums = new Number[howMany]; +for (int i = 0; i < howMany; i++) nums[i] = new Number(r.nextInt(100)); +List listOfNums = Arrays.asList(nums); // 将数组转化为 list + +Integer sum4All = listOfNums + .parallelStream() // 自动执行多线程 + .mapToInt(Number::getValue) // 使用方法引用,而不是 lambda + .sum(); // 将流值计算出和值 +System.out.println("The sum of the randomly generated values is: " + sum4All); +``` + +高阶的 `mapToInt` 函数可以接受一个 lambda 作为参数,但在本例中,它接受一个方法引用,即 `Number::getValue`。`getValue` 方法不需要参数,它返回给定的 `Number` 实例的 `int` 值。语法并不复杂:类名 `Number` 后跟一个双冒号和方法名。回想一下先前的例子 `System.out::println`,它在 `System` 类中的 `static` 属性 `out` 后面有一个双冒号。 + +方法引用 `Number::getValue` 可以用下面的 lambda 表达式替换。参数 `n` 是流中的 `Number` 实例中的之一: + +``` +`mapToInt(n -> n.getValue())` +``` + +通常,lambdas 和方法引用是可互换的:如果像 `mapToInt` 这样的高阶函数可以采用一种形式作为参数,那么这个函数也可以采用另一种形式。这两个函数式编程结构具有相同的目的 —— 对作为参数传入的数据执行一些自定义操作。在两者之间进行选择通常是为了方便。例如,lambda 可以在没有封装类的情况下编写,而方法则不能。。我的习惯是使用 lambda,除非已经有了适当的封装方法。 + +当前示例末尾的 `sum` 函数通过结合来自 `parallelStream` 线程的部分和,以线程安全的方式进行归约。但是,程序员有责任确保在 `parallelStream` 调用引发的多线程过程中,程序员自己的函数调用(在本例中为 `getValue`)是线程安全的。 + +最后一点值得强调。lambda 语法鼓励编写 _纯函数pure function_,即函数的返回值仅取决于传入的参数(如果有);纯函数没有副作用,例如更新类中的 `static` 字段。因此,纯函数是线程安全的,并且如果传递给高阶函数的函数参数(例如 `filter` 和 `map` )是纯函数,则流 API 效果最佳。 + +对于更细粒度的控制,有另一个流 API 函数,名为 `reduce`,可用于对 `Number` 流中的值求和: + +``` +Integer sum4AllHarder = listOfNums + .parallelStream() // 多线程 + .map(Number::getValue) // 每个 Number 的值 + .reduce(0, (sofar, next) -> sofar + next); // 求和 +``` + +此版本的 `reduce` 函数带有两个参数,第二个参数是一个函数: + +> 第一个参数(在这种情况下为零)是 _特征_ 值,该值用作求和操作的初始值,并且在求和过程中流结束时用作默认值。 + +> 第二个参数是 _累加器_,在本例中,这个 lambda 表达式有两个参数:第一个参数(`sofar`)是正在运行的和,第二个参数(`next`)是来自流的下一个值。运行总和以及下一个值相加,然后更新累加器。请记住,由于开始时调用了 `parallelStream`,因此 `map` 和 `reduce` 函数现在都在多线程上下文中执行。 + +在到目前为止的示例中,流值被收集,然后被归并,但是,通常情况下,流 API 中的 `Collectors` 可以累积值,而不需要将它们减少到单个值。正如下一个代码段所示,收集活动可以生成任意丰富的数据结构。该示例使用与前面示例相同的 `listOfNums`: + +``` +Map> numMap = listOfNums + .parallelStream() + .collect(Collectors.groupingBy(Number::getParity)); + +List evens = numMap.get(Number.Parity.EVEN); +List odds = numMap.get(Number.Parity.ODD); +``` + +第一行中的 `numMap` 指的是一个 `Map`,它的键是一个 `Number` 奇偶校验位(**ODD** 或 **EVEN**),其值是一个具有指定奇偶校验位值的 `Number` 实例的`List`。同样,通过 `parallelStream` 调用进行多线程处理,然后 `collect` 调用(以线程安全的方式)将部分结果组装到 `numMap` 引用的 `Map` 中。然后,在 `numMap` 上调用 `get` 方法两次,一次获取 `evens`,第二次获取 `odds`。 + +实用函数 `dumpList` 再次使用来自流 API 的高阶 `forEach` 函数: + +``` +private void dumpList(String msg, List list) { + System.out.println("\n" + msg); + list.stream().forEach(n -> n.dump()); // 或者使用 forEach(Number::dump) +} +``` + +这是示例运行中程序输出的一部分: + +``` +The sum of the randomly generated values is: 3322 +The sum again, using a different method: 3322 + +Evens: + +Value: 72 (parity: even) +Value: 54 (parity: even) +... +Value: 92 (parity: even) + +Odds: + +Value: 35 (parity: odd) +Value: 37 (parity: odd) +... +Value: 41 (parity: odd) +``` + +### 用于代码简化的函数式结构 + +函数式结构(如方法引用和 lambdas)非常适合在流 API 中使用。这些构造代表了 Java 中对高阶函数的主要简化。即使在糟糕的过去,Java 也通过 `Method` 和 `Constructor` 类型在技术上支持高阶函数,这些类型的实例可以作为参数传递给其它函数。由于其复杂性,这些类型在生产级 Java 中很少使用。例如,调用 `Method` 需要对象引用(如果方法是非**静态**的)或至少一个类标识符(如果方法是**静态**的)。然后,被调用的 `Method` 的参数作为**对象**实例传递给它,如果没有发生多态(那会出现另一种复杂性!),则可能需要显式向下转换。相比之下,lambda 和方法引用很容易作为参数传递给其它函数。 + +但是,新的函数式结构在流 API 之外具有其它用途。考虑一个 Java GUI 程序,该程序带有一个供用户按下的按钮,例如,按下以获取当前时间。按钮按下的事件处理程序可能编写如下: + +``` +JButton updateCurrentTime = new JButton("Update current time"); +updateCurrentTime.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + currentTime.setText(new Date().toString()); + } +}); +``` + +这个简短的代码段很难解释。关注第二行,其中方法 `addActionListener` 的参数开始如下: + +``` +`new ActionListener() {` +``` + +这似乎是错误的,因为 `ActionListener` 是一个**抽象**接口,而**抽象**类型不能通过调用 `new` 实例化。但是,事实证明,还有其它一些实例被实例化了:一个实现此接口的未命名内部类。如果上面的代码封装在名为 `OldJava` 的类中,则该未命名的内部类将被编译为 `OldJava$1.class`。`actionPerformed` 方法在这个未命名的内部类中被重写。 + +现在考虑使用新的函数式结构进行这个令人耳目一新的更改: + +``` +`updateCurrentTime.addActionListener(e -> currentTime.setText(new Date().toString()));` +``` + +lambda 表达式中的参数 `e` 是一个 `ActionEvent` 实例,而 lambda 的主体是对按钮上的 `setText` 的简单调用。 + +### 函数式接口和函数组合 + +到目前为止,使用的 lambda 已经写好了。但是,为了方便起见,我们可以像引用封装方法一样引用 lambda 表达式。以下一系列简短示例说明了这一点。 + +考虑以下接口定义: + +``` +@FunctionalInterface // 可选,通常省略 +interface BinaryIntOp { + abstract int compute(int arg1, int arg2); // abstract 声明可以被删除 +} +``` + +注释 `@FunctionalInterface` 适用于声明 _唯一_ 抽象方法的任何接口;在本例中,这个抽象接口是 `compute`。一些标准接口,(例如具有唯一声明方法 `run` 的 `Runnable` 接口)同样符合这个要求。在此示例中,`compute` 是已声明的方法。该接口可用作引用声明中的目标类型: + +``` +BinaryIntOp div = (arg1, arg2) -> arg1 / arg2; +div.compute(12, 3); // 4 +``` + +包 `java.util.function` 提供各种函数式接口。以下是一些示例。 + +下面的代码段介绍了参数化的 `Predicate` 函数式接口。在此示例中,带有参数 `String` 的 `Predicate` 类型可以引用具有 `String` 参数的 lambda 表达式或诸如 `isEmpty` 之类的 `String` 方法。通常情况下,_predicate_ 是一个返回布尔值的函数。 + +``` +Predicate pred = String::isEmpty; // String 方法的 predicate 声明 +String[] strings = {"one", "two", "", "three", "four"}; +Arrays.asList(strings) + .stream() + .filter(pred) // 过滤掉非空字符串 + .forEach(System.out::println); // 只打印空字符串 +``` + +在字符串长度为零的情况下,`isEmpty` predicate 判定结果为 `true`。 因此,只有空字符串才能进入管道的 `forEach` 阶段。 + +下一段代码将演示如何将简单的 lambda 或方法引用组合成更丰富的 lambda 或方法引用。考虑这一系列对 `IntUnaryOperator` 类型的引用的赋值,它接受一个整型参数并返回一个整型值: + +``` +IntUnaryOperator doubled = n -> n * 2; +IntUnaryOperator tripled = n -> n * 3; +IntUnaryOperator squared = n -> n * n; +``` + +`IntUnaryOperator` 是一个 `FunctionalInterface`,其唯一声明的方法为 `applyAsInt`。现在可以单独使用或以各种组合形式使用这三个引用 `doubled`、`tripled` 和 `squared`: + +``` +int arg = 5; +doubled.applyAsInt(arg); // 10 +tripled.applyAsInt(arg); // 15 +squared.applyAsInt(arg); // 25 +``` + +以下是一些函数组合的样例: + +``` +int arg = 5; +doubled.compose(squared).applyAsInt(arg); // 5 求 2 次方后乘 2:50 +tripled.compose(doubled).applyAsInt(arg); // 5 乘 2 后再乘 3:30 +doubled.andThen(squared).applyAsInt(arg); // 5 乘 2 后求 2 次方:100 +squared.andThen(tripled).applyAsInt(arg); // 5 求 2 次方后乘 3:75 +``` + +函数组合可以直接使用 lambda 表达式实现,但是引用使代码更简洁。 + +### 构造器引用 + +构造器引用是另一种函数式编程构造,而这些引用在比 lambda 和方法引用更微妙的上下文中非常有用。再一次重申,代码示例似乎是最好的解释方式。 + +考虑这个 [POJO][13] 类: + +``` +public class BedRocker { // 基岩的居民 + private String name; + public BedRocker(String name) { this.name = name; } + public String getName() { return this.name; } + public void dump() { System.out.println(getName()); } +} +``` + +该类只有一个构造函数,它需要一个 `String` 参数。给定一个名字数组,目标是生成一个 `BedRocker` 元素数组,每个名字代表一个元素。下面是使用了函数式结构的代码段: + +``` +String[] names = {"Fred", "Wilma", "Peebles", "Dino", "Baby Puss"}; + +Stream bedrockers = Arrays.asList(names).stream().map(BedRocker::new); +BedRocker[] arrayBR = bedrockers.toArray(BedRocker[]::new); + +Arrays.asList(arrayBR).stream().forEach(BedRocker::dump); +``` + +在较高的层次上,这个代码段将名字转换为 `BedRocker` 数组元素。具体来说,代码如下所示。`Stream` 接口(在包 `java.util.stream` 中)可以被参数化,而在本例中,生成了一个名为 `bedrockers` 的 `BedRocker` 流。 + +`Arrays.asList` 实用程序再次用于流化一个数组 `names`,然后将流的每一项传递给 `map` 函数,该函数的参数现在是构造器引用 `BedRocker::new`。这个构造器引用通过在每次调用时生成和初始化一个 `BedRocker` 实例来充当一个对象工厂。在第二行执行之后,名为 `bedrockers` 的流由五项 `BedRocker` 组成。 + +这个例子可以通过关注高阶 `map` 函数来进一步阐明。在通常情况下,一个映射将一个类型的值(例如,一个 `int`)转换为另一个 _相同_ 类型的值(例如,一个整数的后继): + +``` +map(n -> n + 1) // 将 n 映射到其后继 +``` + +然而,在 `BedRocker` 这个例子中,转换更加戏剧化,因为一个类型的值(代表一个名字的 `String`)被映射到一个 _不同_ 类型的值,在这个例子中,就是一个 `BedRocker` 实例,这个字符串就是它的名字。转换是通过一个构造器调用来完成的,它是由构造器引用来实现的: + +``` +`map(BedRocker::new) // 将 String 映射到 BedRocker +``` + +传递给构造器的值是 `names` 数组中的其中一项。 + +此代码示例的第二行还演示了一个你目前已经非常熟悉的转换:先将数组先转换成 `List`,然后再转换成 `Stream`: + +``` +`Stream bedrockers = Arrays.asList(names).stream().map(BedRocker::new);` +``` + +第三行则是另一种方式 —— 流 `bedrockers` 通过使用_数组_构造器引用 `BedRocker[]::new` 调用 `toArray` 方法: + +``` +`BedRocker[ ] arrayBR = bedrockers.toArray(BedRocker[]::new);` +``` + +该构造器引用不会创建单个 `BedRocker` 实例,而是创建这些实例的整个数组:该构造器引用现在为 `BedRocker[]:new`,而不是 `BedRocker::new`。为了进行确认,将 `arrayBR` 转换为 `List`,再次对其进行流式处理,以便可以使用 `forEach` 来打印 `BedRocker` 的名字。 + +``` +Fred +Wilma +Peebles +Dino +Baby Puss +``` + +该示例对数据结构的微妙转换仅用几行代码即可完成,从而突出了可以将 lambda,方法引用或构造器引用作为参数的各种高阶函数的功能。 + +### 柯里化Currying + +_柯里化_ 函数是指减少函数执行任何工作所需的显式参数的数量(通常减少到一个)。(该术语是为了纪念逻辑学家 Haskell Curry。)一般来说,函数的参数越少,调用起来就越容易,也更健壮。(回想一下一些需要半打左右参数的噩梦般的函数!)因此,应将柯里化视为简化函数调用的一种尝试。`java.util.function` 包中的接口类型适合于柯里化,如以下示例所示。 + +引用的 `IntBinaryOperator` 接口类型是为函数接受两个整型参数,并返回一个整型值: + +``` +IntBinaryOperator mult2 = (n1, n2) -> n1 * n2; +mult2.applyAsInt(10, 20); // 200 +mult2.applyAsInt(10, 30); // 300 +``` + +引用 `mult2` 强调了需要两个显式参数,在本例中是 10 和 20。 + +前面介绍的 `IntUnaryOperator` 比 `IntBinaryOperator` 简单,因为前者只需要一个参数,而后者则需要两个参数。两者均返回整数值。因此,目标是将名为 `mult2` 的两个参数 `IntBinraryOperator` 柯里化成一个单一的 `IntUnaryOperator` 版本 `curriedMult2`。 + +考虑 `IntFunction` 类型。此类型的函数采用整型参数,并返回类型为 `R` 的结果,该结果可以是另一个函数 —— 更准确地说,是 `IntBinaryOperator`。让一个 lambda 返回另一个 lambda 很简单: + +``` +arg1 -> (arg2 -> arg1 * arg2) // 括号可以省略 +``` + +完整的 lambda 以 `arg1,` 开头,而该 lambda 的主体以及返回的值是另一个以 `arg2` 开头的 lambda。返回的 lambda 仅接受一个参数(`arg2`),但返回了两个数字的乘积(`arg1` 和 `arg2`)。下面的概述,再加上代码,应该可以更好地进行说明。 + +以下是如何柯里化 `mult2` 的概述: + +> 类型为 `IntFunction` 的 lambda 被写入并调用,其整型值为 10。返回的 `IntUnaryOperator` 缓存了值 10,因此变成了已柯里化版本的 `mult2`,在本例中为 `curriedMult2`。 + +> 然后使用单个显式参数(例如,20)调用 `curriedMult2` 函数,该参数与缓存的参数(在本例中为 10)相乘以生成返回的乘积。。 + +这是代码的详细信息: + +``` +// 创建一个接受一个参数 n1 并返回一个单参数 n2 -> n1 * n2 的函数,该函数返回一个(n1 * n2 乘积的)整型数。 +IntFunction curriedMult2Maker = n1 -> (n2 -> n1 * n2); +``` + +调用 `curriedMult2Maker` 生成所需的 `IntUnaryOperator` 函数: + +``` +// 使用 curriedMult2Maker 获取已柯里化版本的 mult2。 +// 参数 10 是上面的 lambda 的 n1。 +IntUnaryOperator curriedMult2 = curriedMult2Maker2.apply(10); +``` + +值 10 现在缓存在 `curriedMult2` 函数中,以便 `curriedMult2` 调用中的显式整型参数乘以 10: + +``` +curriedMult2.applyAsInt(20); // 200 = 10 * 20 +curriedMult2.applyAsInt(80); // 800 = 10 * 80 +``` + +缓存的值可以随意更改: + +``` +curriedMult2 = curriedMult2Maker.apply(50); // 缓存 50 +curriedMult2.applyAsInt(101); // 5050 = 101 * 50 +``` + +当然,可以通过这种方式创建多个已柯里化版本的 `mult2`,每个版本都有一个 `IntUnaryOperator`。 + +柯里化充分利用了 lambda 的强大功能:可以很容易地编写 lambda 表达式来返回需要的任何类型的值,包括另一个 lambda。 + +### 总结 + +Java 仍然是基于类的面向对象的编程语言。但是,借助流 API 及其支持的函数式构造,Java 向函数式语言(例如 Lisp)迈出了决定性的(同时也是受欢迎的)一步。结果是 Java 更适合处理现代编程中常见的海量数据流。在函数式方向上的这一步还使以在前面的代码示例中突出显示的管道的方式编写清晰简洁的 Java 代码更加容易: + +``` +dataStream + .parallelStream() // 多线程以提高效率 + .filter(...) // 阶段 1 + .map(...) // 阶段 2 + .filter(...) // 阶段 3 + ... + .collect(...); // 或者,也可以进行归约:阶段 N +``` + +自动多线程,以 `parallel` 和 `parallelStream` 调用为例,建立在 Java 的 fork/join 框架上,该框架支持 _任务窃取task stealing_ 以提高效率。假设 `parallelStream` 调用后面的线程池由八个线程组成,并且 `dataStream` 被八种方式分区。某个线程(例如,T1)可能比另一个线程(例如,T7)工作更快,这意味着应该将 T7 的某些任务移到 T1 的工作队列中。这会在运行时自动发生。 + +在这个简单的多线程世界中,程序员的主要职责是编写线程安全函数,这些函数作为参数传递给在流 API 中占主导地位的高阶函数。 尤其是 lambda 鼓励编写纯函数(因此是线程安全的)函数。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/javastream + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[laingke](https://github.com/laingke) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/features_solutions_command_data.png?itok=4_VQN3RK (computer screen ) +[2]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+random +[3]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+list +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+number +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+arrays +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+integer +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jbutton +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionlistener +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionevent +[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+date +[13]: https://en.wikipedia.org/wiki/Plain_old_Java_object From 7bc0bcc843a69e71c8f674ddc7e9fac71e0b08c2 Mon Sep 17 00:00:00 2001 From: laingke Date: Wed, 29 Jan 2020 17:38:57 +0800 Subject: [PATCH 141/285] =?UTF-8?q?20200122-article-11830-1=20=E9=94=99?= =?UTF-8?q?=E5=AD=97=E4=BF=AE=E6=94=B9=EF=BC=8C=E2=80=9C=E5=87=BA=E2=80=9D?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E2=80=9C=E5=A4=84=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng up passwordless Linux logins using public-private keys.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200122 Setting up passwordless Linux logins using public-private keys.md b/published/20200122 Setting up passwordless Linux logins using public-private keys.md index 89f54a6b45..711473cdfa 100644 --- a/published/20200122 Setting up passwordless Linux logins using public-private keys.md +++ b/published/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -34,7 +34,7 @@ boss$ ``` -如果你还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用 RSA 或 DSA。)注意,要在不输入密码的情况下访问系统,你需要在下面的对话框中的两个提示符出不输入密码。 +如果你还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用 RSA 或 DSA。)注意,要在不输入密码的情况下访问系统,你需要在下面的对话框中的两个提示符处不输入密码。 如果你已经有一个与此帐户关联的公钥/私钥对,请跳过此步骤。 From d65ff790f026ab0a6fc2a5be931284bd643c7344 Mon Sep 17 00:00:00 2001 From: laingke Date: Wed, 29 Jan 2020 17:53:42 +0800 Subject: [PATCH 142/285] =?UTF-8?q?Revert=20"20200122-article-11830-1=20?= =?UTF-8?q?=E9=94=99=E5=AD=97=E4=BF=AE=E6=94=B9=EF=BC=8C=E2=80=9C=E5=87=BA?= =?UTF-8?q?=E2=80=9D=E6=94=B9=E4=B8=BA=E2=80=9C=E5=A4=84=E2=80=9D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7bc0bcc --- ...ng up passwordless Linux logins using public-private keys.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200122 Setting up passwordless Linux logins using public-private keys.md b/published/20200122 Setting up passwordless Linux logins using public-private keys.md index 711473cdfa..89f54a6b45 100644 --- a/published/20200122 Setting up passwordless Linux logins using public-private keys.md +++ b/published/20200122 Setting up passwordless Linux logins using public-private keys.md @@ -34,7 +34,7 @@ boss$ ``` -如果你还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用 RSA 或 DSA。)注意,要在不输入密码的情况下访问系统,你需要在下面的对话框中的两个提示符处不输入密码。 +如果你还没有在 boss 系统上为你的帐户设置公钥/私钥对,请使用如下所示的命令创建一个密钥对。注意,你可以在各种加密算法之间进行选择。(一般使用 RSA 或 DSA。)注意,要在不输入密码的情况下访问系统,你需要在下面的对话框中的两个提示符出不输入密码。 如果你已经有一个与此帐户关联的公钥/私钥对,请跳过此步骤。 From 4b57bf886d56c28a3a99d3f66bf8885814fa4ed4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Jan 2020 21:38:33 +0800 Subject: [PATCH 143/285] PRF @alim0x --- ... Linux story- Learning Linux in the 90s.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md b/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md index ea0847761d..8830fa539f 100644 --- a/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md +++ b/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (alim0x) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (My Linux story: Learning Linux in the 90s) @@ -9,34 +9,36 @@ 我的 Linux 故事:在 90 年代学习 Linux ====== -这是一个关于我如何在 WiFi 时代之前学习 Linux 的故事,那时的发行版还以 CD 的形式出现。 -![Sky with clouds and grass][1] + +> 这是一个关于我如何在 WiFi 时代之前学习 Linux 的故事,那时的发行版还以 CD 的形式出现。 + +![](https://img.linux.net.cn/data/attachment/album/202001/29/213829t00wmwu2w0z502zg.jpg) 大部分人可能不记得 1996 年时计算产业或日常生活世界的样子。但我很清楚地记得那一年。我那时候是堪萨斯中部一所高中的二年级学生,那是我的自由与开源软件(FOSS)旅程的开端。 -我从这里开始进步。我在 1996 年之前就开始对计算机感兴趣。我出生并成长于我家的第一台 Apple ][e,然后多年之后是 IBM Personal System/2。(是的,在这过程中有一些代际的跨越。)IBM PS/2 有一个非常激动人心的特性:一个 1200 波特的 Hayes 调制解调器。 +我从这里开始进步。我在 1996 年之前就开始对计算机感兴趣。我在我家的第一台 Apple ][e 上启蒙成长,然后多年之后是 IBM Personal System/2。(是的,在这过程中有一些代际的跨越。)IBM PS/2 有一个非常激动人心的特性:一个 1200 波特的 Hayes 调制解调器。 我不记得是怎样了,但在那不久之前,我得到了一个本地 [BBS][2] 的电话号码。一旦我拨号进去,我可以得到本地的一些其他 BBS 的列表,我的网络探险就此开始了。 -在 1995 年,[足够幸运][3]的人拥有了家庭互联网连接,每月可以使用不到 30 分钟。这个互联网不像我们现代的服务那样,通过卫星、光纤、有线电视同轴电缆或任何版本的铜线提供。大多数家庭通过一个调制解调器拨号,它连接到他们的电话线上。(这时离移动电话无处不在的时代还早得很,大多数人只有一部家庭电话。)尽管这还要取决你所在的位置,但我不认为那时有很多独立的互联网服务提供商(ISP),所以大多数人从仅有的几家大公司获得服务,包括 America Online,CompuServe 以及 Prodigy。 +在 1995 年,[足够幸运][3]的人拥有了家庭互联网连接,每月可以使用不到 30 分钟。那时的互联网不像我们现代的服务那样,通过卫星、光纤、有线电视同轴电缆或任何版本的铜线提供。大多数家庭通过一个调制解调器拨号,它连接到他们的电话线上。(这时离移动电话无处不在的时代还早得很,大多数人只有一部家庭电话。)尽管这还要取决你所在的位置,但我不认为那时有很多独立的互联网服务提供商(ISP),所以大多数人从仅有的几家大公司获得服务,包括 America Online,CompuServe 以及 Prodigy。 -你获取到的服务速率非常低,甚至在拨号上网演变的顶峰 56K,你也只能期望得到最高 3.5Kbps 的速率。如果你想要尝试 Linux,下载一个 200MB 到 800MB 的 ISO 镜像或(更加切合实际的)磁盘镜像要贡献出时间,决心,以及面临电话不可用的情形。 +你能获取到的服务速率非常低,甚至在拨号上网革命性地达到了顶峰的 56K,你也只能期望得到最高 3.5Kbps 的速率。如果你想要尝试 Linux,下载一个 200MB 到 800MB 的 ISO 镜像或(更加切合实际的)一套软盘镜像要贡献出时间、决心,以及减少电话的使用。 -我走了一条简单一点的路:在 1996 年,我从一家主要的 Linux 分发商订购了一套“tri-Linux”CD。这些光盘提供了三个发行版,我的这套包含了 Debian 1.1 (Debian 的第一个稳定版本),Red Hat Linux 3.0.3 以及 Slackware 3.1(代号 Slackware '96)。据我回忆,这些光盘是从一家叫做 [Linux Systems Labs][4] 的在线商店购买的。这家在线商店如今已经不存在了,但在 90 年代和 00 年代早期,这样的分发商很常见。对于多光盘 Linux 套件也是如此。这是 1998 年的一套光盘,你可以了解到他们都包含了什么: +我走了一条简单一点的路:在 1996 年,我从一家主要的 Linux 发行商订购了一套 “tri-Linux” CD 集。这些光盘提供了三个发行版,我的这套包含了 Debian 1.1(Debian 的第一个稳定版本)、Red Hat Linux 3.0.3 以及 Slackware 3.1(代号 Slackware '96)。据我回忆,这些光盘是从一家叫做 [Linux Systems Labs][4] 的在线商店购买的。这家在线商店如今已经不存在了,但在 90 年代和 00 年代早期,这样的发行商很常见。这些是多光盘 Linux 套件。这是 1998 年的一套光盘,你可以了解到他们都包含了什么: ![A tri-linux CD set][5] ![A tri-linux CD set][6] -在 1996 年夏天一个命中注定般的日子,那时我住在堪萨斯一个新的并且相对较为乡村的城市,我做出了安装并使用 Linux 的第一次尝试。在 1996 年的整个夏天,我尝试了那套三 Linux CD 套件里的全部三个发行版。他们都在我母亲的老 Pentium 75MHz 电脑上完美运行。 +在 1996 年夏天一个命中注定般的日子,那时我住在堪萨斯一个新的并且相对较为乡村的城市,我做出了安装并使用 Linux 的第一次尝试。在 1996 年的整个夏天,我尝试了那套三张 Linux CD 套件里的全部三个发行版。他们都在我母亲的老 Pentium 75MHz 电脑上完美运行。 -我最终选择了 [Slackware][7] 3.1 作为我喜欢的发行版,相比其他发行版可能更多的是因为它的终端的外观,这是决定选择一个发行版前需要考虑的重要因素。 +我最终选择了 [Slackware][7] 3.1 作为我的首选发行版,相比其它发行版可能更多的是因为它的终端的外观,这是决定选择一个发行版前需要考虑的重要因素。 -我将系统设置完毕并运行了起来。我连接到一家“杂牌”ISP(一家这个区域的本地服务商),通过我家的第二条电话线拨号(为了满足我的所有互联网使用而订购)。那就像在天堂一样。我有一台完美运行的双系统(Microsoft Windows 95 和 Slackware 3.1)电脑。我依然拨号进入我所知道和喜爱的 BBS,游玩在线 BBS 游戏,比如 Trade Wars,Usurper 以及 Legend of the Red Dragon。 +我将系统设置完毕并运行了起来。我连接到一家 “不太知名的” ISP(一家这个区域的本地服务商),通过我家的第二条电话线拨号(为了满足我的所有互联网使用而订购)。那就像在天堂一样。我有一台完美运行的双系统(Microsoft Windows 95 和 Slackware 3.1)电脑。我依然拨号进入我所知道和喜爱的 BBS,游玩在线 BBS 游戏,比如 Trade Wars、Usurper 以及 Legend of the Red Dragon。 -我能够记得花在 EFNet(IRC)上 #Linux 频道的一天天时光,帮助其他用户,回答他们的 Linux 问题以及和审核人员互动。 +我能够记得在 EFNet(IRC)上 #Linux 频道上渡过的日子,帮助其他用户,回答他们的 Linux 问题以及和版主们互动。 -在我第一次在家尝试使用 Linux 系统的 20 多年后,我现在正进入作为 Red Hat 顾问的第五年,仍然在使用 Linux(现在是 Fedora)作为我的日常系统,并且依然在 IRC 上帮助想要使用 Linux 的人们。 +在我第一次在家尝试使用 Linux 系统的 20 多年后,已经是我进入作为 Red Hat 顾问的第五年,我仍然在使用 Linux(现在是 Fedora)作为我的日常系统,并且依然在 IRC 上帮助想要使用 Linux 的人们。 -------------------------------------------------------------------------------- @@ -45,7 +47,7 @@ via: https://opensource.com/article/19/11/learning-linux-90s 作者:[Mike Harris][a] 选题:[lujun9972][b] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0215d826b928946a8858d2c0dab357c15a6e4e51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Jan 2020 21:39:53 +0800 Subject: [PATCH 144/285] PUB @alim0x https://linux.cn/article-11831-1.html --- .../20191108 My Linux story- Learning Linux in the 90s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md b/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md index 8830fa539f..f31ae62e4f 100644 --- a/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md +++ b/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (alim0x) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11831-1.html) [#]: subject: (My Linux story: Learning Linux in the 90s) [#]: via: (https://opensource.com/article/19/11/learning-linux-90s) [#]: author: (Mike Harris https://opensource.com/users/mharris) From 3ae890212279cb49123cce302545eecc68845b23 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 00:53:05 +0800 Subject: [PATCH 145/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=204=20co?= =?UTF-8?q?ol=20new=20projects=20to=20try=20in=20COPR=20for=20January=2020?= =?UTF-8?q?20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 4 cool new projects to try in COPR for January 2020.md --- ...rojects to try in COPR for January 2020.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20200129 4 cool new projects to try in COPR for January 2020.md diff --git a/sources/tech/20200129 4 cool new projects to try in COPR for January 2020.md b/sources/tech/20200129 4 cool new projects to try in COPR for January 2020.md new file mode 100644 index 0000000000..58a64cdc70 --- /dev/null +++ b/sources/tech/20200129 4 cool new projects to try in COPR for January 2020.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for January 2020) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-january-2020/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +4 cool new projects to try in COPR for January 2020 +====== + +![][1] + +COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. + +This article presents a few new and interesting projects in COPR. If you’re new to using COPR, see the [COPR User Documentation][3] for how to get started. + +### Contrast + +[Contrast][4] is a small app used for checking contrast between two colors and to determine if it meets the requirements specified in [WCAG][5]. The colors can be selected either using their RGB hex codes or with a color picker tool. In addition to showing the contrast ratio, Contrast displays a short text on a background in selected colors to demonstrate comparison. + +![][6] + +#### Installation instructions + +The [repo][7] currently provides contrast for Fedora 31 and Rawhide. To install Contrast, use these commands: + +``` +sudo dnf copr enable atim/contrast +sudo dnf install contrast +``` + +### Pamixer + +[Pamixer][8] is a command-line tool for adjusting and monitoring volume levels of sound devices using PulseAudio. You can display the current volume of a device and either set it directly or increase/decrease it, or (un)mute it. Pamixer can list all sources and sinks. + +#### Installation instructions + +The [repo][9] currently provides Pamixer for Fedora 31 and Rawhide. To install Pamixer, use these commands: + +``` +sudo dnf copr enable opuk/pamixer +sudo dnf install pamixer +``` + +### PhotoFlare + +[PhotoFlare][10] is an image editor. It has a simple and well-arranged user interface, where most of the features are available in the toolbars. PhotoFlare provides features such as various color adjustments, image transformations, filters, brushes and automatic cropping, although it doesn’t support working with layers. Also, PhotoFlare can edit pictures in batches, applying the same filters and transformations on all pictures and storing the results in a specified directory. + +![][11] + +#### Installation instructions + +The [repo][12] currently provides PhotoFlare for Fedora 31. To install Photoflare, use these commands: + +``` +sudo dnf copr enable adriend/photoflare +sudo dnf install photoflare +``` + +### Tdiff + +[Tdiff][13] is a command-line tool for comparing two file trees. In addition to showing that some files or directories exist in one tree only, tdiff shows differences in file sizes, types and contents, owner user and group ids, permissions, modification time and more. + +#### Installation instructions + +The [repo][14] currently provides tdiff for Fedora 29-31 and Rawhide, EPEL 6-8 and other distributions. To install tdiff, use these commands: + +``` +sudo dnf copr enable fif/tdiff +sudo dnf install tdiff +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-january-2020/ + +作者:[Dominik Turecek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://docs.pagure.org/copr.copr/user_documentation.html# +[4]: https://gitlab.gnome.org/World/design/contrast +[5]: https://www.w3.org/WAI/standards-guidelines/wcag/ +[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/contrast-screenshot.png +[7]: https://copr.fedorainfracloud.org/coprs/atim/contrast/ +[8]: https://github.com/cdemoulins/pamixer +[9]: https://copr.fedorainfracloud.org/coprs/opuk/pamixer/ +[10]: https://photoflare.io/ +[11]: https://fedoramagazine.org/wp-content/uploads/2020/01/photoflare-screenshot.png +[12]: https://copr.fedorainfracloud.org/coprs/adriend/photoflare/ +[13]: https://github.com/F-i-f/tdiff +[14]: https://copr.fedorainfracloud.org/coprs/fif/tdiff/ From 341610abc18f8596276da09f3491a4d52d9bacaf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 00:57:30 +0800 Subject: [PATCH 146/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200130=20Meet?= =?UTF-8?q?=20FuryBSD:=20A=20New=20Desktop=20BSD=20Distribution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md --- ...FuryBSD- A New Desktop BSD Distribution.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md diff --git a/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md new file mode 100644 index 0000000000..eee1d27f9c --- /dev/null +++ b/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meet FuryBSD: A New Desktop BSD Distribution) +[#]: via: (https://itsfoss.com/furybsd/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Meet FuryBSD: A New Desktop BSD Distribution +====== + +In the last couple of months, a few new desktop BSD have been announced. There is [HyperbolaBSD which was Hyperbola GNU/Linux][1] previously. Another new entry in the [BSD][2] world is [FuryBSD][3]. + +### FuryBSD: A new BSD distribution + +![][4] + +At its heart, FuryBSD is a very simple beast. According to [the site][5], “FuryBSD is a back to basics lightweight desktop distribution based on stock FreeBSD.” It is basically FreeBSD with a desktop environment pre-configured and several apps preinstalled. The goal is to quickly get a FreeBSD-based system running on your computer. + +You might be thinking that this sounds a lot like a couple of other BSDs that are available, such as [NomadBSD][6] and [GhostBSD][7]. The major difference between those BSDs and FuryBSD is that FuryBSD is much closer to stock FreeBSD. For example, FuryBSD uses the FreeBSD installer, while others have created their own installers and utilities. + +As it states on the [site][8], “Although FuryBSD may resemble past graphical BSD projects like PC-BSD and TrueOS, FuryBSD is created by a different team and takes a different approach focusing on tight integration with FreeBSD. This keeps overhead low and maintains compatibility with upstream.” The lead dev also told me that “One key focus for FuryBSD is for it to be a small live media with a few assistive tools to test drivers for hardware.” + +Currently, you can go to the [FuryBSD homepage][3] and download either an XFCE or KDE LiveCD. A GNOME version is in the works. + +### Who’s is Behind FuryBSD? + +The lead dev behind FuryBSD is [Joe Maloney][9]. Joe has been a FreeBSD user for many years. He contributed to other BSD projects, such as PC-BSD. He also worked with Eric Turgeon, the creator of GhostBSD, to rewrite the GhostBSD LiveCD. Along the way, he picked up a better understanding of BSD and started to form an idea of how he would make a distribution on his own. + +Joe is joined by several other devs who have also spent many years in the BSD world, such as Jaron Parsons, Josh Smith, and Damian Szidiropulosz. + +### The Future for FuryBSD + +At the moment, FuryBSD is nothing more than a pre-configured FreeBSD setup. However, the devs have a [list of improvements][5] that they want to make going forward. These include: + + * A sane framework for loading, 3rd party proprietary drivers graphics, wireless + * Cleanup up the LiveCD experience a bit more to continue to make it more friendly + * Printing support out of box + * A few more default applications included to provide a complete desktop experience + * Integrated [ZFS][10] replication tools for backup and restore + * Live image persistence options + * A custom pkg repo with sane defaults + * Continuous integration for applications updates + * Quality assurance for FreeBSD on the desktop + * Tailored artwork, color scheming, and theming + * Directory services integration + * Security hardening + + + +The devs make it quite clear that any changes they make will have a lot of thought and research behind them. They don’t want to compliment a feature, only to have to remove it or change it when it breaks something. + +![FuryBSD desktop][11] + +### How You Can Help FuryBSD? + +At this moment the project is still very young. Since all projects need help to survive, I asked Joe what kind of help they were looking for. He said, “We could use help [answering questions on the forums][12], [GitHub][13] tickets, help with documentation are all needed.” He also said that if people wanted to add support for other desktop environments, pull requests are welcome. + +### Final Thoughts + +Although I have not tried it yet, I have a good feeling about FuryBSD. It sounds like the project is in capable hands. Joe Maloney has been thinking about how to make the best BSD desktop experience for over a decade. Unlike majority of Linux distros that are basically a rethemed Ubuntu, the devs behind FuryBSD know what they are doing and they are choosing quality over the fancy bells and whistles. + +What are your thoughts on this new entry into the every growing desktop BSD market? Have you tried out FuryBSD or will you give it a try? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/furybsd/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/hyperbola-linux-bsd/ +[2]: https://itsfoss.com/bsd/ +[3]: https://www.furybsd.org/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/fury-bsd.jpg?ssl=1 +[5]: https://www.furybsd.org/manifesto/ +[6]: https://itsfoss.com/nomadbsd/ +[7]: https://ghostbsd.org/ +[8]: https://www.furybsd.org/furybsd-video-overview-at-knoxbug/ +[9]: https://github.com/pkgdemon +[10]: https://itsfoss.com/what-is-zfs/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/FuryBSDS-desktop.jpg?resize=800%2C450&ssl=1 +[12]: https://forums.furybsd.org/ +[13]: https://github.com/furybsd +[14]: https://reddit.com/r/linuxusersgroup From c9371d2cdcddb60c762d76b8c4025b86345528b1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 00:58:17 +0800 Subject: [PATCH 147/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=203=20le?= =?UTF-8?q?ssons=20I've=20learned=20writing=20Ansible=20playbooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 3 lessons I-ve learned writing Ansible playbooks.md --- ... I-ve learned writing Ansible playbooks.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/tech/20200129 3 lessons I-ve learned writing Ansible playbooks.md diff --git a/sources/tech/20200129 3 lessons I-ve learned writing Ansible playbooks.md b/sources/tech/20200129 3 lessons I-ve learned writing Ansible playbooks.md new file mode 100644 index 0000000000..a2cfe25265 --- /dev/null +++ b/sources/tech/20200129 3 lessons I-ve learned writing Ansible playbooks.md @@ -0,0 +1,221 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 lessons I've learned writing Ansible playbooks) +[#]: via: (https://opensource.com/article/20/1/ansible-playbooks-lessons) +[#]: author: (Jeff Geerling https://opensource.com/users/geerlingguy) + +3 lessons I've learned writing Ansible playbooks +====== +Avoid common pitfalls and supercharge your Ansible playbook maintenance +by following these best practices. +![plastic game pieces on a board][1] + +I've used Ansible since 2013 and maintain some of my original playbooks to this day. They have evolved with Ansible from version 1.4 to the current version (as of this writing, 2.9). + +Along the way, as Ansible grew from having dozens to hundreds and now thousands of modules, I've learned a lot about how to make sure my playbooks are maintainable and scalable as my systems grow. Even for simple projects (like the [playbook I use to manage my own laptop][2]), it pays dividends to avoid common pitfalls and make decisions that will make the future you thankful instead of regretful. + +The three main takeaways from this experience are: + + 1. Stay organized + 2. Test early and often + 3. Simplify, optimize + + + +The importance of each lesson I've learned follows in that order, too; it's no use trying to optimize something (point 3) that's already poorly assembled (point 1). Each step builds on the one above, so I'll guide you through each step. + +### Stay organized + +![Organized bins of equipment][3] + +At a bare minimum, you should **store your Ansible playbooks in a Git repository**. This helps with so many things: + + 1. Once you have a known working state, you can commit the work (ideally, with tags marking major versions, like 1.0.0 for the first stable version and 2.0.0 for an upgrade or rewrite). + 2. You can always walk back changes if necessary to a previous known-working state (e.g., by using `git reset` or `git checkout `). + 3. Large-scale changes (e.g., feature additions or a major upgrade) can be worked on in a branch, so you can still maintain the existing playbook and have adequate time to work on major changes. + + + +Storing playbooks in Git also helps with the second important organization technique: **run your playbooks from a build server**. + +Whether you use [Ansible Tower][4], [Jenkins][5], or some other build system, using a central interface for playbook runs gives you consistency and stability—you don't risk having one admin run a playbook one way (e.g., with the wrong version of roles or an old checkout) and someone else running it another way, breaking your servers. + +It also helps because it forces you to ensure all your playbook's resources are encapsulated in the playbook's repository and build configuration. Ideally, the entire build (including the job configuration) would be captured in the repository (e.g., through the use of a `Jenkinsfile` or its equivalent). + +Another important aspect to organization is **documentation**; at a bare minimum, I have a README in every playbook repository with the following contents: + + * The playbook's purpose + * Links to relevant resources (CI build status, external documentation, issue tracking, primary contacts) + * Instructions for local testing and development + + + +Even if you have the playbook automated through a build server, it is important to have thorough and correct documentation for how to run the playbook otherwise (e.g., locally in a test environment). I like to make sure my projects are easily approachable—not only for others who might eventually need to work with them but also myself! I often forget a nuance or dependency when running a playbook, and the README is the perfect place to outline any peculiarities. + +Finally, the _structure_ of the Ansible tasks themselves are important, and I like to ensure I have a maintainable structure by having **small, readable task files** and by extracting related sets of tasks into **Ansible roles**. + +Generally, if an individual playbook reaches around 100 lines of YAML, I'll start breaking it up into separate task files and using `include_tasks` to include those files. If I find a set of tasks that operates independently and could be broken out into its own [Ansible role][6], I'll work on extracting those tasks and related handlers, variables, and templates. + +Using roles is the best way to supercharge Ansible playbook maintenance; I often have to do similar tasks in many (if not most) playbooks, like managing user accounts or installing and configuring a web server or database. Abstracting these tasks into Ansible roles means I can maintain one set of tasks to be used among many playbooks, with variables to give flexibility where needed. + +Ansible roles can also be contributed back to the community via [Ansible Galaxy][7] if you're able to make them generic and provide the code with an open source license. I have contributed over a hundred roles to Galaxy, and they are made better by the fact that thousands of other playbooks (besides my own) rely on them and break if there is a bug in the role. + +One final note on roles: If you choose to use external roles (either from Galaxy or a private Git repository), I recommend committing the role to your repository (instead of adding it to a `.gitignore` file and downloading the role every time you run your playbook) because I like to avoid relying on downloads from Ansible Galaxy for every playbook run. You should still use a `requirements.yml` file to define role dependencies and define specific versions for the roles so you can choose when to upgrade your dependencies. + +### Test early and often + +![A stack of computer boards][8] + +Ansible allows you to define infrastructure as code. And like any software, it is essential to be able to verify that the code you write does what you expect. + +Like any software, it's best to _test_ your Ansible playbooks. And when I consider testing for any individual Ansible project I build, I think of a spectrum of CI testing options I can use, going in order from the easiest to hardest to implement: + + 1. `yamllint` + 2. `ansible-playbook --syntax-check` + 3. `ansible-lint` + 4. [Molecule test][9] (integration tests) + 5. `ansible-playbook --check` (testing against production) + 6. Building parallel infrastructure + + + +The first three options (linting and running a syntax check on your playbook) are essentially free; they run very fast and can help you avoid the most common problems with your playbook's task structure and formatting. + +They provide some value, but unless the playbook is extremely simple, I like to go beyond basic linting and run tests using [Molecule][9]. I usually use Molecule's built-in Docker integration to run my playbook against a local Docker instance running the same base OS as my production server. For some of my roles, which I run on different Linux distributions (e.g., CentOS and Debian), I run the Molecule test playbook once for each distro—and sometimes with extra test scenarios for more complex roles. + +If you're interested in learning how to test roles with Molecule, I wrote a blog post on the topic a couple of years ago called [Testing your Ansible roles with Molecule][10]. The process for testing full playbooks is similar, and in both cases, the tests can be run inside most CI environments (for example, my [geerlingguy.apache][11] role runs a suite of [Molecule tests via Travis CI][12]). + +The final two test options, running the playbook in `--check` mode or building parallel production infrastructure, require more setup work and often go beyond what's necessary for efficient testing processes. But in cases where playbooks manage servers critical to business revenue, they can be necessary. + +There are a few other things that are important to watch for when running tests and periodically checking or updating your playbooks: + + * Make sure you track (and fix) any `DEPRECATION WARNING`s you see in Ansible's output. Usually, you'll have a year or two before the warning leads to a failure in the latest Ansible version, so the earlier you can update your playbook code, the better. + * Every Ansible version has a [porting guide][13]) that is extremely helpful when you're updating from one version to the next. + * If you see annoying `WARN` messages in playbook output when you're using a module like `command`, and you know you can safely ignore them, you can add a `warn: no` under the `args` in a task. It's better to squelch these warnings so that more actionable warnings (like deprecation warnings) will be noticed at a glance. + + + +Finally, I like to make sure my CI environments are always running the latest Ansible release (and not locked into a specific version that I know works with my playbooks), because I know if a playbook will break right after the new release comes out. My build server is locked into a specific Ansible version, which may be one or two versions behind the latest version, so this gives me the time to ensure I fix any new issues discovered in CI tests before I upgrade my build server to the latest version. + +### Simplify, optimize + +![Charging AirPods][14] + +> "YAML is not a programming language." +> — Jeff Geerling + +Simplicity in your playbooks makes maintenance and future changes a lot easier. Sometimes I'll look at a playbook and be puzzled as to what's happening because there are multiple `when` and `until` conditions with a bunch of Python mixed in with Jinja filters. + +If I start to see more than one or two chained filters or Python method calls (especially anything having to do with regular expressions), I see that as a prime candidate for rewriting the required functionality as an Ansible module. The module could be maintained in Python and tested independently and would be easier to maintain as strictly Python code rather than mixing in all the Python inline with your YAML task definitions. + +So my first point is: Stick to Ansible's modules and simple task definitions as much as possible. Try to use Jinja filters wherever possible, and avoid chaining more than one or two filters on a variable at a time. If you have a lot of complex inline Python or Jinja, it's time to consider refactoring it into a custom Ansible module. + +Another common thing I see people do, especially when building out roles the first time, is using complex dict variables where separate "flat" variables may be more flexible. + +For example, instead of having an **apache** role with many options in one giant dict, like this: + + +``` +apache: +  startservers: 2 +  maxclients: 2 +``` + +And consider using separate flat variables: + + +``` +apache_startservers: 2 +apache_maxclients: 2 +``` + +The reason for this is simple: Using flat variables allows playbooks to override one particular value easily, without having to redefine the entire dictionary. This is especially helpful when you have dozens (or in some rare cases, _hundreds_) of default variables in a role. + +Once the playbook and role code looks good, it's time to start thinking about **optimization**. + +A few of the first things I look at are: + + * Can I disable `gather_facts`? Not every playbook needs all the facts, and it adds a bit of overhead on every run, on every server. + * Can I increase the number of `forks` Ansible uses? The default is five, but if I have 50 servers, can I operate on 20 or 25 at a time to vastly reduce the amount of time Ansible takes to run a playbook on all the servers? + * In CI, can I parallelize test scenarios? Instead of running one test, then the next, if I can start all the tests at once, it will make my CI test cycle much faster. If CI is slow, you'll tend to ignore it or not wait until the test run is complete, so it's important to make sure your test cycle is short. + + + +When I'm looking through tasks in a role or playbook, I also look for a few blatant performance issues that are common with certain modules: + + * When using `package` (or `apt`, `yum`, `dnf`, etc.), if there is more than one package being managed, the list should be passed directly to the `name` parameter and not via `with_items` or a `loop`—this way Ansible can efficiently operate on the whole list in one go instead of doing it package by package. + * When using `copy`, how many files are being copied? If there is a single file or even a few dozen, it might be fine, but the `copy` module is very slow if you have hundreds or thousands of files to be copied (better to use a module like `synchronize` or a different strategy like copying a tarball and expanding it on the server). + * If using `lineinfile` in a loop, it might be more efficient (and sometimes easier to maintain) to use `template` instead and control the entire file in one pass. + + + +Once I've gotten most of the low-hanging fruit out of the way, I like to profile my playbook, and Ansible has some built-in tools for this. You can configure extra callback plugins to measure role and task performance by setting the `callback_whitelist` option under `defaults` in your `ansible.cfg`: + + +``` +[defaults] +callback_whitelist = profile_roles, profile_tasks, timer +``` + +Now, when you run your playbook, you get a summary of the slowest roles and tasks at the end: + + +``` +Monday 10 September       22:31:08 -0500 (0:00:00.851)       0:01:08.824 ****** +=============================================================================== +geerlingguy.docker ------------------------------------------------------ 9.65s +geerlingguy.security ---------------------------------------------------- 9.33s +geerlingguy.nginx ------------------------------------------------------- 6.65s +geerlingguy.firewall ---------------------------------------------------- 5.39s +geerlingguy.munin-node -------------------------------------------------- 4.51s +copy -------------------------------------------------------------------- 4.34s +geerlingguy.backup ------------------------------------------------------ 4.14s +geerlingguy.htpasswd ---------------------------------------------------- 4.13s +geerlingguy.ntp --------------------------------------------------------- 3.94s +geerlingguy.swap -------------------------------------------------------- 2.71s +template ---------------------------------------------------------------- 2.64s +... +``` + +If anything takes more than a few seconds, it might be good to figure out exactly why it's taking so long. + +### Summary + +I hope you learned a few ways you can make your Ansible Playbooks more maintainable; as I said in the beginning, each of the three takeaways (stay organized, test, then simplify and optimize) builds on the previous, so start by making sure you have clean, documented code, then make sure it's well-tested, and finally look at how you can make it even better and faster! + +* * * + +_This article is a follow up to Jeff's presentation, [Make your Ansible playbooks flexible, maintainable, and scalable][15], at AnsibleFest 2018, which you can [watch here][16]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/ansible-playbooks-lessons + +作者:[Jeff Geerling][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/geerlingguy +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1 (plastic game pieces on a board) +[2]: https://github.com/geerlingguy/mac-dev-playbook +[3]: https://opensource.com/sites/default/files/uploads/organized.jpg (Organized bins of equipment) +[4]: https://www.ansible.com/products/tower +[5]: https://jenkins.io +[6]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html +[7]: https://galaxy.ansible.com +[8]: https://opensource.com/sites/default/files/uploads/test-early-often.jpg (A stack of computer boards) +[9]: https://molecule.readthedocs.io/en/stable/ +[10]: https://www.jeffgeerling.com/blog/2018/testing-your-ansible-roles-molecule +[11]: https://github.com/geerlingguy/ansible-role-apache +[12]: https://travis-ci.org/geerlingguy/ansible-role-apache +[13]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guides.html +[14]: https://opensource.com/sites/default/files/uploads/simplify-optimize.jpg (Charging AirPods) +[15]: https://www.jeffgeerling.com/blog/2019/make-your-ansible-playbooks-flexible-maintainable-and-scalable-ansiblefest-austin-2018 +[16]: https://www.youtube.com/watch?v=kNDL13MJG6Y From d37116e9ad28c2742744a6f7189f9eacfd7b7b01 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 00:58:54 +0800 Subject: [PATCH 148/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=20Use=20?= =?UTF-8?q?Emacs=20to=20get=20social=20and=20track=20your=20todo=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 Use Emacs to get social and track your todo list.md --- ... to get social and track your todo list.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/tech/20200129 Use Emacs to get social and track your todo list.md diff --git a/sources/tech/20200129 Use Emacs to get social and track your todo list.md b/sources/tech/20200129 Use Emacs to get social and track your todo list.md new file mode 100644 index 0000000000..3893aac377 --- /dev/null +++ b/sources/tech/20200129 Use Emacs to get social and track your todo list.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Emacs to get social and track your todo list) +[#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use Emacs to get social and track your todo list +====== +Access Twitter, Reddit, chat, email, RSS, and your todo list in the +nineteenth in our series on 20 ways to be more productive with open +source in 2020. +![Team communication, chat][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Doing (almost) all the things with Emacs, part 2 + +[Yesterday][2], I talked about how to read email, access your addresses, and show calendars in Emacs. Emacs has tons and tons of functionality, and you can also use it for Twitter, chatting, to-do lists, and more! + +![All the things with Emacs][3] + +To do all of this, you need to install some Emacs packages. As you did yesterday, open the Emacs package manager with **Meta**+**x package-manager** (Meta is **Alt** on most keyboards or **Option** on MacOS). Now select the following packages with **i**, then install them by typing **x**: + + +``` +nnreddit +todotxt +twittering-mode +``` + +Once they are installed, open **~/.emacs.d/init.el** with **Ctrl**+**x Ctrl**+**x**, and add the following before the **(custom-set-variables** line: + + +``` +;; Todo.txt +(require 'todotxt) +(setq todotxt-file (expand-file-name "~/.todo/todo.txt")) + +;; Twitter +(require 'twittering-mode) +(setq twittering-use-master-password t) +(setq twittering-icon-mode t) + +;; Python3 for nnreddit +(setq elpy-rpc-python-command "python3") +``` + +Save the file with **Ctrl**+**x Ctrl**+**a**, exit Emacs with **Ctrl**+**x Ctrl**+**c**, then restart Emacs. + +#### Tweet from Emacs with twittering-mode + +![Twitter in Emacs][4] + +[Twittering-mode][5] is one of the best Emacs interfaces for Twitter. It supports almost all the features of Twitter and has some easy-to-use keyboard shortcuts. + +To get started, type **Meta**+**x twit** to launch twittering-mode. It will give a URL to open—and prompt you to launch a browser with it if you want—so you can log in and get an authorization token. Copy and paste the token into Emacs, and your Twitter timeline should load. You can scroll with the **Arrow** keys, use **Tab** to move from item to item, and press **Enter** to view the URL the cursor is on. If the cursor is on a username, pressing **Enter** will open that timeline in a web browser. If you are on a tweet's text, pressing **Enter** will reply to that tweet. You can create a new tweet with **u**, retweet something with **Ctrl**+**c**+**Enter**, and send a direct message with **d**—the dialog it opens has instructions on how to send, cancel, and shorten URLs. + +Pressing **V** will open a prompt to get to other timelines. To open your mentions, type **:mentions**. The home timeline is **:home**, and typing a username will take you to that user's timeline. Finally, pressing **q** will quit twittering-mode and close the window. + +There is a lot more functionality available in twittering-mode, and I encourage you to read the [full list][6] on its GitHub page. + +#### Track your to-do's in Emacs with Todotxt.el + +![todo.txt in emacs][7] + +[Todotxt.el][8] is a nice interface for the [todo.txt][9] to-do list manager. It has hotkeys for just about everything. + +To start it up, type **Meta**+**x todotxt**, and it will load the todo.txt file you specified in the **todotxt-file** variable (which you set in the first part of this article). Inside the buffer (window) for todo.txt, you can press **a** to add a new task and **c** to mark it complete. You can set priorities with **r**, and add projects and context to an item with **t**. When you are ready to move everything to **done.txt**, just press **A**. And you can filter the list with **/** or refresh back to the full list with **l**. And again, you can press **q** to exit. + +#### Chat in Emacs with ERC + +![Chatting with erc][10] + +One of Vim's shortcomings is that trying to use chat with it is difficult (at best). Emacs, on the other hand, has the [ERC][11] client built into the default distribution. Start ERC with **Meta**+**x erc**, and you will be prompted for a server name, username, and password. You can use the same information you used a few days ago when you set up [BitlBee][12]: server **localhost**, port **6667**, and the same username with no password. It should be the same as using almost any other IRC client. Each channel will be split into a new buffer (window), and you can switch between them with **Ctrl**+**x Ctrl**+**b**, which also switches between other buffers in Emacs. The **/quit** command will exit ERC. + +#### Read email, Reddit, and RSS feeds with Gnus + +![Mail, Reddit, and RSS feeds with Gnus][13] + +I'm sure many long-time Emacs users were asking, "but what about [Gnus][14]?" yesterday when I was talking about reading mail in Emacs. And it's a valid question. Gnus is a mail and newsreader built into Emacs, although it doesn't support [Notmuch][15] as a mail reader, just as a search engine. However, if you are configuring it for Reddit and RSS feeds (as you'll do in a moment), it's smart to add in mail functionality as well. + +Gnus was created for reading Usenet News and grew from there. So, a lot of its look and feel (and terminology) seem a lot like a Usenet newsreader. + +Gnus has its own configuration file in **~/.gnus** (the configuration can also be included in the main **~/.emacs.d/init.el**). Open **~/.gnus** with **Ctrl**+**x Ctrl**+**f** and add the following: + + +``` +;; Required packages +(require 'nnir) +(require 'nnrss) + +;; Primary Mailbox +(setq gnus-select-method +      '(nnmaildir "Local" +                  (directory "~/Maildir") +                  (nnir-search-engine notmuch) +      )) +(add-to-list 'gnus-secondary-select-methods +             '(nnreddit "")) +``` + +Save the file with **Ctrl**+**x Ctrl**+**s**. This tells Gnus to read mail from the local mailbox in **~/Maildir** as the primary source (**gnus-select-method**) and add a second source (**gnus-secondary-select-methods**) using the [nnreddit][16] plugin. You can also define multiple secondary sources, including Usenet News (nntp), IMAP (nnimap), mbox (nnmbox), and virtual collections (nnvirtual). You can learn more about all the options in the [Gnus manual][17]. + +Once you save the file, start Gnus with **Meta**+**x gnus**. The first run will install [Reddit Terminal Viewer][18] in a Python virtual environment, which is how it gets Reddit articles. It will then launch your browser to log into Reddit. After that, it will scan and load your subscribed Reddit groups. You will see a list of email folders with new mail and the list of subreddits with new content. Pressing **Enter** on any of them will load the list of messages for the group. You can navigate with the **Arrow** keys and press **Enter** to load and read a message. Pressing **q** will go back to the prior view when viewing message lists, and pressing **q** from the main window will exit Gnus. When reading a Reddit group, **a** creates a new message; in a mail group, **m** creates a new email; and **r** replies to messages in either view. + +You can also add RSS feeds to the Gnus interface and read them like mail and newsgroups. To add an RSS feed, type **G**+**R** and fill in the RSS feed's URL. You will be prompted for the title and description of the feed, which should be auto-filled from the feed. Now type **g** to check for new messages (this checks for new messages in all groups). Reading a feed is like reading Reddit groups and mail, so it uses the same keys. + +There is a _lot_ of functionality in Gnus, and there are a whole lot more key combinations. The [Gnus Reference Card][19] lists all of them for each view (on five pages in very small type). + +#### See your position with nyan-mode + +As a final note, you might notice [Nyan cat][20] at the bottom of some of my screenshots. This is [nyan-mode][21], which indicates where you are in a buffer, so it gets longer as you get closer to the bottom of a document or buffer. You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: + + +``` +;; Nyan Cat +(setq nyan-wavy-trail t) +(setq nyan-bar-length 20) +(nyan-mode) +``` + +### Scratching Emacs' surface + +This is just scratching the surface of all the things you can do with Emacs. It is _very_ powerful, and it is one of my go-to tools for being productive whether I'm tracking to-dos, reading and responding to mail, editing text, or chatting with my friends and co-workers. It takes a bit of getting used to, but once you do, it can become one of the most useful tools on your desktop. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/emacs-social-track-todo-list + +作者:[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/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/20/1/emacs-mail-calendar +[3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) +[4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) +[5]: https://github.com/hayamiz/twittering-mode +[6]: https://github.com/hayamiz/twittering-mode#features +[7]: https://opensource.com/sites/default/files/uploads/productivity_19-3.png (todo.txt in emacs) +[8]: https://github.com/rpdillon/todotxt.el +[9]: http://todotxt.org/ +[10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) +[11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html +[12]: https://opensource.com/article/20/1/open-source-chat-tool +[13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) +[14]: https://www.gnus.org/ +[15]: https://opensource.com/article/20/1/organize-email-notmuch +[16]: https://github.com/dickmao/nnreddit +[17]: https://www.gnus.org/manual/gnus.html +[18]: https://pypi.org/project/rtv/ +[19]: https://www.gnu.org/software/emacs/refcards/pdf/gnus-refcard.pdf +[20]: http://www.nyan.cat/ +[21]: https://github.com/TeMPOraL/nyan-mode From a2672d1ae8dd70fcb0cb8186a296a66fe0b24290 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 00:59:23 +0800 Subject: [PATCH 149/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=207=20op?= =?UTF-8?q?en=20source=20desktop=20tools:=20Download=20our=20new=20eBook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 7 open source desktop tools- Download our new eBook.md --- ...e desktop tools- Download our new eBook.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20200129 7 open source desktop tools- Download our new eBook.md diff --git a/sources/tech/20200129 7 open source desktop tools- Download our new eBook.md b/sources/tech/20200129 7 open source desktop tools- Download our new eBook.md new file mode 100644 index 0000000000..303f86919c --- /dev/null +++ b/sources/tech/20200129 7 open source desktop tools- Download our new eBook.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 open source desktop tools: Download our new eBook) +[#]: via: (https://opensource.com/article/20/1/open-source-desktop-tools-guide) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +7 open source desktop tools: Download our new eBook +====== +Choice is more than a feature of Linux; it's a way of life thanks to a +wealth of open source tools. +![Browser of things][1] + +Linux users say that choice is one of the platform's strengths. On the surface, this might sound self-aggrandizing (or self-deprecating, depending on your perspective). Other operating systems offer choice, too, but once you look at the options available for nearly anything you want to do on Linux, it doesn't take long to conclude that a new word ought to be invented for what we mean by "choice." + +User choice isn't a "feature" of Linux; it's a way of life. Whether you're looking for a whole new desktop or just a new system tray, Linux hackers provide you options. You might also be able to hack some simple commands together to create a batch processor for yourself—and you might publish it online for others, thereby contributing to the array of choice. + +With so many options available, it can be a real challenge to find the solutions you prefer. One of the most effective ways to discover cool new things in the Linux world is through personal recommendation. That's one of the many reasons Opensource.com covers what might seem like random applications—through sharing your experiences with software, others can discover new applications to love without the pain of rummaging through piles of choice. + +### Sharing and open source + +Obviously, you can share software _recommendations_ with friends, whether the software is open source or not. However, in the proprietary world, you can't share the software that you're recommending, and in the world of proprietary software as a service (SaaS), part of the act of sharing is the key component to a pyramid scheme for more user data. It's not quite the same as the no-strings-attached gift of open source. + +Sharing is an integral part of free and open source software. It's one of the [four freedoms][2] defined by the Free Software Foundation, and it's the central concern of [Creative Commons][3]. + +While it's easy to fall into the trap of viewing open source sharing as something that applies only to lines of sometimes cryptic-looking code, it goes well beyond that. Sharing is almost endemic to open culture, explicitly allowing and encouraging it on every level, from code, to tutorials and tips, to physical redistribution of a wealth of common goods and services. Part of that is the simple act of telling others about a cool technology that has improved the way we work and live. + +### Download the eBook + +Opensource.com contributor and productivity aficionado Kevin Sonney has shared many of his favorite desktop applications in our latest eBook, [7 open source desktop tools][4]. As is often the case in the open source world, he doesn't just share his knowledge about his favorite desktop tools, he explains how and why he chooses those tools to help you can evaluate them for yourself. Download it today! + +### [Download the 7 open source desktop tools eBook][4] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-desktop-tools-guide + +作者:[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/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://www.gnu.org/philosophy/free-sw.en.html +[3]: https://creativecommons.org +[4]: https://opensource.com/downloads/desktop-tools From f6c1490ac95dd5eef58654e31002d511b1c0b16a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 01:00:31 +0800 Subject: [PATCH 150/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200130=20Intel?= =?UTF-8?q?=20denies=20reports=20of=20Xeon=20shortage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200130 Intel denies reports of Xeon shortage.md --- ...0 Intel denies reports of Xeon shortage.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20200130 Intel denies reports of Xeon shortage.md diff --git a/sources/talk/20200130 Intel denies reports of Xeon shortage.md b/sources/talk/20200130 Intel denies reports of Xeon shortage.md new file mode 100644 index 0000000000..fce436ea0a --- /dev/null +++ b/sources/talk/20200130 Intel denies reports of Xeon shortage.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel denies reports of Xeon shortage) +[#]: via: (https://www.networkworld.com/article/3516392/intel-denies-reports-of-xeon-shortage.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel denies reports of Xeon shortage +====== +The PC side of Intel's Xeon processor supply remains constrained, but server customers should get their orders this year. +Intel + +Intel has denied reports that its Xeon supply chain is suffering the same constraints as its PC desktop/laptop business. CEO Bob Swan said during the company's recent earnings call that its inventory was depleted but customers are getting orders. + +The issue blew up last week when HPE – one of Intel's largest server OEM partners – reportedly [told UK-based publication The Register][1] that there were supply constraints with Cascade Lake processors, the most recent generation of Xeon Scalable processors, and urged HPE customers "to consider alternative processors." HPE did not clarify if it meant Xeon processors other than Cascade Lake or AMD Epyc processors. + +AMD must have loved that. + +[][2] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][2] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +At the time, Intel was in the quiet period prior to announcing fourth quarter 2019 results, so when I initially approached them for comment, company executives could not answer. But on last week’s earnings call, Swan set the record straight. While supply of desktop CPUs remains constrained, especially on the low-end, Xeon supply is in “pretty good shape,” as he put it, even after a 19% growth in demand for the quarter. + +“When you have that kind of spike in demand, we are not perfect across all products or all SKUs. But server CPUs, we really prioritize that and try to put ourselves in a position where we are not constrained, and we are in pretty good shape. Pretty great shape, macro. Micro, a few challenges here and there. But server CPU supply is pretty good,” he [said on an earnings call][3] with Wall Street analysts. + +Intel CFO George Davis added that supply is expected to improve in the second half of this year, across the board, thanks to an expansion of production capacity. "In the second half of the year we would expect to be able to bring both our server products and, most importantly, our PC products back to a more normalized inventory level," Davis said. + +Intel’s data center group had record revenue of $7.2 billion in Q4 2019, up 19% from Q4 2018. In particular, cloud revenue was up 48% year-over-year as cloud service providers continue building out crazy levels of capacity. + +**[ Check out our [12 most powerful hyperconverged infrasctructure vendors][4]. | Get regularly scheduled insights by [signing up for Network World newsletters][5]. ]** + +Hyperscalers like Amazon and Google are building data centers the size of football stadiums and filling them with tens of thousands of servers at a time. I’ve heard concerns about this trend of a half-dozen or so companies hoovering up all of the supply of CPUs, memory, flash and traditional disk, and so on, but so far any real shortages have not come to pass. + +Perhaps not surprisingly, Intel's enterprise and government revenue was down 7% as more and more companies reduce their data center footprint, while communication and service providers' revenue grew 14% as customers continue to adopt AI-based solutions to transform their networks and transition to 5G. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3516392/intel-denies-reports-of-xeon-shortage.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.theregister.co.uk/2020/01/20/intel_hpe_xeon_shortage/ +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://seekingalpha.com/article/4318803-intel-corporation-intc-ceo-bob-swan-on-q4-2019-results-earnings-call-transcript?part=single +[4]: https://www.networkworld.com/article/3112622/hardware/12-most-powerful-hyperconverged-infrastructure-vendors.htmll +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From ccd604a3bb7a5a7069f382cdac1e7fe8a0753353 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 01:03:09 +0800 Subject: [PATCH 151/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=20You=20?= =?UTF-8?q?can=20now=20have=20a=20Mac=20Pro=20in=20your=20data=20center?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200129 You can now have a Mac Pro in your data center.md --- ... now have a Mac Pro in your data center.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20200129 You can now have a Mac Pro in your data center.md diff --git a/sources/talk/20200129 You can now have a Mac Pro in your data center.md b/sources/talk/20200129 You can now have a Mac Pro in your data center.md new file mode 100644 index 0000000000..f779534e5f --- /dev/null +++ b/sources/talk/20200129 You can now have a Mac Pro in your data center.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You can now have a Mac Pro in your data center) +[#]: via: (https://www.networkworld.com/article/3516490/you-can-now-have-a-mac-pro-in-your-data-center.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +You can now have a Mac Pro in your data center +====== +The company that once eschewed the enterprise now has a server version of the Mac Pro. Apple's rack-mountable Mac Pro starts at $6,499. +Apple + +Steve Jobs rather famously said he hated the enterprise because the people who use the product have no say in its purchase. Well, Apple's current management has adopted the enterprise, ever so slowly, and is now shipping its first server in years. Sort of. + +Apple introduced a new version of the Mac Pro in December 2019, after a six-year gap in releases, and said it would make the computer rack-mountable for data centers. But at the time, all the attention was on the computer’s aesthetics, because it looked like a cheese grater. The other bit of focus was on the price; a fully decked Mac Pro cost an astronomical $53,799. Granted, that did include specs like 1.5TB of DRAM and 8TB of SSD storage. Those are impressive specs for a server, although the price is still a little crazy. + +Earlier this month, Apple quietly delivered on the promise to make the Mac Pro rack-mountable. The Mac Pro rack configuration comes with a $500 premium over the cost of the standing tower, which means it starts at $6,499. + +[][1] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][1] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +That gives you an 8-core Intel Xeon W CPU, 32GB of memory, a Radeon Pro 580X GPU, and 256GB of SSD storage. Most importantly, it gives you the rack mounting rails (which ship in a separate box for some reason) needed to install it in a cabinet. Once installed, the Mac Pro is roughly the size of a 4U server. + +Mac Pros are primarily used in production facilities, where they are used with other audio and video production hardware. MacStadium, a Mac developer with its own data centers, has been installing and testing the servers and thus far has had high praise for both the [ease of install][2] and [performance][3]. + +The server-ready version features a slight difference in its case, according to people who have tested it. The twist handle on the Mac Pro case is replaced with two lock switches that allow the case to be removed to access the internal components. It comes with two Thunderbolt 3 ports and a power button. + +The Mac Pro may be expensive, but you get a lot of performance for your money. Popular YouTube Mac enthusiast Marques Brownlee [tested it out][4] on a 8k resolution video encoding job. Brownlee found a MacBook Pro took 20 minutes to render the five-minute-long video, a iMac Pro desktop took 12 minutes, and the Mac Pro processed the video in 4:20. So the Mac Pro encoded 8k resolution video faster than real time. + +**[ Learn [how server disaggregation can boost data center efficiency][5] and [how Windows Server 2019 embraces hyperconverged data centers][6] . | Get regularly scheduled insights by [signing up for Network World newsletters][7]. ]** + +Apple’s last server was the Xserve, killed off in 2010 after several years of neglect. Instead, it made a version of MacOS for the whole Mac line that would let the hardware be run as a server, which is exactly what the new rack-mountable version of the Mac Pro is. + +MacStadium is doing benchmarks like Node.js, a JavaScript runtime. It will be interesting to see if anyone outside of audio/video encoding uses a Mac Pro in their data centers. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3516490/you-can-now-have-a-mac-pro-in-your-data-center.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[2]: https://twitter.com/brianstucki/status/1219299028791226368 +[3]: https://blog.macstadium.com/blog/2019-mac-pros-at-macstadium +[4]: https://www.youtube.com/watch?v=DOPswcaSsu8&t= +[5]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html +[6]: https://www.networkworld.com/article/3263718/software/windows-server-2019-embraces-hybrid-cloud-hyperconverged-data-centers-linux.html +[7]: https://www.networkworld.com/newsletters/signup.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 176f883711443e3ecb50417b5a080f73f14aa849 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Jan 2020 01:05:20 +0800 Subject: [PATCH 152/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200129=20Showin?= =?UTF-8?q?g=20memory=20usage=20in=20Linux=20by=20process=20and=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200129 Showing memory usage in Linux by process and user.md --- ...mory usage in Linux by process and user.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20200129 Showing memory usage in Linux by process and user.md diff --git a/sources/tech/20200129 Showing memory usage in Linux by process and user.md b/sources/tech/20200129 Showing memory usage in Linux by process and user.md new file mode 100644 index 0000000000..8e21baf042 --- /dev/null +++ b/sources/tech/20200129 Showing memory usage in Linux by process and user.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Showing memory usage in Linux by process and user) +[#]: via: (https://www.networkworld.com/article/3516319/showing-memory-usage-in-linux-by-process-and-user.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Showing memory usage in Linux by process and user +====== +There are several commands for checking up on memory usage in a Linux system, and here are some of the better ones. +[Fancycrave][1] [(CC0)][2] + +There are a lot of tools for looking at memory usage on Linux systems. Some are commonly used commands like **free** and **ps** while others are tools like **top** that allow you to display system performance stats in various ways. In this post, we’ll look at some commands that can be most helpful in identifying the users and processes that are using the most memory. + +Here are some that address memory usage by process. + +### Using top + +One of the best commands for looking at memory usage is **top**. One extremely easy way to see what processes are using the most memory is to start **top** and then press **shift+m** to switch the order of the processes shown to rank them by the percentage of memory each is using. Once you’ve entered **shift+m**, your top output should reorder the task entries to look something like this: + +[][3] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][3] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +``` +$top +top - 09:39:34 up 5 days, 3 min, 3 users, load average: 4.77, 4.43, 3.72 +Tasks: 251 total, 3 running, 247 sleeping, 1 stopped, 0 zombie +%Cpu(s): 50.6 us, 35.9 sy, 0.0 ni, 13.4 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st +MiB Mem : 5944.4 total, 128.9 free, 2509.3 used, 3306.2 buff/cache +MiB Swap: 2048.0 total, 2045.7 free, 2.2 used. 3053.5 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 400 nemo 20 0 3309580 550188 168372 S 0.3 9.0 1:33.27 Web Content +32469 nemo 20 0 3492840 447372 163296 S 7.3 7.3 3:55.60 firefox +32542 nemo 20 0 2845732 433388 140984 S 6.0 7.1 4:11.16 Web Content + 342 nemo 20 0 2848520 352288 118972 S 10.3 5.8 4:04.89 Web Content + 2389 nemo 20 0 1774412 236700 90044 S 39.7 3.9 9:32.64 vlc +29527 nemo 20 0 2735792 225980 84744 S 9.6 3.7 3:02.35 gnome-shell +30497 nemo 30 10 1088476 159636 88884 S 0.0 2.6 0:11.99 update-manager +30058 nemo 20 0 1089464 140952 33128 S 0.0 2.3 0:04.58 gnome-software +32533 nemo 20 0 2389088 104712 79544 S 0.0 1.7 0:01.43 WebExtensions + 2256 nemo 20 0 1217884 103424 31304 T 0.0 1.7 0:00.28 vlc + 1713 nemo 20 0 2374396 79588 61452 S 0.0 1.3 0:00.49 Web Content +29306 nemo 20 0 389668 74376 54340 S 2.3 1.2 0:57.25 Xorg +32739 nemo 20 0 289528 58900 34480 S 1.0 1.0 1:04.08 RDD Process +29732 nemo 20 0 789196 57724 42428 S 0.0 0.9 0:00.38 evolution-alarm + 2373 root 20 0 150408 57000 9924 S 0.3 0.9 10:15.35 nessusd +``` + +Notice the **%MEM** ranking. The list will be limited by your window size, but the most significant processes with respect to memory usage will show up at the top of the process list. + +### Using ps + +The **ps** command includes a column that displays memory usage for each process. To get the most useful display for viewing the top memory users, however, you can pass the **ps** output from this command to the **sort** command. Here’s an example that provides a very useful display: + +``` +$ ps aux | sort -rnk 4 | head -5 +nemo 400 3.4 9.2 3309580 563336 ? Sl 08:59 1:36 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 9086 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 32469 8.2 7.7 3492840 469516 ? Sl 08:54 4:15 /usr/lib/firefox/firefox -new-window +nemo 32542 8.9 7.6 2875428 462720 ? Sl 08:55 4:36 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 1 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 342 9.9 5.9 2854664 363528 ? Sl 08:59 4:44 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 8763 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 2389 39.5 3.8 1774412 236116 pts/1 Sl+ 09:15 12:21 vlc videos/edge_computing.mp4 +``` + +In the example above (truncated for this post), sort is being used with the **-r** (reverse), the **-n** (numeric) and the **-k** (key) options which are telling the command to sort the output in reverse numeric order based on the fourth column (memory usage) in the output from **ps**. If we first display the heading for the **ps** output, this is a little easier to see. + +``` +$ ps aux | head -1; ps aux | sort -rnk 4 | head -5 +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +nemo 400 3.4 9.2 3309580 563336 ? Sl 08:59 1:36 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 9086 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 32469 8.2 7.7 3492840 469516 ? Sl 08:54 4:15 /usr/lib/firefox/firefox -new-window +nemo 32542 8.9 7.6 2875428 462720 ? Sl 08:55 4:36 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 1 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 342 9.9 5.9 2854664 363528 ? Sl 08:59 4:44 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 8763 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 2389 39.5 3.8 1774412 236116 pts/1 Sl+ 09:15 12:21 vlc videos/edge_computing.mp4 +``` + +If you like this command, you can set it up as an alias with a command like the one below. Don't forget to add it to your ~/.bashrc file if you want to make it permanent. + +``` +$ alias mem-by-proc="ps aux | head -1; ps aux | sort -rnk 4" +``` + +Here are some commands that reveal memory usage by user. + +### Using top + +Examining memory usage by user is somewhat more complicated because you have to find a way to group all of a user’s processes into a single memory-usage total. + +If you want to home in on a single user, **top** can be used much in the same way that it was used above. Just add a username with the -U option as shown below and press the **shift+m** keys to order by memory usage: + +``` +$ top -U nemo +top - 10:16:33 up 5 days, 40 min, 3 users, load average: 1.91, 1.82, 2.15 +Tasks: 253 total, 2 running, 250 sleeping, 1 stopped, 0 zombie +%Cpu(s): 28.5 us, 36.8 sy, 0.0 ni, 34.4 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st +MiB Mem : 5944.4 total, 224.1 free, 2752.9 used, 2967.4 buff/cache +MiB Swap: 2048.0 total, 2042.7 free, 5.2 used. 2812.0 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 400 nemo 20 0 3315724 623748 165440 S 1.0 10.2 1:48.78 Web Content +32469 nemo 20 0 3629380 607492 161688 S 2.3 10.0 6:06.89 firefox +32542 nemo 20 0 2886700 404980 136648 S 5.6 6.7 6:50.01 Web Content + 342 nemo 20 0 2922248 375784 116096 S 19.5 6.2 8:16.07 Web Content + 2389 nemo 20 0 1762960 234644 87452 S 0.0 3.9 13:57.53 vlc +29527 nemo 20 0 2736924 227260 86092 S 0.0 3.7 4:09.11 gnome-shell +30497 nemo 30 10 1088476 156372 85620 S 0.0 2.6 0:11.99 update-manager +30058 nemo 20 0 1089464 138160 30336 S 0.0 2.3 0:04.62 gnome-software +32533 nemo 20 0 2389088 102532 76808 S 0.0 1.7 0:01.79 WebExtensions +``` + +### Using ps + +You can also use a **ps** command to rank an individual user's processes by memory usage. In this example, we do this by selecting a single user's processes with a **grep** command: + +``` +$ ps aux | head -1; ps aux | grep ^nemo| sort -rnk 4 | more +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +nemo 32469 7.1 11.5 3724364 701388 ? Sl 08:54 7:21 /usr/lib/firefox/firefox -new-window +nemo 400 2.0 8.9 3308556 543232 ? Sl 08:59 2:01 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 9086 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni/usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 32542 7.9 7.1 2903084 436196 ? Sl 08:55 8:07 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 1 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 342 10.8 7.0 2941056 426484 ? Rl 08:59 10:45 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 8763 -prefMapSize 210653 -parentBuildID 20200107212822 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32469 true tab +nemo 2389 16.9 3.8 1762960 234644 pts/1 Sl+ 09:15 13:57 vlc videos/edge_computing.mp4 +nemo 29527 3.9 3.7 2736924 227448 ? Ssl 08:50 4:11 /usr/bin/gnome-shell +``` + +### Using ps along with other commands + +What gets complicated is when you want to compare users' memory usages with each other. In that case, creating a by-user total and ranking them is a good technique, but it requires a little more work and uses a number of commands. In the script below, we get a list of users with the **ps aux | grep -v COMMAND | awk '{print $1}' | sort -u** command. This includes system users like **syslog**. We then collect stats for each user and total the memory usage stat for each task with **awk**. As a last step, we display each user's memory usage sum in numerical (largest first) order. + +``` +#!/bin/bash + +stats=”” +echo "% user" +echo "============" + +# collect the data +for user in `ps aux | grep -v COMMAND | awk '{print $1}' | sort -u` +do + stats="$stats\n`ps aux | egrep ^$user | awk 'BEGIN{total=0}; \ + {total += $4};END{print total,$1}'`" +done + +# sort data numerically (largest first) +echo -e $stats | grep -v ^$ | sort -rn | head +``` + +Output from this script might look like this: + +``` +$ ./show_user_mem_usage +% user +============ +69.6 nemo +5.8 root +0.5 www-data +0.3 shs +0.2 whoopsie +0.2 systemd+ +0.2 colord +0.2 clamav +0 syslog +0 rtkit +``` + +There are a lot of ways to report on memory usage on Linux. Focusing on which processes and users are consuming the most memory can benefit from a few carefully crafted tools and commands. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3516319/showing-memory-usage-in-linux-by-process-and-user.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://unsplash.com/photos/37LPYOkEE2o +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 96dbdb6cea61a94b6ef2eb674d7e1b9c2c897354 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 11:14:00 +0800 Subject: [PATCH 153/285] PUB @alim0x https://linux.cn/article-11831-1.html --- .../20191108 My Linux story- Learning Linux in the 90s.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20191108 My Linux story- Learning Linux in the 90s.md (100%) diff --git a/translated/talk/20191108 My Linux story- Learning Linux in the 90s.md b/published/20191108 My Linux story- Learning Linux in the 90s.md similarity index 100% rename from translated/talk/20191108 My Linux story- Learning Linux in the 90s.md rename to published/20191108 My Linux story- Learning Linux in the 90s.md From ab7d0cd7f509de585c35970424ca7b53397e6955 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 11:56:53 +0800 Subject: [PATCH 154/285] PRF @laingke --- ...to inter-process communication in Linux.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md index b88af1f2ca..893e9f9ff3 100644 --- a/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md +++ b/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md @@ -1,24 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (laingke) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Introducing the guide to inter-process communication in Linux) [#]: via: (https://opensource.com/article/20/1/inter-process-communication-linux) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Linux 进程间通信介绍指南 +免费电子书《Linux 进程间通信指南》介绍 ====== -这本免费的电子书使经验丰富的程序员更深入了解 Linux 中进程间通信(IPC)的核心概念和机制。 -![Inter-process Communication in Linux][1] -让一个软件过程与另一个软件过程进行对话是一个微妙的平衡行为。但是,它对于应用程序而言可能是至关重要的功能,因此这是任何从事复杂项目的程序员都必须解决的问题。你的应用程序是否需要启动由其它软件处理的工作;监视外设或网络上正在执行的操作;或者检测来自其它来源的信号,当你的软件需要依赖其自身代码之外的东西来知道下一步做什么或什么时候做时,你就需要考虑进程间通信(IPC)。 +> 这本免费的电子书使经验丰富的程序员更深入了解 Linux 中进程间通信(IPC)的核心概念和机制。 -Unix 操作系统在很久以前就说明了这一点,这可能是因为人们早就期望软件会来自各种来源。按照相同的传统,Linux 为 IPC 和一些新接口提供了许多相同的接口。Linux 内核具有几个 IPC 方法,[util-linux 包][2]包含 `ipcmk`、`ipcrm`、`ipcs` 和 `lsipc` 命令,用于监视和管理 IPC 消息。 +![](https://img.linux.net.cn/data/attachment/album/202001/30/115631jthl0h61zhhmwpv1.jpeg) + +让一个软件过程与另一个软件过程进行对话是一个微妙的平衡行为。但是,它对于应用程序而言可能是至关重要的功能,因此这是任何从事复杂项目的程序员都必须解决的问题。你的应用程序是否需要启动由其它软件处理的工作;监视外设或网络上正在执行的操作;或者检测来自其它来源的信号,当你的软件需要依赖其自身代码之外的东西来知道下一步做什么或什么时候做时,你就需要考虑进程间通信inter-process communication(IPC)。 + +这在 Unix 操作系统上已经由来已久了,这可能是因为人们早期预期软件会来自各种来源。按照相同的传统,Linux 提供了一些同样的 IPC 接口和一些新接口。Linux 内核具有多种 IPC 方法,[util-linux 包][2]包含了 `ipcmk`、`ipcrm`、`ipcs` 和 `lsipc` 命令,用于监视和管理 IPC 消息。 ### 显示进程间通信信息 -在尝试 IPC 之前,你应该知道系统上已经有哪些 IPC 工具。`lsipc` 命令提供了该信息。 +在尝试 IPC 之前,你应该知道系统上已经有哪些 IPC 设施。`lsipc` 命令提供了该信息。 ``` RESOURCE DESCRIPTION LIMIT USED USE% @@ -41,23 +43,23 @@ SEMVMX Semaphore max value 32767 - - ``` $ ipcs -\------ Message Queues Creators/Owners --- +------ Message Queues Creators/Owners --- msqid perms cuid cgid [...] -\------ Shared Memory Segment Creators/Owners +------ Shared Memory Segment Creators/Owners shmid perms cuid cgid [...] 557056 700 seth users [...] 3571713 700 seth users [...] 2654210 600 seth users [...] 2457603 700 seth users [...] -\------ Semaphore Arrays Creators/Owners --- +------ Semaphore Arrays Creators/Owners --- semid perms cuid cgid [...] ``` -这表明当前没有消息或信号量数组,但是使用了一些共享内存段。 +这表明当前没有消息或信号量阵列,但是使用了一些共享内存段。 -你可以在系统上执行一个简单的示例,这样就可以看到其中一个系统正在工作。它涉及到一些 C 代码,所以你必须在系统上有构建工具。必须安装才能从源代码构建的软件包的名称取决于发行版,因此请参考文档以获取详细信息。例如,在基于 Debian 的发行版上,你可以在 wiki 的[构建教程][3]部分了解构建需求,而在基于 Fedora 的发行版上,你可以参考文档的[从源代码安装软件][4]部分。 +你可以在系统上执行一个简单的示例,这样就可以看到正在工作的系统之一。它涉及到一些 C 代码,所以你必须在系统上有构建工具。必须安装这些软件包才能从源代码构建软件,这些软件包的名称取决于发行版,因此请参考文档以获取详细信息。例如,在基于 Debian 的发行版上,你可以在 wiki 的[构建教程][3]部分了解构建需求,而在基于 Fedora 的发行版上,你可以参考该文档的[从源代码安装软件][4]部分。 ### 创建一个消息队列 @@ -87,11 +89,10 @@ int main() { printf("Message: %s\n",message.text); printf("Queue: %d\n",msqid); return 0; -} + } ``` -编译应用程序并运行: - +编译该应用程序并运行: ``` $ gcc msgsend.c -o msg.bin @@ -100,19 +101,18 @@ Message: opensource.com Queue: 32769 ``` -你刚刚向消息队列发送了一条消息。你可以使用 `ipcs` 命令验证这一点,使用 `\——queue` 选项将输出限制到消息队列: - +你刚刚向你的消息队列发送了一条消息。你可以使用 `ipcs` 命令验证这一点,可以使用 `——queue` 选项将输出限制到该消息队列: ``` $ ipcs -q -\------ Message Queues -------- +------ Message Queues -------- key msqid owner perms used-bytes messages 0x7b341ab9 0 seth 666 0 0 0x72bd8410 32764 seth 644 24 1 ``` -你也可以检索这些讯息: +你也可以检索这些消息: ``` #include @@ -125,7 +125,7 @@ struct msgbuffer { int main() { int msqid = 32764; - msgrcv(msqid, &message, sizeof(message),0,0); + msgrcv(msqid, &message, sizeof(message),0,0); printf("\nQueue: %d\n",msqid); printf("Got this message: %s\n", message.text); msgctl(msqid,IPC_RMID,NULL); @@ -142,11 +142,11 @@ Queue: 32764 Got this message: opensource.com ``` -### 下载[电子书][5] +### 下载这本电子书 -这只是 Marty Kalin 的 [Linux 内进程间通信指南][5]中课程的一个例子,这是可从 Opensource.com 下载的最新免费(和知识共享)电子书。在短短的几节课中,你将从消息队列、共享内存和信号量、套接字、信号等中了解 IPC 的 POSIX 方法。认真阅读 Marty 的书,您将成为一个消息灵通的程序员。而这不仅适用于经验丰富的编码人员,如果你编写的只是 shell 脚本,那么你将拥有有关管道(命名和未命名)和共享文件的大量实践知识,以及使用共享文件或外部消息队列时需要了解的重要概念。 +这只是 Marty Kalin 的《[Linux 进程间通信指南][5]》中课程的一个例子,可从 Opensource.com 下载的这本最新免费(且 CC 授权)的电子书。在短短的几节课中,你将从消息队列、共享内存和信号量、套接字、信号等中了解 IPC 的 POSIX 方法。认真阅读 Marty 的书,你将成为一个博识的程序员。而这不仅适用于经验丰富的编码人员,如果你编写的只是 shell 脚本,那么你将拥有有关管道(命名和未命名)和共享文件的大量实践知识,以及使用共享文件或外部消息队列时需要了解的重要概念。 -如果你对制作具有动态和系统意识的优秀软件感兴趣,那么你需要了解 IPC。让[这本书][5]做你的向导。 +如果你对制作具有动态和具有系统感知的优秀软件感兴趣,那么你需要了解 IPC。让[这本书][5]做你的向导。 -------------------------------------------------------------------------------- @@ -155,7 +155,7 @@ via: https://opensource.com/article/20/1/inter-process-communication-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[laingke](https://github.com/laingke) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d7f127d21263b93ac6b5180900e8b956d6f19117 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 11:57:33 +0800 Subject: [PATCH 155/285] PUB @laingke https://linux.cn/article-11832-1.html --- ...ucing the guide to inter-process communication in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200103 Introducing the guide to inter-process communication in Linux.md (98%) diff --git a/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/published/20200103 Introducing the guide to inter-process communication in Linux.md similarity index 98% rename from translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md rename to published/20200103 Introducing the guide to inter-process communication in Linux.md index 893e9f9ff3..91a1f7821b 100644 --- a/translated/tech/20200103 Introducing the guide to inter-process communication in Linux.md +++ b/published/20200103 Introducing the guide to inter-process communication in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (laingke) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11832-1.html) [#]: subject: (Introducing the guide to inter-process communication in Linux) [#]: via: (https://opensource.com/article/20/1/inter-process-communication-linux) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 96587bd45b043e49adec1728faec746222b41a14 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Jan 2020 14:13:55 +0800 Subject: [PATCH 156/285] translated --- ...en source tools to manage your contacts.md | 145 ------------------ ...en source tools to manage your contacts.md | 143 +++++++++++++++++ 2 files changed, 143 insertions(+), 145 deletions(-) delete mode 100644 sources/tech/20200116 3 open source tools to manage your contacts.md create mode 100644 translated/tech/20200116 3 open source tools to manage your contacts.md diff --git a/sources/tech/20200116 3 open source tools to manage your contacts.md b/sources/tech/20200116 3 open source tools to manage your contacts.md deleted file mode 100644 index e763954bcc..0000000000 --- a/sources/tech/20200116 3 open source tools to manage your contacts.md +++ /dev/null @@ -1,145 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 open source tools to manage your contacts) -[#]: via: (https://opensource.com/article/20/1/sync-contacts-locally) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -3 open source tools to manage your contacts -====== -Access your contacts more quickly by syncing them locally. Learn how in -the sixth in our series on 20 ways to be more productive with open -source in 2020. -![Team communication, chat][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Open source tools for contact management - -In previous articles in this series, I explained how to synchronize your [mail][2] and [calendars][3] locally. Hopefully, that has sped up accessing your mail and calendar. Now I'll talk about contacts, which you can use to send mail and calendar invites. - -![abook][4] - -I have collected a lot of email addresses over the course of my, well, life so far. And managing all that data can be a bit of a pain. There are web-based services, but they aren't as fast as a local copy. - -A few days ago, I talked about [vdirsyncer][5] for managing calendars. Vdirsyncer also handles contacts using the CardDAV protocol. Vdirsyncer supports **google_contacts** and **carddav** to do contact synchronizations in addition to the **filesystem** store it uses for calendars, but the **fileext** setting will change, so you won't be trying to store contacts in calendar files. - -I added a configuration block to the config file and mirrored my contacts from Google. Extra steps are required to set it up. Once the Google setup is complete, the configuration is pretty simple: - - -``` -[pair address_sync] -a = "googlecard" -b = "localcard" -collections = ["from a", "from b"] -conflict_resolution = "a wins" - -[storage googlecard] -type = "google_contacts" -token_file = "~/.vdirsyncer/google_token" -client_id = "my_client_id" -client_secret = "my_client_secret" - -[storage localcard] -type = "filesystem" -path = "~/.calendars/Addresses/" -fileext = ".vcf" -``` - -Now when I run **vdirsyncer discover**, it finds my Google contacts, and **vdirsyncer sync** copies them to my local machine. But again, that's only half the story. Now I want to read and use the contacts. Enter [khard][6] and [abook][7]. - -![khard search][8] - -Why two applications? Each has its own use case, and in this case, more is better. Khard does for addresses what [khal][9] does for calendar entries. You'll probably want to install the latest release via pip if your distribution ships an older version. Once khard is installed, you need to create **~/.config/khard/khard.conf** because khard doesn't have a nifty configuration wizard the way khal does. Mine looks like this: - - -``` -[addressbooks] -[[addresses]] -path = ~/.calendars/Addresses/default/ - -[general] -debug = no -default_action = list -editor = vim, -i, NONE -merge_editor = vimdiff - -[contact table] -display = first_name -group_by_addressbook = no -reverse = no -show_nicknames = yes -show_uids = no -sort = last_name -localize_dates = yes - -[vcard] -preferred_version = 3.0 -search_in_source_files = yes -skip_unparsable = no -``` - -This defines the source address book (and gives it a friendly name), as well as what to display and what do use to edit contacts. Running **khard list** will list all the entries, and **khard list <[some@email.adr][10]>** will search for a specific entry. If you want to add or edit an entry, the **add** and **edit** commands launch the configured editor with the same basic template, the only difference being that the **add** template will be blank. - -![editing in khard][11] - -Abook requires you to import and export VCF files but offers some nice features for lookups. To convert your files to the abook format, first install abook and create the **~/.abook** default directory. Now tell abook to parse all the files and put them into the **~/.abook/addresses** file: - - -``` -apt install abook -ls ~/.calendars/Addresses/default/* | xargs cat | abook --convert --informat vcard --outformat abook > ~/.abook/addresses -``` - -Now run **abook**, and you'll have a very nice UI to browse, search, and edit the entries. Exporting them back to individual entries is a bit of a pain, so I do most of my edits with khard and have a cron job to import them into abook. - -Abook can also search on the command line and has a lot of documentation about integrating it with mail clients. For example, you can use abook for lookups in the [Notmuch][12] email client [alot][13] by adding some information to the **.config/alot/config** file: - - -``` -[accounts] -  [[Personal]] -     realname = Kevin Sonney -     address = [kevin@sonney.com][14] -     alias_regexp = kevin\[+.+@sonney.com][15] -     gpg_key = 7BB612C9 -     sendmail_command = msmtp --account=Personal -t -     # ~ expansion works -     sent_box = maildir://~/Maildir/Sent -     draft_box = maildir://~/Maildir/Drafts -    [[[abook]]] -        type = abook -``` - -And there you have it: fast lookup of your contacts to go with your mail and calendars! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/sync-contacts-locally - -作者:[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/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/20/1/sync-email-offlineimap -[3]: https://opensource.com/article/20/1/open-source-calendar -[4]: https://opensource.com/sites/default/files/uploads/productivity_6-1.png (abook) -[5]: https://github.com/pimutils/vdirsyncer -[6]: https://github.com/scheibler/khard -[7]: http://abook.sourceforge.net/ -[8]: https://opensource.com/sites/default/files/uploads/productivity_6-2.png (khard search) -[9]: https://khal.readthedocs.io/en/v0.9.2/index.html -[10]: mailto:some@email.adr -[11]: https://opensource.com/sites/default/files/uploads/productivity_6-3.png (editing in khard) -[12]: https://opensource.com/article/20/1/organize-email-notmuch -[13]: https://github.com/pazz/alot -[14]: mailto:kevin@sonney.com -[15]: mailto:+.+@sonney.com diff --git a/translated/tech/20200116 3 open source tools to manage your contacts.md b/translated/tech/20200116 3 open source tools to manage your contacts.md new file mode 100644 index 0000000000..173d743c6d --- /dev/null +++ b/translated/tech/20200116 3 open source tools to manage your contacts.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools to manage your contacts) +[#]: via: (https://opensource.com/article/20/1/sync-contacts-locally) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +用于联系人管理的开源工具 +====== +通过将联系人同步到本地从而更快访问它。在我们的 20 个使用开源提升生产力的系列的第六篇文章中了解该如何做。 +![Team communication, chat][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 用于联系人管理的开源工具 + +在本系列之前的文章中,我解释了如何在本地同步你的[邮件][2]和[日历][3]。希望这些加速了你访问邮件和日历。现在,我将讨论联系人同步,你可以使用这些发送邮件和日历邀请。 + +![abook][4] + +我目前收集了很多邮件地址。管理这些数据可能有点麻烦。有基于 Web 的服务,但它们不如本地副本快。 + +几天前,我谈到了用于管理日历的 [vdirsyncer][5]。vdirsyncer 还使用 CardDAV 协议处理联系人。vdirsyncer 除了可以使用**文件系统**存储日历外,还支持 **google_contacts** 和 **carddav** 进行联系人同步,但 **fileext** 设置将更改,因此你无法在日历文件中存储联系人。 + +我在配置文件添加了一块配置,并从 Google 镜像了我的联系人。设置它需要额外的步骤。从 Google 镜像完成后,配置非常简单: + + +``` +[pair address_sync] +a = "googlecard" +b = "localcard" +collections = ["from a", "from b"] +conflict_resolution = "a wins" + +[storage googlecard] +type = "google_contacts" +token_file = "~/.vdirsyncer/google_token" +client_id = "my_client_id" +client_secret = "my_client_secret" + +[storage localcard] +type = "filesystem" +path = "~/.calendars/Addresses/" +fileext = ".vcf" +``` + +现在,当我运行 **vdirsyncer discover** 时,它会找到我的 Google 联系人,并且 **vdirsyncer sync** 将它们复制到我的本地计算机。但同样,这只进行到一半。现在我想查看和使用联系人。输入 [khard][6] 和 [abook][7]。 + +![khard search][8] + +为什么选择两个应用?因为每个都有它自己的使用场景,在这里,越多越好。khard 用于管理地址,类似于 [khal][9] 用于管理日历条目。如果你的发行版附带了旧版本,你可能需要通过 pip 安装最新版本。安装 khard 后,你需要创建 **~/.config/khard/khard.conf**,因为 khard 没有与 khal 那样漂亮的配置向导。我的看起来像这样: + + +``` +[addressbooks] +[[addresses]] +path = ~/.calendars/Addresses/default/ + +[general] +debug = no +default_action = list +editor = vim, -i, NONE +merge_editor = vimdiff + +[contact table] +display = first_name +group_by_addressbook = no +reverse = no +show_nicknames = yes +show_uids = no +sort = last_name +localize_dates = yes + +[vcard] +preferred_version = 3.0 +search_in_source_files = yes +skip_unparsable = no +``` + +这会定义源通讯簿(并给它一个友好的名称)、显示内容和联系人编辑程序。运行 **khard list** 将列出所有条目,**khard list <[some@email.adr][10]>** 可以搜索特定条目。如果要添加或编辑条目,**add** 和 **edit** 命令将使用相同的基本模板打开配置的编辑器,唯一的区别是 **add** 命令的模板将为空。 + +![editing in khard][11] + +abook 需要你导入和导出 VCF 文件,但它为查找提供了一些不错的功能。要将文件转换为 abook 格式,请先安装 abook 并创建 **~/.abook** 默认目录。然后让 abook 解析所有文件,并将它们放入 **~/.abook/addresses** 文件中: + + +``` +apt install abook +ls ~/.calendars/Addresses/default/* | xargs cat | abook --convert --informat vcard --outformat abook > ~/.abook/addresses +``` + +现在运行 **abook**,你将有一个非常好的 UI 来浏览、搜索和编辑条目。将它们导出到单个文件有点痛苦,所以我用 khard 进行大部分编辑,并有一个 cron 任务将它们导入到 abook 中。 + +abook 还可在命令行中搜索,并有大量有关将其与邮件客户端集成的文档。例如,你可以在 **.config/alot/config** 文件中添加一些信息,从而在 [Nmuch][12] 的邮件客户端 [alot][13] 中使用 abook 查询联系人: + + +``` +[accounts] +  [[Personal]] +     realname = Kevin Sonney +     address = [kevin@sonney.com][14] +     alias_regexp = kevin\[+.+@sonney.com][15] +     gpg_key = 7BB612C9 +     sendmail_command = msmtp --account=Personal -t +     # ~ expansion works +     sent_box = maildir://~/Maildir/Sent +     draft_box = maildir://~/Maildir/Drafts +    [[[abook]]] +        type = abook +``` + +这样你就可以在邮件和日历中快速查找联系人了! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/sync-contacts-locally + +作者:[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/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/20/1/sync-email-offlineimap +[3]: https://opensource.com/article/20/1/open-source-calendar +[4]: https://opensource.com/sites/default/files/uploads/productivity_6-1.png (abook) +[5]: https://github.com/pimutils/vdirsyncer +[6]: https://github.com/scheibler/khard +[7]: http://abook.sourceforge.net/ +[8]: https://opensource.com/sites/default/files/uploads/productivity_6-2.png (khard search) +[9]: https://khal.readthedocs.io/en/v0.9.2/index.html +[10]: mailto:some@email.adr +[11]: https://opensource.com/sites/default/files/uploads/productivity_6-3.png (editing in khard) +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://github.com/pazz/alot +[14]: mailto:kevin@sonney.com +[15]: mailto:+.+@sonney.com From 752f65fcc5bc0d503da9c9f5fe09eca8b8ee07ce Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Jan 2020 14:19:20 +0800 Subject: [PATCH 157/285] translating --- ... this open source tool to get your local weather forecast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200123 Use this open source tool to get your local weather forecast.md b/sources/tech/20200123 Use this open source tool to get your local weather forecast.md index 644bd80331..df44d3b659 100644 --- a/sources/tech/20200123 Use this open source tool to get your local weather forecast.md +++ b/sources/tech/20200123 Use this open source tool to get your local weather forecast.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e0168742bd38f2f803427b47dec1297be326e21a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 19:48:17 +0800 Subject: [PATCH 158/285] PRF @geekpi --- ...en source tools to manage your contacts.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/translated/tech/20200116 3 open source tools to manage your contacts.md b/translated/tech/20200116 3 open source tools to manage your contacts.md index 173d743c6d..01f4d57c98 100644 --- a/translated/tech/20200116 3 open source tools to manage your contacts.md +++ b/translated/tech/20200116 3 open source tools to manage your contacts.md @@ -1,32 +1,33 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 open source tools to manage your contacts) [#]: via: (https://opensource.com/article/20/1/sync-contacts-locally) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -用于联系人管理的开源工具 +用于联系人管理的三个开源工具 ====== -通过将联系人同步到本地从而更快访问它。在我们的 20 个使用开源提升生产力的系列的第六篇文章中了解该如何做。 -![Team communication, chat][1] + +> 通过将联系人同步到本地从而更快访问它。在我们的 20 个使用开源提升生产力的系列的第六篇文章中了解该如何做。 + +![](https://img.linux.net.cn/data/attachment/album/202001/30/194811bbtt449zfr9zppb3.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 用于联系人管理的开源工具 -在本系列之前的文章中,我解释了如何在本地同步你的[邮件][2]和[日历][3]。希望这些加速了你访问邮件和日历。现在,我将讨论联系人同步,你可以使用这些发送邮件和日历邀请。 +在本系列之前的文章中,我解释了如何在本地同步你的[邮件][2]和[日历][3]。希望这些加速了你访问邮件和日历。现在,我将讨论联系人同步,你可以给他们发送邮件和日历邀请。 ![abook][4] 我目前收集了很多邮件地址。管理这些数据可能有点麻烦。有基于 Web 的服务,但它们不如本地副本快。 -几天前,我谈到了用于管理日历的 [vdirsyncer][5]。vdirsyncer 还使用 CardDAV 协议处理联系人。vdirsyncer 除了可以使用**文件系统**存储日历外,还支持 **google_contacts** 和 **carddav** 进行联系人同步,但 **fileext** 设置将更改,因此你无法在日历文件中存储联系人。 +几天前,我谈到了用于管理日历的 [vdirsyncer][5]。vdirsyncer 还使用 CardDAV 协议处理联系人。vdirsyncer 除了可以使用**文件系统**存储日历外,还支持通过 **google_contacts** 和 **carddav** 进行联系人同步,但 `fileext` 设置会被更改,因此你无法在日历文件中存储联系人。 我在配置文件添加了一块配置,并从 Google 镜像了我的联系人。设置它需要额外的步骤。从 Google 镜像完成后,配置非常简单: - ``` [pair address_sync] a = "googlecard" @@ -46,12 +47,11 @@ path = "~/.calendars/Addresses/" fileext = ".vcf" ``` -现在,当我运行 **vdirsyncer discover** 时,它会找到我的 Google 联系人,并且 **vdirsyncer sync** 将它们复制到我的本地计算机。但同样,这只进行到一半。现在我想查看和使用联系人。输入 [khard][6] 和 [abook][7]。 +现在,当我运行 `vdirsyncer discover` 时,它会找到我的 Google 联系人,并且 `vdirsyncer sync` 将它们复制到我的本地计算机。但同样,这只进行到一半。现在我想查看和使用联系人。需要 [khard][6] 和 [abook][7]。 ![khard search][8] -为什么选择两个应用?因为每个都有它自己的使用场景,在这里,越多越好。khard 用于管理地址,类似于 [khal][9] 用于管理日历条目。如果你的发行版附带了旧版本,你可能需要通过 pip 安装最新版本。安装 khard 后,你需要创建 **~/.config/khard/khard.conf**,因为 khard 没有与 khal 那样漂亮的配置向导。我的看起来像这样: - +为什么选择两个应用?因为每个都有它自己的使用场景,在这里,越多越好。khard 用于管理地址,类似于 [khal][9] 用于管理日历条目。如果你的发行版附带了旧版本,你可能需要通过 `pip` 安装最新版本。安装 khard 后,你需要创建 `~/.config/khard/khard.conf`,因为 khard 没有与 khal 那样漂亮的配置向导。我的看起来像这样: ``` [addressbooks] @@ -79,36 +79,34 @@ search_in_source_files = yes skip_unparsable = no ``` -这会定义源通讯簿(并给它一个友好的名称)、显示内容和联系人编辑程序。运行 **khard list** 将列出所有条目,**khard list <[some@email.adr][10]>** 可以搜索特定条目。如果要添加或编辑条目,**add** 和 **edit** 命令将使用相同的基本模板打开配置的编辑器,唯一的区别是 **add** 命令的模板将为空。 +这会定义源通讯簿(并给它一个友好的名称)、显示内容和联系人编辑程序。运行 `khard list` 将列出所有条目,`khard list ` 可以搜索特定条目。如果要添加或编辑条目,`add` 和 `edit` 命令将使用相同的基本模板打开配置的编辑器,唯一的区别是 `add` 命令的模板将为空。 ![editing in khard][11] -abook 需要你导入和导出 VCF 文件,但它为查找提供了一些不错的功能。要将文件转换为 abook 格式,请先安装 abook 并创建 **~/.abook** 默认目录。然后让 abook 解析所有文件,并将它们放入 **~/.abook/addresses** 文件中: - +abook 需要你导入和导出 VCF 文件,但它为查找提供了一些不错的功能。要将文件转换为 abook 格式,请先安装 abook 并创建 `~/.abook` 默认目录。然后让 abook 解析所有文件,并将它们放入 `~/.abook/addresses` 文件中: ``` apt install abook -ls ~/.calendars/Addresses/default/* | xargs cat | abook --convert --informat vcard --outformat abook > ~/.abook/addresses +ls ~/.calendars/Addresses/default/* | xargs cat | abook --convert --informat vcard --outformat abook > ~/.abook/addresses ``` -现在运行 **abook**,你将有一个非常好的 UI 来浏览、搜索和编辑条目。将它们导出到单个文件有点痛苦,所以我用 khard 进行大部分编辑,并有一个 cron 任务将它们导入到 abook 中。 - -abook 还可在命令行中搜索,并有大量有关将其与邮件客户端集成的文档。例如,你可以在 **.config/alot/config** 文件中添加一些信息,从而在 [Nmuch][12] 的邮件客户端 [alot][13] 中使用 abook 查询联系人: +现在运行 `abook`,你将有一个非常漂亮的 UI 来浏览、搜索和编辑条目。将它们导出到单个文件有点痛苦,所以我用 khard 进行大部分编辑,并有一个 cron 任务将它们导入到 abook 中。 +abook 还可在命令行中搜索,并有大量有关将其与邮件客户端集成的文档。例如,你可以在 `.config/alot/config` 文件中添加一些信息,从而在 [Nmuch][12] 的邮件客户端 [alot][13] 中使用 abook 查询联系人: ``` [accounts] -  [[Personal]] -     realname = Kevin Sonney -     address = [kevin@sonney.com][14] -     alias_regexp = kevin\[+.+@sonney.com][15] -     gpg_key = 7BB612C9 -     sendmail_command = msmtp --account=Personal -t -     # ~ expansion works -     sent_box = maildir://~/Maildir/Sent -     draft_box = maildir://~/Maildir/Drafts -    [[[abook]]] -        type = abook + [[Personal]] + realname = Kevin Sonney + address = kevin@sonney.com + alias_regexp = kevin\+.+@sonney.com + gpg_key = 7BB612C9 + sendmail_command = msmtp --account=Personal -t + # ~ expansion works + sent_box = maildir://~/Maildir/Sent + draft_box = maildir://~/Maildir/Drafts + [[[abook]]] + type = abook ``` 这样你就可以在邮件和日历中快速查找联系人了! @@ -120,15 +118,15 @@ via: https://opensource.com/article/20/1/sync-contacts-locally 作者:[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/) 荣誉推出 [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/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/20/1/sync-email-offlineimap -[3]: https://opensource.com/article/20/1/open-source-calendar +[2]: https://linux.cn/article-11804-1.html +[3]: https://linux.cn/article-11812-1.html [4]: https://opensource.com/sites/default/files/uploads/productivity_6-1.png (abook) [5]: https://github.com/pimutils/vdirsyncer [6]: https://github.com/scheibler/khard From cee17089ff42f63d41f7aa97469e976b45a28549 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 19:51:30 +0800 Subject: [PATCH 159/285] PUB @geekpi https://linux.cn/article-11834-1.html --- .../20200116 3 open source tools to manage your contacts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200116 3 open source tools to manage your contacts.md (98%) diff --git a/translated/tech/20200116 3 open source tools to manage your contacts.md b/published/20200116 3 open source tools to manage your contacts.md similarity index 98% rename from translated/tech/20200116 3 open source tools to manage your contacts.md rename to published/20200116 3 open source tools to manage your contacts.md index 01f4d57c98..a1862377d8 100644 --- a/translated/tech/20200116 3 open source tools to manage your contacts.md +++ b/published/20200116 3 open source tools to manage your contacts.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11834-1.html) [#]: subject: (3 open source tools to manage your contacts) [#]: via: (https://opensource.com/article/20/1/sync-contacts-locally) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From f4550f2a813cd992128e1e307baf73a1be8e149c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 21:57:47 +0800 Subject: [PATCH 160/285] APL --- sources/tech/20200109 My favorite Bash hacks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200109 My favorite Bash hacks.md b/sources/tech/20200109 My favorite Bash hacks.md index 857f10e160..647b83a21a 100644 --- a/sources/tech/20200109 My favorite Bash hacks.md +++ b/sources/tech/20200109 My favorite Bash hacks.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d8d6f0eed0b8f0aee178c4ad5aff7723a5d2925c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Jan 2020 23:18:37 +0800 Subject: [PATCH 161/285] TSL --- .../tech/20200109 My favorite Bash hacks.md | 142 ------------------ .../tech/20200109 My favorite Bash hacks.md | 136 +++++++++++++++++ 2 files changed, 136 insertions(+), 142 deletions(-) delete mode 100644 sources/tech/20200109 My favorite Bash hacks.md create mode 100644 translated/tech/20200109 My favorite Bash hacks.md diff --git a/sources/tech/20200109 My favorite Bash hacks.md b/sources/tech/20200109 My favorite Bash hacks.md deleted file mode 100644 index 647b83a21a..0000000000 --- a/sources/tech/20200109 My favorite Bash hacks.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (My favorite Bash hacks) -[#]: via: (https://opensource.com/article/20/1/bash-scripts-aliases) -[#]: author: (Katie McLaughlin https://opensource.com/users/glasnt) - -My favorite Bash hacks -====== -Improve your productivity with aliases and other shortcuts for the -things you forget too often. -![bash logo on green background][1] - -When you work with computers all day, it's fantastic to find repeatable commands and tag them for easy use later on. They all sit there, tucked away in **~/.bashrc** (or ~/.zshrc for [Zsh users][2]), waiting to help improve your day! - -In this article, I share some of my favorite of these helper commands for things I forget a lot, in hopes that they will save you, too, some heartache over time. - -### Say when it's over - -When I'm using longer-running commands, I often multitask and then have to go back and check if the action has completed. But not anymore, with this helpful invocation of **say** (this is on MacOS; change for your local equivalent): - - -``` -function looooooooong { -    START=$(date +%s.%N) -    $* -    EXIT_CODE=$? -    END=$(date +%s.%N) -    DIFF=$(echo "$END - $START" | bc) -    RES=$(python -c "diff = $DIFF; min = int(diff / 60); print('%s min' % min)") -    result="$1 completed in $RES, exit code $EXIT_CODE." -    echo -e "\n⏰  $result" -    ( say -r 250 $result 2>&1 > /dev/null & ) -} -``` - -This command marks the start and end time of a command, calculates the minutes it takes, and speaks the command invoked, the time taken, and the exit code. I find this super helpful when a simple console bell just won't do. - -### Install helpers - -I started using Ubuntu back in the Lucid days, and one of the first things I needed to learn was how to install packages. And one of the first aliases I ever added was a helper for this (named based on the memes of the day): - - -``` -`alias canhas="sudo apt-get install -y"` -``` - -### GNU Privacy Guard (GPG) signing - -On the off chance I have to sign a [GPG][3] email without having an extension or application to do it for me, I drop down into the command line and use these terribly dorky aliases: - - -``` -alias gibson="gpg --encrypt --sign --armor" -alias ungibson="gpg --decrypt" -``` - -### Docker - -There are many Docker commands, but there are even more **docker compose** commands. I used to forget the **\--rm** flags, but not anymore with these useful aliases: - - -``` -alias dc="docker-compose" -alias dcr="docker-compose run --rm" -alias dcb="docker-compose run --rm --build" -``` - -### gcurl helper for Google Cloud - -This one is relatively new to me, but it's [heavily documented][4]. gcurl is an alias to ensure you get all the correct flags when using local curl commands with authentication headers when working with Google Cloud APIs.  - -### Git and ~/.gitignore - -I work a lot in Git, so I have a special section dedicated to Git helpers. - -One of my most useful helpers is one I use to clone GitHub repos. Instead of having to run: - - -``` -`git clone git@github.com:org/repo /Users/glasnt/git/org/repo` -``` - -I set up a clone function: - - -``` -clone(){ -    echo Cloning $1 to ~/git/$1 -    cd ~/git -    git clone [git@github.com][5]:$1 $1 -    cd $1 -} -``` - -Even though I always forget and giggle any time I'm diving into my **~/.bashrc** file, I also have my "refresh upstream" command: - - -``` -`alias yoink="git checkout master && git fetch upstream master && git merge upstream/master"` -``` - -Another helper for Git-ville is a global ignore file. In your **git config --global --list** you should see a **core.excludesfile**. If not, [create one][6], and fill it full of things that you always put into your individual **.gitignore** files. As a Python developer on MacOS, for me this is: - - -``` -.DS_Store     # macOS clutter -venv/         # I never want to commit my virtualenv -*.egg-info/*  # ... nor any locally compiled packages -__pycache__   # ... or source -*.swp         # ... nor any files open in vim -``` - -You can find other suggestions over on [Gitignore.io][7] or on the [Gitignore repo][8] on GitHub. - -### Your turn - -What are your favorite helper commands? Please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/bash-scripts-aliases - -作者:[Katie McLaughlin][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/glasnt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: https://opensource.com/article/19/9/getting-started-zsh -[3]: https://gnupg.org/ -[4]: https://cloud.google.com/service-infrastructure/docs/service-control/getting-started -[5]: mailto:git@github.com -[6]: https://help.github.com/en/github/using-git/ignoring-files#create-a-global-gitignore -[7]: https://www.gitignore.io/ -[8]: https://github.com/github/gitignore diff --git a/translated/tech/20200109 My favorite Bash hacks.md b/translated/tech/20200109 My favorite Bash hacks.md new file mode 100644 index 0000000000..8106ebaf4c --- /dev/null +++ b/translated/tech/20200109 My favorite Bash hacks.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My favorite Bash hacks) +[#]: via: (https://opensource.com/article/20/1/bash-scripts-aliases) +[#]: author: (Katie McLaughlin https://opensource.com/users/glasnt) + +我珍藏的 Bash 秘籍 +====== + +> 通过别名和其他捷径来提高你经常忘记的那些事情的效率。 + +![bash logo on green background][1] + +要是你整天使用计算机,如果能找到可重复的命令并标记它们,以便以后轻松使用那就太棒了。它们全都在那里,藏在 `~/.bashrc` 中(或 [zsh 用户][2]的 `~/.zshrc` 中),等待着改善你的生活! + +在本文中,我分享了我最喜欢的这些辅助命令,它们可以帮助我避免一些遗忘的事情,也希望可以帮助到你,以及为你解决一些越来越头疼的问题。 + +### 完事说一声 + +当我执行一个需要长时间运行的命令时,我经常采用多任务的方式,然后必须回过去检查该操作是否已完成。 然而通过有用的 `say`,现在就不用再这样了(这是在 MacOS 上;更改为本地环境等效的方式): + +``` +function looooooooong { + START=$(date +%s.%N) + $* + EXIT_CODE=$? + END=$(date +%s.%N) + DIFF=$(echo "$END - $START" | bc) + RES=$(python -c "diff = $DIFF; min = int(diff / 60); print('%s min' % min)") + result="$1 completed in $RES, exit code $EXIT_CODE." + echo -e "\n⏰ $result" + ( say -r 250 $result 2>&1 > /dev/null & ) +} +``` + +这个命令会标记命令的开始和结束时间,计算所需的分钟数,并说出调用的命令、花费的时间和退出码。当简单的控制台铃声无法使用时,我发现这个超级有用。 + +### 安装小助手 + +我在小的时候就开始使用 Ubuntu,而我需要学习的第一件事是如何安装软件包。我曾经添加的第一个别名之一是它的助手(根据当天的流行梗命名的): + +``` +alias canhas="sudo apt-get install -y" +``` + +### GPG 签名 + +有时候,我必须在没有扩展程序或应用程序的情况下给电子邮件签署 [GPG][3] 签名,我会跳到命令行并使用以下令人讨厌的别名: + +``` +alias gibson="gpg --encrypt --sign --armor" +alias ungibson="gpg --decrypt" +``` + +### Docker + +Docker 命令很多,但是 Docker compose 命令更多。我曾经使用这些别名来忘记 `--rm` 标志,但是现在不再使用这些有用的别名了: + +``` +alias dc="docker-compose" +alias dcr="docker-compose run --rm" +alias dcb="docker-compose run --rm --build" +``` + +### Google Cloud 的 gcurl 辅助程序 + +对于我来说,Google Cloud 是一个相对较新的东西,而它有[极多的文档][4]。gcurl 是一个别名,可确保在用带有身份验证标头的本地 curl 命令连接 Google Cloud API 时,可以获得所有正确的标头。 + +### Git 和 ~/.gitignore + +我工作中用 Git 很多,因此我有一个专门的部分来介绍 Git 的辅助程序。 + +我最有用的辅助程序之一是我用来克隆 GitHub 存储库的助手。你不必运行: + +``` +git clone git@github.com:org/repo /Users/glasnt/git/org/repo +``` + +我设置了一个克隆函数: + +``` +clone(){ +    echo Cloning $1 to ~/git/$1 +    cd ~/git +    git clone git@github.com:$1 $1 +    cd $1 +} +``` + +即使每次进入 `~/.bashrc` 文件时,我总是会忘记和傻笑,我也有一个“刷新上游”命令: + +``` +alias yoink="git checkout master && git fetch upstream master && git merge upstream/master" +``` + +给 Git 人的另一个辅助程序是全局忽略文件。在你的 `git config --global --list` 中,你应该看到一个 `core.excludesfile`。如果没有,请[创建一个][6],然后将你总是放到各个 `.gitignore` 文件中的内容填满它。作为 MacOS 上的 Python 开发人员,对我来说,这写内容是: + + +``` +.DS_Store     # macOS clutter +venv/         # I never want to commit my virtualenv +*.egg-info/*  # ... nor any locally compiled packages +__pycache__   # ... or source +*.swp         # ... nor any files open in vim +``` + +你可以在 [Gitignore.io][7] 或 GitHub 上的 [Gitignore 存储库][8]上找到其他建议。 + +### 轮到你了 + +你最喜欢的辅助程序命令是什么?请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/bash-scripts-aliases + +作者:[Katie McLaughlin][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/glasnt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/19/9/getting-started-zsh +[3]: https://gnupg.org/ +[4]: https://cloud.google.com/service-infrastructure/docs/service-control/getting-started +[5]: mailto:git@github.com +[6]: https://help.github.com/en/github/using-git/ignoring-files#create-a-global-gitignore +[7]: https://www.gitignore.io/ +[8]: https://github.com/github/gitignore From 6c6daca749f9bee15b55e23df30c0c08b5749d87 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 31 Jan 2020 00:58:08 +0800 Subject: [PATCH 162/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200130=20Run=20?= =?UTF-8?q?your=20network=20with=20open=20source=20software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200130 Run your network with open source software.md --- ... your network with open source software.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20200130 Run your network with open source software.md diff --git a/sources/tech/20200130 Run your network with open source software.md b/sources/tech/20200130 Run your network with open source software.md new file mode 100644 index 0000000000..13137ce392 --- /dev/null +++ b/sources/tech/20200130 Run your network with open source software.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your network with open source software) +[#]: via: (https://opensource.com/article/20/1/open-source-networking) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Run your network with open source software +====== +VyOS is an easy-to-install open source router and firewall solution +![Multi-colored and directional network computer cables][1] + +Way back in 2005, a company called Vyatta was founded by Allan Leinwand. It offered the first commercially supported, open source router and firewall solution. Named after the ancient Sanskrit for "open," the company's goal of bringing open source networking products to the market was so successful that it was purchased by competitor Brocade. This effectively killed Vyatta, but because Vyatta's product was open source, it didn't stop it. As it turns out, Vyatta's software-defined networking capabilities have been continued and developed as [VyOS][2]. + +The VyOS distribution is based on Debian Linux, with source code available from a [Git repository][3] and a [rolling release ISO][4]. For mission-critical applications, there are [long-term support releases and support contracts][5]. + +### Building a network + +Networking has changed since 2005, and thanks to the VyOS project, so has the software that drives it. After learning that VyOS was continuing the work of Vyatta, I downloaded the ISO to try it out. The installation process was easier for me than the normal Debian install, which is a simple task. VyOS doesn't boot into a graphical interface, but to a text console. It's just you and a bunch of configuration files, just like you might expect from a serious router. + +The default install of VyOS provides no default configuration. It's entirely up to you to build the network you want to run. Depending on your point of view, that's either refreshing or frustrating, but it gives you an idea of the intended audience: VyOS is built for network engineers who've mapped out their desired topography and are capable of creating it with some subnet calculations and text definitions. + +### The VyOS configure command + +That said, VyOS isn't just a re-branded Debian release. One of its key features is its **configure** command, an interactive tool for defining network definitions that are applied only after you commit them. In addition to feeling familiar to users accustomed to IOS and similar toolchains, this allows you to configure your network even as the router continues its normal operations. Nothing is final until you type **commit**. + +Once you've tested a committed network change, you can use the **save** command to permanently store your configuration files for backup or migration to other VyOS machines. + +You enter configuration mode with the **configure** command. There are too many possible network configurations to go over **configure** or basic networking tasks here, but the syntax is generally intuitive and predictable. For instance, to enable SSH management over port 22212 of your router: + + +``` +`# set service ssh port '22212'` +``` + +To set the network interface card (NIC) **eth1** to an internal IP address and to create a description identifying it as the default gateway: + + +``` +# set interfaces ethernet eth1 address '10.1.0.1/24' +# set interfaces ethernet eth1 description 'INSIDE' +``` + +To set the public IP of NIC **eth0** and describe it as the world-facing interface: + + +``` +# set interfaces ethernet eth0 address dhcp +# set interfaces ethernet eth0 description 'OUTSIDE' +``` + +To activate network address translation (NAT), it's the same structure: + + +``` +set nat source rule 100 outbound-interface 'eth0' +set nat source rule 100 source address '10.1.0.0/24' +set nat source rule 100 translation address masquerade +``` + +Assuming those are the only tasks you have for now, commit and save: + + +``` +# commit +# save && exit +Saving configuration to '/config/config.boot'... +Done +$ +``` + +Although that's probably not everything you need to do in real life, it gives you an idea of the direct simplicity that VyOS provides. You don't have to deal with "reverse engineering" confusing graphical interfaces nor scrubbing through verbose configuration files for a poorly named key. You have a unified interface for every task, whether it's setting up a firewall, implementing DHCP, DNS, quality of service, VPN gateways, IPv6, or whatever else. + +### Professional networking appliance + +VyOS might not be a beginner-level router distribution, but it's a great tool to have on hand even if you're just starting out. There's no better way to learn the basics of networking than to have an open source router available for manipulation and testing. It's the 21st century, after all; you can set up a computer lab consisting of virtual clients networked to one another through a virtual VyOS instance entirely within [GNOME Boxes][6] for $0. You can learn advanced networking concepts and solutions armed with little more than a Linux computer and the excellent [VyOS documentation][7]. + +If you're already a networking professional, then take a look at VyOS. You'll find its philosophy on configuration simple and its configure tool efficient. + +Connecting your Linux computer to a network is pretty straightforward, except when it is not. In... + +Jay Turner gives tips for attracting and maintaining an open source community around networking. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-networking + +作者:[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/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: http://vyos.io +[3]: https://github.com/vyos/ +[4]: https://www.vyos.io/rolling-release/ +[5]: https://vyos.io/subscriptions/ +[6]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[7]: https://vyos.readthedocs.io/en/latest/index.html From 0f8c44bca2773a4e063c8e5f97445804b9d8c107 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 31 Jan 2020 00:58:42 +0800 Subject: [PATCH 163/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200130=204=20op?= =?UTF-8?q?en=20source=20productivity=20tools=20on=20my=20wishlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200130 4 open source productivity tools on my wishlist.md --- ...ource productivity tools on my wishlist.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20200130 4 open source productivity tools on my wishlist.md diff --git a/sources/tech/20200130 4 open source productivity tools on my wishlist.md b/sources/tech/20200130 4 open source productivity tools on my wishlist.md new file mode 100644 index 0000000000..d36f020aa3 --- /dev/null +++ b/sources/tech/20200130 4 open source productivity tools on my wishlist.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source productivity tools on my wishlist) +[#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +4 open source productivity tools on my wishlist +====== +Find out what the open source world needs to work on in the final +article in our series on 20 ways to be more productive with open source +in 2020. +![Two diverse hands holding a globe][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### But what about… + +When searching for productivity apps, I never find everything I want, and I almost always miss something great that my readers share with me. So, as I bring this series to a close, it's time [again][2] to talk about some of the topics I failed to cover in this year's series. + +![Desktop with Joplin, Emacs, and Firefox][3] + +#### Chatting in Vim + +I tried. I really, _really_ tried to get chat to work in Vim, but it was not to be. The one package I was able to find, [VimIRC.vim][4], never did work for me, and I tried for a few days to no avail. The other option I explored was [Irc it][5], which requires a lot more [effort to set up][6] than I could fit into my available space or time. I tried, I really did, and for the Vim users out there, I'm sorry I wasn't able to get something workable for you. + +#### Org mode + +![Org Mode in Emacs][7] + +I love [Org Mode][8], and I use it daily. I could spend several days _just_ talking about Org. It provides basic [task tracking][9]; Google [calendar][10] sync and [CalFW][11] integration; rich text documents, websites, and presentations; linking to all the things; and; and; and… + +I expect you will hear more from me about Org in 2020 because it really is pretty cool. + +#### GUI programs + +In 2019's productivity series, I shared a lot of programs with a graphical user interface (GUI), and this year almost all are command-line applications. There are some great graphical programs to help with some of the things I talked about this year—[mail][12] programs to talk to Maildir mailboxes, calendar programs to read local calendar files, [weather][13] apps, and so on. I even tried several new-to-me things to see if they would fit with the overall theme. With the exception of [twin][14], I didn't feel that there were any GUI programs that were new (to me) or notable (again, to me) to write about this year. And that brings me to… + +#### Mobile + +More and more people are using tablets (sometimes in conjunction with a laptop) as their primary device. I use my phone for most of my social media and instant messaging, and, more often than not, I use my tablet (OK, let's be honest, _tablets_) to read or browse the web. It isn't that open source mobile apps aren't out there, that's for sure, but they didn't fit with my themes this year. There is a lot going on with open source and mobile apps, and I'm watching carefully for things that can help me be more productive on my phone and tablet. + +### Your turn + +Thank you very much for reading the series this year. Please comment with what you think I missed or need to look at for 2021. And as I say on the [Productivity Alchemy][15] podcast: "Remember folks: Stay productive!" + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-productivity-tools + +作者:[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/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) +[2]: https://opensource.com/article/19/1/productivity-tool-wish-list +[3]: https://opensource.com/sites/default/files/uploads/productivity_20-1.png (Desktop with Joplin, Emacs, and Firefox) +[4]: https://github.com/vim-scripts/VimIRC.vim +[5]: https://tools.suckless.org/ii/ +[6]: https://www.reddit.com/r/vim/comments/48t7ws/vim_ii_irc_client_xpost_runixporn/d0macnl/ +[7]: https://opensource.com/sites/default/files/uploads/productivity_20-2.png (Org Mode in Emacs) +[8]: https://orgmode.org/ +[9]: https://opensource.com/article/20/1/open-source-to-do-list +[10]: https://opensource.com/article/20/1/open-source-calendar +[11]: https://github.com/kiwanami/emacs-calfw +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://opensource.com/article/20/1/open-source-weather-forecast +[14]: https://github.com/cosmos72/twin +[15]: https://productivityalchemy.com From 795c86f607c757ee21796833f0ac77d8d20fd1f7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 31 Jan 2020 00:59:23 +0800 Subject: [PATCH 164/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200130=20NSA=20?= =?UTF-8?q?cloud=20advice,=20Facebook=20open=20source=20year=20in=20review?= =?UTF-8?q?,=20and=20more=20industry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md --- ...ear in review, and more industry trends.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md diff --git a/sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md b/sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md new file mode 100644 index 0000000000..7a3a40d845 --- /dev/null +++ b/sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NSA cloud advice, Facebook open source year in review, and more industry trends) +[#]: via: (https://opensource.com/article/20/1/nsa-facebook-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +NSA cloud advice, Facebook open source year in review, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [Facebook open source year in review][2] + +> Last year was a busy one for our [open source][3] engineers. In 2019 we released 170 new open source projects, bringing our portfolio to a total of 579 [active repositories][3]. While it’s important for our internal engineers to contribute to these projects (and they certainly do — with more than 82,000 commits this year), we are also incredibly grateful for the massive support from external contributors. Approximately 2,500 external contributors committed more than 32,000 changes. In addition to these contributions, nearly 93,000 new people starred our projects this year, growing the most important component of any open source project — the community! Facebook Open Source would not be here without your contributions, so we want to thank you for your participation in 2019. + +**The impact**: Facebook got ~33% more changes than they would have had they decided to develop these as closed projects. Organizations addressing similar challenges got an 82,000-commit boost in exchange. What a clear illustration of the business impact of open source development. + +## [Cloud advice from the NSA][4] + +> This document divides cloud vulnerabilities into four classes (misconfiguration, poor access control, shared tenancy vulnerabilities, and supply chain vulnerabilities) that encompass the vast majority of known vulnerabilities. Cloud customers have a critical role in mitigating misconfiguration and poor access control, but can also take actions to protect cloud resources from the exploitation of shared tenancy and supply chain vulnerabilities. Descriptions of each vulnerability class along with the most effective mitigations are provided to help organizations lock down their cloud resources. By taking a risk-based approach to cloud adoption, organizations can securely benefit from the cloud’s extensive capabilities. + +**The impact**: The Fear, Uncertainty, and Doubt (FUD) that has been associated with cloud adoption is being debunked more all the time. None other then the US Department of Defense has done a lot of the thinking so you don't have to, and there is a good chance that their concerns are at least as dire as yours are. + +## [With Kubernetes, China Minsheng Bank transformed its legacy applications][5] + +> But all of CMBC’s legacy applications—for example, the core banking system, payment systems, and channel systems—were written in C and Java, using traditional architecture. “We wanted to do distributed applications because in the past we used VMs in our own data center, and that was quite expensive and with low resource utilization rate,” says Zhang. “Our biggest challenge is how to make our traditional legacy applications adaptable to the cloud native environment.” So far, around 20 applications are running in production on the Kubernetes platform, and 30 new applications are in active development to adopt the Kubernetes platform. + +**The impact**: This illustrates nicely the challenges and opportunities facing businesses in a competitive environment, and suggests a common adoption pattern. Do new stuff the new way, and move the old stuff as it makes sense. + +## [The '5 Rs' of the move to cloud native: Re-platform, re-host, re-factor, replace, retire][6] + +> The bottom line is that telcos and service providers will go cloud native when it is cheaper for them to migrate to the cloud and pay cloud costs than it is to remain in the data centre. That time is now and by adhering to the "5 Rs" of the move to cloud native, Re-platform, Re-host, Re-factor, Replace and/or Retire, the path is open, clearly marked and the goal eminently achievable. + +**The impact**: Cloud-native is basically used as a synonym for open source in this interview; there is no other type of technology that will deliver the same lift. + +## [Fedora CoreOS out of preview][7] + +> Fedora CoreOS is a new Fedora Edition built specifically for running containerized workloads securely and at scale. It’s the successor to both [Fedora Atomic Host][8] and [CoreOS Container Linux][9] and is part of our effort to explore new ways of assembling and updating an OS. Fedora CoreOS combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host.  For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][10]. + +**The impact**: Collapsing these two branches of the Linux family tree into one another moves the state of the art forward for everyone (once you get through the migration). + +_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/nsa-facebook-more-industry-trends + +作者:[Tim Hildred][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://opensource.com/article/20/1/hybrid-developer-future-industry-trends +[3]: https://opensource.facebook.com/ +[4]: https://media.defense.gov/2020/Jan/22/2002237484/-1/-1/0/CSI-MITIGATING-CLOUD-VULNERABILITIES_20200121.PDF +[5]: https://www.cncf.io/blog/2020/01/23/with-kubernetes-china-minsheng-bank-transformed-its-legacy-applications-and-moved-into-ai-blockchain-and-big-data/ +[6]: https://www.telecomtv.com/content/cloud-native/the-5-rs-of-the-move-to-cloud-native-re-platform-re-host-re-factor-replace-retire-37473/ +[7]: https://fedoramagazine.org/fedora-coreos-out-of-preview/ +[8]: https://www.projectatomic.io/ +[9]: https://coreos.com/os/docs/latest/ +[10]: https://fedoramagazine.org/introducing-fedora-coreos/ From c2ac0c1d9a30ad4f11bee889bb4a91a2e9c61afd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 31 Jan 2020 09:40:28 +0800 Subject: [PATCH 165/285] Rename sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md to sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md --- ...cebook open source year in review, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md (100%) diff --git a/sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md b/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md similarity index 100% rename from sources/tech/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md rename to sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md From 104ab55186df5c7f53d73bb13ea3eabf7b7c356d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 Jan 2020 10:33:38 +0800 Subject: [PATCH 166/285] translated --- ... open source chat tool to rule them all.md | 44 ++++--- ... open source chat tool to rule them all.md | 107 ++++++++++++++++++ 2 files changed, 128 insertions(+), 23 deletions(-) create mode 100644 translated/tech/20200119 One open source chat tool to rule them all.md diff --git a/sources/tech/20200119 One open source chat tool to rule them all.md b/sources/tech/20200119 One open source chat tool to rule them all.md index 25f6728c84..2a4a6d52b4 100644 --- a/sources/tech/20200119 One open source chat tool to rule them all.md +++ b/sources/tech/20200119 One open source chat tool to rule them all.md @@ -7,63 +7,61 @@ [#]: via: (https://opensource.com/article/20/1/open-source-chat-tool) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -One open source chat tool to rule them all +一个管理所有聊天的开源聊天工具 ====== -BitlBee brings multiple chat applications into a single interface. Find -out how to set up and use BitlBee in the ninth in our series on 20 ways -to be more productive with open source in 2020. +BitlBee 将多个聊天应用集合到一个界面中。在我们的 20 个使用开源提升生产力的系列的第九篇文章中了解如何设置和使用 BitlBee。 ![Person using a laptop][1] -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 -### Bring all your chats into one interface with BitlBee +### 将所有聊天都放到 BitlBee 中 -Instant messaging and chat have become a staple of the online world. And if you are like me, you probably have about five or six different apps running to talk to your friends, co-workers, and others. It really is a pain to keep up with it all. Thankfully, you can use one app (OK, two apps) to consolidate a lot of those chats into a single point. +即时消息和聊天已经成为网络世界的主要内容。如果你像我一样,你可能打开五六个不同的应用与你的朋友、同事和其他人交谈。跟上所有聊天真的很痛苦。谢天谢地,你可以使用一个应用(好吧,是两个)将这些聊天整个到一个地方。 ![BitlBee on XChat][2] -[BitlBee][3] is an application that you run as a service that can bridge a standard IRC client with a whole bunch of messaging services. And since it is essentially an IRC server, you have a wealth of clients to choose from. +[BitlBee][3] 是作为服务运行的应用,它可以将标准的 IRC 客户端与大量的消息服务进行桥接。而且,由于它本质上是 IRC 服务器,因此你可以选择很多客户端。 -BitlBee is included with almost all Linux distributions. Installing on Ubuntu (my Linux desktop of choice) goes something like this: +BitlBee 几乎包含在所有 Linux 发行版中。在 Ubuntu 上安装(我选择的 Linux 桌面),类似这样: ``` `sudo apt install bitlbee-libpurple` ``` -On  other distributions, the name of the package may be slightly different, but a search for _bitlbee_ should reveal your options. +在其他发行版上,包名可能略有不同,但搜索 _bitlbee_ 应该就能看到。 -You'll notice I use the libpurple version of BitlBee. This version allows me to use all the protocols available in the [libpurple][4] instant messaging library, which was originally developed for [Pidgin][5]. +你会注意到我用的 libpurple 版的 BitlBee。这个版本能让我使用 [libpurple][4] 即时消息库中提供的所有协议,该库最初是为 [Pidgin][5] 开发的。 -Once the package is installed, the service should start automatically. Now, using an IRC client ([XChat][6] in these pictures), I can connect to the service on port 6667 (the standard IRC port). +安装完成后,服务应会自动启动。现在,使用一个 IRC 客户端(图片中为 [XChat][6]),我可以连接到端口 6667(标准 IRC 端口)上的服务。 ![Initial BitlBee connection][7] -You will be automatically connected to the control channel **&bitlbee**. This channel is unique to you—every person gets their own on multi-user systems. This is where you can configure the services. +你将自动连接到控制频道和 **bitlbee**。此频道对于你是独一无二的,每个人在多用户系统上都有自己的频道。在这里你可以配置服务。 -The full documentation is available at any time by typing **help** in the control channel. Explore here, then register an account on the server with the **register** command. +在控制频道中输入 **help**,你可以随时获得完整的文档。浏览它,然后使用 **register** 命令在服务器上注册帐户。 ``` `register ` ``` -Now, any configuration changes you make on the server—IM accounts, settings, etc.—will be saved when you type **save**. Whenever you connect, use **identify <mypassword>** to connect to your account and load all those settings. +现在,你在服务器上所做的任何配置更改(IM 帐户、设置等)都将在输入 **save** 时保存。每当你连接时,使用 **identify <mypassword>** 连接到你的帐户并加载这些设置。 ![purple settings][8] -The command **help purple** will show you all the available protocols that libpurple provides. For example, I've installed the [**telegram-purple**][9] package, which adds the ability to connect to Telegram. I can add an account by using my phone number with the **account add** command. +命令 **help purple** 将显示 libpurple 提供的所有可用协议。例如,我安装了 [**telegram-purple**][9] 包,它增加了连接到 Telegram 的能力。我可以使用 **account add** 命令将我的电话号码作为帐户添加。 ``` `account add telegram +15555555` ``` -BitlBee will show that it has added the account. You can list your accounts with **account list**. Since I only have one account, I can log into it with **account 0 on**, and it will go through the Telegram login process, list all my friends and chats, and I am good to go. +BitlBee 将显示它已添加帐户。你可以使用 **account list** 列出你的帐户。因为我只有一个帐户,我可以通过 **account 0 on** 登录,它会进行 Telegram 登录,列出我所有的朋友和聊天,接下来就能正常聊天了。 -But what about Slack, one of the most common chat systems out there? Well, you can install the [**slack-libpurple**][10] plugin, and do the same for Slack. If you aren't comfortable compiling and installing things, this may not be for you. +但是,对于 Slack 这个最常见的聊天系统之一呢?你可以安装 [**slack-libpurple**][10] 插件,并且对 Slack 执行同样的操作。如果你不愿意编译和安装这些,这可能不适合你。 -Follow the instructions on the plugin page, and after you have installed it, restart the BitlBee service. Now when you run **help purple**, Slack should be listed. Adding a Slack account happens the same as with all the other protocols. +按照插件页面上的说明操作,安装后重新启动 BitlBee 服务。现在,当你运行 **help purple** 时,应该会列出 Slack。像其他协议一样添加一个 Slack 帐户。 ``` @@ -72,16 +70,16 @@ account 1 set password my_legcay_API_token account 1 on ``` -And what do you know? You're connected to Slack, and you can add the Slack channels you're interested in with the **chat add** command. For example: +你知道么,你已经连接到 Slack 中,你可以通过 **chat add** 命令添加你感兴趣的 Slack 频道。比如: ``` `chat add 1 happyparty` ``` -adds the Slack channel happyparty as the local channel #happyparty. You can use the standard IRC **/join** command to access the channel now. Pretty cool. +将 Slack 频道 happyparty 添加为本地频道 #happyparty。现在可以使用标准 IRC **/join** 命令访问该频道。这很酷。 -BitlBee and an IRC client help me keep (most of) my chats and instant messages in a single place and reduces my distractions because I no longer have to find and switch to whichever app just pinged me. +BitlBee 和 IRC 客户端帮助我的(大部分)聊天和即时消息保存在一个地方,并减少了我的分心,因为我不再需要查找并切换到任何一个刚刚找我的应用上。 -------------------------------------------------------------------------------- @@ -89,7 +87,7 @@ via: https://opensource.com/article/20/1/open-source-chat-tool 作者:[Kevin Sonney][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/20200119 One open source chat tool to rule them all.md b/translated/tech/20200119 One open source chat tool to rule them all.md new file mode 100644 index 0000000000..2a4a6d52b4 --- /dev/null +++ b/translated/tech/20200119 One open source chat tool to rule them all.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (One open source chat tool to rule them all) +[#]: via: (https://opensource.com/article/20/1/open-source-chat-tool) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +一个管理所有聊天的开源聊天工具 +====== +BitlBee 将多个聊天应用集合到一个界面中。在我们的 20 个使用开源提升生产力的系列的第九篇文章中了解如何设置和使用 BitlBee。 +![Person using a laptop][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 将所有聊天都放到 BitlBee 中 + +即时消息和聊天已经成为网络世界的主要内容。如果你像我一样,你可能打开五六个不同的应用与你的朋友、同事和其他人交谈。跟上所有聊天真的很痛苦。谢天谢地,你可以使用一个应用(好吧,是两个)将这些聊天整个到一个地方。 + +![BitlBee on XChat][2] + +[BitlBee][3] 是作为服务运行的应用,它可以将标准的 IRC 客户端与大量的消息服务进行桥接。而且,由于它本质上是 IRC 服务器,因此你可以选择很多客户端。 + +BitlBee 几乎包含在所有 Linux 发行版中。在 Ubuntu 上安装(我选择的 Linux 桌面),类似这样: + + +``` +`sudo apt install bitlbee-libpurple` +``` + +在其他发行版上,包名可能略有不同,但搜索 _bitlbee_ 应该就能看到。 + +你会注意到我用的 libpurple 版的 BitlBee。这个版本能让我使用 [libpurple][4] 即时消息库中提供的所有协议,该库最初是为 [Pidgin][5] 开发的。 + +安装完成后,服务应会自动启动。现在,使用一个 IRC 客户端(图片中为 [XChat][6]),我可以连接到端口 6667(标准 IRC 端口)上的服务。 + +![Initial BitlBee connection][7] + +你将自动连接到控制频道和 **bitlbee**。此频道对于你是独一无二的,每个人在多用户系统上都有自己的频道。在这里你可以配置服务。 + +在控制频道中输入 **help**,你可以随时获得完整的文档。浏览它,然后使用 **register** 命令在服务器上注册帐户。 + + +``` +`register ` +``` + +现在,你在服务器上所做的任何配置更改(IM 帐户、设置等)都将在输入 **save** 时保存。每当你连接时,使用 **identify <mypassword>** 连接到你的帐户并加载这些设置。 + +![purple settings][8] + +命令 **help purple** 将显示 libpurple 提供的所有可用协议。例如,我安装了 [**telegram-purple**][9] 包,它增加了连接到 Telegram 的能力。我可以使用 **account add** 命令将我的电话号码作为帐户添加。 + + +``` +`account add telegram +15555555` +``` + +BitlBee 将显示它已添加帐户。你可以使用 **account list** 列出你的帐户。因为我只有一个帐户,我可以通过 **account 0 on** 登录,它会进行 Telegram 登录,列出我所有的朋友和聊天,接下来就能正常聊天了。 + +但是,对于 Slack 这个最常见的聊天系统之一呢?你可以安装 [**slack-libpurple**][10] 插件,并且对 Slack 执行同样的操作。如果你不愿意编译和安装这些,这可能不适合你。 + +按照插件页面上的说明操作,安装后重新启动 BitlBee 服务。现在,当你运行 **help purple** 时,应该会列出 Slack。像其他协议一样添加一个 Slack 帐户。 + + +``` +account add slack [ksonney@myslack.slack.com][11] +account 1 set password my_legcay_API_token +account 1 on +``` + +你知道么,你已经连接到 Slack 中,你可以通过 **chat add** 命令添加你感兴趣的 Slack 频道。比如: + + +``` +`chat add 1 happyparty` +``` + +将 Slack 频道 happyparty 添加为本地频道 #happyparty。现在可以使用标准 IRC **/join** 命令访问该频道。这很酷。 + +BitlBee 和 IRC 客户端帮助我的(大部分)聊天和即时消息保存在一个地方,并减少了我的分心,因为我不再需要查找并切换到任何一个刚刚找我的应用上。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-chat-tool + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/uploads/productivity_9-1.png (BitlBee on XChat) +[3]: https://www.bitlbee.org/ +[4]: https://developer.pidgin.im/wiki/WhatIsLibpurple +[5]: http://pidgin.im/ +[6]: http://xchat.org/ +[7]: https://opensource.com/sites/default/files/uploads/productivity_9-2.png (Initial BitlBee connection) +[8]: https://opensource.com/sites/default/files/uploads/productivity_9-3.png (purple settings) +[9]: https://github.com/majn/telegram-purple +[10]: https://github.com/dylex/slack-libpurple +[11]: mailto:ksonney@myslack.slack.com From 449f124d6303d3f1ffb357f22626406b39429791 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 Jan 2020 10:35:18 +0800 Subject: [PATCH 167/285] translated --- ... open source chat tool to rule them all.md | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 sources/tech/20200119 One open source chat tool to rule them all.md diff --git a/sources/tech/20200119 One open source chat tool to rule them all.md b/sources/tech/20200119 One open source chat tool to rule them all.md deleted file mode 100644 index 2a4a6d52b4..0000000000 --- a/sources/tech/20200119 One open source chat tool to rule them all.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (One open source chat tool to rule them all) -[#]: via: (https://opensource.com/article/20/1/open-source-chat-tool) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -一个管理所有聊天的开源聊天工具 -====== -BitlBee 将多个聊天应用集合到一个界面中。在我们的 20 个使用开源提升生产力的系列的第九篇文章中了解如何设置和使用 BitlBee。 -![Person using a laptop][1] - -去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 - -### 将所有聊天都放到 BitlBee 中 - -即时消息和聊天已经成为网络世界的主要内容。如果你像我一样,你可能打开五六个不同的应用与你的朋友、同事和其他人交谈。跟上所有聊天真的很痛苦。谢天谢地,你可以使用一个应用(好吧,是两个)将这些聊天整个到一个地方。 - -![BitlBee on XChat][2] - -[BitlBee][3] 是作为服务运行的应用,它可以将标准的 IRC 客户端与大量的消息服务进行桥接。而且,由于它本质上是 IRC 服务器,因此你可以选择很多客户端。 - -BitlBee 几乎包含在所有 Linux 发行版中。在 Ubuntu 上安装(我选择的 Linux 桌面),类似这样: - - -``` -`sudo apt install bitlbee-libpurple` -``` - -在其他发行版上,包名可能略有不同,但搜索 _bitlbee_ 应该就能看到。 - -你会注意到我用的 libpurple 版的 BitlBee。这个版本能让我使用 [libpurple][4] 即时消息库中提供的所有协议,该库最初是为 [Pidgin][5] 开发的。 - -安装完成后,服务应会自动启动。现在,使用一个 IRC 客户端(图片中为 [XChat][6]),我可以连接到端口 6667(标准 IRC 端口)上的服务。 - -![Initial BitlBee connection][7] - -你将自动连接到控制频道和 **bitlbee**。此频道对于你是独一无二的,每个人在多用户系统上都有自己的频道。在这里你可以配置服务。 - -在控制频道中输入 **help**,你可以随时获得完整的文档。浏览它,然后使用 **register** 命令在服务器上注册帐户。 - - -``` -`register ` -``` - -现在,你在服务器上所做的任何配置更改(IM 帐户、设置等)都将在输入 **save** 时保存。每当你连接时,使用 **identify <mypassword>** 连接到你的帐户并加载这些设置。 - -![purple settings][8] - -命令 **help purple** 将显示 libpurple 提供的所有可用协议。例如,我安装了 [**telegram-purple**][9] 包,它增加了连接到 Telegram 的能力。我可以使用 **account add** 命令将我的电话号码作为帐户添加。 - - -``` -`account add telegram +15555555` -``` - -BitlBee 将显示它已添加帐户。你可以使用 **account list** 列出你的帐户。因为我只有一个帐户,我可以通过 **account 0 on** 登录,它会进行 Telegram 登录,列出我所有的朋友和聊天,接下来就能正常聊天了。 - -但是,对于 Slack 这个最常见的聊天系统之一呢?你可以安装 [**slack-libpurple**][10] 插件,并且对 Slack 执行同样的操作。如果你不愿意编译和安装这些,这可能不适合你。 - -按照插件页面上的说明操作,安装后重新启动 BitlBee 服务。现在,当你运行 **help purple** 时,应该会列出 Slack。像其他协议一样添加一个 Slack 帐户。 - - -``` -account add slack [ksonney@myslack.slack.com][11] -account 1 set password my_legcay_API_token -account 1 on -``` - -你知道么,你已经连接到 Slack 中,你可以通过 **chat add** 命令添加你感兴趣的 Slack 频道。比如: - - -``` -`chat add 1 happyparty` -``` - -将 Slack 频道 happyparty 添加为本地频道 #happyparty。现在可以使用标准 IRC **/join** 命令访问该频道。这很酷。 - -BitlBee 和 IRC 客户端帮助我的(大部分)聊天和即时消息保存在一个地方,并减少了我的分心,因为我不再需要查找并切换到任何一个刚刚找我的应用上。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-chat-tool - -作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://opensource.com/sites/default/files/uploads/productivity_9-1.png (BitlBee on XChat) -[3]: https://www.bitlbee.org/ -[4]: https://developer.pidgin.im/wiki/WhatIsLibpurple -[5]: http://pidgin.im/ -[6]: http://xchat.org/ -[7]: https://opensource.com/sites/default/files/uploads/productivity_9-2.png (Initial BitlBee connection) -[8]: https://opensource.com/sites/default/files/uploads/productivity_9-3.png (purple settings) -[9]: https://github.com/majn/telegram-purple -[10]: https://github.com/dylex/slack-libpurple -[11]: mailto:ksonney@myslack.slack.com From 7aef949b362364b53a8b52000b033c6ff62afad9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 Jan 2020 10:38:25 +0800 Subject: [PATCH 168/285] translating --- sources/tech/20200121 Read Reddit from the Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200121 Read Reddit from the Linux terminal.md b/sources/tech/20200121 Read Reddit from the Linux terminal.md index 81c7e9d35e..689314a73e 100644 --- a/sources/tech/20200121 Read Reddit from the Linux terminal.md +++ b/sources/tech/20200121 Read Reddit from the Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 19ac94836cf959595042e4f6bb166703269d4300 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 Jan 2020 11:11:18 +0800 Subject: [PATCH 169/285] PRF @geekpi --- ...ith this open source to-do list manager.md | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/translated/tech/20200117 Get started with this open source to-do list manager.md b/translated/tech/20200117 Get started with this open source to-do list manager.md index 5845325fde..f77f516328 100644 --- a/translated/tech/20200117 Get started with this open source to-do list manager.md +++ b/translated/tech/20200117 Get started with this open source to-do list manager.md @@ -7,28 +7,29 @@ [#]: via: (https://opensource.com/article/20/1/open-source-to-do-list) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -开始使用开源待办清单管理器 +开始使用开源待办事项清单管理器 ====== -Todo 是跟踪任务列表的强大方法。在我们的 20 个使用开源提升生产力的系列的第七篇文章中了解如何使用它。 -![Team checklist][1] + +> 待办事项清单是跟踪任务列表的强大方法。在我们的 20 个使用开源提升生产力的系列的第七篇文章中了解如何使用它。 + +![](https://img.linux.net.cn/data/attachment/album/202001/31/111103kmv55ploshuso4ot.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 todo 跟踪任务 -任务和待办事项列表离我很近。我是生产力的狂热粉丝(以至于我为此做了一个[播客][2]),我尝试了各种不同的应用。我甚至为此[做了演讲][3]并[写了些文章][4]。因此,当我谈到提高工作效率时,肯定会出现任务和待办事项清单工具。 +任务管理和待办事项清单是我非常喜欢0的东西。我是一位生产效率的狂热粉丝(以至于我为此做了一个[播客][2]),我尝试了各种不同的应用。我甚至为此[做了演讲][3]并[写了些文章][4]。因此,当我谈到提高工作效率时,肯定会出现任务管理和待办事项清单工具。 ![Getting fancy with Todo.txt][5] -说实话,由于简单、跨平台且易于同步,你用 [todo.txt][6] 不会错。它是两个我经常使用的待办列表以及任务管理应用之一(另一个是 [Org mode][7])。让我继续使用它的原因它简单、便携、易于理解,并且有许多很好的附加组件,并且当一台机器有附加组件,而另一台没有,也不会破坏程序。由于它是一个 Bash shell 脚本,我还没发现一个无法支持它的系统。 +说实话,由于简单、跨平台且易于同步,用 [todo.txt][6] 肯定不会错。它是我不断反复提到的两个待办事项清单以及任务管理应用之一(另一个是 [Org 模式][7])。让我反复使用它的原因是它简单、可移植、易于理解,并且有许多很好的附加组件,并且当一台机器有附加组件,而另一台没有,也不会破坏它。由于它是一个 Bash shell 脚本,我还没发现一个无法支持它的系统。 #### 设置 todo.txt -首先,你需要安装基本 shell 脚本并将默认配置文件复制到 **~/.todo** 目录: - +首先,你需要安装基本 shell 脚本并将默认配置文件复制到 `~/.todo` 目录: ``` -git clone +git clone https://github.com/todotxt/todo.txt-cli.git cd todo.txt-cli make sudo make install @@ -36,49 +37,47 @@ mkdir ~/.todo cp todo.cfg ~/.todo/config ``` -接下来,设置配置文件。此时,我想取消注释颜色设置,但必须马上设置的是 **TODO_DIR** 变量: - +接下来,设置配置文件。一般,我想取消对颜色设置的注释,但必须马上设置的是 `TODO_DIR` 变量: ``` -`export TODO_DIR="$HOME/.todo"` +export TODO_DIR="$HOME/.todo" ``` #### 添加待办事件 -要添加第一个待办事件,只需输入 **todo.sh add <NewTodo>** 就能添加。这还将在 **$HOME/.todo/** 中创建三个文件:todo.txt、todo.txt 和 reports.txt。 +要添加第一个待办事件,只需输入 `todo.sh add ` 就能添加。这还将在 `$HOME/.todo/` 中创建三个文件:`todo.txt`、`done.txt` 和 `reports.txt`。 -添加几个项目后,运行 **todo.sh ls** 查看你的待办事项。 +添加几个项目后,运行 `todo.sh ls` 查看你的待办事项。 ![Basic todo.txt list][8] #### 管理任务 -你可以通过给项目设置优先级来稍微改善它。要向项目添加优先级,运行 **todo.sh pri # A**。数字是列表中任务的数量,而字母 ”A“ 是优先级。你可以将优先级设置为从 A 到 Z,因为这是它的排序方式。 +你可以通过给项目设置优先级来稍微改善它。要向项目添加优先级,运行 `todo.sh pri # A`。数字是列表中任务的数量,而字母 `A` 是优先级。你可以将优先级设置为从 A 到 Z,因为这是它的排序方式。 -要完成任务,运行**todo.sh do #** 来标记项目已完成,并将项目移动到 done.txt。运行 **todo.sh report** 会向 report.txt 写入已完成和未完成项的数量。 - -所有三个文件的格式都有详细记录,因此你可以选择自己的文本编辑器修改。todo.txt 的基本格式是: +要完成任务,运行 `todo.sh do #` 来标记项目已完成并将它移动到 `done.txt`。运行 `todo.sh report` 会向 `report.txt` 写入已完成和未完成项的数量。 +所有这三个文件的格式都有详细的说明,因此你可以使用你的文本编辑器修改。`todo.txt` 的基本格式是: ``` -`(Priority) YYYY-MM-DD Task` +(Priority) YYYY-MM-DD Task ``` -如果设置了任务,那么日期表示任务的到期日期。手动编辑文件时,只需在任务前面加一个 ”x“ 来标记为已完成。运行 **todo.sh archive** 会将这些项目移动到 done.txt,你可以在该文本文件编辑,并在有时间时将已完成的项目归档。 +该日期表示任务的到期日期(如果已设置)。手动编辑文件时,只需在任务前面加一个 `x` 来标记为已完成。运行 `todo.sh archive` 会将这些项目移动到 `done.txt`,你可以编辑该文本文件,并在有时间时将已完成的项目归档。 #### 设置重复任务 -我有很多重复任务,我需要以每天/周/月来计划。 +我有很多重复的任务,我需要以每天/周/月来计划。 ![Recurring tasks with the ice_recur add-on][9] -这就是 todo.txt 的灵活性所在。通过在 **~/.todo.actions.d/** 中使用[附加组件][10],你可以添加命令并扩展基本 todo.sh 的功能。附加组件基本上是实现特定命令的脚本。对于重复执行的任务,插件 [ice_recur][11] 可以满足。按照页面上的说明操作,你可以以非常灵活的方式设置要重复处理的任务。 +这就是 `todo.txt` 的灵活性所在。通过在 `~/.todo.actions.d/` 中使用[附加组件][10],你可以添加命令并扩展基本 `todo.sh` 的功能。附加组件基本上是实现特定命令的脚本。对于重复执行的任务,插件 [ice_recur][11] 应该符合要求。按照其页面上的说明操作,你可以设置任务以非常灵活的方式重复执行。 ![Todour on MacOS][12] -目录中有很多附加组件,包括同步到某些云服务。也有链接到桌面或移动端应用的组件,这样你可以随时看到待办列表。 +在该[附加组件目录][10]中有很多附加组件,包括同步到某些云服务,也有链接到桌面或移动端应用的组件,这样你可以随时看到待办列表。 -我只介绍了这个 todo 功能的表面,所以请花点时间深入了解这个工具的强大!它真的帮助我跟上每天的任务。 +我只是简单介绍了这个代办事项清单功能,请花点时间深入了解这个工具的强大!它确实可以帮助我每天完成任务。 -------------------------------------------------------------------------------- @@ -87,7 +86,7 @@ via: https://opensource.com/article/20/1/open-source-to-do-list 作者:[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/) 荣誉推出 @@ -104,4 +103,4 @@ via: https://opensource.com/article/20/1/open-source-to-do-list [9]: https://opensource.com/sites/default/files/uploads/productivity_7-3.png (Recurring tasks with the ice_recur add-on) [10]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory [11]: https://github.com/rlpowell/todo-text-stuff -[12]: https://opensource.com/sites/default/files/uploads/productivity_7-4.png (Todour on MacOS) \ No newline at end of file +[12]: https://opensource.com/sites/default/files/uploads/productivity_7-4.png (Todour on MacOS) From 212d2e79d017d2d0f382df68e056c9423f5aa846 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 Jan 2020 11:20:47 +0800 Subject: [PATCH 170/285] PUB @geekpi https://linux.cn/article-11835-1.html --- ... Get started with this open source to-do list manager.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200117 Get started with this open source to-do list manager.md (98%) diff --git a/translated/tech/20200117 Get started with this open source to-do list manager.md b/published/20200117 Get started with this open source to-do list manager.md similarity index 98% rename from translated/tech/20200117 Get started with this open source to-do list manager.md rename to published/20200117 Get started with this open source to-do list manager.md index f77f516328..deaa6da72a 100644 --- a/translated/tech/20200117 Get started with this open source to-do list manager.md +++ b/published/20200117 Get started with this open source to-do list manager.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11835-1.html) [#]: subject: (Get started with this open source to-do list manager) [#]: via: (https://opensource.com/article/20/1/open-source-to-do-list) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From b1a522110436c65bc30c68f4ba9216714caa2dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 31 Jan 2020 11:43:54 +0800 Subject: [PATCH 171/285] Translated --- ...buntu- Important Things You Should Know.md | 175 ----------------- ...buntu- Important Things You Should Know.md | 176 ++++++++++++++++++ 2 files changed, 176 insertions(+), 175 deletions(-) delete mode 100644 sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md create mode 100644 translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md diff --git a/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md b/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md deleted file mode 100644 index f58ada5c58..0000000000 --- a/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md +++ /dev/null @@ -1,175 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Root User in Ubuntu: Important Things You Should Know) -[#]: via: (https://itsfoss.com/root-user-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Root User in Ubuntu: Important Things You Should Know -====== - -When you have just started using Linux, you’ll find many things that are different from Windows. One of those ‘different things’ is the concept of the root user. - -In this beginner series, I’ll explain a few important things about the root user in Ubuntu. - -**Please keep in mind that while I am writing this from Ubuntu user’s perspective, it should be valid for most Linux distributions.** - -You’ll learn the following in this article: - - * [Why root user is disabled in Ubuntu][1] - * [Using commands as root][2] - * [Switch to root user][3] - * [Unlock the root user][4] - - - -### What is root user? Why is it locked in Ubuntu? - -![][5] - -In Linux, there is always a super user called [root][6]. This is the super admin account that can do anything and everything with the system. It can access any file and run any command on your Linux system. - -With great power comes great responsibility. Root user gives you complete power over the system and hence it should be used with great cautious. Root user can access system files and run commands to make changes to the system configuration. And hence, an incorrect command may destroy the system. - -This is why [Ubuntu][7] and other Ubuntu-based distributions lock the root user by default to save you from accidental disasters. - -You don’t need to have root privilege for your daily tasks like moving file in your home directory, downloading files from internet, creating documents etc. - -_**Take this analogy for understanding it better. If you have to cut a fruit, you use a kitchen knife. If you have to cut down a tree, you have to use a saw. Now, you may use the saw to cut fruits but that’s not wise, is it?**_ - -Does this mean that you cannot be root in Ubuntu or use the system with root privileges? No, you can still have root access with the help of ‘sudo’ (explained in the next section). - -**Bottom line: -**Root user is too powerful to be used for regular tasks. This is why it is not recommended to use root all the time. You can still run specific commands with root. - -### How to run commands as root user in Ubuntu? - -![Image Credit: xkcd][8] - -You’ll need root privileges for some system specific tasks. For example, if you want to [update Ubuntu via command line][9], you cannot run the command as a regular user. It will give you permission denied error. - -``` -apt update -Reading package lists... Done -E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) -E: Unable to lock directory /var/lib/apt/lists/ -W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied) -W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied) -``` - -So, how do you run commands as root? The simple answer is to add sudo before the commands that require to be run as root. - -``` -sudo apt update -``` - -Ubuntu and many other Linux distributions use a special mechanism called sudo. Sudo is a program that controls access to running commands as root (or other users). - -Sudo is actually quite a versatile tool. It can be configured to allow a user to run all commands as root or only some commands as root. You can also configure if password is required for some commands or not to run it with sudo. It’s an extensive topic and maybe I’ll discuss it in details in another article. - -For the moment, you should know that [when you install Ubuntu][10], you are forced to create a user account. This user account works as the admin on your system and as per the default sudo policy in Ubuntu, it can run any command on your system with root privileges. - -The thing with sudo is that running **sudo doesn’t require root password but the user’s own password**. - -And this is why when you run a command with sudo, it asks for the password of the user who is running the sudo command: - -``` -[email protected]:~$ sudo apt update -[sudo] password for abhishek: -``` - -As you can see in the example above, user _abhishek_ was trying to run the ‘apt update’ command with _sudo_ and the system asked the password for _abhishek_. - -If you are absolutely new to Linux, you might be surprised that when you start typing your password in the terminal, nothing happens on the screen. This is perfectly normal because as the default security feature, nothing is displayed on the screen. Not even the asterisks (*). You type your password and press enter. - -**Bottom line: -**To run commands as root in Ubuntu, add sudo before the command. -When asked for password, enter your account’s password. -When you type the password on the screen, nothing is visible. Just keep on typing the password and press enter. - -### How to become root user in Ubuntu? - -You can use sudo to run the commands as root. However in situations, where you have to run several commands as root and you keep forogetting to add sudo before the commands, you may switch to root user temporarily. - -The sudo command allows you to simulate a root login shell with this command: - -``` -sudo -i -``` - -``` -[email protected]:~$ sudo -i -[sudo] password for abhishek: -[email protected]:~# whoami -root -[email protected]:~# -``` - -You’ll notice that when you switch to root, the shell command prompt changes from $ (dollar key sign) to # (pound key sign). This makes me crack a (lame) joke that pound is stronger than dollar. - -_**Though I have showed you how to become the root user, I must warn you that you should avoid using the system as root. It’s discouraged for a reason after all.**_ - -Another way to temporarily switch to root user is by using the su command: - -``` -sudo su -``` - -If you try to use the su command without sudo, you’ll encounter ‘su authentication failure’ error. - -You can go back to being the normal user by using the exit command. - -``` -exit -``` - -### How to enable root user in Ubuntu? - -By now you know that the root user is locked by default in Ubuntu based distributions. - -Linux gives you the freedom to do whatever you want with your system. Unlocking the root user is one of those freedoms. - -If, for some reasons, you decided to enable the root user, you can do so by setting up a password for it: - -``` -sudo passwd root -``` - -Again, this is not recommended and I won’t encourage you to do that on your desktop. If you forgot it, you won’t be able to [change the root password in Ubuntu][11] again. - -You can lock the root user again by removing the password: - -``` -sudo passwd -dl root -``` - -**In the end…** - -I hope you have a slightly better understanding of the root concept now. If you still have some confusion and questions about it, please let me know in the comments. I’ll try to answer your questions and might update the article as well. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/root-user-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]: tmp.IrHYJBAqVn#what-is-root -[2]: tmp.IrHYJBAqVn#run-command-as-root -[3]: tmp.IrHYJBAqVn#become-root -[4]: tmp.IrHYJBAqVn#enable-root -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/root_user_ubuntu.png?ssl=1 -[6]: http://www.linfo.org/root.html -[7]: https://ubuntu.com/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/sudo_sandwich.png?ssl=1 -[9]: https://itsfoss.com/update-ubuntu/ -[10]: https://itsfoss.com/install-ubuntu/ -[11]: https://itsfoss.com/how-to-hack-ubuntu-password/ diff --git a/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md b/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md new file mode 100644 index 0000000000..6113f5aa4a --- /dev/null +++ b/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Root User in Ubuntu: Important Things You Should Know) +[#]: via: (https://itsfoss.com/root-user-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Ubuntu 的 root 用户:你应该知道的重要事情 +====== + +当你已经开始使用 Linux 时,你将发现与 Windows 的很多不同。其中一个‘不同的东西’是 root 用户的概念。 + +在这个初学者系列中,我将解释几个关于 Ubuntu 的 root 用户的重要的东西。 + +**请记住,尽管我正在从 Ubuntu 用户的角度编写这篇文章,它应该对大多数的 Linux 发行版也是有效的。** + +你将在这篇文章中学到下面的内容: + + * [为什么在 Ubuntu 中禁用 root 用户][1] + * [像 root 用户一样使用命令][2] + * [切换为 root 用户][3] + * [解锁 root 用户][4] + + + +### 什么是 root 用户?为什么它在 Ubuntu 中被锁定? + +![][5] + +在 Linux 中,这里总是有一个称为 [root][6] 的超级用户。这是超级管理员账号,它可以做任何事以及使用系统的一切东西。它可以在你的 Linux 系统上访问任何文件和运行任何命令。 + +能力越大,责任越大。root 用户给予你完全控制系统,因此,它应该被谨慎地使用。root 用户可以访问系统文件,运行更改系统配置的命令。因此,一个错误的命令可能会破坏系统。 + +这就是为什么 [Ubuntu][7] 和其它基于 Ubuntu 的发行版默认锁定 root 用户以从意外的灾难中挽救你的原因。 + +对于你的日常任务,像移动你 home 目录中的文件,从因特网下载文件,创建文档等等,你不需要拥有 root 权限。 + +_**打个比方来更好地理解它。假设你不得不切一个水果,你使用一把厨房用刀。假设你不得不砍一颗树,你不得不使用一把锯子。现在,你可以使用锯子来切水果,但是那不明智,不是吗?**_ + +这意味着,你不能是 Ubuntu 中 root 用户,或者不能使用 root +权限来使用系统?不,你仍然可以在 ‘sudo’ 的帮助下来拥有 root 权限来访问(在下一节中解释)。 + +**底线: +**使用于常规任务,root 用户权限太过强大。这就是为什么不建议一直使用 root 用户。你仍然可以使用 root 用户来运行特殊的命令。 + +### 如何在 Ubuntu 中像 root 用户一样运行命令? + +![Image Credit: xkcd][8] + +对于一些系统的特殊任务来说,你将需要 root 权限。例如。如果你想[通过命令行更新 Ubuntu ][9],你不能作为一个常规用户运行该命令。它将给予你权限被拒绝的错误。 + +``` +apt update +Reading package lists... Done +E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) +E: Unable to lock directory /var/lib/apt/lists/ +W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied) +W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied) +``` + +那么,你如何像 root 用户一样运行命令?简单的答案是,在命令前添加 sudo ,来像 root 用户一样运行。 + +``` +sudo apt update +``` + +Ubuntu 和很多其它的 Linux 发行版使用一个被称为 sudo 的特殊程序机制。Sudo 是一个像 root 用户(或其它用户)一样来控制运行命令访问的程序。 + +实际上,Sudo 是一个非常多用途的工具。它可以配置为允许一个用户像 root 用户一样来运行所有的命令,或者仅仅一些命令。你也可以配置是否一些命令需要密码,或者不使用 sudo 去运行命令。它是一个广泛的主题,也许我将在另一篇文章中详细讨论它。 + +就目前而言,你应该知道 [当你安装 Ubuntu 时][10] ,你必需创建一个用户账号。这个用户账号在你系统上作为管理员工作,在 Ubuntu 中作为一个默认的 sudo 策略,它可以在你的系统上使用 root 用户权限来运行任何命令。 + +sudo 的问题是,运行 **sudo 不需要 root 用户密码,而是需要用户自己的密码**。 + +并且这就是为什么当你使用 sudo 运行一个命令,会要求正在运行 sudo 命令的用户的密码的原因: + +``` +[email protected]:~$ sudo apt update +[sudo] password for abhishek: +``` + +正如你在上面示例中所见 _abhishek_ 在尝试使用 _sudo_ 来运行 ‘apt update’ 命令,系统要求 _abhishek_ 的密码。 + +如果你对 Linux 完全不熟悉,当你在终端中开始输入密码时,你可能会惊讶,在屏幕上什么都没有发生。这是十分正常的,因为作为默认的安全功能,在屏幕上什么都不会显示。甚至星号(*)都没有。你输入你的密码并按 Enter 键。 + +**底限: +**为在 Ubuntu 中像 root 用户一样运行命令,在命令前添加 sudo 。 +当被要求输入密码时,输入你的账户的密码。 +当你在屏幕上输入密码时,什么都看不到。请保持输入密码,并按 Enter 键。 + +### 如何在 Ubuntu 中成为 root 用户? + +你可以使用 sudo 来像 root 用户一样运行命令。但是,在某些情况下,你必需像 root 用户一样来运行一些命令,而你总是忘了在命令前添加 sudo ,那么你可以临时切换为 root 用户。 + +sudo 命令允许你来模拟一个 root 用户登录的 shell ,使用这个命令: + +``` +sudo -i +``` + +``` +[email protected]:~$ sudo -i +[sudo] password for abhishek: +[email protected]:~# whoami +root +[email protected]:~# +``` + +你将注意到,当你切换为 root 用户时,shell 命令提示符从 $ (美元按键符号)更改为 # (英镑按键符号)。这使我开了一个(拙劣的)玩笑,英镑比美元强大。 + +_**虽然我已经向你显示如何成为 root 用户,但是我必需警告你,你应该避免作为 root 用户使用系统。毕竟它有阻拦你使用 root 用户的原因。**_ + +另外一种临时切换为 root 用户的方法是使用 su 命令: + +``` +sudo su +``` + +如果你尝试使用不带有的 sudo 的 su 命令,你将遇到 ‘su authentication failure’ 错误。 + +你可以使用 exit 命令来恢复为正常用户。 + +``` +exit +``` + +### 如何在 Ubuntu 中启用 root 用户? + +现在你知道,root 用户在基于 Ubuntu 发行版中是默认锁定的。 + +Linux 给予你在系统上想做什么就做什么的自由。解锁 root 用户就是这些自由之一。 + +如果,出于某些原因,你决定启用 root 用户,你可以通过为其设置一个密码来做到: + +``` +sudo passwd root +``` + +再强调一次,不建议使用 root 用户,并且我不支持你在你的桌面上也这样做。如果你忘记密码,你将不能再次 [在 Ubuntu 中更改 root 用户密码][11] 。 + +你可以通过移除密码来再次锁定 root 用户: + +``` +sudo passwd -dl root +``` + +**最后…** + +我希望你现在对 root 概念有稍微更好一点的理解。如果你仍然有些关于它的困惑和问题,请在评论中让我知道。我将尝试回答你的问题,并且也可能更新这篇文章。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/root-user-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: tmp.IrHYJBAqVn#what-is-root +[2]: tmp.IrHYJBAqVn#run-command-as-root +[3]: tmp.IrHYJBAqVn#become-root +[4]: tmp.IrHYJBAqVn#enable-root +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/root_user_ubuntu.png?ssl=1 +[6]: http://www.linfo.org/root.html +[7]: https://ubuntu.com/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/sudo_sandwich.png?ssl=1 +[9]: https://itsfoss.com/update-ubuntu/ +[10]: https://itsfoss.com/install-ubuntu/ +[11]: https://itsfoss.com/how-to-hack-ubuntu-password/ From 66f29cbba59b69377f98fd36a0305a5df11b988f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 31 Jan 2020 11:54:49 +0800 Subject: [PATCH 172/285] Translating --- .../20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md b/sources/tech/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md index 229ea0eb6e..5aff6be9eb 100644 --- a/sources/tech/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md +++ b/sources/tech/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md @@ -1,3 +1,4 @@ +Translating by robsean MidnightBSD Could Be Your Gateway to FreeBSD ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/midnight_4_0.jpg?itok=T2gpLVui) From 1454d7851f2e7221ceedc44d223e5ebb33e9c110 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 Jan 2020 13:05:35 +0800 Subject: [PATCH 173/285] PRF @robsean --- ...buntu- Important Things You Should Know.md | 83 +++++++++---------- 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md b/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md index 6113f5aa4a..c09cc5b595 100644 --- a/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md +++ b/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Root User in Ubuntu: Important Things You Should Know) [#]: via: (https://itsfoss.com/root-user-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Ubuntu 的 root 用户:你应该知道的重要事情 +Ubuntu 中的 root 用户:你应该知道的重要事情 ====== -当你已经开始使用 Linux 时,你将发现与 Windows 的很多不同。其中一个‘不同的东西’是 root 用户的概念。 +![][5] + +当你刚开始使用 Linux 时,你将发现与 Windows 的很多不同。其中一个“不同的东西”是 root 用户的概念。 在这个初学者系列中,我将解释几个关于 Ubuntu 的 root 用户的重要的东西。 @@ -18,38 +20,32 @@ Ubuntu 的 root 用户:你应该知道的重要事情 你将在这篇文章中学到下面的内容: - * [为什么在 Ubuntu 中禁用 root 用户][1] - * [像 root 用户一样使用命令][2] - * [切换为 root 用户][3] - * [解锁 root 用户][4] - - +* 为什么在 Ubuntu 中禁用 root 用户 +* 像 root 用户一样使用命 +* 切换为 root 用户 +* 解锁 root 用户 ### 什么是 root 用户?为什么它在 Ubuntu 中被锁定? -![][5] +在 Linux 中,有一个称为 [root][6] 的超级用户。这是超级管理员账号,它可以做任何事以及使用系统的一切东西。它可以在你的 Linux 系统上访问任何文件和运行任何命令。 -在 Linux 中,这里总是有一个称为 [root][6] 的超级用户。这是超级管理员账号,它可以做任何事以及使用系统的一切东西。它可以在你的 Linux 系统上访问任何文件和运行任何命令。 +能力越大,责任越大。root 用户给予你完全控制系统的能力,因此,它应该被谨慎地使用。root 用户可以访问系统文件,运行更改系统配置的命令。因此,一个错误的命令可能会破坏系统。 -能力越大,责任越大。root 用户给予你完全控制系统,因此,它应该被谨慎地使用。root 用户可以访问系统文件,运行更改系统配置的命令。因此,一个错误的命令可能会破坏系统。 +这就是为什么 [Ubuntu][7] 和其它基于 Ubuntu 的发行版默认锁定 root 用户,以从意外的灾难中挽救你的原因。 -这就是为什么 [Ubuntu][7] 和其它基于 Ubuntu 的发行版默认锁定 root 用户以从意外的灾难中挽救你的原因。 +对于你的日常任务,像移动你家目录中的文件,从互联网下载文件,创建文档等等,你不需要拥有 root 权限。 -对于你的日常任务,像移动你 home 目录中的文件,从因特网下载文件,创建文档等等,你不需要拥有 root 权限。 +**打个比方来更好地理解它。假设你想要切一个水果,你可以使用一把厨房用刀。假设你想要砍一颗树,你就得使用一把锯子。现在,你可以使用锯子来切水果,但是那不明智,不是吗?**_ -_**打个比方来更好地理解它。假设你不得不切一个水果,你使用一把厨房用刀。假设你不得不砍一颗树,你不得不使用一把锯子。现在,你可以使用锯子来切水果,但是那不明智,不是吗?**_ +这意味着,你不能是 Ubuntu 中 root 用户或者不能使用 root 权限来使用系统吗?不,你仍然可以在 `sudo` 的帮助下来拥有 root 权限来访问(在下一节中解释)。 -这意味着,你不能是 Ubuntu 中 root 用户,或者不能使用 root -权限来使用系统?不,你仍然可以在 ‘sudo’ 的帮助下来拥有 root 权限来访问(在下一节中解释)。 - -**底线: -**使用于常规任务,root 用户权限太过强大。这就是为什么不建议一直使用 root 用户。你仍然可以使用 root 用户来运行特殊的命令。 +> **要点:** 使用于常规任务,root 用户权限太过强大。这就是为什么不建议一直使用 root 用户。你仍然可以使用 root 用户来运行特殊的命令。 ### 如何在 Ubuntu 中像 root 用户一样运行命令? ![Image Credit: xkcd][8] -对于一些系统的特殊任务来说,你将需要 root 权限。例如。如果你想[通过命令行更新 Ubuntu ][9],你不能作为一个常规用户运行该命令。它将给予你权限被拒绝的错误。 +对于一些系统的特殊任务来说,你将需要 root 权限。例如。如果你想[通过命令行更新 Ubuntu][9],你不能作为一个常规用户运行该命令。它将给出权限被拒绝的错误。 ``` apt update @@ -60,41 +56,38 @@ W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Pe W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied) ``` -那么,你如何像 root 用户一样运行命令?简单的答案是,在命令前添加 sudo ,来像 root 用户一样运行。 +那么,你如何像 root 用户一样运行命令?简单的答案是,在命令前添加 `sudo`,来像 root 用户一样运行。 ``` sudo apt update ``` -Ubuntu 和很多其它的 Linux 发行版使用一个被称为 sudo 的特殊程序机制。Sudo 是一个像 root 用户(或其它用户)一样来控制运行命令访问的程序。 +Ubuntu 和很多其它的 Linux 发行版使用一个被称为 `sudo` 的特殊程序机制。`sudo` 是一个以 root 用户(或其它用户)来控制运行命令访问的程序。 -实际上,Sudo 是一个非常多用途的工具。它可以配置为允许一个用户像 root 用户一样来运行所有的命令,或者仅仅一些命令。你也可以配置是否一些命令需要密码,或者不使用 sudo 去运行命令。它是一个广泛的主题,也许我将在另一篇文章中详细讨论它。 +实际上,`sudo` 是一个非常多用途的工具。它可以配置为允许一个用户像 root 用户一样来运行所有的命令,或者仅仅一些命令。你也可以配置为无需密码即可使用 sudo 运行命令。这个主题内容比较丰富,也许我将在另一篇文章中详细讨论它。 -就目前而言,你应该知道 [当你安装 Ubuntu 时][10] ,你必需创建一个用户账号。这个用户账号在你系统上作为管理员工作,在 Ubuntu 中作为一个默认的 sudo 策略,它可以在你的系统上使用 root 用户权限来运行任何命令。 +就目前而言,你应该知道[当你安装 Ubuntu 时][10],你必须创建一个用户账号。这个用户账号在你系统上以管理员身份来工作,并且按照 Ubuntu 中的默认 sudo 策略,它可以在你的系统上使用 root 用户权限来运行任何命令。 -sudo 的问题是,运行 **sudo 不需要 root 用户密码,而是需要用户自己的密码**。 +`sudo` 的问题是,运行 **sudo 不需要 root 用户密码,而是需要用户自己的密码**。 -并且这就是为什么当你使用 sudo 运行一个命令,会要求正在运行 sudo 命令的用户的密码的原因: +并且这就是为什么当你使用 `sudo` 运行一个命令,会要求输入正在运行 `sudo` 命令的用户的密码的原因: ``` [email protected]:~$ sudo apt update [sudo] password for abhishek: ``` -正如你在上面示例中所见 _abhishek_ 在尝试使用 _sudo_ 来运行 ‘apt update’ 命令,系统要求 _abhishek_ 的密码。 +正如你在上面示例中所见 `abhishek` 在尝试使用 `sudo` 来运行 `apt update` 命令,系统要求输入 `abhishek` 的密码。 -如果你对 Linux 完全不熟悉,当你在终端中开始输入密码时,你可能会惊讶,在屏幕上什么都没有发生。这是十分正常的,因为作为默认的安全功能,在屏幕上什么都不会显示。甚至星号(*)都没有。你输入你的密码并按 Enter 键。 +**如果你对 Linux 完全不熟悉,当你在终端中开始输入密码时,你可能会惊讶,在屏幕上什么都没有发生。这是十分正常的,因为作为默认的安全功能,在屏幕上什么都不会显示。甚至星号(`*`)都没有。输入你的密码并按回车键。** -**底限: -**为在 Ubuntu 中像 root 用户一样运行命令,在命令前添加 sudo 。 -当被要求输入密码时,输入你的账户的密码。 -当你在屏幕上输入密码时,什么都看不到。请保持输入密码,并按 Enter 键。 +> **要点:**为在 Ubuntu 中像 root 用户一样运行命令,在命令前添加 `sudo`。 当被要求输入密码时,输入你的账户的密码。当你在屏幕上输入密码时,什么都看不到。请继续输入密码,并按回车键。 ### 如何在 Ubuntu 中成为 root 用户? -你可以使用 sudo 来像 root 用户一样运行命令。但是,在某些情况下,你必需像 root 用户一样来运行一些命令,而你总是忘了在命令前添加 sudo ,那么你可以临时切换为 root 用户。 +你可以使用 `sudo` 来像 root 用户一样运行命令。但是,在某些情况下,你必须以 root 用户身份来运行一些命令,而你总是忘了在命令前添加 `sudo`,那么你可以临时切换为 root 用户。 -sudo 命令允许你来模拟一个 root 用户登录的 shell ,使用这个命令: +`sudo` 命令允许你来模拟一个 root 用户登录的 shell ,使用这个命令: ``` sudo -i @@ -108,19 +101,19 @@ root [email protected]:~# ``` -你将注意到,当你切换为 root 用户时,shell 命令提示符从 $ (美元按键符号)更改为 # (英镑按键符号)。这使我开了一个(拙劣的)玩笑,英镑比美元强大。 +你将注意到,当你切换为 root 用户时,shell 命令提示符从 `$`(美元符号)更改为 `#`(英镑符号)。我开个(拙劣的)玩笑,英镑比美元强大。 -_**虽然我已经向你显示如何成为 root 用户,但是我必需警告你,你应该避免作为 root 用户使用系统。毕竟它有阻拦你使用 root 用户的原因。**_ +**虽然我已经向你显示如何成为 root 用户,但是我必须警告你,你应该避免作为 root 用户使用系统。毕竟它有阻拦你使用 root 用户的原因。** -另外一种临时切换为 root 用户的方法是使用 su 命令: +另外一种临时切换为 root 用户的方法是使用 `su` 命令: ``` sudo su ``` -如果你尝试使用不带有的 sudo 的 su 命令,你将遇到 ‘su authentication failure’ 错误。 +如果你尝试使用不带有的 `sudo` 的 `su` 命令,你将遇到 “su authentication failure” 错误。 -你可以使用 exit 命令来恢复为正常用户。 +你可以使用 `exit` 命令来恢复为正常用户。 ``` exit @@ -132,13 +125,13 @@ exit Linux 给予你在系统上想做什么就做什么的自由。解锁 root 用户就是这些自由之一。 -如果,出于某些原因,你决定启用 root 用户,你可以通过为其设置一个密码来做到: +如果出于某些原因,你决定启用 root 用户,你可以通过为其设置一个密码来做到: ``` sudo passwd root ``` -再强调一次,不建议使用 root 用户,并且我不支持你在你的桌面上也这样做。如果你忘记密码,你将不能再次 [在 Ubuntu 中更改 root 用户密码][11] 。 +再强调一次,不建议使用 root 用户,并且我也不鼓励你在桌面上这样做。如果你忘记了密码,你将不能再次[在 Ubuntu 中更改 root 用户密码][11]。(LCTT 译注:可以通过单用户模式修改。) 你可以通过移除密码来再次锁定 root 用户: @@ -146,9 +139,9 @@ sudo passwd root sudo passwd -dl root ``` -**最后…** +### 最后… -我希望你现在对 root 概念有稍微更好一点的理解。如果你仍然有些关于它的困惑和问题,请在评论中让我知道。我将尝试回答你的问题,并且也可能更新这篇文章。 +我希望你现在对 root 概念理解得更好一点。如果你仍然有些关于它的困惑和问题,请在评论中让我知道。我将尝试回答你的问题,并且也可能更新这篇文章。 -------------------------------------------------------------------------------- @@ -157,7 +150,7 @@ via: https://itsfoss.com/root-user-ubuntu/ 作者:[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 a19775aa4ab437de30b3433f471144d12fd518a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 Jan 2020 13:06:09 +0800 Subject: [PATCH 174/285] PUB @robsean https://linux.cn/article-11837-1.html --- ...5 Root User in Ubuntu- Important Things You Should Know.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200115 Root User in Ubuntu- Important Things You Should Know.md (99%) diff --git a/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md b/published/20200115 Root User in Ubuntu- Important Things You Should Know.md similarity index 99% rename from translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md rename to published/20200115 Root User in Ubuntu- Important Things You Should Know.md index c09cc5b595..0abc566f4b 100644 --- a/translated/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md +++ b/published/20200115 Root User in Ubuntu- Important Things You Should Know.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11837-1.html) [#]: subject: (Root User in Ubuntu: Important Things You Should Know) [#]: via: (https://itsfoss.com/root-user-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 6a5097dc4e770a30f3cdaf41757487aeaa83a6d5 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Fri, 31 Jan 2020 14:01:22 +0800 Subject: [PATCH 175/285] Translating. --- .../tech/20200126 What-s your favorite Linux distribution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200126 What-s your favorite Linux distribution.md b/sources/tech/20200126 What-s your favorite Linux distribution.md index 029a4272e8..c1f4ab4688 100644 --- a/sources/tech/20200126 What-s your favorite Linux distribution.md +++ b/sources/tech/20200126 What-s your favorite Linux distribution.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (LazyWolfLin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -43,7 +43,7 @@ via: https://opensource.com/article/20/1/favorite-linux-distribution 作者:[Opensource.com][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[LazyWolfLin](https://github.com/LazyWolfLin) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4add6a1fd8bfe3d3ee4cf12753dd6de155b8ce92 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Fri, 31 Jan 2020 14:31:00 +0800 Subject: [PATCH 176/285] Translating What's your favorite Linux distribution.md --- ...What‘s your favorite Linux distribution.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 translated/tech/20200126 What‘s your favorite Linux distribution.md diff --git a/translated/tech/20200126 What‘s your favorite Linux distribution.md b/translated/tech/20200126 What‘s your favorite Linux distribution.md new file mode 100644 index 0000000000..196eca3a47 --- /dev/null +++ b/translated/tech/20200126 What‘s your favorite Linux distribution.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: (LazyWolfLin) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's your favorite Linux distribution?) +[#]: via: (https://opensource.com/article/20/1/favorite-linux-distribution) +[#]: author: (Opensource.com https://opensource.com/users/admin) + +你最喜欢哪一个 Linux 发行版? +====== +参与我们的第七届年度调查,让我们了解你对 Linux 发行版的偏好。 + +![Hand putting a Linux file folder into a drawer][1] + +What's your favorite Linux distribution? Take our 7th annual poll. Some have come and gone, but there are hundreds of [Linux distributions][2] alive and well today. The combination of distribution, package manager, and desktop creates an endless amount of customized environments for Linux users. + +We asked the community of writers what their favorite is and why. While there were some commonalities (Fedora and Ubuntu were popular choices for a variety of reasons), we heard a few surprises as well. Here are a few of their responses: + +"I use the Fedora distro! I love the community of people who work together to make an awesome operating system that showcases the greatest innovations in the free and open source software world." — Matthew Miller + +"I use Arch at home. As a gamer, I want easy access to the latest Wine versions and GFX drivers, as well as large amounts of control over my OS. Give me a rolling-release distro with every package at bleeding-edge." —Aimi Hobson + +"NixOS, with nothing coming close in the hobbyist niche." —Alexander Sosedkin + +"I have used every Fedora version as my primary work OS. Meaning, I started with the first one. Early on, I asked myself if there would ever come a time when I couldn't remember which number I was on. That time has arrived. What year is it, anyway?" —Hugh Brock + +"I usually have Ubuntu, CentOS, and Fedora boxes running around the house and the office. We depend on all of these distributions for various things. Fedora for speed and getting the latest versions of applications and libraries. Ubuntu for those that need easy of use with a large community of support. CentOS when we need a rock-solid server platform that just runs." —Steve Morris + +"My favorite? For the community, and how packages are built for the distribution (from source, not binaries), I choose Fedora. For pure breadth of packages available and elegance in how packages are defined and developed, I choose Debian. For documentation, I choose Arch. For newbies that ask, I used to recommend Ubuntu but now recommend Fedora." —Al Stone + +* * * + +We've been asking the community this question since 2014. With the exception of PCLinuxOS taking the lead in 2015, Ubuntu tends to be the fan-favorite from year to year. Other popular contenders have been Fedora, Debian, Mint, and Arch. Which distribution stands out to you in the new decade? If we didn't include your favorite in the list of choices, tell us about it in the comments.  + +Here's a look at your favorite Linux distributions throughout the last seven years. You can find this in our latest yearbook, [Best of a decade on Opensource.com][3]. To download the whole eBook, [click here][3]! + +![Poll results for favorite Linux distribution through the years][4] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/favorite-linux-distribution + +作者:[Opensource.com][a] +选题:[lujun9972][b] +译者:[LazyWolfLin](https://github.com/LazyWolfLin) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/admin +[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://distrowatch.com/ +[3]: https://opensource.com/downloads/2019-yearbook-special-edition +[4]: https://opensource.com/sites/default/files/pictures/linux-distributions-through-the-years.jpg (favorite Linux distribution through the years) From 5a22ee9fc0a21430eeb1fd7c89137829323d4922 Mon Sep 17 00:00:00 2001 From: chenmu-kk <53132802+chenmu-kk@users.noreply.github.com> Date: Fri, 31 Jan 2020 14:37:35 +0800 Subject: [PATCH 177/285] Update 20180503 How the four components of a distributed tracing system work together.md --- ... components of a distributed tracing system work together.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180503 How the four components of a distributed tracing system work together.md b/sources/tech/20180503 How the four components of a distributed tracing system work together.md index 68ba97e989..76e093f072 100644 --- a/sources/tech/20180503 How the four components of a distributed tracing system work together.md +++ b/sources/tech/20180503 How the four components of a distributed tracing system work together.md @@ -1,4 +1,4 @@ -chenmu-kk is translating. +chenmu-kk is translating . How the four components of a distributed tracing system work together ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/touch-tracing.jpg?itok=rOmsY-nU) From d822d1f0e947d59c7248ded6c1b47b8892a39ffc 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: Fri, 31 Jan 2020 06:31:15 -0800 Subject: [PATCH 178/285] Update & Translating File name: 20200129 Showing memory usage in Linux by process and user.md Translator: mengxinayan --- ...00129 Showing memory usage in Linux by process and user.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200129 Showing memory usage in Linux by process and user.md b/sources/tech/20200129 Showing memory usage in Linux by process and user.md index 8e21baf042..85c6fcb4ea 100644 --- a/sources/tech/20200129 Showing memory usage in Linux by process and user.md +++ b/sources/tech/20200129 Showing memory usage in Linux by process and user.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -180,7 +180,7 @@ via: https://www.networkworld.com/article/3516319/showing-memory-usage-in-linux- 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[mengxinayan](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4c90885ba1d4629c74a65cca4014d94e062d283d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 1 Feb 2020 00:58:43 +0800 Subject: [PATCH 179/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200131=205=20wa?= =?UTF-8?q?ys=20to=20use=20Emacs=20as=20your=20RPG=20dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200131 5 ways to use Emacs as your RPG dashboard.md --- ...ways to use Emacs as your RPG dashboard.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20200131 5 ways to use Emacs as your RPG dashboard.md diff --git a/sources/tech/20200131 5 ways to use Emacs as your RPG dashboard.md b/sources/tech/20200131 5 ways to use Emacs as your RPG dashboard.md new file mode 100644 index 0000000000..b1d7c6923d --- /dev/null +++ b/sources/tech/20200131 5 ways to use Emacs as your RPG dashboard.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to use Emacs as your RPG dashboard) +[#]: via: (https://opensource.com/article/20/1/emacs-rpgs) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 ways to use Emacs as your RPG dashboard +====== +Emacs is a flexible way to organize and manage your tabletop +role-playing games. +![Chess pieces on a chess board][1] + +There are two ways to play a tabletop role-playing game (RPG): You can play an adventure written by the game's publisher or an independent author, or you can play an adventure that is made up as you go. Regardless of which you choose, there's probably prep work to do. One player (generically called the _game master_) must gather monster or enemy stats, loot tables, and references for rules, and the other players must build characters and apportion (pretend) equipment. Nothing's going to eliminate prep work from a complex RPG, but if you're an [Emacs][2] user, you might find that Emacs makes a great dashboard to keep everything all straight. + +### Organize the rules + +Unfortunately, the digital editions of many RPGs are distributed as PDFs because that's what the RPG publisher sent to the printer for the physical edition. PDFs are good at preserving layout, but they're far from an ideal eBook format. If you play RPGs published under an open license, you can often obtain the rules in alternate formats (such as HTML), which gives you more control and flexibility. Even the world's first and most famous RPG, Dungeons & Dragons, provides its rules as a free download in digital format (which has been translated into HTML and Markdown by many a website). + +I open the rules as Markdown in Emacs so that I have a searchable reference at the ready. While opening the rules as a PDF in a PDF reader lets you search for embedded text, using a text file instead provides several benefits. First of all, a text file is much smaller than a PDF, so it's faster to load and to search. Second, text files are easily editable, so if you find a rule that sends you seeking clarification, you can add what you learn (or whatever you make up) directly into your master document. You can also add house rules and additional resources. My aim is to have a single file that contains all of the rules and resources I use in games I run, with everything a quick **Ctrl+s** (**C-s** in Emacs notation) away. + +### Manage initiatives + +Most RPG systems feature a method to determine the order of play during combat. This is commonly called _initiative_, and it comes up a lot since the source of conflict in games often involves combat or some kind of opposed competitive action. It's not that hard to keep track of combat with pencil and paper, but in games where I'm using digital assets anyway, I find it easier to stay digital for everything. Luckily, the venerable [Org mode][3] provides an excellent solution. + +When players roll for initiative, I type their names into Emacs' scratch buffer. Then I type each monster or enemy, along with the hit or health points (HP) of each, followed by two columns of 0: + + +``` +brad +emily +zombie 22 0 0 +zombie 22 0 0 +flesh-golem 93 0 0 +``` + +Then I select the block of player characters (PCs) and monsters and use the **org-table-create-or-convert-from-region** function to create an Org mode table around it. Using **Alt+Down arrow** (**M-down** in Emacs notation), I move each PC or monster into the correct initiative order. + + +``` +| emily       |    |   |   | +| flesh-golem | 93 | 0 | 0 | +| zombie      | 22 | 0 | 0 | +| brad        |    |   |   | +| zombie      | 22 | 0 | 0 | +``` + +During combat, I only need to record damage for monsters, because the players manage their own HP. For the enemies I control in combat, the second column is its HP (its starting number is taken from the RPG system's rules), and the third is the damage dealt during the current round. + +Table formulas in Org mode are defined on a special **TBLFM** line at the end of the table. If you've used any computerized spreadsheet for anything, [Org table][4] will be fairly intuitive. For combat tracking, I want the third column to be subtracted from the second. Columns are indexed from left to right (**$1** for the first, **$2** for the second, and **$3** for the third), so to replace the contents of column $2 with the sum of columns $2 and $3, I add this line to the bottom of the table: + + +``` +`#+TBLFM: $2=vsum($2 - $3)` +``` + +I don't actually type that into Emacs every time the game enters combat mode. Instead, I've defined an auto-completion trigger with Emacs' [abbrev mode][5], a system that allows you to type in a special string of your choosing, which Emacs expands into something more complex. I define my abbreviations in a file called **~/.emacs.d/abbrev_defs**, using **rpgi** followed by a **Space** as the trigger for Emacs to change the line to my initiative table formula: + + +``` +(define-abbrev-table 'global-abbrev-table +  '( +    ("rpgi" "#+TBLFM: $2=vsum($2 - $3)" nil 0) +   )) +``` + +Each time a player deals damage to a monster, I enter the amount of damage in the damage column. To trigger a table recalculation, I press **Ctrl+u Ctrl+c** (i.e., **C-u C-c** in Emacs) or **Ctrl+c Ctrl+c** (i.e., **C-c C-c**) if I happen to be on the formula line:  + + +``` +| brad        |    |    | +| emily       |    |    | +| zombie      | 12 | 10 | +| zombie      | 15 |  7 | +| flesh-golem | 91 |  2 | +#+TBLFM: $2=vsum($2 - $3) +``` + +This system isn't perfect. Character names can't contain any spaces because Org table splits cells by white space. It's relatively easy to forget that you processed one line and accidentally reprocess it at the end of a round. To add HP back to a creature's total, you have to use a negative number. (I think of it as negative damage, which suggests health.) Then again, many computerized initiative trackers suffer the same problems, so it's not a particularly bad solution. For me, it's one of the faster methods I've found (I'm happy to admit that [MapTool][6] is the best, but I use my Emacs workflow when I'm not using a digital shared map). + +### View PDFs in DocView + +Sometimes a PDF is unavoidable. Whether it's a d100 list of tavern names or a dungeon map, some resources exist only as a PDF with no extractable text data. In these cases, Emacs' [DocView][7] package can help. DocView is a mode that loads PDF data and generates a PNG file for you to view (Emacs can also view JPEG files). I've found that large PDFs are problematic and slow, but if it's a low-resolution PDF with just one or two pages, DocView is an easy way to reference a document without leaving Emacs. + +I use this mode exclusively for maps, tables, and lists. It's not useful for anything that might involve searching, because text data isn't accessible, but it's an amazingly useful feature for documents you only need to glance at. + +![Emacs for RPG][8] + +The [Ghostscript][9] suite that ships with most Linux distributions (or certainly is available in your repository) allows you to process PDFs, drastically simplifying them by lowering the resolution of images from print quality to screen quality. The command contains mostly PostScript commands and attributes, but you don't need to become a PostScript expert to perform a quick down-res: + + +``` +$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ +-dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH \ +-sOutputFile=adventure.pdf \ +-dDownsampleColorImages=true \ +-dColorImageResolution=72 big-adventure-module.pdf +``` + +Opening PDFs in Emacs isn't as exciting as it may sound. It's not by any means a first-class PDF viewer, but for select resources, it can be a convenient way to keep all your information on one screen. + +### Create adventure rap sheets + +Published adventures are often heavy on prose. The theory is that you've paid a lot of money for a prepared adventure, so you obviously want value for your purchase. I do value the lore and world-building that authors put into their adventures, but during a game, I like to have a quick reference to the information I need for the game mechanics to work as intended. In other words, I don't need to have the story of why a trap was placed in a dungeon when a rogue triggers it; I only need to know that the trap exists and what the rogue needs to roll in order to survive. + +I haven't found any modern adventure format that provides me with just that information, so I end up creating my own "rap sheets": a minimal outline for the adventure, with just the game mechanics information I need for each location. Once again, Org mode is the best way for me to keep this information handy. + +In Org mode, you create lists using asterisks for bullet points. For a sub-item, add an asterisk. Even better, press **C-c t** (that's **Ctrl+c** and then the **t** key) to mark the item as a **TODO** item. When your players clear an area in the game, press **C-c t** again to mark the location **DONE**. + + +``` +* DONE 1 Entrance +** Zombie +AC 9 | HP 22 +* TODO 2 Necromancer's chambers +** Flesh golem +AC 16 | HP 93 +** Treasure +\- Gold ring (200 gp) +\- Rusty nail (1 cp) +  Cursed (roll on curse table) +** Secret door (DC 20) +\- to area 11 +``` + +Each asterisk is collapsible, so you can get a summary of a global area by collapsing your list down to just the top-level: + + +``` +* DONE 1 Entrance +* TODO 2 Necromancer's chambers +* TODO 3 Wyrmling nursery +* TODO 4 Caretaker's chambers +* TODO 5 Caretaker's laboratory +``` + +An added bonus: I find that making my own rap sheets helps me internalize both the mechanics and the lore of the adventure I'm preparing, so the benefits to this method are numerous. Since I manage any adventure I run in Emacs with Git, once I do the prep work for an adventure, I have fresh copies of all my assets in case I run the adventure with another group or with a set of fresh characters. + +### Make your own adventure journal + +Generally, I let my players keep their own notes about the adventure because I want to encourage players to interpret the events happening in the adventure for themselves. However, a game master needs private notes to keep all of the improvised data in order. For example, if a published adventure doesn't feature a blacksmith shop, but players decide to visit a blacksmith, then a blacksmith needs to be invented in the moment. If the players revisit the blacksmith six weeks later, then they expect it to be the same blacksmith, and it's up to the game master to keep track of such additions to the published setting. I manage my personal notes about adventures in two different ways, depending on what's available to me. + +If I have the text of the adventure in an editable format (such as HTML or Markdown), I enter my additions into the adventure as if the publisher had included them from the start. This means there's always one source of truth for the setting and for significant events. + +If I haven't been able to get an editable copy of the adventure because it's a hard copy or a PDF that's not easily modified, then I write my additions into my rap sheets in Org mode. This functionally means that there's still one source of truth because my rap sheets are the first place I look for information, falling back on the published text only for details I've forgotten. Sometimes I like my additions enough to merge them back into my Git master for the adventure, but usually, I trust in improvisation and let additions happen dynamically for each group that plays the adventure. + +### Why Emacs is my favorite RPG dashboard + +I've fallen into using Emacs for RPGs because it serves as the heads-up display of my dreams. The "right" answer is probably a good [tiling window manager][10], but until I implement that, I'm happy with Emacs. Everything's bound to keyboard shortcuts designed for specificity and speed, and there's just enough easy customization that I can hack together good-enough solutions—sometimes even while players are arguing with one another about what to do next. + +I've tried juggling multiple desktops, several PDF reader windows, and a spreadsheet for initiatives; while it's a fine experience, nothing has equaled the fluidity of Emacs as my RPG dashboard. + +* * * + +Hey! do you love Emacs? [Write an article][11] about how you use an Emacs (GNU or otherwise) for inclusion in our forthcoming Emacs series! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/emacs-rpgs + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-chess-games.png?itok=U1lWMZ0y (Chess pieces on a chess board) +[2]: https://opensource.com/life/16/2/intro-to-emacs +[3]: https://orgmode.org/ +[4]: https://orgmode.org/manual/Tables.html +[5]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html#Abbrevs +[6]: https://opensource.com/article/19/6/how-use-maptools +[7]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html +[8]: https://opensource.com/sites/default/files/uploads/emacs-rpg.jpg (Emacs for RPG) +[9]: https://www.ghostscript.com/ +[10]: https://opensource.com/article/19/12/ratpoison-linux-desktop +[11]: https://opensource.com/how-submit-article From 4e4f09fa7f2bd9c3e8d2ed648b9547271ea632fe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 1 Feb 2020 01:39:09 +0800 Subject: [PATCH 180/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200131=20Intro?= =?UTF-8?q?=20to=20the=20Linux=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200131 Intro to the Linux command line.md --- ...0200131 Intro to the Linux command line.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20200131 Intro to the Linux command line.md diff --git a/sources/tech/20200131 Intro to the Linux command line.md b/sources/tech/20200131 Intro to the Linux command line.md new file mode 100644 index 0000000000..572be7eee2 --- /dev/null +++ b/sources/tech/20200131 Intro to the Linux command line.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intro to the Linux command line) +[#]: via: (https://www.networkworld.com/article/3518440/intro-to-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Intro to the Linux command line +====== +Here are some warm-up exercises for anyone just starting to use the Linux command line. Warning: It can be addictive. +[Sandra Henry-Stocker / Linux][1] [(CC0)][2] + +If you’re new to Linux or have simply never bothered to explore the command line, you may not understand why so many Linux enthusiasts get excited typing commands when they’re sitting at a comfortable desktop with plenty of tools and apps available to them. In this post, we’ll take a quick dive to explore the wonders of the command line and see if maybe we can get you hooked. + +First, to use the command line, you have to open up a command tool (also referred to as a “command prompt”). How to do this will depend on which version of Linux you’re running. On RedHat, for example, you might see an Activities tab at the top of your screen which will open a list of options and a small window for entering a command (like “cmd” which will open the window for you). On Ubuntu and some others, you might see a small terminal icon along the left-hand side of your screen. On many systems, you can open a command window by pressing the **Ctrl+Alt+t** keys at the same time. + +You will also find yourself on the command line if you log into a Linux system using a tool like PuTTY. + +[][3] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][3] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +Once you get your command line window, you’ll find yourself sitting at a prompt. It could be just a **$** or something as elaborate as “**user@system:~$**” but it means that the system is ready to run commands for you. + +Once you get this far, it will be time to start entering commands. Below are some of the commands to try first, and [here is a PDF][4] of some particularly useful commands and a two-sided command cheatsheet suitable for printing out and laminating. + +``` +Command What it does +pwd show me where I am in the file system (initially, this will be your + home directory) +ls list my files +ls -a list even more of my files (including those that start with a period) +ls -al list my files with lots of details (including dates, file sizes and + permissions) +who show me who is logged in (don’t be disappointed if it’s only you) +date remind me what day today is (shows the time too) +ps list my running processes (might just be your shell and the “ps” + command) +``` + +Once you’ve gotten used to your Linux home from the command line point of view, you can begin to explore. Maybe you’ll feel ready to wander around the file system with commands like these: + +``` +Command What it does +cd /tmp move to another directory (in this case, /tmp) +ls list files in that location +cd go back home (with no arguments, cd always takes you back to your home + directory) +cat .bashrc display the contents of a file (in this case, .bashrc) +history show your recent commands +echo hello say “hello” to yourself +cal show a calendar for the current month +``` + +To get a feeling for why more advanced Linux users like the command line so much, you will want to try some other features – like redirection and pipes. Redirection is when you take the output of a command and drop it into a file instead of displaying it on your screen. Pipes are when you take the output of one command and send it to another command that will manipulate it in some way. Here are commands to try: + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][5] + +``` +Command What it does +echo “echo hello” > tryme create a new file and put the words “echo hello” into + it +chmod 700 tryme make the new file executable +tryme run the new file (it should run the command it + contains and display “hello”) +ps aux show all running processes +ps aux | grep $USER show all running processes, but limit the output to + lines containing your username +echo $USER display your username using an environment variable +whoami display your username with a command +who | wc -l count how many users are currently logged in +``` + +### Wrap-Up + +Once you get used to the basic commands, you can explore other commands and try your hand at writing scripts. You might find that Linux is a lot more powerful and nice to use than you ever imagined. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3518440/intro-to-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://commons.wikimedia.org/wiki/File:Tux.svg +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 7d22c8245dfedeeb3ac7224ff29184be8dd3f11a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 1 Feb 2020 01:40:08 +0800 Subject: [PATCH 181/285] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200131=20How=20?= =?UTF-8?q?bacteria=20could=20run=20the=20Internet=20of=20Things?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200131 How bacteria could run the Internet of Things.md --- ...cteria could run the Internet of Things.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/talk/20200131 How bacteria could run the Internet of Things.md diff --git a/sources/talk/20200131 How bacteria could run the Internet of Things.md b/sources/talk/20200131 How bacteria could run the Internet of Things.md new file mode 100644 index 0000000000..48f86de474 --- /dev/null +++ b/sources/talk/20200131 How bacteria could run the Internet of Things.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How bacteria could run the Internet of Things) +[#]: via: (https://www.networkworld.com/article/3518413/how-bacteria-could-run-the-internet-of-things.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How bacteria could run the Internet of Things +====== +The Internet of Bio-Nano Things (IoBNT) would use certain kinds of bacteria, which scientists think has the attributes needed to make effective sensor networks. +Thinkstock + +Biologically created computing devices could one day be as commonplace as today’s microprocessors and microchips, some scientists believe. Consider DNA, the carrier of genetic information and the principal component of chromosomes; it's showing promise [as a data storage medium][1]. + +A recent study ([PDF][2]) suggests taking matters further and using microbes to network and communicate at nanoscale. The potential is highly attractive for the Internet of Things (IoT), where concealability and unobtrusiveness may be needed for the technology to become completely ubiquitous. + +Advantages to an organic version of IoT include not only the tiny size but also the autonomous nature of bacteria, which includes inherent propulsion. There’s “an embedded, natural propeller motor,” the scientists from Queen Mary University in London explain of the swimming functions microbes perform. + +[][3] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][3] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +At this point, research into the Internet of Bio-Nano Things (IoBNT) is at an early stage, and the Queen Mary University researchers are predominantly explaining how similarities between bacteria and computing could be exploited. But the study is intriguing. + +"The microbes share similarities with components of typical computer IoT devices," wrote Raphael Kim and Stefan Posland in their [paper][2] published on the subject. “This presents a strong argument for bacteria to be considered as a living form of Internet of Things (IoT) device.” + +Environmental IoT is one area they say could benefit. In smart cities, for example, bacteria could be programmed to sense for pollutants. Microbes have good chemical-sensing functions and could turn out to work better than electronic sensors. In fact, the authors say that microbes share some of the same sensing, actuating, communicating and processing abilities that the computerized IoT has. + +In the case of sensing and actuating, bacteria can detect chemicals, electromagnetic fields, light, mechanical stress and temperature — just what’s required in a traditional printed circuit board-based sensor. Plus, the microbes respond. They can produce colored proteins, for example. And not only that, they respond in a more nuanced way compared to the chip-based sensors. They can be more sensitive, as one example. + +[The time of 5G is almost here][4] + +The aforementioned DNA, built into bacteria, functions as a control unit, both for processing and storing data. Genomic DNA would contain the instructions for some functioning, and plasmids — which is another form of DNA related to how genes get into organisms — customize process functions through gene addition and subtraction. + +Networking is also addressed. Transceivers are also in bacterial IoT, the team says. The importing and exporting of molecules act as a form of signaling pathway, and a DNA exchange between two cells can take place. That’s called “molecular communication” and is described as a bacterial nanonetwork. Digital-to-DNA and back to DNA again is a DNA-related area currently showing promise. + +Bacteria should become a “substrate to build a biological version of the Internet of Things,” the scientists say. Interestingly, similar to how traditional IoT has been propelled forward by tech hobbyists mucking around with Arduino microcontrollers and Raspberry Pi educational mini-computers, Kim and Posland reckon it will be do-it-yourself biology that will kick-start IoBNT. They point out that easily obtainable educational products like [the Amino Labs kit][5] already allow the generation of specific colors from bacteria, for example. + +“Currently, tools and techniques to run small-scale experiments with micro-organisms are widely available to the general public, through various channels, including maker spaces.” + +The team also suggest that hypothetically the “gamification of bacteria” could become a part of the experimentation. Biotic games exist. The researchers propose “to utilize the DIY biology movement and gamification techniques to leverage user engagement and introduction to bacteria.” + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3518413/how-bacteria-could-run-the-internet-of-things.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3268646/dna-data-storage-closer-to-becoming-reality.html +[2]: https://arxiv.org/ftp/arxiv/papers/1910/1910.01974.pdf +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[5]: https://amino.bio/ +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 60b4b26f1606225edd395f943946dbd230f0ce75 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 1 Feb 2020 10:31:17 +0800 Subject: [PATCH 182/285] translating --- ...tool to get your local weather forecast.md | 104 ------------------ ...tool to get your local weather forecast.md | 101 +++++++++++++++++ 2 files changed, 101 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20200123 Use this open source tool to get your local weather forecast.md create mode 100644 translated/tech/20200123 Use this open source tool to get your local weather forecast.md diff --git a/sources/tech/20200123 Use this open source tool to get your local weather forecast.md b/sources/tech/20200123 Use this open source tool to get your local weather forecast.md deleted file mode 100644 index df44d3b659..0000000000 --- a/sources/tech/20200123 Use this open source tool to get your local weather forecast.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use this open source tool to get your local weather forecast) -[#]: via: (https://opensource.com/article/20/1/open-source-weather-forecast) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use this open source tool to get your local weather forecast -====== -Know whether you need a coat, an umbrella, or sunscreen before you go -out with wego in the thirteenth in our series on 20 ways to be more -productive with open source in 2020. -![Sky with clouds and grass][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Check the weather with wego - -One of the things I love about the past decade of my employment is that it mostly has been remote. I can work anywhere I happen to be in the world, although the reality is that I spend a lot of time in my home office. The downside is that when I leave the house, I base a lot of decisions on what the conditions look like outside my window. And where I live, "sunny and clear" can mean anything from "scorchingly hot" to "below freezing" to "it will rain in an hour." Being able to check the actual conditions and forecast quickly is pretty useful. - -![Wego][2] - -[Wego][3] is a program written in Go that will fetch and display your local weather. It even renders it in shiny ASCII art if you wish. - -To install wego, you need to make sure [Go][4] is installed on your system. After that, you can fetch the latest version with the **go get** command. You'll probably want to add the **~/go/bin** directory to your path as well: - - -``` -go get -u github.com/schachmat/wego -export PATH=~/go/bin:$PATH -wego -``` - -On its first run, wego will complain about missing API keys. Now you need to decide on a backend. The default backend is for [Forecast.io][5], which is part of [Dark Sky][6]. Wego also supports [OpenWeatherMap][7] and [WorldWeatherOnline][8]. I prefer OpenWeatherMap, so that's what I'll show you how to set up here. - -You'll need to [register for an API key][9] with OpenWeatherMap. Registration is free, although the free API key has a limit on how many queries you can make in a day; this should be fine for an average user. Once you have your API key, put it into the **~/.wegorc** file. Now is also a good time to fill in your location, language, and whether you use metric, imperial (US/UK), metric-ms, or International System of Units (SI). OpenWeatherMap supports locations by name, postal code, coordinates, and ID, which is one of the reasons I like it. - - -``` -# wego configuration for OEM -aat-coords=false -aat-monochrome=false -backend=openweathermap -days=3 -forecast-lang=en -frontend=ascii-art-table -jsn-no-indent=false -location=Pittsboro -owm-api-key=XXXXXXXXXXXXXXXXXXXXX -owm-debug=false -owm-lang=en -units=imperial -``` - -Now, running **wego** at the command line will show the local weather for the next three days. - -Wego can also show data as JSON output for consumption by programs and with emoji. You can choose a frontend with the **-f** command-line parameter or in the **.wegorc** file. - -![Wego at login][10] - -If you want to see the weather every time you open a new shell or log into a host, simply add wego to your **~/.bashrc** (or **~/.zshrc** in my case). - -The [wttr.in][11] project is a web-based wrapper around wego. It provides some additional display options and is available on the website of the same name. One cool thing about wttr.in is that you can fetch one-line information about the weather with **curl**. I have a little shell function called **get_wttr** that fetches the current forecast in a shortened form. - - -``` -get_wttr() { -  curl -s "wttr.in/Pittsboro?format=3"     -} -``` - -![weather tool for productivity][12] - -Now, before I leave the house, I have a quick and easy way to find out if I need a coat, an umbrella, or sunscreen—directly from the command line where I spend most of my time. - -I began paragliding a few years ago. It’s maybe the most weather-dependent sport in the world. We... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-weather-forecast - -作者:[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/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) -[2]: https://opensource.com/sites/default/files/uploads/productivity_13-1.png (Wego) -[3]: https://github.com/schachmat/wego -[4]: https://golang.org/doc/install -[5]: https://forecast.io -[6]: https://darksky.net -[7]: https://openweathermap.org/ -[8]: https://www.worldweatheronline.com/ -[9]: https://openweathermap.org/api -[10]: https://opensource.com/sites/default/files/uploads/productivity_13-2.png (Wego at login) -[11]: https://github.com/chubin/wttr.in -[12]: https://opensource.com/sites/default/files/uploads/day13-image3.png (weather tool for productivity) diff --git a/translated/tech/20200123 Use this open source tool to get your local weather forecast.md b/translated/tech/20200123 Use this open source tool to get your local weather forecast.md new file mode 100644 index 0000000000..e151e40d65 --- /dev/null +++ b/translated/tech/20200123 Use this open source tool to get your local weather forecast.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this open source tool to get your local weather forecast) +[#]: via: (https://opensource.com/article/20/1/open-source-weather-forecast) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用这个开源工具获取本地天气预报 +====== +在我们的 20 个使用开源提升生产力的系列的第十三篇文章中使用 wego 来了解出门前你是否要需要外套、雨伞或者防晒霜。 +![Sky with clouds and grass][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 wego 了解天气 + +过去十年我对我的职业最满意的地方之一是大多数时候是远程工作。尽管现实情况是我很多时候是在家里办公,但我可以在世界上任何地方工作。缺点是,离家时我会根据天气做出一些决定。在我居住的地方,”晴朗“可以表示从”酷热“、”低于零度“到”一小时内会小雨“。能够了解实际情况和快速预测非常有用。 + +![Wego][2] + +[Wego][3] 是用 Go 编写的程序,可以获取并显示你的当地天气。如果你愿意,它甚至可以用闪亮的 ASCII 艺术效果进行渲染。 + +要安装 wego,你需要确保在系统上安装了[Go][4]。之后,你可以使用 **go get** 命令获取最新版本。你可能还想将 **~/go/bin** 目录添加到路径中: + + +``` +go get -u github.com/schachmat/wego +export PATH=~/go/bin:$PATH +wego +``` + +首次运行时,wego 会报告缺失 API 密钥。现在你需要决定一个后端。默认后端是 [Forecast.io][5],它是 [Dark Sky][6]的一部分。Wego还支持 [OpenWeatherMap][7] 和 [WorldWeatherOnline][8]。我更喜欢 OpenWeatherMap,因此我将在此向你展示如何设置。 + +你需要在 OpenWeatherMap 中[注册 API 密钥][9]。注册是免费的,尽管免费的 API 密钥限制了一天可以查询的数量,但这对于普通用户来说应该没问题。得到 API 密钥后,将它放到 **~/.wegorc** 文件中。现在可以填写你的位置、语言以及使用公制、英制(英国/美国)还是国际单位制(SI)。OpenWeatherMap 可通过名称、邮政编码、坐标和 ID 确定位置,这是我喜欢它的原因之一。 + + + +``` +# wego configuration for OEM +aat-coords=false +aat-monochrome=false +backend=openweathermap +days=3 +forecast-lang=en +frontend=ascii-art-table +jsn-no-indent=false +location=Pittsboro +owm-api-key=XXXXXXXXXXXXXXXXXXXXX +owm-debug=false +owm-lang=en +units=imperial +``` + +现在,在命令行运行 **wego** 将显示接下来三天的当地天气。 + +Wego 还可以输出 JSON 以便程序使用,还可显示 emoji。你可以使用 **-f** 参数或在 **.wegorc** 文件中指定前端。 + +![Wego at login][10] + +如果你想在每次打开 shell 或登录主机时查看天气,只需将 wego 添加到 **~/.bashrc**(我这里是 **~/.zshrc**)即可。 + +[wttr.in][11] 项目是 wego 上的基于 Web 的封装。它提供了一些其他显示选项,并且可以在同名网站上看到。关于 wttr.in 的一件很酷的事情是,你可以使用 **curl** 获取一行天气信息。我有一个名为 **get_wttr** 的 shell 函数,用于获取当前简化的预报信息。 + + +``` +get_wttr() { +  curl -s "wttr.in/Pittsboro?format=3"     +} +``` + +![weather tool for productivity][12] + +现在,在我离开家之前,我就可以通过命令行快速简单地获取我是否需要外套、雨伞或者防晒霜了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-weather-forecast + +作者:[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/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) +[2]: https://opensource.com/sites/default/files/uploads/productivity_13-1.png (Wego) +[3]: https://github.com/schachmat/wego +[4]: https://golang.org/doc/install +[5]: https://forecast.io +[6]: https://darksky.net +[7]: https://openweathermap.org/ +[8]: https://www.worldweatheronline.com/ +[9]: https://openweathermap.org/api +[10]: https://opensource.com/sites/default/files/uploads/productivity_13-2.png (Wego at login) +[11]: https://github.com/chubin/wttr.in +[12]: https://opensource.com/sites/default/files/uploads/day13-image3.png (weather tool for productivity) From 2938813972673d0936258e1d64ce06af7932c2f7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 1 Feb 2020 10:35:42 +0800 Subject: [PATCH 183/285] translating --- ...eeds and podcasts in one place with this open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md index 994523d830..d257520efa 100644 --- a/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md +++ b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From be6b1cf405831fa52f2914ed889d220acd10d734 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Feb 2020 11:16:42 +0800 Subject: [PATCH 184/285] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202001?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to create an e-book chapter template in LibreOffice Writer.md | 0 published/{ => 202001}/20190405 File sharing with Git.md | 0 published/{ => 202001}/20190406 Run a server with Git.md | 0 .../20190619 Getting started with OpenSSL- Cryptography basics.md | 0 .../20190724 How to make an old computer useful again.md | 0 ... An advanced look at Python interfaces using zope.interface.md | 0 ...n save your tasks - and your sanity - if SSH is interrupted.md | 0 published/{ => 202001}/20191015 How GNOME uses Git.md | 0 .../20191016 Open source interior design with Sweet Home 3D.md | 0 .../{ => 202001}/20191017 Intro to the Linux useradd command.md | 0 .../20191108 My Linux story- Learning Linux in the 90s.md | 0 .../20191113 How to cohost GitHub and GitLab with Ansible.md | 0 .../{ => 202001}/20191121 Simulate gravity in your Python game.md | 0 .../20191129 How to write a Python web API with Django.md | 0 .../{ => 202001}/20191130 7 maker gifts for kids and teens.md | 0 .../20191205 Add jumping to your Python platformer game.md | 0 .../20191208 What-s your favorite terminal emulator.md | 0 .../20191210 Lessons learned from programming in Go.md | 0 ... Enable your Python game player to run forward and backward.md | 0 .../20191214 Make VLC More Awesome With These Simple Tips.md | 0 .../20191215 How to Add Border Around Text in GIMP.md | 0 ...7 App Highlight- Open Source Disk Partitioning Tool GParted.md | 0 .../{ => 202001}/20191219 Kubernetes namespaces for beginners.md | 0 .../20191220 4 ways to volunteer this holiday season.md | 0 ...220 Why Vim fans love the Herbstluftwm Linux window manager.md | 0 .../20191221 Pop-_OS vs Ubuntu- Which One is Better.md | 0 ...191224 Chill out with the Linux Equinox Desktop Environment.md | 0 ...91226 Darktable 3 Released With GUI Rework and New Features.md | 0 .../20191227 10 resources to boost your Git skills.md | 0 ...hy Your Distribution Still Using an ‘Outdated- Linux Kernel.md | 0 .../20191229 The best resources for agile software development.md | 0 .../20191230 10 articles to enhance your security aptitude.md | 0 ...230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md | 0 ...1 10 Ansible resources to accelerate your automation skills.md | 0 .../20191231 12 programming resources for coders of all levels.md | 0 .../{ => 202001}/20200101 5 predictions for Kubernetes in 2020.md | 0 ...00101 9 cheat sheets and guides to enhance your tech skills.md | 0 .../20200101 Signal- A Secure, Open Source Messaging App.md | 0 .../20200102 Put some loot in your Python platformer game.md | 0 ...3 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md | 0 ...troducing the guide to inter-process communication in Linux.md | 0 ...20200103 My Raspberry Pi retrospective- 6 projects and more.md | 0 .../20200105 PaperWM- tiled window management for GNOME.md | 0 ...0106 How to write a Python web API with Pyramid and Cornice.md | 0 ...107 Generating numeric sequences with the Linux seq command.md | 0 ...0107 How piwheels will save Raspberry Pi users time in 2020.md | 0 .../20200108 How to setup multiple monitors in sway.md | 0 ...0109 Huawei-s Linux Distribution openEuler is Available Now.md | 0 ...end eMail With a List of User Accounts Expiring in -X- Days.md | 0 .../20200111 Sync files across multiple devices with Syncthing.md | 0 ... Use Stow for configuration management of multiple machines.md | 0 .../20200113 Keep your email in sync with OfflineIMAP.md | 0 ...tV- A Bash function to maintain Python virtual environments.md | 0 .../{ => 202001}/20200114 Organize your email with Notmuch.md | 0 published/{ => 202001}/20200115 6 handy Bash scripts for Git.md | 0 ...15 Organize and sync your calendar with khal and vdirsyncer.md | 0 ...00115 Root User in Ubuntu- Important Things You Should Know.md | 0 .../20200115 Why everyone is talking about WebAssembly.md | 0 .../20200116 3 open source tools to manage your contacts.md | 0 ...Rust- Which to choose for programming hardware abstractions.md | 0 ...200117 Get started with this open source to-do list manager.md | 0 .../20200117 Locking and unlocking accounts on Linux systems.md | 0 .../20200119 What-s your favorite Linux terminal trick.md | 0 ...ting up passwordless Linux logins using public-private keys.md | 0 .../20200123 Wine 5.0 is Released- Here-s How to Install it.md | 0 65 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202001}/20171018 How to create an e-book chapter template in LibreOffice Writer.md (100%) rename published/{ => 202001}/20190405 File sharing with Git.md (100%) rename published/{ => 202001}/20190406 Run a server with Git.md (100%) rename published/{ => 202001}/20190619 Getting started with OpenSSL- Cryptography basics.md (100%) rename published/{ => 202001}/20190724 How to make an old computer useful again.md (100%) rename published/{ => 202001}/20190924 An advanced look at Python interfaces using zope.interface.md (100%) rename published/{ => 202001}/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md (100%) rename published/{ => 202001}/20191015 How GNOME uses Git.md (100%) rename published/{ => 202001}/20191016 Open source interior design with Sweet Home 3D.md (100%) rename published/{ => 202001}/20191017 Intro to the Linux useradd command.md (100%) rename published/{ => 202001}/20191108 My Linux story- Learning Linux in the 90s.md (100%) rename published/{ => 202001}/20191113 How to cohost GitHub and GitLab with Ansible.md (100%) rename published/{ => 202001}/20191121 Simulate gravity in your Python game.md (100%) rename published/{ => 202001}/20191129 How to write a Python web API with Django.md (100%) rename published/{ => 202001}/20191130 7 maker gifts for kids and teens.md (100%) rename published/{ => 202001}/20191205 Add jumping to your Python platformer game.md (100%) rename published/{ => 202001}/20191208 What-s your favorite terminal emulator.md (100%) rename published/{ => 202001}/20191210 Lessons learned from programming in Go.md (100%) rename published/{ => 202001}/20191211 Enable your Python game player to run forward and backward.md (100%) rename published/{ => 202001}/20191214 Make VLC More Awesome With These Simple Tips.md (100%) rename published/{ => 202001}/20191215 How to Add Border Around Text in GIMP.md (100%) rename published/{ => 202001}/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md (100%) rename published/{ => 202001}/20191219 Kubernetes namespaces for beginners.md (100%) rename published/{ => 202001}/20191220 4 ways to volunteer this holiday season.md (100%) rename published/{ => 202001}/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md (100%) rename published/{ => 202001}/20191221 Pop-_OS vs Ubuntu- Which One is Better.md (100%) rename published/{ => 202001}/20191224 Chill out with the Linux Equinox Desktop Environment.md (100%) rename published/{ => 202001}/20191226 Darktable 3 Released With GUI Rework and New Features.md (100%) rename published/{ => 202001}/20191227 10 resources to boost your Git skills.md (100%) rename published/{ => 202001}/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md (100%) rename published/{ => 202001}/20191229 The best resources for agile software development.md (100%) rename published/{ => 202001}/20191230 10 articles to enhance your security aptitude.md (100%) rename published/{ => 202001}/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md (100%) rename published/{ => 202001}/20191231 10 Ansible resources to accelerate your automation skills.md (100%) rename published/{ => 202001}/20191231 12 programming resources for coders of all levels.md (100%) rename published/{ => 202001}/20200101 5 predictions for Kubernetes in 2020.md (100%) rename published/{ => 202001}/20200101 9 cheat sheets and guides to enhance your tech skills.md (100%) rename published/{ => 202001}/20200101 Signal- A Secure, Open Source Messaging App.md (100%) rename published/{ => 202001}/20200102 Put some loot in your Python platformer game.md (100%) rename published/{ => 202001}/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md (100%) rename published/{ => 202001}/20200103 Introducing the guide to inter-process communication in Linux.md (100%) rename published/{ => 202001}/20200103 My Raspberry Pi retrospective- 6 projects and more.md (100%) rename published/{ => 202001}/20200105 PaperWM- tiled window management for GNOME.md (100%) rename published/{ => 202001}/20200106 How to write a Python web API with Pyramid and Cornice.md (100%) rename published/{ => 202001}/20200107 Generating numeric sequences with the Linux seq command.md (100%) rename published/{ => 202001}/20200107 How piwheels will save Raspberry Pi users time in 2020.md (100%) rename published/{ => 202001}/20200108 How to setup multiple monitors in sway.md (100%) rename published/{ => 202001}/20200109 Huawei-s Linux Distribution openEuler is Available Now.md (100%) rename published/{ => 202001}/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md (100%) rename published/{ => 202001}/20200111 Sync files across multiple devices with Syncthing.md (100%) rename published/{ => 202001}/20200112 Use Stow for configuration management of multiple machines.md (100%) rename published/{ => 202001}/20200113 Keep your email in sync with OfflineIMAP.md (100%) rename published/{ => 202001}/20200113 setV- A Bash function to maintain Python virtual environments.md (100%) rename published/{ => 202001}/20200114 Organize your email with Notmuch.md (100%) rename published/{ => 202001}/20200115 6 handy Bash scripts for Git.md (100%) rename published/{ => 202001}/20200115 Organize and sync your calendar with khal and vdirsyncer.md (100%) rename published/{ => 202001}/20200115 Root User in Ubuntu- Important Things You Should Know.md (100%) rename published/{ => 202001}/20200115 Why everyone is talking about WebAssembly.md (100%) rename published/{ => 202001}/20200116 3 open source tools to manage your contacts.md (100%) rename published/{ => 202001}/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md (100%) rename published/{ => 202001}/20200117 Get started with this open source to-do list manager.md (100%) rename published/{ => 202001}/20200117 Locking and unlocking accounts on Linux systems.md (100%) rename published/{ => 202001}/20200119 What-s your favorite Linux terminal trick.md (100%) rename published/{ => 202001}/20200122 Setting up passwordless Linux logins using public-private keys.md (100%) rename published/{ => 202001}/20200123 Wine 5.0 is Released- Here-s How to Install it.md (100%) diff --git a/published/20171018 How to create an e-book chapter template in LibreOffice Writer.md b/published/202001/20171018 How to create an e-book chapter template in LibreOffice Writer.md similarity index 100% rename from published/20171018 How to create an e-book chapter template in LibreOffice Writer.md rename to published/202001/20171018 How to create an e-book chapter template in LibreOffice Writer.md diff --git a/published/20190405 File sharing with Git.md b/published/202001/20190405 File sharing with Git.md similarity index 100% rename from published/20190405 File sharing with Git.md rename to published/202001/20190405 File sharing with Git.md diff --git a/published/20190406 Run a server with Git.md b/published/202001/20190406 Run a server with Git.md similarity index 100% rename from published/20190406 Run a server with Git.md rename to published/202001/20190406 Run a server with Git.md diff --git a/published/20190619 Getting started with OpenSSL- Cryptography basics.md b/published/202001/20190619 Getting started with OpenSSL- Cryptography basics.md similarity index 100% rename from published/20190619 Getting started with OpenSSL- Cryptography basics.md rename to published/202001/20190619 Getting started with OpenSSL- Cryptography basics.md diff --git a/published/20190724 How to make an old computer useful again.md b/published/202001/20190724 How to make an old computer useful again.md similarity index 100% rename from published/20190724 How to make an old computer useful again.md rename to published/202001/20190724 How to make an old computer useful again.md diff --git a/published/20190924 An advanced look at Python interfaces using zope.interface.md b/published/202001/20190924 An advanced look at Python interfaces using zope.interface.md similarity index 100% rename from published/20190924 An advanced look at Python interfaces using zope.interface.md rename to published/202001/20190924 An advanced look at Python interfaces using zope.interface.md diff --git a/published/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md b/published/202001/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md similarity index 100% rename from published/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md rename to published/202001/20190930 How the Linux screen tool can save your tasks - and your sanity - if SSH is interrupted.md diff --git a/published/20191015 How GNOME uses Git.md b/published/202001/20191015 How GNOME uses Git.md similarity index 100% rename from published/20191015 How GNOME uses Git.md rename to published/202001/20191015 How GNOME uses Git.md diff --git a/published/20191016 Open source interior design with Sweet Home 3D.md b/published/202001/20191016 Open source interior design with Sweet Home 3D.md similarity index 100% rename from published/20191016 Open source interior design with Sweet Home 3D.md rename to published/202001/20191016 Open source interior design with Sweet Home 3D.md diff --git a/published/20191017 Intro to the Linux useradd command.md b/published/202001/20191017 Intro to the Linux useradd command.md similarity index 100% rename from published/20191017 Intro to the Linux useradd command.md rename to published/202001/20191017 Intro to the Linux useradd command.md diff --git a/published/20191108 My Linux story- Learning Linux in the 90s.md b/published/202001/20191108 My Linux story- Learning Linux in the 90s.md similarity index 100% rename from published/20191108 My Linux story- Learning Linux in the 90s.md rename to published/202001/20191108 My Linux story- Learning Linux in the 90s.md diff --git a/published/20191113 How to cohost GitHub and GitLab with Ansible.md b/published/202001/20191113 How to cohost GitHub and GitLab with Ansible.md similarity index 100% rename from published/20191113 How to cohost GitHub and GitLab with Ansible.md rename to published/202001/20191113 How to cohost GitHub and GitLab with Ansible.md diff --git a/published/20191121 Simulate gravity in your Python game.md b/published/202001/20191121 Simulate gravity in your Python game.md similarity index 100% rename from published/20191121 Simulate gravity in your Python game.md rename to published/202001/20191121 Simulate gravity in your Python game.md diff --git a/published/20191129 How to write a Python web API with Django.md b/published/202001/20191129 How to write a Python web API with Django.md similarity index 100% rename from published/20191129 How to write a Python web API with Django.md rename to published/202001/20191129 How to write a Python web API with Django.md diff --git a/published/20191130 7 maker gifts for kids and teens.md b/published/202001/20191130 7 maker gifts for kids and teens.md similarity index 100% rename from published/20191130 7 maker gifts for kids and teens.md rename to published/202001/20191130 7 maker gifts for kids and teens.md diff --git a/published/20191205 Add jumping to your Python platformer game.md b/published/202001/20191205 Add jumping to your Python platformer game.md similarity index 100% rename from published/20191205 Add jumping to your Python platformer game.md rename to published/202001/20191205 Add jumping to your Python platformer game.md diff --git a/published/20191208 What-s your favorite terminal emulator.md b/published/202001/20191208 What-s your favorite terminal emulator.md similarity index 100% rename from published/20191208 What-s your favorite terminal emulator.md rename to published/202001/20191208 What-s your favorite terminal emulator.md diff --git a/published/20191210 Lessons learned from programming in Go.md b/published/202001/20191210 Lessons learned from programming in Go.md similarity index 100% rename from published/20191210 Lessons learned from programming in Go.md rename to published/202001/20191210 Lessons learned from programming in Go.md diff --git a/published/20191211 Enable your Python game player to run forward and backward.md b/published/202001/20191211 Enable your Python game player to run forward and backward.md similarity index 100% rename from published/20191211 Enable your Python game player to run forward and backward.md rename to published/202001/20191211 Enable your Python game player to run forward and backward.md diff --git a/published/20191214 Make VLC More Awesome With These Simple Tips.md b/published/202001/20191214 Make VLC More Awesome With These Simple Tips.md similarity index 100% rename from published/20191214 Make VLC More Awesome With These Simple Tips.md rename to published/202001/20191214 Make VLC More Awesome With These Simple Tips.md diff --git a/published/20191215 How to Add Border Around Text in GIMP.md b/published/202001/20191215 How to Add Border Around Text in GIMP.md similarity index 100% rename from published/20191215 How to Add Border Around Text in GIMP.md rename to published/202001/20191215 How to Add Border Around Text in GIMP.md diff --git a/published/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md b/published/202001/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md similarity index 100% rename from published/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md rename to published/202001/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md diff --git a/published/20191219 Kubernetes namespaces for beginners.md b/published/202001/20191219 Kubernetes namespaces for beginners.md similarity index 100% rename from published/20191219 Kubernetes namespaces for beginners.md rename to published/202001/20191219 Kubernetes namespaces for beginners.md diff --git a/published/20191220 4 ways to volunteer this holiday season.md b/published/202001/20191220 4 ways to volunteer this holiday season.md similarity index 100% rename from published/20191220 4 ways to volunteer this holiday season.md rename to published/202001/20191220 4 ways to volunteer this holiday season.md diff --git a/published/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md b/published/202001/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md similarity index 100% rename from published/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md rename to published/202001/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md diff --git a/published/20191221 Pop-_OS vs Ubuntu- Which One is Better.md b/published/202001/20191221 Pop-_OS vs Ubuntu- Which One is Better.md similarity index 100% rename from published/20191221 Pop-_OS vs Ubuntu- Which One is Better.md rename to published/202001/20191221 Pop-_OS vs Ubuntu- Which One is Better.md diff --git a/published/20191224 Chill out with the Linux Equinox Desktop Environment.md b/published/202001/20191224 Chill out with the Linux Equinox Desktop Environment.md similarity index 100% rename from published/20191224 Chill out with the Linux Equinox Desktop Environment.md rename to published/202001/20191224 Chill out with the Linux Equinox Desktop Environment.md diff --git a/published/20191226 Darktable 3 Released With GUI Rework and New Features.md b/published/202001/20191226 Darktable 3 Released With GUI Rework and New Features.md similarity index 100% rename from published/20191226 Darktable 3 Released With GUI Rework and New Features.md rename to published/202001/20191226 Darktable 3 Released With GUI Rework and New Features.md diff --git a/published/20191227 10 resources to boost your Git skills.md b/published/202001/20191227 10 resources to boost your Git skills.md similarity index 100% rename from published/20191227 10 resources to boost your Git skills.md rename to published/202001/20191227 10 resources to boost your Git skills.md diff --git a/published/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md b/published/202001/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md similarity index 100% rename from published/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md rename to published/202001/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md diff --git a/published/20191229 The best resources for agile software development.md b/published/202001/20191229 The best resources for agile software development.md similarity index 100% rename from published/20191229 The best resources for agile software development.md rename to published/202001/20191229 The best resources for agile software development.md diff --git a/published/20191230 10 articles to enhance your security aptitude.md b/published/202001/20191230 10 articles to enhance your security aptitude.md similarity index 100% rename from published/20191230 10 articles to enhance your security aptitude.md rename to published/202001/20191230 10 articles to enhance your security aptitude.md diff --git a/published/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/published/202001/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md similarity index 100% rename from published/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md rename to published/202001/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md diff --git a/published/20191231 10 Ansible resources to accelerate your automation skills.md b/published/202001/20191231 10 Ansible resources to accelerate your automation skills.md similarity index 100% rename from published/20191231 10 Ansible resources to accelerate your automation skills.md rename to published/202001/20191231 10 Ansible resources to accelerate your automation skills.md diff --git a/published/20191231 12 programming resources for coders of all levels.md b/published/202001/20191231 12 programming resources for coders of all levels.md similarity index 100% rename from published/20191231 12 programming resources for coders of all levels.md rename to published/202001/20191231 12 programming resources for coders of all levels.md diff --git a/published/20200101 5 predictions for Kubernetes in 2020.md b/published/202001/20200101 5 predictions for Kubernetes in 2020.md similarity index 100% rename from published/20200101 5 predictions for Kubernetes in 2020.md rename to published/202001/20200101 5 predictions for Kubernetes in 2020.md diff --git a/published/20200101 9 cheat sheets and guides to enhance your tech skills.md b/published/202001/20200101 9 cheat sheets and guides to enhance your tech skills.md similarity index 100% rename from published/20200101 9 cheat sheets and guides to enhance your tech skills.md rename to published/202001/20200101 9 cheat sheets and guides to enhance your tech skills.md diff --git a/published/20200101 Signal- A Secure, Open Source Messaging App.md b/published/202001/20200101 Signal- A Secure, Open Source Messaging App.md similarity index 100% rename from published/20200101 Signal- A Secure, Open Source Messaging App.md rename to published/202001/20200101 Signal- A Secure, Open Source Messaging App.md diff --git a/published/20200102 Put some loot in your Python platformer game.md b/published/202001/20200102 Put some loot in your Python platformer game.md similarity index 100% rename from published/20200102 Put some loot in your Python platformer game.md rename to published/202001/20200102 Put some loot in your Python platformer game.md diff --git a/published/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md b/published/202001/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md similarity index 100% rename from published/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md rename to published/202001/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md diff --git a/published/20200103 Introducing the guide to inter-process communication in Linux.md b/published/202001/20200103 Introducing the guide to inter-process communication in Linux.md similarity index 100% rename from published/20200103 Introducing the guide to inter-process communication in Linux.md rename to published/202001/20200103 Introducing the guide to inter-process communication in Linux.md diff --git a/published/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/published/202001/20200103 My Raspberry Pi retrospective- 6 projects and more.md similarity index 100% rename from published/20200103 My Raspberry Pi retrospective- 6 projects and more.md rename to published/202001/20200103 My Raspberry Pi retrospective- 6 projects and more.md diff --git a/published/20200105 PaperWM- tiled window management for GNOME.md b/published/202001/20200105 PaperWM- tiled window management for GNOME.md similarity index 100% rename from published/20200105 PaperWM- tiled window management for GNOME.md rename to published/202001/20200105 PaperWM- tiled window management for GNOME.md diff --git a/published/20200106 How to write a Python web API with Pyramid and Cornice.md b/published/202001/20200106 How to write a Python web API with Pyramid and Cornice.md similarity index 100% rename from published/20200106 How to write a Python web API with Pyramid and Cornice.md rename to published/202001/20200106 How to write a Python web API with Pyramid and Cornice.md diff --git a/published/20200107 Generating numeric sequences with the Linux seq command.md b/published/202001/20200107 Generating numeric sequences with the Linux seq command.md similarity index 100% rename from published/20200107 Generating numeric sequences with the Linux seq command.md rename to published/202001/20200107 Generating numeric sequences with the Linux seq command.md diff --git a/published/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/published/202001/20200107 How piwheels will save Raspberry Pi users time in 2020.md similarity index 100% rename from published/20200107 How piwheels will save Raspberry Pi users time in 2020.md rename to published/202001/20200107 How piwheels will save Raspberry Pi users time in 2020.md diff --git a/published/20200108 How to setup multiple monitors in sway.md b/published/202001/20200108 How to setup multiple monitors in sway.md similarity index 100% rename from published/20200108 How to setup multiple monitors in sway.md rename to published/202001/20200108 How to setup multiple monitors in sway.md diff --git a/published/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/published/202001/20200109 Huawei-s Linux Distribution openEuler is Available Now.md similarity index 100% rename from published/20200109 Huawei-s Linux Distribution openEuler is Available Now.md rename to published/202001/20200109 Huawei-s Linux Distribution openEuler is Available Now.md diff --git a/published/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/published/202001/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md similarity index 100% rename from published/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md rename to published/202001/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md diff --git a/published/20200111 Sync files across multiple devices with Syncthing.md b/published/202001/20200111 Sync files across multiple devices with Syncthing.md similarity index 100% rename from published/20200111 Sync files across multiple devices with Syncthing.md rename to published/202001/20200111 Sync files across multiple devices with Syncthing.md diff --git a/published/20200112 Use Stow for configuration management of multiple machines.md b/published/202001/20200112 Use Stow for configuration management of multiple machines.md similarity index 100% rename from published/20200112 Use Stow for configuration management of multiple machines.md rename to published/202001/20200112 Use Stow for configuration management of multiple machines.md diff --git a/published/20200113 Keep your email in sync with OfflineIMAP.md b/published/202001/20200113 Keep your email in sync with OfflineIMAP.md similarity index 100% rename from published/20200113 Keep your email in sync with OfflineIMAP.md rename to published/202001/20200113 Keep your email in sync with OfflineIMAP.md diff --git a/published/20200113 setV- A Bash function to maintain Python virtual environments.md b/published/202001/20200113 setV- A Bash function to maintain Python virtual environments.md similarity index 100% rename from published/20200113 setV- A Bash function to maintain Python virtual environments.md rename to published/202001/20200113 setV- A Bash function to maintain Python virtual environments.md diff --git a/published/20200114 Organize your email with Notmuch.md b/published/202001/20200114 Organize your email with Notmuch.md similarity index 100% rename from published/20200114 Organize your email with Notmuch.md rename to published/202001/20200114 Organize your email with Notmuch.md diff --git a/published/20200115 6 handy Bash scripts for Git.md b/published/202001/20200115 6 handy Bash scripts for Git.md similarity index 100% rename from published/20200115 6 handy Bash scripts for Git.md rename to published/202001/20200115 6 handy Bash scripts for Git.md diff --git a/published/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/published/202001/20200115 Organize and sync your calendar with khal and vdirsyncer.md similarity index 100% rename from published/20200115 Organize and sync your calendar with khal and vdirsyncer.md rename to published/202001/20200115 Organize and sync your calendar with khal and vdirsyncer.md diff --git a/published/20200115 Root User in Ubuntu- Important Things You Should Know.md b/published/202001/20200115 Root User in Ubuntu- Important Things You Should Know.md similarity index 100% rename from published/20200115 Root User in Ubuntu- Important Things You Should Know.md rename to published/202001/20200115 Root User in Ubuntu- Important Things You Should Know.md diff --git a/published/20200115 Why everyone is talking about WebAssembly.md b/published/202001/20200115 Why everyone is talking about WebAssembly.md similarity index 100% rename from published/20200115 Why everyone is talking about WebAssembly.md rename to published/202001/20200115 Why everyone is talking about WebAssembly.md diff --git a/published/20200116 3 open source tools to manage your contacts.md b/published/202001/20200116 3 open source tools to manage your contacts.md similarity index 100% rename from published/20200116 3 open source tools to manage your contacts.md rename to published/202001/20200116 3 open source tools to manage your contacts.md diff --git a/published/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/published/202001/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md similarity index 100% rename from published/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md rename to published/202001/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md diff --git a/published/20200117 Get started with this open source to-do list manager.md b/published/202001/20200117 Get started with this open source to-do list manager.md similarity index 100% rename from published/20200117 Get started with this open source to-do list manager.md rename to published/202001/20200117 Get started with this open source to-do list manager.md diff --git a/published/20200117 Locking and unlocking accounts on Linux systems.md b/published/202001/20200117 Locking and unlocking accounts on Linux systems.md similarity index 100% rename from published/20200117 Locking and unlocking accounts on Linux systems.md rename to published/202001/20200117 Locking and unlocking accounts on Linux systems.md diff --git a/published/20200119 What-s your favorite Linux terminal trick.md b/published/202001/20200119 What-s your favorite Linux terminal trick.md similarity index 100% rename from published/20200119 What-s your favorite Linux terminal trick.md rename to published/202001/20200119 What-s your favorite Linux terminal trick.md diff --git a/published/20200122 Setting up passwordless Linux logins using public-private keys.md b/published/202001/20200122 Setting up passwordless Linux logins using public-private keys.md similarity index 100% rename from published/20200122 Setting up passwordless Linux logins using public-private keys.md rename to published/202001/20200122 Setting up passwordless Linux logins using public-private keys.md diff --git a/published/20200123 Wine 5.0 is Released- Here-s How to Install it.md b/published/202001/20200123 Wine 5.0 is Released- Here-s How to Install it.md similarity index 100% rename from published/20200123 Wine 5.0 is Released- Here-s How to Install it.md rename to published/202001/20200123 Wine 5.0 is Released- Here-s How to Install it.md From 523ed70853c845ed4944ebb553dff4d0c3990b8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Feb 2020 12:15:05 +0800 Subject: [PATCH 185/285] =?UTF-8?q?=E6=B8=85=E9=99=A4=E5=A4=AA=E4=B9=85?= =?UTF-8?q?=E8=BF=9C=E7=9A=84=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200117 Fedora CoreOS out of preview.md | 108 --- ...ft release open source machine learning.md | 80 -- ...the developer, and more industry trends.md | 61 -- ...ript Fatigue- Realities of our industry.md | 221 ----- .../20171030 Why I love technical debt.md | 69 -- ... How to Monetize an Open Source Project.md | 86 -- ...air writing helps improve documentation.md | 87 -- ... and How to Set an Open Source Strategy.md | 120 --- ...71116 Why is collaboration so difficult.md | 94 -- ...lved our transparency and silo problems.md | 95 -- ...and GitHub to improve its documentation.md | 116 --- ... sourcing movements can share knowledge.md | 121 --- ... the cost of structured data is reduced.md | 181 ---- ...ering- A new paradigm for cybersecurity.md | 87 -- ...eat resume that actually gets you hired.md | 395 --------- ...lopment process that puts quality first.md | 99 --- ...nframes Aren-t Going Away Any Time Soon.md | 73 -- ...ywhere Is Dead, Long Live Anarchy Linux.md | 127 --- ... even if you don-t identify as a writer.md | 149 ---- ...ser community makes for better software.md | 47 - ...an anonymity and accountability coexist.md | 79 -- ...0216 Q4OS Makes Linux Easy for Everyone.md | 140 --- ...en naming software development projects.md | 91 -- ...80221 3 warning flags of DevOps metrics.md | 42 - ...0180222 3 reasons to say -no- in DevOps.md | 105 --- ... Give Life to a Mobile Linux Experience.md | 123 --- ...ortant issue in a DevOps transformation.md | 91 -- ...301 How to hire the right DevOps talent.md | 48 - ... as team on today-s open source project.md | 53 -- ...303 4 meetup ideas- Make your data open.md | 75 -- ...How to apply systems thinking in DevOps.md | 89 -- ...ommunity will help your project succeed.md | 111 --- ...Growing an Open Source Project Too Fast.md | 40 - ...comers- A guide for advanced developers.md | 119 --- ...en Source Projects With These Platforms.md | 96 -- ...for better agile retrospective meetings.md | 66 -- ...180323 7 steps to DevOps hiring success.md | 56 -- ... Android Auto emulator for Raspberry Pi.md | 81 -- ...one should avoid with hybrid multicloud.md | 87 -- ...0180404 Is the term DevSecOps necessary.md | 51 -- ...ing -ownership- across the organization.md | 125 --- .../talk/20180410 Microservices Explained.md | 61 -- ...ent, from coordination to collaboration.md | 71 -- ...back up your people, not just your data.md | 79 -- ... develop the FOSS leaders of the future.md | 93 -- ...mpatible with part-time community teams.md | 73 -- ...pen source project-s workflow on GitHub.md | 109 --- ...Could Be Costing to More Than You Think.md | 39 - ...s a Server in Every Serverless Platform.md | 87 -- ...80511 Looking at the Lispy side of Perl.md | 357 -------- ...7 Whatever Happened to the Semantic Web.md | 106 --- ...nciples of resilience for women in tech.md | 93 -- ... AI Is Coming to Edge Computing Devices.md | 66 -- ... list for open organization enthusiasts.md | 133 --- ...d avoid with hybrid multi-cloud, part 2.md | 68 -- ...g your project and community on Twitter.md | 157 ---- ...rate to the world of Linux from Windows.md | 154 ---- ...ones can teach us about open innovation.md | 49 - ...Ren-Py for creating interactive fiction.md | 70 -- ...ce Certification Matters More Than Ever.md | 49 - ... Linux and Windows Without Dual Booting.md | 141 --- ...eveloper 9 experiences you ll encounter.md | 141 --- ... a multi-microphone hearing aid project.md | 69 -- ...Confessions of a recovering Perl hacker.md | 46 - ... Success with Open Source Certification.md | 63 -- .../talk/20180719 Finding Jobs in Software.md | 90 -- ...e Certification- Preparing for the Exam.md | 64 -- ...ur workloads to the cloud is a bad idea.md | 71 -- ...jargon- The good, the bad, and the ugly.md | 108 --- ...180802 Design thinking as a way of life.md | 95 -- ...rammer in an underrepresented community.md | 94 -- ...lding more trustful teams in four steps.md | 70 -- ...ur team to a microservices architecture.md | 180 ---- .../20180809 How do tools affect culture.md | 56 -- ...eimplement Inheritance and Polymorphism.md | 235 ----- ...t the Evolution of the Desktop Computer.md | 130 --- ...Ru makes a college education affordable.md | 60 -- ...atient data safe with open source tools.md | 51 -- ...source projects for the new school year.md | 59 -- ...80906 DevOps- The consequences of blame.md | 67 -- ...he Rise and Demise of RSS (Old Version).md | 278 ------ ...80917 How gaming turned me into a coder.md | 103 --- ...Building a Secure Ecosystem for Node.js.md | 51 -- ...ubleshooting Node.js Issues with llnode.md | 75 -- ...1003 13 tools to measure DevOps success.md | 84 -- ...sier to Get a Payrise by Switching Jobs.md | 99 --- ...es for giving open source code feedback.md | 47 - ...sational interface design and usability.md | 105 --- ... your organization-s security expertise.md | 147 --- ...reasons not to write in-house ops tools.md | 64 -- ...pen source classifiers in AI algorithms.md | 111 --- ... BeOS or not to BeOS, that is the Haiku.md | 151 ---- ...out leveling up a heroic developer team.md | 213 ----- ...tips for facilitators of agile meetings.md | 60 -- ...open source hardware increases security.md | 84 -- ...ntinuous testing wrong - Opensource.com.md | 184 ---- ...rce in education creates new developers.md | 65 -- ...derstanding a -nix Shell by Writing One.md | 412 --------- ...seen these personalities in open source.md | 93 -- .../20181114 Analyzing the DNA of DevOps.md | 158 ---- ...open source- 9 tips for getting started.md | 76 -- ... Closer Look at Voice-Assisted Speakers.md | 125 --- ...t the open source community means to me.md | 94 -- ...9 top tech-recruiting mistakes to avoid.md | 108 --- ...back is important to the DevOps culture.md | 68 -- ... emerging tipping points in open source.md | 93 -- ... reasons to give Linux for the holidays.md | 78 -- ...in Linux Kernel Code Replaced with -Hug.md | 81 -- ...nately, Garbage Collection isn-t Enough.md | 44 - ...ware delivery with value stream mapping.md | 94 -- ...on the Desktop- Are We Nearly There Yet.md | 344 ------- .../talk/20181209 Open source DIY ethics.md | 62 -- ... tips to help non-techies move to Linux.md | 111 --- ...-t Succeeded on Desktop- Linus Torvalds.md | 65 -- ...ipten, LDC and bindbc-sdl (translation).md | 276 ------ ...ch skill in 2019- What you need to know.md | 145 --- ...ons for artificial intelligence in 2019.md | 91 -- ... Don-t Use ZFS on Linux- Linus Torvalds.md | 82 -- ...g- gene signatures and connectivity map.md | 133 --- ...hannels are bad and you should feel bad.md | 443 ---------- sources/tech/20170115 Magic GOPATH.md | 119 --- ...eboard problems in pure Lambda Calculus.md | 836 ------------------ ...20171006 7 deadly sins of documentation.md | 85 -- ...nes and Android Architecture Components.md | 201 ----- ...ute Once with Xen Linux TPM 2.0 and TXT.md | 94 -- ...o Mint and Quicken for personal finance.md | 96 -- ...1114 Finding Files with mlocate- Part 2.md | 174 ---- ...ux Programs for Drawing and Image Editing.md | 130 --- ...1121 Finding Files with mlocate- Part 3.md | 142 --- ...eractive Workflows for Cpp with Jupyter.md | 301 ------- ...usiness Software Alternatives For Linux.md | 117 --- ...power of community with organized chaos.md | 110 --- ...erve Scientific and Medical Communities.md | 170 ---- ... millions of Linux users with Snapcraft.md | 321 ------- ...xtensions You Should Be Using Right Now.md | 307 ------- ...ings Flexibility and Choice to openSUSE.md | 114 --- ...n must include people with disabilities.md | 67 -- sources/tech/20171224 My first Rust macro.md | 145 --- .../20180108 Debbugs Versioning- Merging.md | 80 -- ...erTux- A Linux Take on Super Mario Game.md | 77 -- ...et a compelling reason to turn to Linux.md | 70 -- ...ures resolving symbol addresses is hard.md | 163 ---- ...180114 Playing Quake 4 on Linux in 2018.md | 80 -- ...To Create A Bootable Zorin OS USB Drive.md | 315 ------- ...Top 6 open source desktop email clients.md | 115 --- ... Perl module a minimalist web framework.md | 106 --- ...urity features installing apps and more.md | 245 ----- ... for using CUPS for printing with Linux.md | 101 --- ...here MQ programming in Python with Zato.md | 262 ------ ... and manage MacOS LaunchAgents using Go.md | 314 ------- ...security risks in open source libraries.md | 249 ------ .../tech/20180130 Trying Other Go Versions.md | 112 --- ...chem group subversion repository to Git.md | 223 ----- ...y a React App on a DigitalOcean Droplet.md | 199 ----- .../tech/20180202 CompositeAcceleration.md | 211 ----- ...h the openbox windows manager in Fedora.md | 216 ----- ...0205 Writing eBPF tracing tools in Rust.md | 258 ------ ...art writing macros in LibreOffice Basic.md | 332 ------- ...e to create interactive adventure games.md | 299 ------- ...20180211 Latching Mutations with GitOps.md | 60 -- ...t Is sosreport- How To Create sosreport.md | 195 ---- ...A Comparison of Three Linux -App Stores.md | 128 --- ...n source card and board games for Linux.md | 103 --- ...hite male asshole, by a former offender.md | 153 ---- ...o create an open source stack using EFK.md | 388 -------- .../tech/20180327 Anna A KVS for any scale.md | 139 --- ...n to the Flask Python web app framework.md | 451 ---------- ... Importer Tool Rewritten in C plus plus.md | 70 -- ...ipt to your Java enterprise with Vert.x.md | 362 -------- ...80411 5 Best Feed Reader Apps for Linux.md | 192 ---- ...custom Linux settings with DistroTweaks.md | 108 --- ... Getting started with Jenkins Pipelines.md | 352 -------- ...0180413 Redcore Linux Makes Gentoo Easy.md | 89 -- ...iting Advanced Web Applications with Go.md | 695 --------------- ...y way to add free books to your eReader.md | 179 ---- ...x filesystem forensics - Opensource.com.md | 342 ------- ...aging virtual environments with Vagrant.md | 488 ---------- ... An easy way to generate RPG characters.md | 136 --- ...istributed tracing system work together.md | 156 ---- ... Modularity in Fedora 28 Server Edition.md | 76 -- ...507 Multinomial Logistic Classification.md | 215 ----- ...ux Revives Your Older Computer [Review].md | 114 --- ...ghtBSD Could Be Your Gateway to FreeBSD.md | 180 ---- ...to the Pyramid web framework for Python.md | 617 ------------- ...ust, flexible virtual tabletop for RPGs.md | 216 ----- ...t The Historical Uptime Of Linux System.md | 330 ------- ...id into a Linux development environment.md | 81 -- ...w to Enable Click to Minimize On Ubuntu.md | 102 --- ... BSD Distribution for the Desktop Users.md | 147 --- ...ustralian TV Channels to a Raspberry Pi.md | 209 ----- ... Go runtime implements maps efficiently.md | 355 -------- ... Build an Amazon Echo with Raspberry Pi.md | 374 -------- ...1 3 open source music players for Linux.md | 128 --- ...Get Started with Snap Packages in Linux.md | 159 ---- ...How to Install and Use Flatpak on Linux.md | 167 ---- ...ping tools to extract data from the web.md | 207 ----- ...ing an older relative online with Linux.md | 76 -- ...n books for Linux and open source types.md | 113 --- ...e tools to make literature reviews easy.md | 73 -- ...Ledger for YNAB-like envelope budgeting.md | 143 --- ...h tips for everyday at the command line.md | 593 ------------- ...t apps with Pronghorn, a Java framework.md | 120 --- ...180621 Troubleshooting a Buildah script.md | 179 ---- ...corn Archimedes Games on a Raspberry Pi.md | 539 ----------- ...629 Discover hidden gems in LibreOffice.md | 97 -- ...ging Linux applications becoming a snap.md | 148 ---- ...Browse Stack Overflow From The Terminal.md | 188 ---- ...gs to do After Installing Linux Mint 19.md | 223 ----- ...702 5 open source alternatives to Skype.md | 101 --- ...v4 launch an optimism born of necessity.md | 91 -- ...Scheme for the Software Defined Vehicle.md | 88 -- ...6 Using Ansible to set up a workstation.md | 168 ---- ... simple and elegant free podcast player.md | 119 --- ...The aftermath of the Gentoo GitHub hack.md | 72 -- ...ource racing and flying games for Linux.md | 102 --- ... Snapshot And Restore Utility For Linux.md | 237 ----- ...mand Line With OpenSubtitlesDownload.py.md | 221 ----- ...ner image- Meeting the legal challenges.md | 64 -- ...tandard Notes for encrypted note-taking.md | 299 ------- ...lusively Created for Microsoft Exchange.md | 114 --- ...0180801 Migrating Perl 5 code to Perl 6.md | 77 -- ...2 Walkthrough On How To Use GNOME Boxes.md | 117 --- ...ora Server to create a router - gateway.md | 285 ------ ...NU Make to load 1.4GB of data every day.md | 126 --- ...ecryption Effect Seen On Sneakers Movie.md | 110 --- ...806 Use Gstreamer and Python to rip CDs.md | 312 ------- ...fix, an open source mail transfer agent.md | 334 ------- ...Quality sound, open source music player.md | 105 --- ...E- 6 reasons to love this Linux desktop.md | 71 -- ...garden with Edraw Max - FOSS adventures.md | 74 -- .../20180816 Garbage collection in Perl 6.md | 121 --- ...ryaLinux- A Distribution and a Platform.md | 224 ----- ... a new open source web development tool.md | 282 ------ ...r behaviour on my competitor-s websites.md | 117 --- ...owchart and diagramming tools for Linux.md | 186 ---- ... books to your eReader- Formatting tips.md | 183 ---- ...sktop Client With VODs And Chat Support.md | 126 --- ...20180829 4 open source monitoring tools.md | 143 --- sources/tech/20180829 Containers in Perl 6.md | 174 ---- ...0830 A quick guide to DNF for yum users.md | 131 --- ... your website across all mobile devices.md | 85 -- ...ow subroutine signatures work in Perl 6.md | 335 ------- ...reat Desktop for the Open Source Purist.md | 114 --- ...diobook Player For DRM-Free Audio Files.md | 72 -- ...st your own cloud with Raspberry Pi NAS.md | 128 --- ...r Own Streaming Media Server In Minutes.md | 171 ---- ...ibuted tracing in a microservices world.md | 113 --- ...untu Linux With Kazam -Beginner-s Guide.md | 185 ---- ...oint is a Delight for Stealth Game Fans.md | 104 --- ...s To Find Out Process ID (PID) In Linux.md | 208 ----- ... the Audiophile Linux distro for a spin.md | 161 ---- ...29 Use Cozy to Play Audiobooks in Linux.md | 138 --- .../tech/20181003 Manage NTP with Chrony.md | 291 ------ ... 4 Must-Have Tools for Monitoring Linux.md | 102 --- ... to access educational material offline.md | 107 --- ...erna, a web-based information organizer.md | 128 --- ...tion to Ansible Operators in Kubernetes.md | 81 -- ...ckage installation for the Raspberry Pi.md | 87 -- ...ting upstream releases with release-bot.md | 327 ------- ...source alternatives to Microsoft Access.md | 94 -- ...tive, JavaScript timeline building tool.md | 82 -- ...irmware Version from Linux Command Line.md | 131 --- ... data streams on the Linux command line.md | 302 ------- ... started with OKD on your Linux desktop.md | 407 --------- ...How to manage storage on Linux with LVM.md | 237 ----- ...es Installed From Particular Repository.md | 342 ------- ...s on running new software in production.md | 151 ---- ...Behind the scenes with Linux containers.md | 205 ----- ...o After Installing elementary OS 5 Juno.md | 260 ------ ...how C-- destructors are useful in Envoy.md | 130 --- ...20181122 Getting started with Jenkins X.md | 148 ---- ... scientific research Linux distribution.md | 79 -- ...tom documentation workflows with Sphinx.md | 126 --- ...How to test your network with PerfSONAR.md | 148 ---- ...nd Tutorial With Examples For Beginners.md | 192 ---- ...earch - Quick Search GUI Tool for Linux.md | 108 --- ... How to view XML files in a web browser.md | 109 --- ... Screen Recorders for the Linux Desktop.md | 177 ---- ...ent and delivery of a hybrid mobile app.md | 102 --- ...you document a tech project with comics.md | 100 --- ... Commands And Programs From Commandline.md | 265 ------ ...g Flood Element for performance testing.md | 180 ---- ...h Reliability Infrastructure Migrations.md | 78 -- ...using KeePassX to secure your passwords.md | 78 -- ...less Way of Using Google Drive on Linux.md | 137 --- ...Large files with Git- LFS and git-annex.md | 145 --- ...o Heaven With These 23 GNOME Extensions.md | 288 ------ ...226 -Review- Polo File Manager in Linux.md | 139 --- ... model of concurrent garbage collection.md | 62 -- ...1229 Some nonparametric statistics math.md | 178 ---- 290 files changed, 44787 deletions(-) delete mode 100644 sources/news/20200117 Fedora CoreOS out of preview.md delete mode 100644 sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md delete mode 100644 sources/news/20200125 What 2020 brings for the developer, and more industry trends.md delete mode 100644 sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md delete mode 100644 sources/talk/20171030 Why I love technical debt.md delete mode 100644 sources/talk/20171107 How to Monetize an Open Source Project.md delete mode 100644 sources/talk/20171114 Why pair writing helps improve documentation.md delete mode 100644 sources/talk/20171115 Why and How to Set an Open Source Strategy.md delete mode 100644 sources/talk/20171116 Why is collaboration so difficult.md delete mode 100644 sources/talk/20171221 Changing how we use Slack solved our transparency and silo problems.md delete mode 100644 sources/talk/20180109 How Mycroft used WordPress and GitHub to improve its documentation.md delete mode 100644 sources/talk/20180111 The open organization and inner sourcing movements can share knowledge.md delete mode 100644 sources/talk/20180112 in which the cost of structured data is reduced.md delete mode 100644 sources/talk/20180124 Security Chaos Engineering- A new paradigm for cybersecurity.md delete mode 100644 sources/talk/20180131 How to write a really great resume that actually gets you hired.md delete mode 100644 sources/talk/20180206 UQDS- A software-development process that puts quality first.md delete mode 100644 sources/talk/20180207 Why Mainframes Aren-t Going Away Any Time Soon.md delete mode 100644 sources/talk/20180209 Arch Anywhere Is Dead, Long Live Anarchy Linux.md delete mode 100644 sources/talk/20180209 How writing can change your career for the better, even if you don-t identify as a writer.md delete mode 100644 sources/talk/20180209 Why an involved user community makes for better software.md delete mode 100644 sources/talk/20180214 Can anonymity and accountability coexist.md delete mode 100644 sources/talk/20180216 Q4OS Makes Linux Easy for Everyone.md delete mode 100644 sources/talk/20180220 4 considerations when naming software development projects.md delete mode 100644 sources/talk/20180221 3 warning flags of DevOps metrics.md delete mode 100644 sources/talk/20180222 3 reasons to say -no- in DevOps.md delete mode 100644 sources/talk/20180223 Plasma Mobile Could Give Life to a Mobile Linux Experience.md delete mode 100644 sources/talk/20180223 Why culture is the most important issue in a DevOps transformation.md delete mode 100644 sources/talk/20180301 How to hire the right DevOps talent.md delete mode 100644 sources/talk/20180302 Beyond metrics- How to operate as team on today-s open source project.md delete mode 100644 sources/talk/20180303 4 meetup ideas- Make your data open.md delete mode 100644 sources/talk/20180314 How to apply systems thinking in DevOps.md delete mode 100644 sources/talk/20180315 6 ways a thriving community will help your project succeed.md delete mode 100644 sources/talk/20180315 Lessons Learned from Growing an Open Source Project Too Fast.md delete mode 100644 sources/talk/20180316 How to avoid humiliating newcomers- A guide for advanced developers.md delete mode 100644 sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md delete mode 100644 sources/talk/20180321 8 tips for better agile retrospective meetings.md delete mode 100644 sources/talk/20180323 7 steps to DevOps hiring success.md delete mode 100644 sources/talk/20180330 Meet OpenAuto, an Android Auto emulator for Raspberry Pi.md delete mode 100644 sources/talk/20180403 3 pitfalls everyone should avoid with hybrid multicloud.md delete mode 100644 sources/talk/20180404 Is the term DevSecOps necessary.md delete mode 100644 sources/talk/20180405 Rethinking -ownership- across the organization.md delete mode 100644 sources/talk/20180410 Microservices Explained.md delete mode 100644 sources/talk/20180412 Management, from coordination to collaboration.md delete mode 100644 sources/talk/20180416 For project safety back up your people, not just your data.md delete mode 100644 sources/talk/20180417 How to develop the FOSS leaders of the future.md delete mode 100644 sources/talk/20180418 Is DevOps compatible with part-time community teams.md delete mode 100644 sources/talk/20180419 3 tips for organizing your open source project-s workflow on GitHub.md delete mode 100644 sources/talk/20180420 What You Don-t Know About Linux Open Source Could Be Costing to More Than You Think.md delete mode 100644 sources/talk/20180424 There-s a Server in Every Serverless Platform.md delete mode 100644 sources/talk/20180511 Looking at the Lispy side of Perl.md delete mode 100644 sources/talk/20180527 Whatever Happened to the Semantic Web.md delete mode 100644 sources/talk/20180604 10 principles of resilience for women in tech.md delete mode 100644 sources/talk/20180613 AI Is Coming to Edge Computing Devices.md delete mode 100644 sources/talk/20180619 A summer reading list for open organization enthusiasts.md delete mode 100644 sources/talk/20180620 3 pitfalls everyone should avoid with hybrid multi-cloud, part 2.md delete mode 100644 sources/talk/20180622 7 tips for promoting your project and community on Twitter.md delete mode 100644 sources/talk/20180701 How to migrate to the world of Linux from Windows.md delete mode 100644 sources/talk/20180703 What Game of Thrones can teach us about open innovation.md delete mode 100644 sources/talk/20180704 Comparing Twine and Ren-Py for creating interactive fiction.md delete mode 100644 sources/talk/20180705 5 Reasons Open Source Certification Matters More Than Ever.md delete mode 100644 sources/talk/20180706 Robolinux Lets You Easily Run Linux and Windows Without Dual Booting.md delete mode 100644 sources/talk/20180711 Becoming a senior developer 9 experiences you ll encounter.md delete mode 100644 sources/talk/20180711 Open hardware meets open science in a multi-microphone hearing aid project.md delete mode 100644 sources/talk/20180716 Confessions of a recovering Perl hacker.md delete mode 100644 sources/talk/20180717 Tips for Success with Open Source Certification.md delete mode 100644 sources/talk/20180719 Finding Jobs in Software.md delete mode 100644 sources/talk/20180724 Open Source Certification- Preparing for the Exam.md delete mode 100644 sources/talk/20180724 Why moving all your workloads to the cloud is a bad idea.md delete mode 100644 sources/talk/20180726 Tech jargon- The good, the bad, and the ugly.md delete mode 100644 sources/talk/20180802 Design thinking as a way of life.md delete mode 100644 sources/talk/20180807 Becoming a successful programmer in an underrepresented community.md delete mode 100644 sources/talk/20180807 Building more trustful teams in four steps.md delete mode 100644 sources/talk/20180808 3 tips for moving your team to a microservices architecture.md delete mode 100644 sources/talk/20180809 How do tools affect culture.md delete mode 100644 sources/talk/20180813 Using D Features to Reimplement Inheritance and Polymorphism.md delete mode 100644 sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md delete mode 100644 sources/talk/20180817 OERu makes a college education affordable.md delete mode 100644 sources/talk/20180820 Keeping patient data safe with open source tools.md delete mode 100644 sources/talk/20180831 3 innovative open source projects for the new school year.md delete mode 100644 sources/talk/20180906 DevOps- The consequences of blame.md delete mode 100644 sources/talk/20180916 The Rise and Demise of RSS (Old Version).md delete mode 100644 sources/talk/20180917 How gaming turned me into a coder.md delete mode 100644 sources/talk/20180920 Building a Secure Ecosystem for Node.js.md delete mode 100644 sources/talk/20180925 Troubleshooting Node.js Issues with llnode.md delete mode 100644 sources/talk/20181003 13 tools to measure DevOps success.md delete mode 100644 sources/talk/20181007 Why it-s Easier to Get a Payrise by Switching Jobs.md delete mode 100644 sources/talk/20181009 4 best practices for giving open source code feedback.md delete mode 100644 sources/talk/20181010 Talk over text- Conversational interface design and usability.md delete mode 100644 sources/talk/20181011 How to level up your organization-s security expertise.md delete mode 100644 sources/talk/20181017 We already have nice things, and other reasons not to write in-house ops tools.md delete mode 100644 sources/talk/20181018 The case for open source classifiers in AI algorithms.md delete mode 100644 sources/talk/20181019 To BeOS or not to BeOS, that is the Haiku.md delete mode 100644 sources/talk/20181023 What MMORPGs can teach us about leveling up a heroic developer team.md delete mode 100644 sources/talk/20181024 5 tips for facilitators of agile meetings.md delete mode 100644 sources/talk/20181031 How open source hardware increases security.md delete mode 100644 sources/talk/20181107 5 signs you are doing continuous testing wrong - Opensource.com.md delete mode 100644 sources/talk/20181107 How open source in education creates new developers.md delete mode 100644 sources/talk/20181107 Understanding a -nix Shell by Writing One.md delete mode 100644 sources/talk/20181113 Have you seen these personalities in open source.md delete mode 100644 sources/talk/20181114 Analyzing the DNA of DevOps.md delete mode 100644 sources/talk/20181114 Is your startup built on open source- 9 tips for getting started.md delete mode 100644 sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md delete mode 100644 sources/talk/20181127 What the open source community means to me.md delete mode 100644 sources/talk/20181129 9 top tech-recruiting mistakes to avoid.md delete mode 100644 sources/talk/20181129 Why giving back is important to the DevOps culture.md delete mode 100644 sources/talk/20181130 3 emerging tipping points in open source.md delete mode 100644 sources/talk/20181205 5 reasons to give Linux for the holidays.md delete mode 100644 sources/talk/20181205 F-Words in Linux Kernel Code Replaced with -Hug.md delete mode 100644 sources/talk/20181205 Unfortunately, Garbage Collection isn-t Enough.md delete mode 100644 sources/talk/20181206 6 steps to optimize software delivery with value stream mapping.md delete mode 100644 sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md delete mode 100644 sources/talk/20181209 Open source DIY ethics.md delete mode 100644 sources/talk/20181217 8 tips to help non-techies move to Linux.md delete mode 100644 sources/talk/20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md delete mode 100644 sources/talk/20181220 D in the Browser with Emscripten, LDC and bindbc-sdl (translation).md delete mode 100644 sources/talk/20181231 Plans to learn a new tech skill in 2019- What you need to know.md delete mode 100644 sources/talk/20190205 7 predictions for artificial intelligence in 2019.md delete mode 100644 sources/talk/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md delete mode 100644 sources/tech/20151127 Research log- gene signatures and connectivity map.md delete mode 100644 sources/tech/20160302 Go channels are bad and you should feel bad.md delete mode 100644 sources/tech/20170115 Magic GOPATH.md delete mode 100644 sources/tech/20170320 Whiteboard problems in pure Lambda Calculus.md delete mode 100644 sources/tech/20171006 7 deadly sins of documentation.md delete mode 100644 sources/tech/20171006 Create a Clean-Code App with Kotlin Coroutines and Android Architecture Components.md delete mode 100644 sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md delete mode 100644 sources/tech/20171030 5 open source alternatives to Mint and Quicken for personal finance.md delete mode 100644 sources/tech/20171114 Finding Files with mlocate- Part 2.md delete mode 100644 sources/tech/20171116 Unleash Your Creativity – Linux Programs for Drawing and Image Editing.md delete mode 100644 sources/tech/20171121 Finding Files with mlocate- Part 3.md delete mode 100644 sources/tech/20171129 Interactive Workflows for Cpp with Jupyter.md delete mode 100644 sources/tech/20171130 Excellent Business Software Alternatives For Linux.md delete mode 100644 sources/tech/20171130 Tap the power of community with organized chaos.md delete mode 100644 sources/tech/20171201 Linux Distros That Serve Scientific and Medical Communities.md delete mode 100644 sources/tech/20171202 Easily control delivery of your Python applications to millions of Linux users with Snapcraft.md delete mode 100644 sources/tech/20171203 Top 20 GNOME Extensions You Should Be Using Right Now.md delete mode 100644 sources/tech/20171208 GeckoLinux Brings Flexibility and Choice to openSUSE.md delete mode 100644 sources/tech/20171222 Why the diversity and inclusion conversation must include people with disabilities.md delete mode 100644 sources/tech/20171224 My first Rust macro.md delete mode 100644 sources/tech/20180108 Debbugs Versioning- Merging.md delete mode 100644 sources/tech/20180108 SuperTux- A Linux Take on Super Mario Game.md delete mode 100644 sources/tech/20180108 You GNOME it- Windows and Apple devs get a compelling reason to turn to Linux.md delete mode 100644 sources/tech/20180109 Profiler adventures resolving symbol addresses is hard.md delete mode 100644 sources/tech/20180114 Playing Quake 4 on Linux in 2018.md delete mode 100644 sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md delete mode 100644 sources/tech/20180119 Top 6 open source desktop email clients.md delete mode 100644 sources/tech/20180126 An introduction to the Web Simple Perl module a minimalist web framework.md delete mode 100644 sources/tech/20180129 CopperheadOS Security features installing apps and more.md delete mode 100644 sources/tech/20180129 Tips and tricks for using CUPS for printing with Linux.md delete mode 100644 sources/tech/20180129 WebSphere MQ programming in Python with Zato.md delete mode 100644 sources/tech/20180130 Create and manage MacOS LaunchAgents using Go.md delete mode 100644 sources/tech/20180130 Mitigating known security risks in open source libraries.md delete mode 100644 sources/tech/20180130 Trying Other Go Versions.md delete mode 100644 sources/tech/20180131 Migrating the debichem group subversion repository to Git.md delete mode 100644 sources/tech/20180201 I Built This - Now What How to deploy a React App on a DigitalOcean Droplet.md delete mode 100644 sources/tech/20180202 CompositeAcceleration.md delete mode 100644 sources/tech/20180205 Getting Started with the openbox windows manager in Fedora.md delete mode 100644 sources/tech/20180205 Writing eBPF tracing tools in Rust.md delete mode 100644 sources/tech/20180208 How to start writing macros in LibreOffice Basic.md delete mode 100644 sources/tech/20180209 How to use Twine and SugarCube to create interactive adventure games.md delete mode 100644 sources/tech/20180211 Latching Mutations with GitOps.md delete mode 100644 sources/tech/20180307 What Is sosreport- How To Create sosreport.md delete mode 100644 sources/tech/20180309 A Comparison of Three Linux -App Stores.md delete mode 100644 sources/tech/20180314 5 open source card and board games for Linux.md delete mode 100644 sources/tech/20180319 How to not be a white male asshole, by a former offender.md delete mode 100644 sources/tech/20180326 How to create an open source stack using EFK.md delete mode 100644 sources/tech/20180327 Anna A KVS for any scale.md delete mode 100644 sources/tech/20180402 An introduction to the Flask Python web app framework.md delete mode 100644 sources/tech/20180403 Open Source Accounting Program GnuCash 3.0 Released With a New CSV Importer Tool Rewritten in C plus plus.md delete mode 100644 sources/tech/20180404 Bring some JavaScript to your Java enterprise with Vert.x.md delete mode 100644 sources/tech/20180411 5 Best Feed Reader Apps for Linux.md delete mode 100644 sources/tech/20180411 Replicate your custom Linux settings with DistroTweaks.md delete mode 100644 sources/tech/20180412 Getting started with Jenkins Pipelines.md delete mode 100644 sources/tech/20180413 Redcore Linux Makes Gentoo Easy.md delete mode 100644 sources/tech/20180419 Writing Advanced Web Applications with Go.md delete mode 100644 sources/tech/20180420 A handy way to add free books to your eReader.md delete mode 100644 sources/tech/20180423 Breach detection with Linux filesystem forensics - Opensource.com.md delete mode 100644 sources/tech/20180423 Managing virtual environments with Vagrant.md delete mode 100644 sources/tech/20180430 PCGen- An easy way to generate RPG characters.md delete mode 100644 sources/tech/20180503 How the four components of a distributed tracing system work together.md delete mode 100644 sources/tech/20180507 Modularity in Fedora 28 Server Edition.md delete mode 100644 sources/tech/20180507 Multinomial Logistic Classification.md delete mode 100644 sources/tech/20180509 4MLinux Revives Your Older Computer [Review].md delete mode 100644 sources/tech/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md delete mode 100644 sources/tech/20180514 An introduction to the Pyramid web framework for Python.md delete mode 100644 sources/tech/20180514 MapTool- A robust, flexible virtual tabletop for RPGs.md delete mode 100644 sources/tech/20180514 Tuptime - A Tool To Report The Historical Uptime Of Linux System.md delete mode 100644 sources/tech/20180515 Termux turns Android into a Linux development environment.md delete mode 100644 sources/tech/20180522 How to Enable Click to Minimize On Ubuntu.md delete mode 100644 sources/tech/20180524 TrueOS- A Simple BSD Distribution for the Desktop Users.md delete mode 100644 sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md delete mode 100644 sources/tech/20180529 How the Go runtime implements maps efficiently.md delete mode 100644 sources/tech/20180531 How to Build an Amazon Echo with Raspberry Pi.md delete mode 100644 sources/tech/20180601 3 open source music players for Linux.md delete mode 100644 sources/tech/20180601 Get Started with Snap Packages in Linux.md delete mode 100644 sources/tech/20180608 How to Install and Use Flatpak on Linux.md delete mode 100644 sources/tech/20180608 How to use screen scraping tools to extract data from the web.md delete mode 100644 sources/tech/20180609 4 tips for getting an older relative online with Linux.md delete mode 100644 sources/tech/20180611 12 fiction books for Linux and open source types.md delete mode 100644 sources/tech/20180612 7 open source tools to make literature reviews easy.md delete mode 100644 sources/tech/20180612 Using Ledger for YNAB-like envelope budgeting.md delete mode 100644 sources/tech/20180614 Bash tips for everyday at the command line.md delete mode 100644 sources/tech/20180618 Write fast apps with Pronghorn, a Java framework.md delete mode 100644 sources/tech/20180621 Troubleshooting a Buildah script.md delete mode 100644 sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md delete mode 100644 sources/tech/20180629 Discover hidden gems in LibreOffice.md delete mode 100644 sources/tech/20180629 Is implementing and managing Linux applications becoming a snap.md delete mode 100644 sources/tech/20180629 SoCLI - Easy Way To Search And Browse Stack Overflow From The Terminal.md delete mode 100644 sources/tech/20180701 12 Things to do After Installing Linux Mint 19.md delete mode 100644 sources/tech/20180702 5 open source alternatives to Skype.md delete mode 100644 sources/tech/20180702 Diggs v4 launch an optimism born of necessity.md delete mode 100644 sources/tech/20180703 AGL Outlines Virtualization Scheme for the Software Defined Vehicle.md delete mode 100644 sources/tech/20180706 Using Ansible to set up a workstation.md delete mode 100644 sources/tech/20180708 simple and elegant free podcast player.md delete mode 100644 sources/tech/20180710 The aftermath of the Gentoo GitHub hack.md delete mode 100644 sources/tech/20180711 5 open source racing and flying games for Linux.md delete mode 100644 sources/tech/20180723 System Snapshot And Restore Utility For Linux.md delete mode 100644 sources/tech/20180727 Download Subtitles Via Right Click From File Manager Or Command Line With OpenSubtitlesDownload.py.md delete mode 100644 sources/tech/20180731 What-s in a container image- Meeting the legal challenges.md delete mode 100644 sources/tech/20180801 Getting started with Standard Notes for encrypted note-taking.md delete mode 100644 sources/tech/20180801 Hiri is a Linux Email Client Exclusively Created for Microsoft Exchange.md delete mode 100644 sources/tech/20180801 Migrating Perl 5 code to Perl 6.md delete mode 100644 sources/tech/20180802 Walkthrough On How To Use GNOME Boxes.md delete mode 100644 sources/tech/20180803 How to use Fedora Server to create a router - gateway.md delete mode 100644 sources/tech/20180806 How ProPublica Illinois uses GNU Make to load 1.4GB of data every day.md delete mode 100644 sources/tech/20180806 Recreate Famous Data Decryption Effect Seen On Sneakers Movie.md delete mode 100644 sources/tech/20180806 Use Gstreamer and Python to rip CDs.md delete mode 100644 sources/tech/20180809 Getting started with Postfix, an open source mail transfer agent.md delete mode 100644 sources/tech/20180810 Strawberry- Quality sound, open source music player.md delete mode 100644 sources/tech/20180815 Happy birthday, GNOME- 6 reasons to love this Linux desktop.md delete mode 100644 sources/tech/20180816 Designing your garden with Edraw Max - FOSS adventures.md delete mode 100644 sources/tech/20180816 Garbage collection in Perl 6.md delete mode 100644 sources/tech/20180817 AryaLinux- A Distribution and a Platform.md delete mode 100644 sources/tech/20180817 Cloudgizer- An introduction to a new open source web development tool.md delete mode 100644 sources/tech/20180821 How I recorded user behaviour on my competitor-s websites.md delete mode 100644 sources/tech/20180822 9 flowchart and diagramming tools for Linux.md delete mode 100644 sources/tech/20180824 Add free books to your eReader- Formatting tips.md delete mode 100644 sources/tech/20180828 Orion Is A QML - C-- Twitch Desktop Client With VODs And Chat Support.md delete mode 100644 sources/tech/20180829 4 open source monitoring tools.md delete mode 100644 sources/tech/20180829 Containers in Perl 6.md delete mode 100644 sources/tech/20180830 A quick guide to DNF for yum users.md delete mode 100644 sources/tech/20180830 How to scale your website across all mobile devices.md delete mode 100644 sources/tech/20180912 How subroutine signatures work in Perl 6.md delete mode 100644 sources/tech/20180914 Freespire Linux- A Great Desktop for the Open Source Purist.md delete mode 100644 sources/tech/20180918 Cozy Is A Nice Linux Audiobook Player For DRM-Free Audio Files.md delete mode 100644 sources/tech/20180919 Host your own cloud with Raspberry Pi NAS.md delete mode 100644 sources/tech/20180919 Streama - Setup Your Own Streaming Media Server In Minutes.md delete mode 100644 sources/tech/20180920 Distributed tracing in a microservices world.md delete mode 100644 sources/tech/20180920 Record Screen in Ubuntu Linux With Kazam -Beginner-s Guide.md delete mode 100644 sources/tech/20180923 Gunpoint is a Delight for Stealth Game Fans.md delete mode 100644 sources/tech/20180925 9 Easiest Ways To Find Out Process ID (PID) In Linux.md delete mode 100644 sources/tech/20180925 Taking the Audiophile Linux distro for a spin.md delete mode 100644 sources/tech/20180929 Use Cozy to Play Audiobooks in Linux.md delete mode 100644 sources/tech/20181003 Manage NTP with Chrony.md delete mode 100644 sources/tech/20181004 4 Must-Have Tools for Monitoring Linux.md delete mode 100644 sources/tech/20181005 How to use Kolibri to access educational material offline.md delete mode 100644 sources/tech/20181008 Taking notes with Laverna, a web-based information organizer.md delete mode 100644 sources/tech/20181015 An introduction to Ansible Operators in Kubernetes.md delete mode 100644 sources/tech/20181016 piwheels- Speedy Python package installation for the Raspberry Pi.md delete mode 100644 sources/tech/20181017 Automating upstream releases with release-bot.md delete mode 100644 sources/tech/20181018 4 open source alternatives to Microsoft Access.md delete mode 100644 sources/tech/20181018 TimelineJS- An interactive, JavaScript timeline building tool.md delete mode 100644 sources/tech/20181023 How to Check HP iLO Firmware Version from Linux Command Line.md delete mode 100644 sources/tech/20181031 Working with data streams on the Linux command line.md delete mode 100644 sources/tech/20181101 Getting started with OKD on your Linux desktop.md delete mode 100644 sources/tech/20181105 How to manage storage on Linux with LVM.md delete mode 100644 sources/tech/20181106 How To Check The List Of Packages Installed From Particular Repository.md delete mode 100644 sources/tech/20181111 Some notes on running new software in production.md delete mode 100644 sources/tech/20181112 Behind the scenes with Linux containers.md delete mode 100644 sources/tech/20181115 11 Things To Do After Installing elementary OS 5 Juno.md delete mode 100644 sources/tech/20181118 An example of how C-- destructors are useful in Envoy.md delete mode 100644 sources/tech/20181122 Getting started with Jenkins X.md delete mode 100644 sources/tech/20181127 Bio-Linux- A stable, portable scientific research Linux distribution.md delete mode 100644 sources/tech/20181128 Building custom documentation workflows with Sphinx.md delete mode 100644 sources/tech/20181128 How to test your network with PerfSONAR.md delete mode 100644 sources/tech/20181129 The Top Command Tutorial With Examples For Beginners.md delete mode 100644 sources/tech/20181203 ANGRYsearch - Quick Search GUI Tool for Linux.md delete mode 100644 sources/tech/20181206 How to view XML files in a web browser.md delete mode 100644 sources/tech/20181207 5 Screen Recorders for the Linux Desktop.md delete mode 100644 sources/tech/20181207 Automatic continuous development and delivery of a hybrid mobile app.md delete mode 100644 sources/tech/20181209 How do you document a tech project with comics.md delete mode 100644 sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md delete mode 100644 sources/tech/20181214 Tips for using Flood Element for performance testing.md delete mode 100644 sources/tech/20181215 New talk- High Reliability Infrastructure Migrations.md delete mode 100644 sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md delete mode 100644 sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md delete mode 100644 sources/tech/20181221 Large files with Git- LFS and git-annex.md delete mode 100644 sources/tech/20181224 Turn GNOME to Heaven With These 23 GNOME Extensions.md delete mode 100644 sources/tech/20181226 -Review- Polo File Manager in Linux.md delete mode 100644 sources/tech/20181228 The office coffee model of concurrent garbage collection.md delete mode 100644 sources/tech/20181229 Some nonparametric statistics math.md diff --git a/sources/news/20200117 Fedora CoreOS out of preview.md b/sources/news/20200117 Fedora CoreOS out of preview.md deleted file mode 100644 index d7a1393cde..0000000000 --- a/sources/news/20200117 Fedora CoreOS out of preview.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fedora CoreOS out of preview) -[#]: via: (https://fedoramagazine.org/fedora-coreos-out-of-preview/) -[#]: author: (bgilbert https://fedoramagazine.org/author/bgilbert/) - -Fedora CoreOS out of preview -====== - -![The Fedora CoreOS logo on a gray background.][1] - -The Fedora CoreOS team is pleased to announce that Fedora CoreOS is now [available for general use][2]. - -Fedora CoreOS is a new Fedora Edition built specifically for running containerized workloads securely and at scale. It’s the successor to both [Fedora Atomic Host][3] and [CoreOS Container Linux][4] and is part of our effort to explore new ways of assembling and updating an OS. Fedora CoreOS combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host.  For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][5]. - -Some highlights of the current Fedora CoreOS release: - - * [Automatic updates][6], with staged deployments and phased rollouts - * Built from Fedora 31, featuring: - * Linux 5.4 - * systemd 243 - * Ignition 2.1 - * OCI and Docker Container support via Podman 1.7 and Moby 18.09 - * cgroups v1 enabled by default for broader compatibility; cgroups v2 available via configuration - - - -Fedora CoreOS is available on a variety of platforms: - - * Bare metal, QEMU, OpenStack, and VMware - * Images available in all public AWS regions - * Downloadable cloud images for Alibaba, AWS, Azure, and GCP - * Can run live from RAM via ISO and PXE (netboot) images - - - -Fedora CoreOS is under active development.  Planned future enhancements include: - - * Addition of the _next_ release stream for extended testing of upcoming Fedora releases. - * Support for additional cloud and virtualization platforms, and processor architectures other than _x86_64_. - * Closer integration with Kubernetes distributions, including [OKD][7]. - * [Aggregate statistics collection][8]. - * Additional [documentation][9]. - - - -### Where do I get it? - -To try out the new release, head over to the [download page][10] to get OS images or cloud image IDs.  Then use the [quick start guide][11] to get a machine running quickly. - -### How do I get involved? - -It’s easy!  You can report bugs and missing features to the [issue tracker][12]. You can also discuss Fedora CoreOS in [Fedora Discourse][13], the [development mailing list][14], in _#fedora-coreos_ on Freenode, or at our [weekly IRC meetings][15]. - -### Are there stability guarantees? - -In general, the Fedora Project does not make any guarantees around stability.  While Fedora CoreOS strives for a high level of stability, this can be challenging to achieve in the rapidly evolving Linux and container ecosystems.  We’ve found that the incremental, exploratory, forward-looking development required for Fedora CoreOS — which is also a cornerstone of the Fedora Project as a whole — is difficult to reconcile with the iron-clad stability guarantee that ideally exists when automatically updating systems. - -We’ll continue to do our best not to break existing systems over time, and to give users the tools to manage the impact of any regressions.  Nevertheless, automatic updates may produce regressions or breaking changes for some use cases. You should make your own decisions about where and how to run Fedora CoreOS based on your risk tolerance, operational needs, and experience with the OS.  We will continue to announce any major planned or unplanned breakage to the [coreos-status mailing list][16], along with recommended mitigations. - -### How do I migrate from CoreOS Container Linux? - -Container Linux machines cannot be migrated in place to Fedora CoreOS.  We recommend [writing a new Fedora CoreOS Config][11] to provision Fedora CoreOS machines.  Fedora CoreOS Configs are similar to Container Linux Configs, and must be passed through the Fedora CoreOS Config Transpiler to produce an Ignition config for provisioning a Fedora CoreOS machine. - -Whether you’re currently provisioning your Container Linux machines using a Container Linux Config, handwritten Ignition config, or cloud-config, you’ll need to adjust your configs for differences between Container Linux and Fedora CoreOS.  For example, on Fedora CoreOS network configuration is performed with [NetworkManager key files][17] instead of _systemd-networkd_, and time synchronization is performed by _chrony_ rather than _systemd-timesyncd_.  Initial migration documentation will be [available soon][9] and a skeleton list of differences between the two OSes is available in [this issue][18]. - -CoreOS Container Linux will be maintained for a few more months, and then will be declared end-of-life.  We’ll announce the exact end-of-life date later this month. - -### How do I migrate from Fedora Atomic Host? - -Fedora Atomic Host has already reached end-of-life, and you should migrate to Fedora CoreOS as soon as possible.  We do not recommend in-place migration of Atomic Host machines to Fedora CoreOS. Instead, we recommend [writing a Fedora CoreOS Config][11] and using it to provision new Fedora CoreOS machines.  As with CoreOS Container Linux, you’ll need to adjust your existing cloud-configs for differences between Fedora Atomic Host and Fedora CoreOS. - -Welcome to Fedora CoreOS.  Deploy it, launch your apps, and let us know what you think! - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fedora-coreos-out-of-preview/ - -作者:[bgilbert][a] -选题:[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/bgilbert/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/introducing-fedora-coreos-816x345.png -[2]: https://getfedora.org/coreos/ -[3]: https://www.projectatomic.io/ -[4]: https://coreos.com/os/docs/latest/ -[5]: https://fedoramagazine.org/introducing-fedora-coreos/ -[6]: https://docs.fedoraproject.org/en-US/fedora-coreos/auto-updates/ -[7]: https://www.okd.io/ -[8]: https://github.com/coreos/fedora-coreos-pinger/ -[9]: https://docs.fedoraproject.org/en-US/fedora-coreos/ -[10]: https://getfedora.org/coreos/download/ -[11]: https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started/ -[12]: https://github.com/coreos/fedora-coreos-tracker/issues -[13]: https://discussion.fedoraproject.org/c/server/coreos -[14]: https://lists.fedoraproject.org/archives/list/coreos@lists.fedoraproject.org/ -[15]: https://github.com/coreos/fedora-coreos-tracker#meetings -[16]: https://lists.fedoraproject.org/archives/list/coreos-status@lists.fedoraproject.org/ -[17]: https://developer.gnome.org/NetworkManager/stable/nm-settings-keyfile.html -[18]: https://github.com/coreos/fedora-coreos-tracker/issues/159 diff --git a/sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md b/sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md deleted file mode 100644 index 90b5c18537..0000000000 --- a/sources/news/20200119 Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning) -[#]: via: (https://opensource.com/article/20/1/news-january-19) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -Open source fights cancer, Tesla adopts Coreboot, Uber and Lyft release open source machine learning -====== -Catch up on the biggest open source headlines from the past two weeks. -![Weekly news roundup with TV][1] - -In this edition of our open source news roundup, we take a look machine learning tools from Uber and Lyft, open source software to fight cancer, saving students money with open textbooks, and more! - -### Uber and Lyft release machine learning tools - -It's hard to a growing company these days that doesn't take advantage of machine learning to streamline its business and make sense of the data it amasses. Ridesharing companies, which gather massive amounts of data, have enthusiastically embraced the promise of machine learning. Two of the biggest players in the ridesharing sector have made some of their machine learning code open source. - -Uber recently [released the source code][2] for its Manifold tool for debugging machine learning models. According to Uber software engineer Lezhi Li, Manifold will "benefit the machine learning (ML) community by providing interpretability and debuggability for ML workflows." If you're interested, you can browse Manifold's source code [on GitHub][3]. - -Lyft has also upped its open source stakes by releasing Flyte. Flyte, whose source code is [available on GitHub][4], manages machine learning pipelines and "is an essential backbone to (Lyft's) operations." Lyft has been using it to train AI models and process data "across pricing, logistics, mapping, and autonomous projects." - -### Software to detect cancer cells - -In a study recently published in _Nature Biotechnology_, a team of medical researchers from around the world announced [new open source software][5] that "could make it easier to create personalised cancer treatment plans." - -The software assesses "the proportion of cancerous cells in a tumour sample" and can help clinicians "judge the accuracy of computer predictions and establish benchmarks" across tumor samples. Maxime Tarabichi, one of the lead authors of [the study][6], said that the software "provides a foundation which will hopefully become a much-needed, unbiased, gold-standard benchmarking tool for assessing models that aim to characterise a tumour’s genetic diversity." - -### University of Regina saves students over $1 million with open textbooks - -If rising tuition costs weren't enough to send university student spiralling into debt, the high prices of textbooks can deepen the crater in their bank accounts. To help ease that financial pain, many universities turn to open textbooks. One of those schools is the University of Regina. By offering open text books, the university [expects to save a huge amount for students][7] over the next five years. - -The expected savings are in the region of $1.5 million (CAD), or around $1.1 million USD (at the time of writing). The textbooks, according to a report by radio station CKOM, are "provided free for (students) and they can be printed off or used as e-books." Students aren't getting inferior-quality textbooks, though. Nilgun Onder of the University of Regina said that the "textbooks and other open education resources the university published are all peer-reviewed resources. In other words, they are reliable and credible." - -### Tesla adopts Coreboot - -Much of the software driving (no pun intended) the electric vehicles made by Tesla Motors is open source. So it's not surprising to learn that the company has [adopted Coreboot][8] "as part of their electric vehicle computer systems." - -Coreboot was developed as a replacement for proprietary BIOS and is used to boot hardware and the Linux kernel. The code, which is in [Tesla's GitHub repository][9], "is from Tesla Motors and Samsung," according to Phoronix. Samsung, in case you're wondering, makes the chip on which Tesla's self-driving software runs. - -#### In other news - - * [Arduino launches new modular platform for IoT development][10] - * [SUSE and Karunya Institute of Technology and Sciences collaborate to enhance cloud and open source learning][11] - * [How open-source code could help us survive natural disasters][12] - * [The hottest thing in robotics is an open source project you've never heard of][13] - - - -_Thanks, as always, to Opensource.com staff members and moderators for their help this week. Make sure to check out [our event calendar][14], to see what's happening next week in open source._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/news-january-19 - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV) -[2]: https://venturebeat.com/2020/01/07/uber-open-sources-manifold-a-visual-tool-for-debugging-ai-models/ -[3]: https://github.com/uber/manifold -[4]: https://github.com/lyft/flyte -[5]: https://www.cbronline.com/industry/healthcare/open-source-cancer-cells/ -[6]: https://www.nature.com/articles/s41587-019-0364-z -[7]: https://www.ckom.com/2020/01/07/open-source-program-to-save-u-of-r-students-1-5m/ -[8]: https://www.phoronix.com/scan.php?page=news_item&px=Tesla-Uses-Coreboot -[9]: https://github.com/teslamotors/coreboot -[10]: https://techcrunch.com/2020/01/07/arduino-launches-a-new-modular-platform-for-iot-development/ -[11]: https://www.crn.in/news/suse-and-karunya-institute-of-technology-and-sciences-collaborate-to-enhance-cloud-and-open-source-learning/ -[12]: https://qz.com/1784867/open-source-data-could-help-save-lives-during-natural-disasters/ -[13]: https://www.techrepublic.com/article/the-hottest-thing-in-robotics-is-an-open-source-project-youve-never-heard-of/ -[14]: https://opensource.com/resources/conferences-and-events-monthly diff --git a/sources/news/20200125 What 2020 brings for the developer, and more industry trends.md b/sources/news/20200125 What 2020 brings for the developer, and more industry trends.md deleted file mode 100644 index e22735d21c..0000000000 --- a/sources/news/20200125 What 2020 brings for the developer, and more industry trends.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What 2020 brings for the developer, and more industry trends) -[#]: via: (https://opensource.com/article/20/1/hybrid-developer-future-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -What 2020 brings for the developer, and more industry trends -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [How developers will work in 2020][2] - -> Developers have been spending an enormous amount of time on everything *except* making software that solves problems. ‘DevOps’ has transmogrified from ‘developers releasing software’ into ‘developers building ever more complex infrastructure atop Kubernetes’ and ‘developers reinventing their software as distributed stateless functions.’ In 2020, ‘serverless’ will mature. Handle state. Handle data storage without requiring devs to learn yet-another-proprietary-database-service. Learning new stuff is fun-but shipping is even better, and we’ll finally see systems and services that support that. - -**The impact:** A lot of forces are converging to give developers superpowers. There are ever more open source building blocks in place; thousands of geniuses are collaborating to make developer workflows more fun and efficient, and artificial intelligences are being brought to bear solving the types of problems a developer might face. On the one hand, there is clear leverage to giving developer superpowers: if they can make magic with software they'll be able to make even bigger magic with all this help. On the other hand, imagine if teachers had the same level of investment and support. Makes ya wonder don't it? - -## [2020 forecast: Cloud-y with a chance of hybrid][3] - -> Behind this growth is an array of new themes and strategies that are pushing cloud further up business agendas the world over. With ‘emerging’ technologies, such as AI and machine learning, containers and functions, and even more flexibility available with hybrid cloud solutions being provided by the major providers, it’s no wonder cloud is set to take centre stage. - -**The impact:** Hybrid cloud finally has the same level of flesh that public cloud and on-premises have. Over the course of 2019 especially the competing visions offered for what it meant to be hybrid formed a composite that drove home why someone would want it. At the same time more and more of the technology pieces that make hybrid viable are in place and maturing. 2019 was the year that people truly "got" hybrid. 2020 will be the year that people start to take advantage of it. - -## [The no-code delusion][4] - -> Increasingly popular in the last couple of years, I think 2020 is going to be the year of “no code”: the movement that says you can write business logic and even entire applications without having the training of a software developer. I empathise with people doing this, and I think some of the “no code” tools are great. But I also thing it’s wrong at heart. - -**The impact:** I've heard many devs say it over many years: "software development is hard." It would be a mistake to interpret that as "all software development is equally hard." What I've always found hard about learning to code is trying to think in a way that a computer will understand. With or without code, making computers do complex things will always require a different kind of thinking. - -## [All things Java][5] - -> The open, multi-vendor model has been a major strength—it’s very hard for any single vendor to pioneer a market for a sustained period of time—and taking different perspectives from diverse industries has been a key strength of the [evolution of Java][6]. Choosing to open source Java in 2006 was also a decision that only worked to strengthen the Java ecosystem, as it allowed Sun Microsystems and later Oracle to share the responsibility of maintaining and evolving Java with many other organizations and individuals. - -**The impact:** The things that move quickly in technology are the things that can be thrown away. When you know you're going to keep something for a long time, you're likely to make different choices about what to prioritize when building it. Disposable and long-lived both have their places, and the Java community made enough good decisions over the years that the language itself can have a foot in both camps. - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/hybrid-developer-future-industry-trends - -作者:[Tim Hildred][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://thenextweb.com/readme/2020/01/15/how-developers-will-work-in-2020/ -[3]: https://www.itproportal.com/features/2020-forecast-cloud-y-with-a-chance-of-hybrid/ -[4]: https://www.alexhudson.com/2020/01/13/the-no-code-delusion/ -[5]: https://appdevelopermagazine.com/all-things-java/ -[6]: https://appdevelopermagazine.com/top-10-developer-technologies-in-2019/ diff --git a/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md deleted file mode 100644 index 923d4618a9..0000000000 --- a/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md +++ /dev/null @@ -1,221 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Ultimate Guide to JavaScript Fatigue: Realities of our industry) -[#]: via: (https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html) -[#]: author: (Lucas Fernandes Da Costa https://lucasfcosta.com) - -The Ultimate Guide to JavaScript Fatigue: Realities of our industry -====== - -**Complaining about JS Fatigue is just like complaining about the fact that humanity has created too many tools to solve the problems we have** , from email to airplanes and spaceships. - -Last week I’ve done a talk about this very same subject at the NebraskaJS 2017 Conference and I got so many positive feedbacks that I just thought this talk should also become a blog post in order to reach more people and help them deal with JS Fatigue and understand the realities of our industry. **My goal with this post is to change the way you think about software engineering in general and help you in any areas you might work on**. - -One of the things that has inspired me to write this blog post and that totally changed my life is [this great post by Patrick McKenzie, called “Don’t Call Yourself a Programmer and other Career Advice”][1]. **I highly recommend you read that**. Most of this blog post is advice based on what Patrick has written in that post applied to the JavaScript ecosystem and with a few more thoughts I’ve developed during these last years working in the tech industry. - -This first section is gonna be a bit philosophical, but I swear it will be worth reading. - -### Realities of Our Industry 101 - -Just like Patrick has done in [his post][1], let’s start with the most basic and essential truth about our industry: - -Software solves business problems - -This is it. **Software does not exist to please us as programmers** and let us write beautiful code. Neither it exists to create jobs for people in the tech industry. **Actually, it exists to kill as many jobs as possible, including ours** , and this is why basic income will become much more important in the next few years, but that’s a whole other subject. - -I’m sorry to say that, but the reason things are that way is that there are only two things that matter in the software engineering (and any other industries): - -**Cost versus Revenue** - -**The more you decrease cost and increase revenue, the more valuable you are** , and one of the most common ways of decreasing cost and increasing revenue is replacing human beings by machines, which are more effective and usually cost less in the long run. - -You are not paid to write code - -**Technology is not a goal.** Nobody cares about which programming language you are using, nobody cares about which frameworks your team has chosen, nobody cares about how elegant your data structures are and nobody cares about how good is your code. **The only thing that somebody cares about is how much does your software cost and how much revenue it generates**. - -Writing beautiful code does not matter to your clients. We write beautiful code because it makes us more productive in the long run and this decreases cost and increases revenue. - -The whole reason why we try not to write bugs is not that we value correctness, but that **our clients** value correctness. If you have ever seen a bug becoming a feature you know what I’m talking about. That bug exists but it should not be fixed. That happens because our goal is not to fix bugs, our goal is to generate revenue. If our bugs make clients happy then they increase revenue and therefore we are accomplishing our goals. - -Reusable space rockets, self-driving cars, robots, artificial intelligence: these things do not exist just because someone thought it would be cool to create them. They exist because there are business interests behind them. And I’m not saying the people behind them just want money, I’m sure they think that stuff is also cool, but the truth is that if they were not economically viable or had any potential to become so, they would not exist. - -Probably I should not even call this section “Realities of Our Industry 101”, maybe I should just call it “Realities of Capitalism 101”. - -And given that our only goal is to increase revenue and decrease cost, I think we as programmers should be paying more attention to requirements and design and start thinking with our minds and participating more actively in business decisions, which is why it is extremely important to know the problem domain we are working on. How many times before have you found yourself trying to think about what should happen in certain edge cases that have not been thought before by your managers or business people? - -In 1975, Boehm has done a research in which he found out that about 64% of all errors in the software he was studying were caused by design, while only 36% of all errors were coding errors. Another study called [“Higher Order Software—A Methodology for Defining Software”][2] also states that **in the NASA Apollo project, about 73% of all errors were design errors**. - -The whole reason why Design and Requirements exist is that they define what problems we’re going to solve and solving problems is what generates revenue. - -> Without requirements or design, programming is the art of adding bugs to an empty text file. -> -> * Louis Srygley -> - - -This same principle also applies to the tools we’ve got available in the JavaScript ecosystem. Babel, webpack, react, Redux, Mocha, Chai, Typescript, all of them exist to solve a problem and we gotta understand which problem they are trying to solve, we need to think carefully about when most of them are needed, otherwise, we will end up having JS Fatigue because: - -JS Fatigue happens when people use tools they don't need to solve problems they don't have. - -As Donald Knuth once said: “Premature optimization is the root of all evil”. Remember that software only exists to solve business problems and most software out there is just boring, it does not have any high scalability or high-performance constraints. Focus on solving business problems, focus on decreasing cost and generating revenue because this is all that matters. Optimize when you need, otherwise you will probably be adding unnecessary complexity to your software, which increases cost, and not generating enough revenue to justify that. - -This is why I think we should apply [Test Driven Development][3] principles to everything we do in our job. And by saying this I’m not just talking about testing. **I’m talking about waiting for problems to appear before solving them. This is what TDD is all about**. As Kent Beck himself says: “TDD reduces fear” because it guides your steps and allows you take small steps towards solving your problems. One problem at a time. By doing the same thing when it comes to deciding when to adopt new technologies then we will also reduce fear. - -Solving one problem at a time also decreases [Analysis Paralysis][4], which is basically what happens when you open Netflix and spend three hours concerned about making the optimal choice instead of actually watching something. By solving one problem at a time we reduce the scope of our decisions and by reducing the scope of our decisions we have fewer choices to make and by having fewer choices to make we decrease Analysis Paralysis. - -Have you ever thought about how easier it was to decide what you were going to watch when there were only a few TV channels available? Or how easier it was to decide which game you were going to play when you had only a few cartridges at home? - -### But what about JavaScript? - -By the time I’m writing this post NPM has 489,989 packages and tomorrow approximately 515 new ones are going to be published. - -And the packages we use and complain about have a history behind them we must comprehend in order to understand why we need them. **They are all trying to solve problems.** - -Babel, Dart, CoffeeScript and other transpilers come from our necessity of writing code other than JavaScript but making it runnable in our browsers. Babel even lets us write new generation JavaScript and make sure it will work even on older browsers, which has always been a great problem given the inconsistencies and different amount of compliance to the ECMA Specification between browsers. Even though the ECMA spec is becoming more and more solid these days, we still need Babel. And if you want to read more about Babel’s history I highly recommend that you read [this excellent post by Henry Zhu][5]. - -Module bundlers such as Webpack and Browserify also have their reason to exist. If you remember well, not so long ago we used to suffer a lot with lots of `script` tags and making them work together. They used to pollute the global namespace and it was reasonably hard to make them work together when one depended on the other. In order to solve this [`Require.js`][6] was created, but it still had its problems, it was not that straightforward and its syntax also made it prone to other problems, as you can see [in this blog post][7]. Then Node.js came with `CommonJS` imports, which were synchronous, simple and clean, but we still needed a way to make that work on our browsers and this is why we needed Webpack and Browserify. - -And Webpack itself actually solves more problems than that by allowing us to deal with CSS, images and many other resources as if they were JavaScript dependencies. - -Front-end frameworks are a bit more complicated, but the reason why they exist is to reduce the cognitive load when we write code so that we don’t need to worry about manipulating the DOM ourselves or even dealing with messy browser APIs (another problem JQuery came to solve), which is not only error prone but also not productive. - -This is what we have been doing this whole time in computer science. We use low-level abstractions and build even more abstractions on top of it. The more we worry about describing how our software should work instead of making it work, the more productive we are. - -But all those tools have something in common: **they exist because the web platform moves too fast**. Nowadays we’re using web technology everywhere: in web browsers, in desktop applications, in phone applications or even in watch applications. - -This evolution also creates problems we need to solve. PWAs, for example, do not exist only because they’re cool and we programmers have fun writing them. Remember the first section of this post: **PWAs exist because they create business value**. - -And usually standards are not fast enough to be created and therefore we need to create our own solutions to these things, which is why it is great to have such a vibrant and creative community with us. We’re solving problems all the time and **we are allowing natural selection to do its job**. - -The tools that suit us better thrive, get more contributors and develop themselves more quickly and sometimes other tools end up incorporating the good ideas from the ones that thrive and becoming even more popular than them. This is how we evolve. - -By having more tools we also have more choices. If you remember the UNIX philosophy well, it states that we should aim at creating programs that do one thing and do it well. - -We can clearly see this happening in the JS testing environment, for example, where we have Mocha for running tests and Chai for doing assertions, while in Java JUnit tries to do all these things. This means that if we have a problem with one of them or if we find another one that suits us better, we can simply replace that small part and still have the advantages of the other ones. - -The UNIX philosophy also states that we should write programs that work together. And this is exactly what we are doing! Take a look at Babel, Webpack and React, for example. They work very well together but we still do not need one to use the other. In the testing environment, for example, if we’re using Mocha and Chai all of a sudden we can just install Karma and run those same tests in multiple environments. - -### How to Deal With It - -My first advice for anyone suffering from JS Fatigue would definitely be to stay aware that **you don’t need to know everything**. Trying to learn it all at once, even when we don’t have to do so, only increases the feeling of fatigue. Go deep in areas that you love and for which you feel an inner motivation to study and adopt a lazy approach when it comes to the other ones. I’m not saying that you should be lazy, I’m just saying that you can learn those only when needed. Whenever you face a problem that requires you to use a certain technology to solve it, go learn. - -Another important thing to say is that **you should start from the beginning**. Make sure you have learned enough about JavaScript itself before using any JavaScript frameworks. This is the only way you will be able to understand them and bend them to your will, otherwise, whenever you face an error you have never seen before you won’t know which steps to take in order to solve it. Learning core web technologies such as CSS, HTML5, JavaScript and also computer science fundamentals or even how the HTTP protocol works will help you master any other technologies a lot more quickly. - -But please, don’t get too attached to that. Sometimes you gotta risk yourself and start doing things on your own. As Sacha Greif has written in [this blog post][8], spending too much time learning the fundamentals is just like trying to learn how to swim by studying fluid dynamics. Sometimes you just gotta jump into the pool and try to swim by yourself. - -And please, don’t get too attached to a single technology. All of the things we have available nowadays have already been invented in the past. Of course, they have different features and a brand new name, but, in their essence, they are all the same. - -If you look at NPM, it is nothing new, we already had Maven Central and Ruby Gems quite a long time ago. - -In order to transpile your code, Babel applies the very same principles and theory as some of the oldest and most well-known compilers, such as the GCC. - -Even JSX is not a new idea. It E4X (ECMAScript for XML) already existed more than 10 years ago. - -Now you might ask: “what about Gulp, Grunt and NPM Scripts?” Well, I’m sorry but we can solve all those problems with GNU Make in 1976. And actually, there are a reasonable number of JavaScript projects that still use it, such as Chai.js, for example. But we do not do that because we are hipsters that like vintage stuff. We use `make` because it solves our problems, and this is what you should aim at doing, as we’ve talked before. - -If you really want to understand a certain technology and be able to solve any problems you might face, please, dig deep. One of the most decisive factors to success is curiosity, so **dig deep into the technologies you like**. Try to understand them from bottom-up and whenever you think something is just “magic”, debunk that myth by exploring the codebase by yourself. - -In my opinion, there is no better quote than this one by Richard Feinman, when it comes to really learning something: - -> What I cannot create, I do not understand - -And just below this phrase, [in the same blackboard, Richard also wrote][9]: - -> Know how to solve every problem that has been solved - -Isn’t this just amazing? - -When Richard said that, he was talking about being able to take any theoretical result and re-derive it, but I think the exact same principle can be applied to software engineering. The tools that solve our problems have already been invented, they already exist, so we should be able to get to them all by ourselves. - -This is the very reason I love [some of the videos available in Egghead.io][10] in which Dan Abramov explains how to implement certain features that exist in Redux from scratch or [blog posts that teach you how to build your own JSX renderer][11]. - -So why not trying to implement these things by yourself or going to GitHub and reading their codebase in order to understand how they work? I’m sure you will find a lot of useful knowledge out there. Comments and tutorials might lie and be incorrect sometimes, the code cannot. - -Another thing that we have been talking a lot in this post is that **you should not get ahead of yourself**. Follow a TDD approach and solve one problem at a time. You are paid to increase revenue and decrease cost and you do this by solving problems, this is the reason why software exists. - -And since we love comparing our role to the ones related to civil engineering, let’s do a quick comparison between software development and civil engineering, just as [Sam Newman does in his brilliant book called “Building Microservices”][12]. - -We love calling ourselves “engineers” or “architects”, but is that term really correct? We have been developing software for what we know as computers less than a hundred years ago, while the Colosseum, for example, exists for about two thousand years. - -When was the last time you’ve seen a bridge falling and when was the last time your telephone or your browser crashed? - -In order to explain this, I’ll use an example I love. - -This is the beautiful and awesome city of Barcelona: - -![The City of Barcelona][13] - -When we look at it this way and from this distance, it just looks like any other city in the world, but when we look at it from above, this is how Barcelona looks: - -![Barcelona from above][14] - -As you can see, every block has the same size and all of them are very organized. If you’ve ever been to Barcelona you will also know how good it is to move through the city and how well it works. - -But the people that planned Barcelona could not predict what it was going to look like in the next two or three hundred years. In cities, people come in and people move through it all the time so what they had to do was make it grow organically and adapt as the time goes by. They had to be prepared for changes. - -This very same thing happens to our software. It evolves quickly, refactors are often needed and requirements change more frequently than we would like them to. - -So, instead of acting like a Software Engineer, act as a Town Planner. Let your software grow organically and adapt as needed. Solve problems as they come by but make sure everything still has its place. - -Doing this when it comes to software is even easier than doing this in cities due to the fact that **software is flexible, civil engineering is not**. **In the software world, our build time is compile time**. In Barcelona we cannot simply destroy buildings to give space to new ones, in Software we can do that a lot easier. We can break things all the time, we can make experiments because we can build as many times as we want and it usually takes seconds and we spend a lot more time thinking than building. Our job is purely intellectual. - -So **act like a town planner, let your software grow and adapt as needed**. - -By doing this you will also have better abstractions and know when it’s the right time to adopt them. - -As Sam Koblenski says: - -> Abstractions only work well in the right context, and the right context develops as the system develops. - -Nowadays something I see very often is people looking for boilerplates when they’re trying to learn a new technology, but, in my opinion, **you should avoid boilerplates when you’re starting out**. Of course boilerplates and generators are useful if you are already experienced, but they take a lot of control out of your hands and therefore you won’t learn how to set up a project and you won’t understand exactly where each piece of the software you are using fits. - -When you feel like you are struggling more than necessary to get something simple done, it might be the right time for you to look for an easier way to do this. In our role **you should strive to be lazy** , you should work to not work. By doing that you have more free time to do other things and this decreases cost and increases revenue, so that’s another way of accomplishing your goal. You should not only work harder, you should work smarter. - -Probably someone has already had the same problem as you’re having right now, but if nobody did it might be your time to shine and build your own solution and help other people. - -But sometimes you will not be able to realize you could be more effective in your tasks until you see someone doing them better. This is why it is so important to **talk to people**. - -By talking to people you share experiences that help each other’s careers and we discover new tools to improve our workflow and, even more important than that, learn how they solve their problems. This is why I like reading blog posts in which companies explain how they solve their problems. - -Especially in our area we like to think that Google and StackOverflow can answer all our questions, but we still need to know which questions to ask. I’m sure you have already had a problem you could not find a solution for because you didn’t know exactly what was happening and therefore didn’t know what was the right question to ask. - -But if I needed to sum this whole post in a single advice, it would be: - -Solve problems. - -Software is not a magic box, software is not poetry (unfortunately). It exists to solve problems and improves peoples’ lives. Software exists to push the world forward. - -**Now it’s your time to go out there and solve problems**. - - --------------------------------------------------------------------------------- - -via: https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html - -作者:[Lucas Fernandes Da Costa][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://lucasfcosta.com -[b]: https://github.com/lujun9972 -[1]: http://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/ -[2]: http://ieeexplore.ieee.org/document/1702333/ -[3]: https://en.wikipedia.org/wiki/Test_Driven_Development -[4]: https://en.wikipedia.org/wiki/Analysis_paralysis -[5]: https://babeljs.io/blog/2016/12/07/the-state-of-babel -[6]: http://requirejs.org -[7]: https://benmccormick.org/2015/05/28/moving-past-requirejs/ -[8]: https://medium.freecodecamp.org/a-study-plan-to-cure-javascript-fatigue-8ad3a54f2eb1 -[9]: https://www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand -[10]: https://egghead.io/lessons/javascript-redux-implementing-store-from-scratch -[11]: https://jasonformat.com/wtf-is-jsx/ -[12]: https://www.barnesandnoble.com/p/building-microservices-sam-newman/1119741399/2677517060476?st=PLA&sid=BNB_DRS_Marketplace+Shopping+Books_00000000&2sid=Google_&sourceId=PLGoP4760&k_clickid=3x4760 -[13]: /assets/barcelona-city.jpeg -[14]: /assets/barcelona-above.jpeg -[15]: https://twitter.com/thewizardlucas diff --git a/sources/talk/20171030 Why I love technical debt.md b/sources/talk/20171030 Why I love technical debt.md deleted file mode 100644 index da071d370a..0000000000 --- a/sources/talk/20171030 Why I love technical debt.md +++ /dev/null @@ -1,69 +0,0 @@ -Why I love technical debt -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_lovemoneyglory1.png?itok=nbSRovsj) -This is not necessarily the title you'd expect for an article, I guess,* but I'm a fan of [technical debt][1]. There are two reasons for this: a Bad Reason and a Good Reason. I'll be upfront about the Bad Reason first, then explain why even that isn't really a reason to love it. I'll then tackle the Good Reason, and you'll nod along in agreement. - -### The Bad Reason I love technical debt - -We'll get this out of the way, then, shall we? The Bad Reason is that, well, there's just lots of it, it's interesting, it keeps me in a job, and it always provides a reason, as a security architect, for me to get involved in** projects that might give me something new to look at. I suppose those aren't all bad things. It can also be a bit depressing, because there's always so much of it, it's not always interesting, and sometimes I need to get involved even when I might have better things to do. - -And what's worse is that it almost always seems to be security-related, and it's always there. That's the bad part. - -Security, we all know, is the piece that so often gets left out, or tacked on at the end, or done in half the time it deserves, or done by people who have half an idea, but don't quite fully grasp it. I should be clear at this point: I'm not saying that this last reason is those people's fault. That people know they need security is fantastic. If we (the security folks) or we (the organization) haven't done a good enough job in making sufficient security resources--whether people, training, or visibility--available to those people who need it, the fact that they're trying is great and something we can work on. Let's call that a positive. Or at least a reason for hope.*** - -### The Good Reason I love technical debt - -Let's get on to the other reason: the legitimate reason. I love technical debt when it's named. - -What does that mean? - -We all get that technical debt is a bad thing. It's what happens when you make decisions for pragmatic reasons that are likely to come back and bite you later in a project's lifecycle. Here are a few classic examples that relate to security: - - * Not getting around to applying authentication or authorization controls on APIs that might, at some point, be public. - * Lumping capabilities together so it's difficult to separate out appropriate roles later on. - * Hard-coding roles in ways that don't allow for customisation by people who may use your application in different ways from those you initially considered. - * Hard-coding cipher suites for cryptographic protocols, rather than putting them in a config file where they can be changed or selected later. - - - -There are lots more, of course, but those are just a few that jump out at me and that I've seen over the years. Technical debt means making decisions that will mean more work later on to fix them. And that can't be good, can it? - -There are two words in the preceding paragraphs that should make us happy: they are "decisions" and "pragmatic." Because, in order for something to be named technical debt, I'd argue, it has to have been subject to conscious decision-making, and trade-offs must have been made--hopefully for rational reasons. Those reasons may be many and various--lack of qualified resources; project deadlines; lack of sufficient requirement definition--but if they've been made consciously, then the technical debt can be named, and if technical debt can be named, it can be documented. - -And if it's documented, we're halfway there. As a security guy, I know that I can't force everything that goes out of the door to meet all the requirements I'd like--but the same goes for the high availability gal, the UX team, the performance folks, etc. - -What we need--what we all need--is for documentation to exist about why decisions were made, because when we return to the problem we'll know it was thought about. And, what's more, the recording of that information might even make it into product documentation. "This API is designed to be used in a protected environment and should not be exposed on the public Internet" is a great piece of documentation. It may not be what a customer is looking for, but at least they know how to deploy the product, and, crucially, it's an opportunity for them to come back to the product manager and say, "We'd really like to deploy that particular API in this way. Could you please add this as a feature request?" Product managers like that. Very much.**** - -The best thing, though, is not just that named technical debt is visible technical debt, but that if you encourage your developers to document the decisions in code,***** then there's a decent chance that they'll record some ideas about how this should be done in the future. If you're really lucky, they might even add some hooks in the code to make it easier (an "auth" parameter on the API, which is unused in the current version, but will make API compatibility so much simpler in new releases; or cipher entry in the config file that currently only accepts one option, but is at least checked by the code). - -I've been a bit disingenuous, I know, by defining technical debt as named technical debt. But honestly, if it's not named, then you can't know what it is, and until you know what it is, you can't fix it.******* My advice is this: when you're doing a release close-down (or in your weekly standup--EVERY weekly standup), have an agenda item to record technical debt. Name it, document it, be proud, sleep at night. - -* Well, apart from the obvious clickbait reason--for which I'm (a little) sorry. - -** I nearly wrote "poke my nose into." - -*** Work with me here. - -**** If you're software engineer/coder/hacker, here's a piece of advice: Learn to talk to product managers like real people, and treat them nicely. They (the better ones, at least) are invaluable allies when you need to prioritize features or have tricky trade-offs to make. - -***** Do this. Just do it. Documentation that isn't at least mirrored in code isn't real documentation.****** - -****** Don't believe me? Talk to developers. "Who reads product documentation?" "Oh, the spec? I skimmed it. A few releases back. I think." "I looked in the header file; couldn't see it there." - -******* Or decide not to fix it, which may also be an entirely appropriate decision. - -This article originally appeared on [Alice, Eve, and Bob - a security blog][2] and is republished with permission. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/10/why-i-love-technical-debt - -作者:[Mike Bursell][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/mikecamel -[1]:https://en.wikipedia.org/wiki/Technical_debt -[2]:https://aliceevebob.wordpress.com/2017/08/29/why-i-love-technical-debt/ diff --git a/sources/talk/20171107 How to Monetize an Open Source Project.md b/sources/talk/20171107 How to Monetize an Open Source Project.md deleted file mode 100644 index ab51006101..0000000000 --- a/sources/talk/20171107 How to Monetize an Open Source Project.md +++ /dev/null @@ -1,86 +0,0 @@ -How to Monetize an Open Source Project -====== - -![](http://www.itprotoday.com/sites/itprotoday.com/files/styles/article_featured_standard/public/ThinkstockPhotos-629994230_0.jpg?itok=5dZ68OTn) -The problem for any small group of developers putting the finishing touches on a commercial open source application is figuring out how to monetize the software in order to keep the bills paid and food on the table. Often these small pre-startups will start by deciding which of the recognized open source business models they're going to adapt, whether that be following Red Hat's lead and offering professional services, going the SaaS route, releasing as open core or something else. - -Steven Grandchamp, general manager for MariaDB's North America operations and CEO for Denver-based startup [Drud Tech][1], thinks that might be putting the cart before the horse. With an open source project, the best first move is to get people downloading and using your product for free. - -**Related:** [Demand for Open Source Skills Continues to Grow][2] - -"The number one tangent to monetization in any open source product is adoption, because the key to monetizing an open source product is you flip what I would call the sales funnel upside down," he told ITPro at the recent All Things Open conference in Raleigh, North Carolina. - -In many ways, he said, selling open source solutions is the opposite of marketing traditional proprietary products, where adoption doesn't happen until after a contract is signed. - -**Related:** [Is Raleigh the East Coast's Silicon Valley?][3] - -"In a proprietary software company, you advertise, you market, you make claims about what the product can do, and then you have sales people talk to customers. Maybe you have a free trial or whatever. Maybe you have a small version. Maybe it's time bombed or something like that, but you don't really get to realize the benefit of the product until there's a contract and money changes hands." - -Selling open source solutions is different because of the challenge of selling software that's freely available as a GitHub download. - -"The whole idea is to put the product out there, let people use it, experiment with it, and jump on the chat channels," he said, pointing out that his company Drud has a public chat channel that's open to anybody using their product. "A subset of that group is going to raise their hand and go, 'Hey, we need more help. We'd like a tighter relationship with the company. We'd like to know where your road map's going. We'd like to know about customization. We'd like to know if maybe this thing might be on your road map.'" - -Grandchamp knows more than a little about making software pay, from both the proprietary and open source sides of the fence. In the 1980s he served as VP of research and development at Formation Technologies, and became SVP of R&D at John H. Harland after it acquired Formation in the mid-90s. He joined MariaDB in 2016, after serving eight years as CEO at OpenLogic, which was providing commercial support for more than 600 open-source projects at the time it was acquired by Rogue Wave Software. Along the way, there was a two year stint at Microsoft's Redmond campus. - -OpenLogic was where he discovered open source, and his experiences there are key to his approach for monetizing open source projects. - -"When I got to OpenLogic, I was told that we had 300 customers that were each paying $99 a year for access to our tool," he explained. "But the problem was that nobody was renewing the tool. So I called every single customer that I could find and said 'did you like the tool?'" - -It turned out that nearly everyone he talked to was extremely happy with the company's software, which ironically was the reason they weren't renewing. The company's tool solved their problem so well there was no need to renew. - -"What could we have offered that would have made you renew the tool?" he asked. "They said, 'If you had supported all of the open source products that your tool assembled for me, then I would have that ongoing relationship with you.'" - -Grandchamp immediately grasped the situation, and when the CTO said such support would be impossible, Grandchamp didn't mince words: "Then we don't have a company." - -"We figured out a way to support it," he said. "We created something called the Open Logic Expert Community. We developed relationships with committers and contributors to a couple of hundred open source packages, and we acted as sort of the hub of the SLA for our customers. We had some people on staff, too, who knew the big projects." - -After that successful launch, Grandchamp and his team began hearing from customers that they were confused over exactly what open source code they were using in their projects. That lead to the development of what he says was the first software-as-a-service compliance portal of open source, which could scan an application's code and produce a list of all of the open source code included in the project. When customers then expressed confusion over compliance issues, the SaaS service was expanded to flag potential licensing conflicts. - -Although the product lines were completely different, the same approach was used to monetize MariaDB, then called SkySQL, after MySQL co-founders Michael "Monty" Widenius, David Axmark, and Allan Larsson created the project by forking MySQL, which Oracle had acquired from Sun Microsystems in 2010. - -Again, users were approached and asked what things they would be willing to purchase. - -"They wanted different functionality in the database, and you didn't really understand this if you didn't talk to your customers," Grandchamp explained. "Monty and his team, while they were being acquired at Sun and Oracle, were working on all kinds of new functionality, around cloud deployments, around different ways to do clustering, they were working on lots of different things. That work, Oracle and MySQL didn't really pick up." - -Rolling in the new features customers wanted needed to be handled gingerly, because it was important to the folks at MariaDB to not break compatibility with MySQL. This necessitated a strategy around when the code bases would come together and when they would separate. "That road map, knowledge, influence and technical information was worth paying for." - -As with OpenLogic, MariaDB customers expressed a willingness to spend money on a variety of fronts. For example, a big driver in the early days was a project called Remote DBA, which helped customers make up for a shortage of qualified database administrators. The project could help with design issues, as well as monitor existing systems to take the workload off of a customer's DBA team. The service also offered access to MariaDB's own DBAs, many of whom had a history with the database going back to the early days of MySQL. - -"That was a subscription offering that people were definitely willing to pay for," he said. - -The company also learned, again by asking and listening to customers, that there were various types of support subscriptions that customers were willing to purchase, including subscriptions around capability and functionality, and a managed service component of Remote DBA. - -These days Grandchamp is putting much of his focus on his latest project, Drud, a startup that offers a suite of integrated, automated, open source development tools for developing and managing multiple websites, which can be running on any combination of content management systems and deployment platforms. It is monetized partially through modules that add features like a centralized dashboard and an "intelligence engine." - -As you might imagine, he got it off the ground by talking to customers and giving them what they indicated they'd be willing to purchase. - -"Our number one customer target is the agency market," he said. "The enterprise market is a big target, but I believe it's our second target, not our first. And the reason it's number two is they don't make decisions very fast. There are technology refresh cycles that have to come up, there are lots of politics involved and lots of different vendors. It's lucrative once you're in, but in a startup you've got to figure out how to pay your bills. I want to pay my bills today. I don't want to pay them in three years." - -Drud's focus on the agency market illustrates another consideration: the importance of understanding something about your customers' business. When talking with agencies, many said they were tired of being offered generic software that really didn't match their needs from proprietary vendors that didn't understand their business. In Drud's case, that understanding is built into the company DNA. The software was developed by an agency to fill its own needs. - -"We are a platform designed by an agency for an agency," Grandchamp said. "Right there is a relationship that they're willing to pay for. We know their business." - -Grandchamp noted that startups also need to be able to distinguish users from customers. Most of the people downloading and using commercial open source software aren't the people who have authorization to make purchasing decisions. These users, however, can point to the people who control the purse strings. - -"It's our job to build a way to communicate with those users, provide them value so that they'll give us value," he explained. "It has to be an equal exchange. I give you value of a tool that works, some advice, really good documentation, access to experts who can sort of guide you along. Along the way I'm asking you for pieces of information. Who do you work for? How are the technology decisions happening in your company? Are there other people in your company that we should refer the product to? We have to create the dialog." - -In the end, Grandchamp said, in the open source world the people who go out to find business probably shouldn't see themselves as salespeople, but rather, as problem solvers. - -"I believe that you're not really going to need salespeople in this model. I think you're going to need customer success people. I think you're going to need people who can enable your customers to be successful in a business relationship that's more highly transactional." - -"People don't like to be sold," he added, "especially in open source. The last person they want to see is the sales person, but they like to ply and try and consume and give you input and give you feedback. They love that." - --------------------------------------------------------------------------------- - -via: http://www.itprotoday.com/software-development/how-monetize-open-source-project - -作者:[Christine Hall][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.itprotoday.com/author/christine-hall -[1]:https://www.drud.com/ -[2]:http://www.itprotoday.com/open-source/demand-open-source-skills-continues-grow -[3]:http://www.itprotoday.com/software-development/raleigh-east-coasts-silicon-valley diff --git a/sources/talk/20171114 Why pair writing helps improve documentation.md b/sources/talk/20171114 Why pair writing helps improve documentation.md deleted file mode 100644 index ff3bbb5888..0000000000 --- a/sources/talk/20171114 Why pair writing helps improve documentation.md +++ /dev/null @@ -1,87 +0,0 @@ -Why pair writing helps improve documentation -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead-2.png?itok=lPO6tqPd) - -Professional writers, at least in the Red Hat documentation team, nearly always work on docs alone. But have you tried writing as part of a pair? In this article, I'll explain a few benefits of pair writing. -### What is pair writing? - -Pair writing is when two writers work in real time, on the same piece of text, in the same room. This approach improves document quality, speeds up writing, and allows writers to learn from each other. The idea of pair writing is borrowed from [pair programming][1]. - -When pair writing, you and your colleague work on the text together, making suggestions and asking questions as needed. Meanwhile, you're observing each other's work. For example, while one is writing, the other writer observes details such as structure or context. Often discussion around the document turns into sharing experiences and opinions, and brainstorming about writing in general. - -At all times, the writing is done by only one person. Thus, you need only one computer, unless you want one writer to do online research while the other person does the writing. The text workflow is the same as if you are working alone: a text editor, the documentation source files, git, and so on. - -### Pair writing in practice - -My colleague Aneta Steflova and I have done more than 50 hours of pair writing working on the Red Hat Enterprise Linux System Administration docs and on the Red Hat Identity Management docs. I've found that, compared to writing alone, pair writing: - - * is as productive or more productive; - * improves document quality; - * helps writers share technical expertise; and - * is more fun. - - - -### Speed - -Two writers writing one text? Sounds half as productive, right? Wrong. (Usually.) - -Pair writing can help you work faster because two people have solutions to a bigger set of problems, which means getting blocked less often during the process. For example, one time we wrote urgent API docs for identity management. I know at least the basics of web APIs, the REST protocol, and so on, which helped us speed through those parts of the documentation. Working alone, Aneta would have needed to interrupt the writing process frequently to study these topics. - -### Quality - -Poor wording or sentence structure, inconsistencies in material, and so on have a harder time surviving under the scrutiny of four eyes. For example, one of our pair writing documents was reviewed by an extremely critical developer, who was known for catching technical inaccuracies and bad structure. After this particular review, he said, "Perfect. Thanks a lot." - -### Sharing expertise - -Each of us lives in our own writing bubble, and we normally don't know how others approach writing. Pair writing can help you improve your own writing process. For example, Aneta showed me how to better handle assignments in which the developer has provided starting text (as opposed to the writer writing from scratch using their own knowledge of the subject), which I didn't have experience with. Also, she structures the docs thoroughly, which I began doing as well. - -As another example, I'm good enough at Vim that XML editing (e.g., tags manipulation) is enjoyable instead of torturous. Aneta saw how I was using Vim, asked about it, suffered through the learning curve, and now takes advantage of the Vim features that help me. - -Pair writing is especially good for helping and mentoring new writers, and it's a great way to get to know professionally (and have fun with) colleagues. - -### When pair writing shines - -In addition to benefits I've already listed, pair writing is especially good for: - - * **Working with[Bugzilla][2]** : Bugzillas can be cumbersome and cause problems, especially for administration-clumsy people (like me). - * **Reviewing existing documents** : When documentation needs to be expanded or fixed, it is necessary to first examine the existing document. - * **Learning new technology** : A fellow writer can be a better teacher than an engineer. - * **Writing emails/requests for information to developers with well-chosen questions** : The difficulty of this task rises in proportion to the difficulty of technology you are documenting. - - - -Also, with pair writing, feedback is in real time, as-needed, and two-way. - -On the downside, pair writing can be a faster pace, giving a writer less time to mull over a topic or wording. On the other hand, generally peer review is not necessary after pair writing. - -### Words of caution - -To get the most out of pair writing: - - * Go into the project well prepared, otherwise you can waste your colleague's time. - * Talkative types need to stay focused on the task, otherwise they end up talking rather than writing. - * Be prepared for direct feedback. Pair writing is not for feedback-allergic writers. - * Beware of session hijackers. Dominant personalities can turn pair writing into writing solo with a spectator. (However, it _can _ be good if one person takes over at times, as long as the less-experienced partner learns from the hijacker, or the more-experienced writer is providing feedback to the hijacker.) - - - -### Conclusion - -Pair writing is a meeting, but one in which you actually get work done. It's an activity that lets writers focus on the one indispensable thing in our vocation--writing. - -_This post was written with the help of pair writing with Aneta Steflova._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/11/try-pair-writing - -作者:[Maxim Svistunov][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/maxim-svistunov -[1]:https://developer.atlassian.com/blog/2015/05/try-pair-programming/ -[2]:https://www.bugzilla.org/ diff --git a/sources/talk/20171115 Why and How to Set an Open Source Strategy.md b/sources/talk/20171115 Why and How to Set an Open Source Strategy.md deleted file mode 100644 index 79ec071b4d..0000000000 --- a/sources/talk/20171115 Why and How to Set an Open Source Strategy.md +++ /dev/null @@ -1,120 +0,0 @@ -Why and How to Set an Open Source Strategy -============================================================ - -![](https://www.linuxfoundation.org/wp-content/uploads/2017/11/open-source-strategy-1024x576.jpg) - -This article explains how to walk through, measure, and define strategies collaboratively in an open source community. - - _“If you don’t know where you are going, you’ll end up someplace else.” _ _—_  Yogi Berra - -Open source projects are generally started as a way to scratch one’s itch — and frankly that’s one of its greatest attributes. Getting code down provides a tangible method to express an idea, showcase a need, and solve a problem. It avoids over thinking and getting a project stuck in analysis-paralysis, letting the project pragmatically solve the problem at hand. - -Next, a project starts to scale up and gets many varied users and contributions, with plenty of opinions along the way. That leads to the next big challenge — how does a project start to build a strategic vision? In this article, I’ll describe how to walk through, measure, and define strategies collaboratively, in a community. - -Strategy may seem like a buzzword of the corporate world rather something that an open source community would embrace, so I suggest stripping away the negative actions that are sometimes associated with this word (e.g., staff reductions, discontinuations, office closures). Strategy done right isn’t a tool to justify unfortunate actions but to help show focus and where each community member can contribute. - -A good application of strategy achieves the following: - -* Why the project exists? - -* What the project looks to achieve? - -* What is the ideal end state for a project is. - -The key to success is answering these questions as simply as possible, with consensus from your community. Let’s look at some ways to do this. - -### Setting a mission and vision - - _“_ _Efforts and courage are not enough without purpose and direction.”_  — John F. Kennedy - -All strategic planning starts off with setting a course for where the project wants to go. The two tools used here are  _Mission_  and  _Vision_ . They are complementary terms, describing both the reason a project exists (mission) and the ideal end state for a project (vision). - -A great way to start this exercise with the intent of driving consensus is by asking each key community member the following questions: - -* What drove you to join and/or contribute the project? - -* How do you define success for your participation? - -In a company, you’d ask your customers these questions usually. But in open source projects, the customers are the project participants — and their time investment is what makes the project a success. - -Driving consensus means capturing the answers to these questions and looking for themes across them. At R Consortium, for example, I created a shared doc for the board to review each member’s answers to the above questions, and followed up with a meeting to review for specific themes that came from those insights. - -Building a mission flows really well from this exercise. The key thing is to keep the wording of your mission short and concise. Open Mainframe Project has done this really well. Here’s their mission: - - _Build community and adoption of Open Source on the mainframe by:_ - -* _Eliminating barriers to Open Source adoption on the mainframe_ - -* _Demonstrating value of the mainframe on technical and business levels_ - -* _Strengthening collaboration points and resources for the community to thrive_ - -At 40 words, it passes the key eye tests of a good mission statement; it’s clear, concise, and demonstrates the useful value the project aims for. - -The next stage is to reflect on the mission statement and ask yourself this question: What is the ideal outcome if the project accomplishes its mission? That can be a tough one to tackle. Open Mainframe Project put together its vision really well: - - _Linux on the Mainframe as the standard for enterprise class systems and applications._ - -You could read that as a [BHAG][1], but it’s really more of a vision, because it describes a future state that is what would be created by the mission being fully accomplished. It also hits the key pieces to an effective vision — it’s only 13 words, inspirational, clear, memorable, and concise. - -Mission and vision add clarity on the who, what, why, and how for your project. But, how do you set a course for getting there? - -### Goals, Objectives, Actions, and Results - - _“I don’t focus on what I’m up against. I focus on my goals and I try to ignore the rest.”_  — Venus Williams - -Looking at a mission and vision can get overwhelming, so breaking them down into smaller chunks can help the project determine how to get started. This also helps prioritize actions, either by importance or by opportunity. Most importantly, this step gives you guidance on what things to focus on for a period of time, and which to put off. - -There are lots of methods of time bound planning, but the method I think works the best for projects is what I’ve dubbed the GOAR method. It’s an acronym that stands for: - -* Goals define what the project is striving for and likely would align and support the mission. Examples might be “Grow a diverse contributor base” or “Become the leading project for X.” Goals are aspirational and set direction. - -* Objectives show how you measure a goal’s completion, and should be clear and measurable. You might also have multiple objectives to measure the completion of a goal. For example, the goal “Grow a diverse contributor base” might have objectives such as “Have X total contributors monthly” and “Have contributors representing Y different organizations.” - -* Actions are what the project plans to do to complete an objective. This is where you get tactical on exactly what needs done. For example, the objective “Have contributors representing Y different organizations” would like have actions of reaching out to interested organizations using the project, having existing contributors mentor new mentors, and providing incentives for first time contributors. - -* Results come along the way, showing progress both positive and negative from the actions. - -You can put these into a table like this: - -| Goals | Objectives | Actions | Results | -|:--|:--|:--|:--| -| Grow a diverse contributor base     | Have X total contributors monthly | Existing contributors mentor new mentors Providing incentives for first time contributors | | -| | Have contributors representing Y different organizations | Reach out to interested organizations using the project | | - - -In large organizations, monthly or quarterly goals and objectives often make sense; however, on open source projects, these time frames are unrealistic. Six- even 12-month tracking allows the project leadership to focus on driving efforts at a high level by nurturing the community along. - -The end result is a rubric that provides clear vision on where the project is going. It also lets community members more easily find ways to contribute. For example, your project may include someone who knows a few organizations using the project — this person could help introduce those developers to the codebase and guide them through their first commit. - -### What happens if the project doesn’t hit the goals? - - _“I have not failed. I’ve just found 10,000 ways that won’t work.”_  — Thomas A. Edison - -Figuring out what is within the capability of an organization — whether Fortune 500 or a small open source project — is hard. And, sometimes the expectations or market conditions change along the way. Does that make the strategy planning process a failure? Absolutely not! - -Instead, you can use this experience as a way to better understand your project’s velocity, its impact, and its community, and perhaps as a way to prioritize what is important and what’s not. - --------------------------------------------------------------------------------- - -via: https://www.linuxfoundation.org/blog/set-open-source-strategy/ - -作者:[ John Mertic][a] -译者:[译者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/author/jmertic/ -[1]:https://en.wikipedia.org/wiki/Big_Hairy_Audacious_Goal -[2]:https://www.linuxfoundation.org/author/jmertic/ -[3]:https://www.linuxfoundation.org/category/blog/ -[4]:https://www.linuxfoundation.org/category/audience/c-level/ -[5]:https://www.linuxfoundation.org/category/audience/developer-influencers/ -[6]:https://www.linuxfoundation.org/category/audience/entrepreneurs/ -[7]:https://www.linuxfoundation.org/category/campaigns/membership/how-to/ -[8]:https://www.linuxfoundation.org/category/campaigns/events-campaigns/linux-foundation/ -[9]:https://www.linuxfoundation.org/category/audience/open-source-developers/ -[10]:https://www.linuxfoundation.org/category/audience/open-source-professionals/ -[11]:https://www.linuxfoundation.org/category/audience/open-source-users/ -[12]:https://www.linuxfoundation.org/category/blog/thought-leadership/ diff --git a/sources/talk/20171116 Why is collaboration so difficult.md b/sources/talk/20171116 Why is collaboration so difficult.md deleted file mode 100644 index 6567b75dca..0000000000 --- a/sources/talk/20171116 Why is collaboration so difficult.md +++ /dev/null @@ -1,94 +0,0 @@ -Why is collaboration so difficult? -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_block_collaboration.png?itok=pKbXpr1e) - -Many contemporary definitions of "collaboration" define it simply as "working together"--and, in part, it is working together. But too often, we tend to use the term "collaboration" interchangeably with cognate terms like "cooperation" and "coordination." These terms also refer to some manner of "working together," yet there are subtle but important differences between them all. - -How does collaboration differ from coordination or cooperation? What is so important about collaboration specifically? Does it have or do something that coordination and cooperation don't? The short answer is a resounding "yes!" - -[This unit explores collaboration][1], a problematic term because it has become a simple buzzword for "working together." By the time you've studied the cases and practiced the exercises contained in this section, you will understand that it's so much more than that. - -### Not like the others - -"Coordination" can be defined as the ordering of a variety of people acting in an effective, unified manner toward an end goal or state - -In traditional organizations and businesses, people contributed according to their role definitions, such as in manufacturing, where each employee was responsible for adding specific components to the widget on an assembly line until the widget was complete. In contexts like these, employees weren't expected to contribute beyond their pre-defined roles (they were probably discouraged from doing so), and they didn't necessarily have a voice in the work or in what was being created. Often, a manager oversaw the unification of effort (hence the role "project coordinator"). Coordination is meant to connote a sense of harmony and unity, as if elements are meant to go together, resulting in efficiency among the ordering of the elements. - -One common assumption is that coordinated efforts are aimed at the same, single goal. So some end result is "successful" when people and parts work together seamlessly; when one of the parts breaks down and fails, then the whole goal fails. Many traditional businesses (for instance, those with command-and-control hierarchies) manage work through coordination. - -Cooperation is another term whose surface meaning is "working together." Rather than the sense of compliance that is part of "coordination," it carries a sense of agreement and helpfulness on the path toward completing a shared activity or goal. - -"Collaboration" also means "working together"--but that simple definition obscures the complex and often difficult process of collaborating. - -People tend to use the term "cooperation" when joining two semi-related entities where one or more entity could decide not to cooperate. The people and pieces that are part of a cooperative effort make the shared activity easier to perform or the shared goal easier to reach. "Cooperation" implies a shared goal or activity we agree to pursue jointly. One example is how police and witnesses cooperate to solve crimes. - -"Collaboration" also means "working together"--but that simple definition obscures the complex and often difficult process of collaborating. - -Sometimes collaboration involves two or more groups that do not normally work together; they are disparate groups or not usually connected. For instance, a traitor collaborates with the enemy, or rival businesses collaborate with each other. The subtlety of collaboration is that the two groups may have oppositional initial goals but work together to create a shared goal. Collaboration can be more contentious than coordination or cooperation, but like cooperation, any one of the entities could choose not to collaborate. Despite the contention and conflict, however, there is discourse--whether in the form of multi-way discussion or one-way feedback--because without discourse, there is no way for people to express a point of dissent that is ripe for negotiation. - -The success of any collaboration rests on how well the collaborators negotiate their needs to create the shared objective, and then how well they cooperate and coordinate their resources to execute a plan to reach their goals. - -### For example - -One way to think about these things is through a real-life example--like the writing of [this book][1]. - -The editor, [Bryan][2], coordinates the authors' work through the call for proposals, setting dates and deadlines, collecting the writing, and meeting editing dates and deadlines for feedback about our work. He coordinates the authors, the writing, the communications. In this example, I'm not coordinating anything except myself (still a challenge most days!). - -The success of any collaboration rests on how well the collaborators negotiate their needs to create the shared objective, and then how well they cooperate and coordinate their resources to execute a plan to reach their goals. - -I cooperate with Bryan's dates and deadlines, and with the ways he has decided to coordinate the work. I propose the introduction on GitHub; I wait for approval. I comply with instructions, write some stuff, and send it to him by the deadlines. He cooperates by accepting a variety of document formats. I get his edits,incorporate them, send it back him, and so forth. If I don't cooperate (or something comes up and I can't cooperate), then maybe someone else writes this introduction instead. - -Bryan and I collaborate when either one of us challenges something, including pieces of the work or process that aren't clear, things that we thought we agreed to, or things on which we have differing opinions. These intersections are ripe for negotiation and therefore indicative of collaboration. They are the opening for us to negotiate some creative work. - -Once the collaboration is negotiated and settled, writing and editing the book returns to cooperation/coordination; that is why collaboration relies on the other two terms of joint work. - -One of the most interesting parts of this example (and of work and shared activity in general) is the moment-by-moment pivot from any of these terms to the other. The writing of this book is not completely collaborative, coordinated, or cooperative. It's a messy mix of all three. - -### Why is collaboration important? - -Collaboration is an important facet of contemporary organizations--specifically those oriented toward knowledge work--because it allows for productive disagreement between actors. That kind of disagreement then helps increase the level of engagement and provide meaning to the group's work. - -In his book, The Age of Discontinuity: Guidelines to our Changing Society, [Peter Drucker discusses][3] the "knowledge worker" and the pivot from work based on experience (e.g. apprenticeships) to work based on knowledge and the application of knowledge. This change in work and workers, he writes: - -> ...will make the management of knowledge workers increasingly crucial to the performance and achievement of the knowledge society. We will have to learn to manage the knowledge worker both for productivity and for satisfaction, both for achievement and for status. We will have to learn to give the knowledge worker a job big enough to challenge him, and to permit performance as a "professional." - -In other words, knowledge workers aren't satisfied with being subordinate--told what to do by managers as, if there is one right way to do a task. And, unlike past workers, they expect more from their work lives, including some level of emotional fulfillment or meaning-making from their work. The knowledge worker, according to Drucker, is educated toward continual learning, "paid for applying his knowledge, exercising his judgment, and taking responsible leadership." So it then follows that knowledge workers expect from work the chance to apply and share their knowledge, develop themselves professionally, and continuously augment their knowledge. - -Interesting to note is the fact that Peter Drucker wrote about those concepts in 1969, nearly 50 years ago--virtually predicting the societal and organizational changes that would reveal themselves, in part, through the development of knowledge sharing tools such as forums, bulletin boards, online communities, and cloud knowledge sharing like DropBox and GoogleDrive as well as the creation of social media tools such as MySpace, Facebook, Twitter, YouTube and countless others. All of these have some basis in the idea that knowledge is something to liberate and share. - -In this light, one might view the open organization as one successful manifestation of a system of management for knowledge workers. In other words, open organizations are a way to manage knowledge workers by meeting the needs of the organization and knowledge workers (whether employees, customers, or the public) simultaneously. The foundational values this book explores are the scaffolding for the management of knowledge, and they apply to ways we can: - - * make sure there's a lot of varied knowledge around (inclusivity) - * help people come together and participate (community) - * circulate information, knowledge, and decision making (transparency) - * innovate and not become entrenched in old ways of thinking and being (adaptability) - * develop a shared goal and work together to use knowledge (collaboration) - - - -Collaboration is an important process because of the participatory effect it has on knowledge work and how it aids negotiations between people and groups. As we've discovered, collaboration is more than working together with some degree of compliance; in fact, it describes a type of working together that overcomes compliance because people can disagree, question, and express their needs in a negotiation and in collaboration. And, collaboration is more than "working toward a shared goal"; collaboration is a process which defines the shared goals via negotiation and, when successful, leads to cooperation and coordination to focus activity on the negotiated outcome. - -Collaboration is an important process because of the participatory effect it has on knowledge work and how it aids negotiations between people and groups. - -Collaboration works best when the other four open organization values are present. For instance, when people are transparent, there is no guessing about what is needed, why, by whom, or when. Also, because collaboration involves negotiation, it also needs diversity (a product of inclusivity); after all, if we aren't negotiating among differing views, needs, or goals, then what are we negotiating? During a negotiation, the parties are often asked to give something up so that all may gain, so we have to be adaptable and flexible to the different outcomes that negotiation can provide. Lastly, collaboration is often an ongoing process rather than one which is quickly done and over, so it's best to enter collaboration as if you are part of the same community, desiring everyone to benefit from the negotiation. In this way, acts of authentic and purposeful collaboration directly necessitate the emergence of the other four values--transparency, inclusivity, adaptability, and community--as they assemble part of the organization's collective purpose spontaneously. - -### Collaboration in open organizations - -Traditional organizations advance an agreed-upon set of goals that people are welcome to support or not. In these organizations, there is some amount of discourse and negotiation, but often a higher-ranking or more powerful member of the organization intervenes to make a decision, which the membership must accept (and sometimes ignores). In open organizations, however, the focus is for members to perform their activity and to work out their differences; only if necessary would someone get involved (and even then would try to do it in the most minimal way that support the shared values of community, transparency, adaptability, collaboration and inclusivity.) This make the collaborative processes in open organizations "messier" (or "chaotic" to use Jim Whitehurst's term) but more participatory and, hopefully, innovative. - -This article is part of the [Open Organization Workbook project][1]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/17/11/what-is-collaboration - -作者:[Heidi Hess Von Ludewig][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/heidi-hess-von-ludewig -[1]:https://opensource.com/open-organization/17/8/workbook-project-announcement -[2]:http://opensource.com/users/bbehrens -[3]:https://www.elsevier.com/books/the-age-of-discontinuity/drucker/978-0-434-90395-5 diff --git a/sources/talk/20171221 Changing how we use Slack solved our transparency and silo problems.md b/sources/talk/20171221 Changing how we use Slack solved our transparency and silo problems.md deleted file mode 100644 index d68bab55bf..0000000000 --- a/sources/talk/20171221 Changing how we use Slack solved our transparency and silo problems.md +++ /dev/null @@ -1,95 +0,0 @@ -Changing how we use Slack solved our transparency and silo problems -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_abstract_pieces.jpg?itok=tGR1d2MU) - -Collaboration and information silos are a reality in most organizations today. People tend to regard them as huge barriers to innovation and organizational efficiency. They're also a favorite target for solutions from software tool vendors of all types. - -Tools by themselves, however, are seldom (if ever), the answer to a problem like organizational silos. The reason for this is simple: Silos are made of people, and human dynamics are key drivers for the existence of silos in the first place. - -So what is the answer? - -Successful communities are the key to breaking down silos. Tools play an important role in the process, but if you don't build successful communities around those tools, then you'll face an uphill battle with limited chances for success. Tools enable communities; they do not build them. This takes a thoughtful approach--one that looks at culture first, process second, and tools last. - -Successful communities are the key to breaking down silos. - -However, this is a challenge because, in most cases, this is not the way the process works in most businesses. Too many companies begin their journey to fix silos by thinking about tools first and considering metrics that don't evaluate the right factors for success. Too often, people choose tools for purely cost-based, compliance-based, or effort-based reasons--instead of factoring in the needs and desires of the user base. But subjective measures like "customer/user delight" are a real factor for these internal tools, and can make or break the success of both the tool adoption and the goal of increased collaboration. - -It's critical to understand the best technical tool (or what the business may consider the most cost-effective) is not always the solution that drives community, transparency, and collaboration forward. There is a reason that "Shadow IT"--users choosing their own tool solution, building community and critical mass around them--exists and is so effective: People who choose their own tools are more likely to stay engaged and bring others with them, breaking down silos organically. - -This is a story of how Autodesk ended up adopting Slack at enterprise scale to help solve our transparency and silo problems. Interestingly, Slack wasn't (and isn't) an IT-supported application at Autodesk. It's an enterprise solution that was adopted, built, and is still run by a group of passionate volunteers who are committed to a "default to open" paradigm. - -Utilizing Slack makes transparency happen for us. - -### Chat-tastrophe - -First, some perspective: My job at Autodesk is running our [Open@ADSK][1] initiative. I was originally hired to drive our open source strategy, but we quickly expanded my role to include driving open source best practices for internal development (inner source), and transforming how we collaborate internally as an organization. This last piece is where we pick up our story of Slack adoption in the company. - -But before we even begin to talk about our journey with Slack, let's address why lack of transparency and openness was a challenge for us. What is it that makes transparency such a desirable quality in organizations, and what was I facing when I started at Autodesk? - -Every company says they want "better collaboration." In our case, we are a 35-year-old software company that has been immensely successful at selling desktop "shrink-wrapped" software to several industries, including architecture, engineering, construction, manufacturing, and entertainment. But no successful company rests on its laurels, and Autodesk leadership recognized that a move to Cloud-based solutions for our products was key to the future growth of the company, including opening up new markets through product combinations that required Cloud computing and deep product integrations. - -The challenge in making this move was far more than just technical or architectural--it was rooted in the DNA of the company, in everything from how we were organized to how we integrated our products. The basic format of integration in our desktop products was file import/export. While this is undoubtedly important, it led to a culture of highly-specialized teams working in an environment that's more siloed than we'd like and not sharing information (or code). Prior to the move to a cloud-based approach, this wasn't as a much of a problem--but, in an environment that requires organizations to behave more like open source projects do, transparency, openness, and collaboration go from "nice-to-have" to "business critical." - -Like many companies our size, Autodesk has had many different collaboration solutions through the years, some of them commercial, and many of them home-grown. However, none of them effectively solved the many-to-many real-time collaboration challenge. Some reasons for this were technical, but many of them were cultural. - -I relied on a philosophy I'd formed through challenging experiences in my career: "Culture first, tools last." - -When someone first tasked me with trying to find a solution for this, I relied on a philosophy I'd formed through challenging experiences in my career: "Culture first, tools last." This is still a challenge for engineering folks like myself. We want to jump immediately to tools as the solution to any problem. However, it's critical to evaluate a company's ethos (culture), as well as existing processes to determine what kinds of tools might be a good fit. Unfortunately, I've seen too many cases where leaders have dictated a tool choice from above, based on the factors discussed earlier. I needed a different approach that relied more on fitting a tool into the culture we wanted to become, not the other way around. - -What I found at Autodesk were several small camps of people using tools like HipChat, IRC, Microsoft Lync, and others, to try to meet their needs. However, the most interesting thing I found was 85 separate instances of Slack in the company! - -Eureka! I'd stumbled onto a viral success (one enabled by Slack's ability to easily spin up "free" instances). I'd also landed squarely in what I like to call "silo-land." - -All of those instances were not talking to each other--so, effectively, we'd created isolated islands of information that, while useful to those in them, couldn't transform the way we operated as an enterprise. Essentially, our existing organizational culture was recreated in digital format in these separate Slack systems. Our organization housed a mix of these small, free instances, as well as multiple paid instances, which also meant we were not taking advantage of a common billing arrangement. - -My first (open source) thought was: "Hey, why aren't we using IRC, or some other open source tool, for this?" I quickly realized that didn't matter, as our open source engineers weren't the only people using Slack. People from all areas of the company--even senior leadership--were adopting Slack in droves, and, in some cases, convincing their management to pay for it! - -My second (engineering) thought was: "Oh, this is simple. We just collapse all 85 of those instances into a single cohesive Slack instance." What soon became obvious was that was the easy part of the solution. Much harder was the work of cajoling, convincing, and moving people to a single, transparent instance. Building in the "guard rails" to enable a closed source tool to provide this transparency was key. These guard rails came in the form of processes, guidelines, and community norms that were the hardest part of this transformation. - -### The real work begins - -As I began to slowly help users migrate to the common instance (paying for it was also a challenge, but a topic for another day), I discovered a dedicated group of power users who were helping each other in the #adsk-slack-help channel on our new common instance of Slack. These power users were, in effect, building the roots of our transparency and community through their efforts. - -The open source community manager in me quickly realized these users were the path to successfully scaling Slack at Autodesk. I enlisted five of them to help me, and, together we set about fabricating the community structure for the tool's rollout. - -We did, however, learn an important lesson about transparency and company culture along the way. - -Here I should note the distinction between a community structure/governance model and traditional IT policies: With the exception of security and data privacy/legal policies, volunteer admins and user community members completely define and govern our Slack instance. One of the keys to our success with Slack (currently approximately 9,100 users and roughly 4,300 public channels) was how we engaged and involved our users in building these governance structures. Things like channel naming conventions and our growing list of frequently asked questions were organic and have continued in that same vein. Our community members feel like their voices are heard (even if some disagree), and that they have been a part of the success of our deployment of Slack. - -We did, however, learn an important lesson about transparency and company culture along the way. - -### It's not the tool - -When we first launched our main Slack instance, we left the ability for anyone to make a channel private turned on. After about three months of usage, we saw a clear trend: More people were creating private channels (and messages) than they were public channels (the ratio was about two to one, private versus public). Since our effort to merge 85 Slack instances was intended to increase participation and transparency, we quickly adjusted our policy and turned off this feature for regular users. We instead implemented a policy of review by the admin team, with clear criteria (finance, legal, personnel discussions among the reasons) defined for private channels. - -This was probably the only time in this entire process that I regretted something. - -We took an amazing amount of flak for this decision because we were dealing with a corporate culture that was used to working in independent units that had minimal interaction with each other. Our defining moment of clarity (and the tipping point where things started to get better) occurred in an all-hands meeting when one of our senior executives asked me to address a question about Slack. I stood up to answer the question, and said (paraphrased from memory): "It's not about the tool. I could give you all the best, gold-plated collaboration platform in existence, but we aren't going to be successful if we don't change our approach to collaboration and learn to default to open." - -I didn't think anything more about that statement--until that senior executive starting using the phrase "default to open" in his slide decks, in his staff meetings, and with everyone he met. That one moment has defined what we have been trying to do with Slack: The tool isn't the sole reason we've been successful; it's the approach that we've taken around building a self-sustaining community that not only wants to use this tool, but craves the ability it gives them to work easily across the enterprise. - -### What we learned - -The tool isn't the sole reason we've been successful; it's the approach that we've taken around building a self-sustaining community that not only wants to use this tool, but craves the ability it gives them to work easily across the enterprise. - -I say all the time that this could have happened with other, similar tools (Hipchat, IRC, etc), but it works in this case specifically because we chose an approach of supporting a solution that the user community adopted for their needs, not strictly what the company may have chosen if the decision was coming from the top of the organizational chart. We put a lot of work into making it an acceptable solution (from the perspectives of security, legal, finance, etc.) for the company, but, ultimately, our success has come from the fact that we built this rollout (and continue to run the tool) as a community, not as a traditional corporate IT system. - -The most important lesson I learned through all of this is that transparency and community are evolutionary, not revolutionary. You have to understand where your culture is, where you want it to go, and utilize the lever points that the community is adopting itself to make sustained and significant progress. There is a fine balance point between an anarchy, and a thriving community, and we've tried to model our approach on the successful practices of today's thriving open source communities. - -Communities are personal. Tools come and go, but keeping your community at the forefront of your push to transparency is the key to success. - -This article is part of the [Open Organization Workbook project][2]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/17/12/chat-platform-default-to-open - -作者:[Guy Martin][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/guyma -[1]:mailto:Open@ADSK -[2]:https://opensource.com/open-organization/17/8/workbook-project-announcement diff --git a/sources/talk/20180109 How Mycroft used WordPress and GitHub to improve its documentation.md b/sources/talk/20180109 How Mycroft used WordPress and GitHub to improve its documentation.md deleted file mode 100644 index 9e35e0ede7..0000000000 --- a/sources/talk/20180109 How Mycroft used WordPress and GitHub to improve its documentation.md +++ /dev/null @@ -1,116 +0,0 @@ -How Mycroft used WordPress and GitHub to improve its documentation -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead-2.png?itok=lPO6tqPd) - -Image credits : Photo by Unsplash; modified by Rikki Endsley. CC BY-SA 4.0 - -Imagine you've just joined a new technology company, and one of the first tasks you're assigned is to improve and centralize the organization's developer-facing documentation. There's just one catch: That documentation exists in many different places, across several platforms, and differs markedly in accuracy, currency, and style. - -So how did we tackle this challenge? - -### Understanding the scope - -As with any project, we first needed to understand the scope and bounds of the problem we were trying to solve. What documentation was good? What was working? What wasn't? How much documentation was there? What format was it in? We needed to do a **documentation audit**. Luckily, [Aneta Šteflova][1] had recently [published an article on OpenSource.com][2] about this, and it provided excellent guidance. - -![mycroft doc audit][4] - -Mycroft documentation audit, showing source, topic, medium, currency, quality and audience - -Next, every piece of publicly facing documentation was assessed for the topic it covered, the medium it used, currency, and quality. A pattern quickly emerged that different platforms had major deficiencies, allowing us to make a data-driven approach to decommission our existing Jekyll-based sites. The audit also highlighted just how fragmented our documentation sources were--we had developer-facing documentation across no fewer than seven sites. Although search engines were finding this content just fine, the fragmentation made it difficult for developers and users of Mycroft--our primary audiences--to navigate the information they needed. Again, this data helped us make the decision to centralize our documentation on to one platform. - -### Choosing a central platform - -As an organization, we wanted to constrain the number of standalone platforms in use. Over time, maintenance and upkeep of multiple platforms and integration touchpoints becomes cumbersome for any organization, but this is exacerbated for a small startup. - -One of the other business drivers in platform choice was that we had two primary but very different audiences. On one hand, we had highly technical developers who we were expecting would push documentation to its limits--and who would want to contribute to technical documentation using their tools of choice--[Git][5], [GitHub][6], and [Markdown][7]. Our second audience--end users--would primarily consume technical documentation and would want to do so in an inviting, welcoming platform that was visually appealing and provided additional features such as the ability to identify reading time and to provide feedback. The ability to capture feedback was also a key requirement from our side as without feedback on the quality of the documentation, we would not have a solid basis to undertake continuous quality improvement. - -Would we be able to identify one platform that met all of these competing needs? - -We realised that two platforms covered all of our needs: - - * [WordPress][8]: Our existing website is built on WordPress, and we have some reasonably robust WordPress skills in-house. The flexibility of WordPress also fulfilled our requirements for functionality like reading time and the ability to capture user feedback. - * [GitHub][9]: Almost [all of Mycroft.AI's source code is available on GitHub][10], and our development team uses this platform daily. - - - -But how could we marry the two? - - -![](https://opensource.com/sites/default/files/images/life-uploads/wordpress-github-sync.png) - -### Integrating WordPress and GitHub with WordPress GitHub Sync - -Luckily, our COO, [Nate Tomasi][11], spotted a WordPress plugin that promised to integrate the two. - -This was put through its paces on our test website, and it passed with flying colors. It was easy to install, had a straightforward configuration, which just required an OAuth token and webhook with GitHub, and provided two-way integration between WordPress and GitHub. - -It did, however, have a dependency--on Markdown--which proved a little harder to implement. We trialed several Markdown plugins, but each had several quirks that interfered with the rendering of non-Markdown-based content. After several days of frustration, and even an attempt to custom-write a plugin for our needs, we stumbled across [Parsedown Party][12]. There was much partying! With WordPress GitHub Sync and Parsedown Party, we had integrated our two key platforms. - -Now it was time to make our content visually appealing and usable for our user audience. - -### Reading time and feedback - -To implement the reading time and feedback functionality, we built a new [page template for WordPress][13], and leveraged plugins within the page template. - -Knowing the estimated reading time of an article in advance has been [proven to increase engagement with content][14] and provides developers and users with the ability to decide whether to read the content now or bookmark it for later. We tested several WordPress plugins for reading time, but settled on [Reading Time WP][15] because it was highly configurable and could be easily embedded into WordPress page templates. Our decision to place Reading Time at the top of the content was designed to give the user the choice of whether to read now or save for later. With Reading Time in place, we then turned our attention to gathering user feedback and ratings for our documentation. - -![](https://opensource.com/sites/default/files/images/life-uploads/screenshot-from-2017-12-08-00-55-31.png) - -There are several rating and feedback plugins available for WordPress. We needed one that could be easily customized for several use cases, and that could aggregate or summarize ratings. After some experimentation, we settled on [Multi Rating Pro][16] because of its wide feature set, especially the ability to create a Review Ratings page in WordPress--i.e., a central page where staff can review ratings without having to be logged in to the WordPress backend. The only gap we ran into here was the ability to set the display order of rating options--but it will likely be added in a future release. - -The WordPress GitHub Integration plugin also gave us the ability to link back to the GitHub repository where the original Markdown content was held, inviting technical developers to contribute to improving our documentation. - -### Updating the existing documentation - -Now that the "container" for our new documentation had been developed, it was time to update the existing content. Because much of our documentation had grown organically over time, there were no style guidelines to shape how keywords and code were styled. This was tackled first, so that it could be applied to all content. [You can see our content style guidelines on GitHub.][17] - -As part of the update, we also ran several checks to ensure that the content was technically accurate, augmenting the existing documentation with several images for better readability. - -There were also a couple of additional tools that made creating internal links for documentation pieces easier. First, we installed the [WP Anchor Header][18] plugin. This plugin provided a small but important function: adding `id` content in GitHub using the `[markdown-toc][19]` library, then simply copied in to the WordPress content, where they would automatically link to the `id` attributes to each `

`, `

` (and so on) element. This meant that internal anchors could be automatically generated on the command line from the Markdown content in GitHub using the `[markdown-toc][19]` library, then simply copied in to the WordPress content, where they would automatically link to the `id` attributes generated by WP Anchor Header. - -Next, we imported the updated documentation into WordPress from GitHub, and made sure we had meaningful and easy-to-search on slugs, descriptions, and keywords--because what good is excellent documentation if no one can find it?! A final activity was implementing redirects so that people hitting the old documentation would be taken to the new version. - -### What next? - -[Please do take a moment and have a read through our new documentation][20]. We know it isn't perfect--far from it--but we're confident that the mechanisms we've baked into our new documentation infrastructure will make it easier to identify gaps--and resolve them quickly. If you'd like to know more, or have suggestions for our documentation, please reach out to Kathy Reid on [Chat][21] (@kathy-mycroft) or via [email][22]. - -_Reprinted with permission from[Mycroft.ai][23]._ - -### About the author -Kathy Reid - Director of Developer Relations @MycroftAI, President of @linuxaustralia. Kathy Reid has expertise in open source technology management, web development, video conferencing, digital signage, technical communities and documentation. She has worked in a number of technical and leadership roles over the last 20 years, and holds Arts and Science undergraduate degrees... more about Kathy Reid - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/rocking-docs-mycroft - -作者:[Kathy Reid][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/kathyreid -[1]:https://opensource.com/users/aneta -[2]:https://opensource.com/article/17/10/doc-audits -[3]:/file/382466 -[4]:https://opensource.com/sites/default/files/images/life-uploads/mycroft-documentation-audit.png (mycroft documentation audit) -[5]:https://git-scm.com/ -[6]:https://github.com/MycroftAI -[7]:https://en.wikipedia.org/wiki/Markdown -[8]:https://www.wordpress.org/ -[9]:https://github.com/ -[10]:https://github.com/mycroftai -[11]:http://mycroft.ai/team/ -[12]:https://wordpress.org/plugins/parsedown-party/ -[13]:https://developer.wordpress.org/themes/template-files-section/page-template-files/ -[14]:https://marketingland.com/estimated-reading-times-increase-engagement-79830 -[15]:https://jasonyingling.me/reading-time-wp/ -[16]:https://multiratingpro.com/ -[17]:https://github.com/MycroftAI/docs-rewrite/blob/master/README.md -[18]:https://wordpress.org/plugins/wp-anchor-header/ -[19]:https://github.com/jonschlinkert/markdown-toc -[20]:https://mycroft.ai/documentation -[21]:https://chat.mycroft.ai/ -[22]:mailto:kathy.reid@mycroft.ai -[23]:https://mycroft.ai/blog/improving-mycrofts-documentation/ diff --git a/sources/talk/20180111 The open organization and inner sourcing movements can share knowledge.md b/sources/talk/20180111 The open organization and inner sourcing movements can share knowledge.md deleted file mode 100644 index 272c1b03ae..0000000000 --- a/sources/talk/20180111 The open organization and inner sourcing movements can share knowledge.md +++ /dev/null @@ -1,121 +0,0 @@ -The open organization and inner sourcing movements can share knowledge -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gov_collaborative_risk.png?itok=we8DKHuL) -Image by : opensource.com - -Red Hat is a company with roughly 11,000 employees. The IT department consists of roughly 500 members. Though it makes up just a fraction of the entire organization, the IT department is still sufficiently staffed to have many application service, infrastructure, and operational teams within it. Our purpose is "to enable Red Hatters in all functions to be effective, productive, innovative, and collaborative, so that they feel they can make a difference,"--and, more specifically, to do that by providing technologies and related services in a fashion that is as open as possible. - -Being open like this takes time, attention, and effort. While we always strive to be as open as possible, it can be difficult. For a variety of reasons, we don't always succeed. - -In this story, I'll explain a time when, in the rush to innovate, the Red Hat IT organization lost sight of its open ideals. But I'll also explore how returning to those ideals--and using the collaborative tactics of "inner source"--helped us to recover and greatly improve the way we deliver services. - -### About inner source - -Before I explain how inner source helped our team, let me offer some background on the concept. - -Inner source is the adoption of open source development practices between teams within an organization to promote better and faster delivery without requiring project resources be exposed to the world or openly licensed. It allows an organization to receive many of the benefits of open source development methods within its own walls. - -In this way, inner source aligns well with open organization strategies and principles; it provides a path for open, collaborative development. While the open organization defines its principles of openness broadly as transparency, inclusivity, adaptability, collaboration, and community--and covers how to use these open principles for communication, decision making, and many other topics--inner source is about the adoption of specific and tactical practices, processes, and patterns from open source communities to improve delivery. - -For instance, [the Open Organization Maturity Model][1] suggests that in order to be transparent, teams should, at minimum, share all project resources with the project team (though it suggests that it's generally better to share these resources with the entire organization). The common pattern in both inner source and open source development is to host all resources in a publicly available version control system, for source control management, which achieves the open organization goal of high transparency. - -Inner source aligns well with open organization strategies and principles. - -Another example of value alignment appears in the way open source communities accept contributions. In open source communities, source code is transparently available. Community contributions in the form of patches or merge requests are commonly accepted practices (even expected ones). This provides one example of how to meet the open organization's goal of promoting inclusivity and collaboration. - -### The challenge - -Early in 2014, Red Hat IT began its first steps toward making Amazon Web Services (AWS) a standard hosting offering for business critical systems. While teams within Red Hat IT had built several systems and services in AWS by this time, these were bespoke creations, and we desired to make deploying services to IT standards in AWS both simple and standardized. - -In order to make AWS cloud hosting meet our operational standards (while being scalable), the Cloud Enablement team within Red Hat IT decided that all infrastructure in AWS would be configured through code, rather than manually, and that everyone would use a standard set of tools. The Cloud Enablement team designed and built these standard tools; a separate group, the Platform Operations team, was responsible for provisioning and hosting systems and services in AWS using the tools. - -The Cloud Enablement team built a toolset, obtusely named "Template Util," based on AWS Cloud Formations configurations wrapped in a management layer to enforce certain configuration requirements and make stamping out multiple copies of services across environments easier. While the Template Util toolset technically met all our initial requirements, and we eventually provisioned the infrastructure for more than a dozen services with it, engineers in every team working with the tool found using it to be painful. Michael Johnson, one engineer using the tool, said "It made doing something relatively straightforward really complicated." - -Among the issues Template Util exhibited were: - - * Underlying cloud formations technologies implied constraints on application stack management at odds with how we managed our application systems. - * The tooling was needlessly complex and brittle in places, using multiple layered templating technologies and languages making syntax issues hard to debug. - * The code for the tool--and some of the data users needed to manipulate the tool--were kept in a repository that was difficult for most users to access. - * There was no standard process to contributing or accepting changes. - * The documentation was poor. - - - -As more engineers attempted to use the Template Util toolset, they found even more issues and limitations with the tools. Unhappiness continued to grow. To make matters worse, the Cloud Enablement team then shifted priorities to other deliverables without relinquishing ownership of the tool, so bug fixes and improvements to the tools were further delayed. - -The real, core issues here were our inability to build an inclusive community to collaboratively build shared tooling that met everyone's needs. Fear of losing "ownership," fear of changing requirements, and fear of seeing hard work abandoned all contributed to chronic conflict, which in turn led to poorer outcomes. - -### Crisis point - -By September 2015, more than a year after launching our first major service in AWS with the Template Util tool, we hit a crisis point. - -Many engineers refused to use the tools. That forced all of the related service provisioning work on a small set of engineers, further fracturing the community and disrupting service delivery roadmaps as these engineers struggled to deal with unexpected work. We called an emergency meeting and invited all the teams involved to find a solution. - -During the emergency meeting, we found that people generally thought we needed immediate change and should start the tooling effort over, but even the decision to start over wasn't unanimous. Many solutions emerged--sometimes multiple solutions from within a single team--all of which would require significant work to implement. While we couldn't reach a consensus on which solution to use during this meeting, we did reach an agreement to give proponents of different technologies two weeks to work together, across teams, to build their case with a prototype, which the community could then review. - -While we didn't reach a final and definitive decision, this agreement was the first point where we started to return to the open source ideals that guide our mission. By inviting all involved parties, we were able to be transparent and inclusive, and we could begin rebuilding our internal community. By making clear that we wanted to improve things and were open to new options, we showed our commitment to adaptability and meritocracy. Most importantly, the plan for building prototypes gave people a clear, return path to collaboration. - -When the community reviewed the prototypes, it determined that the clear leader was an Ansible-based toolset that would eventually become known, internally, as Ansicloud. (At the time, no one involved with this work had any idea that Red Hat would acquire Ansible the following month. It should also be noted that other teams within Red Hat have found tools based on Cloud Formation extremely useful, even when our specific Template Util tool did not find success.) - -This prototyping and testing phase didn't fix things overnight, though. While we had consensus on the general direction we needed to head, we still needed to improve the new prototype to the point at which engineers could use it reliably for production services. - -So over the next several months, a handful of engineers worked to further build and extend the Ansicloud toolset. We built three new production services. While we were sharing code, that sharing activity occurred at a low level of maturity. Some engineers had trouble getting access due to older processes. Other engineers headed in slightly different directions, with each engineer having to rediscover some of the core design issues themselves. - -### Returning to openness - -This led to a turning point: Building on top of the previous agreement, we focused on developing a unified vision and providing easier access. To do this, we: - - 1. created a list of specific goals for the project (both "must-haves" and "nice-to-haves"), - 2. created an open issue log for the project to avoid solving the same problem repeatedly, - 3. opened our code base so anyone in Red Hat could read or clone it, and - 4. made it easy for engineers to get trusted committer access - - - -Our agreement to collaborate, our finally unified vision, and our improved tool development methods spurred the growth of our community. Ansicloud adoption spread throughout the involved organizations, but this led to a new problem: The tool started changing more quickly than users could adapt to it, and improvements that different groups submitted were beginning to affect other groups in unanticipated ways. - -These issues resulted in our recent turn to inner source practices. While every open source project operates differently, we focused on adopting some best practices that seemed common to many of them. In particular: - - * We identified the business owner of the project and the core-contributor group of developers who would govern the development of the tools and decide what contributions to accept. While we want to keep things open, we can't have people working against each other or breaking each other's functionality. - * We developed a project README clarifying the purpose of the tool and specifying how to use it. We also created a CONTRIBUTING document explaining how to contribute, what sort of contributions would be useful, and what sort of tests a contribution would need to pass to be accepted. - * We began building continuous integration and testing services for the Ansicloud tool itself. This helped us ensure we could quickly and efficiently validate contributions technically, before the project accepted and merged them. - - - -With these basic agreements, documents, and tools available, we were back onto the path of open collaboration and successful inner sourcing. - -### Why it matters - -Why does inner source matter? - -From a developer community point of view, shifting from a traditional siloed development model to the inner source model has produced significant, quantifiable improvements: - - * Contributions to our tooling have grown 72% per week (by number of commits). - * The percentage of contributions from non-core committers has grown from 27% to 78%; the users of the toolset are driving its development. - * The contributor list has grown by 15%, primarily from new users of the tool set, rather than core committers, increasing our internal community. - - - -And the tools we've delivered through this project have allowed us to see dramatic improvements in our business outcomes. Using the Ansicloud tools, 54 new multi-environment application service deployments were created in 385 days (compared to 20 services in 1,013 days with the Template Util tools). We've gone from one new service deployment in a 50-day period to one every week--a seven-fold increase in the velocity of our delivery. - -What really matters here is that the improvements we saw were not aberrations. Inner source provides common, easily understood patterns that organizations can adopt to effectively promote collaboration (not to mention other open organization principles). By mirroring open source production practices, inner source can also mirror the benefits of open source code, which have been seen time and time again: higher quality code, faster development, and more engaged communities. - -This article is part of the [Open Organization Workbook project][2]. - -### about the author -Tom Benninger - Tom Benninger is a Solutions Architect, Systems Engineer, and continual tinkerer at Red Hat, Inc. Having worked with startups, small businesses, and larger enterprises, he has experience within a broad set of IT disciplines. His current area of focus is improving Application Lifecycle Management in the enterprise. He has a particular interest in how open source, inner source, and collaboration can help support modern application development practices and the adoption of DevOps, CI/CD, Agile,... - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/18/1/open-orgs-and-inner-source-it - -作者:[Tom Benninger][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/tomben -[1]:https://opensource.com/open-organization/resources/open-org-maturity-model -[2]:https://opensource.com/open-organization/17/8/workbook-project-announcement diff --git a/sources/talk/20180112 in which the cost of structured data is reduced.md b/sources/talk/20180112 in which the cost of structured data is reduced.md deleted file mode 100644 index 992ad57a39..0000000000 --- a/sources/talk/20180112 in which the cost of structured data is reduced.md +++ /dev/null @@ -1,181 +0,0 @@ -in which the cost of structured data is reduced -====== -Last year I got the wonderful opportunity to attend [RacketCon][1] as it was hosted only 30 minutes away from my home. The two-day conference had a number of great talks on the first day, but what really impressed me was the fact that the entire second day was spent focusing on contribution. The day started out with a few 15- to 20-minute talks about how to contribute to a specific codebase (including that of Racket itself), and after that people just split off into groups focused around specific codebases. Each table had maintainers helping guide other folks towards how to work with the codebase and construct effective patch submissions. - -![lensmen chronicles][2] - -I came away from the conference with a great sense of appreciation for how friendly and welcoming the Racket community is, and how great Racket is as a swiss-army-knife type tool for quick tasks. (Not that it's unsuitable for large projects, but I don't have the opportunity to start any new large projects very frequently.) - -The other day I wanted to generate colored maps of the world by categorizing countries interactively, and Racket seemed like it would fit the bill nicely. The job is simple: show an image of the world with one country selected; when a key is pressed, categorize that country, then show the map again with all categorized countries colored, and continue with the next country selected. - -### GUIs and XML - -I have yet to see a language/framework more accessible and straightforward out of the box for drawing1. Here's the entry point which sets up state and then constructs a canvas that handles key input and display: -``` -(define (main path) - (let ([frame (new frame% [label "World color"])] - [categorizations (box '())] - [doc (call-with-input-file path read-xml/document)]) - (new (class canvas% - (define/override (on-char event) - (handle-key this categorizations (send event get-key-code))) - (super-new)) - [parent frame] - [paint-callback (draw doc categorizations)]) - (send frame show #t))) - -``` - -While the class system is not one of my favorite things about Racket (most newer code seems to avoid it in favor of [generic interfaces][3] in the rare case that polymorphism is truly called for), the fact that classes can be constructed in a light-weight, anonymous way makes it much less onerous than it could be. This code sets up all mutable state in a [`box`][4] which you use in the way you'd use a `ref` in ML or Clojure: a mutable wrapper around an immutable data structure. - -The world map I'm using is [an SVG of the Robinson projection][5] from Wikipedia. If you look closely there's a call to bind `doc` that calls [`call-with-input-file`][6] with [`read-xml/document`][7] which loads up the whole map file's SVG; just about as easily as you could ask for. - -The data you get back from `read-xml/document` is in fact a [document][8] struct, which contains an `element` struct containing `attribute` structs and lists of more `element` structs. All very sensible, but maybe not what you would expect in other dynamic languages like Clojure or Lua where free-form maps reign supreme. Racket really wants structure to be known up-front when possible, which is one of the things that help it produce helpful error messages when things go wrong. - -Here's how we handle keyboard input; we're displaying a map with one country highlighted, and `key` here tells us what the user pressed to categorize the highlighted country. If that key is in the `categories` hash then we put it into `categorizations`. -``` -(define categories #hash((select . "eeeeff") - (#\1 . "993322") - (#\2 . "229911") - (#\3 . "ABCD31") - (#\4 . "91FF55") - (#\5 . "2439DF"))) - -(define (handle-key canvas categorizations key) - (cond [(equal? #\backspace key) (swap! categorizations cdr)] - [(member key (dict-keys categories)) (swap! categorizations (curry cons key))] - [(equal? #\space key) (display (unbox categorizations))]) - (send canvas refresh)) - -``` - -### Nested updates: the bad parts - -Finally once we have a list of categorizations, we need to apply it to the map document and display. We apply a [`fold`][9] reduction over the XML document struct and the list of country categorizations (plus `'select` for the country that's selected to be categorized next) to get back a "modified" document struct where the proper elements have the style attributes applied for the given categorization, then we turn it into an image and hand it to [`draw-pict`][10]: -``` - -(define (update original-doc categorizations) - (for/fold ([doc original-doc]) - ([category (cons 'select (unbox categorizations))] - [n (in-range (length (unbox categorizations)) 0 -1)]) - (set-style doc n (style-for category)))) - -(define ((draw doc categorizations) _ context) - (let* ([newdoc (update doc categorizations)] - [xml (call-with-output-string (curry write-xml newdoc))]) - (draw-pict (call-with-input-string xml svg-port->pict) context 0 0))) - -``` - -The problem is in that pesky `set-style` function. All it has to do is reach deep down into the `document` struct to find the `n`th `path` element (the one associated with a given country), and change its `'style` attribute. It ought to be a simple task. Unfortunately this function ends up being anything but simple: -``` - -(define (set-style doc n new-style) - (let* ([root (document-element doc)] - [g (list-ref (element-content root) 8)] - [paths (element-content g)] - [path (first (drop (filter element? paths) n))] - [path-num (list-index (curry eq? path) paths)] - [style-index (list-index (lambda (x) (eq? 'style (attribute-name x))) - (element-attributes path))] - [attr (list-ref (element-attributes path) style-index)] - [new-attr (make-attribute (source-start attr) - (source-stop attr) - (attribute-name attr) - new-style)] - [new-path (make-element (source-start path) - (source-stop path) - (element-name path) - (list-set (element-attributes path) - style-index new-attr) - (element-content path))] - [new-g (make-element (source-start g) - (source-stop g) - (element-name g) - (element-attributes g) - (list-set paths path-num new-path))] - [root-contents (list-set (element-content root) 8 new-g)]) - (make-document (document-prolog doc) - (make-element (source-start root) - (source-stop root) - (element-name root) - (element-attributes root) - root-contents) - (document-misc doc)))) - -``` - -The reason for this is that while structs are immutable, they don't support functional updates. Whenever you're working with immutable data structures, you want to be able to say "give me a new version of this data, but with field `x` replaced by the value of `(f (lookup x))`". Racket can [do this with dictionaries][11] but not with structs2. If you want a modified version you have to create a fresh one3. - -### Lenses to the rescue? - -![first lensman][12] - -When I brought this up in the `#racket` channel on Freenode, I was helpfully pointed to the 3rd-party [Lens][13] library. Lenses are a general-purpose way of composing arbitrarily nested lookups and updates. Unfortunately at this time there's [a flaw][14] preventing them from working with `xml` structs, so it seemed I was out of luck. - -But then I was pointed to [X-expressions][15] as an alternative to structs. The [`xml->xexpr`][16] function turns the structs into a deeply-nested list tree with symbols and strings in it. The tag is the first item in the list, followed by an associative list of attributes, then the element's children. While this gives you fewer up-front guarantees about the structure of the data, it does work around the lens issue. - -For this to work, we need to compose a new lens based on the "path" we want to use to drill down into the `n`th country and its `style` attribute. The [`lens-compose`][17] function lets us do that. Note that the order here might be backwards from what you'd expect; it works deepest-first (the way [`compose`][18] works for functions). Also note that defining one lens gives us the ability to both get nested values (with [`lens-view`][19]) and update them. -``` -(define (style-lens n) - (lens-compose (dict-ref-lens 'style) - second-lens - (list-ref-lens (add1 (* n 2))) - (list-ref-lens 10))) -``` - -Our `` XML elements are under the 10th item of the root xexpr, (hence the [`list-ref-lens`][20] with 10) and they are interspersed with whitespace, so we have to double `n` to find the `` we want. The [`second-lens`][21] call gets us to that element's attribute alist, and [`dict-ref-lens`][22] lets us zoom in on the `'style` key out of that alist. - -Once we have our lens, it's just a matter of replacing `set-style` with a call to [`lens-set`][23] in our `update` function we had above, and then we're off: -``` -(define (update doc categorizations) - (for/fold ([d doc]) - ([category (cons 'select (unbox categorizations))] - [n (in-range (length (unbox categorizations)) 0 -1)]) - (lens-set (style-lens n) d (list (style-for category))))) -``` - -![second stage lensman][24] - -Often times the trade-off between freeform maps/hashes vs structured data feels like one of convenience vs long-term maintainability. While it's unfortunate that they can't be used with the `xml` structs4, lenses provide a way to get the best of both worlds, at least in some situations. - -The final version of the code clocks in at 51 lines and is is available [on GitLab][25]. - -๛ - --------------------------------------------------------------------------------- - -via: https://technomancy.us/185 - -作者:[Phil Hagelberg][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://technomancy.us/ -[1]:https://con.racket-lang.org/ -[2]:https://technomancy.us/i/chronicles-of-lensmen.jpg -[3]:https://docs.racket-lang.org/reference/struct-generics.html -[4]:https://docs.racket-lang.org/reference/boxes.html?q=box#%28def._%28%28quote._~23~25kernel%29._box%29%29 -[5]:https://commons.wikimedia.org/wiki/File:BlankMap-World_gray.svg -[6]:https://docs.racket-lang.org/reference/port-lib.html#(def._((lib._racket%2Fport..rkt)._call-with-input-string)) -[7]:https://docs.racket-lang.org/xml/index.html?q=read-xml#%28def._%28%28lib._xml%2Fmain..rkt%29._read-xml%2Fdocument%29%29 -[8]:https://docs.racket-lang.org/xml/#%28def._%28%28lib._xml%2Fmain..rkt%29._document%29%29 -[9]:https://docs.racket-lang.org/reference/for.html?q=for%2Ffold#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%2Ffold%29%29 -[10]:https://docs.racket-lang.org/pict/Rendering.html?q=draw-pict#%28def._%28%28lib._pict%2Fmain..rkt%29._draw-pict%29%29 -[11]:https://docs.racket-lang.org/reference/dicts.html?q=dict-update#%28def._%28%28lib._racket%2Fdict..rkt%29._dict-update%29%29 -[12]:https://technomancy.us/i/first-lensman.jpg -[13]:https://docs.racket-lang.org/lens/lens-guide.html -[14]:https://github.com/jackfirth/lens/issues/290 -[15]:https://docs.racket-lang.org/pollen/second-tutorial.html?q=xexpr#%28part._.X-expressions%29 -[16]:https://docs.racket-lang.org/xml/index.html?q=xexpr#%28def._%28%28lib._xml%2Fmain..rkt%29._xml-~3exexpr%29%29 -[17]:https://docs.racket-lang.org/lens/lens-reference.html#%28def._%28%28lib._lens%2Fcommon..rkt%29._lens-compose%29%29 -[18]:https://docs.racket-lang.org/reference/procedures.html#%28def._%28%28lib._racket%2Fprivate%2Flist..rkt%29._compose%29%29 -[19]:https://docs.racket-lang.org/lens/lens-reference.html?q=lens-view#%28def._%28%28lib._lens%2Fcommon..rkt%29._lens-view%29%29 -[20]:https://docs.racket-lang.org/lens/lens-reference.html?q=lens-view#%28def._%28%28lib._lens%2Fdata%2Flist..rkt%29._list-ref-lens%29%29 -[21]:https://docs.racket-lang.org/lens/lens-reference.html?q=lens-view#%28def._%28%28lib._lens%2Fdata%2Flist..rkt%29._second-lens%29%29 -[22]:https://docs.racket-lang.org/lens/lens-reference.html?q=lens-view#%28def._%28%28lib._lens%2Fdata%2Fdict..rkt%29._dict-ref-lens%29%29 -[23]:https://docs.racket-lang.org/lens/lens-reference.html?q=lens-view#%28def._%28%28lib._lens%2Fcommon..rkt%29._lens-set%29%29 -[24]:https://technomancy.us/i/second-stage-lensman.jpg -[25]:https://gitlab.com/technomancy/world-color/blob/master/world-color.rkt diff --git a/sources/talk/20180124 Security Chaos Engineering- A new paradigm for cybersecurity.md b/sources/talk/20180124 Security Chaos Engineering- A new paradigm for cybersecurity.md deleted file mode 100644 index 35c89150c8..0000000000 --- a/sources/talk/20180124 Security Chaos Engineering- A new paradigm for cybersecurity.md +++ /dev/null @@ -1,87 +0,0 @@ -Security Chaos Engineering: A new paradigm for cybersecurity -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_bank_vault_secure_safe.png?itok=YoW93h7C) - -Security is always changing and failure always exists. - -This toxic scenario requires a fresh perspective on how we think about operational security. We must understand that we are often the primary cause of our own security flaws. The industry typically looks at cybersecurity and failure in isolation or as separate matters. We believe that our lack of insight and operational intelligence into our own security control failures is one of the most common causes of security incidents and, subsequently, data breaches. - -> Fall seven times, stand up eight." --Japanese proverb - -The simple fact is that "to err is human," and humans derive their success as a direct result of the failures they encounter. Their rate of failure, how they fail, and their ability to understand that they failed in the first place are important building blocks to success. Our ability to learn through failure is inherent in the systems we build, the way we operate them, and the security we use to protect them. Yet there has been a lack of focus when it comes to how we approach preventative security measures, and the spotlight has trended toward the evolving attack landscape and the need to buy or build new solutions. - -### Security spending is continually rising and so are security incidents - -We spend billions on new information security technologies, however, we rarely take a proactive look at whether those security investments perform as expected. This has resulted in a continual increase in security spending on new solutions to keep up with the evolving attacks. - -Despite spending more on security, data breaches are continuously getting bigger and more frequent across all industries. We have marched so fast down this path of the "get-ahead-of-the-attacker" strategy that we haven't considered that we may be a primary cause of our own demise. How is it that we are building more and more security measures, but the problem seems to be getting worse? Furthermore, many of the notable data breaches over the past year were not the result of an advanced nation-state or spy-vs.-spy malicious advanced persistent threats (APTs); rather the principal causes of those events were incomplete implementation, misconfiguration, design flaws, and lack of oversight. - -The 2017 Ponemon Cost of a Data Breach Study breaks down the [root causes of data breaches][1] into three areas: malicious or criminal attacks, human factors or errors, and system glitches, including both IT and business-process failure. Of the three categories, malicious or criminal attacks comprises the largest distribution (47%), followed by human error (28%), and system glitches (25%). Cybersecurity vendors have historically focused on malicious root causes of data breaches, as it is the largest sole cause, but together human error and system glitches total 53%, a larger share of the overall problem. - -What is not often understood, whether due to lack of insight, reporting, or analysis, is that malicious or criminal attacks are often successful due to human error and system glitches. Both human error and system glitches are, at their root, primary markers of the existence of failure. Whether it's IT system failures, failures in process, or failures resulting from humans, it begs the question: "Should we be focusing on finding a method to identify, understand, and address our failures?" After all, it can be an arduous task to predict the next malicious attack, which often requires investment of time to sift threat intelligence, dig through forensic data, or churn threat feeds full of unknown factors and undetermined motives. Failure instrumentation, identification, and remediation are mostly comprised of things that we know, have the ability to test, and can measure. - -Failures we can analyze consist not only of IT, business, and general human factors but also the way we design, build, implement, configure, operate, observe, and manage security controls. People are the ones designing, building, monitoring, and managing the security controls we put in place to defend against malicious attackers. How often do we proactively instrument what we designed, built, and are operationally managing to determine if the controls are failing? Most organizations do not discover that their security controls were failing until a security incident results from that failure. The worst time to find out your security investment failed is during a security incident at 3 a.m. - -> Security incidents are not detective measures and hope is not a strategy when it comes to operating effective security controls. - -We hypothesize that a large portion of data breaches are caused not by sophisticated nation-state actors or hacktivists, but rather simple things rooted in human error and system glitches. Failure in security controls can arise from poor control placement, technical misconfiguration, gaps in coverage, inadequate testing practices, human error, and numerous other things. - -### The journey into Security Chaos Testing - -Our venture into this new territory of Security Chaos Testing has shifted our thinking about the root cause of many of our notable security incidents and data breaches. - -We were brought together by [Bruce Wong][2], who now works at Stitch Fix with Charles, one of the authors of this article. Prior to Stitch Fix, Bruce was a founder of the Chaos Engineering and System Reliability Engineering (SRE) practices at Netflix, the company commonly credited with establishing the field. Bruce learned about this article's other author, Aaron, through the open source [ChaoSlingr][3] Security Chaos Testing tool project, on which Aaron was a contributor. Aaron was interested in Bruce's perspective on the idea of applying Chaos Engineering to cybersecurity, which led Bruce to connect us to share what we had been working on. As security practitioners, we were both intrigued by the idea of Chaos Engineering and had each begun thinking about how this new method of instrumentation might have a role in cybersecurity. - -Within a short timeframe, we began finishing each other's thoughts around testing and validating security capabilities, which we collectively call "Security Chaos Engineering." We directly challenged many of the concepts we had come to depend on in our careers, such as compensating security controls, defense-in-depth, and how to design preventative security. Quickly we realized that we needed to challenge the status quo "set-it-and-forget-it" model and instead execute on continuous instrumentation and validation of security capabilities. - -Businesses often don't fully understand whether their security capabilities and controls are operating as expected until they are not. We had both struggled throughout our careers to provide measurements on security controls that go beyond simple uptime metrics. Our journey has shown us there is a need for a more pragmatic approach that emphasizes proactive instrumentation and experimentation over blind faith. - -### Defining new terms - -In the security industry, we have a habit of not explaining terms and assuming we are speaking the same language. To correct that, here are a few key terms in this new approach: - - * **(Security) Chaos Experiments** are foundationally rooted in the scientific method, in that they seek not to validate what is already known to be true or already known to be false, rather they are focused on deriving new insights about the current state. - * **Security Chaos Engineering** is the discipline of instrumentation, identification, and remediation of failure within security controls through proactive experimentation to build confidence in the system's ability to defend against malicious conditions in production. - - - -### Security and distributed systems - -Consider the evolving nature of modern application design where systems are becoming more and more distributed, ephemeral, and immutable in how they operate. In this shifting paradigm, it is becoming difficult to comprehend the operational state and health of our systems' security. Moreover, how are we ensuring that it remains effective and vigilant as the surrounding environment is changing its parameters, components, and methodologies? - -What does it mean to be effective in terms of security controls? After all, a single security capability could easily be implemented in a wide variety of diverse scenarios in which failure may arise from many possible sources. For example, a standard firewall technology may be implemented, placed, managed, and configured differently depending on complexities in the business, web, and data logic. - -It is imperative that we not operate our business products and services on the assumption that something works. We must constantly, consistently, and proactively instrument our security controls to ensure they cut the mustard when it matters. This is why Security Chaos Testing is so important. What Security Chaos Engineering does is it provides a methodology for the experimentation of the security of distributed systems in order to build confidence in the ability to withstand malicious conditions. - -In Security Chaos Engineering: - - * Security capabilities must be end-to-end instrumented. - * Security must be continuously instrumented to build confidence in the system's ability to withstand malicious conditions. - * Readiness of a system's security defenses must be proactively assessed to ensure they are battle-ready and operating as intended. - * The security capability toolchain must be instrumented from end to end to drive new insights into not only the effectiveness of the functionality within the toolchain but also to discover where added value and improvement can be injected. - * Practiced instrumentation seeks to identify, detect, and remediate failures in security controls. - * The focus is on vulnerability and failure identification, not failure management. - * The operational effectiveness of incident management is sharpened. - - - -As Henry Ford said, "Failure is only the opportunity to begin again, this time more intelligently." Security Chaos Engineering and Security Chaos Testing give us that opportunity. - -Would you like to learn more? Join the discussion by following [@aaronrinehart][4] and [@charles_nwatu][5] on Twitter. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/new-paradigm-cybersecurity - -作者:[Aaron Rinehart][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/aaronrinehart -[1]:https://www.ibm.com/security/data-breach -[2]:https://twitter.com/bruce_m_wong?lang=en -[3]:https://github.com/Optum/ChaoSlingr -[4]:https://twitter.com/aaronrinehart -[5]:https://twitter.com/charles_nwatu diff --git a/sources/talk/20180131 How to write a really great resume that actually gets you hired.md b/sources/talk/20180131 How to write a really great resume that actually gets you hired.md deleted file mode 100644 index b54b3944ae..0000000000 --- a/sources/talk/20180131 How to write a really great resume that actually gets you hired.md +++ /dev/null @@ -1,395 +0,0 @@ -How to write a really great resume that actually gets you hired -============================================================ - - -![](https://cdn-images-1.medium.com/max/2000/1*k7HRLZAsuINP9vIs2BIh1g.png) - -This is a data-driven guide to writing a resume that actually gets you hired. I’ve spent the past four years analyzing which resume advice works regardless of experience, role, or industry. The tactics laid out below are the result of what I’ve learned. They helped me land offers at Google, Microsoft, and Twitter and have helped my students systematically land jobs at Amazon, Apple, Google, Microsoft, Facebook, and more. - -### Writing Resumes Sucks. - -It’s a vicious cycle. - -We start by sifting through dozens of articles by career “gurus,” forced to compare conflicting advice and make our own decisions on what to follow. - -The first article says “one page MAX” while the second says “take two or three and include all of your experience.” - -The next says “write a quick summary highlighting your personality and experience” while another says “summaries are a waste of space.” - -You scrape together your best effort and hit “Submit,” sending your resume into the ether. When you don’t hear back, you wonder what went wrong: - - _“Was it the single page or the lack of a summary? Honestly, who gives a s**t at this point. I’m sick of sending out 10 resumes every day and hearing nothing but crickets.”_ - - -![](https://cdn-images-1.medium.com/max/1000/1*_zQqAjBhB1R4fz55InrrIw.jpeg) -How it feels to try and get your resume read in today’s world. - -Writing resumes sucks but it’s not your fault. - -The real reason it’s so tough to write a resume is because most of the advice out there hasn’t been proven against the actual end goal of getting a job. If you don’t know what consistently works, you can’t lay out a system to get there. - -It’s easy to say “one page works best” when you’ve seen it happen a few times. But how does it hold up when we look at 100 resumes across different industries, experience levels, and job titles? - -That’s what this article aims to answer. - -Over the past four years, I’ve personally applied to hundreds of companies and coached hundreds of people through the job search process. This has given me a huge opportunity to measure, analyze, and test the effectiveness of different resume strategies at scale. - -This article is going to walk through everything I’ve learned about resumes over the past 4 years, including: - -* Mistakes that more than 95% of people make, causing their resumes to get tossed immediately - -* Three things that consistently appear in the resumes of highly effective job searchers (who go on to land jobs at the world’s best companies) - -* A quick hack that will help you stand out from the competition and instantly build relationships with whomever is reading your resume (increasing your chances of hearing back and getting hired) - -* The exact resume template that got me interviews and offers at Google, Microsoft, Twitter, Uber, and more - -Before we get to the unconventional strategies that will help set you apart, we need to make sure our foundational bases are covered. That starts with understanding the mistakes most job seekers make so we can make our resume bulletproof. - -### Resume Mistakes That 95% Of People Make - -Most resumes that come through an online portal or across a recruiter’s desk are tossed out because they violate a simple rule. - -When recruiters scan a resume, the first thing they look for is mistakes. Your resume could be fantastic, but if you violate a rule like using an unprofessional email address or improper grammar, it’s going to get tossed out. - -Our goal is to fully understand the triggers that cause recruiters/ATS systems to make the snap decisions on who stays and who goes. - -In order to get inside the heads of these decision makers, I collected data from dozens of recruiters and hiring mangers across industries. These people have several hundred years of hiring experience under their belts and they’ve reviewed 100,000+ resumes across industries. - -They broke down the five most common mistakes that cause them to cut resumes from the pile: - - -![](https://cdn-images-1.medium.com/max/1000/1*5Zbr3HFeKSjvPGZdq_LCKA.png) - -### The Five Most Common Resume Mistakes (According To Recruiters & Hiring Managers) - -Issue #1: Sloppiness (typos, spelling errors, & grammatical mistakes). Close to 60% of resumes have some sort of typo or grammatical issue. - -Solution: Have your resume reviewed by three separate sources — spell checking software, a friend, and a professional. Spell check should be covered if you’re using Microsoft Word or Google Docs to create your resume. - -A friend or family member can cover the second base, but make sure you trust them with reviewing the whole thing. You can always include an obvious mistake to see if they catch it. - -Finally, you can hire a professional editor on [Upwork][1]. It shouldn’t take them more than 15–20 minutes to review so it’s worth paying a bit more for someone with high ratings and lots of hours logged. - -Issue #2: Summaries are too long and formal. Many resumes include summaries that consist of paragraphs explaining why they are a “driven, results oriented team player.” When hiring managers see a block of text at the top of the resume, you can bet they aren’t going to read the whole thing. If they do give it a shot and read something similar to the sentence above, they’re going to give up on the spot. - -Solution: Summaries are highly effective, but they should be in bullet form and showcase your most relevant experience for the role. For example, if I’m applying for a new business sales role my first bullet might read “Responsible for driving $11M of new business in 2018, achieved 168% attainment (#1 on my team).” - -Issue #3: Too many buzz words. Remember our driven team player from the last paragraph? Phrasing like that makes hiring managers cringe because your attempt to stand out actually makes you sound like everyone else. - -Solution: Instead of using buzzwords, write naturally, use bullets, and include quantitative results whenever possible. Would you rather hire a salesperson who “is responsible for driving new business across the healthcare vertical to help companies achieve their goals” or “drove $15M of new business last quarter, including the largest deal in company history”? Skip the buzzwords and focus on results. - -Issue #4: Having a resume that is more than one page. The average employer spends six seconds reviewing your resume — if it’s more than one page, it probably isn’t going to be read. When asked, recruiters from Google and Barclay’s both said multiple page resumes “are the bane of their existence.” - -Solution: Increase your margins, decrease your font, and cut down your experience to highlight the most relevant pieces for the role. It may seem impossible but it’s worth the effort. When you’re dealing with recruiters who see hundreds of resumes every day, you want to make their lives as easy as possible. - -### More Common Mistakes & Facts (Backed By Industry Research) - -In addition to personal feedback, I combed through dozens of recruitment survey results to fill any gaps my contacts might have missed. Here are a few more items you may want to consider when writing your resume: - -* The average interviewer spends 6 seconds scanning your resume - -* The majority of interviewers have not looked at your resume until -  you walk into the room - -* 76% of resumes are discarded for an unprofessional email address - -* Resumes with a photo have an 88% rejection rate - -* 58% of resumes have typos - -* Applicant tracking software typically eliminates 75% of resumes due to a lack of keywords and phrases being present - -Now that you know every mistake you need to avoid, the first item on your to-do list is to comb through your current resume and make sure it doesn’t violate anything mentioned above. - -Once you have a clean resume, you can start to focus on more advanced tactics that will really make you stand out. There are a few unique elements you can use to push your application over the edge and finally get your dream company to notice you. - - -![](https://cdn-images-1.medium.com/max/1000/1*KthhefFO33-8tm0kBEPbig.jpeg) - -### The 3 Elements Of A Resume That Will Get You Hired - -My analysis showed that highly effective resumes typically include three specific elements: quantitative results, a simple design, and a quirky interests section. This section breaks down all three elements and shows you how to maximize their impact. - -### Quantitative Results - -Most resumes lack them. - -Which is a shame because my data shows that they make the biggest difference between resumes that land interviews and resumes that end up in the trash. - -Here’s an example from a recent resume that was emailed to me: - -> Experience - -> + Identified gaps in policies and processes and made recommendations for solutions at the department and institution level - -> + Streamlined processes to increase efficiency and enhance quality - -> + Directly supervised three managers and indirectly managed up to 15 staff on multiple projects - -> + Oversaw execution of in-house advertising strategy - -> + Implemented comprehensive social media plan - -As an employer, that tells me absolutely nothing about what to expect if I hire this person. - -They executed an in-house marketing strategy. Did it work? How did they measure it? What was the ROI? - -They also also identified gaps in processes and recommended solutions. What was the result? Did they save time and operating expenses? Did it streamline a process resulting in more output? - -Finally, they managed a team of three supervisors and 15 staffers. How did that team do? Was it better than the other teams at the company? What results did they get and how did those improve under this person’s management? - -See what I’m getting at here? - -These types of bullets talk about daily activities, but companies don’t care about what you do every day. They care about results. By including measurable metrics and achievements in your resume, you’re showcasing the value that the employer can expect to get if they hire you. - -Let’s take a look at revised versions of those same bullets: - -> Experience - -> + Managed a team of 20 that consistently outperformed other departments in lead generation, deal size, and overall satisfaction (based on our culture survey) - -> + Executed in-house marketing strategy that resulted in a 15% increase in monthly leads along with a 5% drop in the cost per lead - -> + Implemented targeted social media campaign across Instagram & Pintrest, which drove an additional 50,000 monthly website visits and generated 750 qualified leads in 3 months - -If you were in the hiring manager’s shoes, which resume would you choose? - -That’s the power of including quantitative results. - -### Simple, Aesthetic Design That Hooks The Reader - -These days, it’s easy to get carried away with our mission to “stand out.” I’ve seen resume overhauls from graphic designers, video resumes, and even resumes [hidden in a box of donuts.][2] - -While those can work in very specific situations, we want to aim for a strategy that consistently gets results. The format I saw the most success with was a black and white Word template with sections in this order: - -* Summary - -* Interests - -* Experience - -* Education - -* Volunteer Work (if you have it) - -This template is effective because it’s familiar and easy for the reader to digest. - -As I mentioned earlier, hiring managers scan resumes for an average of 6 seconds. If your resume is in an unfamiliar format, those 6 seconds won’t be very comfortable for the hiring manager. Our brains prefer things we can easily recognize. You want to make sure that a hiring manager can actually catch a glimpse of who you are during their quick scan of your resume. - -If we’re not relying on design, this hook needs to come from the  _Summary_ section at the top of your resume. - -This section should be done in bullets (not paragraph form) and it should contain 3–4 highlights of the most relevant experience you have for the role. For example, if I was applying for a New Business Sales position, my summary could look like this: - -> Summary - -> Drove quarterly average of $11M in new business with a quota attainment of 128% (#1 on my team) - -> Received award for largest sales deal of the year - -> Developed and trained sales team on new lead generation process that increased total leads by 17% in 3 months, resulting in 4 new deals worth $7M - -Those bullets speak directly to the value I can add to the company if I was hired for the role. - -### An “Interests” Section That’s Quirky, Unique, & Relatable - -This is a little “hack” you can use to instantly build personal connections and positive associations with whomever is reading your resume. - -Most resumes have a skills/interests section, but it’s usually parked at the bottom and offers little to no value. It’s time to change things up. - -[Research shows][3] that people rely on emotions, not information, to make decisions. Big brands use this principle all the time — emotional responses to advertisements are more influential on a person’s intent to buy than the content of an ad. - -You probably remember Apple’s famous “Get A Mac” campaign: - - -When it came to specs and performance, Macs didn’t blow every single PC out of the water. But these ads solidified who was “cool” and who wasn’t, which was worth a few extra bucks to a few million people. - -By tugging at our need to feel “cool,” Apple’s campaign led to a [42% increase in market share][4] and a record sales year for Macbooks. - -Now we’re going to take that same tactic and apply it to your resume. - -If you can invoke an emotional response from your recruiter, you can influence the mental association they assign to you. This gives you a major competitive advantage. - -Let’s start with a question — what could you talk about for hours? - -It could be cryptocurrency, cooking, World War 2, World of Warcraft, or how Google’s bet on segmenting their company under the Alphabet is going to impact the technology sector over the next 5 years. - -Did a topic (or two) pop into year head? Great. - -Now think about what it would be like to have a conversation with someone who was just as passionate and knew just as much as you did on the topic. It’d be pretty awesome, right?  _Finally, _ someone who gets it! - -That’s exactly the kind of emotional response we’re aiming to get from a hiring manager. - -There are five “neutral” topics out there that people enjoy talking about: - -1. Food/Drink - -2. Sports - -3. College - -4. Hobbies - -5. Geography (travel, where people are from, etc.) - -These topics are present in plenty of interest sections but we want to take them one step further. - -Let’s say you had the best night of your life at the Full Moon Party in Thailand. Which of the following two options would you be more excited to read: - -* Traveling - -* Ko Pha Ngan beaches (where the full moon party is held) - -Or, let’s say that you went to Duke (an ACC school) and still follow their basketball team. Which would you be more pumped about: - -* College Sports - -* ACC Basketball (Go Blue Devils!) - -In both cases, the second answer would probably invoke a larger emotional response because it is tied directly to your experience. - -I want you to think about your interests that fit into the five categories I mentioned above. - -Now I want you to write a specific favorite associated with each category in parentheses next to your original list. For example, if you wrote travel you can add (ask me about the time I was chased by an elephant in India) or (specifically meditation in a Tibetan monastery). - -Here is the [exact set of interests][5] I used on my resume when I interviewed at Google, Microsoft, and Twitter: - - _ABC Kitchen’s Atmosphere, Stumptown Coffee (primarily cold brew), Michael Lewis (Liar’s Poker), Fishing (especially fly), Foods That Are Vehicles For Hot Sauce, ACC Sports (Go Deacs!) & The New York Giants_ - - -![](https://cdn-images-1.medium.com/max/1000/1*ONxtGr_xUYmz4_Xe66aeng.jpeg) - -If you want to cheat here, my experience shows that anything about hot sauce is an instant conversation starter. - -### The Proven Plug & Play Resume Template - -Now that we have our strategies down, it’s time to apply these tactics to a real resume. Our goal is to write something that increases your chances of hearing back from companies, enhances your relationships with hiring managers, and ultimately helps you score the job offer. - -The example below is the exact resume that I used to land interviews and offers at Microsoft, Google, and Twitter. I was targeting roles in Account Management and Sales, so this sample is tailored towards those positions. We’ll break down each section below: - - -![](https://cdn-images-1.medium.com/max/1000/1*B2RQ89ue2dGymRdwMY2lBA.png) - -First, I want you to notice how clean this is. Each section is clearly labeled and separated and flows nicely from top to bottom. - -My summary speaks directly to the value I’ve created in the past around company culture and its bottom line: - -* I consistently exceeded expectations - -* I started my own business in the space (and saw real results) - -* I’m a team player who prioritizes culture - -I purposefully include my Interests section right below my Summary. If my hiring manager’s six second scan focused on the summary, I know they’ll be interested. Those bullets cover all the subconscious criteria for qualification in sales. They’re going to be curious to read more in my Experience section. - -By sandwiching my Interests in the middle, I’m upping their visibility and increasing the chance of creating that personal connection. - -You never know — the person reading my resume may also be a hot sauce connoisseur and I don’t want that to be overlooked because my interests were sitting at the bottom. - -Next, my Experience section aims to flesh out the points made in my Summary. I mentioned exceeding my quota up top, so I included two specific initiatives that led to that attainment, including measurable results: - -* A partnership leveraging display advertising to drive users to a gamified experience. The campaign resulted in over 3000 acquisitions and laid the groundwork for the 2nd largest deal in company history. - -* A partnership with a top tier agency aimed at increasing conversions for a client by improving user experience and upgrading tracking during a company-wide website overhaul (the client has ~20 brand sites). Our efforts over 6 months resulted in a contract extension worth 316% more than their original deal. - -Finally, I included my education at the very bottom starting with the most relevant coursework. - -Download My Resume Templates For Free - -You can download a copy of the resume sample above as well as a plug and play template here: - -Austin’s Resume: [Click To Download][6] - -Plug & Play Resume Template: [Click To Download][7] - -### Bonus Tip: An Unconventional Resume “Hack” To Help You Beat Applicant Tracking Software - -If you’re not already familiar, Applicant Tracking Systems are pieces of software that companies use to help “automate” the hiring process. - -After you hit submit on your online application, the ATS software scans your resume looking for specific keywords and phrases (if you want more details, [this article][8] does a good job of explaining ATS). - -If the language in your resume matches up, the software sees it as a good fit for the role and will pass it on to the recruiter. However, even if you’re highly qualified for the role but you don’t use the right wording, your resume can end up sitting in a black hole. - -I’m going to teach you a little hack to help improve your chances of beating the system and getting your resume in the hands of a human: - -Step 1: Highlight and select the entire job description page and copy it to your clipboard. - -Step 2: Head over to [WordClouds.com][9] and click on the “Word List” button at the top. Towards the top of the pop up box, you should see a link for Paste/Type Text. Go ahead and click that. - -Step 3: Now paste the entire job description into the box, then hit “Apply.” - -WordClouds is going to spit out an image that showcases every word in the job description. The larger words are the ones that appear most frequently (and the ones you want to make sure to include when writing your resume). Here’s an example for a data a science role: - - -![](https://cdn-images-1.medium.com/max/1000/1*O7VO1C9nhC9LZct7vexTbA.png) - -You can also get a quantitative view by clicking “Word List” again after creating your cloud. That will show you the number of times each word appeared in the job description: - -9 data - -6 models - -4 experience - -4 learning - -3 Experience - -3 develop - -3 team - -2 Qualifications - -2 statistics - -2 techniques - -2 libraries - -2 preferred - -2 research - -2 business - -When writing your resume, your goal is to include those words in the same proportions as the job description. - -It’s not a guaranteed way to beat the online application process, but it will definitely help improve your chances of getting your foot in the door! - -* * * - -### Want The Inside Info On Landing A Dream Job Without Connections, Without “Experience,” & Without Applying Online? - -[Click here to get the 5 free strategies that my students have used to land jobs at Google, Microsoft, Amazon, and more without applying online.][10] - - _Originally published at _ [_cultivatedculture.com_][11] _._ - --------------------------------------------------------------------------------- - -作者简介: - -I help people land jobs they love and salaries they deserve at CultivatedCulture.com - ----------- - -via: https://medium.freecodecamp.org/how-to-write-a-really-great-resume-that-actually-gets-you-hired-e18533cd8d17 - -作者:[Austin Belcak ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://medium.freecodecamp.org/@austin.belcak -[1]:http://www.upwork.com/ -[2]:https://www.thrillist.com/news/nation/this-guy-hides-his-resume-in-boxes-of-donuts-to-score-job-interviews -[3]:https://www.psychologytoday.com/blog/inside-the-consumer-mind/201302/how-emotions-influence-what-we-buy -[4]:https://www.businesswire.com/news/home/20070608005253/en/Apple-Mac-Named-Successful-Marketing-Campaign-2007 -[5]:http://cultivatedculture.com/resume-skills-section/ -[6]:https://drive.google.com/file/d/182gN6Kt1kBCo1LgMjtsGHOQW2lzATpZr/view?usp=sharing -[7]:https://drive.google.com/open?id=0B3WIcEDrxeYYdXFPVlcyQlJIbWc -[8]:https://www.jobscan.co/blog/8-things-you-need-to-know-about-applicant-tracking-systems/ -[9]:https://www.wordclouds.com/ -[10]:https://cultivatedculture.com/dreamjob/ -[11]:https://cultivatedculture.com/write-a-resume/ \ No newline at end of file diff --git a/sources/talk/20180206 UQDS- A software-development process that puts quality first.md b/sources/talk/20180206 UQDS- A software-development process that puts quality first.md deleted file mode 100644 index e9f7bb94ac..0000000000 --- a/sources/talk/20180206 UQDS- A software-development process that puts quality first.md +++ /dev/null @@ -1,99 +0,0 @@ -UQDS: A software-development process that puts quality first -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag) - -The Ultimate Quality Development System (UQDS) is a software development process that provides clear guidelines for how to use branches, tickets, and code reviews. It was invented more than a decade ago by Divmod and adopted by [Twisted][1], an event-driven framework for Python that underlies popular commercial platforms like HipChat as well as open source projects like Scrapy (a web scraper). - -Divmod, sadly, is no longer around—it has gone the way of many startups. Luckily, since many of its products were open source, its legacy lives on. - -When Twisted was a young project, there was no clear process for when code was "good enough" to go in. As a result, while some parts were highly polished and reliable, others were alpha quality software—with no way to tell which was which. UQDS was designed as a process to help an existing project with definite quality challenges ramp up its quality while continuing to add features and become more useful. - -UQDS has helped the Twisted project evolve from having frequent regressions and needing multiple release candidates to get a working version, to achieving its current reputation of stability and reliability. - -### UQDS's building blocks - -UQDS was invented by Divmod back in 2006. At that time, Continuous Integration (CI) was in its infancy and modern version control systems, which allow easy branch merging, were barely proofs of concept. Although Divmod did not have today's modern tooling, it put together CI, some ad-hoc tooling to make [Subversion branches][2] work, and a lot of thought into a working process. Thus the UQDS methodology was born. - -UQDS is based upon fundamental building blocks, each with their own carefully considered best practices: - - 1. Tickets - 2. Branches - 3. Tests - 4. Reviews - 5. No exceptions - - - -Let's go into each of those in a little more detail. - -#### Tickets - -In a project using the UQDS methodology, no change is allowed to happen if it's not accompanied by a ticket. This creates a written record of what change is needed and—more importantly—why. - - * Tickets should define clear, measurable goals. - * Work on a ticket does not begin until the ticket contains goals that are clearly defined. - - - -#### Branches - -Branches in UQDS are tightly coupled with tickets. Each branch must solve one complete ticket, no more and no less. If a branch addresses either more or less than a single ticket, it means there was a problem with the ticket definition—or with the branch. Tickets might be split or merged, or a branch split and merged, until congruence is achieved. - -Enforcing that each branch addresses no more nor less than a single ticket—which corresponds to one logical, measurable change—allows a project using UQDS to have fine-grained control over the commits: A single change can be reverted or changes may even be applied in a different order than they were committed. This helps the project maintain a stable and clean codebase. - -#### Tests - -UQDS relies upon automated testing of all sorts, including unit, integration, regression, and static tests. In order for this to work, all relevant tests must pass at all times. Tests that don't pass must either be fixed or, if no longer relevant, be removed entirely. - -Tests are also coupled with tickets. All new work must include tests that demonstrate that the ticket goals are fully met. Without this, the work won't be merged no matter how good it may seem to be. - -A side effect of the focus on tests is that the only platforms that a UQDS-using project can say it supports are those on which the tests run with a CI framework—and where passing the test on the platform is a condition for merging a branch. Without this restriction on supported platforms, the quality of the project is not Ultimate. - -#### Reviews - -While automated tests are important to the quality ensured by UQDS, the methodology never loses sight of the human factor. Every branch commit requires code review, and each review must follow very strict rules: - - 1. Each commit must be reviewed by a different person than the author. - 2. Start with a comment thanking the contributor for their work. - 3. Make a note of something that the contributor did especially well (e.g., "that's the perfect name for that variable!"). - 4. Make a note of something that could be done better (e.g., "this line could use a comment explaining the choices."). - 5. Finish with directions for an explicit next step, typically either merge as-is, fix and merge, or fix and submit for re-review. - - - -These rules respect the time and effort of the contributor while also increasing the sharing of knowledge and ideas. The explicit next step allows the contributor to have a clear idea on how to make progress. - -#### No exceptions - -In any process, it's easy to come up with reasons why you might need to flex the rules just a little bit to let this thing or that thing slide through the system. The most important fundamental building block of UQDS is that there are no exceptions. The entire community works together to make sure that the rules do not flex, not for any reason whatsoever. - -Knowing that all code has been approved by a different person than the author, that the code has complete test coverage, that each branch corresponds to a single ticket, and that this ticket is well considered and complete brings a piece of mind that is too valuable to risk losing, even for a single small exception. The goal is quality, and quality does not come from compromise. - -### A downside to UQDS - -While UQDS has helped Twisted become a highly stable and reliable project, this reliability hasn't come without cost. We quickly found that the review requirements caused a slowdown and backlog of commits to review, leading to slower development. The answer to this wasn't to compromise on quality by getting rid of UQDS; it was to refocus the community priorities such that reviewing commits became one of the most important ways to contribute to the project. - -To help with this, the community developed a bot in the [Twisted IRC channel][3] that will reply to the command `review tickets` with a list of tickets that still need review. The [Twisted review queue][4] website returns a prioritized list of tickets for review. Finally, the entire community keeps close tabs on the number of tickets that need review. It's become an important metric the community uses to gauge the health of the project. - -### Learn more - -The best way to learn about UQDS is to [join the Twisted Community][5] and see it in action. If you'd like more information about the methodology and how it might help your project reach a high level of reliability and stability, have a look at the [UQDS documentation][6] in the Twisted wiki. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/uqds - -作者:[Moshe Zadka][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/moshez -[1]:https://twistedmatrix.com/trac/ -[2]:http://structure.usc.edu/svn/svn.branchmerge.html -[3]:http://webchat.freenode.net/?channels=%23twisted -[4]:https://twisted.reviews -[5]:https://twistedmatrix.com/trac/wiki/TwistedCommunity -[6]:https://twistedmatrix.com/trac/wiki/UltimateQualityDevelopmentSystem diff --git a/sources/talk/20180207 Why Mainframes Aren-t Going Away Any Time Soon.md b/sources/talk/20180207 Why Mainframes Aren-t Going Away Any Time Soon.md deleted file mode 100644 index 7a1a837ff9..0000000000 --- a/sources/talk/20180207 Why Mainframes Aren-t Going Away Any Time Soon.md +++ /dev/null @@ -1,73 +0,0 @@ -Why Mainframes Aren't Going Away Any Time Soon -====== - -![](http://www.datacenterknowledge.com/sites/datacenterknowledge.com/files/styles/article_featured_standard/public/ibm%20z13%20mainframe%202015%20getty.jpg?itok=uB8agshi) - -IBM's last earnings report showed the [first uptick in revenue in more than five years.][1] Some of that growth was from an expected source, cloud revenue, which was up 24 percent year over year and now accounts for 21 percent of Big Blue's take. Another major boost, however, came from a spike in mainframe revenue. Z series mainframe sales were up 70 percent, the company said. - -This may sound somewhat akin to a return to vacuum tube technology in a world where transistors are yesterday's news. In actuality, this is only a sign of the changing face of IT. - -**Related:** [One Click and Voilà, Your Entire Data Center is Encrypted][2] - -Modern mainframes definitely aren't your father's punch card-driven machines that filled entire rooms. These days, they most often run Linux and have found a renewed place in the data center, where they're being called upon to do a lot of heavy lifting. Want to know where the largest instance of Oracle's database runs? It's on a Linux mainframe. How about the largest implementation of SAP on the planet? Again, Linux on a mainframe. - -"Before the advent of Linux on the mainframe, the people who bought mainframes primarily were people who already had them," Leonard Santalucia explained to Data Center Knowledge several months back at the All Things Open conference. "They would just wait for the new version to come out and upgrade to it, because it would run cheaper and faster. - -**Related:** [IBM Designs a “Performance Beast” for AI][3] - -"When Linux came out, it opened up the door to other customers that never would have paid attention to the mainframe. In fact, probably a good three to four hundred new clients that never had mainframes before got them. They don't have any old mainframes hanging around or ones that were upgraded. These are net new mainframes." - -Although Santalucia is CTO at Vicom Infinity, primarily an IBM reseller, at the conference he was wearing his hat as chairperson of the Linux Foundation's Open Mainframe Project. He was joined in the conversation by John Mertic, the project's director of program management. - -Santalucia knows IBM's mainframes from top to bottom, having spent 27 years at Big Blue, the last eight as CTO for the company's systems and technology group. - -"Because of Linux getting started with it back in 1999, it opened up a lot of doors that were closed to the mainframe," he said. "Beforehand it was just z/OS, z/VM, z/VSE, z/TPF, the traditional operating systems. When Linux came along, it got the mainframe into other areas that it never was, or even thought to be in, because of how open it is, and because Linux on the mainframe is no different than Linux on any other platform." - -The focus on Linux isn't the only motivator behind the upsurge in mainframe use in data centers. Increasingly, enterprises with heavy IT needs are finding many advantages to incorporating modern mainframes into their plans. For example, mainframes can greatly reduce power, cooling, and floor space costs. In markets like New York City, where real estate is at a premium, electricity rates are high, and electricity use is highly taxed to reduce demand, these are significant advantages. - -"There was one customer where we were able to do a consolidation of 25 x86 cores to one core on a mainframe," Santalucia said. "They have several thousand machines that are ten and twenty cores each. So, as far as the eye could see in this data center, [x86 server workloads] could be picked up and moved onto this box that is about the size of a sub-zero refrigerator in your kitchen." - -In addition to saving on physical data center resources, this customer by design would likely see better performance. - -"When you look at the workload as it's running on an x86 system, the math, the application code, the I/O to manage the disk, and whatever else is attached to that system, is all run through the same chip," he explained. "On a Z, there are multiple chip architectures built into the system. There's one specifically just for the application code. If it senses the application needs an I/O or some mathematics, it sends it off to a separate processor to do math or I/O, all dynamically handled by the underlying firmware. Your Linux environment doesn't have to understand that. When it's running on a mainframe, it knows it's running on a mainframe and it will exploit that architecture." - -The operating system knows it's running on a mainframe because when IBM was readying its mainframe for Linux it open sourced something like 75,000 lines of code for Linux distributions to use to make sure their OS's were ready for IBM Z. - -"A lot of times people will hear there's 170 processors on the Z14," Santalucia said. "Well, there's actually another 400 other processors that nobody counts in that count of application chips, because it is taken for granted." - -Mainframes are also resilient when it comes to disaster recovery. Santalucia told the story of an insurance company located in lower Manhattan, within sight of the East River. The company operated a large data center in a basement that among other things housed a mainframe backed up to another mainframe located in Upstate New York. When Hurricane Sandy hit in 2012, the data center flooded, electrocuting two employees and destroying all of the servers, including the mainframe. But the mainframe's workload was restored within 24 hours from the remote backup. - -The x86 machines were all destroyed, and the data was never recovered. But why weren't they also backed up? - -"The reason they didn't do this disaster recovery the same way they did with the mainframe was because it was too expensive to have a mirror of all those distributed servers someplace else," he explained. "With the mainframe, you can have another mainframe as an insurance policy that's lower in price, called Capacity BackUp, and it just sits there idling until something like this happens." - -Mainframes are also evidently tough as nails. Santalucia told another story in which a data center in Japan was struck by an earthquake strong enough to destroy all of its x86 machines. The center's one mainframe fell on its side but continued to work. - -The mainframe also comes with built-in redundancy to guard against situations that would be disastrous with x86 machines. - -"What if a hard disk fails on a node in x86?" the Open Mainframe Project's Mertic asked. "You're taking down a chunk of that cluster potentially. With a mainframe you're not. A mainframe just keeps on kicking like nothing's ever happened." - -Mertic added that a motherboard can be pulled from a running mainframe, and again, "the thing keeps on running like nothing's ever happened." - -So how do you figure out if a mainframe is right for your organization? Simple, says Santalucia. Do the math. - -"The approach should be to look at it from a business, technical, and financial perspective -- not just a financial, total-cost-of-acquisition perspective," he said, pointing out that often, costs associated with software, migration, networking, and people are not considered. The break-even point, he said, comes when at least 20 to 30 servers are being migrated to a mainframe. After that point the mainframe has a financial advantage. - -"You can get a few people running the mainframe and managing hundreds or thousands of virtual servers," he added. "If you tried to do the same thing on other platforms, you'd find that you need significantly more resources to maintain an environment like that. Seven people at ADP handle the 8,000 virtual servers they have, and they need seven only in case somebody gets sick. - -"If you had eight thousand servers on x86, even if they're virtualized, do you think you could get away with seven?" - --------------------------------------------------------------------------------- - -via: http://www.datacenterknowledge.com/hardware/why-mainframes-arent-going-away-any-time-soon - -作者:[Christine Hall][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.datacenterknowledge.com/archives/author/christine-hall -[1]:http://www.datacenterknowledge.com/ibm/mainframe-sales-fuel-growth-ibm -[2]:http://www.datacenterknowledge.com/design/one-click-and-voil-your-entire-data-center-encrypted -[3]:http://www.datacenterknowledge.com/design/ibm-designs-performance-beast-ai diff --git a/sources/talk/20180209 Arch Anywhere Is Dead, Long Live Anarchy Linux.md b/sources/talk/20180209 Arch Anywhere Is Dead, Long Live Anarchy Linux.md deleted file mode 100644 index c3c78e84ad..0000000000 --- a/sources/talk/20180209 Arch Anywhere Is Dead, Long Live Anarchy Linux.md +++ /dev/null @@ -1,127 +0,0 @@ -Arch Anywhere Is Dead, Long Live Anarchy Linux -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_main.jpg?itok=fyBpTjQW) - -Arch Anywhere was a distribution aimed at bringing Arch Linux to the masses. Due to a trademark infringement, Arch Anywhere has been completely rebranded to [Anarchy Linux][1]. And I’m here to say, if you’re looking for a distribution that will enable you to enjoy Arch Linux, a little Anarchy will go a very long way. This distribution is seriously impressive in what it sets out to do and what it achieves. In fact, anyone who previously feared Arch Linux can set those fears aside… because Anarchy Linux makes Arch Linux easy. - -Let’s face it; Arch Linux isn’t for the faint of heart. The installation alone will turn off many a new user (and even some seasoned users). That’s where distributions like Anarchy make for an easy bridge to Arch. With a live ISO that can be tested and then installed, Arch becomes as user-friendly as any other distribution. - -Anarchy Linux goes a little bit further than that, however. Let’s fire it up and see what it does. - -### The installation - -The installation of Anarchy Linux isn’t terribly challenging, but it’s also not quite as simple as for, say, [Ubuntu][2], [Linux Mint][3], or [Elementary OS][4]. Although you can run the installer from within the default graphical desktop environment (Xfce4), it’s still much in the same vein as Arch Linux. In other words, you’re going to have to do a bit of work—all within a text-based installer. - -To start, the very first step of the installer (Figure 1) requires you to update the mirror list, which will likely trip up new users. - -![Updating the mirror][6] - -Figure 1: Updating the mirror list is a necessity for the Anarchy Linux installation. - -[Used with permission][7] - -From the options, select Download & Rank New Mirrors. Tab down to OK and hit Enter on your keyboard. You can then select the nearest mirror (to your location) and be done with it. The next few installation screens are simple (keyboard layout, language, timezone, etc.). The next screen should surprise many an Arch fan. Anarchy Linux includes an auto partition tool. Select Auto Partition Drive (Figure 2), tab down to Ok, and hit Enter on your keyboard. - -![partitioning][9] - -Figure 2: Anarchy makes partitioning easy. - -[Used with permission][7] - -You will then have to select the drive to be used (if you only have one drive this is only a matter of hitting Enter). Once you’ve selected the drive, choose the filesystem type to be used (ext2/3/4, btrfs, jfs, reiserfs, xfs), tab down to OK, and hit Enter. Next you must choose whether you want to create SWAP space. If you select Yes, you’ll then have to define how much SWAP to use. The next window will stop many new users in their tracks. It asks if you want to use GPT (GUID Partition Table). This is different than the traditional MBR (Master Boot Record) partitioning. GPT is a newer standard and works better with UEFI. If you’ll be working with UEFI, go with GPT, otherwise, stick with the old standby, MBR. Finally select to write the changes to the disk, and your installation can continue. - -The next screen that could give new users pause, requires the selection of the desired installation. There are five options: - - * Anarchy-Desktop - - * Anarchy-Desktop-LTS - - * Anarchy-Server - - * Anarchy-Server-LTS - - * Anarchy-Advanced - - - - -If you want long term support, select Anarchy-Desktop-LTS, otherwise click Anarchy-Desktop (the default), and tab down to Ok. Click Enter on your keyboard. After you select the type of installation, you will get to select your desktop. You can select from five options: Budgie, Cinnamon, GNOME, Openbox, and Xfce4. -Once you’ve selected your desktop, give the machine a hostname, set the root password, create a user, and enable sudo for the new user (if applicable). The next section that will raise the eyebrows of new users is the software selection window (Figure 3). You must go through the various sections and select which software packages to install. Don’t worry, if you miss something, you can always installed it later. - - -![software][11] - -Figure 3: Selecting the software you want on your system. - -[Used with permission][7] - -Once you’ve made your software selections, tab to Install (Figure 4), and hit Enter on your keyboard. - -![ready to install][13] - -Figure 4: Everything is ready to install. - -[Used with permission][7] - -Once the installation completes, reboot and enjoy Anarchy. - -### Post install - -I installed two versions of Anarchy—one with Budgie and one with GNOME. Both performed quite well, however you might be surprised to see that the version of GNOME installed is decked out with a dock. In fact, comparing the desktops side-by-side and they do a good job of resembling one another (Figure 5). - -![GNOME and Budgie][15] - -Figure 5: GNOME is on the right, Budgie is on the left. - -[Used with permission][7] - -My guess is that you’ll find all desktop options for Anarchy configured in such a way to offer a similar look and feel. Of course, the second you click on the bottom left “buttons”, you’ll see those similarities immediately disappear (Figure 6). - -![GNOME and Budgie][17] - -Figure 6: The GNOME Dash and the Budgie menu are nothing alike. - -[Used with permission][7] - -Regardless of which desktop you select, you’ll find everything you need to install new applications. Open up your desktop menu of choice and select Packages to search for and install whatever is necessary for you to get your work done. - -### Why use Arch Linux without the “Arch”? - -This is a valid question. The answer is simple, but revealing. Some users may opt for a distribution like [Arch Linux][18] because they want the feeling of “elitism” that comes with using, say, [Gentoo][19], without having to go through that much hassle. With regards to complexity, Arch rests below Gentoo, which means it’s accessible to more users. However, along with that complexity in the platform, comes a certain level of dependability that may not be found in others. So if you’re looking for a Linux distribution with high stability, that’s not quite as challenging as Gentoo or Arch to install, Anarchy might be exactly what you want. In the end, you’ll wind up with an outstanding desktop platform that’s easy to work with (and maintain), based on a very highly regarded distribution of Linux. - -That’s why you might opt for Arch Linux without the Arch. - -Anarchy Linux is one of the finest “user-friendly” takes on Arch Linux I’ve ever had the privilege of using. Without a doubt, if you’re looking for a friendlier version of a rather challenging desktop operating system, you cannot go wrong with Anarchy. - -Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/intro-to-linux/2018/2/arch-anywhere-dead-long-live-anarchy-linux - -作者:[Jack Wallen][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/jlwallen -[1]:https://anarchy-linux.org/ -[2]:https://www.ubuntu.com/ -[3]:https://linuxmint.com/ -[4]:https://elementary.io/ -[6]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_install_1.jpg?itok=WgHRqFTf (Updating the mirror) -[7]:https://www.linux.com/licenses/category/used-permission -[9]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_install_2.jpg?itok=D7HkR97t (partitioning) -[10]:/files/images/anarchyinstall3jpg -[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_install_3.jpg?itok=5-9E2u0S (software) -[12]:/files/images/anarchyinstall4jpg -[13]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_install_4.jpg?itok=fuSZqtZS (ready to install) -[14]:/files/images/anarchyinstall5jpg -[15]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_install_5.jpg?itok=4y9kiC8I (GNOME and Budgie) -[16]:/files/images/anarchyinstall6jpg -[17]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anarchy_install_6.jpg?itok=fJ7Lmdci (GNOME and Budgie) -[18]:https://www.archlinux.org/ -[19]:https://www.gentoo.org/ -[20]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/sources/talk/20180209 How writing can change your career for the better, even if you don-t identify as a writer.md b/sources/talk/20180209 How writing can change your career for the better, even if you don-t identify as a writer.md deleted file mode 100644 index 55618326c6..0000000000 --- a/sources/talk/20180209 How writing can change your career for the better, even if you don-t identify as a writer.md +++ /dev/null @@ -1,149 +0,0 @@ -How writing can change your career for the better, even if you don't identify as a writer -====== -Have you read Marie Kondo's book [The Life-Changing Magic of Tidying Up][1]? Or did you, like me, buy it and read a little bit and then add it to the pile of clutter next to your bed? - -Early in the book, Kondo talks about keeping possessions that "spark joy." In this article, I'll examine ways writing about what we and other people are doing in the open source world can "spark joy," or at least how writing can improve your career in unexpected ways. - -Because I'm a community manager and editor on Opensource.com, you might be thinking, "She just wants us to [write for Opensource.com][2]." And that is true. But everything I will tell you about why you should write is true, even if you never send a story in to Opensource.com. Writing can change your career for the better, even if you don't identify as a writer. Let me explain. - -### How I started writing - -Early in the first decade of my career, I transitioned from a customer service-related role at a tech publishing company into an editing role on Sys Admin Magazine. I was plugging along, happily laying low in my career, and then that all changed when I started writing about open source technologies and communities, and the people in them. But I did _not_ start writing voluntarily. The tl;dr: of it is that my colleagues at Linux New Media eventually talked me into launching our first blog on the [Linux Pro Magazine][3] site. And as it turns out, it was one of the best career decisions I've ever made. I would not be working on Opensource.com today had I not started writing about what other people in open source were doing all those years ago. - -When I first started writing, my goal was to raise awareness of the company I worked for and our publications, while also helping raise the visibility of women in tech. But soon after I started writing, I began seeing unexpected results. - -#### My network started growing - -When I wrote about a person, an organization, or a project, I got their attention. Suddenly the people I wrote about knew who I was. And because I was sharing knowledge—that is to say, I wasn't being a critic—I'd generally become an ally, and in many cases, a friend. I had a platform and an audience, and I was sharing them with other people in open source. - -#### I was learning - -In addition to promoting our website and magazine and growing my network, the research and fact-checking I did when writing articles helped me become more knowledgeable in my field and improve my tech chops. - -#### I started meeting more people IRL - -When I went to conferences, I found that my blog posts helped me meet people. I introduced myself to people I'd written about or learned about during my research, and I met new people to interview. People started knowing who I was because they'd read my articles. Sometimes people were even excited to meet me because I'd highlighted them, their projects, or someone or something they were interested in. I had no idea writing could be so exciting and interesting away from the keyboard. - -#### My conference talks improved - -I started speaking at events about a year after launching my blog. A few years later, I started writing articles based on my talks prior to speaking at events. The process of writing the articles helps me organize my talks and slides, and it was a great way to provide "notes" for conference attendees, while sharing the topic with a larger international audience that wasn't at the event in person. - -### What should you write about? - -Maybe you're interested in writing, but you struggle with what to write about. You should write about two things: what you know, and what you don't know. - -#### Write about what you know - -Writing about what you know can be relatively easy. For example, a script you wrote to help automate part of your daily tasks might be something you don't give any thought to, but it could make for a really exciting article for someone who hates doing that same task every day. That could be a relatively quick, short, and easy article for you to write, and you might not even think about writing it. But it could be a great contribution to the open source community. - -#### Write about what you don't know - -Writing about what you don't know can be much harder and more time consuming, but also much more fulfilling and help your career. I've found that writing about what I don't know helps me learn, because I have to research it and understand it well enough to explain it. - -> "When I write about a technical topic, I usually learn a lot more about it. I want to make sure my article is as good as it can be. So even if I'm writing about something I know well, I'll research the topic a bit more so I can make sure to get everything right." ~Jim Hall, FreeDOS project leader - -For example, I wanted to learn about machine learning, and I thought narrowing down the topic would help me get started. My team mate Jason Baker suggested that I write an article on the [Top 3 machine learning libraries for Python][4], which gave me a focus for research. - -The process of researching that article inspired another article, [3 cool machine learning projects using TensorFlow and the Raspberry Pi][5]. That article was also one of our most popular last year. I'm not an _expert_ on machine learning now, but researching the topic with writing an article in mind allowed me to give myself a crash course in the topic. - -### Why people in tech write - -Now let's look at a few benefits of writing that other people in tech have found. I emailed the Opensource.com writers' list and asked, and here's what writers told me. - -#### Grow your network or your project community - -Xavier Ho wrote for us for the first time last year ("[A programmer's cleaning guide for messy sensor data][6]"). He says: "I've been getting Twitter mentions from all over the world, including Spain, US, Australia, Indonesia, the UK, and other European countries. It shows the article is making some impact... This is the kind of reach I normally don't have. Hope it's really helping someone doing similar work!" - -#### Help people - -Writing about what other people are working on is a great way to help your fellow community members. Antoine Thomas, who wrote "[Linux helped me grow as a musician][7]", says, "I began to use open source years ago, by reading tutorials and documentation. That's why now I share my tips and tricks, experience or knowledge. It helped me to get started, so I feel that it's my turn to help others to get started too." - -#### Give back to the community - -[Jim Hall][8], who started the [FreeDOS project][9], says, "I like to write ... because I like to support the open source community by sharing something neat. I don't have time to be a program maintainer anymore, but I still like to do interesting stuff. So when something cool comes along, I like to write about it and share it." - -#### Highlight your community - -Emilio Velis wrote an article, "[Open hardware groups spread across the globe][10]", about projects in Central and South America. He explains, "I like writing about specific aspects of the open culture that are usually enclosed in my region (Latin America). I feel as if smaller communities and their ideas are hidden from the mainstream, so I think that creating this sense of broadness in participation is what makes some other cultures as valuable." - -#### Gain confidence - -[Don Watkins][11] is one of our regular writers and a [community moderator][12]. He says, "When I first started writing I thought I was an impostor, later I realized that many people feel that way. Writing and contributing to Opensource.com has been therapeutic, too, as it contributed to my self esteem and helped me to overcome feelings of inadequacy. … Writing has given me a renewed sense of purpose and empowered me to help others to write and/or see the valuable contributions that they too can make if they're willing to look at themselves in a different light. Writing has kept me younger and more open to new ideas." - -#### Get feedback - -One of our writers described writing as a feedback loop. He said that he started writing as a way to give back to the community, but what he found was that community responses give back to him. - -Another writer, [Stuart Keroff][13] says, "Writing for Opensource.com about the program I run at school gave me valuable feedback, encouragement, and support that I would not have had otherwise. Thousands upon thousands of people heard about the Asian Penguins because of the articles I wrote for the website." - -#### Exhibit expertise - -Writing can help you show that you've got expertise in a subject, and having writing samples on well-known websites can help you move toward better pay at your current job, get a new role at a different organization, or start bringing in writing income. - -[Jeff Macharyas][14] explains, "There are several ways I've benefitted from writing for Opensource.com. One, is the credibility I can add to my social media sites, resumes, bios, etc., just by saying 'I am a contributing writer to Opensource.com.' … I am hoping that I will be able to line up some freelance writing assignments, using my Opensource.com articles as examples, in the future." - -### Where should you publish your articles? - -That depends. Why are you writing? - -You can always post on your personal blog, but if you don't already have a lot of readers, your article might get lost in the noise online. - -Your project or company blog is a good option—again, you'll have to think about who will find it. How big is your company's reach? Or will you only get the attention of people who already give you their attention? - -Are you trying to reach a new audience? A bigger audience? That's where sites like Opensource.com can help. We attract more than a million page views a month, and more than 700,000 unique visitors. Plus you'll work with editors who will polish and help promote your article. - -We aren't the only site interested in your story. What are your favorite sites to read? They might want to help you share your story, and it's ok to pitch to multiple publications. Just be transparent about whether your article has been shared on other sites when working with editors. Occasionally, editors can even help you modify articles so that you can publish variations on multiple sites. - -#### Do you want to get rich by writing? (Don't count on it.) - -If your goal is to make money by writing, pitch your article to publications that have author budgets. There aren't many of them, the budgets don't tend to be huge, and you will be competing with experienced professional tech journalists who write seven days a week, 365 days a year, with large social media followings and networks. I'm not saying it can't be done—I've done it—but I am saying don't expect it to be easy or lucrative. It's not. (And frankly, I've found that nothing kills my desire to write much like having to write if I want to eat...) - -A couple of people have asked me whether Opensource.com pays for content, or whether I'm asking someone to write "for exposure." Opensource.com does not have an author budget, but I won't tell you to write "for exposure," either. You should write because it meets a need. - -If you already have a platform that meets your needs, and you don't need editing or social media and syndication help: Congratulations! You are privileged. - -### Spark joy! - -Most people don't know they have a story to tell, so I'm here to tell you that you probably do, and my team can help, if you just submit a proposal. - -Most people—myself included—could use help from other people. Sites like Opensource.com offer one way to get editing and social media services at no cost to the writer, which can be hugely valuable to someone starting out in their career, someone who isn't a native English speaker, someone who wants help with their project or organization, and so on. - -If you don't already write, I hope this article helps encourage you to get started. Or, maybe you already write. In that case, I hope this article makes you think about friends, colleagues, or people in your network who have great stories and experiences to share. I'd love to help you help them get started. - -I'll conclude with feedback I got from a recent writer, [Mario Corchero][15], a Senior Software Developer at Bloomberg. He says, "I wrote for Opensource because you told me to :)" (For the record, I "invited" him to write for our [PyCon speaker series][16] last year.) He added, "And I am extremely happy about it—not only did it help me at my workplace by gaining visibility, but I absolutely loved it! The article appeared in multiple email chains about Python and was really well received, so I am now looking to publish the second :)" Then he [wrote for us][17] again. - -I hope you find writing to be as fulfilling as we do. - -You can connect with Opensource.com editors, community moderators, and writers in our Freenode [IRC][18] channel #opensource.com, and you can reach me and the Opensource.com team by email at [open@opensource.com][19]. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/career-changing-magic-writing - -作者:[Rikki Endsley][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/rikki-endsley -[1]:http://tidyingup.com/books/the-life-changing-magic-of-tidying-up-hc -[2]:https://opensource.com/how-submit-article -[3]:http://linuxpromagazine.com/ -[4]:https://opensource.com/article/17/2/3-top-machine-learning-libraries-python -[5]:https://opensource.com/article/17/2/machine-learning-projects-tensorflow-raspberry-pi -[6]:https://opensource.com/article/17/9/messy-sensor-data -[7]:https://opensource.com/life/16/9/my-linux-story-musician -[8]:https://opensource.com/users/jim-hall -[9]:http://www.freedos.org/ -[10]:https://opensource.com/article/17/6/open-hardware-latin-america -[11]:https://opensource.com/users/don-watkins -[12]:https://opensource.com/community-moderator-program -[13]:https://opensource.com/education/15/3/asian-penguins-Linux-middle-school-club -[14]:https://opensource.com/users/jeffmacharyas -[15]:https://opensource.com/article/17/5/understanding-datetime-python-primer -[16]:https://opensource.com/tags/pycon -[17]:https://opensource.com/article/17/9/python-logging -[18]:https://opensource.com/article/16/6/getting-started-irc -[19]:mailto:open@opensource.com diff --git a/sources/talk/20180209 Why an involved user community makes for better software.md b/sources/talk/20180209 Why an involved user community makes for better software.md deleted file mode 100644 index 2b51023e44..0000000000 --- a/sources/talk/20180209 Why an involved user community makes for better software.md +++ /dev/null @@ -1,47 +0,0 @@ -Why an involved user community makes for better software -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_cubestalk.png?itok=Ozw4NhGW) - -Imagine releasing a major new infrastructure service based on open source software only to discover that the product you deployed had evolved so quickly that the documentation for the version you released is no longer available. At Bloomberg, we experienced this problem firsthand in our deployment of OpenStack. In late 2016, we spent six months testing and rolling out [Liberty][1] on our OpenStack environment. By that time, Liberty was about a year old, or two versions behind the latest build. - -As our users started taking advantage of its new functionality, we found ourselves unable to solve a few tricky problems and to answer some detailed questions about its API. When we went looking for Liberty's documentation, it was nowhere to be found on the OpenStack website. Liberty, it turned out, had been labeled "end of life" and was no longer supported by the OpenStack developer community. - -The disappearance wasn't intentional, rather the result of a development community that had not anticipated the real-world needs of users. The documentation was stored in the source branch along with the source code, and, as Liberty was superseded by newer versions, it had been deleted. Worse, in the intervening months, the documentation for the newer versions had been completely restructured, and there was no way to easily rebuild it in a useful form. And believe me, we tried. - -The disappearance wasn't intentional, rather the result of a development community that had not anticipated the real-world needs of users. ]After consulting other users and our vendor, we found that OpenStack's development cadence of two releases per year had created some unintended, yet deeply frustrating, consequences. Older releases that were typically still widely in use were being superseded and effectively killed for the purposes of support. - -Eventually, conversations took place between OpenStack users and developers that resulted in changes. Documentation was moved out of the source branch, and users can now build documentation for whatever version they're using—more or less indefinitely. The problem was solved. (I'm especially indebted to my colleague [Chris Morgan][2], who was knee-deep in this effort and first wrote about it in detail for the [OpenStack Superuser blog][3].) - -Many other enterprise users were in the same boat as Bloomberg—running older versions of OpenStack that are three or four versions behind the latest build. There's a good reason for that: On average it takes a reasonably large enterprise about six months to qualify, test, and deploy a new version of OpenStack. And, from my experience, this is generally true of most open source infrastructure projects. - -For most of the past decade, companies like Bloomberg that adopted open source software relied on distribution vendors to incorporate, test, verify, and support much of it. These vendors provide long-term support (LTS) releases, which enable enterprise users to plan for upgrades on a two- or three-year cycle, knowing they'll still have support for a year or two, even if their deployment schedule slips a bit (as they often do). In the past few years, though, infrastructure software has advanced so rapidly that even the distribution vendors struggle to keep up. And customers of those vendors are yet another step removed, so many are choosing to deploy this type of software without vendor support. - -Losing vendor support also usually means there are no LTS releases; OpenStack, Kubernetes, and Prometheus, and many more, do not yet provide LTS releases of their own. As a result, I'd argue that healthy interaction between the development and user community should be high on the list of considerations for adoption of any open source infrastructure. Do the developers building the software pay attention to the needs—and frustrations—of the people who deploy it and make it useful for their enterprise? - -There is a solid model for how this should happen. We recently joined the [Cloud Native Computing Foundation][4], part of The Linux Foundation. It has a formal [end-user community][5], whose members include organizations just like us: enterprises that are trying to make open source software useful to their internal customers. Corporate members also get a chance to have their voices heard as they vote to select a representative to serve on the CNCF [Technical Oversight Committee][6]. Similarly, in the OpenStack community, Bloomberg is involved in the semi-annual Operators Meetups, where companies who deploy and support OpenStack for their own users get together to discuss their challenges and provide guidance to the OpenStack developer community. - -The past few years have been great for open source infrastructure. If you're working for a large enterprise, the opportunity to deploy open source projects like the ones mentioned above has made your company more productive and more agile. - -As large companies like ours begin to consume more open source software to meet their infrastructure needs, they're going to be looking at a long list of considerations before deciding what to use: license compatibility, out-of-pocket costs, and the health of the development community are just a few examples. As a result of our experiences, we'll add the presence of a vibrant and engaged end-user community to the list. - -Increased reliance on open source infrastructure projects has also highlighted a key problem: People in the development community have little experience deploying the software they work on into production environments or supporting the people who use it to get things done on a daily basis. The fast pace of updates to these projects has created some unexpected problems for the people who deploy and use them. There are numerous examples I can cite where open source projects are updated so frequently that new versions will, usually unintentionally, break backwards compatibility. - -As open source increasingly becomes foundational to the operation of so many enterprises, this cannot be allowed to happen, and members of the user community should assert themselves accordingly and press for the creation of formal representation. In the end, the software can only be better. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/important-conversation - -作者:[Kevin P.Fleming][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/kpfleming -[1]:https://releases.openstack.org/liberty/ -[2]:https://www.linkedin.com/in/mihalis68/ -[3]:http://superuser.openstack.org/articles/openstack-at-bloomberg/ -[4]:https://www.cncf.io/ -[5]:https://www.cncf.io/people/end-user-community/ -[6]:https://www.cncf.io/people/technical-oversight-committee/ diff --git a/sources/talk/20180214 Can anonymity and accountability coexist.md b/sources/talk/20180214 Can anonymity and accountability coexist.md deleted file mode 100644 index 8b15ed169c..0000000000 --- a/sources/talk/20180214 Can anonymity and accountability coexist.md +++ /dev/null @@ -1,79 +0,0 @@ -Can anonymity and accountability coexist? -========================================= - -Anonymity might be a boon to more open, meritocratic organizational cultures. But does it conflict with another important value: accountability? - -![Can anonymity and accountability coexist?](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/GOV_Transparency_B.png?itok=SkP1mUt5 "Can anonymity and accountability coexist?") - -Image by :opensource.com - -### Get the newsletter - -Join the 85,000 open source advocates who receive our giveaway alerts and article roundups. - -Whistleblowing protections, crowdsourcing, anonymous voting processes, and even Glassdoor reviews—anonymous speech may take many forms in organizations. - -As well-established and valued as these anonymous feedback mechanisms may be, anonymous speech becomes a paradoxical idea when one considers how to construct a more open organization. While an inability to discern speaker identity seems non-transparent, an opportunity for anonymity may actually help achieve a _more inclusive and meritocratic_ environment. - -More about open organizations - -* [Download free Open Org books](https://opensource.com/open-organization/resources/book-series?src=too_resource_menu1a) -* [What is an Open Organization?](https://opensource.com/open-organization/resources/open-org-definition?src=too_resource_menu2a) -* [How open is your organization?](https://opensource.com/open-organization/resources/open-org-maturity-model?src=too_resource_menu3a) -* [What is an Open Decision?](https://opensource.com/open-organization/resources/open-decision-framework?src=too_resource_menu4a) -* [The Open Org two years later](https://www.redhat.com/en/about/blog/open-organization-two-years-later-and-going-strong?src=too_resource_menu4b&intcmp=70160000000h1s6AAA) - -But before allowing outlets for anonymous speech to propagate, however, leaders of an organization should carefully reflect on whether an organization's "closed" practices make anonymity the unavoidable alternative to free, non-anonymous expression. Though some assurance of anonymity is necessary in a few sensitive and exceptional scenarios, dependence on anonymous feedback channels within an organization may stunt the normalization of a culture that encourages diversity and community. - -### The benefits of anonymity - -In the case of [_Talley v. California (1960)_](https://supreme.justia.com/cases/federal/us/362/60/case.html), the Supreme Court voided a city ordinance prohibiting the anonymous distribution of handbills, asserting that "there can be no doubt that such an identification requirement would tend to restrict freedom to distribute information and thereby freedom of expression." Our judicial system has legitimized the notion that the protection of anonymity facilitates the expression of otherwise unspoken ideas. A quick scroll through any [subreddit](https://www.reddit.com/reddits/) exemplifies what the Court has codified: anonymity can foster [risk-taking creativity](https://www.reddit.com/r/sixwordstories/) and the [inclusion and support of marginalized voices](https://www.reddit.com/r/MyLittleSupportGroup/). Anonymity empowers individuals by granting them the safety to speak without [detriment to their reputations or, more importantly, their physical selves.](https://www.psychologytoday.com/blog/the-compassion-chronicles/201711/why-dont-victims-sexual-harassment-come-forward-sooner) - -For example, an anonymous suggestion program to garner ideas from members or employees in an organization may strengthen inclusivity and enhance the diversity of suggestions the organization receives. It would also make for a more meritocratic decision-making process, as anonymity would ensure that the quality of the articulated idea, rather than the rank and reputation of the articulator, is what's under evaluation. Allowing members to anonymously vote for anonymously-submitted ideas would help curb the influence of office politics in decisions affecting the organization's growth. - -### The harmful consequences of anonymity - -Yet anonymity and the open value of _accountability_ may come into conflict with one another. For instance, when establishing anonymous programs to drive greater diversity and more meritocratic evaluation of ideas, organizations may need to sacrifice the ability to hold speakers accountable for the opinions they express. - -Reliance on anonymous speech for serious organizational decision-making may also contribute to complacency in an organizational culture that falls short of openness. Outlets for anonymous speech may be as similar to open as crowdsourcing is—or rather, is not. [Like efforts to crowdsource creative ideas](https://opensource.com/business/10/4/why-open-source-way-trumps-crowdsourcing-way), anonymous suggestion programs may create an organizational environment in which diverse perspectives are only valued when an organization's leaders find it convenient to take advantage of members' ideas. - -Anonymity and the open value of accountability may come into conflict with one another. - -A similar concern holds for anonymous whistle-blowing or concern submission. Though anonymity is important for sexual harassment and assault reporting, regularly redirecting member concerns and frustrations to a "complaints box" makes it more difficult for members to hold their organization's leaders accountable for acting on concerns. It may also hinder intra-organizational support networks and advocacy groups from forming around shared concerns, as members would have difficulty identifying others with similar experiences. For example, many working mothers might anonymously submit requests for a lactation room in their workplace, then falsely attribute a lack of action from leaders to a lack of similar concerns from others. - -### An anonymity checklist - -Organizations in which anonymous speech is the primary mode of communication, like subreddits, have generated innovative works and thought-provoking discourse. These anonymous networks call attention to the potential for anonymity to help organizations pursue open values of diversity and meritocracy. Organizations in which anonymous speech is _not_ the main form of communication should acknowledge the strengths of anonymous speech, but carefully consider whether anonymity is the wisest means to the goal of sustainable openness. - -Leaders may find reflecting on the following questions useful prior to establishing outlets for anonymous feedback within their organizations: - -1\. _Availability of additional communication mechanisms_: Rather than investing time and resources into establishing a new, anonymous channel for communication, can the culture or structure of existing avenues of communication be reconfigured to achieve the same goal? This question echoes the open source affinity toward realigning, rather than reinventing, the wheel. - -2\. _Failure of other communication avenues:_ How and why is the organization ill-equipped to handle the sensitive issue/situation at hand through conventional (i.e. non-anonymous) means of communication? - -Careful deliberation on these questions may help prevent outlets for anonymous speech from leading to a dangerous sense of complacency. - -3\. _Consequences of anonymity:_ If implemented, could the anonymous mechanism stifle the normalization of face-to-face discourse about issues important to the organization's growth? If so, how can leaders ensure that members consider the anonymous communication channel a "last resort," without undermining the legitimacy of the anonymous system? - -4\. _Designing the anonymous communication channel:_ How can accountability be promoted in anonymous communication without the ability to determine the identity of speakers? - -5\. _Long-term considerations_: Is the anonymous feedback mechanism sustainable, or a temporary solution to a larger organizational issue? If the latter, is [launching a campaign](https://opensource.com/open-organization/16/6/8-steps-more-open-communications) to address overarching problems with the organization's communication culture feasible? - -These five points build off of one another to help leaders recognize the tradeoffs involved in legitimizing anonymity within their organization. Careful deliberation on these questions may help prevent outlets for anonymous speech from leading to a dangerous sense of complacency with a non-inclusive organizational structure. - -About the author ----------------- - -[![](https://opensource.com/sites/default/files/styles/profile_pictures/public/osdc_default_avatar_1.png?itok=mmbfqFXm)](https://opensource.com/users/susiechoi) - -Susie Choi - Susie is an undergraduate student studying computer science at Duke University. She is interested in the implications of technological innovation and open source principles for issues relating to education and socioeconomic inequality. - -[More about me](https://opensource.com/users/susiechoi) - -* * * - -via: [https://opensource.com/open-organization/18/1/balancing-accountability-and-anonymity](https://opensource.com/open-organization/18/1/balancing-accountability-and-anonymity) - -作者: [Susie Choi](https://opensource.com/users/susiechoi) 选题者: [@lujun9972](https://github.com/lujun9972) 译者: [译者ID](https://github.com/译者ID) 校对: [校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/sources/talk/20180216 Q4OS Makes Linux Easy for Everyone.md b/sources/talk/20180216 Q4OS Makes Linux Easy for Everyone.md deleted file mode 100644 index a868ed28d5..0000000000 --- a/sources/talk/20180216 Q4OS Makes Linux Easy for Everyone.md +++ /dev/null @@ -1,140 +0,0 @@ -Q4OS Makes Linux Easy for Everyone -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/q4os-main.png?itok=WDatcV-a) - -Modern Linux distributions tend to target a variety of users. Some claim to offer a flavor of the open source platform that anyone can use. And, I’ve seen some such claims succeed with aplomb, while others fall flat. [Q4OS][1] is one of those odd distributions that doesn’t bother to make such a claim but pulls off the feat anyway. - -So, who is the primary market for Q4OS? According to its website, the distribution is a: - -“fast and powerful operating system based on the latest technologies while offering highly productive desktop environment. We focus on security, reliability, long-term stability and conservative integration of verified new features. System is distinguished by speed and very low hardware requirements, runs great on brand new machines as well as legacy computers. It is also very applicable for virtualization and cloud computing.” - -What’s very interesting here is that the Q4OS developers offer commercial support for the desktop. Said support can cover the likes of system customization (including core level API programming) as well as user interface modifications. - -Once you understand this (and have installed Q4OS), the target audience becomes quite obvious: Business users looking for a Windows XP/7 replacement. But that should not prevent home users from giving Q4OS at try. It’s a Linux distribution that has a few unique tools that come together to make a solid desktop distribution. - -Let’s take a look at Q4OS and see if it’s a version of Linux that might work for you. - -### What Q4OS all about - -Q4OS that does an admirable job of being the open source equivalent of Windows XP/7. Out of the box, it pulls this off with the help of the [Trinity Desktop][2] (a fork of KDE). With a few tricks up its sleeve, Q4OS turns the Trinity Desktop into a remarkably similar desktop (Figure 1). - -![default desktop][4] - -Figure 1: The Q4OS default desktop. - -[Used with permission][5] - -When you fire up the desktop, you will be greeted by a Welcome screen that makes it very easy for new users to start setting up their desktop with just a few clicks. From this window, you can: - - * Run the Desktop Profiler (which allows you to select which desktop environment to use as well as between a full-featured desktop, a basic desktop, or a minimal desktop—Figure 2). - - * Install applications (which opens the Synaptic Package Manager). - - * Install proprietary codecs (which installs all the necessary media codecs for playing audio and video). - - * Turn on Desktop effects (if you want more eye candy, turn this on). - - * Switch to Kickoff start menu (switches from the default start menu to the newer kickoff menu). - - * Set Autologin (allows you to set login such that it won’t require your password upon boot). - - - - -![Desktop Profiler][7] - -Figure 2: The Desktop Profiler allows you to further customize your desktop experience. - -[Used with permission][5] - -If you want to install a different desktop environment, open up the Desktop Profiler and then click the Desktop environments drop-down, in the upper left corner of the window. A new window will appear, where you can select your desktop of choice from the drop-down (Figure 3). Once back at the main Profiler Window, select which type of desktop profile you want, and then click Install. - -![Desktop Profiler][9] - -Figure 3: Installing a different desktop is quite simple from within the Desktop Profiler. - -[Used with permission][5] - -Note that installing a different desktop will not wipe the default desktop. Instead, it will allow you to select between the two desktops (at the login screen). - -### Installed software - -After selecting full-featured desktop, from the Desktop Profiler, I found the following user applications ready to go: - - * LibreOffice 5.2.7.2 - - * VLC 2.2.7 - - * Google Chrome 64.0.3282 - - * Thunderbird 52.6.0 (Includes Lightning addon) - - * Synaptic 0.84.2 - - * Konqueror 14.0.5 - - * Firefox 52.6.0 - - * Shotwell 0.24.5 - - - - -Obviously some of those applications are well out of date. Since this distribution is based on Debian, we can run and update/upgrade with the commands: -``` -sudo apt update - -sudo apt upgrade - -``` - -However, after running both commands, it seems everything is up to date. This particular release (2.4) is an LTS release (supported until 2022). Because of this, expect software to be a bit behind. If you want to test out the bleeding edge version (based on Debian “Buster”), you can download the testing image [here][10]. - -### Security oddity - -There is one rather disturbing “feature” found in Q4OS. In the developer’s quest to make the distribution closely resemble Windows, they’ve made it such that installing software (from the command line) doesn’t require a password! You read that correctly. If you open the Synaptic package manager, you’re asked for a password. However (and this is a big however), open up a terminal window and issue a command like sudo apt-get install gimp. At this point, the software will install… without requiring the user to type a sudo password. - -Did you cringe at that? You should. - -I get it, the developers want to ease away the burden of Linux and make a platform the masses could easily adapt to. They’ve done a splendid job of doing just that. However, in the process of doing so, they’ve bypassed a crucial means of security. Is having as near an XP/7 clone as you can find on Linux worth that lack of security? I would say that if it enables more people to use Linux, then yes. But the fact that they’ve required a password for Synaptic (the GUI tool most Windows users would default to for software installation) and not for the command-line tool makes no sense. On top of that, bypassing passwords for the apt and dpkg commands could make for a significant security issue. - -Fear not, there is a fix. For those that prefer to require passwords for the command line installation of software, you can open up the file /etc/sudoers.d/30_q4os_apt and comment out the following three lines: -``` -%sudo ALL = NOPASSWD: /usr/bin/apt-get * - -%sudo ALL = NOPASSWD: /usr/bin/apt-key * - -%sudo ALL = NOPASSWD: /usr/bin/dpkg * - -``` - -Once commented out, save and close the file, and reboot the system. At this point, users will now be prompted for a password, should they run the apt-get, apt-key, or dpkg commands. - -### A worthy contender - -Setting aside the security curiosity, Q4OS is one of the best attempts at recreating Windows XP/7 I’ve come across in a while. If you have users who fear change, and you want to migrate them away from Windows, this distribution might be exactly what you need. I would, however, highly recommend you re-enable passwords for the apt-get, apt-key, and dpkg commands… just to be on the safe side. - -In any case, the addition of the Desktop Profiler, and the ability to easily install alternative desktops, makes Q4OS a distribution that just about anyone could use. - -Learn more about Linux through the free ["Introduction to Linux" ][11]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/intro-to-linux/2018/2/q4os-makes-linux-easy-everyone - -作者:[JACK WALLEN][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/jlwallen -[1]:https://q4os.org -[2]:https://www.trinitydesktop.org/ -[4]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/q4os_1.jpg?itok=dalJk9Xf (default desktop) -[5]:/licenses/category/used-permission -[7]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/q4os_2.jpg?itok=GlouIm73 (Desktop Profiler) -[9]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/q4os_3.jpg?itok=riSTP_1z (Desktop Profiler) -[10]:https://q4os.org/downloads2.html -[11]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/sources/talk/20180220 4 considerations when naming software development projects.md b/sources/talk/20180220 4 considerations when naming software development projects.md deleted file mode 100644 index 1e1add0b68..0000000000 --- a/sources/talk/20180220 4 considerations when naming software development projects.md +++ /dev/null @@ -1,91 +0,0 @@ -4 considerations when naming software development projects -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/hello-name-sticker-badge-tag.png?itok=fAgbMgBb) - -Working on a new open source project, you're focused on the code—getting that great new idea released so you can share it with the world. And you'll want to attract new contributors, so you need a terrific **name** for your project. - -We've all read guides for creating names, but how do you go about choosing the right one? Keeping that cool science fiction reference you're using internally might feel fun, but it won't mean much to new users you're trying to attract. A better approach is to choose a name that's memorable to new users and developers searching for your project. - -Names set expectations. Your project's name should showcase its functionality in the ecosystem and explain to users what your story is. In the crowded open source software world, it's important not to get entangled with other projects out there. Taking a little extra time now, before sending out that big announcement, will pay off later. - -Here are four factors to keep in mind when choosing a name for your project. - -### What does your project's code do? - -Start with your project: What does it do? You know the code intimately—but can you explain what it does to a new developer? Can you explain it to a CTO or non-developer at another company? What kinds of problems does your project solve for users? - -Your project's name needs to reflect what it does in a way that makes sense to newcomers who want to use or contribute to your project. That means considering the ecosystem for your technology and understanding if there are any naming styles or conventions used for similar kinds of projects. Imagine that you're trying to evaluate someone else's project: Would the name be appealing to you? - -Any distribution channels you push to are also part of the ecosystem. If your code will be in a Linux distribution, [npm][1], [CPAN][2], [Maven][3], or in a Ruby Gem, you need to review any naming standards or common practices for that package manager. Review any similar existing names in that distribution channel, and get a feel for naming styles of other programs there. - -### Who are the users and developers you want to attract? - -The hardest aspect of choosing a new name is putting yourself in the shoes of new users. You built this project; you already know how powerful it is, so while your cool name may sound great, it might not draw in new people. You need a name that is interesting to someone new, and that tells the world what problems your project solves. - -Great names depend on what kind of users you want to attract. Are you building an [Eclipse][4] plugin or npm module that's focused on developers? Or an analytics toolkit that brings visualizations to the average user? Understanding your user base and the kinds of open source contributors you want to attract is critical. - -Great names depend on what kind of users you want to attract. - -Take the time to think this through. Who does your project most appeal to, and how can it help them do their job? What kinds of problems does your code solve for end users? Understanding the target user helps you focus on what users need, and what kind of names or brands they respond to. - -Take the time to think this through. Who does your project most appeal to, and how can it help them do their job? What kinds of problems does your code solve for end users? Understanding the target user helps you focus on what users need, and what kind of names or brands they respond to. - -When you're open source, this equation changes a bit—your target is not just users; it's also developers who will want to contribute code back to your project. You're probably a developer, too: What kinds of names and brands excite you, and what images would entice you to try out someone else's new project? - -Once you have a better feel of what users and potential contributors expect, use that knowledge to refine your names. Remember, you need to step outside your project and think about how the name would appeal to someone who doesn't know how amazing your code is—yet. Once someone gets to your website, does the name synchronize with what your product does? If so, move to the next step. - -### Who else is using similar names for software? - -Now that you've tried on a user's shoes to evaluate potential names, what's next? Figuring out if anyone else is already using a similar name. It sometimes feels like all the best names are taken—but if you search carefully, you'll find that's not true. - -The first step is to do a few web searches using your proposed name. Search for the name, plus "software", "open source", and a few keywords for the functionality that your code provides. Look through several pages of results for each search to see what's out there in the software world. - -The first step is to do a few web searches using your proposed name. - -Unless you're using a completely made-up word, you'll likely get a lot of hits. The trick is understanding which search results might be a problem. Again, put on the shoes of a new user to your project. If you were searching for this great new product and saw the other search results along with your project's homepage, would you confuse them? Are the other search results even software products? If your product solves a similar problem to other search results, that's a problem: Users may gravitate to an existing product instead of a new one. - -Unless you're using a completely made-up word, you'll likely get a lot of hits. The trick is understanding which search results might be a problem. Again, put on the shoes of a new user to your project. If you were searching for this great new product and saw the other search results along with your project's homepage, would you confuse them? Are the other search results even software products? If your product solves a similar problem to other search results, that's a problem: Users may gravitate to an existing product instead of a new one. - -Similar non-software product names are rarely an issue unless they are famous trademarks—like Nike or Red Bull, for example—where the companies behind them won't look kindly on anyone using a similar name. Using the same name as a less famous non-software product might be OK, depending on how big your project gets. - -### How big do you plan to grow your project? - -Are you building a new node module or command-line utility, but not planning a career around it? Is your new project a million-dollar business idea, and you're thinking startup? Or is it something in between? - -If your project is a basic developer utility—something useful that developers will integrate into their workflow—then you have enough data to choose a name. Think through the ecosystem and how a new user would see your potential names, and pick one. You don't need perfection, just a name you're happy with that seems right for your project. - -If you're planning to build a business around your project, use these tips to develop a shortlist of names, but do more vetting before announcing the winner. Use for a business or major project requires some level of registered trademark search, which is usually performed by a law firm. - -### Common pitfalls - -Finally, when choosing a name, avoid these common pitfalls: - - * Using an esoteric acronym. If new users don't understand the name, they'll have a hard time finding you. - - * Using current pop-culture references. If you want your project's appeal to last, pick a name that will last. - - * Failing to consider non-English speakers. Does the name have a specific meaning in another language that might be confusing? - - * Using off-color jokes or potentially unsavory references. Even if it seems funny to developers, it may fall flat for newcomers and turn away contributors. - - - - -Good luck—and remember to take the time to step out of your shoes and consider how a newcomer to your project will think of the name. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/choosing-project-names-four-key-considerations - -作者:[Shane Curcuru][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/shane-curcuru -[1]:https://www.npmjs.com/ -[2]:https://www.cpan.org/ -[3]:https://maven.apache.org/ -[4]:https://www.eclipse.org/ diff --git a/sources/talk/20180221 3 warning flags of DevOps metrics.md b/sources/talk/20180221 3 warning flags of DevOps metrics.md deleted file mode 100644 index a103a2bbca..0000000000 --- a/sources/talk/20180221 3 warning flags of DevOps metrics.md +++ /dev/null @@ -1,42 +0,0 @@ -3 warning flags of DevOps metrics -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D) - -Metrics. Measurements. Data. Monitoring. Alerting. These are all big topics for DevOps and for cloud-native infrastructure and application development more broadly. In fact, acm Queue, a magazine published by the Association of Computing Machinery, recently devoted an [entire issue][1] to the topic. - -I've argued before that we conflate a lot of things under the "metrics" term, from key performance indicators to critical failure alerts to data that may be vaguely useful someday for something or other. But that's a topic for another day. What I want to discuss here is how metrics affect behavior. - -In 2008, Daniel Ariely published [Predictably Irrational][2] , one of a number of books written around that time that introduced behavioral psychology and behavioral economics to the general public. One memorable quote from that book is the following: "Human beings adjust behavior based on the metrics they're held against. Anything you measure will impel a person to optimize his score on that metric. What you measure is what you'll get. Period." - -This shouldn't be surprising. It's a finding that's been repeatedly confirmed by research. It should also be familiar to just about anyone with business experience. It's certainly not news to anyone in sales management, for example. Base sales reps' (or their managers'!) bonuses solely on revenue, and they'll discount whatever it takes to maximize revenue even if it puts margin in the toilet. Conversely, want the sales force to push a new product line—which will probably take extra effort—but skip the [spiffs][3]? Probably not happening. - -And lest you think I'm unfairly picking on sales, this behavior is pervasive, all the way up to the CEO, as Ariely describes in [a 2010 Harvard Business Review article][4]. "CEOs care about stock value because that's how we measure them. If we want to change what they care about, we should change what we measure," writes Ariely. - -Think developers and operations folks are immune from such behaviors? Think again. Let's consider some problematic measurements. They're not all bad or wrong but, if you rely too much on them, warning flags should go up. - -### Three warning signs for DevOps metrics - -First, there are the quantity metrics. Lines of code or bugs fixed are perhaps self-evidently absurd. But there are also the deployments per week or per month that are so widely quoted to illustrate DevOps velocity relative to more traditional development and deployment practices. Speed is good. It's one of the reasons you're probably doing DevOps—but don't reward people on it excessively relative to quality and other measures. - -Second, it's obvious that you want to reward individuals who do their work quickly and well. Yes. But. Whether it's your local pro sports team or some project team you've been on, you can probably name someone who was really a talent, but was just so toxic and such a distraction for everyone else that they were a net negative for the team. Moral: Don't provide incentives that solely encourage individual behaviors. You may also want to put in place programs, such as peer rewards, that explicitly value collaboration. [As Red Hat's Jen Krieger told me][5] in a podcast last year: "Having those automated pots of awards, or some sort of system that's tracked for that, can only help teams feel a little more cooperative with one another as in, 'Hey, we're all working together to get something done.'" - -The third red flag area is incentives that don't actually incent because neither the individual nor the team has a meaningful ability to influence the outcome. It's often a good thing when DevOps metrics connect to business goals and outcomes. For example, customer ticket volume relates to perceived shortcomings in applications and infrastructure. And it's also a reasonable proxy for overall customer satisfaction, which certainly should be of interest to the executive suite. The best reward systems to drive DevOps behaviors should be tied to specific individual and team actions as opposed to just company success generally. - -You've probably noticed a common theme. That theme is balance. Velocity is good but so is quality. Individual achievement is good but not when it damages the effectiveness of the team. The overall success of the business is certainly important, but the best reward systems also tie back to actions and behaviors within development and operations. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/three-warning-flags-devops-metrics - -作者:[Gordon Haff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/ghaff -[1]:https://queue.acm.org/issuedetail.cfm?issue=3178368 -[2]:https://en.wikipedia.org/wiki/Predictably_Irrational -[3]:https://en.wikipedia.org/wiki/Spiff -[4]:https://hbr.org/2010/06/column-you-are-what-you-measure -[5]:http://bitmason.blogspot.com/2015/09/podcast-making-devops-succeed-with-red.html diff --git a/sources/talk/20180222 3 reasons to say -no- in DevOps.md b/sources/talk/20180222 3 reasons to say -no- in DevOps.md deleted file mode 100644 index 5f27fbaf47..0000000000 --- a/sources/talk/20180222 3 reasons to say -no- in DevOps.md +++ /dev/null @@ -1,105 +0,0 @@ -3 reasons to say 'no' in DevOps -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_DesirePath.png?itok=N_zLVWlK) - -DevOps, it has often been pointed out, is a culture that emphasizes mutual respect, cooperation, continual improvement, and aligning responsibility with authority. - -Instead of saying no, it may be helpful to take a hint from improv comedy and say, "Yes, and..." or "Yes, but...". This opens the request from the binary nature of "yes" and "no" toward having a nuanced discussion around priority, capacity, and responsibility. - -However, sometimes you have no choice but to give a hard "no." These should be rare and exceptional, but they will occur. - -### Protecting yourself - -Both Agile and DevOps have been touted as ways to improve value to the customer and business, ultimately leading to greater productivity. While reasonable people can understand that the improvements will take time to yield, and the improvements will result in higher quality of work being done, and a better quality of life for those performing it, I think we can all agree that not everyone is reasonable. The less understanding that a person has of the particulars of a given task, the more likely they are to expect that it is a combination of "simple" and "easy." - -"You told me that [Agile/DevOps] is supposed to be all about us getting more productivity. Since we're doing [Agile/DevOps] now, you can take care of my need, right?" - -Like "Agile," some people have tried to use "DevOps" as a stick to coerce people to do more work than they can handle. Whether the person confronting you with this question is asking in earnest or is being manipulative doesn't really matter. - -The biggest areas of concern for me have been **capacity** , **firefighting/maintenance** , **level of quality** , and **" future me."** Many of these ultimately tie back to capacity, but they relate to a long-term effort in different respects. - -#### Capacity - -Capacity is simple: You know what your workload is, and how much flex occurs due to the unexpected. Exceeding your capacity will not only cause undue stress, but it could decrease the quality of your work and can injure your reputation with regards to making commitments. - -There are several avenues of discussion that can happen from here. The simplest is "Your request is reasonable, but I don't have the capacity to work on it." This seldom ends the conversation, and a discussion will often run up the flagpole to clarify priorities or reassign work. - -#### Firefighting/maintenance - -It's possible that the thing that you're being asked for won't take long to do, but it will require maintenance that you'll be expected to perform, including keeping it alive and fulfilling requests for it on behalf of others. - -An example in my mind is the Jenkins server that you're asked to stand up for someone else, but somehow end up being the sole owner and caretaker of. Even if you're careful to scope your level of involvement early on, you might be saddled with responsibility that you did not agree to. Should the service become unavailable, for example, you might be the one who is called. You might be called on to help triage a build that is failing. This is additional firefighting and maintenance work that you did not sign up for and now must fend off. - -This needs to be addressed as soon and publicly as possible. I'm not saying that (again, for example) standing up a Jenkins instance is a "no," but rather a ["Yes, but"][1]—where all parties understand that they take on the long-term care, feeding, and use of the product. Make sure to include all your bosses in this conversation so they can have your back. - -#### Level of quality - -There may be times when you are presented with requirements that include a timeframe that is...problematic. Perhaps you could get a "minimum (cough) viable (cough) product" out in that time. But it wouldn't be resilient or in any way ready for production. It might impact your time and productivity. It could end up hurting your reputation. - -The resulting conversation can get into the weeds, with lots of horse-trading about time and features. Another approach is to ask "What is driving this deadline? Where did that timeframe come from?" Discussing the bigger picture might lead to a better option, or that the timeline doesn't depend on the original date. - -#### Future me - -Ultimately, we are trying to protect "future you." These are lessons learned from the many times that "past me" has knowingly left "current me" to clean up. Sometimes we joke that "that's a problem for 'future me,'" but don't forget that 'future you' will just be 'you' eventually. I've cursed "past me" as a jerk many times. Do your best to keep other people from making "past you" be a jerk to "future you." - -I recognize that I have a significant amount of privilege in this area, but if you are told that you cannot say "no" on behalf of your own welfare, you should consider whether you are respected enough to maintain your autonomy. - -### Protecting the user experience - -Everyone should be an advocate for the user. Regardless of whether that user is right next to you, someone down the hall, or someone you have never met and likely never will, you must care for the customer. - -Behavior that is actively hostile to the user—whether it's a poor user experience or something more insidious like quietly violating reasonable expectations of privacy—deserves a "no." A common example of this would be automatically including people into a service or feature, forcing them to explicitly opt-out. - -If a "no" is not welcome, it bears considering, or explicitly asking, what the company's relationship with its customers is, who the company thinks of as it's customers, and what it thinks of them. - -When bringing up your objections, be clear about what they are. Additionally, remember that your coworkers are people too, and make it clear that you are not attacking their character; you simply find the idea disagreeable. - -### Legal, ethical, and moral grounds - -There might be situations that don't feel right. A simple test is to ask: "If this were to become public, or come up in a lawsuit deposition, would it be a scandal?" - -#### Ethics and morals - -If you are asked to lie, that should be a hard no. - -Remember if you will the Volkswagen Emissions Scandal of 2017? The emissions systems software was written such that it recognized that the vehicle was operated in a manner consistent with an emissions test, and would run more efficiently than under normal driving conditions. - -I don't know what you do in your job, or what your office is like, but I have a hard time imagining the Individual Contributor software engineer coming up with that as a solution on their own. In fact, I imagine a comment along the lines of "the engine engineers can't make their product pass the tests, so I need to hack the performance so that it will!" - -When the Volkswagen scandal came public, Volkswagen officials blamed the engineers. I find it unlikely that it came from the mind and IDE of an individual software engineer. Rather, it's more likely indicates significant systemic problems within the company culture. - -If you are asked to lie, get the request in writing, citing that the circumstances are suspect. If you are so privileged, decide whether you may decline the request on the basis that it is fundamentally dishonest and hostile to the customer, and would break the public's trust. - -#### Legal - -I am not a lawyer. If your work should involve legal matters, including requests from law enforcement, involve your company's legal counsel or speak with a private lawyer. - -With that said, if you are asked to provide information for law enforcement, I believe that you are within your rights to see the documentation that justifies the request. There should be a signed warrant. You should be provided with a copy of it, or make a copy of it yourself. - -When in doubt, begin recording and request legal counsel. - -It has been well documented that especially in the early years of the U.S. Patriot Act, law enforcement placed so many requests of telecoms that they became standard work, and the paperwork started slipping. While tedious and potentially stressful, make sure that the legal requirements for disclosure are met. - -If for no other reason, we would not want the good work of law enforcement to be put at risk because key evidence was improperly acquired, making it inadmissible. - -### Wrapping up - -You are going to be your single biggest advocate. There may be times when you are asked to compromise for the greater good. However, you should feel that your dignity is preserved, your autonomy is respected, and that your morals remain intact. - -If you don't feel that this is the case, get it on record, doing your best to communicate it calmly and clearly. - -Nobody likes being declined, but if you don't have the ability to say no, there may be a bigger problem than your environment not being DevOps. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/3-reasons-say-no-devops - -作者:[H. "Waldo" Grunenwal][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/gwaldo -[1]:http://gwaldo.blogspot.com/2015/12/fear-and-loathing-in-systems.html diff --git a/sources/talk/20180223 Plasma Mobile Could Give Life to a Mobile Linux Experience.md b/sources/talk/20180223 Plasma Mobile Could Give Life to a Mobile Linux Experience.md deleted file mode 100644 index 583714836e..0000000000 --- a/sources/talk/20180223 Plasma Mobile Could Give Life to a Mobile Linux Experience.md +++ /dev/null @@ -1,123 +0,0 @@ -Plasma Mobile Could Give Life to a Mobile Linux Experience -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/plasma-mobile_0.png?itok=uUIQFRcm) - -In the past few years, it’s become clear that, outside of powering Android, Linux on mobile devices has been a resounding failure. Canonical came close, even releasing devices running Ubuntu Touch. Unfortunately, the idea of [Scopes][1]was doomed before it touched down on its first piece of hardware and subsequently died a silent death. - -The next best hope for mobile Linux comes in the form of the [Samsung DeX][2] program. With DeX, users will be able to install an app (Linux On Galaxy—not available yet) on their Samsung devices, which would in turn allow them to run a full-blown Linux distribution. The caveat here is that you’ll be running both Android and Linux at the same time—which is not exactly an efficient use of resources. On top of that, most Linux distributions aren’t designed to run on such small form factors. The good news for DeX is that, when you run Linux on Galaxy and dock your Samsung device to DeX, that Linux OS will be running on your connected monitor—so form factor issues need not apply. - -Outside of those two options, a pure Linux on mobile experience doesn’t exist. Or does it? - -You may have heard of the [Purism Librem 5][3]. It’s a crowdfunded device that promises to finally bring a pure Linux experience to the mobile landscape. This device will be powered by a i.MX8 SoC chip, so it should run most any Linux operating system. - -Out of the box, the device will run an encrypted version of [PureOS][4]. However, last year Purism and KDE joined together to create a mobile version of the KDE desktop that could run on the Librem 5. Recently [ISOs were made available for a beta version of Plasma Mobile][5] and, judging from first glance, they’re onto something that makes perfect sense for a mobile Linux platform. I’ve booted up a live instance of Plasma Mobile to kick the tires a bit. - -What I saw seriously impressed me. Let’s take a look. - -### Testing platform - -Before you download the ISO and attempt to fire it up as a VirtualBox VM, you should know that it won’t work well. Because Plasma Mobile uses Wayland (and VirtualBox has yet to play well with that particular X replacement), you’ll find VirtualBox VM a less-than-ideal platform for the beta release. Also know that the Calamares installer doesn’t function well either. In fact, I have yet to get the OS installed on a non-mobile device. And since I don’t own a supported mobile device, I’ve had to run it as a live session on either a laptop or an [Antsle][6] antlet VM every time. - -### What makes Plasma Mobile special? - -This could be easily summed up by saying, Plasma Mobile got it all right. Instead of Canonical re-inventing a perfectly functioning wheel, the developers of KDE simply re-tooled the interface such that a full-functioning Linux distribution (complete with all the apps you’ve grown to love and depend upon) could work on a smaller platform. And they did a spectacular job. Even better, they’ve created an interface that any user of a mobile device could instantly feel familiar with. - -What you have with the Plasma Mobile interface (Figure 1) are the elements common to most Android home screens: - - * Quick Launchers - - * Notification Shade - - * App Drawer - - * Overview button (so you can go back to a previously used app, still running in memory) - - * Home button - - - - -![KDE mobile][8] - -Figure 1: The Plasma Mobile desktop interface. - -[Used with permission][9] - -Because KDE went this route with the UX, it means there’s zero learning curve. And because this is an actual Linux platform, it takes that user-friendly mobile interface and overlays it onto a system that allows for easy installation and usage of apps like: - - * GIMP - - * LibreOffice - - * Audacity - - * Clementine - - * Dropbox - - * And so much more - - - - -Unfortunately, without being able to install Plasma Mobile, you cannot really kick the tires too much, as the live user doesn’t have permission to install applications. However, once Plasma Mobile is fully installed, the Discover software center will allow you to install a host of applications (Figure 2). - - -![Discover center][11] - -Figure 2: The Discover software center on Plasma Mobile. - -[Used with permission][9] - -Swipe up (or scroll down—depending on what hardware you’re using) to reveal the app drawer, where you can launch all of your installed applications (Figure 3). - -![KDE mobile][13] - -Figure 3: The Plasma Mobile app drawer ready to launch applications. - -[Used with permission][9] - -Open up a terminal window and you can take care of standard Linux admin tasks, such as using SSH to log into a remote server. Using apt, you can install all of the developer tools you need to make Plasma Mobile a powerful development platform. - -We’re talking serious mobile power—either from a phone or a tablet. - -### A ways to go - -Clearly Plasma Mobile is still way too early in development for it to be of any use to the average user. And because most virtual machine technology doesn’t play well with Wayland, you’re likely to get too frustrated with the current ISO image to thoroughly try it out. However, even without being able to fully install the platform (or get full usage out of it), it’s obvious KDE and Purism are going to have the ideal platform that will put Linux into the hands of mobile users. - -If you want to test the waters of Plasma Mobile on an actual mobile device, a handy list of supported hardware can be found [here][14] (for PostmarketOS) or [here][15] (for Halium). If you happen to be lucky enough to have a device that also includes Wi-Fi support, you’ll find you get more out of testing the environment. - -If you do have a supported device, you’ll need to use either [PostmarketOS][16] (a touch-optimized, pre-configured Alpine Linux that can be installed on smartphones and other mobile devices) or [Halium][15] (an application that creates an minimal Android layer which allows a new interface to interact with the Android kernel). Using Halium further limits the number of supported devices, as it has only been built for select hardware. However, if you’re willing, you can build your own Halium images (documentation for this process is found [here][17]). If you want to give PostmarketOS a go, [here are the necessary build instructions][18]. - -Suffice it to say, Plasma Mobile isn’t nearly ready for mass market. If you’re a Linux enthusiast and want to give it a go, let either PostmarketOS or Halium help you get the operating system up and running on your device. Otherwise, your best bet is to wait it out and hope Purism and KDE succeed in bringing this oustanding mobile take on Linux to the masses. - -Learn more about Linux through the free ["Introduction to Linux" ][19]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/intro-to-linux/2018/2/plasma-mobile-could-give-life-mobile-linux-experience - -作者:[JACK WALLEN][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/jlwallen -[1]:https://launchpad.net/unity-scopes -[2]:http://www.samsung.com/global/galaxy/apps/samsung-dex/ -[3]:https://puri.sm/shop/librem-5/ -[4]:https://www.pureos.net/ -[5]:http://blog.bshah.in/2018/01/26/trying-out-plasma-mobile/ -[6]:https://antsle.com/ -[8]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/kdemobile_1.jpg?itok=EK3_vFVP (KDE mobile) -[9]:https://www.linux.com/licenses/category/used-permission -[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/kdemobile_2.jpg?itok=CiUQ-MnB (Discover center) -[13]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/kdemobile_3.jpg?itok=i6V8fgK8 (KDE mobile) -[14]:http://blog.bshah.in/2018/02/02/trying-out-plasma-mobile-part-two/ -[15]:https://github.com/halium/projectmanagement/issues?q=is%3Aissue+is%3Aopen+label%3APorts -[16]:https://postmarketos.org/ -[17]:http://docs.halium.org/en/latest/ -[18]:https://wiki.postmarketos.org/wiki/Installation_guide -[19]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/sources/talk/20180223 Why culture is the most important issue in a DevOps transformation.md b/sources/talk/20180223 Why culture is the most important issue in a DevOps transformation.md deleted file mode 100644 index 8fe1b6f273..0000000000 --- a/sources/talk/20180223 Why culture is the most important issue in a DevOps transformation.md +++ /dev/null @@ -1,91 +0,0 @@ -Why culture is the most important issue in a DevOps transformation -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_community2.png?itok=1blC7-NY) - -You've been appointed the DevOps champion in your organisation: congratulations. So, what's the most important issue that you need to address? - -It's the technology—tools and the toolchain—right? Everybody knows that unless you get the right tools for the job, you're never going to make things work. You need integration with your existing stack (though whether you go with tight or loose integration will be an interesting question), a support plan (vendor, third party, or internal), and a bug-tracking system to go with your source code management system. And that's just the start. - -No! Don't be ridiculous: It's clearly the process that's most important. If the team doesn't agree on how stand-ups are run, who participates, the frequency and length of the meetings, and how many people are required for a quorum, then you'll never be able to institute a consistent, repeatable working pattern. - -In fact, although both the technology and the process are important, there's a third component that is equally important, but typically even harder to get right: culture. Yup, it's that touch-feely thing we techies tend to struggle with.1 - -### Culture - -I was visiting a midsized government institution a few months ago (not in the UK, as it happens), and we arrived a little early to meet the CEO and CTO. We were ushered into the CEO's office and waited for a while as the two of them finished participating in the daily stand-up. They apologised for being a minute or two late, but far from being offended, I was impressed. Here was an organisation where the culture of participation was clearly infused all the way up to the top. - -Not that culture can be imposed from the top—nor can you rely on it percolating up from the bottom3—but these two C-level execs were not only modelling the behaviour they expected from the rest of their team, but also seemed, from the brief discussion we had about the process afterwards, to be truly invested in it. If you can get management to buy into the process—and be seen buying in—you are at least likely to have problems with other groups finding plausible excuses to keep their distance and get away with it. - -So let's assume management believes you should give DevOps a go. Where do you start? - -Developers may well be your easiest target group. They are often keen to try new things and find ways to move things along faster, so they are often the group that can be expected to adopt new technologies and methodologies. DevOps arguably has been driven mainly by the development community. - -But you shouldn't assume all developers will be keen to embrace this change. For some, the way things have always been done—your Rick Parfitts of dev, if you will7—is fine. Finding ways to help them work efficiently in the new world is part of your job, not just theirs. If you have superstar developers who aren't happy with change, you risk alienating and losing them if you try to force them into your brave new world. What's worse, if they dig their heels in, you risk the adoption of your DevSecOps vision being compromised when they explain to their managers that things aren't going to change if it makes their lives more difficult and reduces their productivity. - -Maybe you're not going to be able to move all the systems and people to DevOps immediately. Maybe you're going to need to choose which apps start with and who will be your first DevOps champions. Maybe it's time to move slowly. - -### Not maybe: definitely - -No—I lied. You're definitely going to need to move slowly. Trying to change everything at once is a recipe for disaster. - -This goes for all elements of the change—which people to choose, which technologies to choose, which applications to choose, which user base to choose, which use cases to choose—bar one. For those elements, if you try to move everything in one go, you will fail. You'll fail for a number of reasons. You'll fail for reasons I can't imagine and, more importantly, for reasons you can't imagine. But some of the reasons will include: - - * People—most people—don't like change. - * Technologies don't like change (you can't just switch and expect everything to still work). - * Applications don't like change (things worked before, or at least failed in known ways). You want to change everything in one go? Well, they'll all fail in new and exciting9 ways. - * Users don't like change. - * Use cases don't like change. - - - -### The one exception - -You noticed I wrote "bar one" when discussing which elements you shouldn't choose to change all in one go? Well done. - -What's that exception? It's the initial team. When you choose your initial application to change and you're thinking about choosing the team to make that change, select the members carefully and select a complete set. This is important. If you choose just developers, just test folks, just security folks, just ops folks, or just management—if you leave out one functional group from your list—you won't have proved anything at all. Well, you might have proved to a small section of your community that it kind of works, but you'll have missed out on a trick. And that trick is: If you choose keen people from across your functional groups, it's much harder to fail. - -Say your first attempt goes brilliantly. How are you going to convince other people to replicate your success and adopt DevOps? Well, the company newsletter, of course. And that will convince how many people, exactly? Yes, that number.12 If, on the other hand, you have team members from across the functional parts or the organisation, when you succeed, they'll tell their colleagues and you'll get more buy-in next time. - -If it fails, if you've chosen your team wisely—if they're all enthusiastic and know that "fail often, fail fast" is good—they'll be ready to go again. - -Therefore, you need to choose enthusiasts from across your functional groups. They can work on the technologies and the process, and once that's working, it's the people who will create that cultural change. You can just sit back and enjoy. Until the next crisis, of course. - -1\. OK, you're right. It should be "with which we techies tend to struggle."2 - -2\. You thought I was going to qualify that bit about techies struggling with touchy-feely stuff, didn't you? Read it again: I put "tend to." That's the best you're getting. - -3\. Is percolating a bottom-up process? I don't drink coffee,4 so I wouldn't know. - -4\. Do people even use percolators to make coffee anymore? Feel free to let me know in the comments. I may pretend interest if you're lucky. - -5\. For U.S. readers (and some other countries, maybe?), please substitute "check" for "tick" here.6 - -6\. For U.S. techie readers, feel free to perform `s/tick/check/;`. - -7\. This is a Status Quo8 reference for which I'm extremely sorry. - -8\. For millennial readers, please consult your favourite online reference engine or just roll your eyes and move on. - -9\. For people who say, "but I love excitement," try being on call at 2 a.m. on a Sunday at the end of the quarter when your chief financial officer calls you up to ask why all of last month's sales figures have been corrupted with the letters "DEADBEEF."10 - -10\. For people not in the know, this is a string often used by techies as test data because a) it's non-numerical; b) it's numerical (in hexadecimal); c) it's easy to search for in debug files; and d) it's funny.11 - -11\. Though see.9 - -12\. It's a low number, is all I'm saying. - -This article originally appeared on [Alice, Eve, and Bob – a security blog][1] and is republished with permission. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/2/most-important-issue-devops-transformation - -作者:[Mike Bursell][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/mikecamel -[1]:https://aliceevebob.com/2018/02/06/moving-to-devops-whats-most-important/ diff --git a/sources/talk/20180301 How to hire the right DevOps talent.md b/sources/talk/20180301 How to hire the right DevOps talent.md deleted file mode 100644 index bcf9bb3d20..0000000000 --- a/sources/talk/20180301 How to hire the right DevOps talent.md +++ /dev/null @@ -1,48 +0,0 @@ -How to hire the right DevOps talent -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6) - -DevOps culture is quickly gaining ground, and demand for top-notch DevOps talent is greater than ever at companies all over the world. With the [annual base salary for a junior DevOps engineer][1] now topping $100,000, IT professionals are hurrying to [make the transition into DevOps.][2] - -But how do you choose the right candidate to fill your DevOps role? - -### Overview - -Most teams are looking for candidates with a background in operations and infrastructure, software engineering, or development. This is in conjunction with skills that relate to configuration management, continuous integration, and deployment (CI/CD), as well as cloud infrastructure. Knowledge of container orchestration is also in high demand. - -In a perfect world, the two backgrounds would meet somewhere in the middle to form Dev and Ops, but in most cases, candidates lean toward one side or the other. Yet they must possess the skills necessary to understand the needs of their counterparts to work effectively as a team to achieve continuous delivery and deployment. Since every company is different, there is no single right or wrong since so much depends on a company’s tech stack and infrastructure, as well as the goals and the skills of other team members. So how do you focus your search? - -### Decide on the background - -Begin by assessing the strength of your current team. Do you have rock-star software engineers but lack infrastructure knowledge? Focus on closing the skill gaps. Just because you have the budget to hire a DevOps engineer doesn’t mean you should spend weeks, or even months, trying to find the best software engineer who also happens to use Kubernetes and Docker because they are currently the trend. Instead, look for someone who will provide the most value in your environment, and see how things go from there. - -### There is no “Ctrl + F” solution - -Instead of concentrating on specific tools, concentrate on a candidate's understanding of DevOps and CI/CD-related processes. You'll be better off with someone who understands methodologies over tools. It is more important to ensure that candidates comprehend the concept of CI/CD than to ask if they prefer Jenkins, Bamboo, or TeamCity. Don’t get too caught up in the exact toolchain—rather, focus on problem-solving skills and the ability to increase efficiency, save time, and automate manual processes. You don't want to miss out on the right candidate just because the word “Puppet” was not on their resume. - -### Check your ego - -As mentioned above, DevOps is a rapidly growing field, and DevOps engineers are in hot demand. That means candidates have great buying power. You may have an amazing company or product, but hiring top talent is no longer as simple as putting up a “Help Wanted” sign and waiting for top-quality applicants to rush in. I'm not suggesting that maintaining a reputation a great place to work is unimportant, but in today's environment, you need to make an effort to sell your position. Flaws or glitches in the hiring process, such as abruptly canceling interviews or not offering feedback after interviews, can lead to negative reviews spreading across the industry. Remember, it takes just a couple of minutes to leave a negative review on Glassdoor. - -### Contractor or permanent employee? - -Most recruiters and hiring managers immediately start searching for a full-time employee, even though they may have other options. If you’re looking to design, build, and implement a new DevOps environment, why not hire a senior person who has done this in the past? Consider hiring a senior contractor, along with a junior full-time hire. That way, you can tap the knowledge and experience of the contractor by having them work with the junior employee. Contractors can be expensive, but they bring invaluable knowledge—especially if the work can be done within a short timeframe. - -### Cultivate from within - -With so many companies competing for talent, it is difficult to find the right DevOps engineer. Not only will you need to pay top dollar to hire this person, but you must also consider that the search can take several months. However, since few companies are lucky enough to find the ideal DevOps engineer, consider searching for a candidate internally. You might be surprised at the talent you can cultivate from within your own organization. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/how-hire-right-des-talentvop - -作者:[Stanislav Ivaschenko][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/ilyadudkin -[1]:https://www.glassdoor.com/Salaries/junior-devops-engineer-salary-SRCH_KO0,22.htm -[2]:https://squadex.com/insights/system-administrator-making-leap-devops/ diff --git a/sources/talk/20180302 Beyond metrics- How to operate as team on today-s open source project.md b/sources/talk/20180302 Beyond metrics- How to operate as team on today-s open source project.md deleted file mode 100644 index fb5454bbe4..0000000000 --- a/sources/talk/20180302 Beyond metrics- How to operate as team on today-s open source project.md +++ /dev/null @@ -1,53 +0,0 @@ -Beyond metrics: How to operate as team on today's open source project -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/diversity-women-meeting-team.png?itok=BdDKxT1w) - -How do we traditionally think about community health and vibrancy? - -We might quickly zero in on metrics related primarily to code contributions: How many companies are contributing? How many individuals? How many lines of code? Collectively, these speak to both the level of development activity and the breadth of the contributor base. The former speaks to whether the project continues to be enhanced and expanded; the latter to whether it has attracted a diverse group of developers or is controlled primarily by a single organization. - -The [Linux Kernel Development Report][1] tracks these kinds of statistics and, unsurprisingly, it appears extremely healthy on all counts. - -However, while development cadence and code contributions are still clearly important, other aspects of the open source communities are also coming to the forefront. This is in part because, increasingly, open source is about more than a development model. It’s also about making it easier for users and other interested parties to interact in ways that go beyond being passive recipients of code. Of course, there have long been user groups. But open source streamlines the involvement of users, just as it does software development. - -This was the topic of my discussion with Diane Mueller, the director of community development for OpenShift. - -When OpenShift became a container platform based in part on Kubernetes in version 3, Mueller saw a need to broaden the community beyond the core code contributors. In part, this was because OpenShift was increasingly touching a broad range of open source projects and organizations such those associated with the [Open Container Initiative (OCI)][2] and the [Cloud Native Computing Foundation (CNCF)][3]. In addition to users, cloud service providers who were offering managed services also wanted ways to get involved in the project. - -“What we tried to do was open up our minds about what the community constituted,” Mueller explained, adding, “We called it the [Commons][4] because Red Hat's near Boston, and I'm from that area. Boston Common is a shared resource, the grass where you bring your cows to graze, and you have your farmer's hipster market or whatever it is today that they do on Boston Common.” - -This new model, she said, was really “a new ecosystem that incorporated all of those different parties and different perspectives. We used a lot of virtual tools, a lot of new tools like Slack. We stepped up beyond the mailing list. We do weekly briefings. We went very virtual because, one, I don't scale. The Evangelist and Dev Advocate team didn't scale. We need to be able to get all that word out there, all this new information out there, so we went very virtual. We worked with a lot of people to create online learning stuff, a lot of really good tooling, and we had a lot of community help and support in doing that.” - -![diane mueller open shift][6] - -Diane Mueller, director of community development at Open Shift, discusses the role of strong user communities in open source software development. (Credit: Gordon Haff, CC BY-SA 4.0) - -However, one interesting aspect of the Commons model is that it isn’t just virtual. We see the same pattern elsewhere in many successful open source communities, such as the Linux kernel. Lots of day-to-day activities happen on mailings lists, IRC, and other collaboration tools. But this doesn’t eliminate the benefits of face-to-face time that allows for both richer and informal discussions and exchanges. - -This interview with Mueller took place in London the day after the [OpenShift Commons Gathering][7]. Gatherings are full-day events, held a number of times a year, which are typically attended by a few hundred people. Much of the focus is on users and user stories. In fact, Mueller notes, “Here in London, one of the Commons members, Secnix, was really the major reason we actually hosted the gathering here. Justin Cook did an amazing job organizing the venue and helping us pull this whole thing together in less than 50 days. A lot of the community gatherings and things are driven by the Commons members.” - -Mueller wants to focus on users more and more. “The OpenShift Commons gathering at [Red Hat] Summit will be almost entirely case studies,” she noted. “Users talking about what's in their stack. What lessons did they learn? What are the best practices? Sharing those ideas that they've done just like we did here in London.” - -Although the Commons model grew out of some specific OpenShift needs at the time it was created, Mueller believes it’s an approach that can be applied more broadly. “I think if you abstract what we've done, you can apply it to any existing open source community,” she said. “The foundations still, in some ways, play a nice role in giving you some structure around governance, and helping incubate stuff, and helping create standards. I really love what OCI is doing to create standards around containers. There's still a role for that in some ways. I think the lesson that we can learn from the experience and we can apply to other projects is to open up the community so that it includes feedback mechanisms and gives the podium away.” - -The evolution of the community model though approaches like the OpenShift Commons mirror the healthy evolution of open source more broadly. Certainly, some users have been involved in the development of open source software for a long time. What’s striking today is how widespread and pervasive direct user participation has become. Sure, open source remains central to much of modern software development. But it’s also becoming increasingly central to how users learn from each other and work together with their partners and developers. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/how-communities-are-evolving - -作者:[Gordon Haff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/ghaff -[1]:https://www.linuxfoundation.org/2017-linux-kernel-report-landing-page/ -[2]:https://www.opencontainers.org/ -[3]:https://www.cncf.io/ -[4]:https://commons.openshift.org/ -[5]:/file/388586 -[6]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/39369010275_7df2c3c260_z.jpg?itok=gIhnBl6F (diane mueller open shift) -[7]:https://www.meetup.com/London-OpenShift-User-Group/events/246498196/ diff --git a/sources/talk/20180303 4 meetup ideas- Make your data open.md b/sources/talk/20180303 4 meetup ideas- Make your data open.md deleted file mode 100644 index a431b8376a..0000000000 --- a/sources/talk/20180303 4 meetup ideas- Make your data open.md +++ /dev/null @@ -1,75 +0,0 @@ -4 meetup ideas: Make your data open -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_team_community_group.png?itok=Nc_lTsUK) - -[Open Data Day][1] (ODD) is an annual, worldwide celebration of open data and an opportunity to show the importance of open data in improving our communities. - -Not many individuals and organizations know about the meaningfulness of open data or why they might want to liberate their data from the restrictions of copyright, patents, and more. They also don't know how to make their data open—that is, publicly available for anyone to use, share, or republish with modifications. - -This year ODD falls on Saturday, March 3, and there are [events planned][2] in every continent except Antarctica. While it might be too late to organize an event for this year, it's never too early to plan for next year. Also, since open data is important every day of the year, there's no reason to wait until ODD 2019 to host an event in your community. - -There are many ways to build local awareness of open data. Here are four ideas to help plan an excellent open data event any time of year. - -### 1. Organize an entry-level event - -You can host an educational event at a local library, college, or another public venue about how open data can be used and why it matters for all of us. If possible, invite a [local speaker][3] or have someone present remotely. You could also have a roundtable discussion with several knowledgeable people in your community. - -Consider offering resources such as the [Open Data Handbook][4], which not only provides a guide to the philosophy and rationale behind adopting open data, but also offers case studies, use cases, how-to guides, and other material to support making data open. - -### 2. Organize an advanced-level event - -For a deeper experience, organize a hands-on training event for open data newbies. Ideas for good topics include [training teachers on open science][5], [creating audiovisual expressions from open data][6], and using [open government data][7] in meaningful ways. - -The options are endless. To choose a topic, think about what is locally relevant, identify issues that open data might be able to address, and find people who can do the training. - -### 3. Organize a hackathon - -Open data hackathons can be a great way to bring open data advocates, developers, and enthusiasts together under one roof. Hackathons are more than just training sessions, though; the idea is to build prototypes or solve real-life challenges that are tied to open data. In a hackathon, people in various groups can contribute to the entire assembly line in multiple ways, such as identifying issues by working collaboratively through [Etherpad][8] or creating focus groups. - -Once the hackathon is over, make sure to upload all the useful data that is produced to the internet with an open license. - -### 4. Release or relicense data as open - -Open data is about making meaningful data publicly available under open licenses while protecting any data that might put people's private information at risk. (Learn [how to protect private data][9].) Try to find existing, interesting, and useful data that is privately owned by individuals or organizations and negotiate with them to relicense or release the data online under any of the [recommended open data licenses][10]. The widely popular [Creative Commons licenses][11] (particularly the CC0 license and the 4.0 licenses) are quite compatible with relicensing public data. (See this FAQ from Creative Commons for more information on [openly licensing data][12].) - -Open data can be published on multiple platforms—your website, [GitHub][13], [GitLab][14], [DataHub.io][15], or anywhere else that supports open standards. - -### Tips for event success - -No matter what type of event you decide to do, here are some general planning tips to improve your chances of success. - - * Find a venue that's accessible to the people you want to reach, such as a library, a school, or a community center. - * Create a curriculum that will engage the participants. - * Invite your target audience—make sure to distribute information through social media, community events calendars, Meetup, and the like. - - - -Have you attended or hosted a successful open data event? If so, please share your ideas in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/celebrate-open-data-day - -作者:[Subhashish Panigraphi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/psubhashish -[1]:http://www.opendataday.org/ -[2]:http://opendataday.org/#map -[3]:https://openspeakers.org/ -[4]:http://opendatahandbook.org/ -[5]:https://docs.google.com/forms/d/1BRsyzlbn8KEMP8OkvjyttGgIKuTSgETZW9NHRtCbT1s/viewform?edit_requested=true -[6]:http://dattack.lv/en/ -[7]:https://www.eventbrite.co.nz/e/open-data-open-potential-event-friday-2-march-2018-tickets-42733708673 -[8]:http://etherpad.org/ -[9]:https://ssd.eff.org/en/module/keeping-your-data-safe -[10]:https://opendatacommons.org/licenses/ -[11]:https://creativecommons.org/share-your-work/licensing-types-examples/ -[12]:https://wiki.creativecommons.org/wiki/Data#Frequently_asked_questions_about_data_and_CC_licenses -[13]:https://github.com/MartinBriza/MediaWriter -[14]:https://about.gitlab.com/ -[15]:https://datahub.io/ diff --git a/sources/talk/20180314 How to apply systems thinking in DevOps.md b/sources/talk/20180314 How to apply systems thinking in DevOps.md deleted file mode 100644 index c35eb041bd..0000000000 --- a/sources/talk/20180314 How to apply systems thinking in DevOps.md +++ /dev/null @@ -1,89 +0,0 @@ -How to apply systems thinking in DevOps -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_kid_education.png?itok=3lRp6gFa) -For most organizations, adopting DevOps requires a mindset shift. Unless you understand the core of [DevOps][1], you might think it's hype or just another buzzword—or worse, you might believe you have already adopted DevOps because you are using the right tools. - -Let’s dig deeper into what DevOps means, and explore how to apply systems thinking in your organization. - -### What is systems thinking? - -Systems thinking is a holistic approach to problem-solving. It's the opposite of analytical thinking, which separates a problem from the "bigger picture" to better understand it. Instead, systems thinking studies all the elements of a problem, along with the interactions between these elements. - -Most people are not used to thinking this way. Since childhood, most of us were taught math, science, and every other subject separately, by different teachers. This approach to learning follows us throughout our lives, from school to university to the workplace. When we first join an organization, we typically work in only one department. - -Unfortunately, the world is not that simple. Complexity, unpredictability, and sometimes chaos are unavoidable and require a broader way of thinking. Systems thinking helps us understand the systems we are part of, which in turn enables us to manage them rather than be controlled by them. - -According to systems thinking, everything is a system: your body, your family, your neighborhood, your city, your company, and even the communities you belong to. These systems evolve organically; they are alive and fluid. The better you understand a system's behavior, the better you can manage and leverage it. You become their change agent and are accountable for them. - -### Systems thinking and DevOps - -All systems include properties that DevOps addresses through its practices and tools. Awareness of these properties helps us properly adapt to DevOps. Let's look at the properties of a system and how DevOps relates to each one. - -### How systems work - -The figure below represents a system. To reach a goal, the system requires input, which is processed and generates output. Feedback is essential for moving the system toward the goal. Without a purpose, the system dies. - -![](https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/system.png?itok=UlqAf39I) - -If an organization is a system, its departments are subsystems. The flow of work moves through each department, starting with identifying a market need (the first input on the left) and moving toward releasing a solution that meets that need (the last output on the right). The output that each department generates serves as required input for the next department in the chain. - -The more specialized teams an organization has, the more handoffs happen between departments. The process of generating value to clients is more likely to create bottlenecks and thus it takes longer to deliver value. Also, when work is passed between teams, the gap between the goal and what has been done widens. - -DevOps aims to optimize the flow of work throughout the organization to deliver value to clients faster—in other words, DevOps reduces time to market. This is done in part by maximizing automation, but mainly by targeting the organization's goals. This empowers prioritization and reduces duplicated work and other inefficiencies that happen during the delivery process. - -### System deterioration - -All systems are affected by entropy. Nothing can prevent system degradation; that's irreversible. The tendency to decline shows the failure nature of systems. Moreover, systems are subject to threats of all types, and failure is a matter of time. - -To mitigate entropy, systems require constant maintenance and improvements. The effects of entropy can be delayed only when new actions are taken or input is changed. - -This pattern of deterioration and its opposite force, survival, can be observed in living organisms, social relationships, and other systems as well as in organizations. In fact, if an organization is not evolving, entropy is guaranteed to be increasing. - -DevOps attempts to break the entropy process within an organization by fostering continuous learning and improvement. With DevOps, the organization becomes fault-tolerant because it recognizes the inevitability of failure. DevOps enables a blameless culture that offers the opportunity to learn from failure. The [postmortem][2] is an example of a DevOps practice used by organizations that embrace inherent failure. - -The idea of intentionally embracing failure may sound counterintuitive, but that's exactly what happens in techniques like [Chaos Monkey][3]: Failure is intentionally introduced to improve availability and reliability in the system. DevOps suggests that putting some pressure into the system in a controlled way is not a bad thing. Like a muscle that gets stronger with exercise, the system benefits from the challenge. - -### System complexity - -The figure below shows how complex the systems can be. In most cases, one effect can have multiple causes, and one cause can generate multiple effects. The more elements and interactions a system has, the more complex the system. - -![](https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/system-complexity.png?itok=GYZS00Lm) - -In this scenario, we can't immediately identify the reason for a particular event. Likewise, we can't predict with 100% certainty what will happen if a specific action is taken. We are constantly making assumptions and dealing with hypotheses. - -System complexity can be explained using the scientific method. In a recent study, for example, mice that were fed excess salt showed suppressed cerebral blood flow. This same experiment would have had different results if, say, the mice were fed sugar and salt. One variable can radically change results in complex systems. - -DevOps handles complexity by encouraging experimentation—for example, using the scientific method—and reducing feedback cycles. Smaller changes inserted into the system can be tested and validated more quickly. With a "[fail-fast][4]" approach, organizations can pivot quickly and achieve resiliency. Reacting rapidly to changes makes organizations more adaptable. - -DevOps also aims to minimize guesswork and maximize understanding by making the process of delivering value more tangible. By measuring processes, revealing flaws and advantages, and monitoring as much as possible, DevOps helps organizations discover the changes they need to make. - -### System limitations - -All systems have constraints that limit their performance; a system's overall capacity is delimited by its restrictions. Most of us have learned from experience that systems operating too long at full capacity can crash, and most systems work better when they function with some slack. Ignoring limitations puts systems at risk. For example, when we are under too much stress for a long time, we get sick. Similarly, overused vehicle engines can be damaged. - -This principle also applies to organizations. Unfortunately, organizations can't put everything into a system at once. Although this limitation may sometimes lead to frustration, the quality of work usually improves when input is reduced. - -Consider what happened when the speed limit on the main roads in São Paulo, Brazil was reduced from 90 km/h to 70 km/h. Studies showed that the number of accidents decreased by 38.5% and the average speed increased by 8.7%. In other words, the entire road system improved and more vehicles arrived safely at their destinations. - -For organizations, DevOps suggests global rather than local improvements. It doesn't matter if some improvement is put after a constraint because there's no effect on the system at all. One constraint that DevOps addresses, for instance, is dependency on specialized teams. DevOps brings to organizations a more collaborative culture, knowledge sharing, and cross-functional teams. - -### Conclusion - -Before adopting DevOps, understand what is involved and how you want to apply it to your organization. Systems thinking will help you accomplish that while also opening your mind to new possibilities. DevOps may be seen as a popular trend today, but in 10 or 20 years, it will be status quo. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/how-apply-systems-thinking-devops - -作者:[Gustavo Muniz do Carmo][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/gustavomcarmo -[1]:https://opensource.com/tags/devops -[2]:https://landing.google.com/sre/book/chapters/postmortem-culture.html -[3]:https://medium.com/netflix-techblog/the-netflix-simian-army-16e57fbab116 -[4]:https://en.wikipedia.org/wiki/Fail-fast diff --git a/sources/talk/20180315 6 ways a thriving community will help your project succeed.md b/sources/talk/20180315 6 ways a thriving community will help your project succeed.md deleted file mode 100644 index cf15b7f06f..0000000000 --- a/sources/talk/20180315 6 ways a thriving community will help your project succeed.md +++ /dev/null @@ -1,111 +0,0 @@ -6 ways a thriving community will help your project succeed -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_community_lead.jpg?itok=F9KKLI7x) -NethServer is an open source product that my company, [Nethesis][1], launched just a few years ago. [The product][2] wouldn't be [what it is today][3] without the vibrant community that surrounds and supports it. - -In my previous article, I [discussed what organizations should expect to give][4] if they want to experience the benefits of thriving communities. In this article, I'll describe what organizations should expect to receive in return for their investments in the passionate people that make up their communities. - -Let's review six benefits. - -### 1\. Innovation - -"Open innovation" occurs when a company sharing information also listens to the feedback and suggestions from outside the company. As a company, we don't just look at the crowd for ideas. We innovate in, with, and through communities. - -You may know that "[the best way to have a good idea is to have a lot of ideas][5]." You can't always expect to have the right idea on your own, so having different point of views on your product is essential. How many truly disruptive ideas can a small company (like Nethesis) create? We're all young, caucasian, and European—while in our community, we can pick up a set of inspirations from a variety of people, with different genders, backgrounds, skills, and ethnicities. - -So the ability to invite the entire world to continuously improve the product is now no longer a dream; it's happening before our eyes. Your community could be the idea factory for innovation. With the community, you can really leverage the power of the collective. - -No matter who you are, most of the smartest people work for someone else. And community is the way to reach those smart people and work with them. - -### 2\. Research - -A community can be your strongest source of valuable product research. - -First, it can help you avoid "ivory tower development." [As Stack Exchange co-founder Jeff Atwood has said][6], creating an environment where developers have no idea who the users are is dangerous. Isolated developers, who have worked for years in their high towers, often encounter bad results because they don't have any clue about how users actually use their software. Developing in an Ivory tower keeps you away from your users and can only lead to bad decisions. A community brings developers back to reality and helps them stay grounded. Gone are the days of developers working in isolation with limited resources. In this day and age, thanks to the advent of open source communities research department is opening up to the entire world. - -No matter who you are, most of the smartest people work for someone else. And community is the way to reach those smart people and work with them. - -Second, a community can be an obvious source of product feedback—always necessary as you're researching potential paths forward. If someone gives you feedback, it means that person cares about you. It's a big gift. The community is a good place to acquire such invaluable feedback. Receiving early feedback is super important, because it reduces the cost of developing something that doesn't work in your target market. You can safely fail early, fail fast, and fail often. - -And third, communities help you generate comparisons with other projects. You can't know all the features, pros, and cons of your competitors' offerings. [The community, however, can.][7] Ask your community. - -### 3\. Perspective - -Communities enable companies to look at themselves and their products [from the outside][8], letting them catch strengths and weaknesses, and mostly realize who their products' audiences really are. - -Let me offer an example. When we launched the NethServer, we chose a catchy tagline for it. We were all convinced the following sentence was perfect: - -> [NethServer][9] is an operating system for Linux enthusiasts, designed for small offices and medium enterprises. - -Two years have passed since then. And we've learned that sentence was an epic fail. - -We failed to realize who our audience was. Now we know: NethServer is not just for Linux enthusiasts; actually, Windows users are the majority. It's not just for small offices and medium enterprises; actually, several home users install NethServer for personal use. Our community helps us to fully understand our product and look at it from our users' eyes. - -### 4\. Development - -In open source communities especially, communities can be a welcome source of product development. - -They can, first of all, provide testing and bug reporting. In fact, if I ask my developers about the most important community benefit, they'd answer "testing and bug reporting." Definitely. But because your code is freely available to the whole world, practically anyone with a good working knowledge of it (even hobbyists and other companies) has the opportunity to play with it, tweak it, and constantly improve it (even develop additional modules, as in our case). People can do more than just report bugs; they can fix those bugs, too, if they have the time and knowledge. - -But the community doesn't just create code. It can also generate resources like [how-to guides,][10] FAQs, support documents, and case studies. How much would it cost to fully translate your product in seven different languages? At NethServer, we got that for free—thanks to our community members. - -### 5\. Marketing - -Communities can help your company go global. Our small Italian company, for example, wasn't prepared for a global market. The community got us prepared. For example, we needed to study and improve our English so we could read and write correctly or speak in public without looking foolish for an audience. The community gently forced us to organize [our first NethServer Conference][11], too—only in English. - -A strong community can also help your organization attain the holy grail of marketers everywhere: word of mouth marketing (or what Seth Godin calls "[tribal marketing][12]"). - -Communities ensure that your company's messaging travels not only from company to tribe but also "sideways," from tribe member to potential tribe member. The community will become your street team, spreading word of your organization and its projects to anyone who will listen. - -In addition, communities help organizations satisfy one of the most fundamental members needs: the desire to belong, to be involved in something bigger than themselves, and to change the world together. - -Never forget that working with communities is always a matter of giving and taking—striking a delicate balance between the company and the community. - -### 6\. Loyalty - -Attracting new users costs a business five times as much as keeping an existing one. So loyalty can have a huge impact on your bottom line. Quite simply, community helps us build brand loyalty. It's much more difficult to leave a group of people you're connected to than a faceless product or company. In a community, you're building connections with people, which is way more powerful than features or money (trust me!). - -### Conclusion - -Never forget that working with communities is always a matter of giving and taking—striking a delicate balance between the company and the community. - -And I wouldn't be honest with you if I didn't admit that the approach has some drawbacks. Doing everything in the open means moderating, evaluating, and processing of all the data you're receiving. Supporting your members and leading the discussions definitely takes time and resources. But, if you look at what a community enables, you'll see that all this is totally worth the effort. - -As my friend and mentor [David Spinks keeps saying over and over again][13], "Companies fail their communities when when they treat community as a tactic instead of making it a core part of their business philosophy." And [as I've said][4]: Communities aren't simply extensions of your marketing teams; "community" isn't an efficient short-term strategy. When community is a core part of your business philosophy, it can do so much more than give you short-term returns. - -At Nethesis we experience that every single day. As a small company, we could never have achieved the results we have without our community. Never. - -Community can completely set your business apart from every other company in the field. It can redefine markets. It can inspire millions of people, give them a sense of belonging, and make them feel an incredible bond with your company. - -And it can make you a whole lot of money. - -Community-driven companies will always win. Remember that. - -[Subscribe to our weekly newsletter][14] to learn more about open organizations. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/18/3/why-build-community-3 - -作者:[Alessio Fattorini][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/alefattorini -[1]:http://www.nethesis.it/ -[2]:https://www.nethserver.org/ -[3]:https://distrowatch.com/table.php?distribution=nethserver -[4]:https://opensource.com/open-organization/18/2/why-build-community-2 -[5]:https://www.goodreads.com/author/quotes/52938.Linus_Pauling -[6]:https://blog.codinghorror.com/ivory-tower-development/ -[7]:https://community.nethserver.org/tags/comparison -[8]:https://community.nethserver.org/t/improve-our-communication/2569 -[9]:http://www.nethserver.org/ -[10]:https://community.nethserver.org/c/howto -[11]:https://community.nethserver.org/t/nethserver-conference-in-italy-sept-29-30-2017/6404 -[12]:https://www.ted.com/talks/seth_godin_on_the_tribes_we_lead -[13]:http://cmxhub.com/article/community-business-philosophy-tactic/ -[14]:https://opensource.com/open-organization/resources/newsletter diff --git a/sources/talk/20180315 Lessons Learned from Growing an Open Source Project Too Fast.md b/sources/talk/20180315 Lessons Learned from Growing an Open Source Project Too Fast.md deleted file mode 100644 index 6ae7cbea2c..0000000000 --- a/sources/talk/20180315 Lessons Learned from Growing an Open Source Project Too Fast.md +++ /dev/null @@ -1,40 +0,0 @@ -Lessons Learned from Growing an Open Source Project Too Fast -====== -![open source project][1] - -Are you managing an open source project or considering launching one? If so, it may come as a surprise that one of the challenges you can face is rapid growth. Matt Butcher, Principal Software Development Engineer at Microsoft, addressed this issue in a presentation at Open Source Summit North America. His talk covered everything from teamwork to the importance of knowing your goals and sticking to them. - -Butcher is no stranger to managing open source projects. As [Microsoft invests more deeply into open source][2], Butcher has been involved with many projects, including toolkits for Kubernetes and QueryPath, the jQuery-like library for PHP. - -Butcher described a case study involving Kubernetes Helm, a package system for Kubernetes. Helm arose from a company team-building hackathon, with an original team of three people giving birth to it. Within 18 months, the project had hundreds of contributors and thousands of active users. - -### Teamwork - -“We were stretched to our limits as we learned to grow,” Butcher said. “When you’re trying to set up your team of core maintainers and they’re all trying to work together, you want to spend some actual time trying to optimize for a process that lets you be cooperative. You have to adjust some expectations regarding how you treat each other. When you’re working as a group of open source collaborators, the relationship is not employer/employee necessarily. It’s a collaborative effort.” - -In addition to focusing on the right kinds of teamwork, Butcher and his collaborators learned that managing governance and standards is an ongoing challenge. “You want people to understand who makes decisions, how they make decisions and why they make the decisions that they make,” he said. “When we were a small project, there might have been two paragraphs in one of our documents on standards, but as a project grows and you get growing pains, these documented things gain a life of their own. They get their very own repositories, and they just keep getting bigger along with the project.” - -Should all discussion surrounding a open source project go on in public, bathed in the hot lights of community scrutiny? Not necessarily, Butcher noted. “A minor thing can get blown into catastrophic proportions in a short time because of misunderstandings and because something that should have been done in private ended up being public,” he said. “Sometimes we actually make architectural recommendations as a closed group. The reason we do this is that we don’t want to miscue the community. The people who are your core maintainers are core maintainers because they’re experts, right? These are the people that have been selected from the community because they understand the project. They understand what people are trying to do with it. They understand the frustrations and concerns of users.” - -### Acknowledge Contributions - -Butcher added that it is essential to acknowledge people’s contributions to keep the environment surrounding a fast-growing project from becoming toxic. “We actually have an internal rule in our core maintainers guide that says, ‘Make sure that at least one comment that you leave on a code review, if you’re asking for changes, is a positive one,” he said. “It sounds really juvenile, right? But it serves a specific purpose. It lets somebody know, ‘I acknowledge that you just made a gift of your time and your resources.” - -Want more tips on successfully launching and managing open source projects? Stay tuned for more insight from Matt Butcher’s talk, in which he provides specific project management issues faced by Kubernetes Helm. - -For more information, be sure to check out [The Linux Foundation’s growing list of Open Source Guides for the Enterprise][3], covering topics such as starting an open source project, improving your open source impact, and participating in open source communities. - --------------------------------------------------------------------------------- - -via: https://www.linuxfoundation.org/blog/lessons-learned-from-growing-an-open-source-project-too-fast/ - -作者:[Sam Dean][a] -译者:[译者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/author/sdean/ -[1]:https://www.linuxfoundation.org/wp-content/uploads/2018/03/huskies-2279627_1920.jpg -[2]:https://thenewstack.io/microsoft-shifting-emphasis-open-source/ -[3]:https://www.linuxfoundation.org/resources/open-source-guides/ diff --git a/sources/talk/20180316 How to avoid humiliating newcomers- A guide for advanced developers.md b/sources/talk/20180316 How to avoid humiliating newcomers- A guide for advanced developers.md deleted file mode 100644 index e433e85d5f..0000000000 --- a/sources/talk/20180316 How to avoid humiliating newcomers- A guide for advanced developers.md +++ /dev/null @@ -1,119 +0,0 @@ -How to avoid humiliating newcomers: A guide for advanced developers -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy) -Every year in New York City, a few thousand young men come to town, dress up like Santa Claus, and do a pub crawl. One year during this SantaCon event, I was walking on the sidewalk and minding my own business, when I saw an extraordinary scene. There was a man dressed up in a red hat and red jacket, and he was talking to a homeless man who was sitting in a wheelchair. The homeless man asked Santa Claus, "Can you spare some change?" Santa dug into his pocket and brought out a $5 bill. He hesitated, then gave it to the homeless man. The homeless man put the bill in his pocket. - -In an instant, something went wrong. Santa yelled at the homeless man, "I gave you $5. I wanted to give you one dollar, but five is the smallest I had, so you oughtta be grateful. This is your lucky day, man. You should at least say thank you!" - -This was a terrible scene to witness. First, the power difference was terrible: Santa was an able-bodied white man with money and a home, and the other man was black, homeless, and using a wheelchair. It was also terrible because Santa Claus was dressed like the very symbol of generosity! And he was behaving like Santa until, in an instant, something went wrong and he became cruel. - -This is not merely a story about Drunk Santa, however; this is a story about technology communities. We, too, try to be generous when we answer new programmers' questions, and every day our generosity turns to rage. Why? - -### My cruelty - -I'm reminded of my own bad behavior in the past. I was hanging out on my company's Slack when a new colleague asked a question. - -> **New Colleague:** Hey, does anyone know how to do such-and-such with MongoDB? -> **Jesse:** That's going to be implemented in the next release. -> **New Colleague:** What's the ticket number for that feature? -> **Jesse:** I memorize all ticket numbers. It's #12345. -> **New Colleague:** Are you sure? I can't find ticket 12345. - -He had missed my sarcasm, and his mistake embarrassed him in front of his peers. I laughed to myself, and then I felt terrible. As one of the most senior programmers at MongoDB, I should not have been setting this example. And yet, such behavior is commonplace among programmers everywhere: We get sarcastic with newcomers, and we humiliate them. - -### Why does it matter? - -Perhaps you are not here to make friends; you are here to write code. If the code works, does it matter if we are nice to each other or not? - -A few months ago on the Stack Overflow blog, David Robinson showed that [Python has been growing dramatically][1], and it is now the top language that people view questions about on Stack Overflow. Even in the most pessimistic forecast, it will far outgrow the other languages this year. - -![Projections for programming language popularity][2] - -If you are a Python expert, then the line surging up and to the right is good news for you. It does not represent competition, but confirmation. As more new programmers learn Python, our expertise becomes ever more valuable, and we will see that reflected in our salaries, our job opportunities, and our job security. - -But there is a danger. There are soon to be more new Python programmers than ever before. To sustain this growth, we must welcome them, and we are not always a welcoming bunch. - -### The trouble with Stack Overflow - -I searched Stack Overflow for rude answers to beginners' questions, and they were not hard to find. - -![An abusive answer on StackOverflow][3] - -The message is plain: If you are asking a question this stupid, you are doomed. Get out. - -I immediately found another example of bad behavior: - -![Another abusive answer on Stack Overflow][4] - -Who has never been confused by Unicode in Python? Yet the message is clear: You do not belong here. Get out. - -Do you remember how it felt when you needed help and someone insulted you? It feels terrible. And it decimates the community. Some of our best experts leave every day because they see us treating each other this way. Maybe they still program Python, but they are no longer participating in conversations online. This cruelty drives away newcomers, too, particularly members of groups underrepresented in tech who might not be confident they belong. People who could have become the great Python programmers of the next generation, but if they ask a question and somebody is cruel to them, they leave. - -This is not in our interest. It hurts our community, and it makes our skills less valuable because we drive people out. So, why do we act against our own interests? - -### Why generosity turns to rage - -There are a few scenarios that really push my buttons. One is when I act generously but don't get the acknowledgment I expect. (I am not the only person with this resentment: This is probably why Drunk Santa snapped when he gave a $5 bill to a homeless man and did not receive any thanks.) - -Another is when answering requires more effort than I expect. An example is when my colleague asked a question on Slack and followed-up with, "What's the ticket number?" I had judged how long it would take to help him, and when he asked for more help, I lost my temper. - -These scenarios boil down to one problem: I have expectations for how things are going to go, and when those expectations are violated, I get angry. - -I've been studying Buddhism for years, so my understanding of this topic is based in Buddhism. I like to think that the Buddha discussed the problem of expectations in his first tech talk when, in his mid-30s, he experienced a breakthrough after years of meditation and convened a small conference to discuss his findings. He had not rented a venue, so he sat under a tree. The attendees were a handful of meditators the Buddha had met during his wanderings in northern India. The Buddha explained that he had discovered four truths: - - * First, that to be alive is to be dissatisfied—to want things to be better than they are now. - * Second, this dissatisfaction is caused by wants; specifically, by our expectation that if we acquire what we want and eliminate what we do not want, it will make us happy for a long time. This expectation is unrealistic: If I get a promotion or if I delete 10 emails, it is temporarily satisfying, but it does not make me happy over the long-term. We are dissatisfied because every material thing quickly disappoints us. - * The third truth is that we can be liberated from this dissatisfaction by accepting our lives as they are. - * The fourth truth is that the way to transform ourselves is to understand our minds and to live a generous and ethical life. - - - -I still get angry at people on the internet. It happened to me recently, when someone posted a comment on [a video I published about Python co-routines][5]. It had taken me months of research and preparation to create this video, and then a newcomer commented, "I want to master python what should I do." - -![Comment on YouTube][6] - -This infuriated me. My first impulse was to be sarcastic, "For starters, maybe you could spell Python with a capital P and end a question with a question mark." Fortunately, I recognized my anger before I acted on it, and closed the tab instead. Sometimes liberation is just a Command+W away. - -### What to do about it - -If you joined a community with the intent to be helpful but on occasion find yourself flying into a rage, I have a method to prevent this. For me, it is the step when I ask myself, "Am I angry?" Knowing is most of the battle. Online, however, we can lose track of our emotions. It is well-established that one reason we are cruel on the internet is because, without seeing or hearing the other person, our natural empathy is not activated. But the other problem with the internet is that, when we use computers, we lose awareness of our bodies. I can be angry and type a sarcastic message without even knowing I am angry. I do not feel my heart pound and my neck grow tense. So, the most important step is to ask myself, "How do I feel?" - -If I am too angry to answer, I can usually walk away. As [Thumper learned in Bambi][7], "If you can't say something nice, don't say nothing at all." - -### The reward - -Helping a newcomer is its own reward, whether you receive thanks or not. But it does not hurt to treat yourself to a glass of whiskey or a chocolate, or just a sigh of satisfaction after your good deed. - -But besides our personal rewards, the payoff for the Python community is immense. We keep the line surging up and to the right. Python continues growing, and that makes our own skills more valuable. We welcome new members, people who might not be sure they belong with us, by reassuring them that there is no such thing as a stupid question. We use Python to create an inclusive and diverse community around writing code. And besides, it simply feels good to be part of a community where people treat each other with respect. It is the kind of community that I want to be a member of. - -### The three-breath vow - -There is one idea I hope you remember from this article: To control our behavior online, we must occasionally pause and notice our feelings. I invite you, if you so choose, to repeat the following vow out loud: - -> I vow -> to take three breaths -> before I answer a question online. - -This article is based on a talk, [Why Generosity Turns To Rage, and What To Do About It][8], that Jesse gave at PyTennessee in February. For more insight for Python developers, attend [PyCon 2018][9], May 9-17 in Cleveland, Ohio. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/avoid-humiliating-newcomers - -作者:[A. Jesse][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/emptysquare -[1]:https://stackoverflow.blog/2017/09/06/incredible-growth-python/ -[2]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/projections.png?itok=5QTeJ4oe (Projections for programming language popularity) -[3]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/abusive-answer-1.jpg?itok=BIWW10Rl (An abusive answer on StackOverflow) -[4]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/abusive-answer-2.jpg?itok=0L-n7T-k (Another abusive answer on Stack Overflow) -[5]:https://www.youtube.com/watch?v=7sCu4gEjH5I -[6]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/i-want-to-master-python.png?itok=Y-2u1XwA (Comment on YouTube) -[7]:https://www.youtube.com/watch?v=nGt9jAkWie4 -[8]:https://www.pytennessee.org/schedule/presentation/175/ -[9]:https://us.pycon.org/2018/ diff --git a/sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md b/sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md deleted file mode 100644 index 8c02ca228b..0000000000 --- a/sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Easily Fund Open Source Projects With These Platforms) -[#]: via: (https://itsfoss.com/open-source-funding-platforms/) -[#]: author: ([Ambarish Kumar](https://itsfoss.com/author/ambarish/)) -[#]: url: ( ) - -Easily Fund Open Source Projects With These Platforms -====== - -**Brief: We list out some funding platforms you can use to financially support open source projects. ** - -Financial support is one of the many ways to [help Linux and Open Source community][1]. This is why you see “Donate” option on the websites of most open source projects. - -While the big corporations have the necessary funding and resources, most open source projects are developed by individuals in their spare time. However, it does require one’s efforts, time and probably includes some overhead costs too. Monetary supports surely help drive the project development. - -If you would like to support open source projects financially, let me show you some platforms dedicated to open source and/or Linux. - -### Funding platforms for Open Source projects - -![Open Source funding platforms][2] - -Just to clarify, we are not associated with any of the funding platforms mentioned here. - -#### 1\. Liberapay - -[Gratipay][3] was probably the biggest platform for funding open source projects and people associated with the project, which got shut down at the end of the year 2017. However, there’s a fork – Liberapay that works as a recurrent donation platform for the open source projects and the contributors. - -[Liberapay][4] is a non-profit, open source organization that helps in a periodic donation to a project. You can create an account as a contributor and ask the people who would really like to help (usually the consumer of your products) to donate. - -To receive a donation, you will have to create an account on Liberapay, brief what you do and about your project, reasons for asking for the donation and what will be done with the money you receive. - -For someone who would like to donate, they would have to add money to their accounts and set up a period for payment that can be weekly, monthly or yearly to someone. There’s a mail triggered when there is not much left to donate. - -The currency supported are dollars and Euro as of now and you can always put up a badge on Github, your Twitter profile or website for a donation. - -#### 2\. Bountysource - -[Bountysource][5] is a funding platform for open source software that has a unique way of paying a developer for his time and work int he name of Bounties. - -There are basically two campaigns, bounties and salt campaign. - -Under the Bounties, users declare bounties aka cash prizes on open issues that they believe should be fixed or any new features which they want to see in the software they are using. A developer can then go and fix it to receive the cash prize. - -Salt Campaign is like any other funding, anyone can pay a recurring amount to a project or an individual working for an open source project for as long as they want. - -Bountysource accepts any software that is approved by Free Software Foundation or Open Source Initiatives. The bounties can be placed using PayPal, Bitcoin or the bounty itself if owned previously. Bountysource supports a no. of issue tracker currently like GitHub, Bugzilla, Google Code, Jira, Launchpad etc. - -#### 3\. Open Collective - -[Open Collective][6] is another popular funding initiative where a person who is willing to receive the donation for the work he is doing in Open Source world can create a page. He can submit the expense reports for the project he is working on. A contributor can add money to his account and pay him for his expenses. - -The complete process is transparent and everyone can track whoever is associated with Open Collective. The contributions are visible along with the unpaid expenses. There is also the option to contribute on a recurring basis. - -Open Collective currently has more than 500 collectives being backed up by more than 5000 users. - -The fact that it is transparent and you know what you are contributing to, drives more accountability. Some common example of collective include hosting costs, community maintenance, travel expenses etc. - -Though Open Collective keeps 10% of all the transactions, it is still a nice way to get your expenses covered in the process of contributing towards an open source project. - -#### 4\. Open Source Grants - -[Open Source Grants][7] is still in its beta stage and has not matured yet. They are looking for projects that do not have any stable funding and adds value to open source community. Most open source projects are run by a small community in a free time and they are trying to fund them so that the developers can work full time on the projects. - -They are equally searching for companies that want to help open source enthusiasts. The process of submitting a project is still being worked upon, and hopefully, in coming days we will see a working way of funding. - -### Final Words - -In the end, I would also like to mention [Patreon][8]. This funding platform is not exclusive to open source but is focused on creators of all kinds. Some projects like [elementary OS have created their accounts on Patreon][9] so that you can support the project on a recurring basis. - -Think Free Speech, not Free Beer. Your small contribution to a project can help it sustain in the long run. For the developers, the above platform can provide a good way to cover up their expenses. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/open-source-funding-platforms/ - -作者:[Ambarish Kumar][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ambarish/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/help-linux-grow/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/03/Fund-Open-Source-projects.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/gratipay-open-source/ -[4]: https://liberapay.com/ -[5]: https://www.bountysource.com/ -[6]: https://opencollective.com/ -[7]: https://foundation.travis-ci.org/grants/ -[8]: https://www.patreon.com/ -[9]: https://www.patreon.com/elementary diff --git a/sources/talk/20180321 8 tips for better agile retrospective meetings.md b/sources/talk/20180321 8 tips for better agile retrospective meetings.md deleted file mode 100644 index ec45bf17f0..0000000000 --- a/sources/talk/20180321 8 tips for better agile retrospective meetings.md +++ /dev/null @@ -1,66 +0,0 @@ -8 tips for better agile retrospective meetings -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_meeting.png?itok=4_CivQgp) -I’ve often thought that retrospectives should be called prospectives, as that term concerns the future rather than focusing on the past. The retro itself is truly future-looking: It’s the space where we can ask the question, “With what we know now, what’s the next experiment we need to try for improving our lives, and the lives of our customers?” - -### What’s a retro supposed to look like? - -There are two significant loops in product development: One produces the desired potentially shippable nugget. The other is where we examine how we’re working—not only to avoid doing what didn’t work so well, but also to determine how we can amplify the stuff we do well—and devise an experiment to pull into the next production loop to improve how our team is delighting our customers. This is the loop on the right side of this diagram: - - -![Retrospective 1][2] - -### When retros implode - -While attending various teams' iteration retrospective meetings, I saw a common thread of malcontent associated with a relentless focus on continuous improvement. - -One of the engineers put it bluntly: “[Our] continuous improvement feels like we are constantly failing.” - -The teams talked about what worked, restated the stuff that didn’t work (perhaps already feeling like they were constantly failing), nodded to one another, and gave long sighs. Then one of the engineers (already late for another meeting) finally summed up the meeting: “Ok, let’s try not to submit all of the code on the last day of the sprint.” There was no opportunity to amplify the good, as the good was not discussed. - -In effect, here’s what the retrospective felt like: - -![](https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/retro_2.jpg?itok=HrDkppCG) - -The anti-pattern is where retrospectives become dreaded sessions where we look back at the last iteration, make two columns—what worked and what didn’t work—and quickly come to some solution for the next iteration. There is no [scientific method][3] involved. There is no data gathering and research, no hypothesis, and very little deep thought. The result? You don’t get an experiment or a potential improvement to pull into the next iteration. - -### 8 tips for better retrospectives - - 1. Amplify the good! Instead of focusing on what didn’t work well, why not begin the retro by having everyone mention one positive item first? - 2. Don’t jump to a solution. Thinking about a problem deeply instead of trying to solve it right away might be a better option. - 3. If the retrospective doesn’t make you feel excited about an experiment, maybe you shouldn’t try it in the next iteration. - 4. If you’re not analyzing how to improve, ([5 Whys][4], [force-field analysis][5], [impact mapping][6], or [fish-boning][7]), you might be jumping to solutions too quickly. - 5. Vary your methods. If every time you do a retrospective you ask, “What worked, what didn’t work?” and then vote on the top item from either column, your team will quickly get bored. [Retromat][8] is a great free retrospective tool to help vary your methods. - 6. End each retrospective by asking for feedback on the retro itself. This might seem a bit meta, but it works: Continually improving the retrospective is recursively improving as a team. - 7. Remove the impediments. Ask how you are enabling the team's search for improvement, and be prepared to act on any feedback. - 8. There are no "iteration police." Take breaks as needed. Deriving hypotheses from analysis and coming up with experiments involves creativity, and it can be taxing. Every once in a while, go out as a team and enjoy a nice retrospective lunch. - - - -This article was inspired by [Retrospective anti-pattern: continuous improvement should not feel like constantly failing][9], posted at [Podojo.com][10]. - -**[See our related story,[How to build a business case for DevOps transformation][11].]** - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/tips-better-agile-retrospective-meetings - -作者:[Catherine Louis][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/catherinelouis -[1]:/file/389021 -[2]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/retro_1.jpg?itok=bggmHN1Q (Retrospective 1) -[3]:https://en.wikipedia.org/wiki/Scientific_method -[4]:https://en.wikipedia.org/wiki/5_Whys -[5]:https://en.wikipedia.org/wiki/Force-field_analysis -[6]:https://opensource.com/open-organization/17/6/experiment-impact-mapping -[7]:https://en.wikipedia.org/wiki/Ishikawa_diagram -[8]:https://plans-for-retrospectives.com/en/?id=28 -[9]:http://www.podojo.com/retrospective-anti-pattern-continuous-improvement-should-not-feel-like-constantly-failing/ -[10]:http://www.podojo.com/ -[11]:https://opensource.com/article/18/2/how-build-business-case-devops-transformation diff --git a/sources/talk/20180323 7 steps to DevOps hiring success.md b/sources/talk/20180323 7 steps to DevOps hiring success.md deleted file mode 100644 index cdea0c65ac..0000000000 --- a/sources/talk/20180323 7 steps to DevOps hiring success.md +++ /dev/null @@ -1,56 +0,0 @@ -7 steps to DevOps hiring success -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6) -As many of us in the DevOps scene know, most companies are hiring, or, at least, trying to do so. The required skills and job descriptions can change entirely from company to company. As a broad overview, most teams are looking for a candidate from either an operations and infrastructure background or someone from a software engineering and development background, then combined with key skills relating to continuous integration, configuration management, continuous delivery/deployment, and cloud infrastructure. Currently in high-demand is knowledge of container orchestration. - -In the ideal world, the two backgrounds will meet somewhere in the middle to form Dev and Ops, but in most cases, there is a lean toward one side or the other while maintaining sufficient skills to understand the needs and demands of their counterparts to work collaboratively and achieve the end goal of continuous delivery/deployment. Every company is different and there isn’t necessarily a right or wrong here. It all depends on your infrastructure, tech stack, other team members’ skills, and the individual goals you hope to achieve by hiring this individual. - -### Focus your hiring - -Now, given the various routes to becoming a DevOps practitioner, how do hiring managers focus their search and selection process to ensure that they’re hitting the mark? - -#### Decide on the background - -Assess the strengths of your existing team. Do you already have some amazing software engineers but you’re lacking the infrastructure knowledge? Aim to close these gaps in skills. You may have been given the budget to hire for DevOps, but you don’t have to spend weeks/months searching for the best software engineer who happens to use Docker and Kubernetes because they are the current hot trends in this space. Find the person who will provide the most value in your environment and go from there. - -#### Contractor or permanent employee? - -Many hiring managers will automatically start searching for a full-time permanent employee when their needs may suggest that they have other options. Sometimes a contractor is your best bet or maybe contract-hire. If you’re aiming to design, implement and build a new DevOps environment, why not find a senior person who has done this a number of times already? Try hiring a senior contractor and bring on a junior full-time hire in parallel; this way, you’ll be able to retain the external contractor knowledge by having them work alongside the junior hire. Contractors can be expensive, but the knowledge they bring can be invaluable, especially if the work can be completed over a shorter time frame. Again, this is just another point of view and you might be best off with a full-time hire to grow the team. - -#### CTRL F is not the solution - -Focus on their understanding of DevOps and CI/CD-related processes over specific tools. I believe the best approach is to focus on finding someone who understands the methodologies over the tools. Does your candidate understand the concept of continuous integration or the concept of continuous delivery? That’s more important than asking whether your candidate uses Jenkins versus Bamboo versus TeamCity and so on. Try not to get caught up in the exact tool chain. The focus should be on the candidates’ ability to solve problems. Are they obsessed with increasing efficiency, saving time, automating manual processes and constantly searching for flaws in the system? They might be the person you were looking for, but you missed them because you didn’t see the word "Puppet" on the resume. - -#### Work closely with your internal talent acquisition team and/or an external recruiter - -Be clear and precise with what you’re looking for and have an ongoing, open communication with recruiters. They can and will help you if used effectively. The job of these recruiters is to save you time by sourcing candidates while you’re focusing on your day-to-day role. Work closely with them and deliver in the same way that you would expect them to deliver for you. If you say you will review a candidate by X time, do it. If they say they’ll have a candidate in your inbox by Y time, make sure they do it, too. Start by setting up an initial call to talk through your requirement, lay out a timeline in which you expect candidates by a specific time, and explain your process in terms of when you will interview, how many interview rounds, and how soon after you will be able to make a final decision on whether to offer or reject the candidates. If you can get this relationship working well, you’ll save lots of time. And make sure your internal teams are focused on supporting your process, not blocking it. - -#### $$$ - -Decide how much you want to pay. It’s not all about the money, but you can waste a lot of your and other people’s time if you don’t lock down the ballpark salary or hourly rate that you can afford. If your budget doesn’t stretch as far as your competitors’, you need to consider what else can help sell the opportunity. Flexible working hours and remote working options are some great ways to do this. Most companies have snacks, beer, and cool offices nowadays, so focus on the real value such as the innovative work your team is doing and how awesome your game-changing product might be. - -#### Drop the ego - -You may have an amazing company and/or product, but you also have some hot competition. Everyone is hiring in this space and candidates have a lot of the buying power. It is no longer as simple as saying, "We are hiring" and the awesome candidates come flowing in. You need to sell your opportunities. Maintaining a reputation as a great place to work is also important. A poor hiring process, such as interviewing without giving feedback, can contribute to bad rumors being spread across the industry. It only takes a few minutes to leave a sour review on Glassdoor. - -#### A smooth process is a successful One - -"Let’s get every single person within the company to do a one-hour interview with the new DevOps person we are hiring!" No, let’s not do that. Two or three stages should be sufficient. You have managers and directors for a reason. Trust your instinct and use your experience to make decisions on who will fit into your organization. Some of the most successful companies can do one phone screen followed by an in-person meeting. During the in-person interview, spend a morning or afternoon allowing the candidate to meet the relevant leaders and senior members of their direct team, then take them for lunch, dinner, or drinks where you can see how they are on a social level. If you can’t have a simple conversation with them, then you probably won’t enjoy working with them. If the thumbs are up, make the hire and don’t wait around. A good candidate will usually have numerous offers on the table at the same time. - -If all goes well, you should be inviting your shiny new employee or contractor into the office in the next few weeks and hopefully many more throughout the year. - -This article was originally published on [DevOps.com][1] and republished with author permission. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/7-steps-devops-hiring-success - -作者:[Conor Delanbanque][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/cdelanbanque -[1]:https://devops.com/7-steps-devops-hiring-success/ diff --git a/sources/talk/20180330 Meet OpenAuto, an Android Auto emulator for Raspberry Pi.md b/sources/talk/20180330 Meet OpenAuto, an Android Auto emulator for Raspberry Pi.md deleted file mode 100644 index bac0819e74..0000000000 --- a/sources/talk/20180330 Meet OpenAuto, an Android Auto emulator for Raspberry Pi.md +++ /dev/null @@ -1,81 +0,0 @@ -Meet OpenAuto, an Android Auto emulator for Raspberry Pi -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lightbulb_computer_person_general_.png?itok=BRGJXU7e) - -In 2015, Google introduced [Android Auto][1], a system that allows users to project certain apps from their Android smartphones onto a car's infotainment display. Android Auto's driver-friendly interface, with larger touchscreen buttons and voice commands, aims to make it easier and safer for drivers to control navigation, music, podcasts, radio, phone calls, and more while keeping their eyes on the road. Android Auto can also run as an app on an Android smartphone, enabling owners of older-model vehicles without modern head unit displays to take advantage of these features. - -While there are many [apps][2] available for Android Auto, developers are working to add to its catalog. A new, open source tool named [OpenAuto][3] is hoping to make that easier by giving developers a way to emulate Android Auto on a Raspberry Pi. With OpenAuto, developers can test their applications in conditions similar to how they'll work on an actual car head unit. - -OpenAuto's creator, Michal Szwaj, answered some questions about his project for Opensource.com. Some responses have been edited for conciseness and clarity. - -### What is OpenAuto? - -In a nutshell, OpenAuto is an emulator for the Android Auto head unit. It emulates the head unit software and allows you to use Android Auto on your PC or on any other embedded platform like Raspberry Pi 3. - -Head unit software is a frontend for the Android Auto projection. All magic related to the Android Auto, like navigation, Google Voice Assistant, or music playback, is done on the Android device. Projection of Android Auto on the head unit is accomplished using the [H.264][4] codec for video and [PCM][5] codec for audio streaming. This is what the head unit software mostly does—it decodes the H.264 video stream and PCM audio streams and plays them back together. Another function of the head unit is providing user inputs. OpenAuto supports both touch events and hard keys. - -### What platforms does OpenAuto run on? - -My target platform for deployment of the OpenAuto is Raspberry Pi 3 computer. For successful deployment, I needed to implement support of video hardware acceleration using the Raspberry Pi 3 GPU (VideoCore 4). Thanks to this, Android Auto projection on the Raspberry Pi 3 computer can be handled even using 1080p@60 fps resolution. I used [OpenMAX IL][6] and IL client libraries delivered together with the Raspberry Pi firmware to implement video hardware acceleration. - -Taking advantage of the fact that the Raspberry Pi operating system is Raspbian based on Debian Linux, OpenAuto can be also built for any other Linux-based platform that provides support for hardware video decoding. Most of the Linux-based platforms provide support for hardware video decoding directly in GStreamer. Thanks to highly portable libraries like Boost and [Qt][7], OpenAuto can be built and run on the Windows platform. Support of MacOS is being implemented by the community and should be available soon. - -![][https://www.youtube.com/embed/k9tKRqIkQs8?origin=https://opensource.com&enablejsapi=1] - -### What software libraries does the project use? - -The core of the OpenAuto is the [aasdk][8] library, which provides support for all Android Auto features. aasdk library is built on top of the Boost, libusb, and OpenSSL libraries. [libusb][9] implements communication between the head unit and an Android device (via USB bus). [Boost][10] provides support for the asynchronous mechanisms for communication. It is required for high efficiency and scalability of the head unit software. [OpenSSL][11] is used for encrypting communication. - -The aasdk library is designed to be fully reusable for any purposes related to implementation of the head unit software. You can use it to build your own head unit software for your desired platform. - -Another very important library used in OpenAuto is Qt. It provides support for OpenAuto's multimedia, user input, and graphical interface. And the build system OpenAuto is using is [CMake][12]. - -Note: The Android Auto protocol is taken from another great Android Auto head unit project called [HeadUnit][13]. The people working on this project did an amazing job in reverse engineering the AndroidAuto protocol and creating the protocol buffers that structurize all messages. - -### What equipment do you need to run OpenAuto on Raspberry Pi? - -In addition to a Raspberry Pi 3 computer and an Android device, you need: - - * **USB sound card:** The Raspberry Pi 3 doesn't have a microphone input, which is required to use Google Voice Assistant - * **Video output device:** You can use either a touchscreen or any other video output device connected to HDMI or composite output (RCA) - * **Input device:** For example, a touchscreen or a USB keyboard - - - -### What else do you need to get started? - -In order to use OpenAuto, you must build it first. On the OpenAuto's wiki page you can find [detailed instructions][14] for how to build it for the Raspberry Pi 3 platform. On other Linux-based platforms, the build process will look very similar. - -On the wiki page you can also find other useful instructions, such as how to configure the Bluetooth Hands-Free Profile (HFP) and Advanced Audio Distribution Profile (A2DP) and PulseAudio. - -### What else should we know about OpenAuto? - -OpenAuto allows anyone to create a head unit based on the Raspberry Pi 3 hardware. Nevertheless, you should always be careful about safety and keep in mind that OpenAuto is just an emulator. It was not certified by any authority and was not tested in a driving environment, so using it in a car is not recommended. - -OpenAuto is licensed under GPLv3. For more information, visit the [project's GitHub page][3], where you can find its source code and other information. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/openauto-emulator-Raspberry-Pi - -作者:[Michal Szwaj][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/michalszwaj -[1]:https://www.android.com/auto/faq/ -[2]:https://play.google.com/store/apps/collection/promotion_3001303_android_auto_all -[3]:https://github.com/f1xpl/openauto -[4]:https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC -[5]:https://en.wikipedia.org/wiki/Pulse-code_modulation -[6]:https://www.khronos.org/openmaxil -[7]:https://www.qt.io/ -[8]:https://github.com/f1xpl/aasdk -[9]:http://libusb.info/ -[10]:http://www.boost.org/ -[11]:https://www.openssl.org/ -[12]:https://cmake.org/ -[13]:https://github.com/gartnera/headunit -[14]:https://github.com/f1xpl/ diff --git a/sources/talk/20180403 3 pitfalls everyone should avoid with hybrid multicloud.md b/sources/talk/20180403 3 pitfalls everyone should avoid with hybrid multicloud.md deleted file mode 100644 index b128be62f0..0000000000 --- a/sources/talk/20180403 3 pitfalls everyone should avoid with hybrid multicloud.md +++ /dev/null @@ -1,87 +0,0 @@ -3 pitfalls everyone should avoid with hybrid multicloud -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_darwincloud_520x292_0311LL.png?itok=74DLgd8Q) - -This article was co-written with [Roel Hodzelmans][1]. - -We're all told the cloud is the way to ensure a digital future for our businesses. But which cloud? From cloud to hybrid cloud to hybrid multi-cloud, you need to make choices, and these choices don't preclude the daily work of enhancing your customers' experience or agile delivery of the applications they need. - -This article is the first in a four-part series on avoiding pitfalls in hybrid multi-cloud computing. Let's start by examining multi-cloud, hybrid cloud, and hybrid multi-cloud and what makes them different from one another. - -### Hybrid vs. multi-cloud - -There are many conversations you may be having in your business around moving to the cloud. For example, you may want to take your on-premises computing capacity and turn it into your own private cloud. You may wish to provide developers with a cloud-like experience using the same resources you already have. A more traditional reason for expansion is to use external computing resources to augment those in your own data centers. The latter leads you to the various public cloud providers, as well as to our first definition, multi-cloud. - -#### Multi-cloud - -Multi-cloud means using multiple clouds from multiple providers for multiple tasks. - -![Multi-cloud][3] - -Figure 1. Multi-cloud IT with multiple isolated cloud environments - -Typically, multi-cloud refers to the use of several different public clouds in order to achieve greater flexibility, lower costs, avoid vendor lock-in, or use specific regional cloud providers. - -A challenge of the multi-cloud approach is achieving consistent policies, compliance, and management with different providers involved. - -Multi-cloud is mainly a strategy to expand your business while leveraging multi-vendor cloud solutions and spreading the risk of lock-in. Figure 1 shows the isolated nature of cloud services in this model, without any sort of coordination between the services and business applications. Each is managed separately, and applications are isolated to services found in their environments. - -#### Hybrid cloud - -Hybrid cloud solves issues where isolation and coordination are central to the solution. It is a combination of one or more public and private clouds with at least a degree of workload portability, integration, orchestration, and unified management. - -![Hybrid cloud][5] - -Figure 2. Hybrid clouds may be on or off premises, but must have a degree of interoperability - -The key issue here is that there is an element of interoperability, migration potential, and a connection between tasks running in public clouds and on-premises infrastructure, even if it's not always seamless or otherwise fully implemented. - -If your cloud model is missing portability, integration, orchestration, and management, then it's just a bunch of clouds, not a hybrid cloud. - -The cloud environments in Fig. 2 include at least one private and public cloud. They can be off or on premises, but they have some degree of the following: - - * Interoperability - * Application portability - * Data portability - * Common management - - - -As you can probably guess, combining multi-cloud and hybrid cloud results in a hybrid multi-cloud. But what does that look like? - -### Hybrid multi-cloud - -Hybrid multi-cloud pulls together multiple clouds and provides the tools to ensure interoperability between the various services in hybrid and multi-cloud solutions. - -![Hybrid multi-cloud][7] - -Figure 3. Hybrid multi-cloud solutions using open technologies - -Bringing these together can be a serious challenge, but the result ensures better use of resources without isolation in their respective clouds. - -Fig. 3 shows an example of hybrid multi-cloud based on open technologies for interoperability, workload portability, and management. - -### Moving forward: Pitfalls of hybrid multi-cloud - -In part two of this series, we'll look at the first of three pitfalls to avoid with hybrid multi-cloud. Namely, why cost is not always the obvious motivator when determining how to transition your business to the cloud. - -This article is based on "[3 pitfalls everyone should avoid with hybrid multi-cloud][8]," a talk the authors will be giving at [Red Hat Summit 2018][9], which will be held May 8-10 in San Francisco. [Register by May 7][9] to save US$ 500 off of registration. Use discount code **OPEN18** on the payment page to apply the discount. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/4/pitfalls-hybrid-multi-cloud - -作者:[Eric D.Schabell][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/eschabell -[1]:https://opensource.com/users/roelh -[3]:https://opensource.com/sites/default/files/u128651/multi-cloud.png (Multi-cloud) -[5]:https://opensource.com/sites/default/files/u128651/hybrid-cloud.png (Hybrid cloud) -[7]:https://opensource.com/sites/default/files/u128651/hybrid-multicloud.png (Hybrid multi-cloud) -[8]:https://agenda.summit.redhat.com/SessionDetail.aspx?id=153892 -[9]:https://www.redhat.com/en/summit/2018 diff --git a/sources/talk/20180404 Is the term DevSecOps necessary.md b/sources/talk/20180404 Is the term DevSecOps necessary.md deleted file mode 100644 index 96b544e7c4..0000000000 --- a/sources/talk/20180404 Is the term DevSecOps necessary.md +++ /dev/null @@ -1,51 +0,0 @@ -Is the term DevSecOps necessary? -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2) -First came the term "DevOps." - -It has many different aspects. For some, [DevOps][1] is mostly about a culture valuing collaboration, openness, and transparency. Others focus more on key practices and principles such as automating everything, constantly iterating, and instrumenting heavily. And while DevOps isn’t about specific tools, certain platforms and tooling make it a more practical proposition. Think containers and associated open source cloud-native technologies like [Kubernetes][2] and CI/CD pipeline tools like [Jenkins][3]—as well as native Linux capabilities. - -However, one of the earliest articulated concepts around DevOps was the breaking down of the “wall of confusion” specifically between developers and operations teams. This was rooted in the idea that developers didn’t think much about operational concerns and operators didn’t think much about application development. Add the fact that developers want to move quickly and operators care more about (and tend to be measured on) stability than speed, and it’s easy to see why it was difficult to get the two groups on the same page. Hence, DevOps came to symbolize developers and operators working more closely together, or even merging roles to some degree. - -Of course, calls for improved communications and better-integrated workflows were never just about dev and ops. Business owners should be part of conversations as well. And there are the actual users of the software. Indeed, you can write up an almost arbitrarily long list of stakeholders concerned with the functionality, cost, reliability, and other aspects of software and its associated infrastructure. Which raises the question that many have asked: “What’s so special about security that we need a DevSecOps term?” - -I’m glad you asked. - -The first is simply that it serves as a useful reminder. If developers and operations were historically two of the most common silos in IT organizations, security was (and often still is) another. Security people are often thought of as conservative gatekeepers for whom “no” often seems the safest response to new software releases and technologies. Security’s job is to protect the company, even if that means putting the brakes on a speedy development process. - -Many aspects of traditional security, and even its vocabulary, can also seem arcane to non-specialists. This has also contributed to the notion that security is something apart from mainstream IT. I often share the following anecdote: A year or two ago I was leading a security discussion at a [DevOpsDays][4] event in London in which we were talking about traditional security roles. One of the participants raised his hand and admitted that he was one of those security gatekeepers. He went on to say that this was the first time in his career that he had ever been to a conference that wasn’t a traditional security conference like RSA. (He also noted that he was going to broaden both his and his team’s horizons more.) - -So DevSecOps perhaps shouldn’t be a needed term. But explicitly calling it out seems like a good practice at a time when software security threats are escalating. - -The second reason is that the widespread introduction of cloud-native technologies, particularly those built around containers, are closely tied to DevOps practices. These new technologies are both leading to and enabling greater scale and more dynamic infrastructures. Static security policies and checklists no longer suffice. Security must become a continuous activity. And it must be considered at every stage of your application and infrastructure lifecycle. - -**Here are a few examples:** - -You need to secure the pipeline and applications. You need to use trusted sources for content so that you know who has signed off on container images and that they’re up-to-date with the most recent patches. Your continuous integration system must integrate automated security testing. You’ll sometimes hear people talking about “shifting security left,” which means earlier in the process so that problems can be dealt with sooner. But it’s actually better to think about embedding security throughout the entire pipeline at each step of the testing, integration, deployment, and ongoing management process. - -You need to secure the underlying infrastructure. This means securing the host Linux kernel from container escapes and securing containers from each other. It means using a container orchestration platform with integrated security features. It means defending the network by using network namespaces to isolate applications from other applications within a cluster and isolate environments (such as dev, test, and production) from each other. - -And it means taking advantage of the broader security ecosystem such as container content scanners and vulnerability management tools. - -In short, it’s DevSecOps because modern application development and container platforms require a new type of Dev and a new type of Ops. But they also require a new type of Sec. Thus, DevSecOps. - -**[See our related story,[Security and the SRE: How chaos engineering can play a key role][5].]** - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/4/devsecops - -作者:[Gordon Haff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/ghaff -[1]:https://opensource.com/resources/devops -[2]:https://kubernetes.io/ -[3]:https://jenkins.io/ -[4]:https://www.devopsdays.org/ -[5]:https://opensource.com/article/18/3/through-looking-glass-security-sre diff --git a/sources/talk/20180405 Rethinking -ownership- across the organization.md b/sources/talk/20180405 Rethinking -ownership- across the organization.md deleted file mode 100644 index d41a3a86dc..0000000000 --- a/sources/talk/20180405 Rethinking -ownership- across the organization.md +++ /dev/null @@ -1,125 +0,0 @@ -Rethinking "ownership" across the organization -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chain.png?itok=sgAjswFf) -Differences in organizational design don't necessarily make some organizations better than others—just better suited to different purposes. Any style of organization must account for its models of ownership (the way tasks get delegated, assumed, executed) and responsibility (the way accountability for those tasks gets distributed and enforced). Conventional organizations and open organizations treat these issues differently, however, and those difference can be jarring for anyone hopping transitioning from one organizational model to another. But transitions are ripe for stumbling over—oops, I mean, learning from. - -Let's do that. - -### Ownership explained - -In most organizations (and according to typical project management standards), work on projects proceeds in five phases: - - * Initiation: Assess project feasibility, identify deliverables and stakeholders, assess benefits - * Planning (Design): Craft project requirements, scope, and schedule; develop communication and quality plans - * Executing: Manage task execution, implement plans, maintain stakeholder relationships - * Monitoring/Controlling: Manage project performance, risk, and quality of deliverables - * Closing: Sign-off on completion requirements, release resources - - - -The list above is not exhaustive, but I'd like to add one phase that is often overlooked: the "Adoption" phase, frequently needed for strategic projects where a change to the culture or organization is required for "closing" or completion. - - * Adoption: Socializing the work of the project; providing communication, training, or integration into processes and standard workflows. - - - -Examining project phases is one way contrast the expression of ownership and responsibility in organizations. - -### Two models, contrasted - -In my experience, "ownership" in a traditional software organization works like this. - -A manager or senior technical associate initiates a project with senior stakeholders and, with the authority to champion and guide the project, they bestow the project on an associate at some point during the planning and execution stages. Frequently, but not always, the groundwork or fundamental design of the work has already been defined and approved—sometimes even partially solved. Employees are expected to see the project through execution and monitoring to completion. - -Employees cut their teeth on a "starter project," where they prove their abilities to a management chain (for example, I recall several such starter projects that were already defined by a manager and architect, and I was assigned to help implement them). Employees doing a good job on a project for which they're responsible get rewarded with additional opportunities, like a coveted assignment, a new project, or increased responsibility. - -An associate acting as "owner" of work is responsible and accountable for that work (if someone, somewhere, doesn't do their job, then the responsible employee either does the necessary work herself or alerts a manager to the problem.) A sense of ownership begins to feel stable over time: Employees generally work on the same projects, and in the same areas for an extended period. For some employees, it means the development of deep expertise. That's because the social network has tighter integration between people and the work they do, so moving around and changing roles and projects is rather difficult. - -This process works differently in an open organization. - -Associates continually define the parameters of responsibility and ownership in an open organization—typically in light of their interests and passions. Associates have more agency to perform all the stages of the project themselves, rather than have pre-defined projects assigned to them. This places additional emphasis on leadership skills in an open organization, because the process is less about one group of people making decisions for others, and more about how an associate manages responsibilities and ownership (whether or not they roughly follow the project phases while being inclusive, adaptable, and community-focused, for example). - -Being responsible for all project phases can make ownership feel more risky for associates in an open organization. Proposing a new project, designing it, and leading its implementation takes initiative and courage—especially when none of this is pre-defined by leadership. It's important to get continuous buy-in, which comes with questions, criticisms, and resistance not only from leaders but also from peers. By default, in open organizations this makes associates leaders; they do much the same work that higher-level leaders do in conventional organizations. And incidentally, this is why Jim Whitehurst, in The Open Organization, cautions us about the full power of "transparency" and the trickiness of getting people's real opinions and thoughts whether we like them or not. The risk is not as high in a traditional organization, because in those organizations leaders manage some of it by shielding associates from heady discussions that arise. - -The reward in an Open Organization is more opportunity—offers of new roles, promotions, raises, etc., much like in a conventional organization. Yet in the case of open organizations, associates have developed reputations of excellence based on their own initiatives, rather than on pre-sanctioned opportunities from leadership. - -### Thinking about adoption - -Any discussion of ownership and responsibility involves addressing the issue of buy-in, because owning a project means we are accountable to our sponsors and users—our stakeholders. We need our stakeholders to buy-into our idea and direction, or we need users to adopt an innovation we've created with our stakeholders. Achieving buy-in for ideas and work is important in each type of organization, and it's difficult in both traditional and open systems—but for different reasons. - -Open organizations better allow highly motivated associates, who are ambitious and skilled, to drive their careers. But support for their ideas is required across the organization, rather than from leadership alone. - -Penetrating a traditional organization's closely knit social ties can be difficult, and it takes time. In such "command-and-control" environments, one would think that employees are simply "forced" to do whatever leaders want them to do. In some cases that's true (e.g., a travel reimbursement system). However, with more innovative programs, this may not be the case; the adoption of a program, tool, or process can be difficult to achieve by fiat, just like in an open organization. And yet these organizations tend to reduce redundancies of work and effort, because "ownership" here involves leaders exerting responsibility over clearly defined "domains" (and because those domains don't change frequently, knowing "who's who"—who's in charge, who to contact with a request or inquiry or idea—can be easier). - -Open organizations better allow highly motivated associates, who are ambitious and skilled, to drive their careers. But support for their ideas is required across the organization, rather than from leadership alone. Points of contact and sources of immediate support can be less obvious, and this means achieving ownership of a project or acquiring new responsibility takes more time. And even then someone's idea may never get adopted. A project's owner can change—and the idea of "ownership" itself is more flexible. Ideas that don't get adopted can even be abandoned, leaving a great idea unimplemented or incomplete. Because any associate can "own" an idea in an open organization, these organizations tend to exhibit more redundancy. (Some people immediately think this means "wasted effort," but I think it can augment the implementation and adoption of innovative solutions. By comparing these organizations, we can also see why Jim Whitehurst calls this kind of culture "chaotic" in The Open Organization). - -### Two models of ownership - -In my experience, I've seen very clear differences between conventional and open organizations when it comes to the issues of ownership and responsibility. - -In an traditional organization: - - * I couldn't "own" things as easily - * I felt frustrated, wanting to take initiative and always needing permission - * I could more easily see who was responsible because stakeholder responsibility was more clearly sanctioned and defined - * I could more easily "find" people, because the organizational network was more fixed and stable - * I more clearly saw what needed to happen (because leadership was more involved in telling me). - - - -Over time, I've learned the following about ownership and responsibility in an open organization: - - * People can feel good about what they are doing because the structure rewards behavior that's more self-driven - * Responsibility is less clear, especially in situations where there's no leader - * In cases where open organizations have "shared responsibility," there is the possibility that no one in the group identified with being responsible; often there is lack of role clarity ("who should own this?") - * More people participate - * Someone's leadership skills must be stronger because everyone is "on their own"; you are the leader. - - - -### Making it work - -On the subject of ownership, each type of organization can learn from the other. The important thing to remember here: Don't make changes to one open or conventional value without considering all the values in both organizations. - -Sound confusing? Maybe these tips will help. - -If you're a more conventional organization trying to act more openly: - - * Allow associates to take ownership out of passion or interest that align with the strategic goals of the organization. This enactment of meritocracy can help them build a reputation for excellence and execution. - * But don't be afraid sprinkle in a bit of "high-level perspective" in the spirit of transparency; that is, an associate should clearly communicate plans to their leadership, so the initiative doesn't create irrelevant or unneeded projects. - * Involving an entire community (as when, for example, the associate gathers feedback from multiple stakeholders and user groups) aids buy-in and creates beneficial feedback from the diversity of perspectives, and this helps direct the work. - * Exploring the work with the community [doesn't mean having to come to consensus with thousands of people][1]. Use the [Open Decision Framework][2] to set limits and be transparent about what those limits are so that feedback and participation is organized ad boundaries are understood. - - - -If you're already an open organization, then you should remember: - - * Although associates initiate projects from "the bottom up," leadership needs to be involved to provide guidance, input to the vision, and circulate centralized knowledge about ownership and responsibility creating a synchronicity of engagement that is transparent to the community. - * Ownership creates responsibility, and the definition and degree of these should be something both associates and leaders agree upon, increasing the transparency of expectations and accountability during the project. Don't make this a matter of oversight or babysitting, but rather [a collaboration where both parties give and take][3]—associates initiate, leaders guide; associates own, leaders support. - - - -Leadership education and mentorship, as it pertains to a particular organization, needs to be available to proactive associates, especially since there is often a huge difference between supporting individual contributors and guiding and coordinating a multiplicity of contributions. - -["Owning your own career"][4] can be difficult when "ownership" isn't a concept an organization completely understands. - -[Subscribe to our weekly newsletter][5] to learn more about open organizations. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/18/4/rethinking-ownership-across-organization - -作者:[Heidi Hess von Ludewig][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/heidi-hess-von-ludewig -[1]:https://opensource.com/open-organization/17/8/achieving-alignment-in-openorg -[2]:https://opensource.com/open-organization/resources/open-decision-framework -[3]:https://opensource.com/open-organization/17/11/what-is-collaboration -[4]:https://opensource.com/open-organization/17/12/drive-open-career-forward -[5]:https://opensource.com/open-organization/resources/newsletter diff --git a/sources/talk/20180410 Microservices Explained.md b/sources/talk/20180410 Microservices Explained.md deleted file mode 100644 index 1d7e946a12..0000000000 --- a/sources/talk/20180410 Microservices Explained.md +++ /dev/null @@ -1,61 +0,0 @@ -Microservices Explained -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-microservices.jpg?itok=GpoWiDeG) -Microservices is not a new term. Like containers, the concept been around for a while, but it’s become a buzzword recently as many companies embark on their cloud native journey. But, what exactly does the term microservices mean? Who should care about it? In this article, we’ll take a deep dive into the microservices architecture. - -### Evolution of microservices - -Patrick Chanezon, Chief Developer Advocate for Docker provided a brief history lesson during our conversation: In the late 1990s, developers started to structure their applications into monoliths where massive apps hadall features and functionalities baked into them. Monoliths were easy to write and manage. Companies could have a team of developers who built their applications based on customer feedback through sales and marketing teams. The entire developer team would work together to build tightly glued pieces as an app that can be run on their own app servers. It was a popular way of writing and delivering web applications. - -There is a flip side to the monolithic coin. Monoliths slow everything and everyone down. It’s not easy to update one service or feature of the application. The entire app needs to be updated and a new version released. It takes time. There is a direct impact on businesses. Organizations could not respond quickly to keep up with new trends and changing market dynamics. Additionally, scalability was challenging. - -Around 2011, SOA (Service Oriented Architecture) became popular where developers could cram multi-tier web applications as software services inside a VM (virtual machine). It did allow them to add or update services independent of each other. However, scalability still remained a problem. - -“The scale out strategy then was to deploy multiple copies of the virtual machine behind a load balancer. The problems with this model are several. Your services can not scale or be upgraded independently as the VM is your lowest granularity for scale. VMs are bulky as they carry extra weight of an operating system, so you need to be careful about simply deploying multiple copies of VMs for scaling,” said Madhura Maskasky, co-founder and VP of Product at Platform9. - -Some five years ago when Docker hit the scene and containers became popular, SOA faded out in favor of “microservices” architecture. “Containers and microservices fix a lot of these problems. Containers enable deployment of microservices that are focused and independent, as containers are lightweight. The Microservices paradigm, combined with a powerful framework with native support for the paradigm, enables easy deployment of independent services as one or more containers as well as easy scale out and upgrade of these,” said Maskasky. - -### What’s are microservices? - -Basically, a microservice architecture is a way of structuring applications. With the rise of containers, people have started to break monoliths into microservices. “The idea is that you are building your application as a set of loosely coupled services that can be updated and scaled separately under the container infrastructure,” said Chanezon. - -“Microservices seem to have evolved from the more strictly defined service-oriented architecture (SOA), which in turn can be seen as an expression object oriented programming concepts for networked applications. Some would call it just a rebranding of SOA, but the term “microservices” often implies the use of even smaller functional components than SOA, RESTful APIs exchanging JSON, lighter-weight servers (often containerized, and modern web technologies and protocols,” said Troy Topnik, SUSE Senior Product Manager, Cloud Application Platform. - -Microservices provides a way to scale development and delivery of large, complex applications by breaking them down that allows the individual components to evolve independently from each other. - -“Microservices architecture brings more flexibility through the independence of services, enabling organizations to become more agile in how they deliver new business capabilities or respond to changing market conditions. Microservices allows for using the ‘right tool for the right task’, meaning that apps can be developed and delivered by the technology that will be best for the task, rather than being locked into a single technology, runtime or framework,” said Christian Posta, senior principal application platform specialist, Red Hat. - -### Who consumes microservices? - -“The main consumers of microservices architecture patterns are developers and application architects,” said Topnik. As far as admins and DevOps engineers are concerned their role is to build and maintain the infrastructure and processes that support microservices. - -“Developers have been building their applications traditionally using various design patterns for efficient scale out, high availability and lifecycle management of their applications. Microservices done along with the right orchestration framework help simplify their lives by providing a lot of these features out of the box. A well-designed application built using microservices will showcase its benefits to the customers by being easy to scale, upgrade, debug, but without exposing the end customer to complex details of the microservices architecture,” said Maskasky. - -### Who needs microservices? - -Everyone. Microservices is the modern approach to writing and deploying applications more efficiently. If an organization cares about being able to write and deploy its services at a faster rate they should care about it. If you want to stay ahead of your competitors, microservices is the fastest route. Security is another major benefit of the microservices architecture, as this approach allows developers to keep up with security and bug fixes, without having to worry about downtime. - -“Application developers have always known that they should build their applications in a modular and flexible way, but now that enough of them are actually doing this, those that don’t risk being left behind by their competitors,” said Topnik. - -If you are building a new application, you should design it as microservices. You never have to hold up a release if one team is late. New functionalities are available when they're ready, and the overall system never breaks. - -“We see customers using this as an opportunity to also fix other problems around their application deployment -- such as end-to-end security, better observability, deployment and upgrade issues,” said Maskasky. - -Failing to do so means you would be stuck in the traditional stack, which means microservices won’t be able to add any value to it. If you are building new applications, microservices is the way to go. - -Learn more about cloud-native at [KubeCon + CloudNativeCon Europe][1], coming up May 2-4 in Copenhagen, Denmark. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/4/microservices-explained - -作者:[SWAPNIL BHARTIYA][a] -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/arnieswap -[1]:https://events.linuxfoundation.org/events/kubecon-cloudnativecon-europe-2018/attend/register/ diff --git a/sources/talk/20180412 Management, from coordination to collaboration.md b/sources/talk/20180412 Management, from coordination to collaboration.md deleted file mode 100644 index 1262f88300..0000000000 --- a/sources/talk/20180412 Management, from coordination to collaboration.md +++ /dev/null @@ -1,71 +0,0 @@ -Management, from coordination to collaboration -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_consensuscollab2.png?itok=uMO9zn5U) - -Any organization is fundamentally a pattern of interactions between people. The nature of those interactions—their quality, their frequency, their outcomes—is the most important product an organization can create. Perhaps counterintuitively, recognizing this fact has never been more important than it is today—a time when digital technologies are reshaping not only how we work but also what we do when we come together. - - -And yet many organizational leaders treat those interactions between people as obstacles or hindrances to avoid or eliminate, rather than as the powerful sources of innovation they really are. - -That's why we're observing that some of the most successful organizations today are those capable of shifting the way they think about the value of the interactions in the workplace. And to do that, they've radically altered their approach to management and leadership. - -### Moving beyond mechanical management - -Simply put, traditionally managed organizations treat unanticipated interactions between stakeholders as potentially destructive forces—and therefore as costs to be mitigated. - -This view has a long, storied history in the field of economics. But it's perhaps nowhere more clear than in the early writing of Nobel Prize-winning economist[Ronald Coase][1]. In 1937, Coase published "[The Nature of the Firm][2]," an essay about the reasons people organized into firms to work on large-scale projects—rather than tackle those projects alone. Coase argued that when the cost of coordinating workers together inside a firm is less than that of similar market transactions outside, people will tend to organize so they can reap the benefits of lower operating costs. - -But at some point, Coase's theory goes, the work of coordinating interactions between so many people inside the firm actually outweighs the benefits of having an organization in the first place. The complexity of those interactions becomes too difficult to handle. Management, then, should serve the function of decreasing this complexity. Its primary goal is coordination, eliminating the costs associated with messy interpersonal interactions that could slow the firm and reduce its efficiency. As one Fortune 100 CEO recently told me, "Failures happen most often around organizational handoffs." - -This makes sense to people practicing what I've called "[mechanical management][3]," where managing people is the act of keeping them focused on specific, repeatable, specialized tasks. Here, management's key function is optimizing coordination costs—ensuring that every specialized component of the finely-tuned organizational machine doesn't impinge on the others and slow them down. Managers work to avoid failures by coordinating different functions across the organization (accounts payable, research and development, engineering, human resources, sales, and so on) to get them to operate toward a common goal. And managers create value by controlling information flows, intervening only when functions become misaligned. - -Today, when so many of these traditionally well-defined tasks have become automated, value creation is much more a result of novel innovation and problem solving—not finding new ways to drive efficiency from repeatable processes. But numerous studies demonstrate that innovative, problem-solving activity occurs much more regularly when people work in cross-functional teams—not as isolated individuals or groups constrained by single-functional silos. This kind of activity can lead to what some call "accidental integration": the serendipitous innovation that occurs when old elements combine in new and unforeseen ways. - -That's why working collaboratively has now become a necessity that managers need to foster, not eliminate. - -### From coordination to collaboration - -Reframing the value of the firm—from something that coordinated individual transactions to something that produces novel innovations—means rethinking the value of the relations at the core of our organizations. And that begins with reimagining the task of management, which is no longer concerned primarily with minimizing coordination costs but maximizing cooperation opportunities. - -Too few of our tried-and-true management practices have this goal. If they're seeking greater innovation, managers need to encourage more interactions between people in different functional areas, not fewer. A cross-functional team may not be as efficient as one composed of people with the same skill sets. But a cross-functional team is more likely to be the one connecting points between elements in your organization that no one had ever thought to connect (the one more likely, in other words, to achieve accidental integration). - -Working collaboratively has now become a necessity that managers need to foster, not eliminate. - -I have three suggestions for leaders interested in making this shift: - -First, define organizations around processes, not functions. We've seen this strategy work in enterprise IT, for example, in the case of [DevOps][4], where teams emerge around end goals (like a mobile application or a website), not singular functions (like developing, testing, and production). In DevOps environments, the same team that writes the code is responsible for maintaining it once it's in production. (We've found that when the same people who write the code are the ones woken up when it fails at 3 a.m., we get better code.) - -Second, define work around the optimal organization rather than the organization around the work. Amazon is a good example of this strategy. Teams usually stick to the "[Two Pizza Rule][5]" when establishing optimal conditions for collaboration. In other words, Amazon leaders have determined that the best-sized team for maximum innovation is about 10 people, or a group they can feed with two pizzas. If the problem gets bigger than that two-pizza team can handle, they split the problem into two simpler problems, dividing the work between multiple teams rather than adding more people to the single team. - -And third, to foster creative behavior and really get people cooperating with one another, do whatever you can to cultivate a culture of honest and direct feedback. Be straightforward and, as I wrote in The Open Organization, let the sparks fly; have frank conversations and let the best ideas win. - -### Let it go - -I realize that asking managers to significantly shift the way they think about their roles can lead to fear and skepticism. Some managers define their performance (and their very identities) by the control they exert over information and people. But the more you dictate the specific ways your organization should do something, the more static and brittle that activity becomes. Agility requires letting go—giving up a certain degree of control. - -Front-line managers will see their roles morph from dictating and monitoring to enabling and supporting. Instead of setting individual-oriented goals, they'll need to set group-oriented goals. Instead of developing individual incentives, they'll need to consider group-oriented incentives. - -Because ultimately, their goal should be to[create the context in which their teams can do their best work][6]. - -[Subscribe to our weekly newsletter][7] to learn more about open organizations. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/18/4/management-coordination-collaboration - -作者:[Jim Whitehurst][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/remyd -[1]:https://news.uchicago.edu/article/2013/09/02/ronald-h-coase-founding-scholar-law-and-economics-1910-2013 -[2]:http://onlinelibrary.wiley.com/doi/10.1111/j.1468-0335.1937.tb00002.x/full -[3]:https://opensource.com/open-organization/18/2/try-learn-modify -[4]:https://enterprisersproject.com/devops -[5]:https://www.fastcompany.com/3037542/productivity-hack-of-the-week-the-two-pizza-approach-to-productive-teamwork -[6]:https://opensource.com/open-organization/16/3/what-it-means-be-open-source-leader -[7]:https://opensource.com/open-organization/resources/newsletter diff --git a/sources/talk/20180416 For project safety back up your people, not just your data.md b/sources/talk/20180416 For project safety back up your people, not just your data.md deleted file mode 100644 index 0dc6d41fa5..0000000000 --- a/sources/talk/20180416 For project safety back up your people, not just your data.md +++ /dev/null @@ -1,79 +0,0 @@ -For project safety back up your people, not just your data -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel) -The [FSF][1] was founded in 1985, Perl in 1987 ([happy 30th birthday, Perl][2]!), and Linux in 1991. The [term open source][3] and the [Open Source Initiative][4] both came into being in 1998 (and [turn 20 years old][5] in 2018). Since then, free and open source software has grown to become the default choice for software development, enabling incredible innovation. - -We, the greater open source community, have come of age. Millions of open source projects exist today, and each year the [GitHub Octoverse][6] reports millions of new public repositories. We rely on these projects every day, and many of us could not operate our services or our businesses without them. - -So what happens when the leaders of these projects move on? How can we help ease those transitions while ensuring that the projects thrive? By teaching and encouraging **succession planning**. - -### What is succession planning? - -Succession planning is a popular topic among business executives, boards of directors, and human resources professionals, but it doesn't often come up with maintainers of free and open source projects. Because the concept is common in business contexts, that's where you'll find most resources and advice about establishing a succession plan. As you might expect, most of these articles aren't directly applicable to FOSS, but they do form a springboard from which we can launch our own ideas about succession planning. - -According to [Wikipedia][7]: - -> Succession planning is a process for identifying and developing new leaders who can replace old leaders when they leave, retire, or die. - -In my opinion, this definition doesn't apply very well to free and open source software projects. I primarily object to the use of the term leaders. For the collaborative projects of FOSS, everyone can be some form of leader. Roles other than "project founder" or "benevolent dictator for life" are just as important. Any project role that is measured by bus factor is one that can benefit from succession planning. - -> A project's bus factor is the number of team members who, if hit by a bus, would endanger the smooth operation of the project. The smallest and worst bus factor is 1: when only a single person's loss would put the project in jeopardy. It's a somewhat grim but still very useful concept. - -I propose that instead of viewing succession planning as a leadership pipeline, free and open source projects should view it as a skills pipeline. What sorts of skills does your project need to continue functioning well, and how can you make sure those skills always exist in your community? - -### Benefits of succession planning - -When I talk to project maintainers about succession planning, they often respond with something like, "We've been pretty successful so far without having to think about this. Why should we start now?" - -Aside from the fact that the phrase, "We've always done it this way" is probably one of the most dangerous in the English language, and hearing (or saying) it should send up red flags in any community, succession planning provides plenty of very real benefits: - - * **Continuity** : When someone leaves, what happens to the tasks they were performing? Succession planning helps ensure those tasks continue uninterrupted and no one is left hanging. - * **Avoiding a power vacuum** : When a person leaves a role with no replacement, it can lead to confusion, delays, and often most damaging, political woes. After all, it's much easier to fix delays than hurt feelings. A succession plan helps alleviate the insecure and unstable time when someone in a vital role moves on. - * **Increased project/organization longevity** : The thinking required for succession planning is the same sort of thinking that contributes to project longevity. Ensuring continuity in leadership, culture, and productivity also helps ensure the project will continue. It will evolve, but it will survive. - * **Reduced workload/pressure on current leaders** : When a single team member performs a critical role in the project, they often feel pressure to be constantly "on." This can lead to burnout and worse, resignations. A succession plan ensures that all important individuals have a backup or successor. The knowledge that someone can take over is often enough to reduce the pressure, but it also means that key players can take breaks or vacations without worrying that their role will be neglected in their absence. - * **Talent development** : Members of the FOSS community talk a lot about mentoring these days, and that's great. However, most of the conversation is around mentoring people to contribute code to a project. There are many different ways to contribute to free and open source software projects beyond programming. A robust succession plan recognizes these other forms of contribution and provides mentoring to prepare people to step into critical non-programming roles. - * **Inspiration for new members** : It can be very motivational for new or prospective community members to see that a project uses its succession plan. Not only does it show them that the project is well-organized and considers its own health and welfare as well as that of its members, but it also clearly shows new members how they can grow in the community. An obvious path to critical roles and leadership positions inspires new members to stick around to walk that path. - * **Diversity of thoughts/get out of a rut** : Succession plans provide excellent opportunities to bring in new people and ideas to the critical roles of a project. [Studies show][8] that diverse leadership teams are more effective and the projects they lead are more innovative. Using your project's succession plan to mentor people from different backgrounds and with different perspectives will help strengthen and evolve the project in a healthy way. - * **Enabling meritocracy** : Unfortunately, what often passes for meritocracy in many free and open source projects is thinly veiled hostility toward new contributors and diverse opinions—hostility that's delivered from within an echo chamber. Meritocracy without a mentoring program and healthy governance structure is simply an excuse to practice subjective discrimination while hiding behind unexpressed biases. A well-executed succession plan helps teams reach the goal of a true meritocracy. What counts as merit for any given role, and how to reach that level of merit, are openly, honestly, and completely documented. The entire community will be able to see and judge which members are on the path or deserve to take on a particular critical role. - - - -### Why it doesn't happen - -Succession planning isn't a panacea, and it won't solve all problems for all projects, but as described above, it offers a lot of worthwhile benefits to your project. - -Despite that, very few free and open source projects or organizations put much thought into it. I was curious why that might be, so I asked around. I learned that the reasons for not having a succession plan fall into one of five different buckets: - - * **Too busy** : Many people recognize succession planning (or lack thereof) as a problem for their project but just "hadn't ever gotten around to it" because there's "always something more important to work on." I understand and sympathize with this, but I suspect the problem may have more to do with prioritization than with time availability. - * **Don't think of it** : Some people are so busy and preoccupied that they haven't considered, "Hey, what would happen if Jen had to leave the project?" This never occurs to them. After all, Jen's always been there when they need her, right? And that will always be the case, right? - * **Don't want to think of it** : Succession planning shares a trait with estate planning: It's associated with negative feelings like loss and can make people address their own mortality. Some people are uncomfortable with this and would rather not consider it at all than take the time to make the inevitable easier for those they leave behind. - * **Attitude of current leaders** : A few of the people with whom I spoke didn't want to recognize that they're replaceable, or to consider that they may one day give up their power and influence on the project. While this was (thankfully) not a common response, it was alarming enough to deserve its own bucket. Failure of someone in a critical role to recognize or admit that they won't be around forever can set a project up for failure in the long run. - * **Don't know where to start** : Many people I interviewed realize that succession planning is something that their project should be doing. They were even willing to carve out the time to tackle this very large task. What they lacked was any guidance on how to start the process of creating a succession plan. - - - -As you can imagine, something as important and people-focused as a succession plan isn't easy to create, and it doesn't happen overnight. Also, there are many different ways to do it. Each project has its own needs and critical roles. One size does not fit all where succession plans are concerned. - -There are, however, some guidelines for how every project could proceed with the succession plan creation process. I'll cover these guidelines in my next article. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/4/passing-baton-succession-planning-foss-leadership - -作者:[VM(Vicky) Brasseur][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/vmbrasseur -[1]:http://www.fsf.org -[2]:https://opensource.com/article/17/10/perl-turns-30 -[3]:https://opensource.com/article/18/2/coining-term-open-source-software -[4]:https://opensource.org -[5]:https://opensource.org/node/910 -[6]:https://octoverse.github.com -[7]:https://en.wikipedia.org/wiki/Succession_planning -[8]:https://hbr.org/2016/11/why-diverse-teams-are-smarter diff --git a/sources/talk/20180417 How to develop the FOSS leaders of the future.md b/sources/talk/20180417 How to develop the FOSS leaders of the future.md deleted file mode 100644 index a65dc9dabd..0000000000 --- a/sources/talk/20180417 How to develop the FOSS leaders of the future.md +++ /dev/null @@ -1,93 +0,0 @@ -How to develop the FOSS leaders of the future -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_paperclips.png?itok=j48op49T) -Do you hold a critical role in a free and open source software project? Would you like to make it easier for the next person to step into your shoes, while also giving yourself the freedom to take breaks and avoid burnout? - -Of course you would! But how do you get started? - -Before you do anything, remember that this is a free or open source project. As with all things in FOSS, your succession planning should happen in collaboration with others. The [Principle of Least Astonishment][1] also applies: Don't work on your plan in isolation, then spring it on the entire community. Work together and publicly, so no one is caught off guard when the cultural or governance changes start happening. - -### Identify and analyse critical roles - -As a project leader, your first step is to identify the critical roles in your community. While it can help to ask each community members what role they perform, it's important to realize that most people perform multiple roles. Make sure you consider every role that each community member plays in the project. - -Once you've identified the roles and determined which ones are critical to your project, the next step is to list all of the duties and responsibilities for each of those critical roles. Be very honest here. List the duties and responsibilities you think each role has, then ask the person who performs that role to list the duties the role actually has. You'll almost certainly find that the second list is longer than the first. - -### Refactor large roles - -During this process, have you discovered any roles that encompass a large number of duties and responsibilities? Large roles are like large methods in your code: They're a sign of a problem, and they need to be refactored to make them easier to maintain. One of the easiest and most effective steps in succession planning for FOSS projects is to split up each large role into two or more smaller roles and distribute these to other community members. With that one step, you've greatly improved the [bus factor][2] for your project. Even better, you've made each one of those new, smaller roles much more accessible and less intimidating for new community members. People are much more likely to volunteer for a role if it's not a massive burden. - -### Limit role tenure - -Another way to make a role more enticing is to limit its tenure. Community members will be more willing to step into roles that aren't open-ended. They can look at their life and work plans and ask themselves, "Can I take on this role for the next eighteen months?" (or whatever term limit you set). - -Setting term limits also helps those who are currently performing the role. They know when they can set aside those duties and move on to something else, which can help alleviate burnout. Also, setting a term limit creates a pool of people who have performed the role and are qualified to step in if needed, which can also mitigate burnout. - -### Knowledge transfer - -Once you've identified and defined the critical roles in your project, most of what remains is knowledge transfer. Even small projects involve a lot of moving parts and knowledge that needs to be where everyone can see, share, use, and contribute to it. What sort of knowledge should you be collecting? The answer will vary by project, needs, and role, but here are some of the most common (and commonly overlooked) types of information needed to implement a succession plan: - - * **Roles and their duties** : You've spent a lot of time identifying, analyzing, and potentially refactoring roles and their duties. Make sure this information doesn't get lost. - * **Policies and procedures** : None of those duties occur in a vacuum. Each duty must be performed in a particular way (procedures) when particular conditions are met (policies). Take stock of these details for every duty of every role. - * **Resources** : What accounts are associated with the project, or are necessary for it to operate? Who helps you with meetup space, sponsorship, or in-kind services? Such information is vital to project operation but can be easily lost when the responsible community member moves on. - * **Credentials** : Ideally, every external service required by the project will use a login that goes to an email address designated for a specific role (`sre@project.org`) rather than to a personal address. Every role's address should include multiple people on the distribution list to ensure that important messages (such as downtime or bogus "forgot password" requests) aren't missed. The credentials for every service should be kept in a secure keystore, with access limited to the fewest number of people possible. - * **Project history** : All community members benefit greatly from learning the history of the project. Collecting project history information can clarify why decisions were made in the past, for example, and reveal otherwise unexpressed requirements and values of the community. Project histories can also help new community members understand "inside jokes," jargon, and other cultural factors. - * **Transition plans** : A succession plan doesn't do much good if project leaders haven't thought through how to transition a role from one person to another. How will you locate and prepare people to take over a critical role? Since the project has already done a lot of thinking and knowledge transfer, transition plans for each role may be easier to put together. - - - -Doing a complete knowledge transfer for all roles in a project can be an enormous undertaking, but the effort is worth it. To avoid being overwhelmed by such a daunting task, approach it one role at a time, finishing each one before you move onto the next. Limiting the scope in this way makes both progress and success much more likely. - -### Document, document, document! - -Succession planning takes time. The community will be making a lot of decisions and collecting a lot of information, so make sure nothing gets lost. It's important to document everything (not just in email threads). Where knowledge is concerned, documentation scales and people do not. Include even the things that you think are obvious—what's obvious to a more seasoned community member may be less so to a newbie, so don't skip steps or information. - -Gather these decisions, processes, policies, and other bits of information into a single place, even if it's just a collection of markdown files in the main project repository. The "how" and "where" of the documentation can be sorted out later. It's better to capture key information first and spend time [bike-shedding][3] a documentation system later. - -Once you've collected all of this information, you should understand that it's unlikely that anyone will read it. I know, it seems unfair, but that's just how things usually work out. The reason? There is simply too much documentation and too little time. To address this, add an abstract, or summary, at the top of each item. Often that's all a person needs, and if not, the complete document is there for a deep dive. Recognizing and adapting to how most people use documentation increases the likelihood that they will use yours. - -Above all, don't skip the documentation process. Without documentation, succession plans are impossible. - -### New leaders - -If you don't yet perform a critical role but would like to, you can contribute to the succession planning process while apprenticing your way into one of those roles. - -For starters, actively look for opportunities to learn and contribute. Shadow people in critical roles. You'll learn how the role is done, and you can document it to help with the succession planning process. You'll also get the opportunity to see whether it's a role you're interested in pursuing further. - -Asking for mentorship is a great way to get yourself closer to taking on a critical role in the project. Even if you haven't heard that mentoring is available, it's perfectly OK to ask about it. The people already in those roles are usually happy to mentor others, but often are too busy to think about offering mentorship. Asking is a helpful reminder to them that they should be helping to train people to take over their role when they need a break. - -As you perform your own tasks, actively seek out feedback. This will not only improve your skills, but it shows that you're interested in doing a better job for the community. This commitment will pay off when your project needs people to step into critical roles. - -Finally, as you communicate with more experienced community members, take note of anecdotes about the history of the project and how it operates. This history is very important, especially for new contributors or people stepping into critical roles. It provides the context necessary for new contributors to understand what things do or don't work and why. As you hear these stories, document them so they can be passed on to those who come after you. - -### Succession planning examples - -While too few FOSS projects are actively considering succession planning, some are doing a great job of trying to reduce their bus factor and prevent maintainer burnout. - -[Exercism][4] isn't just an excellent tool for gaining fluency in programming languages. It's also an [open source project][5] that goes out of its way to help contributors [land their first patch][6]. In 2016, the project reviewed the health of each language track and [discovered that many were woefully maintained][7]. There simply weren't enough people covering each language, so maintainers were burning out. The Exercism community recognized the risk this created and pushed to find new maintainers for as many language tracks as possible. As a result, the project was able to revive several tracks from near-death and develop a structure for inviting people to become maintainers. - -The purpose of the [Vox Pupuli][8] project is to serve as a sort of succession plan for the [Puppet module][9] community. When a maintainer no longer wishes or is able to work on their module, they can bequeath it to the Vox Pupuli community. This community of 30 collaborators shares responsibility for maintaining all the modules it accepts into the project. The large number of collaborators ensures that no single person bears the burden of maintenance while also providing a long and fruitful life for every module in the project. - -These are just two examples of how some FOSS projects are tackling succession planning. Share your stories in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/4/succession-planning-how-develop-foss-leaders-future - -作者:[VM(Vicky) Brasseur)][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/vmbrasseur -[1]:https://en.wikipedia.org/wiki/Principle_of_least_astonishment -[2]:https://en.wikipedia.org/wiki/Bus_factor -[3]:https://en.wikipedia.org/wiki/Law_of_triviality -[4]:http://exercism.io -[5]:https://github.com/exercism/exercism.io -[6]:https://github.com/exercism/exercism.io/blob/master/CONTRIBUTING.md -[7]:https://tinyletter.com/exercism/letters/exercism-track-health-check-new-maintainers -[8]:https://voxpupuli.org -[9]:https://forge.puppet.com diff --git a/sources/talk/20180418 Is DevOps compatible with part-time community teams.md b/sources/talk/20180418 Is DevOps compatible with part-time community teams.md deleted file mode 100644 index e78b96959f..0000000000 --- a/sources/talk/20180418 Is DevOps compatible with part-time community teams.md +++ /dev/null @@ -1,73 +0,0 @@ -Is DevOps compatible with part-time community teams? -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard.png?itok=kBeRTFL1) -DevOps seems to be the talk of the IT world of late—and for good reason. DevOps has streamlined the process and production of IT development and operations. However, there is also an upfront cost to embracing a DevOps ideology, in terms of time, effort, knowledge, and financial investment. Larger companies may have the bandwidth, budget, and time to make the necessary changes, but is it feasible for part-time, resource-strapped communities? - -Part-time communities are teams of like-minded people who take on projects outside of their normal work schedules. The members of these communities are driven by passion and a shared purpose. For instance, one such community is the [ALM | DevOps Rangers][1]. With 100 rangers engaged across the globe, a DevOps solution may seem daunting; nonetheless, they took on the challenge and embraced the ideology. Through their example, we've learned that DevOps is not only feasible but desirable in smaller teams. To read about their transformation, check out [How DevOps eliminates development bottlenecks][2]. - -> “DevOps is the union of people, process, and products to enable continuous delivery of value to our end customers.” - Donovan Brown - -### The cost of DevOps - -As stated above, there is an upfront "cost" to DevOps. The cost manifests itself in many forms, such as the time and collaboration between development, operations, and other stakeholders, planning a smooth-flowing process that delivers continuous value, finding the best DevOps products, and training the team in new technologies, to name a few. This aligns directly with Donovan's definition of DevOps, in fact—a **process** for delivering **continuous value** and the **people** who make that happen. - -Streamlined DevOps takes a lot of planning and training just to create the process, and that doesn't even consider the testing phase. We also can't forget the existing in-flight projects that need to be converted into the new system. While the cost increases the more pervasive the transformation—for instance, if an organization aims to unify its entire development organization under a single process, then that would cost more versus transforming a single pilot or subset of the entire portfolio—these upfront costs must be addressed regardless of their scale. There are a lot of resources and products already out there that can be implemented for a smoother transition—but again, we face the time and effort that will be necessary just to research which ones might work best. - -In the case of the ALM | DevOps Rangers, they had to halt all projects for a couple of sprints to set up the initial process. Many organizations would not be able to do that. Even part-time groups might have very good reasons to keep things moving, which only adds to the complexity. In such scenarios, additional cutover planning (and therefore additional cost) is needed, and the overall state of the community is one of flux and change, which adds risk, which—you guessed it—requires more cost to mitigate. - -There is also an ongoing "cost" that teams will face with a DevOps mindset: Simple maintenance of the system, training and transitioning new team members, and keeping up with new, improved technologies are all a part of the process. - -### DevOps for a part-time community - -Whereas larger companies can dedicate a single manager or even a team to the task over overseeing the continuous integration and continuous deployment (CI/CD) pipelines, part-time community teams don't have the bandwidth to give. With such a massive undertaking we must ask: Is it even worth it for groups with fewer resources to take on DevOps for their community? Or should they abandon the idea of DevOps altogether? - -The answer to that is dependent on a few variables, such as the ability of the teams to be self-managing, the time and effort each member is willing to put into the transformation, and the dedication of the community to the process. - -### Example: Benefits of DevOps in a part-time community - -Luckily, we aren't without examples to demonstrate just how DevOps can benefit a smaller group. Let's take a quick look at the ALM Rangers again. The results from their transformation help us understand how DevOps changed their community: - -![](https://opensource.com/sites/default/files/images/life-uploads/devops.png) - -As illustrated, there are some huge benefits for part-time community teams. Planning goes from long, arduous design sessions to a quick prototyping and storyboarding process. Builds become automated, reliable, and resilient. Testing and bug detection are proactive instead of reactive, which turns into a happier clientele. Multiple full-time program managers are replaced with self-managing teams with a single part-time manager to oversee projects. Teams become smaller and more efficient, which equates to higher production rates and higher-quality project delivery. With results like these, it's hard to argue against DevOps. - -Still, the upfront and ongoing costs aren't right for every community. The number-one most important aspect of any DevOps transformation is the mindset of the people involved. Adopting the idea of self-managing teams who work in autonomy instead of the traditional chain-of-command scheme can be a challenge for any group. The members must be willing to work independently without a lot of oversight and take ownership of their features and user experience, but at the same time, work in a setting that is fully transparent to the rest of the community. **The success or failure of a DevOps strategy lies on the team.** - -### Making the DevOps transition in 4 steps - -Another important question to ask: How can a low-bandwidth group make such a massive transition? The good news is that a DevOps transformation doesn’t need to happen all at once. Taken in smaller, more manageable steps, organizations of any size can embrace DevOps. - - 1. Determine why DevOps may be the solution you need. Are your projects bottlenecking? Are they running over budget and over time? Of course, these concerns are common for any community, big or small. Answering these questions leads us to step two: - 2. Develop the right framework to improve the engineering process. DevOps is all about automation, collaboration, and streamlining. Rather than trying to fit everyone into the same process box, the framework should support the work habits, preferences, and delivery needs of the community. Some broad standards should be established (for example, that all teams use a particular version control system). Beyond that, however, let the teams decide their own best process. - 3. Use the current products that are already available if they meet your needs. Why reinvent the wheel? - 4. Finally, implement and test the actual DevOps solution. This is, of course, where the actual value of DevOps is realized. There will likely be a few issues and some heartburn, but it will all be worth it in the end because, once established, the products of the community’s work will be nimbler and faster for the users. - - - -### Reuse DevOps solutions - -One benefit to creating effective CI/CD pipelines is the reusability of those pipelines. Although there is no one-size fits all solution, anyone can adopt a process. There are several pre-made templates available for you to examine, such as build templates on VSTS, ARM templates to deploy Azure resources, and "cookbook"-style textbooks from technical publishers. Once it identifies a process that works well, a community can also create its own template by defining and establishing standards and making that template easily discoverable by the entire community. For more information on DevOps journeys and tools, check out [this site][3]. - -### Summary - -Overall, the success or failure of DevOps relies on the culture of a community. It doesn't matter if the community is a large, resource-rich enterprise or a small, resource-sparse, part-time group. DevOps will still bring solid benefits. The difference is in the approach for adoption and the scale of that adoption. There are both upfront and ongoing costs, but the value greatly outweighs those costs. Communities can use any of the powerful tools available today for their pipelines, and they can also leverage reusability, such as templates, to reduce upfront implementation costs. DevOps is most certainly feasible—and even critical—for the success of part-time community teams. - -**[See our related story,[How DevOps eliminates development bottlenecks][4].]** - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/4/devops-compatible-part-time-community-teams - -作者:[Edward Fry][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/edwardf -[1]:https://github.com/ALM-Rangers -[2]:https://opensource.com/article/17/11/devops-rangers-transformation -[3]:https://www.visualstudio.com/devops/ -[4]:https://opensource.com/article/17/11/devops-rangers-transformation diff --git a/sources/talk/20180419 3 tips for organizing your open source project-s workflow on GitHub.md b/sources/talk/20180419 3 tips for organizing your open source project-s workflow on GitHub.md deleted file mode 100644 index 29e4ea2f48..0000000000 --- a/sources/talk/20180419 3 tips for organizing your open source project-s workflow on GitHub.md +++ /dev/null @@ -1,109 +0,0 @@ -3 tips for organizing your open source project's workflow on GitHub -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ) - -Managing an open source project is challenging work, and the challenges grow as a project grows. Eventually, a project may need to meet different requirements and span multiple repositories. These problems aren't technical, but they are important to solve to scale a technical project. [Business process management][1] methodologies such as agile and [kanban][2] bring a method to the madness. Developers and managers can make realistic decisions for estimating deadlines and team bandwidth with an organized development focus. - -At the [UNICEF Office of Innovation][3], we use GitHub project boards to organize development on the MagicBox project. [MagicBox][4] is a full-stack application and open source platform to serve and visualize data for decision-making in humanitarian crises and emergencies. The project spans multiple GitHub repositories and works with multiple developers. With GitHub project boards, we organize our work across multiple repositories to better understand development focus and team bandwidth. - -Here are three tips from the UNICEF Office of Innovation on how to organize your open source projects with the built-in project boards on GitHub. - -### 1\. Bring development discussion to issues and pull requests - -Transparency is a critical part of an open source community. When mapping out new features or milestones for a project, the community needs to see and understand a decision or why a specific direction was chosen. Filing new GitHub issues for features and milestones is an easy way for someone to follow the project direction. GitHub issues and pull requests are the cards (or building blocks) of project boards. To be successful with GitHub project boards, you need to use issues and pull requests. - - -![GitHub issues for magicbox-maps, MagicBox's front-end application][6] - -GitHub issues for magicbox-maps, MagicBox's front-end application. - -The UNICEF MagicBox team uses GitHub issues to track ongoing development milestones and other tasks to revisit. The team files new GitHub issues for development goals, feature requests, or bugs. These goals or features may come from external stakeholders or the community. We also use the issues as a place for discussion on those tasks. This makes it easy to cross-reference in the future and visualize upcoming work on one of our projects. - -Once you begin using GitHub issues and pull requests as a way of discussing and using your project, organizing with project boards becomes easier. - -### 2\. Set up kanban-style project boards - -GitHub issues and pull requests are the first step. After you begin using them, it may become harder to visualize what work is in progress and what work is yet to begin. [GitHub's project boards][7] give you a platform to visualize and organize cards into different columns. - -There are two types of project boards available: - - * **Repository** : Boards for use in a single repository - * **Organization** : Boards for use in a GitHub organization across multiple repositories (but private to organization members) - - - -The choice you make depends on the structure and size of your projects. The UNICEF MagicBox team uses boards for development and documentation at the organization level, and then repository-specific boards for focused work (like our [community management board][8]). - -#### Creating your first board - -Project boards are found on your GitHub organization page or on a specific repository. You will see the Projects tab in the same row as Issues and Pull requests. From the page, you'll see a green button to create a new project. - -There, you can set a name and description for the project. You can also choose templates to set up basic columns and sorting for your board. Currently, the only options are for kanban-style boards. - - -![Creating a new GitHub project board.][10] - -Creating a new GitHub project board. - -After creating the project board, you can make adjustments to it as needed. You can create new columns, [set up automation][11], and add pre-existing GitHub issues and pull requests to the project board. - -You may notice new options for the metadata in each GitHub issue and pull request. Inside of an issue or pull request, you can add it to a project board. If you use automation, it will automatically enter a column you configured. - -### 3\. Build project boards into your workflow - -After you set up a project board and populate it with issues and pull requests, you need to integrate it into your workflow. Project boards are effective only when actively used. The UNICEF MagicBox team uses the project boards as a way to track our progress as a team, update external stakeholders on development, and estimate team bandwidth for reaching our milestones. - - -![Tracking progress][13] - -Tracking progress with GitHub project boards. - -If you are an open source project and community, consider using the project boards for development-focused meetings. It also helps remind you and other core contributors to spend five minutes each day updating progress as needed. If you're at a company using GitHub to do open source work, consider using project boards to update other team members and encourage participation inside of GitHub issues and pull requests. - -Once you begin using the project board, yours may look like this: - - -![Development progress board][15] - -Development progress board for all UNICEF MagicBox repositories in organization-wide GitHub project boards. - -### Open alternatives - -GitHub project boards require your project to be on GitHub to take advantage of this functionality. While GitHub is a popular repository for open source projects, it's not an open source platform itself. Fortunately, there are open source alternatives to GitHub with tools to replicate the workflow explained above. [GitLab Issue Boards][16] and [Taiga][17] are good alternatives that offer similar functionality. - -### Go forth and organize! - -With these tools, you can bring a method to the madness of organizing your open source project. These three tips for using GitHub project boards encourage transparency in your open source project and make it easier to track progress and milestones in the open. - -Do you use GitHub project boards for your open source project? Have any tips for success that aren't mentioned in the article? Leave a comment below to share how you make sense of your open source projects. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/4/keep-your-project-organized-git-repo - -作者:[Justin W.Flory][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jflory -[1]:https://en.wikipedia.org/wiki/Business_process_management -[2]:https://en.wikipedia.org/wiki/Kanban_(development) -[3]:http://unicefstories.org/about/ -[4]:http://unicefstories.org/magicbox/ -[5]:/file/393356 -[6]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/github-open-issues.png?itok=OcWPX575 (GitHub issues for magicbox-maps, MagicBox's front-end application) -[7]:https://help.github.com/articles/about-project-boards/ -[8]:https://github.com/unicef/magicbox/projects/3?fullscreen=true -[9]:/file/393361 -[10]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/github-project-boards-create-board.png?itok=pp7SXH9g (Creating a new GitHub project board.) -[11]:https://help.github.com/articles/about-automation-for-project-boards/ -[12]:/file/393351 -[13]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/github-issues-metadata.png?itok=xp5auxCQ (Tracking progress) -[14]:/file/393366 -[15]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/github-project-boards-overview.png?itok=QSbOOOkF (Development progress board) -[16]:https://about.gitlab.com/features/issueboard/ -[17]:https://taiga.io/ diff --git a/sources/talk/20180420 What You Don-t Know About Linux Open Source Could Be Costing to More Than You Think.md b/sources/talk/20180420 What You Don-t Know About Linux Open Source Could Be Costing to More Than You Think.md deleted file mode 100644 index 10511c3a7d..0000000000 --- a/sources/talk/20180420 What You Don-t Know About Linux Open Source Could Be Costing to More Than You Think.md +++ /dev/null @@ -1,39 +0,0 @@ -What You Don’t Know About Linux Open Source Could Be Costing to More Than You Think -====== - -If you would like to test out Linux before completely switching it as your everyday driver, there are a number of means by which you can do it. Linux was not intended to run on Windows, and Windows was not meant to host Linux. To begin with, and perhaps most of all, Linux is open source computer software. In any event, Linux outperforms Windows on all your hardware. - -If you’ve always wished to try out Linux but were never certain where to begin, have a look at our how to begin guide for Linux. Linux is not any different than Windows or Mac OS, it’s basically an Operating System but the leading different is the fact that it is Free for everyone. Employing Linux today isn’t any more challenging than switching from one sort of smartphone platform to another. - -You’re most likely already using Linux, whether you are aware of it or not. Linux has a lot of distinct versions to suit nearly any sort of user. Today, Linux is a small no-brainer. Linux plays an essential part in keeping our world going. - -Even then, it is dependent on the build of Linux that you’re using. Linux runs a lot of the underbelly of cloud operations. Linux is also different in that, even though the core pieces of the Linux operating system are usually common, there are lots of distributions of Linux, like different software alternatives. While Linux might seem intimidatingly intricate and technical to the ordinary user, contemporary Linux distros are in reality very user-friendly, and it’s no longer the case you have to have advanced skills to get started using them. Linux was the very first major Internet-centred open-source undertaking. Linux is beginning to increase the range of patches it pushes automatically, but several of the security patches continue to be opt-in only. - -You are able to remove Linux later in case you need to. Linux plays a vital part in keeping our world going. Linux supplies a huge library of functionality which can be leveraged to accelerate development. - -Even then, it’s dependent on the build of Linux that you’re using. Linux is also different in that, even though the core pieces of the Linux operating system are typically common, there are lots of distributions of Linux, like different software alternatives. While Linux might seem intimidatingly intricate and technical to the ordinary user, contemporary Linux distros are in fact very user-friendly, and it’s no longer the case you require to have advanced skills to get started using them. Linux runs a lot of the underbelly of cloud operations. Linux is beginning to increase the range of patches it pushes automatically, but several of the security patches continue to be opt-in only. Read More, open source projects including Linux are incredibly capable because of the contributions that all these individuals have added over time. - -### Life After Linux Open Source - -The development edition of the manual typically has more documentation, but might also document new characteristics that aren’t in the released version. Fortunately, it’s so lightweight you can just jump to some other version in case you don’t like it. It’s extremely hard to modify the compiled version of the majority of applications and nearly not possible to see exactly the way the developer created different sections of the program. - -On the challenges of bottoms-up go-to-market It’s really really hard to grasp the difference between your organic product the product your developers use and love and your company product, which ought to be, effectively, a different product. As stated by the report, it’s going to be hard for developers to switch. Developers are now incredibly important and influential in the purchasing procedure. Some OpenWrt developers will attend the event and get ready to reply to your questions! - -When the program is installed, it has to be configured. Suppose you discover that the software you bought actually does not do what you would like it to do. Open source software is much more common than you believe, and an amazing philosophy to live by. Employing open source software gives an inexpensive method to bootstrap a business. It’s more difficult to deal with closed source software generally. So regarding Application and Software, you’re all set if you are prepared to learn an alternate software or finding a means to make it run on Linux. Possibly the most famous copyleft software is Linux. - -Article sponsored by [Vegas Palms online slots][1] - - --------------------------------------------------------------------------------- - -via: https://linuxaria.com/article/what-you-dont-know-about-linux-open-source-could-be-costing-to-more-than-you-think - -作者:[Marc Fisher][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://linuxaria.com -[1]:https://www.vegaspalmscasino.com/casino-games/slots/ diff --git a/sources/talk/20180424 There-s a Server in Every Serverless Platform.md b/sources/talk/20180424 There-s a Server in Every Serverless Platform.md deleted file mode 100644 index 9bc935c06d..0000000000 --- a/sources/talk/20180424 There-s a Server in Every Serverless Platform.md +++ /dev/null @@ -1,87 +0,0 @@ -There’s a Server in Every Serverless Platform -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/servers.jpg?itok=i_gyObMP) -Serverless computing or Function as a Service (FaaS) is a new buzzword created by an industry that loves to coin new terms as market dynamics change and technologies evolve. But what exactly does it mean? What is serverless computing? - -Before getting into the definition, let’s take a brief history lesson from Sirish Raghuram, CEO and co-founder of Platform9, to understand the evolution of serverless computing. - -“In the 90s, we used to build applications and run them on hardware. Then came virtual machines that allowed users to run multiple applications on the same hardware. But you were still running the full-fledged OS for each application. The arrival of containers got rid of OS duplication and process level isolation which made it lightweight and agile,” said Raghuram. - -Serverless, specifically, Function as a Service, takes it to the next level as users are now able to code functions and run them at the granularity of build, ship and run. There is no complexity of underlying machinery needed to run those functions. No need to worry about spinning containers using Kubernetes. Everything is hidden behind the scenes. - -“That’s what is driving a lot of interest in function as a service,” said Raghuram. - -### What exactly is serverless? - -There is no single definition of the term, but to build some consensus around the idea, the [Cloud Native Computing Foundation (CNCF)][1] Serverless Working Group wrote a [white paper][2] to define serverless computing. - -According to the white paper, “Serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment.” - -Ken Owens, a member of the Technical Oversight Committee at CNCF said that the primary goal of serverless computing is to help users build and run their applications without having to worry about the cost and complexity of servers in terms of provisioning, management and scaling. - -“Serverless is a natural evolution of cloud-native computing. The CNCF is advancing serverless adoption through collaboration and community-driven initiatives that will enable interoperability,” [said][3] Chris Aniszczyk, COO, CNCF. - -### It’s not without servers - -First things first, don’t get fooled by the term “serverless.” There are still servers in serverless computing. Remember what Raghuram said: all the machinery is hidden; it’s not gone. - -The clear benefit here is that developers need not concern themselves with tasks that don’t add any value to their deliverables. Instead of worrying about managing the function, they can dedicate their time to adding featured and building apps that add business value. Time is money and every minute saved in management goes toward innovation. Developers don’t have to worry about scaling based on peaks and valleys; it’s automated. Because cloud providers charge only for the duration that functions are run, developers cut costs by not having to pay for blinking lights. - -But… someone still has to do the work behind the scenes. There are still servers offering FaaS platforms. - -In the case of public cloud offerings like Google Cloud Platform, AWS, and Microsoft Azure, these companies manage the servers and charge customers for running those functions. In the case of private cloud or datacenters, where developers don’t have to worry about provisioning or interacting with such servers, there are other teams who do. - -The CNCF white paper identifies two groups of professionals that are involved in the serverless movement: developers and providers. We have already talked about developers. But, there are also providers that offer serverless platforms; they deal with all the work involved in keeping that server running. - -That’s why many companies, like SUSE, refrain from using the term “serverless” and prefer the term function as a service, because they offer products that run those “serverless” servers. But what kind of functions are these? Is it the ultimate future of app delivery? - -### Event-driven computing - -Many see serverless computing as an umbrella that offers FaaS among many other potential services. According to CNCF, FaaS provides event-driven computing where functions are triggered by events or HTTP requests. “Developers run and manage application code with functions that are triggered by events or HTTP requests. Developers deploy small units of code to the FaaS, which are executed as needed as discrete actions, scaling without the need to manage servers or any other underlying infrastructure,” said the white paper. - -Does that mean FaaS is the silver bullet that solves all problems for developing and deploying applications? Not really. At least not at the moment. FaaS does solve problems in several use cases and its scope is expanding. A good use case of FaaS could be the functions that an application needs to run when an event takes place. - -Let’s take an example: a user takes a picture from a phone and uploads it to the cloud. Many things happen when the picture is uploaded - it’s scanned (exif data is read), a thumbnail is created, based on deep learning/machine learning the content of the image is analyzed, the information of the image is stored in the database. That one event of uploading that picture triggers all those functions. Those functions die once the event is over. That’s what FaaS does. It runs code quickly to perform all those tasks and then disappears. - -That’s just one example. Another example could be an IoT device where a motion sensor triggers an event that instructs the camera to start recording and sends the clip to the designated contant. Your thermostat may trigger the fan when the sensor detects a change in temperature. These are some of the many use cases where function as a service make more sense than the traditional approach. Which also says that not all applications (at least at the moment, but that will change as more organizations embrace the serverless platform) can be run as function as service. - -According to CNCF, serverless computing should be considered if you have these kinds of workloads: - - * Asynchronous, concurrent, easy to parallelize into independent units of work - - * Infrequent or has sporadic demand, with large, unpredictable variance in scaling requirements - - * Stateless, ephemeral, without a major need for instantaneous cold start time - - * Highly dynamic in terms of changing business requirements that drive a need for accelerated developer velocity - - - - -### Why should you care? - -Serverless is a very new technology and paradigm, just the way VMs and containers transformed the app development and delivery models, FaaS can also bring dramatic changes. We are still in the early days of serverless computing. As the market evolves, consensus is created and new technologies evolve, and FaaS may grow beyond the workloads and use cases mentioned here. - -What is becoming quite clear is that companies who are embarking on their cloud native journey must have serverless computing as part of their strategy. The only way to stay ahead of competitors is by keeping up with the latest technologies and trends. - -It’s about time to put serverless into servers. - -For more information, check out the CNCF Working Group's serverless whitepaper [here][2]. And, you can learn more at [KubeCon + CloudNativeCon Europe][4], coming up May 2-4 in Copenhagen, Denmark. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/4/theres-server-every-serverless-platform - -作者:[SWAPNIL BHARTIYA][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/arnieswap -[1]:https://www.cncf.io/ -[2]:https://github.com/cncf/wg-serverless/blob/master/whitepaper/cncf_serverless_whitepaper_v1.0.pdf -[3]:https://www.cncf.io/blog/2018/02/14/cncf-takes-first-step-towards-serverless-computing/ -[4]:https://events.linuxfoundation.org/events/kubecon-cloudnativecon-europe-2018/attend/register/ diff --git a/sources/talk/20180511 Looking at the Lispy side of Perl.md b/sources/talk/20180511 Looking at the Lispy side of Perl.md deleted file mode 100644 index 1fa51b314c..0000000000 --- a/sources/talk/20180511 Looking at the Lispy side of Perl.md +++ /dev/null @@ -1,357 +0,0 @@ -Looking at the Lispy side of Perl -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_cloud_database.png?itok=lhhU42fg) -Some programming languages (e.g., C) have named functions only, whereas others (e.g., Lisp, Java, and Perl) have both named and unnamed functions. A lambda is an unnamed function, with Lisp as the language that popularized the term. Lambdas have various uses, but they are particularly well-suited for data-rich applications. Consider this depiction of a data pipeline, with two processing stages shown: - -![](https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/data_source.png?itok=OON2cC2R) - -### Lambdas and higher-order functions - -The filter and transform stages can be implemented as higher-order functions—that is, functions that can take a function as an argument. Suppose that the depicted pipeline is part of an accounts-receivable application. The filter stage could consist of a function named `filter_data`, whose single argument is another function—for example, a `high_buyers` function that filters out amounts that fall below a threshold. The transform stage might convert amounts in U.S. dollars to equivalent amounts in euros or some other currency, depending on the function plugged in as the argument to the higher-order `transform_data` function. Changing the filter or the transform behavior requires only plugging in a different function argument to the higher order `filter_data` or `transform_data` functions. - -Lambdas serve nicely as arguments to higher-order functions for two reasons. First, lambdas can be crafted on the fly, and even written in place as arguments. Second, lambdas encourage the coding of pure functions, which are functions whose behavior depends solely on the argument(s) passed in; such functions have no side effects and thereby promote safe concurrent programs. - -Perl has a straightforward syntax and semantics for lambdas and higher-order functions, as shown in the following example: - -### A first look at lambdas in Perl - -``` -#!/usr/bin/perl - -use strict; -use warnings; - -## References to lambdas that increment, decrement, and do nothing. -## $_[0] is the argument passed to each lambda. -my $inc = sub { $_[0] + 1 };  ## could use 'return $_[0] + 1' for clarity -my $dec = sub { $_[0] - 1 };  ## ditto -my $nop = sub { $_[0] };      ## ditto - -sub trace { -    my ($val, $func, @rest) = @_; -    print $val, " ", $func, " ", @rest, "\nHit RETURN to continue...\n"; -    <STDIN>; -} - -## Apply an operation to a value. The base case occurs when there are -## no further operations in the list named @rest. -sub apply { -    my ($val, $first, @rest) = @_; -    trace($val, $first, @rest) if 1;  ## 0 to stop tracing - -    return ($val, apply($first->($val), @rest)) if @rest; ## recursive case -    return ($val, $first->($val));                        ## base case -} - -my $init_val = 0; -my @ops = (                        ## list of lambda references -    $inc, $dec, $dec, $inc, -    $inc, $inc, $inc, $dec, -    $nop, $dec, $dec, $nop, -    $nop, $inc, $inc, $nop -    ); - -## Execute. -print join(' ', apply($init_val, @ops)), "\n"; -## Final line of output: 0 1 0 -1 0 1 2 3 2 2 1 0 0 0 1 2 2strictwarningstraceSTDINapplytraceapplyapply -``` - -The lispy program shown above highlights the basics of Perl lambdas and higher-order functions. Named functions in Perl start with the keyword `sub` followed by a name: -``` -sub increment { ... }   # named function - -``` - -An unnamed or anonymous function omits the name: -``` -sub {...}               # lambda, or unnamed function - -``` - -In the lispy example, there are three lambdas, and each has a reference to it for convenience. Here, for review, is the `$inc` reference and the lambda referred to: -``` -my $inc = sub { $_[0] + 1 }; - -``` - -The lambda itself, the code block to the right of the assignment operator `=`, increments its argument `$_[0]` by 1. The lambda’s body is written in Lisp style; that is, without either an explicit `return` or a semicolon after the incrementing expression. In Perl, as in Lisp, the value of the last expression in a function’s body becomes the returned value if there is no explicit `return` statement. In this example, each lambda has only one expression in its body—a simplification that befits the spirit of lambda programming. - -The `trace` function in the lispy program helps to clarify how the program works (as I'll illustrate below). The higher-order function `apply`, a nod to a Lisp function of the same name, takes a numeric value as its first argument and a list of lambda references as its second argument. The `apply` function is called initially, at the bottom of the program, with zero as the first argument and the list named `@ops` as the second argument. This list consists of 16 lambda references from among `$inc` (increment a value), `$dec` (decrement a value), and `$nop` (do nothing). The list could contain the lambdas themselves, but the code is easier to write and to understand with the more concise lambda references. - -The logic of the higher-order `apply` function can be clarified as follows: - - 1. The argument list passed to `apply` in typical Perl fashion is separated into three pieces: -``` -my ($val, $first, @rest) = @_; ## break the argument list into three elements - -``` - -The first element `$val` is a numeric value, initially `0`. The second element `$first` is a lambda reference, one of `$inc` `$dec`, or `$nop`. The third element `@rest` is a list of any remaining lambda references after the first such reference is extracted as `$first`. - - 2. If the list `@rest` is not empty after its first element is removed, then `apply` is called recursively. The two arguments to the recursively invoked `apply` are: - - * The value generated by applying lambda operation `$first` to numeric value `$val`. For example, if `$first` is the incrementing lambda to which `$inc` refers, and `$val` is 2, then the new first argument to `apply` would be 3. - * The list of remaining lambda references. Eventually, this list becomes empty because each call to `apply` shortens the list by extracting its first element. - - - -Here is some output from a sample run of the lispy program, with `%` as the command-line prompt: -``` -% ./lispy.pl - -0 CODE(0x8f6820) CODE(0x8f68c8)CODE(0x8f68c8)CODE(0x8f6820)CODE(0x8f6820)CODE(0x8f6820)... -Hit RETURN to continue... - -1 CODE(0x8f68c8) CODE(0x8f68c8)CODE(0x8f6820)CODE(0x8f6820)CODE(0x8f6820)CODE(0x8f6820)... -Hit RETURN to continue -``` - -The first output line can be clarified as follows: - - * The `0` is the numeric value passed as an argument in the initial (and thus non-recursive) call to function `apply`. The argument name is `$val` in `apply`. - * The `CODE(0x8f6820)` is a reference to one of the lambdas, in this case the lambda to which `$inc` refers. The second argument is thus the address of some lambda code. The argument name is `$first` in `apply` - * The third piece, the series of `CODE` references, is the list of lambda references beyond the first. The argument name is `@rest` in `apply`. - - - -The second line of output shown above also deserves a look. The numeric value is now `1`, the result of incrementing `0`: the initial lambda is `$inc` and the initial value is `0`. The extracted reference `CODE(0x8f68c8)` is now `$first`, as this reference is the first element in the `@rest` list after `$inc` has been extracted earlier. - -Eventually, the `@rest` list becomes empty, which ends the recursive calls to `apply`. In this case, the function `apply` simply returns a list with two elements: - - 1. The numeric value taken in as an argument (in the sample run, 2). - 2. This argument transformed by the lambda (also 2 because the last lambda reference happens to be `$nop` for do nothing). - - - -The lispy example underscores that Perl supports lambdas without any special fussy syntax: A lambda is just an unnamed code block, perhaps with a reference to it for convenience. Lambdas themselves, or references to them, can be passed straightforwardly as arguments to higher-order functions such as `apply` in the lispy example. Invoking a lambda through a reference is likewise straightforward. In the `apply` function, the call is: -``` -$first->($val)    ## $first is a lambda reference, $val a numeric argument passed to the lambda - -``` - -### A richer code example - -The next code example puts a lambda and a higher-order function to practical use. The example implements Conway’s Game of Life, a cellular automaton that can be represented as a matrix of cells. Such a matrix goes through various transformations, each yielding a new generation of cells. The Game of Life is fascinating because even relatively simple initial configurations can lead to quite complex behavior. A quick look at the rules governing cell birth, survival, and death is in order. - -Consider this 5x5 matrix, with a star representing a live cell and a dash representing a dead one: -``` - -----              ## initial configuration - --*-- - --*-- - --*-- - ----- -``` - -The next generation becomes: -``` - -----              ## next generation - ----- - -***- - ---- - ----- -``` - -As life continues, the generations oscillate between these two configurations. - -Here are the rules determining birth, death, and survival for a cell. A given cell has between three neighbors (a corner cell) and eight neighbors (an interior cell): - - * A dead cell with exactly three live neighbors comes to life. - * A live cell with more than three live neighbors dies from over-crowding. - * A live cell with two or three live neighbors survives; hence, a live cell with fewer than two live neighbors dies from loneliness. - - - -In the initial configuration shown above, the top and bottom live cells die because neither has two or three live neighbors. By contrast, the middle live cell in the initial configuration gains two live neighbors, one on either side, in the next generation. - -## Conway’s Game of Life -``` -#!/usr/bin/perl - -### A simple implementation of Conway's game of life. -# Usage: ./gol.pl [input file]  ;; If no file name given, DefaultInfile is used. - -use constant Dead  => "-"; -use constant Alive => "*"; -use constant DefaultInfile => 'conway.in'; - -use strict; -use warnings; - -my $dimension = undef; -my @matrix = (); -my $generation = 1; - -sub read_data { -    my $datafile = DefaultInfile; -    $datafile = shift @ARGV if @ARGV; -    die "File $datafile does not exist.\n" if !-f $datafile; -    open(INFILE, "<$datafile"); - -    ## Check 1st line for dimension; -    $dimension = <INFILE>; -    die "1st line of input file $datafile not an integer.\n" if $dimension !~ /\d+/; - -    my $record_count = 0; -    while (<INFILE>) { -        chomp($_); -        last if $record_count++ == $dimension; -        die "$_: bad input record -- incorrect length\n" if length($_) != $dimension; -        my @cells = split(//, $_); -        push @matrix, @cells; -    } -    close(INFILE); -    draw_matrix(); -} - -sub draw_matrix { -    my $n = $dimension * $dimension; -    print "\n\tGeneration $generation\n"; -    for (my $i = 0; $i < $n; $i++) { -        print "\n\t" if ($i % $dimension) == 0; -        print $matrix[$i]; -    } -    print "\n\n"; -    $generation++; -} - -sub has_left_neighbor { -    my ($ind) = @_; -    return ($ind % $dimension) != 0; -} - -sub has_right_neighbor { -    my ($ind) = @_; -    return (($ind + 1) % $dimension) != 0; -} - -sub has_up_neighbor { -    my ($ind) = @_; -    return (int($ind / $dimension)) != 0; -} - -sub has_down_neighbor { -    my ($ind) = @_; -    return (int($ind / $dimension) + 1) != $dimension; -} - -sub has_left_up_neighbor { -    my ($ind) = @_; -    ($ind) && has_up_neighbor($ind); -} - -sub has_right_up_neighbor { -    my ($ind) = @_; -    ($ind) && has_up_neighbor($ind); -} - -sub has_left_down_neighbor { -    my ($ind) = @_; -    ($ind) && has_down_neighbor($ind); -} - -sub has_right_down_neighbor { -    my ($ind) = @_; -    ($ind) && has_down_neighbor($ind); -} - -sub compute_cell { -    my ($ind) = @_; -    my @neighbors; - -    # 8 possible neighbors -    push(@neighbors, $ind - 1) if has_left_neighbor($ind); -    push(@neighbors, $ind + 1) if has_right_neighbor($ind); -    push(@neighbors, $ind - $dimension) if has_up_neighbor($ind); -    push(@neighbors, $ind + $dimension) if has_down_neighbor($ind); -    push(@neighbors, $ind - $dimension - 1) if has_left_up_neighbor($ind); -    push(@neighbors, $ind - $dimension + 1) if has_right_up_neighbor($ind); -    push(@neighbors, $ind + $dimension - 1) if has_left_down_neighbor($ind); -    push(@neighbors, $ind + $dimension + 1) if has_right_down_neighbor($ind); - -    my $count = 0; -    foreach my $n (@neighbors) { -        $count++ if $matrix[$n] eq Alive; -    } - -    if ($matrix[$ind] eq Alive) && (($count == 2) || ($count == 3)); ## survival -    if ($matrix[$ind] eq Dead)  && ($count == 3);                    ## birth -    ;                                                                  ## death -} - -sub again_or_quit { -    print "RETURN to continue, 'q' to quit.\n"; -    my $flag = <STDIN>; -    chomp($flag); -    return ($flag eq 'q') ? 1 : 0; -} - -sub animate { -    my @new_matrix; -    my $n = $dimension * $dimension - 1; - -    while (1) {                                       ## loop until user signals stop -        @new_matrix = map {compute_cell($_)} (0..$n); ## generate next matrix - -        splice @matrix;                               ## empty current matrix -        push @matrix, @new_matrix;                    ## repopulate matrix -        draw_matrix();                                ## display the current matrix - -        last if again_or_quit();                      ## continue? -        splice @new_matrix;                           ## empty temp matrix -    } -} - -### Execute -read_data();  ## read initial configuration from input file -animate();    ## display and recompute the matrix until user tires -``` - -The gol program (see [Conway’s Game of Life][1]) has almost 140 lines of code, but most of these involve reading the input file, displaying the matrix, and bookkeeping tasks such as determining the number of live neighbors for a given cell. Input files should be configured as follows: -``` - 5 - ----- - --*-- - --*-- - --*-- - ----- -``` - -The first record gives the matrix side, in this case 5 for a 5x5 matrix. The remaining rows are the contents, with stars for live cells and spaces for dead ones. - -The code of primary interest resides in two functions, `animate` and `compute_cell`. The `animate` function constructs the next generation, and this function needs to call `compute_cell` on every cell in order to determine the cell’s new status as either alive or dead. How should the `animate` function be structured? - -The `animate` function has a `while` loop that iterates until the user decides to terminate the program. Within this `while` loop the high-level logic is straightforward: - - 1. Create the next generation by iterating over the matrix cells, calling function `compute_cell` on each cell to determine its new status. At issue is how best to do the iteration. A loop nested inside the `while `loop would do, of course, but nested loops can be clunky. Another way is to use a higher-order function, as clarified shortly. - 2. Replace the current matrix with the new one. - 3. Display the next generation. - 4. Check if the user wants to continue: if so, continue; otherwise, terminate. - - - -Here, for review, is the call to Perl’s higher-order `map` function, with the function’s name again a nod to Lisp. This call occurs as the first statement within the `while` loop in `animate`: -``` -while (1) { -    @new_matrix = map {compute_cell($_)} (0..$n); ## generate next matrixcompute_cell -``` - -The `map` function takes two arguments: an unnamed code block (a lambda!), and a list of values passed to this code block one at a time. In this example, the code block calls the `compute_cell` function with one of the matrix indexes, 0 through the matrix size - 1. Although the matrix is displayed as two-dimensional, it is implemented as a one-dimensional list. - -Higher-order functions such as `map` encourage the code brevity for which Perl is famous. My view is that such functions also make code easier to write and to understand, as they dispense with the required but messy details of loops. In any case, lambdas and higher-order functions make up the Lispy side of Perl. - -If you're interested in more detail, I recommend Mark Jason Dominus's book, [Higher-Order Perl][2]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/5/looking-lispy-side-perl - -作者:[Marty Kalin][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/mkalindepauledu -[1]:https://trello-attachments.s3.amazonaws.com/575088ec94ca6ac38b49b30e/5ad4daf12f6b6a3ac2318d28/c0700c7379983ddf61f5ab5ab4891f0c/lispyPerl.html#gol (Conway’s Game of Life) -[2]:https://www.elsevier.com/books/higher-order-perl/dominus/978-1-55860-701-9 diff --git a/sources/talk/20180527 Whatever Happened to the Semantic Web.md b/sources/talk/20180527 Whatever Happened to the Semantic Web.md deleted file mode 100644 index 22d48c150a..0000000000 --- a/sources/talk/20180527 Whatever Happened to the Semantic Web.md +++ /dev/null @@ -1,106 +0,0 @@ -Whatever Happened to the Semantic Web? -====== -In 2001, Tim Berners-Lee, inventor of the World Wide Web, published an article in Scientific American. Berners-Lee, along with two other researchers, Ora Lassila and James Hendler, wanted to give the world a preview of the revolutionary new changes they saw coming to the web. Since its introduction only a decade before, the web had fast become the world’s best means for sharing documents with other people. Now, the authors promised, the web would evolve to encompass not just documents but every kind of data one could imagine. - -They called this new web the Semantic Web. The great promise of the Semantic Web was that it would be readable not just by humans but also by machines. Pages on the web would be meaningful to software programs—they would have semantics—allowing programs to interact with the web the same way that people do. Programs could exchange data across the Semantic Web without having to be explicitly engineered to talk to each other. According to Berners-Lee, Lassila, and Hendler, a typical day living with the myriad conveniences of the Semantic Web might look something like this: - -> The entertainment system was belting out the Beatles’ “We Can Work It Out” when the phone rang. When Pete answered, his phone turned the sound down by sending a message to all the other local devices that had a volume control. His sister, Lucy, was on the line from the doctor’s office: “Mom needs to see a specialist and then has to have a series of physical therapy sessions. Biweekly or something. I’m going to have my agent set up the appointments.” Pete immediately agreed to share the chauffeuring. At the doctor’s office, Lucy instructed her Semantic Web agent through her handheld Web browser. The agent promptly retrieved the information about Mom’s prescribed treatment within a 20-mile radius of her home and with a rating of excellent or very good on trusted rating services. It then began trying to find a match between available appointment times (supplied by the agents of individual providers through their Web sites) and Pete’s and Lucy’s busy schedules. - -The vision was that the Semantic Web would become a playground for intelligent “agents.” These agents would automate much of the work that the world had only just learned to do on the web. - -![][1] - -For a while, this vision enticed a lot of people. After new technologies such as AJAX led to the rise of what Silicon Valley called Web 2.0, Berners-Lee began referring to the Semantic Web as Web 3.0. Many thought that the Semantic Web was indeed the inevitable next step. A New York Times article published in 2006 quotes a speech Berners-Lee gave at a conference in which he said that the extant web would, twenty years in the future, be seen as only the “embryonic” form of something far greater. A venture capitalist, also quoted in the article, claimed that the Semantic Web would be “profound,” and ultimately “as obvious as the web seems obvious to us today.” - -Of course, the Semantic Web we were promised has yet to be delivered. In 2018, we have “agents” like Siri that can do certain tasks for us. But Siri can only do what it can because engineers at Apple have manually hooked it up to a medley of web services each capable of answering only a narrow category of questions. An important consequence is that, without being large and important enough for Apple to care, you cannot advertise your services directly to Siri from your own website. Unlike the physical therapists that Berners-Lee and his co-authors imagined would be able to hang out their shingles on the web, today we are stuck with giant, centralized repositories of information. Today’s physical therapists must enter information about their practice into Google or Yelp, because those are the only services that the smartphone agents know how to use and the only ones human beings will bother to check. The key difference between our current reality and the promised Semantic future is best captured by this throwaway aside in the excerpt above: “…appointment times (supplied by the agents of individual providers through **their** Web sites)…” - -In fact, over the last decade, the web has not only failed to become the Semantic Web but also threatened to recede as an idea altogether. We now hardly ever talk about “the web” and instead talk about “the internet,” which as of 2016 has become such a common term that newspapers no longer capitalize it. (To be fair, they stopped capitalizing “web” too.) Some might still protest that the web and the internet are two different things, but the distinction gets less clear all the time. The web we have today is slowly becoming a glorified app store, just the easiest way among many to download software that communicates with distant servers using closed protocols and schemas, making it functionally identical to the software ecosystem that existed before the web. How did we get here? If the effort to build a Semantic Web had succeeded, would the web have looked different today? Or have there been so many forces working against a decentralized web for so long that the Semantic Web was always going to be stillborn? - -### Semweb Hucksters and Their Metacrap - -To some more practically minded engineers, the Semantic Web was, from the outset, a utopian dream. - -The basic idea behind the Semantic Web was that everyone would use a new set of standards to annotate their webpages with little bits of XML. These little bits of XML would have no effect on the presentation of the webpage, but they could be read by software programs to divine meaning that otherwise would only be available to humans. - -The bits of XML were a way of expressing metadata about the webpage. We are all familiar with metadata in the context of a file system: When we look at a file on our computers, we can see when it was created, when it was last updated, and whom it was originally created by. Likewise, webpages on the Semantic Web would be able to tell your browser who authored the page and perhaps even where that person went to school, or where that person is currently employed. In theory, this information would allow Semantic Web browsers to answer queries across a large collection of webpages. In their article for Scientific American, Berners-Lee and his co-authors explain that you could, for example, use the Semantic Web to look up a person you met at a conference whose name you only partially remember. - -Cory Doctorow, a blogger and digital rights activist, published an influential essay in 2001 that pointed out the many problems with depending on voluntarily supplied metadata. A world of “exhaustive, reliable” metadata would be wonderful, he argued, but such a world was “a pipe-dream, founded on self-delusion, nerd hubris, and hysterically inflated market opportunities.” Doctorow had found himself in a series of debates over the Semantic Web at tech conferences and wanted to catalog the serious issues that the Semantic Web enthusiasts (Doctorow calls them “semweb hucksters”) were overlooking. The essay, titled “Metacrap,” identifies seven problems, among them the obvious fact that most web users were likely to provide either no metadata at all or else lots of misleading metadata meant to draw clicks. Even if users were universally diligent and well-intentioned, in order for the metadata to be robust and reliable, users would all have to agree on a single representation for each important concept. Doctorow argued that in some cases a single representation might not be appropriate, desirable, or fair to all users. - -Indeed, the web had already seen people abusing the HTML `` tag (introduced at least as early as HTML 4) in an attempt to improve the visibility of their webpages in search results. In a 2004 paper, Ben Munat, then an academic at Evergreen State College, explains how search engines once experimented with using keywords supplied via the `` tag to index results, but soon discovered that unscrupulous webpage authors were including tags unrelated to the actual content of their webpage. As a result, search engines came to ignore the `` tag in favor of using complex algorithms to analyze the actual content of a webpage. Munat concludes that a general-purpose Semantic Web is unworkable, and that the focus should be on specific domains within medicine and science. - -Others have also seen the Semantic Web project as tragically flawed, though they have located the flaw elsewhere. Aaron Swartz, the famous programmer and another digital rights activist, wrote in an unfinished book about the Semantic Web published after his death that Doctorow was “attacking a strawman.” Nobody expected that metadata on the web would be thoroughly accurate and reliable, but the Semantic Web, or at least a more realistically scoped version of it, remained possible. The problem, in Swartz’ view, was the “formalizing mindset of mathematics and the institutional structure of academics” that the “semantic Webheads” brought to bear on the challenge. In forums like the World Wide Web Consortium (W3C), a huge amount of effort and discussion went into creating standards before there were any applications out there to standardize. And the standards that emerged from these “Talmudic debates” were so abstract that few of them ever saw widespread adoption. The few that did, like XML, were “uniformly scourges on the planet, offenses against hardworking programmers that have pushed out sensible formats (like JSON) in favor of overly-complicated hairballs with no basis in reality.” The Semantic Web might have thrived if, like the original web, its standards were eagerly adopted by everyone. But that never happened because—as [has been discussed][2] on this blog before—the putative benefits of something like XML are not easy to sell to a programmer when the alternatives are both entirely sufficient and much easier to understand. - -### Building the Semantic Web - -If the Semantic Web was not an outright impossibility, it was always going to require the contributions of lots of clever people working in concert. - -The long effort to build the Semantic Web has been said to consist of four phases. The first phase, which lasted from 2001 to 2005, was the golden age of Semantic Web activity. Between 2001 and 2005, the W3C issued a slew of new standards laying out the foundational technologies of the Semantic future. - -The most important of these was the Resource Description Framework (RDF). The W3C issued the first version of the RDF standard in 2004, but RDF had been floating around since 1997, when a W3C working group introduced it in a draft specification. RDF was originally conceived of as a tool for modeling metadata and was partly based on earlier attempts by Ramanathan Guha, an Apple engineer, to develop a metadata system for files stored on Apple computers. The Semantic Web working groups at W3C repurposed RDF to represent arbitrary kinds of general knowledge. - -RDF would be the grammar in which Semantic webpages expressed information. The grammar is a simple one: Facts about the world are expressed in RDF as triplets of subject, predicate, and object. Tim Bray, who worked with Ramanathan Guha on an early version of RDF, gives the following example, describing TV shows and movies: - -``` -@prefix rdf: . - -@prefix ex: . - - -ex:vincent_donofrio ex:starred_in ex:law_and_order_ci . - -ex:law_and_order_ci rdf:type ex:tv_show . - -ex:the_thirteenth_floor ex:similar_plot_as ex:the_matrix . -``` - -The syntax is not important, especially since RDF can be represented in a number of formats, including XML and JSON. This example is in a format called Turtle, which expresses RDF triplets as straightforward sentences terminated by periods. The three essential sentences, which appear above after the `@prefix` preamble, state three facts: Vincent Donofrio starred in Law and Order, Law and Order is a type of TV Show, and the movie The Thirteenth Floor has a similar plot as The Matrix. (If you don’t know who Vincent Donofrio is and have never seen The Thirteenth Floor, I, too, was watching Nickelodeon and sipping Capri Suns in 1999.) - -Other specifications finalized and drafted during this first era of Semantic Web development describe all the ways in which RDF can be used. RDF in Attributes (RDFa) defines how RDF can be embedded in HTML so that browsers, search engines, and other programs can glean meaning from a webpage. RDF Schema and another standard called OWL allows RDF authors to demarcate the boundary between valid and invalid RDF statements in their RDF documents. RDF Schema and OWL, in other words, are tools for creating what are known as ontologies, explicit specifications of what can and cannot be said within a specific domain. An ontology might include a rule, for example, expressing that no person can be the mother of another person without also being a parent of that person. The hope was that these ontologies would be widely used not only to check the accuracy of RDF found in the wild but also to make inferences about omitted information. - -In 2006, Tim Berners-Lee posted a short article in which he argued that the existing work on Semantic Web standards needed to be supplemented by a concerted effort to make semantic data available on the web. Furthermore, once on the web, it was important that semantic data link to other kinds of semantic data, ensuring the rise of a data-based web as interconnected as the existing web. Berners-Lee used the term “linked data” to describe this ideal scenario. Though “linked data” was in one sense just a recapitulation of the original vision for the Semantic Web, it became a term that people could rally around and thus amounted to a rebranding of the Semantic Web project. - -Berners-Lee’s article launched the second phase of the Semantic Web’s development, where the focus shifted from setting standards and building toy examples to creating and popularizing large RDF datasets. Perhaps the most successful of these datasets was [DBpedia][3], a giant repository of RDF triplets extracted from Wikipedia articles. DBpedia, which made heavy use of the Semantic Web standards that had been developed in the first half of the 2000s, was a standout example of what could be accomplished using the W3C’s new formats. Today DBpedia describes 4.58 million entities and is used by organizations like the NY Times, BBC, and IBM, which employed DBpedia as a knowledge source for IBM Watson, the Jeopardy-winning artificial intelligence system. - -![][4] - -The third phase of the Semantic Web’s development involved adapting the W3C’s standards to fit the actual practices and preferences of web developers. By 2008, JSON had begun its meteoric rise to popularity. Whereas XML came packaged with a bunch of associated technologies of indeterminate purpose (XLST, XPath, XQuery, XLink), JSON was just JSON. It was less verbose and more readable. Manu Sporny, an entrepreneur and member of the W3C, had already started using JSON at his company and wanted to find an easy way for RDFa and JSON to work together. The result would be JSON-LD, which in essence was RDF reimagined for a world that had chosen JSON over XML. Sporny, together with his CTO, Dave Longley, issued a draft specification of JSON-LD in 2010. For the next few years, JSON-LD and an updated RDF specification would be the primary focus of Semantic Web work at the W3C. JSON-LD could be used on its own or it could be embedded within a `