Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2019-11-13 22:41:52 +08:00
commit f2cb9422f8
15 changed files with 2545 additions and 329 deletions

View File

@ -0,0 +1,85 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Best Tools/Latest Tools to Use in Programming)
[#]: via: (https://opensourceforu.com/2019/11/best-tools-latest-tools-to-use-in-programming/)
[#]: author: (Daniil Balabushkin https://opensourceforu.com/author/daniil-balabushkin/)
Best Tools/Latest Tools to Use in Programming
======
[![computer programming][1]][2]
_[Programming languages][3] can be termed as the process in which a person called a programmer writes computer programs. It can also be defined as a set of instructions to facilitate specific actions. A computer understands this language and translates it into a form that can be read or understood by the human eye. It is divided into generations that are from the first generation to the fifth-generation programming languages._
There are four types of programming languages:
* Python
* C
* C++
* Java
Programming has helped a-lot in the development of new and diverse computational languages.
**Computer Programming Uses in the Society and the World at Large**
And these uses include:
* Computer programming helps in developing programming languages that are used for transforming computing problems into instructions. This allows programmers to build source codes much quicker.
* Programming languages have supported the development of the internet, which has brought people closer and made the world one.
* Programming is one of the main stages of the software development process. Software development involves several steps, including programming, testing, bug fixing documenting, etc. A programmer has to know all the stages and also a specialized knowledge about one particular field.
* Programming helps students to understand how to solve computing problems. As you develop more and more programs, your confidence level rises and boosts your educational exposure on programming.
* As innovations come up, programmers are forced to cope up with these new technologies. Because technology is being used all over the world, clients need and want more natural ways to use technology. Programmers have been tasked with developing new ways of building software that can be used in the technology market to make it easier for these innovations to be used by people.
The rise of a more technological world has immensely influenced programming through the following ways:
**Internet**
The internet has been built on programming languages that the computer understands and in turn, creates a worldwide link through an informal network, e.g., Google, Wikipedia, and [_paper writing service_][4] companies. As the world and technology rise, it leads to the consumer wanting more straightforward means to get information and also a fast means of networking hence better services are leading to the high demand for assistance from the programmers.
**Employment**
Due to a rise in technology, programmers are on high demand for their services, and this leads to the need for well-trained and learned programming technicians due to the high demand for programs and applications by the consumer. This, in turn, builds and uplifts the programming sector.
**Socialization**
In the past, people only made calls and sent messages. These were older ways of programming to convey information. But due to a rise in the technological industry, people have come up with ideas like WhatsApp, Twitter, and Facebook. These applications need programmers for them to fix, create, and debug the programs, and this leads to better and new communication services from the specified uses. Due to the rise in technology and social needs, programmers have achieved better employment opportunities and made programming an essential requirement in the technological world.
**Transport industry**
By this, I mean cars of the future, trains of the future, and even airlines of the future. Companies like Tesla have taken programming to the next level. From vehicles that speak to you to cars that can drive by themselves, to name but a few. For that to be achieved, you need a programmer to create a primary interface and language that will link the car to the software and in turn, give feedback to the system. Without programmers, this would not be possible. The rise in the transport industry has been influenced tremendously by programming and technological advancements.
**Authors Note**
_[Programming][5] and the rise in technology go hand in hand. The more technology grows, the more the need to have programmers in the market._
_Every discovery in the technology industry needs an application or program, thus leading to the boom in the programming and coding sector._
![Avatar][6]
[Daniil Balabushkin][7]
[![][8]][9]
--------------------------------------------------------------------------------
via: https://opensourceforu.com/2019/11/best-tools-latest-tools-to-use-in-programming/
作者:[Daniil Balabushkin][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://opensourceforu.com/author/daniil-balabushkin/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2016/06/computer-programming.jpg?resize=696%2C441&ssl=1 (computer programming)
[2]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2016/06/computer-programming.jpg?fit=700%2C444&ssl=1
[3]: https://www.softwaretestinghelp.com/software-development-tools/
[4]: https://expert-writers.net/
[5]: https://www.computerscience.org/resources/computer-programming-languages/
[6]: https://secure.gravatar.com/avatar/5f72f6534155d49b49e0f0b9eab2e7be?s=100&r=g
[7]: https://opensourceforu.com/author/daniil-balabushkin/
[8]: https://opensourceforu.com/wp-content/uploads/2019/11/assoc.png
[9]: https://feedburner.google.com/fb/a/mailverify?uri=LinuxForYou&loc=en_US

View File

@ -0,0 +1,75 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What open communities teach us about empowering customers)
[#]: via: (https://opensource.com/open-organization/19/11/customer-empowerment-open-communities)
[#]: author: (TracyG https://opensource.com/users/tgiuliani23)
What open communities teach us about empowering customers
======
Granting customers more autonomy and control can be scary. It's also an
inevitable consequence of digital transformation. Time to open up our
relationships.
![Shaking hands, networking][1]
When it comes to digital transformation, businesses seem to be on the right track improving their customers' experiences through the use of technologies. Today, so much [digital transformation literature][2] describes the benefits of "delivering new value to customers" or "delivering value to customers in new ways."
But "bringing new value to customers" is just the beginning. An even more powerful effect of digital transformation efforts is _empowering customers_.
"What?" you may be saying. "How could I _possibly_ empower customers? What does that even mean?"
With this series, we're here to help. In this article specifically, we'll define customer empowerment and explain why it should be a concern for any organization facing the possibility of transformation.
### Defining customer empowerment
Customer empowerment begins with the idea of giving customers access to the information, knowledge, opportunities, and authority to act in their own best interests inside the boundaries of their organizations and industries. This translates into an ability for customers to do _more for themselves_.
Creating systems for customer empowerment means doing more than merely adding value to existing customer relationships. It means developing entirely _new_ kinds of relationships—more _open_ relationships—with customers. And that, in turn, means organizations undergoing digital transformations will need to understand how openness affects not only the _technical_ connections they make with people but also the _social_ connections responsible for the success of the new systems they're putting in place.
The customer relationships you want to create are not merely the result of saying "Here's what we do for you, dear customer"; they are like the relationships you have in _other_ areas of your life: Trusting. Reciprocal. Authentic.
Creating systems for customer empowerment means doing more than merely adding value to existing customer relationships.
In short, customer empowerment is a natural, inevitable step in digital transformation. It involves using open values, open processes, and open software to transform the relationship with the customer by trusting them and giving them the information and opportunities to engage differently with your company.
Think of [the way employee empowerment works in open organizations][3]. Leaders in these organizations make information, opportunities, and authority available to stakeholders so they feel empowered to make decisions and solve problems in ways leaders might not have predicted. _Customer_ empowerment works the same way—though in this case, the _organization itself_ provides _external_ parties with materials that empower their _own_ innovative activities. Typically, they do this through new, customer-facing processes. It's imperative that businesses interested in customer empowerment have enough data and sufficiently frequent interactions with their customers to be able to understand them, and that _associates_ in these businesses have a customer-centric mindset accompanied by the tools, processes, and training to make decisions that focus on customers' empowerment.
Makes sense, right? But what does it look like?
### An empowerment continuum
Let's begin with one example from the retail industry. Nordstrom is a company that repeatedly earns high marks for its empowered employees and its superior customer service. Nordstrom customers feel empowered when they interact with the brand because the organization goes to great lengths to ensure that information on sizes for each item is correct, that pictures are color-true, that the opportunity to shop is convenient through online sites and mobile apps, and that trying new brands is risk-free for customers (because shipping is free). Nordstrom even manages return shipping through printable labels directly on its website. The company is trusting customers not to order clothes and return them after wearing them.
Customer empowerment is a natural, inevitable step in digital transformation.
This is an example of a company operating at the far end of a customer empowerment continuum. The empowerment practices we describe are low-risk—that is, the customer behaviors Nordstrom is trying to cultivate are aimed at helping customers do more of what Nordstrom expects them to do (buy goods).
But we can follow that customer empowerment continuum to identify various ways companies might empower customers (and in the process grant them the power to innovate and surprise). [Kelvin Claveria][4], for example, outlines several examples: Mountain Dew collaborated with customers on their new flavor, "Voltage"; Buffer was transparent with customers and businesses about their security breach; Coca-Cola involved its fan community in building marketing content. These examples (all of which focus on marketing) demonstrate a higher degree of risk, but they're not quite on the far edge of our customer empowerment continuum.
At that edge is full-on customer empowerment, where a trusted relationship with the customer lays the foundation of interactions. We might think of open source communities as exemplary in this regard: customers have access to the source code of the application they're using and are actively modifying the products they receive. What's more trusting and empowering than that?
In open source communities, which leverage collaborative development methods, anyone can share information, get feedback, and take advantage of numerous opportunities to write code and participate in the community projects. The community is trusting user-collaborators to participate honestly (and without malicious intent) at the same time that the community manages itself and bans users who don't participate with community values or take advantage.
What might customer empowerment in _this_ sense look like for organizations?
In our next installment, we'll explore that question.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/19/11/customer-empowerment-open-communities
作者:[TracyG][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/tgiuliani23
[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://enterprisersproject.com/what-is-digital-transformation
[3]: https://opensource.com/open-organization/18/10/understanding-engagement-and-empowerment
[4]: https://www.visioncritical.com/blog/power-of-customer

View File

@ -1,241 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Schedule and Automate tasks in Linux using Cron Jobs)
[#]: via: (https://www.linuxtechi.com/schedule-automate-tasks-linux-cron-jobs/)
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
How to Schedule and Automate tasks in Linux using Cron Jobs
======
Sometimes, you may have tasks that need to be performed on a regular basis or at certain predefined intervals. Such tasks include backing up databases, updating the system, performing periodic reboots and so on. Such tasks are referred to as **cron jobs**. Cron jobs are used for **automation of tasks** that come in handy and help in simplifying the execution of repetitive and sometimes mundane tasks. **Cron** is a daemon that allows you to schedule these jobs which are then carried out at specified intervals. In this tutorial, you will learn how to schedule jobs using cron jobs.
[![Schedule -tasks-in-Linux-using cron][1]][2]
### The Crontab file
A crontab file, also known as a **cron table**, is a simple text file that contains rules or commands that specify the time interval of execution of a task. There are two categories of crontab files:
**1)  System-wide crontab file**
These are usually used by Linux services & critical applications requiring root privileges. The system crontab file is located at **/etc/crontab** and can only be accessed and edited by the root user. Its usually used for the configuration of system-wide daemons. The crontab file looks as shown:
[![etc-crontab-linux][1]][3]
**2) User-created crontab files**
Linux users can also create their own cron jobs with the help of the crontab command. The cron jobs created will run as the user who created them.
All cron jobs are stored in /var/spool/cron (For RHEL and CentOS distros) and /var/spool/cron/crontabs (For Debian and Ubuntu distros), the cron jobs are listed using the username of the user that created the cron job
The **cron daemon** runs silently in the background checking the **/etc/crontab** file and **/var/spool/cron** and **/etc/cron.d*/** directories
The **crontab** command is used for editing cron files. Let us take a look at the anatomy of a crontab file.
### The anatomy of a crontab file
Before we go further, its important that we first explore how a crontab file looks like. The basic syntax for a crontab file comprises 5 columns represented by asterisks followed by the command to be carried out.
*    *    *    *    *    command
This format can also be represented as shown below:
m h d moy dow command
OR
m h d moy dow /path/to/script
Lets expound on each entry
* **m**: This represents minutes. Its specified from 0 to 59
* **h**: This denoted the hour specified from 0 to 23
* **d**:  This represents the day of the month. Specified between 1 to 31`
* **moy**: This is the month of the year. Its specified between 1 to 12
* **doy**:  This is the day of the week. Its specified between 0 and 6 where 0 = Sunday
* **Command**: This is the command to be executed e.g backup command, reboot, & copy
### Managing cron jobs
Having looked at the architecture of a crontab file, lets see how you can create, edit and delete cron jobs
**Creating cron jobs**
To create or edit a cron job as the root user, run the command
# crontab -e
To create a cron job or schedule a task as another user, use the syntax
# crontab -u username -e
For instance, to run a cron job as user Pradeep, issue the command:
# crontab -u Pradeep -e
If there is no preexisting crontab file, then you will get a blank text document. If a crontab file was existing, The  -e option allows  to edit the file,
**Listing crontab files**
To view the cron jobs that have been created, simply pass the -l option as shown
# crontab -l
**Deleting a  crontab file**
To delete a cron file, simply run crontab -e and delete or the line of the cron job that you want and save the file.
To remove all cron jobs, run the command:
# crontab -r
That said, lets have a look at different ways that you can schedule tasks
### Crontab examples in Scheduling tasks.
All cron jobs being with a shebang header as shown
#!/bin/bash
This indicates the shell you are using, which, for this case, is bash shell.
Next, specify the interval at which you want to schedule the tasks using the cron job entries we specified earlier on.
To reboot a system daily at 12:30 pm, use the syntax:
30  12 *  *  * /sbin/reboot
To schedule the reboot at 4:00 am use the syntax:
0  4  *  *  *  /sbin/reboot
**NOTE:**  The asterisk * is used to match all records
To run a script twice every day, for example, 4:00 am and 4:00 pm, use the syntax.
0  4,16  *  *  *  /path/to/script
To schedule a cron job to run every Friday at 5:00 pm  use the syntax:
0  17  *  *  Fri  /path/to/script
OR
0 17  *  *  *  5  /path/to/script
If you wish to run your cron job every 30 minutes then use:
*/30  *  *  *  * /path/to/script
To schedule cron to run after every 5 hours, run
*  */5  *  *  *  /path/to/script
To run a script on selected days, for example, Wednesday and Friday at 6.00 pm execute:
0  18  *  *  wed,fri  /path/to/script
To schedule multiple tasks to use a single cron job, separate the tasks using a semicolon for example:
*  *  *  *  *  /path/to/script1 ; /path/to/script2
### Using special strings to save time on writing cron jobs
Some of the cron jobs can easily be configured using special strings that correspond to certain time intervals. For example,
1)  @hourly timestamp corresponds to  0 * * * *
It will execute a task in the first minute of every hour.
@hourly /path/to/script
2) @daily timestamp is equivalent to  0 0 * * *
It executes a task in the first minute of every day (midnight). It comes in handy when executing daily jobs.
  @daily /path/to/script
3) @weekly   timestamp is the equivalent to  0 0 1 * mon
It executes a cron job in the first minute of every week where a week whereby, a  week starts on Monday.
 @weekly /path/to/script
3) @monthly is similar to the entry 0 0 1 * *
It carries out a task in the first minute of the first day of the month.
  @monthly /path/to/script
4) @yearly corresponds to 0 0 1 1 *
It executes a task in the first minute of every year and is useful in sending New year greetings 🙂
@monthly /path/to/script
### Crontab Restrictions
As a Linux user, you can control who has the right to use the crontab command. This is possible using the **/etc/cron.deny** and **/etc/cron.allow** file. By default, only the /etc/cron.deny file exists and does not contain any entries. To restrict a user from using the crontab utility, simply add a users username to the file. When a user is added to this file, and the user tries to run the crontab command, he/she will encounter the error below.
![restricted-cron-user][1]
To allow the user to continue using the crontab utility,  simply remove the username from the /etc/cron.deny file.
If /etc/cron.allow file is present, then only the users listed in the file can access and use the crontab utility.
If neither file exists, then only the root user will have privileges to use the crontab command.
### Backing up crontab entries
Its always advised to backup your crontab entries. To do so, use the syntax
# crontab -l > /path/to/file.txt
For example,
```
# crontab -l > /home/james/backup.txt
```
**Checking cron logs**
Cron logs are stored in /var/log/cron file. To view the cron logs run the command:
```
# cat /var/log/cron
```
![view-cron-log-files-linux][1]
To view live logs, use the tail command as shown:
```
# tail -f /var/log/cron
```
![view-live-cron-logs][1]
**Conclusion**
In this guide, you learned how to create cron jobs to automate repetitive tasks, how to backup as well as how to view cron logs. We hope that this article provided useful insights with regard to cron jobs. Please dont hesitate to share your feedback and comments.
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/schedule-automate-tasks-linux-cron-jobs/
作者:[Pradeep Kumar][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lujun9972
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Schedule-tasks-in-Linux-using-cron.jpg
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/11/etc-crontab-linux.png

View File

@ -1,87 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to add a user to your Linux desktop)
[#]: via: (https://opensource.com/article/19/11/add-user-gui-linux)
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
How to add a user to your Linux desktop
======
It's easy to manage users from a graphical interface, whether during
installation or on the desktop.
![Team of people around the world][1]
Adding a user is one of the first things you do on a new computer system. And you often have to manage users throughout the computer's lifespan.
My article on the [**useradd** command][2] provides a deeper understanding of user management on Linux. Useradd is a command-line tool, but you can also manage users graphically on Linux. That's the topic of this article.
### Add a user during Linux installation
Most Linux distributions provide a step for creating a user during installation. For example, the Fedora 30 installer, Anaconda, creates the standard _root_ user and one other local user account. When you reach the **Configuration** screen during installation, click **User Creation** under **User Settings**.
![Fedora Anaconda Installer - Add a user][3]
On the Create User screen, enter the user's details: **Full name**, **User name**, and **Password**. You can also choose whether to make the user an administrator.
![Create a user during installation][4]
The **Advanced** button opens the **Advanced User Configuration** screen. Here, you can specify the path to the home directory and the user and group IDs if you need something besides the default. You can also type a list of secondary groups that the user will be placed into.
![Advanced user configuration][5]
### Add a user on the Linux desktop
#### GNOME
Many Linux distributions use the GNOME desktop. The following screenshots are from Red Hat Enterprise Linux 8.0, but the process is similar in other distros like Fedora, Ubuntu, or Debian.
Start by opening **Settings**. Then go to **Details**, select **Users**, click **Unlock**, and enter your password (unless you are already logged in as root). This will replace the **Unlock** button with an **Add User** button.
![GNOME user settings][6]
Now, you can add a user by clicking **Add User**,** **then selecting the account **Type** and the details **Name** and **Password**).
In the screenshot below, a user name has been entered, and settings are left as default. I did not have to enter the **Username**; it was created automatically as I typed in the **Full Name** field. You can still modify it though if the autocompletion is not to your liking.
![GNOME settings - add user][7]
This creates a standard account for a user named Sonny. Sonny will need to provide a password the first time he or she logs in.
Next, the users will be displayed. Each user can be selected and customized or removed from this screen. For instance, you might want to choose an avatar image or set the default language.
![GNOME new user][8]
#### KDE
KDE is another popular Linux desktop environment. Below is a screenshot of KDE Plasma on Fedora 30. You can see that adding a user in KDE is quite similar to doing it in GNOME.
![KDE settings - add user][9]
### Conclusion
Other desktop environments and window managers in addition to GNOME and KDE include graphical user management tools. Adding a user graphically in Linux is quick and simple, whether you do it at installation or afterward.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/add-user-gui-linux
作者:[Alan Formy-Duval][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world)
[2]: https://opensource.com/article/19/10/linux-useradd-command
[3]: https://opensource.com/sites/default/files/uploads/screenshot_fedora30_anaconda2.png (Fedora Anaconda Installer - Add a user)
[4]: https://opensource.com/sites/default/files/uploads/screenshot_fedora30_anaconda3.png (Create a user during installation)
[5]: https://opensource.com/sites/default/files/uploads/screenshot_fedora30_anaconda4.png (Advanced user configuration)
[6]: https://opensource.com/sites/default/files/uploads/gnome_settings_user_unlock.png (GNOME user settings)
[7]: https://opensource.com/sites/default/files/uploads/gnome_settings_adding_user.png (GNOME settings - add user)
[8]: https://opensource.com/sites/default/files/uploads/gnome_settings_user_new.png (GNOME new user)
[9]: https://opensource.com/sites/default/files/uploads/kde_settings_adding_user.png (KDE settings - add user)

View File

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

View File

@ -0,0 +1,133 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (3 approaches to secrets management for Flatpak applications)
[#]: via: (https://opensource.com/article/19/11/secrets-management-flatpak-applications)
[#]: author: (Daiki Ueno https://opensource.com/users/ueno)
3 approaches to secrets management for Flatpak applications
======
Flatpak secrets management is getting an upgrade. Here's what's coming.
![A top secret file.][1]
[Flatpak][2] enables desktop applications to run in isolated sandboxes, which significantly improves security as it prevents applications from affecting one another and impacting the host system. In practice, however, typical applications still need to access services and user data that are shared among other applications and the host. This situation has been improved [by hardening permissions around the portal mechanism][3], though there was a long-standing issue: How to manage user secrets.
In this article, we present our approach to managing user secrets for Flatpak applications. While most applications can transparently take advantage of the proposed mechanism, some applications need code modification. The migration steps are also presented.
### How secrets are managed on the Linux desktop
On a modern Linux desktop, most of the secrets—passwords, tokens, and so on, with their associated attributes—are centrally managed by the daemon process **gnome-keyring-daemon**. Applications access this daemon through [the Secret Service API][4], which is exposed through D-Bus. This process is done under the hood if the application is using a client library like **libsecret**. 
**Note:** For the same purpose, there is a library called **libgnome-keyring**, which is now obsolete. Note that, despite the name, **libgnome-keyring** is a separate project from **gnome-keyring**, which is NOT obsolete and still maintains the central role of secrets management.
On the daemon side, the secrets are stored on the filesystem and encrypted. Other than that, the daemon is nothing but a normal storage service, meaning that any application can store data on arbitrary "paths" that other applications can also see. While this model is sufficient as long as we trust all applications, it negates one of Flatpaks security goals: [Increase the security of desktop systems by isolating applications from one another][5].
Therefore, when installing a Flatpak application that uses the Secret Service API, the user is asked to grant the necessary permissions to the application. In the example below, you can see that the application requires access to the Secret Service API (**org.freedesktop.secrets**). If the user doesnt want to allow this application to access the service, their only option is to forfeit installation:
```
$ flatpak install org.gnome.Epiphany
org.gnome.Epiphany permissions:
        ipc                     network         pulseaudio      wayland
        x11                     dri             file access [1] dbus access [2]
        system dbus access [3]
        [1] xdg-download, xdg-run/dconf, ~/.config/dconf:ro
        [2] ca.desrt.dconf, org.freedesktop.Notifications, org.freedesktop.secrets
        [3] org.freedesktop.GeoClue2
Proceed with these changes to the Default system installation? [Y/n]:
```
This is clearly an undesirable outcome.
### The local storage approach
The basic idea to tackle this problem is to store the secrets on the application side, rather than the host side (**gnome-keyring-daemon**). This practice is analogous to [the recent work on GSettings][6], where applications store the settings data in a local file instead of in a [**dconf**][7] service running on the host.
When it comes to secrets, however, there is a bootstrapping problem: The application has to encrypt secrets when storing them in a local file, but it doesnt know the encryption key yet. To provision the application with an encryption key, we rely on the [Flatpak portal][8] mechanism, which sits between the application and the host to let the two communicate through a restricted interface.
We also added [a new portal][9] that allows applications to retrieve encryption keys. First, the application sends a request to the portal (the request contains a Unix file descriptor where the encryption key is written). Then, the portal delegates the request to the back-end implementation in **gnome-keyring-daemon**, which sends a unique encryption key for the sandboxed application through the file descriptor.
With the received encryption key, the application encrypts the secrets and stores them in the application data directory (**~/.var/app/$APPID/data/keyrings**), which is **bind**-mounted and accessible from both the host and the sandbox.
### The libsecret API
The **libsecret** project provides two different sets of APIs. One is [the simple API][10], and the other is [the complete API][11]. The former provides simpler, stateless operations for retrieving and storing secrets, while the latter provides a more complete, object-oriented API that maps the D-Bus interface to the C API.
Local storage is only supported in the simple API. If your applications are already using the simple API, then they will automatically use local storage when running under Flatpak. Otherwise, to enable local storage, the applications need to be ported to the simple API. See [the migration patch in Epiphany][12] as an example.
Having a distinction between the two API sets also makes it possible for the applications to opt-out from using local storage. For example, if your application is a password manager that needs full access to user keyrings, you can bypass local storage by using the complete API.
### The keyring format
Although ideally, we should be able to use the same keyring format for both local storage and **gnome-keyring-daemon**, we realized that the keyring format used by **gnome-keyring-daemon** has limitations. Secrets, including associated attributes, are encrypted as a single chunk, meaning that they can consume an unnecessary amount of locked memory. Also, attributes are hashed without a key, meaning that it is possible to guess which secrets are stored in the file.
Therefore, instead of implementing this format in two places, we decided to define a new version of the keyring file format, with the following characteristics: Secrets are encrypted individually and attribute hashes are now a [message authentication code (MAC)][13] over the attributes.
This new format is based on [the][14] [GVariant serialization format][14], except for the header, and this change allows us to reuse most of the code for encoding, decoding, and lookup.
### What's next for Flatpak secrets management
The necessary patches are (currently) only available in the Git repositories of the relevant components (**xdg-desktop-portal**, **gnome-keyring**, and **libsecret**). They will be included in the next releases leading up to GNOME 3.36.
If you are a developer, there is still room for improvement in this area. Here is where your help would be greatly appreciated:
* **Session keyrings:** The Secret Service API supports "session" keyrings, which only last for the duration of the user session. The local storage backend doesnt support this feature yet. This code could be implemented using the session keyring in the Linux kernel.
* **Management and backup application:** Application secrets are now stored in multiple locations, and not just the host keyrings. It would be useful if there were a tool to manage application secrets and make backups. This process should be possible by enhancing GNOMEs Seahorse to look at application secrets.
* **Online accounts portal:** These days, it is common for web applications to be integrated with web-based access delegation protocols such as OAuth 2.0. These protocols are supported by **gnome-online-accounts**, which in turn uses **gnome-keyring-daemon** for storing the tokens. A portal interface for online accounts would be useful for restricting access per application.
* **Wider adoption of the new keyring format:** While the new format has several advantages, it is currently only used by **libsecret** on the application side. It would be beneficial if **gnome-keyring-daemon** on the host side also used the same format.
* **Hardening the reinstall process:** By default, the applications keyring file (**~/.var/app/$APPID/data/keyrings**) persists after uninstall, along with other data. This persistence is vulnerable in case the application ID is reused by an untrusted publisher. Currently, we recommend using the **\--delete-data** option to ensure that such application data is removed. This procedure could be improved if a publishers ID was associated with the application.
### Summary
This article presented a mechanism to provision Flatpak applications with user secrets. This mechanism was designed based on the following principles:
* Minimize the host interface.
* Let applications interact with the host through a Flatpak portal.
* Store the application data in a common data format.
Although the mechanism is transparent, as long as you use **libsecret**, the mechanism is only enabled through **libsecret**s simple API. For a smoother transition, we suggest migrating applications to this API. More information about the projects background and the design rationale is available in the GUADEC presentation ([slides][15], [recording][16]).
Fragmentation is a longstanding Achilles heel for the Linux desktop. In a world of myriad...
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/secrets-management-flatpak-applications
作者:[Daiki Ueno][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/ueno
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/topsecret_folder_file_security.jpg?itok=y0P2GC5K (A top secret file.)
[2]: https://opensource.com/article/19/10/how-build-flatpak-packaging
[3]: https://blog.tingping.se/2019/10/06/hardening-flatpak-permissions.html
[4]: https://specifications.freedesktop.org/secret-service/
[5]: http://docs.flatpak.org/en/latest/sandbox-permissions.html#sandbox-permissions
[6]: https://blogs.gnome.org/mclasen/2019/07/12/settings-in-a-sandbox-world/
[7]: https://wiki.gnome.org/Projects/dconf
[8]: https://flatpak.github.io/xdg-desktop-portal/portal-docs.html
[9]: https://github.com/flatpak/xdg-desktop-portal/pull/359
[10]: https://developer.gnome.org/libsecret/unstable/simple.html
[11]: https://developer.gnome.org/libsecret/unstable/complete.html
[12]: https://gitlab.gnome.org/GNOME/epiphany/commit/ed514f3ef43b323c51fb539274bef9dce0907ff2
[13]: https://en.wikipedia.org/wiki/Message_authentication_code
[14]: https://people.gnome.org/~desrt/gvariant-serialisation.pdf
[15]: https://people.gnome.org/~dueno/libsecret-guadec.pdf
[16]: https://guadec.ubicast.tv/videos/desktop-secrets-management-for-the-future/

View File

@ -0,0 +1,140 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A guide to intermediate awk scripting)
[#]: via: (https://opensource.com/article/19/11/intermediate-awk-scripting)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
A guide to intermediate awk scripting
======
Learn how to structure commands into executable scripts.
![Coding on a computer][1]
This article explores awk's capabilities, which are easier to use now that you know how to structure your command into an executable script.
### Logical operators and conditionals
You can use the logical operators **and** (written **&&**) and **or** (written **||**) to add specificity to your conditionals.
For example, to select and print only records with the string "purple" in the second column _and_ an amount less than five in the third column:
```
`$2 == "purple" && $3 < 5 {print $1}`
```
If a record has "purple" in column two but a value greater than five in column three, then it is _not_ selected. Similarly, if a record matches column three's requirement but lacks "purple" in column two, it is also _not_ selected.
### Next command
Say you want to select every record in your file where the amount is greater than or equal to eight and print a matching record with two asterisks (******). You also want to flag every record with a value between five (inclusive) and eight with only one asterisk (*****). There are a few ways to do this, and one way is to use the **next** command to instruct awk that after it takes an action, it should stop scanning and proceed to the _next_ record.
Here's an example:
```
NR == 1 {
  print $0;
  next;
}
$3 &gt;= 8 {
  printf "%s\t%s\n", $0, "**";
  next;
}
$3 &gt;= 5 {
  printf "%s\t%s\n", $0, "*";
  next;
}
$3 &lt; 5 {
  print $0;
}
```
### BEGIN command
The **BEGIN** command lets you print and set variables before awk starts scanning a text file. For instance, you can set the input and output field separators inside your awk script by defining them in a **BEGIN** statement. This example adapts the simple script from the previous article for a file with fields delimited by commas instead of whitespace:
```
#!/usr/bin/awk -f
#
# Print each record EXCEPT
# IF the first record contains "raspberry",
# THEN replace "red" with "pi"
BEGIN {
        FS=",";
}
$1 == "raspberry" {
        gsub(/red/,"pi")
}
```
### END command
The **END** command, like **BEGIN**, allows you to perform actions in awk after it completes its scan through the text file you are processing. If you want to print cumulative results of some value in all records, you can do that only after all records have been scanned and processed.
The **BEGIN** and **END** commands run only once each. All rules between them run zero or more times on _each record_. In other words, most of your awk script is a loop that is executed at every new line of the text file you're processing, with the exception of the **BEGIN** and **END** rules, which run before and after the loop.
Here is an example that wouldn't be possible without the **END** command. This script accepts values from the output of the **df** Unix command and increments two custom variables (**used** and **available**) with each new record.
```
$1 != "tempfs" {
    used += $3;
    available += $4;
}
END {
    printf "%d GiB used\n%d GiB available\n", used/2^20, available/2^20;
}
```
Save the script as **total.awk** and try it:
```
`df -l | awk -f total.awk`
```
The **used** and **available** variables act like variables in many other programming languages. You create them arbitrarily and without declaring their type, and you add values to them at will. At the end of the loop, the script adds the records in the respective columns together and prints the totals.
### Math
As you can probably tell from all the logical operators and casual calculations so far, awk does math quite naturally. This arguably makes it a very useful calculator for your terminal. Instead of struggling to remember the rather unusual syntax of **bc**, you can just use awk along with its special **BEGIN** function to avoid the requirement of a file argument:
```
$ awk 'BEGIN { print 2*21 }'
42
$ awk 'BEGIN {print 8*log(4) }'
11.0904
```
Admittedly, that's still a lot of typing for simple (and not so simple) math, but it wouldn't take much effort to write a frontend, which is an exercise for you to explore.
* * *
_This article is adapted from an episode of [Hacker Public Radio][2], a community technology podcast._
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/intermediate-awk-scripting
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: http://hackerpublicradio.org/eps.php?id=2129

View File

@ -0,0 +1,302 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The Top Nine Open Source Cloud Management Platforms)
[#]: via: (https://opensourceforu.com/2019/11/the-top-nine-open-source-cloud-management-platforms/)
[#]: author: (Dr Anand Nayyar https://opensourceforu.com/author/anand-nayyar/)
The Top Nine Open Source Cloud Management Platforms
======
[![][1]][2]
_A cloud management platform (CMP) is a comprehensive software suite with integrated tools that an enterprise can use to monitor and control cloud computing resources. There are many CMPs out there, both open source and proprietary. This article explores how cloud platforms work, their capabilities, as well as a selection of the top open source cloud platforms of the day._
In recent times, all the enterprises that have started or have adopted cloud computing face new challenges with regard to ensuring the same visibility in cloud applications as they have with their on-premise apps. With any cloud-based full implementation, the issues that users face include preserving the integrity, usability and security of all the data migrated online. According to John Webster, senior partner and analyst for the Evaluator Group, and whose research area is the hybrid cloud and Big Data, “As enterprise IT operations start to expand our capabilities and resources into the cloud, we now want to manage cloud resources with the same policy, procedure, guidance and expectations that we have over our existing IT environment.”
The only solution to all the issues arising from cloud-based implementations is a cloud management platform (CMP). This provides a rich set of capabilities for discovery, template-based provisioning, orchestration and automation. It also enables operational monitoring and management, governance and cost optimisation across multiple public and private clouds as well as virtual and bare-metal servers.
A CMP is a comprehensive suite with integrated software tools that an enterprise can use to monitor and control cloud computing resources. An enterprise can use a CMP for either a private or public cloud, but CMPs facilitate toolsets for hybrid and multi-cloud models to centralise the control of various cloud-based infrastructures.
A wide range of tools is available to deal with these challenges and help companies efficiently operate applications and services in the cloud. Vendors offer a variety of cloud management tools that enable IT organisations to build, purchase, manage, monitor, track and optimise their cloud resources. With the help of these tools, organisations can save time and effort while allowing IT staff to focus on more strategic goals. These tools also help in monitoring users interactions with the cloud infrastructure and in managing resource allocation.
In the cloud marketplace, different tools have unique feature sets. Capabilities include unified management across multiple clouds, integration with third-party tools for configuration and monitoring purposes, dashboards and reports for detailed information about resource consumption, notifications and alerts when predefined thresholds are reached, and controlled access to resources to avoid over usage or unauthorised access. By simplifying the management of cloud environments and reducing the complexity and cost of managing multiple activities, the right cloud management tool can bring speed, flexibility, security and cost efficiency to any organisation.
![Figure 1: Cloudstack architecture][3]
So the important question is, “Which CMP is the best?” Well, there are both commercial and open source options. Nowadays, open source technology has become a central facet of cloud computing for many users around the world. In this article, we discuss the top open source cloud management platforms to assist admins, systems analysts, network security as well as cloud computing professionals select the best platform, based on the requirements of the enterprise.
Before we dive into the types of open source CMPs, lets discuss some of their broad capabilities and how they work.
According to analysis by Market Research Future (MRF), the global CMP market was valued at US$ 8.18 billion in 2018 and is expected to reach US$ 26.77 billion by 2022, registering a CAGR of 18.4 per cent during the forecast period. The market growth is attributed to the rising need for enterprises to have greater control over IT spending, the surge in the adoption of heterogeneous and multi-modal IT service delivery environments, the rapid deployment of virtualised workloads, and improved operational efficiency. On the other hand, insufficient technical expertise and the rising security concerns for platforms developed in-house are some of the factors expected to hinder the market growth during the assessment period.
**How cloud management platforms work**
A CMP is deployed into existing cloud environments as a virtual machine (VM) consisting of a database and server. The server communicates with application programming interfaces (APIs) to connect the database and virtual resources held in the cloud. The database collects the information on how the virtual infrastructure is performing and sends an analysis to the Web interface, where systems administrators can analyse the cloud performance. The whole interconnectivity relies on the operating system, which commands all the different technologies that make up clouds and also deploys cloud management tools.
A CMP should be capable of the following things.
* **Strong integration with IT infrastructure:** CMPs should be customised as per the enterprises needs, and must meet the requirements of the operating systems, apps, storage frameworks and anything else running in the cloud.
* **Automating manual tasks:** CMPs should have self-service capabilities to automate everything, with no human involvement.
* **Cost management:** CMPs should assist organisations with precision cost forecasting and reporting to easily use and manage all sorts of cloud services.
* **Service management:** They should assist the IT team to monitor cloud-based services to help in capacity planning, workload deployment, asset management and incident management.
* **Governance and security:** CMPs should enable administrators to enforce policy-based control of cloud resources, and offer security features like encryption as well as identity and access management.
**Top open source CMPs**
The following are the top open source cloud management platform providers.
**Apache CloudStack**
Apache CloudStack is an open source, multi-hypervisor, multi-tenant, high-availability Infrastructure-as-a-Service CMP, which facilitates creating, deploying and managing cloud services by providing a complete stack of features and components for cloud environments. It uses existing hypervisors such as KVM, VMware vSphere, VMware ESXi, VMware vCenter and XenServer/XCP for virtualisation. CloudStack can also orchestrate the non-technical elements of service delivery such as billing and metering. It presents a range of APIs, allowing it to be integrated with any other platform.
The main components of CloudStack are:
1. Compute nodes (CNs), which are servers when VM instances are instantiated.
2. A cluster, which is composed of several CNs that share the same hypervisor and primary storage system.
3. Pod is a rack of hardware including Layer-2 switches and one or more clusters. It is responsible for storing the VM files, which represent the primary storage.
4. The Availability Zone is made up of one or more pods, with secondary storage forming a zone. This is equivalent to a single data centre, representing geographic allocations. The secondary storage stores VM templates, ISO images and disk volume snapshots.
5. The management server is a single point of configuration that provides Web user interfaces and APIs, and manages the assignment of VM instances to particular hosts and of public and private IP addresses to particular accounts, as well as the allocation of storage.
_**Features**_
* _Self-service user interface:_ AJAX console access, multi-role support, network virtualisation, hypervisor agnostic, usage metering, virtual routers.
* _LVM support:_ Block storage volumes, NetScaler support, OpenStack Swift integration, LDAP integration, domains and delegated administration.
_**Official website:**_ _<https://cloudstack.apache.org/>_
_**Latest version:**_ 4.12.0.0
![Figure 2: Openstack components][4]
**OpenStack**
OpenStack consists of a set of software tools for building and managing cloud computing platforms for public and private clouds using pooled virtual resources. The tools comprising the OpenStack platform are called projects. They handle core cloud computing services of compute, networking, storage, identity and image services. OpenStack software controls large pools of compute, storage and networking resources throughout a data centre, and is managed through a dashboard or via the OpenStack API.
OpenStack consists of the following nine components.
* **Nova:** This is the primary computing engine used for deploying and managing a large number of virtual machines and instances to handle computing tasks.
* **Swift:** This is a storage system for objects and files.
* **Cinder:** This is a persistent block storage component for compute instances.
* **Neutron:** This provides networking capability so that all components can communicate quickly.
* **Horizon:** This is a GUI interface for OpenStack.
* **Keystone:** This provides identity services for OpenStack.
* **Glance:** This provides image services and allows images (virtual copies of hard disks) to be used as templates for deploying new virtual machine instances.
* **Ceilometer:** This provides telemetry services, and billing services to individuals.
* **Heat:** This is an orchestration component that allows developers to store the requirements of cloud applications in files.
_**Features**_
* _Services:_ Messaging, clustering, containers, compute, identity, app data protection as a service, events, metadata indexing as service, workflows, DNS, database as a service, bare metal provisioning, optimisation and deployment, governance, and benchmarking.
* Web front-end, Big Data processing framework, container orchestration engine, key management, and NFV orchestration.
_**Official website:** <http://www.openstack.org>_
**Latest version:** Stein
**ManageIQ**
This is an open source CMP for hybrid IT environments, with a mix of public and private clouds. It provides tools for managing small and large environments as well as supports multiple technologies like virtual machines, public clouds and containers. It allows users to download any virtual appliance and deploy copies of it into virtualisation platforms like OpenStack or VMware. Three main variants of ManageIQ are available: Vagrant, Docker and Public Cloud.
ManageIQ is written in Ruby and uses the Ruby on Rails framework. The ManageIQ software is shipped as a pre-built virtual appliance, roughly 1GB in size. The appliance is based on the CentOS operating system and includes an embedded PostgreSQL database. Since the Darga release, a container based version has also been made available. An appliance can be used on its own, or it can be part of a three-tier federated architecture. In the latter case, the operator configures zones, regions and a single super-region. Appliances can be assigned to a specific zone or region and are configured with specific roles so that work is coordinated within the region. Most roles are multi-master and distribute work automatically in a queue, but some roles like the database are singletons.
**Features**
* Offers insights through discovery, monitoring, utilisation, performance, reporting, analytics, chargeback and trending.
* Controls security, compliance, alerting, policy-based resource and configuration management.
* Automates IT processes, tasks and events, provisioning, workload management and orchestration.
* Integrates systems management, tools and processes, event consoles, CMDB, RBA and Web services.
_**Official website:** <http://manageiq.org>_
**Latest version:** Hammer-10
**Cloudify**
Cloudify is an open source software cloud and NFV orchestration product that uses OASIS TOSCA technology. It is designed using Python. Cloudify allows users to model and automate an applications entire life cycle. This includes deployment to a cloud or data centre environment, the management of the deployed application, failure detection and ongoing maintenance. The platform is ideal for users who want to launch prebuilt applications in the cloud without handling the technical aspects.
_**How it works:**_ It translates applications into a blueprint configuration written in the YAML format and describes how the application should be deployed, managed and automated. It identifies the resources and events for every application tier. The cloud orchestrator uses blueprints to install applications in the cloud using a cloud API, which creates VMs and installs Cloudify agents, and is used to orchestrate, install and start the application. Cloudify monitors the application for any pre-defined metrics and displays results on the dashboard.
Cloudify enables users to deploy applications using two main methods — by using the CLI and by using a Cloudify manager. The latter is a dedicated environment comprising an open source stack which enables the user to:
* Use plugins (such as Docker, Script, Chef and Puppet plugins) to manage application hosts.
* Keep a directory of the users blueprints.
* Create multiple deployments for each blueprint and install them.
* Execute healing, scaling and other custom workflows on installed applications.
* Run multiple workflows concurrently.
* View an applications topology.
* Perform different tasks using the Cloudify Web UI view metrics.
Cloudify performs the following tasks.
* _Application modelling:_ This describes the application with all its resources.
* _Orchestration:_ This maintains and runs an application, and performs ongoing operations such as scaling, healing and maintenance.
* _Pluggability:_ This provides reusable component abstraction for the system.
* _Security:_ This provides secure communication via SSL, which enables clients to ensure that the data set received is encrypted.
_**Features**_
Easy orchestration, built-in node types, a blueprints catalogue, role-based access control, IT security and governance, network and TOSCA orchestration, new NFV capabilities, custom widgets and LDAP integration.
_**Official website:**_ <http://www.cloudify.co>
_**Latest version:**_ 5.0
**Mist.io**
Mist.io is a platform that simplifies cloud management and helps users prevent vendor and complexity lock-in. It offers cost and usage reporting, RBAC, management, provisioning, orchestration, monitoring and automation for servers across public and private clouds, Docker containers and KVM hypervisors. It gives actionable alerts so users can address operational issues from anywhere, using any Web-connected device.
Mist.io offers a unified interface for performing common management tasks like provisioning, orchestration, monitoring and automation. It works from any device, including laptops, tablets and phones, to help users take action from where ever they are. Due to the RESTful API and command line tools, its easy to integrate it in the users existing workflow. Because Mist.io abstracts the infrastructure level, users can replicate the entire setup across providers in a matter of seconds. Its a freemium service with an open source component that aims to become the de facto standard for multi-cloud management and a broker of cloud computing services. Its targeted at developers, systems administrators and any organisation that performs on-premise, remote, or hybrid computing.
_**Features**_
* Controls public and private clouds, containers, bare metal servers and more.
* Has fine grained controls for delegating access to team members.
* Enables cost and usage reporting across the whole infrastructure.
* Orchestrates repeatable deployments, and automates common responses.
* Enforces policies consistently, across any computing platform.
_**Official website:** <http://www.mist.io>_
**VirtEngine**
VirtEngine is an open source CMP that can be used to build private or public clouds, which support IaaS, PaaS and SaaS. This Platform as a Service system allows customers to deploy applications in a few clicks. VirtEngine has a wide range of applications and a simple user interface for customers to self-serve their needs. It helps users build both public and private clouds within very little time, and supports infrastructure platforms and other storage devices. It is also very scalable and comes with automation tools that provide companies a competitive advantage. VirtEngine by DET.io is available as two different solutions for the public and private cloud. The public cloud allows users to build their own cloud and offer servers to customers. It is available as a mini edition as well as a complete solution. The private cloud is available as an open source and free solution as well as a powerful solution for enterprises that supports HA and other enterprise features.
_**Features**_
* Access control, demand and supply monitoring, cost management, multi-cloud management, one-click apps, and automatic launch.
* DNS support, self-healing, cloud-native, multi-locations, Docker containers, cloud virtual machines and migration tools.
_**Official website:**_ _<http://www.virtengine.com>_
![Figure 3: OpenNebula components][5]
**openQRM**
openQRM is a free and open source cloud computing management platform for managing heterogeneous data centre infrastructures. It provides a complete, automated workflow engine for all bare metal and VM deployment, as well as for all IT sub-systems, enabling professional management and monitoring of the data centre and cloud capacities. The openQRM platform manages a data centres infrastructure to build private, public and hybrid Infrastructure as a Service clouds. openQRM orchestrates storage, networks, virtualisation, monitoring and security implementation technologies to deploy multi-tier services as virtual machines on distributed infrastructures, combining both data centre resources and remote cloud resources, according to allocation policies.
openQRM provides a Web-based, open source data centre management and cloud platform with the help of which various internal and external technologies can be abstracted and grouped within a common management tool. This management system also takes care of provisioning, high availability and the monitoring of services offered. Instead of providing individual tools for individual tasks, such as configuration management and system monitoring, openQRM integrates proven open source management tools such as Nagios and Zabbix.
_**Architecture:**_ The openQRM system architecture comprises three components — data centre management and cloud platform, the plugin API, and the hybrid cloud connector.
The data centre management and cloud platform provides the basic functionality of openQRM, and uses the plugin API to communicate with the data centres resources that are also installed on the local network (hypervisor, storage and network). openQRM comes with support for five virtualisation environments — VMware ESX, Citrix XenServer, KVM, LXC and OpenVZ.
openQRM can handle LVM, iSCSI, NFS, ATA over Ethernet, SAN Boot and Tmpfs storage. For the network configuration, openQRM integrates critical network services such as DNS, DHCP, TFTP and Wake-on-LAN. The network manager included with the package helps administrators configure the network bridges required for these services. The hybrid cloud connector takes care of connecting with external data centre resources, such as Amazon Web Services, Eucalyptus, or OpenStack cloud.
The openQRM cloud portal provides a Web interface that internal or external users can access to compile IT resources, as needed.
_**Features**_
* Supports P2V, P2P, V2P, V2V migrations and high availability.
* Integrates with all major open and commercial storage technologies.
* Integrated billing system that maps CCU/h (cloud computing units) to real currency.
* Self-service portal for end users provisions new servers and application stacks in minutes!
_**Official website:** <http://openqrm-enterprise.com>_
**OpenNebula**
OpenNebula is a simple yet powerful and flexible turnkey open source solution to build private clouds and manage data centre virtualisation. The OpenNebula platform manages a data centres virtual infrastructure to build private, public and hybrid implementations of Infrastructure as a Service. The two primary uses of the OpenNebula platform are data centre virtualisation solutions and cloud infrastructure solutions.
OpenNebula was designed to help companies build simple, cost-effective, reliable, open enterprise clouds on existing IT infrastructure. It provides flexible tools that orchestrate storage, network and virtualisation technologies to enable the dynamic placement of services. The design of OpenNebula is flexible and modular, to allow integration with different storage and network infrastructure and hypervisor technologies.
OpenNebula components include the following three layers:
1\. The driver layer is responsible for the creation, start-up and shutdown of virtual machines (VMs), for allocating storage to VMs, and for monitoring the operational status of physical machines (PMs).
2\. The core layer manages the VMs full life cycle, including setting up virtual networks dynamically, dynamic IP address allocation for VMs and managing VMs storage.
3\. The tool layer provides interfaces, such as the command line interface (CLI), to communicate with users.
_**Features**_
* Supports numerous APIs like AWS EC2, EBS and OGF OCCI.
* Powerful UNIX based CLI for administration.
* GUI for cloud customers and data centre professionals.
* Resource allocation via fine-grained ACLs; load balancing, high availability, high performance computing.
* Powerful scheduling for task management.
* Supports integration with LDAP and Active directory.
* Supports SSH and X.509 for security, and even supports login token functionality.
_**Official website:** <http://www.opennebula.org>_
_**Latest version:**_ 5.8.4
**Eucalyptus**
Eucalyptus is an acronym for Elastic Utility Computing Architecture for Linking Your Programs to Useful Systems. It is an open source software framework that provides the platform for private cloud computing implementation on computer clusters. Eucalyptus implements Infrastructure as a Service (IaaS) methodology for solutions in private and hybrid clouds.
Eucalyptus provides a platform for a single interface so that users can calculate the resources available in private clouds and the resources available externally in public cloud services. It is designed with extensible and modular architecture for Web services. It also implements the industry standard Amazon Web Services (AWS) API.
![Figure 4: Eucalyptus architecture][6]
The Eucalyptus user console provides an interface for users to provision and configure compute, network and storage resources on their own. Eucalyptus can run multiple versions of Windows and Linux virtual machine images. Users can build a library of Eucalyptus machine images (EMIs) with application metadata that is decoupled from infrastructure details to allow them to run on Eucalyptus clouds.
Amazon Machine Images are also compatible with Eucalyptus clouds. VMware images and vApps can be converted to run on Eucalyptus clouds and AWS public clouds. Eucalyptus user identity management can be integrated with existing Microsoft Active Directory or LDAP systems to have fine-grained role-based access control over cloud resources. Eucalyptus supports storage area network devices to take advantage of storage arrays, thus improving performance and reliability. Eucalyptus machine images can be backed by EBS-like persistent storage volumes, improving the performance of image launch time and enabling fully persistent virtual machine instances. Eucalyptus also supports direct-attached storage.
_**Architecture:**_ The Eucalyptus architecture has the following five main components.
* **Cloud controller (CLC):** CLC acts as the administrative interface for cloud management and performs high-level resource scheduling and system accounting. The CLC accepts user API requests from command-line interfaces like euca2ools or GUI-based tools like the Eucalyptus management console, and manages the underlying computer storage and network resources.
* **Scalable object storage (SOS):** This is a pluggable service that allows infrastructure administrators the flexibility to implement scale-out storage on top of commodity resources using open source and commercial solutions that implement the S3 interface.
* **Cluster controller (CC):** Written in C, this acts as the front-end for clusters within the Eucalyptus cloud and communicates with the storage and node controllers.
* **Storage controller (SC):** Written in Java, this communicates with the cluster controller and the node controller, managing Eucalyptus block volumes and snapshots to instances within its specific cluster. It interfaces with storage systems including Local, NFS, iSCSI and SAN.
* **Node controller (NC):** This is written in C, hosts the virtual machine instances and manages the virtual network endpoints. It caches images from scalable object storage, and creates and caches instances.
_**Features**_
* Works with multiple hypervisors including VMware, Xen and KVM.
* Communication within internal processes is secured through SOAP and WS-Security.
* Offers administrative features such as user and group management, and reports.
* Well-defined interfaces (via WSDL, since they are Web services) and thus can be easily swapped out for custom components.
* Flexible and can be installed on a very minimal setup.
_**Official website:** <https://www.eucalyptus.cloud/>_
_**Latest version:**_ 4.4.3
![Avatar][7]
[Dr Anand Nayyar][8]
The author works in a Graduate School, Duy Tan University in
Vietnam. He loves to work and research on open source technologies,
sensor communications, network security, Internet of Things etc. He
can be reached at [anandnayyar@duytan.edu.vn][9]. YouTube channel:
Gyaan with Anand Nayyar at [www.youtube.com/anandnayyar][10].
[![][11]][12]
--------------------------------------------------------------------------------
via: https://opensourceforu.com/2019/11/the-top-nine-open-source-cloud-management-platforms/
作者:[Dr Anand Nayyar][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://opensourceforu.com/author/anand-nayyar/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Young-man-with-the-head-in-the-clouds-thinking_15259762_xl.jpg?resize=505%2C487&ssl=1 (Young-man-with-the-head-in-the-clouds-thinking_15259762_xl)
[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Young-man-with-the-head-in-the-clouds-thinking_15259762_xl.jpg?fit=505%2C487&ssl=1
[3]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Figure-1-CloudStack-architecture.jpg?resize=350%2C250&ssl=1
[4]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Figure-2-OpenStack-components.jpg?resize=350%2C226&ssl=1
[5]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Figure-3-OpenNebula-components.jpg?resize=350%2C196&ssl=1
[6]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Figure-4-Eucalyptus-architecture.jpg?resize=350%2C241&ssl=1
[7]: https://secure.gravatar.com/avatar/ab87a2bd63788f386c2d815c0f7d2d29?s=100&r=g
[8]: https://opensourceforu.com/author/anand-nayyar/
[9]: mailto:anandnayyar@duytan.edu.vn
[10]: http://www.youtube.com/anandnayyar
[11]: https://opensourceforu.com/wp-content/uploads/2019/11/assoc.png
[12]: https://feedburner.google.com/fb/a/mailverify?uri=LinuxForYou&loc=en_US

View File

@ -0,0 +1,124 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Understanding “disk space math”)
[#]: via: (https://fedoramagazine.org/understanding-disk-space-math/)
[#]: author: (Pat Kelly https://fedoramagazine.org/author/tablepc/)
Understanding “disk space math”
======
![][1]
Everything in a PC, laptop, or server is represented as binary digits (a.k.a. _bits,_ where each bit can only be 1 or 0). There are no characters like we use for writing or numbers as we write them anywhere in a computers memory or secondary storage such as disk drives. For general purposes, the unit of measure for groups of binary bits is the byte — eight bits. Bytes are an agreed-upon measure that helped standardize computer memory, storage, and how computers handled data.
There are various terms in use to specify the capacity of a disk drive (either magnetic or electronic). The same measures are applied to a computers random access memory (RAM) and other memory devices that inhabit your computer. So now lets see how the numbers are made up.
Suffixes are used with the number that specifies the capacity of the device. The suffixes designate a multiplier that is to be applied to the number that preceded the suffix. Commonly used suffixes are:
* Kilo = 103 = 1,000 (one thousand)
* Mega = 106 = 1,000,000 (one million)
* Giga = 109 = 1000,000,000 (one billion)
* Tera = 1012 = 1,000,000,000,000 (one trillion)
As an example 500 GB (gigabytes) is 500,000,000,000 bytes.
The units that memory and storage are specified in  advertisements, on boxes in the store, and so on are in the decimal system as shown above. However since computers only use binary bits, the actual capacity of these devices is different than the advertised capacity.
You saw that the decimal numbers above were shown with their equivalent powers of ten. In the binary system numbers can be represented as powers of two. The table below shows how bits are used to represent powers of two in an 8 bit Byte. At the bottom of the table there is an example of how the decimal number 109 can be represented as a binary number that can be held in a single byte of 8 bits (01101101).
Eight bit binary number | | | | | | | |
---|---|---|---|---|---|---|---|---
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0
Power of 2 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20
Decimal Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
Example Number | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1
The example bit values comprise the binary number 01101101. To get the equivalent decimal value just add the decimal values from the table where the bit is set to 1. That is 64 + 32 + 8 + 4 + 1 = 109.
By the time you get out to 230 you have decimal 1,073,741,824 with just 31 bits (dont forget the 20) Youve got a large enough number to start specifying memory and storage sizes.
Now comes what you have been waiting for. The table below lists common designations as they are used for labeling decimal and binary values.
Decimal
|
Binary
---|---
KB (Kilobyte)
1KB = 1,000 bytes
|
KiB (Kibibyte)
1KiB = 1,024 bytes
MB (Megabyte)
1MB = 1,000,000 bytes
|
MiB (Mebibyte)
1MiB = 1,048,576 bytes
GB (Gigabyte)
1GB = 1,000,000,000 bytes
|
GiB (Gibibyte)
1 GiB (Gibibyte) = 1,073,741,824 bytes
TB (Terabyte)
1TB = 1,000,000,000,000
|
TiB (Tebibyte)
1TiB = 1,099,511,627,776 bytes
Note that all of the quantities of bytes in the table above are expressed as decimal numbers. They are not shown as binary numbers because those numbers would be more than 30 characters long.
Most users and programmers need not be concerned with the small differences between the binary and decimal storage size numbers. If youre developing software or hardware that deals with data at the binary level you may need the binary numbers.
As for what this means to your PC: Your PC will make use of the full capacity of your storage and memory devices. If you want to see the capacity of your disk drives, thumb drives, etc, the Disks utility in Fedora will show you the actual capacity of the storage device in number of bytes as a decimal number.
There are also command line tools that can provide you with more flexibility in seeing how your storage bytes are being used. Two such command line tools are [_du_][2] (for files and directories) and [_df_][3] (for file systems). You can read about these by typing _man du_ or _man df_ at the command line in a terminal window.
* * *
*Photo by _[_Franck V._][4]_ on *[_Unsplash_][5].
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/understanding-disk-space-math/
作者:[Pat Kelly][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/tablepc/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/11/disk-space-math-816x345.jpg
[2]: https://linux.die.net/man/1/du
[3]: https://linux.die.net/man/1/df
[4]: https://unsplash.com/@franckinjapan?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[5]: https://unsplash.com/s/photos/math?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -0,0 +1,853 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (5 open source plugins for Flutter apps)
[#]: via: (https://opensource.com/article/19/11/open-source-plugins-flutter-apps)
[#]: author: (Baradwaj Varadharajan https://opensource.com/users/baradwaj)
5 open source plugins for Flutter apps
======
Create more useful and attractive apps faster with these plugins for
Google's cross-platform development language.
![][1]
[Flutter][2] is the newest addition to Google's programming cadre. Following the success of Android, Kotlin, and Golang, [Flutter][3] was created as a cross-platform application development language. It is primarily based on the Dart programming construct and is considered to be the next big programming paradigm because its code can run as a mobile app, a web app, and even a desktop app without any major changes. Supposedly it will support Google's upcoming [Fuschia][4] operating system.
Flutter plugins are simple dependencies that extend the language's capabilities. This list of the top five open source Flutter plugins includes both user interface (UI)-related and function-related plugins.
The plugins must be included in your **pubspec.yaml** file before they can be used; they are required to make modifications to the **pubspec.yaml** file in the **lib** folder inside the project.
### Flutter video-player plugin
The video_player plugin allows you to embed videos to play in Flutter apps. 
_Note: Up to Flutter 1.9, there is no video player support present in Flutter, so you have to depend on external plugins like video_player. This provides us with the VideoPlayer class which we will be using here._
Before using the VideoPlayer class in Flutter, you have to do the following for iOS and Android applications.
#### Prerequisites
**For Android:**
Make sure that the minimum SDK is set to 21. You can modify this through the Build Gradle inside the **android&gt;app** folder.
Next, make sure that the **AndroidManifest.xml** file has internet permission enabled by adding the following line in the **AndroidManifest.xml** file:
```
`<uses-permission android:name="android.permission.INTERNET"/>`
```
**For iOS:**
To give permission to use the internet to render the videos (if required), add the following lines to the **info.plist** file in **&lt;project root&gt;/ios/Runner/Info.plist**:
```
&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
&lt;dict&gt;
  &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
  &lt;true/&gt;
&lt;/dict&gt;
```
Once the prerequisites for Android and iOS are done, add the following line to the **pubspec.yaml** file in the **dependency** section:
```
`dependencies: video_player: ^0.10.1+3`
```
Then use **get packages** to sync the project.
#### Video_Player plugin basics
The Video_Player plugin provides support for playing network and local videos on a device by creating a simple API to call the videos. The example application below shows how the Video_Player plugin uses the controller object and how to create the **Future&lt;&gt; Builder** to play the video on loading.
Start by using the [Scaffold widget][5] as the parent body widget. The goal is for the user to be able to play and pause a video using button controls.
In order to call the video player object from anywhere, you need a controller to hold it. The VideoPlayerController class makes this possible. The example application pieces it all together.
#### Example Flutter Video Player app
```
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
void main() =&gt; runApp(VideoPlayerApp());
class VideoPlayerApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Player Demo',
      home: VideoPlayerScreen(),
    );
  }
}
class VideoPlayerScreen extends StatefulWidget {
  VideoPlayerScreen({Key key}) : super(key: key);
  @override
  _VideoPlayerScreenState createState() =&gt; _VideoPlayerScreenState();
}
class _VideoPlayerScreenState extends State&lt;VideoPlayerScreen&gt; {
  VideoPlayerController _controller;
  Future&lt;void&gt; _initializeVideoPlayerFuture;
  @override
  void initState() {
    _controller = VideoPlayerController.network(
      '<https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4>',
    );
    // Initialize the controller and store the Future for later use.
    _initializeVideoPlayerFuture = _controller.initialize();
    // Use the controller to loop the video.
    _controller.setLooping(true);
    super.initState();
  }
  @override
  void dispose() {
    // Ensure disposing of the VideoPlayerController to free up resources.
    _controller.dispose();
    super.dispose();
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      drawer: Drawer(),
      backgroundColor: Colors.orangeAccent,
      appBar: AppBar(
        title: Text('Bee Video'),
        backgroundColor: Colors.black87,
      ),
      // Use a FutureBuilder to display a loading spinner while waiting for the
      // VideoPlayerController to finish initializing.
      body: Stack(
        children: &lt;Widget&gt;[
          Center(child:FutureBuilder(
            future: _initializeVideoPlayerFuture,
            builder: (context, snapshot) {
              if (snapshot.connectionState == ConnectionState.done) {
                // If the VideoPlayerController has finished initialization, use
                // the data it provides to limit the aspect ratio of the video.
                return AspectRatio(
                  aspectRatio: _controller.value.aspectRatio,
                  // Use the VideoPlayer widget to display the video.
                  child: VideoPlayer(_controller),
                );
              } else {
                // If the VideoPlayerController is still initializing, show a
                // loading spinner.
                return Center(child: CircularProgressIndicator());
              }
            },
          )),
          Center(
              child:
             ButtonTheme(
                  height: 100.0,
                  minWidth: 200.0,
                  child: RaisedButton(
                    padding: EdgeInsets.all(60.0),
                    color: Colors.transparent,
                    textColor: Colors.white,
                    onPressed: () {
                      // Wrap the play or pause in a call to `setState`. This ensures the
                      // correct icon is shown.
                      setState(() {
                        // If the video is playing, pause it.
                        if (_controller.value.isPlaying) {
                          _controller.pause();
                        } else {
                          // If the video is paused, play it.
                          _controller.play();
                        }
                      });
                    },
                    child: Icon(
                      _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
                      size: 120.0,
                    ),
                  ))
          )
        ],
      ),
    );
  }
}
```
Here's the resulting application.
![Flutter Video Plugin][6]
![Flutter Video Plugin][7]
### Flutter Shimmer Effect plugin
The Flutter [Shimmer Effect][8] UI plugin is fairly straightforward: You just make use of only one class in your widget tree, and the work is done. Here is what the Shimmer Effect looks like:
![Flutter Shimmer Effect plugin][9]
To implement this effect, jump into the widget definition and use the **Shimmer** class in your widget tree with this option:
```
`Shimmer.fromColors`
```
Next, finalize the application by filling out the properties described below.
#### Shimmer.fromColors properties
**Shimmer.fromColors** has the following properties:
* **baseColor:** This is the shimmer's base color that gets shown on the widget. This is the primary color and the one the child widget will use.
* **HighlightColor:** This is the color that produces the shimmer-like effect by continually waving across the child widget.
* **Child:** This holds whatever widget produces the Shimmer Effect. It could be a Text widget or any complex structure.
The example program shows how these attributes work across complex widgets.
#### Example Flutter Shimmer Effect app
This example produces the Shimmer Effect for two important widgets: the Text widget and the [Listview widget][10].
```
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
void main() =&gt; runApp(ShimmerEffectApp());
class ShimmerEffectApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Sample ShimmerEffect Widget',
home: ShimmerWidget(),
);
}
}
class ShimmerWidget extends StatefulWidget {
ShimmerWidget({Key key}) : super(key: key);
@override
_ShimmerWidgetState createState() =&gt; _ShimmerWidgetState();
}
class _ShimmerWidgetState extends State {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Shimmer effect"),),
body: Container(
padding: EdgeInsets.all(25.0),
child:Center(
child: Shimmer.fromColors(
direction: ShimmerDirection.rtl,
period: Duration(seconds:5),
child: Column(
children: [0, 1, 2, 3]
.map((_) =&gt; Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 48.0,
height: 48.0,
color: Colors.white,
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8.0),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 8.0,
color: Colors.white,
),
Padding(
padding:
const EdgeInsets.symmetric(vertical: 2.0),
),
Container(
width: double.infinity,
height: 8.0,
color: Colors.white,
),
Padding(
padding:
const EdgeInsets.symmetric(vertical: 2.0),
),
Container(
width: 40.0,
height: 8.0,
color: Colors.white,
),
],
),
)
],
),
))
.toList(),
),
baseColor: Colors.grey[700],
highlightColor: Colors.grey[100]),
)
),
);
}
}
```
Here's the resulting application.
![Flutter Shimmer Effect plugin][11]
![Flutter Shimmer Effect plugin][12]
### Flutter Badges plugin
[Flutter Badges][13] is a very useful UI plugin that marks a notification count, a count of items in an e-commerce basket, etc.
To use the Flutter Badges plugin, add the following dependency in your **pubspec.yaml** file:
```
dependencies:
    badges: ^1.1.0
```
Then, import the following line into your **main.dart** file:
```
`import 'package:badges/badges.dart';`
```
Now, you can create badges with a simple call to the **Badge class.**
#### Badge class properties
Following are the Badge class's available properties:
* **badgeContent:** This is the attribute that takes in the value of the Badge. It could be a number, a letter, etc. Make sure to make it as small as possible!
* **BadgeColor:** Control the color of the badge by adjusting the BadgeColor colors property.
* **AnimationType:** This enables three animations for the Badge:
* **BadgeAnimationType.scale:** Scales animation once loading happens.
* **BadgeAnimationType.fade:** Fades animation once loading happens
* **BadgeAnimationType.slide:** Slides animation once loading happens
* **shape:** This controls the shape of the badge; it could be a circle or a square.
* **AnimationDuration:** This takes in a Duration class as its value to set how long the animation should last.
Once these attributes are set, you can create a simple app like the following.
#### Example Flutter Badge application
Add the following to your **main.dart** file and run the application.
```
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:badges/badges.dart';
void main() =&gt; runApp(BadgesApp());
class BadgesApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'APP',
home: BadgesWidget(),
);
}
}
class BadgesWidget extends StatefulWidget {
BadgesWidget({Key key}) : super(key: key);
@override
_BadgesWidgetState createState() =&gt; _BadgesWidgetState();
}
class _BadgesWidgetState extends State {
int value = 0;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title:Text("Sample Badges")),
body: Center(
child: Container(
padding: EdgeInsets.all(25.0),
child: Column(
children: [
Spacer(),
Badge(
child: RaisedButton(
color: Colors.blueGrey,
child: Text("Notifications", style: TextStyle(color: Colors.white),),
onPressed: (){
setState(() {
value = value + 1;
});
},),
badgeContent: Text('$value',style: TextStyle(color: Colors.white),),
badgeColor: Colors.red,
animationType: BadgeAnimationType.scale,
animationDuration: Duration(milliseconds: 500),
shape: BadgeShape.circle,
),
Spacer(),
Badge(
child: RaisedButton(
color: Colors.blueGrey,
child: Text("Messages", style: TextStyle(color: Colors.white),),
onPressed: (){
},),
badgeContent: Text("2",style: TextStyle(color: Colors.white),),
badgeColor: Colors.red,
animationType: BadgeAnimationType.scale,
animationDuration: Duration(seconds: 1),
shape: BadgeShape.circle,
),
Spacer(),
Badge(
child: RaisedButton(
color: Colors.blueGrey,
child: Text("Notifications", style: TextStyle(color: Colors.white),),
onPressed: (){
},),
badgeContent: Text("2",style: TextStyle(color: Colors.white),),
badgeColor: Colors.red,
animationType: BadgeAnimationType.scale,
animationDuration: Duration(seconds: 1),
shape: BadgeShape.circle,
),
Spacer(flex: 4,)
],
),
),
)
);
}
}
```
Here's the resulting application.
![Flutter Badges plugin][14]
### Flutter Google Maps plugin
Adding Google Maps in Flutter apps is a very easy process with the help of the **google_maps_flutter** plugin.
_Note: The Google Maps Flutter plugin is still in developer preview (so it cannot be released to the app store yet). Make sure to wait for the stable release before using it._
The main prerequisites for using this plugin are to have a [Google Cloud Platform][15] account and to create a Google Maps API key. If you do not know how to obtain a key, see [Google Maps Integration in Flutter][16].
Once the Google Maps SDK is enabled with a credential/API key, you can use it in your Flutter app. Fill out the following with the key.
**For Android:**
Go to **android&gt;app&gt;src&gt;main&gt;Androidmanifest.xml** and make sure that the manifest looks like the following (replacing YOUR KEY HERE with your API key):
```
&lt;manifest ...
  &lt;application ...
    &lt;meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/&gt;
```
**For iOS:**
Edit the **Appdelegate.m** file as follows (replacing YOUR KEY HERE with your API key):
```
@implementation AppDelegate
\- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GMSServices provideAPIKey:@"YOUR KEY HERE"];
  [GeneratedPluginRegistrant registerWithRegistry:self];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
```
#### GoogleMaps widget basics
Now it's time to bring the Maps inside the Flutter application. To begin, add the following dependency in the **pubspec.yaml** file:
```
dependencies:
 google_maps_flutter: ^0.5.21
```
Import the following package to the **main.dart** file:
```
`import 'package:google_maps_flutter/google_maps_flutter.dart';`
```
This package provides the following widgets:
##### GoogleMap
The GoogleMap widget provides the main control over Google Maps inside a Flutter application. It has several important attributes that help create the maps you require. They are:
* **mapType:** This attribute defines what type of map (satellite, hybrid, or normal) is shown. Select one by with the value MapType.satellite, MapType.hybrid, or MapType.normal.
* **InitialCameraPosition:** The initial camera position is important for rendering the map on the Flutter UI and setting the camera position (from which the camera will move). Set the initial camera position by creating a variable with the **CameraPosition** class as its value.
* **OnMapCreated:** This is a callback that fires whenever the camera position changes (e.g., whenever the user moves the map by pinching or swiping it). To move the camera angle programmatically, use GoogleMapController instead.
##### GoogleMapController
This class controls the Google Map by creating an instance of it. There is no explicit way to change the camera position of the Google Map, but you can use the GoogleMapController to control all sorts of activities on the GoogleMap class.
##### CameraPosition
The CameraPosition class provides the camera position values that are required to show any position on the GoogleMap.
```
CameraPosition initPosition = CameraPosition(
target: LatLng(14.5, 25.7), zoom: 7, );
```
The CameraPosition class takes in various attributes, like target, zoom, etc. The **Target** attribute marks the latitude and longitude position on the Google Map. The class takes in a double value like **LatLng(double, double)** to mark it at that position.
#### Example Flutter GoogleMaps app
This example app creates an animated camera transition on a Google Map. This is a very useful way to provide [Google Maps in Flutter][16] applications.
```
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
void main() =&gt; runApp(GoogleMapApp());
class GoogleMapApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Sample GoogleMap Widget',
home: GoogleMapWidget(),
);
}
}
class GoogleMapWidget extends StatefulWidget {
GoogleMapWidget({Key key}) : super(key: key);
@override
_GoogleMapWidgetState createState() =&gt; _GoogleMapWidgetState();
}
class _GoogleMapWidgetState extends State {
Completer _controller = Completer();
@override
void initState() {
super.initState();
}
CameraPosition initPosition = CameraPosition(
target: LatLng(14.5, 25.7),
zoom: 7,
);
void updateGoogleMap()
async{
GoogleMapController cont = await _controller.future;
setState(() {
CameraPosition newtPosition = CameraPosition(
target: LatLng(14.5, 28.7),
zoom: 4,
);
cont.animateCamera(CameraUpdate.newCameraPosition(newtPosition));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.black45,
title: Text("Update Google Map"),
),
body: Center(
child: Column(
children: [
Container(
height: 400.0,
child: GoogleMap(
mapType: MapType.hybrid,
initialCameraPosition: initPosition,
onMapCreated: (GoogleMapController controller){
_controller.complete(controller);
},
),
),
FlatButton(
child: Text("Update Map", style: TextStyle(color: Colors.white),),
color: Colors.deepOrange,
onPressed: (){
updateGoogleMap();
},
)
],
),
));
}
}
```
Here's the resulting application.
![Flutter Google Maps plugin][17]
![Flutter Google Maps plugin][18]
### Flutter ImagePicker image gallery plugin
The ImagePicker plugin integrates an image gallery into a Flutter app.
To begin using the [**image_picker**][19] plugin, add the following dependency in the **pubspec.yaml** file:
```
dependencies:
  image_picker: ^0.6.1+4
```
This requires you to add an import statement in your main file, e.g., **main.dart** file:
```
`import 'package:image_picker/image_picker.dart';`
```
To use the Flutter application in iOS, make the following changes in the **info.plist** file:
* **NSPhotoLibraryUsageDescription:** This describes why the app needs permission to use the photo library. This is called _Privacy - Photo Library Usage Description_ in the visual editor.
* **NSCameraUsageDescription:** This describes why your app needs access to the camera. This is called _Privacy - Camera Usage Description_ in the visual editor.
* **NSMicrophoneUsageDescription:** This describes why your app needs access to the microphone if you intend to record videos. This is called _Privacy - Microphone Usage Description_ in the visual editor.
#### Image Picker widget basics
To use the ImagePicker widget, just call the class [**ImagePicker**][20]. There are two options for this class:
* Choose an image or choose a video
* Choose an image or video directly from a gallery or a camera source
This is possible through two method callbacks:
* **ImagePicker.pickImage()** with the source **ImageSource.gallery** or **ImageSource.camera**
* **ImagePicker.pickVideo()** with the above sources
Both of these calls are async calls, which require **setState()** on the image or video that is selected.
**ImagePicker.&lt;source call&gt;** returns the file location of the image/video. You must load the image using the **Image.file()** call.
All of this is explained in the example application.
#### Example Flutter ImagePicker widget app
This example app creates an [Image Picker button][20] to select an image from the gallery or directly from the camera.
```
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
void main() =&gt; runApp(ImagePickerApp());
class ImagePickerApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Sample Imagepicker Widget',
home: ImagePickerWidget(),
);
}
}
class ImagePickerWidget extends StatefulWidget {
ImagePickerWidget({Key key}) : super(key: key);
@override
_ImagePickerWidgetState createState() =&gt; _ImagePickerWidgetState();
}
class _ImagePickerWidgetState extends State {
File _image;
@override
void initState() {
super.initState();
}
void open_camera()
async {
var image = await ImagePicker.pickImage(source: ImageSource.camera);
setState(() {
_image = image;
});
}
void open_gallery()
async {
var image = await ImagePicker.pickImage(source: ImageSource.gallery);
setState(() {
_image = image;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Sample Imagepicker Widget"),
backgroundColor: Colors.black45,),
body: Center(
child: Container(
child: Column(
children: [
Container(
color: Colors.black12,
height: 300.0,
width: 900.0,
child: _image == null ? Text("Still waiting!") : Image.file(_image),),
FlatButton(
color: Colors.deepOrangeAccent,
child: Text("Open Camera", style: TextStyle(color: Colors.white),),
onPressed: (){
open_camera();
},),
FlatButton(
color: Colors.limeAccent,
child:Text("Open Gallery", style: TextStyle(color: Colors.black),),
onPressed: (){
open_gallery();
},
)
],
),
),
)
);
}
}
```
Here's the resulting application.
![Flutter ImagePicker widget][21]
![Flutter ImagePicker widget][22]
![Flutter ImagePicker widget][23]
### Summary
These five plugins are very important for creating a neater UI experience in Flutter apps. They will also help you ramp up faster with Flutter app development.
* * *
_Some of the information in this article was previously published at [Android Monks][24]._
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/open-source-plugins-flutter-apps
作者:[Baradwaj Varadharajan][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/baradwaj
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug-insect-butterfly-diversity-inclusion-2.png?itok=TcC9eews
[2]: https://opensource.com/article/18/6/flutter
[3]: https://flutter.dev/
[4]: https://en.wikipedia.org/wiki/Google_Fuchsia
[5]: https://androidmonks.com/scaffold-flutter/
[6]: https://opensource.com/sites/default/files/uploads/flutter1_videoplayer.png (Flutter Video Plugin)
[7]: https://opensource.com/sites/default/files/uploads/flutter2_videoplayer.png (Flutter Video Plugin)
[8]: https://androidmonks.com/shimmer-effect-flutter/
[9]: https://opensource.com/sites/default/files/uploads/flutter3_shimmergif.gif (Flutter Shimmer Effect plugin)
[10]: https://androidmonks.com/listview-flutter/
[11]: https://opensource.com/sites/default/files/uploads/flutter4_shimmer.png (Flutter Shimmer Effect plugin)
[12]: https://opensource.com/sites/default/files/uploads/flutter5_shimmer.png (Flutter Shimmer Effect plugin)
[13]: https://androidmonks.com/flutter-badges/
[14]: https://opensource.com/sites/default/files/uploads/flutter6_samplebadges.png (Flutter Badges plugin)
[15]: https://cloud.google.com/maps-platform/
[16]: https://androidmonks.com/google-maps-flutter/
[17]: https://opensource.com/sites/default/files/uploads/flutter7_googlemap.png (Flutter Google Maps plugin)
[18]: https://opensource.com/sites/default/files/uploads/flutter8_googlemap.png (Flutter Google Maps plugin)
[19]: https://pub.dev/packages/image_picker
[20]: https://androidmonks.com/imagepicker-flutter/
[21]: https://opensource.com/sites/default/files/uploads/flutter9_imagepicker.png (Flutter ImagePicker widget)
[22]: https://opensource.com/sites/default/files/uploads/flutter10_imagepicker.png (Flutter ImagePicker widget)
[23]: https://opensource.com/sites/default/files/uploads/flutter11_imagepicker.png (Flutter ImagePicker widget)
[24]: https://androidmonks.com/flutter-open-source-plugins/

View File

@ -0,0 +1,99 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (8 great podcasts for open source enthusiasts)
[#]: via: (https://opensource.com/article/19/11/open-source-podcasts)
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
8 great podcasts for open source enthusiasts
======
Expand your knowledge about Linux, Python, and open source generally
while you're doing other things.
![Woman programming][1]
Where I live, almost everything is a 20- or 30-minute drive from my home, and I'm always looking for ways to use my car time productively. One way is by listening to podcasts on topics that interest me, so as an open source enthusiast, I subscribe to a variety of open source-related podcasts.
Here are eight Linux and open source podcasts that I Iook forward to every week.
### Linux4Everyone
[Linux4Everyone][2] by Jason Evangelho (whom I [recently interviewed][3]) is a favorite. The podcasts always offer fresh insights on Linux along with thoughtful interviews, including his conversations with [Barton George][4] of Dell and [Christopher Scott][5] of Microsoft. Jason's only been at this gig for a few months, but he already has a loyal following supporting him on Patreon.
I have recently been listening to [**Command Line Heroes**][6]. Its host, Saron Yitbarek, is a developer and the founder of [CodeNewbie][7]. I've learned about how [C and Unix][8] laid important groundwork for the development and growth of Linux, as well as the evolution of the [Python community][9]—which will continue since founder Guido Van Rossum stepped down from his benevolent dictatorship role.
### Linux Headlines
[Linux Headlines][10] from [Jupiter Broadcasting][11] never fails to pique my interest in what's happening in the Linux world. Hosts [Chris Fisher][12], [Joe Ressington][13], [Wes Payne][14], and [Drew Davore][15] are always dishing up the latest developments that inspire me to learn and explore more. If you only have a few minutes to spare, this podcast is for you.
### Self-Hosted
[Self-Hosted][16] is a new podcast about home networks that hooked me immediately. With all the emphasis on containers and the cloud, you might think your local network doesn't have much to offer anymore. Hosts [Alex Kretzschmar][17] and Chris Fisher are two longtime self-hosters who share their learnings with listeners.
### Online Life is Real Life
In [Online Life is Real Life][18], sponsored by Firefox, "host [Manoush Zomorodi][19] shares real stories of life online and real talk about the future of the web." A recent show, "[Privacy or Profit—Why Not Both?][20]," dug into the concept that "privacy" means different things to different people. Do you know how your personal data is being used? Do you care? If so, this podcast might interest you.
### The Changelog
[The Changelog][21] bills itself as "conversations with the hackers, leaders, and innovators of software development." In a recent episode, [Chris Anderson][22], former editor-in-chief of _Wired_, shared how his hobby with drones started out terribly wrong but led him to 3D robotics, do-it-yourself drones, and the [Dronecode][23] project.
### Destination Linux
[Destination Linux][24], where "Linux is our passion," is a weekly show hosted by [Ryan][25], [Michael][26], [Zebediah][27], and [Noah][28]. The show started in 2017, and all of its content is licensed under Creative Commons 4.0 ShareAlike. One recent podcast focused on the addition of ZFS to Ubuntu 19.10 and how Project Trident ditched FreeBSD for Linux.
### Talk Python to Me
[Talk Python To Me][29] with host [Michael Kennedy][30] keeps me growing on my Python learning curve.
In one of my favorite shows, "[Python in digital humanities research][31]," Michael interviewed Cornelius Van Lit, a medieval Islamic philosophy scholar, who is using Python to parse ancient manuscripts.
Most of these podcasts come with show notes, which include links to the content they cover. Since I can't take notes when I'm driving, the show notes help me review what I hear and learn more about the topics mentioned.
I am always eager to learn, so please share your favorite open source-related podcasts in the comments section.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/open-source-podcasts
作者:[Don Watkins][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming)
[2]: https://linuxforeveryone.fireside.fm/
[3]: https://opensource.com/article/19/9/found-linux-video-gaming
[4]: https://twitter.com/barton808?lang=en
[5]: https://opensource.com/article/19/10/trust-linux-community
[6]: https://www.redhat.com/en/command-line-heroes
[7]: https://www.codenewbie.org/
[8]: https://opensource.com/article/19/10/command-line-heroes-c
[9]: https://opensource.com/article/19/6/command-line-heroes-python
[10]: https://linuxheadlines.show/
[11]: https://opensource.com/article/19/10/linux-podcasts-Jupiter-Broadcasting
[12]: https://twitter.com/ChrisLAS
[13]: https://twitter.com/JoeRessington
[14]: https://twitter.com/wespayne?lang=en
[15]: https://twitter.com/drewofdoom
[16]: https://selfhosted.show/
[17]: https://twitter.com/ironicbadger?lang=en
[18]: https://irlpodcast.org/
[19]: https://twitter.com/manoushz
[20]: https://irlpodcast.org/season5/episode7/
[21]: https://changelog.com/podcast
[22]: https://twitter.com/chr1sa
[23]: https://www.dronecode.org/
[24]: https://destinationlinux.org/
[25]: https://destinationlinux.org/ryan/#contact
[26]: https://twitter.com/michaeltunnell?lang=en
[27]: https://twitter.com/zebedeeboss
[28]: https://destinationlinux.org/noah/
[29]: https://talkpython.fm/
[30]: https://twitter.com/mkennedy?lang=en
[31]: https://talkpython.fm/episodes/show/230/python-in-digital-humanities-research

View File

@ -0,0 +1,213 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with PostgreSQL)
[#]: via: (https://opensource.com/article/19/11/getting-started-postgresql)
[#]: author: (Greg Pittman https://opensource.com/users/greg-p)
Getting started with PostgreSQL
======
Install, set up, create, and start using your first PostgreSQL database.
![Guy on a laptop on a building][1]
Everyone has things that would be useful to collect in a database. Even if you're obsessive about keeping paperwork or electronic files, they can become cumbersome. Paper documents can be lost or completely disorganized, and information you need to access in electronic files may be buried in depths of paragraphs and pages of information.
When I was practicing medicine, I used [PostgreSQL][2] to keep track of my hospital patient list and to submit information about my hospital patients. I carried a printout of my daily patient list in my pocket for quick reference and to make quick notes about any changes in the patients' room, diagnosis, or other details.
I thought that was all behind me, until last year when my wife decided to get a new car, and I "inherited" her previous one. She had kept a folder of car repair and maintenance service receipts, but over time, it lost any semblance of organization. It takes time to sift through all the slips of paper to figure out what was done when, and I thought PostgreSQL would be a better way to keep track of this information.
### Install PostgreSQL
It had been a while since I last used PostgreSQL, and I had forgotten how to get going with it. In fact, I didn't even have it on my computer. Installing it was step one. I use Fedora, so in a console, I ran:
```
`dnf list postgresql*`
```
Notice that you don't need to use sudo to use the **list** option. This command returned a long list of packages; after scanning them, I decided I only wanted three: postgresql, postgresql-server, and postgresql-docs.
To find out what I needed to do next, I decided to consult the [PostgreSQL docs][3]. The docs are a very extensive reference—so extensive, in fact, that it is rather daunting. Fortunately, I found some notes I made in the past when I was upgrading Fedora and wanted to efficiently export my database, restart PostgreSQL on the new version, and import my old database.
### Set up PostgreSQL
Unlike most other software, you can't just install PostgreSQL and start using it. You must carry out two basic steps beforehand: First, you need to set up PostgreSQL, and second, you need to start it. You must do these as the **root** user (sudo will not work here).
To set it up, enter:
```
`postgresql-setup initdb`
```
This establishes the location of the PostgreSQL databases on the computer. Then (still as **root**), enter these two commands:
```
systemctl start postgresql.service
systemctl enable postgresql.service
```
The first command starts PostgreSQL for the current session on your computer (if you turn it off, PostgreSQL shuts down). The second command causes PostgreSQL to automatically start on subsequent reboots.
### Create a user
PostgreSQL is running, but you still can't use it because you haven't been named a user yet. To do this, you need to switch to the special user **postgres**. While you are still running as **root**, type:
```
`su postgres`
```
Since you're doing this as **root**, you don't need to enter a password. The **root** user can operate as any user without knowing their password; this is part of what makes it so powerful—and dangerous.
Now that you're **postgres**, run two commands like the following example (which creates the user **gregp**) to create your user:
```
createuser gregp
createdb gregp
```
You will probably get an error message like: **Could not switch to /home/gregp**. This just means that the user **postgres** doesn't have access to that directory. Nonetheless, your user and the database have been created. Next, type **Exit** and **Enter** twice so you're back to being yourself again.
### Set up a database
To start using PostgreSQL, type **psql** on the command line. You should see something like **gregp=&gt;** to the left of each line to show that you're using PostgreSQL and can only use commands that it understands. You automatically have a database (mine is named **gregp**)—with absolutely nothing in it. A database, in the sense of PostgreSQL, is just a space to work. Inside that space, you create _tables_. A table contains a list of variables, and underneath each variable is the data that makes up your database.
Here is how I set up my auto-service database:
```
CREATE TABLE autorepairs (
        date            date,
        repairs         varchar(80),
        location        varchar(80),
        cost            numeric(6,2)
);
```
I could have typed this continuously on a single line, but I broke it up to illustrate the parts better and to show that the white space of tabs and line feeds is not interpreted by PostgreSQL. The data points are contained within parentheses, each variable name and data type is separated from the next by a comma (except for the last), and the command ends with a semicolon. All commands must end with a semicolon!
The first variable name is **date**, and its datatype is also **date**, which is OK with PostgreSQL. The second and third variables, **repairs** and **location**, are both datatype **varchar(80)**, which means they can be any mixture of up to 80 characters (letters, numbers, whatever). The last variable, **cost**, uses the **numeric** datatype. The numbers in parentheses indicate there is a maximum of six digits and two of them are decimals. At first, I tried the **real** datatype, which would be a floating-point number. The problem with **real** as a datatype comes in more advanced commands using a **WHERE** clause, like **WHERE cost = 0** or any other specific number. Since there is some imprecision in **real** values, specific numbers will never match anything.
### Enter data
Next, you can add some data (in PostgreSQL called a **row**) with the command **INSERT INTO**:
```
`INSERT INTO autorepairs VALUES ('2017-08-11', 'airbag recall', 'dealer', 0);`
```
Notice that the parentheses form a container for the values, which must be in the correct order, separated by commas, and with a semicolon at the end of the command. The value for the **date** and **varchar(80)** datatypes must be enclosed in single quotes, but number values like **numeric** do not. As feedback, you should see:
```
`INSERT 0 1`
```
Just as in your regular terminal session, you will have a history of entered commands, so often you can save a great deal of time when entering subsequent rows by pressing the Up arrow key to show the last command and editing the data as needed.
What if you get something wrong? Use **UPDATE** to change a value:
```
`UPDATE autorepairs SET date = '2017-11-08' WHERE repairs = 'airbag recall';`
```
Or maybe you no longer want something in your table. Use **DELETE**:
```
`DELETE FROM autorepairs WHERE repairs = 'airbag recall';`
```
and the whole row will be deleted.
One last thing: Even though I used all caps in the PostgreSQL commands (which is also done in most documentation), you can type them in lowercase, which is what I generally do.
### Output data
If you want to show your data, use **SELECT**:
```
`SELECT * FROM autorepairs ORDER BY date;`
```
Without the **ORDER BY** option, the rows would appear however they were entered. For example, here's a selection of my auto-service data as it's output in my terminal:
```
SELECT date, repairs FROM autorepairs ORDER BY date;
    date   |                             repairs                             
\-----------+-----------------------------------------------------------------
2008-08-08 | oil change, air filter, spark plugs
2011-09-30 | 35000 service, oil change, rotate tires/balance wheels
2012-03-07 | repl battery
2012-11-14 | 45000 maint, oil/filter
2014-04-09 | 55000 maint, oil/filter, spark plugs, air/dust filters
2014-04-21 | replace 4 tires
2014-04-21 | wheel alignment
2016-06-01 | 65000 mile service, oil change
2017-05-16 | oil change, replce oil filt housing
2017-05-26 | rotate tires
2017-06-05 | air filter, cabin filter,spark plugs
2017-06-05 | brake pads and rotors, flush brakes
2017-08-11 | airbag recall
2018-07-06 | oil/filter change, fuel filter, battery svc
2018-07-06 | transmission fl, p steering fl, rear diff fl
2019-07-22 | oil &amp; filter change, brake fluid flush, front differential flush
2019-08-20 | replace 4 tires
2019-10-09 | replace passenger taillight bulb
2019-10-25 | replace passenger taillight assembly
(19 rows)
```
To send this to a file, change the output with:
```
`\o autorepairs.txt`
```
then run the **SELECT** command again.
### Exit PostgreSQL
Finally, to get out of PostgreSQL mode in the terminal, type:
```
`quit`
```
or its shorthand version:
```
`\q`
```
While this is just a brief introduction to PostgreSQL, I hope it demonstrates that it's neither difficult nor time-consuming to use the database for a simple task like this.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/getting-started-postgresql
作者:[Greg Pittman][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/greg-p
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Guy on a laptop on a building)
[2]: https://www.postgresql.org/
[3]: http://www.postgresql.org/docs

View File

@ -0,0 +1,144 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting Started With ZFS Filesystem on Ubuntu 19.10)
[#]: via: (https://itsfoss.com/zfs-ubuntu/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Getting Started With ZFS Filesystem on Ubuntu 19.10
======
One of the main [features of Ubuntu 19.10][1] is support for [ZFS][2]. Now you can easily install Ubuntu with on ZFS without any extra effort.
Normally, you install Linux with Ext4 filesystem. But if you do a fresh install of Ubuntu 19.10, youll see the option to use ZFS on the root. You must not use it on a dual boot system though because it will erase the entire disk.
![You can choose ZFS while installing Ubuntu 19.10][3]
Lets see why ZFS matters and how to take advantage of it on ZFS install of Ubuntu.
### How ZFS is different than other filesystems?
ZFS is designed with two major goals in mind: to handle large amounts of storage and prevent data corruption. ZFS can handle up to 256 quadrillion Zettabytes of storage. (Hence the Z in ZFS.) It can also handle files up to 16 exabytes in size.
If you are limited to a single drive laptop, you can still take advantage of the data protection features in ZFS. The copy-on-write feature ensures that data that is in use is not overwritten. Instead, the new information is written to a new block and the filesystems metadata is updated to point to the new block. ZFS can easily create snapshots of the filesystem. These snapshots track changes made to the filesystem and share with the filesystem the data that is the same to save space.
ZFS assigned a checksum to each file on the drive. It is constantly checking the state of the file against that checksum. If it detects that the file has become corrupt, it will attempt to automatically repair that file.
I have written a detailed article about [what is ZFS and what its features are][2]. Please read it if you are interested in knowing more on this topic.
Note
Keep in mind that the data protection features of ZFS can lead to a reduction in performance.
### Using ZFS on Ubuntu [For intermediate to advanced users]
![][4]
Once you have a clean install of Ubuntu with ZFS on the main disk you can start [taking advantage][5] of the features that this filesystem has.
Please note that all setup of ZFS requires the command line. I am not aware of any GUI tools for it.
#### Creating a ZFS pool
_**The section only applies if you have a system with more than one drive. If you only have one drive, Ubuntu will automatically create the pool during installation.**_
Before you create your pool, you need to find out the id of the drives for the pool. You can use the command _**lsblk**_ to show this information.
To create a basic pool with three drives, use the following command:
```
sudo zpool create pool-test /dev/sdb /dev/sdc /dev/sdd.
```
Remember to replace _**pool-test**_ with the pool name of your choice.
This command will set up “a zero redundancy RAID-0 pool”. This means that if one of the drives becomes damaged or corrupt, you will lose data. If you do use this setup, it is recommended that you do regular backups.
You can alos add another disk to the pool by using this command:
```
sudo zpool add pool-name /dev/sdx
```
#### Check the status of your ZFS pool
You can check the status of your new pool using this command:
```
sudo zpool status pool-test
```
![Zpool Status][6]
#### Mirror a ZFS pool
To ensure that your data is safe, you can instead set up mirroring. Mirroring means that each drive contains the same data. With mirroring setup, you could lose two out of three drives and still have all of your information.
To create a mirror, you can use something like this:
```
sudo zpool create pool-test mirror /dev/sdb /dev/sdc /dev/sdd
```
#### Create ZFS Snapshots for backup and restore
Snapshots allow you to create a fall-back position in case a file gets deleted or overwritten. For example, lets create a snapshot, delete some folder in my home directory and restore them.
First, you need to find the dataset you want to snapshot. You can do that with the
```
zfs list
```
![Zfs List][7]
You can see that my home folder is located in **rpool/USERDATA/johnblood_uwcjk7**.
Lets create a snapshot named **1910** using this command:
```
sudo zfs snapshot rpool/USERDATA/[email protected]
```
The snapshot will be created very quickly. Now, I am going to delete the _Downloads_ and _Documents_ directories.
Now to restore the snapshot, all you have to do is run this command:
```
sudo zfs rollback rpool/USERDATA/[email protected]
```
The length of the rollback depends on how much the information changed. Now, you can check the home folder and the deleted folders (and their content) will be returned to their correct place.
### To ZFS or not?
This is just a quick glimpse at what you can do with ZFS on Ubuntu. For more information, check out [Ubuntus wiki page on ZFS.][5] I also recommend reading this [excellent article on ArsTechnica][8].
This is an experimental feature and if you are not aware of ZFS and you want to have a simple stable system, please go with the standard install on Ext4. If you have a spare machine that you want to experiment with, then only try something like this to learn a thing or two about ZFS. If you are an expert and you know what you are doing, you are free to experiment ZFS wherever you like.
Have you ever used ZFS? Please let us know in the comments below. If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][9].
--------------------------------------------------------------------------------
via: https://itsfoss.com/zfs-ubuntu/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-19-04-release-features/
[2]: https://itsfoss.com/what-is-zfs/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/zfs-ubuntu-19-10.jpg?ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/Using_ZFS_Ubuntu.jpg?resize=800%2C450&ssl=1
[5]: https://wiki.ubuntu.com/Kernel/Reference/ZFS
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/10/zpool-status.png?ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/10/zfs-list.png?ssl=1
[8]: https://arstechnica.com/information-technology/2019/10/a-detailed-look-at-ubuntus-new-experimental-zfs-installer/
[9]: https://reddit.com/r/linuxusersgroup

View File

@ -0,0 +1,290 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Schedule and Automate tasks in Linux using Cron Jobs)
[#]: via: (https://www.linuxtechi.com/schedule-automate-tasks-linux-cron-jobs/)
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
如何使用 cron 任务在 Linux 中计划和自动化任务
======
有时,你可能需要定期执行任务或以预定的时间间隔执行任务。这些任务包括备份数据库、更新系统、执行定期重新引导等。这些任务称为 “cron 任务”。cron 任务用于“自动执行的任务”它有助于简化重复的、有时是乏味的任务的执行。cron 是一个守护进程,可让你调度这些任务,然后按指定的时间间隔执行这些任务。在本教程中,你将学习如何使用 cron 来调度任务。
![Schedule -tasks-in-Linux-using cron][2]
### crontab 文件
crontab 即 “cron table”是一个简单的文本文件其中包含指定任务执行时间间隔的规则或命令。 crontab 文件分为两类:
1系统范围的 crontab 文件
这些通常由需要 root 特权的 Linux 服务及关键应用程序使用。系统 crontab 文件位于 `/etc/crontab` 中,并且只能由 root 用户访问和编辑。通常用于配置系统范围的守护程序。`crontab` 文件的看起来类似如下所示:
![etc-crontab-linux][3]
2用户创建的 crontab 文件
Linux 用户还可以在 `crontab` 命令的帮助下创建自己的 cron 任务。创建的 cron 任务将以创建它们的用户身份运行。
所有 cron 任务都存储在 `/var/spool/cron`(对于 RHEL 和 CentOS 发行版)和 `/var/spool/cron/crontabs`(对于 Debian 和 Ubuntu 发行版cron 任务使用创建该文件的用户的用户名列出。
cron 守护进程在后台静默地检查 `/etc/crontab` 文件和 `/var/spool/cron``/etc/cron.d*/` 目录。
`crontab` 命令用于编辑 cron 文件。让我们看一下 crontab 文件的结构。
### crontab 文件剖析
在继续之前,我们要首先探索 crontab 文件的格式。crontab 文件的基本语法包括 5 列,由星号表示,后跟要执行的命令。
```
*    *    *    *    *    command
```
此格式也可以表示如下:
```
m h d moy dow command
```
```
m h d moy dow /path/to/script
```
让我们来解释一下每个条目
* `m`:代表分钟。范围是 0 到 59
* `h`:表示小时,范围是 0 到 23
* `d`:代表一个月中的某天,范围是 1 到 31
* `moy`:这是一年中的月份。范围是 1 到 12
* `doy`:这是星期几。范围是 0 到 6其中 0 代表星期日
* `Command`:这是要执行的命令,例如备份命令、重新启动和复制命令等
### 管理 cron 任务
看完 crontab 文件的结构之后,让我们看看如何创建、编辑和删除 cron 任务。
#### 创建 cron 任务
要以 root 用户身份创建或编辑 cron 任务,请运行以下命令:
```
# crontab -e
```
要为另一个用户创建或安排 cron 任务,请使用以下语法:
```
# crontab -u username -e
```
例如,要以 Pradeep 用户身份运行 cron 任务,请发出以下命令:
```
# crontab -u Pradeep -e
```
如果该 crontab 文件尚不存在,那么你将打开一个空白文本文档。如果该 crontab 文件已经存在,则 `-e` 选项会让你编辑该文件,
#### 列出 crontab 文件
要查看已创建的 cron 任务,只需传递 `-l` 选项:
```
# crontab -l
```
#### 删除 crontab 文件
要删除 cron 任务,只需运行 `crontab -e` 并删除所需的 cron 任务行,然后保存该文件。
要删除所有的 cron 任务,请运行以下命令:
```
# crontab -r
```
然后,让我们看一下安排任务的不同方式。
### crontab 安排任务示例
如图所示,所有 cron 任务文件都带有释伴标头。
```
#!/bin/bash
```
这表示你正在使用的 shell在这种情况下即 bash shell。
接下来,使用我们之前指定的 cron 任务条目指定要安排任务的时间间隔。
要每天下午 12:30 重新引导系统,请使用以下语法:
```
30  12 *  *  * /sbin/reboot
```
要安排在凌晨 4:00 重启,请使用以下语法:
```
0  4  *  *  *  /sbin/reboot
```
注:星号 `*` 用于匹配所有记录。
要每天两次运行脚本(例如,凌晨 4:00 和下午 4:00请使用以下语法
```
0  4,16  *  *  *  /path/to/script
```
要安排 cron 任务在每个星期五下午 5:00 运行,请使用以下语法:
```
0  17  *  *  Fri  /path/to/script
```
```
0 17  *  *  *  5  /path/to/script
```
如果你希望每 30 分钟运行一次 cron 任务,请使用:
```
*/30  *  *  *  * /path/to/script
```
要安排 cron 任务每 5 小时运行一次,请运行:
```
*  */5  *  *  *  /path/to/script
```
要在选定的日期(例如,星期三和星期五的下午 6:00运行脚本请执行以下操作
```
0  18  *  *  wed,fri  /path/to/script
```
要使用单个 cron 任务运行多个命令,请使用分号分隔任务,例如:
```
*  *  *  *  *  /path/to/script1 ; /path/to/script2
```
### 使用特殊字符串节省编写 cron 任务的时间
某些 cron 任务可以使用对应于特定时间间隔的特殊字符串轻松配置。例如,
1`@hourly` 时间戳等效于 `0 * * * *`
它将在每小时的第一分钟执行一次任务。
```
@hourly /path/to/script
```
2`@daily` 时间戳等效于 `0 0 * * *`
它在每天的第一分钟(午夜)执行任务。它可以在执行日常工作时派上用场。
```
@daily /path/to/script
```
3`@weekly` 时间戳等效于 `0 0 1 * mon`
它在每周的第一分钟执行 cron 任务,一周是从星期一开始的。
```
@weekly /path/to/script
```
3`@monthly` 时间戳等效于 `0 0 1 * *`
它在每月第一天的第一分钟执行任务。
```
@monthly /path/to/script
```
4`@yearly` 时间戳等效于 `0 0 1 1 *`
它在每年的第一分钟执行任务,并且对发送新年问候很有用。
```
@yearly /path/to/script
```
### 限制 crontab
作为 Linux 用户,你可以控制谁有权使用 `crontab` 命令。可以使用 `/etc/cron.deny``/etc/cron.allow` 文件来控制。默认情况下,只有一个 `/etc/cron.deny` 文件,并且不包含任何条目。要限制用户使用 `crontab` 实用程序,只需将用户的用户名添加到文件中即可。当用户添加到该文件中,并且该用户尝试运行 `crontab` 命令时,他/她将遇到以下错误。
![restricted-cron-user][4]
要允许用户继续使用 `crontab` 实用程序,只需从 `/etc/cron.deny` 文件中删除用户名即可。
如果存在 `/etc/cron.allow` 文件,则仅文件中列出的用户可以访问和使用 `crontab` 实用程序。
如果两个文件都不存在,则只有 root 用户具有使用 `crontab` 命令的特权。
### 备份 crontab 条目
始终建议你备份 crontab 条目。为此,请使用语法
```
# crontab -l > /path/to/file.txt
```
例如:
```
# crontab -l > /home/james/backup.txt
```
### 检查 cron 日志
cron 日志存储在 `/var/log/cron` 文件中。要查看 cron 日志,请运行以下命令:
```
# cat /var/log/cron
```
![view-cron-log-files-linux][5]
要实时查看日志,请使用 `tail` 命令,如下所示:
```
# tail -f /var/log/cron
```
![view-live-cron-logs][6]
### 总结
在本指南中,你学习了如何创建 cron 任务以自动执行重复性任务,如何备份和查看 cron 日志。我们希望本文提供有关 cron 作业的有用见解。请随时分享你的反馈和意见。
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/schedule-automate-tasks-linux-cron-jobs/
作者:[Pradeep Kumar][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lujun9972
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Schedule-tasks-in-Linux-using-cron.jpg
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/11/etc-crontab-linux.png
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/11/restricted-cron-user.png
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/11/view-cron-log-files-linux.png
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/11/view-live-cron-logs.png

View File

@ -0,0 +1,86 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to add a user to your Linux desktop)
[#]: via: (https://opensource.com/article/19/11/add-user-gui-linux)
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
如何在 Linux 桌面添加用户
======
无论是在安装中还是在桌面中,通过图形界面管理用户都非常容易。
![Team of people around the world][1]
添加用户是你在一个新系统上要做的第一件事。而且,你通常需要在计算机的整个生命周期中管理用户。
我的关于 [**useradd** 命令][2]文章提供了更深入的对 Linux 的用户管理的了解。useradd 是一个命令行工具,但是你也可以在 Linux 上以图形方式管理用户。这就是本文的主题。
### 在 Linux 安装过程中添加用户
大多数 Linux 发行版都提供了在安装过程中创建用户的步骤。例如Fedora 30 安装程序 Anaconda 创建标准的 _root_ 用户和另一个本地用户帐户。在安装过程中进入“配置”页面时,单击“用户设置”下的“用户创建”。
![Fedora Anaconda Installer - Add a user][3]
在用户创建页面上,输入用户的详细信息:**全名**、**用户名**和**密码**。你还可以选择是否使用户成为管理员。
![Create a user during installation][4]
点击**高级**按钮打开**高级用户配置**页面。如果需要除默认设置以外的其他设置,那么可以在此处指定主目录的路径以及用户和组 ID。你也可以输入用户所属的其他组。
![Advanced user configuration][5]
### 在 Linux 桌面上添加用户
#### GNOME
许多 Linux 发行版都使用 GNOME 桌面。以下截图来自 Red Hat Enterprise Linux 8.0,但是在其他发行版(如 Fedora、Ubuntu 或 Debian该过程相似。
首先打开“设置”。然后打开**详细**,选择**用户**,单击**解锁**,然后输入密码(除非你已经以 root 用户登录)。这样将用“添加用户”按钮代替“解锁”按钮。
![GNOME user settings][6]
现在,你可以通过单击**添加用户**,然后选择帐户**类型**然后输入**用户名**和**密码**来添加用户。
在下面的截图中,已经输入了用户名,设置保留为默认设置。我不必输入**用户名**,因为它是在我在“全名”字段中输入时自动创建的。如果你不喜欢自动补全,你仍然可以对其进行修改。
![GNOME settings - add user][7]
这将为名为 Sonny 的用户创建一个标准帐户。Sonny 首次登录时需要提供密码。
接下来,将显示用户。在此页面可以选择每个用户进行自定义或者删除。例如,你可能想选择一个头像或设置默认语言。
![GNOME new user][8]
#### KDE
KDE 是另一个流行的 Linux 桌面环境。下面是 Fedora 30 上 KDE Plasma 的截图。你可以看到,在 KDE 中添加用户与在 GNOME 中添加用户非常相似。
![KDE settings - add user][9]
### 总结
除 GNOME 和 KDE 外,其他桌面环境和窗口管理器也有图形用户管理工具。无论是在安装时还是安装后,在 Linux 中以图形方式添加用户都是快速简便的。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/11/add-user-gui-linux
作者:[Alan Formy-Duval][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world)
[2]: https://opensource.com/article/19/10/linux-useradd-command
[3]: https://opensource.com/sites/default/files/uploads/screenshot_fedora30_anaconda2.png (Fedora Anaconda Installer - Add a user)
[4]: https://opensource.com/sites/default/files/uploads/screenshot_fedora30_anaconda3.png (Create a user during installation)
[5]: https://opensource.com/sites/default/files/uploads/screenshot_fedora30_anaconda4.png (Advanced user configuration)
[6]: https://opensource.com/sites/default/files/uploads/gnome_settings_user_unlock.png (GNOME user settings)
[7]: https://opensource.com/sites/default/files/uploads/gnome_settings_adding_user.png (GNOME settings - add user)
[8]: https://opensource.com/sites/default/files/uploads/gnome_settings_user_new.png (GNOME new user)
[9]: https://opensource.com/sites/default/files/uploads/kde_settings_adding_user.png (KDE settings - add user)