mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-06 23:50:16 +08:00
commit
6435c5e329
@ -1,5 +1,5 @@
|
|||||||
[#]: collector: (lujun9972)
|
[#]: collector: (lujun9972)
|
||||||
[#]: translator: ( )
|
[#]: translator: (liujing97)
|
||||||
[#]: reviewer: ( )
|
[#]: reviewer: ( )
|
||||||
[#]: publisher: ( )
|
[#]: publisher: ( )
|
||||||
[#]: url: ( )
|
[#]: url: ( )
|
||||||
@ -350,7 +350,7 @@ via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux
|
|||||||
|
|
||||||
作者:[Magesh Maruthamuthu][a]
|
作者:[Magesh Maruthamuthu][a]
|
||||||
选题:[lujun9972][b]
|
选题:[lujun9972][b]
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
译者:[liujing97](https://github.com/liujing97)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
@ -0,0 +1,158 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (9 features developers should know about Selenium IDE)
|
||||||
|
[#]: via: (https://opensource.com/article/19/4/features-selenium-ide)
|
||||||
|
[#]: author: (Al Sargent https://opensource.com/users/alsargent)
|
||||||
|
|
||||||
|
9 features developers should know about Selenium IDE
|
||||||
|
======
|
||||||
|
The new Selenium IDE brings the benefits of functional test automation
|
||||||
|
to many IT professionals—and to frontend developers specifically.
|
||||||
|
![magnifying glass on computer screen][1]
|
||||||
|
|
||||||
|
There has long been a stigma associated with using record-and-playback tools for testing rather than scripted QA automation tools like [Selenium Webdriver][2], [Cypress][3], and [WebdriverIO][4].
|
||||||
|
|
||||||
|
Record-and-playbook tools are perceived to suffer from many issues, including a lack of cross-browser support, no way to run scripts in parallel or from CI build scripts, poor support for responsive web apps, and no way to quickly diagnose frontend bugs.
|
||||||
|
|
||||||
|
Needless to say, it's been somewhat of a rough road for these tools, and after Selenium IDE [went end-of-life][5] in 2017, many thought the road for record and playback would end altogether.
|
||||||
|
|
||||||
|
Well, it turns out this perception was wrong. Not long after the Selenium IDE project was discontinued, my colleagues at [Applitools approached the Selenium open source community][6] to see how they could help.
|
||||||
|
|
||||||
|
Since then, much of Selenium IDE's code has been revamped. The code is now freely available on GitHub under an Apache 2.0 license, managed by the Selenium community, and supported by [two full-time engineers][7], one of whom literally wrote the book on [Selenium testing][8].
|
||||||
|
|
||||||
|
![Selenium IDE's GitHub repository][9]
|
||||||
|
|
||||||
|
The new Selenium IDE brings the benefits of functional test automation to many IT professionals—and to frontend developers specifically. Here are nine things developers should know about the new Selenium IDE.
|
||||||
|
|
||||||
|
### 1\. Selenium IDE is now cross-browser
|
||||||
|
|
||||||
|
When the record-and-playback tool first came out in 2006, Firefox was the shiny new browser it hitched its wagon to, and it remained that way for a decade. No more! Selenium IDE is now available as a [Google Chrome Extension][10] and [Firefox Add-on][11].
|
||||||
|
|
||||||
|
Even better, Selenium IDE can run its tests on Selenium WebDriver servers by using Selenium IDE's new command-line test runner, [SIDE Runner][12]. SIDE Runner blends elements of Selenium IDE and Selenium Webdriver. It takes a Selenium IDE script, saved as a [**.side** file][13], and runs it using browser drivers such as [ChromeDriver][14], [EdgeDriver][15], Firefox's [Geckodriver][16], [IEDriver][17], and [SafariDriver][18].
|
||||||
|
|
||||||
|
SIDE Runner and the other drivers above are available as [straightforward npm installs][12]. Here's what it looks like in action.
|
||||||
|
|
||||||
|
![SIDE Runner][19]
|
||||||
|
|
||||||
|
### 2\. No more brittle functional tests
|
||||||
|
|
||||||
|
For years, brittle tests have been an issue for functional tests—whether you record them or code them by hand. Now that developers are releasing new features more frequently, their user interface (UI) code is constantly changing as well. When a UI changes, object locators often change, too.
|
||||||
|
|
||||||
|
Selenium IDE fixes that by capturing multiple object locators when you record your script. During playback, if Selenium IDE can't find one locator, it tries each of the other locators until it finds one that works. Your test will fail only if none of the locators work. This doesn't guarantee scripts will always play back, but it does insulate scripts against numerous changes. As you can see below, Selenium IDE captures linkText, an xPath expression, and CSS-based locators.
|
||||||
|
|
||||||
|
![Selenium IDE captures linkText, an xPath expression, and CSS-based locators][20]
|
||||||
|
|
||||||
|
### 3\. Conditional logic to handle UI features
|
||||||
|
|
||||||
|
When testing web apps, scripts have to handle intermittent UI elements that can randomly appear in your app. These come in the form of cookie notices, popups for special offers, quote requests, newsletter subscriptions, paywall notifications, adblocker requests, and more.
|
||||||
|
|
||||||
|
Conditional logic is a great way to handle these intermittent UI features. Developers can easily insert conditional logic—also called control flow—into Selenium IDE scripts. [Here are details][21] and how it looks.
|
||||||
|
|
||||||
|
![Selenium IDE's Conditional logic][22]
|
||||||
|
|
||||||
|
### 4\. Support for embedded code
|
||||||
|
|
||||||
|
As broad as the new [Selenium IDE API][23] is, it doesn't do everything. For this reason, Selenium IDE has **[**execute** **script**][24]** and **[execute async script][25]** commands that let your script call a JavaScript snippet.
|
||||||
|
|
||||||
|
This provides developers with a tremendous amount of flexibility to take advantage of JavaScript's flexibility and wide range of libraries. To use it, click on the test step where you want JavaScript to run, choose **Insert New Command** , and enter **execute script** or **execute async script** in the command field, as shown below.
|
||||||
|
|
||||||
|
![Selenium IDE's command line][26]
|
||||||
|
|
||||||
|
### 5\. Selenium IDE runs from CI build scripts
|
||||||
|
|
||||||
|
Because SIDE Runner is called from the command line, you can easily fit it into CI build scripts, so long as the CI server can call **selenium-ide-runner** and upload the **.side** file (the test script) as a build artifact. For example, here's how to upload an input file in [Jenkins][27], [Travis][28], and [CircleCI][29].
|
||||||
|
|
||||||
|
This means Selenium IDE can be better integrated into the software development technology stack. In addition, the scripts created by less-technical QA team members—including business analysts—can run with every build. This helps better align QA with the developer so fewer bugs escape into production.
|
||||||
|
|
||||||
|
### 6\. Support for third-party plugins
|
||||||
|
|
||||||
|
Imagine companies building plugins to have Selenium IDE do all kinds of things, like uploading scripts to a functional testing cloud, a load testing cloud, or a production application monitoring service.
|
||||||
|
|
||||||
|
Plenty of companies have integrated Selenium Webdriver into their offerings, and I bet the same will happen with Selenium IDE. You can also [build your own Selenium IDE plugin][30].
|
||||||
|
|
||||||
|
### 7\. Visual UI testing
|
||||||
|
|
||||||
|
Speaking of new plugins, Applitools introduced a new Selenium IDE plugin to add artificial intelligence-powered visual validations to the equation. Available through the [Chrome][31] and [Firefox][32] stores via a three-second install, just plug in the Applitools API key and go.
|
||||||
|
|
||||||
|
Visual checkpoints are a great way to ensure a UI renders correctly. Rather than a bunch of assert statements on all the UI elements—which would be a pain to maintain—one visual checkpoint checks all your page elements.
|
||||||
|
|
||||||
|
Best of all, visual AI looks at a web app the same way a human does, ignoring minor differences. This means fewer fake bugs to frustrate a development team.
|
||||||
|
|
||||||
|
### 8\. Visually test responsive web apps
|
||||||
|
|
||||||
|
When testing the visual layout of [responsive web apps][33], it's best to do it on a wide range of screen sizes (also called viewports) to ensure nothing appears out of whack. It's all too easy for responsive web bugs to creep in, and when they do, the problems can range from merely cosmetic to business stopping.
|
||||||
|
|
||||||
|
When you use visual UI testing for Selenium IDE, you can visually test your webpages on the Applitools [Visual Grid][34], which has more than 100 combinations of browsers, emulated devices, and viewport sizes.
|
||||||
|
|
||||||
|
Once tests run on the Visual Grid, developers can easily check the test results on all the various combinations.
|
||||||
|
|
||||||
|
![Selenium IDE's Visual Grid][35]
|
||||||
|
|
||||||
|
### 9\. Responsive web bugs have nowhere to hide
|
||||||
|
|
||||||
|
Selenium IDE can help pinpoint the cause of frontend bugs. Every Selenium IDE script that's run with the Visual Grid can be analyzed with Applitools' [Root Cause Analysis][36]. It's no longer enough to find a bug—developers also need to fix it.
|
||||||
|
|
||||||
|
When a visual bug is discovered, it can be clicked on and just the relevant (not all) Document Object Model (DOM) and CSS differences will be displayed.
|
||||||
|
|
||||||
|
![Finding visual bugs][37]
|
||||||
|
|
||||||
|
In summary, much like many emerging technologies in software development, Selenium IDE is part of a larger trend of making life easier and simpler for technical professionals and enabling them to spend more time and effort on creating code for even faster feedback.
|
||||||
|
|
||||||
|
* * *
|
||||||
|
|
||||||
|
_This article is based on[16 reasons why to use Selenium IDE in 2019 (and 2 why not)][38] originally published on the Applitools blog._
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/19/4/features-selenium-ide
|
||||||
|
|
||||||
|
作者:[Al Sargent][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/alsargent
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen)
|
||||||
|
[2]: https://www.seleniumhq.org/projects/webdriver/
|
||||||
|
[3]: https://www.cypress.io/
|
||||||
|
[4]: https://webdriver.io/
|
||||||
|
[5]: https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/
|
||||||
|
[6]: https://seleniumhq.wordpress.com/2018/08/06/selenium-ide-tng/
|
||||||
|
[7]: https://github.com/SeleniumHQ/selenium-ide/graphs/contributors
|
||||||
|
[8]: http://davehaeffner.com/
|
||||||
|
[9]: https://opensource.com/sites/default/files/uploads/selenium_ide_github_graphic_1.png (Selenium IDE's GitHub repository)
|
||||||
|
[10]: https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd
|
||||||
|
[11]: https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/
|
||||||
|
[12]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/command-line-runner/
|
||||||
|
[13]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/command-line-runner/#launching-the-runner
|
||||||
|
[14]: http://chromedriver.chromium.org/
|
||||||
|
[15]: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
|
||||||
|
[16]: https://github.com/mozilla/geckodriver
|
||||||
|
[17]: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
|
||||||
|
[18]: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
|
||||||
|
[19]: https://opensource.com/sites/default/files/uploads/selenium_ide_side_runner_2.png (SIDE Runner)
|
||||||
|
[20]: https://opensource.com/sites/default/files/uploads/selenium_ide_linktext_3.png (Selenium IDE captures linkText, an xPath expression, and CSS-based locators)
|
||||||
|
[21]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/control-flow/
|
||||||
|
[22]: https://opensource.com/sites/default/files/uploads/selenium_ide_conditional_logic_4.png (Selenium IDE's Conditional logic)
|
||||||
|
[23]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/
|
||||||
|
[24]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/#execute-script
|
||||||
|
[25]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/#execute-async-script
|
||||||
|
[26]: https://opensource.com/sites/default/files/uploads/selenium_ide_command_line_5.png (Selenium IDE's command line)
|
||||||
|
[27]: https://stackoverflow.com/questions/27491789/how-to-upload-a-generic-file-into-a-jenkins-job
|
||||||
|
[28]: https://docs.travis-ci.com/user/uploading-artifacts/
|
||||||
|
[29]: https://circleci.com/docs/2.0/artifacts/
|
||||||
|
[30]: https://www.seleniumhq.org/selenium-ide/docs/en/plugins/plugins-getting-started/
|
||||||
|
[31]: https://chrome.google.com/webstore/detail/applitools-for-selenium-i/fbnkflkahhlmhdgkddaafgnnokifobik
|
||||||
|
[32]: https://addons.mozilla.org/en-GB/firefox/addon/applitools-for-selenium-ide/
|
||||||
|
[33]: https://en.wikipedia.org/wiki/Responsive_web_design
|
||||||
|
[34]: https://applitools.com/visualgrid
|
||||||
|
[35]: https://opensource.com/sites/default/files/uploads/selenium_ide_visual_grid_6.png (Selenium IDE's Visual Grid)
|
||||||
|
[36]: https://applitools.com/root-cause-analysis
|
||||||
|
[37]: https://opensource.com/sites/default/files/uploads/seleniumice_rootcauseanalysis_7.png (Finding visual bugs)
|
||||||
|
[38]: https://applitools.com/blog/why-selenium-ide-2019
|
@ -0,0 +1,97 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (5 open source tools for teaching young children to read)
|
||||||
|
[#]: via: (https://opensource.com/article/19/4/early-literacy-tools)
|
||||||
|
[#]: author: (Laura B. Janusek https://opensource.com/users/lbjanusek)
|
||||||
|
|
||||||
|
5 open source tools for teaching young children to read
|
||||||
|
======
|
||||||
|
Early literacy apps give kids a foundation in letter recognition,
|
||||||
|
alphabet sequencing, word finding, and more.
|
||||||
|
![][1]
|
||||||
|
|
||||||
|
Anyone who sees a child using a tablet or smartphone observes their seemingly innate ability to scroll through apps and swipe through screens, flexing those "digital native" muscles. According to [Common Sense Media][2], the percentage of US households in which 0- to 8-year-olds have access to a smartphone has grown from 52% in 2011 to 98% in 2017. While the debates around age guidelines and screen time surge, it's hard to deny that children are developing familiarity and skills with technology at an unprecedented rate.
|
||||||
|
|
||||||
|
This rise in early technical literacy may be astonishing, but what about _traditional_ literacy, the good old-fashioned ability to read? What does the intersection of early literacy development and early tech use look like? Let's explore some open source tools for early learners that may help develop both of these critical skill sets.
|
||||||
|
|
||||||
|
### Balancing risks and rewards
|
||||||
|
|
||||||
|
But first, a disclaimer: Guidelines for technology use, especially for young children, are [constantly changing][3]. Organizations like the American Academy of Pediatrics, Common Sense Media, Zero to Three, and PBS Kids are continually conducting research and publishing recommendations. One position that all of these and other organizations can agree on is that plopping a child in front of a screen with unmonitored content for an unlimited set of time is highly inadvisable.
|
||||||
|
|
||||||
|
Even setting kids up with educational content or tools for extended periods of time may have risks. And on the flip side, research on the benefits of education technologies is often limited or unavailable. In short, there are many cases in which we don't know for certain if educational technology use at a young age is beneficial, detrimental, or simply neutral.
|
||||||
|
|
||||||
|
But if screen time is available to your child or student, it's logical to infer that educational resources would be preferable over simpler pop-the-bubble or slice-the-fruit games or platforms that could house inappropriate content or online predators. While we may not be able to prove that education apps will make a child's test scores soar, we can at least take comfort in their generally being safer and more age-appropriate than the internet at large.
|
||||||
|
|
||||||
|
That said, if you're open to exploring early-education technologies, there are many reasons to look to open source options. Open source technologies are not only free but open to collaborative improvement. In many cases, they are created by developers who are educators or parents themselves, and they're a great way to avoid in-app purchases, advertisements, and paid upgrades. Open source programs can often be downloaded and installed on your device and accessed without an internet connection. Plus, the idea of [open source in education][4] is a growing trend, and there are countless resources to [learn more][5] about the concept.
|
||||||
|
|
||||||
|
But for now, let's check out some open source tools for early literacy in action!
|
||||||
|
|
||||||
|
### Childsplay
|
||||||
|
|
||||||
|
![Childsplay screenshot][6]
|
||||||
|
|
||||||
|
Let's start simple. [Childsplay][7], licensed under the GPLv2, is the most basic of the resources on this list. It's a compilation of just over a dozen educational games for young learners, four of which are specific to letter recognition, including memory games and an activity where the learner identifies a spoken letter.
|
||||||
|
|
||||||
|
### eduActiv8
|
||||||
|
|
||||||
|
![eduActiv8 screenshot][8]
|
||||||
|
|
||||||
|
[eduActiv8][9] started in 2011 as a personal project for the developer's son, "whose thirst for learning and knowledge inspired the creation of this educational program." It includes activities for building basic math and early literacy skills, including a variety of spelling, matching, and listening activities. Games include filling in missing letters in the alphabet, unscrambling letters to form a word, matching words to images, and completing mazes by connecting letters in the correct order. eduActiv8 was written in [Python][10] and is available under the GPLv3.
|
||||||
|
|
||||||
|
### GCompris
|
||||||
|
|
||||||
|
![GCompris screenshot][11]
|
||||||
|
|
||||||
|
[GCompris][12] is an open source behemoth (licensed under the GPLv3) of early educational activities. A French software engineer started it in 2000, and it now includes over 130 educational games in nearly 20 languages. Tailored for learners under age 10, it includes activities for letter recognition and drawing, alphabet sequencing, vocabulary building, and games like hangman to identify missing letters in words, plus activities for learning braille. It also includes games in math and music, plus classics from tic-tac-toe to chess.
|
||||||
|
|
||||||
|
### Feed the Monster
|
||||||
|
|
||||||
|
![Feed the Monster screenshot][13]
|
||||||
|
|
||||||
|
The quality of the playful "monster" graphics in [Feed the Monster][14] definitely sets it apart from the others on this list, plus it supports nearly 40 languages! The app includes activities for sorting letters to form words, memory games to match words to images, and letter-tracing writing activities. The app is developed by Curious Learning, which states: "We create, localize, distribute, and optimize open source mobile software so every child can learn to read." While Feed the Monster's offerings are geared toward early readers, Curious Mind's roadmap suggests it's headed towards a more robust personalized literacy platform growing on a foundation of research with MIT, Tufts, and Georgia State University.
|
||||||
|
|
||||||
|
### Syntax Untangler
|
||||||
|
|
||||||
|
![Syntax Untangler screenshot][15]
|
||||||
|
|
||||||
|
[Syntax Untangler][16] is the outlier of this group. Developed by a technologist at the University of Wisconsin–Madison under the GPLv2, the application is "particularly designed for training language learners to recognize and parse linguistic features." Examples show the software being used for foreign language learning, but anyone can use it to create language identification games, including games for early literacy activities like letter recognition. It could also be applied to later literacy skills, like identifying parts of speech in complex sentences or literary techniques in poetry or fiction.
|
||||||
|
|
||||||
|
### Wrapping up
|
||||||
|
|
||||||
|
Access to [literary environments][17] has been shown to impact literacy and attitudes towards reading. Why not strive to create a digital literary environment for our kids by filling our devices with educational technologies, just like our shelves are filled with books?
|
||||||
|
|
||||||
|
Now it's your turn! What open source literacy tools have you used? Comment below to share.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/19/4/early-literacy-tools
|
||||||
|
|
||||||
|
作者:[Laura B. Janusek][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/lbjanusek
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_kid_education.png?itok=3lRp6gFa
|
||||||
|
[2]: https://www.commonsensemedia.org/research/the-common-sense-census-media-use-by-kids-age-zero-to-eight-2017?action
|
||||||
|
[3]: https://www.businessinsider.com/smartphone-use-young-kids-toddlers-limits-science-2018-3
|
||||||
|
[4]: /article/18/1/best-open-education
|
||||||
|
[5]: https://opensource.com/resources/open-source-education
|
||||||
|
[6]: https://opensource.com/sites/default/files/uploads/cp_flashcards.gif (Childsplay screenshot)
|
||||||
|
[7]: http://www.childsplay.mobi/
|
||||||
|
[8]: https://opensource.com/sites/default/files/uploads/eduactiv8.jpg (eduActiv8 screenshot)
|
||||||
|
[9]: https://www.eduactiv8.org/
|
||||||
|
[10]: /article/17/11/5-approaches-learning-python
|
||||||
|
[11]: https://opensource.com/sites/default/files/uploads/gcompris2.png (GCompris screenshot)
|
||||||
|
[12]: https://gcompris.net/index-en.html
|
||||||
|
[13]: https://opensource.com/sites/default/files/uploads/feedthemonster.png (Feed the Monster screenshot)
|
||||||
|
[14]: https://www.curiouslearning.org/
|
||||||
|
[15]: https://opensource.com/sites/default/files/uploads/syntaxuntangler.png (Syntax Untangler screenshot)
|
||||||
|
[16]: https://courses.dcs.wisc.edu/untangler/
|
||||||
|
[17]: http://www.jstor.org/stable/41386459
|
@ -0,0 +1,86 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (Streaming internet radio with RadioDroid)
|
||||||
|
[#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player)
|
||||||
|
[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen)
|
||||||
|
|
||||||
|
Streaming internet radio with RadioDroid
|
||||||
|
======
|
||||||
|
Listen to your favorite internet radio stations over your home stereo
|
||||||
|
with this easy setup.
|
||||||
|
![woman programming][1]
|
||||||
|
|
||||||
|
Online news outlets have recently lamented the [passing of Google's Chromecast Audio device][2]. The device received [favorable reviews][3] in the audio press, so I had already been thinking about acquiring one. Given the news of Chromecast's demise, I decided to look for one at a reasonable price—before they were all snapped up or thrown in the dumpster.
|
||||||
|
|
||||||
|
I found one at [MobileFun][4] and put in my order. The device eventually arrived, packaged in the usual serviceable but minimal Google wrapping, with a very brief Get Started guide printed on the outside.
|
||||||
|
|
||||||
|
![Google Chromecast Audio][5]
|
||||||
|
|
||||||
|
I cabled it to my home stereo via my digital-analog converter's optical S/PDIF connection, hoping that would provide the best sound quality.
|
||||||
|
|
||||||
|
The setup ran flawlessly, and in about five minutes I was ready to play some tunes. I knew that a number of Android applications support Chromecast, so I decided to test it out with Google Play Music; sure enough, it worked just fine and sounded quite good. However, being an open source kind of person, I decided to see what I could find in the way of open source players that work with Chromecast.
|
||||||
|
|
||||||
|
### RadioDroid to the rescue
|
||||||
|
|
||||||
|
The [RadioDroid Android application][6] fit the bill. It is open source and available on [GitHub][7], Google Play, and [F-Droid][8]. According to the documentation, RadioDroid looks up and plays streams from the [Community Radio Browser][9] website. So I decided to install it on my handset and give it a shot.
|
||||||
|
|
||||||
|
![RadioDroid][10]
|
||||||
|
|
||||||
|
The installation was quick and smooth, and RadioDroid opened rapidly to display local stations. You can see the Chromecast button (the icon that looks like a rectangle with wavefronts) near the top-right side of this screenshot.
|
||||||
|
|
||||||
|
I played around with a few of the local stations. The application reliably played music on my handset's speaker, but I had to futz around with the Chromecast button to get the music to stream over the Chromecast. But stream it did!
|
||||||
|
|
||||||
|
I decided to seek out my favorite internet radio station, [Radio Grenouille][11] in Marseille, France. There are various ways to find stations in RadioDroid. One is to use the tabs—Local, Topclick, etc.—located above the list of stations. One of the tabs is Countries; I found France, with some 1,500 stations, on the list and scrolled—and scrolled, and scrolled—down through the list to find Radio Grenouille. Another way is to use the Search button at the top of the screen; the search was rapid and returned that wonderful radio station. I tried a few other searches, and they all returned reasonable info.
|
||||||
|
|
||||||
|
Going back to the Local tab, I scrolled through the listings and learned that "local" seems to be defined as "in the same country." So, even though Seattle, Portland, San Francisco, Los Angeles, and Juneau are closer to my home than Toronto, I didn't see any of them in Local. However, by using Search, I could find all stations with "Seattle" in their name.
|
||||||
|
|
||||||
|
The Languages tab let me find all stations broadcasting in Portugues, Portuguese, Português, Português Brasil, Português do Brasil, Portuguẽs, and Portugês. I quickly found another favorite station, [91 Rock Curitiba][12].
|
||||||
|
|
||||||
|
Then inspiration struck—it's springtime, but who cares? Let's listen to some Christmas music. And sure enough, searching for Christmas led me to [181.FM – Christmas Blender][13]. Well, a minute or two of that was enough for me…
|
||||||
|
|
||||||
|
So, all in all, I recommend the RadioDroid and Chromecast combo as a nice way to play internet radio on a home stereo at a reasonable cost.
|
||||||
|
|
||||||
|
### As for the music…
|
||||||
|
|
||||||
|
Recently I picked up an interesting album of very ambient (even beatless) music called [Continuum One][14] by [Qua Continuum][15] from the [Blue Coast Music][16] store. Blue Coast has a lot to offer the open source music enthusiast: music is available by download (and sometimes physical format) without resorting to those grotesque platform-specific download managers; it typically provides several formats, including WAV, FLAC, and DSD; different word lengths and bitrates are provided for WAV and FLAC, including 16/44.1, 24/96, and 24/192, and for DSD, 2.8, 5.6, and 11.2 MHz; and the music is recorded with great care using wonderful facilities. Unfortunately, I don't find a lot of music there to my taste, though I like a few of the artists available on Blue Coast, including Qua Continuum, [Art Lande][17], and [Alex De Grassi][18].
|
||||||
|
|
||||||
|
Over on [Bandcamp][19], I picked up [Emancipator's Baralku][20] and [Framework's Tides][21], both of which I enjoy. The music created by these two artists hits my sweet spot—it's electronic but not (generally) dance, it's melodic, and it tends to have some great hooks. There are many things for open source aficionados to like about Bandcamp, such as the ability to listen to the work in its entirety before buying; the lack of bloatware downloaders; the amounts shared with the musicians; and its support for [Creative Commons music][22].
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/19/4/radiodroid-internet-radio-player
|
||||||
|
|
||||||
|
作者:[Chris Hermansen (Community Moderator)][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/clhermansen
|
||||||
|
[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://www.theverge.com/2019/1/11/18178751/google-chromecast-audio-discontinued-sale
|
||||||
|
[3]: https://www.whathifi.com/google/chromecast-audio/review
|
||||||
|
[4]: https://www.mobilefun.com/google-chromecast-audio-black-70476
|
||||||
|
[5]: https://opensource.com/sites/default/files/uploads/internet-radio_chromecast.png (Google Chromecast Audio)
|
||||||
|
[6]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2
|
||||||
|
[7]: https://github.com/segler-alex/RadioDroid
|
||||||
|
[8]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/
|
||||||
|
[9]: http://www.radio-browser.info/gui/#!/
|
||||||
|
[10]: https://opensource.com/sites/default/files/uploads/internet-radio_radiodroid.png (RadioDroid)
|
||||||
|
[11]: http://www.radiogrenouille.com/
|
||||||
|
[12]: https://91rock.com.br/
|
||||||
|
[13]: http://player.181fm.com/?station=181-xblender
|
||||||
|
[14]: https://www.youtube.com/watch?v=PqLCQXPS8iQ
|
||||||
|
[15]: https://bluecoastmusic.com/artists/qua-continuum
|
||||||
|
[16]: https://bluecoastmusic.com/store
|
||||||
|
[17]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aart%20lande
|
||||||
|
[18]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aalex%20de%20grassi
|
||||||
|
[19]: https://bandcamp.com/
|
||||||
|
[20]: https://emancipator.bandcamp.com/album/baralku
|
||||||
|
[21]: https://frameworksuk.bandcamp.com/album/tides
|
||||||
|
[22]: https://bandcamp.com/tag/creative-commons
|
@ -0,0 +1,352 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (A beginner's guide to building DevOps pipelines with open source tools)
|
||||||
|
[#]: via: (https://opensource.com/article/19/4/devops-pipeline)
|
||||||
|
[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter)
|
||||||
|
|
||||||
|
A beginner's guide to building DevOps pipelines with open source tools
|
||||||
|
======
|
||||||
|
If you're new to DevOps, check out this five-step process for building
|
||||||
|
your first pipeline.
|
||||||
|
![Shaking hands, networking][1]
|
||||||
|
|
||||||
|
DevOps has become the default answer to fixing software development processes that are slow, siloed, or otherwise dysfunctional. But that doesn't mean very much when you're new to DevOps and aren't sure where to begin. This article explores what a DevOps pipeline is and offers a five-step process to create one. While this tutorial is not comprehensive, it should give you a foundation to start on and expand later. But first, a story.
|
||||||
|
|
||||||
|
### My DevOps journey
|
||||||
|
|
||||||
|
I used to work for the cloud team at Citi Group, developing an Infrastructure-as-a-Service (IaaS) web application to manage Citi's cloud infrastructure, but I was always interested in figuring out ways to make the development pipeline more efficient and bring positive cultural change to the development team. I found my answer in a book recommended by Greg Lavender, who was the CTO of Citi's cloud architecture and infrastructure engineering, called _[The Phoenix Project][2]_. The book reads like a novel while it explains DevOps principles.
|
||||||
|
|
||||||
|
A table at the back of the book shows how often different companies deploy to the release environment:
|
||||||
|
|
||||||
|
Company | Deployment Frequency
|
||||||
|
---|---
|
||||||
|
Amazon | 23,000 per day
|
||||||
|
Google | 5,500 per day
|
||||||
|
Netflix | 500 per day
|
||||||
|
Facebook | 1 per day
|
||||||
|
Twitter | 3 per week
|
||||||
|
Typical enterprise | 1 every 9 months
|
||||||
|
|
||||||
|
How are the frequency rates of Amazon, Google, and Netflix even possible? It's because these companies have figured out how to make a nearly perfect DevOps pipeline.
|
||||||
|
|
||||||
|
This definitely wasn't the case before we implemented DevOps at Citi. Back then, my team had different staged environments, but deployments to the development server were very manual. All developers had access to just one development server based on IBM WebSphere Application Server Community Edition. The problem was the server went down whenever multiple users simultaneously tried to make deployments, so the developers had to let each other know whenever they were about to make a deployment, which was quite a pain. In addition, there were problems with low code test coverages, cumbersome manual deployment processes, and no way to track code deployments with a defined task or a user story.
|
||||||
|
|
||||||
|
I realized something had to be done, and I found a colleague who felt the same way. We decided to collaborate to build an initial DevOps pipeline—he set up a virtual machine and a Tomcat application server while I worked on Jenkins, integrating with Atlassian Jira and BitBucket, and code testing coverages. This side project was hugely successful: we almost fully automated the development pipeline, we achieved nearly 100% uptime on our development server, we could track and improve code testing coverage, and the Git branch could be associated with the deployment and Jira task. And most of the tools we used to construct our DevOps pipeline were open source.
|
||||||
|
|
||||||
|
I now realize how rudimentary our DevOps pipeline was, as we didn't take advantage of advanced configurations like Jenkins files or Ansible. However, this simple process worked well, maybe due to the [Pareto][3] principle (also known as the 80/20 rule).
|
||||||
|
|
||||||
|
### A brief introduction to DevOps and the CI/CD pipeline
|
||||||
|
|
||||||
|
If you ask several people, "What is DevOps? you'll probably get several different answers. DevOps, like agile, has evolved to encompass many different disciplines, but most people will agree on a few things: DevOps is a software development practice or a software development lifecycle (SDLC) and its central tenet is cultural change, where developers and non-developers all breathe in an environment where formerly manual things are automated; everyone does what they are best at; the number of deployments per period increases; throughput increases; and flexibility improves.
|
||||||
|
|
||||||
|
While having the right software tools is not the only thing you need to achieve a DevOps environment, some tools are necessary. A key one is continuous integration and continuous deployment (CI/CD). This pipeline is where the environments have different stages (e.g., DEV, INT, TST, QA, UAT, STG, PROD), manual things are automated, and developers can achieve high-quality code, flexibility, and numerous deployments.
|
||||||
|
|
||||||
|
This article describes a five-step approach to creating a DevOps pipeline, like the one in the following diagram, using open source tools.
|
||||||
|
|
||||||
|
![Complete DevOps pipeline][4]
|
||||||
|
|
||||||
|
Without further ado, let's get started.
|
||||||
|
|
||||||
|
### Step 1: CI/CD framework
|
||||||
|
|
||||||
|
The first thing you need is a CI/CD tool. Jenkins, an open source, Java-based CI/CD tool based on the MIT License, is the tool that popularized the DevOps movement and has become the de facto standard.
|
||||||
|
|
||||||
|
So, what is Jenkins? Imagine it as some sort of a magical universal remote control that can talk to many many different services and tools and orchestrate them. On its own, a CI/CD tool like Jenkins is useless, but it becomes more powerful as it plugs into different tools and services.
|
||||||
|
|
||||||
|
Jenkins is just one of many open source CI/CD tools that you can leverage to build a DevOps pipeline.
|
||||||
|
|
||||||
|
Name | License
|
||||||
|
---|---
|
||||||
|
[Jenkins][5] | Creative Commons and MIT
|
||||||
|
[Travis CI][6] | MIT
|
||||||
|
[CruiseControl][7] | BSD
|
||||||
|
[Buildbot][8] | GPL
|
||||||
|
[Apache Gump][9] | Apache 2.0
|
||||||
|
[Cabie][10] | GNU
|
||||||
|
|
||||||
|
Here's what a DevOps process looks like with a CI/CD tool.
|
||||||
|
|
||||||
|
![CI/CD tool][11]
|
||||||
|
|
||||||
|
You have a CI/CD tool running in your localhost, but there is not much you can do at the moment. Let's follow the next step of DevOps journey.
|
||||||
|
|
||||||
|
### Step 2: Source control management
|
||||||
|
|
||||||
|
The best (and probably the easiest) way to verify that your CI/CD tool can perform some magic is by integrating with a source control management (SCM) tool. Why do you need source control? Suppose you are developing an application. Whenever you build an application, you are programming—whether you are using Java, Python, C++, Go, Ruby, JavaScript, or any of the gazillion programming languages out there. The programming codes you write are called source codes. In the beginning, especially when you are working alone, it's probably OK to put everything in your local directory. But when the project gets bigger and you invite others to collaborate, you need a way to avoid merge conflicts while effectively sharing the code modifications. You also need a way to recover a previous version—and the process of making a backup and copying-and-pasting gets old. You (and your teammates) want something better.
|
||||||
|
|
||||||
|
This is where SCM becomes almost a necessity. A SCM tool helps by storing your code in repositories, versioning your code, and coordinating among project members.
|
||||||
|
|
||||||
|
Although there are many SCM tools out there, Git is the standard and rightly so. I highly recommend using Git, but there are other open source options if you prefer.
|
||||||
|
|
||||||
|
Name | License
|
||||||
|
---|---
|
||||||
|
[Git][12] | GPLv2 & LGPL v2.1
|
||||||
|
[Subversion][13] | Apache 2.0
|
||||||
|
[Concurrent Versions System][14] (CVS) | GNU
|
||||||
|
[Vesta][15] | LGPL
|
||||||
|
[Mercurial][16] | GNU GPL v2+
|
||||||
|
|
||||||
|
Here's what the DevOps pipeline looks like with the addition of SCM.
|
||||||
|
|
||||||
|
![Source control management][17]
|
||||||
|
|
||||||
|
The CI/CD tool can automate the tasks of checking in and checking out source code and collaborating across members. Not bad? But how can you make this into a working application so billions of people can use and appreciate it?
|
||||||
|
|
||||||
|
### Step 3: Build automation tool
|
||||||
|
|
||||||
|
Excellent! You can check out the code and commit your changes to the source control, and you can invite your friends to collaborate on the source control development. But you haven't yet built an application. To make it a web application, it has to be compiled and put into a deployable package format or run as an executable. (Note that an interpreted programming language like JavaScript or PHP doesn't need to be compiled.)
|
||||||
|
|
||||||
|
Enter the build automation tool. No matter which build tool you decide to use, all build automation tools have a shared goal: to build the source code into some desired format and to automate the task of cleaning, compiling, testing, and deploying to a certain location. The build tools will differ depending on your programming language, but here are some common open source options to consider.
|
||||||
|
|
||||||
|
Name | License | Programming Language
|
||||||
|
---|---|---
|
||||||
|
[Maven][18] | Apache 2.0 | Java
|
||||||
|
[Ant][19] | Apache 2.0 | Java
|
||||||
|
[Gradle][20] | Apache 2.0 | Java
|
||||||
|
[Bazel][21] | Apache 2.0 | Java
|
||||||
|
[Make][22] | GNU | N/A
|
||||||
|
[Grunt][23] | MIT | JavaScript
|
||||||
|
[Gulp][24] | MIT | JavaScript
|
||||||
|
[Buildr][25] | Apache | Ruby
|
||||||
|
[Rake][26] | MIT | Ruby
|
||||||
|
[A-A-P][27] | GNU | Python
|
||||||
|
[SCons][28] | MIT | Python
|
||||||
|
[BitBake][29] | GPLv2 | Python
|
||||||
|
[Cake][30] | MIT | C#
|
||||||
|
[ASDF][31] | Expat (MIT) | LISP
|
||||||
|
[Cabal][32] | BSD | Haskell
|
||||||
|
|
||||||
|
Awesome! You can put your build automation tool configuration files into your source control management and let your CI/CD tool build it.
|
||||||
|
|
||||||
|
![Build automation tool][33]
|
||||||
|
|
||||||
|
Everything is good, right? But where can you deploy it?
|
||||||
|
|
||||||
|
### Step 4: Web application server
|
||||||
|
|
||||||
|
So far, you have a packaged file that might be executable or deployable. For any application to be truly useful, it has to provide some kind of a service or an interface, but you need a vessel to host your application.
|
||||||
|
|
||||||
|
For a web application, a web application server is that vessel. An application server offers an environment where the programming logic inside the deployable package can be detected, render the interface, and offer the web services by opening sockets to the outside world. You need an HTTP server as well as some other environment (like a virtual machine) to install your application server. For now, let's assume you will learn about this along the way (although I will discuss containers below).
|
||||||
|
|
||||||
|
There are a number of open source web application servers available.
|
||||||
|
|
||||||
|
Name | License | Programming Language
|
||||||
|
---|---|---
|
||||||
|
[Tomcat][34] | Apache 2.0 | Java
|
||||||
|
[Jetty][35] | Apache 2.0 | Java
|
||||||
|
[WildFly][36] | GNU Lesser Public | Java
|
||||||
|
[GlassFish][37] | CDDL & GNU Less Public | Java
|
||||||
|
[Django][38] | 3-Clause BSD | Python
|
||||||
|
[Tornado][39] | Apache 2.0 | Python
|
||||||
|
[Gunicorn][40] | MIT | Python
|
||||||
|
[Python Paste][41] | MIT | Python
|
||||||
|
[Rails][42] | MIT | Ruby
|
||||||
|
[Node.js][43] | MIT | Javascript
|
||||||
|
|
||||||
|
Now the DevOps pipeline is almost usable. Good job!
|
||||||
|
|
||||||
|
![Web application server][44]
|
||||||
|
|
||||||
|
Although it's possible to stop here and integrate further on your own, code quality is an important thing for an application developer to be concerned about.
|
||||||
|
|
||||||
|
### Step 5: Code testing coverage
|
||||||
|
|
||||||
|
Implementing code test pieces can be another cumbersome requirement, but developers need to catch any errors in an application early on and improve the code quality to ensure end users are satisfied. Luckily, there are many open source tools available to test your code and suggest ways to improve its quality. Even better, most CI/CD tools can plug into these tools and automate the process.
|
||||||
|
|
||||||
|
There are two parts to code testing: _code testing frameworks_ that help write and run the tests, and _code quality suggestion tools_ that help improve code quality.
|
||||||
|
|
||||||
|
#### Code test frameworks
|
||||||
|
|
||||||
|
Name | License | Programming Language
|
||||||
|
---|---|---
|
||||||
|
[JUnit][45] | Eclipse Public License | Java
|
||||||
|
[EasyMock][46] | Apache | Java
|
||||||
|
[Mockito][47] | MIT | Java
|
||||||
|
[PowerMock][48] | Apache 2.0 | Java
|
||||||
|
[Pytest][49] | MIT | Python
|
||||||
|
[Hypothesis][50] | Mozilla | Python
|
||||||
|
[Tox][51] | MIT | Python
|
||||||
|
|
||||||
|
#### Code quality suggestion tools
|
||||||
|
|
||||||
|
Name | License | Programming Language
|
||||||
|
---|---|---
|
||||||
|
[Cobertura][52] | GNU | Java
|
||||||
|
[CodeCover][53] | Eclipse Public (EPL) | Java
|
||||||
|
[Coverage.py][54] | Apache 2.0 | Python
|
||||||
|
[Emma][55] | Common Public License | Java
|
||||||
|
[JaCoCo][56] | Eclipse Public License | Java
|
||||||
|
[Hypothesis][50] | Mozilla | Python
|
||||||
|
[Tox][51] | MIT | Python
|
||||||
|
[Jasmine][57] | MIT | JavaScript
|
||||||
|
[Karma][58] | MIT | JavaScript
|
||||||
|
[Mocha][59] | MIT | JavaScript
|
||||||
|
[Jest][60] | MIT | JavaScript
|
||||||
|
|
||||||
|
Note that most of the tools and frameworks mentioned above are written for Java, Python, and JavaScript, since C++ and C# are proprietary programming languages (although GCC is open source).
|
||||||
|
|
||||||
|
Now that you've implemented code testing coverage tools, your DevOps pipeline should resemble the DevOps pipeline diagram shown at the beginning of this tutorial.
|
||||||
|
|
||||||
|
### Optional steps
|
||||||
|
|
||||||
|
#### Containers
|
||||||
|
|
||||||
|
As I mentioned above, you can host your application server on a virtual machine or a server, but containers are a popular solution.
|
||||||
|
|
||||||
|
[What are][61] [containers][61]? The short explanation is that a VM needs the huge footprint of an operating system, which overwhelms the application size, while a container just needs a few libraries and configurations to run the application. There are clearly still important uses for a VM, but a container is a lightweight solution for hosting an application, including an application server.
|
||||||
|
|
||||||
|
Although there are other options for containers, Docker and Kubernetes are the most popular.
|
||||||
|
|
||||||
|
Name | License
|
||||||
|
---|---
|
||||||
|
[Docker][62] | Apache 2.0
|
||||||
|
[Kubernetes][63] | Apache 2.0
|
||||||
|
|
||||||
|
To learn more, check out these other [Opensource.com][64] articles about Docker and Kubernetes:
|
||||||
|
|
||||||
|
* [What Is Docker?][65]
|
||||||
|
* [An introduction to Docker][66]
|
||||||
|
* [What is Kubernetes?][67]
|
||||||
|
* [From 0 to Kubernetes][68]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Middleware automation tools
|
||||||
|
|
||||||
|
Our DevOps pipeline mostly focused on collaboratively building and deploying an application, but there are many other things you can do with DevOps tools. One of them is leveraging Infrastructure as Code (IaC) tools, which are also known as middleware automation tools. These tools help automate the installation, management, and other tasks for middleware software. For example, an automation tool can pull applications, like a web application server, database, and monitoring tool, with the right configurations and deploy them to the application server.
|
||||||
|
|
||||||
|
Here are several open source middleware automation tools to consider:
|
||||||
|
|
||||||
|
Name | License
|
||||||
|
---|---
|
||||||
|
[Ansible][69] | GNU Public
|
||||||
|
[SaltStack][70] | Apache 2.0
|
||||||
|
[Chef][71] | Apache 2.0
|
||||||
|
[Puppet][72] | Apache or GPL
|
||||||
|
|
||||||
|
For more on middleware automation tools, check out these other [Opensource.com][64] articles:
|
||||||
|
|
||||||
|
* [A quickstart guide to Ansible][73]
|
||||||
|
* [Automating deployment strategies with Ansible][74]
|
||||||
|
* [Top 5 configuration management tools][75]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Where can you go from here?
|
||||||
|
|
||||||
|
This is just the tip of the iceberg for what a complete DevOps pipeline can look like. Start with a CI/CD tool and explore what else you can automate to make your team's job easier. Also, look into [open source communication tools][76] that can help your team work better together.
|
||||||
|
|
||||||
|
For more insight, here are some very good introductory articles about DevOps:
|
||||||
|
|
||||||
|
* [What is DevOps][77]
|
||||||
|
* [5 things to master to be a DevOps engineer][78]
|
||||||
|
* [DevOps is for everyone][79]
|
||||||
|
* [Getting started with predictive analytics in DevOps][80]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Integrating DevOps with open source agile tools is also a good idea:
|
||||||
|
|
||||||
|
* [What is agile?][81]
|
||||||
|
* [4 steps to becoming an awesome agile developer][82]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/19/4/devops-pipeline
|
||||||
|
|
||||||
|
作者:[Bryant Son (Red Hat, Community Moderator)][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/brson/users/milindsingh/users/milindsingh/users/dscripter
|
||||||
|
[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://www.amazon.com/dp/B078Y98RG8/
|
||||||
|
[3]: https://en.wikipedia.org/wiki/Pareto_principle
|
||||||
|
[4]: https://opensource.com/sites/default/files/uploads/1_finaldevopspipeline.jpg (Complete DevOps pipeline)
|
||||||
|
[5]: https://github.com/jenkinsci/jenkins
|
||||||
|
[6]: https://github.com/travis-ci/travis-ci
|
||||||
|
[7]: http://cruisecontrol.sourceforge.net
|
||||||
|
[8]: https://github.com/buildbot/buildbot
|
||||||
|
[9]: https://gump.apache.org
|
||||||
|
[10]: http://cabie.tigris.org
|
||||||
|
[11]: https://opensource.com/sites/default/files/uploads/2_runningjenkins.jpg (CI/CD tool)
|
||||||
|
[12]: https://git-scm.com
|
||||||
|
[13]: https://subversion.apache.org
|
||||||
|
[14]: http://savannah.nongnu.org/projects/cvs
|
||||||
|
[15]: http://www.vestasys.org
|
||||||
|
[16]: https://www.mercurial-scm.org
|
||||||
|
[17]: https://opensource.com/sites/default/files/uploads/3_sourcecontrolmanagement.jpg (Source control management)
|
||||||
|
[18]: https://maven.apache.org
|
||||||
|
[19]: https://ant.apache.org
|
||||||
|
[20]: https://gradle.org/
|
||||||
|
[21]: https://bazel.build
|
||||||
|
[22]: https://www.gnu.org/software/make
|
||||||
|
[23]: https://gruntjs.com
|
||||||
|
[24]: https://gulpjs.com
|
||||||
|
[25]: http://buildr.apache.org
|
||||||
|
[26]: https://github.com/ruby/rake
|
||||||
|
[27]: http://www.a-a-p.org
|
||||||
|
[28]: https://www.scons.org
|
||||||
|
[29]: https://www.yoctoproject.org/software-item/bitbake
|
||||||
|
[30]: https://github.com/cake-build/cake
|
||||||
|
[31]: https://common-lisp.net/project/asdf
|
||||||
|
[32]: https://www.haskell.org/cabal
|
||||||
|
[33]: https://opensource.com/sites/default/files/uploads/4_buildtools.jpg (Build automation tool)
|
||||||
|
[34]: https://tomcat.apache.org
|
||||||
|
[35]: https://www.eclipse.org/jetty/
|
||||||
|
[36]: http://wildfly.org
|
||||||
|
[37]: https://javaee.github.io/glassfish
|
||||||
|
[38]: https://www.djangoproject.com/
|
||||||
|
[39]: http://www.tornadoweb.org/en/stable
|
||||||
|
[40]: https://gunicorn.org
|
||||||
|
[41]: https://github.com/cdent/paste
|
||||||
|
[42]: https://rubyonrails.org
|
||||||
|
[43]: https://nodejs.org/en
|
||||||
|
[44]: https://opensource.com/sites/default/files/uploads/5_applicationserver.jpg (Web application server)
|
||||||
|
[45]: https://junit.org/junit5
|
||||||
|
[46]: http://easymock.org
|
||||||
|
[47]: https://site.mockito.org
|
||||||
|
[48]: https://github.com/powermock/powermock
|
||||||
|
[49]: https://docs.pytest.org
|
||||||
|
[50]: https://hypothesis.works
|
||||||
|
[51]: https://github.com/tox-dev/tox
|
||||||
|
[52]: http://cobertura.github.io/cobertura
|
||||||
|
[53]: http://codecover.org/
|
||||||
|
[54]: https://github.com/nedbat/coveragepy
|
||||||
|
[55]: http://emma.sourceforge.net
|
||||||
|
[56]: https://github.com/jacoco/jacoco
|
||||||
|
[57]: https://jasmine.github.io
|
||||||
|
[58]: https://github.com/karma-runner/karma
|
||||||
|
[59]: https://github.com/mochajs/mocha
|
||||||
|
[60]: https://jestjs.io
|
||||||
|
[61]: /resources/what-are-linux-containers
|
||||||
|
[62]: https://www.docker.com
|
||||||
|
[63]: https://kubernetes.io
|
||||||
|
[64]: http://Opensource.com
|
||||||
|
[65]: https://opensource.com/resources/what-docker
|
||||||
|
[66]: https://opensource.com/business/15/1/introduction-docker
|
||||||
|
[67]: https://opensource.com/resources/what-is-kubernetes
|
||||||
|
[68]: https://opensource.com/article/17/11/kubernetes-lightning-talk
|
||||||
|
[69]: https://www.ansible.com
|
||||||
|
[70]: https://www.saltstack.com
|
||||||
|
[71]: https://www.chef.io
|
||||||
|
[72]: https://puppet.com
|
||||||
|
[73]: https://opensource.com/article/19/2/quickstart-guide-ansible
|
||||||
|
[74]: https://opensource.com/article/19/1/automating-deployment-strategies-ansible
|
||||||
|
[75]: https://opensource.com/article/18/12/configuration-management-tools
|
||||||
|
[76]: https://opensource.com/alternatives/slack
|
||||||
|
[77]: https://opensource.com/resources/devops
|
||||||
|
[78]: https://opensource.com/article/19/2/master-devops-engineer
|
||||||
|
[79]: https://opensource.com/article/18/11/how-non-engineer-got-devops
|
||||||
|
[80]: https://opensource.com/article/19/1/getting-started-predictive-analytics-devops
|
||||||
|
[81]: https://opensource.com/article/18/10/what-agile
|
||||||
|
[82]: https://opensource.com/article/19/2/steps-agile-developer
|
@ -0,0 +1,68 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (Bash vs. Python: Which language should you use?)
|
||||||
|
[#]: via: (https://opensource.com/article/19/4/bash-vs-python)
|
||||||
|
[#]: author: (Archit Modi (Red Hat) https://opensource.com/users/architmodi/users/greg-p/users/oz123)
|
||||||
|
|
||||||
|
Bash vs. Python: Which language should you use?
|
||||||
|
======
|
||||||
|
Both programming languages have pros and cons that make them better for
|
||||||
|
some tasks than others.
|
||||||
|
![][1]
|
||||||
|
|
||||||
|
[Bash][2] and [Python][3] are most automation engineers' favorite programming languages. Both have pros and cons, and sometimes it can be hard to choose which one you should use. The honest answer is: It depends on the task, the scope, the context, and the complexity of the task.
|
||||||
|
|
||||||
|
Let's compare these two languages to get a better understanding of where each one shines.
|
||||||
|
|
||||||
|
### Bash
|
||||||
|
|
||||||
|
* Is a Linux/Unix shell command language
|
||||||
|
* Is great for writing shell scripts that use command line interface (CLI) utilities, utilizing output from one command to another (piping), and executing simple tasks (up to 100 lines of code)
|
||||||
|
* Can utilize command-line commands and utilities as-is
|
||||||
|
* Has better startup time than Python but poor execution time performance
|
||||||
|
* Does not come preinstalled in Windows; your script might not be compatible with multiple operating systems, but Bash is the default shell on most Linux/Unix systems
|
||||||
|
* Is _not_ fully compatible with other shells (e.g., csh, zsh, fish)
|
||||||
|
* Piping ("|") CLI utilities like sed, awk, grep, etc. can slow its performance
|
||||||
|
* Lacks many functions, objects, data structures, and multi-threading, which limits its use for complex scripting/programming
|
||||||
|
* Lacks good debugging tools and utilities
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Python
|
||||||
|
|
||||||
|
* Is an object-oriented programming (OOP) language, so it's more general purpose than Bash
|
||||||
|
* Can be used for almost any task
|
||||||
|
* Works on most major operating systems and is also installed by default on most Unix/Linux systems
|
||||||
|
* Is very similar to writing pseudo code
|
||||||
|
* Has simple, clear, easy-to-learn, and easy-to-read syntax
|
||||||
|
* Has lots of libraries, documentation, and an active community
|
||||||
|
* Provides better error handling features than Bash
|
||||||
|
* Has better debugging tools and utilities than Bash, which makes it a great language for developing complex software applications involving many lines of code
|
||||||
|
* Applications (or scripts) can contain many third-party dependencies that must be installed before executing them
|
||||||
|
* Requires writing more lines of code for simple tasks than Bash does
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
I hope these lists give you a better understanding of which language to use and when to use it.
|
||||||
|
|
||||||
|
Which language do you use more in your day-to-day work, Bash or Python? Please share in the comments.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/19/4/bash-vs-python
|
||||||
|
|
||||||
|
作者:[Archit Modi (Red Hat)][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/architmodi/users/greg-p/users/oz123
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_
|
||||||
|
[2]: /article/18/7/admin-guide-bash
|
||||||
|
[3]: /article/17/11/5-approaches-learning-python
|
@ -0,0 +1,111 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (Getting started with Python's cryptography library)
|
||||||
|
[#]: via: (https://opensource.com/article/19/4/cryptography-python)
|
||||||
|
[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez)
|
||||||
|
|
||||||
|
Getting started with Python's cryptography library
|
||||||
|
======
|
||||||
|
Encrypt your data and keep it safe from attackers.
|
||||||
|
![lock on world map][1]
|
||||||
|
|
||||||
|
The first rule of cryptography club is: never _invent_ a cryptography system yourself. The second rule of cryptography club is: never _implement_ a cryptography system yourself: many real-world holes are found in the _implementation_ phase of a cryptosystem as well as in the design.
|
||||||
|
|
||||||
|
One useful library for cryptographic primitives in Python is called simply [**cryptography**][2]. It has both "secure" primitives as well as a "hazmat" layer. The "hazmat" layer requires care and knowledge of cryptography and it is easy to implement security holes using it. We will not cover anything in the "hazmat" layer in this introductory article!
|
||||||
|
|
||||||
|
The most useful high-level secure primitive in **cryptography** is the Fernet implementation. Fernet is a standard for encrypting buffers in a way that follows best-practices cryptography. It is not suitable for very big files—anything in the gigabyte range and above—since it requires you to load the whole buffer that you want to encrypt or decrypt into memory at once.
|
||||||
|
|
||||||
|
Fernet supports _symmetric_ , or _secret key_ , cryptography: the same key is used for encryption and decryption, and therefore must be kept safe.
|
||||||
|
|
||||||
|
Generating a key is easy:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
>>> k = fernet.Fernet.generate_key()
|
||||||
|
>>> type(k)
|
||||||
|
<class 'bytes'>
|
||||||
|
```
|
||||||
|
|
||||||
|
Those bytes can be written to a file with appropriate permissions, ideally on a secure machine.
|
||||||
|
|
||||||
|
Once you have key material, encrypting is easy as well:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
>>> frn = fernet.Fernet(k)
|
||||||
|
>>> encrypted = frn.encrypt(b"x marks the spot")
|
||||||
|
>>> encrypted[:10]
|
||||||
|
b'gAAAAABb1'
|
||||||
|
```
|
||||||
|
|
||||||
|
You will get slightly different values if you encrypt on your machine. Not only because (I hope) you generated a different key from me, but because Fernet concatenates the value to be encrypted with some randomly generated buffer. This is one of the "best practices" I alluded to earlier: it will prevent an adversary from being able to tell which encrypted values are identical, which is sometimes an important part of an attack.
|
||||||
|
|
||||||
|
Decryption is equally simple:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
>>> frn = fernet.Fernet(k)
|
||||||
|
>>> frn.decrypt(encrypted)
|
||||||
|
b'x marks the spot'
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that this only encrypts and decrypts _byte strings_. In order to encrypt and decrypt _text strings_ , they will need to be encoded and decoded, usually with [UTF-8][3].
|
||||||
|
|
||||||
|
One of the most interesting advances in cryptography in the mid-20th century was _public key_ cryptography. It allows the encryption key to be published while the _decryption key_ is kept secret. It can, for example, be used to store API keys to be used by a server: the server is the only thing with access to the decryption key, but anyone can add to the store by using the public encryption key.
|
||||||
|
|
||||||
|
While **cryptography** does not have any public key cryptographic _secure_ primitives, the [**PyNaCl**][4] library does. PyNaCl wraps and offers some nice ways to use the [**NaCl**][5] encryption system invented by Daniel J. Bernstein.
|
||||||
|
|
||||||
|
NaCl always _encrypts_ and _signs_ or _decrypts_ and _verifies signatures_ simultaneously. This is a way to prevent malleability-based attacks, where an adversary modifies the encrypted value.
|
||||||
|
|
||||||
|
Encryption is done with a public key, while signing is done with a secret key:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
>>> from nacl.public import PrivateKey, PublicKey, Box
|
||||||
|
>>> source = PrivateKey.generate()
|
||||||
|
>>> with open("target.pubkey", "rb") as fpin:
|
||||||
|
... target_public_key = PublicKey(fpin.read())
|
||||||
|
>>> enc_box = Box(source, target_public_key)
|
||||||
|
>>> result = enc_box.encrypt(b"x marks the spot")
|
||||||
|
>>> result[:4]
|
||||||
|
b'\xe2\x1c0\xa4'
|
||||||
|
```
|
||||||
|
|
||||||
|
Decryption reverses the roles: it needs the private key for decryption and the public key to verify the signature:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
>>> from nacl.public import PrivateKey, PublicKey, Box
|
||||||
|
>>> with open("source.pubkey", "rb") as fpin:
|
||||||
|
... source_public_key = PublicKey(fpin.read())
|
||||||
|
>>> with open("target.private_key", "rb") as fpin:
|
||||||
|
... target = PrivateKey(fpin.read())
|
||||||
|
>>> dec_box = Box(target, source_public_key)
|
||||||
|
>>> dec_box.decrypt(result)
|
||||||
|
b'x marks the spot'
|
||||||
|
```
|
||||||
|
|
||||||
|
The [**PocketProtector**][6] library builds on top of PyNaCl and contains a complete secrets management solution.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/19/4/cryptography-python
|
||||||
|
|
||||||
|
作者:[Moshe Zadka (Community Moderator)][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/moshez
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map)
|
||||||
|
[2]: https://cryptography.io/en/latest/
|
||||||
|
[3]: https://en.wikipedia.org/wiki/UTF-8
|
||||||
|
[4]: https://pynacl.readthedocs.io/en/stable/
|
||||||
|
[5]: https://nacl.cr.yp.to/
|
||||||
|
[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md
|
@ -0,0 +1,182 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux)
|
||||||
|
[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
Anbox – Easy Way To Run Android Apps On Linux
|
||||||
|
======
|
||||||
|
|
||||||
|
Android emulator applications are allow us to run our favorite Android apps or games directly from Linux system.
|
||||||
|
|
||||||
|
There are many android emulators were available for Linux and we had covered few applications in the past.
|
||||||
|
|
||||||
|
You can review those by navigating to the following URLs.
|
||||||
|
|
||||||
|
* [How To Install Official Android Emulator (SDK) On Linux][1]
|
||||||
|
* [How To Install GenyMotion (Android Emulator) On Linux][2]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Today we are going to discuss about the Anbox Android emulator.
|
||||||
|
|
||||||
|
### What Is Anbox?
|
||||||
|
|
||||||
|
Anbox stands for Android in a box. Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system.
|
||||||
|
|
||||||
|
It’s new and modern emulator among others.
|
||||||
|
|
||||||
|
Since Anbox places the core Android OS into a container using Linux namespaces (LXE) so, there is no slowness while accessing the installed applications.
|
||||||
|
|
||||||
|
Anbox will let you run Android on your Linux system without the slowness of virtualization because the core Android OS has placed into a container using Linux namespaces (LXE).
|
||||||
|
|
||||||
|
There is no direct access to any hardware from the Android container. All hardware access are going through the anbox daemon on the host.
|
||||||
|
|
||||||
|
Each applications will be open in a separate window, just like other native system applications, and it can be showing up in the launcher.
|
||||||
|
|
||||||
|
### How To Install Anbox In Linux?
|
||||||
|
|
||||||
|
Anbox application is available as snap package so, make sure you have enabled snap support on your system.
|
||||||
|
|
||||||
|
Anbox package is recently added to the Ubuntu (Cosmic) and Debian (Buster) repositories. If you are running these version then you can easily install with help of official distribution package manager. Other wise go with snap package installation.
|
||||||
|
|
||||||
|
Make sure the necessary kernel modules should be installed in your system in order to work Anbox. For Ubuntu based users, use the following PPA to install it.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo add-apt-repository ppa:morphis/anbox-support
|
||||||
|
$ sudo apt update
|
||||||
|
$ sudo apt install linux-headers-generic anbox-modules-dkms
|
||||||
|
```
|
||||||
|
|
||||||
|
After you installed the `anbox-modules-dkms` package you have to manually reload the kernel modules or system reboot is required.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo modprobe ashmem_linux
|
||||||
|
$ sudo modprobe binder_linux
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install anbox.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install anbox
|
||||||
|
```
|
||||||
|
|
||||||
|
We always used to get package for Arch Linux based systems from AUR repository. So, use any of the **[AUR helper][5]** to install it. I prefer to go with **[Yay utility][6]**.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yuk -S anbox-git
|
||||||
|
```
|
||||||
|
|
||||||
|
If no, you can **[install and configure snaps in Linux][7]** by navigating to the following article. Others can ignore if you have already installed snaps on your system.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo snap install --devmode --beta anbox
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prerequisites For Anbox
|
||||||
|
|
||||||
|
By default, Anbox doesn’t ship with the Google Play Store.
|
||||||
|
|
||||||
|
Hence, we need to manually download each application (APK) and install it using Android Debug Bridge (ADB).
|
||||||
|
|
||||||
|
The ADB tool is readily available in most of the distributions repository so, we can easily install it.
|
||||||
|
|
||||||
|
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ADB.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install android-tools-adb
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Fedora`** system, use **[DNF Command][8]** to install ADB.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo dnf install android-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install ADB.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo pacman -S android-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`openSUSE Leap`** system, use **[Zypper Command][10]** to install ADB.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo zypper install android-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
### Where To Download The Android Apps?
|
||||||
|
|
||||||
|
Since you can’t use the Play Store so, you have to download the APK packages from trusted sites like [APKMirror][11] then manually install it.
|
||||||
|
|
||||||
|
### How To Launch Anbox?
|
||||||
|
|
||||||
|
Anbox can be launched from the Dash. This is how the default Anbox looks.
|
||||||
|
![][13]
|
||||||
|
|
||||||
|
### How To Push The Apps Into Anbox?
|
||||||
|
|
||||||
|
As i told previously, we need to manually install it. For testing purpose, we are going to install `YouTube` and `Firefox` apps.
|
||||||
|
|
||||||
|
First, you need to start ADB server. To do so, run the following command.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ adb devices
|
||||||
|
```
|
||||||
|
|
||||||
|
We have already downloaded the `YouTube` and `Firefox` apps and the same we will install now.
|
||||||
|
|
||||||
|
**Common Syntax:**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ adb install Name-Of-Your-Application.apk
|
||||||
|
```
|
||||||
|
|
||||||
|
Installing YouTube and Firefox app.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk'
|
||||||
|
Success
|
||||||
|
|
||||||
|
$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk'
|
||||||
|
Success
|
||||||
|
```
|
||||||
|
|
||||||
|
I have installed `YouTube` and `Firefox` in my Anbox. See the screenshot below.
|
||||||
|
![][14]
|
||||||
|
|
||||||
|
As we told in the beginning of the article, it will open any app as a new tab. Here, I’m going to open Firefox and accessing the **[2daygeek.com][15]** website.
|
||||||
|
![][16]
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.2daygeek.com/install-configure-sdk-android-emulator-on-linux/
|
||||||
|
[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/
|
||||||
|
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[5]: https://www.2daygeek.com/category/aur-helper/
|
||||||
|
[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/
|
||||||
|
[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/
|
||||||
|
[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
|
||||||
|
[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
|
||||||
|
[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
|
||||||
|
[11]: https://www.apkmirror.com/
|
||||||
|
[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||||
|
[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg
|
||||||
|
[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg
|
||||||
|
[15]: https://www.2daygeek.com/
|
||||||
|
[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg
|
@ -0,0 +1,355 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (Four Methods To Add A User To Group In Linux)
|
||||||
|
[#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
Four Methods To Add A User To Group In Linux
|
||||||
|
======
|
||||||
|
|
||||||
|
Linux groups are organization units which are used to manage user accounts in Linux.
|
||||||
|
|
||||||
|
It has unique numerical identification number for each users and groups in the Linux system.
|
||||||
|
|
||||||
|
It’s called a userid (UID) and a groupid (GID). The main purpose of groups is to define a set of privileges to the member of the group.
|
||||||
|
|
||||||
|
They all can perform the particular operations but not others.
|
||||||
|
|
||||||
|
There are two types of default groups are available in Linux. Each user should have exactly one primary group and any number of secondary groups.
|
||||||
|
|
||||||
|
* **Primary Group:** Primary group has been added to the user when the user account creation. It’s typically the name of the user. The primary group is applied to the user when performing any actions such as creating new files (or directories), modifying files, or executing commands, etc,. The user primary group information is stored in the `/etc/passwd` file.
|
||||||
|
* **Secondary Group:** It’s known as Supplementary Groups. It allows the group of users to perform the particular action in the same group members files.
|
||||||
|
Say for example, if you would like to allow few users to run Apache (httpd) service command then it will perfectly suits.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
You may have interested in the following articles which is related to user management.
|
||||||
|
|
||||||
|
* [Three Methods To Create An User Account In Linux?][1]
|
||||||
|
* [How To Create The Bulk Users In Linux?][2]
|
||||||
|
* [How to Update/Change Users Password in Linux Using Different Ways][3]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
It can be done using the following four methods.
|
||||||
|
|
||||||
|
* **`usermod:`** The usermod command modifies the system account files to reflect the changes that are specified on the command line.
|
||||||
|
* **`gpasswd:`** The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password.
|
||||||
|
* **`Shell Script:`** Shell scripts are allow administrator to automate the required tasks.
|
||||||
|
* **`Manual Method:`** We can manually add the users into any group by editing the `/etc/group` file.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
I assume that you already have the necessary group and users for this activity. In this example, we are going to use following users and groups `user1`, `user2`, `user3` and group is `mygroup` and `mygroup1`.
|
||||||
|
|
||||||
|
Before making the changes, i would like to check the users and group information. See the details below.
|
||||||
|
|
||||||
|
I could see the below users were associate with their own group and not with others.
|
||||||
|
|
||||||
|
```
|
||||||
|
# id user1
|
||||||
|
uid=1008(user1) gid=1008(user1) groups=1008(user1)
|
||||||
|
|
||||||
|
# id user2
|
||||||
|
uid=1009(user2) gid=1009(user2) groups=1009(user2)
|
||||||
|
|
||||||
|
# id user3
|
||||||
|
uid=1010(user3) gid=1010(user3) groups=1010(user3)
|
||||||
|
```
|
||||||
|
|
||||||
|
I could see there is no users are associated in this group.
|
||||||
|
|
||||||
|
```
|
||||||
|
# getent group mygroup
|
||||||
|
mygroup:x:1012:
|
||||||
|
|
||||||
|
# getent group mygroup1
|
||||||
|
mygroup1:x:1013:
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method-1: What Is usermod Command?
|
||||||
|
|
||||||
|
The usermod command modifies the system account files to reflect the changes that are specified on the command line.
|
||||||
|
|
||||||
|
### How to Add an Existing User to Secondary or Supplementary Group Using usermod Command?
|
||||||
|
|
||||||
|
To add an existing user to a secondary group, use the usermod command with `-G` option and the name of the group.
|
||||||
|
Syntax
|
||||||
|
|
||||||
|
```
|
||||||
|
# usermod [-G] [GroupName] [UserName]
|
||||||
|
```
|
||||||
|
|
||||||
|
You will be getting an error message if the given user or group doesn’t exist in your system. If you doesn’t get any error then the user has been added to the corresponding group.
|
||||||
|
|
||||||
|
```
|
||||||
|
# usermod -a -G mygroup user1
|
||||||
|
```
|
||||||
|
|
||||||
|
Let me see the output using id command. Yes, it’s added successfully.
|
||||||
|
|
||||||
|
```
|
||||||
|
# id user1
|
||||||
|
uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup)
|
||||||
|
```
|
||||||
|
|
||||||
|
### How to Add an Existing User to Multiple Secondary or Supplementary Groups Using usermod Command?
|
||||||
|
|
||||||
|
To add an existing user to multiple secondary groups, use the usermod command with `-G` option and the name of the groups with comma.
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
|
||||||
|
```
|
||||||
|
# usermod [-G] [GroupName1,GroupName2] [UserName]
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, we are going to add the `user2` into `mygroup` and `mygroup1`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# usermod -a -G mygroup,mygroup1 user2
|
||||||
|
```
|
||||||
|
|
||||||
|
Let me see the output using id command. Yes, `user2` is successfully added into `mygroup` and `mygroup1`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# id user2
|
||||||
|
uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1)
|
||||||
|
```
|
||||||
|
|
||||||
|
### How to Change a User’s Primary Group?
|
||||||
|
|
||||||
|
To change a user’s primary group, use the usermod command with `-g` option and the name of the group.
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
|
||||||
|
```
|
||||||
|
# usermod [-g] [GroupName] [UserName]
|
||||||
|
```
|
||||||
|
|
||||||
|
We have to use `-g` to change user’s primary group.
|
||||||
|
|
||||||
|
```
|
||||||
|
# usermod -g mygroup user3
|
||||||
|
```
|
||||||
|
|
||||||
|
Let see the output. Yes, it has been successfully changed. Now, it’s showing `mygroup` as `user3` primary group instead of `user3`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# id user3
|
||||||
|
uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method-2: What Is gpasswd Command?
|
||||||
|
|
||||||
|
The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password.
|
||||||
|
|
||||||
|
### How to Add an Existing User to Secondary or Supplementary Group Using gpasswd Command?
|
||||||
|
|
||||||
|
To add an existing user to a secondary group, use the gpasswd command with `-M` option and the name of the group.
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
|
||||||
|
```
|
||||||
|
# gpasswd [-M] [UserName] [GroupName]
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, we are going to add the `user1` into `mygroup`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# gpasswd -M user1 mygroup
|
||||||
|
```
|
||||||
|
|
||||||
|
Let me see the output using id command. Yes, `user1` is successfully added into `mygroup`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# id user1
|
||||||
|
uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup)
|
||||||
|
```
|
||||||
|
|
||||||
|
### How to Add The Multiple User’s to Secondary or Supplementary Group Using gpasswd Command?
|
||||||
|
|
||||||
|
To add the multiple users to a secondary group, use the gpasswd command with `-M` option and the name of the group.
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
|
||||||
|
```
|
||||||
|
# gpasswd [-M] [UserName1,UserName2] [GroupName]
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, we are going to add the `user2` and `user3` into `mygroup1`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# gpasswd -M user2,user3 mygroup1
|
||||||
|
```
|
||||||
|
|
||||||
|
Let me see the output using getent command. Yes, `user2` and `user3` are successfully added into `mygroup1`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# getent group mygroup1
|
||||||
|
mygroup1:x:1013:user2,user3
|
||||||
|
```
|
||||||
|
|
||||||
|
### How to Remove a User From a Group Using gpasswd Command?
|
||||||
|
|
||||||
|
To remove the user from the group, use the gpasswd command with `-d` option and the name of the user and group.
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
|
||||||
|
```
|
||||||
|
# gpasswd [-d] [UserName] [GroupName]
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, we are going to remove the `user1` from `mygroup`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# gpasswd -d user1 mygroup
|
||||||
|
Removing user user1 from group mygroup
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method-3: Using Shell Script?
|
||||||
|
|
||||||
|
Based on the above examples what i came to know is the `usermod` command doesn’t has capable to add multiple users into the group but it can be done through the `gpasswd` command.
|
||||||
|
|
||||||
|
However, it will overwrite the existing users which are currently associated on the group.
|
||||||
|
|
||||||
|
For example, `user1` has already associated with `mygroup`. If you would like to add `user2` and `user3` into the `mygroup` with `gpasswd` command, it doesn’t work as expected and it over right the group instead of modifying it.
|
||||||
|
|
||||||
|
What would be the solution if you would like to add multiple users to multiple groups?
|
||||||
|
|
||||||
|
There is no default option is available in both of the commands to achieve this.
|
||||||
|
|
||||||
|
Hence, we need to write a small shell script to achieve this.
|
||||||
|
|
||||||
|
### Method-3a: How to Add The Multiple Users to Secondary or Supplementary Group Using gpasswd Command?
|
||||||
|
|
||||||
|
Create the following small shell script if you would like to add the multiple users to secondary or supplementary group using gpasswd command.
|
||||||
|
|
||||||
|
Create The Users list. Each user should be in separate line.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cat user-lists.txt
|
||||||
|
user1
|
||||||
|
user2
|
||||||
|
user3
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the following shell script to add multiple users to single secondary group.
|
||||||
|
|
||||||
|
```
|
||||||
|
vi group-update.sh
|
||||||
|
|
||||||
|
#!/bin/bash
|
||||||
|
for user in `cat user-lists.txt`
|
||||||
|
do
|
||||||
|
usermod -a -G mygroup $user
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
Set an executable permission to `group-update.sh` file.
|
||||||
|
|
||||||
|
```
|
||||||
|
# chmod + group-update.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally run the script to achieve this.
|
||||||
|
|
||||||
|
```
|
||||||
|
# sh group-update.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Let me see the output using getent command. Yes, `user1`, `user2` and `user3` are successfully added into `mygroup`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# getent group mygroup
|
||||||
|
mygroup:x:1012:user1,user2,user3
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method-3a: How to Add The Multiple Users Into Multiple Secondary or Supplementary Group Using gpasswd Command?
|
||||||
|
|
||||||
|
Create the following small shell script if you would like to add the multiple users into multiple secondary or supplementary group using gpasswd command.
|
||||||
|
|
||||||
|
Create The Users list. Each user should be in separate line.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cat user-lists.txt
|
||||||
|
user1
|
||||||
|
user2
|
||||||
|
user3
|
||||||
|
```
|
||||||
|
|
||||||
|
Create The Groups list. Each group should be in separate line.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cat group-lists.txt
|
||||||
|
mygroup
|
||||||
|
mygroup1
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the following shell script to add multiple users to multiple secondary groups.
|
||||||
|
|
||||||
|
```
|
||||||
|
#!/bin/sh
|
||||||
|
for user in `more user-lists.txt`
|
||||||
|
do
|
||||||
|
for group in `more group-lists.txt`
|
||||||
|
do
|
||||||
|
usermod -a -G $group $user
|
||||||
|
done
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
Set an executable permission to `group-update-1.sh` file.
|
||||||
|
|
||||||
|
```
|
||||||
|
# chmod +x group-update-1.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally run the script to achieve this.
|
||||||
|
|
||||||
|
```
|
||||||
|
# sh group-update-1.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Let me see the output using getent command. Yes, `user1`, `user2` and `user3` are successfully added into `mygroup`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# getent group mygroup
|
||||||
|
mygroup:x:1012:user1,user2,user3
|
||||||
|
```
|
||||||
|
|
||||||
|
Also, `user1`, `user2` and `user3` are successfully added into `mygroup1`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# getent group mygroup1
|
||||||
|
mygroup1:x:1013:user1,user2,user3
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method-4: Manual Method To Add A User Into A Group In Linux?
|
||||||
|
|
||||||
|
We can manually add the users into any group by editing the `/etc/group` file.
|
||||||
|
|
||||||
|
Open the `/etc/group` file and search the group name where you want to update the users. Finally update the Users into the corresponding group.
|
||||||
|
|
||||||
|
```
|
||||||
|
# vi /etc/group
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.2daygeek.com/linux-user-account-creation-useradd-adduser-newusers/
|
||||||
|
[2]: https://www.2daygeek.com/how-to-create-the-bulk-users-in-linux/
|
||||||
|
[3]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/
|
@ -0,0 +1,225 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (How To Install And Configure Chrony As NTP Client?)
|
||||||
|
[#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
How To Install And Configure Chrony As NTP Client?
|
||||||
|
======
|
||||||
|
|
||||||
|
The NTP server and NTP client allow us to sync the clock across the network.
|
||||||
|
|
||||||
|
We had written an article about **[NTP server and NTP client installation and configuration][1]** in the past.
|
||||||
|
|
||||||
|
If you would like to check these, navigate to the above URL.
|
||||||
|
|
||||||
|
### What Is Chrony Client?
|
||||||
|
|
||||||
|
Chrony is replacement of NTP client.
|
||||||
|
|
||||||
|
It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time.
|
||||||
|
|
||||||
|
chronyd is smaller, it uses less memory and it wakes up the CPU only when necessary, which is better for power saving.
|
||||||
|
|
||||||
|
It can perform well even when the network is congested for longer periods of time.
|
||||||
|
|
||||||
|
It supports hardware timestamping on Linux, which allows extremely accurate synchronization on local networks.
|
||||||
|
|
||||||
|
It offers following two services.
|
||||||
|
|
||||||
|
* **`chronyc:`** Command line interface for chrony.
|
||||||
|
* **`chronyd:`** Chrony daemon service.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### How To Install And Configure Chrony In Linux?
|
||||||
|
|
||||||
|
Since the package is available in most of the distributions official repository. So, use the package manager to install it.
|
||||||
|
|
||||||
|
For **`Fedora`** system, use **[DNF Command][2]** to install chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo dnf install chrony
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install chrony
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo pacman -S chrony
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo yum install chrony
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo zypper install chrony
|
||||||
|
```
|
||||||
|
|
||||||
|
In this article, we are going to use the following setup to test this.
|
||||||
|
|
||||||
|
* **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7
|
||||||
|
* **`Chrony Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Navigate to the following URL for **[NTP server installation and configuration in Linux][1]**.
|
||||||
|
|
||||||
|
I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. Also, include the other required information on it.
|
||||||
|
|
||||||
|
The `chrony.conf` file will be placed in the different locations based on your distribution.
|
||||||
|
|
||||||
|
For RHEL based systems, it’s located at `/etc/chrony.conf`.
|
||||||
|
|
||||||
|
For Debian based systems, it’s located at `/etc/chrony/chrony.conf`.
|
||||||
|
|
||||||
|
```
|
||||||
|
# vi /etc/chrony/chrony.conf
|
||||||
|
|
||||||
|
server CentOS7.2daygeek.com prefer iburst
|
||||||
|
keyfile /etc/chrony/chrony.keys
|
||||||
|
driftfile /var/lib/chrony/chrony.drift
|
||||||
|
logdir /var/log/chrony
|
||||||
|
maxupdateskew 100.0
|
||||||
|
makestep 1 3
|
||||||
|
cmdallow 192.168.1.0/24
|
||||||
|
```
|
||||||
|
|
||||||
|
Bounce the Chrony service once you update the configuration.
|
||||||
|
|
||||||
|
For sysvinit systems. For RHEL based system we need to run `chronyd` instead of chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
# service chrony restart
|
||||||
|
|
||||||
|
# chkconfig chrony on
|
||||||
|
```
|
||||||
|
|
||||||
|
For systemctl systems. For RHEL based system we need to run `chronyd` instead of chrony.
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl restart chrony
|
||||||
|
|
||||||
|
# systemctl enable chrony
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the following commands like tacking, sources and sourcestats to check chrony synchronization details.
|
||||||
|
|
||||||
|
To check chrony tracking status.
|
||||||
|
|
||||||
|
```
|
||||||
|
# chronyc tracking
|
||||||
|
Reference ID : C0A80105 (CentOS7.2daygeek.com)
|
||||||
|
Stratum : 3
|
||||||
|
Ref time (UTC) : Thu Mar 28 05:57:27 2019
|
||||||
|
System time : 0.000002545 seconds slow of NTP time
|
||||||
|
Last offset : +0.001194361 seconds
|
||||||
|
RMS offset : 0.001194361 seconds
|
||||||
|
Frequency : 1.650 ppm fast
|
||||||
|
Residual freq : +184.101 ppm
|
||||||
|
Skew : 2.962 ppm
|
||||||
|
Root delay : 0.107966967 seconds
|
||||||
|
Root dispersion : 1.060455322 seconds
|
||||||
|
Update interval : 2.0 seconds
|
||||||
|
Leap status : Normal
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the sources command to displays information about the current time sources.
|
||||||
|
|
||||||
|
```
|
||||||
|
# chronyc sources
|
||||||
|
210 Number of sources = 1
|
||||||
|
MS Name/IP address Stratum Poll Reach LastRx Last sample
|
||||||
|
===============================================================================
|
||||||
|
^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms
|
||||||
|
```
|
||||||
|
|
||||||
|
The sourcestats command displays information about the drift rate and offset estimation process for each of the sources currently being examined by chronyd.
|
||||||
|
|
||||||
|
```
|
||||||
|
# chronyc sourcestats
|
||||||
|
210 Number of sources = 1
|
||||||
|
Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev
|
||||||
|
==============================================================================
|
||||||
|
CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us
|
||||||
|
```
|
||||||
|
|
||||||
|
When chronyd is configured as an NTP client or peer, you can have the transmit and receive timestamping modes and the interleaved mode reported for each NTP source by the chronyc ntpdata command.
|
||||||
|
|
||||||
|
```
|
||||||
|
# chronyc ntpdata
|
||||||
|
|
||||||
|
Remote address : 192.168.1.5 (C0A80105)
|
||||||
|
Remote port : 123
|
||||||
|
Local address : 192.168.1.3 (C0A80103)
|
||||||
|
Leap status : Normal
|
||||||
|
Version : 4
|
||||||
|
Mode : Server
|
||||||
|
Stratum : 2
|
||||||
|
Poll interval : 6 (64 seconds)
|
||||||
|
Precision : -23 (0.000000119 seconds)
|
||||||
|
Root delay : 0.108994 seconds
|
||||||
|
Root dispersion : 0.076523 seconds
|
||||||
|
Reference ID : 85F3EEF4 ()
|
||||||
|
Reference time : Thu Mar 28 06:43:35 2019
|
||||||
|
Offset : +0.000160221 seconds
|
||||||
|
Peer delay : 0.000664478 seconds
|
||||||
|
Peer dispersion : 0.000000178 seconds
|
||||||
|
Response time : 0.000243252 seconds
|
||||||
|
Jitter asymmetry: +0.00
|
||||||
|
NTP tests : 111 111 1111
|
||||||
|
Interleaved : No
|
||||||
|
Authenticated : No
|
||||||
|
TX timestamping : Kernel
|
||||||
|
RX timestamping : Kernel
|
||||||
|
Total TX : 46
|
||||||
|
Total RX : 46
|
||||||
|
Total valid RX : 46
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally run the `date` command.
|
||||||
|
|
||||||
|
```
|
||||||
|
# date
|
||||||
|
Thu Mar 28 03:08:11 CDT 2019
|
||||||
|
```
|
||||||
|
|
||||||
|
To step the system clock immediately, bypassing any adjustments in progress by slewing, issue the following command as root (To adjust the system clock manually).
|
||||||
|
|
||||||
|
```
|
||||||
|
# chronyc makestep
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/
|
||||||
|
[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
|
||||||
|
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
|
||||||
|
[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
|
||||||
|
[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
|
@ -0,0 +1,262 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?)
|
||||||
|
[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
How To Install And Configure NTP Server And NTP Client In Linux?
|
||||||
|
======
|
||||||
|
|
||||||
|
You might heard this word many times and also you might had worked on this.
|
||||||
|
|
||||||
|
However, i will tell you clearly in this article about NTP Server setup and NTP Client setup
|
||||||
|
|
||||||
|
We will see about **[Chrony NTP Client setup][1]** later.
|
||||||
|
|
||||||
|
### What Is NTP Server?
|
||||||
|
|
||||||
|
NTP stands for Network Time Protocol.
|
||||||
|
|
||||||
|
It is a networking protocol that synchronize the clock between computer systems over the network.
|
||||||
|
|
||||||
|
In other hand I can say. It will keep the same time (It keep an accurate time) to all the systems which are connected to NTP server through NTP or Chrony client.
|
||||||
|
|
||||||
|
NTP can usually maintain time to within tens of milliseconds over the public Internet, and can achieve better than one millisecond accuracy in local area networks under ideal conditions.
|
||||||
|
|
||||||
|
It uses User Datagram Protocol (UDP) on port number 123 for send and receive timestamps. It’s a client/server application.
|
||||||
|
|
||||||
|
It send and receive timestamps using the User Datagram Protocol (UDP) on port number 123.
|
||||||
|
|
||||||
|
### What Is NTP Client?
|
||||||
|
|
||||||
|
NTP client will synchronize its clock to the network time server.
|
||||||
|
|
||||||
|
### What Is Chrony Client?
|
||||||
|
|
||||||
|
Chrony is replacement of NTP client. It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time.
|
||||||
|
|
||||||
|
### Why We Need NTP Server?
|
||||||
|
|
||||||
|
To keep all the servers in your organization in-sync with an accurate time to perform time based jobs.
|
||||||
|
|
||||||
|
To clarify this, I will tell you a scenario. Say for example, we have two servers (Server1 and Server2). The server1 usually complete the batch jobs at 10:55 then the server2 needs to run another job at 11:00 based on the server1 job completion report.
|
||||||
|
|
||||||
|
If both the system is using in a different time (if one system is ahead of the others, the others are behind that particular one) then we can’t perform this. To achieve this, we should setup NTP. Hope it cleared your doubts about NTP.
|
||||||
|
|
||||||
|
In this article, we are going to use the following setup to test this.
|
||||||
|
|
||||||
|
* **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7
|
||||||
|
* **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### NTP SERVER SIDE: How To Install NTP Server In Linux?
|
||||||
|
|
||||||
|
There is no different packages for NTP server and NTP client since it’s a client/server model. The NTP package is available in distribution official repository so, use the distribution package manger to install it.
|
||||||
|
|
||||||
|
For **`Fedora`** system, use **[DNF Command][2]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo dnf install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo pacman -S ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo yum install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo zypper install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Configure The NTP Server In Linux?
|
||||||
|
|
||||||
|
Once you have installed the NTP package, make sure you have to uncomment the following configuration in the `/etc/ntp.conf` file on server side.
|
||||||
|
|
||||||
|
By default the NTP server configuration relies on `X.distribution_name.pool.ntp.org`. If you want you can use the default configuration or you can change it as per your location (country specific) by visiting <https://www.ntppool.org/zone/@> site.
|
||||||
|
|
||||||
|
Say for example. If you are in India then your NTP server will be `0.in.pool.ntp.org` and it will work for most of the countries.
|
||||||
|
|
||||||
|
```
|
||||||
|
# vi /etc/ntp.conf
|
||||||
|
|
||||||
|
restrict default kod nomodify notrap nopeer noquery
|
||||||
|
restrict -6 default kod nomodify notrap nopeer noquery
|
||||||
|
restrict 127.0.0.1
|
||||||
|
restrict -6 ::1
|
||||||
|
server 0.asia.pool.ntp.org
|
||||||
|
server 1.asia.pool.ntp.org
|
||||||
|
server 2.asia.pool.ntp.org
|
||||||
|
server 3.asia.pool.ntp.org
|
||||||
|
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
|
||||||
|
driftfile /var/lib/ntp/drift
|
||||||
|
keys /etc/ntp/keys
|
||||||
|
```
|
||||||
|
|
||||||
|
We have allowed only `192.168.1.0/24` subnet clients to access the NTP server.
|
||||||
|
|
||||||
|
Since firewall is enabled by default on RHEL 7 based distributions so, allow the ntp server/service.
|
||||||
|
|
||||||
|
```
|
||||||
|
# firewall-cmd --add-service=ntp --permanent
|
||||||
|
# firewall-cmd --reload
|
||||||
|
```
|
||||||
|
|
||||||
|
Bounce the service once you update the configuration.
|
||||||
|
|
||||||
|
For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd.
|
||||||
|
|
||||||
|
```
|
||||||
|
# service ntpd restart
|
||||||
|
|
||||||
|
# chkconfig ntpd on
|
||||||
|
```
|
||||||
|
|
||||||
|
For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd.
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl restart ntpd
|
||||||
|
|
||||||
|
# systemctl enable ntpd
|
||||||
|
```
|
||||||
|
|
||||||
|
### NTP CLIENT SIDE: How To Install NTP Client On Linux?
|
||||||
|
|
||||||
|
As I mentioned earlier in this article. There is no specific package for NTP server and client. So, install the same package on client also.
|
||||||
|
|
||||||
|
For **`Fedora`** system, use **[DNF Command][2]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo dnf install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo pacman -S ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo yum install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo zypper install ntp
|
||||||
|
```
|
||||||
|
|
||||||
|
I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines.
|
||||||
|
|
||||||
|
```
|
||||||
|
# vi /etc/ntp.conf
|
||||||
|
|
||||||
|
restrict default kod nomodify notrap nopeer noquery
|
||||||
|
restrict -6 default kod nomodify notrap nopeer noquery
|
||||||
|
restrict 127.0.0.1
|
||||||
|
restrict -6 ::1
|
||||||
|
server CentOS7.2daygeek.com prefer iburst
|
||||||
|
driftfile /var/lib/ntp/drift
|
||||||
|
keys /etc/ntp/keys
|
||||||
|
```
|
||||||
|
|
||||||
|
Bounce the service once you update the configuration.
|
||||||
|
|
||||||
|
For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd.
|
||||||
|
|
||||||
|
```
|
||||||
|
# service ntpd restart
|
||||||
|
|
||||||
|
# chkconfig ntpd on
|
||||||
|
```
|
||||||
|
|
||||||
|
For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd.
|
||||||
|
|
||||||
|
```
|
||||||
|
# systemctl restart ntpd
|
||||||
|
|
||||||
|
# systemctl enable ntpd
|
||||||
|
```
|
||||||
|
|
||||||
|
Wait for few minutes post restart of the NTP service to get synchronize time from the NTP server.
|
||||||
|
|
||||||
|
Run the following commands to verify the NTP server synchronization status on Linux.
|
||||||
|
|
||||||
|
```
|
||||||
|
# ntpq –p
|
||||||
|
Or
|
||||||
|
# ntpq -pn
|
||||||
|
|
||||||
|
remote refid st t when poll reach delay offset jitter
|
||||||
|
==============================================================================
|
||||||
|
*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the following command to get the current status of ntpd.
|
||||||
|
|
||||||
|
```
|
||||||
|
# ntpstat
|
||||||
|
synchronised to NTP server (192.168.1.8) at stratum 3
|
||||||
|
time correct to within 508 ms
|
||||||
|
polling server every 64 s
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally run the `date` command.
|
||||||
|
|
||||||
|
```
|
||||||
|
# date
|
||||||
|
Tue Mar 26 23:17:05 CDT 2019
|
||||||
|
```
|
||||||
|
|
||||||
|
If you are observing a significant offset in the NTP output. Run the following command to sync clock manually from the NTP server. Make sure that your NTP client should be inactive state when you perform the command.
|
||||||
|
|
||||||
|
```
|
||||||
|
# ntpdate –uv CentOS7.2daygeek.com
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/
|
||||||
|
[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
|
||||||
|
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
|
||||||
|
[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
|
||||||
|
[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
|
@ -0,0 +1,304 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (How To Install And Enable Flatpak Support On Linux?)
|
||||||
|
[#]: via: (https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
How To Install And Enable Flatpak Support On Linux?
|
||||||
|
======
|
||||||
|
|
||||||
|
Currently we all are using distributions official package managers to install any required packages.
|
||||||
|
|
||||||
|
in Linux, it’s doing good without any issues. (It’s doing their job nicely without any compromise)
|
||||||
|
|
||||||
|
There was some limitation on this that will think about other alternative solutions to fix it.
|
||||||
|
|
||||||
|
Yes, by default we won’t get the latest version of packages from the distributions official package managers because as these were built while building a current OS version. And they offers only security updates until the next major release comes.
|
||||||
|
|
||||||
|
So, what will be the solution for this?
|
||||||
|
|
||||||
|
Yes, we have multiple solutions for this and most of us were already started using few of those.
|
||||||
|
|
||||||
|
What it is and what is the benefit of those?
|
||||||
|
|
||||||
|
* **For Ubuntu based systems:** PPAs
|
||||||
|
* **For RHEL based systems:** [EPEL Repository][1], [ELRepo Repository][2], [nux-dextop Repository][3], [IUS Community Repo][4], [RPMfusion Repository][5] and [Remi Repository][6].
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Using the above repos, we will be getting the latest packages for the distribution. And these are usually well maintained and suggested by most of the community. But these are advisable by the OS and may not always be safe.
|
||||||
|
|
||||||
|
In recent years, the following universal packaging formats were come out and gained a lot of popularity.
|
||||||
|
|
||||||
|
* **`Flatpak:`**`` It’s distribution independent package format and the main contributor is Fedora project team. The Flatpak framework is adopted by most of the major Linux distributions.
|
||||||
|
* **`Snaps:`**`` Snappy is a universal packaging formats originally designed and built by Canonical for the Ubuntu phone and it’s operating system. Later most of the distributions are adapted.
|
||||||
|
* **`AppImage:`**`` AppImage is a portable package format and it can run without installation or the need for root rights.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
We had already covered about the **[Snap package manager& packaging format][7]** in the past. Today we are going to discuss about Flatpak packing format.
|
||||||
|
|
||||||
|
### What Is Flatpak?
|
||||||
|
|
||||||
|
Flatpak (formerly know as X Desktop Group or xdg-app) is a software utility. It’s offering a universal packaging formats which can be used in any Linux distributions.
|
||||||
|
|
||||||
|
It provides a sandbox (isolated) environment to run the app and it doesn’t impact either other apps and distribution core packages. Also we can install and run the different version of same package.
|
||||||
|
|
||||||
|
There is an disadvantage on flatpak is that doesn’t support server OS unlike Snap and AppImage. It’s working only on few desktops environment.
|
||||||
|
|
||||||
|
Say for example. If you would like to run two version of php on your system then you can easily install and run as your wish.
|
||||||
|
|
||||||
|
That’s where the universal packaging formats are become very famous nowadays.
|
||||||
|
|
||||||
|
### How To Install Flatpak On Linux?
|
||||||
|
|
||||||
|
Flatpak package is available in most of the Linux distribution official repository. Hence, it can be installed using those.
|
||||||
|
|
||||||
|
For **`Fedora`** system, use **[DNF Command][8]** to install flatpak.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo dnf install flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][9]** or **[APT Command][10]** to install flatpak.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
For older Ubuntu versions.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo add-apt-repository ppa:alexlarsson/flatpak
|
||||||
|
$ sudo apt update
|
||||||
|
$ sudo apt install flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`Arch Linux`** based systems, use **[Pacman Command][11]** to install flatpak.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo pacman -S flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`RHEL/CentOS`** systems, use **[YUM Command][12]** to install flatpak.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo yum install flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
For **`openSUSE Leap`** system, use **[Zypper Command][13]** to install flatpak.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo zypper install flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Enable Flathub Support On Linux?
|
||||||
|
|
||||||
|
Flatbub website is a app store for Flatpak packages where you can find them.
|
||||||
|
|
||||||
|
It’s a central repository where all the flatpak applications are available for users.
|
||||||
|
|
||||||
|
Run the following command to enable Flathub support on Linux.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the Software Flatpak plugin for GNOME Desktop Environment.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install gnome-software-plugin-flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
Also, you can enable GNOME Repository if you are using GNOME Desktop Environment. It’s containing all GNOME core applications.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ wget https://sdk.gnome.org/keys/gnome-sdk.gpg
|
||||||
|
$ sudo flatpak remote-add --gpg-import=gnome-sdk.gpg --if-not-exists gnome-apps https://sdk.gnome.org/repo-apps/
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To List configured flatpak repositories?
|
||||||
|
|
||||||
|
Run the following command, if you would like to view list of the configured flatpak repositories on your system.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak remotes
|
||||||
|
Name Options
|
||||||
|
flathub system
|
||||||
|
gnome-apps system
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To List The Available Packages In The Configured Repositories?
|
||||||
|
|
||||||
|
Run the following command, if you would like to view list of the available packages (It will display all together like, applications and run times) in the configured repositories.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak remote-ls | head -10
|
||||||
|
|
||||||
|
org.freedesktop.GlxInfo gnome-apps
|
||||||
|
org.gnome.Books gnome-apps
|
||||||
|
org.gnome.Builder gnome-apps
|
||||||
|
org.gnome.Calculator gnome-apps
|
||||||
|
org.gnome.Calendar gnome-apps
|
||||||
|
org.gnome.Characters gnome-apps
|
||||||
|
org.gnome.Devhelp gnome-apps
|
||||||
|
org.gnome.Dictionary gnome-apps
|
||||||
|
org.gnome.Documents gnome-apps
|
||||||
|
org.gnome.Epiphany gnome-apps
|
||||||
|
```
|
||||||
|
|
||||||
|
To list only applications not runtimes.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak remote-ls --app
|
||||||
|
```
|
||||||
|
|
||||||
|
To list specific repository applications.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak remote-ls gnome-apps
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Install A Package From flatpak?
|
||||||
|
|
||||||
|
Run the following command to install a package from flatpak repository.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo flatpak install flathub com.github.muriloventuroso.easyssh
|
||||||
|
|
||||||
|
Required runtime for com.github.muriloventuroso.easyssh/x86_64/stable (runtime/org.gnome.Platform/x86_64/3.30) found in remote flathub
|
||||||
|
Do you want to install it? [y/n]: y
|
||||||
|
Installing in system:
|
||||||
|
org.gnome.Platform/x86_64/3.30 flathub 4e93789f42ac
|
||||||
|
org.gnome.Platform.Locale/x86_64/3.30 flathub 6abf9c0e2b72
|
||||||
|
org.freedesktop.Platform.html5-codecs/x86_64/18.08 flathub d6abde36c0be
|
||||||
|
com.github.muriloventuroso.easyssh/x86_64/stable flathub 337db43043d2
|
||||||
|
permissions: ipc, network, wayland, x11, dri
|
||||||
|
file access: home, xdg-run/dconf, ~/.config/dconf:ro
|
||||||
|
dbus access: ca.desrt.dconf
|
||||||
|
com.github.muriloventuroso.easyssh.Locale/x86_64/stable flathub af837356b222
|
||||||
|
Is this ok [y/n]: y
|
||||||
|
Installing: org.gnome.Platform/x86_64/3.30 from flathub
|
||||||
|
[####################] 1 metadata, 14908 content objects fetched; 228018 KiB transferred in 364 seconds
|
||||||
|
Now at 4e93789f42ac.
|
||||||
|
Installing: org.gnome.Platform.Locale/x86_64/3.30 from flathub
|
||||||
|
[####################] 4 metadata, 1 content objects fetched; 16 KiB transferred in 2 seconds
|
||||||
|
Now at 6abf9c0e2b72.
|
||||||
|
Installing: org.freedesktop.Platform.html5-codecs/x86_64/18.08 from flathub
|
||||||
|
[####################] 26 metadata, 131 content objects fetched; 2737 KiB transferred in 8 seconds
|
||||||
|
Now at d6abde36c0be.
|
||||||
|
Installing: com.github.muriloventuroso.easyssh/x86_64/stable from flathub
|
||||||
|
[####################] 191 metadata, 3633 content objects fetched; 24857 KiB transferred in 117 seconds
|
||||||
|
Now at 337db43043d2.
|
||||||
|
Installing: com.github.muriloventuroso.easyssh.Locale/x86_64/stable from flathub
|
||||||
|
[####################] 3 metadata, 1 content objects fetched; 14 KiB transferred in 2 seconds
|
||||||
|
Now at af837356b222.
|
||||||
|
```
|
||||||
|
|
||||||
|
All the installed application will be placed in the following location.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ ls /var/lib/flatpak/app/
|
||||||
|
com.github.muriloventuroso.easyssh
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Run The Installed Application?
|
||||||
|
|
||||||
|
Run the following command to launch the required application. Make sure, you have to replace with your application name instead.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak run com.github.muriloventuroso.easyssh
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To View The Installed Application?
|
||||||
|
|
||||||
|
Run the following command to view the installed application.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak list
|
||||||
|
Ref Options
|
||||||
|
com.github.muriloventuroso.easyssh/x86_64/stable system,current
|
||||||
|
org.freedesktop.Platform.html5-codecs/x86_64/18.08 system,runtime
|
||||||
|
org.gnome.Platform/x86_64/3.30 system,runtime
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To View The Detailed Information About The Installed Application?
|
||||||
|
|
||||||
|
Run the following command to view the detailed information about the installed application.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak info com.github.muriloventuroso.easyssh
|
||||||
|
|
||||||
|
Ref: app/com.github.muriloventuroso.easyssh/x86_64/stable
|
||||||
|
ID: com.github.muriloventuroso.easyssh
|
||||||
|
Arch: x86_64
|
||||||
|
Branch: stable
|
||||||
|
Origin: flathub
|
||||||
|
Collection ID: org.flathub.Stable
|
||||||
|
Date: 2019-01-08 13:36:32 +0000
|
||||||
|
Subject: Update com.github.muriloventuroso.easyssh.json (cd35819c)
|
||||||
|
Commit: 337db43043d282c74d14a9caecdc780464b5e526b4626215d534d38b0935049f
|
||||||
|
Parent: 6e49096146f675db6ecc0ce7c5347b4b4f049b21d83a6cc4d01ff3f27c707cb6
|
||||||
|
Location: /var/lib/flatpak/app/com.github.muriloventuroso.easyssh/x86_64/stable/337db43043d282c74d14a9caecdc780464b5e526b4626215d534d38b0935049f
|
||||||
|
Installed size: 100.0 MB
|
||||||
|
Runtime: org.gnome.Platform/x86_64/3.30
|
||||||
|
Sdk: org.gnome.Sdk/x86_64/3.30
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Update The Installed Application?
|
||||||
|
|
||||||
|
Run the following command to updated the installed application to latest version.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak update
|
||||||
|
```
|
||||||
|
|
||||||
|
For specific application, use the following format.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak update com.github.muriloventuroso.easyssh
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Remove The Installed Application?
|
||||||
|
|
||||||
|
Run the following command to remove the installed application.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo flatpak uninstall com.github.muriloventuroso.easyssh
|
||||||
|
```
|
||||||
|
|
||||||
|
Go to the man page for more details and options.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ flatpak --help
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/
|
||||||
|
[2]: https://www.2daygeek.com/install-enable-elrepo-on-rhel-centos-scientific-linux/
|
||||||
|
[3]: https://www.2daygeek.com/install-enable-nux-dextop-repository-on-centos-rhel-scientific-linux/
|
||||||
|
[4]: https://www.2daygeek.com/install-enable-ius-community-repository-on-rhel-centos/
|
||||||
|
[5]: https://www.2daygeek.com/install-enable-rpm-fusion-repository-on-centos-fedora-rhel/
|
||||||
|
[6]: https://www.2daygeek.com/install-enable-remi-repository-on-centos-rhel-fedora/
|
||||||
|
[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/
|
||||||
|
[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
|
||||||
|
[9]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[10]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||||
|
[11]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
|
||||||
|
[12]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
|
||||||
|
[13]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
|
@ -0,0 +1,149 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (UP Shell Script – Quickly Navigate To A Specific Parent Directory In Linux)
|
||||||
|
[#]: via: (https://www.2daygeek.com/up-shell-script-quickly-go-back-to-a-specific-parent-directory-in-linux/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
UP Shell Script – Quickly Navigate To A Specific Parent Directory In Linux
|
||||||
|
======
|
||||||
|
|
||||||
|
Recently we had written an article about **[bd command][1]** , which help us to **[quickly go back to the specific parent directory][1]**.
|
||||||
|
|
||||||
|
Even, the [up shell script][2] allow us to perform the same but has different approach so, we would like to explore it.
|
||||||
|
|
||||||
|
This will allow us to quickly navigate to a specific parent directory with mentioning the directory name.
|
||||||
|
|
||||||
|
Instead we can give the directory number. I mean to say that number of times you’d have to go back.
|
||||||
|
|
||||||
|
Stop typing `cd ../../..` endlessly and navigate easily to a specific parent directory by using up shell script.
|
||||||
|
|
||||||
|
It support tab completion so, it’s become more convenient.
|
||||||
|
|
||||||
|
The `up.sh` registers the up function and some completion functions via your `.bashrc` or `.zshrc` file.
|
||||||
|
|
||||||
|
It was completely written using shell script and it’s support zsh and fish shell as well.
|
||||||
|
|
||||||
|
We had written an article about **[autocd][3]**. It’s a builtin shell variable that helps us to **[navigate to inside a directory without cd command][3]**.
|
||||||
|
|
||||||
|
### How To Install up Linux?
|
||||||
|
|
||||||
|
It’s not based on the distribution and you have to install it based on your shell.
|
||||||
|
|
||||||
|
Simple run the following command to enable up script on `bash` shell.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh
|
||||||
|
|
||||||
|
$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the following command to take the changes to effect.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ source ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Simple run the following command to enable up script on `zsh` shell.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh
|
||||||
|
|
||||||
|
$ echo 'source ~/.config/up/up.sh' >> ~/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the following command to take the changes to effect.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ source ~/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Simple run the following command to enable up script on `fish` shell.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish
|
||||||
|
|
||||||
|
$ source ~/.config/up/up.fish
|
||||||
|
```
|
||||||
|
|
||||||
|
### How To Use This In Linux?
|
||||||
|
|
||||||
|
We have successfully installed and configured the up script on system. It’s time to test it.
|
||||||
|
|
||||||
|
I’m going to take the below directory path for this testing.
|
||||||
|
|
||||||
|
Run the `pwd` command or `dirs` command to know your current location.
|
||||||
|
|
||||||
|
```
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ pwd
|
||||||
|
or
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ dirs
|
||||||
|
|
||||||
|
/usr/share/icons/Adwaita/256x256/apps
|
||||||
|
```
|
||||||
|
|
||||||
|
How to up one level? Quickly go back to one directory. I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go one directory up `256x256` directory quickly then simple type the following command.
|
||||||
|
|
||||||
|
```
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up
|
||||||
|
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256$ pwd
|
||||||
|
/usr/share/icons/Adwaita/256x256
|
||||||
|
```
|
||||||
|
|
||||||
|
How to up multiple levels? Quickly go back to multiple directory. I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go to `share` directory quickly then simple type the following command.
|
||||||
|
|
||||||
|
```
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up 4
|
||||||
|
|
||||||
|
daygeek@Ubuntu18:/usr/share$ pwd
|
||||||
|
/usr/share
|
||||||
|
```
|
||||||
|
|
||||||
|
How to up by full name? Quickly go back to the given directory instead of number.
|
||||||
|
|
||||||
|
```
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up icons
|
||||||
|
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons$ pwd
|
||||||
|
/usr/share/icons
|
||||||
|
```
|
||||||
|
|
||||||
|
How to up by partial name? Quickly go back to the given directory instead of number.
|
||||||
|
|
||||||
|
```
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up Ad
|
||||||
|
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita$ pwd
|
||||||
|
/usr/share/icons/Adwaita
|
||||||
|
```
|
||||||
|
|
||||||
|
As i told in the beginning of the article, it supports tab completion.
|
||||||
|
|
||||||
|
```
|
||||||
|
daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up
|
||||||
|
256x256/ Adwaita/ icons/ share/ usr/
|
||||||
|
```
|
||||||
|
|
||||||
|
This tutorial allows you to quickly go back to a specific parent directory but there is no option to move forward quickly.
|
||||||
|
|
||||||
|
We have another solution for this, will come up with new solution shortly. Please stay tune with us.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/up-shell-script-quickly-go-back-to-a-specific-parent-directory-in-linux/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.2daygeek.com/bd-quickly-go-back-to-a-specific-parent-directory-in-linux/
|
||||||
|
[2]: https://github.com/shannonmoeller/up
|
||||||
|
[3]: https://www.2daygeek.com/navigate-switch-directory-without-using-cd-command-in-linux/
|
@ -0,0 +1,207 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: ( )
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: url: ( )
|
||||||
|
[#]: subject: (topgrade – Upgrade/Update Everything In Single Command On Linux?)
|
||||||
|
[#]: via: (https://www.2daygeek.com/topgrade-upgrade-update-everything-in-single-command-on-linux/)
|
||||||
|
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||||
|
|
||||||
|
topgrade – Upgrade/Update Everything In Single Command On Linux?
|
||||||
|
======
|
||||||
|
|
||||||
|
As a Linux administrator, you have to keep your system up-to-date to get ride out from some unexpected issues.
|
||||||
|
|
||||||
|
We have to keep the system with latest patches as part of best practices.
|
||||||
|
|
||||||
|
To do so, you need to perform the patching activity at least once in a month.
|
||||||
|
|
||||||
|
Most of the time you have to reboot the server after patching to activate the latest kernel.
|
||||||
|
|
||||||
|
It’s good to reboot the server at least 90-120 days once that will fix some outstanding issue which we already having.
|
||||||
|
|
||||||
|
If you have a single system then we can directly login to the system and do perform the patching that is not a big deal.
|
||||||
|
|
||||||
|
Even, if you have few of servers with the same flavor then you can perform the patching with help of shell script.
|
||||||
|
|
||||||
|
If you have high number of servers then i would advise you to go with any of the parallel utility, which will help us to perform the patching in parallel.
|
||||||
|
|
||||||
|
It will save a lot’s of time compared with shell script as this go with sequential order.
|
||||||
|
|
||||||
|
how to patch all togeter if you have servers with multiple flavors? What will be the solution ?
|
||||||
|
|
||||||
|
I recently came to know the utility called `topgrade` that can fulfill your requirement.
|
||||||
|
|
||||||
|
Also, your distribution package manager doesn’t upgrade the packages which was installed with other package managers such as pip, npm, snap, etc,. but topgrade can fix this issue as well.
|
||||||
|
|
||||||
|
### What Is topgrade?
|
||||||
|
|
||||||
|
[topgrade][1] is a new tool that will upgrade all the installed packages on your system to latest available version by detecting and running the appropriate package managers.
|
||||||
|
|
||||||
|
### How To Install topgrade In Linux?
|
||||||
|
|
||||||
|
There is no separate package manager for distributions wise. Hence, you need to install topgrade with help of cargo package manager.
|
||||||
|
|
||||||
|
The topgrade is available in AUR. So, use one of the **[AUR helper][2]** to install it on Arch-based systems. I prefer to go with **[Yay helper][3]** program.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yay -S topgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
Once you have installed the **[cargo package manager][4]** , use the following command to install it.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cargo install topgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
Once topgrade is initiated, it will perform the following tasks one by one.
|
||||||
|
|
||||||
|
* Try to self-upgrade if any updated is available for topgrade.
|
||||||
|
* Arch: Run yay or fall back to pacman
|
||||||
|
* CentOS/RHEL: Run yum upgrade
|
||||||
|
* Fedora: Run dnf upgrade
|
||||||
|
* Debian/Ubuntu: Run apt update && apt dist-upgrade
|
||||||
|
* openSUSE: Run zypper refresh && zypper dist-upgrade
|
||||||
|
* Upgrade Vim/Neovim packages.
|
||||||
|
* Run npm update -g if NPM is installed
|
||||||
|
* Upgrade Atom packages
|
||||||
|
* Linux: Update Flatpak packages
|
||||||
|
* Linux: Update snap packages
|
||||||
|
* Linux: Run fwupdmgr to show firmware upgrade.
|
||||||
|
* Finally it will run needrestart to bounce all the services.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Now, we have successfully installed `topgrade` so, run the topgrade alone to upgrade everything on your system. I have tested the utility on Ubuntu 18.04 LTS and the results are below.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ topgrade
|
||||||
|
|
||||||
|
―― System update ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
|
||||||
|
[sudo] password for daygeek:
|
||||||
|
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
|
||||||
|
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
|
||||||
|
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
|
||||||
|
Get:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
|
||||||
|
.
|
||||||
|
Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [45.2 kB]
|
||||||
|
Get:17 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,460 B]
|
||||||
|
Fetched 1,565 kB in 13s (117 kB/s)
|
||||||
|
Reading package lists... Done
|
||||||
|
Building dependency tree
|
||||||
|
Reading state information... Done
|
||||||
|
119 packages can be upgraded. Run 'apt list --upgradable' to see them.
|
||||||
|
Reading package lists... Done
|
||||||
|
Building dependency tree
|
||||||
|
Reading state information... Done
|
||||||
|
Calculating upgrade... Done
|
||||||
|
The following packages were automatically installed and are no longer required:
|
||||||
|
libopts25 linux-headers-4.15.0-45 linux-headers-4.15.0-45-generic linux-image-4.15.0-45-generic
|
||||||
|
linux-modules-4.15.0-29-generic linux-modules-4.15.0-45-generic linux-modules-extra-4.15.0-45-generic sntp
|
||||||
|
Use 'sudo apt autoremove' to remove them.
|
||||||
|
The following packages will be upgraded:
|
||||||
|
apport apport-gtk apt apt-utils cups cups-bsd cups-client cups-common cups-core-drivers cups-daemon cups-ipp-utils
|
||||||
|
cups-ppdc cups-server-common distro-info-data fwupdate fwupdate-signed gir1.2-dbusmenu-glib-0.4 gir1.2-gtk-3.0
|
||||||
|
gir1.2-packagekitglib-1.0 gir1.2-snapd-1 gnome-settings-daemon gnome-settings-daemon-schemas grub-common grub-pc
|
||||||
|
python3-httplib2 python3-problem-report samba-libs systemd systemd-sysv ubuntu-drivers-common udev ufw
|
||||||
|
unattended-upgrades xdg-desktop-portal xdg-desktop-portal-gtk
|
||||||
|
119 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
|
||||||
|
Need to get 38.5 MB of archives.
|
||||||
|
After this operation, 475 kB of additional disk space will be used.
|
||||||
|
Do you want to continue? [Y/n]
|
||||||
|
.
|
||||||
|
.
|
||||||
|
Setting up grub-pc (2.02-2ubuntu8.13) ...
|
||||||
|
Installing for i386-pc platform.
|
||||||
|
Installation finished. No error reported.
|
||||||
|
Sourcing file `/etc/default/grub'
|
||||||
|
Generating grub configuration file ...
|
||||||
|
Found memtest86+ image: /boot/memtest86+.elf
|
||||||
|
Found memtest86+ image: /boot/memtest86+.bin
|
||||||
|
done
|
||||||
|
Setting up mesa-vdpau-drivers:amd64 (18.2.8-0ubuntu0~18.04.2) ...
|
||||||
|
Updating PPD files for cups ...
|
||||||
|
Setting up apport-gtk (2.20.9-0ubuntu7.6) ...
|
||||||
|
Setting up pulseaudio-module-bluetooth (1:11.1-1ubuntu7.2) ...
|
||||||
|
Processing triggers for libc-bin (2.27-3ubuntu1) ...
|
||||||
|
Processing triggers for initramfs-tools (0.130ubuntu3.7) ...
|
||||||
|
update-initramfs: Generating /boot/initrd.img-4.15.0-47-generic
|
||||||
|
```
|
||||||
|
|
||||||
|
It will run the self-updates once the distribution official packages update done.
|
||||||
|
|
||||||
|
```
|
||||||
|
―― rustup ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
|
||||||
|
info: checking for self-updates
|
||||||
|
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
|
||||||
|
info: checking for self-updates
|
||||||
|
|
||||||
|
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.33.0 (2aa4c46cf 2019-02-28)
|
||||||
|
```
|
||||||
|
|
||||||
|
Then it will try to update the packages that has installed with other package managers.
|
||||||
|
|
||||||
|
```
|
||||||
|
―― Flatpak User Packages ――――――――――――――――――――――――――――――――――――――――――――――――――――――――
|
||||||
|
Looking for updates...
|
||||||
|
Looking for updates...
|
||||||
|
Updating in system:
|
||||||
|
org.gnome.Platform/x86_64/3.30 flathub 862e6b8ec2b5
|
||||||
|
org.gnome.Platform.Locale/x86_64/3.30 flathub 5e66e981ae00
|
||||||
|
org.freedesktop.Platform.html5-codecs/x86_64/18.08 flathub 282fd2c4ef33
|
||||||
|
com.github.muriloventuroso.easyssh/x86_64/stable flathub c6bc3a3e72fb
|
||||||
|
new permissions: ssh-auth
|
||||||
|
com.github.muriloventuroso.easyssh.Locale/x86_64/stable flathub b705864b8d78
|
||||||
|
Updating: org.gnome.Platform/x86_64/3.30 from flathub
|
||||||
|
[####################] 16 delta parts, 10 loose fetched; 65539 KiB transferred in 63 seconds
|
||||||
|
Error: Failed to update org.gnome.Platform/x86_64/3.30: Flatpak system operation Deploy not allowed for user
|
||||||
|
|
||||||
|
Skipping org.gnome.Platform.Locale/x86_64/3.30 due to previous error
|
||||||
|
|
||||||
|
Skipping org.freedesktop.Platform.html5-codecs/x86_64/18.08 due to previous error
|
||||||
|
Updating: com.github.muriloventuroso.easyssh/x86_64/stable from flathub
|
||||||
|
[####################] 2 delta parts, 3 loose fetched; 1532 KiB transferred in 5 seconds
|
||||||
|
Error: Failed to update com.github.muriloventuroso.easyssh/x86_64/stable: Flatpak system operation Deploy not allowed for user
|
||||||
|
|
||||||
|
Skipping com.github.muriloventuroso.easyssh.Locale/x86_64/stable due to previous error
|
||||||
|
error: There were one or more errors
|
||||||
|
|
||||||
|
Retry? [y/N]
|
||||||
|
```
|
||||||
|
|
||||||
|
Then it will run the firmwre upgrade.
|
||||||
|
|
||||||
|
```
|
||||||
|
―― Firmware upgrades ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
|
||||||
|
Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz
|
||||||
|
Downloading… [***************************************]
|
||||||
|
Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, it shows the summary about the patching has done.
|
||||||
|
|
||||||
|
```
|
||||||
|
―― Summary ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
|
||||||
|
System update: OK
|
||||||
|
rustup: OK
|
||||||
|
Flatpak User Packages: FAILED
|
||||||
|
Firmware upgrade: OK
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.2daygeek.com/topgrade-upgrade-update-everything-in-single-command-on-linux/
|
||||||
|
|
||||||
|
作者:[Magesh Maruthamuthu][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.2daygeek.com/author/magesh/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://github.com/r-darwish/topgrade
|
||||||
|
[2]: https://www.2daygeek.com/category/aur-helper/
|
||||||
|
[3]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/
|
||||||
|
[4]: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/
|
Loading…
Reference in New Issue
Block a user