Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-12-07 08:18:42 +08:00
commit c7c98c7404
4 changed files with 333 additions and 41 deletions

View File

@ -0,0 +1,106 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Openness is the key to innovation, history shows)
[#]: via: (https://opensource.com/open-organization/20/12/open-innovation-history)
[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland)
Openness is the key to innovation, history shows
======
History demonstrates the kinds of organizational structures that foster
innovation: open, communal, and humble. Here are just two examples.
![Team checklist][1]
In the [first part of this article series][2]—an extended review of the book [How Innovation Works][3] by [Matt Ridley][4]—I examined Ridley's characterization of innovation: it's gradual, incremental, and collective, and involves extensive collaboration between parties. This, I argued, is why [open organization principles][5] are so important and play a major role in fostering innovation.
In [part two of the series][6], I reviewed Ridley's assessment of the environments where innovation and discovery thrive, and I demonstrated some essential characteristics of the innovation process.
Now, in this concluding part of my review, I bring these ideas alive by recounting case studies of innovative discoveries throughout history.
### Innovation throughout history
In _How Innovation Works_, Ridley mentions that innovation is mostly a "bottom-up phenomenon." For example, throughout the 19th century, as Britain and Europe developed new railways, the steel industry, new applications for electricity, the textile industry, and many other breakthroughs, governments weren't involved. Only after the fact did governments play the role of regulator and standards creator. Sometimes, governments even played the role of the customer or user.
The same was true in America in the early 20th century. There were few public subsidies for research and development before 1940. And after World War II, the Japanese miracle was a function of private corporations backed by a vast ecosystem of small enterprises. Most efforts resembled open organizations—a modest group of dedicated hands-on, ground floor members. That's where most innovation originated, on the ground floor according to open organization principles.
By contrast, the Soviet Union was a very clear case of a public governmental entrepreneurial state; it funded a great deal of research centrally, and allowed virtually no involvement from private enterprise. Innovation in transportation, food production, health care, and consumer products suffered as a result. (In this environment open organization principles were not in use.)
Innovations come from humble places, Ridley's argues, and large, bureaucratic corporations were not particularly good at developing innovative products. Instead, small, loosely assembled communities (open organizations with front line teams) have been more innovative throughout history. They have been far more capable of exploring new concepts, particularly if they have a wide base of contributions to work with.
Let me review two historical examples of this, drawn from Ridley's work (one brief, one lengthier).
### Lighting every house (the light bulb)
Who invented the light bulb? Easy answer: Thomas Edison.
But at least a dozen other people were working on similar technologies around the same time, even before Edison, as Ridley documents in detail in _How Innovation Works_. Edison, however, [gets recognition for the invention][2].
Through some 50,000 trial-and-error experiments, a full complement of staff developed a usable, affordable light bulb for interior and room lighting (Edison's team tested roughly 6,000 plant materials until it found the right kind of bamboo for the bulb's filament). The invention made both oil lamps and gas lamps things of the past. Perhaps better than anyone else at the time, Edison knew that innovation was largely a team effort. He hired groups of skilled craftsmen and scientists (totalling 200 people in all) and worked them incredibly hard. Their collaboration, iterative and adaptive testing, and sharing eventually led to the registration of more than 400 patents in six years. Edison supported his innovative teams extensively, stuffing his workshops with every kind of material, tool, and book. His goal was not simply to inspire invention; it was to turn ideas into practical, reliable, and affordable items—the result of extensive application of open organization principles.
### Two approaches to flight (the powered aircraft)
Now let me offer a more detailed example, one focused on the innovation of powered aircraft. To better illustrate the advantage of an open organizational approach, I'll juxtapose two approaches to this innovation.
#### Samuel Langley's approach
In 1903, the East Coast of the United States saw the first airplane flight by Samuel Langley. It impressed the US government, which expressed a desire to invest in the development of powered flight (powered flight, of course, would allow people to travel longer distances).
Innovations come from humble places.
Initially, the American government supported Langley's experiments with an investment of $50,000. Later, it offered another US$20,000. Langley had convinced the government he could build a powered plane that would stay in the air longer than a simple glider (Langley was a professor from New England, an astronomer, and a well-connected head of the Smithsonian Institute in Washington, DC, so his reputation would have seemed to support his claims).
Because of his confidence, he decided to _keep all his research and experiments confidential_. He could not have been more closed in his approach to research and experimentation.
This went on for seven years, until a test plane was finally ready for presentation to the government. Langley was not a hands-on experimenter and was not willing to pilot his prototype plane himself (he commissioned Charles Manly). The plane crashed after flying just a short distance, to everyone's disappointment. Langley's reputation never recovered. The fiasco led to the US government pulling all funding for the project, and it gave up on powered flight after a decade of wasting money.
From the perspective of someone thinking with open organization principles, Langley would seem to have done everything wrong. He spent lots of money, depended on a single authority (the government), consulted with very few outside people, and built the full aircraft from scratch instead of building and testing components in an incremental way, by experimenting with different designs, shapes, sizes, and weights. He built _no community_ to work on the project. He _included_ only the minimum necessary outsiders. He was _not transparent_ of his activities or concerns. He did not establish step-by-step milestones in which he could make _adaptations_ if need be. And, he _collaborated_ with as few people as possible.
#### The Wright brothers' approach
But just south of Langley's failure, in an area called [Kitty Hawk][7], with almost nobody watching, two brothers from Ohio were busy achieving innovation in powered flight, and by spending only a fraction of what Langley did. They were Orville and Wilbur Wright.
The Wright brothers' initial test flight lasted 12 seconds and traveled 40 yards (37 meters). Their second flight (later that day) lasted almost one minute and covered more than 800 feet (244 meters). Just five people were present to observe these successful powered flights.
Thinking again with open organization principles, we might say the Wright brothers did everything right.
Innovation happens when someone creates a community while working on a problem. Through concurrent community collaboration, that group might make discoveries that lead to an innovation.
These two brothers were not well-known researchers (or even engineers for that matter). They simply were experienced bicycle builders and had a small shop. They were diligent craftsmen and loved building things. They simply wanted to address the challenges and problems of powered flight through building an aircraft. Fueled by those passions, they started building a development team (_community_ building), which included others in the project to bring in valued experience. They _included_ key outside people. They were very _transparent_ regarding their activities and concerns (more on this in a moment). They established step-by-step milestones in which they could make _adaptations_ if need be.
Moreover, they _collaborated_ with as many people as they needed to, gathering expertise where they could find it. First they wrote to Otto Lillienthal in Frankfurt, Germany**,** a famous designer of gliders. They also approached a rather eccentric French-American in Chicago by the name of Octave Chanute, who studied the powered flight problems to overcome and published papers on them. These are examples of inclusivity at its best—approaching people far different than them to achieve something. Thorough documentation of the Wright brother's collaboration with Chanute (and his extensive network of like-minded thinkers) helped solidify their basic design for a powered aircraft. And just by luck, someone the Wright brothers hired to work in the bicycle shop was an extremely good mechanic and loved designing machines. His name was Charlie Taylor. The internal combustion engine was just being developed at that time, and the Wright brothers knew that the motors on the market were too heavy for an aircraft, so Charlie built one from scratch, using aluminium (a much lighter material).
This more open approach to innovating in the field of powered aircraft is the one that eventually gave rise to the inventions (and industry) we enjoy today and brought the Wright brothers fame.
### History lessons
Think about both those examples, two case studies of innovation through open organization principles. Both indicate that, for _any_ innovation, quite a few people are required (not lone individuals). In both cases, inventors needed to "cross-pollinate" ideas in two ways:
1. concurrently, working together directly, and
2. learning sequentially over time.
Our lessons from history illustrate these approaches to innovation. Innovation happens when someone creates a _community_ while working on a problem. Through concurrent community collaboration, that group might make discoveries that lead to an innovation. Sometimes, however, those communities fail. But because they _document_ their work as they collaborate, another person (and community) can replicate what they've done and improve upon it (sequential innovation)—perhaps succeeding where the first group did not.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/20/12/open-innovation-history
作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist)
[2]: https://opensource.com/open-organization/20/10/best-ideas-recognition-innovation
[3]: https://www.goodreads.com/en/book/show/45449488-how-innovation-works
[4]: https://en.wikipedia.org/wiki/Matt_Ridley
[5]: https://theopenorganization.org/definition/
[6]: https://opensource.com/open-organization/20/11/environments-for-innovation
[7]: https://www.google.com/search?rlz=1CAKMJF_enJP874&sxsrf=ALeKk02B7m1kL1nXrRT2cH4-zyr8VV_DDw:1597632027500&ei=u-05X5byJ8Ko-QaRt6HoDQ&q=kitty%20hawk%20museum&oq=kitty+hawk+mus&gs_lcp=CgZwc3ktYWIQARgAMgIIADICCAAyAggAMgIIADICCAAyAggAMgIIADoECAAQRzoHCC4QJxCTAjoHCAAQFBCHAjoICC4QxwEQrwE6BAgAEENQ04sBWIqeAWCvtAFoAXABeACAAY4BiAHEBZIBAzEuNZgBAKABAaoBB2d3cy13aXrAAQE&sclient=psy-ab&npsic=0&rflfq=1&rlha=0&rllag=36111118,-75775286,9090&tbm=lcl&rldimm=17550871878646241173&lqi=ChFraXR0eSBoYXdrIG11c2V1bVobCgZtdXNldW0iEWtpdHR5IGhhd2sgbXVzZXVt&phdesc=B2b85nIlVwQ&ved=2ahUKEwjz-uuLm6HrAhVLFogKHXjGD7YQvS4wAHoECAoQLQ&rldoc=1&tbs=lrf:!1m4!1u3!2m2!3m1!1e1!1m4!1u2!2m2!2m1!1e1!1m4!1u16!2m2!16m1!1e1!1m4!1u16!2m2!16m1!1e2!1m5!1u15!2m2!15m1!1shas_1wheelchair_1accessible_1entrance!4e2!2m1!1e2!2m1!1e16!2m1!1e3!3sIAE,lf:1,lf_ui:1&rlst=f#rlfi=hd:;si:17259280498191889741,l,ChFraXR0eSBoYXdrIG11c2V1bVobCgZtdXNldW0iEWtpdHR5IGhhd2sgbXVzZXVt,y,tBWxg7TmYyk;mv:%5B%5B41.993476711913615,-73.13628440817928%5D,%5B33.753275807154516,-89.35208728632068%5D,null,%5B37.98892655631248,-81.24418584724998%5D,6%5D

View File

@ -0,0 +1,117 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Experience the useful features of the Xedit text editor)
[#]: via: (https://opensource.com/article/20/12/xedit)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Experience the useful features of the Xedit text editor
======
Xedit, part of the X11 graphic server, isn't much to look at but has
enough hidden features to make it a serious text editor.
![Computer screen with files or windows open][1]
The X11 graphic server, distributed by [X.org][2], has a few token applications that show how to program with its provided tools. These range from the [TWM][3] desktop to the silly but hypnotic Xeyes. It also includes a text editor called Xedit, a seemingly simple application with enough hidden features to make it a serious editor.
### Install Xedit
If you're on Linux or BSD, you can install Xedit from your distribution's software repository or ports tree. It sometimes appears in a package called X11-apps bundled with other X11 apps.
On macOS, you can install [XQuartz][4], which provides Xedit, Xeyes, and a few other small applications (along with an X11 graphics server).
### Launch Xedit
You can launch Xedit from your application menu, if it's listed. Some distributions treat it more as a command than a GUI app, even though it is definitely a GUI app, so it may not be listed in your application menu. In that case, you can launch Xedit from the terminal. If you type `xedit &` to launch the application, it launches an empty Xedit editor ready for text. If you enter the launch command along with an existing file's name, Xedit starts with the file loaded into its buffer:
```
`$ xedit example.txt &`
```
![Xedit][5]
(Seth Kenlon, [CC BY-SA 4.0][6])
### Load a file
From an open Xedit instance, you can load a file by typing the file's path in the top text field. Click the **Load** button (to the left of the text field) to read the file into the Xedit window.
![Load Xedit][7]
(Seth Kenlon, [CC BY-SA 4.0][6])
You can have several files open at once. When one file is loaded, it takes focus and appears in your main Xedit buffer (the big text field in the main window) and shuffles any existing file into a hidden buffer.
You can navigate between buffers using a key combo familiar to Emacs users but sometimes confusing to others: First, press **Ctrl+X**. Release those keys, and then press **Ctrl+B**.
### Key combos
It feels strange at first to perform actions that require _two_ keyboard shortcuts in a row, but after a while, you get used to it. In fact, as a frequent Emacs user, I find the compound key combinations comfortingly rhythmic. I was surprised and pleased to find that some of my favorite shortcuts were valid in Xedit.
It turns out that Xedit borrows keyboard shortcuts from several sources of inspiration. If you're an Emacs user, you'll find that the most common combinations are valid in Xedit. For instance, **C-x** **C-f** (that's **Ctrl+X** followed **Ctrl+F**) takes you to the top text field to load a file, and **C-x** **C-s** (**Ctrl+X** followed by **Ctrl+S**) saves a file. Surprisingly, **C-x** **3** even splits the window vertically, while **C-x** **2** splits it horizontally, and **C-x** **0** or **1** removes the split.
Edit commands familiar to Emacs or Bash users also apply:
* **Ctrl+A** moves to the beginning of a line.
* **Ctrl+E** moves to the end of a line.
* **Alt+B** moves back a word.
* **Ctrl+B** moves back a character.
* **Ctrl+F** moves forward a character.
* **Alt+F** moves forward a word.
* **Ctrl+D** deletes the next character.
There are many more, and they're listed on the Xedit man page.
### Use line-editing mode
Xedit also includes a line editor, similar to **ex**, which ought to be familiar to [Vi][8] and `ed` or even `sed` users. To enter line-editing mode, press the **Esc** key. This places you in the top text field but in a command mode. Edit commands use the syntax: _line number_ followed by a _command_ and _parameters_.
Say you have this text file:
```
ed is the standard Unix text editor.
This is line number two.
```
You decide you want to change `ed` to `Xedit` in line 1. In Xedit, move to line 1, press **Esc**, and then type `.,s/ed/Xedit/`.
```
Xedit is the standard Unix text editor.
This is line number two.
```
Without moving your cursor to the next line, you could change `two` to `the second`: Press **Esc** and then type `2,s/two/the second/`.
Possible commands and valid parameters are listed in Xedit's man page.
### Simple but robust
Xedit isn't much to look at. It's simple, it has no menus to speak of, but it borrows some popular conveniences from some of the best Unix editors. The next time you're looking for a new editor, try Xedit.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/12/xedit
作者:[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_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://www.x.org/wiki/
[3]: https://opensource.com/article/19/12/twm-linux-desktop
[4]: http://xquartz.org
[5]: https://opensource.com/sites/default/files/uploads/xedit.jpeg (Xedit)
[6]: https://creativecommons.org/licenses/by-sa/4.0/
[7]: https://opensource.com/sites/default/files/uploads/xedit-load.jpg (Load Xedit)
[8]: https://opensource.com/article/20/12/vi-text-editor

View File

@ -0,0 +1,70 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Always on Top: An Often Ignored But Handy Feature in Linux Desktop)
[#]: via: (https://itsfoss.com/always-on-top/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
Always on Top: An Often Ignored But Handy Feature in Linux Desktop
======
“Always on Top” is one of those features that people are either not aware of or they simply ignore it.
And this surprises me. Because for me, it is one of the features that I simply love to use on Linux desktop.
If you are not aware of it already, (almost) all applications have this “Always on Top” option. Usually, when you open a new application, it gets the focus and occupies the screen above all other running applications.
With the “Always on Top” option selected, the application window will always be visible, no matter what other application you open.
This comes handy for me in situations where I have to use terminal and read something together. I can keep the terminal in “Always on Top” mode so that it remains visible while I browse the internet or interact with team members through Rocket Chat.
### Using “Always on Top” feature in Linux
This cannot be simpler than this. All you have to do is to right-click on the top bar of the application. In here, select the Always on Top option. Thats it.
![Right click on the application bar and select the option][1]
Keep in mind that the position of the application is not fixed. You can move the application to any corner of the screen. It will remain visible on the top of all opened applications.
To disable the “Always on Top” mode, you have to select it one more time.
![Same steps: Right click on the application bar and select the Always on Top option][2]
Do note that you wont see the “Always on Top” option if your application is in full-window mode.
I know switching between applications is a matter of Alt+Tab keys but when you have several applications running, switching apps will require more than two keystrokes.
This feature should be available in most desktop environments. If you dont see it, please [check which desktop environment you are using][3] and let me know. Ill update the article with the information.
### Do you like the “Always on Top” feature
This is like the “Picture in Picture” [feature that modern web browsers like Firefox are providing][4] these days. Linux had it way before.
I know this is a tiny thing and perhaps did not warrant an entire article. But I also have a feeling that in the world full of [Poirots][5], there will be some [Hastings][6] and for them, this will be a revelation.
So, are you Hercule Poirot (already using this feature) or Captain Hastings (didnt know about it)? Or perhaps you are [Chief Inspector Japp][7] (knew about this feature but never bothered to use it).
I couldnt help using Agatha Christie jargon. If you are not a fan, just ignore it :)
--------------------------------------------------------------------------------
via: https://itsfoss.com/always-on-top/
作者:[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/12/set-always-on-top-linux.png?resize=800%2C450&ssl=1
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/disable-always-on-top.png?resize=800%2C450&ssl=1
[3]: https://itsfoss.com/find-desktop-environment/
[4]: https://itsfoss.com/firefox-useful-features/
[5]: https://agathachristie.fandom.com/wiki/Hercule_Poirot
[6]: https://agathachristie.fandom.com/wiki/Arthur_Hastings
[7]: https://agathachristie.fandom.com/wiki/James_Japp

View File

@ -1,32 +1,30 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with Fedora CoreOS)
[#]: via: (https://fedoramagazine.org/getting-started-with-fedora-coreos/)
[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/)
Getting started with Fedora CoreOS
Fedora CoreOS 入门
======
![Getting started with Fedora CoreOS][1]
[Fedora CoreOS入门][1]
Photo by [Paweł Czerwiński][2] on [Unsplash][3]
现在被称为 DevOps 时代,操作系统的关注度似乎比工具要低一些。然而,这并不意味着操作系统没有创新。(编辑注:基于 Linux 内核的众多发行版所提供的多样化产品就是一个很好的例子)。[Fedora CoreOS][4] 就对这个 DevOps 时代的操作系统应该是什么样有着独特的理念。
This has been called the age of DevOps, and operating systems seem to be getting a little bit less attention than tools are. However, this doesnt mean that there has been no innovation in operating systems. [Edit: The diversity of offerings from the plethora of distributions based on the Linux kernel is a fine example of this.] [Fedora CoreOS][4] has a specific philosophy of what an operating system should be in this age of DevOps.
### Fedora CoreOS 的理念
### Fedora CoreOS philosophy
Fedora CoreOSFCOS是由 CoreOS Container Linux 和 Fedora Atomic Host 合并而来。它是一个专注于运行容器化应用程序的精简的独体操作系统。安全性是首要重点FCOS 提供了自动更新,并带有 SELinux 强化。
Fedora CoreOS (FCOS) came from the merging of CoreOS Container Linux and Fedora Atomic Host. It is a minimal and monolithic OS focused on running containerized applications. Security being a first class citizen, FCOS provides automatic updates and comes with SELinux hardening.
为了使自动更新能够很好地工作,它们需要非常健壮,目标是运行 FCOS 的服务器在更新后不会崩溃。这是通过使用不同的发布流stable、testing 和 next来实现的。每个流每 2 周发布一次更新内容会从一个流推广到另一个流next -> testing -> stable。这样落地在 stable 流中的更新就有机会经过长时间的测试。
### 入门
For automatic updates to work well they need to be very robust. The goal being that servers running FCOS wont break after an update. This is achieved by using different release streams (stable, testing and next). Each stream is released every 2 weeks and content is promoted from one stream to the other (next -> testing -> stable). That way updates landing in the stable stream have had the opportunity to be tested over a long period of time.
### Getting Started
For this example lets use the stable stream and a QEMU base image that we can run as a virtual machine. You can use [coreos-installer][5] to download that image.
From your (Workstation) terminal, run the following commands after updating the link to the image. [Edit: On Silverblue the container based coreos tools are the simplest method to try. Instructions can be found at <https://docs.fedoraproject.org/en-US/fedora-coreos/tutorial-setup/> , in particular “Setup with Podman or Docker”.]
对于这个例子,让我们使用 stable 流和一个 QEMU 基础镜像,我们可以作为一个虚拟机运行。你可以使用 [coreos-installer][5] 来下载该镜像。
在你的Workstation终端上更新镜像的链接后运行以下命令编辑注在 Silverblue 上,基于容器的 coreos 工具是最简单的方法,可以尝试一下。说明可以在 <https://docs.fedoraproject.org/en-US/fedora-coreos/tutorial-setup/> 中找到,特别是 “Setup with Podman or Docker” 一节。):
```
$ sudo dnf install coreos-installer
@ -36,11 +34,11 @@ $ ls
fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2
```
#### Create a configuration
#### 创建一个配置
To customize a FCOS system, you need to provide a configuration file that will be used by [Ignition][6] to provision the system. You may use this file to configure things like creating a user, adding a trusted SSH key, enabling systemd services, and more.
要定制一个 FCOS 系统,你需要提供一个配置文件,[Ignition][6] 将使用这个文件来配置系统。你可以用这个文件来配置诸如创建用户、添加受信任的 SSH 密钥、启用 systemd 服务等等。
The following configuration creates a _core_ user and adds an SSH key to the authorized_keys file. It is also creating a systemd service that uses [podman][7] to run a simple hello world container.
以下配置创建了一个 `core` 用户,并在 `authorized_keys` 文件中添加了一个 SSH 密钥。它还创建了一个 systemd 服务,使用 [podman][7] 来运行一个简单的 “hello world” 容器:
```
version: "1.0.0"
@ -67,24 +65,24 @@ systemd:
name: hello.service
```
After adding your SSH key in the configuration save it as _config.yaml_. Next use the Fedora CoreOS Config Transpiler (fcct) tool to convert this YAML configuration into a valid Ignition configuration (JSON format).
在配置中加入你的 SSH 密钥后,将其保存为 `config.yaml`。接下来使用 Fedora CoreOS Config Transpiler`fcct`)工具将这个 YAML 配置转换成有效的 Ignition 配置JSON 格式)。
Install _fcct_ directly from Fedoras repositories or get the binary from [GitHub][8].
直接从 Fedora 的资源库中安装 `fcct`,或者从 [GitHub][8] 中获取二进制文件:
```
$ sudo dnf install fcct
$ fcct -output config.ign config.yaml
```
#### Install and run Fedora CoreOS
#### 安装并运行 Fedora CoreOS
To run the image, you can use the libvirt stack. To install it on a Fedora system using the dnf package manager
要运行镜像,你可以使用 libvirt 堆栈。要在 Fedora 系统上使用 `dnf` 软件包管理器安装它:
```
$ sudo dnf install @virtualization
```
Now lets create and run a Fedora CoreOS virtual machine
现在让我们创建并运行一个 Fedora CoreOS 虚拟机:
```
$ chcon --verbose unconfined_u:object_r:svirt_home_t:s0 config.ign
@ -98,7 +96,7 @@ $ virt-install --name=fcos \
--disk=size=20,backing_store=${PWD}/fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2
```
Once the installation is successful, some information is displayed and a login prompt is provided.
安装成功后,会显示一些信息并提供登录提示符:
```
Fedora CoreOS 32.20200907.3.0
@ -111,16 +109,16 @@ Ignition: user provided config was applied
Ignition: wrote ssh authorized keys file for user: core
```
The Ignition configuration file did not provide any password for the _core_ user, therefore it is not possible to login directly via the console. (Though, it is possible to configure a password for users via Ignition configuration.)
Ignition 配置文件没有为 `core` 用户提供任何密码,因此无法通过控制台直接登录。(不过,也可以通过 Ignition 配置为用户配置密码。)
Use Ctrl + ] key combination to exit the virtual machines console. Then check if the hello.service is running.
使用 `Ctrl + ]` 组合键退出虚拟机的控制台。然后检查 `hello.service` 是否在运行:
```
$ curl http://192.168.122.237:8080
Hello from Fedora CoreOS!
```
Using the preconfigured SSH key, you can also access the VM and inspect the services running on it.
使用预先配置的 SSH 密钥,你还可以访问虚拟机并检查其上运行的服务:
```
$ ssh core@192.168.122.237
@ -130,10 +128,11 @@ Loaded: loaded (/etc/systemd/system/hello.service; enabled; vendor preset: enabl
Active: active (running) since Wed 2020-10-28 10:10:26 UTC; 42s ago
```
#### zincati, rpm-ostree and automatic updates
#### zincati、rpm-ostree 和自动更新
The zincati service drives rpm-ostreed with automatic updates.
Check which version of Fedora CoreOS is currently running on the VM, and check if Zincati has found an update.
zincati 服务使用自动更新驱动 rpm-ostreed。
检查虚拟机上当前运行的 Fedora CoreOS 版本,并检查 zincati 是否找到了更新:
```
$ ssh core@192.168.122.237
@ -155,7 +154,7 @@ Oct 28 13:36:25 cosa-devsh zincati[1013]: [INFO ] target release '32.20201004.3.
... zincati reboot ...
```
After the restart, lets remote login once more to check the new version of Fedora CoreOS.
重启后,我们再远程登录一次,检查新版的 Fedora CoreOS
```
$ ssh core@192.168.122.237
@ -172,31 +171,31 @@ Commit: b53de8b03134c5e6b683b5ea471888e9e1b193781794f01b9ed5865b57f35d57
GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
```
_rpm-ostree status_ now shows 2 versions of Fedora CoreOS, the one that came in the QEMU image, and the latest one received from the update. By having these 2 versions available, it is possible to rollback to the previous version using the _rpm-ostree rollback_ command.
`rpm-ostree status` 现在显示了两个版本的 Fedora CoreOS一个是 QEMU 镜像中的版本,一个是更新后的最新版本。有了这两个版本,就可以使用 `rpm-ostree rollback` 命令回滚到之前的版本。
Finally, you can make sure that the hello service is still running and serving content.
最后,你可以确保 hello 服务仍在运行并提供内容:
```
$ curl http://192.168.122.237:8080
Hello from Fedora CoreOS!
```
More information: [Fedora CoreOS updates][9]
更多信息参见:[Fedora CoreOS 更新][9]。
#### Deleting the Virtual Machine
#### 删除虚拟机
To clean up afterwards, the following commands will delete the VM and associated storage.
要进行事后清理,使用以下命令删除虚拟机和相关存储:
```
$ virsh destroy fcos
$ virsh undefine --remove-all-storage fcos
```
### Conclusion
### 结论
Fedora CoreOS provides a solid and secure operating system tailored to run applications in containers. It excels in a DevOps environment which encourages the hosts to be provisioned using declarative configuration files. Automatic updates and the ability to rollback to a previous version of the OS, bring a peace of mind during the operation of a service.
Fedora CoreOS 为在容器中运行应用程序提供了一个坚实而安全的操作系统。它在推荐主机使用声明式配置文件进行配置的 DevOps 环境中表现出色。自动更新和回滚到以前版本的操作系统的能力,可以在服务的运行过程中带来安心的感觉。
Learn more about Fedora CoreOS by following the tutorials available in the projects [documentation][10].
通过关注项目[文档][10]中的教程,了解更多关于 Fedora CoreOS 的信息。
--------------------------------------------------------------------------------
@ -204,8 +203,8 @@ via: https://fedoramagazine.org/getting-started-with-fedora-coreos/
作者:[Clément Verna][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出