Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang
2020-11-13 23:45:32 +08:00
18 changed files with 2212 additions and 362 deletions

View File

@@ -1,90 +1,79 @@
[#]: collector: "lujun9972"
[#]: translator: "xiao-song-123"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-12819-1.html"
[#]: subject: "Understand your Python code with this open source visualization tool"
[#]: via: "https://opensource.com/article/20/11/python-code-viztracer"
[#]: author: "Tian Gao https://opensource.com/users/gaogaotiantian"
使用开源可视化工具来理解的 Python 代码
使用开源可视化工具来理解的 Python 代码
======
VizTracer 工具可以可视化并跟踪 Python 代码,让您可以更深入地了解其工作原理。
![Python programming language logo with question marks][1]
随之 Python 项目变得越来越大、越复杂,理解起它来就变得充满挑战性。即使是您自己独自编写了整个项目,也不可能完全知道项目是如何工作的。为了能更好的理解您的代码,调试和分析代码变得至关重要
> VizTracer 工具可以可视化并跟踪 Python 代码,让你可以更深入地了解其工作原理
[VizTracer][2] 是一个这样的工具,它通过跟踪和可视化 Python 代码的执行过程来帮助您对代码的理解。无需对源代码进行任何更改VizTracer 即可记录函数的入口 / 出口,函数参数 / 返回值以及任意变量,然后通过 [Trace-Viewer][3] 使用直观的谷歌前端界面来显示数据。
![](https://img.linux.net.cn/data/attachment/album/202011/13/225531g64gdav22n6d6va9.jpg)
随着 Python 项目变得越来越大、越复杂,理解起它来就变得充满挑战性。即使是你自己独自编写了整个项目,也不可能完全知道项目是如何工作的。为了能更好的理解你的代码,调试和分析代码变得至关重要。
[VizTracer][2] 是一个这样的工具,它通过跟踪和可视化 Python 代码的执行过程来帮助你对代码的理解。无需对源代码进行任何更改VizTracer 即可记录函数的入口 / 出口,函数参数 / 返回值以及任意变量,然后通过 [Trace-Viewer][3] 使用直观的谷歌前端界面来显示数据。
下面是一个运行[蒙特卡洛树搜索][4]的例子:
![Monte Carlo tree search visualization][5]
(Tian Gao, [CC BY-SA 4.0][6])
每个函数都在时间线上以堆栈的形式记录和可视化,这样您就可以看到在运行程序时发生了什么。您可以放大查看任意特定点的详细信息:
每个函数都在时间线上以堆栈的形式记录和可视化,这样你就可以看到在运行程序时发生了什么。你可以放大查看任意特定点的详细信息:
![Zooming in on VizTracer visualization][7]
(Tian Gao, [CC BY-SA 4.0][6])
VizTracer 还可以自动记录函数参数和返回值。您可以单击功能条目并查看详细信息:
VizTracer 还可以自动记录函数参数和返回值。你可以单击函数条目并查看详细信息:
![Viewing VizTracer details][8]
(Tian Gao, [CC BY-SA 4.0][6])
或者您可以创建一个全新的信号,并用它来记录变量。例如,这显示了执行梯度下降时的代价值:
或者你可以创建一个全新的信号,并用它来记录变量。例如,这显示了执行梯度下降时的成本值:
![VizTracer gradient descent][9]
(Tian Gao, [CC BY-SA 4.0][6])
与其他设置复杂的工具相比VizTracer 使用起来非常简单,并且没有任何依赖关系。您可以从 pip 安装它:
与其他设置复杂的工具相比VizTracer 使用起来非常简单,并且没有任何依赖关系。你可以从 pip 安装它:
```
`pip install viztracer`
pip install viztracer
```
也可以通过输入来跟踪你的程序 ( `<your_script.py>`脚本的名称):
也可以通过输入来跟踪你的程序`<your_script.py>`脚本的名称:
```
`viztracer <your_script.py>`
viztracer <your_script.py>
```
VizTracer 将在的工作目录中生成一个 HTML 报告,可以在 Chrome 浏览器中打开它。
VizTracer 还提供了其他高级功能,比如过滤器功能,您可以使用它过滤掉不想跟踪的函数,获得更清晰的报告。例如,要仅包含文件中的函数,您需要:
VizTracer 将在的工作目录中生成一个 HTML 报告,可以在 Chrome 浏览器中打开它。
VizTracer 还提供了其他高级功能,比如过滤器功能,你可以使用它过滤掉不想跟踪的函数,获得更清晰的报告。例如,要仅包含文件中的函数,你需要:
```
`viztracer include_files ./ --run <your_script.py>`
viztracer include_files ./ --run <your_script.py>
```
记录函数参数和返回值:
```
`viztracer --log_function_args --log_return_value <your_script.py>`
viztracer --log_function_args --log_return_value <your_script.py>
```
记录与某个正则表达式匹配的任意变量:
记录与某个正则表达式匹配的任意变量
```
# log variables starts with a
viztracer --log_var a.* --run &lt;your_script.py&gt;
```
可以通过对源代码进行较小的修改来获得其他功能,例如自定义事件来记录数值和对象。
可以通过对源代码进行较小的修改来获得其他功能,例如自定义事件来记录数值和对象。
VizTracer 还包括一个虚拟调试器( vdb ),它可以调试 VizTracer 的日志文件。可以用 vdb 调试运行中的代码 (与 [pdb][10] 非常相似 ) 以便了解代码流。有用的是,它还支持时间回溯,因为它知道发生的一切。
VizTracer 还包括一个虚拟调试器vdb,它可以调试 VizTracer 的日志文件。可以用 vdb 调试运行中的代码与 [pdb][10] 非常相似以便了解代码流。有用的是,它还支持时间回溯,因为它知道发生的一切。
与一些原型不同VizTracer 使用纯 C 语言实现其核心,这将极大地减少开销,使其达到类似于 [cProfile][11] 的水平。
VizTracer 是开源的,在 Apache 2.0 许可下发布,支持所有常见的操作系统平台(Linux、macOSWindows)。你可以在 [GitHub][2] 上了解关于它的更多特性并访问源代码。
VizTracer 是开源的,在 Apache 2.0 许可下发布,支持所有常见的操作系统平台Linux、macOSWindows。你可以在 [GitHub][2] 上了解关于它的更多特性并访问源代码。
--------------------------------------------------------------------------------
@@ -93,7 +82,7 @@ via: https://opensource.com/article/20/11/python-code-viztracer
作者:[Tian Gao][a]
选题:[lujun9972][b]
译者:[xiao-song-123](https://github.com/xiao-song-123)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,76 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (DevOps Replaces Developers As Most Sought After Skill Set)
[#]: via: (https://www.linux.com/interviews/devops-replaces-developers-as-most-sought-after-skill-set/)
[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/)
DevOps Replaces Developers As Most Sought After Skill Set
======
[_The_ 2020 Open Source Jobs Report][1] _just came out so we took the opportunity to speak with Clyde Seepersad, Senior Vice President and General Manager of Training and Certification at the Linux Foundation, about the significance of the report and the insights it provides on the current open source landscape. He touched on the effects of COVID-19 on hiring trends, the open source skills that are in high demand, and how the Foundation is helping organizations meet this demand through high-quality intensive training. Bottom line, he says “We still dont have enough open source talent. The urgency of finding new ways to bring talent into the market continues to be something that should be front and center for all of us.”_
**Swapnil Bhartiya: What is the importance of this report? Not only for the open source ecosystem, but companies outside of the open source ecosystem, because today almost everybodys leveraging open source in one capacity or another.**
Clyde Seepersad: One of the things that we didnt realize several years ago is that there is a lot of data around general employment reports and a few around IT and technology in general, but there was really this gap when it comes to whats happening on open source talent, and we kept hearing anecdotally that people cant hire or cant find enough talent.
And so what we wanted to do was put a really clear spotlight on whats going on specifically when it comes to the talent pool around open source, to be able to share with the market a sort of non-anecdotal state of the world, but also to be able to inform our own strategy and our own mission, which is to try to ensure not just that there is fantastic code coming out of open source projects, but also that there is enough talent to implement and use it as tool.
**Swapnil Bhartiya: What are some of the key highlights of this report?**
Clyde Seepersad: A couple of things. One is the rise of DevOps skills. I think everybody knows cloud is hot. Its been that way for a while, but the companion piece to that around DevOps and the importance of understanding CI/CD pipelines and also the cultural difference of working in that sort of continuous delivery. The rise of that, I think, is something that maybe most people are not quite as aware of.
The second thing I would highlight is that there were a lot of questions about whats happening to tech hiring in response to the COVID pandemic. We have some answers for that, that says that although hiring slowed down, it did not slow down nearly as much as people might have worried at the outset. In fact, its now accelerating.
The top-level thing, which is continuing to be the case, is we still dont have enough open-source talent. The urgency of finding new ways to bring talent into the market continues to be something that should be front and center for all of us.
**Swapnil Bhartiya: So if we look at this report, what are the skills that are kind of not only most in demand, but also hardest to find? That is like a chicken-and-egg solution, right?**
Clyde Seepersad: Yeah. Obviously, its the cloud skills, right? A lot of the smaller companies, more conservative companies, they kind of make us push them to be much more active on the cloud. What thats done is raise the stakes in terms of people who are familiar with cloud-native development, cloud-native architecture, Kubernetes orchestration, and then what does CI/CD pipelines look like in a cloud world because obviously, theres some changes there when youre running that sort of infrastructure. So those interwoven skillsets, right?
Of course, sitting underneath all of that is what operating system does the cloud run on? I think we all know now that the vast, fast 98% of instances are running on Linux. So you have this tiered approach where understanding from basic Linux competence is a baseline and then youre building on top of that, looking for cloud-native development, cloud-native orchestration, and then what the CI/CD pipelines look like to bring that to life.
**Swapnil Bhartiya: So when we look at this shortage of talent and, at the same time, the demand for talent, in addition to just coming out with this report, do you have any kind of advice or suggestion to the hiring managers? What can they do to attract top developers or talent to their organizations because there is heavy demand and everybody wants them?**
Clyde Seepersad: Right. Well, some of the things actually have happened in response to the pandemic, right? One of the trends we saw last year was people wanting the flexibility to be able to work from home. Of course, now we all work from home so that helps. But what came out in the report that was really interesting is that more and more talent managers are realizing that you dont just have to go externally for talent, that you can, in fact, upskill people who are currently in your organization.
The data suggests that a lot more people are waking up and realizing that trolling LinkedIn for your next hire is a zero-sum game because other people are doing the same. Theyre starting to invest more in training, especially online training. Theyre starting to invest more in certifications for their employees. And just in general, theyre starting to be much more proactive in looking at investing into their talent pool and finding ways to provide new opportunities for development. Of course, that also comes with new job opportunities for the existing employee base.
**Swapnil Bhartiya: I just want to talk a little bit more about COVID-19. A couple of things are happening with COVID-19: a lot of companies that are scaling down. Theyre cutting budgets and everything. At the same time, since people are able to work remotely, you dont have to relocate yourself or you dont have to find talent in the same area. You have access to almost everybody wherever they are. So how has COVID-19 affected the hiring process itself in terms of while they do have to scale down to some extent, the beauty is, I should not say that, the world that we are living in is all powered by cloud and technology. All the purchases that I was making even in my Indian grocery, they now have a website. I can just go and place an order. It was not the case earlier. So, cloud actually enabled companies to stay in business. That also means that you do need developers and all those talents to keep those businesses running. At the same time, you have the advantage of not having to relocate. So talk a bit about it.**
Clyde Seepersad: Yeah, thats true. I dont think thats tied together, right? So as people have been forced to use the cloud more, I had the same experience you did. My local Chinese restaurant suddenly developed a website and they have an ordering business that they did not previously have. Every business is now an e-commerce business is true, right? So theres this broader footprint.
On the flip side of it, you also have people who are now having to work from home, where they maybe didnt use to, either for practical or maybe cultural reasons within the company. That also then intersects with the sort of cultural change and the cultural norms of CI/CD and DevOps, right? This idea that you have to be in person together versus this idea that you have a well-documented pipeline and everybody can contribute to that pipeline and do their commits and do their code, that whole tooling ecosystem of cloud native and DevOps has actually made it, made it easier—and I would argue, possible—to do whats happened and what weve seen over the past several months, which is people being productive, working from home, working with people they havent worked with before, onboarding new team members, and being able to get them provisioned with the right access and up skill on the right systems. Its all really come together. In my view, we have been lucky that weve got the technology infrastructure that we have today because I dont know that we would have been able to stay as productive and focused in a sudden shift to remote work if we were trying to do this even five years ago,
**Swapnil Bhartiya: Im a good example of that because I have been working from home ever since I moved out of India. What I realized was that I work when I feel that Im most productive instead of hey, I have to clock in at 9:00 AM and I have to clock out at 5:00 PM. I have to sit there and do something. It doesnt matter how I feel. And then sometimes, there are personal issues. Somebody is sick in the family and your mind is there, but you have to come to the office. I think remote working offers the best balance between work and life. Of course, it is actually more challenging because you may end up working all the time, but still, it offers a better balance. Earlier you were talking about how you dont have to go out to hire people; you can also internally train people. So when we look at organizations and they look at all these new cloud-native technologies and they want to retain or prepare their own workforce, what resources are available there, especially from the Linux Foundation so that they can better equip their own workforce when there is already a shortage of a lot of talent?**
Clyde Seepersad: Yeah, its a good question, Swapnil. From a practical perspective, the portfolio that we have provided, which is very heavily focused on self-paced e-learning that you take online, but at the same time, very skills-based, very lab-intensive online training, because ultimately, what do you care about as a colleague or as a hiring manager? Its not whether they check the box and they have a certificate saying they completed a course. What you care about is the skills, right? Did they actually develop those skills? So, weve got a pretty big portfolio of very hands-on, self-paced e-learning programs to help people develop the skills. And then weve continued to build our portfolio of performance-based certification exams. So this is not your grandads pick an answer out of a lineup, right? These are live systems with variable questions, and you have to demonstrate your skills under the pressure of time, under the pressure of being proctored by an independent person. I think its that one-two punch of really focusing on skills.
I joke with people all the time. We get feedback sometimes that our courses arent dont have enough video. And I say, “Well, true, because were not trying to entertain you. Were trying to develop skills and the way you develop skills is not by staring at a screen and listening to a video. The way you develop skills is by doing a lab.” So weve got a very lab-centric mindset in terms of the training side of it and that carries on into the certification side of it, where its all about performance. Show that you can do the work, take the time to develop the skills because thats what your colleagues are going to be looking for. Thats what your employers are going to be looking for. Thats whats going to benefit you personally, as an individual — to be able to have that broader skill set and to be able to do that in a remote way and not have to rely on a senior trainer coming onto site and working with you. I think thats going to be the new normal.
**Swapnil Bhartiya: The advantage of this crisis is that people are realizing that they dont have to move. Actually, they can move to the ideal pace they wanted to live. It could be a big ranch, it could be a beach, and they can work for companies who are operating in Silicon Valley, which also means you can also cross national boundaries. The whole idea of hope is open source is the best and the brightest people from around the globe. So how do you enable these people? People come from different cultural backgrounds, different education backgrounds, and different languages. Do you also help them irrespective of where theyre coming from, whether its internationalizing or supporting different languages so people can get training?**
Clyde Seepersad: Yeah. Our LS training, we do that. Obviously, the online format helps because its truly available 24/7 globally, nights and weekends. So that really has expanded the footprint of what were able to do and who we are able to reach. Weve also done some translations, particularly for the certification exams to make those available in languages that we know folks may not otherwise be comfortable with, for Japan and China, for instance.
What were trying to do is mirror what were seeing in the workforce. The shift towards more remote work has actually opened up the pipeline. When you think about hiring and talent management, if you think about somebody who is in the US or in Western Europe, your pool is not as limited. You really can reach out to this global pool of talent in non-traditional markets. Weve seen sectors get hot. Obviously, India has a lot of workshops today. Theres a ton of stuff happening in Eastern Europe now, but it really is global, right? Weve got folks on our team in South America being super productive in this new remote way of working. I think thats becoming more and more typical. Because of the rise of cloud native, because of the rise of Cloud Native, because of the rise of this sort of collaborative DevOps mindset, we are able to collaborate across regions, across countries, across time zones, much more effectively than they ever have before.
**Swapnil Bhartiya: Awesome. Clyde, thank you so much for talking to me today about not only this report, but also how to help hiring managers not only get more talent, but also not retrain their own employees. I look forward to talking to you again. Thank you.**
Clyde Seepersad: Hey, its always a pleasure to be with you, Swap. Thank you.
--------------------------------------------------------------------------------
via: https://www.linux.com/interviews/devops-replaces-developers-as-most-sought-after-skill-set/
作者:[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.prnewswire.com/news-releases/2020-open-source-jobs-report-reveals-spike-in-demand-for-devops-talent-continued-dearth-of-open-source-skills-301159394.html#:~:text=The%202020%20Open%20Source%20Jobs%20Report%20examines%20trends,and%20how%20employers%20attract%20and%20retain%20qualified%20talent.

View File

@@ -0,0 +1,105 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why I use Home Assistant for open source home automation)
[#]: via: (https://opensource.com/article/20/11/home-assistant)
[#]: author: (Steve Ovens https://opensource.com/users/stratusss)
Why I use Home Assistant for open source home automation
======
Home automation can be a slippery slope. The right open source tools can
get you on firmer footing.
![Houses in a row][1]
Home automation is a slippery slope; you have been warned! In this multipart series, I will discuss home automation using the open source project Home Assistant. This introductory article will cover my journey to [Home Assistant][2], what the application does, and why it's important.
### How my journey began
Some time ago, when I set out on this journey, my goal was not lofty. I was solving a need. You see, I have a fairly sizable [homelab][3]. Nothing on the scale of some notable YouTubers, but I have eight machines ranging from 16GB RAM all the way up to 96GB. I have a Netgear 10G Ethernet switch as the backbone of my networking infrastructure. However, I have a small problem. Every once in a while, this switch's state table fills up, and then it crashes, taking the network with it. This is a known issue with this model (although it was not known to me ahead of time). The only way to resolve the issue, without replacing the switch, is to power it off for a few seconds and then power it back on.
This would not seem like a big deal. Especially because I live in an apartment, so I don't even have to travel up or down a flight of stairs to do this. However, I work for Red Hat as a senior OpenShift consultant, which means I am often on the road (at least pre-COVID). I use my lab almost every day for work-related activities, and my family uses the network as well for things like playing games, watching our Blu-ray collection, etc. So, it's a giant pain to have the network go down when I don't have physical access. My solution was to get a smart plug and join it to a completely different network with nothing else on it, completely firewalled off from other equipment. If the Netgear switch needs to be rebooted, I should be able to access the smart plug remotely to reboot the switch.
### My journey away from the cloud
Being privacy-conscious, perhaps bordering on the tinfoil hat breed, I am immediately uncomfortable with a "cloud"-connected anything. We run [Plex][4], [Kodi][5], [Nextcloud][6], and a host of other services because, well, I am "that guy." But I'm not "anti-cloud." In fact, a large part of my day job is working with the big three: AWS, Google Compute, and Azure. But when it comes to standing up services that I rely on, I have an almost irrational need to host things locally.
After doing a significant amount of digging and speaking to my coworker Alex Kretzschmar (who also hosts the [Self-Hosted][7] podcast), I discovered alternative firmware projects, such as [Tasmota][8] and [ESPHome][9], available for certain wireless chipsets. I'll cover the different chipsets and protocols (Zigbee, WiFi, Z-Wave, and the like) in a future article, but suffice it to say, you are not stuck buying products that are dependent on the cloud. There are online stores such as [CloudFree][10] that sell devices pre-flashed with Tasmota. There are even companies like [Shelly][11] that produce high-quality products with an optional cloud component, but the buyer maintains local control.
Anyway, back to my story. I bought a plug, flashed the firmware to run Tasmota, and remotely power-cycled my switch on occasion, and that was the end of it, right? Well, if it was, I imagine I would not be writing this article. I currently have 43 Internet of Things (IoT) devices—from sensors I built to smart bulbs, smart LED strips, infrared blasters, and more. Remember how I said home automation is a slippery slope?
Did I mention that I have had virtually no experience with soldering, electronic theory/repairs, or anything remotely related to home automation? In fact, outside of Linux and related technology, I am one of the least "handy" people I know. Sure, I can punch a hole in a wall or put some screws in a board, but up to the age of 30, the only tools that I ever owned were a Dremel and some screwdrivers for installing computer components.
Why mention this? So you understand exactly how far behind square one I was when I started. If I can take this on, so can you!
### Centralized local control
Great, I have a ton of IoT devices, and I can toggle things on and off from a phone. For a while, I was satisfied with simply calling up the Tasmota web UI and using its sparse but functional controls.
![Tasmota user interface][12]
(Steve Ovens, [CC BY-SA 4.0][13])
Even my wife, God bless her willingness and patience while I constantly learned and attempted new things, got used to using the Tasmota interface. After a while, as the number of devices grew, this method of managing things became untenable and did not scale well at all.
I began to poke around to learn how other people were managing their "smart homes." Let's be honest; at this point, it wasn't a smart home as much as a small but growing number of lights we could remotely control.
The big open source projects in this area are [openHAB][14] and [Home Assistant][15]. This series won't compare them in any manner. Partly, it's because I am not qualified for this, as I have only been using Home Assistant for the last year or so, but also because for me to feel comfortable making such a comparison, I would have to set up openHAB as a drop-in replacement and, frankly, I have too much invested in Home Assistant to explore this avenue.
### About Home Assistant
You may be wondering what Home Assistant is and what it has to offer. Imagine a house that reacts to its inhabitants, like in sci-fi movies. Perhaps you have a couple of bedside lamps, a TV, some floor lighting, a fan, and a few other gizmos in your bedroom. As you walk into the bedroom, the lights turn on. Big deal, you say; we have had this technology for some time. Of course, you are right. But what if it's late and your significant other is already in bed? You might be in for a rather cold greeting if the lights come on as you enter the bedroom. Yikes!
What if, instead, when you walk into the room at night, the floor LED lights turn on to a soft glow—enough so that you can move around without killing yourself but not bright enough to wake a sleeping partner. You climb into bed, and a few minutes later, the floor lighting turns off. This is what Home Assistant can do for you.
"But wait!" I hear you screaming at your monitor. "I can just ask Alexa or Google to turn off my lights for me." You're correct again, of course. However, what happens when these services suffer some sort of disruption? Also, you may need to consider how loudly you need to speak to trigger the listening device. And remember that thing I said about privacy? Do you really want these big companies to learn your habits? Even discarding the privacy issue, consider that others may use your home as well. This means visitors need to know what commands you have available for controlling your smart devices.
Lots of "smart" products on the market can set timers, schedules, and scenes, but none of them can really _react_ to any given situation. This is where a home automation hub like Home Assistant comes into play.
At its core, Home Assistant is software that helps centralize all of the sensors, gizmos, and gadgets you have in your home. With all of these products working together in concert, you can set all kinds of conditions that would not otherwise be possible.
Has someone entered the room? Is it a certain time of the day? Is the room warmer than a certain value? Is someone in bed? All of these data points are of limited use on their own, but together, you can use them to set the brightness of a light at dusk, turn a fan on because it's above 26ºC (80ºF) in the room, but don't turn on Steve's desk lamp because his side of the bed is occupied.
If you can imagine it, you can accomplish it using Home Assistant and the right sensor inputs.
### Sustainable and open source
One thing I like about Home Assistant is that it seems to be reaching a critical mass of adoption from various vendors. But more important to me is that the company behind it, [Nabu Casa][16], creates a focal point for the community. The company hired developers directly from the community, and it does not penalize you if you don't pay a monthly fee. The revenue Nabu Casa generates comes from value-added items, like being able to access your local Home Assistant easily and from anywhere in the world.
This is important because it means that there is a path forward for the project, and it has a sustainable income for future development. Unlike "open core" models, Home Assistant is fully open source, which means that if the community disagrees strongly enough with Nabu Casa's direction, it could fork Home Assistant at its current state and take a divergent path. Because my family has chosen to make this piece of software integral to how we interact with our devices, that Home Assistant has a revenue stream and is fully open source are invaluable to me.
In the next article, I will discuss some of the common standards for IoT devices as well as the benefits of local control. Future articles will walk through the basics of installing Home Assistant, setting up essential add-ons (e.g., MQTT), Node-RED, the Community Store, making backups, and more.
In the meantime, comment or [tweet][17] at me if you would like to explore something specific in-depth. If I have used it, I can talk about it.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/home-assistant
作者:[Steve Ovens][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/stratusss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row)
[2]: https://www.home-assistant.io/
[3]: https://opensource.com/article/19/3/home-lab
[4]: https://www.plex.tv/
[5]: https://opensource.com/article/19/1/manage-your-media-kodi
[6]: https://nextcloud.com/
[7]: https://selfhosted.show/
[8]: https://tasmota.github.io/docs/
[9]: https://esphome.io/
[10]: https://cloudfree.shop/
[11]: https://shelly.cloud/
[12]: https://opensource.com/sites/default/files/uploads/tasmota_ui.png (Tasmota user interface)
[13]: https://creativecommons.org/licenses/by-sa/4.0/
[14]: https://www.openhab.org/
[15]: https://opensource.com/article/18/3/smart-home-assistant
[16]: https://www.nabucasa.com/
[17]: https://twitter.com/linuxovens

View File

@@ -0,0 +1,146 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Improve open source community sustainability by tracking these two metrics)
[#]: via: (https://opensource.com/article/20/11/open-source-community-sustainability)
[#]: author: (Kevin Xu https://opensource.com/users/kevin-xu)
Improve open source community sustainability by tracking these two metrics
======
Focusing on metrics around community ownership and incentives can
increase your odds of building a sustainable open source project.
![Person using a laptop][1]
In early 2020, I wrote an article on [three metrics][2] for tracking and measuring offline, in-person community-building activities. Little did I (or the world) know then that offline, in-person activities of any kind would soon become unfeasible for the foreseeable future.
So, I started thinking: With open source projects being online by default, and with everything else moving online and virtual, what should creators of open source technologies measure as we continue in this COVID and (hopefully soon) post-COVID world?
There are plenty of metrics you _can_ track—stars, forks, pull requests (PRs), merge requests (MRs), contributor counts, etc.—_but more data doesn't necessarily mean clearer insights_. I've previously shared my skepticism about the value of these [surface-level metrics][3], especially when assessing an open source project's health and sustainability.
In this article, I propose two second-order metrics to track, measure, and continually optimize to build a strong, self-sustaining open source community:
* Breakdowns of PR or MR reviewers
* Leaderboards of different community interactions
### Why these metrics?
The long-term goal of any open source community-building effort is to reach a tipping point where the project can live beyond the initial creators' or maintainers' day-to-day involvement. It's an especially important goal if you also are building a commericial open source software (COSS) company around that open source technology, whether it's bootstrapped or venture capital-backed. Your company will eventually have to divert resources and people power to build commercial services or paid features.
It's a lofty goal that few projects achieve. Meanwhile, maintainer burnout is a real problem. The latest and most high-profile example is Redis creator Salvatore Sanfilippo, who shared his [struggles as an open source maintainer][4] last year and [bowed out as CEO][5] of Redis Labs earlier this year. Maintainers of various projects, big or small, struggle through similar challenges every day.
Focusing on the two metrics above, especially early in your open source journey, can increase your odds of building something sustainable because they illuminate two important elements that drive sustainability: **ownership** and **incentive**.
#### Breaking down PR/MR reviewers = Ownership
Tracking who in your community is actively reviewing contributions is a good indicator of ownership. In the beginning, you, the creator, do the bulk of reviewing, but this will be unsustainable over time. Being intentional about building your community so that more people have the _contextual knowledge, confidence, and welcoming attitude_ to review incoming PRs/MRs (which should increase in frequency as your project gains traction) is crucial to long-term sustainability.
There's a customer service-like element to reviewing contributions, which can deteriorate if not enough people feel ownership to do it. And one of the worst signals you can give to an otherwise enthusiastic newcomer is a PR or MR left unattended for two or more weeks.
#### Community interaction leaderboards = Incentive
Tracking a few community-facing interactions and possibly gamifying them within your community with rewards can help drive the right incentives and behaviors among community members with all levels of experience. Some of the interactions you can track are the number of PRs/MRs filed, comments, reactions, and reviews (which has some overlap with reactions). These interactions may have different values and quality, but the bigger goal here is _to understand who's doing what, who's good at doing what_, and intentionally _foster more behaviors based on people's strengths and interests_.
Perhaps some people are great at providing helpful comments but don't have enough context (yet) to review a PR/MR. It would be good to identify who they are and provide them with more info so that they can become a reviewer one day. Perhaps some people are super-engaged with monitoring the project, as shown by their frequent reactions, but don't feel comfortable chiming in with comments and suggestions. It would be good to know who they are and help them gain more context into the project's inner workings, so they can add more value to a community they clearly care about. 
### How to use the metrics
So how can you track and read into these metrics? I'll illustrate with an example comparing two open source projects: [Kong][6], an API gateway, and [Apache Pulsar][7], a pub-sub messaging system.
In May 2020, I used [Apache Superset][8], an open source data visualization tool, along with a tutorial written by [Max Beauchemin][9], one of the project's creators, to crawl and visualize some data from Kong, Apache Pulsar, and [a few other projects][10]. Using [the tutorial][11], I crawled two years' worth of data (from May 2018 to May 2020) to see changes over time. (Note: The tutorial is an example of Superset's own data with some hard-coded linkage to its history inside Airbnb and Lyft, so to use it, you will need to do some customization of the dashboard JSON to make it work more generally.)
Two caveats: First, the data was last gathered in May, so it will surely look different today. Second, the projects were open sourced at different times, and this comparison is not a judgment on the current state or potential of either project. (Kong's first commit was in November 2014, and Pulsar's was in September 2016. Of course, both were worked on in private before being open sourced.) Some of the differences you see may simply be due to the passage of time and community effort paying off at different times; _community building is a long, persistent slog_.
#### PR reviewer metrics
The following two charts show Kong and Pulsar's PR reviews by GitHub handle:
![Kong PR reviews by GitHub handle][12]
Kong's PR reviews by GitHub handle (COSS Media, ©2020)
![Pulsar's PR reviews by GitHub handle][13]
Pulsar's PR reviews by GitHub handle (COSS Media, ©2020)
Based on this data, I observe that Kong has a better balance of people reviewing PRs than Pulsar has. That balance was achieved over time as the Kong project grew in maturity. The most important thing to note is that neither of Kong's creators, [Aghi][14] nor [Marco][15], is anywhere close to being the top reviewers. _That's a good thing!_ They certainly were during the early days, but their involvement became less visible as the project matured, as it should.
As a younger project, Pulsar isn't at the same level yet but is on its way to achieving that balance. [Sijie][16], [Jia][17], and [Penghui][18] are doing the bulk of the reviewing for now; all three are project management committee members and lead SteamNative, Pulsar's COSS company. Other major players, including Splunk (especially after it [acquired][19] Streamlio), also contribute to the project, which is a good leading indicator of eventually achieving balance.
One factor I'm intentionally glossing over is the difference in the governance process of an Apache Software Foundation project and a non-ASF project, which would impact the speed and procedure for a contributor to become a reviewer or maintainer. In that regard, this comparison is not 100% apples-to-apples.
#### Community interaction metrics
Following are two leaderboard charts showing Kong and Pulsar's community interactions by GitHub handle in the 90 days since the most recent data gathered (roughly from March to May 2020):
![Kong's 90-day leaderboard chart][20]
Kong's 90-day leaderboard chart (COSS Media, ©2020)
![Pulsar's 90-day leaderboard chart][21]
Pulsar's 90-day leaderboard chart (COSS Media, ©2020)
These leaderboards reflect the same "level of balance" shown in the previous chart, which makes sense. The more interesting takeaway is who is doing what kind of interaction, how much _interacting_ is happening, and who seems to be doing it all (Sijie!).
As far as building the right incentive structure, this leaderboard-type view can help you get a sense of where interactions are coming from and what sort of reward or motivational system you want to design to accelerate positive behaviors.
This data is also useful for internal management _and_ external community building. As close watchers can tell, many of the leaders on these charts are employees of the projects' COSS companies, Kong Inc. and StreamNative. It's quite common for active community contributors (or enthusiasts) to become employees of the company commercializing the project. Regardless of where these folks are employed, to foster a sustainable project beyond its initial creators (which in turn would influence the sustainability of the COSS company), you would need to measure, track, and incentivize the same behaviors.
Also, I'm aware that the Pulsar chart does not have a "reactions" column, which could either be because there wasn't much reaction data to merit a top-10 entry or due to my own faulty configuration of the chart. I apologize for this inconsistency.
### Tips on driving balanced sustainability
No matter how pretty the charts are, data doesn't tell the whole story. And no matter how successful a particular project is, its experience should not be templatized and applied directly to a different project. That said, I'd like to share a few actionable tips I've seen work in the wild that can help you improve these two metrics over time:
* **Provide high-quality documentation:** In a previous article, I focused on [documentation][22], and I encourage you to give it a read. The most important point is: a project's documentation gets the most amount of traffic. It's the place where people decide whether to continue learning about your project or move on. _You never want to give people a reason to move on_. Generally, I recommend spending 10% to 20% of your time writing documentation. Putting it in context: if you are working on your project full-time, it's about half a day to one full day per week.
* **Make your contributor guide a living document:** Every project has a CONTRIBUTING.MD document (or a variation of it). But projects that grow and mature make that document the best it can be and continually refresh, update, and refine it. Why? Because that's where people who are enthusiastic about participating in the project go. If the guide is clear, succinct, and actionable, you'll get contributions in no time. If it's outdated, convoluted, and lacks an easy onramp (e.g., beginner issues, simple bugs, etc.), then that enthusiasm will go somewhere else. _Make your CONTRIBUTING.MD a killer feature_.
* **Set clear quality guidelines:** There _is_ such a thing as a "noisy contribution"—low-quality PRs/MRs that require more energy than it's worth to review (and oftentimes reject). However, the responsibility of communicating to the public what is and is not a "quality contribution" is on you, the creator or maintainer, because you have the most context and institutional knowledge about the project, by far. _Make your expectations clear, and don't compromise on quality._ Make it a prominent section of your CONTRIBUTING.MD or a separate document to give it more visibility. Combine it with your project's roadmap, which should be part of your public documentation anyway, so your new contributors know what's expected of them and why.
I hope this provides some useful insight into the two second-order metrics that matter when building a sustainable open source community and some actionable items you can use to track and improve them.
* * *
_This article originally appeared on_ _[COSS Media][23]_ _and is republished with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/open-source-community-sustainability
作者:[Kevin Xu][a]
选题:[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/kevin-xu
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
[2]: https://opensource.com/article/20/3/community-metrics
[3]: https://softwareengineeringdaily.com/2019/04/04/project-health-assessing-open-source-projects-with-more-context/
[4]: http://antirez.com/news/129
[5]: http://antirez.com/news/133
[6]: https://github.com/Kong/kong
[7]: https://github.com/apache/pulsar
[8]: https://superset.apache.org/
[9]: https://github.com/mistercrunch
[10]: https://twitter.com/kevinsxu/status/1275072801511059456
[11]: https://preset.io/blog/2020-04-15-github-community-dashboard/
[12]: https://opensource.com/sites/default/files/uploads/kongpr-reviews.jpg (Kong PR reviews by GitHub handle)
[13]: https://opensource.com/sites/default/files/uploads/pulsarpr-reviews.jpg (Pulsar's PR reviews by GitHub handle)
[14]: https://github.com/sonicaghi
[15]: https://github.com/subnetmarco
[16]: https://github.com/sijie
[17]: https://github.com/jiazhai
[18]: https://github.com/codelipenghui
[19]: https://www.splunk.com/en_us/blog/leadership/splunk-to-expand-streaming-expertise-announces-intent-to-acquire-streamlio-open-source-distributed-messaging-leader.html
[20]: https://opensource.com/sites/default/files/uploads/kong_leaderboard.jpg (Kong's 90-day leaderboard chart)
[21]: https://opensource.com/sites/default/files/uploads/pulsarleaderboard.jpg (Pulsar's 90-day leaderboard chart)
[22]: https://opensource.com/article/20/3/documentation
[23]: https://coss.media/2-things-to-measure-and-improve-open-source-community-sustainability/

View File

@@ -1,199 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (xiao-song-123)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (5 steps to learn any programming language)
[#]: via: (https://opensource.com/article/20/10/learn-any-programming-language)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
5 steps to learn any programming language
======
With just a little programming experience, you can learn a new language
in just a few days (sometimes less).
![Learning to program][1]
Some people love learning new programming languages. Other people can't imagine having to learn even one. In this article, I'm going to show you how to think like a coder so that you can confidently learn any programming language you want.
The truth is, once you've learned how to program, the language you use becomes less of a hurdle and more of a formality. In fact, that's just one of the many reasons educators say to [teach kids to code early][2]. Regardless of how simple their introductory language may be, the logic remains the same across everything else children (or adult learners) are likely to encounter later.
With just a little programming experience, which you can gain from any one of several introductory articles here on Opensource.com, you can go on to learn _any_ programming language in just a few days (sometimes less). Now, this isn't magic, and you do have to put some effort into it. And admittedly, it takes a lot longer than just a few days to learn every library available to a language or to learn the nuances of packaging your code for delivery. But getting started is easier than you might think, and the rest comes naturally with practice.
When experienced programmers sit down to learn a new language, they're looking for five things. Once you know those five things, you're ready to start coding.
### 1\. Syntax
![Syntax][3]
(Seth Kenlon, [CC BY-SA 4.0][4])
The syntax of a language describes the structure of code. This encompasses both how the code is written on a line-by-line basis as well as the actual words used to construct code statements.
[Python][5], for instance, is known for using indentation to indicate where one block ends and another one starts:
```
while j &lt; rows:
    while k &lt; columns:
        tile = Tile(k * w)
        board.add(tile)
        k += 1
    j += 1
    k = 0
```
[Lua][6] just uses the keyword `end`:
```
for i,obj in ipairs(hit) do
  if obj.moving == 1 then
     obj.x,obj.y = v.mouse.getPosition()
  end
end
```
[Java][7], [C][8], C++, and similar languages use braces:
```
while (std::getline(e,r)) {
  wc++;
  }
```
A language's syntax also involves things like including libraries, setting variables, and terminating lines. With practice, you'll learn to recognize syntactical requirements (and conventions) almost subliminally as you read sample code.
#### Take action
When learning a new programming language, strive to understand its syntax. You don't have to memorize it, just know where to look, should you forget. It also helps to use a good [IDE][9], because many of them alert you of syntax errors as they occur.
### 2\. Built-ins and conditionals
![built-in words][10]
(Seth Kenlon, [CC BY-SA 4.0][4])
A programming language, just like a natural language, has a finite number of words it recognizes as valid. This vocabulary can be expanded with additional libraries, but the core language knows a specific set of keywords. Most languages don't have as many keywords as you probably think. Even in a very low-level language like C, there are only 32 words, such as `for`, `do`, `while`, `int`, `float`, `char`, `break`, and so on.
Knowing these keywords gives you the ability to write basic expressions, the building blocks of a program. Many of the built-in words help you construct conditional statements, which influence the flow of your program. For instance, if you want to write a program that lets you click and drag an icon, then your code must detect when the user's mouse cursor is positioned over an icon. The code that causes the mouse to grab the icon must execute only _if_ the mouse cursor is within the same coordinates as the icon's outer edges. That's a classic if/then statement, but different languages can express that differently.
Python uses a combination of `if`, `elif`, and `else` but doesn't explicitly close the statement:
```
if var == 1:
    # action
elif var == 2:
    # some action
else:
    # some other action
```
[Bash][11] uses `if`, `elif`, `else`, and uses `fi` to end the statement:
```
if [ "$var" = "foo" ]; then
   # action
elif [ "$var" = "bar" ]; then
   # some action
else
   # some other action
fi
```
C and Java, however, use `if`, `else`, and `else if`, enclosed by braces:
```
if (boolean) {
   // action
} else if (boolean) {
   // some action
} else {
   // some other action
}
```
While there are small variations in word choice and syntax, the basics are always the same. Learn the ways to define conditions in the programming language you're learning, including `if/then`, `do...while`, and `case` statements.
#### Take action
Get familiar with the core set of keywords a programming language understands. In practice, your code will contain more than just a language's core words, because there are almost certainly libraries containing lots of simple functions to help you do things like print output to the screen or display a window. The logic that drives those libraries, however, starts with a language's built-in keywords.
### 3\. Data types
![Data types][12]
(Seth Kenlon, [CC BY-SA 4.0][4])
Code deals with data, so you must learn how a programming language recognizes different kinds of data. All languages understand integers and most understand decimals and individual characters (a, b, c, and so on). These are often denoted as `int`, `float` and `double`, and `char`, but of course, the language's built-in vocabulary informs you of how to refer to these entities.
Sometimes a language has extra data types built into it, and other times complex data types are enabled with libraries. For instance, Python recognizes a string of characters with the keyword `str`, but C code must include the `string.h` header file for string features.
#### Take action
Libraries can unlock all manner of data types for your code, but learning the basic ones included with a language is a sensible starting point.
### 4\. Operators and parsers
![Operators][13]
(Seth Kenlon, [CC BY-SA 4.0][4])
Once you understand the types of data a programming language deals in, you can learn how to analyze that data. Luckily, the discipline of mathematics is pretty stable, so math operators are often the same (or at least very similar) across many languages. For instance, adding two integers is usually done with a `+` symbol, and testing whether one integer is greater than another is usually done with the `>` symbol. Testing for equality is usually done with `==` (yes, that's two equal symbols, because a single equal symbol is usually reserved to _set_ a value).
There are notable exceptions to the obvious in languages like Lisp and Bash, but as with everything else, it's just a matter of mental transliteration. Once you know _how_ the expression is different, it's trivial for you to adapt. A quick review of a language's math operators is usually enough to get a feel for how math is done.
You also need to know how to compare and operate on non-numerical data, such as characters and strings. These are often done with a language's core libraries. For instance, Python features the `split()` method, while C requires `string.h` to provide the `strtok()` function.
#### Take action
Learn the basic functions and keywords for manipulating basic data types, and look for core libraries that help you accomplish complex actions.
### 5\. Functions
![Class][14]
(Seth Kenlon, [CC BY-SA 4.0][4])
Code usually isn't just a to-do list for a computer. Typically when you write code, you're looking to present a computer with a set of theoretical conditions and a set of instructions for actions that must be taken when each condition is met. While flow control with conditional statements and math and logic operators can do a lot, code is a lot more efficient once functions and classes are introduced because they let you define subroutines. For instance, should an application require a confirmation dialogue box very frequently, it's a lot easier to write that box _once_ as an instance of a class rather than re-writing it each time you need it to appear throughout your code.
You need to learn how classes and functions are defined in the programming language you're learning. More precisely, first, you need to learn whether classes and functions are available in the programming language. Most modern languages do support functions, but classes are specialized constructs common to object-oriented languages.
#### Take action
Learn the constructs available in a language that help you write and use code efficiently.
### You can learn anything
Learning a programming language is, in itself, a sort of subroutine of the coding process. Once you understand the theory behind how code works, the language you use is just a medium for delivering logic. The process of learning a new language is almost always the same: learn syntax through simple exercises, learn vocabulary so you can build up to performing complex actions, and then practice, practice, practice.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/learn-any-programming-language
作者:[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/learn-programming-code-keyboard.png?itok=xaLyptT4 (Learning to program)
[2]: https://opensource.com/article/20/9/scratch
[3]: https://opensource.com/sites/default/files/uploads/syntax_0.png (Syntax)
[4]: https://creativecommons.org/licenses/by-sa/4.0/
[5]: https://opensource.com/downloads/cheat-sheet-python-37-beginners
[6]: https://opensource.com/article/20/2/lua-cheat-sheet
[7]: https://opensource.com/downloads/java-cheat-sheet
[8]: https://opensource.com/downloads/c-programming-cheat-sheet
[9]: https://opensource.com/resources/what-ide
[10]: https://opensource.com/sites/default/files/uploads/builtin.png (built-in words)
[11]: https://opensource.com/downloads/bash-cheat-sheet
[12]: https://opensource.com/sites/default/files/uploads/type.png (Data types)
[13]: https://opensource.com/sites/default/files/uploads/operator.png (Operators)
[14]: https://opensource.com/sites/default/files/uploads/class.png (Class)

View File

@@ -1,125 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (KDE Neon vs Kubuntu: Whats the Difference Between the Two KDE Distribution?)
[#]: via: (https://itsfoss.com/kde-neon-vs-kubuntu/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
KDE Neon vs Kubuntu: Whats the Difference Between the Two KDE Distribution?
======
When you find two Linux distributions based on [Ubuntu][1] and powered up by [KDE][2], which one do you choose?
* [Kubuntu][3] is the official KDE flavor from Ubuntu.
* [KDE Neon][4] is the Ubuntu-based distribution by KDE itself.
I know it is often confusing especially if you have never used either of them but got them as recommendations for usage. Hence, to help you make a decision, I thought of compiling a list of differences (and similarities) between KDE Neon and Kubuntu.
Lets start with getting to know the similarities and then proceed with the differences.
**Note:** _Depending on your system, your experience with the distributions might differ. So, take this article as a reference and not a “whats better” comparison._
### KDE Neon vs Kubuntu: Feature wise comparison
![][5]
Its always good to compare distribution based on their similarities. So, theoretically, Ive tried to put down the most important differences.
However, it is worth noting that the compatibility, performance, and the stability of the distros will vary depending on your hardware and hence, that has not been accounted here.
#### Ubuntu as the Base
![][6]
Yes, both the Linux distributions are based on Ubuntu. However, KDE Neon is based only on the latest Ubuntu LTS release while Kubuntu offers an Ubuntu LTS based edition and a non-LTS edition as well.
So, with KDE Neon, you would expect to get your hands on the latest Ubuntu features right after a few months of the next Ubuntu LTS release (2 years). But, with Kubuntu, you have got the option to opt for a non-LTS release and try on the latest Ubuntu releases with 6 months of software updates.
KDE Neon does offer testing editions and developer editions but those are meant to test pre-release KDE software.
#### KDE Plasma Desktop
![][7]
Even though both of the distros feature KDE plasma desktop and you can get the same level of customization, KDE Neon gets the latest KDE Plasma desktop release first.
If you did not know already, KDE Neon is developed by the official KDE team and was announced by Jonathan Riddell (Founder of Kubuntu) after he was [forced out of Kubuntu by Canonical][8].
So, not just limited to the latest Plasma desktop, but if you want the latest and greatest of KDE as soon as possible, KDE Neon is the perfect choice for that.
Kubuntu will eventually get the update for newer KDE software — but it will take time. If youre not too sure about the latest KDE software/desktop and all you need is a stable KDE-powered system, you should go with Kubuntu LTS releases.
#### Pre-installed Software
Out of the box, you will find Kubuntu to have several essential tools and applications pre-installed. But, with KDE Neon, you would need to find and install several applications and tools.
To give you some perspective, KDE Neon might turn out to be a lightweight distro when compared to Kubuntu. However, for new Linux users, they might find Kubuntu as an easy-to-use experience with more essential software and tools pre-installed.
**Recommended Read:**
![][9]
#### [KDE Neon: KDEs Very Own Linux Distribution Provides the Latest and Greatest of KDE With the Simplicity of Ubuntu][10]
#### Software Updates
If you are not using a metered connection, this may not matter at all. But, just for the sake of it, I should mention that KDE Neon gets more software updates considering the regular Ubuntu LTS fixes/updates along with KDE software updates.
With Kubuntu, you just get the Ubuntu LTS updates (unless youre using the non-LTS edition). So, technically, you can expect less number of updates.
#### Ubuntu with KDE vs Plasma Experience
![][11]
I know if you havent tried both of them, you might think of them as pretty similar. But, Kubuntu is an official flavour of Ubuntu that focused more on the experience with Ubuntu on a KDE desktop environment.
While KDE Neon is technically the same thing, but it is all about getting the best-in-class Plasma desktop experience with the latest stuff on board.
Even though both the distributions work amazing out of the box, they have a different vision and the development proceeds on both them accordingly. You just have to decide what you want for yourself and choose one of them.
#### Hardware Compatibility
![Kubuntu Focus Laptop][12]
As I mentioned earlier, this is not a fact-based point here. But, as per my quick look on the feedback or experiences shared by the users online, it seems that Kubuntu works with a wide range of old hardware along with new hardware (potentially dating back to 2012) while KDE Neon may not.
Its just a thing to keep in mind if you try KDE Neon and it doesnt work for some reason. You know what to do.
**Wrapping Up**
So, what would it be? KDE Neon or Kubuntu? Thats really is your choice.
Both are good choices for a [beginner-friendly Linux distribution][13] but if you want the latest KDE Plasma desktop, KDE Neon gets the edge here. You can read more about it in our [review of KDE Neon][10].
Feel free to let me know your thoughts in the comments down below and what do you find good/bad on either of them.
--------------------------------------------------------------------------------
via: https://itsfoss.com/kde-neon-vs-kubuntu/
作者:[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://ubuntu.com/
[2]: https://kde.org/
[3]: https://kubuntu.org
[4]: https://neon.kde.org
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-neon-vs-kubuntu.png?resize=800%2C450&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/install_ubuntu_8.jpg?resize=796%2C611&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-feat.png?resize=800%2C394&ssl=1
[8]: https://lwn.net/Articles/645973/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/kde-neon-review.jpg?fit=800%2C450&ssl=1
[10]: https://itsfoss.com/kde-neon-review/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-kde.jpg?resize=800%2C450&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-focus-laptop.jpg?resize=800%2C600&ssl=1
[13]: https://itsfoss.com/best-linux-beginners/

View File

@@ -0,0 +1,90 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Reclaim hard-drive space with LVM)
[#]: via: (https://fedoramagazine.org/reclaim-hard-drive-space-with-lvm/)
[#]: author: (Troy Curtis Jr https://fedoramagazine.org/author/troycurtisjr/)
Reclaim hard-drive space with LVM
======
![Hard drive image][1]
Photo by Frank R @ Unsplash.com
LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. It is commonly used on Fedora installations (prior to BTRFS as default it was LVM+Ext4). But have you ever started up your system to find out that Gnome just said the home volume is almost out of space! Luckily, there is likely some space sitting around in another volume, unused and ready to re-alocate. Heres how to reclaim hard-drive space with LVM.
The key to easily re-alocate space between volumes is the [Logical Volume Manager (LVM)][2]. Fedora 32 and before use LVM to divide disk space by default. This technology is similar to standard hard-drive partitions, but LVM is a lot more flexible. LVM enables not only flexible volume size management, but also advanced capabilities such as read-write snapshots, striping or mirroring data across multiple drives, using a high-speed drive as a cache for a slower drive, and much more. All of these advanced options can get a bit overwhelming, but resizing a volume is straight-forward.
### LVM basics
The _volume group_ serves as the main container in the LVM system. By default Fedora only defines a single volume group, but there can be as many as needed. Actual hard-drive and hard-drive partitions are added to the _volume group_ as _physical volumes_. _Physical volumes_ add available free space to the _volume group_. A typical Fedora install has one formatted boot partition, and the rest of the drive is a partition configured as an LVM _physical volume_.
Out of this pool of available space, the _volume group_ allocates one or more _logical volumes_. These volumes are similar to hard-drive partitions, but without the limitation of contiguous space on the disk. LVM _logical volumes_ can even span multiple devices! Just like hard-drive partitions, _logical volumes_ have a defined size and can contain any filesystem which can then be mounted to specific directories.
### Whats needed
Confirm the system uses LVM with the _gnome-disks_ application, and make sure there is free space available in some other volume. Without space to reclaim from another volume, this guide isnt useful. A [Fedora live CD/USB][3] is also needed. Any file system that needs to shrink must be unmounted. Running from a live image allows all the volumes on the hard-disk to remain unmounted, even important directories like _/_ and _/home_.
![Use gnome-disks to verify free space][4]
### A word of warning
No data should be lost by following this guide, but it does muck around with some very low-level and powerful commands. One mistake could destroy all data on the hard-drive. So backup all the data on the disk first!
### Resizing LVM volumes
To begin, boot the Fedora live image and select _Try Fedora_ at the dialog. Next, use the _Run Command_ to launch the _blivet-gui_ application (accessible by pressing _Alt-F2_, typing _blivet-gui_, then pressing _enter_). Select the volume group on the left under _LVM_. The logical volumes are on the right.
![Explore logical volumes in blivet-gui][5]
The logical volume labels consist of both the volume group name and the logical volume name. In the example, the volume group is “fedora_localhost-live” and there are “home”, “root”, and “swap” logical volumes allocated. To find the full volume, select each one, click on the _gear_ icon, and choose _resize_. The slider in the resize dialog indicates the allowable sizes for the volume. The minimum value on the left is the space already in use within the file system, so this is the minimum possible volume size (without deleting data). The maximum value on the right is the greatest size the volume can have based on available free space in the _volume group_.
![Resize dialog in blivet-gui][6]
A grayed out _resize_ option means the volume is full and there is no free space in the volume group. Its time to change that! Look through all of the volumes to find one with plenty of extra space, like in the screenshot above. Move the slider to the left to set the new size. Free up enough space to be useful for the full volume, but still leave plenty of space for future data growth. Otherwise, this volume will be the next to fill up.
Click _resize_ and note that a new item appears in the volume listing: _free space_. Now select the full volume that started this whole endeavor, and move the slider all the way to the right. Press _resize_ and marvel at the new improved volume layout. However, nothing has changed on the hard drive yet. Click on the _check-mark_ to commit the changes to disk.
![Review changes in blivet-gui][7]
Review the summary of the changes, and if everything looks right, click _Ok_ to proceed. Wait for _blivet-gui_ to finish. Now reboot back into the main Fedora install and enjoy all the new space in the previously full volume.
### Planning for the future
It is challenging to know how much space any particular volume will need in the future. Instead of immediately allocating all available free space, consider leaving it free in the volume group. In fact, Fedora Server reserves space in the volume group by default. Extending a volume is possible while it is online and in use. No live image or reboot needed. When a volume is almost full, easily extend the volume using part of the available free space and keep working. Unfortunately the default disk manager, _gnome-disks_, does not support LVM volume resizing, so install _[blivet-gui][8]_ for a graphical management tool. Alternately, there is a simple terminal command to extend a volume:
```
lvresize -r -L +1G /dev/fedora_localhost-live/root
```
### Wrap-up
Reclaiming hard-drive space with LVM just scratches the surface of LVM capabilities. Most people, especially on the desktop, probably dont need the more advanced features. However, LVM is there when the need arises, though it can get a bit complex to implement. [BTRFS][9] is the default filesystem, without LVM, starting with [Fedora 33][10]. BTRFS can be easier to manage while still flexible enough for most common usages. Check out the recent [Fedora Magazine articles on BTRFS][11] to learn more.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/reclaim-hard-drive-space-with-lvm/
作者:[Troy Curtis Jr][a]
选题:[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/troycurtisjr/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/11/lvm-resize-816x345.jpg
[2]: http://sourceware.org/lvm2/
[3]: https://getfedora.org/en/workstation/download/
[4]: https://fedoramagazine.org/wp-content/uploads/2020/11/gnome-disks.png
[5]: https://fedoramagazine.org/wp-content/uploads/2020/11/blivet-overview.png
[6]: https://fedoramagazine.org/wp-content/uploads/2020/11/blivet-resize-1024x525.png
[7]: https://fedoramagazine.org/wp-content/uploads/2020/11/blivet-summary-1024x525.png
[8]: https://fedoraproject.org/wiki/Blivet-gui
[9]: https://fedoramagazine.org/btrfs-coming-to-fedora-33/
[10]: https://fedoramagazine.org/whats-new-fedora-33-workstation/
[11]: https://fedoramagazine.org/btrfs-snapshots-backup-incremental/

View File

@@ -0,0 +1,225 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use your favorite open source apps on your Mac with MacPorts)
[#]: via: (https://opensource.com/article/20/11/macports)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Use your favorite open source apps on your Mac with MacPorts
======
MacPorts is an easy way to get open source applications and keep them
updated on macOS.
![Coffee and laptop][1]
"Package manager" is a generic name for software to install, upgrade, and uninstall applications. Commands like `dnf` or `apt` on Linux, or `pkg_add` on BSD, or even `pip` on Python and `luarocks` on Lua, make it trivial for users to add new applications to their system. Once you've tried it, you're likely to find it hard to live without, and it's a convenience every operating system ought to include. Not all do, but the open source community tends to ensure the best ideas in computing are propagated across all platforms.
There are several package managers designed just for macOS, and one of the oldest is the [MacPorts][2] project.
### Darwin and MacPorts
When Apple shifted to Unix at the turn of the century, it essentially built a Unix operating system called [Darwin][3]. Shortly thereafter, a group of resourceful hackers promptly began work on a project called OpenDarwin, with the intent of creating an independent branch of Darwin. They hoped that OpenDarwin and Apple developers could work on related codebases, borrowing from each other whenever it was useful. Unfortunately, OpenDarwin didn't gain traction within Apple and it eventually [came to an end][4]. However, the OpenDarwin package manager project, MacPorts, is alive and well and continues to provide great open source software for macOS.
MacOS already comes with a healthy set of default terminal commands, some borrowed from GNU, others from BSD, and still others written especially for Darwin. You can use MacPorts to add new commands and even graphical applications.
### Install MacPorts
Your macOS version dictates which MacPorts installer package you need. So first, get the version of macOS you're currently running:
```
$ sw_vers -productVersion
10.xx.y
```
MacPorts releases for recent macOS versions are available on [macports.org/install.php][5]. You can download an installer from the website, or just copy the link and download using the [curl][6] command:
```
$ curl <https://distfiles.macports.org/MacPorts/MacPorts-2.6.3-10.14-Mojave.pkg> \
\--output MacPorts-2.6.3-10.14-Mojave.pkg
```
Once you download the installer, you can double-click to install it or install it using a terminal:
```
$ sudo installer -verbose \
-pkg MacPorts*.pkg
-tgt /
```
### Configure MacPorts
Once the package is installed, you must add the relevant paths to your system so that your terminal knows where to find your new MacPorts commands. Add the path to MacPorts, and add its manual pages to your `PATH` environment variable by adding this to `~/.bashrc`:
```
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
```
Load your new environment:
```
`$ source ~/.bashrc`
```
Run an update so your MacPorts installation has access to the latest versions of software:
```
`$ sudo port -v selfupdate`
```
### Use MacPorts
Some package managers install pre-built software from a server onto your local system. This is called _binary installation_ because it installs code that's been compiled into an executable binary file. Other package managers, MacPorts among them, pull source code from a server, compile it into a binary executable on your computer, and install it into the correct directories. The end result is the same: you have the software you want.
The way they get there is different.
There are advantages to both methods. A binary install is quicker because the only transaction required is copying files from a server onto your computer. This is something [Homebrew][7] does with its "bottles," but there are sometimes issues with [non-relocatable][8] builds. Installing from source code means it's easy for you to modify how software is built and where it gets installed.
MacPorts provides the **port** command, and calls it packages **ports** (inherited terminology from projects like NetBSD's [Pkgsrc][9] and FreeBSD's port system.) The typical MacPorts workflow is to search for an application and then install it.
#### Search for an application
If you know the specific command or application you need to install, search for it to ensure it's in the MacPorts tree:
```
`$ sudo port search parallel`
```
By default, `port` searches both the names and descriptions of packages. You can search on just the name field by adding the `--name` option:
```
`$ sudo port search --name parallel`
```
You can make your searches "fuzzy" with common shell wildcards. For instance, to search for `parallel` only at the start of a name field:
```
`$ sudo port search --name --glob "parallel*"`
```
List all ports
If you don't know what you're searching for and you want to see all the packages (or "ports" in MacPorts and BSD terminology) available, use the `list` subcommand:
```
`$ sudo port list`
```
The list is long but complete. You can, of course, redirect the output into a text for reference or pipe it to `more` or `less` for closer examination:
```
$ sudo port list &gt; all-ports.txt
$ sudo port list | less
```
#### Get information about a package
You can get all the important details about a package with the `info` subcommand:
```
$ sudo port info parallel
parallel @20200922 (sysutils)
Description:          Build and execute shell command lines from standard input in parallel
Homepage:             <https://www.gnu.org/software/parallel/>
Library Dependencies: perl5
Platforms:            darwin
License:              GPL-3+
Maintainers:          Email: [example@example.com][10]
```
This displays important metadata about each application, including a brief description of what it is and the project homepage, in case you need more information. It also lists dependencies, which are _other_ ports that must be on your system for a package to run correctly. Dependencies are resolved automatically by MacPorts, meaning that if you install, for example, the `parallel` package, MacPorts also installs `perl5` if it's not already on your system. Finally, it provides the license and port maintainer.
#### Install a package
When you're ready to install a package, use the `install` subcommand:
```
`$ sudo port install parallel`
```
It can take some time to compile the code depending on your CPU, the size of the code base, and the number of packages being installed, so be patient. It'll be worth it.
Once the installation is done, the new application is available immediately:
```
$ parallel echo ::: "hello" "world"
hello
world
```
Applications installed by MacPorts are placed into `/opt/local`.
#### View what is installed
Once a package has been installed on your system, you can see exactly what it placed on your drive using the `contents` subcommand:
```
$ sudo port contents parallel
/opt/local/bin/parallel
[...]
```
#### Clean up
Installing a package with MacPorts often leaves build files in your ports tree. These files are useful for debugging a failed install, but normally you don't need to keep them lying around. Purge these files from your system with the `port clean` command:
```
`$ port clean parallel`
```
#### Uninstall packages
Uninstall a package with the `port uninstall` command:
```
`$ port uninstall parallel`
```
### Open source package management
The MacPorts project is a remnant of an early movement to build upon the open source work that served as macOS's foundation. While that effort failed, there have been efforts to revive it as a project called [PureDarwin][11]. The push to open more of Apple's code is important work, and the byproducts of this effort are beneficial to everyone running macOS. If you're looking for an easy way to get open source applications on your Mac and a reliable way to keep them up to date, install and use MacPorts.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/macports
作者:[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/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
[2]: http://macports.org
[3]: https://en.wikipedia.org/wiki/Darwin_%28operating_system%29
[4]: https://web.archive.org/web/20070111155348/opendarwin.org/en/news/shutdown.html
[5]: https://www.macports.org/install.php
[6]: https://opensource.com/article/20/5/curl-cheat-sheet
[7]: https://opensource.com/article/20/6/homebrew-linux
[8]: https://discourse.brew.sh/t/why-do-bottles-need-to-be-in-home-linuxbrew-linuxbrew/4346/3
[9]: https://opensource.com/article/19/11/pkgsrc-netbsd-linux
[10]: mailto:example@example.com
[11]: http://www.puredarwin.org/

View File

@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -0,0 +1,469 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Create your first Knative app)
[#]: via: (https://opensource.com/article/20/11/knative)
[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb)
Create your first Knative app
======
Knative is a great way to get started quickly on serverless development
with Kubernetes.
![Working from home at a laptop][1]
[Knative][2] is an open source community project that adds components to [Kubernetes][3] for deploying, running, and managing [serverless, cloud-native][4] applications. It enables more productive development with less interaction with Kubernetes' infrastructure.
There is a large amount of information out there about Knative, networking, and serverless deployments, and this introductory tutorial covers just a bite-size amount of it. In this walkthrough, I'll use Knative with [Minikube][5] to create a Knative app—a simple container that prints messages in response to a `curl` command or in a web browser at a link provided by the deployment.
### First, some background
Knative uses custom resource definitions (CRDs), a network layer, and a service core. For this walkthrough, I used Ubuntu 18.04, Kubernetes 1.19.0, Knative 0.17.2, and [Kourier][6] 0.17.0 as the Knative networking layer, as well as the Knative command-line interface (CLI).
A CRD is a custom resource definition within Kubernetes. A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pod's resource contains a collection of pod objects. This allows an expansion of the Kubernetes API with new definitions. One example is the Knative serving core, which is defined to have internal autoscaling and rapid deployment of pods with the correct roles and access predefined.
Kourier is an [Ingress][7] (a service to let in external network traffic) for Knative serving and a lightweight alternative for the [Istio][8] ingress. Its deployment consists only of an [Envoy proxy][9] and a control plane for it.
To understand the concepts in this tutorial, I recommend you are somewhat familiar with:
* Serverless, cloud-native applications
* Ingress with Envoy proxies, i.e., Istio
* DNS in Kubernetes
* Kubernetes patching configurations
* Custom resource definitions in Kubernetes
* Configuring YAML files for Kubernetes
### Set up and installation
There are some prerequisites you must do before you can use Knative.
#### Configure Minikube
Before doing anything else, you must configure Minikube to run Knative locally in your homelab. Below are the configurations I suggest and the commands to set them:
```
$ minikube config set kubernetes-version v1.19.0
$ minikube config set memory 4000
$ minikube config set cpus 4
```
To make sure those configurations are set up correctly in your environment, run the Minikube commands to delete and start your cluster:
```
$ minikube delete
$ minikube start
```
#### Install the Knative CLI
You need the Knative CLI to make a deployment, and you need [Go v1.14][10] or later to work with the CLI. I created a separate directory to make it easier to find and install these tools. Use the following commands to set up the command line:
```
$ mkdir knative
$ cd knative/
$ git clone <https://github.com/knative/client.git>
$ cd client/
$ hack/build.sh -f
$ sudo cp kn /usr/local/bin
$ kn version
Version:        v20201018-local-40a84036
Build Date:   2020-10-18 20:00:37
Git Revision: 40a84036
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.18.0)
* Eventing
  - sources.knative.dev/v1alpha2 (knative-eventing v0.18.0)
  - eventing.knative.dev/v1beta1 (knative-eventing v0.18.0)
```
Once the CLI is installed, you can configure Knative in the Minikube cluster.
#### Install Knative
Since Knative is composed of CRDs, much of its installation uses YAML files with `kubectl` commands. To make this easier, set up some environment variables in the terminal so that you can get the needed YAML files a little faster and in the same version:
```
`$ export KNATIVE="0.17.2"`
```
First, apply the service resource definitions:
```
`$ kubectl apply -f https://github.com/knative/serving/releases/download/v$KNATIVE/serving-crds.yaml`
```
Then apply the core components to Knative:
```
`$ kubectl apply -f https://github.com/knative/serving/releases/download/v$KNATIVE/serving-core.yaml`
```
This deploys the services and deployments to the namespace `knative-serving`. You may have to wait a couple of moments for the deployment to finish.
To confirm the deployment finished, run the `kubectl` command to get the deployments from the namespace:
```
$ kubectl get deployments -n knative-serving
NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
3scale-kourier-control   1/1    1               1               107m
activator               1/1     1               1               108m
autoscaler              1/1     1               1               108m
controller              1/1     1               1               108m
webhook                 1/1     1               1               108m
```
#### Install Kourier
Because you want to use a specific version and collect the correct YAML file, use another environment variable:
```
`$ export KOURIER="0.17.0"`
```
Then apply your networking layer YAML file:
```
`$ kubectl apply -f https://github.com/knative/net-kourier/releases/download/v$KOURIER/kourier.yaml`
```
You will find the deployment in the `kourier-system` namespace. To confirm the deployment is correctly up and functioning, use the `kubectl` command to get the deployments:
```
$ kubectl get deployments -n kourier-system
NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
3scale-kourier-gateway   1/1    1               1               110m
```
Next, configure the Knative serving to use Kourier as default. If you don't set this, the external networking traffic will not function. Set it with this `kubectl patch` command:
```
$ kubectl patch configmap/config-network \
  --namespace knative-serving \
  --type merge \
  --patch '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'
```
#### Configure the DNS
Before you can access the load balancer, you need to run the `minikube tunnel` command in a separate terminal window. This command creates a route to services deployed with type `LoadBalancer` and sets their Ingress to their `ClusterIP`. Without this command, you will never get an `External-IP` from the load balancer. Your output will look like this:
```
Status:    
    machine: minikube
    pid: 57123
    route: 10.96.0.0/12 -&gt; 192.168.39.67
    minikube: Running
    services: [kourier]
        errors:
         minikube: no errors
         router: no errors
         loadbalancer emulator: no errors
Status:    
    machine: minikube
    pid: 57123
    route: 10.96.0.0/12 -&gt; 192.168.39.67
    minikube: Running
    services: [kourier]
        errors:
         minikube: no errors
         router: no errors
         loadbalancer emulator: no errors
```
Now that the services and deployments are complete, configure the DNS for the cluster. This enables your future deployable application to support DNS web addresses. To configure this, you need to get some information from your Kourier service by using the `kubectl get` command:
```
$ kubectl get service kourier -n kourier-system
NAME    TYPE            CLUSTER-IP      EXTERNAL-IP     PORT(S)                        
kourier   LoadBalancer   10.103.12.15   10.103.12.15   80:32676/TCP,443:30558/TCP
```
Get the `CLUSTER-IP` address and save it for the next step. Next, configure the domain to determine your internal website on local DNS. (I ended mine in `nip.io`, and you can also use `xip.io`.) This requires another `kubectl patch` command:
```
`$ kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"10.103.12.15.nip.io\": \"\"}}"`
```
Once it's patched, you will see this output:
```
`configmap/config-domain patched`
```
### Use the Knative CLI
Now that your configurations are done, you can create an example application to see what happens.
#### Deploy a service
Earlier in this walkthrough, you installed the Knative CLI, which is used for Serving and Eventing resources in a Kubernetes cluster. This means you can deploy a sample application and manage services and routes. To bring up the command-line menu, type `kn`. Here is a snippet of the output:
```
$ kn
kn is the command line interface for managing Knative Serving and Eventing resources
 Find more information about Knative at: <https://knative.dev>
Serving Commands:
  service       Manage Knative services
  revision      Manage service revisions
  route         List and describe service routes
```
Next, use the Knative CLI to deploy a basic "hello world" application with a web frontend. Knative provides some examples you can use; this one does a basic deployment:
```
`kn service create hello --image gcr.io/knative-samples/helloworld-go`
```
Your output should look something like this:
```
$ kn service create hello --image gcr.io/knative-samples/helloworld-go
Creating service 'hello' in namespace 'default':
  0.032s The Configuration is still working to reflect the latest desired specification.
  0.071s The Route is still working to reflect the latest desired specification.
  0.116s Configuration "hello" is waiting for a Revision to become ready.
 34.908s ...
 34.961s Ingress has not yet been reconciled.
 35.020s unsuccessfully observed a new generation
 35.208s Ready to serve.
Service 'hello' created to latest revision 'hello-dydlw-1' is available at URL:
<http://hello.default.10.103.12.15.nip.io>
```
This shows that the service was deployed with a URL into the namespace default. You can deploy to another namespace by running something like the following, then look at the output:
```
$ kn service create hello --image gcr.io/knative-samples/helloworld-go --namespace hello
Creating service 'hello' in namespace 'hello':
  0.015s The Configuration is still working to reflect the latest desired specification.
  0.041s The Route is still working to reflect the latest desired specification.
  0.070s Configuration "hello" is waiting for a Revision to become ready.
  5.911s ...
  5.958s Ingress has not yet been reconciled.
  6.043s unsuccessfully observed a new generation
  6.213s Ready to serve.
Service 'hello' created to latest revision 'hello-wpbwj-1' is available at URL:
<http://hello.hello.10.103.12.15.nip.io>
```
#### Test your new deployment
Check to see if the new service you deployed is up and running. There are two ways to check:
1. Check your web address in a browser
2. Run a `curl` command to see what returns
If you check the address in a web browser, you should see something like this:
![Checking Knative deployment][11]
(Jess Cherry, [CC BY-SA 4.0][12])
Good! It looks like your application's frontend is up!
Next, test the `curl` command to confirm everything works from the command line. Here is an example of a `curl` to my application and the output:
```
$ curl <http://hello.default.10.103.12.15.nip.io>
Hello World!
```
#### Interact with the Knative app
From here, you can use the Knative CLI to make some basic changes and test the functionality. Describe the service and check the output:
```
$ kn service describe hello
Name:           hello
Namespace:  default
Age:            12h
URL:            <http://hello.default.10.103.12.15.nip.io>
Revisions:  
  100%  @latest (hello-dydlw-1) [1] (12h)
        Image:  gcr.io/knative-samples/helloworld-go (pinned to 5ea96b)
Conditions:  
  OK TYPE                       AGE REASON
  ++ Ready                      12h
  ++ ConfigurationsReady        12h
  ++ RoutesReady                12h
```
It looks like everything is up and ready as you configured it. Some other things you can do with the Knative CLI (which won't show up now due to the minimal configuration in this example) are to describe and list the routes with the app:
```
$ kn route describe hello
Name:           hello
Namespace:  default
Age:            12h
URL:            <http://hello.default.10.103.12.15.nip.io>
Service:        hello
Traffic Targets:  
  100%  @latest (hello-dydlw-1)
Conditions:  
  OK TYPE                       AGE REASON
  ++ Ready                      12h
  ++ AllTrafficAssigned         12h
  ++ CertificateProvisioned     12h TLSNotEnabled
  ++ IngressReady               12h
jess@Athena:~/knative/client$ kn route list hello
NAME    URL                                     READY
hello   <http://hello.default.10.103.12.15.nip.io>   True
```
This can come in handy later when you need to troubleshoot issues with your deployments.
#### Clean up
Just as easily as you deployed your application, you can clean it up:
```
$ kn service delete hello
Service 'hello' successfully deleted in namespace 'default'.
jess@Athena:~/knative/client$ kn service delete hello --namespace hello
Service 'hello' successfully deleted in namespace 'hello'.
```
### Make your own app
This walkthrough used an existing Knative example, but you are probably wondering about making something that _you_ want. You are right, so I'll provide this example YAML then explain how you can apply it with kubectl and manage it with the Knative CLI.
**Example YAML**
```
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: helloworld
  namespace: default
spec:
 template:
  spec:
   containers:
     - image: gcr.io/knative-samples/helloworld-go
       ports:
             - containerPort: 8080
       env:
        - name: TARGET
          value: "This is my app"
```
Save this to `apps.yaml`, and then you can make changes to some things. For example, you can change your `metadata`, `name`, and `namespace`. You can also change the value of the target (which I set to `This is my app`) so that, rather than `Hello World`, you'll see a new message that says `Hello ${TARGET} !` when you deploy the file.
To deploy a file like this, you will have to use `kubectl apply -f apps.yaml`.
First, deploy your new service using the `apply` command:
```
$ kubectl apply -f apps.yaml
service.serving.knative.dev/helloworld created
```
Next, you can describe your new deployment, which is the name provided in the YAML file:
```
$ kn service describe helloworld
Name:           helloworld
Namespace:  default
Age:            50s
URL:            <http://helloworld.default.10.103.12.15.nip.io>
Revisions:  
  100%  @latest (helloworld-qfr9s) [1] (50s)
        Image:  gcr.io/knative-samples/helloworld-go (at 5ea96b)
Conditions:  
  OK TYPE                       AGE REASON
  ++ Ready                      43s
  ++ ConfigurationsReady        43s
  ++ RoutesReady                43s
```
Run a `curl` command to confirm it produces the new output you defined in your YAML file:
```
$ curl  <http://helloworld.default.10.103.12.15.nip.io>
Hello This is my app!
```
Double-check by going to the simple web frontend.
![Checking Knative deployment][13]
(Jess Cherry, [CC BY-SA 4.0][12])
This proves your application is running! Congratulations!
### Final thoughts
Knative is a great way for developers to move quickly on serverless development with networking services that allow users to see changes in apps immediately. It is fun to play with and lets you take a deeper dive into serverless and other exploratory uses of Kubernetes!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/knative
作者:[Jessica Cherry][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/cherrybomb
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
[2]: https://knative.dev/
[3]: https://opensource.com/resources/what-is-kubernetes
[4]: https://en.wikipedia.org/wiki/Cloud_native_computing
[5]: https://minikube.sigs.k8s.io/docs/
[6]: https://github.com/knative-sandbox/net-kourier
[7]: https://kubernetes.io/docs/concepts/services-networking/ingress/
[8]: https://istio.io/
[9]: https://www.envoyproxy.io/
[10]: https://golang.org/doc/install
[11]: https://opensource.com/sites/default/files/uploads/knative_browser-check.png (Checking Knative deployment)
[12]: https://creativecommons.org/licenses/by-sa/4.0/
[13]: https://opensource.com/sites/default/files/uploads/knativebrowser2.png (Checking Knative deployment)

View File

@@ -0,0 +1,175 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How I use Cockpit for my home's Linux server management)
[#]: via: (https://opensource.com/article/20/11/cockpit-server-management)
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
How I use Cockpit for my home's Linux server management
======
Anyone—from home users to large-network admins—can access
enterprise-grade server management with Cockpit.
![People work on a computer server with devices][1]
[Cockpit][2] is a service for Linux that provides a web-based interface for managing and monitoring hosts. It can be deployed in any size organization, even a small office, and it's a great way for home users to maintain the family IT infrastructure. I use it to manage and monitor all of the computers in my house—including Raspberry Pi.
Cockpit is a free and open source software project released under the LGPL v2.1+. It is sponsored by Red Hat and included in Red Hat Enterprise Linux as the RHEL Web Console.
### Using Cockpit
Cockpit allows you to manage Linux devices on your network remotely. You can add or remove users, connect Network File System (NFS) shares, and start and stop services. One of my favorite simple Cockpit tasks is doing updates. I no longer have to walk around the office or house to collect each device to log in, update, reboot, and wait. Enterprise administrators don't need to badge into a data center; instead, they can manage devices from the comfort of their office.
This isn't all, though. Cockpit's advanced capabilities include managing an LDAP server, virtual machines, and storage. You can also use it to install Docker or Podman containers.
In terms of monitoring, Cockpit provides visibility into the expected CPU, memory, and disk space metrics. But it also exposes information like the manufacturer, BIOS, and CPU branding and gives a detailed look at hardware elements such as the [northbridge][3] and [southbridge][4] chips and various controllers. It lists the graphics, storage, and network communications devices and the memory controller and memory type. Cockpit can also be used to review logs.
### Install Cockpit
Cockpit is included in most major distributions. The website provides [documentation][5] for installing on Red Hat, Fedora, Ubuntu, Debian, Arch, and several others. You can install it with the standard package management commands on your Linux distribution. You can also usually find it in your graphical utility, such as GNOME Software Center, for a one-click process.
* **Fedora: **`dnf install cockpit`
* **Ubuntu: **`apt install cockpit`
### Access and login
The default listen port is 9090. To access the Cockpit interface on a server, just point your browser to `hostname:9090`. You can use `localhost:9090` for the local server where you are logged on. Log in with a common account, as it will be advantageous to have root privileges on this account.
![Cockpit Login Screen][6]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
To access other servers remotely, you would use their hostname, e.g., `https://hostname:9090`. However, you could designate one host as a management server and add all your servers to the Dashboard for a unified view.
Once you log in, the first screen you see is the Dashboard; the other option is Host view. 
### Dashboard view
The Dashboard view is clean and uncluttered. The image below shows a performance monitor for all of a system's connected servers. It graphs CPU, memory, network, and disk I/O. If this is your first run and you haven't yet connected any servers, you will see graphs for the local system only.
![Cockpit Dashboard][8]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
Add a server by clicking the blue plus (**+**) button.
![Adding a machine to Cockpit][9]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
After you add servers, scroll down to see the full list. I have a few systems set up already.
![Cockpit server list][10]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
### Host view
Host view is where all the fun begins. This section shows and gives access to each server added to the Dashboard. The main area of interest here is the column toward the left that includes **Overview**, **Logs**, **Storage**, **Networking**, and a few other items, with **Terminal** at the bottom. Clicking on each item enables you to manage these parts of the system. The items in this section can vary depending on other features that may be installed.
#### Overview
When you select a server, the Host screen opens to the **Overview** section with controls for the specific host system. The Overview screen is divided into quadrants for _Health_, _Usage_, _Configuration_, and _System information_.
![Cockpit Host Overview][11]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
Usage links to a detailed performance graph view, and System information links to hardware details. Some management controls are directly available on this screen. For example, you can change the system hostname or join the server to an enterprise domain.
#### Storage
In this image of the **Storage** section, the top part has a graph of read/write activity, and below that is a list of local filesystems. Further down, you can add NFS mounts or view logs. You can even create RAID devices and volume groups.
![Cockpit Host Storage View][12]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
#### Networking
The **Networking** section allows you to manage firewall and network interfaces. You can edit firewall rules and zones and manipulate networking with bonding, teaming, bridges, and VLANs.
![Cockpit Host Networking View][13]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
#### Software updates
Being able to apply updates on servers remotely is super-convenient. Even a family may have five or 10 computers. But an enterprise with hundreds or thousands of headless servers racked in a dry, dark data center miles away definitely needs this capability. The **Software updates** section lists the updates available to you.
![Cockpit host updates][14]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
You can select whether to install all updates or just those related to security, and Cockpit displays a progress bar while updates are installed. Once the process is complete, you can restart the system.
#### Terminal
The last item in Host view is a **Terminal**, where you can do all the normal command-line options. One way I've used the Terminal is to overcome inconsistencies in Cockpit feature sets, most likely due to Linux version differences. I discovered this on [my Media Center PC][15] running Ubuntu Linux 18.04. In this version of Ubuntu, the Overview section is labeled System. It indicates available bug-fix updates but does not have a button for applying updates. This is not the case with the newer Ubuntu 20.04 LTS, which has the expected Overview section and update facility. Either way, there is no need to fret because I can leverage the terminal to run the normal Apt update commands.
![Cockpit Terminal][16]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
#### Applications
You may have noticed that I skipped the **Applications** section in Host view. This section deserves your attention because it can manipulate the view and functionality of your Cockpit service. From here, you can install additional functionality or applications, such as 389 LDAP Server or tools for collecting diagnostic reports and kernel dumps or building server images. The _Machines_ section enables virtual machine management, and _Podman_ provides container management capabilities. Once you have Cockpit up and running, it's a good idea to explore the Applications section.
![Cockpit Applications][17]
(Alan Formy Duvall, [CC BY-SA 4.0][7])
### Final thoughts
Cockpit uses a secure shell (SSH) client to access remote servers, so there may be some resource impact on a system where you create the unified view that I described above since each managed server will have an associated SSH connection.
```
$ ps fax |grep cockpit
2064515 ?        Ssl    0:50 /usr/libexec/cockpit-tls
2064521 ?        Ssl    0:41 /usr/libexec/cockpit-ws --for-tls-proxy --port=0
2064527 ?        S      0:00  \\_ /usr/libexec/cockpit-session localhost
2064537 ?        Sl     0:38      \\_ cockpit-bridge
2064636 ?        S      1:37          \\_ /usr/libexec/cockpit-ssh webserver
2064639 ?        S      1:37          \\_ /usr/libexec/cockpit-ssh smtpserver
2064640 ?        S      1:37          \\_ /usr/libexec/cockpit-ssh ftpserver
2064670 ?        Sl     0:02          \\_ /usr/bin/cockpit-bridge --privileged
2076607 ?        S      0:21          \\_ /usr/libexec/cockpit-ssh ldapserver
2078182 ?        S      0:10          \\_ /usr/libexec/cockpit-ssh teaserver
```
I've used many operations tools like this, both closed and open source, for management, monitoring, provisioning, deployment, and security tasks. Cockpit is a great tool that fits organizations of all sizes.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/cockpit-server-management
作者:[Alan Formy-Duval][a]
选题:[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/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices)
[2]: https://cockpit-project.org/
[3]: https://en.wikipedia.org/wiki/Northbridge_%28computing%29
[4]: https://en.wikipedia.org/wiki/Southbridge_%28computing%29
[5]: https://cockpit-project.org/running.html
[6]: https://opensource.com/sites/default/files/uploads/cockpitlogin.png (Cockpit Login Screen)
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://opensource.com/sites/default/files/uploads/cockpitdashboard.png (Cockpit Dashboard)
[9]: https://opensource.com/sites/default/files/uploads/cockpitaddmachine.png (Adding a machine to Cockpit)
[10]: https://opensource.com/sites/default/files/uploads/cockpitservers.png (Cockpit server list)
[11]: https://opensource.com/sites/default/files/uploads/cockpithostoverview.png (Cockpit Host Overview)
[12]: https://opensource.com/sites/default/files/uploads/cockpithoststorage.png (Cockpit Host Storage View)
[13]: https://opensource.com/sites/default/files/uploads/cockpithostnetwork.png (Cockpit Host Networking View)
[14]: https://opensource.com/sites/default/files/uploads/cockpithostupdates.png (Cockpit host updates)
[15]: https://opensource.com/article/18/11/old-linux-desktop-new-home-media-center
[16]: https://opensource.com/sites/default/files/uploads/cockpitterminal.png (Cockpit Terminal)
[17]: https://opensource.com/sites/default/files/uploads/cockpitapplications.png (Cockpit Applications)

View File

@@ -0,0 +1,126 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Install Google Chrome on Fedora [Beginners Tutorial])
[#]: via: (https://itsfoss.com/install-google-chrome-fedora/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
How to Install Google Chrome on Fedora [Beginners Tutorial]
======
Fedora comes with Firefox as the default web browser. Despite it being an excellent web browser, you may prefer the popular Google Chrome browser.
If you are wondering how to install Google Chrome on Fedora, let me show you two ways of installing Google Chrome, graphical method and command line method.
* [GUI method 1: Install Chrome from the software center by enabling Fedora third-party repository][1]
* [GUI method 2: Download RPM file from Google Chromes website][2]
* [CLI method: Install Chrome from the Fedora third-party repository, everything using commands (same as GUI method 1)][3]
It is up to you which method you prefer. Your Google Chrome on [Fedora][4] will be getting regular updates via the system updates in all the three methods.
### Method 1: Install Google Chrome on Fedora from the Software Center
Fedora provides a third-party repository that contains some popular proprietary software, graphics driver. Google Chrome is one of them.
First step, make sure to enable third-party repositories in Fedora. You should see this option in the software center itself.
![Step1: Fedora Third Party Repositories][5]
Once you have it enabled, simply search for Chrome in the software center:
![Step 2: Search for Chrome In Fedora Software Center][6]
And install it from there:
![Step 3: Install Chrome Fedora][7]
Can it be any easier than this? I dont think either :)
### Method 2: Installing Google Chrome on Fedora from Chrome website
If you do not want to enable the third-party repository, thats okay. You dont have to. You can download the RPM file from Chromes website, double-click on it and install it.
Visit Google Chromes website and click on the download button.
[Get Google Chrome][8]
![][9]
Then select the .rpm package and click on “Accept and Install”.
![][10]
Once the download is over, double click on the file and click install when prompted at the package manager. Type your password and wait until the process is done.
![][11]
Thats super easy, right? Lets see somewhat complicated method (if you are not a terminal fan).
### Method 3: Install Chrome on Fedora using command line
Firstly, you need to add extra Fedora repositories (that you saw in method 1):
```
sudo dnf install fedora-workstation-repositories
```
And then enable Google Chrome repository.
```
sudo dnf config-manager --set-enabled google-chrome
```
![][12]
To install the Google Chrome stable release, run the following command at your terminal.
```
sudo dnf install google-chrome-stable
```
You should get a warning for importing the GPG key, enter y to continue.
![][13]
You are adding the Google Chrome repository. The package comes from this repository, directly from Google.
#### Conclusion
Installing Google chrome on Fedora is fairly easy, even if you use the command line. Its pretty much the [same as installing Chrome on Ubuntu][14] except the third-party repository part.
Now that you have installed it, you may want to [check our list of Google Chrome keyboard shortcuts][15] to use the browser faster.
Dont forget to subscribe, to get the latest news and tutorials about Fedora, and if you have any questions please leave a comment below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-google-chrome-fedora/
作者:[Dimitrios Savvopoulos][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/dimitrios/
[b]: https://github.com/lujun9972
[1]: tmp.VFVwBw56ac#gui-method-1
[2]: tmp.VFVwBw56ac#gui-method-2
[3]: tmp.VFVwBw56ac#cli-method
[4]: https://getfedora.org/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repositories.jpg?resize=800%2C400&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/chrome-in-fedora.png?resize=800%2C400&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/installing-chrome-fedora.png?resize=800%2C400&ssl=1
[8]: https://www.google.com/chrome/
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/install-google-chrome-ubuntu-1.jpeg?resize=800%2C374&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/3.-download-rpm-chrome.png?resize=800%2C600&ssl=1
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/4.-install-chrome-fedora.png?resize=800%2C550&ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/1.-Fedora-extra-repos.png?resize=800%2C550&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/2.-Fedora-GPG-key.png?resize=800%2C550&ssl=1
[14]: https://itsfoss.com/install-chrome-ubuntu/
[15]: https://itsfoss.com/google-chrome-shortcuts/

View File

@@ -0,0 +1,136 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Install and Use Etcher on Linux for Making Live Linux USB)
[#]: via: (https://itsfoss.com/install-etcher-linux/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
How to Install and Use Etcher on Linux for Making Live Linux USB
======
_**Etcher is a popular USB flasher app for creating bootable Linux USB drives. Let me show you how to install it and how to use it for making a live Linux disk.**_
### Etcher: An open source tool to flash Linux ISO on SD Cards &amp; USB drives
Etcher is an open-source project by [Balena][1] to help flash SD cards for Raspberry Pi. In fact, we used it in our tutorial on [how to install Raspbian OS on a SD Card][2].
Not just limited to SD Cards, you can also use Etcher to [make a bootable USB drive][3] just like we created a [live USB of Manjaro in Linux][4] with the help of it.
Ever since its first release, Etcher caught the attention for its neat interface and simplicity of use.
![][5]
In this article, I will be focusing on the steps to help you install Etcher on Linux. And then, Ill also show how to use it. Before I do that, let me give you an overview of the features it offers:
### Features of Etcher
* Validate drive before flashing
* Beautiful user interface
* Auto-detects USB drive/SD card to prevent wiping the HDD on your computer
* Cross-platform support (Windows, macOS, and Linux)
* Fast flashing
* Simple three-step process
On paper, you get everything one would need to flash OS images on an SD card and a USB drive. It is also exciting to know that they plan to add the support simultaneous writing to multiple devices as per their [roadmap][6].
### Installing Etcher on Linux
To get started, you have to grab the AppImage file that it offers (suitable for any Linux distribution) from its official website.
You just need to head on to its [homepage][7] and download the one for your system (32-bit/64-bit):
![][8]
In my case, I got the 64-bit AppImage file for Ubuntu. You can go through our guide on [using AppImage files on Linux][9], but Ill give you a head start on what you need to do next.
You need to give the file permissions to execute and you can do that by right-clicking on the **AppImage file -&gt; Properties**.
![][10]
Next, click on “**Allow executing as a program**” under the Permissions tab as shown in the image below.
![][11]
Now, just double-click on the AppImage file to launch balenaEtcher!
This should work on any Linux distribution. In either case, you can also head over to its [GitHub releases se][12][c][12][tion][12] to find RPM, DEB, and the source file if you want to build it from source or just install it using the .rpm or .deb files.
You can also refer to our guide on [using deb file in Ubuntu][13] to install applications.
Attention!
Its been noticed that when you use Etcher to create live USB of Linux distributions, it leaves the USB in an apparent unusable state where it has only a few MB of free state and cannot be formatted directly. On Linux, you can [use the Disks tool to manually delete the partitions and then format it][14].
### Using Etcher on Linux
It is just a three-step process to get started using Etcher. It should be self-explanatory as per the on-screen instructions after you launch it, but just to give you a head start, heres what you have to do:
**Step 1:** Select the appropriate ISO image file or the URL of the file that you need to flash (as shown in the image below).
![][15]
**Step 2**: Next, you will have to select the target device. It automatically detects and highlights removable devices to help you prevent selecting any internal storage locations.
![][16]
In this case, I have a USB drive connected, and I have it selected as well (as shown in the screenshot below).
![][17]
**Step 3:** Now, all you have to do is — flash the image and wait for it to complete successfully.
![][18]
Heres how the progress looks:
![][19]
And, it is done!
![][20]
[Download balenaEtcher][7]
### Wrapping Up
Etcher is a useful tool to flash OS images for both SD cards and USB drives. I tend to use it primarily to create live USB drives to test Linux distros and Im happy with it.
What do you prefer to use to create bootable drives? Have you tried Etcher already? Let me know your thoughts in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-etcher-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.balena.io/
[2]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/
[3]: https://itsfoss.com/create-bootable-ubuntu-usb-drive-mac-os/
[4]: https://itsfoss.com/create-live-usb-manjaro-linux/
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/etcher-mxlinux-2.png?resize=800%2C518&ssl=1
[6]: https://github.com/balena-io/etcher/milestones
[7]: https://www.balena.io/etcher
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/etcher-official-site-download.png?resize=800%2C580&ssl=1
[9]: https://itsfoss.com/use-appimage-linux/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/balena-etcher-permission.jpg?resize=800%2C378&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/balena-etcher-execute.jpg?resize=800%2C445&ssl=1
[12]: https://github.com/balena-io/etcher/releases/tag/v1.5.109
[13]: https://itsfoss.com/install-deb-files-ubuntu/
[14]: https://itsfoss.com/cant-format-usb-disk/
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/balena-etcher-select.jpg?resize=800%2C521&ssl=1
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/etcher-select-target.jpg?resize=800%2C509&ssl=1
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/etcher-target-device.jpg?resize=800%2C521&ssl=1
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/etcher-flash.jpg?resize=800%2C516&ssl=1
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/etcher-flashing.jpg?resize=800%2C510&ssl=1
[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/etcher-flash-complete.jpg?resize=800%2C507&ssl=1

View File

@@ -0,0 +1,116 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (MuditaOS: A Beautiful and Minimal Open Source Mobile Operating System for Feature Phones)
[#]: via: (https://itsfoss.com/mudita-os/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
MuditaOS: A Beautiful and Minimal Open Source Mobile Operating System for Feature Phones
======
_**Find the always connected smartphones too distracting and privacy invasive? Lets go back to the pre-2010 era and enjoy the simplicity of feature phones but with a modern design with MuditaOS.**_
There are a [few open source mobile operating systems][1] existing already. Let me add one more to this list.
Unlike most other mobile operating systems, MuditaOS is not interested in serving smartphones. Lets have a look at it.
### Meet MuditaOS: A minimalistic, yet powerful mobile operating system
![][2]
[MuditaOS][3] is a beautifully designed [E Ink][4] mobile operating system. You might have come across the E Ink display with electronic eBook readers like Kindle or Nook.
The E Ink display itself is soothing to the eyes and MuditaOS makes it even more beautiful with its minimalist approach.
Here are the components of a basic phone running MuditaOS:
* Home Screen (with clock and notification)
* Calls
* Phonebook
* Messaging
* Settings
* Music Player (Thanks goodness!)
* Alarm clock
* Calendar
* Meditation Timer
* Tools
* Onboarding
Since this is all too 2007-ish, MuditaOS has a companion desktop application available to manage the phone.
### Mudita Center desktop app to manage your Mudita Phone
![][5]
Mudita Center application is available on Linux, Windows and macOS. Connecting the phone to the computer and using this application, you can do the following:
* Update MuditaOS
* Upload and manage audio on Pure
* Export notes and voice memos
* Create longer messages and notes (because typing on phone with limited keys is a pain)
* Synchronize calendar
* Use your phone as mobile hotspot (if you have the 3G/4G data connection)
### What devices are available?
![][6]
MuditaOS is specially created for their own [Mudita Pure phones][7] that come on pebble gray and charcoal black colors.
The phones are water resistant with IP54 rating and though it supports 4G network, you cannot use internet on the phone. Youll have to tether it with your computer to use the data network on the computer.
It also has ultralow SAR antenna to minimize the mobile radiation exposure. Another good thing is that their speakers and microphones are by [Harman][8] so expect top quality audio.
Here are more technical specifications:
* Processor: Arm Cortex-M7 600MHz, 512KB Tightly Coupled Memory (TCM)
* Memory: 16 MB SDRAM and 16 GB eMMC flash storage
* Network and connectivity: 2G, 3G, 4G/LTE, GSM, Bluetooth 4.2, USB type-C, No WiFi, no mobile data on the phone
* Display: 2.84 E Ink (600x480px), 16-grayscale, scratch resistant
* Weight: 140 g
* Sim card: 2 nano SIM card slots
* Audio: Loudspeaker, earspeaker &amp; microphone by Harman, Audio playback format: MP3, WAV, FLAC, Headphone jack, Bluetooth audio playback
* Battery: ~1600mAh, Li-Po, replacable
* Sensors: Ambient Light
You can preorder a Mudita Pure phone on the link below Keep in mind that pricing is astronomical compared to other feature phones.
[Pre-order Mudita Pure][7]
As of now, I am not aware of any device other than the ones from Mudita running MuditaOS. This is rather new on the scene.
### Conclusion
The name Mudita is inspired by the Sanskrit word Mudit which means happy. Recently when the developers open sourced their project they mentioned, “open-sourcing MuditaOS goes along the line of our “Youre happy Im Happy” philosophy”.
I know that working on feature phones in the age of smartphones may sound like a bad idea but keep in mind that feature phones are still not obsolete. There is still market for these phones among older people and for people who dont want to spend too much on phones just for making calls.
--------------------------------------------------------------------------------
via: https://itsfoss.com/mudita-os/
作者:[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/open-source-alternatives-android/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/muditaos.jpg?resize=800%2C450&ssl=1
[3]: https://mudita.com/products/pure/muditaos
[4]: https://www.eink.com
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/muditaos-desktop-app.jpg?resize=800%2C581&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/mudita-pure.jpg?resize=800%2C600&ssl=1
[7]: https://mudita.com/products/pure/
[8]: https://www.harmanaudio.com/

View File

@@ -0,0 +1,133 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Quick Lookup is a Simple Open Source Word Lookup Tool to Find Meaning of Words You Come Across)
[#]: via: (https://itsfoss.com/quick-lookup/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Quick Lookup is a Simple Open Source Word Lookup Tool to Find Meaning of Words You Come Across
======
_**It is always handy to have a quick word lookup tool while browsing the web or reading an e-book. Quick Lookup is one such free and open-source tool to try.**_
Whenever I come across a word that I dont know the meaning of, I just open a new tab and search for the meaning. However, it is a hit and trial every time depending on what search engine youre on.
Even if you do get an idea for the meaning with a quick search, you do not get all the details required along with it. Especially, if you do not know the meaning of the word that describes your target word. You will end up performing another quick search.
So, to get rid of all that hassle, a quick lookup tool should prove to be useful!
### Quick Lookup: A Simple Dictionary App Powered by Wiktionary
![][1]
Whatever is your [idea of what is Linux][2], this is what Wiktionary thinks of Linux.
As you might have guessed already, Quick Lookup needs an active Internet connection to give you the results for your words utilizing [Wiktionary][3].
It is a completely free and open-source application that offers essential features to make it a handy [productive tool for Linux users][4]. Let us take a look at what it offers.
**Recommended Read:**
![][5]
#### [Artha: An Offline English Thesaurus App for Linux][6]
Artha is a feature rich thesaurus application available for all major Linux distributions. 
### Features of Quick Lookup
![][7]
* Ability to look for the definitions of the words and phrases
* It lets you manually enter the word or phrase
* Multiple languages supported but the description and meaning of words/phrases will be displayed only in English
* Open internal links from within app (if youre curious about a related word)
* Remembers your last search with the help of the back button
* You can also launch the app in selection mode to automatically capture the word you select
### Installing Quick Lookup on Linux
Quick Look is [available primarily][8] as a [Flatpak package][9] for every Linux user. If Flatpak is integrated with your software center like Pop!_Shop on [Pop OS][10], you can find it listed there.
If you have Flatpak enabled, you can always use this command to install it:
```
flatpak install flathub com.github.johnfactotum.QuickLookup
```
You can learn more about [using Flatpak][11] in case you dont know how about it.
It is worth noting that if you want to select texts on your browser (or any other app) while using a Flatpak package and have it look for the meaning, you will have to type this command (launching it in the selection mode):
```
flatpak run com.github.johnfactotum.QuickLookup --selection
```
In either case, you can simply [download the source][12] archive and get it installed using the installation script. You can also run it without needing to install it by simply navigating the source folder and typing this command:
```
gjs quick-lookup.js
```
If youve installed it from source and want it to automatically fetch the text that you select on any app, you will have to launch it using the following command:
```
quick-lookup --selection
```
You also get an option to use the [GNOME Builder][13] if youre familiar with it. For more details, you can check out its [GitHub page][14].
[Quick Lookup][14]
**Recommended Read:**
![][15]
#### [LanguageTool Review: Free and Open Source Grammar Checker][16]
LanguageTool is a free and open source proofreading software that checks the grammar, style and spelling in more than 20 languages.
### Closing Thoughts on Quick Look
Quick Look is definitely a useful dictionary app (even without an offline functionality) to quickly look for the meanings of words/phrases. Im not much into eBooks, but you can try using an [eBook reader][17] along with this app to quickly be able to decipher words.
Personally, I like to use it while browsing the web. To make things convenient, I like to keep its Window on top of every window on my workspace. So, you can easily select a text and then click on it to get the meaning and continue working.
An offline functionality would be great for users who do not spend most of their time online. But, for the time being, its only online.
Have you tried something like Quick Look? Let us know your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/quick-lookup/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/quick-lookup-dictionary.jpg?resize=800%2C559&ssl=1
[2]: https://itsfoss.com/what-is-linux/
[3]: https://www.wiktionary.org/
[4]: https://itsfoss.com/productivity-tips-ubuntu/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/08/thesaurus-app-linux.jpeg?fit=300%2C169&ssl=1
[6]: https://itsfoss.com/artha-thesaurus-app-linux/
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/quick-lookup-itsfoss.png?resize=800%2C405&ssl=1
[8]: https://flathub.org/apps/details/com.github.johnfactotum.QuickLookup
[9]: https://itsfoss.com/what-is-flatpak/
[10]: https://itsfoss.com/pop-os-20-04-review/
[11]: https://itsfoss.com/flatpak-guide/
[12]: https://github.com/johnfactotum/quick-lookup/releases/tag/1.2.0
[13]: https://wiki.gnome.org/Apps/Builder
[14]: https://github.com/johnfactotum/quick-lookup
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/LanguageTool-grammar-checker.png?fit=800%2C450&ssl=1
[16]: https://itsfoss.com/languagetool-review/
[17]: https://itsfoss.com/best-ebook-readers-linux/

View File

@@ -0,0 +1,70 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Test GNOME apps on this Linux reference platform)
[#]: via: (https://opensource.com/article/20/11/gnome-os)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
Test GNOME apps on this Linux reference platform
======
Introducing GNOME OS, the plain-vanilla Linux reference platform that
makes it easier to test GNOME applications and bug reports.
![Penguin with green background][1]
I'm very excited about [GNOME 3.38][2]. The new version of the Linux desktop environment includes [lots of new features and a noticeable performance boost][3]. But in the background, mostly unnoticed, is another neat new thing about GNOME: the development of GNOME OS.
As you might guess from its name, GNOME OS is a Linux distribution that uses GNOME as its desktop. But unlike Pop!_OS, Fedora, or Ubuntu, GNOME OS isn't meant as a complete Linux distribution. Instead, it is a reference platform for GNOME.
The idea is to have a standard operating system image running GNOME to give developers a consistent platform to test on. As GNOME makes new releases, the GNOME development team can share that image with testers, so they can experience the new version.
This is significant for GNOME testing. Previously, if someone reported a bug in a GNOME application, a developer would have to dig into the bug report and determine if the bug is really in the GNOME desktop or if it happened because the distribution did something or tweaked something in GNOME that had a knockdown effect on a GNOME application. But with GNOME OS, developers have a standard reference platform that is always a _vanilla_ version of GNOME. Developers can reproduce bug reports using GNOME OS; if they can reproduce the bug, they know it's really with GNOME and not someone else's "spin" on GNOME.
As such, GNOME OS is not meant to be a full desktop operating system. It's just meant to be a place to test GNOME and GNOME applications.
![Installing GNOME OS][4]
Installing GNOME OS (Jim Hall, [CC BY-SA 4.0][5])
GNOME OS also helps GNOME developers add new features. Imagine having a virtual machine where a developer can test new changes to GNOME Shell and the extensions. In previous GNOME releases, GNOME extensions would usually break in every release. With GNOME OS, developers can test those extensions against a full version of GNOME. Developers and testers don't have to reinstall their full desktop OS—they can just run GNOME OS in a virtual machine and test it there.
![Booting GNOME OS][6]
Booting GNOME OS (Jim Hall, [CC BY-SA 4.0][5])
That's the big value in GNOME OS. Now extension writers can do their tests using GNOME OS and don't have to wait for a new version of the full GNOME to become available in a standard distribution. This allows GNOME to better support development and testing processes.
GNOME OS also makes it easier for testers to join the project. If you want to work on GNOME, just download the GNOME OS image and test against that. Because GNOME OS is a reference platform, you know that any bugs you find will be only against GNOME.
![Running GNOME OS][7]
Running GNOME OS (Jim Hall, [CC BY-SA 4.0][5])
GNOME OS is automatically generated from new builds, so it's always the latest version of GNOME. Whenever there's a change in GNOME, it gets pushed to the GNOME OS image. GNOME OS is managed with [OSTree][8], so you don't have to keep downloading new versions. This also makes it easy to roll back if an update is broken.
Interested in GNOME OS? Learn more about it at [GNOME OS Nightly][9], or visit the [GitLab project][10] to download a bootable GNOME OS image.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/gnome-os
作者:[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://help.gnome.org/misc/release-notes/3.38/
[3]: https://opensource.com/article/20/10/whats-new-gnome-338
[4]: https://opensource.com/sites/default/files/uploads/installing-gnome-os.png (Installing GNOME OS)
[5]: https://creativecommons.org/licenses/by-sa/4.0/
[6]: https://opensource.com/sites/default/files/uploads/booting-gnome-os.png (Booting GNOME OS)
[7]: https://opensource.com/sites/default/files/uploads/running-gnome-os.png (Running GNOME OS)
[8]: https://ostreedev.github.io/ostree/
[9]: https://os.gnome.org/
[10]: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/wikis/home

View File

@@ -0,0 +1,198 @@
[#]: collector: "lujun9972"
[#]: translator: "xiao-song-123"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "5 steps to learn any programming language"
[#]: via: "https://opensource.com/article/20/10/learn-any-programming-language"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
学习任何编程语言的 5 个步骤
======
只需一点编程经验,您就可以在几天内(有时更少)学习一种新语言。
![Learning to program][1]
有些人喜欢学习新的编程语言,也有一些人连学习一种都是可望不可即的事情。在本文中,我将向您展示如何像程序员一样思考,以便您可以自信地学习所需的任何编程语言。
事实上,一旦您学会了如何编程,您使用的语言就不再是一个障碍,而更像是一种形式。这只是教育家们倡导 [让孩子尽早学习编程][2] 的众多原因之一。不管他们的入门语言有多简单,这种编程的逻辑和儿童(或成人学习者)以后可能遇到的其他东西的逻辑有着相同之处。
只需有一点编程经验(您可以从 Opensource.com 上的任何一篇介绍性文章中获得),您就可以在几天内(有时更短)学习任何编程语言。这并不是魔法,现在您也必须要为此付出一些努力。诚然,学习一种语言每个的可用库,或者学习打包代码以及进行交付的细微差别,需要的时间远远不止几天。但是,就入门来说,比您想像中的要容易许多,剩下的则要通过不断练习来完成。
当有经验的程序员静下心来学习一门新的编程语言时,他们会寻找五样东西。只要您知道了这五件事,您就可以开始编码了。
### 1\. 语法
![Syntax][3]
(Seth Kenlon, [CC BY-SA 4.0][4])
语言的语法描述了代码的结构。这包括如何逐行编写代码,以及用于构造代码语句的实际单词。
例如,[Python][5] 因使用缩进来指示一个代码块在哪里结束以及另一代码块在哪里开始而闻名:
```
while j &lt; rows:
    while k &lt; columns:
        tile = Tile(k * w)
        board.add(tile)
        k += 1
    j += 1
    k = 0
```
[Lua][6] 只是使用关键字 `end`:
```
for i,obj in ipairs(hit) do
  if obj.moving == 1 then
     obj.x,obj.y = v.mouse.getPosition()
  end
end
```
[Java][7], [C][8], C++, 和类似的编程语言使用花括号:
```
while (std::getline(e,r)) {
  wc++;
  }
```
编程语言的语法还包括包括库、设置变量和终止行等内容。通过练习,您将学会在阅读示例代码时下意识地识别语法需求(和惯例)。
#### 实践
当学习一门新的编程语言时,要努力理解它的语法。您不需要去记住它,只需要知道如果忘记了以后去哪里看。使用好的 [IDE][9] 也很有帮助,因为很多 IDE 在出现语法错误时会提醒您。
### 2\. 内置函数和条件
![built-in words][10]
(Seth Kenlon, [CC BY-SA 4.0][4])
就像自然语言一样,编程语言可以识别的合法单词是有限的。这个词汇表可以使用其他库进行扩展,但是核心语言知道一组特定的关键字。大多数语言并没有您想的那么多关键字。即使在像 C 语言这样非常低级的语言中,也只有 32 个关键字,比如 `for`, `do`, `while`, `int`, `float`, `char`, `break` 等等。
了解了这些关键字,您就可以编写基本的表达式,也就是构建程序的代码块。许多内置的关键字能帮助您构建条件语句,这些条件语句影响整个程序的流程。例如,如果您想编写一个允许单击和拖动图标的程序,那么您的代码就必须检测用户的鼠标指针何时位于图标上。只有当鼠标光标位于图标外部边缘相同的坐标时,才执行导致使鼠标抓取图标的代码。这是一个经典的 if / then 语句,不同的语言可以用不同的方式表达。
Python 使用 `if`, `elif ``else` 的组合来实现条件语句,但是并不显式的关闭语句:
```
if var == 1:
    # action
elif var == 2:
    # some action
else:
    # some other action
```
[Bash][11] 使用 `if`, `elif`, `else`, 并且使用 `fi` 来结束语句:
```
if [ "$var" = "foo" ]; then
   # action
elif [ "$var" = "bar" ]; then
   # some action
else
   # some other action
fi
```
然而 C 和 Java, 使用 `if`, `else``else if`, 用花括号把它们括起来:
```
if (boolean) {
   // action
} else if (boolean) {
   // some action
} else {
   // some other action
}
```
各种编程语言虽然在关键字的选择和语法上有细微的变化,但基本是相同的。学习如何在编程语言中定义条件语句,包括 `if/then`, `do...while``case` 语句。
#### 实践
要去熟悉编程语言能够理解的关键字集。在实践中,您的代码将不仅仅包含一种语言的关键字。可以肯定的是,有许多库中包含一些简单的函数,它们可以帮助您完成诸如将输出打印到屏幕或显示窗口之类的操作。然而,驱动这些库的逻辑始于编程语言的内置关键字。
### 3\. 数据类型
![Data types][12]
(Seth Kenlon, [CC BY-SA 4.0][4])
代码是用来处理数据的,因此您必须学习编程语言如何识别不同类型的数据。所有编程语言都能理解整数,大多数的语言能理解小数和单个字符 (a, b, c 等等)。它们通常被表示为 `int` , `float``double``char`, 当然,语言的内置词汇表会告诉您如何引用这些实体。
有时候在编程语言中内置了一些额外的数据类型也有时是通过引用库来启用复杂的数据类型。例如Python 可以识别关键字为 `str` 的字符串,但是 C 语言的代码中必须包含 `string.h` 头文件才能实现字符串特性。
#### 实践
库可以为您的代码解锁所有类型的数据,但是学习编程语言中包含的基本数据类型是一个明智的起点。
### 4\. 运算符和解析器
![Operators][13]
(Seth Kenlon, [CC BY-SA 4.0][4])
一旦您理解了编程语言可处理的数据类型,就可以学习如何分析这些数据了。幸运的是,数学这门学科是相当稳定的,所以算数运算符在许多语言中通常是相同的(或至少非常相似)。例如,两个整数相加通常用 `+` 符号完成,而测试一个整数是否大于另一个整数通常用 `>` 符号完成。测试是否相等通常使用 `==` 来完成(是的,是两个等号,因为通常一个等号用来赋值)。
当然也有一些例外,比如像 Lisp 和 Bash 语言算数运算符就不是如此,但与其他语言一样,这只是一个音译的问题。一旦您了解了表达方式有何不同,很快就可以适应它。快速回顾一门编程语言的算数运算符通常足以让您了解算数操作是如何完成的。
您还需要知道如何比较和操作非数值数据比如字符和字符串。这些通常是通过编程语言的核心库来进行的的。例如Python 提供了 `split()` 方法,而 C 语言需要引入头文件 `string.h` 来提供 `strtok()` 函数。
#### 实践
了解用于处理基本数据类型的基本函数和关键字,并寻找可帮助您完成复杂操作的核心库。
### 5\. 函数
![Class][14]
(Seth Kenlon, [CC BY-SA 4.0][4])
代码不只是计算机的待办清单。通常情况下,在编写代码时您往往希望向计算机提供一组理论条件和一组操作指令,当满足每个条件时计算机就会采取这些操作。尽管使用条件语句以及数学和逻辑运算符进行流控制可以做很多事情,但是引入了函数和类之后,代码会变得更加高效,因为它们使您可以定义子程序。 例如,如果应用程序需要非常频繁地确认一个对话框,那么将其作为类的实例编写一次要比每次需要它时重新编写实现起来要容易得多。
您需要学习如何在编程语言中定义类和函数。更准确地说,您首先需要了解编程语言中是否支持类和函数。大多数现代语言都支持函数,但是类是面向对象的编程语言中所特有的。
#### 实践
学习语言中可用的结构,这些结构可以帮助您高效地编写和使用代码。
### 您可以学到任何东西
学习编程语言,就其本身而言,是一种编码过程中的子程序。一旦理解了代码如何工作,您所使用的语言就只是一种传递逻辑的媒介。学习一门新语言的过程几乎都是一样的:通过简单的练习来学习语法,通过学习词汇来积累进行复杂动作的能力,然后练习、练习、再练习。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/learn-any-programming-language
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[xiao-song-123](https://github.com/xiao-song-123)
校对:[校对者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/learn-programming-code-keyboard.png?itok=xaLyptT4 "Learning to program"
[2]: https://opensource.com/article/20/9/scratch
[3]: https://opensource.com/sites/default/files/uploads/syntax_0.png "Syntax"
[4]: https://creativecommons.org/licenses/by-sa/4.0/
[5]: https://opensource.com/downloads/cheat-sheet-python-37-beginners
[6]: https://opensource.com/article/20/2/lua-cheat-sheet
[7]: https://opensource.com/downloads/java-cheat-sheet
[8]: https://opensource.com/downloads/c-programming-cheat-sheet
[9]: https://opensource.com/resources/what-ide
[10]: https://opensource.com/sites/default/files/uploads/builtin.png "built-in words"
[11]: https://opensource.com/downloads/bash-cheat-sheet
[12]: https://opensource.com/sites/default/files/uploads/type.png "Data types"
[13]: https://opensource.com/sites/default/files/uploads/operator.png "Operators"
[14]: https://opensource.com/sites/default/files/uploads/class.png "Class"

View File

@@ -0,0 +1,120 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (KDE Neon vs Kubuntu: Whats the Difference Between the Two KDE Distribution?)
[#]: via: (https://itsfoss.com/kde-neon-vs-kubuntu/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
KDE Neon vs Kubuntu两款 KDE 发行版有什么区别?
======
当你发现两款基于 [Ubuntu][1] 并由 [KDE][2] 驱动的 Linux 发行版,你会选择哪一个?
* [Kubuntu][3] 是 Ubuntu 的官方 KDE 版本。
* [KDE Neon][4] 是 KDE 自己发布的基于 Ubuntu 的发行版。
我知道这常常会让人感到困惑,尤其是当你从来没有使用过这两个版本,但得到了使用它们的建议。因此,为了帮助你做出决定,我想整理了一份 KDE Neon 和 Kubuntu 的区别(和相似之处)。
让我们先开始了解相似之处,然后再继续了解不同之处。
**注:**_根据你的系统你对这两个发行版的体验可能有所不同。所以请把这篇文章作为一个参考而不是一个”哪个更好“的比较。_
### KDE Neon vs Kubuntu功能上的比较
![][5]
比较发行版相似性来总是好的。所以,从理论上,我试图把最重要的区别写下来。
然而,值得注意的是,发行版的兼容性、性能和稳定性会根据你的硬件而有所不同,而这里没有考虑到这一点。
#### Ubuntu 作为基础
![][6]
是的,这两个 Linux 发行版都是基于 Ubuntu 的,但 KDE Neon 只基于最新的 Ubuntu LTS 版本,而 Kubuntu 则提供了基于 Ubuntu LTS 的版本和非 LTS 版本。
所以,如果使用 KDE Neon你可以期望在下一个 Ubuntu LTS 版本2 年)的几个月后就能用上最新的 Ubuntu 功能。但是,对于 Kubuntu 来说,你可以选择一个非 LTS 版本,并尝试使用最新的 Ubuntu 版本的 6 个月的软件更新。
KDE Neon 确实提供了测试版和开发者版,但这些都是为了测试预发布的 KDE 软件。
#### KDE Plasma 桌面
![][7]
尽管这两个发行版都采用了 KDE plasma 桌面,而且你可以获得相同程度的定制,但 KDE Neon 会首先获得最新的 KDE Plasma 桌面。
如果你还不知道KDE Neon 是由 KDE 官方团队开发的,由 Jonathan RiddellKubuntu 创始人)在[被 Canonical 强制退出 Kubuntu][8] 后宣布的。
所以,不仅仅局限于最新的 Plasma 桌面,如果你想尽快获得最新最好的 KDEKDE Neon 是最佳选择。
Kubuntu 最终会得到更新的 KDE 软件的更新,但这需要时间。如果你不太确定最新的 KDE 软件/桌面,而你需要的只是一个稳定的 KDE 系统,你应该选择 Kubuntu LTS 版本。
#### 预装软件
开箱即用,你会发现 Kubuntu 已经预装了一些必要的工具和应用程序,但是,对于 KDE Neon你需要找到并安装一些应用和工具。
为了给你一些视角,与 Kubuntu 相比KDE Neon 可能是一个轻量级的发行版。然而,对于新的 Linux 用户来说,他们可能会发现 Kubuntu 是一个易于使用的体验,并预装了更多必要的软件和工具。
#### 软件更新
如果你没有使用按流量计费的连接,这可能根本不重要。但是,我应该提一下,考虑到常规的 Ubuntu LTS 修复/更新以及 KDE 软件更新KDE Neon 会得到更多的软件更新。
对于 Kubuntu你只会得到 Ubuntu LTS 的更新(除非你使用的是非 LTS 版本)。所以,从技术上讲,你会得到更少的更新数量。
#### Ubuntu KDE 版与 Plasma 的体验差异
![][11]
我知道如果你没有尝试过这两个版本你可能会认为它们很相似。但是Kubuntu 是 Ubuntu 的官方版本,它更注重在 KDE 桌面环境上使用 Ubuntu 的体验。
而 KDE Neon 在技术上是一样的,但它的目的是为了获得一流的 Plasma 桌面体验,并搭载最新的东西。
尽管这两个发行版开箱即可完美工作,但它们有不同的愿景,而开发也相应地进行。你只需要决定你自己想要什么,然后选择其中之一。
#### 硬件兼容性
![Kubuntu Focus Laptop][12]
正如我前面提到的,这不是一个基于事实的观点。但是,根据我在网上快速了解用户分享的反馈或经验,似乎 Kubuntu 可以与各种旧硬件以及新硬件(可能追溯到 2012 年)一起工作,而 KDE Neon 可能不能。
只需要记住,如果你尝试 KDE Neon但由于某些原因不能工作。你知道该怎么做。
**总结**
那么你会选择哪个呢KDE Neon 还是 Kubuntu这完全是你的选择。
两者都是[初学者友好的 Linux 发行版][13]的不错选择,但如果你想要最新的 KDE Plasma 桌面KDE Neon 会更有优势。你可以在我们的 [KDE Neon 评测][10]中阅读更多关于它的内容。
欢迎在下面的评论中告诉我你的想法,你觉得它们中的任何一个有什么好的/坏的地方。
--------------------------------------------------------------------------------
via: https://itsfoss.com/kde-neon-vs-kubuntu/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://ubuntu.com/
[2]: https://kde.org/
[3]: https://kubuntu.org
[4]: https://neon.kde.org
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-neon-vs-kubuntu.png?resize=800%2C450&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/install_ubuntu_8.jpg?resize=796%2C611&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-feat.png?resize=800%2C394&ssl=1
[8]: https://lwn.net/Articles/645973/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/kde-neon-review.jpg?fit=800%2C450&ssl=1
[10]: https://itsfoss.com/kde-neon-review/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-kde.jpg?resize=800%2C450&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-focus-laptop.jpg?resize=800%2C600&ssl=1
[13]: https://itsfoss.com/best-linux-beginners/