Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-01-01 21:25:36 +08:00
commit 41d8ac1e09
9 changed files with 833 additions and 13 deletions

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11735-1.html)
[#]: subject: (How to cohost GitHub and GitLab with Ansible)
[#]: via: (https://opensource.com/article/19/11/how-host-github-gitlab-ansible)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
@ -12,27 +12,27 @@
> 通过使用 Ansible 镜像 Git 存储库,保护对重要项目的访问。
![Hands programming][1]
![](https://img.linux.net.cn/data/attachment/album/202001/01/104040fbdu68wosg8o99wg.jpg)
开源无处不在。它在家里的计算机上、在工作场所的计算机上、在互联网上,并且很多都由 [Git][2] 管理。由于 Git 是分布式的,因此许多人也将其视为一种众包的备份解决方案。从理论上讲,每当有人将 Git 存储库克隆到其本地计算机时,他们就创建了项目源代码的备份。如果有 100 个人这样做,则存储库就有 100 个备份副本。
开源无处不在。它在家里的计算机上、在工作场所的计算机上、在互联网上,并且很多都由 [Git][2] 管理。由于 Git 是分布式的,因此许多人也将其视为一种众包的备份解决方案。从理论上讲,每当有人将 Git 存储库克隆到其本地计算机时,他们就创建了项目源代码的备份。如果有 100 个人这样做,则存储库就有 100 个备份副本。
从理论上讲,这可以缓解“灾难”,例如项目维护者[突然决定删除存储库][3]或[莫名其妙地阻止所有流量][4],导致开发人员们无头苍蝇般地寻找谁拥有主分支的最新版本。类似的,整个代码托管站点也会消失。没有人会想到 Google Code、Microsoft CodePlex 或 Gitorious 会在鼎盛时期将被关闭。
从理论上讲,这可以缓解“灾难”的影响,例如项目维护者[突然决定删除存储库][3]或[莫名其妙地阻止所有流量][4],导致开发人员们无头苍蝇般地寻找谁拥有主分支的最新版本。类似的,整个代码托管站点也会消失。没有人会想到 Google Code、Microsoft CodePlex 或 Gitorious 会在鼎盛时期将被关闭。
简而言之,如果在过去的几十年中互联网教给了我们一些东西,那就是依靠互联网神奇地创建备份并不是冗余的最可靠途径。
此外,对于许多人来说,很多开源项目都托管在 GitHub 上是个问题,而 GitHub 不是开放平台。许多开发人员和用户都希望支持诸如 GitLab 之类的堆栈并与之交互,它具有开源社区版本。
此外,对于许多人来说,很多开源项目都托管在 GitHub 上是个问题 —— GitHub 并不是开放平台。许多开发人员和用户都希望支持诸如 GitLab 之类的堆栈并与之交互,它具有开源社区版本。
### 使用 Ansible 管理 Git
Git 的去中心方式对于解决这个问题很有用。使用纯 Git你可以使用一个 `push` 命令轻松地将其推到两个或多个存储库。但是,为了使其在发生意外故障时有用,你必须经常与 Git 存储库进行交互(特别是推送)。此外,即使你可能永远不会自己推送或拉出代码,也可能有一些要备份的存储库。
但是,使用 Ansible你可以自动执行项目主分支或其他任何分支的 Git 拉取,然后自动存储库到“异地”镜像的 Git 推送。换句话说,你可以让你的计算机定期从 GitHub 拉取并推送到 GitLab 或 [Gitolite][5] 或 Gitea或你喜欢的任何 Git 主机)。
但是,使用 Ansible你可以自动执行项目主分支或其他任何分支的 Git 拉取,然后自动进行存储库到“异地”镜像的 Git 推送。换句话说,你可以让你的计算机定期从 GitHub 拉取并推送到 GitLab 或 [Gitolite][5] 或 Gitea或你喜欢的任何 Git 托管主机)。
### Ansible 模块
如果 Ansible 并不是因为其出色的模块集合,那么它就没那么出色。像 Python 的第三方库或 Linux 的应用程序一样,这个技术驱动器有用而令人惊讶的简单技巧是Ansible 以其他人贡献的组件而闻名。因为本文正在研究如何有效和可靠地备份 Git 存储库,所以这里使用的模块是 [Git 模块][6]和 [ini_file][7] 模块。
如果不是因其出色的模块集合,那么 Ansible 就没那么出色。像 Python 的第三方库或 Linux 的应用程序一样,这个技术引擎的一个有用而令人惊讶的简单技巧是Ansible 以其他人贡献的组件而闻名。因为本文正在研究如何有效和可靠地备份 Git 存储库,所以这里使用的模块是 [Git 模块][6]和 [ini_file][7] 模块。
首先,创建一个名为 `mirror.yaml` 的文件作为<ruby>剧本<rt>playbook</rt></ruby>。你可以像通常使用 Ansible 一样,从 `name``task` 条目开始。本示例将 `localhost` 添加到 `hosts` 列表中,以便在控制器计算机(你现在坐在前面的计算机)上运行<ruby>动作<rt>play</rt></ruby>,但是在现实生活中,你可能会在特定的主机或一组网络上的主机上运行。
首先,创建一个名为 `mirror.yaml` 的文件作为<ruby>剧本<rt>playbook</rt></ruby>。你可以像通常使用 Ansible 一样,从 `name``task` 条目开始。本示例将 `localhost` 添加到 `hosts` 列表中,以便在控制器计算机(你现在坐在前面的计算机)上运行<ruby>动作<rt>play</rt></ruby>,但是在现实生活中,你可能会在特定的主机或一组网络上的主机上运行
```
---
@ -43,7 +43,7 @@ Git 的去中心方式对于解决这个问题很有用。使用纯 Git你可
### Git 拉取和克隆
如果要进行备份,则需要最新代码的副本。在 Git 仓库中实现这一目标的明显方法是执行 `git pull`。 但是,`pull` 会假定克隆已经存在,而写得很好的 Ansible 动作Ansible 脚本)则尽可能少的假定。 最好先告诉 Ansible `clone` 存储库。
如果要进行备份,则需要最新代码的副本。明显,在 Git 仓库中实现这一目标的方法是执行 `git pull`。 但是,`pull` 会假定克隆已经存在,而写得很好的 Ansible 动作Ansible 脚本)则尽可能少的假定。最好告诉 Ansible 先克隆存储库。
将你的第一个任务添加到剧本:
@ -63,7 +63,7 @@ Git 的去中心方式对于解决这个问题很有用。使用纯 Git你可
update: yes
```
这个例子使用了开源的类似于 Unix 的操作系统 soso 作为我要镜像的存储库。这是一个完全任意的选择,绝不意味着对该存储库的未来缺乏信心。它还使用变量来引用目标文件夹 `/tmp/soso.git`,这很方便,并且如果以后你希望将它扩展为一个通用的镜像脚本也会受益。在现实生活中,你的工作机上可能会比 `/tmp` 具有更永久的位置,例如 `/home/gitmirrors/soso.git``/opt/gitmirrors/soso.git`
这个例子使用了开源的类似于 Unix 的操作系统 soso 作为我要镜像的存储库。这是一个完全任意的选择,绝不意味着对该存储库的未来缺乏信心。它还使用变量来引用目标文件夹 `/tmp/soso.git`,这很方便,并且如果以后你希望将它扩展为一个通用的镜像脚本也会受益。在现实生活中,你的工作机上可能会比 `/tmp` 具有更永久的位置,例如 `/home/gitmirrors/soso.git``/opt/gitmirrors/soso.git`
运行你的剧本:
@ -150,7 +150,7 @@ via: https://opensource.com/article/19/11/how-host-github-gitlab-ansible
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,89 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to be a better organization: Top 10 reads for leaders)
[#]: via: (https://opensource.com/article/19/12/open-leadership)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
How to be a better organization: Top 10 reads for leaders
======
Get tips and strategies to help you leverage open principles in your
organization.
![Shaking hands, networking][1]
Modern organizations are adopting key elements from open source software. By leveraging the "open" in open source, leaders can help shape a more responsive and productive enterprise. Check out these top 10 articles from 2019 that can help you develop your own path in open leadership.
### 19 resolutions of an open leader
Open organizations succeed when leaders are open and transparent, demonstrating open skills, including transparency, inclusivity, adaptability, collaboration, and community. In [_19 resolutions of an open leader_][2], Angela Robertson shares her plan for continuing on the path of an open leader.
### The psychology behind a blameless retrospective
"One of the Agile Manifesto's principles suggests all teams regularly reflect on how to become more effective," writes Dominika Bula in [_The psychology behind a blameless retrospective_][3]. She says the main goals of a retrospective are to promote self-improvement, improve processes, and advance team members' skills. She also outlines the three foundational pillars that will "ensure your blameless retrospective truly is successful."
### A guide to human communication for sysadmins
The job of a systems administrator is no longer defined simply by running racks of servers and poking bits to optimize performance. In modern organizations, sysadmins can and should increase the value they deliver to the organization they work for. In [_A guide to human communication for sysadmins_][4], Maxim Burgerhout describes the best way to increase your value to an organization: getting to know the people around you.
### The innovation delusion
Red Hat CEO Jim Whitehurst observes that organizations (and especially leaders) like to think success is always planned—that they've become masters of chaos and can almost predict the future. But these assessments are often made with the benefit of hindsight. In [_The innovation delusion_][5], Jim advises that different kinds of challenges require different kinds of approaches, and we need to get better at building flexible organizations capable of responding to the unforeseen or unknowable.
### The power of being vulnerable in the workplace
In open organizations, high-performing teams must feel comfortable taking risks and appearing vulnerable in front of each other. These are necessary ingredients for creativity, curiosity, and diversity of ideas. In [_The power of being vulnerable in the workplace_][6], Kathleen Hayes explains psychological safety and explores some real-life examples where new mindsets and behaviors have helped teams thrive.
### Let's be real: Diversity and inclusion is a business issue
"If the problem is a struggle to innovate, then the solution is greater diversity and inclusion," DeLisa Alexander writes in [_Let's be real: Diversity and inclusion is a business issue_][7]. She says when diversity and inclusion are solutions to problems that affect us every day, we all do better work and generate value for customers.
### How to plan your next IT career move
Like many people in open source, being part of technology-oriented communities has been an essential part of Matthew Broberg's career development. In [_How to plan your next IT career move_][8], Matthew challenges us to ask essential career questions about the cloud, DevOps, coding, and where you're going next in IT.
**[Read next: [The new rules of CIO leadership][9]]**
### How to advance your career by contributing to open source projects
After working as a recruiter for 10 years at Red Hat, Josh Wulf decided it was time for a change. He quit his job as a recruiter, contributed to open source software, and landed a job as a software engineer. Josh explains in [_How to advance your career by contributing to open source projects_][10] how he did it and how you can, too.
### 7 tips to ace your tech job interview
In [_7 tips to ace your tech job interview_][11], Jessica Repka shares an insightful list of interviewing tips that should help you stand out in a good way. Based on her own job interviews and what she's seen in person while interviewing others, Jessica's tips can give you the edge you need to find your next job.
### Why DevOps is the most important tech strategy today
"Many people first learn about DevOps when they see one of its outcomes and ask how it happened. It's not necessary to understand why something is part of DevOps to implement it," Kelly Albrecht writes in [_Why DevOps is the most important tech strategy today_][12]. Albrecht clears up some of the confusion about DevOps and explains how a DevOps strategy can mean the difference between being a leader or a follower in an industry.
### Open leadership in 2020
What do you want to know about open leadership in the coming year? Please share your ideas for article topics in the comments—or even share your own experiences with open leadership by [writing an article for Opensource.com][13].
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/open-leadership
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/network_team_career_hand.png?itok=_ztl2lk_ (Shaking hands, networking)
[2]: https://opensource.com/open-organization/19/1/leadership-goals
[3]: https://opensource.com/article/19/4/psychology-behind-blameless-retrospective
[4]: https://opensource.com/article/19/9/communication-sysadmins
[5]: https://opensource.com/open-organization/19/6/innovation-delusion
[6]: https://opensource.com/open-organization/19/3/introduction-psychological-safety
[7]: https://opensource.com/open-organization/19/5/inclusivity-solution-innovation
[8]: https://opensource.com/article/19/8/plan-next-IT-career-move
[9]: https://enterprisersproject.com/cio-new-rules-report
[10]: https://opensource.com/article/19/5/how-get-job-doing-open-source
[11]: https://opensource.com/article/19/1/job-interviewing-tips
[12]: https://opensource.com/article/19/3/devops-most-important-tech-strategy
[13]: https://opensource.com/how-submit-article

View File

@ -0,0 +1,100 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (2019: Year in review)
[#]: via: (https://jvns.ca/blog/2019-year-in-review/)
[#]: author: (Julia Evans https://jvns.ca/)
2019: Year in review
======
Its the end of the year again! Here are a few things that happened in 2019.
### I have a business instead of a job!
The biggest change this year is that I left my job in August after working there for 5.5 years and now I dont have a job! Now I have a [business][1] (wizard zines).
This has been exciting (I can do anything I want with my time! No rules! Wow!) and also disorienting (I can do anything I… want? Wait, what do I want to do exactly?). Obviously this is a good problem to have but its a big adjustment from the structure I had when I had a job.
My plan for now is to give myself a year (until August 2020) to see how this new way of existing goes and then reevaluate.
I wanted to write some reflections on my 5 years at Stripe here but its been such a huge part of my life for so long that I couldnt figure out how to summarize it. I was in a much worse place in my career 6 years ago before I started working there and it really changed everything for me.
### !!Con
2019 was [!!Con][2]s 6th year! Its a conference about the joy, excitement, and surprise of programming. And !!Con also expanded to the [west coast][3]!! I wasnt part of organizing the west coast conference at all but I got to attend and it was wonderful.
Running a conference is a ton of work and I feel really lucky to get to do it with such great co-organizers there have been at least 20 people involved in organizing over the years and I only do a small part (right now I organize sponsorships for the east coast conference).
This year we also incorporated the [Exclamation Foundation][4] which is the official entity which runs both conferences which is going to make organizing money things a lot easier.
### I understand how the business works a little better
Earlier this year I signed up for a business course called [30x500][5] by Amy Hoy and Alex Hillman. Theyve influenced me a lot this year. Basically I signed up for it because I had a business that had made $100,000 in revenue already but I didnt really understand how the business _worked_ and it felt like it could just evaporate at any point. So $2000 (the cost at the time of 30x500) was worth it to help me understand what was going on.
Amy and Alex both just the other day wrote 100-tweet threads that have some of the ideas that I learned this year in them: [Alex on creating sustainable businesses][6] and [Amy on design][7].
I was hoping to build a system for selling printed zines in 2019 and I didnt get to it thats probably my one concrete business goal for 2020. I tried out Lulu for printing in the hopes that I could experiment with print-on-demand but the quality was awful so its going to be a bit more work.
### blog posts and things
In 2019 I:
* wrote 29 blog posts
* published 2 [zines][8] (Bite Size Networking, HTTP: Learn Your Browsers Language) and wrote most of a third
* published 1 box set of my zines ([Your Linux Toolbox][9], its in Real Physical Bookstores!!)
* did some experiments in interactive SQL/server exercises, which Im excited about but are sort of on the back burner right now. Maybe Ill go back to them in 2020!
* made the same business [revenue][1] as in 2018 (which I was thrilled about)
* gave 0 talks (which was a goal of mine)
The blog post Im happiest to have published this year is definitely [Get your work recognized: write a brag document][10]. Ive seen quite a few people saying that it helped them track their work and it makes me really happy. A bunch of people at my old job adopted it and its one of the non-engineering projects Im most proud of having done there.
Publishing this post about my [business revenue][1] was also important to me in the past I loved blogging, but I didnt think it was possible to make a living by explaining computer things online. And I was totally wrong! It is possible! So I think its important to tell other people that its a possibility.
Having a Real Traditionally Published Book out is also really cool, I could not have imagined [4 years ago][11] that I could go to an actual bookstore and buy the little 16-page zine I wrote about how much I love strace.
### what went well
some things that were good this year:
* spending time understanding why the business works the way it does instead of just guessing
* collaborating with many great people on !!Con to do a big thing together
* Im happy to have given myself the time/space to do whatever it is I want, even though its a big adjustment
* writing things that help people a little bit with their careers (the brag documents post) is nice
some things that are harder:
* I used to have a lot of really amazing coworkers at my job, and right now Im working much more by myself. I definitely miss having so many great people right there to talk to all the time.
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2019-year-in-review/
作者:[Julia Evans][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://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://jvns.ca/blog/2019/10/01/zine-revenue-2019/
[2]: https://bangbangcon.com
[3]: https://bangbangcon.com/west
[4]: https://exclamation.foundation/
[5]: https://30x500.com/academy/
[6]: https://twitter.com/alexhillman/status/1209252239501647874
[7]: https://twitter.com/amyhoy/status/1209693440872603651
[8]: https://wizardzines.com
[9]: https://jvns.ca/blog/2019/10/21/print-collection-of-my-first-7-zines/
[10]: https://jvns.ca/blog/brag-documents/
[11]: https://jvns.ca/blog/2015/04/14/strace-zine/

View File

@ -0,0 +1,92 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (10 articles to enhance your security aptitude)
[#]: via: (https://opensource.com/article/19/12/security-resources)
[#]: author: (Ben Cotton https://opensource.com/users/bcotton)
10 articles to enhance your security aptitude
======
Whether you're learning the first steps or looking to add to your
skills, there's something for you in Opensource.com's top 10 security
articles of 2019.
![A secure lock.][1]
If security is a process (and it is), then it stands to reason that different projects (and contributors) are in different places. Some applications have years of security testing, with design done by people who have worked in information security for decades. Others are brand new projects by developers working on their first open source project. It comes as no surprise that Opensource.com's top security articles of 2019 represent this range of experience. We have articles that introduce basic security practices as well as deep dives into more advanced topics.
Whether you're learning the first steps or looking to add to your skills acquired over a storied career, there's something for you in the top 10 security articles of 2019.
### 7 steps to securing your Linux server
Security is like a house: if the foundation is bad, the rest is at risk. Patrick H. Mullins' excellent _[7 steps to securing your Linux server][2]_ gets you started with basic security steps for Linux servers. Even if you have a lot of experience administering servers, this article provides a good checklist to make sure you have the basics covered. From there, you can begin adding additional layers of security.
### Make Linux stronger with firewalls
One of the seven steps to securing your server is enabling a firewall. But what _is_ a firewall, and how does it work? Seth Kenlon answers these questions and then describes in detail how to configure your firewall for better security in _[Make Linux stronger with firewalls][3]_. Using firewalld and Network Manager, you can set different firewall configurations for different networks. This allows you to have a trusting configuration on your home network, for example, and a more paranoid configuration on your favorite coffee shop's WiFi network.
### Reducing security risks with centralized logging
Once you've secured your system, you're not done: security is a process, not a state. Part of _keeping_ systems secure is keeping an eye on what goes on. One way to do that, especially with multiple systems, is to centralize your logging. In _[Reducing security risks with centralized logging][4]_, Hannah Suarez shares how to get started (she based this article on her lightning talk at FOSDEM '19).
### Using GPG keys for SSH
Most people who use key-based authentication for SSH use SSH keys. And why wouldn't you? It's right there in the name. These are perfectly fine from a security standpoint, but if you want to make some forms of key distribution and backup easier, there's another way. Brian Exelbierd's three-part series walks through _[How to enable SSH access with a GPG subkey][5]_, _[How to import existing SSH keys][6]_, and _[How to reduce your backup needs to a single key file][7]_.
### Graphically manage SSH keys with Seahorse
Using GPG for SSH keys isn't everyone's cup of tea, but that doesn't mean you're out of luck when it comes to key management. Seahorse is a graphical tool for managing SSH keys (and other authentication methods) that is included in the GNOME desktop. Alan Formy-Duval's [_Graphically manage SSH keys with Seahorse_][8], is particularly helpful to the novice user.
### Security scanning your DevOps pipeline
Containers are everywhere these days. But what's in them? Knowing that containers meet your security policies is an important part of staying secure. Fortunately, you can use open source tools to help automate compliance checking. Jessica Cherry's (formly Repka) [_Security scanning your DevOps pipeline_][9] is a step-by-step tutorial that shows you how to use the Jenkins build system and the Anchore inspection service to create a scanning pipeline for container images and registries.
### 4 open source cloud security tools
One of the great things about cloud services is that your data can be accessed from anywhere. One of the downsides to cloud services is that your data can be accessed from anywhere. If you're using "-as-a-Service" offerings, you want to make sure they're securely configured. Anderson Silva, Alison Naylor, Travis McPeak, and Rich Monk join forces to introduce [_4 open source cloud security tools_][10] to help improve security when using GitHub and AWS. If you're looking for accidentally committed secrets—or trying to prevent them from being committed in the first place—this article has tools you can use.
### How to use OpenSSL: hashes, digital signatures, and more
Much of information security is based on math: specifically, the cryptographic functions used to encrypt data and authenticate users or file contents. After providing an introduction in [_Getting started with OpenSSL: Cryptography basics_][11], Marty Kalin digs deeper into the details of _[How to use OpenSSL: Hashes, digital signatures, and more][12]_, explaining how to use the OpenSSL utility to explore these commonly used but uncommonly understood concepts.
### Learn about computer security with the Raspberry Pi and Kali Linux
Cheap hardware and open source software make a great combination, especially for people looking to learn by doing. In this article, Anderson Silva introduces the security-oriented Kali Linux distribution in _[Learn about computer security with the Raspberry Pi and Kali Linux][13]_. It's a short article, but it's full of useful links to documentation and security-related projects that you can use with your own Raspberry Pi.
### Will quantum computing break security?
Has the rest of this article been a waste? Will quantum computing render everything we know about security obsolete? The good news is that the answer is "no," but quantum computing can still have a profound impact on security and the computing world more broadly. In _[Will quantum computing break security?][14]_ Mike Bursell examines its potential impacts—both the good news and the bad. And of course, quantum computing may make it easier to break encryption, but that doesn't matter if the baddies can't get your data in the first place.
### Looking to 2020
Security will always be important, and (as the quantum computing article suggests) the next few years will be an interesting time in the field. In 2020, Opensource.com articles will look at the leading edge of open source security and help explain the basics to the ever-growing open source community. If you have a topic you want us to cover, please share it in the comments, or—better yet— if you have an article in mind, [write for us][15].
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/security-resources
作者:[Ben Cotton][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/bcotton
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko (A secure lock.)
[2]: https://opensource.com/article/19/10/linux-server-security
[3]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
[4]: https://opensource.com/article/19/2/reducing-security-risks-centralized-logging
[5]: https://opensource.com/article/19/4/gpg-subkeys-ssh
[6]: https://opensource.com/article/19/4/gpg-subkeys-ssh-multiples
[7]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage
[8]: https://opensource.com/article/19/4/ssh-keys-seahorse
[9]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline
[10]: https://opensource.com/article/19/9/open-source-cloud-security
[11]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1
[12]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2
[13]: https://opensource.com/article/19/3/computer-security-raspberry-pi
[14]: https://opensource.com/article/19/1/will-quantum-computing-break-security
[15]: https://opensource.com/how-submit-article

View File

@ -0,0 +1,153 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (8 must-read DevOps articles for success in 2020)
[#]: via: (https://opensource.com/article/19/12/devops-resources)
[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych)
8 must-read DevOps articles for success in 2020
======
Get up to speed on DevOps with our eight most popular DevOps articles
this year.
![Brick wall between two people, a developer and an operations manager][1]
I am an avid reader, but I go through periods where I'm so busy that it's hard to find the time to keep up with my reading list. Even during my busiest times, I try to stay up to date on DevOps news since it's one of my areas of focus.
Here, I've summarized key takeaways from the top eight DevOps articles Opensource.com published this year so you can increase your knowledge even if you don't have time to read all of them. Since DevOps is about **people**, **processes**, and **tools**, I've categorized the top eight articles around those themes.
### People
#### 5 essential values for the DevOps mindset
Conversations about IT problems and solutions often focus on the technology or the tools. But often, the people and processes are harder and more important to get right than the technology and tools. In [_5 essential values for the DevOps mindset_][2], Brent Aaron Reed and Willy-Peter Schaub outline the foundation for establishing the right processes and hiring the right people.
* Create a continuous feedback loop with stakeholders (customers, business teams, partners, etc.). Ensure changes are being made for the right reasons and that they benefit all stakeholders.
* Processes should be continuously improved. Having a repeatable framework and process is good, but look for ways to make it better.
* Don't replace existing silos with new silos. Teamwork is essential; changing the name of a team or creating a new team does not help. You should be working to break down silos, not create new silos with new names.
* Your primary stakeholder is the customer. Every department in the organization needs to work together to make sure the customer's needs are met.
* Learning is infectious. When you learn something new, share it with others.
#### The case for making the transition from sysadmin to DevOps engineer
Making the leap from system administrator (sysadmin) to DevOps engineer requires shifting your mindset and learning new tools and technology. In [_The case for making the transition from sysadmin to DevOps engineer_][3], [Correspondent][4] Taz Brown covers this experience and the things you should do if you are considering taking on a DevOps engineer role.
* Learn a scripting language like Python, Perl, Bash, or Powershell. You don't need to become an expert; learn the basics, and build up your skills over time.
* Think strategically and consider the business impact of your day-to-day tasks.
* Learn a programming language like Ruby, Go, or Python.
* Understand CI/CD pipelines and how and where to automate tasks within the pipeline.
* Become familiar with configuration and orchestration tools.
* Learn common Git commands as well as the fundamentals of version control.
### Processes
#### Don't test in production? Test in production!
The notion of testing in production is a sticky subject, but Ann Marie Fred covers it well in [_Don't test in production? Test in production!_][5] Historically, development, test, and production systems were treated differently from the perspective of security, compliance, and risk management. The risks are much higher if data in production systems becomes corrupted than if it happens in a test environment.
There are pros and cons to testing in production. The majority of the cons boil down to risk and compliance concerns like corrupted or leaked data, unintended side effects, and overloaded systems. Many of the pros can be lumped into two categories: improving the user experience (UX) and gaining new knowledge about your architecture. Improving UX includes things like usability testing, UX research, real-user monitoring, canary testing, and regression testing. Testing in production also enables you to learn more about your environment by running A/B tests, experimenting, chaos engineering, and failover testing.
By testing in production, you gain feedback you would not otherwise get into quality, performance, availability, resiliency, user experience, and changes. Testing on real data can reveal things you would not see with mock or test data. You should test in production, but before you begin, put mechanisms in place to keep your systems safe and minimize risk.
* Test all systems thoroughly with automated tests before you start testing in production.
* Review the risks associated with bug hunt days and put appropriate guardrails in place from the start.
* Follow the principles of chaos engineering: plan ahead; contain the blast radius; scale or squash.
Yes, there are risks associated with testing in production, but you can minimize them with proper safeguards.
#### 8 principles to achieve DevOps at scale
Processes are a vital aspect of a successful DevOps initiative. The most important part is building processes suited to your organization rather than copying what worked somewhere else. The guidelines Matthieu Fronton lists in [_8 principles to achieve DevOps at scale_][6] ensure you will implement strategies focused on your business needs.
* Teams create silos. Instead of building a DevOps team, create a DevOps task force of highly skilled and diverse members. Its objective is to help other projects and departments identify slow processes, automate processes, improve performance, and ensure effectiveness.
* Reduce overhead when collaborating and syncing on tasks. Make status updates and team availability publicly available, make work visible by putting everything in shared collaboration tools, and work on one task at a time to avoid context switching.
* Get outside help; hire an agile coach to be your advocate.
* Schedule regular team training on needed job skills, ranging from soft skills to how to use specific tools.
* Empower teams to make their own decisions and learn from their mistakes.
* Embrace uncertainty. Failures will happen, so run blameless post-mortems and determine how to improve and reduce uncertainty the next time around.
* DevOps is about people, processes, and tools. It is not just about the technical implementation of a product.
* Always be learning. Stay up to date on trends in the DevOps space.
#### Small scale scrum vs. large scale scrum
In [_Small scale scrum vs. large scale scrum_][7], Agnieszka Gancarczyk shares her analysis of 54 early responses to a survey on agile adoption.
* 96% work in distributed teams, think scrum principles help them reduce development complexity, and believe agile contributes to the success of their projects.
* The most popular length of a sprint is three weeks (62%).
* Participants take on additional roles on their projects when needed, such as business analyst, project manager, and quality engineer. When changing roles, they lose an average of one to two hours.
* The majority of teams don't have a definition of "ready" to ensure that user stories are actionable, testable, and clear.
* Participants ask for help and mentoring when a task is complex.
#### Scrum vs. kanban: Which agile framework is better?
Agile is a process of iterative development and continuous feedback. While both scrum and kanban are classified as agile frameworks, they are not the same thing. In [_Scrum vs. kanban: Which agile framework is better?_][8] Taz Brown explores the differences.
Kanban is an agile framework that utilizes a visual method for managing a project's creation through set steps, and the emphasis is on continuous flow through the steps. Tasks can be color-coded to identify different types of tasks. Work-in-progress limits can be used to restrict the maximum number of work items allowed in a single stage. The goal is to see progress and bottlenecks at a glance. Any team (not just software developers) can use the kanban methodology.
The goal of scrum is to create a shippable product. Scrum involves daily standups, planning, reviews, retrospectives, and a two- to four-week cadence. Since its goal is to ship a product, scrum is primarily used by software development teams.
Choosing which methodology is best for you depends on the state of your organization, the team, the people on the team, and the end product or service.
### Tools
#### Automate user acceptance testing with your DevOps pipeline
User acceptance testing (UAT) determines whether a system satisfies user needs, business requirements, and authorized entity requirements. These tests need to be run whenever there is a new design in the application, which is why it's so valuable to automate them. In [_Automate user acceptance testing with your DevOps pipeline_][9], Daniel Oh shares how to skip manually validating test cases and automate them with Selenium.
You can build WebDriver scripts with Selenium to execute test cases programmatically, then automate them by integrating the Selenium tool with your DevOps pipeline.
#### A beginner's guide to building DevOps pipelines with open source tools
Saving the best for last, Bryant Son's [_A beginner's guide to building DevOps pipelines with open source tools_][10] is a comprehensive overview of one critical category of DevOps tooling: continuous integration/continuous deployment (CI/CD) pipelines. The CI/CD pipeline is the process of taking code and configuration from a repository and moving it to production.
Bryant describes some of the tools in a typical CI/CD pipeline.
* A CI/CD tool like Jenkins talks to many different services and tools to configure and orchestrate them.
* Source control management (SCM) stores code in repositories, versions code, and facilitates collaboration with project members. (CI/CD can automate checking source code in and out among team members.)
* Build-automation tools compile and create a deployable package format from the source code.
* A web application server is the location where an executable will be deployed so the application can be used.
* Code testing coverage catches errors early on and ensures users are satisfied with the application. Code test frameworks help write the tests, and code-quality suggestion tools help improve the quality of the code.
### More in 2020
Opensource.com's most widely read DevOps articles of 2019 covered a diverse range of topics under the umbrella of people, processes, and tools. We appreciate these writers for sharing their knowledge, and I look forward to reading more from them in 2020.
What DevOps topics would you like us to cover in the coming months? Feel free to leave a comment or, better yet, [submit an article proposal][11].
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/devops-resources
作者:[Dawn Parzych][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/dawnparzych
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager)
[2]: https://opensource.com/article/19/5/values-devops-mindset
[3]: https://opensource.com/article/19/7/devops-vs-sysadmin
[4]: https://opensource.com/correspondent-program
[5]: https://opensource.com/article/19/5/dont-test-production
[6]: https://opensource.com/article/19/4/principles-achieve-devops-scale
[7]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum
[8]: https://opensource.com/article/19/8/scrum-vs-kanban
[9]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing
[10]: https://opensource.com/article/19/4/devops-pipeline
[11]: https://opensource.com/how-submit-article

View File

@ -0,0 +1,70 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (10 Ansible resources to accelerate your automation skills)
[#]: via: (https://opensource.com/article/19/12/ansible-resources)
[#]: author: (James Farrell https://opensource.com/users/jamesf)
10 Ansible resources to accelerate your automation skills
======
Gear up and get crackin' with awesome Ansible automation skills this
year.
![Gears above purple clouds][1]
This year saw a wide range of really helpful Ansible articles. Whether you are just starting out with Ansible or a seasoned pro, there is something for everyone here to learn from.
A good number of these articles are worthy of your bookmarking and perhaps a cron (or maybe a Tower/AWX job) reminder to reread them periodically.
If you are new to Ansible, start with the following articles:
* [_A quickstart guide to Ansible_][2] has some good starter information as well as deeper dives into more advanced topics
* [_10 Ansible modules you need to know_][3] and [_5 ops tasks to do with Ansible_][4] review some of the more fundamental functions that every Ansible admin should be familiar with
* [_How to use Ansible to document procedures_][5] also presents a survey of additional topics you might find it interesting to follow up on
The remainder of these articles cover more advanced topics like Windows management, testing, hardware, cloud, and containers—and even a case study in managing the demands of tech-curious children.
I hope you enjoyed this Ansible year as much as I did. Never stop learning!
1. _[How Ansible brought peace to my home][6]_ is a whimsical case study in applying Ansible skills to quickly provision new (or rather old) laptops for my children.
2. _[Ansible for the Windows admin][7]_ by Taz Brown and Abner Malivert: Did you know Ansible can manage Windows nodes as well? This piece reviews basic Ansible server and Windows client setups with an example on how to deploy an IIS server.
3. _[10 Ansible modules you need to know][3]_ by Shashank Hegde is a great place to start for some of the most common and basic Ansible modules all admins should know. Running commands, installing packages, and handling files are the basis for many useful automation plays.
4. _[How to use Ansible to document procedures][5]_ by Marco Bravo: Ansibles YAML files make for easy reading, so much so that they can be used to document the manual steps needed to accomplish a task. This makes your work easier to debug and extend later on. Also contained in this article are pointers on related topics like testing and analysis.
5. _[Using Testinfra with Ansible to verify server state][8]_ by Clement Verna: Testing is an integral part of any CI/CD DevOps pipeline, so why not test Ansibles results as well? This primer on Testinfra can be used to help check the configuration results you need.
6. _[Hardware bootstrapping with Ansible][9]_ by Mark Phillips: Not all the world is containers and virtual machines. Many of us sysadmins still have significant hardware deployments to manage. With a little PXE dust and DHCP magic (among other tidbits), you can create a convenient framework using Ansible to get real hardware up and running easily.
7. _[What you need to know about Ansible modules][10]_ by Jairo da Silva Junior: Modules bring real power to Ansible. Many modules are already available, but when there is none, you may need to roll your own. Read this article to look a bit deeper into how modules are made.
8. _[5 ops tasks to do with Ansible][4]_ by Mark Phillips: This is another more basic review of Ansible use to manage common system operations tasks. The draw here is the list of examples given in Tower (or AWX) instead of the old familiar command line.
9. _[A quickstart guide to Ansible][2]_ by Chris Short is a great PDF download that you should keep on hand and reread from time to time. It begins with a great primer to get started in Ansible. It also covers other areas of interest including Molecule testing, sysadmin tasks, and Kubernetes object management, to name a few.
10. _[An Ansible reference guide, CI/CD with Ansible Tower and GitHub, and more news][11]_ by Mark Phillips: This is a monthly round-up article full of interesting links to follow. Topics span Ansible basics, managing Netapp E-Series storage, debugging, patching, and more. Videos are included here as well as some pointers to Ansible meetup groups. Check it out!
Let us know if you had a favorite Ansible article this year and why in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/ansible-resources
作者:[James Farrell][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/jamesf
[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://opensource.com/article/19/2/quickstart-guide-ansible
[3]: https://opensource.com/article/19/9/must-know-ansible-modules
[4]: https://opensource.com/article/19/8/ops-tasks-ansible
[5]: https://opensource.com/article/19/4/ansible-procedures
[6]: https://opensource.com/article/19/9/ansible-documentation-kids-laptops
[7]: https://opensource.com/article/19/2/ansible-windows-admin
[8]: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state
[9]: https://opensource.com/article/19/5/hardware-bootstrapping-ansible
[10]: https://opensource.com/article/19/3/developing-ansible-modules
[11]: https://opensource.com/article/19/7/ansible-news-edition-one

View File

@ -0,0 +1,85 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (12 programming resources for coders of all levels)
[#]: via: (https://opensource.com/article/19/12/programming-resources)
[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny)
12 programming resources for coders of all levels
======
No matter where you are in your programming journey, there are things
for you to learn in Opensource.com's top 12 programming articles from
2019.
![Woman sitting in front of her computer][1]
> "The best time to learn computer programming was 20 years ago. The second best time is now."
> — A computer science proverb, maybe.
Are you a new programmer, an experienced web dev, a backend wizard, a grizzled system programmer, or some other yet-to-be-discovered species of computer geek? Wherever you land in the vast ecosystem of software developers, the only constant in our field is the need to learn about new technologies and how to apply them. Here is an ensemble of the most-read Opensource.com articles from the past year that inform and entertain, and I'm excited to share them with you here.
### For the noble newbie
Whatever your skillset or interests, learning how to write computer programs turns that domain-specific knowledge into a superpower. Unfortunately, it isn't possible to learn how to program from the bite of a radioactive computer, at least not yet. Until that's a thing, I recommend these excellent articles to help bootstrap your programming skills. They address important questions like which languages to consider learning and different ways to get started.
* [Which programming languages should you learn?][2]
* [A dozen ways to learn Python][3]
* [Three popular programming languages you can learn with Raspberry Pi][4]
* [Introducing kids to computational thinking with Python][5]
### Keeping up with emerging technologies
Experienced programmers know that the only thing harder than learning to program is keeping your skills and knowledge up to date. But we are an [autodidactic][6] breed, always looking to level up our expertise and understanding. Even if we don't anticipate using a new technology, we know that eventually, someone will ask about it. These articles on Rust, WebAssembly, and Podman are great places to start learning about just a few of the upcoming trends in software technology.
* [Why should you use Rust in WebAssembly?][7]
* [Level up command-line playgrounds with WebAssembly][8]
* [How does rootless Podman work?][9]
* [Why to choose Rust as your next programming language][10]
### Old programs never die
Despite the never-ending cascade of new technologies, it never hurts to look back to help you look forward. Today's amazing technologies are built on top of yesterday's tools, and it will serve us well to understand the abilities and limitations of those tools, even if we never write a line of code in these languages of legend. This collection of articles focuses on the C language, a practical application written in AWK, and an interesting discussion of computer languages that are declining in popularity, but perhaps not dead yet.
* [The monumental impact of C][11]
* [How to write a good C main function][12]
* [Drinking coffee with AWK][13]
* [What's your favorite "dead" language?][14]
### Keep on learning
No matter where you are in your programming journey, there will always be more to learn. I hope these top resources from 2019 will get you ready for 2020. Thanks to the authors and you, the reader.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/programming-resources
作者:[Erik O'Shaughnessy][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/jnyjny
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer)
[2]: https://opensource.com/article/19/2/which-programming-languages-should-you-learn
[3]: https://opensource.com/article/19/8/dozen-ways-learn-python
[4]: https://opensource.com/article/19/3/programming-languages-raspberry-pi
[5]: https://opensource.com/article/19/2/break-down-stereotypes-python
[6]: https://en.wikipedia.org/wiki/Autodidacticism
[7]: https://opensource.com/article/19/2/why-use-rust-webassembly
[8]: https://opensource.com/article/19/4/command-line-playgrounds-webassembly
[9]: https://opensource.com/article/19/2/how-does-rootless-podman-work
[10]: https://opensource.com/article/19/10/choose-rust-programming-language
[11]: https://opensource.com/article/19/10/command-line-heroes-c
[12]: https://opensource.com/article/19/5/how-write-good-c-main-function
[13]: https://opensource.com/article/19/2/drinking-coffee-awk
[14]: https://opensource.com/article/19/6/favorite-dead-language

View File

@ -0,0 +1,109 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (7 resources to grow your Java skills)
[#]: via: (https://opensource.com/article/19/12/java-resources)
[#]: author: (Stephon Brown https://opensource.com/users/stephb)
7 resources to grow your Java skills
======
Java is still evolving and going strong decades after its launch. Catch
up with our hottest Java articles from 2019.
![Coffee beans and a cup of coffee][1]
Java is still one of the most influential programming languages today. It only recently dropped from #2 to the third most used [programming language on GitHub][2]. You may say usage is not everything, but Java also remains popular. According to [Stack Overflow's Developer Survey Results for 2019][3], Java is the fifth most popular programming language. It was first released to the public in 1998, and it stays high on the usage and popularity scale after all this time. A big reason for that fact is that Java has grown and evolved significantly since its release. As a strongly-typed language, Java continues to push the envelope of the object-oriented programming (OOP) paradigm and is continually used to implement new concepts and technologies.
Testifying to its ongoing popularity, Opensource.com publishes many excellent articles about the language. The following seven are Opensource.com's top read Java articles of 2019.
### What is an object in Java?
Chris Hermansen provides an in-depth look at the OOP paradigm and its importance to Java development in [_What is an object in Java?_][4] OOP is based on the idea that data and programs should all be viewed as "objects." Each object has properties and behaviors that describe how it is used in a program.
There are a number of principals that define OOP and its use of objects for all aspects of programming. These include:
* **Inheritance:** This is the hierarchical use of objects for mutating and reusing object properties and behaviors from parent objects to child objects.
* **Typing:** Static and strong typing express the idea that, at compile time, the type should be defined and constant unless explicitly converted or changed, which helps with both debugging and consistent functionality.
* **Classes and primitives:** Objects natively implemented into OOP languages are called "primitives," including int, long, etc.; however, objects designed and implemented using class declarations and by assigning properties and behaviors to primitives are called classes.
* **Object class:** In Java, the Object class is the parent class that all classes inherit from. It allows the use of basic functions and properties, including comparison and **hashCode** functionality.
Overall, objects are the basis of Java development, and Chris expounds upon them in his in-depth article.
### What is a Java constructor?
As a great follow-up to Chris Hermansen's overview of the Java object, I recommend reading [_What is a Java constructor?_][5] The constructor is an important concept to understand when working within the realms of OOP and Java, and Seth Kenlon introduces it in this easy-to-understand guide. The constructor in Java (and most OOP languages) is where you instantiate or create an instance of an object you have defined. In many languages, an instance is created with the **new** keyword and the object you want to create. For example, **Dog fluffy = new Dog();** will create a new instance of **Dog**. Constructors can also set properties within the object you are instantiating; therefore, if you have an implementation for a constructor to set your object's size, height, and type, you can set those all from the constructor. By default, Java allows objects to be instantiated with the **new** keyword without having an explicit constructor defined and creates them at compilation time.
### Initializing arrays in Java
An array is a longstanding data structure that originates in early math concepts. In computer science, as Chris Hermansen says in [_Initializing arrays in Java_][6], it represents "…a contiguous block of memory where each location is a certain type," which can be any type—from primitives (int, long, etc.) to custom objects (Dog, Cat, Car). An array is initialized with a specific type of constructor that reserves the fixed length of the array; in other words, it is a defined amount of memory that the array is reserving. It looks like this: **int[] a = new int[15]**. Much like instantiating a new object, arrays are similar in form and functions. In addition, because arrays inherit from the Object class, they can utilize methods and properties associated with the Object class, including **GetClass()**.
In addition to simple arrays, Java implements **ArrayLists** and **Map** objects by default. Both of these collection types allow elements to be added or removed dynamically; there is no need to set the size of each manually. The ArrayList allows the addition, retrieval, and removal of elements dynamically as your code runs. These lists must be of one type, which is defined when it is instantiated. The Map allows a dictionary object to be created, which means each index, or "key," is connected to another object. For example, **Map&lt;string, Integer&gt; scores = new Map&lt;String, Integer&gt;()** would allow you to insert a student's score, with the key being their name, with **scores.put("Stephon", 50)**. Arrays, ArrayLists, and Maps are excellent ways to store, retrieve, and manipulate data within your Java application.
### Getting started with blockchain for Java developers
Blockchain is an amalgamation of cryptography, computer science, cryptocurrency, and many other fields. It is the technology at the heart of Bitcoin and other cryptocurrencies, but it can stand alone and is powerful when implemented with other concepts. As Bilgin Ibrayam writes in [_Getting started with blockchain for Java developers_][7], "the technologies most people know, such as Java, .NET, and relational databases, are not common in the blockchain space; instead, blockchain is primarily dominated by C, Go, and Rust on the server side, and JavaScript on the client side." However, this should not deter you from using Java for developing blockchain projects, and Ibrayam provides seven Java-based open source technologies that leverage the Java language and the Java Virtual Machine (JVM) for blockchain development.
The seven technologies he presents are: Corda, a business-focused, blockchain technology that focuses on building smart contracts to process and streamline business transactions on the chain; Hyperledger's Pantheon (or Besu), an Ethereum client that enables use of private and public networks and was created to introduce Java developers to blockchain development; Bitcoinj, a Java implementation of the Bitcoin protocol that allows the use of a wallet and transactions without Bitcoin Core; Web3j, a lightweight Ethereum client that has implementations for both Android and Java for smart contract development; Hyperledger Fabric SDK, a complete solution for building and providing security for a localized or distributed blockchain; FundRequest, a decentralized platform/marketplace that enables requesting open source work and is completely implemented in Java on top of the Ethereum network; and Eventeum, which allows monitoring of the Ethereum network and storage of events and their details on a messaging server like Kafka or RabbitMQ.
### 7 Java tips for new developers
When learning a new language, there are always obstacles, whether they be syntactical differences or entire development paradigm shifts. Seth Kenlon provides [_7 Java tips for new developers_][8], focusing on what to look for when diving into Java programming. Installing Java and the Java Development Kit (JDK) are the first steps to developing in Java. Most computers may already have Java and JVM installed, but you will need JDK to begin programming.
In brief, Seth's tips are:
* Most other languages allow importing and exporting libraries or other code that you may require when developing a project. Java packages are external or internal libraries that need to be managed. The packages are separated and organized by namespaces, which are like buckets for organizing code.
* Packages are imported with the simple syntax of **import** with the library's namespace.
* Declaring a class allows you to create an object in your program. These classes can use different access modifiers; within the classes are properties and methods or functions that also can have access modifiers that define whether they can be used only inside of the class, outside of the class with inherited classes, or by any other class.
* The class modifier **Static** allows the use of properties or functions without having to instantiate or create an instance of an object.
* Code will eventually have bugs; it is inevitable. "Try and catch" flow control allows you to catch errors and exceptions and implement recovery and logging mechanisms.
* To run a Java application outside an integrated development environment (IDE), such as Netbeans or Eclipse, navigate to your Java project folders from the command line and type **java &lt;filename.java&gt;** or, if the application is already compiled into a .jar file, **java -jar &lt;filename.jar&gt;**.
### Using the Java Persistence API
[_Using the Java Persistence API_][9] (JPA) is my introduction to connecting Java to various data persistence solutions, whether they be relational, NoSQL, or basic file representations in a system. Java provides a broad interface that allows connection to generally any type of persistence solution. This tutorial walks through creating an application with common libraries, including Spring Boot, a module/template for quickly configuring applications in Java; Maven, a package manager for Java; Lombok, a library that simplifies defining object accessors/mutators; and Netbeans, a popular IDE for developing in Java.
The tutorial uses these libraries to create models for a fictitious bike shop's database. The models' accessors/mutators are defined with Lombok and provide data annotations that are used when persisting to the chosen database. Then the database is set up and configured through the **application.properties** file, which the JPA reads to connect and persist data. The persisting and fetching implementation is done mostly with the Spring framework for Mongo; however, you can also override functions for more control of what should be fetched when finding, updating, or persisting objects. In a matter of minutes, you will be able to define objects and call basic functions on local databases without much boilerplate.
### How to compare strings in Java
Flexibility is often considered a gift, and while there are tradeoffs between statically typed and dynamically typed languages, one of Java's strengths is its ability to compare types and equality of types. In fact, Girish Managoli explains in [_How to compare strings in Java_][10], there six different ways to compare the immutable string type in Java.
The double-equal operator (**==**) compares memory location rather than string content. When the compiler sees two strings that are equal, it will allocate the same memory for both. If a new string is instantiated, it will not share the same memory location or object reference.
The **equals** method compares the case-sensitive content of the string, not the object information. For example, if you use **equals** to compare **Dog** and **Dog**, the result would be true, even if they are two different objects; however, **dog** and **Dog** would be false because the function is case-sensitive. The **equalsIgnoreCase** function is the same as **equals**, except that it removes case-sensitivity; therefore, comparing **dog** and **Dog** would be true. The **compareTo** and **compareToIgnoreCase** functions compare strings based on the Unicode value of each character in the string; they compare the total value to the other string and return the total lexical value difference between the two (with case-sensitivity and case-insensitivity, respectively). Last but not least, the **Objects equals** function allows the comparison of two string object references and of null values.
### Java: Still growing and evolving
Java is still going strong, evolving, and staying relevant after all this time, and there is continued optimism in its growth. Since its release, the Java platform has continued to change with the times, from OpenJDK to release schedule changes, and push the envelope of what you can accomplish with it.
As you can see from the top Java articles on Opensource.com in 2019, it never hurts to know the language, because you never know where you can use it for your next project. These (and other) Opensource.com articles have been really helpful to me as a [new developer transitioning from higher education][11]. I look forward to reading and sharing more in 2020, and I hope you'll join me.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/java-resources
作者:[Stephon Brown][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/stephb
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee)
[2]: https://octoverse.github.com/#top-languages
[3]: https://insights.stackoverflow.com/survey/2019
[4]: https://opensource.com/article/19/8/what-object-java
[5]: https://opensource.com/article/19/6/what-java-constructor
[6]: https://opensource.com/article/19/10/initializing-arrays-java
[7]: https://opensource.com/article/19/4/blockchain-java-developers
[8]: https://opensource.com/article/19/10/java-basics
[9]: https://opensource.com/article/19/10/using-java-persistence-api
[10]: https://opensource.com/article/19/9/compare-strings-java
[11]: https://opensource.com/article/19/6/5-transferable-higher-education-skills

View File

@ -0,0 +1,122 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Signal: A Secure, Open Source Messaging App)
[#]: via: (https://itsfoss.com/signal-messaging-app/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Signal: A Secure, Open Source Messaging App
======
**_Brief: Signal is a secure open-source messaging app for smartphones. It also offers a standalone desktop app for Linux, Windows, and macOS_. _Here, we take a look at its features and usability._**
### Signal is an Excellent Alternative to WhatsApp (and Telegram) for Privacy Concerned People
![Signal App On Linux][1]
Signal is an open source application with a keen focus on privacy. It is recommended by privacy advocates like [Edward Snowden][2].
It may not have as many features as Telegram or WhatsApp but if you want to enhance your privacy while having a conversation, this is a solid open-source solution.
You can install it on your smartphone ([iOS][3]/[Android][4]) and it is also available for Linux, Windows, and macOS.
### Features of Signal Messenger
**Note:** _Some of the features are specific/exclusive to smartphones. You may not observe all the features mentioned in the desktop app._
As I already mentioned, this is tailored to enhance your privacy. So, the user experience may not be the “best” youve ever seen. But, privacy/security-wise, I think it is a good option to have.
![Signal Features][5]
#### Disappearing Messages
You can set a timer for messages in a conversation so that it will be automatically deleted as per the timer.
Essentially, anyone in the conversation can activate this feature. So, you control if the messages should stay in a conversation or disappear.
#### Use it As Default SMS App
If you want to utilize an open-source app for all your SMSs, you can simply go to Signals app settings and set it as the default for SMS and MMS.
#### Screen Security
Theres a neat feature to block screenshots in-app, “Screen Security”.
If you enable it, you wont be able to take a screenshot of any conversation in the app. You can find the option to enable or disable it from the app settings.
It may not be useful to everyone but you can try it out.
#### Safety Number
If you want to verify the security of your encryption with a friend, you can simply tap on the profile and scroll down to find “View Safety Number”.
You can either scan it to verify or simply take a look at it to mark it verified.
#### Locked Messages
If you protect the app with a lock (pin/fingerprint), even if your device has been unlocked, you wont be able to see the messages on your notifications.
So, when you get a notification while Signal is locked, you will notice the content of the notification as “**Locked Message**” which is a plus for privacy-oriented users.
#### Other Features
![][6]
As you would expect in a messaging app you get a couple of stickers to utilize and you can also create a group if you want.
However, you wont have the ability to moderate your group you can just add members and change the profile picture.
In addition to this, Signal also supports biometric security for its app.
### Installing Signal on Ubuntu/Linux
Unfortunately, you dont get a .**deb** or .**AppImage** to install it on your Linux distro. So, you will need to utilize the terminal as per the [official installation instructions][7].
Heres what you have to type in the terminal:
```
curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list
sudo apt update && sudo apt install signal-desktop
```
Simply copy-paste the commands one by one in the terminal and you should be good to go.
[Download Signal for Other Devices][7]
### My Thoughts On Signal
Ive been using Signal for a few years now and it has improved with what it offers. However, I still feel that the user experience can be improved.
Privacy-wise, it is definitely a good alternative to what we already have (in my opinion). You can give it a try and see how well it works for your usage.
You can also take a look at their [GitHub page][8] for the latest developments and beta releases if you want to try them out.
Signal app may not be a popular messaging app when compared to WhatsApp or even [Telegram on Linux][9]. But, you can try it for yourself and encourage your friends to use an open-source messaging app.
Have you tried it yet? Let me know what you think about the Signal app in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/signal-messaging-app/
作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?ssl=1
[2]: https://en.wikipedia.org/wiki/Edward_Snowden
[3]: https://apps.apple.com/us/app/signal-private-messenger/id874139669
[4]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&hl=en_IN
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-phone.jpg?ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot-1.jpg?ssl=1
[7]: https://signal.org/download/
[8]: https://github.com/signalapp
[9]: https://itsfoss.com/install-telegram-desktop-linux/