mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-27 02:30:10 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
af88b843a1
published
20160823 Getting Started with HTTP2 - Part 1.md20160929 Getting Started with HTTP2 - Part 2.md20161005 GETTING STARTED WITH ANSIBLE.md20161229 How Setup Go in Docker and Deploy an Application.md20170104 5 Ways to Find a Binary Command Description and Location on File System.md
sources
talk
20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md20170109 How to get started as an open source programmer.md20170110 What engineers and marketers can learn from each other.md20170111 How to choose your first programming language.md
tech
20161220 How Linux got to be Linux: Test driving 1993-2003 distros.md20161222 Top open source creative tools in 2016.md20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md20161224 10 Interesting Linux Command Line Tricks and Tips Worth Knowing.md20161225 Minecraft Server on Linux.md20161226 Top 10 open source projects of 2016.md20170104 50 ways to avoid getting hacked in 2017.md20170104 How to change the Linux IO scheduler to fit your needs.md20170104 Speed up your downloads with Axel command line downloader.md20170106 inxi – A Great Tool to Check Hardware Information on Linux.md20170107 Min Browser Muffles the Web Noise.md20170109 4 open source alternatives to Trello that you can self-host.md20170109 How to record a region of your desktop as animated GIF on Linux.md20170109 Open technology for land rights documentation.md20170109 Troubleshooting tips for the 5 most common Linux issues.md20170110 Why we need an open model to design and evaluate public policy.md20170111 Explore climate data with open source tools.md20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md
translated
talk
20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md20170111 The difference between development and deployment.md
tech
20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md20160823 Getting Started with HTTP2 - Part 1.md20161227 The Dos and Donts of Writing Test cases in Android.md20161228 10 Linux System Administrators New Years Resolutions 2017.md20161229 5 Most Promising New Linux Distributions to Look Forward in 2017.md20161229 How Setup Go in Docker and Deploy an Application.md20161230 Hot programming trends in 2016.md20161231 How to Trace Execution of Commands in Shell Script with Shell Tracing.md20170103 4 hot skills for Linux pros in 2017.md20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md20170110 Improve your programming skills with Exercism.md
62
published/20160823 Getting Started with HTTP2 - Part 1.md
Normal file
62
published/20160823 Getting Started with HTTP2 - Part 1.md
Normal file
@ -0,0 +1,62 @@
|
||||
初识 HTTP/2(一)
|
||||
============================================================
|
||||

|
||||
|
||||
> 用披萨来说明当你订单数很大的时候 HTTP/2 是怎么打败 HTTP/1.1 的。
|
||||
|
||||
在建立网站和应用的方式上 HTTP/2 有些令人惊叹的改变,在 HTTP/2 发布后的一年半,几乎 [10% 的网站使用了 HTTP/2][4]。它绝对值得采用,但是这篇文章应该首先推给使用 HTTP/2 的前端开发者。这个连载的文章是指导前端开发者怎么转换到 HTTP/2。
|
||||
|
||||
本文涵盖了 HTTP/2 对 HTTP/1.1 来说有什么提高的内容,并且向前端开发者介绍了 HTTP/2。
|
||||
|
||||
### 再次让我想起什么是 HTTP ...
|
||||
|
||||
超文本传输协议,也就是 HTTP,这个协议决定了 web 内容怎么传输。HTTP/1.1 在 1999 年被标准化,那时候的 web 和现在有很大的不同,表格霸占了整个网络。样式通常被内联在元素中,如果网站管理员更加的细致,他们会在头部写个 `<style>`标签。 JavaScript 也被丢在文档里面,那时候完整的网站通常也不会超过几页。
|
||||
|
||||
HTTP/1.1 预计这种情况会持续一段时间,所以它并没有太过关注在让一个站点可以加载大量的资源方面,因为那时候的开发者并不需要这个。因此它使用了一个非常简单的方式来处理资源,你访问一个资源然后服务器去寻找它,并且返回你访问的资源,或者告诉你这个资源不存在。这种被叫作"线头堵塞"方式非常高效,但是当你需要多个资源的时候,这个进程会依次寻找每个资源。这意味着在你访问第二个资源之前,服务器必须找到你访问的第一个资源并且载入它,或者告诉你没找到。
|
||||
|
||||
### 大型站点的发展
|
||||
|
||||
在 1999 年之后的几年里,随着 php 和其他像 Rails 这样的动态语言的崛起,站点变得越来越复杂。css 文件也随着向响应式开发的转变而变的越来越大,因此像 Sass 这样的可以创造一个简单的工作环境的 CSS 编译器就应运而生。 JavaScript 也在 web 上有了更大的作用,它允许开发者编写复杂的应用,这曾经只是 C++ 开发人员的工作。随着 Retina 和高清显示屏的兴起,也让图片变得更高清。随着这些改变,文件大小呈现指数式的增长,使得本来是等待几个字节的资源变成了加载几千字节,甚至在某些情况下有几兆。当你开始载入页面的其它东西前,必须先载入数百 K 的东西,你只能乐观的假设你的用户有很快的网络接入。
|
||||
|
||||
想象 HTTP/1.1 是个过去的那种柜台购买式的街旁披萨店。你能自己过去并且预定一个雪碧和 2 片 Angry Hawaiian ,然后等待 3 分钟。他们可以很容易地处理这些,实际上这是一个蓬勃发展的商业模式-定单简单、处理迅速。
|
||||
|
||||

|
||||
|
||||
然而,一旦你决定在同样的披萨店主办一场小区域的季度颁奖典礼,事情就变的更复杂了。每个人都预定不同的东西,快速而杂乱无章让等待时间直线上升。
|
||||
|
||||

|
||||
|
||||
### 哪里是 HTTP/2 的舞台
|
||||
|
||||
HTTP/2 对前端开发者主要的承诺就是复用。意思就是资源请求能发生在同一时间,并且服务器能马上响应这些资源。在请求之间没有等待,因为它们发生在同一时间。
|
||||
|
||||
使用同样的比喻,HTTP/2 允许披萨店在餐馆他们自己区域举办派对。派一个服务员接受订单,并把所有已经准备好的订单交付。当其他人的比萨在制作的时候,你也不需要花 30 分钟去等待你的雪碧,它们在第一批交付的东西之中。这方式使得管理大量订单更加简单,并且防止人们等他们的订单时间太长。
|
||||
|
||||
复用带给我们的 web 开发的大变化是改变了文件的加载方式。帮助绕过资源加载的 HTTP/1.1 瓶颈的方式是通过连接和压缩需要被加载的文件。所有任务运行器都默认采取这样的操作方式,或者需要作一点小设置就行。和过去一样,开发人员可以将图像放在精灵拼图(sprite sheets)中,这会减少了对服务器的请求数。
|
||||
|
||||
### 改进 HTTP/1.1
|
||||
|
||||
将文件连接起来是个处理 HTTP1.1 的请求限制问题的非常聪明的方式,但是连接文件的主要问题是它要求用户第一次访问整个网站时下载所有的资源。一旦它们载入后,浏览器就会缓存所有的资源。这能提高用户每次访问网页时的速度,但是前期负载很重,对[跳出率不利][5]。此外,他们可能为所不访问的页面加载资源。期望用户访问每个页面以查看每个样式,并与每个脚本进行交互是不现实的。此外,在加拿大和欧洲以及几乎每个美国移动提供商的地方,有每月的带宽上限。不是加载额外的 54 千字节的内容就会超过每月的流量限制,而是让我们假设用户想保留这些额外的流量看 Taylor Swift 的 gif。
|
||||
|
||||
使用 HTTP/2 和多路复用,您可以开发一些最高效的网站,但它需要一些重新思考、甚至撤销之前的最佳做法。重复一次,我的目的是加快 HTTP/2 的会话,使用我们新的工具,我们可以发现这些新的最佳的做法。
|
||||
|
||||
在我的下一篇文章,[我将探索建设基于 HTTP/2 的网站的一些最好方式][6]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.viget.com/articles/getting-started-with-http-2-part-1?imm_mid=0eb24a&cmp=em-web-na-na-newsltr_20161130
|
||||
|
||||
作者:[Ben][a]
|
||||
译者:[hkurj](https://github.com/hkurj)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.viget.com/about/team/btinsley
|
||||
[1]:https://twitter.com/home?status=Using%20pizza%20to%20show%20how%20HTTP%2F2%20beats%20HTTP%2F1.1%20when%20your%20orders%20get%20too%20big.%20https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-1
|
||||
[2]:https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-1
|
||||
[3]:http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-1
|
||||
[4]:https://w3techs.com/technologies/details/ce-http2/all/all
|
||||
[5]:https://blog.kissmetrics.com/speed-is-a-killer/
|
||||
[6]:https://www.viget.com/articles/getting-started-with-http-2-part-2
|
||||
[7]:https://www.viget.com/about/team/btinsley
|
@ -1,10 +1,10 @@
|
||||
初识 HTTP/2(第二部分)
|
||||
初识 HTTP/2(二)
|
||||
============================================================
|
||||

|
||||
|
||||
首先制定一个坚定的 HTTP/2 前端开发目标。
|
||||
> HTTP/2 时代的开启为前端开发带来了最佳体验。
|
||||
|
||||
如果你对 HTTP/2 有所了解,那你可能用过它,或者至少想过怎样能把它融入你的项目中。尽管有很多关于它如何改变工作流程,提高 Web 速度和效率等方面的猜想,但最好的使用方式还没有定下来。这里我想讲的就是我在之前的项目中所发现的 HTTP/2 的最佳实践。
|
||||
如果你对 HTTP/2 有所了解,那你可能用过它,或者至少想过怎样能把它融入你的项目中。尽管有很多关于它如何改变工作流程,提高 Web 速度和效率等方面的猜想,但最佳使用方式还没有定下来。这里我想讲的就是我在之前的项目中所发现的 HTTP/2 的最佳实践。
|
||||
|
||||
如果你还不确定什么是 HTTP/2,或者为什么它能改进你的工作,可以先看看我[介绍背景方面的第一篇文章][4]。
|
||||
|
||||
@ -12,118 +12,116 @@
|
||||
|
||||
### 🙏 [热身工作]
|
||||
|
||||
首先组织好你的文件。看一看下面的文件树结构,作为组织样式表的起点:
|
||||
首先组织好你的文件。看一看下面的文件树结构,作为组织你的样式表的起点:
|
||||
|
||||
```
|
||||
`/styles
|
||||
/styles
|
||||
|── /setup
|
||||
| /* variables, mixins and functions */
|
||||
| /* 变量、混入(minin)和函数 */
|
||||
|── /global
|
||||
| /* reusable components that could be within any component or section */
|
||||
| /* 能放在任何组件和部分中的可重用组件 */
|
||||
|── /components
|
||||
| /* specific components and sections */
|
||||
|── setup.scss // index for setup styles
|
||||
|── global.scss // index for global styles`
|
||||
| /* 特殊组件和部分 */
|
||||
|── setup.scss // setup 样式索引
|
||||
|── global.scss // 全局样式索引
|
||||
```
|
||||
|
||||
这会把你的样式分到三个目录下面:Setup,Global 和 Componenets。接下来我会说明这些目录对你的项目有什么用。
|
||||
这会把你的样式分到三个目录下面:`setup`、`global` 和 `componenets`。接下来我会说明这些目录对你的项目有什么用。
|
||||
|
||||
### Setup 目录
|
||||
### setup 目录
|
||||
|
||||
Setup 目录保存所有的变量,函数,mixins 以及其它文件正常编译需要的任意定义。要想让这个目录物尽其用,把这个目录下所有内容导入到 `setup.scss` 文件中是个很不错的主意,这样这个文件就会像下面所展示的一样:
|
||||
`setup` 目录保存所有的变量、函数、混入(minin)以及一些正常编译需要的其它文件的定义。要想让这个目录物尽其用,把这个目录下所有内容导入到 `setup.scss` 文件中是个很不错的主意,这样这个文件就会像下面所展示的一样:
|
||||
|
||||
```
|
||||
`/* setup.scss */
|
||||
/* setup.scss */
|
||||
|
||||
/* variables */
|
||||
/* 变量 */
|
||||
@import "setup/variables/colors";
|
||||
|
||||
/* mixins */
|
||||
/* 混入 */
|
||||
@import "setup/mixins/color";
|
||||
|
||||
/* functions */
|
||||
/* 函数 */
|
||||
@import "setup/functions/color";
|
||||
|
||||
... etc`
|
||||
... 等等
|
||||
```
|
||||
|
||||
现在我们能快速引用这个站点中的所有定义,应该确保在所有的样式文件顶部包含我们这里创建的这个文件。
|
||||
|
||||
### Global 目录
|
||||
### global 目录
|
||||
|
||||
接下来的目录,Global (全局)目录,应该包含可在当前站点的多个部分或者每一个页面中重复使用的组件。像按钮、文本、主要样式以及你的浏览器默认设置应该放在这里。我不建议把 <ruby>头部<rt>header</rt></ruby> 或 <ruby>底部样式<rt>footer styles</rt></ruby> 放在这儿,因为某些项目中没有头部,或者不同页面头部不同。而且,底部永远是页面的最后一个元素,所以在用户加载完当前站点的其它东西前,不必过分优先考虑加载底部样式。
|
||||
接下来的目录,global 目录,应该包含可在当前站点的多个部分或者每一个页面中重复使用的组件。像按钮、文本、主要样式,以及你的浏览器默认设置应该放在这里。我不建议把页面的头部或底部样式放在这儿,因为某些项目中没有头部,或者不同页面头部不同。而且,底部永远是页面的最后一个元素,所以在用户加载完当前站点的其它东西前,不必过分优先考虑加载底部样式。
|
||||
|
||||
记住,如果没有那些定义在 Setup 目录下的东西,你的 Global 样式就可能没有作用,你的 Global 文件看起来应该像这样:
|
||||
记住,如果没有那些定义在 setup 目录下的东西,你的 global 样式就可能没有作用,你的 global 文件看起来应该像这样:
|
||||
|
||||
```
|
||||
`/* global.scss */
|
||||
/* global.scss */
|
||||
|
||||
/* application definitions */
|
||||
/* 应用定义 */
|
||||
@import "setup";
|
||||
|
||||
/* global styles */
|
||||
/* 全局样式 */
|
||||
@import "global/reset";
|
||||
@import "global/buttons";
|
||||
@import "global/typography";
|
||||
@import "global/grid";
|
||||
|
||||
... etc`
|
||||
... 等等
|
||||
```
|
||||
|
||||
注意,首先要做的就是导入 Setup 样式。这样的话,这个样式里定义的所有文件都能够获得引用。
|
||||
注意,首先要做的就是导入 setup 样式。这样的话,之后的文件都可以引用这个样式里的定义。
|
||||
|
||||
由于 Global 样式需要存在于每个页面中,我们可以用典型的方式加载它们,在 `<head>` 标签内用一个 `<link>` 标签。你所看到的将是一个十分小巧的 css 文件,或者说理论上小巧的,这取决于你需要多少全局样式。
|
||||
由于站点内的每个页面都需要 global 样式,我们可以用典型的方式,在 `<head>` 标签内用一个 `<link>` 标签来加载它们。你所看到的将是一个十分小巧的 css 文件,或者说理论上小巧的,这取决于你需要多少全局样式。
|
||||
|
||||
### 最后,你的组件
|
||||
|
||||
注意,我没有在上述文件树中的 Components(组件)目录里包含索引文件。这是 HTTP/2 所带来的效用。直到现在,我们已经按照标准步骤构建了一个典型的站点,包含 <ruby>相当简单的结构<rt>fairly lean infrastructure</rt></ruby>,选择仅仅全局化那些最重要的样式。组件充当他们自己的索引文件。
|
||||
注意,我没有在上述目录树中的 components 目录里包含索引文件。这是 HTTP/2 所带来的效用。直到现在,我们已经按照标准步骤构建了一个典型的站点,保持相当简单的结构,仅选择全局化那些最重要的样式。组件充当它们自己的索引文件。
|
||||
|
||||
大多数开发者有独特的组织组件的方式,因此我并不想影响你的策略。但是,你所有的组件看起来应该像这样:
|
||||
|
||||
```
|
||||
`/* header.scss */
|
||||
/* header.scss */
|
||||
|
||||
/* application definitions */
|
||||
/* 应用定义 */
|
||||
@import "../setup";
|
||||
|
||||
header {
|
||||
// styles
|
||||
// 样式
|
||||
}
|
||||
|
||||
... etc`
|
||||
... 等等
|
||||
```
|
||||
|
||||
同样的,你要把 Setup 样式包含进来,确保所有东西在编译时都有定义。除了编译这些文件,以及可能要把他们放到 /assets 目录,以便很容易找到模版,对这些文件你不必 <ruby>链接 <rt>concatenate</rt></ruby>、<ruby>压缩<rt>minify</rt></ruby> 或者改变什么。
|
||||
同样的,你要把 setup 样式包含进来,确保所有东西在编译时都定义过。除了编译这些文件,以及可能要把他们放到 `/assets` 目录,以便很容易找到模版,对这些文件你不必 <ruby>拼接<rt>concatenate</rt></ruby>、<ruby>压缩<rt>minify</rt></ruby> 它们或者改变什么。
|
||||
|
||||
现在样式表已经差不多了,构建站点应该很简单。
|
||||
|
||||
|
||||
### 构建组件
|
||||
|
||||
或许对于模板语言你有自己的选择,这取决于你的项目,有可能是 Twig, Rails, Jade 或者 Handlebars。我认为考虑组件最好的方式是它是否有自己的模版文件,它该有个与名字相应的样式。这样你的项目中,模版和样式的比例就会是个不错的 1:1 的比例,而且你知道哪个文件有哪些东西,哪里有哪个文件,因为它们的命名是有规律的。
|
||||
或许对于模板语言你有自己的选择,这取决于你的项目,有可能是 Twig、Rails、Jade 或者 Handlebars。我认为考虑组件最好的方式是它是否有自己的模版文件,它该有个与名字相应的样式。这样你的项目中,模版和样式的比例就会是个不错的 1:1 的比例,而且你知道哪个文件有哪些东西,哪里有哪个文件,因为它们的命名是有规律的。
|
||||
|
||||
现在它正步入正轨,用好 HTTP/2 的多种功能十分简单,让我们做一个模版:
|
||||
|
||||
```
|
||||
`{# header.html #}
|
||||
{# header.html #}
|
||||
|
||||
{# compiled header styles #}
|
||||
<link href="assets/components/header.css" rel="stylesheet" media="all">
|
||||
|
||||
<header>
|
||||
<h1>This Awesome HTTP/2 Site</h1>
|
||||
... etc`
|
||||
... 等等
|
||||
```
|
||||
|
||||
非常好!在模版里你可能有更简单的方式链接资源,但这里显示你所要做的仅是在开始构建时,在模版文件中链接一个小小的头部样式。这将允许你的站点仅仅加载特定资源到任意给定页面的组件中,而且,能够设定页面从头到脚的组件的优先级。
|
||||
|
||||
非常好!在模版里你可能有更简单的方式链接到资源,但这里显示你所要做的仅是在开始构建时,在模版文件中链接一个小小的头部样式。这将允许你的站点仅仅加载特定资源到任意给定页面的组件中,而且,能够设定页面从头到脚的组件的优先级。
|
||||
|
||||
### 结合在一起
|
||||
|
||||
现在所有的组件都有结构,浏览器将会类似以下来渲染它们:
|
||||
现在所有的组件都有结构,浏览器将会类似以下方式来渲染它们:
|
||||
|
||||
```
|
||||
`<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" media="all" href="/assets/global.css">
|
||||
@ -156,11 +154,10 @@ header {
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>`
|
||||
</html>
|
||||
```
|
||||
|
||||
这是一个高级别方法,但你的项目中可能有调整的<ruby>更细致的<rt>finer-tuned</rt></ruby>组件。例如,在头部的 `<nav>` 组件可能要加载自己的样式表。尽你所能地自由发挥,让组件更有作用 - HTTP/2 不会因这些需求而阻碍你!
|
||||
|
||||
这是一个高级别方法,但你的项目中可能有调整的更细致的组件。例如,在头部的 `<nav>` 组件可能要加载自己的样式表。尽你所能地自由发挥,让组件更有作用 - HTTP/2 不会因这些需求而阻碍你!
|
||||
|
||||
### 结论
|
||||
|
||||
@ -180,5 +177,5 @@ via: https://www.viget.com/articles/getting-started-with-http-2-part-2
|
||||
[1]:https://twitter.com/home?status=Firmly%20planting%20a%20flag%20in%20the%20sand%20for%20HTTP%2F2%20best%20practices%20for%20front%20end%20development.%20https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-2
|
||||
[2]:https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-2
|
||||
[3]:http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-2
|
||||
[4]:https://www.viget.com/articles/getting-started-with-http-2-part-1
|
||||
[4]:https://linux.cn/article-8111-1.html
|
||||
[5]:https://github.com/http2/http2-spec/wiki/Tools
|
@ -1,29 +1,29 @@
|
||||
开始使用Ansible
|
||||
Ansible 起步指南
|
||||
==========
|
||||
|
||||
|
||||
这是一篇关于 Ansible 的课程,你也可以用来作小项目的模板,或者继续深入这个工具。在本指南的最后,你将了解足够的自动化服务器配置、部署等。
|
||||
这是一篇关于 Ansible 的速成课程,你可以用作小项目的模板,或者帮你深入了解这个神奇的工具。阅读了本指南之后,你将对自动化服务器配置、部署等有足够的了解。
|
||||
|
||||
### Ansible 是什么,为什么你该了解?
|
||||
|
||||
Ansible是一个简单的配置管理系统。你只需要访问你的服务器或设备的ssh。它也不同于其他工具,因为它使用push的方式,而不是像chef那样使用pull的方式。你可以将代码部署到任意数量的服务器上,配置网络设备或在基础架构中自动执行任何操作。
|
||||
Ansible 简单的说是一个配置管理系统(configuration management system)。你只需要可以使用 ssh 访问你的服务器或设备就行。它也不同于其他工具,因为它使用推送的方式,而不是像 puppet 或 chef 那样使用拉取的方式。你可以将代码部署到任意数量的服务器上,配置网络设备或在基础架构中自动执行任何操作。
|
||||
|
||||
#### 要求
|
||||
### 前置要求
|
||||
|
||||
假设你使用 Mac 或 Linux 作为你的工作站,Ubuntu Trusty为你的服务器,并有一些安装软件包的经验。此外,你的计算机上将需要以下软件。所以,如果你还没有它们,请先安装:
|
||||
假设你使用 Mac 或 Linux 作为你的工作站,Ubuntu Trusty 作为你的服务器,并有一些安装软件包的经验。此外,你的计算机上将需要以下软件。所以,如果你还没有它们,请先安装:
|
||||
|
||||
- Virtualbox
|
||||
- Vagrant
|
||||
- Mac 用户: Homebrew
|
||||
- [Virtualbox](https://www.virtualbox.org/)
|
||||
- [Vagrant](https://www.vagrantup.com/downloads.html)
|
||||
- Mac 用户:[Homebrew](http://brew.sh/)
|
||||
|
||||
#### 情景
|
||||
我们将模拟2个连接到MySQL数据库的Web应用程序服务器。Web应用程序使用Rails 5和Puma。
|
||||
### 情景
|
||||
|
||||
我们将模拟 2 个连接到 MySQL 数据库的 Web 应用程序服务器。Web 应用程序使用 Rails 5 和 Puma。
|
||||
|
||||
### 准备
|
||||
|
||||
#### Vagrantfile
|
||||
|
||||
为这个项目创建一个文件夹并将下面的内容保存到:Vagrantfile
|
||||
为这个项目创建一个文件夹,并将下面的内容保存到名为 `Vagrantfile` 的文件。
|
||||
|
||||
```
|
||||
VMs = [
|
||||
@ -46,9 +46,9 @@ Vagrant.configure(2) do |config|
|
||||
end
|
||||
```
|
||||
|
||||
### 配置你的虚拟网络
|
||||
#### 配置你的虚拟网络
|
||||
|
||||
我们希望我们的虚拟机能互相交互,但不要让流量流出到真实的网络,所以我们将在Virtualbox中创建一个仅在主机的网络适配器。
|
||||
我们希望我们的虚拟机能互相交互,但不要让流量流出到真实的网络,所以我们将在 Virtualbox 中创建一个仅主机(HOST-Only)的网络适配器。
|
||||
|
||||
1. 打开 Virtualbox
|
||||
2. 转到 Preferences
|
||||
@ -56,18 +56,18 @@ end
|
||||
4. 单击 Host-Only
|
||||
5. 单击添加网络
|
||||
6. 单击 Adapter
|
||||
7. 将IPv4设置为 10.1.1.1,IPv4网络掩码:255.255.255.0
|
||||
7. 将 IPv4 设置为 `10.1.1.1`,IPv4 网络掩码:`255.255.255.0`
|
||||
8. 单击 “OK”
|
||||
|
||||
#### 测试虚拟机及虚拟网络
|
||||
|
||||
在终端中,在具有Vagrantfile的目录中,输入下面的命令:
|
||||
在终端中,在存放 `Vagrantfile` 的项目目录中,输入下面的命令:
|
||||
|
||||
```
|
||||
vagrant up
|
||||
```
|
||||
|
||||
这回创建你的虚拟机,因此会花费一会时间。输入下面的命令并验证输出来检查是否已经工作:
|
||||
它会创建你的虚拟机,因此会花费一会时间。输入下面的命令并验证输出内容以检查是否已经工作:
|
||||
|
||||
```
|
||||
$ vagrant status
|
||||
@ -82,8 +82,7 @@ above with their current state. For more information about a specific
|
||||
VM, run `vagrant status NAME`.
|
||||
```
|
||||
|
||||
现在使用用户名和密码为vagrant,Vagrantfile中的IP登录其中一台虚拟机,这将验证虚拟机并将它们的密钥添加到你的已知主机文件中。
|
||||
|
||||
现在使用 `vagrant` 的用户名和密码 ,按 `Vagrantfile` 中的 IP 登录其中一台虚拟机,这将验证虚拟机并将它们的密钥添加到你的已知主机(`known_hosts`)文件中。
|
||||
|
||||
```
|
||||
ssh vagrant@10.1.1.11 # password is `vagrant`
|
||||
@ -107,16 +106,16 @@ $ brew install ansible
|
||||
$ sudo apt install ansible
|
||||
```
|
||||
|
||||
确保你使用了ansible最近的版本 2.1 或者更高的版本:
|
||||
确保你使用了ansible 最近的版本 2.1 或者更高的版本:
|
||||
|
||||
```
|
||||
$ ansible --version
|
||||
ansible 2.1.1.0
|
||||
```
|
||||
|
||||
### inventory
|
||||
### 清单
|
||||
|
||||
Ansible 使用 inventory 来了解要使用的服务器,以及如何将它们分组以并行执行任务。让我们为这个项目创建我们的 inventory,并将 inventory 放在与 Vagrantfile 相同的文件夹中:
|
||||
Ansible 使用清单文件来了解要使用的服务器,以及如何将它们分组以并行执行任务。让我们为这个项目创建我们的清单文件 `inventory`,并将它放在与 `Vagrantfile` 相同的文件夹中:
|
||||
|
||||
```
|
||||
[all:children]
|
||||
@ -135,21 +134,20 @@ web2 ansible_host=10.1.1.12
|
||||
dbserver ansible_host=10.1.1.21
|
||||
```
|
||||
|
||||
- `[all:children]` 定义一个组(all)的组
|
||||
- `[all:vars]` 定义属于组all的变量
|
||||
- `[webs]` 定义一个组,就像[dbs]
|
||||
- 文件的其余部分只是主机的声明,带有它们的名称和IP
|
||||
- `[all:children]` 定义一个组的组(`all`)
|
||||
- `[all:vars]` 定义属于组 `all` 的变量
|
||||
- `[webs]` 定义一个组,就像 `[db]` 一样
|
||||
- 文件的其余部分只是主机的声明,带有它们的名称和 IP
|
||||
- 空行表示声明结束
|
||||
|
||||
现在我们有了一个inventory,我们可以从命令行开始使用 ansible,指定一个主机或一个组来执行命令。以下是检查与服务器的连接的命令示例:
|
||||
现在我们有了一个清单,我们可以从命令行开始使用 ansible,指定一个主机或一个组来执行命令。以下是检查与服务器的连接的命令示例:
|
||||
|
||||
```
|
||||
$ ansible -i inventory all -m ping
|
||||
```
|
||||
|
||||
- `-i` 指定inventory文件
|
||||
- `-i` 指定清单文件
|
||||
- `all` 指定要操作的服务器或服务器组
|
||||
- `-m' 指定一个ansible模块,在这种情况下为ping
|
||||
- `-m' 指定一个 ansible 模块,在这种情况下为 `ping`
|
||||
|
||||
下面是命令输出:
|
||||
|
||||
@ -168,9 +166,9 @@ web2 | SUCCESS => {
|
||||
}
|
||||
```
|
||||
|
||||
服务器以不同的顺序响应,这只取决于谁先响应,但是这个没有相关,因为ansible独立保持每台服务器的状态。
|
||||
服务器以不同的顺序响应,这只取决于谁先响应,但是这个没有关系,因为 ansible 独立保持每台服务器的状态。
|
||||
|
||||
你也可以使用另外一个选项运行任何命令:
|
||||
你也可以使用另外一个选项来运行任何命令:
|
||||
|
||||
- `-a <command>`
|
||||
|
||||
@ -195,11 +193,11 @@ Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/sda1 40G 1.4G 37G 4% /
|
||||
```
|
||||
|
||||
### Playbook
|
||||
### 剧本
|
||||
|
||||
Playbook 只是 YAML 文件,它将inventory中的服务器组与命令关联。ansible的正确用法是任务,它可以是期望的状态,shell 命令或许多其他选项。有关 ansible 可做的所有事情列表,可以查看所有模块的列表。
|
||||
剧本(playbook)只是个 YAML 文件,它将清单文件中的服务器组与命令关联。在 ansible 中的对于关键字是 `tasks`,它可以是一个预期的状态、shell 命令或许多其它的选项。有关 ansible 可做的所有事情列表,可以查看[所有模块的列表](http://docs.ansible.com/ansible/list_of_all_modules.html)。
|
||||
|
||||
下面是一个运行 shell 命令的 playbook 示例,将其保存为 playbook1.yml:
|
||||
下面是一个运行 shell 命令的剧本示例,将其保存为 `playbook1.yml`:
|
||||
|
||||
```
|
||||
---
|
||||
@ -211,8 +209,8 @@ Playbook 只是 YAML 文件,它将inventory中的服务器组与命令关联
|
||||
- `---` 是 YAML 文件的开始
|
||||
- ` - hosts`:指定要使用的组
|
||||
- `tasks`:标记任务列表的开始
|
||||
- ` - shell`:指定使用shell模块的第一个任务
|
||||
- 记住:YAML 需要缩进,确保你始终遵循playbook中的正确结构
|
||||
- ` - shell`:指定第一个任务使用 [shell] (http://docs.ansible.com/ansible/shell_module.html) 模块
|
||||
- **记住:YAML 需要缩进结构,确保你始终遵循剧本中的正确结构**
|
||||
|
||||
用下面的命令运行它:
|
||||
|
||||
@ -237,14 +235,13 @@ web1 : ok=2 changed=1 unreachable=0 failed=0
|
||||
web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
```
|
||||
|
||||
正如你所见,ansible 运行了 2 个任务,而不是只有 playbook 中的一个。TASK [setup]是一个隐式任务,它会首先运行以捕获服务器的信息,如主机名、IP、分布和更多详细信息,然后可以使用该信息运行条件任务。
|
||||
正如你所见,ansible 运行了 2 个任务,而不是只有剧本中的一个。`TASK [setup]` 是一个隐式任务,它会首先运行以捕获服务器的信息,如主机名、IP、发行版和更多详细信息,然后可以使用这些信息运行条件任务。
|
||||
|
||||
还有一个最后的PLAY RECAP,其中 ansible 显示了有多少个运行的任务以及每个对应的状态。在我们的例子中,因为我们运行了一个 shell 命令,ansible 不知道结果的状态,它被认为是 changed。
|
||||
还有最后的 `PLAY RECAP`,其中 ansible 显示了运行了多少个任务以及每个对应的状态。在我们的例子中,因为我们运行了一个 shell 命令,ansible 不知道结果的状态,它被认为是 `changed`。
|
||||
|
||||
#### 安装软件
|
||||
|
||||
### 安装软件
|
||||
|
||||
我们将使用 apt 在我们的服务器上安装软件,因为我们需要root,所以我们必须使用 become 语句,将这个内容保存在 playbook2.yml 中并运行它(ansible-playbook playbook2.yml):
|
||||
我们将使用 [apt](http://docs.ansible.com/ansible/apt_module.html) 在我们的服务器上安装软件,因为我们需要 root 权限,所以我们必须使用 `become` 语句,将这个内容保存在 `playbook2.yml` 中并运行它(`ansible-playbook playbook2.yml`):
|
||||
|
||||
```
|
||||
---
|
||||
@ -255,7 +252,7 @@ web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
- apt: name=git state=present
|
||||
```
|
||||
|
||||
有可以应用于 ansible 中所有模块的语句; 一个是 name 语句,让我们可以打印关于正在执行的任务的更具描述性的文本。要使用它,任务还是一样,但是添加 name 字段:描述性文本作为第一行,所以我们以前的文本将是:
|
||||
有一些语句可以应用于 ansible 中所有模块;一个是 `name` 语句,可以让我们输出关于正在执行的任务的更具描述性的文本。要使用它,保持任务内容一样,但是添加 `name :描述性文本` 作为第一行,所以我们以前的文本将改成:
|
||||
|
||||
```
|
||||
---
|
||||
@ -267,9 +264,9 @@ web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
apt: name=git state=present
|
||||
```
|
||||
|
||||
### 使用 `with_items`
|
||||
#### 使用 `with_items`
|
||||
|
||||
当你在处理一个项目列表、要安装的包、要创建的文件等时可以用 ansible 提供的 with_items。下面是我们如何在 playbook3.yml 中使用它,同时添加一些我们已经知道的其他语句:
|
||||
当你要处理一个列表时,比如要安装的项目和软件包、要创建的文件,可以用 ansible 提供的 `with_items`。下面是我们如何在 `playbook3.yml` 中使用它,同时添加一些我们已经知道的其他语句:
|
||||
|
||||
```
|
||||
---
|
||||
@ -287,9 +284,9 @@ web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
- python-software-properties
|
||||
```
|
||||
|
||||
### 使用 `template` 和 `vars`
|
||||
#### 使用 `template` 和 `vars`
|
||||
|
||||
`vars` 是一个定义变量语句,可以在 `task` 语句或 `template` 文件中使用。 Jinja2 是 Ansible 中使用的模板引擎,但是关于它你不需要学习很多。在你的 playbook 中定义变量,如下所示:
|
||||
`vars` 是一个定义变量语句,可以在 `task` 语句或 `template` 文件中使用。 [Jinja2](http://jinja.pocoo.org/docs/dev/) 是 Ansible 中使用的模板引擎,但是关于它你不需要学习很多。在你的剧本中定义变量,如下所示:
|
||||
|
||||
```
|
||||
---
|
||||
@ -302,7 +299,7 @@ web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
template: src=myconfig.j2 dest={{path_to_vault}}/app.conf
|
||||
```
|
||||
|
||||
正如你看到的,我可以使用 {{path_to_vault}} 作为 playbook 的一部分,但也因为我使用了模板语句,我可以使用 myconfig.j2 中的任何变量,它必须存在一个名为 templates 的子文件夹中。你项目树应该如下所示:
|
||||
正如你看到的,我可以使用 `{{path_to_vault}}` 作为剧本的一部分,但也因为我使用了 `template`语句,我可以使用 `myconfig.j2` 中的任何变量,该文件必须存在一个名为 `templates` 的子文件夹中。你项目树应该如下所示:
|
||||
|
||||
```
|
||||
├── Vagrantfile
|
||||
@ -313,15 +310,15 @@ web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
└── myconfig.j2
|
||||
```
|
||||
|
||||
当 ansible 找到一个模板语句后它会在模板文件夹内查找,并将把被“{{”和“}}”括起来的变量展开来。
|
||||
当 ansible 找到一个 `template` 语句后它会在 `templates` 文件夹内查找,并将把被 `{{` 和 `}}` 括起来的变量展开来。
|
||||
|
||||
示例模板:
|
||||
示例模板:
|
||||
|
||||
```
|
||||
this is just an example vault_dir: {{path_to_vault}} secret_password: {{secret_key}}
|
||||
```
|
||||
|
||||
即使你不扩展变量你也可以使用`模板`。考虑到将来会添加所以我先做了。比如创建一个 `hosts.j2` 模板并加入主机名和IP。
|
||||
即使你不扩展变量你也可以使用 `template`。考虑到将来会添加所以我先做了。比如创建一个 `hosts.j2` 模板并加入主机名和 IP。
|
||||
|
||||
```
|
||||
10.1.1.11 web1
|
||||
@ -329,31 +326,31 @@ this is just an example vault_dir: {{path_to_vault}} secret_password: {{secret_k
|
||||
10.1.1.21 dbserver
|
||||
```
|
||||
|
||||
这里要求像这样的语句:
|
||||
这里要用像这样的语句:
|
||||
|
||||
```
|
||||
- name: Installing the hosts file in all servers
|
||||
template: src=hosts.j2 dest=/etc/hosts mode=644
|
||||
```
|
||||
|
||||
### shell 命令
|
||||
#### shell 命令
|
||||
|
||||
你应该总是尝试使用模块,因为 Ansible 可以跟踪任务的状态,并避免不必要的重复,但有时 shell 命令是不可避免的。 对于这些情况,Ansible 提供两个选项:
|
||||
你应该尽量使用模块,因为 Ansible 可以跟踪任务的状态,并避免不必要的重复,但有时 shell 命令是不可避免的。 对于这些情况,Ansible 提供两个选项:
|
||||
|
||||
- command:直接运行一个命令,没有环境变量或重定向(|,<,>等)
|
||||
- shell:运行 /bin/sh 并展开变量和重定向
|
||||
- [command](http://docs.ansible.com/ansible/command_module.html):直接运行一个命令,没有环境变量或重定向(`|`,`<`,`>` 等)
|
||||
- [shell](http://docs.ansible.com/ansible/shell_module.html):运行 `/bin/sh` 并展开变量和支持重定向
|
||||
|
||||
#### 其他有用的模块
|
||||
|
||||
- apt_repository - Debian家族中添加/删除包仓库
|
||||
- yum_repository - RedHat系列中添加/删除包仓库
|
||||
- service - 启动/停止/重新启动/启用/禁用服务
|
||||
- git - 从git服务器部署代码
|
||||
- unarchive - 从Web或本地源解开软件包
|
||||
- [apt_repository](http://docs.ansible.com/ansible/apt_repository_module.html) - 在 Debian 系的发行版中添加/删除包仓库
|
||||
- [yum_repository](https://docs.ansible.com/ansible/yum_repository_module.html) - 在 RedHat 系的发行版中添加/删除包仓库
|
||||
- [service](http://docs.ansible.com/ansible/service_module.html) - 启动/停止/重新启动/启用/禁用服务
|
||||
- [git](http://docs.ansible.com/ansible/git_module.html) - 从 git 服务器部署代码
|
||||
- [unarchive](http://docs.ansible.com/ansible/unarchive_module.html) - 从 Web 或本地源解开软件包
|
||||
|
||||
#### 只在一台服务器中运行任务
|
||||
|
||||
Rails 使用 `migrations` 来逐步更改数据库,但由于你有多个应用程序服务器,因此这些迁移不能被分配为组任务,而只需要一个服务器来运行迁移。在这种情况下,当使用 run_once 时,run_once 将分派任务到一个服务器,并继续下一个任务,直到这个任务完成。你只需要在你的任务中设置 run_once:true。
|
||||
Rails 使用 [migrations](http://edgeguides.rubyonrails.org/active_record_migrations.html) 来逐步更改数据库,但由于你有多个应用程序服务器,因此这些迁移任务不能被分配为组任务,而我们只需要一个服务器来运行迁移。在这种情况下,当使用 `run_once` 时,`run_once` 将分派任务到一个服务器,并直到这个任务完成继续下一个任务。你只需要在你的任务中设置 `run_once:true`。
|
||||
|
||||
```
|
||||
- name: 'Run db:migrate'
|
||||
@ -361,9 +358,9 @@ Rails 使用 `migrations` 来逐步更改数据库,但由于你有多个应用
|
||||
run_once: true
|
||||
```
|
||||
|
||||
##### 会失败的任务
|
||||
#### 会失败的任务
|
||||
|
||||
通过指定 ignore_errors:true,你可以运行可能会失败但不影响剩余 playbook 完成的任务。这是非常有用的,例如,当删除最初不存在的日志文件时。
|
||||
通过指定 `ignore_errors:true`,你可以运行可能会失败的任务,但不会影响剧本中剩余的任务完成。这是非常有用的,例如,当删除最初并不存在的日志文件时。
|
||||
|
||||
```
|
||||
- name: 'Delete logs'
|
||||
@ -371,11 +368,11 @@ Rails 使用 `migrations` 来逐步更改数据库,但由于你有多个应用
|
||||
ignore_errors: true
|
||||
```
|
||||
|
||||
##### 放到一起
|
||||
### 放到一起
|
||||
|
||||
现在用我们先前学到的,这里是每个文件的最终版:
|
||||
|
||||
Vagrantfile:
|
||||
`Vagrantfile`:
|
||||
|
||||
```
|
||||
VMs = [
|
||||
@ -398,7 +395,7 @@ Vagrant.configure(2) do |config|
|
||||
end
|
||||
```
|
||||
|
||||
inventory:
|
||||
`inventory`:
|
||||
|
||||
```
|
||||
[all:children]
|
||||
@ -417,7 +414,7 @@ web2 ansible_host=10.1.1.12
|
||||
dbserver ansible_host=10.1.1.21
|
||||
```
|
||||
|
||||
templates/hosts.j2:
|
||||
`templates/hosts.j2`:
|
||||
|
||||
```
|
||||
10.1.1.11 web1
|
||||
@ -425,7 +422,7 @@ templates/hosts.j2:
|
||||
10.1.1.21 dbserver
|
||||
```
|
||||
|
||||
templates/my.cnf.j2:
|
||||
`templates/my.cnf.j2`:
|
||||
|
||||
```
|
||||
[client]
|
||||
@ -470,9 +467,11 @@ max_allowed_packet = 16M
|
||||
key_buffer = 16M
|
||||
|
||||
!includedir /etc/mysql/conf.d/
|
||||
```
|
||||
|
||||
final-playbook.yml:
|
||||
`final-playbook.yml`:
|
||||
|
||||
```
|
||||
- hosts: all
|
||||
become_user: root
|
||||
become: true
|
||||
@ -551,7 +550,7 @@ final-playbook.yml:
|
||||
shell: cd {{appdir}};rails server -b 0.0.0.0 -p 80 --pid /run/puma.pid -d
|
||||
```
|
||||
|
||||
### 打开你的环境
|
||||
### 放在你的环境中
|
||||
|
||||
将这些文件放在相同的目录,运行下面的命令打开你的开发环境:
|
||||
|
||||
@ -560,9 +559,9 @@ vagrant up
|
||||
ansible-playbook -i inventory final-playbook.yml
|
||||
```
|
||||
|
||||
#### 部署新的代码
|
||||
### 部署新的代码
|
||||
|
||||
确保修改了代码并push到了仓库中。接下来,确保你git语句中有正确的分支:
|
||||
确保修改了代码并推送到了仓库中。接下来,确保你 git 语句中使用了正确的分支:
|
||||
|
||||
```
|
||||
- name: 'Clone app repo'
|
||||
@ -573,19 +572,19 @@ ansible-playbook -i inventory final-playbook.yml
|
||||
force=yes
|
||||
```
|
||||
|
||||
作为一个例子,你可以在master上修改version字段,再次运行 playbook:
|
||||
作为一个例子,你可以修改 `version` 字段为 `master`,再次运行剧本:
|
||||
|
||||
```
|
||||
ansible-playbook -i inventory final-playbook.yml
|
||||
```
|
||||
|
||||
检查所有的 web 服务器上的页面是否已更改:`http:// 10.1.1.11` 或 `http:// 10.1.1.12`。将其更改为 `version = staging` 并重新运行 playbook 并再次检查页面。
|
||||
检查所有的 web 服务器上的页面是否已更改:`http://10.1.1.11` 或 `http://10.1.1.12`。将其更改为 `version = staging` 并重新运行剧本并再次检查页面。
|
||||
|
||||
你还可以创建只包含与部署相关的任务的替代 playbook,以便其运行更快。
|
||||
你还可以创建只包含与部署相关的任务的替代剧本,以便其运行更快。
|
||||
|
||||
### 接下来是什么 ?!
|
||||
|
||||
这只是可以做的很小一部分。我们没有接触角色、过滤器、调试器等许多其他很棒的功能,但我希望它给了你一个良好的开始!所以,请继续学习并使用它。如果你有任何问题,你可以在 twitter 或评论栏联系我,让我知道你还想知道哪些关于 ansible 的东西!
|
||||
这只是可以做的很小一部分。我们没有接触角色(role)、过滤器(filter)、调试等许多其他很棒的功能,但我希望它给了你一个良好的开始!所以,请继续学习并使用它。如果你有任何问题,你可以在 [twitter](https://twitter.com/c0d5x) 或评论栏联系我,让我知道你还想知道哪些关于 ansible 的东西!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@ -593,10 +592,8 @@ ansible-playbook -i inventory final-playbook.yml
|
||||
via: https://gorillalogic.com/blog/getting-started-with-ansible/?utm_source=webopsweekly&utm_medium=email
|
||||
|
||||
作者:[JOSE HIDALGO][a]
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,212 @@
|
||||
如何在 Docker 中设置 Go 并部署应用
|
||||
============================================================
|
||||
|
||||
嗨,在本教程中,我们将学习如何使用 docker 部署 golang web 应用程序。 你可能已经知道,由于 golang 的高性能和可靠性,docker 是完全是用 golang 写的。在我们详细介绍之前,请确保你已经安装了 docker 以及 golang 并对它们有基本了解。
|
||||
|
||||
### 关于 docker
|
||||
|
||||
Docker 是一个开源程序,它可以将应用及其完整的依赖包捆绑到一起,并打包为容器,与宿主机共享相同的 Linux 内核。另一方面,像 VMware 这样的基于 hypervisor 的虚拟化操作系统容器提供了高级别的隔离和安全性,这是由于客户机和主机之间的通信是通过 hypervisor 来实现的,它们不共享内核空间。但是硬件仿真也导致了性能的开销,所以容器虚拟化诞生了,以提供一个轻量级的虚拟环境,它将一组进程和资源与主机以及其它容器分组及隔离,因此,容器内部的进程无法看到容器外部的进程或资源。
|
||||
|
||||
### 用 Go 语言创建一个 “Hello World” web 应用
|
||||
|
||||
首先我们为 Go 应用创建一个目录,它会在浏览器中显示 “Hello World”。创建一个 `web-app` 目录并使它成为当前目录。进入 `web-app` 应用目录并编辑一个名为 `main.go` 的文件。
|
||||
|
||||
```
|
||||
root@demohost:~# mkdir web-app
|
||||
root@demohost:~# cd web-app/
|
||||
root@demohost:~/web-app# vim.tiny main.go
|
||||
|
||||
package main
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Hello %s", r.URL.Path[1:])
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/World", handler)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
```
|
||||
|
||||
使用下面的命令运行上面的 “Hello World” Go 程序。在浏览器中输入 `http://127.0.0.1:8080/World` 测试,你会在浏览器中看到 “Hello World”。
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# PORT=8080 go run main.go
|
||||
```
|
||||
|
||||
下一步是将上面的应用在 docker 中容器化。因此我们会创建一个 dockerfile 文件,它会告诉 docker 如何容器化我们的 web 应用。
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# vim.tiny Dockerfile
|
||||
|
||||
# 得到最新的 golang docker 镜像
|
||||
FROM golang:latest
|
||||
|
||||
# 在容器内部创建一个目录来存储我们的 web 应用,接着使它成为工作目录。
|
||||
RUN mkdir -p /go/src/web-app
|
||||
WORKDIR /go/src/web-app
|
||||
|
||||
# 复制 web-app 目录到容器中
|
||||
COPY . /go/src/web-app
|
||||
|
||||
# 下载并安装第三方依赖到容器中
|
||||
RUN go-wrapper download
|
||||
RUN go-wrapper install
|
||||
|
||||
# 设置 PORT 环境变量
|
||||
ENV PORT 8080
|
||||
|
||||
# 给主机暴露 8080 端口,这样外部网络可以访问你的应用
|
||||
EXPOSE 8080
|
||||
|
||||
# 告诉 Docker 启动容器运行的命令
|
||||
CMD ["go-wrapper", "run"]
|
||||
```
|
||||
|
||||
### 构建/运行容器
|
||||
|
||||
使用下面的命令构建你的 Go web-app,你会在成功构建后获得确认。
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# docker build --rm -t web-app .
|
||||
Sending build context to Docker daemon 3.584 kB
|
||||
Step 1 : FROM golang:latest
|
||||
latest: Pulling from library/golang
|
||||
386a066cd84a: Already exists
|
||||
75ea84187083: Pull complete
|
||||
88b459c9f665: Pull complete
|
||||
a31e17eb9485: Pull complete
|
||||
1b272d7ab8a4: Pull complete
|
||||
eca636a985c1: Pull complete
|
||||
08158782d330: Pull complete
|
||||
Digest: sha256:02718aef869a8b00d4a36883c82782b47fc01e774d0ac1afd434934d8ccfee8c
|
||||
Status: Downloaded newer image for golang:latest
|
||||
---> 9752d71739d2
|
||||
Step 2 : RUN mkdir -p /go/src/web-app
|
||||
---> Running in 9aef92fff9e8
|
||||
---> 49936ff4f50c
|
||||
Removing intermediate container 9aef92fff9e8
|
||||
Step 3 : WORKDIR /go/src/web-app
|
||||
---> Running in 58440a93534c
|
||||
---> 0703574296dd
|
||||
Removing intermediate container 58440a93534c
|
||||
Step 4 : COPY . /go/src/web-app
|
||||
---> 82be55bc8e9f
|
||||
Removing intermediate container cae309ac7757
|
||||
Step 5 : RUN go-wrapper download
|
||||
---> Running in 6168e4e96ab1
|
||||
+ exec go get -v -d
|
||||
---> 59664b190fee
|
||||
Removing intermediate container 6168e4e96ab1
|
||||
Step 6 : RUN go-wrapper install
|
||||
---> Running in e56f093b6f03
|
||||
+ exec go install -v
|
||||
web-app
|
||||
---> 584cd410fdcd
|
||||
Removing intermediate container e56f093b6f03
|
||||
Step 7 : ENV PORT 8080
|
||||
---> Running in 298e2a415819
|
||||
---> c87fd2b43977
|
||||
Removing intermediate container 298e2a415819
|
||||
Step 8 : EXPOSE 8080
|
||||
---> Running in 4f639a3790a7
|
||||
---> 291167229d6f
|
||||
Removing intermediate container 4f639a3790a7
|
||||
Step 9 : CMD go-wrapper run
|
||||
---> Running in 6cb6bc28e406
|
||||
---> b32ca91bdfe0
|
||||
Removing intermediate container 6cb6bc28e406
|
||||
Successfully built b32ca91bdfe0
|
||||
```
|
||||
|
||||
现在可以运行我们的 web-app 了,可以执行下面的命令。
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# docker run -p 8080:8080 --name="test" -d web-app
|
||||
7644606b9af28a3ef1befd926f216f3058f500ffad44522c1d4756c576cfa85b
|
||||
```
|
||||
|
||||
进入 `http://localhost:8080/World` 浏览你的 web 应用。你已经成功容器化了一个可重复的/确定性的 Go web 应用。使用下面的命令来启动、停止并检查容器的状态。
|
||||
|
||||
```
|
||||
### 列出所有容器
|
||||
root@demohost:~/ docker ps -a
|
||||
|
||||
### 使用 id 启动容器
|
||||
root@demohost:~/ docker start CONTAINER_ID_OF_WEB_APP
|
||||
|
||||
### 使用 id 停止容器
|
||||
root@demohost:~/ docker stop CONTAINER_ID_OF_WEB_APP
|
||||
```
|
||||
|
||||
### 重新构建镜像
|
||||
|
||||
假设你正在开发 web 应用程序并在更改代码。现在要在更新代码后查看结果,你需要重新生成 docker 镜像、停止旧镜像并运行新镜像,并且每次更改代码时都要这样做。为了使这个过程自动化,我们将使用 docker 卷在主机和容器之间共享一个目录。这意味着你不必为在容器内进行更改而重新构建镜像。容器如何检测你是否对 web 程序的源码进行了更改?答案是有一个名为 “Gin” 的好工具 [https://github.com/codegangsta/gin][1],它能检测是否对源码进行了任何更改,然后重建镜像/二进制文件并在容器内运行更新过代码的进程。
|
||||
|
||||
要使这个过程自动化,我们将编辑 Dockerfile 并安装 Gin 将其作为入口命令来执行。我们将开放 `3030` 端口(Gin 代理),而不是 `8080`。 Gin 代理将转发流量到 web 程序的 `8080` 端口。
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# vim.tiny Dockerfile
|
||||
|
||||
# 得到最新的 golang docker 镜像
|
||||
FROM golang:latest
|
||||
|
||||
# 在容器内部创建一个目录来存储我们的 web 应用,接着使它称为工作目录。
|
||||
RUN mkdir -p /go/src/web-app
|
||||
WORKDIR /go/src/web-app
|
||||
|
||||
# 复制 web 程序到容器中
|
||||
COPY . /go/src/web-app
|
||||
|
||||
# 下载并安装第三方依赖到容器中
|
||||
RUN go get github.com/codegangsta/gin
|
||||
RUN go-wrapper download
|
||||
RUN go-wrapper install
|
||||
|
||||
# 设置 PORT 环境变量
|
||||
ENV PORT 8080
|
||||
|
||||
# 给主机暴露 8080 端口,这样外部网络可以访问你的应用
|
||||
EXPOSE 3030
|
||||
|
||||
# 启动容器时运行 Gin
|
||||
CMD gin run
|
||||
|
||||
# 告诉 Docker 启动容器运行的命令
|
||||
CMD ["go-wrapper", "run"]
|
||||
```
|
||||
|
||||
现在构建镜像并启动容器:
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# docker build --rm -t web-app .
|
||||
```
|
||||
|
||||
我们会在当前 web 程序的根目录下运行 docker,并通过暴露的 `3030` 端口链接 CWD (当前工作目录)到容器中的应用目录下。
|
||||
|
||||
```
|
||||
root@demohost:~/web-app# docker run -p 3030:3030 -v `pwd`:/go/src/web-app --name="test" -d web-app
|
||||
````
|
||||
|
||||
打开 `http://localhost:3030/World`, 你就能看到你的 web 程序了。现在如果你改变了任何代码,会在浏览器刷新后反映在你的浏览器中。
|
||||
|
||||
### 总结
|
||||
|
||||
就是这样,我们的 Go web 应用已经运行在 Ubuntu 16.04 Docker 容器中运行了!你可以通过使用 Go 框架来快速开发 API、网络应用和后端服务,从而扩展当前的网络应用。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/containers/setup-go-docker-deploy-application/
|
||||
|
||||
作者:[Dwijadas Dey][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[jasminepeng](https://github.com/jasminepeng)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/dwijadasd/
|
||||
[1]:https://github.com/codegangsta/gin
|
@ -0,0 +1,173 @@
|
||||
5 个找出“二进制命令”描述和系统中位置的方法
|
||||
============================================================
|
||||
|
||||
在数千个 [Linux 系统上的命令/程序][1]中,知道给定命令的类型和目的以及其在系统上的位置(绝对路径)对于新手来说可能是一个挑战。
|
||||
|
||||
知道命令/程序的一些细节不仅有助于 [Linux 用户掌握大量命令][2],还能使用户理解命令行或脚本在系统上的操作。
|
||||
|
||||
因此,在本文中我们将向你解释五个有用的命令,用于显示给定命令的简短描述和位置。
|
||||
|
||||
要在系统上发现新命令,请查看 PATH 环境变量中的所有目录。这些目录存储系统上安装的所有命令/程序。
|
||||
|
||||
一旦你找到一个有趣的命令,在继续阅读更多关于它的手册页之前,请尝试如下收集一些简要的信息。
|
||||
|
||||
假设你输出了 `PATH` 的值,然后进到其中的一个目录 `/usr/local/bin`,注意到一个名为 [`fswatch`(监视文件修改更改)][3]的新命令:
|
||||
|
||||
```
|
||||
$ echo $PATH
|
||||
$ cd /usr/local/bin
|
||||
```
|
||||
|
||||
[
|
||||

|
||||
][4]
|
||||
|
||||
*在 Linux 中找出新命令*
|
||||
|
||||
现在让我们在 Linux 中用不同的方法找出 `fswatch` 命令的描述和位置。
|
||||
|
||||
### 1、 whatis 命令
|
||||
|
||||
`whatis` 用于显示你作为参数输入的命令名的单行描述(例如下面命令中的 `fswatch`)。
|
||||
|
||||
如果描述太长,一些部分在默认情况下会被省略,使用 `-l` 标志来显示完整的描述。
|
||||
|
||||
```
|
||||
$ whatis fswatch
|
||||
$ whatis -l fswatch
|
||||
```
|
||||
[
|
||||

|
||||
][5]
|
||||
|
||||
*Linux whatis 命令示例*
|
||||
|
||||
### 2、 apropos 命令
|
||||
|
||||
`apropos` 会搜索手册页名称和关键字描述(以命令名作为正则表达式搜索)。
|
||||
|
||||
使用 `-l` 标志来显示完整的描述。
|
||||
|
||||
```
|
||||
$ apropos fswatch
|
||||
$ apropos -l fswatch
|
||||
```
|
||||
|
||||
[
|
||||

|
||||
][6]
|
||||
|
||||
*Linux apropos 命令示例*
|
||||
|
||||
默认上,`apropos` 会如示例那样输出所有匹配的行。你可以使用 `-e` 选项来精确匹配:
|
||||
|
||||
```
|
||||
$ apropos fmt
|
||||
$ apropos -e fmt
|
||||
```
|
||||
[
|
||||

|
||||
][7]
|
||||
|
||||
*Linux apropos 命令根据关键词显示*
|
||||
|
||||
### 3、 type 命令
|
||||
|
||||
`type` 命令会输出给定命令的完整路径名,此外,如果输入的命令名不是做为独立存储在磁盘的文件的程序,`type` 还会告诉你命令分类:
|
||||
|
||||
- shell 内置命令
|
||||
- shell 关键字或保留字
|
||||
- 别名
|
||||
|
||||
```
|
||||
$ type fswatch
|
||||
```
|
||||
|
||||
[
|
||||

|
||||
][8]
|
||||
|
||||
*Linux type 命令示例*
|
||||
|
||||
当命令是另外一个命令的别名时,`type` 会显示运行别名时所执行的命令。使用 `alias` 命令可以查看你系统上创建的所有别名:
|
||||
|
||||
```
|
||||
$ alias
|
||||
$ type l
|
||||
$ type ll
|
||||
```
|
||||
|
||||
[
|
||||

|
||||
][9]
|
||||
|
||||
*显示 Linux 中所有别名*
|
||||
|
||||
### 4、 which 命令
|
||||
|
||||
`which` 可以帮助命令定位命令,它会打印出命令的绝对路径:
|
||||
|
||||
```
|
||||
$ which fswatch
|
||||
```
|
||||
|
||||
[
|
||||

|
||||
][10]
|
||||
|
||||
*找出 Linux 命令位置*
|
||||
|
||||
一些二进制文件存在于 `PATH` 环境变量中的多个目录,使用 `-a` 标志来找出所有匹配的路径名。
|
||||
|
||||
### 5、 whereis 命令
|
||||
|
||||
`whereis` 定位指定命令名的二进制、源和帮助页文件,如下所示:
|
||||
|
||||
```
|
||||
$ whereis fswatch
|
||||
$ whereis mkdir
|
||||
$ whereis rm
|
||||
```
|
||||
[
|
||||

|
||||
][11]
|
||||
|
||||
*Linux whereis 命令示例*
|
||||
|
||||
虽然上面的命令对于查找关于命令/程序的一些快速信息很重要,但是该命令的手册总是可以提供完整的文档,它还包括其他相关程序的列表:
|
||||
|
||||
```
|
||||
$ man fswatch
|
||||
```
|
||||
|
||||
在本文中,我们回顾了五个简单的命令,用于显示命令的简短的手册描述和位置。 你可以在反馈栏中对此文章做出贡献或提出问题。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin、web 开发人员,目前是 TecMint 的内容创作者,他喜欢用电脑工作,并坚信分享知识。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
via: http://www.tecmint.com/find-linux-command-description-and-location/
|
||||
|
||||
作者:[Aaron Kili][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[jasminepeng](https://github.com/jasminepeng)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/aaronkili/
|
||||
[1]:http://www.tecmint.com/category/top-tools/
|
||||
[2]:http://www.tecmint.com/tag/linux-tricks/
|
||||
[3]:http://www.tecmint.com/fswatch-monitors-files-and-directory-changes-modifications-in-linux/
|
||||
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Find-New-Commands-in-Linux.png
|
||||
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Whatis-Command-Example.png
|
||||
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-apropos-Command-Example.png
|
||||
[7]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-apropos-Command-Keyword-Example.png
|
||||
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-type-Command-Example.png
|
||||
[9]:http://www.tecmint.com/wp-content/uploads/2017/01/Show-All-Aliases-in-Linux.png
|
||||
[10]:http://www.tecmint.com/wp-content/uploads/2017/01/Find-Linux-Command-Location.png
|
||||
[11]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-whereis-Command-Example.png
|
@ -1,54 +0,0 @@
|
||||
# Build Strong Real-Time Streaming Apps with Apache Calcite
|
||||
|
||||
|
||||

|
||||
Calcite is a data framework that lets you to build custom database functionality, explains Microsoft developer Atri Sharma in this preview to his upcoming talk at Apache: Big Data Europe, Nov. 14-16 in Seville, Spain.[Creative Commons Zero][2]Wikimedia Commons: Parent Géry
|
||||
|
||||
The [Apache Calcite][7] data management framework contains many pieces of a typical database management system but omits others, such as storage of data and algorithms to process data. In his talk at the upcoming [Apache: Big Data][6] conference in Seville, Spain, Atri Sharma, a Software Engineer for Azure Data Lake at Microsoft, will talk about developing applications using [Apache Calcite][5]'s advanced query planning capabilities. We spoke with Sharma to learn more about Calcite and how existing applications can take advantage of its functionality.
|
||||
|
||||

|
||||
|
||||
Atri Sharma, Software Engineer, Azure Data Lake, Microsoft[Used with permission][1]
|
||||
|
||||
**Linux.com: Can you provide some background on Apache Calcite? What does it do?**
|
||||
|
||||
Atri Sharma: Calcite is a framework that is the basis of many database kernels. Calcite empowers you to build your custom database functionality and use the required resources from Calcite. For example, Hive uses Calcite for cost-based query optimization, Drill and Kylin use Calcite for SQL parsing and optimization, and Apex uses Calcite for streaming SQL.
|
||||
|
||||
**Linux.com: What are some features that make Apache Calcite different from other frameworks?**
|
||||
|
||||
Atri: Calcite is unique in the sense that it allows you to build your own data platform. Calcite does not manage your data directly but rather allows you to use Calcite's libraries to define your own components. For eg, instead of providing a generic query optimizer, it allows defining custom query optimizers using the Planners available in Calcite.
|
||||
|
||||
**Linux.com: Apache Calcite itself does not store or process data. How does that affect application development?**
|
||||
|
||||
Atri: Calcite is a dependency in the kernel of your database. It is targeted for data management platforms that wish to extend their functionalities without writing a lot of functionality from scratch.
|
||||
|
||||
**Linux.com: Who should be using it? Can you give some examples?**
|
||||
|
||||
Atri: Any data management platform looking to extend their functionalities should use Calcite. We are the foundation of your next high-performance database!
|
||||
|
||||
Specifically, I think the biggest examples would be Hive using Calcite for query optimization and Flink for parsing and streaming SQL processing. Hive and Flink are full-fledged data management engines, and they use Calcite for highly specialized purposes. This is a good case study for applications of Calcite to further strengthen the core of a data management platform.
|
||||
|
||||
**Linux.com: What are some new features that you’re looking forward to?**
|
||||
|
||||
Atri: Streaming SQL enhancements are something I am very excited about. These features are exciting because they will enable users of Calcite to develop real-time streaming applications much faster, and the strength and capabilities of these applications will be manifold. Streaming applications are the new de facto, and the strength to have query optimization in streaming SQL will be very useful for a large crowd. Also, there is discussion ongoing about temporal tables, so watch out for more!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/news/build-strong-real-time-streaming-apps-apache-calcite
|
||||
|
||||
作者:[AMBER ANKERHOLZ][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/aankerholz
|
||||
[1]:https://www.linux.com/licenses/category/used-permission
|
||||
[2]:https://www.linux.com/licenses/category/creative-commons-zero
|
||||
[3]:https://www.linux.com/files/images/atri-sharmajpg
|
||||
[4]:https://www.linux.com/files/images/calcitejpg
|
||||
[5]:https://calcite.apache.org/
|
||||
[6]:http://events.linuxfoundation.org/events/apache-big-data-europe
|
||||
[7]:https://calcite.apache.org/
|
@ -0,0 +1,150 @@
|
||||
#rusking translating
|
||||
How to get started as an open source programmer
|
||||
============================================================
|
||||

|
||||
|
||||
Image credits :
|
||||
|
||||
Zagrev on [Flickr][1]. [CC BY-SA 2.0][2]
|
||||
|
||||
Looking out at the world of technology is exciting. It has a lot of moving parts, and it seems the further you dig into it, the deeper it gets, and then it's [turtles all the way down][3]. For that very reason, technology is also overwhelming. Where do you start if you're keen to join in and help shape the way the modern world functions? What's the first step? What's the twentieth step?
|
||||
|
||||
The first thing to understand is that open source is open. This might seem obvious, but the phrase "open source" is thrown around so often these days that sometimes people forget it's just a description of a cultural phenomenon, not the name of a Fortune 500 company. Unlike other jobs or groups, you don't have to interview or complete a sign-up sheet or registration form to become an open source programmer. All you do to become an open source programmer is _program_and then share your code, ideally with a guarantee that the code remains open regardless of how it's used.
|
||||
|
||||
That's it. You're an open source programmer!
|
||||
|
||||
You now have your destination, but what about the logistics?
|
||||
|
||||
### Skill trees
|
||||
|
||||
Have you ever played an RPG? In these games, there's the concept of linear "skill trees". When you play, you acquire basic skills that you build upon to "level up" and get new skills, which you use to acquire new ones and "level up" again. And so on.
|
||||
|
||||
Becoming a programmer is a little like adding to your skill tree. You get some basic skills, you practice them until they're second nature, and then you get new skills, and so on, and then you are progressing along your chosen skill tree.
|
||||
|
||||
You'll find you'll encounter more than one skill tree. Open source has many entry points and many individuals with their own unique strengths, talents, and interests. However, certain definable skills contribute to being a great programmer, and developing them is an important part of participating successfully in open source projects.
|
||||
|
||||
### Scripting
|
||||
|
||||

|
||||
|
||||
One of the biggest advantages of a POSIX system like Linux or BSD is that every time you use your computer, you've got the opportunity to practice a little programming. If you have no idea where to start programming, then begin with how you work. Find repetitive tasks that you perform every day, and start automating them. This step can be something simple, like converting or re-sizing batches of photos, checking email, or even just getting the five applications you use each day launched with one click. Whatever the task, take the time to automate something for yourself.
|
||||
|
||||
If you can do something from a terminal, then it can be scripted. Learn `bash` or `tsch` and let system scripting be your introduction to writing code and to how your system works.
|
||||
|
||||
### Sysadmin
|
||||
|
||||

|
||||
|
||||
From this point, you can continue on to become a programmer, or you can cross over to a different skill tree entirely: that of systems administration. The two careers have some overlap (a good sysadmin ought to have a little programming experience, and should be ready to wield Python, Perl, or a similar language to develop unique solutions), but a _programmer_ is someone who builds with code day in and day out.
|
||||
|
||||
### Programmer
|
||||
|
||||

|
||||
|
||||
Open source is a great way to learn programming skills; you get to look at other people's code, borrow ideas and techniques, learn from their mistakes, get a critique of your own code, and if you use Linux or BSD, the _entire_ stack is open to you—as far as the eye can see, it's all yours for the taking.
|
||||
|
||||
That's what the travel brochure says, anyway. The reality is that you're probably not going to start digging into the source code of a project and come out the other side with the sudden realization that you accidentally learned to code. Programming is hard work. If it wasn't, everyone would do it.
|
||||
|
||||
Luckily, programming is logical and structured, so it builds upon itself. You might not fall into programming, but the more you poke at it, the more you start to understand it.
|
||||
|
||||
Understanding how to control and automate a computer is one thing, but knowing how to write the stuff that other people want to automate is the point that you cross over into the realm of _programming_.
|
||||
|
||||
### Polyglot
|
||||
|
||||

|
||||
|
||||
All programming languages aim to do the same thing: make computers compute. Choosing one is a mix of what you think you want to do, what (if any) language is in common use in the industry you are targeting, and what language you happen to best understand given the materials available to you and your learning style.
|
||||
|
||||
With a little bit of research, you can get a good idea of a language's complexity, and then decide what to try first based on your own level of comfort.
|
||||
|
||||
Another way to choose a language is to look at your goal, find out if other people are working toward the same thing, and then look at what they're using. If your aim is to develop desktop tools, you might learn C and Vala for one, or C++ for another.
|
||||
|
||||
At the end of the day, though, don't get overwhelmed with all the available choices. Languages stack well. Once you learn one programming language well enough to fall back on it when you need to get something done, you'll find it a lot easier to pick up another one. A "language" is just a set of syntax and rules, after all; learn one, and it's fairly trivial to superimpose new rules over the same theory.
|
||||
|
||||
The primary goal is to learn a language. Pick the one that makes sense to you or the one that's most appealing to you or the one that your friends are using or the one that has the documentation you understand best, but focus on one and learn it.
|
||||
|
||||
### Open Whazzit?
|
||||
|
||||
Whether or not you're just learning to program or you're an old pro just getting into open source, before jumping head first into this brave new world, you need to learn what makes open source, well, "open source."
|
||||
|
||||
Claiming software is open source is the latest marketing approach some software vendors are wielding. Unfortunately, some vendors just mean they've released a public API or that they're receptive ("open") to suggestions from their users. The word "open" isn't trademarked and no committee governs how or when the word is used. However, the [Open Source Initiative][4], co-founded by the late Ian Murdock of Debian Linux, [defines][5] what open source means (licenses that "allow software to be freely used, modified, and shared"), and formally approves and [tracks][6]licenses deemed truly "open."
|
||||
|
||||
Apply one of those licenses to your code, and you're an open source programmer. Congratulations!
|
||||
|
||||
### Community
|
||||
|
||||

|
||||
|
||||
Ask any open source enthusiast and they'll tell you the most important thing about open software is the people. Without motivated contributors, software stagnates. Computers need users, bug reporters, designers, and programmers.
|
||||
|
||||
If you want to join or cultivate the global open source community, you need to become a part of the community, even if you're not a people person. This usually encompasses subscribing to mailing lists, joining IRC channels, or hopping onto forums, and starting at the bottom of the totem pole. Any mature community has been around long enough to see prospective members come and go, so you have to understand that when you saunter in ready to change their world, before they all agree to your master plan, you have to prove that you're not going to disappear after three months when something sparkly on the other side of the Net catches your eye. Be ready for the long haul if you aspire to something big.
|
||||
|
||||
If you're just around to lend a hand, then that's acceptable, too. I myself have submitted small patches to projects, and sometimes the project leads think these are good and other times they reject them. If the rejected patch is important to me, I maintain it for myself and clients, and otherwise I move forward.
|
||||
|
||||
It's part of the process.
|
||||
|
||||
Where do these communities exist? It depends on the project. Some projects have dedicated community managers who help bring everyone together in public spaces for everyone to see. Other projects form around forums, use mailing lists, or even issue trackers. Look for the communities, and you'll find them.
|
||||
|
||||
Just as importantly, though, look at the code! They call it open "source" for a reason, so be sure to find the code and take a peek. Even if it's still above your level of full comprehension, it gives you an idea of how the software project organizes itself and possibly where they might need assistance. How is the code organized? Does the code have comments? Is it tidy with a consistent style? Review the documentation, particularly the README, LICENSE, or COPYING files.
|
||||
|
||||
Don't under estimate the importance of following through on the promise of open code. It's the reason you're getting involved, so look at it critically from every angle to see what you can learn from it and how you might contribute.
|
||||
|
||||
Finding the best community is a lot like dating, but specifically it's like dating in [Groundhog Day][7]. It takes time, and the first couple of tries might fall flat. The more you go through the process, the more you start to feel déjà vu. Eventually, though, you learn enough about yourself and your interests, you find the right combination of other people, and you settle in somewhere. Have patience, and let it happen naturally.
|
||||
|
||||
### Actions > Words
|
||||
|
||||

|
||||
|
||||
Being an open source programmer is about the code (the "source" part of open source), and ideas are a dime a dozen. What speaks volumes is producing. You need to show you know what you're doing, willing to get your hands dirty, spend your time on the project, and can back up your ideas with something that compiles.
|
||||
|
||||
To do that effectively, of course, you should do your homework on the project itself, including learning how a project prefers to receive submissions and which branches are the stable and development ones.
|
||||
|
||||
To approach getting started:
|
||||
|
||||
* Get familiar with a project and its development culture, and be respectful of it.
|
||||
* Write patches, bug fixes, or small, requested features, and submit them.
|
||||
* Don't get discouraged if your work is rejected. You are not being rejected personally, your work was evaluated and the development team made a call.
|
||||
* Don't get discouraged if your work is accepted, but changed beyond recognition.
|
||||
* Rinse, repeat, and try new and bigger changes.
|
||||
|
||||

|
||||
|
||||
There is no leaderboard in open source. Some sites try to make it seem like they have such a thing, but there isn't one. Participate, contribute, add to the pool of ideas, add to the stash of commits, and you're doing it right.
|
||||
|
||||
### Develop
|
||||
|
||||

|
||||
|
||||
Programming in any environment is always, ultimately, about personal development. Whether you're searching for new ways of solving problems, looking for new ways to optimize code, learning a new language, or learning how to deal with other people better, you never want to stop growing. The more you develop yourself, the more a project benefits.
|
||||
|
||||
Growth, both personal and professional, is the final one on the list, but it actually persists through the entire process. Becoming an open source programmer isn't like getting a government job; it's a process. You learn, you share, you keep learning, you get distracted and write a [Game of Life][8] implementation, and you learn some more.
|
||||
|
||||
This process is what open source is about: the freedom to develop, in every sense of the word. So go find your skill tree, choose your super powers, pay your dues, level up, and get involved.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Seth Kenlon - Seth Kenlon is an independent multimedia artist, free culture advocate, and UNIX geek. He is one of the maintainers of the Slackware-based multimedia production project, http://slackermedia.ml
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/how-get-started-open-source-programmer
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
译者:[译者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
|
||||
[1]:https://www.flickr.com/photos/zagrev/79470567/in/photolist-82iQc-pijuye-9CmY3Z-c1EJAf-4Y65Zt-dhLziB-51QVc-hjqkN-4rNTuC-5Mbvqi-5MfK13-7dh6AW-2fiSu7-48R7et-5sC5ck-qf1TE9-48R6qv-pXuSG9-KFBLJ-95jQ8U-jBR7-dhLpfV-5bCZVH-9vsPTT-bA2nvP-bn7cWw-d7j8q-ubap-pij32X-7WT6iw-dcZZm2-3knisv-4dgN2f-bc6V1-E9xar-EovvU-6T71Mg-pi5zwE-5SR26m-dPKXrn-HFyzb-3aJF9W-7Rvz19-zbewj-xMsv-7MFi3u-2mVokJ-nsVAx-7g5k-4jCbbP
|
||||
[2]:https://creativecommons.org/licenses/by-nc-sa/2.0/
|
||||
[3]:https://en.wikipedia.org/wiki/Turtles_all_the_way_down
|
||||
[4]:http://opensource.org/
|
||||
[5]:https://opensource.org/licenses
|
||||
[6]:https://opensource.org/licenses/category
|
||||
[7]:https://en.wikipedia.org/wiki/Groundhog_Day_(film)
|
||||
[8]:https://en.wikipedia.org/wiki/Conway's_Game_of_Life
|
@ -0,0 +1,105 @@
|
||||
# rusking translating
|
||||
|
||||
What engineers and marketers can learn from each other
|
||||
============================================================
|
||||
|
||||
### Marketers think engineering is all math; engineers think marketing is all fluff. They're both wrong.
|
||||
|
||||

|
||||
Image by :
|
||||
|
||||
opensource.com
|
||||
|
||||
After many years of practicing marketing in the B2B tech world, I think I've heard just about every misconception that engineers seem to have about marketers. Here are some of the more common:
|
||||
|
||||
* "Marketing is a waste of money that we should be putting into actual product development."
|
||||
* "Those marketers just throw stuff against the wall and hope it sticks. Where's the discipline?"
|
||||
* "Does anyone actually read this stuff?"
|
||||
* "The best thing a marketer can tell me is how to unsubscribe, unfollow, and unfriend."
|
||||
|
||||
And here's my personal favorite:
|
||||
|
||||
_"Marketing is all fluff."_
|
||||
|
||||
That last one is simply incorrect—but more than that, It's actually a major impediment to innovation in our organizations today.
|
||||
|
||||
Let me explain why.
|
||||
|
||||
### Seeing my own reflection
|
||||
|
||||
I think these comments from engineers bother me so much because I see a bit of my former self in them.
|
||||
|
||||
You see, I was once as geeky as they come—and was proud of it. I hold a Bachelor's in electrical engineering from Rensselaer Polytechnic Institute, and began my professional career as an officer in the US Air Force during Desert Storm. There, I was in charge of developing and deploying a near real-time intelligence system that correlated several sources of data to create a picture of the battlefield.
|
||||
|
||||
After I left the Air Force, I planned to pursue a doctorate from MIT. But my Colonel convinced me to take a look at their business school. "Are you really going to be in a lab?" he asked me. "Are you going to teach at a university? Jackie, you are gifted at orchestrating complex activities. I think you really need to look at MIT Sloan."
|
||||
|
||||
So I took his advice, believing I could still enroll in a few tech courses at MIT. Taking a marketing course, however, would certainly have been a step too far—a total waste of time. I continued to bring my analytical skills to bear on any problem put in front of me.
|
||||
|
||||
Soon after, I became a management consultant at The Boston Consulting Group. Throughout my six years there, I consistently heard the same feedback: "Jackie, you're not visionary enough. You're not thinking outside the box. You assume your analysis is going to point you to the answer."
|
||||
|
||||
And of course, I agreed with them—because that's the way the world works, isn't it? What I realize now (and wish I'd discovered out far earlier) is that by taking this approach I was missing something pivotal: the open mind, the art, the emotion—the human and creative elements.
|
||||
|
||||
All this became much more apparent when I joined Delta Air Lines soon after September 11, 2001, and was asked to help lead consumer marketing. Marketing _definitely_ wasn't my thing, but I was willing to help however they needed me to.
|
||||
|
||||
But suddenly, my rulebook for achieving familiar results was turned upside down. Thousands of people (both inside and outside the airline) were involved in this problem. Emotions were running high. I was facing problems that required different kinds of solutions, answers I couldn't reach simply by crunching numbers.
|
||||
|
||||
That's when I learned—and quickly, because we had much work to do if we were going to pull Delta back up to where it deserved to be—that marketing can be as much a strategic, problem-oriented and user-centered function as engineering is, even if these two camps don't immediately recognize it.
|
||||
|
||||
### Two cultures
|
||||
|
||||
That "great divide" between engineering and marketing is deep indeed—so entrenched that it resembles what C.P. Snow once called[ the "two cultures" problem][1]. Scientifically minded engineers and artistically minded marketers tend to speak different languages, and they're acculturated to believe they value divergent things.
|
||||
|
||||
But the fact is that they're more similar than they might think.[ A recent study][2] from the University of Washington (co-sponsored by Microsoft, Google, and the National Science Foundation) identified "what makes a great software engineer," and (not surprisingly) the list of characteristics sounds like it could apply to great marketers, too. For example, the authors list traits like:
|
||||
|
||||
* Passion
|
||||
* Open-mindedness
|
||||
* Curiosity
|
||||
* Cultivation of craft
|
||||
* Ability to handle complexity
|
||||
|
||||
And these are just a few! Of course, not every characteristic on the list applies to marketers—but the Venn diagram connecting these "two cultures" is tighter than I believe most of us think. _Both_ are striving to solve complex user and/or customer challenges. They just take a different approach to doing it.
|
||||
|
||||
Reading this list got me thinking: _What if these two personalities understood each other just a little bit more? Would there be power in that?_
|
||||
|
||||
You bet. I've seen it firsthand at Red Hat, where I'm surrounded by people I'd have quickly dismissed as "crazy creatives" during my early days. And I'd be willing to bet that a marketer has (at one time or another) looked at an engineer and thought, "Look at this data nerd. Can't see the forest beyond the trees."
|
||||
|
||||
I now understand the power of having both perspectives in the same room. And in reality, engineers and marketers are _both_ working at the _intersection of customers, creativity, and analytics_. And if they could just learn to recognize the ways their personalities compliment each other, we could see tremendously positive results—results far more surprising and innovative than we'd see if we kept them isolated from one another.
|
||||
|
||||
### Listening to the crazies (and the nerds)
|
||||
|
||||
Case in point: _The Open Organization_.
|
||||
|
||||
In my role at Red Hat I spent much of my day thinking about how to extend and amplify our brand—but never in a million years would I have thought to do it by asking our CEO to write a book. That idea came from a cross-functional team of those "crazy creatives," a group of people I rely on to help me imagine new and innovative solutions to branding challenges.
|
||||
|
||||
When I heard the idea, I recognized it right away as a quintessentially Red Hat approach to our work: something that would be valuable to a community of practitioners, and something that helps spread the message of openness just a little farther. By prioritizing these two goals above all others, we'd reinforce Red Hat's position as a positive force in the open source world, a trusted expert ready to help customers navigate the turbulence of[ digital disruption][3].
|
||||
|
||||
Here's the clincher: _That's exactly the same spirit guiding Red Hat engineers tackling problems of code._ The group of Red Hatters urging me to help make _The Open Organization_ a reality demonstrated one of the very same motivations as the programmers that make up our internal and external communities: a desire to share.
|
||||
|
||||
In the end, bringing _The Open Organization_ to life required help from across the spectrum of skills—both the intensely analytic and the beautifully artistic. Everyone pitched in. The project only cemented my belief that engineers and marketers are more alike than different.
|
||||
|
||||
But it also reinforced something else: The realization that openness shows no bias, no preference for a culture of engineering or a culture of marketing. The idea of a more open world can inspire them both equally, and the passion it ignites ripples across the artificial boundaries we draw around our groups.
|
||||
|
||||
That hardly sounds like fluff to me.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Jackie Yeaney - Chief Marketing Officer at Ellucian
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/open-organization/17/1/engineers-marketers-can-learn
|
||||
|
||||
作者:[Jackie Yeaney][a]
|
||||
译者:[译者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/jackie-yeaney
|
||||
[1]:https://en.wikipedia.org/wiki/The_Two_Cultures#Implications_and_influence
|
||||
[2]:https://faculty.washington.edu/ajko/papers/Li2015GreatEngineers.pdf
|
||||
[3]:https://opensource.com/open-organization/16/7/future-belongs-open-leaders
|
@ -0,0 +1,128 @@
|
||||
How to choose your first programming language
|
||||
============================================================[
|
||||
|
||||
][1]
|
||||

|
||||
Image by :
|
||||
|
||||
opensource.com
|
||||
|
||||
The reasons for learning to program are as a varied as the people who want to learn. You might have a program you want to make, or maybe you just want to jump in. So, before choosing your first programming language, ask yourself: Where do you want that program to run? What do you want that program to do?
|
||||
|
||||
Your reasons for learning to code should inform your choice of a first language.
|
||||
|
||||
_In this article, I use "code," "program," and "develop" interchangeably as verbs, while "code," "program," "application," and "app" interchangeably as nouns. This is to reflect language usage you may hear._
|
||||
|
||||
### Know your device
|
||||
|
||||
Where your programs will run is a defining factor in your choice of language.
|
||||
|
||||
Desktop applications are the traditional software programs that run on a desktop or laptop computer. For these you'll be writing code that only runs on a single computer at a time. Mobile applications, known as apps, run on portable communications devices using iOS, Android, or other operating systems. Web applications are websites that function like applications.
|
||||
|
||||
Web development is often broken into two subcategories, based on the web's client-server architecture:
|
||||
|
||||
* Front-end programming, which is writing code that runs in the web browser itself. This is the part that faces the user, or the "front end" of the program. It's sometimes called "client-side" programming, because the web browser is the client half of the web's client-server architecture. The web browser runs on your local computer or device.
|
||||
|
||||
* Back-end programming, which is also known as "server-side" programming, the code written runs on a server, which is a computer you don't have physical access to.
|
||||
|
||||
### What to create
|
||||
|
||||
Programming is a broad discipline and can be used in a variety of fields. Common examples include:
|
||||
|
||||
* data science,
|
||||
* web development,
|
||||
* game development, and
|
||||
* work automation of various types.
|
||||
|
||||
Now that we've looked at why and where you want to program, let's look at two great languages for beginners.
|
||||
|
||||
### Python
|
||||
|
||||
[Python][2] is one of the most popular languages for first-time programmers, and that is not by accident. Python is a general-purpose language. This means it can be used for a wide range of programming tasks. There's almost _nothing_ you can't do with Python. This lets a wide range of beginners make practical use of the language. Additionally, Python has two key design features that make it great for new programmers: a clear, English-like [syntax][3] and an emphasis on code [readability][4].
|
||||
|
||||
A language's syntax is essentially what you type to make the language perform. This can include words, special characters (like `;`, `$`, `%`, or `{}`), white space, or any combination. Python uses English for as much of this as possible, unlike other languages, which often use punctuation or special characters. As a result, Python reads much more like a natural, human language. This helps new programmers focus on solving problems, and they spend less time struggling with the specifics of the language itself.
|
||||
|
||||
Combined with that clear syntax is a focus on readability. When writing code, you'll create logical "blocks" of code, sections of code that work together for some related purpose. In many languages, those blocks are marked (or delimited) by special characters. They may be enclosed in `{}` or some other character. The combination of block-delimiting characters and your ability to write your code in almost any fashion can decrease readability. Let's look at an example.
|
||||
|
||||
Here's a small function, called "fun," which takes a number, `x` as its input. If `x`equals **0**, it runs another function called `no_fun` (which does something that's no fun). That function takes no input. Otherwise, it runs the function `big_fun`, using the same input, `x`.
|
||||
|
||||
This function defined in the ["C" language][5] could be written like this:
|
||||
|
||||
```
|
||||
void fun(int x)
|
||||
{
|
||||
if (x == 0) {
|
||||
no_fun();
|
||||
} else {
|
||||
big_fun(x);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
or, like this:
|
||||
|
||||
```
|
||||
void fun(int x) { if (x == 0) {no_fun(); } else {big_fun(x); }}
|
||||
```
|
||||
|
||||
Both are functionally equivalent and both will run. The `{}` and `;` tell us where different parts of the block are; however, one is _clearly_ more readable to a human. Contrast that with the same function in Python:
|
||||
|
||||
```
|
||||
def fun(x):
|
||||
if x == 0:
|
||||
no_fun()
|
||||
else:
|
||||
big_fun(x)
|
||||
```
|
||||
|
||||
In this case, there's only one option. If the code isn't structured this way, it won't work, so if you have code that works, you have code that's readable. Also, notice the difference in syntax. Other than `def`, the words in the Python code are English and would be clear to a broad audience. In the C language example `void` and `int` are less intuitive.
|
||||
|
||||
Python also has an excellent ecosystem. This means two things. First, you have a large, active community of people using the language you can turn to when you need help and guidance. Second, it has a large number of preexisiting libraries, which are chunks of code that perform special functions. These range from advanced mathematical processing to graphics to computer vision to almost anything you can imagine.
|
||||
|
||||
Python has two drawbacks to it being your first language. The first is that it can sometimes be tricky to install, especially on computers running Windows. (If you have a Mac or a Linux computer, Python is already installed.) Although this issue isn't insurmountable, and the situation is improving all the time, it can be a deterrent for some people. The second drawback is for people who specifically want to build websites. While there are projects written in Python (like [Django][6] and [Flask][7]) that let you build websites, there aren't many options for writing Python that will run in a web browser. It is primarily a back-end or server-side language.
|
||||
|
||||
### JavaScript
|
||||
|
||||
If you know your primary reason for learning to program is to build websites, [JavaScript][8] may be the best choice for you. JavaScript is _the_ language of the web. Besides being the default language of the web, JavaScript has a few advantages as a beginner language.
|
||||
|
||||
First, there's nothing to install. You can open any text editor (like Notepad on Windows, but not a word processor like Microsoft Word) and start typing JavaScript. The code will run in your web browser. Most modern web browsers have a JavaScript engine built in, so your code will run on almost any computer and a lot of mobile devices. The fact that you can run your code immediately in a web browser provides a _very_ fast feedback loop, which is good for new coders. You can try something and see the results very quickly.
|
||||
|
||||
While JavaScript started life as a front-end language, an environment called [Node.js][9] lets you write code that runs in a web browser or on a server. Now JavaScript can be used as a front-end or back-end language. This has led to an increase in its popularity. JavaScript also has a huge number of packages that provide added functionality to the core language, allowing it to be used as a general-purpose language, and not just as the language of web development. Like Python, JavaScript has a vibrant, active ecosystem.
|
||||
|
||||
Despite these strengths, JavaScript is not without its drawbacks for new programmers. The [syntax of JavaScript][10] is not as clear or English-like as Python. It's much more like the C example above. It also doesn't have readability as a key design principle.
|
||||
|
||||
### Making a choice
|
||||
|
||||
It's hard to go wrong with either Python or JavaScript as your first language. The key factor is what you intend to do. Why are you learning to code? Your answer should influence your decision most heavily. If you're looking to make contributions to open source, you will find a _huge_ number of projects written in both languages. In addition, many projects that aren't primarily written in JavaScript still make use of it for their front-end component. As you're making a choice, don't forget about your local community. Do you have friends or co-workers who use either of these languages? For a new coder, having live support is very important.
|
||||
|
||||
Good luck and happy coding.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Kojo Idrissa - I'm a new software developer (1 year) who changed careers from accounting and university teaching. I've been a fan of Open Source software since around the time the term was coined, but I didn't have a NEED to do much coding in my prior careers. Tech-wise, I focus on Python, automated testing, and learning Django. I hope to learn more JavaScript soon. Topic-wise, I like to focus on helping new people get started with programing or getting involved in contributing to Open Source projects. I also focus on inclusive culture in tech environments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/choosing-your-first-programming-language
|
||||
|
||||
作者:[Kojo Idrissa][a]
|
||||
译者:[译者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/transitionkojo
|
||||
[1]:https://opensource.com/article/17/1/choosing-your-first-programming-language?rate=fWoYXudAZ59IkAKZ8n5lQpsa4bErlSzDEo512Al6Onk
|
||||
[2]:https://www.python.org/about/
|
||||
[3]:https://en.wikipedia.org/wiki/Python_syntax_and_semantics
|
||||
[4]:https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Indentation
|
||||
[5]:https://en.wikipedia.org/wiki/C_(programming_language
|
||||
[6]:https://www.djangoproject.com/
|
||||
[7]:http://flask.pocoo.org/
|
||||
[8]:https://en.wikipedia.org/wiki/JavaScript
|
||||
[9]:https://nodejs.org/en/
|
||||
[10]:https://en.wikipedia.org/wiki/JavaScript_syntax#Basics
|
@ -0,0 +1,242 @@
|
||||
# rusking translating
|
||||
|
||||
How Linux got to be Linux: Test driving 1993-2003 distros
|
||||
============================================================
|
||||
|
||||
### Enjoy a trip down Linux memory lane as we take early distros for a spin.
|
||||
|
||||

|
||||
|
||||
Image by :
|
||||
|
||||
Internet Archive [Book][7] [Images][8]. Modified by Opensource.com. CC BY-SA 4.0
|
||||
|
||||
A unique trait of open source is that it's never truly EOL (End of Life). The disc images mostly remain online, and their licenses don't expire, so going back and installing an old version of Linux in a virtual machine and getting a precise picture of what progress Linux has made over the years is relatively simple.
|
||||
|
||||
We begin our journey with Slackware 1.01, posted to the **comp.os.linux.announce** newsgroup well over 20 years ago.
|
||||
|
||||
### Slackware 1.01 (1993)
|
||||
|
||||

|
||||
|
||||
Slackware 1.01
|
||||
|
||||
The best part about trying Slackware 1.01 is that there's a pre-made image in Qemu's [2014 series][9] of free images, so you don't have to perform the install manually (don't get used to this luxury).
|
||||
|
||||
```
|
||||
$ qemu-kvm -m 16M -drive if=ide,format=qcow2,file=slackware.qcow2 \
|
||||
-netdev user,id=slirp -device ne2k_isa,netdev=slirp \
|
||||
-serial stdio -redir tcp:22122::22
|
||||
```
|
||||
|
||||
Many things in 1993's version of Linux works just as you'd expect. All the basic commands, such as `ls` and `cd` work, all the basic tools (`gawk`, `cut`, `diff`, `perl`, and of course [Volkerding][10]'s favorite `elvis`) are present and accounted for, but some of the little things surprised me. `BASH` courteously asks for confirmation when you try to tab-complete hundreds of files, and tools to inspect compressed files (such as `zless` and `zmore` and `zcat`) already existed. In more ways than I'd expected, the system feels surprisingly modern.
|
||||
|
||||
What's missing is any notion of package management. All installs and uninstalls are entirely manual, with no tracking.
|
||||
|
||||
Over all, Slackware 1.01 feels a lot like a fairly modern UNIX—or more appropriately, it feels like modern UNIX might feel to a Linux user. Most everything is familiar, but there are differences here and there. Not nearly as much a difference as you might expect from an operating system released in 1993!
|
||||
|
||||
### Debian 0.91 (1994)
|
||||
|
||||
To try Debian 0.91, I used the floppy disk images available on the [Ibiblio digital archive][11], originally posted in 1994\. The commands to boot:
|
||||
|
||||
```
|
||||
$ gunzip bootdsk.gz basedsk1.gz basedsk2.gz
|
||||
$ qemu-system-i386 -M pc -m 64 -boot order=ac,menu=on \
|
||||
-drive file=bootdisk,if=floppy,format=raw \
|
||||
-drive file=debian.raw,if=ide,format=raw \
|
||||
-device ne2k_isa,netdev=slirp \
|
||||
-serial msmouse -vga std \
|
||||
-redir tcp:22122::22 \
|
||||
-netdev user,id=slirp
|
||||
```
|
||||
|
||||
The bootdisk for Debian 0.91 boots to a simple shell, with clear instructions on the steps you're meant to take next.
|
||||
|
||||
The install process is surprisingly smooth. It works off of a menu system with seven steps—from partitioning a hard drive and writing the ext2 filesystem to it, all the way through to copying the `basedsk` images. This provided a minimal Debian install with many of the familiar conventions any modern Linux user would expect from their OS.
|
||||
|
||||
Debian is now famous for its package management system, but there are mere hints of that in this early release. The `dpkg` command exists, but it's an interactive menu-based system—a sort of clunky `aptitude`, with several layers of menu selections and, unsurprisingly, a fraction of available packages.
|
||||
|
||||
Even so, you can sense the convenience factor in the design concept. You download three floppy images and end up with a bootable system, and then use a simple text menu to install more goodies. I sincerely see why Debian made a splash.
|
||||
|
||||
### Jurix/S.u.S.E. (1996)
|
||||
|
||||

|
||||
|
||||
Jurix installation
|
||||
|
||||
A pre-cursor to SUSE, Jurix shipped with binary `.tgz` packages organized into directories resembling the structure of Slackware's install packages. The installer itself is also similar to Slackware's installer.
|
||||
|
||||
```
|
||||
$ qemu-system-i386 -M pc -m 1024 \
|
||||
-boot order=ac,menu=on \
|
||||
-drive \
|
||||
file=jurix/install,if=floppy,format=raw \
|
||||
-drive file=jurix.img,if=ide \
|
||||
-drive file=pkg.raw,if=ide,format=raw \
|
||||
-device ne2k_isa,netdev=slirp \
|
||||
-serial msmouse -vga std \
|
||||
-redir tcp:22122::22 \
|
||||
-netdev user,id=slirp
|
||||
```
|
||||
|
||||
Because I wasn't specifically looking for the earliest instance, Jurix was the first Linux distribution I found that really "felt" like it intended the user to use a GUI environment. [XFree86][12] is installed by default, so if you didn't intend to use it, you had to opt out.
|
||||
|
||||
An example `/usr/lib/X11/XF86Config` (this later became `Xorg.conf`) file was provided, and that got me 90% of the way to a GUI, but fine-tuning `vsync`, `hsync`, and `ramdac` colormap overrides took me an entire weekend until I finally gave up.
|
||||
|
||||
Installing new packages on Jurix was simple; find a `.tgz` on your sources drive, and run a routine `tar` command: ` $ su -c 'tar xzvf foo.tgz -C /'`The package gets unzipped and unarchived to the root partition, and ready to use. I did this with several packages I hadn't installed to begin with, and found it easy, fast, and reliable.
|
||||
|
||||
### SUSE 5.1 (1998)
|
||||
|
||||

|
||||
|
||||
FVWM running on SuSE 5.1
|
||||
|
||||
I installed SUSE 5.1 from a InfoMagic CD-ROM purchased from a software store in Maryland in 1998.
|
||||
|
||||
```
|
||||
$ qemu-system-i386 -M pc-0.10 -m 64 \
|
||||
-boot order=ad,menu=on \
|
||||
-drive file=floppy.raw,if=floppy,format=raw \
|
||||
-cdrom /dev/sr0 \
|
||||
-drive file=suse5.raw,if=ide,format=raw \
|
||||
-vga cirrus -serial msmouse
|
||||
```
|
||||
|
||||
The install process was convoluted compared to those that came before. YaST volleyed configuration files and settings between a floppy disk and the boot CD-ROM, requiring several reboots and a few restarts as I tried to understand the sequence expected from me. Once I'd failed the process twice, I got used to the way YaST worked, and the third time was smooth and very much a hint at the Linux user experience to come in later years.
|
||||
|
||||
A GUI environment was my main goal for SUSE 5.1\. The configuration process was familiar, with a few nice graphical tools (including a good `XF86Setup`frontend) to help test and debug mouse and monitor problems. It took less than an hour to get a GUI up and running, and most of the delay was caused by my own research on what resolutions and color depths Qemu's virtualized video card could handle.
|
||||
|
||||
Included desktops were `fvwm`, `fvwm2`, and `ctwm`. I used `fvwm`, and it worked as expected. I even discovered `tkDesk`, a dock and file manager combo pack that is surprisingly similar to Ubuntu's `Unity` launcher bar.
|
||||
|
||||
The experience was, over all, very pleasant, and in terms of getting a successful desktop up and running, SUSE 5.1 was a rousing success.
|
||||
|
||||
### Red Hat 6.0 (1999)
|
||||
|
||||

|
||||
|
||||
Red Hat 6 running GIMP 1.x
|
||||
|
||||
The next install disc I happened to have lying around was Red Hat 6.0\. That's not RHEL 6.0—just Red Hat 6.0\. This was a desktop distribution sold in stores, before RHEL or Fedora existed. The disc I used was purchased in June 1999.
|
||||
|
||||
```
|
||||
$ qemu-system-i386 -M pc-0.10 -m 512 \
|
||||
-boot order=ad,menu=on \
|
||||
-drive file=redhat6.raw,if=ide,format=raw \
|
||||
-serial msmouse -netdev user,id=slirp \
|
||||
-vga cirrus -cdrom /dev/sr0
|
||||
```
|
||||
|
||||
The installation was fully guided and remarkably fast. You never have to leave the safety of the install process, whether choosing what packages to install (grouped together in **Workstation**, **Server**, and **Custom** groups), partitioning a drive, or kicking off the install.
|
||||
|
||||
Red Hat 6 included an `xf86config` application to step you through X configuration, although it strangely allowed some mouse emulation options that X later claimed were invalid. It beat editing the Xf86Config file, but getting X correct was still clearly not a simple task.
|
||||
|
||||
The desktop bundled with Red Hat 6 was, as it still is, GNOME, but the window manager was an early [Enlightenment][13], which also provided the main sound daemon. `Xdm` and `gdm` were both provided as login managers so that normal users could log in without having the permission to start or kill X itself, which is particularly important on multi-user systems.
|
||||
|
||||
Certain staple applications are missing; `gedit` didn't exist yet, there's no grand unified office application, and there was no package manager to speak of. `GnoRPM`, a GUI interface for RPM installation, review, and removal, was the closest to a `yum` or `PackageKit` experience it had, and `gnotepad+` is the GUI text editor (Emacs notwithstanding, obviously).
|
||||
|
||||
Over all, though, the desktop is intuitive. Unlike later implementations of GNOME, this early version featured a panel at the bottom of the screen, with an application menu and launcher icons and virtual desktop control in a central location. I can't imagine a user of another operating system at the time finding this environment foreign.
|
||||
|
||||
Red Hat 6 was a strong entry for Linux, which was obviously moving seriously toward being a proper desktop OS.
|
||||
|
||||
### Mandrake 8.0 (2001)
|
||||
|
||||

|
||||
|
||||
Mandrake: A turning point in Linux
|
||||
|
||||
Mandrake 8.0 was released in 2001, so it would have been compared to, for instance, Apple OS 9.2 and Windows ME.
|
||||
|
||||
I fell back on fairly old emulated tech to be safe.
|
||||
|
||||
```
|
||||
$ qemu-system-i386 \
|
||||
-M pc-0.10 -m 2048 \
|
||||
-boot order=ad,menu=on \
|
||||
-drive file=mandrake8.qcow2 \
|
||||
-usb -net nic,model=rtl8139 \
|
||||
-netdev user,id=slirp \
|
||||
-vga cirrus \
|
||||
-cdrom mandrake-8.0-i386.iso
|
||||
```
|
||||
|
||||
I'd thought the Red Hat installation process had been nice, but Mandrake's was amazing. It was friendly, it gave the user a chance to test configurations before continuing, it was easy and fast, and it worked almost like magic. I didn't even have to import my `XF86Config` file, because Mandrake's installer got it right.
|
||||
|
||||

|
||||
|
||||
Mandrake 8.0 installer
|
||||
|
||||
Using the Mandrake desktop is a lot like using any given desktop of the time, actually. I was a little surprised at how similar the experience was. I feel certain that if I'd somehow stumbled into Mandrake Linux at this time, it actually wouldn't have been beyond my ability, even as a young and not very technical user. The interfaces are intuitive, the documentation helpful, and the package management quite natural, for a time when it still wasn't yet the mental default for people to just go to a website and download an installer for whatever software they wanted.
|
||||
|
||||
### Fedora 1 (2003)
|
||||
|
||||

|
||||
|
||||
Blue Fedora, Red Hat
|
||||
|
||||
In 2003, the new Fedora Core distribution was released. Fedora Core was based on Red Hat, and was meant to carry on the banner of desktop Linux once Red Hat Enterprise Linux (RHEL) became the flagship product of the company.
|
||||
|
||||
Nothing particularly special is required to boot the old Fedora Core 1 disc:
|
||||
|
||||
```
|
||||
$ qemu-system-i386 -M pc \
|
||||
-m 2048 -boot order=ac,menu=on \
|
||||
-drive file=fedora1.qcow2 -usb \
|
||||
-net nic,model='rtl8139' -netdev user \
|
||||
-vga cirrus -cdrom fedora-1-i386-cd1.iso
|
||||
```
|
||||
|
||||
Installing Fedora Core is simple and familiar; it uses the same installer as Fedora and Red Hat for the next 9 years. It's a graphical interface that's easy to use and easy to understand.
|
||||
|
||||

|
||||
Anaconda GUI
|
||||
|
||||
The Fedora Core experience is largely indistinguishable from Red Hat 6 or 7\. The GNOME desktop is polished, there are all the signature configuration helper applications, and the presentation is clean and professional.
|
||||
|
||||
A _Start Here_ icon on the desktop guides the user toward three locations: an _Applications_ folder, the _Preferences_ panel, and _System Settings_. A red hat icon marks the applications menu, and the lower GNOME panel holds all the latest Linux application launchers, including the OpenOffice office suite and the Mozilla browser.
|
||||
|
||||
### The future
|
||||
|
||||
By the early 2000s, it's clear that Linux has well and truly hit its stride. The desktop is more polished than ever, the applications available want for nothing, the installation is easier and more efficient than other operating systems. In fact, from the early 2000s onward, the relationship between the user and the system is firmly established and remains basically unchanged even today. There are some changes, and of course several updates and improvements and a staggering amount of innovation.
|
||||
|
||||
Project names come and go:
|
||||
|
||||
* Mandrake became Mandriva and then [Mageia][1];
|
||||
* Fedora Core became just [Fedora][2];
|
||||
* [Ubuntu][3] popped up from [Debian][4] and helped make "Linux" a household term;
|
||||
* Valve has made [SteamOS][5] the official basis for its gaming platform; and
|
||||
* [Slackware][6] quietly continues to this day.
|
||||
|
||||
Whether you're new to Linux, or whether you're such an old hand that most of these screenshots have been more biographical than historical, it's good to be able to look back at how one of the largest open source projects in the world has developed. More importantly, it's exciting to think of where Linux is headed and how we can all be a part of that, starting now, and for years to come.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Seth Kenlon - Seth Kenlon is an independent multimedia artist, free culture advocate, and UNIX geek. He is one of the maintainers of the Slackware-based multimedia production project, http://slackermedia.ml
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/16/12/yearbook-linux-test-driving-distros
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
译者:[译者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
|
||||
[1]:http://mageia.org/
|
||||
[2]:http://fedoraproject.org/
|
||||
[3]:http://ubuntu.com/
|
||||
[4]:http://debian.org/
|
||||
[5]:http://store.steampowered.com/steamos
|
||||
[6]:http://slackware.com/
|
||||
[7]:https://www.flickr.com/photos/internetarchivebookimages/14746482994/in/photolist-ot6zCN-odgbDq-orm48o-otifuv-otdyWa-ouDjnZ-otGT2L-odYVqY-otmff7-otGamG-otnmSg-rxnhoq-orTmKf-otUn6k-otBg1e-Gm6FEf-x4Fh64-otUcGR-wcXsxg-tLTN9R-otrWYV-otnyUE-iaaBKz-ovcPPi-ovokCg-ov4pwM-x8Tdf1-hT5mYr-otb75b-8Zk6XR-vtefQ7-vtehjQ-xhhN9r-vdXhWm-xFBgtQ-vdXdJU-vvTH6R-uyG5rH-vuZChC-xhhGii-vvU5Uv-vvTNpB-vvxqsV-xyN2Ai-vdXcFw-vdXuNC-wBMhes-xxYmxu-vdXxwS-vvU8Zt
|
||||
[8]:https://www.flickr.com/photos/internetarchivebookimages/14774719031/in/photolist-ovAie2-otPK99-xtDX7p-tmxqWf-ow3i43-odd68o-xUPaxW-yHCtWi-wZVsrD-DExW5g-BrzB7b-CmMpC9-oy4hyF-x3UDWA-ow1m4A-x1ij7w-tBdz9a-tQMoRm-wn3tdw-oegTJz-owgrs2-rtpeX1-vNN6g9-owemNT-x3o3pX-wiJyEs-CGCC4W-owg22q-oeT71w-w6PRMn-Ds8gyR-x2Aodm-owoJQm-owtGp9-qVxppC-xM3Gw7-owgV5J-ou9WEs-wihHtF-CRmosE-uk9vB3-wiKdW6-oeGKq3-oeFS4f-x5AZtd-w6PNuv-xgkofr-wZx1gJ-EaYPED-oxCbFP
|
||||
[9]:http://www.qemu-advent-calendar.org/2014
|
||||
[10]:http://www.slackware.com/~volkerdi/
|
||||
[11]:https://ibiblio.org/pub/historic-linux/distributions/debian-0.91/debian-0.91/dist
|
||||
[12]:http://www.xfree86.org/
|
||||
[13]:http://enlightenment.org/
|
320
sources/tech/20161222 Top open source creative tools in 2016.md
Normal file
320
sources/tech/20161222 Top open source creative tools in 2016.md
Normal file
@ -0,0 +1,320 @@
|
||||
Top open source creative tools in 2016
|
||||
============================================================
|
||||
|
||||
### Whether you want to manipulate images, edit audio, or animate stories, there's a free and open source tool to do the trick.
|
||||
|
||||

|
||||
|
||||
>Image by : opensource.com
|
||||
|
||||
A few years ago, I gave a lightning talk at Red Hat Summit that took attendees on a tour of the [2012 open source creative tools][12] landscape. Open source tools have evolved a lot in the past few years, so let's take a tour of 2016 landscape.
|
||||
|
||||
### Core applications
|
||||
|
||||
These six applications are the juggernauts of open source design tools. They are well-established, mature projects with full feature sets, stable releases, and active development communities. All six applications are cross-platform; each is available on Linux, OS X, and Windows, although in some cases the Linux versions are the most quickly updated. These applications are so widely known, I've also included highlights of the latest features available that you may have missed if you don't closely follow their development.
|
||||
|
||||
If you'd like to follow new developments more closely, and perhaps even help out by testing the latest development versions of the first four of these applications—GIMP, Inkscape, Scribus, and MyPaint—you can install them easily on Linux using [Flatpak][13]. Nightly builds of each of these applications are available via Flatpak by [following the instructions][14] for _Nightly Graphics Apps_. One thing to note: If you'd like to install brushes or other extensions to each Flatpak version of the app, the directory to drop the extensions in will be under the directory corresponding to the application inside the **~/.var/app** directory.
|
||||
|
||||
### GIMP
|
||||
|
||||
[GIMP][15] [celebrated its 20th anniversary in 2015][16], making it one of the oldest open source creative applications out there. GIMP is a solid program for photo manipulation, basic graphic creation, and illustration. You can start using GIMP by trying simple tasks, such as cropping and resizing images, and over time work into a deep set of functionality. Available for Linux, Mac OS X, and Windows, GIMP is cross-platform and can open and export to a wide breadth of file formats, including those popularized by its proprietary analogue, Photoshop.
|
||||
|
||||
The GIMP team is currently working toward the 2.10 release; [2.8.18][17] is the latest stable version. More exciting is the unstable version, [2.9.4][18], with a revamped user interface featuring space-saving symbolic icons and dark themes, improved color management, more GEGL-based filters with split-preview, MyPaint brush support (shown in screenshot below), symmetrical drawing, and command-line batch processing. For more details, check out [the full release notes][19].
|
||||
|
||||

|
||||
|
||||
### Inkscape
|
||||
|
||||
[Inkscape][20] is a richly featured vector-based graphic design workhorse. Use it to create simple graphics, diagrams, layouts, or icon art.
|
||||
|
||||
The latest stable version is [0.91][21]; similarly to GIMP, more excitement can be found in a pre-release version, 0.92pre3, which was released November 2016\. The premiere feature of the latest pre-release is the [gradient mesh feature][22](demonstrated in screenshot below); new features introduce in the 0.91 release include [power stroke][23] for fully configurable calligraphic strokes (the "open" in "opensource.com" in the screenshot below uses powerstroke), the on-canvas measure tool, and [the new symbols dialog][24] (shown in the right side of the screenshot below). (Many symbol libraries for Inkscape are available on GitHub; [Xaviju's inkscape-open-symbols set][25] is fantastic.) A new feature available in development/nightly builds is the _Objects_ dialog that catalogs all objects in a document and provides tools to manage them.
|
||||
|
||||

|
||||
|
||||
### Scribus
|
||||
|
||||
[Scribus][26] is a powerful desktop publishing and page layout tool. Scribus enables you to create sophisticated and beautiful items, including newsletters, books, and magazines, as well as other print pieces. Scribus has color management tools that can handle and output CMYK and spot colors for files that are ready for reliable reproduction at print shops.
|
||||
|
||||
[1.4.6][27] is the latest stable release of Scribus; the [1.5.x][28] series of releases is the most exciting as they serve as a preview to the upcoming 1.6.0 release. Version 1.5.3 features a Krita file (*.KRA) file import tool; other developments in the 1.5.x series include the _Table_ tool, text frame welding, footnotes, additional PDF formats for export, improved dictionary support, dockable palettes, a symbols tool, and expanded file format support.
|
||||
|
||||

|
||||
|
||||
### MyPaint
|
||||
|
||||
[MyPaint][29] is a drawing tablet-centric expressive drawing and illustration tool. It's lightweight and has a minimal interface with a rich set of keyboard shortcuts so that you can focus on your drawing without having to drop your pen.
|
||||
|
||||
[MyPaint 1.2.0][30] is the latest stable release and includes new features, such as the [intuitive inking tool][31] for tracing over pencil drawings, new flood fill tool, layer groups, brush and color history panel, user interface revamp including a dark theme and small symbolic icons, and editable vector layers. To try out the latest developments in MyPaint, I recommend installing the nightly Flatpak build, although there have not been significant feature additions since the 1.2.0 release.
|
||||
|
||||

|
||||
|
||||
### Blender
|
||||
|
||||
Initially released in January 1995, [Blender][32], like GIMP, has been around for more than 20 years. Blender is a powerful open source 3D creation suite that includes tools for modeling, sculpting, rendering, realistic materials, rigging, animation, compositing, video editing, game creation, and simulation.
|
||||
|
||||
The latest stable Blender release is [2.78a][33]. The 2.78 release was a large one and includes features such as the revamped _Grease Pencil_ 2D animation tool; VR rendering support for spherical stereo images; and a new drawing tool for freehand curves.
|
||||
|
||||

|
||||
|
||||
To try out the latest exciting Blender developments, you have many options, including:
|
||||
|
||||
* The Blender Foundation makes [unstable daily builds][2] available on the official Blender website.
|
||||
* If you're looking for builds that include particular in-development features, [graphicall.org][3] is a community-moderated site that provides special versions of Blender (and occasionally other open source creative apps) to enable artists to try out the latest available code and experiments.
|
||||
* Mathieu Bridon has made development versions of Blender available via Flatpak. See his blog post for details: [Blender nightly in Flatpak][4].
|
||||
|
||||
### Krita
|
||||
|
||||
[Krita][34] is a digital drawing application with a deep set of capabilities. The application is geared toward illustrators, concept artists, and comic artists and is fully loaded with extras, such as brushes, palettes, patterns, and templates.
|
||||
|
||||
The latest stable version is [Krita 3.0.1][35], released in September 2016\. Features new to the 3.0.x series include 2D frame-by-frame animation; improved layer management and functionality; expanded and more usable shortcuts; improvements to grids, guides, and snapping; and soft-proofing.
|
||||
|
||||

|
||||
|
||||
### Video tools
|
||||
|
||||
There are many, many options for open source video editing tools. Of the members of the pack, [Flowblade][36] is a newcomer and Kdenlive is the established, newbie-friendly, and most fully featured contender. The main criteria that may help you eliminate some of this array of options is supported platforms—some of these only support Linux. These all have active upstreams and the latest stable versions of each have been released recently, within weeks of each other.
|
||||
|
||||
### Kdenlive
|
||||
|
||||
[Kdenlive][37], which was initially released back in 2002, is a powerful non-linear video editor available for Linux and OS X (although the OS X version is out-of-date). Kdenlive has a user-friendly drag-and-drop-based user interface that accommodates beginners, and with the depth experts need.
|
||||
|
||||
Learn how to use Kdenlive with an [multi-part Kdenlive tutorial series][38] by Seth Kenlon.
|
||||
|
||||
* Latest Stable: 16.08.2 (October 2016)
|
||||
|
||||

|
||||
|
||||
### Flowblade
|
||||
|
||||
Released in 2012, [Flowblade][39], a Linux-only video editor, is a relative newcomer.
|
||||
|
||||
* Latest Stable: 1.8 (September 2016)
|
||||
|
||||
### Pitivi
|
||||
|
||||
[Pitivi][40] is a user-friendly free and open source video editor. Pitivi is written in [Python][41] (the "Pi" in Pitivi), uses the [GStreamer][42] multimedia framework, and has an active community.
|
||||
|
||||
* Latest stable: 0.97 (August 2016)
|
||||
* Get the [latest version with Flatpak][5]
|
||||
|
||||
### Shotcut
|
||||
|
||||
[Shotcut][43] is a free, open source, cross-platform video editor that started [back in 2004][44] and was later rewritten by current lead developer [Dan Dennedy][45].
|
||||
|
||||
* Latest stable: 16.11 (November 2016)
|
||||
* 4K resolution support
|
||||
* Ships as a tarballed binary
|
||||
|
||||
|
||||
|
||||
### OpenShot Video Editor
|
||||
|
||||
Started in 2008, [OpenShot Video Editor][46] is a free, open source, easy-to-use, cross-platform video editor.
|
||||
|
||||
* Latest stable: [2.1][6] (August 2016)
|
||||
|
||||
|
||||
### Utilities
|
||||
|
||||
### SwatchBooker
|
||||
|
||||
[SwatchBooker][47] is a handy utility, and although it hasn't been updated in a few years, it's still useful. SwatchBooker helps users legally obtain color swatches from various manufacturers in a format that you can use with other free and open source tools, including Scribus.
|
||||
|
||||
### GNOME Color Manager
|
||||
|
||||
[GNOME Color Manager][48] is the built-in color management system for the GNOME desktop environment, the default desktop for a bunch of Linux distros. The tool allows you to create profiles for your display devices using a colorimeter, and also allows you to load/managed ICC color profiles for those devices.
|
||||
|
||||
### GNOME Wacom Control
|
||||
|
||||
[The GNOME Wacom controls][49] allow you to configure your Wacom tablet in the GNOME desktop environment; you can modify various options for interacting with the tablet, including customizing the sensitivity of the tablet and which monitors the tablet maps to.
|
||||
|
||||
### Xournal
|
||||
|
||||
[Xournal][50] is a humble but solid app that allows you to hand write/doodle notes using a tablet. Xournal is a useful tool for signing or otherwise annotating PDF documents.
|
||||
|
||||
### PDF Mod
|
||||
|
||||
[PDF Mod][51] is a handy utility for editing PDFs. PDF Mod lets users remove pages, add pages, bind multiple single PDFs together into a single PDF, reorder the pages, and rotate the pages.
|
||||
|
||||
### SparkleShare
|
||||
|
||||
[SparkleShare][52] is a git-backed file-sharing tool artists use to collaborate and share assets. Hook it up to a GitLab repo and you've got a nice open source infrastructure for asset management. The SparkleShare front end nullifies the inscrutability of git by providing a dropbox-like interface on top of it.
|
||||
|
||||
### Photography
|
||||
|
||||
### Darktable
|
||||
|
||||
[Darktable][53] is an application that allows you to develop digital RAW files and has a rich set of tools for the workflow management and non-destructive editing of photographic images. Darktable includes support for an extensive range of popular cameras and lenses.
|
||||
|
||||

|
||||
|
||||
### Entangle
|
||||
|
||||
[Entangle][54] allows you to tether your digital camera to your computer and enables you to control your camera completely from the computer.
|
||||
|
||||
### Hugin
|
||||
|
||||
[Hugin][55] is a tool that allows you to stitch together photos in order to create panoramic photos.
|
||||
|
||||
### 2D animation
|
||||
|
||||
### Synfig Studio
|
||||
|
||||
[Synfig Studio][56] is a vector-based 2D animation suite that also supports bitmap artwork and is tablet-friendly.
|
||||
|
||||
### Blender Grease Pencil
|
||||
|
||||
I covered Blender above, but particularly notable from a recent release is [a refactored grease pencil feature][57], which adds the ability to create 2D animations.
|
||||
|
||||
|
||||
### Krita
|
||||
|
||||
[Krita][58] also now provides 2D animation functionality.
|
||||
|
||||
|
||||
### Music and audio editing
|
||||
|
||||
### Audacity
|
||||
|
||||
[Audacity][59] is popular, user-friendly tool for editing audio files and recording sound.
|
||||
|
||||
### Ardour
|
||||
|
||||
[Ardour][60] is a digital audio workstation with an interface centered around a record, edit, and mix workflow. It's a little more complicated than Audacity to use but allows for automation and is generally more sophisticated. (Available for Linux, Mac OS X, and Windows.)
|
||||
|
||||
### Hydrogen
|
||||
|
||||
[Hydrogen][61] is an open source drum machine with an intuitive interface. It provides the ability to create and arrange various patterns using synthesized instruments.
|
||||
|
||||
### Mixxx
|
||||
|
||||
[Mixxx][62] is a four-deck DJ suite that allows you to DJ and mix songs together with powerful controls, including beat looping, time stretching, and pitch bending, as well as live broadcast your mixes and interface with DJ hardware controllers.
|
||||
|
||||
### Rosegarden
|
||||
|
||||
[Rosegarden][63] is a music composition suite that includes tools for score writing and music composition/editing and provides an audio and MIDI sequencer.
|
||||
|
||||
### MuseScore
|
||||
|
||||
[MuseScore][64] is a music score creation, notation, and editing tool with a community of musical score contributors.
|
||||
|
||||
### Additional creative tools
|
||||
|
||||
### MakeHuman
|
||||
|
||||
[MakeHuman][65] is a 3D graphical tool for creating photorealistic models of humanoid forms.
|
||||
|
||||
<iframe allowfullscreen="" frameborder="0" height="293" src="https://www.youtube.com/embed/WiEDGbRnXdE?rel=0" width="520"></iframe>
|
||||
|
||||
### Natron
|
||||
|
||||
[Natron][66] is a node-based compositor tool used for video post-production and motion graphic and special effect design.
|
||||
|
||||
### FontForge
|
||||
|
||||
[FontForge][67] is a typeface creation and editing tool. It allows you to edit letter forms in a typeface as well as generate fonts for using those typeface designs.
|
||||
|
||||
### Valentina
|
||||
|
||||
[Valentina][68] is an application for drafting sewing patterns.
|
||||
|
||||
### Calligra Flow
|
||||
|
||||
[Calligra Flow][69] is a Visio-like diagramming tool. (Available for Linux, Mac OS X, and Windows.)
|
||||
|
||||
### Resources
|
||||
|
||||
There are a lot of toys and goodies to try out there. Need some inspiration to start your exploration? These websites and conference are chock-full of tutorials and beautiful creative works to inspire you get you going:
|
||||
|
||||
1. [pixls.us][7]: Blog hosted by photographer Pat David that focuses on free and open source tools and workflow for professional photographers.
|
||||
2. [David Revoy's Blog][8] The blog of David Revoy, an immensely talented free and open source illustrator, concept artist, and advocate, with credits on several of the Blender Foundation films.
|
||||
3. [The Open Source Creative Podcast][9]: Hosted by Opensource.com community moderator and columnist [Jason van Gumster][10], who is a Blender and GIMP expert, and author of _[Blender for Dummies][1]_, this podcast is directed squarely at those of us who enjoy open source creative tools and the culture around them.
|
||||
4. [Libre Graphics Meeting][11]: Annual conference for free and open source creative software developers and the creatives who use the software. This is the place to find out about what cool features are coming down the pipeline in your favorite open source creative tools, and to enjoy what their users are creating with them.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Máirín Duffy - Máirín is a principal interaction designer at Red Hat. She is passionate about software freedom and free & open source tools, particularly in the creative domain: her favorite application is Inkscape (http://inkscape.org).
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/16/12/yearbook-top-open-source-creative-tools-2016
|
||||
|
||||
作者:[Máirín Duffy][a]
|
||||
译者:[译者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/mairin
|
||||
[1]:http://www.blenderbasics.com/
|
||||
[2]:https://builder.blender.org/download/
|
||||
[3]:http://graphicall.org/
|
||||
[4]:https://mathieu.daitauha.fr/blog/2016/09/23/blender-nightly-in-flatpak/
|
||||
[5]:https://pitivi.wordpress.com/2016/07/18/get-pitivi-directly-from-us-with-flatpak/
|
||||
[6]:http://www.openshotvideo.com/2016/08/openshot-21-released.html
|
||||
[7]:http://pixls.us/
|
||||
[8]:http://davidrevoy.com/
|
||||
[9]:http://monsterjavaguns.com/podcast/
|
||||
[10]:https://opensource.com/users/jason-van-gumster
|
||||
[11]:http://libregraphicsmeeting.org/2016/
|
||||
[12]:https://opensource.com/life/12/9/tour-through-open-source-creative-tools
|
||||
[13]:https://opensource.com/business/16/8/flatpak
|
||||
[14]:http://flatpak.org/apps.html
|
||||
[15]:https://opensource.com/tags/gimp
|
||||
[16]:https://www.gimp.org/news/2015/11/22/20-years-of-gimp-release-of-gimp-2816/
|
||||
[17]:https://www.gimp.org/news/2016/07/14/gimp-2-8-18-released/
|
||||
[18]:https://www.gimp.org/news/2016/07/13/gimp-2-9-4-released/
|
||||
[19]:https://www.gimp.org/news/2016/07/13/gimp-2-9-4-released/
|
||||
[20]:https://opensource.com/tags/inkscape
|
||||
[21]:http://wiki.inkscape.org/wiki/index.php/Release_notes/0.91
|
||||
[22]:http://wiki.inkscape.org/wiki/index.php/Mesh_Gradients
|
||||
[23]:https://www.youtube.com/watch?v=IztyV-Dy4CE
|
||||
[24]:https://inkscape.org/cs/~doctormo/%E2%98%85symbols-dialog
|
||||
[25]:https://github.com/Xaviju/inkscape-open-symbols
|
||||
[26]:https://opensource.com/tags/scribus
|
||||
[27]:https://www.scribus.net/scribus-1-4-6-released/
|
||||
[28]:https://www.scribus.net/scribus-1-5-2-released/
|
||||
[29]:http://mypaint.org/
|
||||
[30]:http://mypaint.org/blog/2016/01/15/mypaint-1.2.0-released/
|
||||
[31]:https://github.com/mypaint/mypaint/wiki/v1.2-Inking-Tool
|
||||
[32]:https://opensource.com/tags/blender
|
||||
[33]:http://www.blender.org/features/2-78/
|
||||
[34]:https://opensource.com/tags/krita
|
||||
[35]:https://krita.org/en/item/krita-3-0-1-update-brings-numerous-fixes/
|
||||
[36]:https://opensource.com/life/16/9/10-reasons-flowblade-linux-video-editor
|
||||
[37]:https://opensource.com/tags/kdenlive
|
||||
[38]:https://opensource.com/life/11/11/introduction-kdenlive
|
||||
[39]:http://jliljebl.github.io/flowblade/
|
||||
[40]:http://pitivi.org/
|
||||
[41]:http://wiki.pitivi.org/wiki/Why_Python%3F
|
||||
[42]:https://gstreamer.freedesktop.org/
|
||||
[43]:http://shotcut.org/
|
||||
[44]:http://permalink.gmane.org/gmane.comp.lib.fltk.general/2397
|
||||
[45]:http://www.dennedy.org/
|
||||
[46]:http://openshot.org/
|
||||
[47]:http://www.selapa.net/swatchbooker/
|
||||
[48]:https://help.gnome.org/users/gnome-help/stable/color.html.en
|
||||
[49]:https://help.gnome.org/users/gnome-help/stable/wacom.html.en
|
||||
[50]:http://xournal.sourceforge.net/
|
||||
[51]:https://wiki.gnome.org/Apps/PdfMod
|
||||
[52]:https://www.sparkleshare.org/
|
||||
[53]:https://opensource.com/life/16/4/how-use-darktable-digital-darkroom
|
||||
[54]:https://entangle-photo.org/
|
||||
[55]:http://hugin.sourceforge.net/
|
||||
[56]:https://opensource.com/article/16/12/synfig-studio-animation-software-tutorial
|
||||
[57]:https://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.78/GPencil
|
||||
[58]:https://opensource.com/tags/krita
|
||||
[59]:https://opensource.com/tags/audacity
|
||||
[60]:https://ardour.org/
|
||||
[61]:http://www.hydrogen-music.org/
|
||||
[62]:http://mixxx.org/
|
||||
[63]:http://www.rosegardenmusic.com/
|
||||
[64]:https://opensource.com/life/16/03/musescore-tutorial
|
||||
[65]:http://makehuman.org/
|
||||
[66]:https://natron.fr/
|
||||
[67]:http://fontforge.github.io/en-US/
|
||||
[68]:http://valentina-project.org/
|
||||
[69]:https://www.calligra.org/flow/
|
@ -0,0 +1,109 @@
|
||||
Best 4 Command Line Download Managers/Accelerators for Linux
|
||||
============================================================
|
||||
|
||||
We all very often uses download manager to download files from internet for different requirements, it’s one of the major contributor for me as well as others too. We all want a super fast download manager to complete the download as much possible, so that we can save our time and move forward for further work. There are a lot of download managers and accelerators available (GUI & CLI) which speeds up your download.
|
||||
|
||||
All the download utility doing the same task but they way of handling & feature is differ like, Single threaded and multi-threaded, interactive and non-interactive. Here, we are going to list best four command line download accelerators which we uses regularly for day to day work.
|
||||
|
||||
#### #1 Aria2
|
||||
|
||||
[Aria2][1] is a lightweight multi-protocol & multi-source command-line download manager/utility for Linux, Windows & Mac OSX. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.
|
||||
|
||||
It supports multi-threading and uses multiple sources/protocols to download files which really speeds up your download and complete the download as much as possible.
|
||||
|
||||
It’s very lightweight and doesn’t require much memory and CPU. We can use as a BitTorrent Client because it has all the features you want in BitTorrent client.
|
||||
|
||||
#### Aria2 Features
|
||||
|
||||
* HTTP/HTTPS GET support
|
||||
* HTTP Proxy support
|
||||
* HTTP BASIC authentication support
|
||||
* HTTP Proxy authentication support
|
||||
* FTP support(active, passive mode)
|
||||
* FTP through HTTP proxy(GET command or tunneling)
|
||||
* Segmented download
|
||||
* Cookie support
|
||||
* It can run as a daemon process.
|
||||
* BitTorrent protocol support with fast extension.
|
||||
* Selective download in multi-file torrent
|
||||
* Metalink version 3.0 support(HTTP/FTP/BitTorrent).
|
||||
* Limiting download/upload speed
|
||||
|
||||
Refer the following article for further usage of Aria2.
|
||||
|
||||
[How to Install & use Aria2 in Linux][2]
|
||||
|
||||
#### #2 Axel
|
||||
|
||||
[Axel][3] is a lightweight download utility, it does the same thing how other accelerator does. It opens multiple connections for one file and each connections download separate file fragment to complete the download more quickly.
|
||||
|
||||
Axel supports HTTP, HTTPS, FTP and FTPS protocols. It can also use multiple mirrors for single file download. So, Axel can speed up a download up to 40% (approximately, i personally realized). It’s very lightweight because no dependencies and uses very less CPU & RAM.
|
||||
|
||||
Axel downloads all the data directly to the destination file, using one single thread.
|
||||
|
||||
Note : There is no option to download the two file in single command
|
||||
|
||||
Refer the following article for further usage of Axel.
|
||||
|
||||
[How to Install & use Axel in Linux][4]
|
||||
|
||||
#### #3 Wget
|
||||
|
||||
[Wget][5] (formerly known as Geturl) is a Free, open source, command line downloader which is retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive command line tool and Its name is derived from World Wide Web and get.
|
||||
|
||||
Wget handle download pretty much good compared with other tools, even it doesn’t support multi-threading and futures included working in background, recursive download, multiple file downloads, resume downloads, non-interactive downloads & large file downloads.
|
||||
|
||||
By default all the Linux Distribution included wget, so we can install easily from official repository, also we can install to windows and Mac OS too.
|
||||
|
||||
Wget has been designed for robustness over slow or unstable network connections, if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved. If the server supports regetting, it will instruct the server to continue the download from where it left off.
|
||||
|
||||
#### Wget Features
|
||||
|
||||
* Can resume aborted downloads, using REST and RANGE
|
||||
* Can use filename wild cards and recursively mirror directories
|
||||
* NLS-based message files for many different languages
|
||||
* Optionally converts absolute links in downloaded documents to relative, so that downloaded documents may link to each other locally
|
||||
* Runs on most UNIX-like operating systems as well as Microsoft Windows
|
||||
* Supports HTTP proxies
|
||||
* Supports HTTP cookies
|
||||
* Supports persistent HTTP connections
|
||||
* Unattended / background operation
|
||||
* Uses local file timestamps to determine whether documents need to be re-downloaded when mirroring
|
||||
|
||||
Refer the following article for further usage of Wget.
|
||||
|
||||
[How to Install & use Wget in Linux][6]
|
||||
|
||||
#### #4 Curl
|
||||
|
||||
[Curl][7] is similar to wget and doesn’t support multi-threading but surprisingly make the download much faster compare with wget.
|
||||
|
||||
curl is a tool to transfer data from a server or to server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).
|
||||
|
||||
The command is designed to work without user interaction. Also curl support proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more. curl is powered by libcurl for all transfer-related features.
|
||||
|
||||
If you specify URL without `protocol://` prefix, curl will attempt to guess what protocol you might want. For example, host names starting with “ftp.”curl will assume you want to speak FTP. If it’s not find specific protocol, then do default to HTTP.
|
||||
|
||||
Refer the following article for further usage of Curl.
|
||||
|
||||
[How to Install & use Curl in Linux][8]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.2daygeek.com/best-4-command-line-download-managers-accelerators-for-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.2daygeek.com/author/magesh/
|
||||
[1]:https://aria2.github.io/
|
||||
[2]:http://www.2daygeek.com/aria2-command-line-download-utility-tool/
|
||||
[3]:https://axel.alioth.debian.org/
|
||||
[4]:http://www.2daygeek.com/axel-command-line-downloader-accelerator-for-linux/
|
||||
[5]:https://www.gnu.org/software/wget/
|
||||
[6]:http://www.2daygeek.com/wget-command-line-download-utility-tool/
|
||||
[7]:https://curl.haxx.se/
|
||||
[8]:http://www.2daygeek.com/curl-command-line-download-manager/
|
@ -0,0 +1,252 @@
|
||||
Translating by zhb127
|
||||
10 Interesting Linux Command Line Tricks and Tips Worth Knowing
|
||||
============================================================
|
||||
|
||||
I passionately enjoy working with commands as they offer more control over a Linux system than GUIs(Graphical User Interfaces) applications, therefore am always on the look out to discover or figure out interesting ways and ideas to make [Linux so easy and fun to operate][1], primarily from the terminal.
|
||||
|
||||
It is always thrilling when we discover [new tricks or tips while using Linux][2] especially a command line geek like myself.
|
||||
|
||||
And the feeling of wanting to share newly learned practices or commands with millions of Linux users out there, particularly the newbies who are still getting their way around this exciting operating system normally sets in.
|
||||
|
||||
**Suggested Read:** [10 Useful Linux Command Line Tricks for Newbies – Part 2][3]
|
||||
|
||||
In this article, we will review a number of [useful command line tricks and tips][4] that can significantly enhance your Linux usage skills.
|
||||
|
||||
### 1\. Lock or Hide a File or Directory in Linux
|
||||
|
||||
The simplest way of locking a file or directory is by using Linux file permissions. In case your the owner of a file or directory, you can block (remove read, write and execute privileges) other users and groups from accessing it as follows:
|
||||
|
||||
```
|
||||
$ chmod 700 tecmint.info
|
||||
OR
|
||||
$ chmod go-rwx tecmint.info
|
||||
```
|
||||
|
||||
To know more about Linux file permissions, read this article [Managing Users & Groups, File Permissions & Attributes in Linux][5].
|
||||
|
||||
To hide the file/directory from other system users, rename it with a `(.)` at the start of the file or directory:
|
||||
|
||||
```
|
||||
$ mv filename .tecmint.info
|
||||
```
|
||||
|
||||
### 2\. Translate rwx Permissions into Octal Format in Linux
|
||||
|
||||
By default, when you run the [ls command][6], it displays file permissions in `rwx` format, but to understand the equivalence of this format and the octal format, you can learn how to [translate rwx permissions into Octal format in Linux][7].
|
||||
|
||||
### 3\. How to Use ‘su’ When ‘sudo’ Fails
|
||||
|
||||
Although [sudo command][8] is used to execute commands with superuser privileges, there are moments when it fails to work as in the example below.
|
||||
|
||||
Here, I want to [empty the contents of a large file][9] named `uptime.log` but the operation has failed even when I used sudo.
|
||||
|
||||
```
|
||||
$ cat /dev/null >/var/log/uptime.log
|
||||
$ sudo cat /dev/null >/var/log/uptime.log
|
||||
```
|
||||
[
|
||||

|
||||
][10]
|
||||
|
||||
Empty Large File Content in Linux
|
||||
|
||||
In such as case, you need to switch to the root user account using su command to perform the operation like so:
|
||||
|
||||
```
|
||||
$ su
|
||||
$ sudo cat /dev/null >/var/log/uptime.log
|
||||
$ cat /var/log/uptime.log
|
||||
```
|
||||
[
|
||||

|
||||
][11]
|
||||
|
||||
Switch to Super User
|
||||
|
||||
Try to understand the [difference between su and sudo][12], in addition, read through their man pages for more guidelines:
|
||||
|
||||
```
|
||||
$ man sudo
|
||||
$ man su
|
||||
```
|
||||
|
||||
### 4\. Kill a Process in Linux
|
||||
|
||||
Sometimes when you want to [terminate a process using kill or killall or pkill][13] commands, it may fail to work, you realize that the process still continues to run on the system.
|
||||
|
||||
In order to destructively kill a process, send the `-KILL` siganl to it.
|
||||
|
||||
First [determine its process ID][14] and then kill it like so:
|
||||
|
||||
```
|
||||
$ pidof vlc
|
||||
$ sudo kill -KILL 10279
|
||||
```
|
||||
[
|
||||

|
||||
][15]
|
||||
|
||||
Find and Kill Process in Linux
|
||||
|
||||
Check the [kill command][16] for additional usage options and information.
|
||||
|
||||
### 5\. Delete File Permanently in Linux
|
||||
|
||||
Normally, we use the rm command to delete files from a Linux system, however, these files do not completely get deleted, they are simply stored and hidden on the hard disk and can still be [recovered these files in Linux][17]and viewed by another person.
|
||||
|
||||
To prevent this, we can use the shred command which overwrites the file content and optionally deletes the file as well.
|
||||
|
||||
```
|
||||
$ shred -zvu tecmint.pdf
|
||||
```
|
||||
|
||||
The options used in the above command:
|
||||
|
||||
1. `-z` – adds a final overwrite with zeros to hide shredding.
|
||||
2. `-u` – helps to truncate and remove file after overwriting.
|
||||
3. `-v` – shows progress.
|
||||
|
||||
[
|
||||

|
||||
][18]
|
||||
|
||||
Delete File Permanently in Linux
|
||||
|
||||
Read through shred man page for additional usage instructions:
|
||||
|
||||
```
|
||||
$ man shred
|
||||
```
|
||||
|
||||
### 6\. Rename Multiple Files in Linux
|
||||
|
||||
You can [rename multiple files in Linux][19] on the go by invoking the rename command.
|
||||
|
||||
It renames the filenames supplied according to a rule specified in the first argument.
|
||||
|
||||
The command below renames all `.pdf` files to `.doc`, here `'s/\.pdf$/\.doc/'` is the rule:
|
||||
|
||||
```
|
||||
$ rename -v 's/\.pdf$/\.doc/' *.pdf
|
||||
```
|
||||
[
|
||||

|
||||
][20]
|
||||
|
||||
Rename Multiple Files in Linux
|
||||
|
||||
The next example renames all files matching `"*.bak"` to strip the extension, where `'s/\e.bak$//'` is the rule:
|
||||
|
||||
### 7\. Check for Spelling of Words in Linux
|
||||
|
||||
The look command displays lines beginning with a given string, it can help you to check for the spelling of word from within the command line. Although it is not so effective and reliable, look is still a useful alternative to other powerful spelling-checkers:
|
||||
|
||||
```
|
||||
$ look linu
|
||||
$ look docum
|
||||
```
|
||||
[
|
||||

|
||||
][21]
|
||||
|
||||
Spell Checking in Linux
|
||||
|
||||
### 8\. Search for Description of Keyword in Manual Page
|
||||
|
||||
The man command is used to display manual entry pages of commands, when used with the `-k` switch, it searches the short descriptions and manual page names for the keyword `printf` (such as adjust, apache and php in the commands below) as regular expression.
|
||||
|
||||
```
|
||||
$ man -k adjust
|
||||
$ man -k apache
|
||||
$ man -k php
|
||||
```
|
||||
[
|
||||

|
||||
][22]
|
||||
|
||||
Show Description of Keyword in Manual Pages
|
||||
|
||||
### 9\. Watch Logs in Real-Time in Linux
|
||||
|
||||
With watch command, you can run [another Linux command periodically][23] while displaying its output on fullscreen and alongside [tail command][24] which is used to view the last parts of a file, it is possible to watch the recording of log entries in a logfile.
|
||||
|
||||
In the example below, you will watch the system authentication logfile. Open two terminal windows, display the logfile for watching in real-time in the first window like so:
|
||||
|
||||
```
|
||||
$ sudo watch tail /var/log/auth.log
|
||||
```
|
||||
|
||||
You can also use [tail command][25] which shows the last parts of a file. Its `-f` flag enables watching changes in a file in real-time, therefore it is possible to watch the recording of log entries in a logfile.
|
||||
|
||||
```
|
||||
$ sudo tail -f /var/log/auth.log
|
||||
```
|
||||
|
||||
And run the commands below in the second terminal as you observe the logfile content from the first window:
|
||||
|
||||
```
|
||||
$ sudo mkdir -p /etc/test
|
||||
$ sudo rm -rf /etc/test
|
||||
```
|
||||
|
||||
### 10\. List All Shell builtin Commands
|
||||
|
||||
A shell builtin is a command or a function, called from within and executed directly in the shell itself, instead of an external executable program which the shell would load from the hard disk and execute.
|
||||
|
||||
To list all shell builtins and their usage syntax, run:
|
||||
|
||||
```
|
||||
$ help
|
||||
```
|
||||
|
||||
As a concluding remark, [command line tricks and tips][26] always come in handy and make learning and using Linux easy and fun especially for newbies.
|
||||
|
||||
You can as well share with us other [useful and interesting command line tricks or tips][27] in Linux that you have come across via the comment form below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/linux-command-line-tricks-and-tips-worth-knowing/
|
||||
|
||||
作者:[Aaron Kili][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/aaronkili/
|
||||
[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/
|
||||
[2]:http://www.tecmint.com/tag/linux-tricks/
|
||||
[3]:http://www.tecmint.com/10-useful-linux-command-line-tricks-for-newbies/
|
||||
[4]:http://www.tecmint.com/10-useful-linux-command-line-tricks-for-newbies/
|
||||
[5]:http://www.tecmint.com/manage-users-and-groups-in-linux/
|
||||
[6]:http://www.tecmint.com/tag/linux-ls-command/
|
||||
[7]:http://www.tecmint.com/check-linux-file-octal-permissions-using-stat-command/
|
||||
[8]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
|
||||
[9]:http://www.tecmint.com/empty-delete-file-content-linux/
|
||||
[10]:http://www.tecmint.com/wp-content/uploads/2016/12/Empty-Large-File-Content-in-Linux.png
|
||||
[11]:http://www.tecmint.com/wp-content/uploads/2016/12/Switch-to-Super-User.png
|
||||
[12]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
|
||||
[13]:http://www.tecmint.com/how-to-kill-a-process-in-linux/
|
||||
[14]:http://www.tecmint.com/find-process-name-pid-number-linux/
|
||||
[15]:http://www.tecmint.com/wp-content/uploads/2016/12/Find-and-Kill-Process-in-Linux.png
|
||||
[16]:http://www.tecmint.com/how-to-kill-a-process-in-linux/
|
||||
[17]:http://www.tecmint.com/recover-deleted-file-in-linux/
|
||||
[18]:http://www.tecmint.com/wp-content/uploads/2016/12/Delete-File-Permanently-in-Linux.png
|
||||
[19]:http://www.tecmint.com/rename-multiple-files-in-linux/
|
||||
[20]:http://www.tecmint.com/wp-content/uploads/2016/12/Rename-Multiple-Files-in-Linux.png
|
||||
[21]:http://www.tecmint.com/wp-content/uploads/2016/12/Spell-Checking-in-Linux.png
|
||||
[22]:http://www.tecmint.com/wp-content/uploads/2016/12/Show-Description-of-Keyword-in-Manual-Pages.png
|
||||
[23]:http://www.tecmint.com/run-repeat-linux-command-every-x-seconds/
|
||||
[24]:http://www.tecmint.com/view-contents-of-file-in-linux/
|
||||
[25]:http://www.tecmint.com/view-contents-of-file-in-linux/
|
||||
[26]:http://www.tecmint.com/tag/linux-tricks/
|
||||
[27]:http://www.tecmint.com/5-linux-command-line-tricks/
|
146
sources/tech/20161225 Minecraft Server on Linux.md
Normal file
146
sources/tech/20161225 Minecraft Server on Linux.md
Normal file
@ -0,0 +1,146 @@
|
||||
Minecraft Server on Linux
|
||||
=============================
|
||||
|
||||

|
||||
|
||||
Minecraft is a major game being played on many different consoles and computer systems. As of June 2016 there have been over 106 million units sold on all platforms. Because of the popularity, you may want to host a Minecraft party at home. To do this you install a Minecraft Server to allow all users to connect locally and play in the same world together.
|
||||
|
||||
**System Requirements**
|
||||
|
||||
To start, you need a Linux system with a fair amount of Random Access Memory (RAM). The more players you will host on the server the more RAM you will need. Hard Drive space is not a large requirement, just enough to install Java and the Minecraft Server Java file. The Minecraft Server should have a decent network connection whether wired or WiFi.
|
||||
|
||||
Let's look at some minimum requirements for the Minecraft Server:
|
||||
|
||||
**Processor: **Duo Core or better
|
||||
**RAM:** 2 GB (20-40 players), 3 GB (30-60 players), 8 GB (60+ players)
|
||||
**OS:** An OS with no Graphical User Interface (GUI) to allow more resources free
|
||||
|
||||
**NOTE:** The requirements are for the Minecraft Server program and not for the whole OS! If more resources can be allocated to the Minecraft Server it will operate better.
|
||||
|
||||
**Installing JAVA**
|
||||
|
||||
Once you have a system with Linux running on it you will need to install the latest version of Java.
|
||||
|
||||
To verify your Java version enter the following command in a terminal: “java -version”. The result should be:
|
||||
|
||||
```
|
||||
java version "1.8.0_101"
|
||||
|
||||
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
|
||||
|
||||
Java HotSpot(TM) Client VM (build 25.101-b13, mixed mode)
|
||||
```
|
||||
|
||||
If your current Java version is not 1.8 or higher then install Java version 8 by performing the following from a terminal on a Ubuntu system:
|
||||
|
||||
1. _sudo add-apt-repository ppa:webupd8team/java_
|
||||
2. _sudo apt-get update_
|
||||
3. _sudo apt-get install oracle-java8-installer_
|
||||
|
||||
**NOTE:** If the 'add-apt-repository' command is not found, run 'sudo apt-get install software-properties-common'. You could also change the third command to be 'oracle-java9-installer' for the newest version of JAVA.
|
||||
|
||||
For a Redhat system, such as CentOS, use the following command:
|
||||
|
||||
1. _sudo yum install java-1.8.0-openjdk_
|
||||
|
||||
After the installation verify the version by entering the version command, 'java -version', and verify the output. Once you have the appropriate version of Java you may proceed with the rest of the installation.
|
||||
|
||||
**Minecraft Server Version Download**
|
||||
|
||||
The next thing is to check the version of Minecraft which the users will be running. See Figure 1 taken from a system running Minecraft and notice the version number in the bottom left corner.
|
||||
|
||||

|
||||
|
||||
**FIGURE 1**
|
||||
|
||||
Keep in mind the version number of the Minecraft client software. Each client should be the same version to make this work.
|
||||
|
||||
The next thing to do is download the Minecraft Server for the version you will need for the clients. To download the version you need you will need to know its location. The command to get the needed file is:
|
||||
|
||||
_sudo wget _[_https://s3.amazonaws.com/Minecraft.Download/versions/[version]/minecraft_server.[version].jar_][1]
|
||||
|
||||
As seen in Figure 1, the version number is 1.10.2\. The command would then be:
|
||||
|
||||
_sudo wget _[_https://s3.amazonaws.com/Minecraft.Download/versions/1.10.2/minecraft_server.1.10.2.jar_][2]
|
||||
|
||||
When you download the file it will be saved to the current directory in which you are currently in when you run the command. To determine the current location use the command 'pwd'.
|
||||
|
||||
Once you have the file and know the folder where it has been saved you are ready to continue.
|
||||
|
||||
**Server Information**
|
||||
|
||||
Before starting the Minecraft Server you must know the amount of available RAM on the current system to be able to use what is needed. When starting the Minecraft Server you will specify the starting amount of RAM and the maximum amount of RAM to use as more players join. Again, it is important to have enough RAM. If needed, use a minimal install of an Operating System (OS) such as a Minimal install of Ubuntu to have more RAM available.
|
||||
|
||||
Once you have the Minecraft Server file you need it is time to determine the amount of RAM which can be allocated to Minecraft. To determine the available RAM open a terminal and type the following command – a sample output is shown in Figure 2:
|
||||
|
||||
_free -h_
|
||||
|
||||

|
||||
|
||||
**FIGURE 2**
|
||||
|
||||
On this low end system as shown in Figure 2, you can see there is only 684 MB of free RAM. This is not an adequate system to use for a Minecraft Server. On another system I have 2.8 GB available to use for the Minecraft Server.
|
||||
|
||||
Before we start the server we need to find the IP Address of the server. To do this, run the command 'ifconfig'. As shown in Figure 3, there should be a listing for a network connection that shows an Internet Address, or 'inet addr', which is '192.168.0.2'. On my server system it is listed with the address of '192.168.0.14', which is the address that will be used from the client systems.
|
||||
|
||||

|
||||
|
||||
**FIGURE 3**
|
||||
|
||||
**Start Minecraft Server**
|
||||
|
||||
The next step is to actually start the Minecraft Server. There are a few items to cover before we actually start it. When starting the Minecraft Server you specify how much memory to initialize for Minecraft. You also will designate the maximum amount to use as well.
|
||||
|
||||
If my system has 3.7 GB free and I know I will have less than 40 players, then I only need 2 GB set aside. Of course, I may add a little to allow for any growth of users. I also want to leave some memory for the system to use if needed. I will set my minimum at 2 GB and my maximum at 3 GB. Since my maximum is 3 GB I will leave the system 700 MB of RAM if needed, but this is only if the Minecraft Server uses more than the initial 2 GB.
|
||||
|
||||
The command line to start the server is:
|
||||
|
||||
_sudo java -Xms# -Xmx# -jar [path]/minecraft_server.[version].jar nogui_
|
||||
|
||||
Now for a breakdown of the command structure:
|
||||
|
||||
-Xms# - the amount of the initial startup RAM (-Xms2048m)
|
||||
-Xmx# - the amount of the maximum RAM (-Xmx3096m)
|
||||
[path] – the path to the Minecraft Server File (/home/tux/MCS/)
|
||||
[version] – the version of the Minecraft Server downloaded (1.10.2)
|
||||
nogui – used to show that the system is text based only to help reduce RAM use. If you install the GUI, then remove the _nogui_ parameter
|
||||
|
||||
An example of the full command for a system using an initial 2 GB of RAM with a maximum of 3 GB with a path to '/home/tux/MCS/' and a version of '1.10.2' would be:
|
||||
|
||||
_sudo java -Xms2048m -Xmx3096m -jar /home/tux/MCS/minecraft_server.1.10.2.jar nogui_
|
||||
|
||||
**NOTE:** The RAM sizes are in values of megabytes. Multiply the value by 1024\. For example, for 2 GB of RAM multiply 2x1024 for a value of 2048\. Do not forget the lowercase 'm' to specify megabytes. You can easily specify '2g' and '3g' for 2 GB and 3 GB.
|
||||
|
||||
After you run the server the first time there will be an error. It states that the EULA must be agreed to before starting the server.
|
||||
|
||||
To agree to the EULA you need to edit the 'eula.txt' file in the same folder as the Minecraft Server JAR file.
|
||||
|
||||
Open the 'eula.txt' file in a text editor such as nano. Make sure you do this with root privileges. Change the line 'eula=false' to 'eula=true' and save the file.
|
||||
|
||||
Now, enter the command again to start the server. A screen full of information should pass by and then a section of lines which states it is preparing the spawn area. The lines will count up to 100% as it creates the initial world. Any error messages about the system time changing are normal so ignore them.
|
||||
|
||||
At this point you can open the client program and see a screen similar to Figure 1 above. Click on the button 'Multiplayer'. At the next screen, Figure 4, choose 'Direct Connect'. You will then be prompted for the server address, so type in the IP Address of the Minecraft Server. You should now be able to connect to the game.
|
||||
|
||||

|
||||
|
||||
**FIGURE 4**
|
||||
|
||||
**Troubleshooting certain connections**
|
||||
|
||||
If some clients cannot connect to the server, then you need to exit the JAVA program by pressing CTRL+Z. Open the file 'server.properties' with an editor such as 'nano'. Remember to be root. Edit the line 'online-mode'. It should be set to 'true'. Change this to 'false' and save the file. Reboot the system and start the Minecraft Server. Have the clients reconnect to the server and everything should be working.
|
||||
|
||||
Happy mining!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxforum.com/threads/minecraft-server-on-linux.3202/
|
||||
|
||||
作者:[Jarret][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linuxforum.com/members/jarret.268/
|
||||
[1]:https://s3.amazonaws.com/Minecraft.Download/versions/%5Bversion%5D/minecraft_server.%5Bversion%5D.jar
|
||||
[2]:https://s3.amazonaws.com/Minecraft.Download/versions/%5Bversion%5D/minecraft_server.%5Bversion%5D.jar
|
180
sources/tech/20161226 Top 10 open source projects of 2016.md
Normal file
180
sources/tech/20161226 Top 10 open source projects of 2016.md
Normal file
@ -0,0 +1,180 @@
|
||||
Top 10 open source projects of 2016
|
||||
============================================================
|
||||
|
||||
### In our annual list of the year's top open source projects, we look back at popular projects our writers covered in 2016, plus favorites our Community Moderators picked.
|
||||
|
||||

|
||||
|
||||
Image by : [George Eastman House][1] and [Internet Archive Book Images][2]. Modified by Opensource.com. CC BY-SA 4.0
|
||||
|
||||
We continue to be impressed with the wonderful open source projects that emerge, grow, change, and evolve every year. Picking 10 to include in our annual list of top projects is no small feat, and certainly no list this short can include every deserving project.
|
||||
|
||||
To choose our 10, we looked back at popular open source projects our writers covered in 2016, and collected suggestions from our Community Moderators. After a round of nominations and voting by our moderators, our editorial team narrowed down the final list.
|
||||
|
||||
So here they are, our top 10 open source projects of 2016:
|
||||
|
||||
### Atom
|
||||
|
||||
[Atom][3] is a hackable text editor from GitHub. Jono Bacon [wrote][4] about its "simple core" earlier this year, exclaiming approval for open source projects that give users options.
|
||||
|
||||
"[Atom] delivers the majority of the core features and settings that most users likely will want, but is missing many of the more advanced or specific features some users may want. … Atom provides a powerful framework that allows pretty much any part of Atom to be changed and expanded."
|
||||
|
||||
To get started contributing, read the [guide][5]. To connect with other users and the community, find Atom on [GitHub][6], [Discuss][7], and [Slack][8].
|
||||
|
||||
Atom is [MIT][9] licensed and the [source code][10] is hosted on GitHub.
|
||||
|
||||
### Eclipse Che
|
||||
|
||||
[Eclipse Che][11] is a next-generation online integrated development environment (IDE) and developer workspace. Joshua Allen Holm brought us a [review][12] of Eclipse Che in November 2016, which provided a look at the developer community behind the project, its innovative use of container technology, and popular languages it supports out of the box.
|
||||
|
||||
"The ready-to-go bundled stacks included with Eclipse Che cover most of the modern popular languages. There are stacks for C++, Java, Go, PHP, Python, .NET, Node.js, Ruby on Rails, and Android development. A Stack Library provides even more options and if that is not enough, there is the option to create a custom stack that can provide specialized environments."
|
||||
|
||||
You can test out Eclipse Che in an online [hosted account][13], through a [local installation][14], or in your preferred [cloud provider][15]. The [source code][16] can be found on GitHub under an [Eclipse Public License][17].
|
||||
|
||||
### FreeCAD
|
||||
|
||||
[FreeCAD][18] is written in Python and one of the many computer-aided design—or computer-aided drafting—tools available to create design specifications for real-world objects. Jason Baker wrote about FreeCAD in [3 open source alternatives to AutoCAD][19].
|
||||
|
||||
"FreeCAD can import and export from a variety of common formats for 3D objects, and its modular architecture makes it easy to extend the basic functionality with various plug-ins. The program has many built-in interface options, from a sketcher to renderer to even a robot simulation ability."
|
||||
|
||||
FreeCAD is [LGPL][20] licensed and the [source code][21] is hosted on GitHub.
|
||||
|
||||
### GnuCash
|
||||
|
||||
[GnuCash][22] is a cross-platform open source desktop solution for managing your personal and small business accounts. Jason Baker included GnuCash in our [roundup][23] of the open source alternatives to Mint and Quicken for personal finance.
|
||||
|
||||
GnuCash "features multi-entry bookkeeping, can import from a wide range of formats, handles multiple currencies, helps you create budgets, prints checks, creates custom reports in Scheme, and can import from online banks and pull stock quotes for you directly."
|
||||
|
||||
You can find GnuCash's [source code][24] on GitHub under a GPL [version 2 or 3 license][25].
|
||||
|
||||
An honorable mention goes to GnuCash alternative [KMyMoney][26], which also received a nomination for our list, and is another great option for keeping your finances in Linux.
|
||||
|
||||
### Kodi
|
||||
|
||||
[Kodi][27] is an open source media center solution, formerly known as XBMC, which works on a variety of devices as a do-it-yourselfer's tool to building a set-top box for playing movies, TV, music, and more. It is heavily customizable, and supports numerous skins, plugins, and a variety of remote control devices (including its own custom Android remote for your phone).
|
||||
|
||||
Although we didn't cover Kodi in-depth this year, it kept popping up in articles on building a home Linux [music server][28], media [management tools][29], and even a previous poll on favorite open source [video players][30]. (If you're using Kodi at home and want to write about your experience, [let us know][31].)
|
||||
|
||||
The [source code][32] to Kodi can be found on GitHub under a [GPLv2][33] license.
|
||||
|
||||
### MyCollab
|
||||
|
||||
[MyCollab][34] is a suite of tools for customer relationship management, document management, and project management. Community Moderator Robin Muilwijk covered the details of the project management tool MyCollab-Project in his roundup of [Top 11 project management tools for 2016][35].
|
||||
|
||||
"MyCollab-Project includes many features, like a Gantt chart and milestones, time tracking, and issue management. It also supports agile development models with its Kanban board. MyCollab-Project comes in three editions, of which the [community edition][36] is the free and open source option."
|
||||
|
||||
Installing MyCollab requires a Java runtime and MySQL stack. Visit the [MyCollab site][37] to learn how to contribute to the project.
|
||||
|
||||
MyCollab is AGPLv3 licensed and the [source code][38] is hosted on GitHub.
|
||||
|
||||
### OpenAPS
|
||||
|
||||
[OpenAPS][39] is another project that our moderators found interesting in 2016, but also one that we have yet to cover in depth. OpenAPS, the Open Artificial Pancreas System project, is an open source project devoted to improving the lives of people with Type 1 diabetes.
|
||||
|
||||
The project includes "[a safety-focused reference design,][40] a[ toolset][41], and an open source [reference implementation][42]" designed for device manufacturers or any individual to be able to build their own artificial pancreas device to be able to safely regulate blood glucose levels overnight by adjusting insulin levels. Although potential users should examine the project carefully and discuss it with their healthcare provider before trying to build or use the system themselves, the project founders hope opening up technology will accelerate the research and development pace across the medical devices industry to discover solutions and bring them to market even faster.
|
||||
|
||||
### OpenHAB
|
||||
|
||||
[OpenHAB][43] is a home automation platform with a pluggable architecture. Community Moderator D Ruth Bavousett [wrote][44] about OpenHAB after buying a home this year and trying it out.
|
||||
|
||||
"One of the interesting modules I found was the Bluetooth binding; it can watch for the presence of specific Bluetooth-enabled devices (your smartphone, and those of your children, for instance) and take action when that device arrives or leaves—lock or unlock doors, turn on lights, adjust your thermostat, turn off security modes, and so on."
|
||||
|
||||
Check out the [full list of binding and bundles][45] that provide integration and communication with social networks, instant messaging, cloud IoT platforms, and more.
|
||||
|
||||
OpenHAB is EPL licensed and the [source code][46] is hosted on GitHub.
|
||||
|
||||
### OpenToonz
|
||||
|
||||
[OpenToonz][47] is production software for 2D animation. Community Moderator Joshua Allen Holm [reported][48] on its open source release in March 2016, and it has been mentioned in other animation-related articles on Opensource.com, but we haven't covered it in depth. Stay tuned for that.
|
||||
|
||||
In the meantime, we can tell you that there are a number of features unique to OpenToonz, including GTS, which is a spanning tool developed by Studio Ghibli, and [a plug-in effect SDK][49] for image processing.
|
||||
|
||||
To discuss development and video research topics, check out the [forum][50] on GitHub. OpenToonz [source code][51] is hosted on GitHub and the project is licensed under a modified BSD license.
|
||||
|
||||
### Roundcube
|
||||
|
||||
[Roundcube][52] is a modern, browser-based email client that provides much—if not all—of the functionality email users may be used to with a desktop client. Featuring support for more than 70 languages, integrated spell-checking, a drag-and-drop interface, a feature-rich address book, HTML email composition, multiple search features, PGP encryption support, threading, and more, Roundcube can work as a drop-in replacement email client for many users.
|
||||
|
||||
Roundcube was included along with four other solutions in our roundup of open source [alternatives to Gmail][53].
|
||||
|
||||
You can find the [source code][54] to Roundcube on GitHub under a [GPLv3][55] license. In addition to [downloading][56] and installing the project directly, you can also find it inside many complete email server packages, including [Kolab Groupware][57], [iRedMail][58], [Mail-in-a-Box][59], and [mailcow][60].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Jen Wike Huger - Jen Wike Huger is the Content Manager for Opensource.com. She manages the publication calendar, coordinates the editing team, and guides new and current writers. Follow her on Twitter @jenwike, and see her extended portfolio at Jen.io.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/16/12/yearbook-top-10-open-source-projects
|
||||
|
||||
作者:[Jen Wike Huger ][a]
|
||||
译者:[译者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/jen-wike
|
||||
[1]:https://www.flickr.com/photos/george_eastman_house/
|
||||
[2]:https://www.flickr.com/photos/internetarchivebookimages/14784547612/in/photolist-owsEVj-odcHUi-osAjiE-x91Jr9-obHow3-owt68v-owu56t-ouySJt-odaPbp-owajfC-ouBSeL-oeTzy4-ox1okT-odZmpW-ouXBnc-ot2Du4-ocakCh-obZ8Pp-oeTNDK-ouiMZZ-ie12mP-oeVPhH-of2dD4-obXM65-owkSzg-odBEbi-oqYadd-ouiNiK-icoz2G-ie4G4G-ocALsB-ouHTJC-wGocbd-osUxcE-oeYNdc-of1ymF-idPbwn-odoerh-oeSekw-ovaayH-otn9x3-ouoPm7-od8KVS-oduYZL-obYkk3-hXWops-ocUu6k-dTeHx6-ot6Fs5-ouXK46
|
||||
[3]:https://atom.io/
|
||||
[4]:https://opensource.com/life/16/2/culture-pluggable-open-source
|
||||
[5]:https://github.com/atom/atom/blob/master/CONTRIBUTING.md
|
||||
[6]:https://github.com/atom/atom
|
||||
[7]:http://discuss.atom.io/
|
||||
[8]:http://atom-slack.herokuapp.com/
|
||||
[9]:https://raw.githubusercontent.com/atom/atom/master/LICENSE.md
|
||||
[10]:https://github.com/atom/atom
|
||||
[11]:http://www.eclipse.org/che/
|
||||
[12]:https://opensource.com/life/16/11/introduction-eclipse-che
|
||||
[13]:https://www.eclipse.org/che/getting-started/cloud/
|
||||
[14]:https://www.eclipse.org/che/getting-started/download/
|
||||
[15]:https://bitnami.com/stack/eclipse-che
|
||||
[16]:https://github.com/eclipse/che/
|
||||
[17]:https://github.com/eclipse/che/blob/master/LICENSE
|
||||
[18]:http://www.freecadweb.org/
|
||||
[19]:https://opensource.com/alternatives/autocad
|
||||
[20]:https://github.com/FreeCAD/FreeCAD/blob/master/COPYING
|
||||
[21]:https://github.com/FreeCAD/FreeCAD
|
||||
[22]:https://www.gnucash.org/
|
||||
[23]:https://opensource.com/life/16/1/3-open-source-personal-finance-tools-linux
|
||||
[24]:https://github.com/Gnucash/
|
||||
[25]:https://github.com/Gnucash/gnucash/blob/master/LICENSE
|
||||
[26]:https://kmymoney.org/
|
||||
[27]:https://kodi.tv/
|
||||
[28]:https://opensource.com/life/16/1/how-set-linux-based-music-server-home
|
||||
[29]:https://opensource.com/life/16/6/tinymediamanager-catalogs-your-movie-and-tv-files
|
||||
[30]:https://opensource.com/life/15/11/favorite-open-source-video-player
|
||||
[31]:https://opensource.com/how-submit-article
|
||||
[32]:https://github.com/xbmc/xbmc
|
||||
[33]:https://github.com/xbmc/xbmc/blob/master/LICENSE.GPL
|
||||
[34]:https://community.mycollab.com/
|
||||
[35]:https://opensource.com/business/16/3/top-project-management-tools-2016
|
||||
[36]:https://github.com/MyCollab/mycollab
|
||||
[37]:https://community.mycollab.com/docs/developing-mycollab/how-can-i-contribute-to-mycollab/
|
||||
[38]:https://github.com/MyCollab/mycollab
|
||||
[39]:https://openaps.org/
|
||||
[40]:https://openaps.org/reference-design
|
||||
[41]:https://github.com/openaps/openaps
|
||||
[42]:https://github.com/openaps/oref0/
|
||||
[43]:http://www.openhab.org/
|
||||
[44]:https://opensource.com/life/16/4/automating-your-home-openhab
|
||||
[45]:http://www.openhab.org/features/supported-technologies.html
|
||||
[46]:https://github.com/openhab/openhab
|
||||
[47]:https://opentoonz.github.io/e/index.html
|
||||
[48]:https://opensource.com/life/16/3/weekly-news-march-26
|
||||
[49]:https://github.com/opentoonz/plugin_sdk
|
||||
[50]:https://github.com/opentoonz/opentoonz/issues
|
||||
[51]:https://github.com/opentoonz/opentoonz
|
||||
[52]:https://roundcube.net/
|
||||
[53]:https://opensource.com/alternatives/gmail
|
||||
[54]:https://github.com/roundcube/roundcubemail
|
||||
[55]:https://github.com/roundcube/roundcubemail/blob/master/LICENSE
|
||||
[56]:https://roundcube.net/download/
|
||||
[57]:http://kolab.org/
|
||||
[58]:http://www.iredmail.org/
|
||||
[59]:https://mailinabox.email/
|
||||
[60]:https://mailcow.email/
|
195
sources/tech/20170104 50 ways to avoid getting hacked in 2017.md
Normal file
195
sources/tech/20170104 50 ways to avoid getting hacked in 2017.md
Normal file
@ -0,0 +1,195 @@
|
||||
50 ways to avoid getting hacked in 2017
|
||||
============================================================
|
||||
|
||||
### Paul Simon outlined "50 Ways to Leave Your Lover," whereas we present 50 ways to secure your systems.
|
||||
|
||||

|
||||
|
||||
Image by :
|
||||
|
||||
Opensource.com
|
||||
|
||||
When I was young, Paul Simon released his hit song, [50 Ways to Leave Your Lover][3]. Inspired by this song, I've collected 50 ways sysadmins and laypeople can avoid getting hacked:
|
||||
|
||||
### "You just slip out the back, Jack"
|
||||
|
||||
1\. Backup your data. If you get hit with ransomware, you don't have to pay if you have backups.
|
||||
|
||||
2\. Use a [syncstop][4] when you have to charge your phone in a public place, or bring your own battery backup.
|
||||
|
||||
3\. Take advantage of the auditing subsystems. There are lots of cool tools to help monitor your system. If you do have a break in, the audit system might well be able to tell you what happened and what the attacker did.
|
||||
|
||||
4\. Speaking of logs, offloading the logs to a centralized server is always a good idea because if a hacker breaks into your system, the first thing he is going to attack is the logging system to cover his tracks. Having a good intrusion system watching the logs also helps.
|
||||
|
||||
### "Make a new plan, Stan"
|
||||
|
||||
5\. Run SELinux in enforcing mode (see [stopdisablingselinux.com][5]). Didn't think it would take me this long to get to that one? SELinux prevents escalations of zero day vulnerabilities. When [Shell Shock][6] came out, SELinux was the only defense.
|
||||
|
||||
6\. Run applications in the [SELinux Sandbox][7] whenever possible—it was a container before containers were cool. Also follow the development of [Flatpack][8], which soon should be developing sandboxing capabilities.
|
||||
|
||||
7\. Don't install or use Flash. Firefox no longer supports it, and hopefully most web servers are moving away from it.
|
||||
|
||||
8\. Use [confined SELinux users][9] to control what users do in your systems. If you are running a shared login system, set up users as **guest_t**.
|
||||
|
||||
### "You don't need to be coy, Roy"
|
||||
|
||||
9\. Take [advantage of systemd tools][10] to help secure your services. Most system attacks are going to come through a service listening on the network. Systemd provides great ways to lock down the service. For example, use **[PrivateTmp=yes][1]**. PrivateTmp takes advantage of the mount namespace to set up a private **tmpfs** mount for the server's **/tmp**. This prevents a hacked service from getting access to content in the host's **/tmp** and potentially attacking the rest of the system based on services listening on **/tmp**.
|
||||
|
||||
10. **InaccessibleDirectories=/home** is a systemd unit flag that uses the mount namespace to eliminate the **/home** (or any other directory) from the services view, which makes it more difficult for a hacked service ability to attack the content.
|
||||
|
||||
11. **ReadOnlyDirectories=/var** is another systemd unit flag that uses the mount namespace to turn the directories contents into read-only mode. You probably should always run with **/usr** in **ReadOnlyMode**. This would prevent a hacked application from rewriting the binary, so the next time it started the service, you would already be hacked.
|
||||
|
||||
12\. Drop capabilities from a service (**CapabilityBoundingSet=CAP_CHOWN CAP_KILL**). In the kernel, priviliged processes are broken down into a series of distinct capabilities. Most services do not need many (if any), and systemd provides a simple switch to drop them from a service.
|
||||
|
||||
13\. If your service is not going to use the network, then you can turn it off for the service using **PrivateNetwork=yes**. Just turning this on in a service unit file takes advantage of the network namespace and turns off all networks available to the service. Oftentimes a hacker does not actually want to break into your machine—he just wants to use it as an attack server to attack other machines. If the service can't see the network, it cannot attack it.
|
||||
|
||||
>Control the devices available to your service.
|
||||
|
||||
14\. Control the devices available to your service. Systemd provides the **DeviceAllow** directive, which controls the devices available to the service. **DeviceAllow=/dev/null rw** will limit access to **/dev/null** and only this device node, disallowing access to any other device nodes. The feature is implemented on top of the device's cgroup controller.
|
||||
|
||||
15\. Coming soon to a systemd system near you is a new feature, **[ProtectSystem Strict][2]**, which can turn on all of these namespaces to fully lock down the environment in which a service runs.
|
||||
|
||||
### "Just get yourself free"
|
||||
|
||||
16\. Don't use a cell phone without SELinux ([SEAndroid][11]) in enforcing mode. Luckily, I heard that more than 90% of all Android phones now run with SEAndroid on in enforcing mode. That makes me happy. Now if we could only get those Apple guys to use SELinux.
|
||||
|
||||
>Only install software from trusted sources.
|
||||
|
||||
17\. Only install software from trusted sources. Don't install dodgy things you find on the Internet. This goes for your cell phone, computer system, virtual machines, containers, and so on.
|
||||
|
||||
18\. I don't do online banking on my phone—only on my Linux computer. If a hacker steals my credit card, I lose 50 bucks; if he gets into my bank account, I lose a lot more. I guess I am old. (Get off my lawn.)
|
||||
|
||||
19\. One cool thing I did do with my phone is set up my credit card companies to send me a text every time my credit card has been charged. That way if the number gets stolen, I will know a lot quicker.
|
||||
|
||||
>I don't do online banking on my phone—only on my Linux computer.
|
||||
|
||||
20\. When you need to communicate securely, use the [Signal secure messaging app][12].
|
||||
|
||||
### "Hop on the bus gus"
|
||||
|
||||
21\. Run Linux on your systems. When I first hooked my father up with a computer system, I barely got home before his system was infested with viruses. I returned and installed Linux on his system, and he has been running it ever since. I believe Linux generally is a more secure system because of the way it was designed, but I also believe the desktop is less likey to be hacked because of the smaller user base. Some would argue that Windows has improved greatly over the years, but for me, I am still sticking with what I know.
|
||||
|
||||
22\. Only run distributions with a [Security Response Team][13] watching over the security of the distribution. Enterprise Software is important.
|
||||
|
||||
23\. Run an enterprise-level kernel. In containers, the single point of failure is the kernel. If you want to keep it secure, use an enterprise-level kernel, which means it has the latest security fixes, but is not bleeding edge. Remember the latest kernel comes with the latest security fixes, but it also comes with a ton of new code that could have vulnerabilities.
|
||||
|
||||
### "You don't need to discuss much"
|
||||
|
||||
24\. Most hacks are social engineering—for example, email links, web browser attacks, and phone calls. The best option here is to be educated and skeptical. No one from Nigeria is giving you money. The IRS is not calling your house demanding money. If you get a link to a web site in email from your bank, don't use the link. Type the address directly on the web browser.
|
||||
|
||||
25\. Always keep your systems fully up to date with the latest security fixes. The number of systems that are outdated and have known security vulnerabilities is scarey. Script kiddies rely on you **not** to update your system.
|
||||
|
||||
>Always keep your systems fully up to date with the latest security fixes.
|
||||
|
||||
26\. Always use HTTPS when connecting to services on the network. Chrome and Firefox now have modes to enforce this. If a web site does not support secure communications by 2016, it is probably not worth your visit.
|
||||
|
||||
27\. Use [seccomp][14] in your containers. This limits the attack surface on the kernel, which is the single point of failure. Limit what the processes can discuss.
|
||||
|
||||
### "Just drop off the key, Lee"
|
||||
|
||||
28\. Use a [YubiKey][15] for storing private keys.
|
||||
|
||||
29\. Encrypt your data on your systems. At least for laptops, keep your **homedir**and your other data directories encrypted. I was riding the subway in London a few years ago, and had my Laptop "nicked"—the door of the train car closed, and I noticed by laptop was gone and the train was pulling out of the station. Luckily, the disks were encrypted.
|
||||
|
||||
30\. Use [Let's Encrypt][16] for all your web sites. There's no reason not to run HTTPS anymore.
|
||||
|
||||
31\. Never use the same password on different web servers. This one is difficult not to fall into the trap. Tools like Let's Encrypt help a lot. It's even better if you use ssh keys to log into systems.
|
||||
|
||||
32\. Use two-factor authentication (2FA). Passwords have become just about useless. Using YubiKeys and the like make two-factor easy. We all have cell phones. Having a secret in your head and one generated on the phone is always better than a password.
|
||||
|
||||
33\. Nothing aggravates me more than websites always asking me to set up an account—can't we do better? Always use a password-generating tool for your website passwords. I am old school: I use [Password Safe][17] and cut and paste into the web browser. I have heard that other people have good luck with [LastPass][18]and other tools that integrate your phone and web service.
|
||||
|
||||
34\. Set up a service like [FreeIPA][19] to use for identity services. Using tools such as [Kerberos][20] for authentication and authorization makes keeping track of employees and their access to systems much easier (and it has cool crypto services). Using Active Directory is ok, but I am a little prejudiced.
|
||||
|
||||
>When you must use a password that you need to type in often, use an easily remembered sentence rather the a word.
|
||||
|
||||
35\. When you must use a password that you need to type in often, use an easily remembered sentence rather the a word. My preferred way to remember passwords is to use a phrase several words long that is easy to type.
|
||||
|
||||
### "And get yourself free"
|
||||
|
||||
36\. Use [USBGuard][21] to protect your system from rogue USB devices.
|
||||
|
||||
37\. The past few years, I have been working on containers, so now let's dive into security on containers. First run them on a system with SELinux turned on in enforcing mode. If your system does not support SELinux, switch the distribution to one that does. SELinux is the best tool for protecting against container break out using the file system.
|
||||
|
||||
38\. Run your service inside of a container whenever possible. I believe this is the future—applications using [OCI Image Format][22] and Linux container technology. Launch these containers with Docker, [runC][23], OCID, RKT, Systemd-nspawn, and so on. Although I have often said "containers do not contain," they do contain better than not running them inside of a container.
|
||||
|
||||
39\. Run your container in a VM. Virtual machines provide better isolation than containers. Running like containers on virtual machines provides you scalability and isolation from each other.
|
||||
|
||||
40\. Run containerized apps with different security needs on different virtual machines. Run your web service containers on virtual machines in the DMZ, but run the database containers on virtual machines outside of the DMZ.
|
||||
|
||||
41\. Also remember to run your virtual machines requiring the most security on different physical machines, on different virtual machines inside of containers (a.k.a., defense in depth).
|
||||
|
||||
42\. Run your containers in [read-only mode.][24] Containers in development need to be able to write to **/usr**, but a container in production should only be able to write to **tmpfs** and volumes mounted into the container.
|
||||
|
||||
43. [Drop capabilities from your containers][25]. We run our processes in and outside of containers with many more "capabiltiies" than they need. You can make your processes more secure by dropping capabilties.
|
||||
|
||||
44. [Don't run your processes in containers as root][26]. Most services never need root privileges, or they need it to bind to a port < 1024 and then switch to a non-root user. I would advise always running apps as non-root.
|
||||
|
||||
45\. Keep your containers updated with the latest CVEs fixes. Using a system like OpenShift for building and maintaining your container images is a good idea, because it automatically rebuilds container images when a new security fix appears.
|
||||
|
||||
46\. An associate of mine says, "Docker is all about running random code from the Internet as root on your host." Get your software from a trusted source. Don't grab the first Apache application that you find at docker.io. The [operating system matters][27].
|
||||
|
||||
47\. Run your containers in production on a limited containerized optimized host, such as an [Atomic Host][28], which comes with all of the security turned on, optimized for running containers, with a limited attack surface and atomic updates. What is not to like there?
|
||||
|
||||
48\. Use tools like [OpenScap][29] to scan your systems for vulnerabilities. Sadly, new vulnerabilities are always popping up, so you must keep your scanners up to date. (Take a look at [atomic scan][30] for scanning your containers, as well.)
|
||||
|
||||
49\. OpenScap also has features to scan for [security configuration][31], such as STIGs (Security Technical Implementation Guides).
|
||||
|
||||
50\. Set up a special guest network for all those Christmas IoT devices your kids receive. I love my Amazon Echo and automated lights and power switches ("Alexa, turn on the Christmas Lights"), but each one of these is a Linux operating system that has questionable security.
|
||||
|
||||
### "There must be 50 more ways not to get hacked"
|
||||
|
||||
What would you add to the list? Let us know in the comments.
|
||||
|
||||
_Josh Bressers contributed to this article._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Daniel J Walsh - Daniel Walsh has worked in the computer security field for almost 30 years. Dan joined Red Hat in August 2001.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/yearbook-50-ways-avoid-getting-hacked
|
||||
|
||||
作者:[Daniel J Walsh][a]
|
||||
译者:[译者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/rhatdan
|
||||
[1]:http://danwalsh.livejournal.com/51459.html
|
||||
[2]:https://www.phoronix.com/scan.php?page=news_item&px=systemd-New-Protect-Tunables
|
||||
[3]:https://www.youtube.com/watch?v=0H5chfbcWtY
|
||||
[4]:http://syncstop.com/
|
||||
[5]:http://stopdisablingselinux.com/
|
||||
[6]:http://danwalsh.livejournal.com/71122.html
|
||||
[7]:http://danwalsh.livejournal.com/31146.html
|
||||
[8]:http://flatpak.org/
|
||||
[9]:http://danwalsh.livejournal.com/37404.html
|
||||
[10]:http://0pointer.de/blog/projects/security.html
|
||||
[11]:https://source.android.com/security/selinux/
|
||||
[12]:https://whispersystems.org/
|
||||
[13]:https://access.redhat.com/blogs/766093/posts/2695561
|
||||
[14]:https://lwn.net/Articles/656307/
|
||||
[15]:https://www.yubico.com/
|
||||
[16]:https://letsencrypt.org/
|
||||
[17]:https://pwsafe.org/
|
||||
[18]:https://www.lastpass.com/
|
||||
[19]:https://www.freeipa.org/page/Main_Page
|
||||
[20]:https://web.mit.edu/kerberos/
|
||||
[21]:https://github.com/dkopecek/usbguard
|
||||
[22]:https://www.opencontainers.org/
|
||||
[23]:https://runc.io/
|
||||
[24]:http://www.projectatomic.io/blog/2015/12/making-docker-images-write-only-in-production/
|
||||
[25]:http://rhelblog.redhat.com/2016/10/17/secure-your-containers-with-this-one-weird-trick/
|
||||
[26]:https://www.projectatomic.io/blog/2016/01/how-to-run-a-more-secure-non-root-user-container/
|
||||
[27]:https://opensource.com/16/12/yearbook-why-operating-system-matters
|
||||
[28]:https://access.redhat.com/articles/rhel-atomic-getting-started
|
||||
[29]:https://www.open-scap.org/
|
||||
[30]:https://developers.redhat.com/blog/2016/05/02/introducing-atomic-scan-container-vulnerability-detection/
|
||||
[31]:https://www.open-scap.org/security-policies/scap-security-guide/
|
@ -0,0 +1,96 @@
|
||||
How to change the Linux I/O scheduler to fit your needs
|
||||
============================================================
|
||||
|
||||
In order to eek out as much performance from Linux servers as possible, learn how to change your I/O scheduler to meet your needs.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
The Linux I/O scheduler controls the way the kernel commits read and writes to disk. Since the 2.6 kernel, administrators have been able to change the scheduler, so they can customize their platforms to perfectly suit their needs.
|
||||
|
||||
There are three schedulers to choose from, and each one has its benefits. Those schedulers are:
|
||||
|
||||
* **CFQ (cfq):** the default scheduler for many Linux distributions; it places synchronous requests, submitted by processes, into a number of per-process queues and then allocates timeslices for each of the queues to access the disk.
|
||||
* **Noop scheduler (noop):** the simplest I/O scheduler for the Linux kernel based on the First In First Out (FIFO) queue concept. This scheduler is best suited for SSDs.
|
||||
* **Deadline scheduler (deadline):** attempts to guarantee a start service time for a request.
|
||||
|
||||
|
||||
When you want to squeeze the most performance out of your Linux-powered machines, this might be one of the areas you turn. Fortunately, it is quite simple to change the scheduler that powers I/O. Let me show you how.
|
||||
|
||||
### Finding out which scheduler you have
|
||||
|
||||
The first thing you need to do is find out which scheduler is handling I/O on your system. This is done from the command line, and you must know the name of your disk. For simplicity sake, I'll assume the disk is question is sda. With that information in hand, open a terminal window and issue the following command:
|
||||
|
||||
```
|
||||
cat /sys/block/sda/queue/scheduler
|
||||
```
|
||||
|
||||
The results of the command will display the current running scheduler (**Figure A**).
|
||||
|
||||
**Figure A**
|
||||
|
||||

|
||||
|
||||
Elementary OS Loki running the noop scheduler.
|
||||
|
||||
### Changing your scheduler
|
||||
|
||||
You can change your scheduler in two ways: on the fly or persistently. If you change the scheduler on the fly, it can revert to the default scheduler (after a reboot). You might want to do an on the fly change first, to see which scheduler brings about the best performance for your needs.
|
||||
|
||||
Say you want to change to the noop scheduler on the fly. To do this, you would issue the following command:
|
||||
|
||||
```
|
||||
sudo echo noop > /sys/block/hda/queue/scheduler
|
||||
```
|
||||
|
||||
You can change _noop_ to _cfq_, or _deadline_.
|
||||
|
||||
This change can be done without having to reboot your machine. Once changed, the I/O scheduler will switch and (hopefully) you'll see a performance increase (again, depending upon your needs).
|
||||
|
||||
If you want to change the scheduler to be persistent, you must do this within the GRUB configuration file. To do that, issue the command sudo nano /etc/default/grub and then change the line:
|
||||
|
||||
```
|
||||
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
|
||||
```
|
||||
|
||||
to
|
||||
|
||||
```
|
||||
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=noop"
|
||||
```
|
||||
|
||||
Again, you can change noop to whatever scheduler you need. If you make this change after you do an on the fly change, you won't have to do a reboot to have the new scheduler take effect.
|
||||
|
||||
That's all there is to it.
|
||||
|
||||
### Choose wisely
|
||||
|
||||
You should do research to find out what scheduler is best suited for your particular situation. To find out more about each scheduler, check out these Wiki pages: [CFS][7], [Noop][8], and [Deadline][9].
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.techrepublic.com/article/how-to-change-the-linux-io-scheduler-to-fit-your-needs/
|
||||
|
||||
作者:[Jack Wallen ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.techrepublic.com/meet-the-team/us/jack-wallen/
|
||||
[1]:http://www.techrepublic.com/article/why-the-earliest-open-source-licenses-are-still-the-most-relevant/
|
||||
[2]:http://www.techrepublic.com/article/raspberry-pi-in-2017-new-boards-new-oses-and-more/
|
||||
[3]:http://www.techrepublic.com/article/open-source-predictions-for-2017/
|
||||
[4]:http://www.techrepublic.com/newsletters/
|
||||
[5]:http://www.techrepublic.com/article/how-to-change-the-linux-io-scheduler-to-fit-your-needs/#postComments
|
||||
[6]:http://www.techrepublic.com/article/open-source-predictions-for-2017/
|
||||
[7]:https://en.wikipedia.org/wiki/Completely_Fair_Scheduler
|
||||
[8]:https://en.wikipedia.org/wiki/Noop_scheduler
|
||||
[9]:https://en.wikipedia.org/wiki/Deadline_scheduler
|
||||
[10]:http://intent.cbsi.com/redir?tag=medc-content-top-leaderboard&siteId=11&rsid=cbsitechrepublicsite&pagetype=article&sl=en&sc=us&topicguid=0aed1ce4-8606-11e2-a661-024c619f5c3d&assetguid=b1120b55-9a41-4a43-b0c6-23f7beb58c5b&assettype=content_article&ftag_cd=LGN3588bd2&devicetype=desktop&viewguid=d21156e0-d86f-11e6-85ae-35117859b3ea&q=&ctype=docids;promo&cval=33159110;7205&ttag=&ursuid=&bhid=&destUrl=http%3A%2F%2Fwww.techrepublic.com%2Fresource-library%2Fwhitepapers%2Fthe-web-developer-bootcamp%2F%3Fpromo%3D7205%26ftag%3DLGN3588bd2%26cval%3Dcontent-top-leaderboard
|
||||
[11]:http://intent.cbsi.com/redir?tag=medc-content-top-leaderboard&siteId=11&rsid=cbsitechrepublicsite&pagetype=article&sl=en&sc=us&topicguid=0aed1ce4-8606-11e2-a661-024c619f5c3d&assetguid=b1120b55-9a41-4a43-b0c6-23f7beb58c5b&assettype=content_article&ftag_cd=LGN3588bd2&devicetype=desktop&viewguid=d21156e0-d86f-11e6-85ae-35117859b3ea&q=&ctype=docids;promo&cval=33159110;7205&ttag=&ursuid=&bhid=&destUrl=http%3A%2F%2Fwww.techrepublic.com%2Fresource-library%2Fwhitepapers%2Fthe-web-developer-bootcamp%2F%3Fpromo%3D7205%26ftag%3DLGN3588bd2%26cval%3Dcontent-top-leaderboard
|
||||
[12]:http://www.techrepublic.com/rssfeeds/topic/data-centers/
|
||||
[13]:http://www.techrepublic.com/meet-the-team/us/jack-wallen/
|
||||
[14]:https://twitter.com/intent/user?screen_name=jlwallen
|
@ -0,0 +1,329 @@
|
||||
Speed up your downloads with Axel command line downloader/accelerator
|
||||
============================================================
|
||||
|
||||
[Axel][7] is a lightweight download utility, it does the same thing how other accelerator does. It opens multiple connections for one file and each connections download separate file fragment to complete the download more quickly.
|
||||
|
||||
Axel supports HTTP, HTTPS, FTP and FTPS protocols. It can also use multiple mirrors for single file download. So, Axel can speed up a download up to 40% (approximately, i personally realized). It’s very lightweight because no dependencies and uses very less CPU & RAM.
|
||||
|
||||
Axel downloads all the data directly to the destination file, using one single thread.
|
||||
|
||||
Note : There is no option to download the two file in single command
|
||||
|
||||
You can also try alternative Command Line Download Managers/Accelerators
|
||||
|
||||
* [aria2 – The ultra fast download utility][1]
|
||||
* [wget – Standard command line download utility][2]
|
||||
* [curl – command line download utility][3]
|
||||
* [Best 4 Command Line Download Managers/Accelerators for Linux][4]
|
||||
|
||||
Most of the distribution (Debian, Ubuntu, Mint, Fedora, suse, openSUSE, Arch Linux, Manjaro, Mageia, etc.) has the axel package so we can easily install it from distribution official repository. For CentOS/RHEL we need to enable [EPEL Repository][5].
|
||||
|
||||
```
|
||||
[Install Axel on Debian/Ubuntu/LinuxMint]
|
||||
$ sudo apt-get install axel
|
||||
|
||||
[Install Axel on RHEL/CentOS]
|
||||
$ sudo yum install axel
|
||||
|
||||
[Install Axel on Fedora]
|
||||
$ sudo dnf install axel
|
||||
|
||||
[Install Axel on openSUSE]
|
||||
$ sudo zypper install axel
|
||||
|
||||
[Install Axel on Mageia]
|
||||
$ sudo urpmi axel
|
||||
|
||||
[Install Axel on Arch Linux based system]
|
||||
$ sudo pacman -S axel
|
||||
```
|
||||
|
||||
#### 1) Download Single File
|
||||
|
||||
The below command will download the file from given URL and stores in current directory, while downloading the file we can see the (No of connection established, download speed, download progress, how much time it took to complete the download & where connection finished) of file.
|
||||
|
||||
```
|
||||
# axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
Starting download
|
||||
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 146.7KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 267.0KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 373.9KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 406.9KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 487.5KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 572.6KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 650.7KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 649.3KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 718.1KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 769.3KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 838.7KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 866.0KB/s]
|
||||
Connection 0 finished
|
||||
.
|
||||
.
|
||||
[ 99%] .......... .......... .......... .......... .......... [5721.0KB/s]
|
||||
Connection 2 finished
|
||||
[ 99%] .......... .......... .......... .......... .......... [5733.4KB/s]
|
||||
Connection 1 finished
|
||||
[ 99%] .......... .......... .......... .......... .......... [5745.4KB/s]
|
||||
[100%] .......... .......... .......... .......... ......
|
||||
|
||||
Downloaded 21.6 megabytes in 3 seconds. (5755.94 KB/s)
|
||||
```
|
||||
|
||||
#### 2) Save the file with different name
|
||||
|
||||
You can save the file with different name while initiate downloading by adding -o (lowercase) option followed by file name. Here we are going to save the filename with owncloud.tar.bz2.
|
||||
|
||||
```
|
||||
# axel -o cloud.tar.bz2 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file cloud.tar.bz2
|
||||
Starting download
|
||||
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 143.0KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 264.1KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 309.8KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 406.3KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 495.4KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 586.3KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 673.1KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 647.1KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 721.1KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 781.3KB/s]
|
||||
Connection 2 finished
|
||||
.
|
||||
.
|
||||
Connection 0 finished
|
||||
[ 98%] .......... .......... .......... .......... .......... [6221.9KB/s]
|
||||
[ 98%] .......... .......... .....
|
||||
Connection 1 finished
|
||||
,,,,,,,,,, ,,,,,,,,,, ,,,,,..... .......... .......... [6145.6KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [6159.2KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [6172.0KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [5977.9KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [5989.6KB/s]
|
||||
[100%] .......... .......... .......... .......... ......
|
||||
|
||||
Downloaded 21.6 megabytes in 3 seconds. (6001.05 KB/s)
|
||||
```
|
||||
|
||||
#### 3) Limit download speed
|
||||
|
||||
By default axel Set the maximum speed for downloading file in Bytes per Second. We can use this option when we have a slow network connection. Just add `-s` option followed by bytes value. Here we are going to download a file with `512KB/s`.
|
||||
|
||||
```
|
||||
# axel -s 512000 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
Starting download
|
||||
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 141.5KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 266.1KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 308.0KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 405.9KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 496.7KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 526.4KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 507.0KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 505.6KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 504.8KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 503.9KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 503.4KB/s]
|
||||
.
|
||||
.
|
||||
[ 99%] .......... .......... .......... .......... .......... [ 497.0KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [ 496.9KB/s]
|
||||
[100%] .......... ..
|
||||
Connection 0 finished
|
||||
,,,,,,,,,, ,,.....
|
||||
Connection 1 finished
|
||||
Connection 3 finished
|
||||
,,,,,,,,,, ,,,,,,,... .......... .......... ......
|
||||
|
||||
Downloaded 21.6 megabytes in 44 seconds. (494.54 KB/s)
|
||||
```
|
||||
|
||||
#### 4) Limit the Connections
|
||||
|
||||
By default axel establish 4 connection to get the file from different mirrors. Additionally we can boost the download speed by adding more connection with `-n` option followed by connections count `8`. We have added eight connection for safer side but unfortunately it took much time to get the file downloaded.
|
||||
|
||||
```
|
||||
# axel -n 10 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
Starting download
|
||||
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 140.8KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 265.7KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 305.4KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 402.1KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 496.3KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 522.1KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 567.5KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 640.5KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 710.8KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 780.5KB/s]
|
||||
.
|
||||
.
|
||||
[ 98%] .......... .......... .......... .......... .......... [7544.9KB/s]
|
||||
[ 98%] .......... .......... .......... .......... .......... [7557.9KB/s]
|
||||
[ 98%] .......... .......... .......... .......... .......... [7570.4KB/s]
|
||||
[ 98%] .......... .......... .......... .......... .......... [7495.3KB/s]
|
||||
[ 99%] .......... .......... .......... .......... ......
|
||||
Connection 2 finished
|
||||
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,.... [7311.6KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [7318.9KB/s]
|
||||
[ 99%] .......... .......... .......... .......... ..........
|
||||
Connection 9 finished
|
||||
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, [7331.0KB/s]
|
||||
[ 99%] .......... .......... .......... ..........
|
||||
Connection 3 finished
|
||||
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, .......... [4300.7KB/s]
|
||||
[100%] .......... .......... .......... .......... ......
|
||||
|
||||
Downloaded 21.6 megabytes in 5 seconds. (4109.41 KB/s)
|
||||
```
|
||||
|
||||
#### 5) Resume Incomplete download
|
||||
|
||||
By default axel have the behavior of Resume Incomplete download. Axel used to update the state file `(.st extension)` regularly while downloading the file. Due to some reason, the download get hang in middle ? don’t worry, just use the same axel command which will check `file` & `file.st`, if found, download is resumed where it stopped.
|
||||
|
||||
```
|
||||
# axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
Starting download
|
||||
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 140.8KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 265.7KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 305.4KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 402.1KB/s]
|
||||
[ 0%] .......... .......... .......... .......... .......... [ 496.3KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 522.1KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 567.5KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 640.5KB/s]
|
||||
[ 1%] .......... .......... .......... .......... .......... [ 710.8KB/s]
|
||||
[ 2%] .......... .......... .......... .......... .......... [ 780.5KB/s]
|
||||
.
|
||||
.
|
||||
[ 84%] .......... .......... .......... .......... .......... [7100.7KB/s]
|
||||
[ 84%] .......... .......... .......... .......... .......... [7104.3KB/s]
|
||||
[ 84%] .......... .......... .......... .^C
|
||||
|
||||
Downloaded 18.3 megabytes in 2 seconds. (7009.79 KB/s)
|
||||
```
|
||||
|
||||
The following output clearly showing two files `owncloud-9.0.0.tar.bz2` & `owncloud-9.0.0.tar.bz2.st` when we disconnect the download. When re initiating the download again, it starts exactly where it stopped before.
|
||||
|
||||
```
|
||||
# ls -lh
|
||||
total 19M
|
||||
-rw------- 1 root root 22M Dec 27 08:33 owncloud-9.0.0.tar.bz2
|
||||
-rw------- 1 root root 44 Dec 27 08:33 owncloud-9.0.0.tar.bz2.st
|
||||
|
||||
# axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
State file found: 19180828 bytes downloaded, 3497380 to go.
|
||||
Starting download
|
||||
|
||||
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,......... .......... [ 66.5KB/s]
|
||||
[ 84%] .......... .......... .......... .......... .......... [ 186.0KB/s]
|
||||
[ 85%] .......... .......... .......... .......... .......... [ 241.7KB/s]
|
||||
[ 85%] .......... .......... .......... .......... .......... [ 335.6KB/s]
|
||||
[ 85%] .......... .......... .......... .......... .......... [ 351.5KB/s]
|
||||
[ 85%] .......... .......... .......... .......... .......... [ 427.1KB/s]
|
||||
[ 85%] .......... .......... .......... .......... .......... [ 427.4KB/s]
|
||||
[ 86%] .......... .......... .......... .......... .......... [ 491.5KB/s]
|
||||
.
|
||||
.
|
||||
[ 98%] ...
|
||||
Connection 0 finished
|
||||
,,,....... .......... .......... .......... .......... [2106.6KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [2140.5KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [2172.4KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [2203.2KB/s]
|
||||
[ 99%] .......... .......... .......... .......... .......... [2236.2KB/s]
|
||||
[100%] .......... .......... .......... .......... ......
|
||||
|
||||
Downloaded 3415.4 kilobytes in 1 second. (2264.93 KB/s)
|
||||
```
|
||||
|
||||
#### 6) Get the file without progress
|
||||
|
||||
If you don’t want to see the file download progress, simply add `-q` option with axel command.
|
||||
|
||||
```
|
||||
# axel -q https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
```
|
||||
|
||||
#### 7) Alternate progress indicator
|
||||
|
||||
If you don’t like the default progress bar, you can use alternate progress indicator by adding -a option with axel command.
|
||||
|
||||
```
|
||||
# axel -a https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
Starting download
|
||||
|
||||
[ 66%] [......0 ...1 ..........2 ...........3] [ 5.8MB/s] [00:01]^C
|
||||
|
||||
Downloaded 14.3 megabytes in 2 seconds. (5916.11 KB/s)
|
||||
```
|
||||
|
||||
We have interrupted the above download to show you the alternate progress indicator status clearly while downloading the file. Once the file get downloaded successfully you can see the same output like below.
|
||||
|
||||
```
|
||||
# axel -a https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
|
||||
File size: 22678208 bytes
|
||||
Opening output file owncloud-9.0.0.tar.bz2
|
||||
Starting download
|
||||
|
||||
Connection 2 finished ]
|
||||
Connection 1 finished ]
|
||||
Connection 3 finished ]
|
||||
Connection 0 finished ]
|
||||
|
||||
Downloaded 21.6 megabytes in 4 seconds. (5062.32 KB/s)
|
||||
```
|
||||
|
||||
#### 8) Read more about axel
|
||||
|
||||
If you want to know more option which is available for axel, simply navigate to man page.
|
||||
|
||||
```
|
||||
# man axel
|
||||
or
|
||||
# axel --help
|
||||
```
|
||||
|
||||
Enjoy…)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.2daygeek.com/axel-command-line-downloader-accelerator-for-linux/
|
||||
|
||||
作者:[ MAGESH MARUTHAMUTHU][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.2daygeek.com/author/magesh/
|
||||
[1]:http://www.2daygeek.com/aria2-command-line-download-utility-tool/
|
||||
[2]:http://www.2daygeek.com/wget-command-line-download-utility-tool/
|
||||
[3]:http://www.2daygeek.com/aria2-command-line-download-utility-tool/
|
||||
[4]:http://www.2daygeek.com/best-4-command-line-download-managers-accelerators-for-linux/
|
||||
[5]:http://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/
|
||||
[6]:http://www.2daygeek.com/author/magesh/
|
||||
[7]:https://axel.alioth.debian.org/
|
@ -0,0 +1,267 @@
|
||||
inxi – A Great Tool to Check Hardware Information on Linux
|
||||
============================================================
|
||||
|
||||
One of the big challenge for Linux administrator to find, all the hardware information on the system. There are many command line utility is are available in Linux to get the hardware information but there will be a lack to get some of the information.
|
||||
|
||||
[inxi][1] is a nifty tool to check hardware information on Linux and offers wide range of option to get all the hardware information on Linux system that i never found in any other utility which are available in Linux. It was forked from the ancient and mindbendingly perverse yet ingenius infobash, by locsmif.
|
||||
|
||||
inxi is a script that quickly shows system hardware, CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other useful information, also used for forum technical support & debugging tool.
|
||||
|
||||
#### Install inix on Linux
|
||||
|
||||
inxi is support all Linux distributions and never require latest dependencies, so no need to think about manual installation. Simply install inix from distribution official repository by using below commands.
|
||||
|
||||
```
|
||||
[Install inxi on CentOS/RHEL]
|
||||
$ sudo yum install inxi
|
||||
|
||||
[Install inix on Fedora]
|
||||
$ sudo dnf install inxi
|
||||
|
||||
[Install inxi on Debian/Linux Mint/Ubuntu]
|
||||
$ sudo apt-get install inxi
|
||||
|
||||
[Install inxi on openSUSE]
|
||||
$ sudo zypper in inxi
|
||||
|
||||
[Install inxi on Mageia]
|
||||
$ sudo urpmi inxi
|
||||
|
||||
[Install inxi on Arch based system]
|
||||
$ yaourt -S inxi
|
||||
```
|
||||
|
||||
By default inxi output comes with colors which can be turned off by using `-c` followed by `0` (you can use 0-32) to get better visibility.
|
||||
|
||||
#### Print one line output with inix
|
||||
|
||||
Issue inxi command without any option to print the hardware information in one line like, CPU, kernel, architecture, uptime, memory, HDD, process & inxi version.
|
||||
|
||||
```
|
||||
$ inxi -c 0
|
||||
CPU~Dual core Intel Core i7-6700HQ (-MCP-) speed~2591 MHz (max) Kernel~4.8.0-32-generic x86_64 Up~50 min Mem~1609.9/1999.8MB HDD~42.9GB(17.6% used) Procs~197 Client~Shell inxi~2.3.1
|
||||
```
|
||||
|
||||
#### Print basic system hardware
|
||||
|
||||
Issue inxi command with `-b` option wich will print basic system hardware information. I mean, it shows about System, Machine, CPU, Graphics, Network, Drives & Info.
|
||||
|
||||
```
|
||||
$ inxi -b
|
||||
System: Host: daygeek Kernel: 4.8.0-32-generic x86_64 (64 bit) Desktop: Unity 7.5.0 Distro: Ubuntu 16.10
|
||||
Machine: System: innotek (portable) product: VirtualBox v: 1.2
|
||||
Mobo: Oracle model: VirtualBox v: 1.2 BIOS: innotek v: VirtualBox date: 12/01/2006
|
||||
Battery BAT0: charge: 31.5 Wh 63.0% condition: 50.0/50.0 Wh (100%)
|
||||
CPU: Dual core Intel Core i7-6700HQ (-MCP-) speed: 2591 MHz (max)
|
||||
Graphics: Card: InnoTek Systemberatung VirtualBox Graphics Adapter
|
||||
Display Server: X.Org 1.18.4 drivers: (unloaded: fbdev,vesa) Resolution: 1920x955@59.89hz
|
||||
GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits) GLX Version: 3.0 Mesa 12.0.3
|
||||
Network: Card: Intel 82540EM Gigabit Ethernet Controller driver: e1000
|
||||
Drives: HDD Total Size: 42.9GB (17.6% used)
|
||||
Info: Processes: 197 Uptime: 50 min Memory: 1586.2/1999.8MB Client: Shell (bash) inxi: 2.3.1
|
||||
```
|
||||
|
||||
* System : Host Name, Kernel version, Architecture, Desktop & Distribution
|
||||
* Machine : Motherboard & Bios information
|
||||
* CPU : Processor Name and core
|
||||
* Graphics : Graphics card info
|
||||
* Network : Network card info
|
||||
* Drives : HDD size and used percent
|
||||
* Info : Total process count, Server Uptime, Memory total and used, inxi version
|
||||
|
||||
#### Show Audio/sound card information
|
||||
|
||||
Issue inxi command with `-A` which will show Audio/sound card information.
|
||||
|
||||
```
|
||||
$ inxi -A
|
||||
Audio: Card Intel 82801AA AC'97 Audio Controller driver: snd_intel8x0 Sound: ALSA v: k4.8.0-32-generic
|
||||
```
|
||||
|
||||
#### Show full CPU info
|
||||
|
||||
Issue inxi command with `-C` which will show full CPU information, including per CPU clock speed and CPU max speed (if available).
|
||||
|
||||
```
|
||||
$ inxi -C
|
||||
CPU: Dual core Intel Core i7-6700HQ (-MCP-) cache: 6144 KB
|
||||
clock speeds: max: 2591 MHz 1: 2591 MHz 2: 2591 MHz
|
||||
```
|
||||
|
||||
#### Show optical drive information
|
||||
|
||||
Issue inxi command with `-d` which will show optical drive data information, including all storage.
|
||||
|
||||
```
|
||||
$ inxi -d
|
||||
Drives: HDD Total Size: 42.9GB (17.6% used) ID-1: /dev/sda model: VBOX_HARDDISK size: 42.9GB
|
||||
Optical: /dev/sr0 model: VBOX CD-ROM dev-links: cdrom,dvd
|
||||
Features: speed: 32x multisession: yes audio: yes dvd: yes rw: none
|
||||
```
|
||||
#### Show full hard Disk information
|
||||
|
||||
Issue inxi command with `-D` which will show full hard Disk information, including HDD total size, used size and percentage, file system type & mount point.
|
||||
|
||||
```
|
||||
$ inxi -D
|
||||
Drives: HDD Total Size: 42.9GB (17.6% used) ID-1: /dev/sda model: VBOX_HARDDISK size: 42.9GB
|
||||
```
|
||||
|
||||
Issue inxi command with `-p` which will show full partition information.
|
||||
|
||||
```
|
||||
$ inxi -p
|
||||
Partition: ID-1: / size: 38G used: 5.2G (15%) fs: ext4 dev: /dev/sda1
|
||||
ID-2: swap-1 size: 2.15GB used: 0.20GB (9%) fs: swap dev: /dev/sda5
|
||||
```
|
||||
|
||||
Issue inxi command with `-0` which will show unmounted partition information.
|
||||
|
||||
```
|
||||
$ inxi -o
|
||||
Unmounted: No unmounted partitions detected
|
||||
```
|
||||
|
||||
#### Show Graphic card information
|
||||
|
||||
Issue inxi command with `-G` which will show Graphic card information.
|
||||
|
||||
```
|
||||
$ inxi -G
|
||||
Graphics: Card: InnoTek Systemberatung VirtualBox Graphics Adapter
|
||||
Display Server: X.Org 1.18.4 drivers: (unloaded: fbdev,vesa) Resolution: 1920x955@59.89hz
|
||||
GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits) GLX Version: 3.0 Mesa 12.0.3
|
||||
```
|
||||
|
||||
#### Show server public IP address
|
||||
|
||||
Issue inxi command with `-i` (requires ifconfig network tool) which will show server public IP address.
|
||||
|
||||
```
|
||||
$ inxi -i
|
||||
Network: Card: Intel 82540EM Gigabit Ethernet Controller driver: e1000
|
||||
IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac: 08:00:27:ae:1d:fe
|
||||
WAN IP: 103.5.134.167 IF: enp0s3 ip-v4: 10.0.2.15
|
||||
```
|
||||
|
||||
#### Show machine data information
|
||||
|
||||
Issue inxi command with `-M` which will show machine data information, including Device, Motherboard, Bios, and if percentage, System Builder (Like Lenovo).
|
||||
|
||||
```
|
||||
$ inxi -M
|
||||
Machine: System: innotek (portable) product: VirtualBox v: 1.2
|
||||
Mobo: Oracle model: VirtualBox v: 1.2 BIOS: innotek v: VirtualBox date: 12/01/2006
|
||||
Battery BAT0: charge: 32.5 Wh 65.0% condition: 50.0/50.0 Wh (100%)
|
||||
```
|
||||
|
||||
#### Show Show Network card information
|
||||
|
||||
Issue inxi command with `-N` which will show Show Network card information.
|
||||
|
||||
```
|
||||
$ inxi -N
|
||||
Network: Card: Intel 82540EM Gigabit Ethernet Controller driver: e1000
|
||||
```
|
||||
|
||||
Issue inxi command with `-n` which will show Show Advanced Network card information, including interface, speed, mac id, state, etc.
|
||||
|
||||
```
|
||||
$ inxi -n
|
||||
Network: Card: Intel 82540EM Gigabit Ethernet Controller driver: e1000
|
||||
IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac: 08:00:27:ae:1d:fe
|
||||
```
|
||||
|
||||
#### Show distro repository data information
|
||||
|
||||
Issue inxi command with `-r` which will show distro repository data information.
|
||||
|
||||
```
|
||||
$ inxi -r
|
||||
Repos: Active apt sources in file: /etc/apt/sources.list
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety main restricted
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates main restricted
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety universe
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates universe
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety multiverse
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates multiverse
|
||||
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse
|
||||
deb http://security.ubuntu.com/ubuntu yakkety-security main restricted
|
||||
deb http://security.ubuntu.com/ubuntu yakkety-security universe
|
||||
deb http://security.ubuntu.com/ubuntu yakkety-security multiverse
|
||||
Active apt sources in file: /etc/apt/sources.list.d/arc-theme.list
|
||||
deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /
|
||||
Active apt sources in file: /etc/apt/sources.list.d/snwh-ubuntu-pulp-yakkety.list
|
||||
deb http://ppa.launchpad.net/snwh/pulp/ubuntu yakkety main
|
||||
```
|
||||
|
||||
#### Show possible system hardware information
|
||||
|
||||
Issue inxi command with `-F` which will show possible system hardware information.
|
||||
|
||||
```
|
||||
$ inxi -F
|
||||
System: Host: daygeek Kernel: 4.8.0-32-generic x86_64 (64 bit) Desktop: Unity 7.5.0 Distro: Ubuntu 16.10
|
||||
Machine: System: innotek (portable) product: VirtualBox v: 1.2
|
||||
Mobo: Oracle model: VirtualBox v: 1.2 BIOS: innotek v: VirtualBox date: 12/01/2006
|
||||
Battery BAT0: charge: 33.0 Wh 66.0% condition: 50.0/50.0 Wh (100%)
|
||||
CPU: Dual core Intel Core i7-6700HQ (-MCP-) cache: 6144 KB
|
||||
clock speeds: max: 2591 MHz 1: 2591 MHz 2: 2591 MHz
|
||||
Graphics: Card: InnoTek Systemberatung VirtualBox Graphics Adapter
|
||||
Display Server: X.Org 1.18.4 drivers: (unloaded: fbdev,vesa) Resolution: 1920x955@59.89hz
|
||||
GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits) GLX Version: 3.0 Mesa 12.0.3
|
||||
Audio: Card Intel 82801AA AC'97 Audio Controller driver: snd_intel8x0 Sound: ALSA v: k4.8.0-32-generic
|
||||
Network: Card: Intel 82540EM Gigabit Ethernet Controller driver: e1000
|
||||
IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac: 08:00:27:ae:1d:fe
|
||||
Drives: HDD Total Size: 42.9GB (17.6% used) ID-1: /dev/sda model: VBOX_HARDDISK size: 42.9GB
|
||||
Partition: ID-1: / size: 38G used: 5.2G (15%) fs: ext4 dev: /dev/sda1
|
||||
ID-2: swap-1 size: 2.15GB used: 0.20GB (9%) fs: swap dev: /dev/sda5
|
||||
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
|
||||
Sensors: None detected - is lm-sensors installed and configured?
|
||||
Info: Processes: 198 Uptime: 53 min Memory: 1587.5/1999.8MB Client: Shell (bash) inxi: 2.3.1
|
||||
```
|
||||
|
||||
#### Get extra information about the device
|
||||
|
||||
Add `-x` with any above individual output which will show extra information about the device.
|
||||
|
||||
```
|
||||
$ inxi -F -x
|
||||
System: Host: daygeek Kernel: 4.8.0-32-generic x86_64 (64 bit gcc: 6.2.0)
|
||||
Desktop: Unity 7.5.0 (Gtk 3.20.9-1ubuntu2) Distro: Ubuntu 16.10
|
||||
Machine: System: innotek (portable) product: VirtualBox v: 1.2
|
||||
Mobo: Oracle model: VirtualBox v: 1.2 BIOS: innotek v: VirtualBox date: 12/01/2006
|
||||
Battery BAT0: charge: 33.0 Wh 66.0% condition: 50.0/50.0 Wh (100%) model: innotek 1 status: Charging
|
||||
CPU: Dual core Intel Core i7-6700HQ (-MCP-) cache: 6144 KB
|
||||
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) bmips: 10368
|
||||
clock speeds: max: 2591 MHz 1: 2591 MHz 2: 2591 MHz
|
||||
Graphics: Card: InnoTek Systemberatung VirtualBox Graphics Adapter bus-ID: 00:02.0
|
||||
Display Server: X.Org 1.18.4 drivers: (unloaded: fbdev,vesa) Resolution: 1920x955@59.89hz
|
||||
GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits)
|
||||
GLX Version: 3.0 Mesa 12.0.3 Direct Rendering: Yes
|
||||
Audio: Card Intel 82801AA AC'97 Audio Controller driver: snd_intel8x0 ports: d100 d200 bus-ID: 00:05.0
|
||||
Sound: Advanced Linux Sound Architecture v: k4.8.0-32-generic
|
||||
Network: Card: Intel 82540EM Gigabit Ethernet Controller
|
||||
driver: e1000 v: 7.3.21-k8-NAPI port: d010 bus-ID: 00:03.0
|
||||
IF: enp0s3 state: up speed: 1000 Mbps duplex: full mac: 08:00:27:ae:1d:fe
|
||||
Drives: HDD Total Size: 42.9GB (17.6% used) ID-1: /dev/sda model: VBOX_HARDDISK size: 42.9GB
|
||||
Partition: ID-1: / size: 38G used: 5.2G (15%) fs: ext4 dev: /dev/sda1
|
||||
ID-2: swap-1 size: 2.15GB used: 0.20GB (9%) fs: swap dev: /dev/sda5
|
||||
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
|
||||
Sensors: None detected - is lm-sensors installed and configured?
|
||||
Info: Processes: 198 Uptime: 54 min Memory: 1592.5/1999.8MB Init: systemd runlevel: 5 Gcc sys: 6.2.0
|
||||
Client: Shell (bash 4.3.461) inxi: 2.3.1
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.2daygeek.com/inxi-system-hardware-information-on-linux/2/
|
||||
|
||||
作者:[ MAGESH MARUTHAMUTHU ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.2daygeek.com/author/magesh/
|
||||
[1]:http://smxi.org/docs/inxi.htm
|
122
sources/tech/20170107 Min Browser Muffles the Web Noise.md
Normal file
122
sources/tech/20170107 Min Browser Muffles the Web Noise.md
Normal file
@ -0,0 +1,122 @@
|
||||
Min Browser Muffles the Web's Noise
|
||||
============================================================
|
||||

|
||||
|
||||
[Min][1] is a Web browser with a minimal design that provides speedy operation with simple features.
|
||||
|
||||
When it comes to software design, "minimal" does not mean low functionality or undeveloped potential. If you like minimal distraction tools for your text editor and note-taking applications, that same comfort appeal is evident in the Min browser.
|
||||
|
||||
I mostly use Google Chrome, Chromium and Firefox on my desktops and laptop computers. I am well invested in their add-on functionality, so I can access all the specialty services that get me through my long sessions in researching and working online.
|
||||
|
||||
However, I sometimes prefer a fast, uncluttered alternative on-ramp to the Internet. With multiple projects in progress, I can amass a wide collection of open tabs or even separate windows of the powerhouse browsers in no time.
|
||||
|
||||
I have tried other browser options with little success. The alternatives usually have their own sets of distracting add-ons and features that tend to pull me into more off-task behavior.
|
||||
|
||||
The Min browser does not do that. It is a GitHub-sourced Web browser that is easy to use, and it keeps the typical interruptions from distracting me.
|
||||
|
||||

|
||||
The Min browser is minimal-design Web browser that provides speedy operation with simple features. Just don't expect to take its tour any time soon.
|
||||
|
||||
### What It Does
|
||||
|
||||
The Min browser comes in versions for Debian Linux variants, Windows and Mac machines. It can not compete with the functionality available in the mainstream cross-platform Web browsers.
|
||||
|
||||
It does not have to compete, though. Its claim to fame very well might be supplementing rather than replacing them.
|
||||
|
||||
One big reason for this is its built-in ad blocking capability. Out of the box, the Min browser needs no configuration or hunting for compatible third-party apps to do end-runs around ads.
|
||||
|
||||
In Edit/Preferences, you have three options to click/unclick for content blocking. It's easy to modify blocking tactics to suit your preferences. The Block Trackers and Ads option uses EasyList and EasyPrivacy. If nothing else, keep this option checked.
|
||||
|
||||
You also can block scripts and block images. Doing both maximizes the website loading speeds and really ramps up your protection against rogue code attacks.
|
||||
|
||||
### Have Search Your Way
|
||||
|
||||
If you spend considerable time doing online research, you will adore the way Min handles searching. It is a top-notch feature.
|
||||
|
||||
Search functionality is accessible right in the browser's URL bar. Min utilizes search engine DuckDuckGo and Wikipedia entries. You can enter search queries directly into the Web address field.
|
||||
|
||||
This approach saves time since you do not have to go to the search engine window first. A nice bonus is the ability to search your bookmarks.
|
||||
|
||||
In the Edit/Preferences menu, choose your choice for default search engine. The list includes DuckDuckGo, Google, Bing, Yahoo, Baidu, Wikipedia and Yandex.
|
||||
|
||||
Try making DuckDuckGo your default search engine. Min is built around that option but does not impose it on you.
|
||||
|
||||

|
||||
Min browser's search functionality is part of the URL bar. Min utilizes search engine DuckDuckGo and Wikipedia entries. You can enter search queries directly into the Web address window.
|
||||
|
||||
The search bar displays answers to your questions very rapidly. It uses information from DuckDuckGo including Wikipedia entries, a calculator and more.
|
||||
|
||||
It offers quick snippets, answers and Web suggestions. It sort of substitutes for not being in a Google-based environment.
|
||||
|
||||
### Navigating Aids
|
||||
|
||||
Min lets you jump to any site quickly with fuzzy search. It throws suggestions at you almost immediately.
|
||||
|
||||
I like the way the tabs open next to the current tab. You do not have to set this preference. It is there by default with no other choice, but it makes sense.
|
||||
|
||||
[
|
||||

|
||||
][2]One of Min's really cool operations is the ability to organize tabs into Tasks that you can search anytime. (click image to enlarge)
|
||||
|
||||
Tabs you have not clicked on for a while dim. This lets you concentrate on your current task without distractions.
|
||||
|
||||
Min does not need an add-on tool to keep numerous tabs under control. The browser displays a list of tags and lets you split them into groups.
|
||||
|
||||
### Stay Focused
|
||||
|
||||
Min has an optional Focus Mode hidden in the View menu. When enabled, it hides all tabs except the one you have opened. You must return to the menu to turn off Focus Mode before you can open new tabs.
|
||||
|
||||
The Tasks feature also helps you stay focused. You can create tasks from the File menu or with Control+Shift+N. If you want to open a new tab, you can select that option in the Files menu or use Control+T.
|
||||
|
||||
Call the new task whatever fits your style. I like being able to organize and display as a group all the tabs associated with a work project or a specific portion of my research. I can recall the entire list at any time to easily and quickly find where I was in my browsing adventure.
|
||||
|
||||
Another neat feature is found under the paragraph alignment icon in the tab area. Click it to enable Reading Mode. This mode saves the article for future reference and strips away everything on the page so you can focus on the task of reading.
|
||||
|
||||
### Not Perfect
|
||||
|
||||
The Min browser is not a perfect alternative to high-powered, feature-bloated alternatives. It does have a few glaring weaknesses that developers have taken too long to rectify.
|
||||
|
||||
For instance, It lacks a solid developer website stocked with support forums and detailed user guides. That may be partly due to its home being GitHub rather than an independent developer website. Still, it's a weakness that is glaring to new users.
|
||||
|
||||
Without website support, users are forced to struggle with lists of readme files and hard-to-follow directories on GitHub. You can access them from the Min browser Help menu -- but that's not much help.
|
||||
|
||||
A case in point is the Welcome to Min splash screen that loads from the menu when you launch the browser. It displays two buttons. One says "Start Browsing." The other says "Take a Tour." Neither one works.
|
||||
|
||||
However, you can start browsing by clicking on the menu bar at the top of the Min window. There is no workaround for the missing tour, though.
|
||||
|
||||
### Bottom Line
|
||||
|
||||
Min is not a full-featured Web browser with bells and whistles galore. It is not designed for add-ons and many other features you typically use in well-established Web browsers. However, Min serves an important niche purpose by offering speed and distraction-free browsing.
|
||||
|
||||
The more I use the Min browser, the more productive it is for me -- but be wary when you first start to use it.
|
||||
|
||||
Min is not complicated or confusing -- it is just quirky. You have to play around with it to discover how it works.
|
||||
|
||||
### Want to Suggest a Review?
|
||||
|
||||
Is there a Linux software application or distro you'd like to suggest for review? Something you love or would like to get to know?
|
||||
|
||||
Please [email your ideas to me][3], and I'll consider them for a future Linux Picks and Pans column.
|
||||
|
||||
And use the Reader Comments feature below to provide your input!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||
Jack M. Germain has been writing about computer technology since the early days of the Apple II and the PC. He still has his original IBM PC-Jr and a few other legacy DOS and Windows boxes. He left shareware programs behind for the open source world of the Linux desktop. He runs several versions of Windows and Linux OSes and often cannot decide whether to grab his tablet, netbook or Android smartphone instead of using his desktop or laptop gear. You can connect with him on Google+.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxinsider.com/story/84212.html?rss=1
|
||||
|
||||
作者:[Jack M. Germain][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxinsider.com/story/84212.html?rss=1#searchbyline
|
||||
[1]:https://github.com/minbrowser/min/releases/
|
||||
[2]:http://www.linuxinsider.com/article_images/2017/84212_1200x750.jpg
|
||||
[3]:mailto:jack.germain@newsroom.ectnews.com
|
@ -0,0 +1,88 @@
|
||||
translating---geekpi
|
||||
|
||||
4 open source alternatives to Trello that you can self-host
|
||||
============================================================
|
||||
|
||||
Trello is a visual team collaboration platform that was recently acquired by Atlassian. And by that, I mean as _recently_ as today Monday, January 9 2017.
|
||||
|
||||
I’ve been using Trello as a board member of DigitalOcean’s community authors and started using it to manage a small team project for a non-profit organization a couple of days ago. It’s a nice piece of software that any team, including those with non-geeky members, can use comfortable.
|
||||
|
||||
If you like [Trello][6], but now want a similar software that you can self-host, or run on your own server, I’ve found four that you can choose from. Keep in mind that I’ve not installed any of these on my own server, but from the information I’ve gathered about them, the ones I’m most likely to use are Kanboard and Restyaboard.
|
||||
|
||||
And that’s because their installation requirements are familiar.. Their installation process are also relatively simpler. Restyaboard seems to have a more polished UI, so it will probably be my first option, though one of it’s requirements (Elasticsearch) makes me think that the server requirements will be more than for others. In any case, I’ll be posting my attempt to self-host both Kanboard and Restyaboard soon, so check back often.
|
||||
|
||||
Until then, the top four alternatives for Trello that I’ve found, are:
|
||||
|
||||
### Kanboard
|
||||
|
||||
Aside form the fact that it is free and open source, Kanban features integrations with third party tools and services like Amazon S3 Storage, Hipchat, Jabber, RabbitMQ, Slack, and many more. Kanboard can be installed on a Microsoft operating system, but for installation on free and open source components, you’ll need the following:
|
||||
|
||||
* PHP >= 5.3.9
|
||||
* MariaDB/MySQL, Postgres, or Sqlite
|
||||
* Apache or Nginx
|
||||
* CentOS 6/7, Debian 8, FreeBSD 10, or Ubuntu 14.04/16.04
|
||||
|
||||
[Related Post: Five Reasons to Switch to Software for Load Balancing][7]
|
||||
|
||||
From just a very cursory assessment of the project, the UI seems to be less polished than that of others mentioned in this article. And in the event that you change your mind about self-hosting, there’s a managed, or hosted Kanboard that you can register for. The project’s GitHub page is available at [https://github.com/kanboard/kanboard][8]
|
||||
|
||||

|
||||
|
||||
### Restyaboard
|
||||
|
||||
With a polished UI and ability to import data from Trello, Restyaboard is a very attractive Trello alternative. And the installation requirements seem modest; you’ll need the following to install Restyaboard on your server:
|
||||
|
||||
* PHP-FPM
|
||||
* Postgres
|
||||
* Nginx
|
||||
* Elasticsearch
|
||||
|
||||
Even with those few requirements, installation is made even simpler with a script that will auto-install all you need on your server. Also there’s an AMI for installation on Amazon AWS. For Docker fans, there’s an unofficial Docker image you can use to run Restyaboard containers. I don’t encourage running Docker containers using unofficial Docker images, but it’s an option if you wish to go that route. Details at the project’s [GitHub page][9].
|
||||
|
||||

|
||||
|
||||
### Taiga
|
||||
|
||||
A Taiga deployment is made up of three components – taiga-back (backend/api), taiga-front-dist (frontend), taiga-events – each with its own requirements. In general, you need the following to install Taiga on your server:
|
||||
|
||||
[Related Post: Dual-boot Fedora 25, Windows 10 on a computer with UEFI firmware][10]* Python >= 3.4* PostgreSQL >= 9.3* RabbitMQ (optional as long as you don’t want async notifications)* gcc and development headers* Ruby >= 2.1 (only for compiling sass)* NodeJS >= 5.0 (with npm, gulp and bower for downloading dependencies and compiling coffeescript)
|
||||
|
||||
The installation requirements seem to be a bit more involved than the others, so if that’s going to be an issue for you, there’s an hosted platform that’s free to use. Extra features on that hosted platform are fee-based. Visit the project’s [GitHub page][1] for details.
|
||||
|
||||

|
||||
|
||||
### Wekan
|
||||
|
||||
Wekan is built with Meteor, a JavaScript framework for building web applications, and is hosted at [https://github.com/wekan/wekan][2]. The project offers a 1-click installation on Heroku, Sandstorm, and verified Docker images for running it on Docker containers. It can also be installed on Scalingo, IndieHosters and Cloudron, but I couldn’t find installation instructions for deploying it on other Cloud hosting providers like [Vultr][3]and [DigitalOcean][4].
|
||||
|
||||
So it seems that your best bet, and the easiest route to installing Wekan, is to use one of the supported Cloud hosting platforms.
|
||||
|
||||

|
||||
|
||||
As promised, check back soon for the publication of my guide on how to install Kanboard and Restyaboard on your server.
|
||||
|
||||
### UPDATE
|
||||
|
||||
Just after publishing this article, I came across [Tuleap][5]. It seems to be very polished, but a production installation is supported only on CentOS 6 and Red Hat 6\. Containerized installation using Docker is supported, but not recommended for production.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linuxbsdos.com/2017/01/09/4-open-source-alternatives-to-trello-that-you-can-self-host/
|
||||
|
||||
作者:[linuxbsdos.com][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linuxbsdos.com
|
||||
[1]:https://github.com/taigaio/
|
||||
[2]:https://github.com/wekan/wekan
|
||||
[3]:http://www.vultr.com/?ref=6827794
|
||||
[4]:https://www.digitalocean.com/?refcode=900fe177d075
|
||||
[5]:https://www.tuleap.org/
|
||||
[6]:https://trello.com/
|
||||
[7]:http://linuxbsdos.com/2016/07/11/five-reasons-to-switch-to-software-for-load-balancing/
|
||||
[8]:https://github.com/kanboard/kanboard
|
||||
[9]:https://github.com/RestyaPlatform/board
|
||||
[10]:http://linuxbsdos.com/2016/12/01/dual-boot-fedora-25-windows-10-on-a-computer-with-uefi-firmware/
|
@ -0,0 +1,150 @@
|
||||
How to record a region of your desktop as animated GIF on Linux
|
||||
============================================================
|
||||
|
||||
### On this page
|
||||
|
||||
1. [Gifine][1]
|
||||
2. [Gifine Download/Installation/Setup][2]
|
||||
3. [Gifine Usage][3]
|
||||
4. [Conclusion][4]
|
||||
|
||||
It won't be a stretch to say - and you'll likely agree - that animated gifs have become a rage in the past few years. While one of the most popular uses of animated gifs is to add humor to the text-based conversation that people usually have online, there are many other areas where these animations prove to be really useful.
|
||||
|
||||
Those in technical spheres usually use animated gifs to quickly describe how a problem or an error gets triggered. It's also a useful way of explaining how a particular feature in a software application works. You can easily use gifs in online forums, your company presentations, and more.
|
||||
|
||||
Now, suppose you have various applications opened on your Linux desktop, and for whatever purpose, you want to create an animated gif out of your activity with a particular application that's occupying only a small area of your desktop. What would you do? Obviously, look for a tool that lets you do the same.
|
||||
|
||||
If you've been looking for one such tool that lets you record a particular region of you desktop and then automatically convert the recording into an animated gif, then look no further, as in this tutorial, we will discuss a Linux command line utility that lets you do just that.
|
||||
|
||||
Before we proceed, keep in mind that all the examples in this tutorial have been tested on Ubuntu 14.04 with Bash version 4.3.11(1).
|
||||
|
||||
### Gifine
|
||||
|
||||
The tool in question is [Gifine][5]. It is is basically a GTK application implemented in MoonScript using lgi. Gifine not only lets you record your desktop screen and create animated gifs or video, but also lets you stitch together short gifs or videos.
|
||||
|
||||
According to the application's developer: "You can either load a directory of frames, or select a region of your desktop to record. After loading some frames, you can scroll through them and trim out what isn't necessary. When you've finalized the video you can export to gif or mp4.".
|
||||
|
||||
### Gifine Download/Installation/Setup
|
||||
|
||||
Before we go ahead and tell you the steps to download and install Gifine, it's worth mentioning that the tool has several dependencies that you need to install before installing the tool itself.
|
||||
|
||||
The first dependency that you need to install is FFmpeg, which is basically a cross-platform solution to record, convert and stream audio and video. Following is the command that should install the tool:
|
||||
|
||||
```
|
||||
sudo apt-get install ffmpeg
|
||||
```
|
||||
|
||||
Next up is GraphicsMagick, which is basically an image processing system. "It provides a robust and efficient collection of tools and libraries which support reading, writing, and manipulating an image in over 88 major formats including important formats like DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF," the tool's official website says.
|
||||
|
||||
Following is the command to download and install it:
|
||||
|
||||
```
|
||||
sudo apt-get install graphicsmagick
|
||||
```
|
||||
|
||||
Next up is a tool dubbed XrectSel. It's basically an application that tells you the geometry of a rectangular screen region which you have selected by dragging the mouse/pointer. The only way to install XrectSel is from source, which you can download by heading [here][6].
|
||||
|
||||
Once you've downloaded theXrectSel source code on your system, the next step is extract the downloaded archive and enter the top-level directory on a command line terminal. Once there, run the following commands:
|
||||
|
||||
```
|
||||
./bootstrap
|
||||
```
|
||||
|
||||
The above command is required if ./configure is not present
|
||||
|
||||
```
|
||||
./configure --prefix /usr
|
||||
|
||||
make
|
||||
|
||||
make DESTDIR="$directory" install
|
||||
```
|
||||
|
||||
Moving on, the last dependency is Gifsicle. It's a command-line tool for creating, editing, and getting information about GIF images and animations. Downloading and installing Gifsicle is quite easy - all you need to do is to run the following command:
|
||||
|
||||
```
|
||||
sudo apt-get install gifsicle
|
||||
```
|
||||
|
||||
So that was all about the dependencies. Now, let us come to the installation of Gifine. The following two commands will do the needful:
|
||||
|
||||
```
|
||||
sudo apt-get install luarocks
|
||||
|
||||
sudo luarocks install --server=http://luarocks.org/dev gifine
|
||||
```
|
||||
|
||||
Please note that the second command above may give you the following error:
|
||||
|
||||
```
|
||||
No package 'gobject-introspection-1.0' found
|
||||
```
|
||||
|
||||
In that case, you need to install the package using the following command:
|
||||
|
||||
```
|
||||
sudo apt-get install libgirepository1.0-dev
|
||||
```
|
||||
|
||||
And then run the 'luarocks install' command again.
|
||||
|
||||
### Gifine Usage
|
||||
|
||||
Once you're done with the installation part, you can launch the tool using the following command:
|
||||
|
||||
```
|
||||
gifine
|
||||
```
|
||||
|
||||
The application's UI looks like this:
|
||||
|
||||
[
|
||||

|
||||
][7]
|
||||
|
||||
So you have a couple of options here: record frames and load frames. If you click the Record rectangle button, then your mouse pointer gets converted into a +, allowing you to select a rectangular area on your screen. As soon as you are done selecting an area, the recording begins, and the 'Record rectangle' button is replaced by a 'Stop recording' button.
|
||||
|
||||
[
|
||||

|
||||
][8]
|
||||
|
||||
As soon as you are done with the recording, click the 'Stop recording' button and you'll see that the Gifine window shows several buttons.
|
||||
|
||||
[
|
||||

|
||||
][9]
|
||||
|
||||
The upper part of the UI contains the recording, which you can see frame by frame using the slider below it. Suppose you want to delete all the frames before frame 5 or after frame 50, then this can be done using the Trim left of and Trim right of buttons. Then there are also buttons to delete a particular frame, half the number of frames, as well as reset any frame cuts that you've made.
|
||||
|
||||
Once you are done with all the editing part, use the Save GIF... or Save MP4... buttons to save the recording as an animated gif or a video. There are options to set frame delay, frame rate, and number of loops as well.
|
||||
|
||||
Please keep in mind that "the recorded frames recorded aren't automatically cleaned up. You can find them in your `/tmp` dir if you want to reload a session. Use the load directory button on the initial screen.".
|
||||
|
||||
### Conclusion
|
||||
|
||||
There's not much of a learning curve associated with Gifine - all the features are available in the form of buttons, and the text on them makes their functionality self explanatory.
|
||||
|
||||
The only issue for me was the installation part - installing so many dependencies one by one and then dealing with errors that may pop up could be a big no no for many. But otherwise, on the whole, Gifine is a nice tool that does what it promises, and if that's what you were looking for, do give it a try.
|
||||
|
||||
Already a Gifine user? How has your experience been so far? Let us known in comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/
|
||||
|
||||
作者:[Ansh][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/
|
||||
[1]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine
|
||||
[2]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine-downloadinstallationsetup
|
||||
[3]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine-usage
|
||||
[4]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#conclusion
|
||||
[5]:https://github.com/leafo/gifine
|
||||
[6]:https://github.com/lolilolicon/xrectsel
|
||||
[7]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-ui.png
|
||||
[8]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-stop-rec.png
|
||||
[9]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-post-rec.png
|
@ -0,0 +1,77 @@
|
||||
Open technology for land rights documentation
|
||||
============================================================
|
||||
|
||||
### One-third of people on the planet don't have documented rights to the land on which they rely.
|
||||
|
||||
[up][3]
|
||||

|
||||
Image by :
|
||||
|
||||
[Pixabay][4]. Modified by Opensource.com. [CC BY-SA 4.0][5]
|
||||
|
||||
The [Cadasta Foundation][6] creates tech to allow communities to document their land rights. By helping groups document the evidence of their individual and community rights to the land on which they depend, they can eventually obtain legal recognition of their land rights, and in the meantime, enjoy greater security.
|
||||
|
||||
We are motivated by the fact that most of the world does not have documented legal rights to the land on which they live. Technology is only a small part of this larger social issue, but our hope is that tech tools can be part of the solution even in the most remote and low-tech environments.
|
||||
|
||||
### The magnitude of property rights
|
||||
|
||||
Many of us who come from the global north probably take our rights to our land, property, and home for granted. We have titles, deeds, and rental agreements that document and solidly protect our rights.
|
||||
|
||||
But one-third of the people on the planet, from urban shanty towns to forest-dwelling indigenous communities, do not have documented rights to the land on which they rely. In fact, an estimated 70% of the property in emerging economies is undocumented. An estimated 25% of the world’s urban population live in homes to which they have no legal right. A majority of smallholder farmers around the world farm without the protection of having legal rights to their land documented by government records.
|
||||
|
||||
This is simply because government land and property records in many areas of the world either were never created or are out of date. For example, most rural land records in the state of Telangana, India haven't been updated since the 1940s. In other areas, such as parts of sub-Saharan Africa, there were never any records of land ownership to begin with—people simply farm the land their parents farmed, generation after generation.
|
||||
|
||||
Consider for a moment working land to which you have no secure rights. Would you invest your savings or labor in improving the land, including applying good quality seeds and fertilizer, with the knowledge that you could be displaced any day by a more powerful neighbor or investor? Imagine living in a home that could be bulldozed or usurped by an official any day. Or how could you sell your house, or use it for collateral for a loan, if you don’t have any proof that you own it?
|
||||
|
||||
For a majority of the world's population, these are not rhetorical questions. These are daily realities.
|
||||
|
||||
### How open source matters for land
|
||||
|
||||
Technology is only one part of the solution, but at Cadasta we believe it is a key component. While many governments had modern technology systems put in place to manage land records, often these were expensive to maintain, required highly trained staff, were not transparent, and were otherwise too complicated. Many of these systems, created at great expense by donor governments, are already outdated and no longer accurately reflect existing land and property rights.
|
||||
|
||||
By building open and user-friendly technology for land rights documentation we aim to overcome these problems and create land documentation systems that are flexible and accessible, allowing them to be treated as living documents that are updated continually.
|
||||
|
||||
We routinely train people who have never even used a smartphone before to use our technology to document their land rights in a single afternoon. The resulting data, hosted on an open source platform, is easy to access, update, and analyze. This flexibility means that governments in developing countries, should they adopt our platform, don't need to hire specially trained staff to manage the upkeep of these records.
|
||||
|
||||
We also believe that by contributing to and fostering open communities we can benefit more people, instead of attempting to develop all the technology ourselves. We do this by building a community around our tools as well as contributing to other existing software.
|
||||
|
||||
Over the past two years we've contributed and been involved in [OpenStreetMap][7]through the [Missing Maps Projec][8]t, used [OpenDataKit][9] extensively for data collection, and currently are integrating [Field Papers][10] with our system. Field Papers is technology that allows users to print paper maps, annotate those maps with pen, and then take a picture of those annotations with their phone and upload them to be transcribed.
|
||||
|
||||
We've also released a few Django libraries we hope will be useful to others in other Django applications. These include a policy-based permission system called [django-tutelary][11] and [django-jsonattrs][12], which provides JavaScript Object Notification (JSON)-based attribute management for PostgresSQL. If others use these pieces and contribute bug reports and patches, this can help make Cadasta's work stronger.
|
||||
|
||||
This work is critically important. Land rights are the foundation of stability and prosperity. Communities and countries seeking economic growth and sustainable development must document land rights and ensure land rights are secure for women, men, and communities.
|
||||
|
||||
_Learn more in Kate Chapman's talk at linux.conf.au 2017 ([#lca2017][1]) in Hobart: [Land Matters: Creating Open Technology for Land Rights][2]._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Kate Chapman - Kate Chapman is Chief Technology Officer of the Cadasta Foundation, leading the organization’s technology team and strategy. Cadasta develops free and open source software to help communities document their land rights around the world. Chapman is recognized as a leader in the domains of open source geospatial technology and community mapping, and an advocate for open imagery as a public good.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
via: https://opensource.com/article/17/1/land-rights-documentation-Cadasta
|
||||
|
||||
作者:[Kate Chapman][a]
|
||||
译者:[译者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/wonderchook
|
||||
[1]:https://twitter.com/search?q=%23lca2017&src=typd
|
||||
[2]:https://linux.conf.au/schedule/presentation/50/
|
||||
[3]:https://opensource.com/article/17/1/land-rights-documentation-Cadasta?rate=E8gJkvb1mbBXytsZiKA_ZtBCOvpi41nDSfz4R8tNnoc
|
||||
[4]:https://pixabay.com/en/tree-field-cornfield-nature-247122/
|
||||
[5]:https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]:http://cadasta.org/
|
||||
[7]:http://www.openstreetmap.org/
|
||||
[8]:http://www.missingmaps.org/
|
||||
[9]:https://opendatakit.org/
|
||||
[10]:http://fieldpapers.org/
|
||||
[11]:https://github.com/Cadasta/django-tutelary
|
||||
[12]:https://github.com/Cadasta/django-jsonattrs
|
@ -0,0 +1,72 @@
|
||||
Vic020
|
||||
|
||||
Troubleshooting tips for the 5 most common Linux issues
|
||||
============================================================
|
||||
|
||||
### Learn how to tackle the most common challenges Linux desktop users encounter.
|
||||
|
||||

|
||||
Image by :
|
||||
|
||||
Opensource.com
|
||||
|
||||
Although Linux installs and operates as expected for most users, inevitably some users will run into problems. For my final article in The Queue column for the year, I thought it would be interesting to summarize the most common technical Linux issues people ran into in 2016\. I posted the question to LinuxQuestions.org and on social media, and I analyzed LQ posting patterns. Here are the results.
|
||||
|
||||
### 1\. Wifi drivers (especially Broadcom chips)
|
||||
|
||||
Generally speaking, wifi drivers—and Broadcom cards in particular—continue to be one of the most problematic technical issues facing Linux. There were hundreds of posts about this topic on LQ alone in 2016, and myriad more elsewhere. Dozens of Broadcom wireless cards are available, and detailed instructions for getting them to work with each distribution is far too involved for a single article, but the basic troubleshooting steps are the same:
|
||||
|
||||
* ascertain exactly which Broadcom card you have by using _lspci_ to find out the PCI ID,
|
||||
* determine whether the distribution you use supports that card,
|
||||
* and if it does, identify the proper way to get the card working.
|
||||
|
||||
For example, if you have a 14e4:4315 PCI ID and are using Ubuntu, then you know the BCM4312 card is supported by installing the _firmware-b43-installer_package. The other option you have is to research the wifi card before your purchase to ensure it's fully supported by your distribution of choice out of the box.
|
||||
|
||||
### 2\. Printer drivers (especially Canon and Lexmark)
|
||||
|
||||
Printers also continue to be problematic, with Canon and Lexmark repeatedly cited for being an issue. If you're purchasing a new printer, research compatibility before you buy. But if you are migrating from another operating system, that may not be an option. If you are doing research, the [OpenPrinting][1] database and the official support channel for your distribution are the two best places to start. Note that you should ensure all functionality of a device is fully compatible, especially if it's a multifunction product. One common complaint with Canon printers is that the drivers are often only available on non-English and sometimes obscure sites.
|
||||
|
||||
>If you're purchasing a new printer, research compatibility before you buy.
|
||||
|
||||
### 3\. Video
|
||||
|
||||
Video is a nuanced topic, as simple straightforward video works extremely well out of the box on Linux. Where the issues pop up are video accelerators/acceleration; the latest video cards and newest technologies, such as NVIDIA Optimus and ATI dynamic GPU switching; installation and stability of proprietary drivers; efficient power management; and reliable suspend and resume. If you're not a gamer, do not need high-end graphics for another reason, and are not on a laptop, then you probably don't have to worry about this. If you're looking for a new laptop, be sure to research compatibility before your purchase. If you're a gamer or need the highest-end graphics, you'll need to know exactly what your requirements are and start your research there. Luckily, the situation here is improving and, Wayland teething issues aside, the situation should be quite a bit better in 2017.
|
||||
|
||||
### 4\. Audio
|
||||
|
||||
Once again, for simple setups, audio has been easy to configure and reliable under Linux for a while. As soon as you get into professional production, echo cancellation, audio routing, unified mixing, and other complex setups, however, it can go south pretty quickly. My suggestion is to use one of the dedicated audio-related distributions if you need high-end real-time audio.
|
||||
|
||||
### 5\. Installation
|
||||
|
||||
With a category this all-encompassing, it's almost guaranteed to be high volume. That said, I don't know that it's fair to say Linux has wide-spread installation issues. The vast majority of installs go as expected. The sheer variety of hardware that Linux supports, and nearly infinite combinations of hardware on which Linux installs are attempted, inevitably lead to edge cases here and there. Keep in mind that end users rarely install other operating systems, such as Mac OS and Windows, as they come pre-installed on new devices.
|
||||
|
||||
>The vast majority of installs go as expected.
|
||||
|
||||
### Future looks bright
|
||||
|
||||
Other issues that were mentioned frequently include Bluetooth, suspend/resume, HiDPI, and touchscreens. You may see a pattern forming here—most of the issues noted in this article focus on desktop use cases. When you think about it, that makes sense. With Linux desktop adoption being relatively low, the result is that less testing and resources go into finding and fixing related issues. As desktop usage increases, you can anticipate these areas improving.
|
||||
|
||||
On that note, I thought it would be nice to end with a mention of one area that used to pop up frequently as a problem area for Linux, and very rarely does these days: fonts. Only a few short years ago, getting high-quality antialiased fonts were the exception. With modern distribution releases, it has become the rule.
|
||||
|
||||
What technical Linux issues did you find most common in 2016? Let me know about them in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Jeremy Garcia - Jeremy Garcia is the founder of LinuxQuestions.org and an ardent but realistic open source advocate. Follow Jeremy on Twitter: @linuxquestions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/yearbook-linux-troubleshooting-tips
|
||||
|
||||
作者:[Jeremy Garcia][a]
|
||||
译者:[译者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/jeremy-garcia
|
||||
[1]:http://www.openprinting.org/printers
|
@ -0,0 +1,69 @@
|
||||
Why we need an open model to design and evaluate public policy
|
||||
============================================================
|
||||
|
||||
### Imagine an app that allows citizens to test drive proposed policies.
|
||||
|
||||
[up][3]
|
||||

|
||||
Image by :
|
||||
|
||||
opensource.com
|
||||
|
||||
In the months leading up to political elections, public debate intensifies and citizens are exposed to a proliferation of information around policy options. In a data-driven society where new insights have been informing decision-making, a deeper understanding of this information has never been more important, yet the public still hasn't realized the full potential of public policy modeling.
|
||||
|
||||
At a time where the concept of "open government" is constantly evolving to keep pace with new technological advances, government policy models and analysis could be the new generation of open knowledge.
|
||||
|
||||
Government Open Source Models (GOSMs) refer to the idea that government-developed models, whose purpose is to design and evaluate policy, are freely available to everyone to use, distribute, and modify without restrictions. The community could potentially improve the quality, reliability, and accuracy of policy modeling, creating new data-driven apps that benefit the public.
|
||||
|
||||
Today's generation interacts with technology like it's second nature, absorbing vast amounts of information tacitly. What if we could interact with different public policies in a virtual, immersive environment using a GOSM?
|
||||
|
||||
Imagine an app that allows citizens to test drive proposed policies to determine the future in which they want to live. They would instinctively learn the key drivers and what to expect. Before long the public would have a deeper understanding of public policy impacts and become more savvy at navigating the controversial terrains of public debate.
|
||||
|
||||
Why haven't we had greater access to these models before? The reason lies behind the veils of public policy modeling.
|
||||
|
||||
In a society as complex as the one we live in, quantifying policy impacts is a difficult task and has been described as a "fine-art." Moreover, most government policy models are based on administrative and other privately held data. Nevertheless, policy analysts valiantly go about their quest with the aim of guiding policy design, and many a political battle has been won with a quantitative call to arms.
|
||||
|
||||
Numbers are powerful. They build credibility and are often used as a rationale for introducing new policies. The development of public policy models lends power to both politicians and bureaucrats, who may be reluctant to disrupt the status quo. Giving that up may not be easy, but GOSMs provide an opportunity for unprecedented public policy reform.
|
||||
|
||||
GOSMs level the playing field for everyone: politicians, the media, lobby groups, stakeholders, and the general public. By opening the doors of policy evaluation to the community, governments can tap into new and undiscovered capabilities for creativity, innovation, and efficiency within the public sphere. But what are the practical implications for the strategic interactions between stakeholders and governments in public policy design?
|
||||
|
||||
GOSMs are unique because they are primarily a tool for designing public policy and do not necessarily require re-distribution for private gains. Stakeholders and lobby groups could potentially employ GOSMs along with their own privately held information to gain new insights into the workings of the policy environment in which they are economic players for private benefit.
|
||||
|
||||
Could GOSMs become a weapon where stakeholders hold the balance of power in public debate and strategize for optimal benefit?
|
||||
|
||||
Being a modifiable public good, GOSMs are, in notion, funded by the taxpayer and attributed to the state. Would it be ethically appropriate for private entities to gain from GOSMs without passing on the benefits to society? Unlike apps that may be used for more efficient service provision, alternate policy proposals are more likely to be used by consultancies and contribute to public debate.
|
||||
|
||||
The open source community has frequently used the "copyleft license" to ensure that code and any derivative works under this license remains open to everyone. This works well when the product of value is the code itself, which requires re-distribution for maximum benefit. However, what if the code or GOSM redistribution is incidental to the main product, which may be new strategic insights into the existing policy environment?
|
||||
|
||||
At a time when privately collected data is becoming prolific, the real value behind GOSMs may be the underlying data, which could be used to refine the models themselves. Ultimately, government is the only consumer with the authority to implement policy, and stakeholders may choose to share their modified GOSMs in negotiations.
|
||||
|
||||
The big challenge government has when publicly releasing policy models is increasing transparency while protecting privacy. Ideally, releasing GOSMs would require securing closed data in a way that preserves the key features of the modeling.
|
||||
|
||||
Publicly releasing GOSMs empower citizens by promoting a greater understanding and participation into our democracy, which would lead to improved policy outcomes and greater public satisfaction. In an open government utopia, open public policy development will be a collaborative effort between government and the community, where knowledge, data, and analysis are freely available to everyone.
|
||||
|
||||
_Learn more in Audrey Lobo-Pulo's talk at linux.conf.au 2017 ([#lca2017][1]) in Hobart: [Publicly Releasing Government Models][2]._
|
||||
|
||||
_Disclaimer: The views presented in this article belong to Audrey Lobo-Pulo and are not necessarily those of the Australian Government._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Audrey Lobo-Pulo - Dr. Audrey Lobo-Pulo is a co-founder of Phoensight and is an advocate for open government and open source software in government modelling. A physicist, she moved to working in economic policy modelling after joining the Australian Public Service. Audrey has been involved in modelling a wide range of economic policy options and is currently interested in government open data and open policy modelling. Audrey's vision for government is to bring data science to public policy analytics.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/government-open-source-models
|
||||
|
||||
作者:[Audrey Lobo-Pulo ][a]
|
||||
译者:[译者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/audrey-lobo-pulo
|
||||
[1]:https://twitter.com/search?q=%23lca2017&src=typd
|
||||
[2]:https://linux.conf.au/schedule/presentation/31/
|
||||
[3]:https://opensource.com/article/17/1/government-open-source-models?rate=p9P_dJ3xMrvye9a6xiz6K_Hc8pdKmRvMypzCNgYthA0
|
@ -0,0 +1,72 @@
|
||||
Explore climate data with open source tools
|
||||
============================================================[up][1]
|
||||

|
||||
Image credits :
|
||||
|
||||
[Flickr user: theaucitron][2] (CC BY-SA 2.0)
|
||||
|
||||
You can't look anywhere these days without seeing evidence of the changing weather patterns on the earth. Monthly, we are confronted with facts and figures that point to a warming planet.
|
||||
|
||||
Climate scientists warn us that inaction could be fatal to our futures here. Military strategists at the Pentagon have [recently cautioned][3] President-Elect Trump that inaction on climate change could spell disaster for our national security as shrinking water supplies and meager rainfall cause crop failures will force large numbers of people to migrate to other parts of the world that can sustain them.
|
||||
|
||||
With all of the research on our climate by NASA, the US Defense Department, and others, I was curious if there are open source tools that would allow interested citizens to explore climate data and draw our own conclusions. A quick search of the Internet led me to the [Open Climate Workbench][4], a project that is part of the [Apache Software Foundation][5].
|
||||
|
||||
The Open Climate Workbench (OCW) develops software that performs climate model evaluation on data that comes from the [Earth System Grid Federation][6], [Coordinated Regional Climate Downscaling Environment][7], the U.S. Global Change Research Program's [National Climate Assessment][8], the[ North American Regional Climate Assessment Program][9], and from NASA, NOAA, and others.
|
||||
|
||||
You can download the OCW's [tar ball][10] and install it on your Linux computer by following the [prerequisites][11]. You can also install the OCW in a virtual machine using Vagrant and a provider like VirtualBox. [Get the instructions][12] for an OCW virtual machine.
|
||||
|
||||
I found the easiest way to see how the OCW works is to download a [virtual machine image][13] from the Regional Climate Model Evaluation System (RCMES).
|
||||
|
||||
According to its website, the RCMES "is designed to facilitate regional-scale evaluations of climate and Earth system models by providing standardized access to a vast and comprehensive set of observations (e.g., satellite, reanalyzes and in-situ) and modeling resources (e.g., [CMIP][14] & [CORDEX][15] on the [ESGF][16]), as well as tools for performing common analysis and visualization tasks (e.g., OCW)."
|
||||
|
||||
You will need to have VirtualBox and Vagrant installed on your host computer. With it you can see an excellent example of the OCW in operation. The RCMES provides [detailed instructions][17] for downloading, importing, and running the virtual machine. Once your virtual machine is up and running you can log into it with the following credentials.
|
||||
|
||||
**Username:vagrant, password:vagrant. **
|
||||
|
||||

|
||||
|
||||
RCMES data plot sample
|
||||
|
||||
[Tutorials][18] for the RCMES are available on their website to help you quickly become familiar with the software. The community [is active][19] and they are looking for more [developers][20]. You can [subscribe to their mailing lists][21], too.
|
||||
|
||||
[Source code][22] for the project is on GitHub and licensed under the Apache License, Version 2.0.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||

|
||||
|
||||
Don Watkins - Educator, education technology specialist, entrepreneur, open source advocate. M.A. in Educational Psychology, MSED in Educational Leadership, Linux system administrator, CCNA, virtualization using Virtual Box and VMware. Follow me at @Don_Watkins .
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/apache-open-climate-workbench
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/don-watkins
|
||||
[1]:https://opensource.com/article/17/1/apache-open-climate-workbench?rate=Hv4_T-1gbcRNsiP9jnevzP1OTNKHIyQLXwqdjnBy2Bs
|
||||
[2]:https://www.flickr.com/photos/theaucitron/5810163712/in/photolist-5p9nh3-6EkSKG-6EgGEF-9hYBcr-abCSpq-9zbjDz-4PVqwm-9RqBfq-abA2T4-4nXfwv-9RQkdN-dmjSdA-84o2ER-abA2Wp-ehyhPC-7oFYrc-4nvqBz-csMQXb-nRegFf-ntS23C-nXRyaB-6Xw3Mq-cRMaCq-b6wkkP-7u8sVQ-yqcg-6fTmk7-bzm3vU-6Xw3vL-6EkzCQ-d3W8PG-5MoveP-oMWsyY-jtMME6-XEMwS-2SeRXT-d2hjzJ-p2ZZVZ-7oFYoX-84r6Mo-cCizvm-gnnsg5-77YfPx-iDjqK-8gszbW-6MUZEZ-dhtwtk-gmpTob-6TBJ8p-mWQaAC/
|
||||
[3]:https://www.scientificamerican.com/article/military-leaders-urge-trump-to-see-climate-as-a-security-threat/
|
||||
[4]:https://climate.apache.org/
|
||||
[5]:https://www.apache.org/
|
||||
[6]:http://esgf.llnl.gov/
|
||||
[7]:http://www.cordex.org/
|
||||
[8]:http://nca2014.globalchange.gov/
|
||||
[9]:http://www.narccap.ucar.edu/
|
||||
[10]:http://climate.apache.org/downloads.html
|
||||
[11]:http://climate.apache.org/downloads.html#prerequsites
|
||||
[12]:https://cwiki.apache.org/confluence/display/CLIMATE/OCW+VM+-+A+Self+Contained+OCW+Environment
|
||||
[13]:https://rcmes.jpl.nasa.gov/RCMES_Turtorial_data/RCMES_June09-2016.ova
|
||||
[14]:http://cmip-pcmdi.llnl.gov/
|
||||
[15]:http://www.cordex.org/
|
||||
[16]:http://esgf.org/
|
||||
[17]:https://rcmes.jpl.nasa.gov/content/running-rcmes-virtual-machine
|
||||
[18]:https://rcmes.jpl.nasa.gov/content/tutorials-overview
|
||||
[19]:http://climate.apache.org/community/get-involved.html
|
||||
[20]:https://cwiki.apache.org/confluence/display/CLIMATE/Developer+Getting+Started+Guide
|
||||
[21]:http://climate.apache.org/community/mailing-lists.html
|
||||
[22]:https://github.com/apache/climate
|
@ -0,0 +1,452 @@
|
||||
# rusking translating
|
||||
|
||||
Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5
|
||||
============================================================
|
||||
|
||||
This tutorial will show you how to add a second Samba4 domain controller, provisioned on Ubuntu 16.04 server, to the existing Samba AD DC forest in order to provide a degree of load balancing/failover for some crucial AD DC services, especially for services such as DNS and AD DC LDAP schema with SAM database.
|
||||
|
||||
#### Requirements
|
||||
|
||||
1. [Create an Active Directory Infrastructure with Samba4 on Ubuntu – Part 1][1]
|
||||
|
||||
This article is a Part-5 of Samba4 AD DC series as follows:
|
||||
|
||||
Part 2: [Manage Samba4 AD Infrastructure from Linux Command Line][2]Part 3: [Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT][3]Part 4: [Manage Samba4 AD Domain Controller DNS and Group Policy from Windows][4]
|
||||
|
||||
### Step 1: Initial Configuration for Samba4 Setup
|
||||
|
||||
1. Before you start to actually perform domain joining for the second DC, you need to take care of few initial settings. First, make sure the hostname of the system which will be integrated into Samba4 AD DC contains a descriptive name.
|
||||
|
||||
Assuming that the hostname of the first provisioned realm is called `adc1`, you can name the second DC with `adc2` in order to provide a consistent naming scheme across your Domain Controllers.
|
||||
|
||||
To change the system hostname you can issue the below command.
|
||||
|
||||
```
|
||||
# hostnamectl set-hostname adc2
|
||||
```
|
||||
|
||||
else you can manually edit /etc/hostname file and add a new line with the desired name.
|
||||
|
||||
```
|
||||
# nano /etc/hostname
|
||||
```
|
||||
|
||||
Here add the hostname.
|
||||
|
||||
```
|
||||
adc2
|
||||
```
|
||||
|
||||
2. Next, open local system resolution file and add an entry with the IP address witch points to the short name and FQDN of the main domain controller, as illustrated in the below screenshot.
|
||||
|
||||
Through this tutorial, the primary DC name is `adc1.tecmint.lan` and it resolves to 192.168.1.254 IP address.
|
||||
|
||||
```
|
||||
# nano /etc/hosts
|
||||
```
|
||||
|
||||
Add the following line:
|
||||
|
||||
```
|
||||
IP_of_main_DC FQDN_of_main_DC short_name_of_main_DC
|
||||
```
|
||||
[
|
||||

|
||||
][5]
|
||||
|
||||
Set Hostname for Samba4 AD DC
|
||||
|
||||
3. On the next step, open /etc/network/interfaces and assign a static IP address for your system as illustrated in the below screenshot.
|
||||
|
||||
Pay attention to dns-nameservers and dns-search variables. These values should be configured to point back to the IP address of the primary Samba4 AD DC and realm in order for DNS resolution to work correctly.
|
||||
|
||||
Restart the network daemon in order to reflect changes. Verify /etc/resolv.conf file to assure that both DNS values from your network interface are updated to this file.
|
||||
|
||||
```
|
||||
# nano /etc/network/interfaces
|
||||
```
|
||||
|
||||
Edit and replace with your custom IP settings:
|
||||
|
||||
```
|
||||
auto ens33
|
||||
iface ens33 inet static
|
||||
address 192.168.1.253
|
||||
netmask 255.255.255.0
|
||||
brodcast 192.168.1.1
|
||||
gateway 192.168.1.1
|
||||
dns-nameservers 192.168.1.254
|
||||
dns-search tecmint.lan
|
||||
```
|
||||
|
||||
Restart network service and confirm changes.
|
||||
|
||||
```
|
||||
# systemctl restart networking.service
|
||||
# cat /etc/resolv.conf
|
||||
```
|
||||
[
|
||||

|
||||
][6]
|
||||
|
||||
Configure DNS for Samba4 AD
|
||||
|
||||
The dns-search value will automatically append the domain name when you query a host by its short name (will form the FQDN).
|
||||
|
||||
4. In order to test if DNS resolution is working as expected, issue a series of ping commands against your domain short name, FQDN and realm as shown in the below screenshot.
|
||||
|
||||
In all these cases Samba4 AD DC DNS server should reply with the IP address of your main DC.
|
||||
|
||||
[
|
||||

|
||||
][7]
|
||||
|
||||
Verify DNS Resolution for Samba4 AD
|
||||
|
||||
5. The final additional step that you need to take care off is time synchronization with your main Domain Controller. This can be accomplished by installing NTP client utility on your system by issuing the below command:
|
||||
|
||||
```
|
||||
# apt-get install ntpdate
|
||||
```
|
||||
|
||||
6. Assuming that you want to manually force time synchronization with samba4 AD DC, run ntpdate command against the primary DC by issuing the following command.
|
||||
|
||||
```
|
||||
# ntpdate adc1
|
||||
```
|
||||
[
|
||||

|
||||
][8]
|
||||
|
||||
Time Synchronize with Samba4 AD
|
||||
|
||||
### Step 2: Install Samba4 with Required Dependencies
|
||||
|
||||
7. In order to enroll Ubuntu 16.04 system into your domain, first install Samba4, Kerberos client and a few other important packages for later use from Ubuntu official repositories by issuing the below command:
|
||||
|
||||
```
|
||||
# apt-get install samba krb5-user krb5-config winbind libpam-winbind libnss-winbind
|
||||
```
|
||||
[
|
||||

|
||||
][9]
|
||||
|
||||
Install Samba4 in Ubuntu
|
||||
|
||||
8. During the installation you will need to provide Kerberos realm name. Write your domain name with upper cases and press [Enter] key to finish the installation process.
|
||||
|
||||
[
|
||||

|
||||
][10]
|
||||
|
||||
Configure Kerberos Authentication for Samba4
|
||||
|
||||
9. After the packages installation finishes, verify the settings by requesting a Kerberos ticket for a domain administrator using kinit command. Use klist command to list granted Kerberos ticket.
|
||||
|
||||
```
|
||||
# kinit domain-admin-user@YOUR_DOMAIN.TLD
|
||||
# klist
|
||||
```
|
||||
[
|
||||

|
||||
][11]
|
||||
|
||||
Verify Kerberos on Samba4 Domain
|
||||
|
||||
### Step 3: Join to Samba4 AD DC as a Domain Controller
|
||||
|
||||
10. Before integrating your machine into Samba4 DC, first make sure all Samba4 daemons running on your system are stopped and, also, rename the default Samba configuration file in order to start clean. While provisioning the domain controller, samba will create a new configuration file from scratch.
|
||||
|
||||
```
|
||||
# systemctl stop samba-ad-dc smbd nmbd winbind
|
||||
# mv /etc/samba/smb.conf /etc/samba/smb.conf.initial
|
||||
```
|
||||
|
||||
11. In order to start the domain joining process, first start only samba-ad-dc daemon, after which you will run samba-tool command to join the realm using an account with administrative privileges on your domain.
|
||||
|
||||
```
|
||||
# samba-tool domain join your_domain -U "your_domain_admin"
|
||||
```
|
||||
|
||||
Domain integration excerpt:
|
||||
|
||||
```
|
||||
# samba-tool domain join tecmint.lan DC -U"tecmint_user"
|
||||
```
|
||||
|
||||
##### Sample Output
|
||||
|
||||
```
|
||||
Finding a writeable DC for domain 'tecmint.lan'
|
||||
Found DC adc1.tecmint.lan
|
||||
Password for [WORKGROUP\tecmint_user]:
|
||||
workgroup is TECMINT
|
||||
realm is tecmint.lan
|
||||
checking sAMAccountName
|
||||
Deleted CN=ADC2,CN=Computers,DC=tecmint,DC=lan
|
||||
Adding CN=ADC2,OU=Domain Controllers,DC=tecmint,DC=lan
|
||||
Adding CN=ADC2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=tecmint,DC=lan
|
||||
Adding CN=NTDS Settings,CN=ADC2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=tecmint,DC=lan
|
||||
Adding SPNs to CN=ADC2,OU=Domain Controllers,DC=tecmint,DC=lan
|
||||
Setting account password for ADC2$
|
||||
Enabling account
|
||||
Calling bare provision
|
||||
Looking up IPv4 addresses
|
||||
Looking up IPv6 addresses
|
||||
No IPv6 address will be assigned
|
||||
Setting up share.ldb
|
||||
Setting up secrets.ldb
|
||||
Setting up the registry
|
||||
Setting up the privileges database
|
||||
Setting up idmap db
|
||||
Setting up SAM db
|
||||
Setting up sam.ldb partitions and settings
|
||||
Setting up sam.ldb rootDSE
|
||||
Pre-loading the Samba 4 and AD schema
|
||||
A Kerberos configuration suitable for Samba 4 has been generated at /var/lib/samba/private/krb5.conf
|
||||
Provision OK for domain DN DC=tecmint,DC=lan
|
||||
Starting replication
|
||||
Schema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[402/1550] linked_values[0/0]
|
||||
Schema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[804/1550] linked_values[0/0]
|
||||
Schema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[1206/1550] linked_values[0/0]
|
||||
Schema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[1550/1550] linked_values[0/0]
|
||||
Analyze and apply schema objects
|
||||
Partition[CN=Configuration,DC=tecmint,DC=lan] objects[402/1614] linked_values[0/0]
|
||||
Partition[CN=Configuration,DC=tecmint,DC=lan] objects[804/1614] linked_values[0/0]
|
||||
Partition[CN=Configuration,DC=tecmint,DC=lan] objects[1206/1614] linked_values[0/0]
|
||||
Partition[CN=Configuration,DC=tecmint,DC=lan] objects[1608/1614] linked_values[0/0]
|
||||
Partition[CN=Configuration,DC=tecmint,DC=lan] objects[1614/1614] linked_values[28/0]
|
||||
Replicating critical objects from the base DN of the domain
|
||||
Partition[DC=tecmint,DC=lan] objects[97/97] linked_values[24/0]
|
||||
Partition[DC=tecmint,DC=lan] objects[380/283] linked_values[27/0]
|
||||
Done with always replicated NC (base, config, schema)
|
||||
Replicating DC=DomainDnsZones,DC=tecmint,DC=lan
|
||||
Partition[DC=DomainDnsZones,DC=tecmint,DC=lan] objects[45/45] linked_values[0/0]
|
||||
Replicating DC=ForestDnsZones,DC=tecmint,DC=lan
|
||||
Partition[DC=ForestDnsZones,DC=tecmint,DC=lan] objects[18/18] linked_values[0/0]
|
||||
Committing SAM database
|
||||
Sending DsReplicaUpdateRefs for all the replicated partitions
|
||||
Setting isSynchronized and dsServiceName
|
||||
Setting up secrets database
|
||||
Joined domain TECMINT (SID S-1-5-21-715537322-3397311598-55032968) as a DC
|
||||
```
|
||||
[
|
||||

|
||||
][12]
|
||||
|
||||
Join Domain to Samba4 AD DC
|
||||
|
||||
12. After the Ubuntu with samba4 software has been integrated into the domain, open samba main configuration file and add the following lines:
|
||||
|
||||
```
|
||||
# nano /etc/samba/smb.conf
|
||||
```
|
||||
|
||||
Add following excerpt to smb.conf file.
|
||||
|
||||
```
|
||||
dns forwarder = 192.168.1.1
|
||||
idmap_ldb:use rfc2307 = yes
|
||||
template shell = /bin/bash
|
||||
winbind use default domain = true
|
||||
winbind offline logon = false
|
||||
winbind nss info = rfc2307
|
||||
winbind enum users = yes
|
||||
winbind enum groups = yes
|
||||
```
|
||||
|
||||
Replace dns forwarder IP address with your own DNS forwarder IP. Samba will forward all DNS resolution queries that are outside your domain authoritative zone to this IP address.
|
||||
|
||||
13. Finally, restart samba daemon to reflect changes and check active directory replication by executing the following commands.
|
||||
|
||||
```
|
||||
# systemctl restart samba-ad-dc
|
||||
# samba-tool drs showrepl
|
||||
```
|
||||
[
|
||||

|
||||
][13]
|
||||
|
||||
Configure Samba4 DNS
|
||||
|
||||
14. Additionally, rename initial Kerberos configuration file from /etc path and replace it with the new krb5.confconfiguration file generated by samba while provisioning the domain.
|
||||
|
||||
The file is located in /var/lib/samba/private directory. Use Linux symlink to link this file to /etc directory.
|
||||
|
||||
```
|
||||
# mv /etc/krb6.conf /etc/krb5.conf.initial
|
||||
# ln -s /var/lib/samba/private/krb5.conf /etc/
|
||||
# cat /etc/krb5.conf
|
||||
```
|
||||
[
|
||||

|
||||
][14]
|
||||
|
||||
Configure Kerberos
|
||||
|
||||
15. Also, verify Kerberos authentication with samba krb5.conf file. Request a ticket for an administrator user and list the cached ticket by issuing the below commands.
|
||||
|
||||
```
|
||||
# kinit administrator
|
||||
# klist
|
||||
```
|
||||
[
|
||||

|
||||
][15]
|
||||
|
||||
Verify Kerberos Authentication with Samba
|
||||
|
||||
### Step 4: Additional Domain Services Validations
|
||||
|
||||
16. The first test you need to perform is Samba4 DC DNS resolution. To validate your domain DNS resolution, query the domain name using host command against a few crucial AD DNS records as presented on the below screenshot.
|
||||
|
||||
The DNS server should replay by now with a pair of two IP addresses for each query.
|
||||
|
||||
```
|
||||
# host your_domain.tld
|
||||
# host -t SRV _kerberos._udp.your_domain.tld # UDP Kerberos SRV record
|
||||
# host -t SRV _ldap._tcp.your_domain.tld # TCP LDAP SRV record
|
||||
```
|
||||
[
|
||||

|
||||
][16]
|
||||
|
||||
Verify Samba4 DC DNS
|
||||
|
||||
17. These DNS records should also be visible from an enrolled [Windows machine with RSAT tools installed][17]. Open DNS Manager and expand to your domain tcp records as shown in the below image.
|
||||
|
||||
[
|
||||

|
||||
][18]
|
||||
|
||||
Verify DNS Records on Windows RSAT Tool
|
||||
|
||||
18. The next test should indicate if domain LDAP replication works as expected. Using samba-tool, create an account on the second domain controller and verify if the account is automatically replicated on the first Samba4 AD DC.
|
||||
|
||||
##### On adc2:
|
||||
|
||||
```
|
||||
# samba-tool user add test_user
|
||||
```
|
||||
|
||||
##### On adc1:
|
||||
|
||||
```
|
||||
# samba-tool user list | grep test_user
|
||||
```
|
||||
[
|
||||

|
||||
][19]
|
||||
|
||||
Create User Account on Samba4 AD
|
||||
|
||||
[
|
||||

|
||||
][20]
|
||||
|
||||
Verify Replication on Samba4 AD
|
||||
|
||||
19. You can also create an account from a Microsoft AD UC console and verify if the account appears on both domain controllers.
|
||||
|
||||
By default, the account should be automatically created on both samba domain controllers. Query the account name from `adc1` using wbinfo command.
|
||||
|
||||
[
|
||||

|
||||
][21]
|
||||
|
||||
Create Account from Microsoft AD UC
|
||||
|
||||
[
|
||||

|
||||
][22]
|
||||
|
||||
Verify Account Replication On Samba4 AD
|
||||
|
||||
20. As a fact, open AD UC console from Windows, expand to Domain Controllers and you should see both enrolled DC machines.
|
||||
|
||||
[
|
||||

|
||||
][23]
|
||||
|
||||
Verify Samba4 Domain Controllers
|
||||
|
||||
### Step 5: Enable Samba4 AD DC Service
|
||||
|
||||
21. In order to enable samba4 AD DC services system-wide, first disable some old and unused Samba daemons and enable only samba-ad-dc service by running the below commands:
|
||||
|
||||
```
|
||||
# systemctl disable smbd nmbd winbind
|
||||
# systemctl enable samba-ad-dc
|
||||
```
|
||||
[
|
||||

|
||||
][24]
|
||||
|
||||
Enable Samba4 AD DC Services
|
||||
|
||||
22. If you remotely administer Samba4 domain controller from a Microsoft client or you have other Linux or Windows clients integrated into your domain, make sure you mention the IP address of the `adc2` machine to their network interface DNS server IP settings in order to gain a level of redundancy.
|
||||
|
||||
The below screenshots illustrates the configurations required for a Windows or a Debian/Ubuntu client.
|
||||
|
||||
[
|
||||

|
||||
][25]
|
||||
|
||||
Configure Client to Administer Samba4 DC
|
||||
|
||||
[
|
||||

|
||||
][26]
|
||||
|
||||
Configure Linux Client to Administer Samba4 DC
|
||||
|
||||
Assuming that the first DC with 192.168.1.254 goes offline, reverse the order of the DNS server IP addresses in the configuration file so it won’t try to query first an unavailable DNS server.
|
||||
|
||||
Finally, in case you want to perform local authentication on a Linux system with a Samba4 Active Directory account or grant root privileges for AD LDAP accounts in Linux, read the steps 2 and 3 from the tutorial [Manage Samba4 AD Infrastructure from Linux Command Line][27].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/join-additional-ubuntu-dc-to-samba4-ad-dc-failover-replication/
|
||||
|
||||
作者:[Ravi Saive][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/admin/
|
||||
[1]:http://www.tecmint.com/install-samba4-active-directory-ubuntu/
|
||||
[2]:http://www.tecmint.com/manage-samba4-active-directory-linux-command-line/
|
||||
[3]:http://www.tecmint.com/manage-samba4-ad-from-windows-via-rsat/
|
||||
[4]:http://www.tecmint.com/manage-samba4-dns-group-policy-from-windows/
|
||||
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Set-Hostname-for-Samba4-AD-DC.jpg
|
||||
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-DNS-for-Samba4-AD.jpg
|
||||
[7]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-DNS-Resolution-for-Samba4-AD.png
|
||||
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Time-Synchronize-with-Samba4-AD.png
|
||||
[9]:http://www.tecmint.com/wp-content/uploads/2017/01/Install-Samba4-in-Ubuntu.png
|
||||
[10]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos-Authentication-for-Samba4.png
|
||||
[11]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Kerberos-on-Samba4-Domain.png
|
||||
[12]:http://www.tecmint.com/wp-content/uploads/2017/01/Join-Domain-to-Samba4-AD-DC.png
|
||||
[13]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Samba4-DNS.png
|
||||
[14]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos.jpg
|
||||
[15]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Kerberos-Authentication-with-Samba.jpg
|
||||
[16]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-DC-DNS.png
|
||||
[17]:http://www.tecmint.com/manage-samba4-ad-from-windows-via-rsat/
|
||||
[18]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-DNS-Records-on-Windows-RSAT-Tool.png
|
||||
[19]:http://www.tecmint.com/wp-content/uploads/2017/01/Create-User-Account-on-Samba4-AD.jpg
|
||||
[20]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Replication-on-Samba4-AD.jpg
|
||||
[21]:http://www.tecmint.com/wp-content/uploads/2017/01/Create-Account-from-Microsoft-AD-UC.png
|
||||
[22]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Account-Replication-On-Samba4-AD.png
|
||||
[23]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-Domain-Controllers.png
|
||||
[24]:http://www.tecmint.com/wp-content/uploads/2017/01/Enable-Samba4-AD-DC-Services.png
|
||||
[25]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Client-to-Administer-Samba4-DC.png
|
||||
[26]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Linux-Client-to-Administer-Samba4-DC.png
|
||||
[27]:http://www.tecmint.com/manage-samba4-active-directory-linux-command-line/
|
@ -0,0 +1,56 @@
|
||||
# 用 Apache Calcite 构建强大的实时流应用
|
||||
|
||||

|
||||
|
||||
Calcite 是一个数据框架,它允许你创建自定义数据库功能,微软开发者 Atri Sharma 在 Apache 即将到来的 11 月 14-16 日在西班牙塞维利亚举行的 Big Data Europe 中解释。[Creative Commons Zero][2]
|
||||
|
||||
Wikimedia Commons: Parent Géry
|
||||
|
||||
[Apache Calcite][7] 数据管理框架包含许多典型的数据库管理系统,但省略了其他部分,如存储数据和算法来处理数据。 Microsoft 在 Azure Data Lake 的软件工程师 Atri Sharma 在西班牙塞维利亚的即将到来的 [Apache:Big Data][6] 会议上的演讲中将讨论使用 [Apache Calcite][5]的高级查询规划能力。我们与 Sharma 讨论了解有关 Calcite 的更多信息,以及现有程序如何利用其功能。
|
||||
|
||||

|
||||
|
||||
Atri Sharma,微软 Azure Data Lake 的软件工程师,已经[授权使用][1]
|
||||
|
||||
**Linux.com:你能提供一些关于 Apache Calcite 的背景吗? 它有什么作用?
|
||||
|
||||
Atri Sharma:Calcite是一个框架,它是许多数据库内核的基础。Calcite 允许你构建自定义数据库功能并使用 Calcite 所需的资源。例如,Hive 使用 Calcite 进行基于成本的查询优化、Drill 和 Kylin 使用 Calcite 进行 SQL 解析和优化、Apex 使用 Calcite 进行流式 SQL。
|
||||
|
||||
**Linux.com:有哪些是使得 Apache Calcite 与其他框架不同的特性?
|
||||
|
||||
Atri:Calcite 是独一无二的,它允许你建立自己的数据平台。 Calcite 不直接管理你的数据,而是允许你使用 Calcite 的库来定义你自己的组件。 例如,它允许使用 Calcite 中可用的 Planner 定义自定义查询优化器,而不是提供通用查询优化器。
|
||||
|
||||
**Linux.com:Apache Calcite 本身不会存储或处理数据。 它如何影响程序开发?
|
||||
|
||||
Atri:Calcite 是数据库内核中的依赖项。它面向希望扩展其功能的数据管理平台,而无需从头开始编写大量功能。
|
||||
|
||||
** Linux.com:谁应该使用它? 你能举几个例子吗?**
|
||||
|
||||
Atri:任何旨在扩展其功能的数据管理平台都应使用 Calcite。 我们是你下一个高性能数据库的基础!
|
||||
|
||||
具体来说,我认为最大的例子是 Hive 使用 Calcite 用于查询优化、Flink 解析和流 SQL 处理。 Hive 和 Flink 是成熟的数据管理引擎,并使用 Calcite 高度专业目的。这是对 Calcite 应用进一步加强数据管理平台核心的一个好的案例研究。
|
||||
|
||||
**Linux.com:你有哪些期待的新功能?
|
||||
|
||||
Atri:流 SQL 增强是令我非常兴奋的事情。这些功能令人兴奋,因为它们将使 Calcite 的用户能够更快地开发实时流式应用程序,并且这些程序的强大和功能将是多方面的。流程序是新的事实,并且在流 SQL 中具有查询优化的优点对于大部分人将是非常有用的。此外,关于暂存表的讨论还在进行,所以请继续关注!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/news/build-strong-real-time-streaming-apps-apache-calcite
|
||||
|
||||
作者:[AMBER ANKERHOLZ][a]
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/aankerholz
|
||||
[1]:https://www.linux.com/licenses/category/used-permission
|
||||
[2]:https://www.linux.com/licenses/category/creative-commons-zero
|
||||
[3]:https://www.linux.com/files/images/atri-sharmajpg
|
||||
[4]:https://www.linux.com/files/images/calcitejpg
|
||||
[5]:https://calcite.apache.org/
|
||||
[6]:http://events.linuxfoundation.org/events/apache-big-data-europe
|
||||
[7]:https://calcite.apache.org/
|
@ -0,0 +1,59 @@
|
||||
开发和部署的不同
|
||||
============================================================
|
||||

|
||||
图片提供 :
|
||||
|
||||
opensource.com
|
||||
|
||||
多年来,我是一名 Smalltalk 程序员,这种经验给让我在观察编程世界时有不同的想法。例如,源代码应该存储在文本文件中的想法需要一些习惯。
|
||||
|
||||
我们作为程序员通常区分“开发”和“部署”,特别是我们在一个地方开发使用的工具不同于我们之后部署软件时的地点和工具。在Smalltalk世界里,没有这样的区别。
|
||||
|
||||
Smalltalk 构建于虚拟机包含了你的开发环境(IDE、调试器、文本编辑器、版本控制等)的想法上,如果你必须修改任何代码,你将修改内存中运行副本。如果你想快照运行中的机器,你可以这样做,如果你想分发你的代码,你可以发送一个运行的机器镜像(包括IDE、调试器、文本编辑器、版本控制等)的副本到用户。这就是 90 年代软件开发的工作原理(对我们中的一些人来说)。
|
||||
|
||||
如今部署环境与开发环境有了很大的不同。对于初学者,你不希望那里有任何开发工具。一旦部署,就没有版本控制、没有调试、没有开发环境。有记录和监视,这些在我们的开发环境中没有,并且有一个“构建管道”,它将我们的软件从我们开发形式转换为部署形式。例如,Docker 容器试图重新抓住 1990 年代 Smalltalk 程序员部署经验的一些简单性,而不希望对开发体验做同样的事情。
|
||||
|
||||
我想如果 Smalltalk 世界是我唯一的编程隐喻体验,无法区分开发和部署环境,我可能作为侥幸回顾一下它。但在我是一名 Smalltalk 程序员之前,我是一位 APL 程序员,这也是一个可以修改虚拟机镜像的世界,其中开发和部署是无法区分的。因此,我相信,当前的世界,人们编辑单独的源代码文件,然后运行构建管道以e创建在编辑代码时不存在的部署工作,然后将这些作品部署到用户。我们已经以某种方式将这种反模式软件开发制度化,并且不断发展的软件环境的需求正在迫使我们找到回到 20 世纪 90 年代更有效的技术的方法。因此会有 Docker 的成功。因此,我需要提出建议。
|
||||
|
||||
我有两个建议:我们在运行时系统中实现(和使用)版本控制,我们通过更改运行系统来开发软件,而不是用新的运行系统替换它们。这两个想法是相关的。为了安全地更改正在运行的系统,我们需要一些版本控制功能来支持“撤消”功能。也许公平地说,我只提出一个建议。让我举例来说明。
|
||||
|
||||
让我们开始想象一个静态网站。你要修改一些 HTML 文件。你应该如何工作?如果你像大多数开发者一样,你会有两个,也许三个网站 - 一个用于开发,一个用于QA(或者预发布),一个用于生产。你将直接编辑开发实例中的文件。准备就绪后,你将“部署”你的修改到预发布实例。在用户验收测试之后,你将再次部署,这次是生产环境。
|
||||
|
||||
使用 Occam 的 Razor,让我们避免不必要地创建实例。我们需要多少台机器?我们可以使用一台电脑。我们需要多少台网络服务器?我们可以使用具有多个虚拟主机的单台 web 服务器,而不是多个虚拟主机,我们可以使用单台虚拟主机吗?然后,我们需要多个目录,并需要使用 URL 的顶级路径来区分不同的版本,而不是虚拟主机名。但是为什么我们需要多个目录?因为 web 服务器将从文件系统中提供静态文件。我们的问题是,目录有三个不同的版本,我们的解决方案是创建目录的三个不同的副本。这不是像 Subversion 和 Git 这样的版本控制系统解决的问题?制作目录的多个副本以存储多个版本的策略回到了 CVS 之前的日子。为什么不使用,也就是一个空的的 Git 仓库来存储文件?因为要这样做,web 服务器将需要能够从 git 仓库读取文件(参见[mod_git] [3])。
|
||||
|
||||
这将是一个支持版本控制的运行时系统。
|
||||
|
||||
使用这样的 web 服务器,使用的版本可以由 cookie 来标识。这样,任何人都可以推送到仓库,用户将继续看到他们发起会话时分配的版本。版本控制系统有不可改变的提交; 一旦会话开始,开发人员可以在不影响正在运行的用户的情况下快速推送更改。开发人员可以重置其会话以跟踪他们的新提交,因此开发人员或测试人员就可能如普通用户一样查看在同台服务器上同一个URL上正在开发或正在测试的版本。作为偶然的副作用,A/B 测试仅仅是将不同的用户分配给不同的提交的情况。所有用于管理多个版本的 git 设施都在运行环境中发挥作用。当然,git reset 为我们提供了前面提到的“撤销”功能。
|
||||
|
||||
为什么不是每个人都这样做?
|
||||
|
||||
一种可能性是,诸如版本控制系统的工具不被设计为在生产环境中使用。例如,给某人许可推送到测试分支而不是生产分支是不可能的。对这个方案最常见的反对是,如果发现了一个漏洞,你会想要将某些提交标记为不可访问。这将是另一种更细粒度的权限的情况;开发人员将具有对所有提交的读取权限,但外部用户不会。我们可能需要对现有工具进行一些额外的工作以支持这种模式,但是这些功能很容易理解,并已被设计到其他软件中。例如,Linux (或 PostgreSQL)实现了对不同用户的细粒度权限的想法。
|
||||
|
||||
随着云环境变得越来越普及,这些想法变得更加相关:云总是在运行。例如,我们可以看到,AWS 中等价的 “文件系统”(S3)实现了版本控制,所以你可能有一个不同的想法,使用一台 web 服务器提供来自 S3 的资产,并使用会话信息选择不同版本的资产。重要的想法并不是实现是最好的,而是支持运行时版本控制的愿望。
|
||||
|
||||
部署的软件环境应该是“版本感知”的原则扩展到除了服务静态资产的web服务器之外的其他工具。在将来的文章中,我将介绍版本库,数据库和应用程序服务器的方法。
|
||||
|
||||
_在 linux.conf.au 中了解更多 Robert Lefkowitz 2017 年 ([#lca2017][1])在 Hobart:[保持 Linux 伟大][2]的主题。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Robert M. Lefkowitz - Robert(a / k / a r0ml)是一个喜欢复杂编程语言的编程语言爱好者。 他是一个提高清晰度、提高可靠性和最大限度地简化编程技术的收藏家。他通过让计算机更加容易获得来使它普及化。他经常演讲中世纪晚期和早期文艺复兴对编程艺术的影响。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/difference-between-development-deployment
|
||||
|
||||
作者:[Robert M. Lefkowitz][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/r0ml
|
||||
[1]:https://twitter.com/search?q=%23lca2017&src=typd
|
||||
[2]:https://www.linux.conf.au/schedule/presentation/107/
|
||||
[3]:https://github.com/r0ml/mod_git
|
@ -0,0 +1,210 @@
|
||||
3 个在 Linux 中永久并安全删除`文件和目录`的方法
|
||||
============================================================
|
||||
|
||||
在大多数情况下,我们习惯于[从我们的计算机中删除文件][1],例如使用 `Delete` 键、垃圾箱或 `rm` 命令,这不是永久安全地从硬盘中(或任何存储介质)删除文件的方法。
|
||||
|
||||
该文件只是对用户隐藏,它驻留在硬盘上的某个地方。它可以通过数据窃贼、执法或其他威胁来恢复。
|
||||
|
||||
假设文件包含密级或机密内容,例如安全系统的用户名和密码,具有必要知识和技能的攻击者可以轻松地[恢复删除文件的副本][2]并访问这些用户凭证(你可以猜测到这种情况的后果)。
|
||||
|
||||
在本文中,我们将解释一些命令行工具,用于永久并安全地删除 Linux 中的文件。
|
||||
|
||||
### 1\. shred – 覆盖文件来隐藏内容
|
||||
|
||||
shred 会覆盖文件来隐藏它的内容,并且也可以选择删除它。
|
||||
|
||||
```
|
||||
$ shred -zvu -n 5 passwords.list
|
||||
```
|
||||
|
||||
在下面的命令中,选项有:
|
||||
|
||||
1. `-z` - 用零覆盖以隐藏碎片
|
||||
2. `-v` - 显示操作进度
|
||||
3. `-u` - 在覆盖后截断并删除文件
|
||||
4. `-n` - 指定覆盖文件内容的次数(默认值为3)
|
||||
|
||||
[
|
||||

|
||||
][3]
|
||||
|
||||
shred - 覆盖文件来隐藏它的内容
|
||||
|
||||
你可以在 shred 的帮助页中找到更多的用法选项和信息:
|
||||
|
||||
```
|
||||
$ man shred
|
||||
```
|
||||
|
||||
### 2\. wipe – 在 Linux 中安全删除文件
|
||||
|
||||
Linux wipe 命令可以安全地擦除磁盘中的文件,从而不可能[恢复删除的文件或目录内容] 4]。
|
||||
|
||||
首先,你需要安装 wipe 工具,运行以下适当的命令:
|
||||
|
||||
```
|
||||
$ sudo apt-get install wipe [On Debian and its derivatives]
|
||||
$ sudo yum install wipe [On RedHat based systems]
|
||||
```
|
||||
|
||||
下面的命令会摧毁 private 目录下的所有文件。
|
||||
|
||||
```
|
||||
$ wipe -rfi private/*
|
||||
```
|
||||
|
||||
当使用下面的标志时:
|
||||
|
||||
1. `-r` - 告诉 wipe 递归擦除子目录
|
||||
2. `-f` - 启用强制删除并禁用确认查询
|
||||
3. `-i` - 显示擦除进度
|
||||
|
||||
[
|
||||

|
||||
][5]
|
||||
|
||||
wipe – 在 Linux 中安全擦除文件
|
||||
|
||||
注意:wipe 仅在磁性存储上可以可靠地工作,因此对固态磁盘(内存)请使用其他方法。
|
||||
|
||||
阅读 wipe 手册以获取其他使用选项和说明:
|
||||
|
||||
```
|
||||
$ man wipe
|
||||
```
|
||||
|
||||
### 3\. Linux 中的安全删除工具集
|
||||
|
||||
secure-delete 是一个安全文件删除工具的集合,它包含srm(secure_deletion)工具,用于安全删除文件。
|
||||
|
||||
首先,你需要使用以下相关命令安装它:
|
||||
|
||||
```
|
||||
$ sudo apt-get install secure-delete [On Debian and its derivatives]
|
||||
$ sudo yum install secure-delete [On RedHat based systems]
|
||||
```
|
||||
|
||||
安装完成后,你可以使用 srm 工具在 Linux 中安全地删除文件和目录。
|
||||
|
||||
```
|
||||
$ srm -vz private/*
|
||||
```
|
||||
|
||||
下面是使用的选项:
|
||||
|
||||
1. `-v` – 启用 verbose 模式
|
||||
2. `-z` – 用0而不是随机数据来擦除最后的写入
|
||||
|
||||
[
|
||||

|
||||
][6]
|
||||
|
||||
srm – 在 Linux 中安全删除文件
|
||||
|
||||
阅读 srm 手册来获取更多的使用选项和信息:
|
||||
|
||||
```
|
||||
$ man srm
|
||||
```
|
||||
|
||||
### 4\. sfill -安全免费的磁盘/inode 空间擦除器
|
||||
|
||||
sfill 是 secure-deletetion 工具包的一部分,是一个安全免费的磁盘和 inode 空间擦除器,它以安全的方法删除可用磁盘空间中的文件。 sfill 会[检查指定分区上的可用空间][7],并使用来自 /dev/urandom 的随机数据填充它。
|
||||
|
||||
以下命令将在我的根分区上执行 sfill,使用 `-v' 选项启用 verbose 模式:
|
||||
|
||||
```
|
||||
$ sudo sfill -v /home/aaronkilik/tmp/
|
||||
```
|
||||
|
||||
假设你创建了一个单独的分区 `/home` 来存储正常的系统用户主目录,你可以在该分区上指定一个目录,以便在其上应用 sfill:
|
||||
|
||||
```
|
||||
$ sudo sfill -v /home/username
|
||||
```
|
||||
|
||||
你可以在 sfill 的手册上看到一些限制,你也可以看到额外的使用标志和命令:
|
||||
|
||||
```
|
||||
$ man sfill
|
||||
```
|
||||
|
||||
注意:secure-deletetion 工具包中的两个工具(sswap 和 sdmem)与本指南的范围不直接相关,但是,我们会在将来为了传播知识的目的来解释它们。
|
||||
|
||||
### 5\. sswap – 安全 swap 擦除器
|
||||
|
||||
它是一个安全的分区擦除器,sswap以安全的方式删除 swap 分区上存在的数据。
|
||||
|
||||
警告:请记住在使用 sswap 之前卸载 swap 分区! 否则你的系统可能会崩溃!
|
||||
|
||||
只需确定交换分区(并检查分页和交换设备/文件是否使用 swapon 命令打开),接下来,使用 swapoff 命令禁用分页和交换设备/文件(使 swap 分区不可用)。
|
||||
|
||||
然后在 swap 分区上运行 sswap 命令:
|
||||
|
||||
```
|
||||
$ cat /proc/swaps
|
||||
$ swapon
|
||||
$ sudo swapoff /dev/sda6
|
||||
$ sudo sswap /dev/sda6 #this command may take some time to complete with 38 default passes
|
||||
```
|
||||
[
|
||||

|
||||
][8]
|
||||
|
||||
sswap – 安全 swap 擦除器
|
||||
|
||||
阅读 sswap 的手册来获取更多的选项和信息:
|
||||
|
||||
```
|
||||
$ man sswap
|
||||
```
|
||||
|
||||
### 6\. sdmem – 安全内存擦除器
|
||||
|
||||
sdmem 是一个安全的内存擦除器,它被设计为以安全的方式删除存储器(RAM)中的数据。
|
||||
|
||||
它最初命名为[smem][9],但是因为在 Debain 系统上存在另一个包[smem - 报告每个进程和每个用户的内存消耗][10],开发人员决定将它重命名为 sdmem。
|
||||
|
||||
```
|
||||
$ sudo sdmem -f -v
|
||||
```
|
||||
|
||||
关于更多的使用信息,阅读 sdmen 的手册:
|
||||
|
||||
```
|
||||
$ man sdmem
|
||||
```
|
||||
|
||||
**推荐阅读:** [PhotoRec – 在 Linux 中恢复删除或遗失的文件][11]
|
||||
|
||||
就是这样了!在本文中,我们审查了一系列可以永久安全地删除 Linux 中的文件的工具。像往常一样,通过下面的评论栏发表你对本篇文章的想法或建议。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
我是 Ravi Saive,TecMint 的创建者。 一个计算机 Geek 和 Linux 大师,喜欢在互联网上分享技巧和贴士。我的服务器大多数运行在称为 Linux 的开源平台上。关注我:Twitter、Facebook 和 Google+
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/permanently-and-securely-delete-files-directories-linux/
|
||||
|
||||
作者:[Ravi Saive][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/admin/
|
||||
[1]:http://www.tecmint.com/delete-all-files-in-directory-except-one-few-file-extensions/
|
||||
[2]:http://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/
|
||||
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/shred-command-example.png
|
||||
[4]:http://www.tecmint.com/recover-deleted-file-in-linux/
|
||||
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Wipe-Securely-Erase-Files.png
|
||||
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/srm-securely-delete-Files-in-Linux.png
|
||||
[7]:http://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/
|
||||
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/sswap-Secure-Swap-Wiper.png
|
||||
[9]:http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/
|
||||
[10]:http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/
|
||||
[11]:http://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/
|
@ -1,61 +0,0 @@
|
||||
初识 HTTP/2(第一部分)
|
||||
============================================================
|
||||

|
||||
|
||||
用披萨来说明当你订单数很大的时候HTTP/2是怎么打败HTTP/1.1的。
|
||||
|
||||
在建立网站和应用上 _HTTP/2 有些令人惊叹的改变,在 HTTP/2 发布后的一年半,几乎[10%的网站使用了 HTTP/2][4]。它是绝对值得被采用的,但是这篇博文应该首推给使用 HTTP/2 的前端开发者。这是个连载的博文是指导前端开发者怎么转换到 HTTP/2。_
|
||||
|
||||
_这个推送涵盖了 HTTP/2 对 HTTP/1.1 来说有什么提高,并且向前端开发者介绍了 HTTP/2。_
|
||||
|
||||
### 再次让我想起什么是HTTP...
|
||||
|
||||
超文本传输协议,也就是 HTTP,这个协议决定了 web 内容怎么传输。HTTP/1.1 在1999年被标准化,那时候的 web 和现在有很大的不同,表格霸占了整个网络。样式通常被内联在元素中,如果网站管理员更加的细致,他们会在头部写个 `<style>`标签。 JavaScript 也被使用在文档上,那时候完整的网站通常也不会超过几页。
|
||||
|
||||
HTTP/1.1 假设这种情况会持续一段时间,所以它并没有太过关注允许一个站点加载大量的资源,因为那时候的开发者并不需要这个。因此它使用了一个非常简单的方式来处理资源,你访问一个资源然后服务器去寻找它并且返回你访问的或者告诉你这个资源不存在。这被叫作"线头堵塞"并且非常高效的,但是当你需要多个资源的时候,这个进程会依次寻找每个资源。这意味着在你访问第二个资源之前,服务器必须找到你访问的第一个并且载入它或者告诉你没找到。
|
||||
|
||||
### 大型站点的发展
|
||||
|
||||
在1999年后的几年里,随着php和其他Rails等动态语言的崛起,站点变得越来越复杂。css文件也随着向响应式开发的转变变的越来越大,因此CSS编译器就,比如Sass,就创造了一个简单的工作环境。 JavaScript 也在 web 上有了更大的作用,允许开发者编写复杂的应用,这曾经只是才c++ 开发人员的工作。Retina和高清显示屏的兴起,也让图片可以定义更多的属性。随着这些改变,文件大小呈现指数式的增长,使用本来是等待几个字节的资源变成了加载几千字节,甚至在某些情况下有几兆。当你开始载入这页面的其他东西前必须先载入数百个千字节的东西,你只能乐观的假设你的用户有很快的网络。
|
||||
|
||||
想象 HTTP/1.1 是个精巧的订单在柜台里附近的披萨店。你能自己过去并且预定一个雪碧和2片 Angry Hawaiian 然后等待3分钟。他们很简单的处理这些,实际上这是个蓬勃发展的商业模式-快速插入简单的定单。
|
||||

|
||||
|
||||
然而,一旦你决定主办小区域的季度颁奖典礼在同样的披萨店,事情就变的更复杂了。每个人都预定不同的东西,杂乱无章的快会让等待时间加长。
|
||||
|
||||

|
||||
|
||||
### 哪里是HTTP/2的舞台
|
||||
|
||||
HTTP/2对前端开发者主要的承诺就是复用。意思就是资源请求能发生在同一时间并且服务器能马上响应这些资源。在请求之间没有等待,因为它们发生在同一时间。
|
||||
|
||||
使用一样的比喻,HTTP/2 允许披萨店在餐馆举办他们自己这区域的派对。派一个服务员接受订单并带出所有已经准备好的订单。当其他人的比萨在制作的时候,你也不需要花30分钟去等待你的雪碧,所以这成为了第一个项目之一。这方式使管理大量订单更加简单并且防止人们等他们的订单时间太长。
|
||||
|
||||
复用带给我们 web 开发的大变化是我们改变文件的加载方式。帮助绕过资源加载的 HTTP/1.1 瓶颈的方式是通过连接和缩小立即加载的文件。所有任务运行器都默认执行这操作或者需要作一点小设置。通常,开发人员也会将图像放在精灵表单中,这也减少了对服务器的请求数。
|
||||
|
||||
### 改进 HTTP/1.1
|
||||
|
||||
连接文件是个非常聪明的方式来处理 HTTP1.1 的请求限制问题,但是主要的连接文件问题是它要求用户第一次访问整个网站时下载所有的资源。一旦它们载入浏览器会缓存所有的资源。能提高用户每次访问这网页时的速度,但是前期负载很重,对[跳出率不利][5]。此外,他们可能为他们不访问的页面加载资源。期望用户访问每个页面以查看每个样式并与每个脚本进行交互是不现实的。此外,在加拿大和欧洲以及几乎每个美国移动提供商的地方,每月的带宽上限。不是加载额外的54千字节的内容会超过每月的流量限制,而是让我们假设用户想保留这些额外的字节看Taylor Swift的gif。
|
||||
|
||||
使用HTTP/2和多路复用,您可以运行一些最高效的网站,但它需要一些重新思考甚至撤销之前的最佳做法。重复一次,我的目的是加快HTTP/2的会话,使用我们新的工具,我们可以发现这些新的最佳的做法。
|
||||
|
||||
在我的下一篇文章,[我将探索一些最好的方式来处理一个基于HTTP/2的网站][6]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.viget.com/articles/getting-started-with-http-2-part-1?imm_mid=0eb24a&cmp=em-web-na-na-newsltr_20161130
|
||||
|
||||
作者:[Ben][a]
|
||||
译者:[译者ID](https://github.com/hkurj)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.viget.com/about/team/btinsley
|
||||
[1]:https://twitter.com/home?status=Using%20pizza%20to%20show%20how%20HTTP%2F2%20beats%20HTTP%2F1.1%20when%20your%20orders%20get%20too%20big.%20https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-1
|
||||
[2]:https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-1
|
||||
[3]:http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.viget.com%2Farticles%2Fgetting-started-with-http-2-part-1
|
||||
[4]:https://w3techs.com/technologies/details/ce-http2/all/all
|
||||
[5]:https://blog.kissmetrics.com/speed-is-a-killer/
|
||||
[6]:https://www.viget.com/articles/getting-started-with-http-2-part-2
|
||||
[7]:https://www.viget.com/about/team/btinsley
|
@ -1,20 +1,17 @@
|
||||
编写android测试单元应该做的和不应该做的.
|
||||
编写 android 测试单元该做的和不该做的事
|
||||
============================================================
|
||||
|
||||
在本文中, 根据我的实际经验我将为大家阐述一个测试用例.在本文中我将使用Espresso编码, 但是它们可以用到单元测试当中. 基于以上目的, 我们来研究一个新闻程序.
|
||||
在本文中, 我将根据我的实际经验,为大家阐述一个编写测试用例的最佳实践。在本文中我将使用 Espresso 编码, 但是它们可以用到单元和 instrumentation 测试当中。基于以上目的, 我们来研究一个新闻程序.
|
||||
|
||||
> 以下内容纯属虚构,如有雷同纯属巧合:P
|
||||
> 以下内容纯属虚构,如有雷同纯属巧合:P
|
||||
|
||||
一个新闻APP应该会有以下几个工作流.
|
||||
一个新闻 APP 应该会有以下这些 <ruby>活动<rt>activities</rt></ruby>。
|
||||
|
||||
* 语言选择 - 当用户第一次打开软件, 他必须至少选择一种语言。选择后,选项保存在共享偏好中,用户跳转到新闻列表 activity。
|
||||
* 新闻列表 - 当用户来到新闻列表 activity,将发送一个包含语言参数的请求到服务器,并将服务器返回的内容显示在 recycler view 上(包含有新闻列表的 id _news_list_)。 如果共享偏好中未存语言参数,或者服务器没有返回一个成功消息, 就会弹出一个错误对话框并且 recycler view 将不可见。如果用户只选择了一种语言,新闻列表 activity 有个 “Change your Language” 的按钮,或者如果用户选择多种语言,则按钮为 “Change your Languages” 。 ( 我对天发誓这是一个虚构的 APP 软件)
|
||||
* 新闻细节 - 如同名字所述, 当用户点选新闻列表项时将启动这个 activity。
|
||||
|
||||
* 语言选择页面- 当用户第一次打开软件, 他必须至少选择一种语言. 当选择一个或者多个语言, 用shared preferences保存选项,用户跳转到新闻列表页面.
|
||||
* 新闻列表页面- 当用户来到新闻列表页面, 将发送一个包含语言参数的请求到服务器,并将服务器返回的内容显示在recycler view上(包含有新闻列表的 id?_news_list_). 如果语言参数不存在在shared preferences或者服务器没有返回一个成功消息, 就会弹出一个错误对话框并且recycler view将不可见. 新闻列表页面有个名叫 “Change your Language” 的按钮,如果用户选择了一种语言 或者用户选择多种语言“Change your Languages” 永远是可见的. ( 我对天发誓这是一个虚构的APP软件)
|
||||
* 新闻详细内容-如同名字所述, 当用户点选新闻列表项将启动这个页面.
|
||||
|
||||
|
||||
这个APP已经研究的足够了,让我们深入新闻列表页面编写测试用例. 这是我第一次写的代码.
|
||||
|
||||
这个 APP 功能已经足够,,让我们深入研究下为新闻列表 activity 编写的测试用例。 这是我第一次写的代码。
|
||||
|
||||
```
|
||||
/*
|
||||
@ -42,9 +39,10 @@
|
||||
}
|
||||
?}
|
||||
```
|
||||
#### 仔细想想测试什么.
|
||||
|
||||
我们首先来测试新闻列表项的点击_?testClickOnAnyNewsItem()_, 如果服务器没有返回成功信息, 测试用例将会返回失败,因为recycler view是不可见的. 但是这个测试用例的通过或者失败并不是我们所期望的结果, 它要求不管什么原因recycler view都是可见的, 如果recycler view不可见,将返回失败信息. 正确的测试代码应该像下面这个样子.
|
||||
#### 仔细想想测试什么。
|
||||
|
||||
在第一个测试用例 _testClickOnAnyNewsItem()_, 如果服务器没有返回成功信息,测试用例将会返回失败,因为 recycler view 是不可见的。但是这个测试用例的目的并非如此。 **不管该用例为 PASS 还是 FAIL,它的最低要求是 recycler view 总是可见的,** 如果因某种原因,recycler view 不可见,那么测试用例不应视为 FAILED。正确的测试代码应该像下面这个样子。
|
||||
|
||||
```
|
||||
/*
|
||||
@ -66,8 +64,8 @@
|
||||
} catch (AssertionFailedError e) {
|
||||
return;
|
||||
}
|
||||
//Here we are sure, that the news_list recyclerview is visible to the user.
|
||||
onView(allOf(withId(R.id.news_list), isDisplayed())).perform(RecyclerViewActions
|
||||
//在这里我们确信,news_list的 recyclerview 对用户是可见的。
|
||||
onView(allOf(withId(R.id.news_list), isDisplayed())).perform(RecyclerViewActions
|
||||
.actionOnItemAtPosition(1, click()));
|
||||
intended(hasComponent(NewsDetailsActivity.class.getName()));
|
||||
}
|
||||
@ -76,13 +74,15 @@
|
||||
```
|
||||
#### 一个测试用例本身应该是完整的
|
||||
|
||||
当我开始测试, 我通常按如下顺序测试
|
||||
当我开始测试, 我通常按如下顺序测试 activities:
|
||||
|
||||
* 语音选择页面
|
||||
* 新闻列表页面
|
||||
* 新闻详细内容
|
||||
* 语音选择
|
||||
|
||||
当我开始测试语音选择页面, 总有一种语音已经是选择好了的. 但是当我测试新闻列表页面, 测试用例开始返回错误信息. 原因很简单- 没有选择语音,recycler view讲不会显示出来.因此, 测试用例的执行顺序不能影响测试结果. 因此在运行测试用例之前, 语言选项必须是保存的. 在本例中,测试用例独立与语言选择页面单独运行.
|
||||
* 新闻列表
|
||||
|
||||
* 新闻细节
|
||||
|
||||
因为我首先测试语音选择 activity,在测试 NewsList activity 之前,总有一种语音已经是选择好了的。但是当我先测试新闻列表 activity 时,测试用例开始返回错误信息。原因很简单 - 没有选择语言,recycler view 不会显示。**注意, 测试用例的执行顺序不能影响测试结果。** 因此在运行测试用例之前, 语言选项必须是保存在共享偏好中的。在本例中,测试用例独立于语言选择 activity 的测试。
|
||||
|
||||
```
|
||||
@Rule
|
||||
@ -111,9 +111,9 @@
|
||||
intended(hasComponent(NewsDetailsActivity.class.getName()));
|
||||
?}
|
||||
```
|
||||
#### 在测试用例中避免使用条件代码.
|
||||
#### 在测试用例中避免使用条件代码。
|
||||
|
||||
现在在第二个测试用例_testChangeLanguageFeature()_, 我们获取到用户选择语言个数, 我们写了if-else条件来进行测试 . 但是 if-else 条件应该写在你的代码当中, 不是测试代码里. 每一个条件应该单独测试. 因此, 在本例中, 我们将写如下两个测试用例.
|
||||
现在在第二个测试用例 _testChangeLanguageFeature()_中,我们获取到用户选择语言的个数, 基于这个数目,我们写了 if-else 条件来进行测试。 但是 if-else 条件应该写在你的代码当中,而不是测试代码里。每一个条件应该单独测试。 因此, 在本例中, 不是只写一条测试用例,而是要写如下两个测试用例。
|
||||
|
||||
```
|
||||
/**
|
||||
@ -143,16 +143,16 @@
|
||||
```
|
||||
#### 测试用例应该独立于外部因素
|
||||
|
||||
在大多数APP中, 我们与外部网络或者数据库进行交互.一个测试用例可以向服务器发送一个请求并获取返回信息. 但是当获取失败信息以后, 我们不能认为测试用例没有通过.试想一下如果测试用例没有通过, 然后我们修改客户端代码,测试用例通过. 但是在本文中, 我们有在客户端进行任何更改吗?-没有.
|
||||
在大多数应用中,我们与外部网络或者数据库进行交互。一个测试用例运行时可以向服务器发送一个请求,并获取成功或失败的返回信息。但是不能因从服务器获取到失败信息,就认为测试用例没有通过。这样想这个问题 - 如果测试用例失败,然后我们修改客户端代码,以便测试用例通过。 但是在本例中, 我们要在客户端进行任何更改吗?- **NO**。
|
||||
|
||||
但是你应该也无法避免要测试网络请求和响应. 由于服务器是一个外部代理, 我们可以设想一个场景,发送一些可能导致程序崩溃的错误请求. 因此, 你写的测试用例应该覆盖所有可能来自服务器的响应,通过这种方式来保证你的代码不会崩溃.
|
||||
但是你应该也无法完全避免要测试网络请求和响应。由于服务器是一个外部代理,我们可以设想一个场景,发送一些可能导致程序崩溃的错误响应。因此, 你写的测试用例应该覆盖所有可能来自服务器的响应,甚至包括服务器决不会发出的响应。这样可以覆盖所有代码,并能保证应用可以处理所有响应,而不会崩溃。
|
||||
|
||||
> 正确的编写测试用例非常重要的.
|
||||
|
||||
感谢你阅读此文章。你可以联系我[LinkedIn][1]. 你还可以阅读我的其他文章[here][2].
|
||||
> 正确的编写测试用例与编写这些测试代码同等重要。
|
||||
|
||||
获取更多资讯请关注?_[_Mindorks_][3]_?, 你将获得我们的最新信息.
|
||||
感谢你阅读此文章。希望对测试用例写的更好有所帮助。你可以在 [LinkedIn][1] 上联系我。还可以[在这里][2]阅读我的其他文章。
|
||||
|
||||
获取更多资讯请关注_[Mindorks][3]_, 我们发新文章时您将获得通知。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -160,7 +160,7 @@ via: https://blog.mindorks.com/the-dos-and-don-ts-of-writing-test-cases-in-andro
|
||||
|
||||
作者:[Anshul Jain][a]
|
||||
译者:[kokialoves](https://github.com/kokialoves)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[jasminepeng](https://github.com/jasminepeng)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
|
@ -0,0 +1,139 @@
|
||||
|
||||
10个 Linux 系统管理员新年决心
|
||||
============================================================
|
||||
|
||||
当我们准备告别2016时,也到时间定下我们的新年决心了。不管你身为 Linux 系统管理员的经验水平如何,我们认为,制定接下来12个月的成长目标是很值得的。
|
||||
|
||||
万一你没什么想法的话,我们将会在这篇文章分享10个简单专业的决心,你可以为 2017 年考虑一下。
|
||||
|
||||
### 1. 决定更自动化
|
||||
|
||||
你没必要每天忙得像头无头苍蝇,忙于解决可预见的问题。如果你发现自己每天都花费时间在执行重复的任务,你有必要现在就停下来。
|
||||
|
||||
你了解了所有[基于 Linux 而且开源的工具][4]后,你能通过尽可能地[自动化你的 Linux 任务][5]来给你自己休闲的时间。
|
||||
|
||||
你会发现,接下来的几个决心会帮你在工作上朝着这个目标前进。所以继续看下去吧。
|
||||
|
||||
另外,帮自己一个忙,花费几分钟来浏览我们[免费的电子书][6]部分。
|
||||
|
||||
你将有机会下载跟[Bash shell 脚本编程][7]相关的书籍来巩固你的技能。开心地自动化!
|
||||
|
||||
### 2\. 学习一门新的脚本语言
|
||||
|
||||
虽然每一个系统管理员应该熟练地使用 Bash 编程,但考虑一下其他更现代化、鲁棒性更强的工具也是很重要的,例如 Python 。
|
||||
|
||||
但别只是相信我们说的话——点这个不久之前我们出版的[两篇关于 Python 的系列文章][9]。你将会意识到,与其他相比,Python 带来了面向对象编程的力量和允许你写出更短、鲁棒性更强的脚本。
|
||||
|
||||
### 3\. 学习一门新的编程语言
|
||||
|
||||
除了学习一门新的脚本语言,(你也可以)决定花费点时间来开始学习或者巩固你的编程技能。不确定从何处开始?今年的 [Stackoverflow 开发者调查][10]表明 Javascript连续第三年继续引领最流行语言的榜单。
|
||||
|
||||
其他经典例如 Java 和 C 也值得考虑。来看我们[2016年最好的编程课程][11]
|
||||
|
||||
### 4\. 注册一个 Github 账户并且定期更新
|
||||
|
||||
特别是如果你是一个编程新手,你应该考虑一下在 Github 上展示你的成果。通过允许别人去复刻你的脚本或者程序,你就能提高知识水平和通过别人的帮帮助来创造出更复杂的软件。
|
||||
|
||||
在[《如何安装和注册 Github 帐号》][12]一文中了解更多。
|
||||
|
||||
### 5\. 向一个开源项目做贡献
|
||||
|
||||
在 Github 上向一个开源项目做贡献,这是另一个学习或者提高一门新脚本语言或者编程语言能力的好办法。
|
||||
|
||||
如果这吸引到了你的兴趣,点击 [Explore Github][13] 页面。这里你能按热度或者编程语言浏览仓库,你能在这里面找到一些有趣的事情来做。
|
||||
|
||||
在此基础上,你能因回馈社区而获得满足感。
|
||||
|
||||
|
||||
### 6\. 每月尝试一个新的发行版
|
||||
|
||||
经常会有新的发行版或者分支出现,你有不同的选项以供选择。谁知道你梦想中的发行版是否就在角落,而你还没发现它?每个月去一次 Distrowatch 然后选择一个新的发行版。
|
||||
|
||||
也别忘了[订阅 Techmint][14] 来获取新发行版的消息,这样说吧,了解刚出现的发行版。
|
||||
|
||||
如果你想要尝试一个新的发行版,希望我们的评论能帮你做出决定。也可以点击我们这里关于最好的 Linux发行版的文章:
|
||||
|
||||
|
||||
1. [2016年最好的5个注重安全的 Linux 发行版][1]
|
||||
2. [2016年最值得期待的 Linux 发行版][2]
|
||||
3. [2015年最流行的10个 Linux 发行版][3]
|
||||
|
||||
### 7\. 参加一个 Linux 或者开源会议。
|
||||
|
||||
如果你住在由 Linux 基金会赞助的会议举办地附近,我强烈建议你去参加会议。
|
||||
|
||||
这不仅将会给你一个巩固关于 Linux 知识的机会,而且将是个会见其他开源专家的机会。
|
||||
|
||||
### 8\. 从 Linux 基金会的免费或付费课程中学习
|
||||
|
||||
Linux 基金会分别通过 edX.org 和他们自己的入口,不断地提供免费或付费课程。
|
||||
|
||||
免费课程的话题包括(但不仅限于)Linux 介绍,云基础设施技术介绍和 OpenStack 介绍。
|
||||
|
||||
另一方面,付费课程包括 [LFCS 认证][16] 和 [LFCE 认证][17] 考试的准备,给开发者的 Linux ,内核内部构件,Linux 安全,性能试验,高可用性及其他。
|
||||
|
||||
另外,他们对企业课程有折扣,所以尝试去说服你上司来为你和你同事的训练付费。还有,也会提供周期性的免费在线研讨会,所以别忘了订阅他们的时事通讯。
|
||||
|
||||
你也可以考虑下看看我们最棒的[在线 Linux 训练课程][18]
|
||||
|
||||
### 9\. 每周在 Linux 论坛上回答特定数量的问题
|
||||
|
||||
另一个回馈社区的好方法是帮助那些刚开始使用 Linux 的人。你将会发现全网的 Linux 论坛上有许多人正在寻找着答复。
|
||||
|
||||
牢记你曾经也是像他们那样是个新手,试着换位思考。
|
||||
|
||||
### 10\. 教一个孩子或少年使用 Linux
|
||||
|
||||
如果我能回到20年前,我希望我能有台电脑,有个能[在青年时学习 Linux ][19]的机会。
|
||||
|
||||
我也希望我能比现在尽早地开始编程。毫无疑问,这样事情就会变得简单许多。那样会使我认为给孩子和青年教授至少是基础的 Linux 和编程技巧(我对我的孩子这样做)是个重要的尝试。
|
||||
|
||||
教育成长中的一代如何有效地使用开源技术将会给他们选择的自由,而他们会因此永远感激你。
|
||||
|
||||
##### 总结
|
||||
##### Summary
|
||||
|
||||
在这篇文章里我们分享了10个适合系统管理员的可能新年决心。[Tecmint.com][20]祝你在朝着目标的工作顺顺利利,希望你能在2017年成为我们网站的常客。
|
||||
|
||||
如果你有关于这篇文章的问题或者评论,永远不要犹豫地使用下面的表格。我们期待着收到您的信息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Gabriel Cánepa 是个 GNU/Linux 系统管理员和网页开发者,他来自阿根廷圣路易斯的 Villa Mercedes 。他供职于全球领先的消费品公司,享受在日常工作的方方面面使用 FOSS(自由及开源软件) 工具来提高生产效率。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/linux-system-administrators-new-years-resolutions-ideas/
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[ypingcn](https://github.com/ypingcn)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.tecmint.com/author/gacanepa/
|
||||
[1]: http://www.tecmint.com/best-security-centric-linux-distributions-of-2016/
|
||||
[2]: http://www.tecmint.com/top-linux-distributions-to-look-forward-in-2016/
|
||||
[3]: http://www.tecmint.com/10-top-most-popular-linux-distributions-of-2015/
|
||||
[4]: http://www.tecmint.com/category/top-tools/
|
||||
[5]: http://www.tecmint.com/using-shell-script-to-automate-linux-system-maintenance-tasks/
|
||||
[6]: http://tecmint.tradepub.com/category/information-technology-servers-and-linux-server-os/806/
|
||||
[7]: http://tecmint.tradepub.com/free/w_syst05/?p=w_syst05
|
||||
[8]: http://www.tecmint.com/category/python/
|
||||
[9]: http://www.tecmint.com/learn-python-programming-and-scripting-in-linux/
|
||||
[10]: http://stackoverflow.com/research/developer-survey-2016#technology
|
||||
[11]: https://deals.tecmint.com/collections/best-of-bundles-2016
|
||||
[12]: http://www.tecmint.com/install-git-centos-fedora-redhat/
|
||||
[13]: https://help.github.com/articles/where-can-i-find-open-source-projects-to-work-on/
|
||||
[14]: http://subscribe.tecmint.com/newsletter
|
||||
[15]: http://events.linuxfoundation.org/
|
||||
[16]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/
|
||||
[17]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/
|
||||
[18]: http://www.tecmint.com/linux-online-training-courses/
|
||||
[19]: http://www.tecmint.com/free-online-linux-learning-guide-for-beginners/
|
||||
[20]: http://tecmint.com/
|
@ -0,0 +1,121 @@
|
||||
2017 年最值得期待的 5 个新 Linux 发行版
|
||||
============================================================
|
||||
|
||||
如果你经常光顾 [Distrowatch][1] 网站,你会发现每一年的 Linux 系统流行度排行榜几乎都没啥变化。
|
||||
|
||||
排在前十名的一直都是那几个发行版,其它一些发行版也许现在还在排行榜中,到下一年年底就有可能不在了。
|
||||
|
||||
关于 Distrowatch 的一个大家很不了解的功能叫做[候选列表][2],它包括以下类型的发行版:
|
||||
|
||||
- 还未进行评审
|
||||
- 组件缺失或有缺陷
|
||||
- 相关的英文资料不够丰富
|
||||
- 该项目好像都没人进行维护
|
||||
|
||||
其它一些非常具有潜力,但是还未被评审的 Linux 系统发行版也是值得大家去关注的。注意,由于 Distrowatch 网站暂时没时间或人力去评审这些新的发行版,因此它们可能永远无法进入网站首页排名。
|
||||
|
||||
因此,我们将会跟大家分享下 **2017** 年最具潜力的 **5** 个新的 Linux 发行版系统,并且会对它们做一些简单的介绍。
|
||||
|
||||
由于 Linux 系统的生态圈都非常活跃,你可以期待着这篇文章后续的不断更新,或许在下一年中它将完全大变样了。
|
||||
|
||||
尽管如此,咱们还是来看下这些新系统吧!
|
||||
|
||||
### 1\. SemicodeOS 操作系统
|
||||
|
||||
[SemicodeOS 操作系统][3] 是一个专为程序员和 Web 开发人员设计的 Linux 发行版。它包括所有的开箱即用的代码编译器,[各种文本编辑器][4],[最流行的编程语言的 IDE 环境][5],以及团队协作编程工具。
|
||||
|
||||
即使你不是程序员或者开发人员,但是期望成为他们中的一员,SemicodeOS 系统自带的 Scratch IDE 工具可以在你起步时给以指引。尽管该系统还处于测试阶段,但是我相信这个基于 Sudan 的 Linux 发行版在接下来的一年中将会让 Linux 开源社区变得更加丰富多彩。
|
||||
|
||||
你可以通过其官网了解更多的详细信息。
|
||||
|
||||
[
|
||||

|
||||
][6]
|
||||
|
||||
*Semicode Linux 操作系统*
|
||||
|
||||
### 2\. EnchantmentOS 操作系统
|
||||
|
||||
[EnchantmentOS][7] 操作系统是一个基于 Xubuntu 16.04 的发行版,它包括一些经过特别挑选的对内存要求较低的应用程序。这无论对新老设备来说都是一个不错的选择。
|
||||
|
||||
它同样遵循 Xubuntu 系统的长期支持周期,并且旨在提供可靠和安全的 Linux 应用软件。除此这外,即便是对非技术人员,其内置的应用程序也都非常地简单易用。
|
||||
|
||||
还有, EnchantmentOS 系统即使从 USB 存储设备启动时也表现出超强的性能,这一点是其创建者引以为豪的。
|
||||
|
||||
[
|
||||

|
||||
][8]
|
||||
|
||||
*EnchantmentOS 操作系统*
|
||||
|
||||
### 3\. Escuelas Linux 操作系统
|
||||
|
||||
[Escuelas Linux 操作系统][9](在西班牙语中是 ”Linux 学校“ 的意思)是一个基于 Bodhi 的 Linux 发行版,它主要是为中小学教育而设计的,它包括各种各样的与教育相关的应用软件。请忽略其西班牙语名字,它也提供全英语支持。
|
||||
|
||||
Escuelas Linux 系统其它方面的特性就是它使用的是轻量级桌面环境,低内存和低存储空间要求。其官网宣称,该系统只需要 300 MB 的内存和 20 GB 的硬盘存储空间就可以完美运行。
|
||||
|
||||
[
|
||||

|
||||
][10]
|
||||
|
||||
*Escuelas Linux 操作系统*
|
||||
|
||||
### 4\. OviOS 操作系统
|
||||
|
||||
与前面几个 Linux 发行版截然不同的是,[OviOS 操作系统][11] 并不是一个多用途的操作系统。相反,它被描述为企业级存储操作系统,虽然它不基于任何发行版,但是完全与 Linux 标准库(LSB)相兼容。
|
||||
|
||||
你可以把 OviOS 系统作为一种功能强大的存储设备,它能够处理 iSCSI,NFS,SMB 或者是 FTP 服务,除此之外,最新版的 OviOs 系统还能实现复制及高可用性。因此,你还在等什么呢?赶紧去试用一下吧。
|
||||
|
||||
[
|
||||

|
||||
][12]
|
||||
|
||||
*OviOS 操作系统*
|
||||
|
||||
### 5\. <ruby>开放式网络 Linux 操作系统<rt>Open Network Linux</rt></ruby>
|
||||
|
||||
[ONL][13] 操作系统(简称)是一个基于 Debian 的发行版,而且(就像 OviOs 操作系统一样),它也不是一个多用途的操作系统。
|
||||
|
||||
如果你是一名网络管理员,你应该为找到这个操作系统而感到庆幸(如果你之前不知道的话),你可以把 ONL 系统应用于裸交换机设备上,替换原有的昂贵且需要授权的操作系统。
|
||||
|
||||
值得注意的是, ONL 操作系统因其包含各种各样的开箱即用的软件而出名,并且这些软件都是与面向网络的裸设备相关的。你准备好去尝试了吗?
|
||||
|
||||
##### 总结
|
||||
|
||||
你应该注意到所有这些发行版在最近几个月内都已经提交给 Distrowatch 网站进行评审了。如果你对其中一些比较感兴趣,可以查看 [候选列表][14] 页面,单击发行版名称旁边的 **推荐** 按钮。你所做的操作将会推动 Distrowatch 网站安排相关人员对该系统进行评审。
|
||||
|
||||
像往常一样,如果你对这篇文章有任何问题或建议,请随意提出来。请通过下面的评论区随时与我们进行交流。我们非常期待你的参与!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Gabriel Cánepa 来自 Argentina , San Luis , Villa Mercedes ,他是一名 GNU/Linux 系统管理员和网站开发工程师。目前在一家世界领先的消费品公司工作,在日常工作中,他非常善于使用 FOSS 工具来提高公司在各个领域的生产率。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/new-linux-distributions-2017/
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[rusking](https://github.com/rusking)
|
||||
校对:[jasminepeng](https://github.com/jasminepeng)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/gacanepa/
|
||||
[1]:http://distrowatch.com/
|
||||
[2]:http://distrowatch.com/dwres.php?resource=links#new
|
||||
[3]:http://www.semicodeos.com/
|
||||
[4]:http://www.tecmint.com/best-open-source-linux-text-editors/
|
||||
[5]:http://www.tecmint.com/best-linux-ide-editors-source-code-editors/
|
||||
[6]:http://www.tecmint.com/wp-content/uploads/2016/12/Semicode-Linux-Distro.png
|
||||
[7]:http://enchantment.sourceforge.net/
|
||||
[8]:http://www.tecmint.com/wp-content/uploads/2016/12/EnchantmentOS.jpg
|
||||
[9]:https://escuelaslinux.sourceforge.io/
|
||||
[10]:http://www.tecmint.com/wp-content/uploads/2016/12/escuelaslinux.png
|
||||
[11]:http://www.ovios.org/
|
||||
[12]:http://www.tecmint.com/wp-content/uploads/2016/12/ovios.png
|
||||
[13]:http://www.opennetlinux.org/
|
||||
[14]:http://distrowatch.com/dwres.php?resource=links#new
|
@ -1,192 +0,0 @@
|
||||
嗨,本教程中,我们将学习如何使用 docker 部署 golang web 应用程序。 你可能已经知道,由于 golang 的高性能和可靠性,docker是完全是用 golang 写的。在我们详细介绍之前,请确保你已经安装了 docker 以及 golang 并对它们有基本了解。
|
||||
|
||||
|
||||
### 关于 docker
|
||||
|
||||
Docker 是一个开源程序,它使一个 Linux 应用程序捆绑完整的依赖并打包为容器来共享主机操作系统的相同内核。 另一方面,像 VMware 这样的基于 hypervisor 的虚拟化操作系统容器提供了高级别的隔离和安全性,由于客户机和主机之间的通信是通过 hypervisor 来实现的,因为它们不共享内核空间。这也导致了由于硬件仿真带来的性能开销。 所以容器虚拟化诞生了以确保一个轻量级的虚拟环境,它将一组进程和资源与主机以及其他容器分组及隔离。因此,容器内部的进程无法看到容器外部的进程或资源。
|
||||
|
||||
### 用 Go 语言创建一个 "Hello World" web 应用
|
||||
|
||||
让我们创建一个 Go 应用的目录,它会在浏览器中显示“Hello World”。创建一个 web 应用目录并使它成为当前页面。进入 web 应用目录并编辑一个 “main.go”。
|
||||
|
||||
root@demohost:~# mkdir web-app
|
||||
root@demohost:~# cd web-app/
|
||||
root@demohost:~/web-app# vim.tiny main.go
|
||||
|
||||
package main
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Hello %s", r.URL.Path[1:])
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/World", handler)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
使用下面的命令运行上面的 “Hello World” Go 程序。在浏览器中输入 http://127.0.0.1:8080/World 测试,你会在浏览器中看到“Hello World”。
|
||||
|
||||
root@demohost:~/web-app# PORT=8080 go run main.go
|
||||
|
||||
下一步是将上面的应用容器化。因此我们会创建一个 dockerfile 文件,它会告诉 docker 如何容器化我们的 web 应用。
|
||||
|
||||
root@demohost:~/web-app# vim.tiny Dockerfile
|
||||
|
||||
# 得到最新的golang docker 镜像
|
||||
FROM golang:latest
|
||||
|
||||
# 在容器内部创建一个目录来存储我们的 web 应用,接着使它称为工作目录。
|
||||
RUN mkdir -p /go/src/web-app
|
||||
WORKDIR /go/src/web-app
|
||||
|
||||
# 复制 web 目录到容器中
|
||||
COPY . /go/src/web-app
|
||||
|
||||
# 下载并安装第三方依赖到容器中
|
||||
RUN go-wrapper download
|
||||
RUN go-wrapper install
|
||||
|
||||
# 设置 PORT 环境变量
|
||||
ENV PORT 8080
|
||||
|
||||
# 给主机暴露 8080 端口,这样外部网络可以访问你的应用
|
||||
EXPOSE 8080
|
||||
|
||||
# 告诉 Docker 启动容器运行的命令
|
||||
CMD ["go-wrapper", "run"]
|
||||
|
||||
### 构建/运行容器
|
||||
|
||||
使用下面的命令构建你的 Go web 应用,你会在成功构建后获得确认。
|
||||
|
||||
root@demohost:~/web-app# docker build --rm -t web-app .
|
||||
Sending build context to Docker daemon 3.584 kB
|
||||
Step 1 : FROM golang:latest
|
||||
latest: Pulling from library/golang
|
||||
386a066cd84a: Already exists
|
||||
75ea84187083: Pull complete
|
||||
88b459c9f665: Pull complete
|
||||
a31e17eb9485: Pull complete
|
||||
1b272d7ab8a4: Pull complete
|
||||
eca636a985c1: Pull complete
|
||||
08158782d330: Pull complete
|
||||
Digest: sha256:02718aef869a8b00d4a36883c82782b47fc01e774d0ac1afd434934d8ccfee8c
|
||||
Status: Downloaded newer image for golang:latest
|
||||
---> 9752d71739d2
|
||||
Step 2 : RUN mkdir -p /go/src/web-app
|
||||
---> Running in 9aef92fff9e8
|
||||
---> 49936ff4f50c
|
||||
Removing intermediate container 9aef92fff9e8
|
||||
Step 3 : WORKDIR /go/src/web-app
|
||||
---> Running in 58440a93534c
|
||||
---> 0703574296dd
|
||||
Removing intermediate container 58440a93534c
|
||||
Step 4 : COPY . /go/src/web-app
|
||||
---> 82be55bc8e9f
|
||||
Removing intermediate container cae309ac7757
|
||||
Step 5 : RUN go-wrapper download
|
||||
---> Running in 6168e4e96ab1
|
||||
+ exec go get -v -d
|
||||
---> 59664b190fee
|
||||
Removing intermediate container 6168e4e96ab1
|
||||
Step 6 : RUN go-wrapper install
|
||||
---> Running in e56f093b6f03
|
||||
+ exec go install -v
|
||||
web-app
|
||||
---> 584cd410fdcd
|
||||
Removing intermediate container e56f093b6f03
|
||||
Step 7 : ENV PORT 8080
|
||||
---> Running in 298e2a415819
|
||||
---> c87fd2b43977
|
||||
Removing intermediate container 298e2a415819
|
||||
Step 8 : EXPOSE 8080
|
||||
---> Running in 4f639a3790a7
|
||||
---> 291167229d6f
|
||||
Removing intermediate container 4f639a3790a7
|
||||
Step 9 : CMD go-wrapper run
|
||||
---> Running in 6cb6bc28e406
|
||||
---> b32ca91bdfe0
|
||||
Removing intermediate container 6cb6bc28e406
|
||||
Successfully built b32ca91bdfe0
|
||||
|
||||
现在可以运行我们的 Go 应用了,可以执行下面的命令。
|
||||
|
||||
root@demohost:~/web-app# docker run -p 8080:8080 --name="test" -d web-app
|
||||
7644606b9af28a3ef1befd926f216f3058f500ffad44522c1d4756c576cfa85b
|
||||
|
||||
进入 http://localhost:8080/World 浏览你的 web 应用。你已经成功容器化了一个可重复的/确定性的容器化 Go web 应用。使用下面的命令来启动、停止并检查容器的状态。
|
||||
|
||||
列出所有容器
|
||||
root@demohost:~/ docker ps -a
|
||||
|
||||
使用 id 启动容器
|
||||
root@demohost:~/ docker start CONTAINER_ID_OF_WEB_APP
|
||||
|
||||
使用 id 停止容器
|
||||
root@demohost:~/ docker stop CONTAINER_ID_OF_WEB_APP
|
||||
|
||||
### 重新构建镜像
|
||||
|
||||
假设你正在开发 web 应用程序并在更改代码。现在要在更新代码后查看结果,你需要重新生成 docker 镜像、停止旧镜像并运行新镜像,并且每次更改代码时都会继续。为了使这个过程自动化,我们将使用 docker 卷在主机和容器之间共享一个目录。这意味着你不必重新构建镜像以在容器内进行更改。容器如何检测你是否对 web 程序的源码进行了更改?答案是有一个名为 “Gin” 的好工具[https://github.com/codegangsta/gin][1],它能检测是否对源码进行了任何更改、重建镜像/二进制文件并在容器内运行更新过代码的进程。
|
||||
|
||||
要使这个过程自动化,我们将编辑 Dockerfile 并安装 Gin 将其作为 entry 命令执行。我们将开放 3030 端口(Gin代理),而不是 8080。 Gin 代理将转发流量到 8080 端口的 web 程序。
|
||||
|
||||
root@demohost:~/web-app# vim.tiny Dockerfile
|
||||
|
||||
# 得到最新的 golang docker 镜像
|
||||
FROM golang:latest
|
||||
|
||||
# 在容器内部创建一个目录来存储我们的 web 应用,接着使它称为工作目录。
|
||||
RUN mkdir -p /go/src/web-app
|
||||
WORKDIR /go/src/web-app
|
||||
|
||||
# 复制 web 程序到容器中
|
||||
COPY . /go/src/web-app
|
||||
|
||||
# 下载并安装第三方依赖到容器中
|
||||
RUN go get github.com/codegangsta/gin
|
||||
RUN go-wrapper download
|
||||
RUN go-wrapper install
|
||||
|
||||
# 设置 PORT 环境变量
|
||||
ENV PORT 8080
|
||||
|
||||
# 给主机暴露 8080 端口,这样外部网络可以访问你的应用
|
||||
EXPOSE 3030
|
||||
|
||||
# 启动容器时运行 Gin
|
||||
CMD gin run
|
||||
|
||||
# 告诉 Docker 启动容器运行的命令
|
||||
CMD ["go-wrapper", "run"]
|
||||
|
||||
现在构建镜像并启动容器:
|
||||
|
||||
root@demohost:~/web-app# docker build --rm -t web-app .
|
||||
|
||||
我们会在当前 web 程序的根目录下运行 docker 并通过暴露的 3030 端口链接 CWD 到容器中的应用目录下。
|
||||
|
||||
root@demohost:~/web-app# docker run -p 3030:3030 -v `pwd`:/go/src/web-app --name="test" -d web-app
|
||||
|
||||
打开 http://localhost:3030/World, 你就能看到你的 web 程序了。现在如果你改变了任何代码,它会在刷新后反应在你的浏览器中。
|
||||
|
||||
### 总结
|
||||
|
||||
就是这样,我们的 Go web 应用已经运行在 Ubuntu 16.04 Docker 容器中运行了!你可以通过使用 Go 框架来快速开发 API、网络应用和后端服务,从而扩展当前的网络应用。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/containers/setup-go-docker-deploy-application/
|
||||
|
||||
作者:[Dwijadas Dey][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/dwijadasd/
|
||||
[1]:https://github.com/codegangsta/gin
|
82
translated/tech/20161230 Hot programming trends in 2016.md
Normal file
82
translated/tech/20161230 Hot programming trends in 2016.md
Normal file
@ -0,0 +1,82 @@
|
||||
2016 年的编程趋势
|
||||
============================================================
|
||||
|
||||
### 回顾年度最热门的 AI 项目语言、新语言和更多编程趋势。
|
||||
|
||||

|
||||
图片提供:
|
||||
|
||||
[Museum of Photographic Arts][6]. 由 Opensource.com 修改。 CC BY-SA 4.0
|
||||
|
||||
技术在不断前进 - 可能不总是向前,但总是在变动。即使对于那些关注趋势及其对程序员的影响的人来说,确切地了解技术的方向也是一个挑战。当我与我的同事,Kelsey Hightower 和 Scott Hanselman,和我们的非常棒的编程委员会,以塑造来年的[OSCON] [7](O'Reilly 开放源码公约 ),我清楚地看到开源编程趋势总是出现在秋天。我们获得的建议和关注特定主题的数字被证明是开源世界热门趋势的良好指标。以下是我们在 2016 年看到的顶级编程趋势的概述。
|
||||
|
||||
### 语言驱动 AI
|
||||
|
||||
在 20 世纪 90 年代的人工智能冬季,人工智能随着计算能力的提升再次出现,它一直影响我们如何构建软件。机器学习、深度学习、自然语言处理和汽车语音识别覆盖了世界各地 - 从 GitHub 的项目和工作岗位,到新公司成立背后的原因,以及清除我们杂乱的台面上的空间(嘿,Alexa!)。是的,即使像 OSCON 这样的会议都处处提及 AI。虽然计算能力的可用性已经铺平了道路,所有关于 AI 的开源已经引起了行业广泛开放的创新和竞争。谷歌的 [TensorFlow][8]、[OpenAI][9] 和 [Apache Spark][10]领导的强大框架,但也有较小的球员,如 [Nervana][11] 的 [Neon][12] 和 [Theano][13]。
|
||||
|
||||
AI 的兴起如何影响软件开发者的前景?好了,现在是了解 Python 的好时机 - 它的敏捷性和流行性与数据工程师和科学家使它成为最流行的AI编程语言,其次是R、Java和Scala。
|
||||
|
||||
### 容器和 Go 的结合就像花生、黄油和果冻
|
||||
|
||||
[Go 1.0 发布][14]于 2012 年 3 月。紧接着 [Docker][15] 在一年后发布,[Kubernetes][16] 在另外一年后发布。总之,Go 并不是如我们所知的那样专为基础设施的未来而设计的,但 Go 似乎是为了填充编程世界的一个主要的空洞。对于一个高度联网的世界,一个必须拥有一流并发性的世界而言,Go 是以 Java 或 C++ 永远不会存在的方式专门写的。如果你在做这些事或者类似的事,你应该至少在 Go 世界的尖端,因为它正在发展中,它将会被使用多年,并成为许多程序的骨干。
|
||||
|
||||
### Swift 超越了 Apple 的生态系统
|
||||
|
||||
Swift 是[ Apple 在 2015 年发布不就之后就开源的][17]。Swift 已经成为 iOS 和 Mac OS X 开发人员的热门话题。这种语言很容易理解因此很快流行起来,并且它比它要取代的语言 - Objective-C 和 C++ 赢得了一个[更安全的声誉][18]。在[ JavaScript 框架][19]和其他新语言的世界中 Swift 的成功如何成功仍有待观察,但如果它继续获得苹果忠实用户的欢迎,Swift 将有机会成为伟大的网络世界中有望成功的竞争者和超越者。
|
||||
|
||||
### Java 8 vs 使用 JVM 的函数式语言
|
||||
|
||||
Java 8 的函数式能力(即引入 Lambdas )的出现使得 JVM 语言(如 Scala 和 Clojure)上榜单了。最近,很大程度上由于 Apache Spark 的增长使得 Scala 有一点小爆发。因为长期的和新的开发人员一起都来关注 Java 8 所带来的东西,至少在那一刻,Scala 和 Clojure 似乎被搁置。Java 现在能够解决并发和大数据关心的事,这些其他编程语言专门为满足这些要求已经做了多年。在 2017 年,OSCON 几乎缺乏 Scala 和 Clojure 的提案,不是因为设计,但似乎潜在发言者没有什么兴趣提交提案。
|
||||
|
||||
### 新兴语言
|
||||
|
||||
和往常一样,世上总是有更多的新兴语言,旨在把事情做得更好,它们可以做到从前的语言出现时没有的需求,或者开始只是疯狂思想,最终改变了我们对编程的看法。今年有五种语言即将进入大时代:Rust、Elixir、Elm、Kotlin和 Perl 6。
|
||||
|
||||
这 5 个会给行业带来什么?
|
||||
|
||||
* [Rust][1]:兼顾速度和一定安全的系统编程语言。
|
||||
* [Elixir][2]:函数式、动态和容错,适用于那些规模越来越大的应用程序。
|
||||
* [Elm][3]:更多函数式的乐趣,使用 JavaScript,学习成为一种乐趣。
|
||||
* [Kotlin][4]:这一个是为使用 Java 和 JVM 的人设计的语言 - 静态类型、安全,我提到Java兼容?
|
||||
* [Perl 6] [5]:它还活着!Perl 6 碰巧是一种新的语言,它胜在富有表现力和功能丰富。
|
||||
|
||||
时间会告诉他们是否会如约发布。尝试他们,为他们贡献,成为未来的一部分!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Rachel Roumeliotis - O'Reilly Media,Inc.的战略内容总监,领导了一个编辑团队,其涵盖各种各样的编程主题,从全栈 web 开发到企业中的开源到新兴的编程语言。她是 OSCON,O'Reilly软件架构会议和 Fluent 的编程主席。 她从事技术出版工作超过10年,获得许多领域的内容,包括移动编程、UX、计算机安全。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/16/12/yearbook-top-programming-trends-2016
|
||||
|
||||
作者:[Rachel Roumeliotis][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/rroumeliotis
|
||||
[1]:https://www.rust-lang.org/en-US/
|
||||
[2]:http://elixir-lang.org/
|
||||
[3]:http://elm-lang.org/
|
||||
[4]:https://kotlinlang.org/
|
||||
[5]:https://perl6.org/
|
||||
[6]:https://www.flickr.com/photos/mopa1/5710937421/in/photolist-9GE3Ji-6tCkcs-otWCnW-wkkhM8-tm7Nah-7vwJ3Q-68HXuT-oruzry-7Dnhxt-oeUiuj-otcNUW-oyfLei-i1n1f6-owqxpT-i8RyRi-owbQS4-ovnJwp-otgwsB-qtFP4G-i1yVzD-i9cB9K-i1Db76-8eHe5n-i8VwCo-oupp7X-ouCYj2-i7VHNV-qrLEpj-ou6mGD-otHdws-55Bcba-ba4NaZ-owr9WM-r5rFgN-i1As83-i9e17E-of1nLV-ocbpqf-occJbg-oeZBT4-oujeML-obZjTD-oePhsw-odkejY-5ohHHH-odjBfU-odkSVS-otTy9e-obWKAc-ouXqVQ
|
||||
[7]:http://conferences.oreilly.com/oscon/oscon-tx
|
||||
[8]:https://www.tensorflow.org/
|
||||
[9]:https://openai.com/blog/
|
||||
[10]:http://spark.apache.org/
|
||||
[11]:https://www.nervanasys.com/
|
||||
[12]:https://github.com/NervanaSystems/neon
|
||||
[13]:https://github.com/benanne/nervana_theano
|
||||
[14]:https://blog.golang.org/go-version-1-is-released
|
||||
[15]:https://opensource.com/resources/what-docker
|
||||
[16]:https://opensource.com/resources/what-is-kubernetes
|
||||
[17]:https://opensource.com/life/15/12/most-likely-succeed-2016
|
||||
[18]:http://www.infoworld.com/article/2920333/mobile-development/swift-vs-objective-c-10-reasons-the-future-favors-swift.html
|
||||
[19]:https://opensource.com/article/16/11/15-javascript-frameworks-libraries
|
@ -0,0 +1,258 @@
|
||||
如何用 shell 跟踪跟踪命令在 shell 中的执行
|
||||
============================================================
|
||||
|
||||
在本文的[ shell 脚本调试系列][3]中,我们将解释第三种 shell 脚本调试模式,即 shell 跟踪,并查看一些示例来演示它如何工作以及如何使用它。
|
||||
|
||||
本系列的前面部分清晰地阐明了另外两种 shell 脚本调试模式:verbose 模式和语法检查模式,以及如何在这些模式下启用 shell 脚本调试的易于理解的示例。
|
||||
|
||||
1. [如何在 Linux 中启用 shell 脚本调试模式 - 第1部分][1]
|
||||
2. [如何在 shell 脚本中执行语法检查调试模式 - 第2部分][2]
|
||||
|
||||
shell 跟踪只是跟踪 shell 脚本中的命令的执行。要打开 shell 跟踪,请使用 `-x` 调试选项。
|
||||
|
||||
这让 shell 在终端上执行时显示所有命令及其参数。
|
||||
|
||||
我们将使用下面的 `sys_info.sh` shell 脚本,它会简要地打印你的系统日期和时间、登录的用户数和系统的运行时间。但是它包含我们需要查找和更正的语法错误。
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
#script to print brief system info
|
||||
ROOT_ID="0"
|
||||
DATE=`date`
|
||||
NO_USERS=`who | wc -l`
|
||||
UPTIME=`uptime`
|
||||
check_root(){
|
||||
if [ "$UID" -ne "$ROOT_ID" ]; then
|
||||
echo "You are not allowed to execute this program!"
|
||||
exit 1;
|
||||
}
|
||||
print_sys_info(){
|
||||
echo "System Time : $DATE"
|
||||
echo "Number of users: $NO_USERS"
|
||||
echo "System Uptime : $UPTIME
|
||||
}
|
||||
check_root
|
||||
print_sys_info
|
||||
exit 0
|
||||
```
|
||||
|
||||
保存文件并执行脚本。脚本只能用 root 用户运行,因此如下使用[ sudo 命令][4]运行:
|
||||
|
||||
```
|
||||
$ chmod +x sys_info.sh
|
||||
$ sudo bash -x sys_info.sh
|
||||
```
|
||||
[
|
||||

|
||||
][5]
|
||||
|
||||
shell 跟踪 - 显示脚本中的错误
|
||||
|
||||
从上面的输出我们可以观察到,命令首先在其输出被替换为变量的值之前执行。
|
||||
|
||||
例如,首次执行 date,其输出被替换为变量 DATE 的值。
|
||||
|
||||
我们可以执行语法检查,只显示语法错误,如下所示:
|
||||
|
||||
```
|
||||
$ sudo bash -n sys_info.sh
|
||||
```
|
||||
[
|
||||

|
||||
][6]
|
||||
|
||||
脚本中语法检查
|
||||
|
||||
如果我们批判地看这个 shell 脚本,我们就会发现 `if 语句`缺少了 `fi` 关键字。因此,让我们加上它,新的脚本应该看起来像这样:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
#script to print brief system info
|
||||
ROOT_ID="0"
|
||||
DATE=`date`
|
||||
NO_USERS=`who | wc -l`
|
||||
UPTIME=`uptime`
|
||||
check_root(){
|
||||
if [ "$UID" -ne "$ROOT_ID" ]; then
|
||||
echo "You are not allowed to execute this program!"
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
print_sys_info(){
|
||||
echo "System Time : $DATE"
|
||||
echo "Number of users: $NO_USERS"
|
||||
echo "System Uptime : $UPTIME
|
||||
}
|
||||
check_root
|
||||
print_sys_info
|
||||
exit 0
|
||||
```
|
||||
|
||||
再次保存文件并以 root 执行,同时做语法检查:
|
||||
|
||||
```
|
||||
$ sudo bash -n sys_info.sh
|
||||
```
|
||||
[
|
||||

|
||||
][7]
|
||||
|
||||
在 shell 脚本中执行语法检查
|
||||
|
||||
上面的语法检查操作的结果仍然显示在脚本的第 21 行还有一个错误。所以,我们仍然要纠正一些语法。
|
||||
|
||||
如果我们再分析一次脚本,第 21 行的错误是由于在 `print_sys_info` 函数内最后一个 [echo 命令][8]中没有闭合双引号`(”)`。
|
||||
|
||||
我们将在 echo 命令中添加闭合双引号并保存文件。修改过的脚本如下:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
#script to print brief system info
|
||||
ROOT_ID="0"
|
||||
DATE=`date`
|
||||
NO_USERS=`who | wc -l`
|
||||
UPTIME=`uptime`
|
||||
check_root(){
|
||||
if [ "$UID" -ne "$ROOT_ID" ]; then
|
||||
echo "You are not allowed to execute this program!"
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
print_sys_info(){
|
||||
echo "System Time : $DATE"
|
||||
echo "Number of users: $NO_USERS"
|
||||
echo "System Uptime : $UPTIME"
|
||||
}
|
||||
check_root
|
||||
print_sys_info
|
||||
exit 0
|
||||
```
|
||||
|
||||
现在在一次检查语法。
|
||||
|
||||
```
|
||||
$ sudo bash -n sys_info.sh
|
||||
```
|
||||
|
||||
上面的命令不会产生任何输出,因为我们的脚本语法上正确。我们也可以再次跟踪脚本执行,它应该工作得很好:
|
||||
|
||||
```
|
||||
$ sudo bash -x sys_info.sh
|
||||
```
|
||||
[
|
||||

|
||||
][9]
|
||||
|
||||
跟踪 shell 脚本执行
|
||||
|
||||
现在运行脚本。
|
||||
|
||||
```
|
||||
$ sudo ./sys_info.sh
|
||||
```
|
||||
[
|
||||

|
||||
][10]
|
||||
|
||||
用 shell 脚本显示日期、时间和运行时间
|
||||
|
||||
### shell 跟踪执行的重要性
|
||||
|
||||
shell 脚本跟踪帮助我们识别语法错误,更重要的是识别逻辑错误。例如,在`sys_info.sh` shell 脚本中的 `check_root` 函数,它用于确定用户是否为 root,因为脚本只允许由超级用户执行。
|
||||
|
||||
```
|
||||
check_root(){
|
||||
if [ "$UID" -ne "$ROOT_ID" ]; then
|
||||
echo "You are not allowed to execute this program!"
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
这里的魔法是由 `if 语句`表达式 `["$ UID" -ne "$ ROOT_ID"]` 控制的,一旦我们不使用合适的数字运算符(示例中为 `-ne`,这意味着不相等),我们最终会出现一个可能的逻辑错误。
|
||||
|
||||
假设我们使用 `-eq` (意思等于),这将允许任何系统用户以及 root 用户运行脚本,因此是一个逻辑错误。
|
||||
|
||||
```
|
||||
check_root(){
|
||||
if [ "$UID" -eq "$ROOT_ID" ]; then
|
||||
echo "You are not allowed to execute this program!"
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
注意:我们在本系列开头介绍的到 set 这个 shell 内置命令可以在shell脚本的特定部分激活调试。
|
||||
|
||||
因此,下面的行将帮助我们通过跟踪它在函数中的执行找到这个逻辑错误:
|
||||
|
||||
具有逻辑错误的脚本:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
#script to print brief system info
|
||||
ROOT_ID="0"
|
||||
DATE=`date`
|
||||
NO_USERS=`who | wc -l`
|
||||
UPTIME=`uptime`
|
||||
check_root(){
|
||||
if [ "$UID" -eq "$ROOT_ID" ]; then
|
||||
echo "You are not allowed to execute this program!"
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
print_sys_info(){
|
||||
echo "System Time : $DATE"
|
||||
echo "Number of users: $NO_USERS"
|
||||
echo "System Uptime : $UPTIME"
|
||||
}
|
||||
#turning on and off debugging of check_root function
|
||||
set -x ; check_root; set +x ;
|
||||
print_sys_info
|
||||
exit 0
|
||||
```
|
||||
|
||||
保存文件并调用脚本,在输出中,我们可以看到一个普通的系统用户可以没有 sudo 运行脚本。 这是因为 USER_ID 的值为100,不等于 ROOT_ID 为 0 的 root。
|
||||
|
||||
```
|
||||
$ ./sys_info.sh
|
||||
```
|
||||
[
|
||||

|
||||
][11]
|
||||
|
||||
不用 sudo 运行 shell 脚本
|
||||
|
||||
那么,现在我们已经到了[ shell 脚本调试系列][12]的末尾,可以在下面的反馈栏里给我们关于本篇或者本系列提出问题或反馈。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin、web开 发人员,目前是 TecMint 的内容创作者,他喜欢用电脑工作,并坚信分享知识。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/trace-shell-script-execution-in-linux/
|
||||
|
||||
作者:[Aaron Kili][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[jasminepeng](https://github.com/jasminepeng)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/aaronkili/
|
||||
[1]:http://www.tecmint.com/enable-shell-debug-mode-linux/
|
||||
[2]:http://www.tecmint.com/check-syntax-in-shell-script/
|
||||
[3]:http://www.tecmint.com/enable-shell-debug-mode-linux/
|
||||
[4]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
|
||||
[5]:http://www.tecmint.com/wp-content/uploads/2016/12/Shell-Tracing-Errors.png
|
||||
[6]:http://www.tecmint.com/wp-content/uploads/2016/12/Syntax-Checking-in-Script.png
|
||||
[7]:http://www.tecmint.com/wp-content/uploads/2016/12/Syntax-Check-in-Shell-Scripts.png
|
||||
[8]:http://www.tecmint.com/echo-command-in-linux/
|
||||
[9]:http://www.tecmint.com/wp-content/uploads/2016/12/Trace-Shell-Execution.png
|
||||
[10]:http://www.tecmint.com/wp-content/uploads/2016/12/Script-to-Show-Date-and-Uptime.png
|
||||
[11]:http://www.tecmint.com/wp-content/uploads/2016/12/Run-Shell-Script-Without-Sudo.png
|
||||
[12]:http://www.tecmint.com/enable-shell-debug-mode-linux/
|
@ -0,0 +1,62 @@
|
||||
2017 年 4 个 Linux 热门技能
|
||||
============================================================
|
||||
|
||||
### 你在新的一年里需要刷哪些技能?
|
||||
|
||||

|
||||
|
||||
图片提供:[Internet Archive Book Images][1]。由 Opensource.com 修改。 CC BY-SA 4.0
|
||||
|
||||
成为 Linux 专家的一个问题是专家定义在不断变化。当我进入 Linux 世界的时候,要被认为是一个 _Linux 专家_,你需要能够编译自己的内核。天啊,如果你想在笔记本电脑上使用 Linux,即便你只是_用户_,你也必须编译一个自定义内核。 如今编译自己的内核通常是浪费时间。这不是说它并不重要,但在开源世界,我们建立在他人的成功基础之上,而 Linux 发行版为我们提供了运行良好的内核。虽然不总是那么剧烈变化,但对 IT 专业人员的需求每年都在变化。
|
||||
|
||||
下面是 2017 年 Linux 专业人员的四个重要技能:
|
||||
|
||||
### 1\. 安全
|
||||
|
||||
我不是在讨论安全专家或安全顾问。这些职位和服务当然很重要,但是随着连接的设备渗透到我们生活的每一个方面,我们需要在我们做出的每一个决定中有[安全][2]意识。今年,我的妻子和我买了一台洗衣机和一台冰箱,它们都配备了蓝牙。黑客攻入我的漂洗系统的想法可能看起来很傻,但这都是潜在的攻击点。
|
||||
|
||||
当激活工作、家庭或我们的口袋中的任何系统时,我们应该考虑它们可能引发的安全问题。而且因为像联网烤面包机这样的物品不太可能及时获得固件升级,我们需要按照平凡的设备可能遭到破坏的思路来设计其余的系统。相比以前任何时候,我们更需要考虑来自防火墙内的攻击。不要让你的文件服务器被你的搅拌器破坏!
|
||||
|
||||
### 2\. DevOps
|
||||
|
||||
[DevOps][3] 不再是一个新概念。在过去两三年里,我们一直鼓励员工学习 DevOps,以便他们能够在员工队伍中取得成功。这是个好建议,但这并不意味着我们应该完全依赖自动化工具来完成我们的工作。Chef、Puppet、Ansible、Salt Stack 及类似的工具是美好的,但我们需要了解背后发生了什么,所以当发生一些不可避免的错误,我们应该知道如何解决它。
|
||||
|
||||
使用 DevOps 的程序方法来计算,我们仍然需要能够维护、修复和理解在代码层下运行的系统的人。没有 Linux 专家,云计算将是一个可怕的地方,即使那个云在你自己的机房里。
|
||||
|
||||
### 3\. 开发
|
||||
|
||||
作为系统管理员,20 年来,我从来没有时间学习编程。这听起来可能是一个借口,但这是事实。我所有的开发技能就是基本的脚本编写,以帮助我更快工作。不过,那些日子已经结束了。虽然我们需要在 DevOps 世界中拥有系统管理技能,但我们还需要系统管理员拥有编程技能。
|
||||
|
||||
如果你是一个像我一样的老练的系统管理员,你可能已经采用 DevOps 并每天使用它。如果你真的想要胜过他人,你需要学习如何以编程方式解决问题,并且不认为 Chef 或 Puppet 代码只是配置文件。 每个 IT 专业人员都需要至少掌握编程概念,因为 DevOps 代码至少在某种程度上抽象了 IT 的每个方面。
|
||||
|
||||
### 4\. 软技能
|
||||
|
||||
通常,我们在准备职业生涯时所考虑的最后一件事是所谓的 *软技能* - 社交和沟通技巧 - 但是他们可能是最有可能决定你的成功的技能。无论你正在寻找一份新工作,还是试图适应当前职业生涯的变化,软技能是至关重要的。
|
||||
|
||||
划分 IT 各个领域的线是交错的,并且良好的沟通能力使得这些模糊的线成为一个优点,而不是绊脚石。我们正生活在一个开发人员围绕着服务器,而运维团队编写 Ruby 代码来维护服务器农场的世界里。这些都是 IT 中的大胆的新思想,如果人们不能在不同部门间很好的沟通,工作场所将迅速有敌对气氛。此外,IT 人员总是需要与其他业务领域的人员进行有效沟通。而且,现在比以往有更大的需求。
|
||||
|
||||
|
||||
你计划在 2017 年里添加什么到你的技能中?在评论栏中让我们知道吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Shawn Powers - 自 2009 年起是 CBT Nuggets (www.cbtnuggets.com) 的一名 IT 训练员,专于 Linux、Chef 及为大规模网络集成多个平台。他在 2016 年 12 月发布了一个在线高级 Linux 认证课程(LPIC-2)。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/1/yearbook-4-hot-skills-linux-pros-2017
|
||||
|
||||
作者:[Shawn Powers][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[jasminepeng](https://github.com/jasminepeng)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/shawnpowers
|
||||
[1]:https://www.flickr.com/photos/internetarchivebookimages/14758810172/in/photolist-oubL5m-ocu2ck-odJwF4-oeq1na-odgZbe-odcugD-w7KHtd-owgcWd-oucGPe-oud585-rgBDNf-obLoQH-oePNvs-osVgEq-othPLM-obHcKo-wQR3KN-oumGqG-odnCyR-owgLg3-x2Zeyq-hMMxbq-oeRzu1-oeY49i-odumMM-xH4oJo-odrT31-oduJr8-odX8B3-obKG8S-of1hTN-ovhHWY-ow7Scj-ovfm7B-ouu1Hj-ods7Sg-qwgw5G-oeYz5D-oeXqFZ-orx8d5-hKPN4Q-ouNKch-our8E1-odvGSH-oweGTn-ouJNQQ-ormX8L-od9XZ1-roZJPJ-ot7Wf4
|
||||
[2]:https://opensource.com/tags/security
|
||||
[3]:https://opensource.com/tags/devops
|
@ -0,0 +1,177 @@
|
||||
PhotoRec – Recover Deleted or Lost Files in Linux
|
||||
============================================================
|
||||
在 Linux 系统下使用 PhotoRec 工具来恢复已删除或丢失的文件
|
||||
|
||||
当你在系统中有意或无意地使用 'shift + delete‘ 组合键或者删除选项或是清空回收站的方式来删除一个文件时,该文件的内容并没有从硬盘(或是其它存储设备)上直接销毁。
|
||||
|
||||
它仅仅是从系统的目录结构中被移除,然后你在删除文件的目录下就看不到该文件了,但是这个文件仍然存在你磁盘中的某个位置上。
|
||||
|
||||
如果你有一个合适的工具和相关的专业知识,你就可以[从电脑中恢复已丢失的文件][1]。然而,随着你存储的文件越来越多,删除的文件将会被覆盖,你只能恢复最近删除的文件。
|
||||
|
||||
在这篇文章中,我们将阐明如何在 Linux 系统中使用磁盘分区修复工具来恢复硬盘上已删除或丢失的文件,这个非常优秀的免费修复工具叫做 PhotoRec 。
|
||||
|
||||
PhoteRec 工具用于从存储介质比如硬盘,数码相机和 cdrom 设备中恢复丢失的文件。
|
||||
|
||||
### 在 Linux 系统中安装磁盘分区修复工具(PhotoRec)
|
||||
|
||||
在系统中执行以下相关的命令来安装磁盘分区修复工具:
|
||||
|
||||
```
|
||||
------- On Debian/Ubuntu/Linux Mint -------
|
||||
$ sudo apt-get install testdisk
|
||||
------- On CentOS/RHEL/Fedora -------
|
||||
$ sudo yum install testdisk
|
||||
------- On Fedora 22+ -------
|
||||
$ sudo dnf install testdisk
|
||||
------- On Arch Linux -------
|
||||
$ pacman -S testdisk
|
||||
------- On Gentoo -------
|
||||
$ emerge testdisk
|
||||
```
|
||||
|
||||
如果你的 Linux 系统 yum 源仓库中没有这个安装包,可以从 [这里][2] 下载然后在 Live CD 中运行即可。
|
||||
|
||||
这个安装包也可以在其它应急修复 CD 工具中找到,比如 Gparted LiveCD 、 Parted Magic 、 Ubuntu Boot CD 、 Ubuntu-Rescue-Remix 及其它工具中也有。
|
||||
|
||||
安装完成之后,使用 root 账号权限打开控制台界面,启动 PhotoRec 工具,并指定已删除文件的分区:
|
||||
|
||||
```
|
||||
$ sudo photorec /dev/sda3
|
||||
```
|
||||
|
||||
你将会看到下面的交互界面:
|
||||
|
||||
[
|
||||

|
||||
][3]
|
||||
|
||||
Linux 系统 PhotoRec 数据恢复工具
|
||||
|
||||
使用左右箭头选择菜单选项,按 Enter 键确认。要继续恢复操作,选择 '[继续]' 并单击 Enter。
|
||||
|
||||
你将看到下面的界面:
|
||||
|
||||
[
|
||||

|
||||
][4]
|
||||
|
||||
选择分区进行文件恢复
|
||||
|
||||
选择 '[选项]' 来查看可用的恢复选项,如下图所示:
|
||||
|
||||
[
|
||||

|
||||
][5]
|
||||
|
||||
Linux 系统文件恢复选项
|
||||
|
||||
按 `Q` 返回,在下图界面,你可以指定你想要查询并恢复的文件扩展名。因此,选择 '[文件选项]' ,按 Enter 键确认。
|
||||
|
||||
按 's' 停止或启用所有文件扩展名,如果你已经停止所有文件扩展,只需要使用向右箭头选择你想要恢复的文件类型即可(或者按向左箭头取消选择)。
|
||||
|
||||
例如,我想恢复所有系统中丢失的 ’.mov‘ 类型的文件:
|
||||
|
||||
[
|
||||

|
||||
][6]
|
||||
|
||||
指定恢复文件类型
|
||||
|
||||
按 ‘b’ 键保存设置,之后你应该看到如下图所示信息。单击 Enter 键返回(或者按 ‘Q' 键),再将按 ’Q' 键返回到主界面。
|
||||
|
||||
[
|
||||

|
||||
][7]
|
||||
|
||||
保存文件恢复设置
|
||||
|
||||
现在选择 '[查询]' 开始文件恢复。在下图中,选择存储文件分区的文件系统类型,然后按 Enter 键。
|
||||
|
||||
[
|
||||

|
||||
][8]
|
||||
|
||||
选择文件系统类型来恢复删除的文件
|
||||
|
||||
下一步,如下图所示,选择是否对空闲空间或者是整个分区进行分析。注意选择整个分区将会让操作过程变得更长更慢。选择合适的选项后,按 Enter 键继续。
|
||||
|
||||
[
|
||||

|
||||
][9]
|
||||
|
||||
选择文件系统进行分析
|
||||
|
||||
注意选择一个目录用于存储将要恢复的文件,选择完成之后,按 ’C' 键继续。选择不同分区的目录以避免当更多的文件存储在这个分区时覆盖掉已删除的文件。
|
||||
|
||||
按向左箭头返回到根分区下。
|
||||
|
||||
[
|
||||

|
||||
][10]
|
||||
|
||||
选择要保存恢复文件的目录
|
||||
|
||||
下图显示正在被恢复的指定类型的已删除文件。你可以按 Enter 键来停止操作。
|
||||
|
||||
注意:在恢复的过程中,你的系统会变得很慢,很可能会卡住一段时间,请耐心等待直至恢复完成。
|
||||
|
||||
[
|
||||

|
||||
][11]
|
||||
|
||||
在 Linux 系统中恢复已删除的文件
|
||||
|
||||
最后, Photorec 工具将会显示出已恢复文件的数量及保存的路径。
|
||||
|
||||
[
|
||||

|
||||
][12]
|
||||
|
||||
Linux 文件恢复总结
|
||||
|
||||
默认情况下,已恢复的文件将会以 root 账号权限被保存,因此,你需要以提升权限的方式打开文件管理器来访问这些文件。
|
||||
|
||||
使用如下命令(指定你的文件管理器):
|
||||
|
||||
```
|
||||
$ gksudo nemo
|
||||
or
|
||||
$ gksudo nautilus
|
||||
```
|
||||
|
||||
想了解更多的信息,访问 PhotoRec 官网: [http://www.cgsecurity.org/wiki/PhotoRec][13]。
|
||||
|
||||
到此为止吧!在这篇文章中,我们阐明了使用 PhotoRec 工具来恢复磁盘中已删除或丢失文件每一个步骤。这是目前为止我使用过的最可靠和有效的恢复工具,如果你知道还有其它相似的工具,请在评论中跟大家分享。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
Aaron Kili 是一个 Linux 系统及 F.O.S.S 爱好者,即将成为一名系统管理员及 Web 开发人员,他现在是 TecMint 网站的内容创建者,他喜欢使用电脑来工作,并且他坚信分享知识是一种美德。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/
|
||||
|
||||
作者:[Aaron Kili][a]
|
||||
译者:[rusking](https://github.com/rusking)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/aaronkili/
|
||||
[1]:http://www.tecmint.com/recover-deleted-file-in-linux/
|
||||
[2]:http://www.cgsecurity.org/wiki/TestDisk_Download
|
||||
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/PhotoRec-Data-Recovery-Tool.png
|
||||
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Select-Partition-to-Proceed-File-Recovery.png
|
||||
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-File-Recovery-Options.png
|
||||
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Specify-Recovery-File-Type.png
|
||||
[7]:http://www.tecmint.com/wp-content/uploads/2017/01/Save-File-Recovery-Settings.png
|
||||
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Select-Filesystem-to-Recover-Files.png
|
||||
[9]:http://www.tecmint.com/wp-content/uploads/2017/01/Select-Filesystem-to-Analyze.png
|
||||
[10]:http://www.tecmint.com/wp-content/uploads/2017/01/Select-Directory-to-Save-Recovered-Files.png
|
||||
[11]:http://www.tecmint.com/wp-content/uploads/2017/01/Recover-Deleted-Files-in-Linux.png
|
||||
[12]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-File-Recovery-Summary.png
|
||||
[13]:http://www.cgsecurity.org/wiki/PhotoRec
|
@ -0,0 +1,67 @@
|
||||
使用 Exercism 提升你的编程技巧
|
||||
============================================================
|
||||
|
||||
### 这些练习目前已经支持 33 种编程语言了。
|
||||
|
||||

|
||||
>图片提供: opensource.com
|
||||
|
||||
我们中的很多人有一个 2017 年的目标,将提高我们的编程能力或学习如何编程在第一位。虽然我们可以访问许多资源,但是练习独立于特定职业的代码开发的艺术需要一些规划。Exercism.io 是为此确切目的而设计的一种资源。
|
||||
|
||||
Exercism 是一个开源项目和服务,旨在通过发现和协作的哲学帮助人们提高他们的编程技能。Exercism 提供了几十种不同编程语言的练习。实践者完成每个练习,接着根据他们的回复反馈,使他们能够从他们的同行小组的经验中学习。
|
||||
|
||||
这里有这么多同行! Exercism 在 2016 年留下了一些令人印象深刻的统计:
|
||||
|
||||
* 参加者来自201个不同国家
|
||||
* 自 2013 年 6 月以来 29,000 名参与者提交了演习,其中 15,500 名参加者仅在 2016 年提交练习
|
||||
* 自 2013 年 6 月以来 15,000 名参与者就练习解决方案提供反馈,其中 5,500 人在 2016 年提供反馈
|
||||
* 每月 50,000 名访客,每周超过 12,000 名访客
|
||||
* 目前练习支持 33 种编程语言,另外 22 种语言在支持中
|
||||
|
||||
该项目为所有级别的参与者提供了一系列小小的胜利,使他们能够“即使在低水平也能发展到高度流利”,Exercism 的创始人 [Katrina Owen][3] 这样说到。虽然 Exercism 并不旨在教导学员成为一名程序员,但它的练习使他们对语言及其瑕疵有深刻的了解。这种熟悉性消除了学习者对语言的认知负担(流利),使他们能够专注于更困难的架构和最佳实践(熟练)的问题。
|
||||
|
||||
Exercism 通过一系列练习(还有什么?)来做到这一点。程序员下载[命令行客户端][4],检索第一个练习,添加完成练习的代码,然后提交解决方案。提交解决方案后,程序员可以研究他人的解决方案,并从不同的方法学习同样的问题。更重要的是,每个解决方案来自其他参与者的反馈。
|
||||
|
||||
反馈是 Exercism 的超级力量。鼓励所有参与者不仅接收反馈而且提供反馈。根据 Owen 说的,Exercism 社区的成员从提供反馈比完成练习了解更多。她说:“这是一个强大的学习经验,你被迫发表内心感受,并检查你的假设、习惯和偏见”。她还指出,反馈可以有多种形式。
|
||||
|
||||
欧文说:“只要进入,观察并问问题”。
|
||||
|
||||
那些刚刚接触编程,甚至只是一种特定语言的人,可以通过质疑假设来提供有价值的反馈,同时通过协作和对话来学习。
|
||||
|
||||
除了实现对新语言的学习之外,Exercism 本身还强烈支持和鼓励项目的新贡献者。在[SitePoint.com][5]的一篇文章中,欧文强调:“如果你想为开源贡献代码,你所需要的技能水平只要‘够用’。” Exercism 不仅鼓励新的贡献者,它还尽可能地帮助新贡献者发布他们项目中的第一个补丁。到目前为止,有近 1000 人是[ Exercism 项目][6]的贡献者。
|
||||
|
||||
还会有大量新的贡献者来保持繁忙。 Exercism 目前正在审查[其语言轨道的健康][7],目的是使所有轨道可持续并避免维护者的倦怠。它还在寻求[捐赠][8]和赞助,聘请设计师提高网站的可用性。
|
||||
|
||||
Owen 说:“这些改进对于网站的健康以及为了 Exercism 参与者的发展是有必要的,但这些变化鼓励并减轻了新贡献者加入的途径。” 她说:“如果我们可以重新设计,产品方面将更加可维护。。。当用户体验一团糟,华丽的代码一点用也没有”。该项目有一个非常活跃的[讨论仓库][9],这里社区成员合作来发现最好的新方法和功能。
|
||||
|
||||
那些想关注项目但还没有参与的人可以关注[邮件列表][10]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||

|
||||
|
||||
VM(Vicky)Brasseur - VM(aka Vicky)是一名技术人员、项目、流程、产品和 p^Hbusinesses 的经理。在她超过18年的科技行业从业中,她一直是分析师、程序员、产品经理、软件工程经理和软件工程总监。 目前,她是 Hewlett Packard Enterprise 上游开源开发团队的高级工程经理。 VM 的博客在 anonymoushash.vmbrasseur.com,tweets 在 @vmbrasseur。
|
||||
|
||||
via: https://opensource.com/article/17/1/exercism-learning-programming
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者:[VM (Vicky) Brasseur][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/vmbrasseur
|
||||
[1]:http://exercism.io/
|
||||
[2]:https://github.com/exercism
|
||||
[3]:https://twitter.com/kytrinyx
|
||||
[4]:http://exercism.io/cli
|
||||
[5]:https://www.sitepoint.com/exorcise-your-newbie-demons-by-contributing-to-exercism/
|
||||
[6]:https://github.com/exercism
|
||||
[7]:http://tinyletter.com/exercism/letters/exercism-track-health-check-new-maintainers
|
||||
[8]:http://exercism.io/donate
|
||||
[9]:https://github.com/exercism/discussions/issues?page=1&q=is%3Aissue+is%3Aopen
|
||||
[10]:http://tinyletter.com/exercism/archive
|
Loading…
Reference in New Issue
Block a user