pull the newest lctt master

This commit is contained in:
zhousiyu325 2017-06-28 11:10:59 +08:00
commit 94adea2276
21 changed files with 810 additions and 681 deletions

View File

@ -0,0 +1,128 @@
六大标志性的开源形象概览
=====================
![六大标志性的开源形象概览](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_brandbalance.png?itok=opwotgEh "A look at 6 iconic open source brands")
品牌是营销的重要组成部分。完成了品牌的塑造并形成一定的影响力之后,一个简单的 Logo (比如说耐克旋风一样) 就会成为这个品牌的强大广告。如果你常常在美国各州之间穿梭你将会看各种描述品牌的标志符号如麦当劳的金色拱门golden arches。即便是没有任何文字或图像的简单色彩组合也是可以用来作为一个品牌的比如美国弗吉尼亚理工大学的栗色和橙色这种独特的色彩结合是很难被认错的。
所以,现在的问题是:品牌对于开源社区是否真的那么重要呢?
对于我和其他很多的人来说,是的,非常重要。开源软件要与付费软件进行竞争,那么它必须要将自己定义为切实可行的替代品。并且,它也必须要让人容易记住以及形成一定程度的影响力。如果某个开源软件项目以一种设计难看的 Logo、糟糕的口号、前后矛盾的信息来表现自己的话那它就很难引起大众的注意、难以记住和得到广泛使用。
现有很多项目这方面做得很好,我们可以从中寻找灵感和指导方法。以下是我最喜欢的六个开源品牌。
### 六大开源品牌
#### Linux
![Linux's Tux 吉祥物](https://opensource.com/sites/default/files/resize/linux-300x354.png "Linux's Tux mascot")
这个可爱的 Linux 企鹅叫做 Tux人们通常将其称为吉祥物而非 Logo。
Tux 是 Larry Ewing 在 1996 年使用 GIMP 0.54 创建出来的。按 Jeff Ayers 讲述的[故事][4]:自从 Linus Torvalds 1993 年在澳大利亚的某个动物园被一只企鹅咬了一口之后他就特别的钟爱它们。Torvalds 当时正在为 Linux 寻找一个有趣的形象他觉得一个饱食后正在休息的胖企鹅是一个不错的选择。Tux 同时也出现在视频游戏和麦片广告中,它甚至还有一个叫做 Gown 的异性同伴。正如 Mac 用户熟知那个被咬了一口的苹果、Windows 用户熟知那个飘动的窗口那样,作为 Linux 用户,你肯定也非常熟悉 Tux。
#### Mozilla
![Mozilla 2017 的新 Logo ](https://opensource.com/sites/default/files/resize/mozilla_1-650x185.png "Mozilla new logo 2017")
[Mozilla][5] 基金会是一个非营利组织和 [自由软件社区][6]。
近期,它完成了[品牌重建行动][7],其创意团队负责人 Tim Murray 这样写道:“该项目的核心就是应让人们更好地理解 Mozilla 自身的目的和商标的需求而生。我们的品牌标识,包括 Logo、口号及其设计是我们用以传递我们自身的信仰和所做的工作的重要信号。”
以真正的开源方式Mozilla 邀请所有的人来为项目贡献自己的力量。“数千个电子邮件、数百场会议、几十种理念,以及之后的三轮讨究,我们把自己的想法都分享了出来。”但是,他们仍然遵循指导方针进行,还需要你参与到贡献中来。
#### Firefox
![Firefox logo](https://opensource.com/sites/default/files/firefox_0.png "Firefox logo")
[Firefox][8] 是 Mozilla 开发的一款旗舰级软件产品,是一个非常受欢迎的 [web 浏览器][9]。
Firefox 中的 "fox" 实际上是一只红色的熊猫这是一种中国本土的像猫一样的真实动物。故事是这样的Firefox 原本有个 "Phoenix" 的别称,表明它是由 Netscape 浏览器发展而来的。但在经历了 Phoenix 科技的商标起诉之后,它更名为 Mozilla Firebird。然后Firebird RDMS 项目说它给其自己项目带来了歧义,其名称最终在 2004 年 02 月变更为 Mozilla Firefox。
平面设计师 Steve Garrity 对 Firefox 和 Phoenix 早期的 Logo 作出了批评,在“[品牌化 Mozilla走向 Mozilla 2.0][10] ”一文中详细阐述了各种缺陷。所以Mozilla 邀请 Garrity 来领导更好的品牌化工作。新的形象是由 silverorange 开发出来的,但最终的渲染却是 Jon Hicks 完成的,他同时也为 Camino、MailChimp 和 Opera 进行过品牌化工作。
早在 2013 年,[Jeopardy!][11] 上边关于询问 Firefox 使用哪个动物做 Logo 的帖子则成了最后的线索。三位回答者都不知道答案就是一个红色熊猫,而是回答了 “su”、 “raccoon” 和 “Excel”。
#### GIMP
![Wilber the Gimp logo](https://opensource.com/sites/default/files/resize/gimp-300x300.png "Wilber the Gimp logo")
GIMP 的 Logo 是由 Tuomas Kuosmanen 在 1997 年 09 月 25 日创建的 [Wilber the GIMP][12]。
GIMP 是 GNU 图像处理程序GNU Image Manipulation Program的缩写主要用于相片修整和图像处理。Wilber 现在已经有了一些配饰,比如 Simon Budig 设计的一顶安全帽、Raphaël Quintet 设计的巫师帽。根据 GIMP 的“[链接到我们][13]” 页面,它高度鼓励人们使用 Wilber你甚至可以在源代码中的 `/docs/Wilber_Construction_Kit.xcf.gz` 获得 Wilber 的构建素材。
那么Wilber 到底是那一种生物呢?很显然,这是一个值得热烈讨论的问题。在 [gimper.net][14] 上的一个论坛众说纷纭一种产于北美大草原的小狼coyote、熊猫、狗或者“高飞”Goofy的一种衍生形象仅举几例。而 [GimpChat.com][15] 上一位叫做 TheWarrior 的用户直接发邮件给 Wilber 的创造者 Kuosmanen被告知说 “Wilber 是一种独立物种的动物 —— 就叫 GIMP。什么是 GIMP这是个玩笑因为人们一直在问说它是一只狗、狐狸或者其他什么的就太没意思了。我设计的这一个形象的时候在我脑袋中并没有特定哪种动物原型。”
#### PostgreSQL
![PostgreSQL logo](https://opensource.com/sites/default/files/postgresql.png "PostgreSQL logo")
正如你所见和熟悉的一样,使用动物头像来做 Logo 非常普遍。
一只名为 [Slonik][16] 的大象就是 [PostgreSQL][17] 的 Logo 的一部分,这是一个开源的关系型数据库管理系统 RDMS。Patrycja Dybka 在 Vertabelo 上写过博文解释了这一名称是由俄语单词的大象slony演化而来的。Oleg Bartunov 也说过,这个 Logo 是在一个[邮件讨论][18]中初步形成的。在讨论里,在费城圣约瑟夫大学的 David Yang 建议使用大象:“……但如果你想要一个动物头像的 Logo那么使用某种大象如何 毕竟就像阿加莎·克里斯蒂(侦探小说家 Agatha Christie说的那样_大象让人印象深刻_。”
#### VLC 媒体播放器
![VLC logo](https://opensource.com/sites/default/files/resize/vlc-300x340.png "VLC logo")
该 Logo 不再是动物主题了,而是交通锥筒。
VLC 是一款无处不在的媒体播放器它神奇地出现在很多人的桌面电脑上让很多人体验到了开源即使不知道它是开源的。VLC 是由总部在法国的 VideoLAN 组织所支持的 VideoLAN 项目的一款产品。VideoLAN 源自 1996 年在法国中央理工大学的一个学生项目。根据维基百科的描述,这个交通锥标图标参考了由法国中央理工大学的网络学生协会收集自巴黎街道上的交通锥筒。最初的手绘 Logo 在 2006 年由 Richard Oistad 重新进行了渲染。
一些有趣的花絮:
* Seamus Islwyn 的帖子 “[VLC 中的交通锥表达了哪些含义?][1]” 告诉我们在十二月的时候VLC 锥筒会戴着一顶圣诞帽,但在 12 月 31 日它就会消失不见,恢复原样的锥筒。
* 有人说VLC 的意思是 “非常大的锥筒Very Large Cone” 或者选用它仅仅是为了和法国那些交通锥筒相关联而已。
* “官方” 的故事背景是否准确?在 VLC 的 jean-baptiste Kempf 和用户在 [VideoLAN 论坛][2] 上的交流似乎表明,交通锥筒收集说法以及漏斗、建筑区、扩音器和其他一些说法,可能是不正确的。
我们是否完全解答了 VLC 的交通锥筒起源的问题了呢?我个人觉得:那就是 “星期六夜现场” 的尖头外星人。他们就是来自法国的,记得吗?确切地说是来自 Remulak 星球。
**我很期待看到你关于自己喜欢、讨厌以及为它所代表的品牌而倍感激动的那些开源 Logo 的评论。**
题图opensource.com
------------
作者简介:
Jeff Macharyas - 他有多年的出版和印刷工作经验他曾担任过快速印刷、美国观察家、USO 巡逻、今天校园和其他出版物的艺术总监以及项目经理、编辑和发行经理。杰夫持有佛罗里达州立大学的通信信息、罗格斯大学的社会媒体营销研究生证书以及 Utica 学院的网络安全与计算机取证硕士学位。
------------
译者简介:
[GHLandy](http://ghlandy.com) —— 另一种生活中,有属于你也适合你的舞台。或许有你狠心放弃的专业,或者不必上妆,不用摆出另外一副面孔。—— 摘自林特特《以自己喜欢的方式过一生》
------
via: https://opensource.com/article/17/2/six-open-source-brands
作者:[Jeff Macharyas][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jeffmacharyas
[1]:http://www.ehow.com/info_10029162_traffic-cone-mean-vlc.html
[2]:https://forum.videolan.org/viewtopic.php?f=5&t=92513
[3]:https://opensource.com/article/17/2/six-open-source-brands?rate=Lmf1lD4etve4Apqfhw3NUV3SeENsNXhGqTh8OO4PzzQ
[4]:https://en.wikipedia.org/wiki/Tux
[5]:https://www.mozilla.org/en-US/
[6]:https://en.wikipedia.org/wiki/Mozilla
[7]:https://blog.mozilla.org/opendesign/arrival/
[8]:https://en.wikipedia.org/wiki/Firefox
[9]:https://en.wikipedia.org/wiki/Web_browser
[10]:http://actsofvolition.com/steven/mozillabranding/
[11]:http://www.complex.com/pop-culture/2013/09/firefox-jeopardy-answer
[12]:https://www.gimp.org/about/ancient_history.html
[13]:https://www.gimp.org/about/linking.html
[14]:https://gimper.net/threads/what-is-wilber.793/
[15]:http://gimpchat.com/viewtopic.php?f=4&t=10265
[16]:http://www.vertabelo.com/blog/notes-from-the-lab/the-history-of-slonik-the-postgresql-elephant-logo
[17]:https://wiki.postgresql.org/wiki/Logo
[18]:http://www.pgsql.ru/db/mw/msg.html?mid=1238939
[19]:https://opensource.com/user/83821/feed
[20]:https://opensource.com/article/17/2/six-open-source-brands#comments
[21]:https://opensource.com/users/jeffmacharyas

View File

@ -1,15 +1,13 @@
开发 Linux 调试器第二部分:断点
开发一个 Linux 调试器(二):断点
============================================================
在该系列的第一部分,我们写了一个小的进程启动器,作为我们调试器的基础。在这篇博客中,我们会学习在 x86 Linux 上断点如何工作以及给我们工具添加设置断点的能力。
* * *
在该系列的第一部分,我们写了一个小的进程启动器,作为我们调试器的基础。在这篇博客中,我们会学习在 x86 Linux 上断点是如何工作的,以及如何给我们工具添加设置断点的能力。
### 系列文章索引
随着后面文章的发布,这些链接会逐渐生效。
1. [启动][2]
1. [准备环境][2]
2. [断点][3]
3. 寄存器和内存
4. Elves 和 dwarves
@ -20,11 +18,9 @@
9. 读取变量
10.之后步骤
* * *
### 断点是如何形成的?
### 断点如何形成?
有两种类型的断点:硬件和软件。硬件断点通常涉及设置和体系结构相关的寄存器来为你产生断点,而软件断点则涉及修改正在执行的代码。在这篇文章中我们只会关注软件断点,因为它们比较简单,而且可以设置任意多断点。在 x86 机器上任一时刻你最多只能有 4 个硬件断点,但是它们能使你通过读取或者写入给定地址生效,而不是只有当执行到那里的时候。
有两种类型的断点:硬件和软件。硬件断点通常涉及到设置与体系结构相关的寄存器来为你产生断点,而软件断点则涉及到修改正在执行的代码。在这篇文章中我们只会关注软件断点,因为它们比较简单,而且可以设置任意多断点。在 x86 机器上任一时刻你最多只能有 4 个硬件断点,但是它们能让你在读取或者写入给定地址时触发,而不是只有当代码执行到那里的时候。
我前面说软件断点是通过修改正在执行的代码实现的,那么问题就来了:
@ -32,15 +28,13 @@
* 为了设置断点我们要做什么修改?
* 如何告知调试器?
第一个问题的答案显然是 `ptrace`。我们之前已经用它来启动我们的程序以便跟踪和继续它的执行,但我们也可以用它来读或者写内存。
第一个问题的答案显然是 `ptrace`。我们之前已经用它为我们的程序设置跟踪并继续程序的执行,但我们也可以用它来读或者写内存。
当执行到断点时,我们的更改要让处理器暂停并给程序发送信号。在 x86 机器上这是通过 `int 3` 重写该地址上的指令实现的。x86 机器有个`interrupt vector table`(中断向量表),操作系统能用它来为多种事件注册处理程序,例如页故障、保护故障和无效操作码。它就像是注册错误处理回调函数,但是在硬件层面的。当处理器执行 `int 3` 指令时,控制权就被传递给断点中断处理器,对于 Linux 来说,就是给进程发送 `SIGTRAP` 信号。你可以在下图中看到这个进程,我们用 `0xcc` 覆盖了 `mov` 指令的第一个字节,它是 `init 3` 的指令代码。
当执行到断点时,我们的更改要让处理器暂停并给程序发送信号。在 x86 机器上这是通过 `int 3` 重写该地址上的指令实现的。x86 机器有个中断向量表interrupt vector table),操作系统能用它来为多种事件注册处理程序,例如页故障、保护故障和无效操作码。它就像是注册错误处理回调函数,但是在硬件层面的。当处理器执行 `int 3` 指令时,控制权就被传递给断点中断处理器,对于 Linux 来说,就是给进程发送 `SIGTRAP` 信号。你可以在下图中看到这个进程,我们用 `0xcc` 覆盖了 `mov` 指令的第一个字节,它是 `init 3` 的指令代码。
![断点](http://blog.tartanllama.xyz/assets/breakpoint.png)
最后一个谜题是调试器如何被告知中断的。如果你回顾前面的文章,我们可以用 `waitpid` 来监听被发送给被调试程序的信号。这里我们也可以这样做:设置断点、继续执行程序、调用 `waitpid` 然后等待直到发生 `SIGTRAP`。然后就可以通过打印已运行到的源码位置、或改变有图形用户界面的调试器中关注的代码行,将这个断点传达给用户。
* * *
谜题的最后一个部分是调试器如何被告知中断的。如果你回顾前面的文章,我们可以用 `waitpid` 来监听被发送给被调试的程序的信号。这里我们也可以这样做:设置断点、继续执行程序、调用 `waitpid` 并等待直到发生 `SIGTRAP`。然后就可以通过打印已运行到的源码位置、或改变有图形用户界面的调试器中关注的代码行,将这个断点传达给用户。
### 实现软件断点
@ -66,9 +60,10 @@ private:
uint64_t m_saved_data; //data which used to be at the breakpoint address
};
```
这里的大部分代码都是跟踪状态;真正神奇的地方是 `enable``disable` 函数。
正如我们上面学到的,我们要用 `int 3` 指令 - 编码为 `0xcc` - 替换当前指定地址的指令。我们还要保存该地址之前的值,以便后面恢复代码;我们不想忘了执行用户的代码。
正如我们上面学到的,我们要用 `int 3` 指令 - 编码为 `0xcc` - 替换当前指定地址的指令。我们还要保存该地址之前的值,以便后面恢复代码;我们不想忘了执行用户(原来)的代码。
```
void breakpoint::enable() {
@ -81,9 +76,9 @@ void breakpoint::enable() {
}
```
`ptrace` 的 `PTRACE_PEEKDATA` 请求完成如何读取被跟踪进程的内存。我们给它一个进程 ID 和一个地址,然后它返回给我们该地址当前的 64 位内容。 `(m_saved_data & ~0xff)` 把这个数据的低位字节置零,然后我们用它和我们的 `int 3` 指令按位或 `OR` 来设置断点。然后我们通过 `PTRACE_POKEDATA` 用我们的新数据覆盖那部分内存来设置断点。
`PTRACE_PEEKDATA` 请求告知 `ptrace` 如何读取被跟踪进程的内存。我们给它一个进程 ID 和一个地址,然后它返回给我们该地址当前的 64 位内容。 `(m_saved_data & ~0xff)` 把这个数据的低位字节置零,然后我们用它和我们的 `int 3` 指令按位或`OR`)来设置断点。最后我们通过 `PTRACE_POKEDATA` 用我们的新数据覆盖那部分内存来设置断点。
`disable` 的实现比较简单,我们只需要恢复用 `0xcc` 覆盖的原始数据。
`disable` 的实现比较简单,我们只需要恢复用 `0xcc` 覆盖的原始数据。
```
void breakpoint::disable() {
@ -92,8 +87,6 @@ void breakpoint::disable() {
}
```
* * *
### 在调试器中增加断点
为了支持通过用户界面设置断点,我们要在 debugger 类修改三个地方:
@ -115,7 +108,7 @@ private:
}
```
`set_breakpoint_at_address` 函数中我们会新建一个 breakpoint 对象、启用它、把它添加到数据结构里、并给用户打印一条信息。如果你喜欢的话,你可以重构所有的输出信息,从而你可以将调试器作为库或者命令行工具使用,为了简便,我把它们都整合到了一起。
`set_breakpoint_at_address` 函数中我们会新建一个 breakpoint 对象,启用它,把它添加到数据结构里,并给用户打印一条信息。如果你喜欢的话,你可以重构所有的输出信息,从而你可以将调试器作为库或者命令行工具使用,为了简便,我把它们都整合到了一起。
```
void debugger::set_breakpoint_at_address(std::intptr_t addr) {
@ -146,23 +139,19 @@ void debugger::handle_command(const std::string& line) {
}
```
我删除了字符串中的前两个字符并对结果调用 `std::stol`,为了让解析更加强壮,你也可以修改它。`std::stol` 可以将字符串按照所给基数转化为整数。
* * *
我删除了字符串中的前两个字符并对结果调用 `std::stol`,你也可以让该解析更健壮一些。`std::stol` 可以将字符串按照所给基数转化为整数。
### 从断点继续执行
如果你尝试这样做,你可能会发现,如果你从断点处继续执行,不会发生任何事情。这是因为断点仍然在内存中,因此一直被命中。简单的解决办法就是停用这个断点、运行到下一步、再次启用这个断点、然后继续执行。不过我们还需要更改程序计数器,指回到断点前面,这部分内容会留到下一篇关于操作寄存器的文章中介绍。
* * *
如果你尝试这样做,你可能会发现,如果你从断点处继续执行,不会发生任何事情。这是因为断点仍然在内存中,因此一直被重复命中。简单的解决办法就是停用这个断点、运行到下一步、再次启用这个断点、然后继续执行。不过我们还需要更改程序计数器,指回到断点前面,这部分内容会留到下一篇关于操作寄存器的文章中介绍。
### 测试它
当然,如果你不知道要设置的地址,在某些地址设置断点并非很有用。后面我们会学习如何在函数名或者代码行设置断点,但现在我们可以通过手动实现。
当然,如果你不知道要在哪个地址设置,那么在某些地址设置断点并非很有用。后面我们会学习如何在函数名或者代码行设置断点,但现在我们可以通过手动实现。
测试你调试器的简单方法是写一个 hello world 程序,这个程序输出到 `std::err`(为了避免缓存),并在调用输出操作符的地方设置断点。如果你继续执行被调试的程序,执行很可能会停止而不会输出任何东西。然后你可以重启调试器并在调用之后设置一个断点,现在你应该看到成功地输出了消息。
查找地址的一个方法是使用 `objdump`。如果你打开一个终端并执行 `objdump -d <your program>`,然后你应该看到你程序的反汇编代码。然后你就可以找到 `main` 函数并定位到你想设置断点的 `call` 指令。例如,我编译了一个 hello world 程序,反汇编它,然后得到了 `main` 的反汇编代码:
查找地址的一个方法是使用 `objdump`。如果你打开一个终端并执行 `objdump -d <your program>`,然后你应该看到你程序的反汇编代码。你就可以找到 `main` 函数并定位到你想设置断点的 `call` 指令。例如,我编译了一个 hello world 程序,反汇编它,然后得到了如下的 `main` 的反汇编代码:
```
0000000000400936 <main>:
@ -178,8 +167,6 @@ void debugger::handle_command(const std::string& line) {
正如你看到的,要没有输出,我们要在 `0x400944` 设置断点,要看到输出,要在 `0x400949` 设置断点。
* * *
### 总结
现在你应该有了一个可以启动程序、允许在内存地址上设置断点的调试器。后面我们会添加读写内存和寄存器的功能。再次说明,如果你有任何问题请在评论框中告诉我。
@ -190,7 +177,7 @@ void debugger::handle_command(const std::string& line) {
via: http://blog.tartanllama.xyz/c++/2017/03/24/writing-a-linux-debugger-breakpoints/
作者:[Simon Brand ][a]
作者:[Simon Brand][a]
译者:[ictlyh](https://github.com/ictlyh)
校对:[jasminepeng](https://github.com/jasminepeng)
@ -198,5 +185,5 @@ via: http://blog.tartanllama.xyz/c++/2017/03/24/writing-a-linux-debugger-breakpo
[a]:http://blog.tartanllama.xyz/
[1]:http://blog.tartanllama.xyz/c++/2017/03/21/writing-a-linux-debugger-setup/
[2]:http://blog.tartanllama.xyz/c++/2017/03/24/writing-a-linux-debugger-breakpoints/
[2]:https://linux.cn/article-8626-1.html
[3]:https://github.com/TartanLlama/minidbg/tree/tut_break

View File

@ -1,24 +1,23 @@
ps_mem ——一个用于精确生成 Linux 核心内存使用报告的简单 Python 脚本
ps_mem:一个用于精确报告 Linux 核心内存用量的简单 Python 脚本
============================================================
[ps_mem][2] 是一个可以帮助我们精确获取 Linux 中各程序核心内存使用情况的简单 python 脚本。虽然在 Linux 上有很多可用于查看内存使用情况的工具,比如 free、vmstat、smem、top等但这个工具和其它的区别在于其精确显示核心内存使用情况。
它分别计算一个程序私有内存总量和共享内存总量,并以更准确的方式给出了总的内存使用量。很明显的,它将帮助大伙知道系统中哪个程序正占用更多的内存。
[ps_mem][2] 是一个可以帮助我们精确获取 Linux 中各个程序核心内存使用情况的简单 python 脚本。虽然在 Linux 上有很多可用于查看内存使用情况的工具,比如 `free`、`vmstat`、`smem`、`top` 等,但这个工具和其它的区别在于其精确显示核心内存使用情况。
你可以通过包管理器、pip 、或直接运行 ps_mem.py 脚本等多种方式来安装 ps_mem工具。需要注意的是需要有root 权限。
它会分别计算一个程序私有内存总量和共享内存总量,并以更准确的方式给出了总的内存使用量。很明显的,它将帮助大家知道系统中哪个程序正在占用更多的内存。
你可以通过包管理器、`pip` 、或直接运行 `ps_mem.py` 脚本等多种方式来安装 `ps_mem` 工具。需要注意的是:需要有 root 权限。
另外,推荐阅读以下内存工具:
推荐阅读: [free A Standard Command to Check Memory Usage Statistics (Free & Used) in Linux][3]
- [free 一个在 Linux 上查看内存用量统计(可用和已用)的标准工具][3]
- [smem Linux 内存报告/统计工具][4]
- [vmstat 一个好用的用于虚拟内存统计的标准工具][5]
推荐阅读: [smem Linux Memory Reporting/Statistics Tool][4]
推荐阅读: [vmstat A Standard Nifty Tool to Report Virtual Memory Statistics][5]
#### 通过包管理器安装 ps_mem
### 通过包管理器安装 ps_mem
基于 RHEL 的系统默认仓库就包含 ps_mem 工具,所以我们可以简单地通过包管理器进行安装。
对于 RHEL/CentOS ,使用 [yum 包管理器][6] 安装 ps_mem 包:
对于 RHEL/CentOS ,使用 [yum 包管理器][6] 安装 `ps_mem` 包:
```
$ sudo yum install ps_mem
@ -38,7 +37,7 @@ $ sudo pacman -S ps_mem
#### 通过 pip 安装 ps_mem
pip 是在 Linux 上推荐使用的一种安装 Python 包的工具。使用 pip 命令而不是包管理器去获取最新的版本。使用 pip 包前,请确保你的系统上已安装过 pip 包。否则,先使用发行版本的包管理器安装 `python-pip` 包。
`pip` 是在 Linux 上推荐使用的一种安装 Python 包的工具。可以使用 `pip` 命令而不是包管理器去获取最新的版本。使用 `pip` 包前,请确保你的系统上已安装过 `pip` 包。否则,先使用发行版本的包管理器安装 `python-pip` 包。
对于基于 Debian 的系统:
@ -70,13 +69,13 @@ $ sudo zypper install python-pip
$ sudo pacman -S python-pip
```
最后,在 Linux 上运行 pip 工具安装ps_mem
最后,在 Linux 上运行 `pip` 工具安装 `ps_mem`
```
$ sudo pip install ps_mem
```
#### 直接运行 ps_mem.py 脚本
### 直接运行 ps_mem.py 脚本
我们也可以从开发者 github 页面下载文件,并直接运行 `ps_mem.py` 脚本。
@ -85,7 +84,7 @@ $ git clone https://github.com/pixelb/ps_mem.git && cd ps_mem
$ sudo python ps_mem.py
```
#### ps_mem 使用方法
### ps_mem 使用方法
不带任何参数直接运行 `ps_mem` 以精确获取每个程序的的核心内存使用情况。
@ -155,7 +154,7 @@ $ sudo ps_mem
=================================
```
输出打印出全路径:
输出打印出全路径:
```
$ sudo ps_mem -s
@ -221,7 +220,7 @@ $ sudo ps_mem -p 2886,4386
=================================
```
每 N 秒打印进程内存。以下命令每2秒报告一次内存使用情况
每 N 秒打印进程内存。以下命令每 2 秒报告一次内存使用情况:
```
$ sudo ps_mem w 2
@ -238,9 +237,9 @@ $ sudo ps_mem -t
via: http://www.2daygeek.com/ps_mem-report-core-memory-usage-accurately-in-linux/
作者:[ 2DAYGEEK ][a]
译者xllc(https://github.com/xllc)
校对:[校对者ID](https://github.com/校对者ID)
作者:[2DAYGEEK][a]
译者:[xllc](https://github.com/xllc)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,76 @@
使用 Ubuntu Cleaner 为 Ubuntu/LinuxMint 释放空间
============================================================
我们中的大部分人都会经常忘记清理 Linux 系统中的垃圾文件,这会导致我们的系统空间不足。
一般情况下我们不得不按标准的程序来释放 Linux 发行版中的空间(删除发行版缓存、系统日志、应用程序缓存和垃圾邮件),但如果我们每次以手动方式执行相同的过程,那么会花费大量的时间和困难。
在 Linux 的应用程序中,可以使这个任务更容易。今天我们将教你如何使用 Ubuntu Cleaner它衍生自 Ubuntu Tweak 中的 Janitor 模块。
[Ubuntu Cleaner][2]  是一个可以简化你清理 Ubuntu 系统的工具。如我们所知道Ubuntu Tweak 是帮助我们调整 Ubuntu 及其衍生发行版的最佳实用程序之一。但由于它的主要开发人员没有时间维护它,因此已被弃用。
建议阅读:
- [Stacer - Linux 系统优化和监控工具][3]
- [BleachBit - 在 Linux 中清理系统的快速而最佳方法][4]
因为许多用户在最新版本中仍使用 Ubuntu Tweak 这个工具(因为他们不想离开这个工具),所以 Ubuntu Cleaner 的开发人员从 Ubuntu Tweak 工具中复刻了 janitor 模块,并将这个有用的功能带回 Ubuntu 社区,并命名为 Ubuntu Cleaner。它也成为了 Ubuntu 多年来最受欢迎的实用程序之一。
建议阅读:
- [uCareSystem - 用于 Ubuntu / LinuxMint 的一体化系统更新和维护工具][5]
我猜所有那些怀念 Ubuntu Tweak 的人都会因为有 Ubuntu Cleaner 而感到高兴,因为它是从 janitor 模块衍生出来的。
Ubuntu Cleaner 将删除 Ubuntu 及其衍生发行版中的以下垃圾文件:
* 应用缓存 (浏览器缓存)
* 缩略图缓存
* Apt 缓存
* 旧的内核
* 包的配置文件
* 不需要的包
### 如何安装 Ubuntu Cleaner
因为开发者提供官方 PPA ,我们可以通过 PPA 轻松地将 Ubuntu Cleaner 安装到 Ubuntu 及其衍生发行版。 Ubuntu Cleaner 目前支持 Ubuntu 14.04 LTS 和 Ubuntu 16.04 LTS。
```
$ sudo add-apt-repository ppa:gerardpuig/ppa
$ sudo apt update
$ sudo apt install ubuntu-cleaner
```
### 如何使用 Ubuntu Cleaner
从主菜单启动 Ubuntu Cleaner 你可以看到得以下默认界面。
![](http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_001.png)
勾选你要清理的文件前面的 “复选框”。 最后点击 “清理” 按钮从系统中删除垃圾文件。
![](http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_002.png)
现在我们已经成功清除了系统中的垃圾。
![](http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_003.png)
--------------------------------------------------------------------------------
via: http://www.2daygeek.com/ubuntu-cleaner-system-cleaner-ubuntu-tweak-alternative-janitor/
作者:[2DAYGEEK][a]
译者:[chenxinlong](https://github.com/chenxinlong)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.2daygeek.com/author/2daygeek/
[1]:http://www.2daygeek.com/author/2daygeek/
[2]:http://ubuntu-cleaner.blogspot.in/
[3]:http://www.2daygeek.com/stacer-linux-system-optimizer-and-monitoring-tool/
[4]:http://www.2daygeek.com/bleachbit-system-cleaner-on-ubuntu-debian-fedora-opensuse-arch-linux-mint/
[5]:http://www.2daygeek.com/ucaresystem-system-update-and-maintenance-tool-for-ubuntu-linuxmint/
[6]:http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_001.png
[7]:http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_002.png
[8]:http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_003.png

View File

@ -0,0 +1,63 @@
Linus Torvalds 说 Linux 仍然惊讶和激励着他
============================================================
![Linus Torvalds](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/linus-torvalds-lc3.jpg?itok=lzZupevU "Linus Torvalds")
> Linus Torvalds 和 VMware 开源负责人 Dirk Hohndel 上周在中国 LinuxCon 上进行了一次“炉边聊天”。
周一Linus Torvalds 首次来到中国参加[在北京召开的 LinuxCon + ContainerCon + CloudOpen][3]。在近 2000 名观众面前Linus Torvalds 和 VMware 开源负责人 Dirk Hohndel 进行了进行了一次“炉边聊天”,谈及是什么在惊讶和激励着他,以及有志的开源开发者们该如何上手。下面是他们谈话中的一些亮点。
### Linux 开发中有什么令人惊讶的事情?
> “我觉得有趣的是我认为已经稳定的代码仍然在不断的得到改进,有些东西我们已经很多年没有碰了,然后有人来改进了它们,或者在我以为根本就不会有人用的东西上提交了 Bug 报告。我们有了新的硬件,开发了新的功能,但是 25 年后,我们仍然有老的、非常基础的东西,并且人们依然在关心和改善着它们。”
### 什么在激励着他
> “我真的很喜欢我正在做的事情。我喜欢醒来时有一个在技术上有趣而富有挑战性并且不太紧张的工作,因此我可以长时间的为此工作;或者做一些我感觉我正在做一个真正有影响的事情,做一些不仅仅是对我来说有意义的事情。
> “我偶尔在工作中休息一下,例如我在 Git 上工作两到三周的时候就开始休息了。但是每次休息的时间比较长我都会感到无聊厌倦。当我出去潜水一周,就想着要回来,我从没有感觉我需要一个更长的假期。”
LCTT 译注:此处“在 Git 上工作” 是指 Linus 在 Git 版本仓库里面开发 Linux 内核,而非开发 Git 软件——事实上Linus 在早期开发完 Git 的原型之后,主要的 Git 开发已经有别人接手了,虽然他被称之为 Git 之父。而“潜水”是真的指潜水运动Linus 喜好玩潜水运动。)
### Linux 的未来领导力
> “我们的工作进程不会只是 25 年,我们仍然有非常强大的维护团队。我们常常抱怨我们没有足够的维护者 - 这是真的,我们只有数十名顶级维护者做日常合并的工作,这对于一个开源项目来说是一个非常强大的团队。而且随着这些顶级维护者慢慢变老变胖,我们不断有新人进来。一个新人成长为一个顶级维护者需要几年的时间,因此我不觉得我们应该为 Linux 的下一个 20 年担心。”
### Linux 会被替代吗?
> “或许会有一些新的项目将来会并且表明他们比我们做的更好,但是我不担心这个。有很多非常成功的 Linux 的分支fork人们不会把它们看作是分支是因为他们很和谐。如果有人想要改变一切并且让内核变得更好我的感觉是干吧证明你自己。我可能觉得那是一个坏主意但是你可以证明我是错的。”
LCTT 译注:此处所说的分支,应该是指类似 Android、AGL 等 Linux 分支并没有分裂 Linux 生态,而是彼此补充。)
### 对 Git 的想法
> “我对 Git 的广泛传播感到非常的惊讶。显然我非常高兴,它验证了我对分布式开发的看法。然而那时,已经有如此之多的源码版本控制工具,很难再去推出一个新的版本控制系统。我预计它主要限于内核开发 - 因为它是针对我们所做的。”
> “在刚开始的三到四年里,关于 Git 的抱怨是它如此的与众不同,难以使用。大约五年前,事情发生了改变。有足够多的项目和开发者开始使用 Git ,它变得不再与众不同;人们习惯于使用 Git 。他们开始利用这种开发模式,使用 Git 的安全感,意味着任何东西都不会损坏或者丢失。”
> “在某些方面Git 比 Linux 更为人所知。Linux 常常被隐藏起来,例如安卓手机就运行在 Linux 之上,但是你并不知道。但是使用 Git 时,你确切地知道你在使用 Git 。”
### 分支 Linux
> “当我坐下来开始写 Git ,一个首要的原则就是你应该能 fork 并且在此基础上做你自己的事情。如果你有友好的 fork能证明我错了并且能够改进内核在这种情况下人们可以回来说我们实际上改进了内核这没有什么不好的感觉。我会采纳你的改进并且将其合并进来。这就是为什么你应该鼓励 fork 。你也想让良好的回馈变得很简单。”
### 开源开发者应该如何开始
> “于我而言,我总是自我激励,知道自己想要做什么,我从来没有被告知要去做什么。我不确定我的例子是否适合人们效仿。如果你是一个新手程序员,你可以从成千上万的开源项目中找到你所感兴趣的,你可以长期关注这个项目,去了解它的代码,以至于你可以在某个部分的代码上可以成为专家,不需要是整个项目。没有人是整个内核的专家,但是你可以很好地了解其中的一个领域。”
> “如果你能成为社区的一份子,能提交补丁,那将不仅仅是编程,而是有开源社会方面的意义。你作为一个程序员提升了你自己并且和外界联系了起来。你基本上可以向外展示 - 我做了这些改进,我有能力在我的社区或者工作上走得更远。你不得不花费一定的时间来学习一个项目,但是你将有一个巨大的上升空间 - 不仅仅是从职业方面,而且在你的生活中有一个惊人的项目。”
--------------------------------------------------------------------------------
via: https://www.linux.com/blog/event/lc3-china/20176/6/linus-torvalds-explains-how-linux-still-surprises-and-motivates-him
作者:[Linux 基金会][a]
译者:[rieonke](https://github.com/rieonke)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/lfadmin
[1]:https://www.linux.com/licenses/category/linux-foundation
[2]:https://www.linux.com/files/images/linus-torvalds-lc3jpg
[3]:https://www.lfasiallc.com/linuxcon-containercon-cloudopen-china

View File

@ -1,30 +1,28 @@
如何在 LaTex 中创建文档
如何以 LaTex 创建文档
============================================================
### 学习以 LaTex 文本标记语言排版文档
> 学习以 LaTex 文本标记语言排版文档
![A introduction to creating documents in LaTeX](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/idea_innovation_kid_education.png?itok=jpetC9wJ "A introduction to creating documents in LaTeX")
图片来自 : opensource.com

LaTeX读作 `lay-tech` )是使用纯文本创建文档的方法,使用与 HTML/CSS 或 Markdown 类似的标记标签进行风格化。 LaTeX 最常用于为学术界(如学术期刊)创建文档。 在 LaTeX 中,作者不必直接对文档进行风格化,就像在 Microsoft WordLibreOffice Writer 或 Apple Pages 等文字处理程序中一样; 而是用纯文本编写代码,这些代码必须经过编译才能生成 PDF 文档。
LaTeX读作_lay-tech_是使用纯文本创建文档的方法使用与 HTML/CSS 或 Markdown 类似的标记标签进行风格化。 LaTeX 最常用于为学术界(如学术期刊)创建文档。 在 LaTeX 中,作者不必直接对文档进行风格化,例如 Microsoft WordLibreOffice Writer 或 Apple Page s等文字处理程序 而是用纯文本编写代码,这些代码必须被编译才能生成 PDF 文档。
### [intro.png][1]
r
![computer screen with LaTeX markup language](https://opensource.com/sites/default/files/u128651/intro.png "computer screen with LaTeX markup language")
### 起步
要想使用 LaTex 来书写文档,首先你必须要安装一个 LaTex 编辑器。我用的是一款免费且开源,同时在学术界也是大受欢迎的软件叫做 [TexStudio][8], 它可以运行在 Windows、Unix/Linux、BSD 和 Mac OS X 上。同时你还需要安装一个 **Tex** 排版系统的发行版。因为我斗士在 MacOS 上书写文档,所以我使用的发行版本是 [MacTex or BasicTex][9]。对于 Windows 用户你可以使用[MiKTex][10]而且 Linux 用户也可以在 repository 中找到它。
要想使用 LaTex 来书写文档,首先你必须要安装一个 LaTex 编辑器。我用的是一款自由开源软件FOSS其在学术界也是大受欢迎,叫做 [TexStudio][8]它可以运行在 Windows、Unix/Linux、BSD 和 Mac OS X 上。同时你还需要安装一个 **Tex** 排版系统的分发版。因为我都是在 MacOS 上书写文档,所以我使用的分发版是 [MacTex 或 BasicTex][9]。对于 Windows 用户你可以使用 [MiKTex][10]而且 Linux 用户也可以在软件库中找到它。
当你完成了 TexStudio 和 LaTex 发版的下载,你就可以开始对你的文档进行排版了。
当你完成了 TexStudio 和某个 LaTex 的分发版的下载,你就可以开始对你的文档进行排版了。
### 创建你的第一个文档
在这个简短的教程里,我们会创建一个简单的文章包括一个大标题、一个子标题和两个段落。
在这个简短的教程里,我们会创建一个简单的文章包括一个大标题、一个子标题和两个段落。
在启动 TexStudio后保存一份新的文档。 (我将其保存为 **helloworld.tex** ,因为我正在编写本教程的 HelloWorld文档。这是编程的一个传统。接下来你需要在你的 **.txt** 文件顶部添加一些样板代码用于指定文档的类型和大小。 这与 HTML5 w文件中使用的样板代码类似。
在启动 TexStudio 后,保存一份新的文档。 (我将其保存为 `helloworld.tex` ,因为我正在编写本教程的 HelloWorld文档。这是编程的一个传统。接下来你需要在你的 `.tex` 文件顶部添加一些样板代码用于指定文档的类型和大小。 这与 HTML5 文件中使用的样板代码类似。
我的代码(下方)将会把页面大小设置为 A4文本大小设置为 12 pt 。 你可以直接把这些代码放入 TexStudio并指定你自己的页面大小,字体大小,名称,标题和其他详细信息进行编辑:
我的代码(下方)将会把页面大小设置为 A4文本大小设置为 12pt 。 你可以直接把这些代码放入 TexStudio并指定你自己的页面大小、字体大小、名称、标题和其他详细信息进行编辑:
```
\documentclass[a4paper,12pt]{article}
@ -41,33 +39,27 @@ content will go here
接下来,点击那个大的绿色箭头来编译该文档。就是下方截图中的中间的那个按钮。
### [compile.png][2]
![compile button in TexStudio](https://opensource.com/sites/default/files/u128651/compile.png "compile button in TexStudio")
如果这期间发生了什么错误,它将显示在底部的对话框里。
在你编译了这个文档之后,你可以看到它就像一个 PDF 一样显示在程序的 WYSIWYG (所见即所得) 预览区域中。记住一旦你修改了代码就必须重新编译,就像我们在 C++ 中编程一样。
在你编译了这个文档之后,你可以看到它就像一个 PDF 一样显示在程序的 WYSIWYG (所见即所得)预览区域中。记住一旦你修改了代码就必须重新编译,就像我们在 C++ 中编程一样。
通过点击 **Tools > Commands > View PDF** 可以来预览你的文档,如下截图所示。
### [view_as_pdf.png][3]
![Menu to view a PDF](https://opensource.com/sites/default/files/u128651/view_as_pdf.png "Menu to view a PDF")
PDF 的输出将会显示在右侧,就像这样:
### [pdf_output.png][4]
![Viewing the LaTeX code as PDF](https://opensource.com/sites/default/files/u128651/pdf_output.png "Viewing the LaTeX code as PDF")
现在你可以添加一个段落。首先先通过 **\section{}** 命令来写一个子标题。在命令的大括号中输入你的子标题;我写的是 **Introduction**.
现在你可以添加一个段落。首先先通过 `\section{}` 命令来写一个子标题。在命令的大括号中输入你的子标题;我写的是 `Introduction`
```
\section{Introduction}
```
现在你已经给你的段落标记了一个子标题,是时候来写一个段落了。在这个例子中,我使用了 Lipsum [lorem ipsum 生成器][11]。要创建一个段落,要使用 **\paragraph{}** 命令, 将你的文本插入到 **\maketitle** 和 **\end{document}** 之间的的 **\paragraph{}** 大括号下方,而不是中间。
现在你已经给你的段落标记了一个子标题,是时候来写一个段落了。在这个例子中,我使用了 Lipsum [lorem ipsum 生成器][11]。要创建一个段落,要使用 `\paragraph{}` 命令, 将你的文本插入到 `\maketitle``\end{document}` 之间的 `\paragraph{}` 大括号下方,而不是中间。
以下就是我创建的段落的代码:
@ -85,8 +77,6 @@ Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, pulvinar a posuer
这是一个我已经完成的文档及其相应的代码:
### [finished_document.png][5]
![The finished document with code and the PDF output side-by-side](https://opensource.com/sites/default/files/u128651/finished_document.png "The finished document with code and the PDF output side-by-side")
本教程所有的代码如下所示:
@ -112,7 +102,9 @@ Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, pulvinar a posuer
### 更多
在 LaTeX 撰写的数以千计的优秀资源中,大多数大学制作的指南是可索引的,同时也可以在 Google 搜索中找到。 [普林斯顿大学 University][12] 提供了一个很好的扩展教程,为了更深入的了解,普林斯顿大学的导师 Donald Knuth 提供了 [The TexBook][13],这是关于 LaTeX 的最好的教程。
在 LaTeX 撰写的数以千计的优秀资源中,大多数大学制作的指南是可索引的,同时也可以在 Google 搜索中找到。 [普林斯顿大学][12] 提供了一个很好的扩展教程,为了更深入的了解,普林斯顿大学的导师 Donald Knuth 提供了 [The TexBook][13],这是关于 LaTeX 的最好的教程。
(题图 : opensource.com
--------------------------------------------------------------------------------
@ -125,9 +117,9 @@ Aaron Cocker - 一名在英国上大学的计算机学士。我是一个有抱
via: https://opensource.com/article/17/6/introduction-latex
作者:[ Aaron Cocker][a]
作者:[Aaron Cocker][a]
译者:[chenxinlong](https://github.com/chenxinlong)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,67 +0,0 @@
translating------geekpi
7 ways to discuss legal matters with an open community
============================================================
> Are your organization's lawyers ready to engage an open community? Don't let them make these mistakes.
![7 ways to discuss legal matters with an open community](https://opensource.com/sites/default/files/styles/image-full-size/public/images/law/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=xmtgmowQ "7 ways to discuss legal matters with an open community")
>Image by : opensource.com
Having watched a fair number of people attempt to engage both the [Open Source Initiative's licensing evaluation community][3] and the [Apache Software Foundation's legal affairs committee][4], I'd like to offer some hints and tips for succeeding when it's  _your_  turn to conduct a legal discussion with an open community.
### No proxies
First and foremost, make sure the person conducting the conversation is both  _qualified_  and  _empowered_ . Don't send proxies; they simply frustrate the community, who quickly work out that your representative is always playing the second-hand car salesman and going to the back room to ask for a deal. Obviously, legal discussions will involve a team at your company, probably involving product management, engineering and in-house counsel. But the representative needs to be able to hold the conversation themselves and not keep delivering cut paste quotes from anonymous personae behind the curtain.
### Multilaterality
An open source community reaches a hard-won consensus on the certainties they need in order to collaborate safely. That consensus gets embodied in their governance and especially in the open source license they use. So when you come with a new proposal, it's not like a normal business deal. Those are bilateral negotiations, trading the freedoms of the two parties to create a peace treaty that's an optimal compromise. In this discussion you are just one of many, many parties, and you need to explain why your proposal is good for everyone. Negotiating multilateral change is inherently slow, so don't come with a deadline. And whatever you do, don't suggest changes to the open source license!
### Study first
The existing consensus and process exists for a reason. You should understand the reason for each element, preferably along with the history of how it arose, before suggesting changes to it. That way you can couch your proposals in the context of further evolution, and you can avoid being schooled in community history (something that wastes community bandwidth and reduces your chances of effectiveness). Read back through the mailing list and ask your developer colleagues for history and context.
### Transparency
Open source developers use a process of iterative, incremental change. Even if a big change is needed, it will almost always be delivered as a sequence of smaller, well-explained or self-evidently correct changes so that everyone can follow along and buy in to the improvement. The same is true of your proposed change. Don't show up with a new contributor agreement or a modified license and expect everyone to trust that you're experts so it must all be good. You need to provide a "red-line" (the legal document equivalent of a diff), document each change, and provide a justification that admits any community impact and justifies it. If you need a thing to be  _just so_  for your own benefit, admit it rather than hoping no one will notice.
### Humility
So you are a hot-shot lawyer and you think only programmers use the mailing list. It's clear to you that they'll lack the experience to have a discussion, so you either send a proxy you think is their equal, dumb it all down, or propose having a one-on-one discussion with the community's chosen lawyer. I'm sorry to say that you are so, so wrong on all counts. Since the community's policy is a multilateral consensus, there is a really good chance they know why they settled on what they have now. There will be some people on the list with excellent domain-specific knowledge, likely to be better than yours. And that one-on-one thing is the ultimate insult, like asking if there is an adult you can speak with.
### Don't back-channel
There may well be a leadership body of some kind. Maybe you know the boss at the company where the VP Legal works. Perhaps you know the community's General Counsel. While asking for hints on how to navigate the process may be acceptable in some circumstances, trying to conduct a back-channel discussion or negotiation with the expectation of influencing or even determining the outcome can blow back badly. You may eventually be invited for a one-on-one discussion, but you should never demand or expect it.
### Become a member
If you do everything right, chances are that the community will respect you for it. Stick around. Build your reputation as a calm, wise contributor. Help others when they show up and make the mistakes you made (or avoided!) As a trusted participant in the "$-legal" mailing list community, you are a real asset to both the project and your employer. Keep contributing and some projects will eventually offer you a role in their governance process.
_An earlier version of this article [originally appeared][1] at Meshed Insights._
--------------------------------------------------------------------------------
作者简介:
Simon Phipps - Computer industry and open source veteran Simon Phipps started Public Software, a European host for open source projects, and volunteers as a director at The Document Foundation. His posts are sponsored by Patreon patrons - become one if you'd like to see more!
------------
via: https://opensource.com/open-organization/17/3/legal-matters-community
作者:[ Simon Phipps][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/simonphipps
[1]:https://meshedinsights.com/2017/02/28/engaging-communities-on-legal-matters-7-tips/
[2]:https://opensource.com/open-organization/17/3/legal-matters-community?rate=gSFbyOzBTIipXOdeeL-GVIT1BYoC4f61FKZJ7KRg3d0
[3]:https://opensource.org/approval
[4]:https://www.apache.org/legal/
[5]:https://opensource.com/user/12532/feed
[6]:https://opensource.com/open-organization/17/3/legal-matters-community#comments
[7]:https://opensource.com/users/simonphipps

View File

@ -1,58 +0,0 @@
Linus Torvalds Explains How Linux Still Surprises and Motivates Him
============================================================
![Linus Torvalds](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/linus-torvalds-lc3.jpg?itok=lzZupevU "Linus Torvalds")
Linux Torvalds spoke with Dirk Hohndel in one of their famous “fireside chats” this week at LinuxCon China.[The Linux Foundation][1]
Linus Torvalds took to the stage in China for the first time Monday at [LinuxCon + ContainerCon + CloudOpen China in Beijing][3]. In front of a crowd of nearly 2,000, Torvalds spoke with VMware Head of Open Source Dirk Hohndel in one of their famous “fireside chats” about what motivates and surprises him and how aspiring open source developers can get started. Here are some highlights of their talk.
**Whats surprising about Linux development**
“What I find interesting is code that I thought was stable continually gets improved. There are things we havent touched for many years, then someone comes along and improves them or makes bug reports in something I thought no one used. We have new hardware, new features that are developed, but after 25 years, we still have old, very basic things that people care about and still improve.”
**What motivates him**
“I really like what Im doing. I like waking up and having a job that is technically interesting and challenging without being too stressful so I can do it for long stretches; something where I feel I am making a real difference and doing something meaningful not just for me.”
“I occasionally have taken breaks from my job. The 2-3 weeks I worked on Git to get that started for example. But every time I take a longer break, I get bored. When I go diving for a week, I look forward to getting back. I never had the feeling that I need to take a longer break.”
**The future of Linux leadership**
“Our processes have not only worked for 25 years, we still have a very strong maintainer group. We complain that we dont have enough maintainers which is true, we only have tens of top maintainers who do the daily work of merging stuff. Thats a strong team for an open source project. And as these maintainers get older and fatter, we have new people coming in. It takes years to go from a new developer to a top maintainer, so I dont feel that we should necessarily worry about the process and Linux for the next 20 years.”
**Will Linux be replaced**
“Maybe some new aggressive project will come along and show they can do what we do better, but I dont worry about that. There have been lots of very successful forks of Linux. What makes people not think of them as forks is that they are harmonious. If someone says they want to do this and change everything and make the kernel so much better, my feeling is do it, prove yourself. I may think its a bad idea, but you can prove me wrong.”
**Thoughts on Git**
“Im very surprised about how widely Git has spread. Im pleased obviously, and it validates my notion of doing distributed development. At the same time, looking at most source control versions, it tends to be a huge slog and difficult to introduce a new software control version. I expected it to be limited mostly to the kernel -- as its tailored to what we do.”
“For the first 3 to 4 years, the complaint about Git was it was so different and hard to use. About 5 years ago something changed. Enough projects and developers had started using Git that it wasnt different anymore; it was what people were used to. They started taking advantage of the development model and the feeling of security that using Git meant nothing would be corrupted or lost.”
“In certain circles, Git is more well known than Linux. Linux is often hidden on an Android phone youre running Linux, but you dont think about it. With Git, you know you are using Git.”
**Forking Linux**
“When I sat down and wrote Git, a prime principle was that you should be able to fork and go off on your own and do something on your own. If you have forks that are friendly -- the type that prove me wrong and do something interesting that improves the kernel -- in that situation, someone can come back and say they actually improved the kernel and there are no bad feelings. Ill take your improved code and merge it back. Thats why you should encourage forks. You also want to make it easy to take back the good ones.”
**How to get started as an open source developer**
“For me, I was always self-motivated and knew what I wanted to do. I was never told what I should look at doing. Im not sure my example is the right thing for people to follow. There are a ton of open source projects and, if you are a beginning programmer, find something youre interested in that you can follow for more than just a few weeks. Get to know the code so well that you get to the point where you are an expert on a code piece. It doesnt need to be the whole project. No one is an expert on the whole kernel, but you can know an area well.  
If you can be part of a community and set up patches, its not just about the coding, but about the social aspect of open source. You make connections and improve yourself as a programmer. You are basically showing off I made these improvements, Im capable of going far in my community or job. Youll have to spend a certain amount of time to learn a project, but theres a huge upside -- not just from a career aspect, but having an amazing project in your life.”
--------------------------------------------------------------------------------
via: https://www.linux.com/blog/event/lc3-china/20176/6/linus-torvalds-explains-how-linux-still-surprises-and-motivates-him
作者:[ THE LINUX FOUNDATION][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/lfadmin
[1]:https://www.linux.com/licenses/category/linux-foundation
[2]:https://www.linux.com/files/images/linus-torvalds-lc3jpg
[3]:https://www.lfasiallc.com/linuxcon-containercon-cloudopen-china

View File

@ -0,0 +1,141 @@
BUILD A 64-BIT KERNEL FOR YOUR RASPBERRY PI 3
============================================================
> EDIT : After writing this blog post Ive started a 64-bit OS for the Raspberry Pi 3, based on Debian. You can [find it here][3].
The **Raspberry Pi 3** ships with a Broadcom BCM2837 64bit ARMv8 quad core Cortex A53 processor, which is a **64-bit CPU**. If you own one of these, running the following command might surprise you :
> > uname -a
> Linux raspberrypi 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux
Yes, this is a **32-bit kernel**. The reason for this is that the Raspberry Pi foundation doesnt yet provides a 64-bit version of Raspbian, the official OS for Raspberry Pi. It is however possible to build one, thanks to the various patches sent by [Electron752][9].
# Build the Kernel
The Raspberry Pi foundation maintains [their own fork ][10]of the Linux Kernel which is especially tailored for their devices, while upstream gets merged regularly.
Were going to adapt instructions from [that page][11] to **build a 64-bit Kernel**.
We cannot use the “Local building” method as itd require a 64-bit Raspberry Pi, which we obviously dont have yet. So we have to **cross-compile** it, **Ubuntu**is the recommended OS for this. I personally dont have Ubuntu so Ill make my build on a 2 CPUs Ubuntu 16.04 Digital Ocean droplet, which should cost me $0.03\. If you also want to proceed like this, you can get $10 free credits through [this link][12]. Alternatively, you could use a Ubuntu VM through Virtualbox for instance.
First, wed need a few **build tools** and the **aarch64 cross-compiler** :
> > apt-get update
> > apt-get install -y bc build-essential gcc-aarch64-linux-gnu git unzip
Then we can download the **Linux Kernel sources** :
> > git clone depth=1 -b rpi-4.8.y https://github.com/raspberrypi/linux.git
Enter now inside the created git directory. Optionally, you can add an extra version tag for your kernel. This is done by editing the beginning of the Makefile :
> VERSION = 4
> PATCHLEVEL = 8
> SUBLEVEL = 13
> EXTRAVERSION = +bilal
In order to **build it**, run the following commands :
> > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcmrpi3_defconfig
> > make -j 3 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
The first one should be pretty fast. For the second one its a whole different story, I havent timed it exactly but it was around 30 minutes for me. Make sure to adapt the -j flag depending on your number of CPUs (nproc * 1.5).
# Choose a Linux distribution
While the Kernel is being built, we can start preparing a Linux distribution for it. Ill be using **Raspbian** for simplicity in this tutorial, even though this is a 32-bit only distribution.
_If you want to go 64-bit all the way you should pick up a distribution available in aarch64, Debian has a robust [ARM64Port][4]. To grab it there are basically 3 options :_
_ download a pre-built root filesystem, this would most likely give you an outdated one as mentioned in that page_
_ build your own with debootstrap if youre familiar with it (otherwise it can be tricky as it requires some manual tweaks, the original purpose of it is to chroot from an already running host, not build a root filesystem for another machine)._
_ the one Id recommend, using multistrap, there seems to be a nice tutorial on this page : http://free-electrons.com/blog/embdebian-with-multistrap/_
Back to Raspbian, we can now download the official OS and start preparing it.
Open a new shell session and run the following commands :
> > wget -O raspbian.zip https://downloads.raspberrypi.org/raspbian_lite_latest
> > unzip raspbian.zip
We can inspect it with the following command :
> > fdisk -l 2016-11-25-raspbian-jessie-lite.img
> Disk 2016-11-25-raspbian-jessie-lite.img: 1.3 GiB, 1390411776 bytes, 2715648 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x244b8248
>
> Device Boot Start End Sectors Size Id Type
> 2016-11-25-raspbian-jessie-lite.img1 8192 137215 129024 63M c W95 FAT32 (LBA)
> 2016-11-25-raspbian-jessie-lite.img2 137216 2715647 2578432 1.2G 83 Linux
We can see it has **two partitions**. The first one is the **boot partition**, it mainly contains the bootloader, the Linux Kernel and a few config files. The second one is the** root partition**.
We can **mount those partitions** on our filesystem, starting with the **root partition** :
> > mount -o loop,offset=70254592 2016-11-25-raspbian-jessie-lite.img /mnt
The offset depends on the sector size, which is 512 : 70254592 = 512 * 137216
Then the **boot partition** :
> > mount -o loop,offset=4194304,sizelimit=66060288 2016-11-25-raspbian-jessie-lite.img /mnt/boot
_(offset : 4194304 = 512 * 8192, sizelimit: _ _66060288 = 512 * 129024)_
The Raspbian OS can now be seen under /mnt. Were almost there.
# Wrapping it up
Once the Kernel build is finished, the last steps involve **copying the Linux Kernel** and the **device tree** to the boot partition :
> > cp arch/arm64/boot/Image /mnt/boot/kernel8.img
> > cp arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dtb /mnt/boot/
Tweaking **config.txt** :
> > echo “kernel=kernel8.img” >> /mnt/boot/config.txt
Installing **Kernel modules** :
> > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu INSTALL_MOD_PATH=/mnt modules_install
> > umount /mnt/boot
> > umount /mnt
And… thats it, a freshly baked **ARM64 Linux Kernel** for our Raspberry Pi 3!
You can now compress the image, download it through scp for instance and follow the standard instructions to put it on your SD card.
Eventually youll get :
> > uname -a
> Linux raspberrypi 4.8.13+bilal-v8+ #1 SMP Wed Dec 14 14:09:38 UTC 2016 aarch64 GNU/Linux
[Twitter][5][LinkedIn][6][Google+][7][Share][8]
--------------------------------------------------------------------------------
via: https://devsidestory.com/build-a-64-bit-kernel-for-your-raspberry-pi-3/
作者:[Bilal Amarni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://devsidestory.com/about-me
[1]:https://devsidestory.com/author/bamarni/
[2]:https://devsidestory.com/build-a-64-bit-kernel-for-your-raspberry-pi-3/
[3]:https://github.com/bamarni/pi64
[4]:https://wiki.debian.org/Arm64Port
[5]:https://devsidestory.com/#twitter
[6]:https://devsidestory.com/#linkedin
[7]:https://devsidestory.com/#google_plus
[8]:https://www.addtoany.com/share#url=https%3A%2F%2Fdevsidestory.com%2Fbuild-a-64-bit-kernel-for-your-raspberry-pi-3%2F&title=Build%20a%2064-bit%20Kernel%20for%20your%20Raspberry%20Pi%203
[9]:https://github.com/Electron752
[10]:https://github.com/raspberrypi/linux
[11]:https://www.raspberrypi.org/documentation/linux/kernel/building.md
[12]:https://m.do.co/c/8ef9c5832a9c

View File

@ -1,125 +0,0 @@
GHLandy Translating
简览 6 大形象的开源商标
============================================================
![A look at 6 iconic open source brands](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_brandbalance.png?itok=opwotgEh "A look at 6 iconic open source brands")
Image by : 
opensource.com
Branding is an integral part of marketing. When it's done right and makes an impact, a simple logo (like a Nike swoosh) becomes a powerful advertisement in of itself. Just drive down any interstate in America and you'll see symbols that tell you about a brand. Like, the golden arches. Even certain color combinations can be identified with a brand without any additional text or images to give further context. Like, Virginia Tech University's maroon and orange; they are a unique color combination that is hard to mistake.
So, the question is: How is branding important to the open source community?
There is a strong argument from me, and many others, that yes it does very much. Open source software competes with paid software, and so must define itself as a viable, realistic alternative. It must also be memoriable and make an impact. If an open source software project represents itself with a poorly designed logo, a bad tagline, and inconsistent messaging, it will be hard to get noticed, be remembered, and be taken seriously. 
There are many projects doing it right that we can look to for inspiration and guidance. Here are six of my favorites.
### Six open source brands
###
![Linux&#039;s Tux mascot](https://opensource.com/sites/default/files/resize/linux-300x354.png "Linux&amp;#039;s Tux mascot")
### Linux
The beloved Linux penguin is named Tux, and he is considered the mascot, not the logo.
Tux was created by Larry Ewing, using GIMP 0.54 in 1996. [The story][4], as told by Jeff Ayers, is that Linus Torvalds had a fixation on penguins after being bitten by one at an Australian zoo in 1993\. Torvalds was looking for a fun image for Linux and felt that a fat penguin resting after a meal was the perfect solution. Tux has found his way into video games, cereal commercials, and even has a female pal, named Gown. Tux is as familiar to Linux users as the bitten-apple is to Mac users and the flying window is to Windows users.
![Mozilla new logo 2017](https://opensource.com/sites/default/files/resize/mozilla_1-650x185.png "Mozilla new logo 2017")
### Mozilla
The [Mozilla][5] Foundation is non-profit organization and [free-software community][6].
Recently wrapping up [a long rebranding effort][7], their creative team leader, Tim Murray, wrote, "At the core of this project is the need for Mozilla's purpose and brand to be better understood by more people. Our brand identity—our logo, our voice, our design—is an important signal of what we believe in and what we do."
In true open source fashion, Mozilla has invited everyone to contribute. "Thousands of emails, hundreds of meetings, dozens of concepts, and three rounds of research later, we have something to share." But, they're still working on the guidelines, so there's still time to get involved.
![Firefox logo](https://opensource.com/sites/default/files/firefox_0.png "Firefox logo")
### Firefox
[Firefox][8] is Mozilla's flagship software product and a popular [web browser][9].
The "fox" in Firefox is actually a red panda, which is a real animal, a cat-like creature native to China. The story is that Firefox was originally nicknamed "Phoenix" to denote its rising from the ashes of Netscape Navigator. The name was changed to Mozilla Firebird after a trademark dispute with Phoenix Technologies. Then, in February 2004, the name was changed to Mozilla Firefox, after the Firebird RDMS project said it caused confusion with its own projects.
Early logos for Firefox and Phoenix were criticized by interface designer Steve Garrity, who detailed the flaws in the post "[Branding Mozilla: Towards Mozilla 2.0][10]." So, Mozilla invited Garrity to lead better branding efforts. New icons were developed by silverorange, and the final renderings were done by Jon Hicks, who has done branding work for Camino, MailChimp, and Opera.
In 2013, the Firefox logo was a final clue on "[Jeopardy!][11]" that asked what the animal was in the logo. None of the three contestants knew the answer is a red panda, instead answering "su," "raccoon," and "Excel."
![Wilber the Gimp logo](https://opensource.com/sites/default/files/resize/gimp-300x300.png "Wilber the Gimp logo")
### GIMP
GIMP's logo is [Wilber the GIMP][12], created on September 25, 1997 by Tuomas Kuosmanen.
GIMP is an acronym for GNU Image Manipulation Program, and it is used for photo retouching and image manipulation. Wilber has had some accessories added, such as a hard hat, by Simon Budig, and a wizard cap, by Raphaël Quintet. According to GIMP's [Linking to Us][13] page, the use of Wilber is highly encouraged and you can even get the Wilber Construction Kit included in the source code in **/docs/Wilber_Construction_Kit.xcf.gz**.
What kind of creature is Wilber? Apparently, that's up for discussion. A forum on [gimper.net][14] offers many theories: coyote, panda, dog, or a "Goofy" derivative, just to name a few. A user named "TheWarrior" on [GimpChat.com][15], emailed Kuosmanen directly and was told, "Wilber is an animal of its own species: a 'GIMP.' What a GIMP is, is sort of a joke, because people kept asking it so much: It would be so boring to say it's a dog or a fox or whatever. And when I designed the character, I did not really have any particular animal in mind."
![PostgreSQL logo](https://opensource.com/sites/default/files/postgresql.png "PostgreSQL logo")
### PostgreSQL
As you've seen and probably know, animals are popular in logos.
An elephant named [Slonik][16] is part of the logo for [PostgreSQL][17], an open source Relational Database Management System (RDMS). Patrycja Dybka, writing for "Vertabelo," explains that the name is derived from the Russian word for "elephants," which is "slony." Oleg Bartunov said that the logo was first considered in an [email thread][18]. In it, the elephant was suggested by David Yang at St. Joseph's University in Philadelphia: "…but if you want an animal-based logo, how about some sort of elephant? After all, as the Agatha Christie title read, _Elephants Can Remember_."
![VLC logo](https://opensource.com/sites/default/files/resize/vlc-300x340.png "VLC logo")
### VLC media player
This logo diverges from the animal theme with... a traffic cone.
VLC is the ubiquitous media player that seems to appear on desktops magically—giving many a taste of open source without even knowing it! VLC is a product of the VideoLAN project, supported by the VideoLAN organization, which is based in France. VideoLAN began in 1996 as a student project at École Centrale Paris. According to Wikipedia, the traffic cone image is a reference to traffic cones collected from the streets of Paris by the École Centrale's Networking Students' Association. The original hand-drawn illustrated logo was re-rendered in 2006 by Richard Oistad.
Fun tidbits include:
* Seamus Islwyn's post _[What Does the Traffic Cone Mean in VLC?][1]_ tells us that in the month of December, the VLC cone wears a Santa hat, which disappears on December 31 and reverts back to the original cone.
* Some say that VLC stands for "Very Large Cone" or the cone was chosen because of a connection with Cone, France.
* Is the "official" story accurate? An exchange on the [VideoLAN Forum][2] between VLC's Jean-Baptiste Kempf and users seems to indicate that the traffic cone collection theory, as well as the funnel, the construction zone, the megaphone, and several other theories, may not be correct.
Will we ever get the definitive answer on the origins of the VLC traffic cone? My personal theory: It's "Saturday Night Live's" Coneheads. They were from France, remember? Remulak, to be exact.
**I'd love to hear from you in the comments about which other open source logos you love, hate, and feel excel at representing their brands.**
--------------------------------------------------------------------------------
译者简介:
Jeff Macharyas - Jeff Macharyas has worked in publishing and graphics for many years and has been the art director for Quick Printing, The American Spectator, the USOs OnPatrol, Todays Campus, and other publications as well as a project manager, editor, and circulation manager. Jeff holds a BS in Communications from Florida State University, a Graduate Certificate in Social Media Marketing from Rutgers University and a Masters in Cybersecurity and Computer Forensics from Utica College.
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/2/six-open-source-brands
作者:[Jeff Macharyas ][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/jeffmacharyas
[1]:http://www.ehow.com/info_10029162_traffic-cone-mean-vlc.html
[2]:https://forum.videolan.org/viewtopic.php?f=5&t=92513
[3]:https://opensource.com/article/17/2/six-open-source-brands?rate=Lmf1lD4etve4Apqfhw3NUV3SeENsNXhGqTh8OO4PzzQ
[4]:https://en.wikipedia.org/wiki/Tux
[5]:https://www.mozilla.org/en-US/
[6]:https://en.wikipedia.org/wiki/Mozilla
[7]:https://blog.mozilla.org/opendesign/arrival/
[8]:https://en.wikipedia.org/wiki/Firefox
[9]:https://en.wikipedia.org/wiki/Web_browser
[10]:http://actsofvolition.com/steven/mozillabranding/
[11]:http://www.complex.com/pop-culture/2013/09/firefox-jeopardy-answer
[12]:https://www.gimp.org/about/ancient_history.html
[13]:https://www.gimp.org/about/linking.html
[14]:https://gimper.net/threads/what-is-wilber.793/
[15]:http://gimpchat.com/viewtopic.php?f=4&t=10265
[16]:http://www.vertabelo.com/blog/notes-from-the-lab/the-history-of-slonik-the-postgresql-elephant-logo
[17]:https://wiki.postgresql.org/wiki/Logo
[18]:http://www.pgsql.ru/db/mw/msg.html?mid=1238939
[19]:https://opensource.com/user/83821/feed
[20]:https://opensource.com/article/17/2/six-open-source-brands#comments
[21]:https://opensource.com/users/jeffmacharyas

View File

@ -1,3 +1,5 @@
translating---geekpi
uCareSystem All-In-One System Update And Maintenance Tool For Ubuntu/LinuxMint
============================================================

View File

@ -1,3 +1,5 @@
Translating by cycoe
Installing Fedora 26 Beta on a MacBook Air
======================

View File

@ -1,3 +1,4 @@
translating by chenxinlong
# [Boot Repair Tool - Repair The Most Boot Related Problems][15]

View File

@ -1,3 +1,4 @@
wcnnbdk1 translating
How To kill An Inactive OR Idle SSH Sessions
============================================================

View File

@ -1,78 +0,0 @@
translating by chenxinlong
Free Up Some Space in Ubuntu/LinuxMint With Ubuntu Cleaner (Fork of Janitor Module)
============================================================
Most of us very often forget to remove junk files in Linux system which will make the system to run out of space.
We have to follow few stand procedure to free up space (remove distribution cache, system logs, app cache & trash) in Linux distribution, if we are doing the same procedure in manual way it would take hell lots of time and very difficult too.
In Linux verity of applications is available to make this task much easier. Today we are going to teach you about Ubuntu Cleaner which is forked from Janitor module (Its one of the module in Ubuntu tweak).
[Ubuntu Cleaner][2] is a tool that makes it easy to clean your Ubuntu system. As we already knows Ubuntu Tweak is one of the best utility which help us to tweak Ubuntu and its derivatives. Its got deprecated as his main developer did not have time to maintain it.
Suggested Read : [Stacer Linux System Optimizer and Monitoring Tool][3]
Suggested Read : [BleachBit A Quick And Best Way to Clean Up Your System In Linux][4]
So the developer of Ubuntu Cleaner forked the janitor module from Ubuntu tweak utility and bring back that useful functionality to the Ubuntu community with new name called Ubuntu cleaner since many users using Ubuntu tweak utility in latest version too (as they dont want to leave the utility). Its one of the most popular utility on Ubuntu many years.
Suggested Read : [uCareSystem All-In-One System Update And Maintenance Tool For Ubuntu/LinuxMint][5]
I guess whoever missing Ubuntu tweak they may feel happy by using the Ubuntu cleaner since its forked from janitor module.
Ubuntu Cleaner will remove the following junk files in Ubuntu and its derivatives:
* App caches (Browser caches)
* Thumbnail cache
* Apt cache
* Old kernels
* Package config files
* Unneeded packages
#### How to install Ubuntu Cleaner
We can easily install Ubuntu Cleaner to Ubuntu and its derivatives through PPA since the developer offering official PPA. Ubuntu Cleaner currently support Ubuntu 14.04 LTS and Ubuntu 16.04 LTS.
```
$ sudo add-apt-repository ppa:gerardpuig/ppa
$ sudo apt update
$ sudo apt install ubuntu-cleaner
```
#### How to use Ubuntu Cleaner
Launch an Ubuntu cleaner from main menu, you will get the default interface look like below.
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_001.png)][6]
Tick the `check box` in front of the file which you want to clean up. Finally hit `Clean` button to remove the junk files from system.
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_002.png)][7]
Yes, we have successfully cleaned our system now.
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_003.png)][8]
--------------------------------------------------------------------------------
via: http://www.2daygeek.com/ubuntu-cleaner-system-cleaner-ubuntu-tweak-alternative-janitor/#
作者:[2DAYGEEK ][a]
译者:[chenxinlong](https://github.com/chenxinlong)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.2daygeek.com/author/2daygeek/
[1]:http://www.2daygeek.com/author/2daygeek/
[2]:http://ubuntu-cleaner.blogspot.in/
[3]:http://www.2daygeek.com/stacer-linux-system-optimizer-and-monitoring-tool/
[4]:http://www.2daygeek.com/bleachbit-system-cleaner-on-ubuntu-debian-fedora-opensuse-arch-linux-mint/
[5]:http://www.2daygeek.com/ucaresystem-system-update-and-maintenance-tool-for-ubuntu-linuxmint/
[6]:http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_001.png
[7]:http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_002.png
[8]:http://www.2daygeek.com/wp-content/uploads/2017/06/Ubuntu-Cleaner_003.png

View File

@ -1,223 +0,0 @@
Pass A Simple command-line Password Manager for Linux
============================================================
Keep tracking the password is one of the big challenge to everyone now a days since we has multiple password like email, bank, social media, online portal, and ftp, etc.,.
Password managers are become very famous due to the demand and usage. In Linux so many alternatives are available, GUI based and CLI based. Today we are going to discuss about CLI based password manager called pass.
[pass][2] is a simple command line password manager for Linux which stores password inside of a `gpg` encrypted file. These encrypted files are organized in well folder hierarchies.
All passwords live in `~/.password-store`, and it provides simple commands for adding, editing, generating, and retrieving passwords.
Suggested Read : [KeePass A Best Password Management Tool To Store/Secure Passwords][3]
It is a very short and simple shell script. Its capable of temporarily putting passwords on your clipboard and tracking password changes using git.
This is a small shell script which use few default tools like gnupg, tree and git, there are active community offering GUI & extensions for pass.
#### How to Install Pass in Linux
Pass is available in the repositories of most major distributions. So, use your distribution package manager to get installed.
For Debian based systems, use [apt-get][4] or [apt package manager][5] to install pass.
```
$ sudo apt-get install pass
```
For RHEL/CentOS based systems, use [yum package manager][6] to install pass.
```
$ sudo yum install pass
```
For Fedora system, use [dnf package manager][7] to install pass.
```
$ sudo dnf install pass
```
For openSUSE system, use [zypper package manager][8] to install pass.
```
$ sudo zypper in password-store
```
For Arch Linux based systems, use [pacman package manager][9] to install pass.
```
$ pacman -S pass
```
#### How to generate GPG key pair
Make sure you have your own GPG key pair. If no, create a GPG key pair by running following command on terminal and follow the instructions.
```
$ gpg --gen-key
```
The above command will ask a series of questions to create a GPG key pair, so input the required details carefully and few question you can leave default answer which is enough.
#### Initiate the password store
If you got a GPG key pair then initialize the local password store by running the following command, you can pass either `email-id or gpg-id`.
```
$ pass init 2daygeek@gmail.com
mkdir: created directory '/home/magi/.password-store/'
Password store initialized for 2daygeek@gmail.com
```
The above command will create a password store under `~/.password-store` directory.
pass command is offering simple syntax to manage password. Lets see one by one like adding, editing, generating, and retrieving passwords.
Check the hierarchical tree by firing below command.
```
$ pass
or
$ pass ls
or
$ pass show
Password Store
```
I didnt see any tree hierarchical, so we will create our own based on our requirement.
#### Insert a new password info
We are going to save gmail id and its password by running below command.
```
$ pass insert eMail/2daygeek@gmail.com
mkdir: created directory '/home/magi/.password-store/eMail'
Enter password for eMail/2daygeek@gmail.com:
Retype password for eMail/2daygeek@gmail.com:
```
Do the same until you insert all your entries. Saving Facebook credential.
```
$ pass insert Social/Facebook_2daygeek
mkdir: created directory '/home/magi/.password-store/Social'
Enter password for Social/Facebook_2daygeek:
Retype password for Social/Facebook_2daygeek:
```
We can list all the existing passwords in the store.
```
$ pass show
Password Store
├── 2g
├── Bank
├── eMail
│   ├── 2daygeek@gmail.com
│   └── magesh.maruthamuthu@gmail.com
├── eMail
├── Social
│   ├── Facebook_2daygeek
│   └── Gplus_2daygeek
├── Social
└── Sudha
└── sudha21.magesh@gmail.com
```
#### Show existing password
Run the following command to retrieve password info from password store, It will ask you to enter the passphrase to unlock.
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/pass-command-line-package-manager-for-linux-1.png)][10]
```
$ pass eMail/2daygeek@gmail.com
*******
```
#### Copy the password in clipboard
To copy the password directly onto the clipboard temporarily instead of printing on terminal, use the following command which is more secure method and it will clear the password automatically after 45 seconds.
```
$ pass -c eMail/magesh.maruthamuthu@gmail.com
Copied eMail/magesh.maruthamuthu@gmail.com to clipboard. Will clear in 45 seconds.
```
#### Generate a new password
If you want to generate hard and guess password instead of odd one, it will do by using the pwgen utility internally.
```
$ pass generate eMail/2daygeek@gmail.com 15
An entry already exists for eMail/2daygeek@gmail.com. Overwrite it? [y/N] y
The generated password for eMail/2daygeek@gmail.com is:
y!NZ<%T)5Iwym_S
```
To generate password without symbols.
```
$ pass generate eMail/2daygeek@gmail.com 15 -n
An entry already exists for eMail/2daygeek@gmail.com. Overwrite it? [y/N] y
The generated password for eMail/2daygeek@gmail.com is:
TP9ACLyzUZUwBwO
```
#### Edit existing password
Insert a new password or edit an existing password using editor. When you run below command it will open the file `/dev/shm/pass.wUyGth1Hv0rnh/6kOBG-eMail-2daygeek@gmail.com.txt` in text editor which contain the password. Just add new password then save and exit.
```
$ pass edit eMail/2daygeek@gmail.com
File: /dev/shm/pass.wUyGth1Hv0rnh/6kOBG-eMail-2daygeek@gmail.com.txt
TP9ACLyzUZUwBwO
```
#### Remove a Password
To remove existing password. It will remove the entry from `~/.password-store` which is contain `.gpg`
```
$ pass rm eMail/2daygeek@gmail.com
Are you sure you would like to delete eMail/2daygeek@gmail.com? [y/N] y
removed '/home/magi/.password-store/eMail/2daygeek@gmail.com.gpg'
```
#### Multi-line Functionality
To save detailed info like, URL, username, password, pin, etc,., Use the following format. Make sure you have to add first entry as a password since it used to copy first line as a password when you use clipboard option, and the additional information on subsequent lines.
```
$ pass insert eMail/2daygeek@gmail.com -m
Enter contents of eMail/2daygeek@gmail.com and press Ctrl+D when finished:
H3$%hbhYT
URL : http://www.2daygeek.com
Info : Linux Tips & Tricks
Ftp User : 2g
```
--------------------------------------------------------------------------------
via: http://www.2daygeek.com/pass-command-line-password-manager-linux/
作者:[2DAYGEEK ][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/2daygeek/
[1]:http://www.2daygeek.com/author/2daygeek/
[2]:https://www.passwordstore.org/
[3]:http://www.2daygeek.com/keepass-best-linux-password-manager-arch-linux-mint-ubuntu-debian-fedora-opensuse/
[4]:http://www.2daygeek.com/apt-get-apt-cache-command-examples/
[5]:http://www.2daygeek.com/apt-command-examples/
[6]:http://www.2daygeek.com/yum-command-examples/
[7]:http://www.2daygeek.com/dnf-command-examples/
[8]:http://www.2daygeek.com/zypper-command-examples/
[9]:http://www.2daygeek.com/pacman-command-examples/
[10]:http://www.2daygeek.com/wp-content/uploads/2017/06/pass-command-line-package-manager-for-linux-1.png

View File

@ -0,0 +1,65 @@
与开放社区讨论法律事宜的 7 种方式
============================================================
> 你的组织的律师准备好参加开放社区了么?不要让他们犯这些错。
![7 ways to discuss legal matters with an open community](https://opensource.com/sites/default/files/styles/image-full-size/public/images/law/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=xmtgmowQ "7 ways to discuss legal matters with an open community")
>图片提供 opensource.com
我注意到有相当多的人尝试同时参与[开源倡议的许可评估社区] [3]以及[ Apache 软件基金会的法律事务委员会][4]我想提供一些成功的提示和技巧在当轮到_你_与开放社区进行法律讨论时。
### 不要代理人
首先要确保进行谈话的人员既有_资格_又有_授权_。不要用代理人这只会让社区沮丧他们很快会发现你的代表总是扮演二手车推销员的角色并且到后面的房间要求交易。显然法律讨论将涉及公司的一个团队可能涉及产品管理、工程和内部咨询。 但代表们需要能够自己进行谈话,不要总是引用幕后匿名人物的话。
### 多边主义
一个开源社区就安全合作所需的确定性达成了难得一致的共识。这种共识体现在其治理中,尤其是在他们使用的开源许可证中。所以当你提出一个新的提案时,这不是一个正常的商业交易。这些是双边谈判,交换双方的自由创造一个最佳妥协的和平条约。在这个讨论中,你只是许多方面之一,你需要解释为什么你的提案对所有人都有好处。谈判多边变化本质上是缓慢的,所以不要设置最后期限。无论你做什么,不要建议对开源许可证进行更改!
### 首先学习
现有的共识和过程存在一个原因。你应该了解每个元素的原因,最好连同其发生的历史一起了解,然后再提出修改。这样,你可以在进一步发展的背景下表达你的提案,这样你可以避免在社区历史中受教育(浪费社区资源,降低你机会的有效性)。回看邮件列表,并向开发人员询问历史和来龙去脉。
### 透明
开源开发人员使用一个迭代、增量修改的过程。即使需要大的变化它几乎总是用一系列更小更好的解释或不言而喻的正确变化来实现的这样每个人都可以跟进并支持。你提出的更改也是如此。不要出现新的贡献者协议或者修改过的许可证并期望每个人都相信你是专家所以一切都是好的。你需要提供一根“红线”相当于法律文件的差异记录每个变化并提供一个承认任何社区影响的里有并为其辩护。如果你_只是_为了你自己的利益需要一个东西承认它而不是希望没有人会注意到。
### 谦逊
你是一个炙手可热的律师,你认为只有程序员使用邮件列表。很明显,对你而言他们缺乏讨论的经验,所以你排了一个你认为是同等的代理人,简化这一切,或者提出与社区选择的律师进行一对一的讨论。 我很抱歉地说你做的都是错的。由于社区的政策是多边协商一致的,所以他们很有可能知道他们现在的决定。名单上的一些人将具有优秀的领域知识,可能会比你的更好。而且一对一这件事是终极的羞辱,就像询问是否有一个成年人可以与你说话。
### 不要后台渠道
有可能是某种领导机构。也许你认识在公司法务工作的 VP。也许你认识社区的总法律顾问。虽然在某些情况下询问如何操控流程的提示可能是可以接受的但试图影响甚至决定结果的方式进行后台渠道讨论或协商, 那么结果会很糟糕。你最终可能会被邀请进行一对一的讨论, 但你不应该要求或期待。
### 成为一个成员
如果你一切都做得正确,那么社区就有可能尊重你。坚持这些。作为一名冷静、机智的贡献者建立你的声誉。当人们犯你犯过的错误(或者已避免的)时,帮助他们。作为邮件列表社区的值得信赖的参与者,你是项目和雇主的真正资产。继续贡献,一些项目最终会在它们的治理中为你提供一个角色。
_这个文章的早期版本[最初发表][1]在 Meshed Insights 中。_
--------------------------------------------------------------------------------
作者简介:
Simon Phipps - 计算机行业和开源老手 Simon Phipps 上线了 Public Software一个欧洲的开源项目托管Document Foundation 的志愿者总监。他的帖子由 Patreon 赞助者赞助 - 如果你想要看更多,成为其中一个!
------------
via: https://opensource.com/open-organization/17/3/legal-matters-community
作者:[ Simon Phipps][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/simonphipps
[1]:https://meshedinsights.com/2017/02/28/engaging-communities-on-legal-matters-7-tips/
[2]:https://opensource.com/open-organization/17/3/legal-matters-community?rate=gSFbyOzBTIipXOdeeL-GVIT1BYoC4f61FKZJ7KRg3d0
[3]:https://opensource.org/approval
[4]:https://www.apache.org/legal/
[5]:https://opensource.com/user/12532/feed
[6]:https://opensource.com/open-organization/17/3/legal-matters-community#comments
[7]:https://opensource.com/users/simonphipps

View File

@ -1,4 +1,4 @@
开发 Linux 调试器第三部分:寄存器和内存
开发 Linux 调试器(三):寄存器和内存
============================================================
上一篇博文中我们给调试器添加了一个简单的地址断点。这次,我们将添加读写寄存器和内存的功能,这将使我们能够使用我们的程序计数器、观察状态和改变程序的行为。
@ -9,7 +9,7 @@
随着后面文章的发布,这些链接会逐渐生效。
1. [启动][3]
1.  [准备环境][3]
2. [断点][4]
@ -29,12 +29,11 @@
10. 下一步
译者注ELF[Executable and Linkable Format](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format "Executable and Linkable Format") 可执行文件格式DWARF一种广泛使用的调试数据格式参考 [WIKI](https://en.wikipedia.org/wiki/DWARF "DWARF WIKI")
* * *
### 注册我们的寄存器
在我们真正读取任何寄存器之前,我们需要告诉调试器更多关于我们平台,也就是 x86_64 的信息。除了多组通用和专用目的寄存器x86_64 还提供浮点和向量寄存器。为了简化我将跳过后两种寄存器但是你如果喜欢的话也可以选择支持它们。x86_64 也允许你像访问 32、16 或者 8 位寄存器那样访问一些 64 位寄存器,但我只会介绍 64 位寄存器。由于这些简化,对于每个寄存器我们只需要它的名称,它的 DWARF 寄存器编号以及 `ptrace` 返回结构体中的存储地址。我使用范围枚举引用这些寄存器,然后我列出了一个全局寄存器描述符数组,其中元素顺序和 `ptrace` 中寄存器结构体相同。
在我们真正读取任何寄存器之前,我们需要告诉调试器一些关于我们的目标,也就是 x86_64 的信息。除了多组通用和专用目的寄存器x86_64 还提供浮点和向量寄存器。为了简化我将跳过后两种寄存器但是你如果喜欢的话也可以选择支持它们。x86_64 也允许你像访问 32、16 或者 8 位寄存器那样访问一些 64 位寄存器,但我只会介绍 64 位寄存器。由于这些简化,对于每个寄存器我们只需要它的名称,它的 DWARF 寄存器编号以及 `ptrace` 返回结构体中的存储地址。我使用范围枚举引用这些寄存器,然后我列出了一个全局寄存器描述符数组,其中元素顺序和 `ptrace` 中寄存器结构体相同。
```
enum class reg {
@ -169,7 +168,7 @@ void debugger::dump_registers() {
正如你看到的iostreams 有非常精确的接口用于美观地输出十六进制数据[2][10]。如果你喜欢你也可以通过 I/O 操纵器来摆脱这种混乱。
这些已经足够支持我们在调试器接下来的部分轻松地处理寄存器,因为我们现在可以把这些添加到我们的用户界面。
这些已经足够支持我们在调试器接下来的部分轻松地处理寄存器,所以我们现在可以把这些添加到我们的用户界面。
* * *
@ -196,7 +195,7 @@ void debugger::dump_registers() {
### 接下来做什么?
设置断点的时候我们已经读取和写入内存,因此我们只需要添加一些函数用于隐藏 `ptrace`调用。
设置断点的时候我们已经读取和写入内存,因此我们只需要添加一些函数用于隐藏 `ptrace` 调用。
```
uint64_t debugger::read_memory(uint64_t address) {
@ -309,7 +308,7 @@ void debugger::continue_execution() {
```
你要将程序计数器移回 `0x40093a` 使得正确设置 `esi` and `edi` 寄存器。
你要将程序计数器移回 `0x40093a` 以便正确设置 `esi` 和 `edi` 寄存器。
在下一篇博客中,我们会第一次接触到 DWARF 信息并给我们的调试器添加一系列逐步调试的功能。之后,我们会有一个功能工具,它能逐步执行代码、在想要的地方设置断点、修改数据以及其它。一如以往,如果你有任何问题请留下你的评论!
@ -327,15 +326,15 @@ via: https://blog.tartanllama.xyz/c++/2017/03/31/writing-a-linux-debugger-regist
作者:[ TartanLlama ][a]
译者:[ictlyh](https://github.com/ictlyh)
校对:[校对者ID](https://github.com/校对者ID)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.twitter.com/TartanLlama
[1]:https://blog.tartanllama.xyz/c++/2017/03/31/writing-a-linux-debugger-registers/#fnref:2
[2]:https://blog.tartanllama.xyz/c++/2017/03/31/writing-a-linux-debugger-registers/#fnref:1
[3]:https://blog.tartanllama.xyz/2017/03/21/writing-a-linux-debugger-setup/
[4]:https://blog.tartanllama.xyz/c++/2017/03/24/writing-a-linux-debugger-breakpoints/
[3]:https://linux.cn/article-8626-1.html
[4]:https://linux.cn/article-8645-1.html
[5]:https://blog.tartanllama.xyz/c++/2017/03/31/writing-a-linux-debugger-registers/
[6]:https://blog.tartanllama.xyz/c++/2017/04/05/writing-a-linux-debugger-elf-dwarf/
[7]:https://blog.tartanllama.xyz/c++/2017/04/24/writing-a-linux-debugger-source-signal/

View File

@ -1,62 +1,62 @@
Powerline A Powerful Statusline Plugin For Vim & Bash Terminal
Powerline - Vim 和 Bash 中的一个强大状态栏插件
============================================================
[Powerline][2] is a statusline plugin for vim, zsh, bash, tmux, IPython, Awesome, bar, fish, lemonbar, pdb, rc, shell, tcsh, wm, i3 and Qtil. It provides statuslines to applications and make all applications more beautiful. Its written in Python.
[Powerline][2] 是 vim、zsh、bash、tmux、IPython、Awesome、bar、fish、lemonbar、pdb、rc、shell、tcsh、wm、i3 和 Qtil 中的一个状态栏插件。它给程序提供状态栏,并使程序更好看。它用 Python 写成。
Its Extensible and feature rich, written in Python which is very thin and doesnt required any third-party dependencies other than a Python interpreter.
它是可扩展的并且功能丰富,它用 Python 写成,非常轻便不需要任何第三方的依赖,只需要一个 Python 解释器。
Stable and testable code base which is throughly tested and works fine with Python 2.6+ and Python 3.
稳定以及可测试代码库经过完整的测试,并且在 Python 2.6+ 和 Python 3 中工作良好。
Statuslines Originally created exclusively for vim, later the project has evolved to provide statuslines in many Linux applications such as zsh, bash, tmux, IPython, Awesome, i3 and Qtil.
最初状态栏只在 vim 中可用,随后项目进化为为许多 Linux 程序如 zsh、bash、tmux、IPython、Awesome、i3 和 Qtil 提供状态栏。
Configuration and colorschemes written in JSON. Its a standard and easy file format that allows user to configure supported applications with Powerlines.
配置以及配色方案用 JSON 写成。它是一种标准简易的文件格式,允许用户配置 Powerline 支持的程序。
Fast and lightweight, with daemon support for even better performance.
快速并且轻量级,支持守护进程为了更好的性能。
#### Install pre requisites
#### 安装预先要求
Make sure your system should have below pre requisite packages. If no, install before proceeding powerline installation.
确保你的系统有下面预先要求的包。如果没有,在安装 powerline 之前先安装它们。
For Debian users, use [APT Package Manager][3] or [Apt-Get Package Manager][4] to install Audit package.
对于 Debian 用户,使用[ APT 包管理器][3]或者[ Apt-Get 包管理器][4]安装需要的包。
```
$ sudo apt-get install python-pip git
```
For openSUSE users, use [Zypper Package Manager][5] to install Audit package.
对于 openSUSE 用户,使用 [ Zypper 包管理器][5]安装需要的包。
```
$ sudo zypper install python-pip git
```
For Fedora users, use [dnf Package Manager][6] to install Audit package.
对于 Fedora 用户,使用[ dnf 包管理器][6]安装需要的包。
```
$ sudo dnf install python-pip git
```
For Arch Linux users, use [pacman Package Manager][7] to install Audit package.
对于 Arch Linux 用户,使用[ pacman 包管理器][7]安装需要的包。
```
$ sudo pacman -S python-pip git
```
For CentOS/RHEL user, use [yum Package Manager][8] to install Audit package.
对于 CentOS/RHEL 用户,使用[ yum 包管理器][8]安装需要的包。
```
$ sudo yum install python-pip git
```
#### How to install Powerline in Linux
#### 如何在 Linux 中安装 Powerline
In this article, we are going to show you how to install Powerline. Also show you how to use with Bash, tumx & Vim in Debian and RHEL based systems.
在本篇中,我们将向你展示如何安装 Powerline。以及如何在基于 Debian 以及 RHEL 的系统中在 Bash、tumx 和 Vim 中使用。
```
$ sudo pip install git+git://github.com/Lokaltog/powerline
```
Find the powerline installed location in order to configure with applications.
找出 powerline 安装位置以便配置程序。
```
$ pip show powerline-status
@ -71,9 +71,9 @@ Location: /usr/lib/python2.7/site-packages
Requires:
```
#### Add/Enable Powerline on Bash Shell
#### 在 Bash Shell 中添加/启用 Powerline
Add following lines to your `.bashrc` file which will enable powerline to base shell by default.
添加下面的行到 `.bashrc` 中,它会默认在基础 shell 中启用 powerline。
```
if [ -f `which powerline-daemon` ]; then
@ -84,7 +84,7 @@ if [ -f `which powerline-daemon` ]; then
fi
```
Reload the `.bashrc` file to take immediate effect to get the powerline in the same window.
重新加载 `.bashrc` 文件使得 powerline 在当前窗口中立即生效。
```
$ source ~/.bashrc
@ -92,9 +92,9 @@ $ source ~/.bashrc
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/install-powerline-in-linux-1.png)][9]
#### Add/Enable Powerline on tmux
#### 在 tmux 中添加/启用 Powerline
Tmux is one of the best terminal emulator that offers multiple window and statusline but is not looks good compare with powerline statusline. Add following line to your `.tmux.conf` file which will enable powerline to tmux by default. If you dont found `.tmux.conf` file then create a new one.
tmux 是最好的终端仿真程序之一,它提供多窗口以及状态栏,但是相比 powerline 的状态栏看上去不那么好。添加下面的的行到 `.tmux.conf` 中,它会默认在 tmux 中启用 powerline。如果你没有找到 `.tmux.conf` 文件,那么创建一个新的。
```
# vi ~/.tmuc.conf
@ -104,9 +104,9 @@ source "/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/install-powerline-in-linux-2.png)][10]
#### Add/Enable Powerline on Vim
#### 在 Vim 中添加/启用 Powerline
Vim is one of the favourite text editor for admins. Enable powerline to add more power to vim by adding below lines into `.vmrc`file. Make a note, in vim 7.x you may not found the .vmrc file in system so dont worry create a new one and add below lines thats it.
vim 是管理员最爱的文本编辑器之一。添加下面的行到 `.vmrc` 中,启用 powerline 使 vim 更加强大。注意,在 vim 7.x 中,你可能不会在系统中发现 .vimrc 文件,因此不必担心,创建一个新的文件,并添加下面行。
```
# vi ~/.vmrc
@ -125,7 +125,7 @@ set t_Co=256
via: http://www.2daygeek.com/powerline-adds-powerful-statusline-to-vim-bash-tumx-in-ubuntu-fedora-debian-arch-linux-mint/
作者:[ 2DAYGEEK · ][a]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,18 +1,18 @@
Automatically Create/Remove And Mount Swap File In Linux Using Shell Script
在 Linux 中使用 shell 脚本自动创建/移除并挂载交换文件
============================================================ 
Few days ago we have covered an article about swap file creation in Linux using three ways which is the common method but it requires manual human effort.
几天前我们写了一篇关于在 Linux 中 3 种创建交换文件的方法,它们是常见的方法,但是需要人工操作。
Today i have found a small shell script (Two shell script, one for swap file creation and another one for removing swap file) which was written by [Gary Stafford][3] that help us to create/remove & mount swap file automatically in Linux.
今天我发现了一个小的 [Gary Stafford][3] 写的 shell 脚本(两个 shell 脚本,一个用于创建交换文件,另外一个用于移除交换文件),它帮助我们在 Linux 中创建/移除并且自动挂载交换文件。
By default the script create and mount `512MB` swapfile. If you want more swap space and different file name you have to modify the script accordingly. Its not a big deal to modify the script since its very handy and small script, even though i have colored the line where you want to modify the script.
默认这个脚本创建并挂载 `512MB` 的交换文件。如果你想要更多的交换空间和不同的文件名,你需要相应地修改脚本。修改脚本不是一件困难的事,因为这是一个非常上手而且小的脚本,设置我已经为你想要修改的脚本行加上了颜色。
**Suggested Read : **[3 Easy Ways To Create Or Extend Swap Space In Linux][4]
**推荐阅读:** [Linux 中 3 中简易的创建或扩展交换空间的方法][4]
#### How to check current swap size
#### 如何检查当前交换文件大小
Lets first check the size of existing swap space partition using **[free][1]** & `swapon` command.
使用 **[free][1]** 和 `swapon` 命令检查已经存在交换空间。
```
$ free -h
@ -25,11 +25,11 @@ NAME TYPE SIZE USED PRIO
/dev/sda5 partition 2G 655.2M -1
```
The above output clearly shows `2GB` is my current swap space.
上面的输出显示我当前的交换空间是 `2GB`
#### Create Swap File
#### 创建交换文件
Create `create_swap.sh` file and add below script to automate the swap space creation and mounting.
创建 `create_swap.sh` 文件并添加下面的脚本来自动化交换空间的创建和挂载。
```
$ nano create_swap.sh
@ -59,13 +59,13 @@ echo '--------------------------------------------'
swapon --show
```
Add execute permission to the file.
给文件添加执行权限。
```
$ sudo +x create_swap.sh
```
Run the file to create and mount swap file.
运行文件来创建和挂载交换文件。
```
$ sudo ./create_swap.sh
@ -81,11 +81,11 @@ NAME TYPE SIZE USED PRIO
/swapfile file 1024M 0B -2
```
Yes i can see the new `1024M swapfile`. Reboot the system to use the new swap file.
你可以看到新的 `1024M swapfile`。重启系统以使用新的交换文件。
#### Remove Swap File
#### 移除交换文件
If the swap file is no longer required, then create `remove_swap.sh` file and add below script to remove swap file and its mount point from /etc/fstab.
如果不再需要交换文件,接着创建 `remove_swap.sh` 文件并添加下面的脚本移除交换文件以及它的 /etc/fstab 挂载点。
```
$ nano remove_swap.sh
@ -111,13 +111,13 @@ echo '--------------------------------------------'
swapon --show
```
Add execute permission to the file.
并给文件添加可执行权限。
```
$ sudo +x remove_swap.sh
```
Run the file to remve and unmount swap file.
运行脚本来移除并卸载交换文件。
```
$ sudo ./remove_swap.sh
@ -138,7 +138,7 @@ NAME TYPE SIZE USED PRIO
via: http://www.2daygeek.com/shell-script-create-add-extend-swap-space-linux/
作者:[2DAYGEEK ][a]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,224 @@
Pass 一款 Linux 的简单命令行密码管理工具
============================================================
现如今要记住类似 email、银行、社交媒体、在线支付、ftp 等等这么多的密码相信对每一个人来说都是一个巨大的挑战。
由于需求和使用,密码管理器现如今变得非常的流行。在 Linux 中我们可以有很多选择,包括基于 GUI 和基于 CLI 两种。今天我们要讲的是一款基于 CLI 的密码管理器叫做 pass 。
[pass][2] 是 Linux 上的一个简单的命令行密码管理器,它将密码存储在一个 `gpg` 加密后的文件里。这些加密后的文件会被按照良好的目录结构组织存放。
所有密码都存在于 `〜/ .password-store` 中,它提供了添加、编辑、生成和检索密码等简单命令。
建议阅读:[KeePass - 存储/安全密码的最佳密码管理工具][3]
它是一个非常简短和简单的 shell 脚本。 它能够临时将密码放在剪贴板上,并使用 git 跟踪密码的修改。
这是一个很小的 shell 脚本,它还使用了少量的默认工具比如 gnupg、tree 和 git同时还有活跃的社区为它提供 GUI 和扩展。
#### 如何在 Linux 中安装 Pass
Pass 可从大多数 Linux 的主要发行版的仓库中获得。 所以,你可以使用你的分布式包管理器来安装它。
对于基于 Debian 的系统,你可以使用 [apt-get][4] 或 [apt package manager][5] 命令来安装 pass。
```
$ sudo apt-get install pass
```
对于基于 RHEL/CentOS 的操作系统, 使用 [yum package manager][6] 命令来安装它。
```
$ sudo yum install pass
```
Fedora 系统可用 [dnf package manager][7] 命令来安装。
```
$ sudo dnf install pass
```
openSUSE 系统可以用 [zypper package manager][8] 命令来安装。
```
$ sudo zypper in password-store
```
对于基于 Arch Linux 的操作系统用 [pacman package manager][9] 来安装它。
```
$ pacman -S pass
```
#### 如何生成 GPG 密钥对
确保你拥有你个人的 GPG 密钥对。如果没有的话,你可以通过在终端中输入以下的命令并安装指导来创建你的 GPG 密钥对。
```
$ gpg --gen-key
```
运行以上的命令以生成 GPG 密钥对时会有一系列的问题询问,谨慎输入问题的答案,其中有一些只要使用默认值即可。、
#### 初始化密码存储
如果你已经有了 GPG 密钥对,请通过运行以下命令初始化本地密码存储,你可以 pass `email-id``gpg-id`
```
$ pass init 2daygeek@gmail.com
mkdir: created directory '/home/magi/.password-store/'
Password store initialized for 2daygeek@gmail.com
```
上述命令将在 `〜/ .password-store` 目录下创建一个密码存储区。
pass 命令提供了简单的语法来管理密码。 我们一个个来看,如何添加、编辑、生成和检索密码。
通过下面的命令检查目录结构树。
```
$ pass
or
$ pass ls
or
$ pass show
Password Store
```
我没有看到任何树型结构,所以我们将根据我们的需求来创建一个。
#### 插入一个新的密码信息
我们将通过运行以下命令来保存 gmail id 及其密码。
```
$ pass insert eMail/2daygeek@gmail.com
mkdir: created directory '/home/magi/.password-store/eMail'
Enter password for eMail/2daygeek@gmail.com:
Retype password for eMail/2daygeek@gmail.com:
```
执行重复操作,直到所有的密码插入完成。 必入保存 Facebook 密码。
```
$ pass insert Social/Facebook_2daygeek
mkdir: created directory '/home/magi/.password-store/Social'
Enter password for Social/Facebook_2daygeek:
Retype password for Social/Facebook_2daygeek:
```
我们可以列出存储中的所有现有的密码。
```
$ pass show
Password Store
├── 2g
├── Bank
├── eMail
│   ├── 2daygeek@gmail.com
│   └── magesh.maruthamuthu@gmail.com
├── eMail
├── Social
│   ├── Facebook_2daygeek
│   └── Gplus_2daygeek
├── Social
└── Sudha
└── sudha21.magesh@gmail.com
```
#### 显示已有密码
运行以下命令从密码存储中检索密码信息,它会询问你输入密码以解锁。
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/pass-command-line-package-manager-for-linux-1.png)][10]
```
$ pass eMail/2daygeek@gmail.com
*******
```
#### 在剪贴板中复制密码
要直接将密码直接复制到剪贴板上,而不是在终端上输入,请使用以下更安全的命令,它会在 45 秒后自动清除密码。
```
$ pass -c eMail/magesh.maruthamuthu@gmail.com
Copied eMail/magesh.maruthamuthu@gmail.com to clipboard. Will clear in 45 seconds.
```
#### 生成一个新密码
如果你想生成一些比较难以猜测的密码用于代替原有的奇怪的密码,可以通过其内部的 pwgen 程序来实现。
```
$ pass generate eMail/2daygeek@gmail.com 15
An entry already exists for eMail/2daygeek@gmail.com. Overwrite it? [y/N] y
The generated password for eMail/2daygeek@gmail.com is:
y!NZ<%T)5Iwym_S
```
生成没有符号的密码。
```
$ pass generate eMail/2daygeek@gmail.com 15 -n
An entry already exists for eMail/2daygeek@gmail.com. Overwrite it? [y/N] y
The generated password for eMail/2daygeek@gmail.com is:
TP9ACLyzUZUwBwO
```
#### 编辑现有的密码
使用编辑器插入新密码或编辑现有密码。 当你运行下面的命令时,将会在包含密码的文本编辑器中打开文件`/ dev / shm / pass.wUyGth1Hv0rnh / 6kOBG-eMail-2daygeek @ gmail.com.txt`。 只需在其中添加新密码,然后保存并退出即可。
```
$ pass edit eMail/2daygeek@gmail.com
File: /dev/shm/pass.wUyGth1Hv0rnh/6kOBG-eMail-2daygeek@gmail.com.txt
TP9ACLyzUZUwBwO
```
#### 移除密码
删除现有密码。 它将从 `〜/ .password-store` 中删除包含 `.gpg` 的条目
```
$ pass rm eMail/2daygeek@gmail.com
Are you sure you would like to delete eMail/2daygeek@gmail.com? [y/N] y
removed '/home/magi/.password-store/eMail/2daygeek@gmail.com.gpg'
```
#### 多选项功能
要保存详细信息,如 URL、用户名、密码、引脚等信息可以使用以下格式。 首先确保你要将第一项设置为密码,因为它用于在使用剪贴板选项时将第一行复制为密码,以及后续行中的附加信息。
```
$ pass insert eMail/2daygeek@gmail.com -m
Enter contents of eMail/2daygeek@gmail.com and press Ctrl+D when finished:
H3$%hbhYT
URL : http://www.2daygeek.com
Info : Linux Tips & Tricks
Ftp User : 2g
```

--------------------------------------------------------------------------------
via: http://www.2daygeek.com/pass-command-line-password-manager-linux/
作者:[2DAYGEEK ][a]
译者:[chenxinlong](https://github.com/chenxinlong)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.2daygeek.com/author/2daygeek/
[1]:http://www.2daygeek.com/author/2daygeek/
[2]:https://www.passwordstore.org/
[3]:http://www.2daygeek.com/keepass-best-linux-password-manager-arch-linux-mint-ubuntu-debian-fedora-opensuse/
[4]:http://www.2daygeek.com/apt-get-apt-cache-command-examples/
[5]:http://www.2daygeek.com/apt-command-examples/
[6]:http://www.2daygeek.com/yum-command-examples/
[7]:http://www.2daygeek.com/dnf-command-examples/
[8]:http://www.2daygeek.com/zypper-command-examples/
[9]:http://www.2daygeek.com/pacman-command-examples/
[10]:http://www.2daygeek.com/wp-content/uploads/2017/06/pass-command-line-package-manager-for-linux-1.png