Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-01-25 10:11:30 +08:00
commit 4704f3d121
18 changed files with 1533 additions and 241 deletions

View File

@ -0,0 +1,73 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11814-1.html)
[#]: subject: (What's your favorite terminal emulator?)
[#]: via: (https://opensource.com/article/19/12/favorite-terminal-emulator)
[#]: author: (Opensource.com https://opensource.com/users/admin)
你最喜欢的终端模拟器是什么?
======
> 我们让社区讲述他们在终端仿真器方面的经验。以下是我们收到的一些回复。
![](https://img.linux.net.cn/data/attachment/album/202001/24/000846qsmpz7s7spig77qg.jpg)
终端仿真器的偏好可以说明一个人的工作流程。无鼠标操作能力是否必须具备?你想要标签页还是窗口?对于终端仿真器你还有什么选择的原因?是否有酷的因素?欢迎参加调查或给我们留下评论,告诉我们你最喜欢的终端模拟器。你尝试过多少种终端仿真器呢?
我们让社区讲述他们在终端仿真器方面的经验。以下是我们收到的一些回复。
“我最喜欢的终端仿真器是用 Powerline 定制的 Tilix。我喜欢它支持在一个窗口中打开多个终端。” —Dan Arel
“[urxvt][2]。它可以通过文件简单配置,轻巧,并且在大多数程序包管理器存储库中都很容易找到。” —Brian Tomlinson
“即使我不再使用 GNOMEgnome-terminal 仍然是我的首选。:)” —Justin W. Flory
“现在 FC31 上的 Terminator。我刚刚开始使用它我喜欢它的分屏功能对我来说感觉很轻巧。我正在研究它的插件。” —Marc Maxwell
“不久前,我切换到了 Tilix它完成了我需要终端执行的所有工作。:) 多个窗格、通知,很精简,用来运行我的 tmux 会话很棒。” —Kevin Fenzi
“alacritty。它针对速度进行了优化是用 Rust 实现的,并且具有很多常规功能,但是老实说,我只关心一个功能:可配置的字形间距,使我可以进一步压缩字体。” —Alexander Sosedkin
 
“我是个老古板KDE Konsole。如果是远程会话请使用 tmux。” —Marcin Juszkiewicz
“在 macOS 上用 iTerm2。是的它是开源的。:-) 在 Linux 上是 Terminator。” —Patrick Mullins
“我现在已经使用 alacritty 一两年了,但是最近我在全屏模式下使用 cool-retro-term因为我必须运行一个输出内容有很多的脚本而它看起来很酷让我感觉很酷。这对我很重要。” —Nick Childers
“我喜欢 Tilix部分是因为它擅长免打扰我通常全屏运行它里面是 tmux而且还提供自定义热链接支持在我的终端中rhbz1234 之类的文本是将我带到 Bugzilla 的热链接。类似的还有 LaunchPad 提案OpenStack 的 Gerrit 更改 ID 等。” —Lars Kellogg-Stedman
“Eterm在使用 Vintage 配置文件的 cool-retro-term 中,演示效果也最好。” —Ivan Horvath
“Tilix +1。这是 GNOME 用户最好的选择,我是这么觉得的!” —Eric Rich
“urxvt。快速、小型、可配置、可通过 Perl 插件扩展,这使其可以无鼠标操作。” —Roman Dobosz 
“Konsole 是最好的,也是 KDE 项目中我唯一使用的应用程序。所有搜索结果都高亮显示是一个杀手级功能,据我所知没有任何其它 Linux 终端有这个功能(如果能证明我错了,那我也很高兴)。最适合搜索编译错误和输出日志。” —Jan Horak
“我过去经常使用 Terminator。现在我在 Tilix 中克隆了它的主题(深色主题),而感受一样好。它可以在选项卡之间轻松移动。就是这样。” —Alberto Fanjul Alonso
“我开始使用的是 Terminator自从差不多过去这三年我已经完全切换到 Tilix。” —Mike Harris
“我使用下拉式终端 X。这是 GNOME 3 的一个非常简单的扩展,使我始终可以通过一个按键(对于我来说是`F12`)拉出一个终端。它还支持制表符,这正是我所需要的。 ” —Germán Pulido
“xfce4-terminal支持 Wayland、缩放、无边框、无标题栏、无滚动条 —— 这就是我在 tmux 之外全部想要的终端仿真器的功能。我希望我的终端仿真器可以尽可能多地使用屏幕空间,我通常在 tmux 窗格中并排放着编辑器Vim和 repl。” —Martin Kourim
“别问,问就是 Fish ;-)” —Eric Schabell
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/favorite-terminal-emulator
作者:[Opensource.com][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/admin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals_0.png?itok=XwIRERsn (Terminal window with green text)
[2]: https://opensource.com/article/19/10/why-use-rxvt-terminal

View File

@ -1,22 +1,25 @@
[#]: collector: (lujun9972)
[#]: translator: (FSSlc)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11813-1.html)
[#]: subject: (Locking and unlocking accounts on Linux systems)
[#]: via: (https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
在 Linux 系统中禁用与解禁用户的账号
======
总有这样的时候:有时你需要禁用某位 Linux 用户的账号,有时你还需要反过来解禁用户的账号。
> 总有这样的时候:有时你需要禁用某位 Linux 用户的账号,有时你还需要反过来解禁用户的账号。
本文将介绍一些管理用户访问的命令,并介绍它们背后的原理。
![](https://images.idgesg.net/images/article/2019/10/cso_cybersecurity_mysterious_padlock_complex_circuits_gold_by_sqback_gettyimages-1177918748_2400x1600-100813830-large.jpg)
假如你正管理着一台 [Linux][1] 系统,那么很有可能将遇到需要禁用一个账号的情况。可能是某人已经换了职位,他们是否还需要该账号仍是个问题;或许有理由相信再次使用该账号并没有大碍。不管上述哪种情况,知晓如何禁用账号并解禁账号都是你需要知道的知识。
需要你记住的一件重要的事是尽管有多种方法来禁用账号,但它们并不都达到相同的效果。假如用户使用公钥/私钥来使用该账号而不是使用密码来访问,那么你使用的某些命令来阻止用户获取该账号或许将不会生效。
### 使用 `passwd` 来禁用一个账号
### 使用 passwd 来禁用一个账号
最为简单的用来禁用一个账号的方法是使用 `passwd -l` 命令。例如:
@ -25,6 +28,7 @@ $ sudo passwd -l tadpole
```
上面这个命令的效果是在加密后的密码文件 `/etc/shadow` 中,用户对应的那一行的最前面加上一个 `!` 符号。这样就足够阻止用户使用密码来访问账号了。
在没有使用上述命令前,加密后的密码行如下所示(请注意第一个字符):
```
@ -37,7 +41,7 @@ $6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7R
!$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7:::
```
在 tadpole 下一次尝试登录时, 他可能会使用他原有的密码来尝试多次登录,但就是无法再登录成功了。另一方面,你则可以使用下面的命令来查看他这个账号的状态(-S = status
在 tadpole 下一次尝试登录时,他可能会使用他原有的密码来尝试多次登录,但就是无法再登录成功了。另一方面,你则可以使用下面的命令来查看他这个账号的状态(`-S` = status
```
$ sudo passwd -S tadpole
@ -57,7 +61,7 @@ passwd: password expiry information changed.
但使用这种方式的问题是如果用户使用公钥/私钥对的方式来访问他/她的账号,这种方式将不能阻止他们使用该账号。
### 使用 `chage` 命令来禁用账号
### 使用 chage 命令来禁用账号
另一种禁用用户账号的方法是使用 `chage` 命令,它可以帮助管理用户账号的过期日期。
@ -67,7 +71,7 @@ $ sudo passwd -S tadpole
tadpole P 10/15/2019 0 99999 7 -1
```
`chage` 命令将`/etc/shadow` 文件做出显著的变化。在这个使用 `:` 来分隔的文件(下面将进行展示)中,某行的第 8 项将被设置为 `0` (先前为空),这就意味着这个账号已经过期了。 `chage` 命令将追踪密码更改期间的日期数目,但给出选项是它也可以提供账号过期信息。第 8 项如果是 0 则意味着这个账号在 1970 年 1 月 1 日后的一天过期,当使用上面显示的那个命令时可以用来禁用账号。
`chage` 命令将会稍微修改 `/etc/shadow` 文件。在这个使用 `:` 来分隔的文件(下面将进行展示)中,某行的第 8 项将被设置为 `0`(先前为空),这就意味着这个账号已经过期了。`chage` 命令会追踪密码更改期间的天数,通过选项也可以提供账号过期信息。第 8 项如果是 0 则意味着这个账号在 1970 年 1 月 1 日后的一天过期,当使用上面显示的那个命令时可以用来禁用账号。
```
$ sudo grep tadpole /etc/shadow | fold
@ -84,9 +88,8 @@ nXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::0:
% sudo chage -E-1 tadpole
```
一旦一个账号使用这种方式被禁用,即便是免密的 [SSH][4] 登录也不能再访问该账号了。
一旦一个账号使用这种方式被禁用,即便是无密码的 [SSH][4] 登录也不能再访问该账号了。
最后请加入我们在 [Facebook][5] 和 [LinkedIn][6] 上的社区来对你感兴趣的话题进行评论。
--------------------------------------------------------------------------------
@ -95,7 +98,7 @@ via: https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,102 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Survey: Digital transformation can reveal network weaknesses)
[#]: via: (https://www.networkworld.com/article/3516030/survey-digital-transformation-can-reveal-network-weaknesses.html)
[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/)
Survey: Digital transformation can reveal network weaknesses
======
When enterprises embraced digital transformation, some found their existing networks had a limited ability to address cloud connectivity or access for mobile users.
Metamorworks / Getty Images
[Digital transformation][1] is a catch-all phrase that describes the process of using technology to modernize or even revolutionize how services are delivered to customers. Not only technology but also people and processes commonly undergo fundamental changes for the ultimate goal of significantly improving business performance.
Such transformations have become so mainstream that IDC estimated that 40% of all technology spending now goes toward digital transformation projects, with enterprises spending in excess of $2 trillion on their efforts through 2019.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][2]
Every companys digital transformation project is unique. Whether its transforming a companys marketing and sales processes by using machine learning to garner deep insights on each and every customer, or building a seamless experience across sales channels and revamping distribution channels to provide the best products and resources to customers, a digital-transformation project is going to be dependent on as well as have an impact on the enterprises network infrastructure.
[][3]
BrandPost Sponsored by HPE
[Take the Intelligent Route with Consumption-Based Storage][3]
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
Many companies assume their networks can handle these changes. But can they? Do these new ways of working strain the existing network infrastructure by imposing new requirements for agility, cloud access, security and mobility?
### Gauging Confidence in the Network Post-Digital Transformation
A recent survey of more than 1,300 IT professionals dared to ask about the impact of digital transformation on each respondents enterprise network. Having just conducted its fourth annual state of the WAN survey at the end of 2019, Cato Networks issued the report, [Networking in 2020: Understanding Digital Transformations Impact on IT Confidence in Enterprise Networks][4]_._ Steve Taylor, publisher and editor-in-chief of Webtorials.Com, and Dr. JimMetzler, principal at Ashton,Metzler, and Associates, were instrumental in designing and the analyzing the results from the portion of the survey relating to digital transformation. There are some worthy observations here for network managers.
The study looked at networking and security priorities for IT professional in 2020. As part of that process, the study sought to identify how ready enterprise networks are for the digital era. According to the report, “The modern business has data and users residing everywhere. And just as the enterprise network provided performance and security to data centers and branch offices in the past, so, too, it must provide performance and security to the cloud and mobile users—both hallmarks of digital initiatives.” Without a network that delivers the right infrastructure with the right performance and security levels anywhere, digital transformation efforts can run aground.
1,333 respondents took part in the survey in late 2019. Qualified respondents were those who work in IT and are involved in the purchase of telco services for enterprises with an SD-WAN or MPLS backbone (or a mix of MPLS and Internet VPN). The vast majority of the respondents say they are moderately or extremely involved in their organizations digital transformation initiatives.
More than half of respondents identified working for companies with a global or regional footprint. Nearly half of respondents work for companies with more than 2,500 employees. The vast majority said their organization spans 11 or more locations, with a quarter of the respondents from companies with more than 100 locations. All respondents companies have some cloud presence and most have two or more physical [data centers][5].
To gauge the impact of digital transformation on the network, the survey asked a number of qualitative questions pertaining to network characteristics that include agility, security, performance, and management and operations. For each characteristic, the study looked at the “network confidence level”; that is, whether the respondent feels more or less confident in the networks capabilities in that area following the deployment of the transformation project. The study segmented respondents by the type of network they operate—[MPLS][6], hybrid (MPLS and Internet-based VPN), [SD-WAN][7], or [SASE][8] (secure access service edge, pronounced “sassy”). SASE converges SD-WAN and other networking capabilities and a complete security stack into a global, cloud-native platform. (Disclosure: Report publisher Cato Networks delivers an SD-WAN service and also bills itself as the worlds first SASE platform.)
**Overall Findings**
Ill get to the results about network confidence level in a moment. First lets look at some general information disclosed in the report:
* Budgets are growing in 2020. Respondents report that both their network and their security budgets are expected to grow in 2020. Thats good news, considering both areas are being asked to do more.
* Site connectivity continues to drive the major networking challenges for 2020. This includes bandwidth costs, performance between locations, and managing the network.
* Mobility is becoming strategic for network buyers. The importance of managing mobile and remote access grew significantly since the last annual survey. Addressing this need has become another top networking challenge.
* Security is an essential consideration for [WAN][9] transformation. Enterprises must have a multi-edge security strategy that includes defending against emerging threats like malware/ransomware, enforcing corporate security policies on mobile users, and full awareness of the cost of buying and managing security appliances and software.
* The most critical applications are now in the cloud. More than half (60%) of all respondents indicate that their organizations most critical applications will be hosted in the cloud over the next 12 months. This has a huge impact on how users will access the cloud via their WAN.
* Digital initiatives are driving a rethinking of legacy networks. More than half of the respondents whose organizations still rely on MPLS say their organizations are actively planning to deploy SD-WAN in the next 12 months to lower costs and support new business initiatives.
### Digital transformations rattle network confidence
To better understand why enterprises are abandoning MPLS and what lessons can be derived for any WAN transformation initiatives, respondents were asked to rate a series of statements evaluating their perceptions of their networks agility, management and operations, performance, and security. The respondents were then grouped by their network in order to assess the change in network confidence pre- and post-digital transformation.
With one exception, respondents express lower confidence in their networks post-digital transformation. This is true in areas of MPLSs presumed strength, such as performance, and its even true for hybrid networks as well as for SD-WAN. As organizations roll out digital initiatives, they uncover the weaknesses in their existing networks, such as a limited ability to address cloud connectivity or mobile user access.
According to the report, the only exception is when respondents run a SASE architecture. They express greater confidence post-digital transformation. SASEs convergence of SD-WAN with security, cloud connectivity, and mobility is well suited for digital transformation but may only be appreciated when required by the business.
Going back to the network characteristics of agility, security, performance, and management and operations, lets look at how each one is perceived in terms of respondents network confidence.
* Network agility This characteristic includes the ability to add new sites, adjust available bandwidth, add cloud resources, and generally adapt quickly to changing business needs. Its understandable that respondents with an MPLS-based network would rate their confidence in network agility as low, but confidence among respondents who deployed an SD-WAN dropped the most when asked about rapidly delivering new public cloud infrastructure. The opposite is also true: SASEs built-in cloud connectivity is a major factor in respondents being more confident in their network agility post-digital transformation.
* Security Its critical to protect users and resources regardless of the underlying network. MPLS does not protect resources and users, and certainly not those connected to the Internet, leading MPLS-only respondents to be significantly less confident in their networks security post-digital transformation. SD-WAN respondents also demonstrate lower confidence in security post-digital transformation, largely because SD-WAN on its own fails to restrict access to specific applications or provide the advanced security tools needed to protect all edges mobile devices, sites, and cloud resources. By contrast, SASE confidence grew post-digital transformation. Converging a complete security stack into the network allows SASE to bring granular control to sites, mobile, and cloud resources.
* Performance Delivering cloud resources presents problems for MPLS and SD-WAN. Users expect their cloud application experience to be as responsive as on-premises applications. This point plays a significant role in performance confidence. When asked if respondents can provide access to cloud-based resources with the performance and availability comparable to internally hosted resources, respondents with MPLS, hybrid WAN, and SD-WAN networks showed significant drop-off in confidence post-digital transformation. On the other hand, SASE solutions that include native cloud optimization improve cloud performance out-of-the-box, making those network owners more confident that they can deliver what users need.
* Management and operations Respondent confidence was high before digital transformation but dropped off post-digital transformation across all network types except for SASE. According to the report, the lack of redundant last mile connections with MPLS leaves sites susceptible to cable cuts and other last mile problems. Adding Internet VPNs to MPLS improves last mile access but still does not allow organizations to automatically overcome last mile issues without downtime. SD-WAN and SASE are better able to overcome last mile issues with active/active configurations.
Digital transformation initiatives can vastly change network traffic patterns, bandwidth requirements, access locations, and security needs. These changes might not be apparent until the project is fully deployed. Every organization needs a network infrastructure that provides adequate performance, security, agility and manageability to support digital initiatives, now and into the future. Some network architectures are better at providing those characteristics than others are. IT organizations that want to be confident in their networks ability to meet the future need to consider areas such as cloud, mobility and especially security when transforming their WANs today.
Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3516030/survey-digital-transformation-can-reveal-network-weaknesses.html
作者:[Linda Musthaler][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Linda-Musthaler/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/article/3512830/how-to-deal-with-the-impact-of-digital-transformation-on-networks.html
[2]: https://www.networkworld.com/newsletters/signup.html
[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[4]: https://go.catonetworks.com/Survey-Networking-in-2020.html
[5]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html
[6]: https://www.networkworld.com/article/2297171/network-security-mpls-explained.html
[7]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html
[8]: https://www.networkworld.com/article/3453030/sase-is-more-than-a-buzzword-for-bioivt.html
[9]: https://www.networkworld.com/article/3248989/what-is-a-wan-wide-area-network-definition-and-examples.html
[10]: https://www.facebook.com/NetworkWorld/
[11]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,54 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Gartner: Data-center spending will inch up this year)
[#]: via: (https://www.networkworld.com/article/3515314/data-center-spending-will-inch-up-in-year-of-accelerated-it-investment-gartner.html)
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
Gartner: Data-center spending will inch up this year
======
After a down year in 2019, IT spending will pick up this year, led by enterprise software and the cloud, according to IT research firm Gartner, including an uptick for data-center spending that had takend a dip.
Getty Images
Global IT spending could reach $3.865 trillion in 2020, up 3.4% over 2019, according to newly released data from IT research firm Gartner. In comparison, 2019 saw just 0.5% growth over 2018 levels. Spending is expected to continue to climb into 2021, surpassing the $4 trillion mark with 3.7% growth.
Spending on hardware including edge devices and data center hardware will be deemphasized, while investments in software and services, including cloud, will see an increase, the firm predicts.
**READ MORE:** [Data centers in 2020 will feature greater automation, cheaper memory][1]
"With the waning of global uncertainties, businesses are redoubling investments in IT as they anticipate revenue growth, but their spending patterns are continually shifting," said John-David Lovelock, distinguished research vice president at Gartner, in a statement.
After a decline of 2.7% in 2019, data center systems sales will grow 1.9% in 2020, while devices everything from laptops to printers to smartphones will rise just 0.8% in 2020 after a 4.3% decline in 2019.
IT services will rise 5.0%, increasing its momentum over 2019, which saw a rise of 3.6%. But the real action will be in enterprise software, which is expected to grow 10.5% this year. This includes both on-premises software (such as Microsoft, Oracle) and cloud services. More of the spending growth is aimed at SaaS than on-premises software, Gartner notes.
"Almost all of the market segments with enterprise software are being driven by the adoption of software as a service (SaaS)," Lovelock said. "We even expect spending on forms of software that are not cloud to continue to grow, albeit at a slower rate. SaaS is gaining more of the new spending, although licensed-based software will still be purchased and its use expanded through 2023."
In a conference call with clients, Lovelock said there has been a shift over the last three years, where the world is going from "'we like all tech' to 'we like softer tech and not all tech.'" The trend is toward consulting, software, and the cloud, the softest of tech.
The weakest segment is mobile devices. It's not that people dont want them any longer, but in the mobile device space there is no more must-have feature, nothing to make people line up for days in advance like we saw a decade ago with each new iPhone release. "People are happy with the devices they have. The market is down to a replacement market so they extend their spending," Lovelock said.
In data center space, there's a similar pattern. Servers last longer, and at the same time, more work is being done outside the company at colocations and the cloud.
"The cloud is taking a lot [of money] out of the data center," Lovelock said. "SaaS and IaaS are all viable for organizations but taking data center dollars. Where we keep saying software is growing most quickly, thats very true. But recognize that it is also taking money from other areas. Budgets arent going up, concentrations in spending is where we are seeing things happen."
Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3515314/data-center-spending-will-inch-up-in-year-of-accelerated-it-investment-gartner.html
作者:[Andy Patrizio][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Andy-Patrizio/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/article/3487684/data-centers-in-2020-automation-cheaper-memory.html
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,70 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How Open-RAN could white-box 5G)
[#]: via: (https://www.networkworld.com/article/3516075/how-open-ran-could-white-box-5g.html)
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
How Open-RAN could white-box 5G
======
Open-hardware, software-defined mobile radio infrastructure could kick-start private LTE and 5G and perhaps eventually lead to their supremacy over Wi-Fi for enterprises.
mrdoomits / Getty Images
One of Britains principal mobile networks, O2, has just announced that it intends to deploy Open Radio Access Network technology (O-RAN) in places.
O-RAN is a wireless industry initiative for designing and building radio network solutions using “a general-purpose, vendor-neutral hardware and software-defined technology,” explains Telecom Infra Project, the body responsible, on its website.
TIP is the trade body that, along with Intel and Vodafone, conceived of the technology alternative an attempt at toppling the dominance of Ericsson, Huawei and Nokia, which provide almost all mobile telco infrastructure now.
[][1]
BrandPost Sponsored by HPE
[Take the Intelligent Route with Consumption-Based Storage][1]
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
O2 joins fellow UK mobile operator Vodafone, which is also experimenting with O-RAN.
O2 is working with partners including; Mavenir, DenseAir and WaveMobile to introduce O-RAN solutions, [the Telefónica-owned network says in a press release][2].
What it means by that is that by encouraging less powerful, smaller vendors to provide infrastructure, the grip that Ericsson, Huawei and Nokia hold over mobile networks might be lessened. Costs could be reduced because those big three would have to reduce prices to remain competitive.
But most interestingly, it also allows for the standardizing of telco infrastructure, possibly making future private mobile networks cheaper and easier to implement. Private LTE and 5G networks are expected to genearate $4.7 billion in revenue by the end of this year, [according to an SNS Telecom & IT report published in October][3]. That number is expected to be $8 billion by the end of 2023.
**[ Dont miss [customer reviews of top remote access tools][4] and see [the most powerful IoT companies][5] . | Get daily insights by [signing up for Network World newsletters][6]. ]**
Indeed, white-box telco equipment might be the result. White-box IT hardware is used in enterprises, and could be advantageous in telco equipment, too. Conceivably, as telco equipment prices and availability became more within reach, along with the availability of new, unlicensed, shared spectrum, such as is being launched in the U.S. with Citizen Broadband Radio Service; then implementation of a an enterprise-level, private LTE or 5G network, with “white-box” hardware and programmable software-defined networks, may be one-day no harder than a Wi-Fi network install, common now.
“By providing authority over wireless coverage and capacity, private LTE and 5G networks ensure guaranteed and secure connectivity, while supporting a wide range of applications,” SNS Telecom & IT says of private mobile networks in its report. Factory robotics and IoT sensor  networks will be driving that investment. LTE and 5G are being pitched as more reliable than Wi-Fi, in part because of less congestion. Private mobile networks can be provided by existing mobile-network operators or built independently.
In the case of TIPs O-RAN, the vision is for modular base stations with a software stack functioning on common, off-the-shelf hardware, called COTS. Field-programmable gate arrays (FPGAs) are also part of the concept.
“Thus the main objective of this project is to have RAN solutions that benefit from the flexibility and pace of innovation associated with software-driven developments on fully programmable platforms,” [TIP said on its website][7] last year. The influence of Wi-Fi diminishes.
Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3516075/how-open-ran-could-white-box-5g.html
作者:[Patrick Nelson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Patrick-Nelson/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[2]: https://news.o2.co.uk/press-release/o2-to-further-improve-network-service-for-customers-using-open-radio-access-network-ran-technology/
[3]: https://www.snstelecom.com/private-lte
[4]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb
[5]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb
[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb
[7]: https://telecominfraproject.com/tip-project-group-feature-openran/
[8]: https://www.facebook.com/NetworkWorld/
[9]: https://www.linkedin.com/company/network-world

View File

@ -1,74 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What's your favorite terminal emulator?)
[#]: via: (https://opensource.com/article/19/12/favorite-terminal-emulator)
[#]: author: (Opensource.com https://opensource.com/users/admin)
What's your favorite terminal emulator?
======
We asked our community to tell us about their experience with terminal
emulators. Here are a few of the responses we received. Take our poll to
weigh in on your favorite.
![Terminal window with green text][1]
Preference of a terminal emulator can say a lot about a person's workflow. Is the ability to drive mouseless a must-have? Do you like to navigate between tabs or windows? There's something to be said about how it makes you feel, too. Does it have that cool factor? Tell us about your favorite terminal emulator by taking our poll or leaving us a comment. How many have you tried?
We asked our community to tell us about their experience with terminal emulators. Here are a few of the responses we received.
"My favorite terminal emulator is Tilix, customized with Powerline. I love that it supports multiple terminals open in a single window." —Dan Arel
"urxvt ([rxvt-unicode][2]). It's simple to configure via files, is lightweight, and readily available in most package manager repositories." —Brian Tomlinson
"gnome-terminal is still my go-to even though I don't use GNOME anymore. :)" —Justin W. Flory
"Terminator at this point on FC31.  I just started using it but like the split screen feature and it seems light enough for me. Investigating plugins." —Marc Maxwell
"I switched over to Tilix a while back and it does everything I need terminals to do. :) Multiple panes, notifications, lean and runs my tmux sessions great." —Kevin Fenzi
"alacritty. It's optimized for speed, implemented in Rust and generally feature packed, but, honestly speaking, I only care about one feature: configurable inter-glyph spacing that allows me to further condense my font. I'm so-o hooked." —Alexander Sosedkin
 
"I am old and grumpy: KDE Konsole. With tmux in it if session is remote." —Marcin Juszkiewicz
"iTerm2 for macOS. Yes, it's open source. :-) Terminator on Linux." —Patrick Mullins
 "I've been using alacritty for a year or two now, but recently I started also using cool-retro-term in fullscreen mode whenever I have to run a script that has a lot of output because it looks cool and makes me feel cool. This is important to me." —Nick Childers
 
"I love Tilix, partly because it's good at staying out of the way (I usually just run it full screen with tmux inside), but also for the custom hotlinking support: in my terminal, text like "rhbz#1234" is a hotlink that takes me to bugzilla. Similar for LaunchPad issues, Gerrit change ids for OpenStack, etc." —Lars Kellogg-Stedman
 
"Eterm, also presentations look best in cool-retro-term with Vintage profile." —Ivan Horvath
 
"+1 for Tilix. Its the best for an option for GNOME users, IMO!"  —Eric Rich
 
"urxvt. Fast. Small. Configurable. Extendable via perl plugins, which can make it mouseless." —Roman Dobosz 
 
"Konsole is the best, the only app I use from KDE project. The highlight of all search result occurrences is a killer feature which afaik does not have any other Linux terminal (glad if you prove me wrong). Best for searching compilation errors and output logs." —Jan Horak
 
"I use Terminator in past a lot. Now I cloned the theme (dark one) in Tilix and I didn't miss a thing. Is easy to move between tabs. That's all." —Alberto Fanjul Alonso
 
"Started my journey in using Terminator, I have since (in the past 3 years or so) completely switched over to Tilix." —Mike Harris
 
"I use Drop Down Terminal X. It's a very simple extension for GNOME 3 that lets me have a terminal always at the stroke of a single key (F12 for me). And it also supports tabs, which is kind of all I need." —Germán Pulido
 
"xfce4-terminal: wayland support, zoom, no borders, no title bar, no scroll bar - that's all I want from terminal emulator, for everything else I have tmux. I want my terminal emulator to use as much screen space as possible as I usually have editor (Vim) and repl side by side in tmux panes." —Martin Kourim
"Fish! Dont ask! ;-)" —Eric Schabell
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/favorite-terminal-emulator
作者:[Opensource.com][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/admin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals_0.png?itok=XwIRERsn (Terminal window with green text)
[2]: https://opensource.com/article/19/10/why-use-rxvt-terminal

View File

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

View File

@ -1,65 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (algzjh)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The best resources for agile software development)
[#]: via: (https://opensource.com/article/19/12/agile-resources)
[#]: author: (Leigh Griffin https://opensource.com/users/lgriffin)
The best resources for agile software development
======
Read our top articles that highlight the discussion around agile's past,
present, and what it may look like in the future.
![Women programming][1]
It has been a great year for agile topics on Opensource.com. As we approach the end of 2019, reviewed our top agile-related articles, as read by you, our readers!
### Small Scale Scrum guide
Opensource.com's six-part guide to [Small Scale Scrum][2] (which I helped co-author) advises smaller teams on how to bring agile into their work. The traditional scrum framework outlined in the official [Scrum Guide][3] recommends a minimum of three people for the framework to realize its full potential. However, it provides no guidance for how teams of one or two people can follow scrum successfully. Our six-part series aims to formalize Small Scale Scrum and examines our experience with it in the real world. The series was received very warmly by our readers—so much such that the six individual articles comprise 60% of our Top 10 list. So, if you haven't already, make sure to download them from our [_Introduction to Small Scale Scrum_ page][2].
### A comprehensive guide to agile project management
Teams following traditional project management approaches, initially skeptical about agile, have warmed up to the agile way of working. Now agile has reached acceptance, and a more flexible, hybrid style has found a home. [_A comprehensive guide to agile project management_][4] by Matt Shealy covers 12 guiding principles of agile project management and is perfect for traditional project managers looking to bring some agility to their projects.
### 4 steps to becoming an awesome agile developer
A DevOps culture has emerged in many modern software teams that embrace agile software development principles that leverage cutting-edge tooling and automation. But this mechanically agile approach does not guarantee that developers are following agile practices in their day-to-day work. In [_4 steps to becoming an awesome agile developer_][5], Daniel Oh gives great tips for increasing your agility by focusing on design thinking, using predictable approaches, putting quality at the center, and continuously learning and exploring. Complementing these methods with your agile tooling will create very flexible and strong agile developers.
### Scrum vs. kanban: Which agile framework is better?
Scrum and kanban are two of the most popular approaches for teams running in an agile manner, and in [_Scrum vs. kanban: Which agile framework is better?_][6] Taz Brown explores the history and purpose of both. While reading this article, a great saying came to my mind: "If the only tool in your toolbox is a hammer, every problem looks like a nail." Knowing when to use kanban and when to use scrum is important, and this article helps show that both have a place, depending on your team, your challenge, and your goals.
### 4 ways developers can have a say in what agile looks like
Developers often have a fear of having a workstyle imposed upon them when the topic of adopting agile comes up. In [_4 ways developers can have a say in what agile looks like_][7], [Clément Verna][8] looks at ways that developers can flip that narrative by helping to determine what agile looks like on their team. Examining the origins and the basics of agile is a great starting point, but the real value is in having metrics to help guide your journey. Knowing what challenges you can expect to have will give you a firm ground to move forward. And making decisions empirically not only empowers teams but gives them a sense of ownership of the journey. Verna's article also examines the importance of putting people over processes and working as a team to achieve your goals.
### Agile now and later
This year, Opensource.com authors created a lot of discussion around agile's past, present, and what it may look like in the future. Thank you to all of them, and be sure to [share your own agile story][9] here in 2020.
A look back at the tools Opensource.com covered in 2014 and 2015 , with updates on new releases,...
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/agile-resources
作者:[Leigh Griffin][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/lgriffin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming)
[2]: https://opensource.com/downloads/small-scale-scrum
[3]: https://scrumguides.org/scrum-guide.html
[4]: https://opensource.com/article/19/8/guide-agile-project-management
[5]: https://opensource.com/article/19/2/steps-agile-developer
[6]: https://opensource.com/article/19/8/scrum-vs-kanban
[7]: https://opensource.com/article/19/10/ways-developers-what-agile
[8]: https://twitter.com/clemsverna
[9]: https://opensource.com/how-submit-article

View File

@ -0,0 +1,91 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (6 things you should be doing with Emacs)
[#]: via: (https://opensource.com/article/20/1/emacs-cheat-sheet)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
6 things you should be doing with Emacs
======
Here are six things you may not have realized you could do with Emacs.
Then, get our new cheat sheet to get the most out of Emacs.
![Text editor on a browser, in blue][1]
Imagine using Python's IDLE interface to edit text. You would be able to load files into memory, edit them, and save changes. But every action you perform would be defined by a Python function. Making a word all capitals, for instance, calls **upper()**, opening a file calls **open**, and so on. Everything in your text document is a Python object and can be manipulated accordingly. From the user's perspective, it's the same experience as any text editor. For a Python developer, it's a rich Python environment that can be changed and developed with just a few custom functions in a config file.
This is what [Emacs][2] does for the 1958 programming language [Lisp][3]. In Emacs, there's no separation between the Lisp engine running the application and the arbitrary text you type into it. To Emacs, everything is Lisp data, so everything can be analyzed and manipulated programmatically.
That makes for a powerful user interface (UI). But if you're a casual Emacs user, you may only be scratching the surface of what it can do for you. Here are six things you may not have realized you could do with Emacs.
## Use Tramp mode for cloud editing
Emacs has been network-transparent for a lot longer than has been trendy, and today it still provides one of the smoothest remote editor experiences available. The [Tramp mode][4] in Emacs (formerly known as RPC mode) stands for "Transparent Remote (file) Access, Multiple Protocol," which spells out exactly what it offers: easy access to remote files you want to edit over most popular network protocols. The most popular and safest protocol for remote editing these days is [OpenSSH][5], so that's the default.
Tramp is already included in Emacs 22.1 or greater, so to use Tramp, you just open a file in the Tramp syntax. In the **File** menu of Emacs, select **Open File**. When prompted in the mini-buffer at the bottom of the Emacs window, enter the file name using this syntax:
```
`/ssh:user@example.com:/path/to/file`
```
If you are required to log in interactively, Tramp prompts you for your password. However, Tramp uses OpenSSH directly, so to avoid interactive prompts, you can also add your hostname, username, and SSH key path to your **~/.ssh/config** file. Like Git, Emacs uses your SSH config first and only stops to ask for more information in the event of an error.
Tramp is great for editing files that don't exist on your computer, and the user experience is not noticeably any different from editing a local file. The next time you start to SSH into a server just to launch a Vim or Emacs session, try Tramp instead.
## Calendaring
If you parse text better than you parse graphical interfaces, you'll be happy to know that you can schedule your day (or life) in plain text with Emacs but still get fancy notifications on your mobile device with open source [Org mode][6] viewers.
The process takes a little setup to create a convenient way to sync your agenda with your mobile device (I use Git, but you could invoke Bluetooth, KDE Connect, Nextcloud, or your file synchronization tool of choice), and you have to install an Org mode viewer (such as [Orgzly][7]) and a Git client app on your mobile. Once you've got your infrastructure sorted, though, the process is inherently perfectly integrated with your usual (or developing, if you're a new user) Emacs workflow. You can refer to your agenda easily in Emacs, make updates to your schedule, and generally stay on task. Pushing changes to your agenda is reflected on your mobile, so you can stay organized even when Emacs isn't available.
![][8]
Intrigued? Read my step-by-step guide about [calendaring with Org mode and Git][9].
## Access the terminal
There are [lots of terminal emulators][10] available. Although the Elisp terminal emulator in Emacs isn't the greatest general-purpose one, it's got two notable advantages.
1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job.
2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash.
To try the Emacs terminal, type **Alt**+**x** (**M-x** in Emacs notation), then type **shell**, and press **Return**.
## Use Racket mode
[Racket][11] is an exciting emerging Lisp dialect with a dynamic programming environment, a GUI toolkit, and a passionate community. The default editor when learning Racket is DrRacket, which has a Definitions panel at the top and an Interactions panel at the bottom. Using this setup, the user writes definitions that affect the Racket runtime. Imagine the old [Logo Turtle][12] program, but with a terminal instead of just a turtle.
![Racket-mode][13]
LGPL sample code by PLT
Emacs, being based on Lisp, makes a great integrated development environment (IDE) for advanced Racket coders. It doesn't ship with [Racket mode][14] (yet), but you can install Racket mode and several other helper extensions using the Emacs package installer. To install it, press **Alt**+**X** (**M-x** in Emacs notation), type **package-install**, and press **Return**. Then enter the package you want to install (**racket-mode**), and press **Return**.
Enter Racket mode with **M-x racket-mode**. If you're new to Racket but not to Lisp or Emacs, start with the excellent [Quick introduction to Racket with pictures][15].
## Scripting
You might know that Bash scripts are popular for automating and enhancing your Linux or Unix experience. You may have heard that Python does a pretty good job of that, too. But did you know that Lisp scripts can be run in much the same way? There's sometimes confusion about just how useful Lisp really is because many people are introduced to Lisp through Emacs, so there's the latent impression that the only way to run Lisp in the 21st century is to open an Emacs window. Luckily, that's not the case at all, and Emacs is a great IDE for the tools that enable you to run Lisp scripts as general system executables.
There are two popular modern Lisps, aside from Elisp, that are easy to run as standalone scripts.
1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient.
2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s
!#
(display "hello world")
     (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme
;;; compiling /home/seth/./hello.scheme
;;; compiled [...]/hello.scheme.go
hello world
$ guile ./hello.scheme
hello world
```
## Run Elisp without Emacs
Emacs can serve as an Elisp runtime, but you don't have to "open" Emacs in the traditional sense. The **\--script** option allows you to run Elisp scripts using Emacs as the engine but without launching the Emacs GUI (not even its terminal-based one). In this example, the **-Q** option causes Emacs to ignore your **.emacs** file to avoid any delays in executing the Elisp script (if your script relies upon something

View File

@ -0,0 +1,107 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to stop typosquatting attacks)
[#]: via: (https://opensource.com/article/20/1/stop-typosquatting-attacks)
[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta)
How to stop typosquatting attacks
======
Typosquatting is a way to lure users into divulging sensitive data to
cybercriminals. Learn how to protect your organization, your open source
project, and yourself.
![Gears above purple clouds][1]
Cybercriminals are turning to social engineering to try to trick unsuspecting people into divulging private information or valuable credentials. It is behind many [phishing scams][2] where the attacker poses as a reputable company or organization and uses it as a front to distribute a virus or other piece of malware.
One such risk is [typosquatting][3], a form of social engineering attack that tries to lure users into visiting malicious sites with URLs that are common misspellings of legitimate sites. These sites can cause significant damage to the reputation of organizations that are victimized by these attackers and harm users who are tricked into entering sensitive details into fake sites. Both system administrators and users need to be aware of the risks and take steps to protect themselves.
Open source software, which is developed and tested by large groups in public repositories, is often lauded for its security benefits. However, when it comes to social engineering schemes and malware implantation, even open source tools can fall victim.
This article looks at the rising trend of typosquatting and what these attacks could mean for open source software in the future.
### What is typosquatting?
Typosquatting is a very specific form of cybercrime that is often tied to a larger phishing attack. It begins with the cybercriminal buying and registering a domain name that is the misspelling of a popular site. For example, the cybercriminal might add an extra vowel or replace an "i" with a lowercase "l" character. Sometimes a cybercriminal obtains dozens of domain names, each with a different spelling variation.
A typosquatting attack does not become dangerous until real users start visiting the site. To make that happen, the criminal runs a phishing scam, typically over email, to urge people to click a link and visit the typosquatting website. Normally these rogue pages have simple login screens bearing familiar logos that try to imitate the real company's design.
If the user does not realize they are visiting a fake website and enters sensitive details, such as their password, username, or credit card number, into the page, the cybercriminal gets full access to that data. If a user is utilizing the same password across several sites, their other online accounts are likely to be exploited as well. This is a cybercriminal's payout: identity theft, ruined credit reports, stolen records, and sometimes worse.
### Some recent attacks
From a company perspective, having a typosquatting attack connected to your domain name can be a public relations disaster, even though you played no direct role in it, because it's seen as irresponsible internet stewardship. As a domain owner, you have a responsibility to be proactive in defending against typosquatting to limit the pain caused by this type of fraud.
A few years ago, many [health insurance customers fell victim][4] to a typosquatting attack when they received a phishing email that pointed to we11point.com, with the number 1 replacing the character "l" in the URL.
When the international domain name rules were changed to allow anyone to register a URL with an extension previously tied to specific countries, it created a brand new wave of typosquatting attacks. One of the most prevalent ones seen today is when a cybercriminal registers a .om domain that matches a popular .com domain to take advantage of accidental omissions of the letter "c" when entering a web address.
### How to protect your website from typosquatting
For companies, the best strategy is to try to stay ahead of typosquatting attacks.
That means spending the money to trademark your domain and purchase all related URLs that could be easy misspellings. You don't need to buy all top-level domain variants of your site name, but at least focus on common misspellings to your primary site name.
If you need to send your users to third-party sites, do so from your official website, not in a mass email. It's important to firmly establish a policy that official communication always and only sends users to your site. That way, should a cybercriminal attempt to spoof communication from you, your users will know something's amiss when they end up on an unfamiliar page or URL structure.
Use an open source tool like [DNS Twist][5] to automatically scan your company's domain and determine whether there could already be a typosquatting attack in progress. DNS Twist runs on Linux operating systems and can be used through a series of shell commands.
Some ISPs offer typosquatting protection as part of their product offering. This functions as an extra layer of web filtering—if a user in your organization accidentally misspells a common URL, they are alerted that the page is blocked and redirected to the proper domain.
If you are a system administrator, consider running your own [DNS server][6] along with a blacklist of incorrect and forbidden domains.
Another effective way to spot a typosquatting attack in progress is to monitor your site traffic closely and set an alert for a sudden decrease in visitors from a particular region. It could be that a large number of your regular users have been redirected to a fake site.
As with almost any form of cyberattack, the key to stopping typosquatting is constant vigilance. Your users are counting on you to identify and shut down any fake sites that are operating under your name, and if you don't, you could lose your audience's trust.
### Typosquatting threats to open source software
Most major open source projects go through security and penetration testing, largely because the code is public. However, mistakes happen under even the best of conditions. Here are some things to watch for if you're involved in an open source project.
When you get a merge request or patch from an unknown source, review it carefully before merging, especially if there's a networking stack involved. Don't fall prey to the temptation of only testing your build; look at the code to ensure that nothing nefarious has been embedded into an otherwise functional enhancement.
Also, use the same rigor in protecting your project's identity as a business does for its domain. Don't let a cybercriminal create alternate download sites and offer a version of your project with additional harmful code. Use digital signatures, like the following, to create an assurance of authenticity for your software:
```
gpg --armor --detach-sig \
\--output advent-gnome.sig \
example-0.0.1.tar.xz
```
You should also provide a checksum for the file you deliver:
```
`sha256sum example-0.0.1.tar.xz > example-0.0.1.txt`
```
Provide these safeguards even if you don't believe your users will take advantage of them, because all it takes is one perceptive user to notice a missing signature on an alternative download to alert you that someone, somewhere is spoofing your project.
### Final thoughts
Humans are prone to making mistakes. When you have millions of people around the world typing in a common web address, it's no surprise that a certain percentage enter a typo in the URL. Cybercriminals are trying to capitalize on that trend with typosquatting.
It's hard to stop cybercriminals from registering domains that are available for purchase, so mitigate against typosquatting attacks by focusing on the ways they spread. The best protection is to build trust with your users and to be diligent in detecting typosquatting attempts. Together, as a community, we can all help ensure that typosquatting attempts are ineffective.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/stop-typosquatting-attacks
作者:[Sam Bocetta][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sambocetta
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds)
[2]: https://www.cloudberrylab.com/resources/guides/types-of-phishing/
[3]: https://en.wikipedia.org/wiki/Typosquatting
[4]: https://www.menlosecurity.com/blog/-a-new-approach-to-end-typosquatting
[5]: https://github.com/elceef/dnstwist
[6]: https://opensource.com/article/17/4/build-your-own-name-server

View File

@ -0,0 +1,104 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use this open source tool to get your local weather forecast)
[#]: via: (https://opensource.com/article/20/1/open-source-weather-forecast)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
Use this open source tool to get your local weather forecast
======
Know whether you need a coat, an umbrella, or sunscreen before you go
out with wego in the thirteenth in our series on 20 ways to be more
productive with open source in 2020.
![Sky with clouds and grass][1]
Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using.
### Check the weather with wego
One of the things I love about the past decade of my employment is that it mostly has been remote. I can work anywhere I happen to be in the world, although the reality is that I spend a lot of time in my home office. The downside is that when I leave the house, I base a lot of decisions on what the conditions look like outside my window. And where I live, "sunny and clear" can mean anything from "scorchingly hot" to "below freezing" to "it will rain in an hour." Being able to check the actual conditions and forecast quickly is pretty useful.
![Wego][2]
[Wego][3] is a program written in Go that will fetch and display your local weather. It even renders it in shiny ASCII art if you wish.
To install wego, you need to make sure [Go][4] is installed on your system. After that, you can fetch the latest version with the **go get** command. You'll probably want to add the **~/go/bin** directory to your path as well:
```
go get -u github.com/schachmat/wego
export PATH=~/go/bin:$PATH
wego
```
On its first run, wego will complain about missing API keys. Now you need to decide on a backend. The default backend is for [Forecast.io][5], which is part of [Dark Sky][6]. Wego also supports [OpenWeatherMap][7] and [WorldWeatherOnline][8]. I prefer OpenWeatherMap, so that's what I'll show you how to set up here.
You'll need to [register for an API key][9] with OpenWeatherMap. Registration is free, although the free API key has a limit on how many queries you can make in a day; this should be fine for an average user. Once you have your API key, put it into the **~/.wegorc** file. Now is also a good time to fill in your location, language, and whether you use metric, imperial (US/UK), metric-ms, or International System of Units (SI). OpenWeatherMap supports locations by name, postal code, coordinates, and ID, which is one of the reasons I like it.
```
# wego configuration for OEM
aat-coords=false
aat-monochrome=false
backend=openweathermap
days=3
forecast-lang=en
frontend=ascii-art-table
jsn-no-indent=false
location=Pittsboro
owm-api-key=XXXXXXXXXXXXXXXXXXXXX
owm-debug=false
owm-lang=en
units=imperial
```
Now, running **wego** at the command line will show the local weather for the next three days.
Wego can also show data as JSON output for consumption by programs and with emoji. You can choose a frontend with the **-f** command-line parameter or in the **.wegorc** file.
![Wego at login][10]
If you want to see the weather every time you open a new shell or log into a host, simply add wego to your **~/.bashrc** (or **~/.zshrc** in my case).
The [wttr.in][11] project is a web-based wrapper around wego. It provides some additional display options and is available on the website of the same name. One cool thing about wttr.in is that you can fetch one-line information about the weather with **curl**. I have a little shell function called **get_wttr** that fetches the current forecast in a shortened form.
```
get_wttr() {
  curl -s "wttr.in/Pittsboro?format=3"    
}
```
![weather tool for productivity][12]
Now, before I leave the house, I have a quick and easy way to find out if I need a coat, an umbrella, or sunscreen—directly from the command line where I spend most of my time.
I began paragliding a few years ago. Its maybe the most weather-dependent sport in the world. We...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/open-source-weather-forecast
作者:[Kevin Sonney][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ksonney
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass)
[2]: https://opensource.com/sites/default/files/uploads/productivity_13-1.png (Wego)
[3]: https://github.com/schachmat/wego
[4]: https://golang.org/doc/install
[5]: https://forecast.io
[6]: https://darksky.net
[7]: https://openweathermap.org/
[8]: https://www.worldweatheronline.com/
[9]: https://openweathermap.org/api
[10]: https://opensource.com/sites/default/files/uploads/productivity_13-2.png (Wego at login)
[11]: https://github.com/chubin/wttr.in
[12]: https://opensource.com/sites/default/files/uploads/day13-image3.png (weather tool for productivity)

View File

@ -0,0 +1,158 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (3 handy command-line internet speed tests)
[#]: via: (https://opensource.com/article/20/1/internet-speed-tests)
[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall)
3 handy command-line internet speed tests
======
Check your internet and network speeds with these three open source
tools.
![Old train][1]
Being able to validate your network connection speed puts you in control of your computer. Three open source tools that enable you to check your internet and network speeds at the command line are Speedtest, Fast, and iPerf.
### Speedtest
[Speedtest][2] is an old favorite. It's implemented in Python, packaged in Apt, and also available with pip. You can use it as a command-line tool or within a Python script.
Install it with:
```
`sudo apt install speedtest-cli`
```
or
```
`sudo pip3 install speedtest-cli`
```
Then run it with the command **speedtest**:
```
$ speedtest
Retrieving speedtest.net configuration...
Testing from CenturyLink (65.128.194.58)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by CenturyLink (Cambridge, UK) [20.49 km]: 31.566 ms
Testing download speed................................................................................
Download: 68.62 Mbit/s
Testing upload speed......................................................................................................
Upload: 10.93 Mbit/s
```
This gives you your download and upload Internet speeds. It's fast and scriptable, so you can run it regularly and save the output to a file or database for a record of your network speed over time.
### Fast
[Fast][3] is a service provided by Netflix. Its web interface is located at [Fast.com][4], and it has a command-line interface available through npm:
```
`npm install --global fast-cli`
```
Both the website and command-line utility provide the same basic interface: it's a simple-as-possible speed test:
```
$ fast
     82 Mbps ↓
```
The command returns your Internet download speed. To get your upload speed, use the **-u** flag:
```
$ fast -u
   ⠧ 80 Mbps ↓ / 8.2 Mbps ↑
```
### iPerf
[iPerf][5] is a great way to test your LAN speed (rather than your Internet speed, as the two previous tools do). Debian, Raspbian, and Ubuntu users can install it with **apt**:
```
`sudo apt install iperf`
```
It's also available for Mac and Windows.
Once it's installed, you need two machines on the same network to use it (both must have iPerf installed). Designate one as the server.
Obtain the IP address of the server machine:
```
`ip addr show | grep inet.*brd`
```
Your local IP address (assuming an IPv4 local network) starts with either **192.168** or **10**. Take note of the IP address so you can use it on the other machine (the one designated as the client).
Start **iperf** on the server:
```
`iperf -s`
```
This waits for incoming connections from clients. Designate another machine as a client and run this command, substituting the IP address of your server machine for the sample one here:
```
`iperf -c 192.168.1.2`
```
![iPerf][6]
It only takes a few seconds to do a test, and it returns the transfer size and calculated bandwidth. I ran a few tests from my PC and my laptop, using my home server as the server machine. I recently put in Cat6 Ethernet around my house, so I get up to 1Gbps speeds from my wired connections but much lower speeds on WiFi connections.
![iPerf][7]
­You may notice where it recorded 16Gbps. That was me using the server to test itself, so it's just testing how fast it can write to its own disk. The server has hard disk drives, which are only 16Gbps, but my desktop PC gets 46Gbps, and my (newer) laptop gets over 60Gbps, as they have solid-state drives.
![iPerf][8]
### Wrapping up
Knowing the speed of your network is a rather straightforward task with these tools. If you prefer to script or run these from the command line for the fun of it, any of the above projects will get you there. If you're after specific point-to-point metrics, iPerf is your go-to.
What other tools do you use to measure the network at home? Share in the comments.
* * *
_This article was originally published on Ben Nuttall's [Tooling blog][9] and is used here with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/internet-speed-tests
作者:[Ben Nuttall][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/bennuttall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/train-plane-speed-big-machine.png?itok=f377dXKs (Old train)
[2]: https://github.com/sivel/speedtest-cli
[3]: https://github.com/sindresorhus/fast-cli
[4]: https://fast.com/
[5]: https://iperf.fr/
[6]: https://opensource.com/sites/default/files/uploads/iperf.png (iPerf)
[7]: https://opensource.com/sites/default/files/uploads/iperf2.png (iPerf)
[8]: https://opensource.com/sites/default/files/uploads/iperf3.png (iPerf)
[9]: https://tooling.bennuttall.com/command-line-speedtest-tools/

View File

@ -0,0 +1,313 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Ansible Ad-hoc Command Quick Start Guide with Examples)
[#]: via: (https://www.2daygeek.com/ansible-ad-hoc-command-quick-start-guide-with-examples/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
Ansible Ad-hoc Command Quick Start Guide with Examples
======
Recently, we have written an article about the **[Ansible installation and configuration][1]**.
Only a few examples of how to use it are included in that tutorial.
If you are new to Ansible, I suggest you read the Installation and Configuration section by pressing the URL above.
Once youre good in that area, go ahead and play with this article.
By default, Ansible uses only 5 parallel processes. If you want to perform a task on multiple hosts, you need to manually set the value of the fork count by adding **“-f [fork count]”**.
### What is ad-hoc Command
The ad-hoc command is used to automate a task on one or more managed nodes. Ad-hoc commands are very simple, but they are not re-usable. It uses the **“/usr/bin/ansible”** binary to perform all actions.
Ad-hoc commands are best for tasks you run once. For example, if you want to check whether a given user is available or not, you can use the Ansible Quick One liner without writing a playbook.
### Why Would You Like to Know About ad-hoc Commands?
Ad-hoc commands prove the simplicity and power of the Ansible. It currently supports 3389 modules as of version 2.9, so you need to understand and learn the list of Ansible modules you want to use regularly.
If you are new to Ansible, you can easily practice those modules and their arguments with the help of ad-hoc command.
The concepts you learn here will port over directly to the playbook language.
**General Syntax of ad-hoc command:**
```
ansible | [pattern] | -m [module] | -a "[module options]"
A | B | C | D
```
The ad-hoc command comes with four parts and the details are below.
```
+-----------------+--------------------------------------------------+
| Details | Description |
+-----------------+--------------------------------------------------+
|ansible | A command |
|pattern | Input the entire inventory or a specific group |
|module | Run the given module name |
|module options | Specify the module arguments |
+-----------------+--------------------------------------------------+
```
### How To Use Ansible Inventory File
If you use the default inventory file of Ansible **“/etc/ansible/hosts”**, you can call it directly.
If not, the entire path of the Ansible Inventory file should be called with the **“-i”** option.
### Whats Pattern and How to Use it?
An Ansible pattern can refer to a single host, IP address, an inventory group, a set of groups, or all hosts in your inventory.
It allows you to run commands and playbooks against them. Patterns are very flexible and you can use them according to your needs.
For example, you can exclude hosts, use wildcards or regular expressions, and more.
The table below describes common patterns and their use. But if it doesnt meet your needs, you can use variables in patterns with the **“-e”** argument in the ansible-playbook.
```
+-----------------------+------------------------------+-----------------------------------------------------+
| Description | Pattern(s) | Targets |
+-----------------------+------------------------------+-----------------------------------------------------+
|All hosts | all (or *) | Run an Ansible against all servers in your inventory|
|One host | host1 | Run an Ansible against only the given host. |
|Multiple hosts | host1:host2 (or host1,host2) | Run an Ansible against the mentioned multiple hosts |
|One group | webservers | Run an Ansible against the webservers group |
|Multiple groups | webservers:dbservers | all hosts in webservers plus all hosts in dbservers |
|Excluding groups | webservers:!atlanta | all hosts in webservers except those in atlanta |
|Intersection of groups | webservers:&staging | any hosts in webservers that are also in staging |
+-----------------------+------------------------------+-----------------------------------------------------+
```
### What is Ansible Modules and What it Does?
Modules (also referred to as “task plugins” or “library plugins”) are units of code that can be used to perform a specific task directly on remote hosts or through Playbooks.
Ansible executes the given module on the remote target node and collects the return values.
Each module supports multiple arguments, allowing it to meet the users needs. Almost all modules take **“key=value”** arguments except few.
You can add multiple arguments with the space at once, and the command/shell modules directly take the string of the command you want to run.
We will add a table with the most frequently used **“module options”** arguments.
To list all available modules, run the command below.
```
$ ansible-doc -l
```
Run the command below to read the documentation for the given module
```
$ ansible-doc [Module]
```
### 1) How to List the Contents of a Directory Using Ansible on Linux
This can be done using the Ansible command module as follows. We have listed the contents of the **“daygeek”** users home directory on the **“node1.2g.lab”** and **“node2.2g.lab”** remote server.
```
$ ansible web -m command -a "ls -lh /home/daygeek"
node1.2g.lab | CHANGED | rc=0 >>
total 12K
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Desktop
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Documents
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Downloads
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Music
-rwxr-xr-x. 1 daygeek daygeek 159 Mar 4 2019 passwd-up.sh
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Pictures
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Public
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Templates
-rwxrwxr-x. 1 daygeek daygeek 138 Mar 10 2019 user-add.sh
-rw-rw-r--. 1 daygeek daygeek 18 Mar 10 2019 user-list1.txt
drwxr-xr-x. 2 daygeek daygeek 6 Feb 15 2019 Videos
node2.2g.lab | CHANGED | rc=0 >>
total 0
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Desktop
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Documents
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Downloads
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Music
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Pictures
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Public
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Templates
drwxr-xr-x. 2 daygeek daygeek 6 Nov 9 09:55 Videos
```
### 2) How to Manage Files Using Ansible on Linux
Ansible “copy module” copies a file from a local system to a remote system. Use the Ansible command module to move or copy files to a remote machine.
```
$ ansible web -m copy -a "src=/home/daygeek/backup/CentOS7.2daygeek.com-20191025.tar dest=/home/u1" --become
node1.2g.lab | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": true,
"checksum": "ad8aadc0542028676b5fe34c94347829f0485a8c",
"dest": "/home/u1/CentOS7.2daygeek.com-20191025.tar",
"gid": 0,
"group": "root",
"md5sum": "ee8e778646e00456a4cedd5fd6458cf5",
"mode": "0644",
"owner": "root",
"secontext": "unconfined_u:object_r:user_home_t:s0",
"size": 30720,
"src": "/home/daygeek/.ansible/tmp/ansible-tmp-1579726582.474042-118186643704900/source",
"state": "file",
"uid": 0
}
node2.2g.lab | CHANGED => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": true,
"checksum": "ad8aadc0542028676b5fe34c94347829f0485a8c",
"dest": "/home/u1/CentOS7.2daygeek.com-20191025.tar",
"gid": 0,
"group": "root",
"md5sum": "ee8e778646e00456a4cedd5fd6458cf5",
"mode": "0644",
"owner": "root",
"secontext": "unconfined_u:object_r:user_home_t:s0",
"size": 30720,
"src": "/home/daygeek/.ansible/tmp/ansible-tmp-1579726582.4793239-237229399335623/source",
"state": "file",
"uid": 0
}
```
We can verify it by running the command below.
```
$ ansible web -m command -a "ls -lh /home/u1" --become
node1.2g.lab | CHANGED | rc=0 >>
total 36K
-rw-r--r--. 1 root root 30K Jan 22 14:56 CentOS7.2daygeek.com-20191025.tar
-rw-r--r--. 1 root root 25 Dec 9 03:31 user-add.sh
node2.2g.lab | CHANGED | rc=0 >>
total 36K
-rw-r--r--. 1 root root 30K Jan 23 02:26 CentOS7.2daygeek.com-20191025.tar
-rw-rw-r--. 1 u1 u1 18 Jan 23 02:21 magi.txt
```
To copy a file from one location to another on the remote machine, use the following command.
```
$ ansible web -m command -a "cp /home/u2/magi/ansible-1.txt /home/u2/magi/2g" --become
```
To move a file, use the following command.
```
$ ansible web -m command -a "mv /home/u2/magi/ansible.txt /home/u2/magi/2g" --become
```
To create a new file named **“ansible.txt”** under **“u1”** user, run the following command.
```
$ ansible web -m file -a "dest=/home/u1/ansible.txt owner=u1 group=u1 state=touch" --become
```
To create a new directory named **“magi”** under the **“u1”** user, run the following command. **_“**The file module can also create directories as follows**_“**.
```
$ ansible web -m file -a "dest=/home/u1/magi mode=755 owner=u2 group=u2 state=directory" --become
```
To change the permission of the **“ansible.txt”** file to **“777”** under **“u1”** user, run the following command.
```
$ ansible web -m file -a "dest=/home/u1/ansible.txt mode=777" --become
```
To delete the “ansible.txt” file under “u1” user, run the following command.
```
$ ansible web -m file -a "dest=/home/u2/magi/ansible-1.txt state=absent" --become
```
Use the following command to delete a directory and it will delete the given directory recursively.
```
$ ansible web -m file -a "dest=/home/u2/magi/2g state=absent" --become
```
### 3) User Management
You can easily perform the user management activity through Ansible, such as user creation, deleting a user, and adding a user to the group.
```
$ ansible all -m user -a "name=foo password=[crypted password here]"
```
To remove a user, run the following command.
```
$ ansible all -m user -a "name=foo state=absent"
```
### 4) Managing Package
Package installation can be easily managed using the appropriate Ansible Package Manager module. For example, we are going to use the yum module to manage packages on the CentOS system.
To install the latest Apache (httpd) package.
```
$ ansible web -m yum -a "name=httpd state=latest"
```
To uninstall the Apache (httpd) package.
```
$ ansible web -m yum -a "name=httpd state=absent"
```
### 5) Managing Service
Use the following Ansible module command to manage any service on Linux using Ansible
To stop the httpd service
```
$ ansible web -m service -a "name=httpd state=stopped"
```
To start the httpd service
```
$ ansible web -m service -a "name=httpd state=started"
```
To restart the httpd service
```
$ ansible web -m service -a "name=httpd state=restarted"
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/ansible-ad-hoc-command-quick-start-guide-with-examples/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/install-configure-ansible-automation-tool-linux-quick-start-guide/

View File

@ -0,0 +1,115 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Run multiple consoles at once with this open source window environment)
[#]: via: (https://opensource.com/article/20/1/multiple-consoles-twin)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
Run multiple consoles at once with this open source window environment
======
Simulate the old-school DESQview experience with twin in the fourteenth
in our series on 20 ways to be more productive with open source in 2020.
![Digital creative of a browser on the internet][1]
Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using.
### Overcome "one screen, one app" limits with twin
Who remembers [DESQview][2]? It allowed for things in DOS we take for granted now in Windows, Linux, and MacOS—namely the ability to run and have multiple programs running onscreen at once. In my early days running a dial-up BBS, DESQview was a necessity—it enabled me to have the BBS running in the background while doing other things in the foreground. For example, I could be working on new features or setting up new external programs while someone was dialed in without impacting their experience. Later, in my early days in support, I could have my work email ([DaVinci email on MHS][3]), the support ticket system, and other DOS programs running all at once. It was amazing!
![twin][4]
Running multiple console applications has come a long way since then. But applications like [tmux][5] and [Screen][6] still follow the "one screen, one app" kind of display. OK, yes, tmux has screen splitting and panes, but not like DESQview, with the ability to "float" windows over others, and I, for one, miss that.
Enter [twin][7], the text-mode window environment. This relatively young project is, in my opinion, a spiritual successor to DESQview. It supports console and graphical environments, as well as the ability to detach from and reattach to sessions. It's not as easy to set up as some things, but it will run on most modern operating systems.
Twin is installed from source (for now). But first, you need to install the required development libraries. The library names will vary by operating system. The following example shows it for my Ubuntu 19.10 installation. Once the libraries are installed, check out the twin source from Git and run **./configure** and **make**, which should auto-detect everything and build twin:
```
sudo apt install libx11-dev libxpm-dev libncurses-dev zlib1g-dev libgpm-dev
git clone [git@github.com][8]:cosmos72/twin.git
cd twin
./configure
make
sudo make install
```
Note: If you are compiling this on MacOS or BSD, you will need to comment out **#define socklen_t int** in the files **include/Tw/autoconf.h** and **include/twautoconf.h** before running **make**. This should be addressed by [twin issue number 57][9].
![twin text mode][10]
Invoking twin for the first time can be a bit of a challenge. You need to tell it what kind of display it is using with the **\--hw** parameter. For example, to launch a text-mode version of twin, you would enter **twin --hw=tty,TERM=linux**. The **TERM** variable specifies an override to the current terminal variable in your shell. To launch a graphical version, run **twin --hw=X@$DISPLAY**. On Linux, twin mostly "just works," and on MacOS, it mostly only works in terminals.
The _real_ fun comes with the ability to attach to running sessions with the **twattach** and **twdisplay** commands. They allow you to attach to a running twin session somewhere else. For example, on my Mac, I can run the following command to connect to the twin session running on my demo box:
```
`twdisplay --twin@20days2020.local:0 --hw=tty,TERM=linux`
```
![remote twin session][11]
With some extra work, you can also use it as a login shell in place of [getty][12] on consoles. This requires the gdm mouse daemon, the twdm application (included), and a little extra configuration. On systems that use systemd, start by installing and enabling gdm (if it isn't already installed). Then use systemctl to create an override for a console (I used tty6). The commands must be run as the root user; on Ubuntu, they look something like this:
```
apt install gdm
systemctl enable gdm
systemctl start gdm
systemctl edit getty@tty6
```
The **systemctl edit getty@tty6** command will open an empty file named **override.conf**. This defines systemd service settings to override the default for console 6. Update the contents to:
```
[service]
ExecStart=
ExecStart=-/usr/local/sbin/twdm --hw=tty@/dev/tty6,TERM=linux
StandardInput=tty
StandardOutput=tty
```
Now, reload systemd and restart tty6 to get a twin login prompt:
```
systemctl daemon-reload
systemctl restart getty@tty6
```
![twin][13]
This will launch a twin session for the user who logs in. I do not recommend this for a multi-user system, but it is pretty cool for a personal desktop. And, by using **twattach** and **twdisplay**, you can access that session from the local GUI or remote desktops.
I think twin is pretty darn cool. It has some rough edges, but the basic functionality is there, and it has some pretty good documentation. Also, it scratches the itch I have for a DESQview-like experience on modern operating systems. I look forward to improvements over time, and I hope you like it as much as I do.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/multiple-consoles-twin
作者:[Kevin Sonney][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ksonney
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://en.wikipedia.org/wiki/DESQview
[3]: https://en.wikipedia.org/wiki/Message_Handling_System
[4]: https://opensource.com/sites/default/files/uploads/productivity_14-1.png (twin)
[5]: https://github.com/tmux/tmux/wiki
[6]: https://www.gnu.org/software/screen/
[7]: https://github.com/cosmos72/twin
[8]: mailto:git@github.com
[9]: https://github.com/cosmos72/twin/issues/57
[10]: https://opensource.com/sites/default/files/uploads/productivity_14-2.png (twin text mode)
[11]: https://opensource.com/sites/default/files/uploads/productivity_14-3.png (remote twin session)
[12]: https://en.wikipedia.org/wiki/Getty_(Unix)
[13]: https://opensource.com/sites/default/files/uploads/productivity_14-4.png (twin)

View File

@ -0,0 +1,96 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Thunderbolt how to use keyboard during boot time)
[#]: via: (https://fedoramagazine.org/thunderbolt-how-to-use-keyboard-during-boot-time/)
[#]: author: (Martin Sehnoutka https://fedoramagazine.org/author/msehnout/)
Thunderbolt how to use keyboard during boot time
======
![][1]
### Problem statement
Imagine you bought a new laptop with a shiny new USB-C docking station. You install fresh Fedora, encrypt your hard drive because laptop is a travel equipment and you do not want to travel around with non-ecrypted hard drive. You finish the installation, close the lid because you have external monitor, reboot the machine, and finally you would like to enter the LUKS password using the external keyboard attached using USB 2.0 to the USB-C docking station but it does not work!
The keyboard does not respond at all. So you open the lid, try the built-in keyboard which works just fine and once the machine boots the external keyboard works just fine as well. What is the problem?
### What is this Thunderbolt anyway and why would anyone want it?
Thunderbolt is a hardware interface to connect peripherals such as monitors, external network cards [1] or even graphic cards [1]. The physical connector is the same as USB-C, but there is usually a label with a little lightning right next to the port to differentiate “plain” USB-C from Thunderbolt ports.
![][2]
Of course it comes with very high transmission speed to support such demanding peripherals, but it also comes with a certain security risks. To achieve transmission speed like this, Thunderbolt uses Direct Memory Access (DMA) for the peripheral devices. As the name suggests, this method allows the external device to read and write memory directly without talking to the running operating system.
I guess you can already spot the problem here. If some stranger is walking around my laptop (even with the screen locked), is it really possible to just attach a device and read content of my computer memory? Lets discuss it in more detail.
### User facing solution for Thunderbolt security
In the recent versions, Gnome settings include a tab for Thunderbolt device configuration. You can enable and disable DMA access for external devices and you can also verify identity of the devices.
![][3]
_bolt_ is the component responsible for managing thunderbolt devices. See _man 8 boltd_ for more information.
### CLI tools
Of course it is possible to control the same via command line. I suggest you to read _man boltctl_ or check the upstream repository directly: <https://gitlab.freedesktop.org/bolt/bolt>
### Pre-boot support solution to the keyboard problem
In pre-boot environment, the situation is slightly different. The userspace service responsible for device verification is not yet running so if a device is to be allowed, the firmware must to it. In order to enable this feature go to your BIOS and look for “support in pre boot environment”. For example this is how it looks on a Lenovo laptop:
![][4]
Once you enable this feature, bolt will add any verified device to a list of allowed devices. The next time you boot your machine, you should be able to use your external keyboard.
Run _boltctl_ a look for “bootacl”. Make sure that the list of allowed devices contains the one you wish to use.
![][5]
Also note the “security: secure” line. If you see anything else, for instance “security: user” I recommend to reconfigure BIOS.
### Technical details of the pre-boot support
There is one unfortunate technical detail about this solution. Thunderbolt support different security levels. For running Fedora, I recommend you to use “secure” level to verify that the device is indeed the one that it claims to be by using a per-device key generated by the host and stored in the device. Firmware, on the other hand, will only use “user” level which uses simple UUID that is provided by the device. The difference is that a malicious device could claim to be a different one by providing the same UUID as a legitimate one. Anyway this should not be a problem as the memory does not contain any sensitive data yet.
You can find more technical details in this blog post: <https://christian.kellner.me/2019/02/11/thunderbolt-preboot-access-control-list-support-in-bolt/>
### Conclusion
As you can see, in recent enough Fedora version the solution is a simple switch in BIOS. So if you are still opening your laptop during boot, go ahead and configure it so you dont have to do it next time. Meanwhile **check that the default security level is “secure”** instead of “user” [5].
### Sources:
[1] <https://www.intel.com/content/www/us/en/products/docs/io/thunderbolt/thunderbolt-technology-developer.html>
[2] <https://christian.kellner.me/2019/02/11/thunderbolt-preboot-access-control-list-support-in-bolt/>
[3] <https://gitlab.freedesktop.org/bolt/bolt>
[4] <https://wiki.gnome.org/Design/Whiteboards/ThunderboltAccess>
[5] <https://christian.kellner.me/2019/02/27/thunderclap-and-linux/>
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/thunderbolt-how-to-use-keyboard-during-boot-time/
作者:[Martin Sehnoutka][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/msehnout/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/header-816x345.png
[2]: https://fedoramagazine.org/wp-content/uploads/2020/01/port-1024x165.jpg
[3]: https://fedoramagazine.org/wp-content/uploads/2020/01/Screenshot-from-2020-01-17-12-47-30.png
[4]: https://fedoramagazine.org/wp-content/uploads/2020/01/bios-1024x389.jpg
[5]: https://fedoramagazine.org/wp-content/uploads/2020/01/Screenshot-from-2020-01-17-13-18-21.png

View File

@ -0,0 +1,80 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Oh, Bummer! Rocket League is Ending Support For Linux)
[#]: via: (https://itsfoss.com/rocket-league-ending-support-for-linux/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Oh, Bummer! Rocket League is Ending Support For Linux
======
If youve enjoyed playing Rocket League on Linux, you will be disappointed to know that [Pysonix][1], the developer team behind Rocket League [announced][2] that they will be dropping support for Linux and Mac in March, 2020.
If it was just another casual game on [Steam][3], I wouldnt mind- but Rocket League is a quite popular online multiplayer game across every platform.
![][4]
In fact, Rocket League was one of my [favorite games to play on Linux][5] (in addition to CS: GO). Even though I havent played it for a while it is a bummer that I wont be able to play it either.
So, this is definitely sad for Linux gamers who were looking forward to having fun in a popular online multiplayer game that required a decent hardware configuration to work flawlessly.
### Why are they ending support?
![][6]
In their [announcement][2], they mentioned:
> As we continue to upgrade _**Rocket League**_ with new technologies, it is no longer viable for us to maintain support for the macOS and Linux (SteamOS) platforms. As a result, the final patch for the macOS and Linux versions of the game will be in March. This update will disable online functionality (such as in-game purchases) for players on macOS and Linux, but offline features including Local Matches, and splitscreen play will still be accessible.
Well, this certainly does not explain why theyre dropping support for Linux/Mac. But, it looks like the game will get its final patches in March.
**After that, you will not be able to play multiplayer sessions but will be restricted to the local multiplayer sessions (or split-screen)**.
Maybe you can try using [Wine][7] or [Steam Play][8] to play it on Linux? Doesnt sound good though.
Some furious users/gamers on [Reddit][9] mentioned that this is a result of Epic Games acquiring Rocket League developer **Psyonix**. I wouldnt comment on that one feel free to share your thoughts in the comments though.
### How to get a refund for your Rocket League purchase
![][10]
To get a refund for your purchase of the Rocket League, you need to open a ticket on the [Psyonix Support][11] page.
If youve purchased it recently in the ongoing Steam sale you might just get an instant refund from Steam if you initiate a refund.
If you have no plans to play it on a Windows machine (or trying Proton/Wine) on Linux you should apply for a refund.
**Wrapping Up**
While this may not be a big-shot game for the platform but dropping support for Linux is not helping to improve the gaming scene on Linux.
If a game that worked quite well on Linux drops support for it how can we expect newer games to consider adding support for Linux?
Feel free to share your thoughts in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/rocket-league-ending-support-for-linux/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.psyonix.com/
[2]: https://www.rocketleague.com/news/ending-support-for-mac-and-linux/
[3]: https://store.steampowered.com/app/252950/Rocket_League/
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/rocket-league.jpg?ssl=1
[5]: https://itsfoss.com/free-linux-games/
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/rocket-league-shot.jpg?ssl=1
[7]: https://itsfoss.com/use-windows-applications-linux/
[8]: https://itsfoss.com/steam-play/
[9]: https://www.reddit.com/r/linux/comments/esxil2/support_for_rocket_league_on_linux_is_ending/
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/rocket-league-refund.jpg?ssl=1
[11]: https://support.rocketleague.com/hc/en-us

View File

@ -0,0 +1,64 @@
[#]: collector: (lujun9972)
[#]: translator: (algzjh)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The best resources for agile software development)
[#]: via: (https://opensource.com/article/19/12/agile-resources)
[#]: author: (Leigh Griffin https://opensource.com/users/lgriffin)
敏捷软件开发的最佳资源
======
请阅读我们的热门文章,这些文章着重讨论了敏捷的过去、现在和未来。
![Women programming][1]
对于 Opensource.com 上的敏捷主题来说,今年是非常棒的一年。随着 2019 年的临近,我们回顾了我们读者所读的与敏捷相关的热门文章。
### 小规模 Scrum 指南
Opensource.com 关于[小规模 Scrum][2] 的指南(我曾参与合著)由六部分组成,为小型团队提供了关于如何将敏捷引入到他们的工作中的建议。在官方的 [Scrum 指南][3] 的概述中,传统的 Scrum 框架推荐至少三个人来实现,以充分发挥其潜力。但是,它并没有为一两个人的团队如何成功遵循 Scrum 提供指导。我们的六部分系列旨在规范化小规模的 Scrum并检验我们在现实世界中使用它的经验。该系列受到了读者的热烈欢迎以至于这六篇文章占据了前 10 名文章的 60%。因此,如果你还没有阅读的话,一定要从我们的[小规模 Scrum 介绍页面][2]下载。
### 全面的敏捷项目管理指南
遵循传统项目管理方法的团队最初对敏捷持怀疑态度现在已经热衷于敏捷的工作方式。目前敏捷已被接受并且一种更加灵活的混合风格已经找到了归宿。Matt Shealy 撰写的[有关敏捷项目管理的综合指南][4]涵盖了敏捷项目管理的 12 条指导原则,对于希望为其项目带来敏捷性的传统项目经理而言,它是完美的选择。
### 成为出色的敏捷开发人员的 4 个步骤
DevOps 文化已经出现在许多现代软件团队中这些团队采用了敏捷软件开发原则利用了最先进的工具和自动化技术。但是这种机械的敏捷方法并不能保证开发人员在日常工作中遵循敏捷实践。Daniel Oh 在[《成为出色的敏捷开发人员的 4 个步骤》][5]中给出了一些很棒的技巧,通过关注设计思维,使用可预测的方法,以质量为中心并不断学习和探索来提高你的敏捷性。用你的敏捷工具补充这些方法将形成非常灵活和强大的敏捷开发人员。
### Scrum 和 kanban哪种敏捷框架更好
对于以敏捷方式运行的团队来说Scrum 和 kanban 是两种最流行的方法。在 “[Scrum 与 kanban哪种敏捷框架更好][6]” 中Taz Brown 探索了两者的历史和目的。在阅读本文时,我想起一句名言:“如果你的工具箱里只有锤子,那么所有问题看起来都像钉子。”知道何时使用 kanban 以及何时使用 Scrum 非常重要,本文有助于说明两者都有一席之地,这取决于你的团队、挑战和目标。
### 开发人员对敏捷发表意见的 4 种方式
当采用敏捷的话题出现时,开发人员常常会担心自己会被强加上一种工作风格。在“[开发人员对敏捷发表意见的 4 种方式][7]”中,[Clément Verna][8] 着眼于开发人员通过帮助确定敏捷在其团队中的表现形式来颠覆这种说法的方法。检查敏捷的起源和基础是一个很好的起点但是真正的价值在于拥有可帮助指导你的过程的指标。知道你将面临什么样的挑战会给你的前进提供坚实的基础。根据经验进行决策不仅可以增强团队的能力还可以使他们对整个过程有一种主人翁意识。Verna 的文章还探讨了将人置于过程之上并作为一个团队来实现目标的重要性。
### 敏捷的现在和未来
今年Opensource.com 的作者围绕敏捷的过去、现在以及未来可能会是什么样子进行了大量的讨论。感谢他们所有人,请一定于 2020 年在这里分享[你自己的敏捷故事][9]。
回顾一下 Opensource.com 在 2014 年和 2015 年报道的工具,以及新版本的更新,……
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/agile-resources
作者:[Leigh Griffin][a]
选题:[lujun9972][b]
译者:[algzjh](https://github.com/algzjh)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/lgriffin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G "Women programming"
[2]: https://opensource.com/downloads/small-scale-scrum
[3]: https://scrumguides.org/scrum-guide.html
[4]: https://opensource.com/article/19/8/guide-agile-project-management
[5]: https://opensource.com/article/19/2/steps-agile-developer
[6]: https://opensource.com/article/19/8/scrum-vs-kanban
[7]: https://opensource.com/article/19/10/ways-developers-what-agile
[8]: https://twitter.com/clemsverna
[9]: https://opensource.com/how-submit-article

View File

@ -7,56 +7,56 @@
[#]: via: (https://opensource.com/article/20/1/add-scorekeeping-your-python-game)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Add scorekeeping to your Python game
添加计分到你的 Python 游戏
======
In the tenth article in this series on programming with Python's Pygame
module, display your game player's score when they collect loot or take
damage.
In the tenth article in this series on programming with 在这一系列关于使用 Python 的 Pygame
模块编程的第 11 篇文章中,当你的玩家收集战利品或受到伤害时,显示你的玩家的得分。
![connecting yellow dots in a maze][1]
This is part 10 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are:
这是仍在进行中的关于使用 [Pygame][3] 模块来在 [Python 3][2] 在创建电脑游戏的第十一部分。先前的文章是:
* [Learn how to program in Python by building a simple dice game][4]
* [Build a game framework with Python using the Pygame module][5]
* [How to add a player to your Python game][6]
* [Using Pygame to move your game character around][7]
* [What's a hero without a villain? How to add one to your Python game][8]
* [Simulate gravity in your Python game][9]
* [Add jumping to your Python platformer game][10]
* [Enable your Python game player to run forward and backward][11]
* [Using Python to set up loot in Pygame][12]
* [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][4]
* [使用 Python 和 Pygame 模块构建一个游戏框架][5]
* [如何在你的 Python 游戏中添加一个玩家][6]
* [用 Pygame 使你的游戏角色移动起来][7]
* [如何向你的 Python 游戏中添加一个敌人][8]
* [在 Pygame 游戏中放置平台][19]
* [在你的 Python 游戏中模拟引力][9]
* [为你的 Python 平台类游戏添加跳跃功能][10]
* [使你的 Python 游戏玩家能够向前和向后跑][11]
* [在你的 Python 平台类游戏中放一些奖励][12]
If you've followed along with this series, you've learned all the essential syntax and patterns you need to create a video game with Python. However, it still lacks one vital component. This component isn't important just for programming games in Python; it's something you must master no matter what branch of computing you explore: Learning new tricks as a programmer by reading a language's or library's documentation.
如果你已经跟随这一系列很久,那么你已经学习你需要使用 Python 创建一个电脑游戏的所有的基本语法和样本。然而,它仍然缺少一个至关重要的组成部分。这一组成部分不仅仅对用 Python 编程游戏重要;不管你探究哪个计算机分支,你都必需精通:作为一个程序员,通过阅读一种语言的或库的文档来学习新的技巧。
Luckily, the fact that you're reading this article is a sign that you're comfortable with documentation. For the practical purpose of making your platform game more polished, in this article, you will add a score and health display to your game screen. But the not-so-secret agenda of this lesson is to teach you how to find out what a library offers and how you can use new features.
幸运的是,事实上,你正在阅读的这篇文章是你适应阅读文档的一个标记。为了实现使你的平台类游戏更加优雅的实际目标,在这篇文章中,你将添加一个得分和健康状况显示到你游戏屏幕中。不过,教你如何找到一个库的功能以及如何使用这些新的功能的这节课程并不是如此神秘。
### Displaying the score in Pygame
### 在 Pygame 中显示得分
Now that you have loot that your player can collect, there's every reason to keep score so that your player sees just how much loot they've collected. You can also track the player's health so that when they hit one of the enemies, it has a consequence.
现在,你有你的玩家收集的奖励,这里有足够的正当理由来维持分数,以便你的玩家恰好看到他们收集了多少奖励。你也可以跟踪玩家的健康度,以便当他们击中一个敌人时,会有一个结果。
You already have variables that track score and health, but it all happens in the background. This article teaches you to display these statistics in a font of your choice on the game screen during gameplay.
你已经有了跟踪分数和健康度的变量,但是这一切都发生在后台。这篇文章教你在游戏过程期间在游戏屏幕上以你选择的一种字体来显示这些统计数字。
### Read the docs
### 阅读文档
Most Python modules have documentation, and even those that do not can be minimally documented by Python's Help function. [Pygame's main page][13] links to its documentation. However, Pygame is a big module with a lot of documentation, and its docs aren't exactly written in the same approachable (and friendly and elucidating and helpful) narrative style as articles on Opensource.com. They're technical documents, and they list each class and function available in the module, what kind of inputs each expects, and so on. If you're not comfortable referring to descriptions of code components, this can be overwhelming.
大多数 Python 模块都有文档,即使那些没有文档的模块,也能通过 Python 的帮助功能来进行最小化地文档化。[Pygame 的主页面][13] 链接到它的文档。不过Pygame 是一个带有很多文档的大模块,并且它的文档不像在 Opensource.com 上的文章一样,以同样的易理解的(友好地,易解释地,有用地)叙述样式准确地编写。它们是技术文档,并且它们列出在模块中可用的每个类和函数,每个要求输入的类型等等。如果你不适应参考代码组件描述,这可能令人不知所措的。
The first thing to do, before bothering with a library's documentation, is to think about what you are trying to achieve. In this case, you want to display the player's score and health on the screen.
在烦恼一个库的文档前,第一件要做的事,就是来想想你正在尝试达到的目标。在这种情况下,你想在屏幕上显示玩家的得分和健康状况。
Once you've determined your desired outcome, think about what components are required for it. You can think of this in terms of variables and functions or, if that doesn't come naturally to you yet, you can think generically. You probably recognize that displaying a score requires some text, which you want Pygame to draw on the screen. If you think it through, you might realize that it's not very different from rendering a player or loot or a platform on screen.
在你确定你需要的结果后,想想它需要什么的组件。你可以从变量和函数的方面考虑这一点,或者,如果你还没有自然地想到这一点,你可以考虑一般情况。你可能意识到需要一些文本来显示一个分数,你希望 Pygame 在屏幕上绘制这些文本。如果你彻头彻尾地思考,你可能会意识到它与在屏幕上渲染一个玩家或奖励或一个平台并多么大的不同。
Technically, you _could_ use graphics of numbers and have Pygame display those. It's not the easiest way to achieve your goal, but if it's the only way you know, then it's a valid way. However, if you refer to Pygame's docs, you see that one of the modules listed is **font**, which is Pygame's method for making printing text on the screen as easy as typing.
从技术上讲,你 _可以_ 使用数字图形,并让 Pygame 显示这些数字图形。它不是达到你目标的最容易的方法,但是如果它是你唯一知道的方法,那么它是一个有效的方法。不过,如果你参考 Pygame 的文档,你看到列出的模块之一是 **font** ,这是 Pygame 使得在屏幕上来使打印文本像输入文字一样容易的方法。
### Deciphering technical documentation
### 解密技术文档
The **font** documentation page starts with **pygame.font.init()**, which it lists as the function that is used to initialize the font module. It's called automatically by **pygame.init()**, which you already call in your code. Once again, you've reached a point that that's technically _good enough_. While you don't know _how_ yet, you know that you _can_ use the **pygame.font** functions to print text on the screen.
**font** 文档页面以 **pygame.font.init()** 开始,它被列为用于初始化字体模块的函数。它由 **pygame.init()** 自动地调用,你已经在代码中调用了它。再强调一次,点,从技术上讲,你已经到达一个 _足够好_ 的点。虽然你尚不知道 _如何做_ ,你知道你 _能够_ 使用 **pygame.font** 函数来在屏幕上打印文本。
If you read further, however, you find that there's yet an even better way to print fonts. The **pygame.freetype** module is described in the docs this way:
然而,如果你阅读更多一些,你会找到这里还有一种更好的方法来打印字体。**pygame.freetype** 模块被以这种方式描述在文档中:
> The pygame.freetype module is a replacement for pygame.fontpygame module for loading and rendering fonts. It has all of the functionality of the original, plus many new features.
> pygame.freetype 模块是 pygame.fontpygame 模块的一个替代品,用于加载和渲染字体。它有原函数的所有功能,外加很多新的功能。
Further down the **pygame.freetype** documentation page, there's some sample code:
向下进一步到 **pygame.freetype** 文档页面,这里有一些样本代码:
```
@ -64,7 +64,7 @@ import pygame
import pygame.freetype
```
Your code already imports Pygame, but modify your **import** statements to include the Freetype module:
你的代码应该导入 Pygame ,尽管如此,修改你的 **import** 语句以包含 Freetype 模块:
```
@ -74,34 +74,34 @@ import os
import pygame.freetype
```
### Using a font in Pygame
### 在 Pygame 中使用一种字体
From the description of the font modules, it's clear that Pygame uses a font, whether it's one you provide or a default font built into Pygame, to render text on the screen. Scroll through the **pygame.freetype** documentation to find the **pygame.freetype.Font** function:
从字体模块的描述开始,使用一种字体是很明显是,不管它的你提供的或内置到 Pygame 的默认字体,我在屏幕上渲染字体。滚动 **pygame.freetype** 文档来找到 **pygame.freetype.Font** 函数:
```
pygame.freetype.Font
Create a new Font instance from a supported font file.
从支持的字体文件中创建一个新的字体实例。
Font(file, size=0, font_index=0, resolution=0, ucs4=False) -&gt; Font
Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font
pygame.freetype.Font.name
  Proper font name.
  符合规则的字体名称。
pygame.freetype.Font.path
  Font file path
  字体文件路径。
pygame.freetype.Font.size
  The default point size used in rendering
  在渲染中使用的默认点大小
```
This describes how to construct a font "object" in Pygame. It may not feel natural to you to think of a simple object onscreen as the combination of several code attributes, but it's very similar to how you built your hero and enemy sprites. Instead of an image file, you need a font file. Once you have a font file, you can create a font object in your code with the **pygame.freetype.Font** function and then use that object to render text on the screen.
这描述了如何在 Pygame 中构建一个字体"对象"。你可能不太自然能把屏幕上的一个简单的对象考虑为一些代码属性的组合,但是它非常类似于你如何构建你的英雄和敌人精灵。你需要一个字体文件,而不是一个图像文件。在你有一个字体文件后,你可以在你的代码中使用 **pygame.freetype.Font** 函数来创建一个字体对象,然后使用该对象来在屏幕上渲染文本。
Because not everyone in the world has the exact same fonts on their computers, it's important to bundle your chosen font with your game. To bundle a font, first create a new directory in your game folder, right along with the directory you created for your images. Call it **fonts**.
因为并不是世界上的每个人的电脑上都有完全一样的字体,将你选择的字体与你的游戏绑定在一起是很重要的。为绑定一种字体,首先在你的游戏文件夹中创建一个新的目录,恰好跟你为图像而创建的文件目录在一起。 称其为 **fonts**
Even though several fonts come with your computer, it's not legal to give those fonts away. It seems strange, but that's how the law works. If you want to ship a font with your game, you must find an open source or Creative Commons font that permits you to give the font away along with your game.
虽然一些字体是随你的计算机操作系统一起提供,但是将这些字体给予其他人是非法的。这看起来很奇怪,但法律就是这样运作的。如果想与你的游戏一起随附一种字体,你必需找到一种开放源码或知识共享字体,它允许与你的游戏一起提供字体。
Sites that specialize in free and legal fonts include:
专门提供自由和合法字体的网站包括:
* [Font Library][14]
* [Font Squirrel][15]
@ -109,20 +109,20 @@ Sites that specialize in free and legal fonts include:
When you find a font that you like, download it. Extract the ZIP or [TAR][17] file and move the **.ttf** or **.otf** file into the **fonts** folder in your game project directory.
当你找到你喜欢是字体后,下载下来。解压缩 ZIP 或 [TAR][17] 文件,并移动 **.ttf** 或 **.otf** 文件到你一下项目目录下的 **fonts** 文件夹中。
You aren't installing the font on your computer. You're just placing it in your game's **fonts** folder so that Pygame can use it. You _can_ install the font on your computer if you want, but it's not necessary. The important thing is to have it in your game directory, so Pygame can "trace" it onto the screen.
你没有安装字体到你的计算机上。你只是放置字体到你游戏的 **fonts** 文件夹中,以便 Pygame 可以使用它。如果你想,你 _可以_ 在你的计算机上安装字体,但是它是没有必要的。重要的是字体在你的游戏目录中,这样 Pygame 可以 "描绘" 字体到屏幕上。
If the font file has a complicated name with spaces or special characters, just rename it. The filename is completely arbitrary, and the simpler it is, the easier it is for you to type into your code.
如果字体有一个使用空格或特殊字符的复杂名称,只需要重新命名它。文件名称是完全任意的,并且对你来说,文件名称越简单,越任意将其键入你的代码中。
Now tell Pygame about your font. From the documentation, you know that you'll get a font object in return when you provide at least the path to a font file to **pygame.freetype.Font** (the docs state explicitly that all remaining attributes are optional):
现在告诉 Pygame 关于你的字体。从文档中,你知道,当你至少提供一种字体文件的路径到 **pygame.freetype.Font** 时,你将在返回中获得一个字体对象(文档讲明所有剩余的属性都是可选的)
```
`Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font`
```
Create a new variable called **myfont** to serve as your font in the game, and place the results of the **Font** function into that variable. This example uses the **amazdoom.ttf** font, but you can use whatever font you want. Place this code in your Setup section:
创建一个称为 **myfont** 的新变量来充当你在游戏中字体,并放置 **Font** 函数的结果到这个变量中。这个示例使用 **amazdoom.ttf** 字体,但是你可以使用任何你想使用的字体。在你的 Setup 部分放置这些代码:
```
@ -131,11 +131,11 @@ font_size = tx
myfont = pygame.freetype.Font(font_path, font_size)
```
### Displaying text in Pygame
### 在 Pygame 中显示文本
Now that you've created a font object, you need a function to draw the text you want onto the screen. This is the same principle you used to draw the background and platforms in your game.
现在你已经创建一个字体对象,你需要一个函数来绘制你想绘制到屏幕上的文本。这和你在你的游戏中绘制背景和平台是相同的原理。
First, create a function, and use the **myfont** object to create some text, setting the color to some RGB value. This must be a global function; it does not belong to any specific class:
首先,创建一个函数,并使用 **myfont** 对象来创建一些文本,设置颜色到一些 RGB 值。这必需是一个全局函数;它不属于任何具体的类:
```
@ -144,7 +144,7 @@ def stats(score,health):
    myfont.render_to(world, (4, 72), "Health:"+str(health), WHITE, None, size=64)
```
Of course, you know by now that nothing happens in your game if it's not in the Main loop, so add a call to your **stats** function near the bottom of the file:
当然,你此刻已经知道,如果它不在主循环中,你的游戏将不会发生任何事,所以在文件的底部房间添加一个调用到你的 **stats** 函数:
```
@ -154,21 +154,21 @@ Of course, you know by now that nothing happens in your game if it's not in the
    pygame.display.flip()
```
Try your game.
尝试你的游戏。
When the player collects loot, the score goes up. When the player gets hit by an enemy, health goes down. Success!
当玩家收集奖励品时,得分上升。当玩家被敌人击中时,健康值下降。成功!
![Keeping score in Pygame][18]
There is one problem, though. When a player gets hit by an enemy, health goes _way_ down, and that's not fair. You have just discovered a non-fatal bug. Non-fatal bugs are those little problems in applications that don't keep the application from starting up or even from working (mostly), but they either don't make sense, or they annoy the user. Here's how to fix this one.
不过,这里有一个问题。当一个玩家被敌人击中时,健康度会 _大量_ 下降,这是不公平的。你刚刚发现一个非致命的错误。非致命的错误是这些在应用程序中小问题,(通常)不要延迟应用程序启动,或者甚至停止工作,但是它们两者要么讲不通,要么惹恼用户。这里是如何解决这个问题的方法。
### Fixing the health counter
### 修复健康度计数
The problem with the current health point system is that health is subtracted for every tick of the Pygame clock that the enemy is touching the player. That means that a slow-moving enemy can take a player down to 200 health in just one encounter, and that's not fair. You could, of course, just give your player a starting health score of 10,000 and not worry about it; that would work, and possibly no one would mind. But there is a better way.
当前健康度点系统的问题是敌人接触玩家时Pygame 时钟的每一次滴答,健康度都会减少。这意味着一个缓慢移动的敌人可能在一次遭遇中将一个玩家降低健康度至 -200 ,这不公平。当然,你可以给你的玩家一个 10000 的起始健康度得分,而不用担心它;这可以工作,并且可能没有人会注意。但是这里有一个更好的方法。
Currently, your code detects when a player and an enemy collide. The fix for the health-point problem is to detect _two_ separate events: when the player and enemy collide and, once they have collided, when they _stop_ colliding.
当前,你的代码侦查出一个玩家和一个敌人碰撞的时候。健康度点问题的修复是侦查出 _两个_ 独立的事件:什么时候玩家和敌人碰撞,并且,在它们碰撞后,什么时候它们 _停止_ 碰撞。
First, in your Player class, create a variable to represent when a player and enemy have collided:
首先,在你的玩家类中,创建一个变量来显示一个玩家和敌人碰撞在一起的时间:
```
@ -177,7 +177,7 @@ First, in your Player class, create a variable to represent when a player and en
        self.damage = 0
```
In the update function of your Player class, _remove_ this block of code:
在你的玩家类的更新函数中, _移除_ 这块代码块:
```
@ -186,7 +186,7 @@ In the update function of your Player class, _remove_ this block of code:
            #print(self.health)
```
And in its place, check for collision as long as the player is not currently being hit:
并且在它的位置,只要玩家当前没有被击中,检查碰撞:
```
@ -196,15 +196,15 @@ And in its place, check for collision as long as the player is not currently bei
                    self.damage = self.rect.colliderect(enemy)
```
You might see similarities between the block you deleted and the one you just added. They're both doing the same job, but the new code is more complex. Most importantly, the new code runs only if the player is not _currently_ being hit. That means that this code runs once when a player and enemy collide and not constantly for as long as the collision happens, the way it used to.
你可能会在你删除的语句块和你刚刚添加的语句块之间看到相似之处。它们都在做相同的工作,但是新的代码更复杂。最重要的是,只有当玩家 _当前_ 没有被击中时,新的代码运行。这意味着,当一个玩家和敌人碰撞时,这些代码运行一次,而不是像以前那样一直发生碰撞。
The new code uses two new Pygame functions. The **self.rect.contains** function checks to see if an enemy is currently within the player's bounding box, and **self.rect.colliderect** sets your new **self.damage** variable to one when it is true, no matter how many times it is true.
新的代码使用两个新的 Pygame 函数。**self.rect.contains** 函数检查一个敌人当前是否在玩家的边界框内,并且当它是 true 时, **self.rect.colliderect** 设置你的新的 **self.damage** 变量为 1 ,而不管它多少次是 true 。
Now even three seconds of getting hit by an enemy still looks like one hit to Pygame.
现在,即使被一个敌人击中 3 秒,对 Pygame 来说仍然看作一次击中。
I discovered these functions by reading through Pygame's documentation. You don't have to read all the docs at once, and you don't have to read every word of each function. However, it's important to spend time with the documentation of a new library or module that you're using; otherwise, you run a high risk of reinventing the wheel. Don't spend an afternoon trying to hack together a solution to something that's already been solved by the framework you're using. Read the docs, find the functions, and benefit from the work of others!
我通过通读 Pygame 的文档而发现这些函数。你没有必要一次阅读完全部的文档,并且你也没有必要阅读每个函数的每个单词。不过,花费时间在你正在使用的新的库或模块的文档上是很重要的;否则,你将面临重新发明轮子的高风险。不要花费一个下午的时间来尝试修改拼接一个解决方案到一些东西,这些东西已经被你正在使用的框架的所解决。阅读文档,知悉函数,并从别人的工作中获益!
Finally, add another block of code to detect when the player and the enemy are no longer touching. Then and only then, subtract one point of health from the player.
最后,添加另一个代码语句块来侦查出什么时候玩家和敌人不再接触。只要那时,从玩家减少一点健康度点。
```
@ -215,19 +215,19 @@ Finally, add another block of code to detect when the player and the enemy are n
                self.health -= 1  # subtract 1 hp
```
Notice that this new code gets triggered _only_ if the player has been hit. That means this code doesn't run while your player is running around your game world exploring or collecting loot. It only runs when the **self.damage** variable gets activated.
注意_只有_ 当玩家被击中时,这个新的代码才会被触发。这意味着,在你的玩家在你的游戏世界正在探索或收集奖励时,这个代码不会运行。它仅当 **self.damage** 变量被激活时运行。
When the code runs, it uses **self.rect.collidelist** to see whether or not the player is _still_ touching an enemy in your enemy list (**collidelist** returns negative one when it detects no collision). Once it is not touching an enemy, it's time to pay the **self.damage** debt: deactivate the **self.damage** variable by setting it back to zero and subtract one point of health.
当代码运行时,它使用 **self.rect.collidelist** 来查看玩家是否 _仍然_ 接触在你敌人列表中的一个敌人(当其未侦查到碰撞时,**collidelist** 返回 -1 )。在它没有接触一个敌人时,是来偿还 **self.damage** 负债的时机:通过设置 **self.damage** 变量回到 0 来使其无效,并减少一点健康度点。
Try your game now.
现在尝试你的游戏。
### Score reaction
### 得分反应
Now that you have a way for your player to know their score and health, you can make certain events occur when your player reaches certain milestones. For instance, maybe there's a special loot item that restores some health points. And maybe a player who reaches zero health points has to start back at the beginning of a level.
现在,你有一个来让你的玩家知道它们分数和健康度的方法,当你的玩家达到某些里程碑时,你可以确保某些事件发生。例如,也许这里有一个特殊的恢复一些健康度点的奖励项目。也许一个到达 0 健康度点的玩家不得不从一个等级的起始位置重新开始。
You can check for these events in your code and manipulate your game world accordingly. You already know how, so go skim the documentation for new tricks and try them out on your own.
你可以在你的代码中检查这些事件,并且相应地控制你的游戏世界。你也知道怎么做,所以去浏览文档来寻找新的技巧,并且独立地尝试这些技巧。
Here's all the code so far:
这里是到目前为止所有的代码:
```
@ -297,7 +297,7 @@ class Player(pygame.sprite.Sprite):
    def gravity(self):
        self.movey += 3.2 # how fast player falls
       
        if self.rect.y &gt; worldy and self.movey &gt;= 0:
        if self.rect.y > worldy and self.movey >= 0:
            self.movey = 0
            self.rect.y = worldy-ty
       
@ -317,16 +317,16 @@ class Player(pygame.sprite.Sprite):
        self.rect.y = self.rect.y + self.movey
        # moving left
        if self.movex &lt; 0:
        if self.movex < 0:
            self.frame += 1
            if self.frame &gt; ani*3:
            if self.frame > ani*3:
                self.frame = 0
            self.image = self.images[self.frame//ani]
        # moving right
        if self.movex &gt; 0:
        if self.movex > 0:
            self.frame += 1
            if self.frame &gt; ani*3:
            if self.frame > ani*3:
                self.frame = 0
            self.image = self.images[(self.frame//ani)+4]
@ -353,7 +353,7 @@ class Player(pygame.sprite.Sprite):
        for p in plat_hit_list:
            self.collide_delta = 0 # stop jumping
            self.movey = 0
            if self.rect.y &gt; p.rect.y:
            if self.rect.y > p.rect.y:
                self.rect.y = p.rect.y+ty
            else:
                self.rect.y = p.rect.y-ty
@ -363,11 +363,11 @@ class Player(pygame.sprite.Sprite):
            self.movey = 0
            self.rect.y = worldy-ty-ty
            self.collide_delta = 0 # stop jumping
            if self.rect.y &gt; g.rect.y:
            if self.rect.y > g.rect.y:
                self.health -=1
                print(self.health)
               
        if self.collide_delta &lt; 6 and self.jump_delta &lt; 6:
        if self.collide_delta < 6 and self.jump_delta < 6:
            self.jump_delta = 6*2
            self.movey -= 33  # how high to jump
            self.collide_delta += 6
@ -398,22 +398,22 @@ class Enemy(pygame.sprite.Sprite):
        self.movey += 3.2
       
        if self.counter &gt;= 0 and self.counter &lt;= distance:
        if self.counter >= 0 and self.counter <= distance:
            self.rect.x += speed
        elif self.counter &gt;= distance and self.counter &lt;= distance*2:
        elif self.counter >= distance and self.counter <= distance*2:
            self.rect.x -= speed
        else:
            self.counter = 0
       
        self.counter += 1
        if not self.rect.y &gt;= worldy-ty-ty:
        if not self.rect.y >= worldy-ty-ty:
            self.rect.y += self.movey
        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False)
        for p in plat_hit_list:
            self.movey = 0
            if self.rect.y &gt; p.rect.y:
            if self.rect.y > p.rect.y:
                self.rect.y = p.rect.y+ty
            else:
                self.rect.y = p.rect.y-ty
@ -450,7 +450,7 @@ class Level():
        ground_list = pygame.sprite.Group()
        i=0
        if lvl == 1:
            while i &lt; len(gloc):
            while i < len(gloc):
                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png')
                ground_list.add(ground)
                i=i+1
@ -469,9 +469,9 @@ class Level():
            ploc.append((300,worldy-ty-256,3))
            ploc.append((500,worldy-ty-128,4))
            while i &lt; len(ploc):
            while i < len(ploc):
                j=0
                while j &lt;= ploc[i][2]:
                while j <= ploc[i][2]:
                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png')
                    plat_list.add(plat)
                    j=j+1
@ -528,7 +528,7 @@ font_size = tx
myfont = pygame.freetype.Font(font_path, font_size)
   
i=0
while i &lt;= (worldx/tx)+tx:
while i <= (worldx/tx)+tx:
    gloc.append(i*tx)
    i=i+1
@ -570,7 +570,7 @@ while main == True:
                main = False
    # scroll the world forward
    if player.rect.x &gt;= forwardx:
    if player.rect.x >= forwardx:
        scroll = player.rect.x - forwardx
        player.rect.x = forwardx
        for p in plat_list:
@ -582,7 +582,7 @@ while main == True:
            l.rect.x -= scroll
               
    # scroll the world backward
    if player.rect.x &lt;= backwardx:
    if player.rect.x >= backwardx:
        scroll = backwardx - player.rect.x
        player.rect.x = backwardx
        for p in plat_list:
@ -613,7 +613,7 @@ via: https://opensource.com/article/20/1/add-scorekeeping-your-python-game
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -638,3 +638,4 @@ via: https://opensource.com/article/20/1/add-scorekeeping-your-python-game
[16]: https://www.theleagueofmoveabletype.com/
[17]: https://opensource.com/article/17/7/how-unzip-targz-file
[18]: https://opensource.com/sites/default/files/uploads/pygame-score.jpg (Keeping score in Pygame)
[19]:https://opensource.com/article/18/7/put-platforms-python-game