mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
4e217ed066
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (HankChow)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12098-1.html)
|
||||
[#]: subject: (How to Go Full Dark Mode in Ubuntu 20.04)
|
||||
[#]: via: (https://itsfoss.com/dark-mode-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
@ -12,15 +12,19 @@
|
||||
|
||||
> 深色模式是 Ubuntu 20.04 最受瞩目的[新功能][1]之一了。任何版本的 Ubuntu 都可以通过[安装深色主题][2]让用户界面拥有一个深色的外观,但在 Ubuntu 20.04 中,这个过程变得更简单。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/11/200841gvvaja25jaz5z7hv.jpg)
|
||||
|
||||
在 Ubuntu 20.04 中,无需额外安装主题,默认主题(称为 Yaru)本身就带有三种模式,其中就包括深色模式。
|
||||
|
||||
下面我会展示如何将 Ubuntu 系统完全设置为深色模式。
|
||||
|
||||
### 在 Ubuntu 20.04 打开深色模式
|
||||
|
||||
这个步骤将会在 GNOME 桌面上完成,如果你[使用的是其它桌面][4],你看到的可能会和下面的截图不一样。
|
||||
- [video](https://player.vimeo.com/video/405726943)
|
||||
|
||||
按下 super 键(或 Windows 键),然后输入“settings”,就可以找到系统设置。
|
||||
这个步骤是在 GNOME 桌面上进行的,如果你[使用的是其它桌面][4],你看到的可能会和下面的截图不一样。
|
||||
|
||||
按下 super 键(或 Windows 键),然后输入 “settings”,就可以找到系统设置。
|
||||
|
||||
![Search for Settings][5]
|
||||
|
||||
@ -82,7 +86,7 @@ via: https://itsfoss.com/dark-mode-ubuntu/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[HankChow](https://github.com/HankChow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,73 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news)
|
||||
[#]: via: (https://opensource.com/article/20/4/news-april-11)
|
||||
[#]: author: (Ben Cotton https://opensource.com/users/bcotton)
|
||||
|
||||
New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news
|
||||
======
|
||||
Catch up on the biggest open source headlines from the past two weeks.
|
||||
![][1]
|
||||
|
||||
In this edition of our open source news roundup, we take a look at GNOME Foundation's new contributor program, a new Linux integrity checker from Microsoft, a free software alternative to smart TVs, and more!
|
||||
|
||||
### GNOME Foundation launches a new contributor program
|
||||
|
||||
A key part of keeping open source communities vibrant and healthy is bringing in new contributors. To help promote this, the GNOME Foundation and Endless teamed up to launch the inaugural [Community Engagement Challenge][2]. Phase one launched this week by opening the call for submitting project applications. Candidate projects should be aimed at bringing beginners into open source and encouraging ongoing participation in open source communities. Projects don’t have to be coding, they can also be games, videos, written materials, and so on.
|
||||
|
||||
A panel of judges will select 20 projects to participate in phase two, where ideas will be turned into proofs of concept. At each phase, cash prizes will be awarded. [Proposals][3] are due July 1, 2020.
|
||||
|
||||
### Microsoft announces code integrity checker for Linux
|
||||
|
||||
When you run a program, you want it to be the one you think you’re running. This week, Microsoft announced [Integrity Policy Enforcement][4] (IPE), a Linux Security Model released under the GPLv2.
|
||||
|
||||
IPE is targeted toward specific-purpose devices like network firewalls, not for general-purpose computing. It provides runtime verification that the code being executed matches the desired version. This allows administrators to detect and block altered binaries.
|
||||
|
||||
IPE is currently in the Request for Comments stage on the [linux-security-module][5] mailing list.
|
||||
|
||||
### KDE announces Plasma Bigscreen
|
||||
|
||||
I recently bought a new TV and, if you haven’t been in the market lately, it’s hard to find “dumb” televisions. I didn’t want a smart TV because I worry about the manufacturer abandoning the software and what the device might do with my data. So KDE’s recent [Plasma Bigscreen][6] announcement caught my eye.
|
||||
|
||||
Plasma Bigscreen takes the KDE Plasma interface I use every day and combines it with [Mycroft AI][7] to turn single-board computers into a smart TV. The beta, released last month, includes support for the Raspberry Pi 4 (Model B).
|
||||
|
||||
### In other news
|
||||
|
||||
* [IVPN for Android is now available on F-Droid][8]
|
||||
* [IBM gives Outreachy $50,000 grant][9]
|
||||
* [Warren For President Tech Team open source many of their projects][10]
|
||||
* [Firefox 75.0 is released with a redesigned address bar and distribution via Flatpak][11]
|
||||
* [LineageOS releases version 17.1 based on Android 10][12]
|
||||
* [Linux kernel 5.6 released][13]
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/news-april-11
|
||||
|
||||
作者:[Ben Cotton][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/bcotton
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd
|
||||
[2]: https://www.gnome.org/challenge
|
||||
[3]: https://surveys.gnome.org/index.php/986379?lang=en
|
||||
[4]: https://microsoft.github.io/ipe/
|
||||
[5]: https://lore.kernel.org/linux-security-module/20200406181045.1024164-1-deven.desai@linux.microsoft.com/T/#m297116cd00666428c2ae3e627ff39653ebb691fb
|
||||
[6]: https://dot.kde.org/2020/03/26/plasma-tv-presenting-plasma-bigscreen
|
||||
[7]: https://mycroft.ai/
|
||||
[8]: https://www.ivpn.net/blog/ivpn-for-android-is-now-available-on-f-droid
|
||||
[9]: https://developer.ibm.com/blogs/ibm-second-open-source-community-grant-outreachy/
|
||||
[10]: https://medium.com/@teamwarren/open-source-tools-from-the-warren-for-president-tech-team-f1f27d2c7551
|
||||
[11]: https://www.mozilla.org/en-US/firefox/75.0/releasenotes/
|
||||
[12]: https://lineageos.org/Changelog-24/
|
||||
[13]: https://lore.kernel.org/lkml/CAHk-=wi9ZT7Stg-uSpX0UWQzam6OP9Jzz6Xu1CkYu1cicpD5OA@mail.gmail.com/
|
@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5 open source activities while you work from home)
|
||||
[#]: via: (https://opensource.com/article/20/4/open-source-activities)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
5 open source activities while you work from home
|
||||
======
|
||||
Work-life balance is important whether you're working from home
|
||||
temporarily or it's your usual mode of earning a living.
|
||||
![Person in a field of dandelions][1]
|
||||
|
||||
The mythos of the remote home office or the exciting archetype of the digital nomad are as appealing as they are dangerous. It's great to be able to avoid a commute, to be able to stay comfortable at home while getting lots of work done, and to be master of your own schedule. But along with those liberties, you inherit the responsibility of remembering to be a normal, functioning human being. Believe it or not, the two aren't mutually exclusive. You can do both, but you have to work at it. Here are some ideas on how.
|
||||
|
||||
### Plant something
|
||||
|
||||
![Seeeduino in the garden][2]
|
||||
|
||||
You may have an abundance of little ones to care for during the day, and if you do, you should read our [article][3] about fun open source projects for kids and parents. If you don't, or if you're just keen to try caring for something that's quiet, then you might find it satisfying to plant something.
|
||||
|
||||
I used to think gardening was something you did as a way to establish a routine: each morning, you wake up and tend to your plants before you start your day, each evening you might pull weeds, and so on. Now that I have a garden, I realize that it's more like a low-stress puzzle. Learning to tend to plants is a little like learning to program. You learn the basics first, you learn to debug (literally, in the case of aphids), and then you learn how to optimize growth and maybe even [how to automate plant care][4].
|
||||
|
||||
If you're not attracted to gardening, there are plenty of other [outdoor projects][5] that are useful in getting you outdoors with a purpose and encouraging you to go back out for more.
|
||||
|
||||
### Go for a walk
|
||||
|
||||
![Walking][6]
|
||||
|
||||
The phrases "go for a walk" or "get some fresh air" are so common that they seem trite, but that doesn't make the result any less valid. Getting outside your usual workspace is vital for clarity and drive, but sometimes going outside feels a little pointless. You can only walk around the block so many times before the journey loses excitement.
|
||||
|
||||
If you need a goal for ambling around your neighborhood, you can download a handy app called [StreetComplete][7]. It's a quest-based app that presents you with points of interest in your area with incomplete [Open Street Map][8] data. You can help crowdsource better open source maps by verifying and providing information through the app. Suddenly, that aimless meandering you don't really want to do is a fun quest for you and your family.
|
||||
|
||||
### Diversify
|
||||
|
||||
![Mini stapler][9]
|
||||
|
||||
Being in an office can present exciting challenges, whether it's because you're in a dynamic industry or in a petty fight with a colleague over ownership of a stapler. When you work from home, your daily routine can get pretty, well, routine. If that's the case, it might be time to diversify.
|
||||
|
||||
If you've been meaning to [get involved with open source][10], now's a great time for it.
|
||||
|
||||
If you suspect you might be artistic (or even if you're convinced you're not, but you have something you want to express), then maybe it's time to finally learn how to create some [digital imagery][11].
|
||||
|
||||
Or maybe you're curious about programming. It might be easier than you think and given enough free time, you might even end up with [your own game written in Python][12].
|
||||
|
||||
### Make some music
|
||||
|
||||
![Music keyboardas][13]
|
||||
|
||||
Artistic expression is important, whether you're working from home or living with someone who's bored at home. The great thing about music is that you don't need to be _musical_ to [make some really cool noise][14]. In fact, you can make some [wild sounds on a Raspberry Pi][15], if you have one lying around.
|
||||
|
||||
If you happen to be musical, though, you can have a go at a digital audio workstation like [Qtractor][16] or [Rosegarden][17]. For inspiration, read about a [professional composer][18] and the music festival he created.
|
||||
|
||||
### Refurbish
|
||||
|
||||
![Old computers][19]
|
||||
|
||||
I don't like it when good things go to waste, especially computers. Read about [refurbishing old computers][20] and [really old computers][21], and then rummage around in your attic to find one for your own experiments.
|
||||
|
||||
### Meet the challenge
|
||||
|
||||
Being stuck at home for long periods of time, whether it's for a few weeks or the better part of your career, can be challenging. However, open source is a vast landscape of opportunity. Explore and find the parts of it that appeal to you. You can build a hobby, and maybe even a career, out of all the fun things you can do with other people's toys.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/open-source-activities
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_dandelion_520x292.png?itok=-xhFQvUj (Person in a field of dandelions)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/diversions_seeeduino.jpg (Seeeduino in the garden)
|
||||
[3]: https://opensource.com/article/19/12/kids-students-education
|
||||
[4]: https://opensource.com/article/17/3/arduino-garden-projects
|
||||
[5]: https://opensource.com/article/19/5/hardware-outdoors
|
||||
[6]: https://opensource.com/sites/default/files/uploads/diversions_walk.jpg (Walking)
|
||||
[7]: https://opensource.com/article/20/1/streetcomplete-crowdsource-maps
|
||||
[8]: https://opensource.com/article/17/8/openstreetmap
|
||||
[9]: https://opensource.com/sites/default/files/uploads/diversions_stapler.jpg (Mini stapler)
|
||||
[10]: https://opensource.com/article/17/10/open-source-cats
|
||||
[11]: https://opensource.com/life/12/6/design-without-debt-five-tools-for-designers
|
||||
[12]: https://opensource.com/article/17/10/python-101
|
||||
[13]: https://opensource.com/sites/default/files/uploads/diversions_keyboards.jpg (Music keyboards)
|
||||
[14]: https://opensource.com/life/16/2/linux-multimedia-studio
|
||||
[15]: https://opensource.com/article/20/3/sonic-pi
|
||||
[16]: https://opensource.com/article/17/6/qtractor-audio
|
||||
[17]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden
|
||||
[18]: https://opensource.com/article/20/2/linux-open-source-music
|
||||
[19]: https://opensource.com/sites/default/files/uploads/diversions_old-computers.jpg (Old computers)
|
||||
[20]: https://opensource.com/article/19/7/how-make-old-computer-useful-again
|
||||
[21]: https://opensource.com/article/20/2/restore-old-computer-linux
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,221 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create web tutorials with Reveal.js and Git)
|
||||
[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git)
|
||||
[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell)
|
||||
|
||||
Create web tutorials with Reveal.js and Git
|
||||
======
|
||||
Workshop slides can be viewed consistently on any browser, device, and
|
||||
platform with this easy workflow.
|
||||
![Person reading a book and digital copy][1]
|
||||
|
||||
Whether you're a learner or a teacher, you probably recognize the value of online workshops set up like slideshows for communicating knowledge. If you've ever stumbled upon one of these well-organized tutorials that are set up page by page, chapter by chapter, you may have wondered how hard it was to create such a website.
|
||||
|
||||
Well, I'm here to show you how easy it is to generate this type of workshop using a fully automated process.
|
||||
|
||||
### Introduction
|
||||
|
||||
When I started putting my learning content online, it was not a nice, seamless experience. So, I wanted something repeatable and consistent that was also easy to maintain, since my content changes as the technology I teach progresses.
|
||||
|
||||
I tried many delivery models, from low-level code generators, such as [Asciidoctor][2], to laying out a workshop in a single PDF file. All failed to satisfy me. When I deliver live, onsite workshops, I like using slideshows, so I wondered if I could do the same thing for my online, self-paced workshop experiences.
|
||||
|
||||
After some digging, I built a foundation for creating painless workshop websites. It helped that I was already using a presentation-generation framework that resulted in a website-friendly format (HTML).
|
||||
|
||||
### Setting it up
|
||||
|
||||
Here the basic components you need for this project:
|
||||
|
||||
* Workshop idea (this is your problem, can't help you here)
|
||||
* Reveal.js for the workshop slides
|
||||
* GitLab project repository
|
||||
* Your favorite HTML code editor
|
||||
* Web browser
|
||||
* Git installed on your machine
|
||||
|
||||
|
||||
|
||||
If this list looks intimidating, there's a quick way to get started that doesn't involve pulling all the pieces together one by one: You can use my template project to give you a kickstart with the slides and project setup.
|
||||
|
||||
This article assumes you're familiar with Git and projects hosted on a Git platform like GitLab. If you need a refresher or tutorial, check out our [introductory Git series][3].
|
||||
|
||||
Start by cloning the template project to your local machine:
|
||||
|
||||
|
||||
```
|
||||
`$ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git`
|
||||
```
|
||||
|
||||
Set up a new GitLab project for this and import the template project as the initial import.
|
||||
|
||||
There are a number of important files for the workshop website. In the **root** directory, you'll find a file called **.gitlab-ci.yml**, which is used as a trigger when you commit changes to the master branch (i.e., merge pull requests to **master**). It triggers a copy of the complete contents of the **slides** directory into the GitLab project's **website** folder.
|
||||
|
||||
I have this hosted as a project called **beginners-guide-automated-workshops** in my GitLab account. When it deploys, you can view the contents of the **slides** directory in your browser by navigating to:
|
||||
|
||||
|
||||
```
|
||||
`https://eschabell.gitlab.io/beginners-guide-automated-workshops`
|
||||
```
|
||||
|
||||
For your user account and project, the URL would look like:
|
||||
|
||||
|
||||
```
|
||||
`https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]`
|
||||
```
|
||||
|
||||
These are the basic materials you need to start creating your website content. When you push changes, they will automatically generate your updated workshop website. Note that the default template contains several example slides, which will be your first workshop website after you complete the full check-in to your repository.
|
||||
|
||||
The workshop template results in a [reveal.js][4] slideshow that can run in any browser, with automatic resizing that allows it to be viewed by almost anyone, anywhere, on any device.
|
||||
|
||||
How's that for creating handy and accessible workshops?
|
||||
|
||||
### How it works
|
||||
|
||||
With this background in place, you're ready to explore the workshop materials and start putting your content together. Everything you need can be found in the project's **slides** directory; this is where all of the magic happens with reveal.js to create the workshop slideshow in a browser.
|
||||
|
||||
The files and directories you'll be working with to craft your workshop are:
|
||||
|
||||
* The **default.css** file
|
||||
* The **images** directory
|
||||
* The **index.html** file
|
||||
|
||||
|
||||
|
||||
Open each one in your favorite HTML/CSS editor and make the changes described below. It does not matter which editor you use; I prefer [RubyMine IDE][5] because it offers a page preview in the local browser. This helps when I'm testing out content before pushing it online to the workshop website.
|
||||
|
||||
#### Default.css file
|
||||
|
||||
The file **css/theme/default.css** is the base file where you will set important global settings for your workshop slides. The two main items of interest are the default font and background image for all slides.
|
||||
|
||||
In **default.css**, look at the section labeled **GLOBAL STYLES**. The current default font is listed in the line:
|
||||
|
||||
|
||||
```
|
||||
`font-family: "Red Hat Display", "Overpass", san-serif;`
|
||||
```
|
||||
|
||||
If you're using a non-standard font type, you must import it (as was done for the Overpass font type) in the line:
|
||||
|
||||
|
||||
```
|
||||
`@import url('SOME_URL');`
|
||||
```
|
||||
|
||||
The **background** is the default image for every slide you create. It is stored in the **images** directory (see below) and set in the line below (focus on the image path):
|
||||
|
||||
|
||||
```
|
||||
`background: url("…/…/images/backgrounds/basic.png")`
|
||||
```
|
||||
|
||||
To set a default background, just point this line to the image you want to use.
|
||||
|
||||
#### Images directory
|
||||
|
||||
As its name implies, the **images** directory is used for storing the images you want to use on your workshop slides. For example, I usually put screenshots that demonstrate the progress of the workshop topic on my individual slides.
|
||||
|
||||
For now, just know that you need to store the background images in a subdirectory (**backgrounds**) and the images you plan to use in your slides in the **Images** directory.
|
||||
|
||||
#### Index.html file
|
||||
|
||||
Now that you have those two files sorted out, you'll spend the rest of your time creating slides in the HTML files, starting with **index.html**. For your workshop website to start taking shape, pay attention to the following three sections in this file:
|
||||
|
||||
* The **head** section, where you set the title, author, and description
|
||||
* The **body** section, where you find the individual slides to design
|
||||
* Each **section**, where you define the contents of individual slides
|
||||
|
||||
|
||||
|
||||
Start with the **head** section, since it's at the top. The template project has three placeholder lines for you to update:
|
||||
|
||||
|
||||
```
|
||||
<title>INSERT-YOUR-TITLE-HERE</title>
|
||||
<meta name="description" content="YOUR DESCIPTION HERE.">
|
||||
<meta name="author" content="YOUR NAME">
|
||||
```
|
||||
|
||||
The **title** tag contains the text that appears in the browser tab when the file is open. Change it to something relevant to the title of your workshop (or maybe a section of your workshop), but remember to keep it short since tab title space is limited. The **description** meta tag contains a short description of your workshop, and the **author** meta tag is where you should put your name (or the workshop creator's name, if you're doing this for someone else).
|
||||
|
||||
Now move on to the **body** section. You'll notice that it's divided into a number of **section** tags. The opening of the **body** contains a comment that explains that you're creating slides for each open and closing tag labeled **section**:
|
||||
|
||||
|
||||
```
|
||||
<body>
|
||||
<div class="reveal">
|
||||
|
||||
<!-- Any section element inside of this container is displayed as a slide -->
|
||||
<div class="slides">
|
||||
```
|
||||
|
||||
Next, create your individual slides, with each slide enclosed in **section** tags. The template includes a few slides to help you get started. For example, here's the first slide:
|
||||
|
||||
|
||||
```
|
||||
<section>
|
||||
<div style="width: 1056px; height: 300px">
|
||||
<h1>Beginners guide</h1>
|
||||
<h2>to automated workshops</h2>
|
||||
</div>
|
||||
<div style="width: 1056px; height: 200px; text-align: left">
|
||||
Brought to you by,<br/>
|
||||
YOUR-NAME<br/>
|
||||
</div>
|
||||
<aside class="notes">Here are notes: Welcome to the workshop!</aside>
|
||||
</section>
|
||||
```
|
||||
|
||||
This slide has two areas divided with **div** tags. Spacing separates the title and the author.
|
||||
|
||||
Assuming you have some knowledge of using HTML, try various things to develop your workshop. It's really handy to use a browser as you go to preview the results. Some IDEs provide local viewing of changes, but you can also open the **index.html** file and view your changes before pushing them to the repository.
|
||||
|
||||
Once you're satisfied with your workshop, push your changes, and wait for them to pass through the continuous integration pipeline. They'll be hosted like the template project at <https://eschabell.gitlab.io/beginners-guide-automated-workshops>.
|
||||
|
||||
### Learn more
|
||||
|
||||
To learn more about what you can do with this workflow, check out the following example workshops and sites that host workshop collections. All of these are based on the workflow described in this article.
|
||||
|
||||
Workshop examples:
|
||||
|
||||
* [Red Hat Process Automation Manage workshop][6]
|
||||
* [JBoss Travel Agency BPM Suite online workshop][7]
|
||||
|
||||
|
||||
|
||||
Workshop collections:
|
||||
|
||||
* [Rule the world: Practical decisions & process automation development workshops][8]
|
||||
* [Application development in the cloud workshop][9]
|
||||
* [Portfolio architecture: Workshops for creating impactful architectural diagrams][10]
|
||||
|
||||
|
||||
|
||||
I hope this beginner's guide and the template workshop project show you easy and painless it can be to develop and maintain workshop websites in a consistent manner. I also hope this workflow gives your workshop audiences full access to your content on almost any device so they can learn from the knowledge you're sharing.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/create-web-tutorial-git
|
||||
|
||||
作者:[Eric D. Schabell][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/eschabell
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy)
|
||||
[2]: https://asciidoctor.org/
|
||||
[3]: https://opensource.com/resources/what-is-git
|
||||
[4]: https://revealjs.com/#/
|
||||
[5]: https://www.jetbrains.com/ruby/
|
||||
[6]: https://gitlab.com/bpmworkshop/rhpam-devops-workshop
|
||||
[7]: https://gitlab.com/bpmworkshop/presentation-bpmworkshop-travel-agency
|
||||
[8]: https://bpmworkshop.gitlab.io/
|
||||
[9]: https://appdevcloudworkshop.gitlab.io/
|
||||
[10]: https://redhatdemocentral.gitlab.io/portfolio-architecture-workshops
|
157
sources/tech/20200410 Get started with Bash programming.md
Normal file
157
sources/tech/20200410 Get started with Bash programming.md
Normal file
@ -0,0 +1,157 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Get started with Bash programming)
|
||||
[#]: via: (https://opensource.com/article/20/4/bash-programming-guide)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Get started with Bash programming
|
||||
======
|
||||
Learn how to write custom programs in Bash to automate your repetitive
|
||||
tasks. Download our new eBook to get started.
|
||||
![Command line prompt][1]
|
||||
|
||||
One of the original hopes for Unix was that it would empower everyday computer users to fine-tune their computers to match their unique working style. The expectations around computer customization have diminished over the decades, and many users consider their collection of apps and websites to be their "custom environment." One reason for that is that the components of many operating systems are not open, so their source code isn't available to normal users.
|
||||
|
||||
But for Linux users, custom programs are within reach because the entire system is based around commands available through the terminal. The terminal isn't just an interface for quick commands or in-depth troubleshooting; it's a scripting environment that can reduce your workload by taking care of mundane tasks for you.
|
||||
|
||||
### How to learn programming
|
||||
|
||||
If you've never done any programming before, it might help to think of it in terms of two different challenges: one is to understand how code is written, and the other is to understand what code to write. You can learn _syntax_—but you won't get far without knowing what words are available to you in the _language_. In practice, you start learning both concepts all at once because you can't learn syntax without words to arrange, so initially, you write simple tasks using basic commands and basic programming structures. Once you feel comfortable with the basics, you can explore more of the language so you can make your programs do more and more significant things.
|
||||
|
||||
In [Bash][2], most of the _words_ you use are Linux commands. The _syntax_ is Bash. If you already use Bash on a frequent basis, then the transition to Bash programming is relatively easy. But if you don't use Bash, you'll be pleased to learn that it's a simple language built for clarity and simplicity.
|
||||
|
||||
### Interactive design
|
||||
|
||||
Sometimes, the hardest thing to figure out when learning to program is what a computer can do for you. Obviously, if a computer on its own could do everything you do with it, then you wouldn't have to ever touch a computer again. But the reality is that humans are important. The key to finding something your computer can help you with is to take notice of tasks you repeatedly do throughout the week. Computers handle repetition particularly well.
|
||||
|
||||
But for you to be able to tell your computer to do something, you must know how to do it. This is an area Bash excels in: interactive programming. As you perform an action in the terminal, you are also learning how to script it.
|
||||
|
||||
For instance, I was once tasked with converting a large number of PDF books to versions that would be low-ink and printer-friendly. One way to do this is to open the PDF in a PDF editor, select each one of the hundreds of images—page backgrounds and textures counted as images—delete them, and then save it to a new PDF. Just one book would take half a day this way.
|
||||
|
||||
My first thought was to learn how to script a PDF editor, but after days of research, I could not find a PDF editing application that could be scripted (outside of very ugly mouse-automation hacks). So I turned my attention to finding out to accomplish the task from within a terminal. This resulted in several new discoveries, including GhostScript, the open source version of PostScript (the printer language PDF is based on). By using GhostScript for the task for a few days, I confirmed that it was the solution to my problem.
|
||||
|
||||
Formulating a basic script to run the command was merely a matter of copying the command and options I used to remove images from a PDF and pasting them into a text file. Running the file as a script would, presumably, produce the same results.
|
||||
|
||||
### Passing arguments to a Bash script
|
||||
|
||||
The difference between running a command in a terminal and running a command in a shell script is that the former is interactive. In a terminal, you can adjust things as you go. For instance, if I just processed **example_1.pdf** and am ready to process the next document, to adapt my command, I only need to change the filename.
|
||||
|
||||
A shell script isn't interactive, though. In fact, the only reason a shell _script_ exists is so that you don't have to attend to it. This is why commands (and the shell scripts that run them) accept arguments.
|
||||
|
||||
In a shell script, there are a few predefined variables that reflect how a script starts. The initial variable is **$0**, and it represents the command issued to start the script. The next variable is **$1**, which represents the first "argument" passed to the shell script. For example, in the command **echo hello**, the command **echo** is **$0,** and the word **hello** is **$1**. In the command **echo hello world**, the command **echo** is **$0**, **hello** is **$1**, and **world** is **$2**.
|
||||
|
||||
In an interactive shell:
|
||||
|
||||
|
||||
```
|
||||
$ echo hello world
|
||||
hello world
|
||||
```
|
||||
|
||||
In a non-interactive shell script, you _could_ do the same thing in a very literal way. Type this text into a text file and save it as **hello.sh**:
|
||||
|
||||
|
||||
```
|
||||
`echo hello world`
|
||||
```
|
||||
|
||||
Now run the script:
|
||||
|
||||
|
||||
```
|
||||
$ bash hello.sh
|
||||
hello world
|
||||
```
|
||||
|
||||
That works, but it doesn't take advantage of the fact that a script can take input. Change **hello.sh** to this:
|
||||
|
||||
|
||||
```
|
||||
`echo $1`
|
||||
```
|
||||
|
||||
Run the script with two arguments grouped together as one with quotation marks:
|
||||
|
||||
|
||||
```
|
||||
$ bash hello.sh "hello bash"
|
||||
hello bash
|
||||
```
|
||||
|
||||
For my PDF reduction project, I had a real need for this kind of non-interactivity, because each PDF took several minutes to condense. But by creating a script that accepted input from me, I could feed the script several PDF files all at once. The script processed each one sequentially, which could take half an hour or more, but it was a half-hour I could use for other tasks.
|
||||
|
||||
### Flow control
|
||||
|
||||
It's perfectly acceptable to create Bash scripts that are, essentially, transcripts of the exact process you took to achieve the task you need to be repeated. However, scripts can be made more powerful by controlling how information flows through them. Common methods of managing a script's response to data are:
|
||||
|
||||
* if/then
|
||||
* for loops
|
||||
* while loops
|
||||
* case statements
|
||||
|
||||
|
||||
|
||||
Computers aren't intelligent, but they are good at comparing and parsing data. Scripts can feel a lot more intelligent if you build some data analysis into them. For example, the basic **hello.sh** script runs whether or not there's anything to echo:
|
||||
|
||||
|
||||
```
|
||||
$ bash hello.sh foo
|
||||
foo
|
||||
$ bash hello.sh
|
||||
|
||||
$
|
||||
```
|
||||
|
||||
It would be more user-friendly if it provided a help message when it receives no input. That's an if/then statement, and if you're using Bash in a basic way, you probably wouldn't know that such a statement existed in Bash. But part of programming is learning the language, and with a little research you'd learn about if/then statements:
|
||||
|
||||
|
||||
```
|
||||
if [ "$1" = "" ]; then
|
||||
echo "syntax: $0 WORD"
|
||||
echo "If you provide more than one word, enclose them in quotes."
|
||||
else
|
||||
echo "$1"
|
||||
fi
|
||||
```
|
||||
|
||||
Running this new version of **hello.sh** results in:
|
||||
|
||||
|
||||
```
|
||||
$ bash hello.sh
|
||||
syntax: hello.sh WORD
|
||||
If you provide more than one word, enclose them in quotes.
|
||||
$ bash hello.sh "hello world"
|
||||
hello world
|
||||
```
|
||||
|
||||
### Working your way through a script
|
||||
|
||||
Whether you're looking for something to remove images from PDF files, or something to manage your cluttered Downloads folder, or something to create and provision Kubernetes images, learning to script Bash is a matter of using Bash and then learning ways to take those scripts from just a list of commands to something that responds to input. It's usually a process of discovery: you're bound to find new Linux commands that perform tasks you never imagined could be performed with text commands, and you'll find new functions of Bash to make your scripts adaptable to all the different ways you want them to run.
|
||||
|
||||
One way to learn these tricks is to read other people's scripts. Get a feel for how people are automating rote commands on their systems. See what looks familiar to you, and look for more information about the things that are unfamiliar.
|
||||
|
||||
Another way is to download our [introduction to programming with Bash][3] eBook. It introduces you to programming concepts specific to Bash, and with the constructs you learn, you can start to build your own commands. And of course, it's free to download and licensed under a [Creative Commons][4] license, so grab your copy today.
|
||||
|
||||
### [Download our introduction to programming with Bash eBook!][3]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/bash-programming-guide
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt)
|
||||
[2]: https://opensource.com/resources/what-bash
|
||||
[3]: https://opensource.com/downloads/bash-programming-guide
|
||||
[4]: https://opensource.com/article/20/1/what-creative-commons
|
@ -0,0 +1,136 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages)
|
||||
[#]: via: (https://opensource.com/article/20/4/ai-translation)
|
||||
[#]: author: (Daniel Whitenack https://opensource.com/users/datadan)
|
||||
|
||||
How I'm using AI to translate 'wash your hands' in 500 languages
|
||||
======
|
||||
By using both human and machine-generated translations, key health
|
||||
phrases can be translated into local languages spoken all over the
|
||||
world.
|
||||
![Two diverse hands holding a globe][1]
|
||||
|
||||
You might not know, but there are currently [7,117 languages spoken in the world][2]. Not dialects, but living languages! However, much of the world's digital media is available in only a couple dozen languages, and translation platforms like Google Translate only support around 100 languages. This reality means that there are billions of people around the world that are marginalized due to a lack of timely access to information. The current coronavirus (COVID-19) pandemic has made this painfully clear, and it has stressed the need for immediate, rapid translation of health-related phrases (like "wash your hands" or "keep your distance") into the long tail of languages.
|
||||
|
||||
To this end, I applied state-of-the-art AI techniques to construct something close to the phrase "wash your hands" in 544 languages and counting (my GPUs are still running). Multilingual Unsupervised and Supervised Embeddings (MUSE) methods are used to train cross-lingual word embeddings between each of 544 languages and English. These embeddings then allow for the extraction of a phrase similar to the target phrase from existing documents.
|
||||
|
||||
I performed this work in collaboration with my colleagues at SIL International, who have gathered even more human translations of the phrase. The combination of these human translations and some of my machine translations can be searched on [this Ethnologue guide page][3] (machine-generated phrases are indicated with a little robot icon), and more translations will be added as they are generated/gathered.
|
||||
|
||||
### Leveraging existing corpora
|
||||
|
||||
SIL International has done linguistic work in over 2000 languages and is currently managing over 1600 language projects. Thus, as I approached this particular problem, I knew that we had likely already translated the phrase "wash your hands" and/or similar phrases many times into hundreds of languages, and that guess paid off in spades. I was able to quickly gather documents (mostly completed shell book templates, educational materials, and Bibles) from our archives in over 900 languages. Each of these documents has an English parallel, which necessarily includes the phrase "wash your hands" and/or similar phrases like "wash your face." Moreover, each of these documents is very high quality and translated and checked in cooperation with the local language communities.
|
||||
|
||||
That is quite the multilingual data set. However, there are two problems to overcome. First, this data included thousands of samples for most languages, which is in contrast to the millions used to train machine translation models. Second, even if the documents include the phrase "wash your hands" in the target language, we don't know the exact location of the phrase within the surrounding text.
|
||||
|
||||
We could certainly exploit some of the latest tricks in [machine translation for low resource languages][4], but it would take some time to tune automated methods for rapidly adapting translation models in each language pair. Moreover, many of the languages we are targeting have no existing baseline with which we could compare evaluation metrics, e.g., [BLEU score][5]. Given the pressing concerns about the Coronavirus pandemic, we wanted to move a bit faster than that (although we plan to return to this problem in the future).
|
||||
|
||||
I opted to try and construct the phrase "wash your hands" by finding the phrase itself or components of the phrase (like "wash your" or "your hands") in existing documents. To find these, I trained cross-lingual embedding for each {English, Target Language} pair using [Multilingual Unsupervised and Supervised Embedding (MUSE)][6] from Facebook Research. MUSE takes monolingual word embeddings as input (I used [_fasttext_][7] to generate these) and learns a mapping from the English to the target embedding space using adversarial methods. The output of this process is cross-lingual word embeddings.
|
||||
|
||||
![Using fasttext along with MUSE to perform cross-language embedding][8]
|
||||
|
||||
Once the cross-lingual embeddings are generated, we can get to finding the phrase components in the target language documents. As it turns out, the phrase "wash your face" was most clearly used throughout the documents along with instances of "hands," "wash your," etc. in isolation. For each of the languages, I search through n-grams in areas where I expected the phrase to appear (based on its usage in the English parallel). N-grams were vectorized using the cross-lingual embedding and compared with vectorized versions of the English phrases using various distance metrics. The n-grams that were "closest" to the English phrases in the embedding space were determined to be the target language matches.
|
||||
|
||||
Finally, component phrases matching their English counterparts were combined to generate the phrase "wash your hands" in the target language. This combination utilizes the cross-lingual embedding again to make sure that the components are combined in an appropriate manner. For example, if we matched the phrase "wash your feet" in the target language, the n-gram corresponding to "feet" must be replaced with the n-gram corresponding to "hands." Here's an example for Belize Kriol English:
|
||||
|
||||
![][9]
|
||||
|
||||
There were, of course, some assumptions that were made during this matching process, and it is entirely possible that this procedure does not produce grammatically correct predictions. For example, I assumed that in most languages, the word for "hands" and the word for "feet" are both one token long (with tokens being separated by spaces and punctuation). This is certainly not always the case. This could create a bad word salad something like "and wash the and hand you" or similar. Hopefully, we can overcome some of these limitations and extend the system in the future, but, for now, we chose to reinforce the idea with graphics.
|
||||
|
||||
We adapted the World Health Organization's hand washing instructions into a template PNG image. We then took our translated and generated phrases and rendered them into the hand washing image using a combination of Bash and Go scripts. In this way, the idea of proper hand washing is emphasized in both text and imagery (just in case our generated translations are awkward).
|
||||
|
||||
![][10]
|
||||
|
||||
### Results
|
||||
|
||||
Thus far, I've been able to train cross-lingual embeddings for 544 languages. I used the above-discussed method to try and construct "wash your hands" for all of these languages. Because I don't have aligned data for many of the language pairs, I used separate holdout documents also containing components of "wash your hands" to help validate the tokens in the constructed phrase. This gives us some confidence in the translations that we publicly release (at least that they contain information indicating washing and/or hands). In addition, I compared the method with language pairs that are also supported by Google Translate and/or have available human translations. Here's a sample of the translations with language stats from [the Ethnologue][11]:
|
||||
|
||||
#### Language: Italian [ita]
|
||||
|
||||
Location: Italy
|
||||
Population: 68,000,000
|
||||
Our system: "làvati la mani"
|
||||
Google Translate: "Lavati le mani"
|
||||
|
||||
#### Language: Bulgarian [bul]
|
||||
|
||||
Location: Bulgaria
|
||||
Population: 8,000,000
|
||||
Our system: "умий ръцете"
|
||||
Google Translate: "Измий си ръцете"
|
||||
|
||||
#### Language: Dutch [nld]
|
||||
|
||||
Location: Netherlands
|
||||
Population: 24,000,000
|
||||
Our system: "wast uw handen"
|
||||
Google Translate: "Was je handen"
|
||||
|
||||
#### Language: Pijin [pis]
|
||||
|
||||
Location: Solomon Islands
|
||||
Population: 550,000
|
||||
Our system: "wasim han"
|
||||
Google Translate: Not supported
|
||||
|
||||
#### Language: Tikar [tik]
|
||||
|
||||
Location: Cameroon
|
||||
Population: 110,000
|
||||
Our system: "ɓɔsi fyàʼ"
|
||||
Google Translate: Not supported
|
||||
|
||||
#### Language: Waffa [waj]
|
||||
|
||||
Location: Papua New Guinea
|
||||
Population: 1,300
|
||||
Our system: "yaakuuvaitana nnikiiyauvaa fini"
|
||||
Google Translate: Not supported
|
||||
|
||||
The constructed phrases are similar to reference translations or appear to be alternative ways of saying "wash your hands." For example, in Bulgarian, I predict "умий ръцете," and Google Translate predicts "Измий си ръцете." However, if I back-translate my prediction using Google Translate, I still get "wash your hands." There is some uncertainty where I can't compare to reference translations (e.g., Pijin [pis] from the Solomon Islands) or human-annotated spans, but I can still validate that the word for wash (wasim) and the word for hands (han) are used in other reference documents that are necessarily talking about washing, or hands, respectively. About 15% of the translations could be validated using this method, and I hope to validate more as I gather reference dictionaries.
|
||||
|
||||
Note, I used at most about 7,000 sentences in each language to get the above translations, even for high-resource languages like Italian. I also did not rely on aligned sentences between the language pairs. Despite this very data-scarce, unsupervised scenario, I was still able to obtain phrases similar to that of Google Translate for languages supported by both systems. This demonstrates the potential utility of this sort of "hybrid" approach (unsupervised alignment of word embeddings + rule-based matching) for translating short phrases into languages where very little data exists.
|
||||
|
||||
Note—I'm definitely not saying that this is a solution to the problem of information spread about Coronavirus and other health-related issues. There are still a lot of things to explore and formally evaluate here, and we are working on that. In many cases, this approach won't be able to help construct important informational material in hundreds of languages. However, I think that we should all be trying to develop creative solutions to problems related to the current crisis. Maybe this is one piece of a very large puzzle.
|
||||
|
||||
You can view the complete list of validated translations plus human translations on [this Ethnologue guide page][3]. In addition, a more thorough description and analysis of the system in paper form is forthcoming. We welcome feedback from the public on the translations to help fine-tune the system and, most of all, to make sure that health information gets out to marginalized language communities around the world.
|
||||
|
||||
### Create your own hand washing posters
|
||||
|
||||
We have open sourced [the code used to render complex scripts and generate the hand washing posters][12]. This methodology should be able to handle almost all languages and scripts. You can add your own translation of "wash your hands" to a poster to help spread the word or tailor the translations for your own local context. Be sure to share your generated posters on social media with the hashtag #WashYourHands.
|
||||
|
||||
### Develop your AI skills
|
||||
|
||||
There are so many exciting AI problems out there that can make a huge impact in the world. If you want to solve problems like the one above with AI or if you think your business might need to start leveraging AI for other things (supply chain optimization, recommendation, customer service automation, etc.), don't miss the [_AI Classroom_ training event this May][13]. _AI Classroom_ is an immersive, three-day virtual training event for anyone with at least some programming experience and foundational understanding of mathematics. The training provides a practical baseline for realistic AI development using Python and open source frameworks like TensorFlow and PyTorch. After completing the course, participants will have the confidence to start developing and deploying their own AI solutions.
|
||||
|
||||
_This article was republished with permission from <https://datadan.io/blog/wash-your-hands>_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/ai-translation
|
||||
|
||||
作者:[Daniel Whitenack][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/datadan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe)
|
||||
[2]: https://www.ethnologue.com/guides/how-many-languages
|
||||
[3]: https://www.ethnologue.com/guides/health
|
||||
[4]: https://datadan.io/blog/resources-for-low-resource-machine-translation
|
||||
[5]: https://en.wikipedia.org/wiki/BLEU
|
||||
[6]: https://github.com/facebookresearch/MUSE
|
||||
[7]: https://fasttext.cc/
|
||||
[8]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom.gif (Using fasttext along with MUSE to perform cross-language embedding)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom2.gif
|
||||
[10]: https://opensource.com/sites/default/files/uploads/ai-language-translation-wash-your-hands-opensourcedotcom3.gif
|
||||
[11]: https://www.ethnologue.com/
|
||||
[12]: https://github.com/sil-ai/wash-your-hands
|
||||
[13]: https://datadan.io/
|
@ -0,0 +1,55 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How Kubernetes saved my desktop application)
|
||||
[#]: via: (https://opensource.com/article/20/4/kubernetes-desktop-application)
|
||||
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
|
||||
|
||||
How Kubernetes saved my desktop application
|
||||
======
|
||||
Keep this fix in mind if you have a broken Java desktop application but
|
||||
aren't a crypto expert.
|
||||
![Puzzle pieces coming together to form a computer screen][1]
|
||||
|
||||
Recently, fellow Opensource.com scribe James Farrell wrote a wonderful article entitled _[How Ansible brought peace to my home][2]_. In addition to the great article, I really liked the title, one of those unexpected phrases that I’m sure brought a smile to many faces.
|
||||
|
||||
I recently had a weird but positive experience of my own that begs a similar sort of unexpected label. I’ve been grappling with a difficult problem that arose when upgrading some server and networking infrastructure that broke a Java application I’ve been supporting since the early 2000s. Strangely enough, I found the solution in what appears to be a very informative and excellent article on Kubernetes, of all things.
|
||||
|
||||
Without further ado, here is my problem:
|
||||
|
||||
![][3]
|
||||
|
||||
I’m guessing that most readers will look at that message and think things like, "I hope there’s more info in the log file," or "I’m really glad I’ve never received a message like that."
|
||||
|
||||
Unfortunately, there isn’t a lot of info in the log file, just the same message, in fact. In an effort to debug this, I did three things:
|
||||
|
||||
1. I searched online for the message. Interestingly, or perhaps ominously, there were only 200 or so hits on this string, [one of which suggested][4] [turn][4][ing][4] [on more debugging output][4], which involved adding the setting
|
||||
|
||||
|
||||
```
|
||||
**-Djavax.net.debug=ssl:handshake:verbose**[/code] to the **java** command running the application.
|
||||
|
||||
2. I tried that suggestion, which resulted in a lot of output (good), most of which only vaguely made sense to me as I’m no kind of expert in the underlying bits of stuff like SSL. But one thing I did notice is that there was no information regarding a response from the server in the midst of all of that output;
|
||||
|
||||
3. So I searched some more.
|
||||
|
||||
|
||||
|
||||
|
||||
Another interesting part of this problem is that the code ran fine when executed by the Java command bundled in the OpenJDK, but failed with this error when using a customized runtime [created from the same OpenJDK in this way][5]. So the relatively modest number of apparently similar problems turned up from search #1 above were actually not all that relevant since they all seemed to be dealing mostly with bad SSL certificates on the server in conjunction with the PostgreSQL JDBC’s ability to check the server’s credentials.
|
||||
|
||||
I should also mention that it took me quite some time to realize that the problem was introduced by using the custom Java runtime, as I managed to check many other possibilities along the way (and indeed, I did fix a few minor bugs while I was at it). My efforts included things like getting the latest OpenJDK, checking and re-checking all the URLs in case one had a typo, and so forth.
|
||||
|
||||
As often happens, after putting the problem aside for a few hours, an idea occurred to me—perhaps I was missing some module in the customized Java runtime. While I didn’t receive any errors directly suggesting that problem, the observable fact that the standard OpenJDK environment worked while the custom one failed seemed to hint at that possibility. I took a quick look in the **jmods/** folder in the OpenJDK installation, but there are some 70 modules there and nothing jumped out at me.
|
||||
|
||||
But again, what seemed odd was, with debugging turned on (see #1 above), there was no indication of what the server would accept, just what the client mostly couldn’t offer, many lines like this:
|
||||
```
|
||||
`Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA`
|
||||
```
|
||||
So I was at least thinking by this time that maybe what was missing was the module that offered those kinds of cipher suites. So I started searching with strings like "jdbc crypto," and in the midst of that, the most unlikely article showed up: [Optimizing Kubernetes Services—Part 2: Spring Web][6], written by [Juan Medina][7]. Midway down the article, I spotted the following:
|
||||
|
||||
![][8]
|
||||
|
||||
Huh! Imagine that, his script is creating a custom Java runtime, just like mine. But he says he needs to add in manually the module **jdk.crypto.ec** in order t
|
@ -0,0 +1,204 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create web tutorials with Reveal.js and Git)
|
||||
[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git)
|
||||
[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell)
|
||||
|
||||
使用 Reveal.js 和 Git 创建网页教程
|
||||
======
|
||||
|
||||
> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上一致地查看。
|
||||
|
||||
![Person reading a book and digital copy][1]
|
||||
|
||||
无论你是学习者还是教师,你可能都会认识到采用幻灯片放映来传播知识的在线<ruby>研讨会<rt>workshop</rt></ruby>的价值。如果你曾经偶然看到过这样一个逐页、逐章设置的井井有条的教程,你可能会想知道创建这样的一个网站有多难。
|
||||
|
||||
好吧,让我在这里向你展示,使用全自动化的流程来生成这样的教程是多么容易。
|
||||
|
||||
### 介绍
|
||||
|
||||
当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我的教学技术而进步。
|
||||
|
||||
我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为自己的在线的,自定进度的研讨会体验做同样的事情。
|
||||
|
||||
经过一番挖掘,我为创建无痛的研讨会网站打下了基础。当时我已经在使用一个演示文稿生成框架,这对我来说是很有帮助的,因为这个框架可以产生对网站友好的格式(HTML)。
|
||||
|
||||
### 设置
|
||||
|
||||
这里是这个项目所需要的基本组件。
|
||||
|
||||
* 研讨会的想法(这是你的问题,我帮不了你)
|
||||
* 用于研讨会幻灯片的 Reveal.js
|
||||
* GitLab 项目仓库
|
||||
* 你最喜欢的 HTML 代码编辑器
|
||||
* Web 浏览器
|
||||
* 在你的机器上安装好 Git
|
||||
|
||||
如果这个列表看起来令人望而生畏,那么有一个快速入门的方法,不需要把所有的东西一个个都拉到一起。你可以用我的模板项目来给你提供幻灯片和项目设置的入门教程。
|
||||
|
||||
本文假设你熟悉 Git 和托管在 Git 平台(如 GitLab)上的项目。如果你需要指导或教程,请查看我们的[Git 入门系列][3]。
|
||||
|
||||
首先,将模板项目克隆到本地机器上。
|
||||
|
||||
```
|
||||
$ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git
|
||||
```
|
||||
|
||||
为此设置一个新的 GitLab 项目,导入模板项目作为初始导入。
|
||||
|
||||
研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即合并拉取请求到 `master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。
|
||||
|
||||
我把它托管在我的 GitLab 账户中,名为 `beginners-guide-automated-workshops`。当它部署完毕后,你可以在浏览器中通过导航到下列地址查看 `slides` 目录的内容:
|
||||
|
||||
```
|
||||
https://eschabell.gitlab.io/beginners-guide-automated-workshops
|
||||
```
|
||||
|
||||
对于你的用户帐户和项目,URL 如下所示:
|
||||
|
||||
```
|
||||
https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]
|
||||
```
|
||||
|
||||
这些是你开始创建网站内容所需要的基本素材。当你推送修改后,它们会自动生成更新过的研讨会网站。请注意,默认模板包含了几个示例幻灯片,这将是你完成对存储库的完整签入后的第一个研讨会网站。
|
||||
|
||||
研讨会模板生成的结果是一个 [receive.js][4] 幻灯片,可以在任何浏览器中运行,并可以自动调整大小,几乎可以让任何人在任何地方、任何设备上观看。
|
||||
|
||||
这样创建一个方便、易访问的研讨会怎么样?
|
||||
|
||||
### 它是如何工作的
|
||||
|
||||
有了这些背景信息,你就可以开始探索研讨会的这些素材,并开始把你的内容放在一起了。你需要的一切都可以在项目的 `slides` 目录中找到;这里是使用 reveal.js 在浏览器中创建研讨会幻灯片的地方。
|
||||
|
||||
你将用来制作研讨会的文件和目录是:
|
||||
|
||||
* `default.css`文件
|
||||
* `images` 目录
|
||||
* `index.html`文件
|
||||
|
||||
在你喜欢的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。
|
||||
|
||||
#### default.css 文件
|
||||
|
||||
文件 `css/theme/default.css` 是一个基础文件,你将在这里为你的研讨会幻灯片设置重要的全局设置。其中值得注意的两个主要的项目是所有幻灯片的默认字体和背景图片。
|
||||
|
||||
在 `default.css` 中,看一下标有 `GLOBAL STYLES` 的部分。当前的默认字体在这一行中列出了。
|
||||
|
||||
```
|
||||
font-family: "Red Hat Display", "Overpass", san-serif;
|
||||
```
|
||||
|
||||
如果你使用的是非标准字体类型,则必须在以下行中将其导入(与 Overpass 字体类型相同):
|
||||
|
||||
```
|
||||
@import url('SOME_URL');
|
||||
```
|
||||
|
||||
`background` 是你创建的每张幻灯片的默认图像。它存储在 `images` 目录下(见下面),并在下面这一行中设置(重点是图像路径)。
|
||||
|
||||
```
|
||||
background: url("…/…/images/backgrounds/basic.png")
|
||||
```
|
||||
|
||||
要设置一个默认背景,只需将这一行指向你要使用的图片。
|
||||
|
||||
#### images 目录
|
||||
|
||||
顾名思义,`images` 目录是用来存储你想在研讨会幻灯片上使用的图片。例如,我通常会把展示研讨会主题进展的截图放在我的个人幻灯片上。
|
||||
|
||||
现在,你只需要知道你需要将背景图片存储在一个子目录(`backgrounds`)中,并将你计划在幻灯片中使用的图片存储在 `images` 目录中。
|
||||
|
||||
#### index.html 文件
|
||||
|
||||
现在你已经把这两个文件整理好了,剩下的时间你就可以在 HTML 文件中创建幻灯片了,从 `index.html` 开始。为了让你的研讨会网站开始成形,请注意这个文件中的以下三个部分。
|
||||
|
||||
* `head `部分,在这里你可以设置标题、作者和描述。
|
||||
* `body` 部分,你可以在这里找到要设计的单个幻灯片。
|
||||
* 你可以在每个 `section` 中定义各个幻灯片的内容。
|
||||
|
||||
从 `head` 部分开始,因为它在顶部。模板项目有三个占位符行供你更新。
|
||||
|
||||
```
|
||||
<title>INSERT-YOUR-TITLE-HERE</title>
|
||||
<meta name="description" content="YOUR DESCIPTION HERE.">
|
||||
<meta name="author" content="YOUR NAME">
|
||||
```
|
||||
|
||||
`title` 标签包含文件打开时显示在浏览器选项卡中的文字。请将其改为与你的研讨会的标题相关的内容(或研讨会的某个部分),但记得要简短,因为标签页的标题空间有限。`description` 元标签包含了对你的工作坊的简短描述,而 `author` 元标签是你应该把你的名字(如果你是为别人写的,则是工作坊创建者的名字)。
|
||||
|
||||
现在继续到 `body` 部分。你会注意到它被分成了许多 `section` 标签。`body` 的开头包含了一个注释,说明你正在为每个标有 `section` 的打开和关闭的标签创建幻灯片。
|
||||
|
||||
|
||||
```
|
||||
<body>
|
||||
<div class="reveal">
|
||||
|
||||
<!-- Any section element inside of this container is displayed as a slide -->
|
||||
<div class="slides">
|
||||
```
|
||||
|
||||
接下来,创建你的各个幻灯片,每张幻灯片都用 `section` 标签封装起来。这个模板包括了一些幻灯片来帮助你开始制作。例如,这里是第一张幻灯片。
|
||||
|
||||
```
|
||||
<section>
|
||||
<div style="width: 1056px; height: 300px">
|
||||
<h1>Beginners guide</h1>
|
||||
<h2>to automated workshops</h2>
|
||||
</div>
|
||||
<div style="width: 1056px; height: 200px; text-align: left">
|
||||
Brought to you by,<br/>
|
||||
YOUR-NAME<br/>
|
||||
</div>
|
||||
<aside class="notes">Here are notes: Welcome to the workshop!</aside>
|
||||
</section>
|
||||
```
|
||||
|
||||
这张幻灯片有两个区域,用 `div` 标签划分。用空格隔开了标题和作者。
|
||||
|
||||
如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。你使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。
|
||||
|
||||
一旦你对你的研讨会感到满意,推送你的修改,然后等待它们通过持续集成管道。它们将像模板项目一样被托管在 <https://eschabell.gitlab.io/beginners-guide-automated-workshops>。
|
||||
|
||||
### 了解更多
|
||||
|
||||
要了解更多关于这个工作流程可以做什么,请查看下面的示例研讨会和托管了研讨会集合的网站。所有这些都是基于本文中描述的工作流程。
|
||||
|
||||
研讨会的例子:
|
||||
|
||||
* [Red Hat Process Automation Manage workshop][6]
|
||||
* [JBoss Travel Agency BPM Suite online workshop][7]
|
||||
|
||||
研讨会集合:
|
||||
|
||||
* [Rule the world: Practical decisions & process automation development workshops][8]
|
||||
* [Application development in the cloud workshop][9]
|
||||
* [Portfolio architecture: Workshops for creating impactful architectural diagrams][10]
|
||||
|
||||
我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护工作室网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/create-web-tutorial-git
|
||||
|
||||
作者:[Eric D. Schabell][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/eschabell
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy)
|
||||
[2]: https://asciidoctor.org/
|
||||
[3]: https://opensource.com/resources/what-is-git
|
||||
[4]: https://revealjs.com/#/
|
||||
[5]: https://www.jetbrains.com/ruby/
|
||||
[6]: https://gitlab.com/bpmworkshop/rhpam-devops-workshop
|
||||
[7]: https://gitlab.com/bpmworkshop/presentation-bpmworkshop-travel-agency
|
||||
[8]: https://bpmworkshop.gitlab.io/
|
||||
[9]: https://appdevcloudworkshop.gitlab.io/
|
||||
[10]: https://redhatdemocentral.gitlab.io/portfolio-architecture-workshops
|
Loading…
Reference in New Issue
Block a user