Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-03-05 09:22:37 +08:00
commit 9cb4e166d9
9 changed files with 1085 additions and 245 deletions

View File

@ -0,0 +1,79 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Seawater, humidity inspire new ways to generate power)
[#]: via: (https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html)
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
Seawater, humidity inspire new ways to generate power
======
Researchers around the globe are working on new ways to generate huge amounts of power that will be needed for the shift to a data-driven society.
Getty Imags
The possiblity of a future power-availability crunch spurred in part by a global increase in data usage is driving researchers to get creative with a slew of new and modified ways to generate and store energy.
Ongoing projects include the use of seawater for batteries; grabbing ambient humidity; massive water storage systems for hydropower; and solar panels that work at night. Here are some details:
### Batteries based on seawater
Seawater will provide "super-batteries," says the University of Southern Denmark. Researchers there have been studying how to use sodium, which is abundant in seawater, as an alternative to lithium in batteries.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
"Sodium is a very readily available resource," the school says in a [press release][2], and it can be easily extracted from seawater. Lithium, on the other hand, is a limited resource that's mined only in a few places in the world, says research leader Dorthe Bomholdt Ravnsbæk of the department of physics, chemistry and pharmacy at the university. Batteries based on seawater would also alleviate the need for cobalt, which is used in lithium cells. The team in Denmark (working with Massachusetts Institute of Technology) believes it has come up with a new electrode material, based on manganese, that will make the seawater battery ultimately viable.
### Using ambient moisture to generate power
Humidity captured with bio-electronics could end up being a viable power source for sensors, say some scientists.
"Harvesting energy from the environment offers the promise of clean power for self-sustained systems," notes University of Massachusetts researchers [in an article published in Nature][3]. However, known technologies often have restrictive environmental requirements  solar panels that must be mounted outside, for example that limit their energy-producing potential.
Moisture harvesting with thin-film, protein nanowires doesn't have restrictive environmental requirements. Sustained voltages of about half a volt can be obtained from moisture present in normal, ambient air. "Connecting several devices linearly scales up the voltage and current to power electronics," the Amherst group claims. "Our results demonstrate the feasibility of a continuous energy-harvesting strategy that is less restricted by location or environmental conditions than other sustainable approaches."
[][4]
### Seasonally pumped hydropower storage 
On a larger scale, inland water storage could solve renewable power issues, say scientists at the International Institute for Applied Systems Analysis.
One big problem collecting power from the environment, as opposed to using fossil fuels, is where to store the on-the-fly electricity being generated. The Austrian organization believes that hydropower systems should be used to contain renewable energy. It's cheap, for starters. In addition, seasonal pumped hydropower storage (SPHS) is better than wind or solar, the group claims, because it not only generates the power in real time as its needed, but also isn't affected by variations— a windy day isn't required, for example.
SPHS operates by pumping water into dammed, river-adjacent reservoirs when water flow is high but power demand is low. Water is then allowed to flow out of the reservoir, through turbines—similar to hydroelectric—when energy demand increases. Electricity is thus created. The group, in a [press release][5] related to a study just released, says the technique is highly economical, even including required land purchases, excavation and tunneling.
### Nighttime, anti-solar cells
Contrary to popular belief, photovoltaic solar panels don't actually need full sun to function. Cloud cover allows some to work just fine, just not as well. Nighttime photovoltaic, however, is something more radical:
The earth should be used as a heat source, and the night sky a heat sink, say Jeremy Munday and Tristan Deppe of the department of electrical and computer engineering at University of California, Davis. They shared their idea for nighttime photovoltaic cells in an [abstract of a paper][6] published by American Chemical Society's ACS Photonics.
What they are suggesting is using thermoradiative photovoltaics, where deep space radiative cooling ([which Ive written about before][7]) is combined with photovoltaics. Current is created as infrared light or heat, in other words is radiated into extremely cold, deep space.
"Similar to the way a normal solar cell works, but in reverse," Munday says of their anti-solar panel concept, quoted in a [UC Davis news article][8]. 
Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html
作者:[Patrick Nelson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Patrick-Nelson/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/newsletters/signup.html
[2]: https://www.sdu.dk/en/nyheder/Forskningsnyheder/skal_fremtidens_superbatterier_laves_af_havvand
[3]: https://www.nature.com/articles/s41586-020-2010-9
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[5]: https://iiasa.ac.at/web/home/about/news/200219-seasonal-pumped-storage.html
[6]: https://pubs.acs.org/toc/apchd5/7/1
[7]: https://www.networkworld.com/article/3222850/space-radiated-cooling-cuts-power-use-21.html
[8]: https://www.ucdavis.edu/news/anti-solar-cells-photovoltaic-cell-works-night
[9]: https://www.facebook.com/NetworkWorld/
[10]: https://www.linkedin.com/company/network-world

View File

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

View File

@ -1,105 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Add New Brushes in GIMP [Quick Tip])
[#]: via: (https://itsfoss.com/add-brushes-gimp/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
How to Add New Brushes in GIMP [Quick Tip]
======
[GIMP][1], is the most popular free and open-source image editor and perhaps the best [Adobe Photoshop alternative][2] on Linux.
When you [install GIMP on Ubuntu][3] or any other operating system, youll find a few brushes already installed for basic image editing. If you need something more specific, you can always add new brushes in GIMP.
How? Let me show you that in this quick tutorial.
### How to add brushes in GIMP
![][4]
There are three steps involved in installing new brushes in GIMP:
* Get new brush
* Put it in the designated folder
* Refresh the brushes in GIMP
#### Step 1: Download new GIMP brushes
The first step is to get new brushes for GIMP. Where do you get it from? From the internet, of course.
You can search on Google or [alternative private search engines like Duck Duck Go][5] for GIMP brushes and download the ones you like from a reputed website.
GIMP brushes are usually available in .gbr and .gih file formats. The .gbr file is for regular brushes while .gih is used for animated brushes.
Did you know?
For the versions 2.4 and above, GIMP makes installing and using Photoshop brushes (.abr file) quite straightforward. All you need to do is place the Photoshop brush files in the proper folder.
Do keep in mind that the latest Photoshop brushes might not work with GIMP flawlessly.
#### Step 2: Copy the new brushes into its location
After you get your brush file, the next step is to copy and paste it to the right folder in GIMP configuration directory.
On **Windows**, youll have to go to a folder like “**C:\Documents and Settings\myusername.gimp-2.10\brushes**“.
Ill show detailed steps for **Linux** because Its FOSS is a Linux-focused website.
After selecting the brush files press **Ctrl+h** in your **Home** folder to [see hidden files in Linux][6].
![Press Ctrl+H to see hidden files in the home directory][7]
You should go to **.config/GIMP/2.10/brushes** folder (if you are using GIMP version 2.10). If you are using some other version, you should see an equivalent folder under .config/GIMP.
![Adding New Brushes in GIMP][8]
Paste the brush files in this folder. Optionally, you can hide the hidden files by pressing **Ctrl+h** again.
#### Step 3: Refresh the brushes (to avoid restarting GIMP)
GIMP will automatically load brushes when its launched. If you are already running it and dont want to close it, you can refresh the brushes.
In GIMP go to **Windows**->**Dockable Dialogues**->**Brushes** in the main menu.
![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9]
Locate the **refresh** icon in the **Brushes** dialog on the right side bar.
![Refresh GIMP Brushes][10]
If your brushes are not present, you can always try to restart GIMP.
Bonus Tip!
Adding new brushes in [GIMP also allows you easily watermark images][11]. Just use your logo as a brush and add it to the images in a single click.
I hope you enjoyed this quick GIMP tip. Stay tuned for more.
--------------------------------------------------------------------------------
via: https://itsfoss.com/add-brushes-gimp/
作者:[Community][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/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://www.gimp.org/
[2]: https://itsfoss.com/open-source-photoshop-alternatives/
[3]: https://itsfoss.com/gimp-2-10-release/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1
[5]: https://itsfoss.com/privacy-search-engines/
[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1
[11]: https://itsfoss.com/add-watermark-gimp-linux/

View File

@ -1,139 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop)
[#]: via: (https://itsfoss.com/drauger-os/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop
======
For years (or decades) people complained that one of the reasons to not [use Linux][1] is lack of mainstream games. [Gaming on Linux][2] has improved drastically in last few years specially with the [introduction of Steam Proton][3] project that enables you to [play a lot of Windows-only games on Linux][4].
This also has encourages several [Linux distributions centered around gaming][5]. Take [Lakka][6] for example. You can [turn your old computer into a retro gaming console thanks to Lakka Linux][7].
Another such gaming focused Linux distribution is [Draguer OS][8] and we are going to take a look at it today.
### What is Drauger OS?
Accord to [the projects website][9], “Drauger OS is a Linux desktop gaming operating system. It aims to provide a platform for gamers to use where they can get great performance without sacrificing their security. Furthermore, it aims to make it easy for anyone to game, whether they use a keyboard and mouse, or some sort of controller.”
They stress that Drauger OS is not for everyday use. As such, many of the productivity tools that most other distros come with are not in Drauger OS.
![Drauger OS 7.4.1][10]
Drauger OS is [based][9] on the Ubuntu. The current version (7.4.1 Jiangshi) uses “[Liquorix][11] low latency Linux kernel, a pre-compiled ZEN kernel designed with a balance between latency and throughput in mind”. However, that will be changing in the next release. They only have one desktop environment choice, a modified version of [Xfce][12].
Drauger OS has several applications and tools installed out of the box to improve the gaming experience. These include:
* [PlayOnLinux][13]
* WINE
* [Lutris][14]
* Steam
* [DXVK][15]
It also has an interesting set of tools that are not gaming related. [Drauger Installer][16] is a .deb installer and alternative to Gdebi. [Multiple Repository App Installer][17] (mrai) is “an AUR-helper-like script for Debian-based Linux Operating Systems”. Mrai is designed to work with apt, snaps, flatpaks, and can install apps from GitHub.
Interestingly, Drauger OS name is an error. Lead dev [Thomas Castleman][18] (aka batcastle) has intended to name his distro Draugr, but had mistyped the name. In [episode 23][19] of the Drauger OS podcast, Castleman said the name will stay misspelled because it would be a lot of work to correct it. According to [Wikipedia][20], a draugr is “an undead creature from Norse mythology”.
Yes, you read that correctly. Drauger OS is one of only a few distros that have its own [podcast][21]. When asked about it, Castleman told me that “I wanted to ensure that we had the maximum transparency possible with our community, no matter their circumstances.” Most of the time, the podcast is an audio version of the Drauger OS blog, but sometimes they use it to make an announcement when they dont have time to write a blog post.
### The Future for Drauger OS
![Drauger OS][22]
The developers behind Druager OS are working on their next major release: 7.5.1. This release will be based on Ubuntu 19.10. There will be three major changes. First, the Liquorix kernel will be [replaced][23] with “a kernel we are building in-house.” This kernel will be based on the Linux Kernel GitHub repository, “so its about as vanilla as it gets”.
The second major change in the new release will a new layout for their desktop. Based on user feedback, they have decided to change it to something that looks more GNOME-like.
Thirdly, they are dropping SystemBack as their backup tool and installer. They have instead written a new [installer][24] from scratch.
The Dev team is also working on an [ARM version][25] of Drauger OS. They hope to release it sometime in 2022.
### System requirements for Draguer OS
The Drauger OS [system requirements][25] are pretty modest. Keep in mind that Drauger OS will only run on 64-bit systems.
#### Minimum system requirements
* CPU: Dual-Core, 1.8GHz, 64-bit processor
* RAM: 1 GB
* Storage: 16 GB
* Graphics Processor: Integrated
* Screen Resolution: 1024×768 at 60Hz
* External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 2 USB Ports for Installation USB Drive and Keyboard (Mouse optional, but recommended)
#### Recommended system requirements
* CPU: Quad-Core, 2.2Ghz, 64-bit processor
* RAM: 4 GB
* Storage: 128 GB
* Graphics Processor: NVIDIA GTX 1050, AMD RX 460, or equivalent card
* Screen Resolution: 1080p at 60Hz
* External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 3 USB Ports for Installation USB Drive, Keyboard, and Mouse, 1 Audio Out Port
### How you can help out Drauger OS
There are several ways that you can help out the Drauger OS if you are interestedin doing so. They are always looking for [financial support][26] to keep development going.
If you want yo contribute code, they are looking for people with experience in BASH, C++, and Python. All of their code is up on [GitHub][27]. You can also [contact][28] them on social media.
### Final Thoughts
Drauger OS is quite a project. Ive seen a couple of other [gaming-oriented distributions][29], but Drauger OS is single-minded in its focus on gaming. Since I am more of a casual gamer, this distro doesnt appeal to me personally. But, I can see how it could lure gaming enthusiasts to Linux. I wish them good luck in their future releases.
What are your thoughts on this gaming-only distro? What is your favorite Linux gaming solution? 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][30].
--------------------------------------------------------------------------------
via: https://itsfoss.com/drauger-os/
作者:[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/why-use-linux/
[2]: https://itsfoss.com/linux-gaming-guide/
[3]: https://itsfoss.com/steam-play-proton/
[4]: https://itsfoss.com/steam-play/
[5]: https://itsfoss.com/linux-gaming-distributions/
[6]: http://www.lakka.tv/
[7]: https://itsfoss.com/lakka-retrogaming-linux/
[8]: https://draugeros.org/go/
[9]: https://www.draugeros.org/go/about/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1
[11]: https://liquorix.net/
[12]: https://www.xfce.org/
[13]: https://www.playonlinux.com/en/
[14]: https://lutris.net/
[15]: https://github.com/doitsujin/dxvk
[16]: https://github.com/drauger-os-development/drauger-installer
[17]: https://github.com/drauger-os-development/mrai
[18]: https://github.com/Batcastle
[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47
[20]: https://en.wikipedia.org/wiki/Draugr
[21]: https://anchor.fm/drauger-os
[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1
[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/
[24]: https://github.com/drauger-os-development/system-installer
[25]: https://www.draugeros.org/go/system-requirements/
[26]: https://www.draugeros.org/go/contribute/
[27]: https://github.com/drauger-os-development
[28]: https://www.draugeros.org/go/contact-us/
[29]: https://itsfoss.com/manjaro-gaming-linux/
[30]: https://reddit.com/r/linuxusersgroup

View File

@ -0,0 +1,122 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with the Gutenberg editor in Drupal)
[#]: via: (https://opensource.com/article/20/3/gutenberg-editor-drupal)
[#]: author: (MaciejLukianski https://opensource.com/users/maciejlukianski)
Getting started with the Gutenberg editor in Drupal
======
Learn how to use the WYSIWYG editor, made popular in WordPress, with
Drupal.
![Text editor on a browser, in blue][1]
Since 2017, WordPress has had a really great WYSIWYG editor in the [Gutenberg][2] plugin. But the Drupal community hasn't yet reached consensus on the best approach to the content management system's (CMS) editorial experience. But a strong new option appeared when, with a lot of community effort, [Gutenberg was integrated with Drupal][3].
Previously, there were two main approaches to content creation in Drupal 8:
* In the [**Paragraph-based approach**][4], content is assembled out of entities called paragraphs. Currently, approximately 100,000 websites use the Paragraphs module (according to Drupal).
* The [**Layout-Builder approach**][5] uses an editorial tool shipped with Drupal 8.5. It is still undergoing improvements, but it is the next strong contender because it is really well integrated with the Drupal core. Stats on usage are not available since Layout Builder is part of Drupal.
At the end of 2018, the Drupal community, lead by Fronkom (a Norwegian digital agency strongly focused on open source solutions), ported the WordPress Gutenberg project as a contributed module into Drupal. Let's take a look at how Gutenberg works in Drupal (including some cool Drupal-specific integrations).
### Installation
Installing the [Gutenberg module][6] is as straightforward as installing any Drupal module, and it has good [installation documentation][7].
### Configuration
Gutenberg is integrated into Drupal's default content-entity creation workflow. You can use it on any of the content types you choose, provided that the content type has at least one text area field, which is where the Gutenberg editor's output will be saved.
To enable the Gutenberg project on a content type in Drupal, you have to navigate to its settings: **Structure > Content types** and, from the dropdown next to the content type where you want to use Gutenberg, click **Edit**.
![Drupal settings][8]
In the form that appears, scroll down and select the **Gutenberg experience** tab on the left, where you can find the settings described below. Select the **Enable Gutenberg experience** box.
![Drupal Gutenberg settings][9]
#### Template
This is one of the cool features that is not available in WordPress out of the box. It enables you to define a template for a new page in a JSON structure. This will pre-populate all newly created articles with dummy placeholder content, which will help editors structure content correctly. In the screenshot above, I added a heading and a paragraph. Note that any double-quotes have to be escaped.
#### Template lock
This setting allows you to define whether users are allowed to delete the placeholder content, add new blocks, or just edit the existing, pre-populated content.
#### Allowed Gutenberg and Drupal blocks
This is another super-cool feature on the Drupal side of Gutenberg. Drupal allows users to create various types of blocks to design a page. For example, you could create a block with a list of the five latest blog posts, the most recent comments, or a form to collect users' emails.
Gutenberg's deep integration with Drupal allows users to select which Drupal blocks are available to users while they are editing (e.g., limit embeds to YouTube) and use blocks as inline content. This is a very handy feature that allows granular control of the user experience.
There's not much to choose from in a blank Drupal installation, but a live site usually has many blocks that provide various functionalities. In the screenshot below, the **Search form** Drupal block is selected.
![Drupal Gutenberg blocks][10]
After you finish the configuration, hit **Save content type**.
### Publishing content with Drupal Gutenberg
When Gutenberg is enabled for a content type, it takes over most of the editorial experience.
![Drupal Gutenberg content screen][11]
In the main window, you can see the dummy placeholder content I added in the Template configuration above.
#### Drupal-specific options
On the right-hand side, there are a few fields and settings that Drupal provides. For example, the **Title** field is a required separate field in Drupal, and therefore it is not on the main Gutenberg screen.
Underneath the **Title**, there are additional settings that can vary, depending on the modules installed and options set up in Drupal. You can see **Revision log messages**, **Menu settings**, **Comment settings**, and a place to add a **URL alias**.
Typically, Drupal content types are composed of several text fields, such as tags, categories, checkboxes, image fields for teasers, etc. When you enable Gutenberg for a content type, these additional fields are available in the **More settings** tab.
You can now add your content—it works the same as it does in WordPress Gutenberg, with the additional option to add Drupal blocks.
In the screenshot below, you can see what happens when I add some text to replace the placeholder text, a search block from Drupal, a title, tags, and a custom URL alias.
![Drupal Gutenberg entering text][12]
After you hit **Save**, your content will be published.
![Drupal Gutenberg output][13]
And that is it. It works like a charm!
### Working together for better software experiences
Gutenberg in Drupal works well. It is an alternative option that allows editors to control the look and feel of their websites down to the tiniest details. Adoption is growing well, with over 1,000 installations as of this writing and 50 new ones every month. The Drupal integration adds other cool features like fine-grained permissions, placeholder content, and the ability to include Drupal blocks inline, which aren't available in the WordPress plugin.
It is great to see the communities of two separate projects working together to achieve the common goal of giving people better software.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/gutenberg-editor-drupal
作者:[MaciejLukianski][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/maciejlukianski
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://wordpress.org/plugins/gutenberg/
[3]: https://drupalgutenberg.org/
[4]: https://www.droptica.com/blog/flexible-and-easy-content-creation-drupal-paragraphs-module/
[5]: https://www.droptica.com/blog/layout-builder-building-drupal-8-layouts/
[6]: https://www.drupal.org/project/gutenberg
[7]: https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules
[8]: https://opensource.com/sites/default/files/uploads/gutenberg_edit.png (Drupal settings)
[9]: https://opensource.com/sites/default/files/uploads/gutenberg_settings.png (Drupal Gutenberg settings)
[10]: https://opensource.com/sites/default/files/uploads/gutenberg_blocks.png (Drupal Gutenberg blocks)
[11]: https://opensource.com/sites/default/files/uploads/gutenberg_contentwindow.png (Drupal Gutenberg content screen)
[12]: https://opensource.com/sites/default/files/uploads/gutenberg_entry.png (Drupal Gutenberg entering text)
[13]: https://opensource.com/sites/default/files/uploads/gutenberg-demo.png (Drupal Gutenberg output)

View File

@ -0,0 +1,428 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How service virtualization relates to test-driven development)
[#]: via: (https://opensource.com/article/20/3/service-virtualization-test-driven-development)
[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic)
How service virtualization relates to test-driven development
======
Mountebank simulates services you're dependent on so autonomous teams
can continue development activities without having to wait on anyone.
![Person using a laptop][1]
The agile approach to software development relies on service virtualization to give each IT team autonomy. This approach removes blockages and allows autonomous teams to continue development activities without having to wait on anyone. That way, integration testing can commence as soon as teams start iterating/sprinting.
### How automated services work
Any automated service is available to consumers via a published endpoint. This means services can be automated only if they're made available online.
Any consumer wishing to leverage available automated services must be capable of sending requests to that service's endpoint via an HTTP protocol. Some of those services will, upon receiving the request via the HTTP protocol, respond by simply sending back some data. Other services may respond to receiving a request via HTTP protocol by actually performing some work. For example, a service may create a resource (for example, create an order), update a resource (update an order), or delete a resource (cancel an order).
All those activities get triggered via the HTTP protocol. In the simplest of cases, the action instigated by the service consumer is GET (e.g., HTTP GET). That request may arrive with some query values; those values will get used by the service to narrow down the search (such as "search for order number 12345 and return the data").
In more elaborate cases, a request may arrive with the instruction to POST some values; a service will accept that request and expect some values to be associated with it. Those values are usually called the payload. When the service accepts an HTTP POST request containing the payload, it will attempt to process it. It may or may not succeed in processing it, but either way, it will respond to the service consumer with a status code and an optional status message. That way, service consumers will be notified of the success/failure of their request so that they can decide what the next step should be.
### What is service virtualization?
Now that we understand how automated services work, it should be easier to understand how to virtualize them. In a nutshell, it is possible to simulate any service that is published on a hosting site. Instead of sending HTTP requests directly to the service provider's endpoint, you can interject a fake, pretend service that simulates the behavior of the real service.
From the service consumer's standpoint, it makes absolutely no difference whether it is interacting with a real or a fake service. The interaction remains identical.
### Virtualize one service
OK, enough talking, I'll roll up my sleeves and show how to do it in practical terms. Suppose your team is starting a new project and receives requirements in the form of a fully fleshed user story:
#### Authenticate user
_As a new app_
_I want to authenticate the user_
_Because we want to ensure proper security for the app_
#### Acceptance criteria
**Scenario #1:** _New app successfully authenticates the user_
Given that the user has navigated to the login page
And the user has submitted credentials
When new app receives login request
Then new app successfully authenticates the user
And new app displays response message "User successfully logged in."
**Scenario #2:** _New app cannot authenticate the user on the first attempt_
Given that the user has navigated to the login page
And the user has submitted credentials
When new app receives login request
Then new app fails to successfully authenticate the user
And new app displays response message "Incorrect login. You have 2 more attempts left."
**Scenario #3:** _New app cannot authenticate the user on the second attempt_
Given that the user has navigated to the login page
And the user has submitted credentials
When new app receives login request
Then new app fails to successfully authenticate the user
And new app displays response message "Incorrect login. You have 1 more attempt left."
**Scenario #4:** _New app cannot authenticate the user on the third attempt_
Given that the user has navigated to the login page
And the user has submitted credentials
When new app receives login request
Then new app fails to successfully authenticate the user
And new app displays response message "Incorrect login. You have no more attempts left."
The first thing to do when starting the work on this user story is to create the so-called "walking skeleton" (for this exercise, I will be using the standard **.Net Core** platform plus **xUnit.net** I discussed in my previous articles ([starting with this one][2] with [another example here][3]). Please refer to them for technical details on how to install, configure, and run the required tools.
Create the walking skeleton infrastructure by opening the command line and typing:
```
`mkdir AuthenticateUser`
```
Then move inside the **AuthenticateUser** folder:
```
`cd AuthenticateUser`
```
And create a separate folder for tests:
```
`mkdir tests`
```
Move into the **tests** folder (**cd tests**) and initiate the **xUnit** framework:
```
`dotnet new xunit`
```
Now move one folder up (back to **AuthenticateUser**) and create the app folder:
```
mkdir app
cd app
```
Create the scaffold necessary for C# code:
```
`dotnet new classlib`
```
The walking skeleton is now ready! Open the editor of your choice and start coding.
### Write a failing test first
In the spirit of TDD, start by writing the failing test (refer to the [previous article][4] to learn why is it important to see your test fail before attempting to make it pass):
```
using System;
using Xunit;
using app;
namespace tests {
    public class UnitTest1 {
        Authenticate auth = [new][5] Authenticate();
        [Fact]
        public void SuccessLogin(){
            var given = "credentials";
            var expected = "Successful login.";
            var actual = auth.Login(given);
            Assert.Equal(expected, actual);
        }
    }
}
```
This test states that if someone supplies some credentials (i.e., a secret username and password) to the **Login** method of the **Authenticate** component when it processes the request, it is expected to return the message "Successful login."
Of course, this is functionality that does not exist yet—the instantiated **Authenticate** module in the **SuccessLogin()** module hasn't been written yet. So you might as well go ahead and take the first stab at writing the desired functionality. Create a new file (**Authenticate.cs**) in the **app** folder and add the following code:
```
using System;
namespace app {
    public class Authenticate {
        public string Login(string credentials) {
            return "Not implemented";
        }
    }
}
```
Now, navigate to the **tests** folder and run:
```
`dotnet test`
```
![Output of dotnet.test][6]
The test fails because it was expecting a "Successful login" output but instead got the "Not implemented" output.
### Increasing complexity for day two operations
Now that you have created the "happy path" expectation and made it fail, it is time to work on implementing the functionality that will make the failing test pass. The following day, you attend the standup and report that you have started on the "Authenticate user" story. You let the team know that you have created the first failing test for the "happy path," and today, the plan is to implement the code to make the failing test pass.
You explain your intention to first create a **User** table containing the **username**, **password**, and other pertinent attributes. But the scrum master interrupts and explains that the **User** module is being handled by another team. It would be bad practice to duplicate the maintenance of users, as the information will quickly get out of sync. So instead of building the **User** module (which would include the authentication logic), you are to leverage the authentication services that the **User** team is working on.
That's great news because it saves you the trouble of having to write a lot of code to implement the **User** processing. Emboldened, you enthusiastically announce that you will quickly cobble up a function that will take user credentials and send them to the service that the **User** team has built.
Alas, your intentions get squashed again as you learn that the **User** team hasn't started building the **User authentication** service yet. They're still in the process of assigning user stories to the backlog. Disheartened, you resign to the fact that it will be at least a few days (if not weeks?) before you can start working on the **User authentication** story.
The scrum master then says that there is no reason to wait for the **User authentication** service to be built and deployed to testing. You could start developing the authentication functionality right away. But how can you do that?
The scrum master offers a simple suggestion: leverage service virtualization. Since all specifications for the **User** module have been solidified and signed off, you have a solid, non-volatile contract to build your solution against. The contract published by the **User** services team states that in order to authenticate a user, specific expectations must be fulfilled:
1. A client wishing to authenticate a user should send an **HTTP POST** request to the endpoint <http://some-domain.com/api/v1/users/login>.
2. The **HTTP POST** sent to the above endpoint must have a **JSON** payload that contains the user credentials (i.e., username and password).
3. Upon receiving the request, the service will attempt to log the user in. If the username and password match the information on record, the service will return an **HTTP** response containing status code 200 with the body of the response containing the message "User successfully logged in."
So, now that you know the contract details, you can start building the solution. Here's the code that connects to the endpoint, sends the **HTTP POST** request, and receives the **HTTP** response:
```
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace app {
    public class Authenticate {
        HttpClient client = [new][5] HttpClient();
        string endPoint = "<http://some-domain.com/api/v1/users/login>";
        public string Login(string credentials) {
            Task&lt;string&gt; response = CheckLogin(credentials);
            return response.Result;
        }
        private async Task&lt;string&gt; CheckLogin(string credentials) {
            var values = [new][5] Dictionary&lt;string, string&gt;{{"credentials", credentials}};
            var content = [new][5] FormUrlEncodedContent(values);
            var response = await client.PostAsync(endPoint, content);
            return await response.Content.ReadAsStringAsync();
        }
    }
}
```
This code won't work because <http://some-domain.com> does not exist (yet). Are you stuck now, waiting for the other team to eventually build and deploy that service?
Not really. Service virtualization to rescue! Let's pretend that the service is already there and continue the development.
### How to virtualize a service
One way to virtualize the **User authentication** service would be to write a new app (the new API) and run it locally. This API will mirror the contract specified by the real **User authentication** API and will only return hard-coded stubbed data (it will be a fake service).
Sounds like a good plan. Again, the team pushes back during the standup, questioning the need for writing, building, testing, and deploying a brand new app just to accomplish this fake functionality. It kind of wouldn't be worth the trouble because, by the time you deliver that new fake app, the other team would probably be ready with the real service.
So you've reached an impasse. It looks like you are forced to wait on your dependency to materialize. You've failed to control your dependencies; you now have no recourse but to work in a sequential fashion.
Not so fast! There is a great new tool called [mountebank][7] that is ideal for virtualizing any service. Using this tool, you can quickly stand up a local server that listens on a port you specify and takes orders. To make it simulate a service, you only have to tell it which port to listen to and which protocol to handle. The choice of protocols is:
* HTTP
* HTTPS
* SMTP
* TCP
In this case, you need the HTTP protocol. First, install mountebank—if you have **npm** on your computer, you can simply type on the command line:
```
`npm install -g mountebank`
```
After it's installed, run mountebank by typing:
```
`mb`
```
At startup, mountebank will show:
![mountebank startup][8]
Now you're ready to virtualize an HTTP service. In this case, the **User authentication** service expects to receive an HTTP POST request; here is how the implemented code sends an HTTP POST request:
```
`var response = await client.PostAsync(endPoint, content);`
```
You now have to establish that **endPoint**. Ideally, all virtualized services should be propped in the **localhost** server to ensure quick execution of integration tests.
To do that, you need to configure the **imposter**. In its bare-bones form, the **imposter** is a simple JSON collection of key-value pairs containing the definition of a port and a protocol:
```
{
    "port": 3001,
    "protocol": "http"
}
```
This imposter is configured to handle the HTTP protocol and to listen to incoming requests on port 3001.
Just listening to incoming HTTP requests on port 3001 is not going to do much. Once the request arrives at that port, mountebank needs to be told what to do with that request. In other words, you are virtualizing not only the availability of a service on a specific port but also the way that virtualized service is going to respond to the request.
To accomplish that level of service virtualization, you need to tell mountebank how to configure stubs. Each stub consists of two components:
1. A collection of predicates
2. A collection of expected responses
A predicate (sometimes called a matcher) narrows down the scope of the incoming request. For example, using the HTTP protocol, you can expect more than one type of method (e.g., GET, POST, PUT, DELETE, PATCH, etc.). In most service-virtualization scenarios, we are interested in simulating the behavior that is specific to a particular HTTP method. This scenario is about responding to the HTTP POST request, so you need to configure your stub to match on HTTP POST requests only:
```
{
    "port": 3001,
    "protocol": "http",
    "stubs": [
        {
            "predicates": [
                {
                    "equals": {
                        "method": "post"
                    }
                }
            ]
        }
    ]
}
```
This imposter defines one predicate that matches (using the keyword **equals**) on the HTTP POST request only.
Now take a closer look at the **endPoint** value, as defined in the implemented code:
```
`string endPoint = "http://localhost:3001/api/v1/users/login";`
```
In addition to listening to port 3001 (as defined in <http://localhost:3001>), the **endPoint** is more specific, in that it expects the incoming HTTP POST request to go to the /api/v1/users/login path. How do you tell mountebank to only match exactly on the /api/v1/users/login path? By adding the path key-value pair to the stub's predicate:
```
{
    "port": 3001,
    "protocol": "http",
    "stubs": [
        {
            "predicates": [
                {
                    "equals": {
                        "method": "post",
                        "path": "/api/v1/users/login"
                    }
                }
            ]
        }
    ]
}
```
This imposter now knows that HTTP requests arriving at port 3001 must be a POST method and must point at the /api/v1/users/login path. The only thing left to simulate is the expected HTTP response.
Add the response to the JSON imposter:
```
{
    "port": 3001,
    "protocol": "http",
    "stubs": [
        {
            "predicates": [
                {
                    "equals": {
                        "method": "post",
                        "path": "/api/v1/users/login"
                    }
                }
            ],
            "responses": [
                {
                    "is": {
                        "statusCode": 200,
                        "body": "Successful login."
                    }
                }
            ]
        }
    ]
}
```
With mountebank imposters, you define responses as a collection of JSON key-value pairs. In most cases, it is sufficient to simply state that a response is a **statusCode** and a **body**. This case is simulating the "happy path" response that has the status code **OK (200)** and the body containing a simple message **Successful login** (as specified in the acceptance criteria).
### How to run virtualized services?
OK, now that you have virtualized the **User authentication** service (at least its "happy path"), how do you run it?
Remember that you have already started mountebank, and it reported that it is running in memory as the <http://localhost> domain. Mountebank is listening on port 2525 and taking orders.
Great, now you have to tell mountebank that you have the imposter ready. How do you do that? Send an HTTP POST request to <http://localhost:2525/imposters>. The requests body must contain the JSON you created above. There are a few techniques available to send that request. If you're versed in [curl][9], using it to send HTTP POST requests would be the simplest, quickest way to stand up the imposter. But many people prefer a more user-friendly way to send the HTTP POST to mountebank.
The easy way to do that is to use [Postman][10]. If you download and install Postman, you can point it at <http://localhost:2525/imposters>, select the POST method from the pulldown menu, and copy and paste the imposter JSON into the raw body.
When you click Send, the imposter will be created, and you should get Status 201 (Created).
![Postman output][11]
Your virtualized service is now running! You can verify it by navigating to the **tests** folder and running the **dotnet test** command:
![dotnet test output][12]
### Conclusion
This demo shows how easy it is to remove blockages and control dependencies by simulating services you're dependent on. Mountebank is a fantastic tool that easily and cheaply simulates all kinds of very elaborate, sophisticated services.
In this installment, I just had time to illustrate how to virtualize a simple "happy path" service. If you go back to the actual user story, you will notice that its acceptance criteria contain several "less happy" paths (cases when someone is repeatedly trying to log in using invalid credentials). It's a bit trickier to properly virtualize and test those use cases, so I've left that exercise for the next installment in this series.
How will you use service virtualization to solve your testing needs? I would love to hear about it in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/service-virtualization-test-driven-development
作者:[Alex Bunardzic][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/alex-bunardzic
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
[2]: https://opensource.com/article/19/8/mutation-testing-evolution-tdd
[3]: https://opensource.com/article/19/9/mutation-testing-example-tdd
[4]: https://opensource.com/article/20/2/automate-unit-tests
[5]: http://www.google.com/search?q=new+msdn.microsoft.com
[6]: https://opensource.com/sites/default/files/uploads/dotnet-test.png (Output of dotnet.test)
[7]: http://www.mbtest.org/
[8]: https://opensource.com/sites/default/files/uploads/mountebank-startup.png (mountebank startup)
[9]: https://curl.haxx.se/
[10]: https://www.postman.com/
[11]: https://opensource.com/sites/default/files/uploads/status-201.png (Postman output)
[12]: https://opensource.com/sites/default/files/uploads/dotnet-test2.png (dotnet test output)

View File

@ -0,0 +1,219 @@
[#]: collector: (lujun9972)
[#]: translator: (qianmingtian)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Install and Use Wireshark on Ubuntu Linux)
[#]: via: (https://itsfoss.com/install-wireshark-ubuntu/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
Install and Use Wireshark on Ubuntu Linux
======
_**Brief: Youll learn to install the latest Wireshark on Ubuntu and other Ubuntu-based distribution in this tutorial. Youll also learn how to run Wireshark without sudo and how to set it up for packet sniffing.**_
[Wireshark][1] is a free and open-source network protocol analyzer widely used around the globe.
With Wireshark, you can capture incoming and outgoing packets of a network in real-time and use it for network troubleshooting, packet analysis, software and communication protocol development, and many more.
It is available on all major desktop operating systems like Windows, Linux, macOS, BSD and more.
In this tutorial, I will guide you to install Wireshark on Ubuntu and other Ubuntu-based distributions. Ill also show a little about setting up and configuring Wireshark to capture packets.
### Installing Wireshark on Ubuntu based Linux distributions
![][2]
Wireshark is available on all major Linux distributions. You should check out the [official installation instructions][3]. because in this tutorial, Ill focus on installing the latest Wireshark version on Ubuntu-based distributions only.
Wireshark is available in the Universe repository of Ubuntu. You can [enable universe repository][4] and then install it like this:
```
sudo add-apt-repository universe
sudo apt install wireshark
```
One slight problem in this approach is that you might not always get the latest version of Wireshark.
For example, in Ubuntu 18.04, if you [use the apt command][5] to check the available version of Wireshark, it is 2.6.
```
[email protected]:~$ apt show wireshark
Package: wireshark
Version: 2.6.10-1~ubuntu18.04.0
Priority: optional
Section: universe/net
Origin: Ubuntu
Maintainer: Balint Reczey <[email protected]>
```
However, [Wireshark 3.2 stable version][6] has been released months ago. New release brings new features, of course.
So, what do you do in such case? Thankfully, Wiresshark developers provide an official PPA that you can use to install the latest stable version of Wireshark on Ubuntu and other Ubuntu-based distributions.
I hope you are acquainted with PPA. If not, please [read our excellent guide on PPA to understand it completely][7].
Open a terminal and use the following commands one by one:
```
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt update
sudo apt install wireshark
```
Even if you have an older version of Wireshark installed, it will be updated to the newer version.
While installing, you will be asked whether to allow non-superusers to capture packets. Select Yes to allow and No to restrict non-superusers to capture packets &amp; finish the installation.
### Running Wireshark without sudo
If you have selected **No** in the previous installation, then run the following command as root:
```
sudo dpkg-reconfigure wireshark-common
```
And select **Yes** by pressing the tab key and then using enter key:
![][8]
Since you have allowed the non-superuser to capture packets, you have to add the user to wireshark group. Use the [usermod command][9] to add yourself to the wireshark group.
```
sudo usermod -aG wireshark $(whoami)
```
Finally, [restart your Ubuntu system][10] to make the necessary changes to your system.
Trivia
First released in 1998, Wireshark was initially known as Ethereal. Developers had to change its name to Wireshark in 2006 due to trademark issues.
### Starting Wireshark
Launching Wireshark application can be done from the application launcher or the CLI.
To start from CLI, just type **wireshark** on your console:
```
wireshark
```
From **GUI**, search for Wireshark application on the search bar and hit enter.
![][11]
Now lets play with Wireshark.
### Capturing packets using Wireshark
When you start Wireshark, you will see a list of interfaces that you can use to capture packets to and from.
There are many types of interfaces available which you can monitor using Wireshark such as, Wired, External devices, etc. According to your preference, you can choose to show specific types of interfaces in the welcome screen from the marked area in the given image below.
![Select interface][12]
For instance, I listed only the **Wired** network interfaces.
![][13]
Next, to start capturing packets, you have to select the interface (which in my case is ens33) and click on the **Start capturing packets** icon as marked in the image below.
![Start capturing packets with Wireshark][14]
You can also capture packets to and from multiple interfaces at the same time. Just press and hold the **CTRL** button while clicking on the interfaces that you want to capture to and from and then hit the **Start capturing packets** icon as marked in the image below.
![][15]
Next, I tried using **ping google.com** command in the terminal and as you can see, many packets were captured.
![Captured packets][16]
Now you can select on any packet to check that particular packet. After clicking on a particular packet you can see the information about different layers of TCP/IP Protocol associated with it.
![Packet info][17]
You can also see the RAW data of that particular packet at the bottom as shown in the image below.
![Check RAW data in the captured packets][18]
This is why end-to-end encryption is important
Imagine you are logging into a website that doesnt use HTTPS. Anyone on the same network as you can sniff the packets and see the user name and password in the RAW data.
This is why most chat applications use end to end encryption and most websites these days use https (instead of http).
#### Stopping packet capture in Wireshark
You can click on the red icon as marked in the given image to stop capturing Wireshark packets.
![Stop packet capture in Wireshark][19]
#### Save captured packets to a file
You can click on the marked icon in the image below to save captured packets to a file for future use.
![Save captured packets by Wireshark][20]
**Note**: _Output can be exported to XML, PostScript®, CSV, or plain text._
Next, select a destination folder, and type the file name and click on **Save**.
Then select the file and click on **Open**.
![][21]
Now you can open and analyze the saved packets anytime. To open the file, press **\ + o**
or go to **File &gt; Open** from Wireshark.
The captured packets should be loaded from the file.
![][22]
### Conclusion
Wireshark supports many different communication protocols. There are many options and features that provide you the power to capture and analyze the network packets in a unique way. You can learn more about Wireshark from their [official documentation][23].
I hope this detailed helped you to install Wireshark on Ubuntu. Please let me know your questions and suggestions.
![][24]
### Kushal Rai
A computer science student &amp; Linux and open source lover. He likes sharing knowledge for he believes technology shapes the perception of modern world. Kushal also loves music and photography.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-wireshark-ubuntu/
作者:[Community][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/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://www.wireshark.org/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1
[3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html
[4]: https://itsfoss.com/ubuntu-repositories/
[5]: https://itsfoss.com/apt-command-guide/
[6]: https://www.wireshark.org/news/20191218.html
[7]: https://itsfoss.com/ppa-guide/
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/yes.png?ssl=1
[9]: https://linuxhandbook.com/usermod-command/
[10]: https://itsfoss.com/schedule-shutdown-ubuntu/
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/wire.png?ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/interfaces.jpg?ssl=1
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/intoption.jpg?ssl=1
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/singleinterface.jpg?ssl=1
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/selint.jpg?ssl=1
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/capture.jpg?ssl=1
[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/packetinfo.png?ssl=1
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/raw.png?ssl=1
[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/stopcapture.png?ssl=1
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/savepackets.jpg?ssl=1
[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/savename.jpg?ssl=1
[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openpacket.png?ssl=1
[23]: https://www.wireshark.org/docs/https://www.wireshark.org/docs/
[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/kushal_rai.jpg?ssl=1

View File

@ -0,0 +1,105 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Add New Brushes in GIMP [Quick Tip])
[#]: via: (https://itsfoss.com/add-brushes-gimp/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
如何在 GIMP 中添加新画笔(快速技巧)
======
[GIMP][1] 是最流行的免费和开源图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。
当你[在 Ubuntu 或其他任何操作系统上安装了 GIMP 后][3],你会发现已经安装了一些用于基本图像编辑的画笔。如果你需要更具体的画笔,你可以随时在 GIMP 中添加新画笔。
怎么样?让我在这个快速教程中向你展示。
### 如何在 GIMP 中添加画笔
![][4]
在 GIMP 中安装新画笔需要三个步骤:
* 获取新画笔
* 将其放入指定的文件夹中
* 刷新 GIMP 中的画笔
#### 步骤 1下载新的 GIMP 画笔
第一步是获取新的 GIMP 画笔。你从哪里获取?当然是从互联网上。
你可以在 Google 或[隐私搜索引擎,如 Duck Duck Go][5] 种搜索 “GIMP画笔”并从网站下载一个你喜欢的。
GIMP 画笔通常以 .gbr 和 .gih 文件格式提供。.gbr 文件用于常规画笔,而 .gih 用于动画画笔。
你知道吗?
从 2.4 版本起GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。
请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。
#### 步骤 2将新画笔复制到它的位置
获取画笔文件后,下一步是复制该文件并将其粘贴到 GIMP 配置目录中所在的文件夹。
**Windows** 上,你必须进入类似 “**C:\Documents and Settings\myusername.gimp-2.10\brushes**” 这样的文件夹。
我将展示 **Linux** 上的详细步骤,因为 Its FOSS 是一个专注于 Linux 的网站。
选择画笔文件后,在 **Home** 目录中按下 **Ctrl+h** [查看 Linux 中的隐藏文件][6]。
![Press Ctrl+H to see hidden files in the home directory][7]
你应该进入 **.config/GIMP/2.10/brushes** 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 .config/GIMP 下看到相应文件夹。
![Adding New Brushes in GIMP][8]
将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 **Ctrl+h** 来隐藏隐藏的文件。
#### 步骤 3刷新画笔避免重启 GIMP
GIMP 将在启动时自动加载画笔。如果已在运行,并且不想关闭它,你可以刷新画笔。
在 GIMP 的主菜单中找到 **Windows**-&gt;**Dockable Dialogues**-&gt;**Brushes**。
![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9]
在右侧栏的 **Brushes** 对话框中找到**刷新**图标。
![Refresh GIMP Brushes][10]
如果你的画笔没有出现,那么你可以试试重启 GIMP。
额外的技巧!
在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。
我希望你喜欢这个快速 GIMP 技巧。敬请期待更多。
--------------------------------------------------------------------------------
via: https://itsfoss.com/add-brushes-gimp/
作者:[Community][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://www.gimp.org/
[2]: https://itsfoss.com/open-source-photoshop-alternatives/
[3]: https://itsfoss.com/gimp-2-10-release/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1
[5]: https://itsfoss.com/privacy-search-engines/
[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1
[11]: https://itsfoss.com/add-watermark-gimp-linux/

View File

@ -0,0 +1,131 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop)
[#]: via: (https://itsfoss.com/drauger-os/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Drauger OS Linux 旨在为台式机带来主机游戏体验
======
多年来(或数十年),人们抱怨不[使用Linux][1] 的原因之一是缺乏主流游戏。[Linux 上的游戏][2]在最近几年有了显著改进,特别是 [Steam Proton][3] 项目的引入使你可以[在 Linux 上玩很多 Windows 专用的游戏][4]。
这也鼓励了一些[以游戏为中心的 Linux发行版][5]。以 [Lakka][6] 为例,你可以[借助 Lakka Linux 将旧计算机变成复古的街机游戏机][7]。
另一个以游戏为中心的 Linux 发行版是 [Draguer OS][8],我们今天将对其进行研究。
### Drauger OS
根据[该项目的网站][9]“Drauger OS 是 Linux 桌面游戏操作系统。它旨在为游戏玩家提供一个平台,使他们可以在不牺牲安全性的情况下获得出色的性能。此外,它旨在使任何人都可以轻松玩游戏,无论他们使用键盘和鼠标还是某种控制器。”
他们强调 Drauger OS 并非供日常使用。因此,大多数其他发行版附带的许多生产力工具都不在 Drauger OS 中。
![Drauger OS 7.4.1][10]
Drauger OS [基于][9] Ubuntu 之上。当前版本7.4.1 Jiangshi使用 “[Liquorix][11] 低延迟Linux 内核,这是一种预编译的 ZEN 内核,设计时考虑了延迟和吞吐量之间的平衡”。但是,这将在下一版本中更改。他们只有一个桌面环境可供选择,即一个修改版本的 [Xfce][12]。
Drauger OS 开箱即用地安装了多个应用程序和工具,以改善游戏体验。这些包括:
* [PlayOnLinux][13]
* WINE
* [Lutris][14]
* Steam
* [DXVK][15]
它还具有一组与游戏无关的有趣工具。[Drauger Installer][16] 是 .deb 安装程序,是 Gdebi 的替代品。[多软件库应用安装器][17]mrai是“用于基于 Debian 的 Linux 操作系统的类似于 AUR-helper 的脚本”。Mrai 旨在与 apt、snap、flatpaks 配合使用,并且可以从 GitHub 安装应用程序。
有趣的是Drauger OS 的名称是一个错误。首席开发者 [Thomas Castleman][18](即 batcastle曾打算为其发行版命名为 Draugr但是却打错了名字。在 Drauger OS 播客的[第 23 集][19]中Castleman 说保持这个拼写错误的名称,因为要对其进行更正需要大量工作。根据 [Wikipedia][20] 的描述Draugr 是“来自北欧神话中的不死生物”。
是的你没看错。Drauger OS 是仅有的几个具有自己的[播客][21]的发行版之一。当被问到这个问题时Castleman 告诉我:“无论他们的情况如何,我都希望确保我们的社区拥有最大的透明度。”多数情况下,播客是 Drauger OS 博客的音频版本,但有时他们会在没有时间撰写博客文章时使用它来发布公告。
### Drauger OS 的未来
![Drauger OS][22]
Druager OS 背后的开发人员正在开发其下一个主要版本7.5.1。此版本将基于 Ubuntu 19.10。将有三个主要变化。首先,将使用“我们内部构建的内核” [替换][23] Liquorix 内核。该内核将基于 Linux Kernel GitHub 存储库,“因此,它变得越来越原汁原味”。
新版本的第二个主要变化将是为其桌面提供新布局。根据用户的反馈,他们决定将其更改为看起来更类似于 GNOME 的样子。
第三,他们放弃了 SystemBack 作为其备份工具和安装程序。相反,他们从头开始编写了新的[安装程序][24]。
开发团队也正在研究 Drauger OS 的 [ARM 版本][25]。他们希望在 2022 年的某个时候发布它。
### 系统要求
Drauger OS [系统要求][25]非常适中。请记住Drauger OS 仅在 64 位系统上运行。
#### 最低系统要求
* CPU双核、1.8GHz、64 位处理器
* RAM1 GB
* 储存空间16 GB
* 图形处理器:集成
* 屏幕分辨率60Hz 时为 1024×768
* 外部端口1 个用于显示的端口HDMI/DisplayPort/VGA/DVI2 个用于安装 USB 驱动器和键盘的 USB 端口(鼠标可选,但建议使用)
  
#### 推荐系统要求
* CPU四核、2.2Ghz、64 位处理器
* RAM4 GB
* 储存空间128 GB
* 图形处理器NVIDIA GTX 1050、AMD RX 460 或同等显卡
* 屏幕分辨率60Hz 时为 1080p
* 外部端口1 个用于显示的端口HDMI/DisplayPort/VGA/DVI3 个用于安装 USB 驱动器、键盘和鼠标的 USB 端口1 个音频输出端口
### 如何为Drauger OS提供帮助
如果你有兴趣,可以通过多种方法来帮助 Drauger OS。他们一直在寻找[财政支持][26]以保持发展。
如果你想贡献代码,他们正在寻找具有 BASH、C++ 和 Python 经验的人员。他们所有的代码都在 [GitHub][27] 上。你也可以在社交媒体上[联系][28]他们。
### 结语
Drauger OS 只是这类项目之一。我还见过其他[面向游戏的发行版][29],但 Drauger OS 在专注于游戏方面一心一意。由于我更喜欢休闲游戏,因此该发行版对我个人而言并不具有吸引力。但是,我可以看到它如何吸引游戏爱好者使用 Linux。祝他们在以后的发行中好运。
你对这个仅限于游戏的发行版有何想法?你最喜欢的 Linux 游戏解决方案是什么?请在下面的评论中告诉我们。
--------------------------------------------------------------------------------
via: https://itsfoss.com/drauger-os/
作者:[John Paul][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://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/why-use-linux/
[2]: https://itsfoss.com/linux-gaming-guide/
[3]: https://itsfoss.com/steam-play-proton/
[4]: https://itsfoss.com/steam-play/
[5]: https://itsfoss.com/linux-gaming-distributions/
[6]: http://www.lakka.tv/
[7]: https://itsfoss.com/lakka-retrogaming-linux/
[8]: https://draugeros.org/go/
[9]: https://www.draugeros.org/go/about/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1
[11]: https://liquorix.net/
[12]: https://www.xfce.org/
[13]: https://www.playonlinux.com/en/
[14]: https://lutris.net/
[15]: https://github.com/doitsujin/dxvk
[16]: https://github.com/drauger-os-development/drauger-installer
[17]: https://github.com/drauger-os-development/mrai
[18]: https://github.com/Batcastle
[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47
[20]: https://en.wikipedia.org/wiki/Draugr
[21]: https://anchor.fm/drauger-os
[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1
[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/
[24]: https://github.com/drauger-os-development/system-installer
[25]: https://www.draugeros.org/go/system-requirements/
[26]: https://www.draugeros.org/go/contribute/
[27]: https://github.com/drauger-os-development
[28]: https://www.draugeros.org/go/contact-us/
[29]: https://itsfoss.com/manjaro-gaming-linux/
[30]: https://reddit.com/r/linuxusersgroup