Merge pull request #32 from LCTT/master

Update Repository
This commit is contained in:
joeren 2014-10-13 09:09:32 +08:00
commit 94ad7d554f
23 changed files with 574 additions and 516 deletions

View File

@ -1,10 +1,10 @@
在 Debian 上使用 systemd 管理系统
================================================================================
人类已经无法阻止 systemd 占领全世界的 Linux 系统了唯一阻止它的方法是在你自己的机器上手动卸载它。到目前为止systemd 已经创建了比任何软件都多的技术问题、感情问题和社会问题。这一点从[热议][1](也称 Linux 初始化软件之战)上就能看出,这场争论在 Debian 开发者之间持续了好几个月。当 Debian 技术委员会最终决定将 systemd 放到 Debian 8代号 Jessie的发行版里面时其反对者试图通过多种努力来[取代这项决议][2],甚至有人扬言要威胁那些支持 systemd 的开发者的生命安全。
人类已经无法阻止 systemd 占领全世界的 Linux 系统了唯一阻止它的方法是在你自己的机器上手动卸载它。到目前为止systemd 已经创建了比任何软件都多的技术问题、感情问题和社会问题。这一点从[“Linux 初始化软件之战”][1]上就能看出,这场争论在 Debian 开发者之间持续了好几个月。当 Debian 技术委员会最终决定将 systemd 放到 Debian 8代号 Jessie的发行版里面时其反对者试图通过多种努力来[取代这项决议][2],甚至有人扬言要威胁那些支持 systemd 的开发者的生命安全。
这也说明了 systemd 对 Unix 传承下来的系统处理方式有很大的干扰。“一个软件只做一件事情”的哲学思想已经被这个新来者彻底颠覆。除了取代了 sysvinit 成为新的系统初始化工具外systemd 还是一个系统管理工具。目前为止,由于 systemd-sysv 这个软件包提供的兼容性,那些我们使用惯了的工具还能继续工作。但是当 Debian 将 systemd 升级到214版本后这种兼容性就不复存在了。升级措施预计会在 Debian 8 "Jessie" 的稳定分支上进行。从此以后用户必须使用新的命令来管理系统、执行任务、变换运行级别、查询系统日志等等。不过这里有一个应对方案,那就是在 .bashrc 文件里面添加一些别名。
现在就让我们来看看 systemd 是怎么改变你管理系统的习惯的。在使用 systemd 之前,你得先把 sysvinit 保存起来,以 systemd 出错的时候还能用 sysvinit 启动系统。这种方法只有在没安装 systemd-sysv 的情况下才能生效,具体操作方法如下:
现在就让我们来看看 systemd 是怎么改变你管理系统的习惯的。在使用 systemd 之前,你得先把 sysvinit 保存起来,以便在 systemd 出错的时候还能用 sysvinit 启动系统。这种方法**只有在没安装 systemd-sysv 的情况下才能生效**,具体操作方法如下:
# cp -av /sbin/init /sbin/init.sysvinit
@ -34,8 +34,8 @@ systemctl 的功能是替代“/etc/init.d/foo start/stop”这类命令
你同样可以使用 systemctl 实现转换运行级别、重启系统和关闭系统的功能:
- systemctl isolate graphical.target - 切换到运行级别5就是有桌面的级别
- systemctl isolate multi-user.target - 切换到运行级别3没有桌面的级别
- systemctl isolate graphical.target - 切换到运行级别5就是有桌面的运行级别
- systemctl isolate multi-user.target - 切换到运行级别3没有桌面的运行级别
- systemctl reboot - 重启系统
- systemctl poweroff - 关机
@ -43,7 +43,7 @@ systemctl 的功能是替代“/etc/init.d/foo start/stop”这类命令
### journalctl 的基本用法 ###
systemd 不仅提供了比 sysvinit 更快的启动速度,还让日志系统在更早的时候启动起来,可以记录内核初始化阶段、内存初始化阶段、前期启动步骤以及主要的系统执行过程的日志。所以以前那种需要通过对显示屏拍照或者暂停系统来调试程序的日子已经一去不复返啦。
systemd 不仅提供了比 sysvinit 更快的启动速度,还让日志系统在更早的时候启动起来,可以记录内核初始化阶段、内存初始化阶段、前期启动步骤以及主要的系统执行过程的日志。所以**以前那种需要通过对显示屏拍照或者暂停系统来调试程序的日子已经一去不复返啦**
systemd 的日志文件都被放在 /var/log 目录。如果你想使用它的日志功能,需要执行一些命令,因为 Debian 没有打开日志功能。命令如下:
@ -86,7 +86,7 @@ systemd 可以让你能更有效地分析和优化你的系统启动过程:
![](https://farm6.staticflickr.com/5565/14423020978_14b21402c8_z.jpg)
systemd 虽然是个年轻的项目,但存在大量文档。首先要介绍的是[Lennart Poettering 的 0pointer 系列][3]。这个系列非常详细,非常有技术含量。另外一个是[免费桌面信息文档][4],它包含了最详细的关于 systemd 的链接发行版特性文件、bug 跟踪系统和说明文档。你可以使用下面的命令来查询 systemd 都提供了哪些文档:
systemd 虽然是个年轻的项目,但已有大量文档。首先要介绍给你的是[Lennart Poettering 的 0pointer 系列][3]。这个系列非常详细,非常有技术含量。另外一个是[免费桌面信息文档][4],它包含了最详细的关于 systemd 的链接发行版特性文件、bug 跟踪系统和说明文档。你可以使用下面的命令来查询 systemd 都提供了哪些文档:
# man systemd.index
@ -96,7 +96,7 @@ systemd 虽然是个年轻的项目,但存在大量文档。首先要介绍的
via: http://xmodulo.com/2014/07/use-systemd-system-administration-debian.html
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
译者:[bazz2](https://github.com/bazz2) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -3,37 +3,37 @@
<center><img src="http://www.linux.com/images/stories/41373/fig-1-annabelle.jpg" /></center>
<center><small>图 1侏儒山羊 Annabelle</small></center>
[Krita][1] 是一款很棒的绘图应用,同时也是很不错的照片编辑器。今天我们将学习如何给图片添加文字,以及如何有选择锐化照片的某一部分。
[Krita][1] 是一款很棒的绘图应用,同时也是很不错的照片编辑器。今天我们将学习如何给图片添加文字,以及如何有选择锐化照片的某一部分。
### Krita 简介 ###
与其他绘图/制图应用类似Krita 内置了数百种工具和选项,以及多种处理手段。因此让我们来花点时间了解一下。
与其他绘图/制图应用类似Krita 内置了数百种工具和选项,以及多种处理方法。因此它值得我们花点时间来了解一下。
Krita 默认使用了暗色主题。我不太喜欢暗色主题,但幸运的是 Krita 还有其他很赞的主题,你可以在任何时候通过菜单里的“设置 > 主题”进行更改。
Krita 使用了窗口停靠样式的工具条。如果左右两侧面板的 Dock 工具条没有显示,检查一下“设置 > 显示工具条”选项,你也可以在“设置 > 工具条”中对工具条按你的偏好进行调整。不过隐藏的工具条也许会让你感到一些小小的不快,它们只会在一个狭小的压扁区域展开,你看不见其中的任何东西。你可以拖动他们至顶端或者 Krita 窗口的一侧,扩展或者收缩它们,甚至你可以把他们拖到 Krita 外,拖到你显示屏的任意位置。如果你把其中一个工具条拖到了另一个工具条上,它们会自动合并成一个工具条。
Krita 使用了窗口停靠样式的工具条。如果左右两侧面板的 Dock 工具条没有显示,检查一下“设置 > 显示工具条”选项,你也可以在“设置 > 工具条”中对工具条按你的偏好进行调整。不过隐藏的工具条也许会让你感到一些小小的不快,它们只会在一个狭小的压扁区域展开,你看不见其中的任何东西。你可以拖动它们至顶端或者 Krita 窗口的一侧,放大或者缩小它们,甚至你可以把它们拖到 Krita 外,放在你显示屏的任意位置。如果你把其中一个工具条拖到了另一个工具条上,它们会自动合并成一个工具条。
当你配置好比较满意的工作区后,你可以在“选择工作区”内保存它。你可以在笔刷工具条(通过“设置 > 显示工具条”开启显示)的右侧找到“选择工作区”。其中有对工作区的不同配置,当然你也可以创建自己的配置(图 2
<center><img src="http://www.linux.com/images/stories/41373/fig-2-workspaces.jpg" /></center>
<center><small>图 2在“选择工作区”里保存用户定制的工作区。</small></center>
Krita 中有多重缩放控制手段。Ctrl + “=” 放大Ctrl + “-” 缩小Ctrl + “0” 重置为 100% 缩放画面。你也可以通过“视图 > 缩放”,或者右下角的缩放条进行控制。在缩放条的左侧还有一个下拉式的缩放菜单。
工具菜单位于窗口左部,其中包含了锐化和选择工具。你最好移动你的鼠标到每个工具上,查看一下标签。工具选项条总是显示当前正在使用的工具的选项,默认情况下工具选项条位于窗口右部。
Krita 中有多重缩放控制方法。Ctrl + “=” 放大Ctrl + “-” 缩小Ctrl + “0” 重置为 100% 缩放画面。你也可以通过“视图 > 缩放”,或者右下角的缩放条进行控制。在缩放条的左侧还有一个下拉式的缩放菜单。
工具菜单位于窗口左部,其中包含了锐化和选择工具。你必须移动光标到每个工具上,才能查看它的标签。工具选项条总是显示当前正在使用的工具的选项,默认情况下工具选项条位于窗口右部。
### 裁切工具 ###
当然,在工具菜单条中有裁切工具,并且非常易于使用。用矩形选取把你所要选择的区域圈定,使用拖拽的方式来调整选区,调整完毕后点击返回按钮。在工具选项条中,你可以选择对所有图层应用裁切,还是只对当前图层应用裁切,通过输入具体数值,或者是百分比调整尺寸。
当然,在工具菜单条中有裁切工具,并且非常易于使用。把你想要选择的区域用矩形圈定,使用拖拽的方式来调整选区,调整完毕后点击返回按钮。在工具选项条中,你可以选择对所有图层应用裁切,还是只对当前图层应用裁切,通过输入具体数值,或者是百分比调整尺寸。
### 添加文本 ###
当你想在照片上添加标签或者说明这类简单文本的时候Krita 也许会让你感到不知所措,因为它有太多的艺术字效果可供选择了。但 Krita 同时也支持添加简单的文字。点击文本工具条,你将会看到工具选项条如图 3 那样。
当你想在照片上添加标签或者说明这类简单文本的时候Krita 也许会让你眼花缭乱,因为它有太多的艺术字效果可供选择了。但 Krita 同时也支持添加简单的文字。点击文本工具条,你将会看到工具选项条如图 3 那样。
<center><img src="http://www.linux.com/images/stories/41373/fig-3-text.jpg" /></center>
<center><small>图 3文本选项。</small></center>
点击展开按钮。这将显示简单文本工具;首先绘制矩形文本框,接着在文本框内输入文字。工具选项条中有所有常用的文本格式选项:文本选择、文本尺寸、文字与背景颜色、边距,以及一系列图形风格。但你处理完文本后点击外观处理工具,外观处理工具的按钮是一个白色的箭头,在文本工具按钮旁边,通过外观处理工具你可以调整文字整体的尺寸、外观还有位置。外观处理工具的工具选项包括多种不同的线条、颜色还有边距。图 4 为我向蜗居在城市里的亲戚发送的带有愉快标题的照片。
点击展开按钮。这将显示简单文本工具;首先绘制矩形文本框,接着在文本框内输入文字。工具选项条中有所有常用的文本格式选项:文本选择、文本尺寸、文字与背景颜色、边距,以及一系列图形风格。但你处理完文本后点击外观处理工具,外观处理工具的按钮是一个白色的箭头,在文本工具按钮旁边,通过外观处理工具你可以调整文字整体的尺寸、外观还有位置。外观处理工具的工具选项包括多种不同的线条、颜色还有边距。图 4 是我为我那些蜗居在城市里的亲戚们发送的一幅带有愉快标题的照片。
<center><img src="http://www.linux.com/images/stories/41373/fig-4-frontdoor.jpg" /></center>
<center><small>图 4来这绿色农场吧。</small></center>
@ -57,7 +57,7 @@ Krita 中有多重缩放控制手段。Ctrl + “=” 放大Ctrl + “-”
接着,你要问,“虚化蒙板”是什么意思?这个名字来源于锐化技术:虚化蒙板滤镜在原始图像上覆盖一层模糊的蒙板,接着在上面分层进行虚化蒙板。这将使图像比直接锐化产生更加锐利清晰的效果。
今天要说的就这么多。有关 Krita 的很多,但很杂。你可以从 [Krita Tutorials][2] 开始学习,也可以在网上找寻相关的学习视频。
今天要说的就这么多。有关 Krita 的资料很多,但比较杂乱。你可以从 [Krita Tutorials][2] 开始学习,也可以在 YouTube 上找寻相关的学习视频。
- [krita 官方网站][1]
@ -67,10 +67,10 @@ via: http://www.linux.com/learn/tutorials/786040-photo-editing-on-linux-with-kri
作者:[Carla Schroder][a]
译者:[SteveArcher](https://github.com/SteveArcher)
校对:[校对者ID](https://github.com/校对者ID)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.linux.com/community/forums/person/3734
[1]:https://krita.org/
[2]:https://krita.org/learn/tutorials/
[2]:https://krita.org/learn/tutorials/

View File

@ -1,10 +1,10 @@
Ubuntu 14.04和拥有Texmaker的Linux Mint 17(基于ubuntu和debian的Linux发行版)中使用LaTeX
Ubuntu 14.04 和 Linux Mint 17 中通过 Texmaker 来使用LaTeX
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/texmaker_Ubuntu.jpeg)
[LaTeX][1]是一种文本标记语言,也可以说是一种文档制作系统。经常在很多大学或者机构中作为一种标准来书写专业的科学文献,毕业论文或其他类似的文档。在这篇文章中我们会看到如何在Ubuntu 14.04中使用LaTeX。
[LaTeX][1]是一种文本标记语言,也可以说是一种文档编撰系统。在很多大学或者机构中普遍作为一种标准来书写专业的科学文献、毕业论文或其他类似的文档。在这篇文章中我们会看到如何在Ubuntu 14.04中使用LaTeX。
### 在Ubuntu 14.04或Linux Mint 17中安装Texmaker
### 在 Ubuntu 14.04 Linux Mint 17 中安装 Texmaker 来使用LaTeX
[Texmaker][2]是一款免费开源的LaTeX编辑器它支持一些主流的桌面操作系统比如WindowLinux和OS X。下面是Texmaker的主要特点
@ -24,11 +24,11 @@
- [下载Texmaker编辑器][3]
你通过链接下载到的是一个.deb包因此你在一些像Linux MintElementary OSPinguy OS等等类Debain的发行版中可以使用相同的安装方式。
你通过上述链接下载到的是一个.deb包因此你在一些像Linux MintElementary OSPinguy OS等等类Debain的发行版中可以使用相同的安装方式。
如果你想使用像Github类型的markdown编辑器你可以试试[Remarkable编辑器][4]。
如果你想使用像Github的markdown编辑器你可以试试[Remarkable编辑器][4]。
希望Texmaker能够在Ubuntu和Linux Mint中帮到你
希望Texmaker能够在Ubuntu和Linux Mint中帮到你
--------------------------------------------------------------------------------
@ -36,7 +36,7 @@ via: http://itsfoss.com/install-latex-ubuntu-1404/
作者:[Abhishek][a]
译者:[john](https://github.com/johnhoow)
校对:[校对者ID](https://github.com/校对者ID)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
@ -44,4 +44,4 @@ via: http://itsfoss.com/install-latex-ubuntu-1404/
[1]:http://www.latex-project.org/
[2]:http://www.xm1math.net/texmaker/index.html
[3]:http://www.xm1math.net/texmaker/download.html#linux
[4]:http://itsfoss.com/remarkable-markdown-editor-linux/
[4]:http://itsfoss.com/remarkable-markdown-editor-linux/

View File

@ -1,8 +1,8 @@
Linux有问必答——如何扩展XFS文件系统
Linux有问必答如何扩展XFS文件系统
================================================================================
> **问题**我的磁盘上有额外的空间所以我想要扩展其上创建的现存的XFS文件系统以完全使用额外空间。怎样才是扩展XFS文件系统的正确途径
XFS是一个开源的GPL子文件系统,最初由硅谷图形开发,现在被大多数的Linux发行版都支持。事实上XFS已被最新的CentOS/RHEL 7采用成为其默认的文件系统。在其众多的特性中包含了“在线调整大小”这一特性使得现存的XFS文件系统在被挂载时可以进行扩展。然而对于XFS文件系统的缩减确实不被支持的
XFS是一个开源的GPL志文件系统最初由硅谷图形SGI开发现在大多数的Linux发行版都支持。事实上XFS已被最新的CentOS/RHEL 7采用成为其默认的文件系统。在其众多的特性中包含了“在线调整大小”这一特性使得现存的XFS文件系统在已经挂载的情况下可以进行扩展。然而对于XFS文件系统的**缩减**却还没有支持
要扩展一个现存的XFS文件系统你可以使用命令行工具xfs_growfs这在大多数Linux发行版上都默认可用。由于XFS支持在线调整大小目标文件系统可以挂在也可以不挂载。
@ -24,7 +24,7 @@ XFS是一个开源的GPL日子文件系统最初由硅谷图形开发
![](https://farm6.staticflickr.com/5569/14914950529_ddfb71c8dd_z.jpg)
注意当你扩展一个现存的XFS文件系统时必须准备事先添加用于XFS文件系统扩展的空间。这虽然是十分明了的事但是如果在潜在的分区或磁盘卷上没有空闲空间可用的话xfs_growfs不会做任何事情。同时如果你尝试扩展XFS文件系统大小到超过磁盘分区或卷的大小xfs_growfs将会失败。
注意当你扩展一个现存的XFS文件系统时必须准备事先添加用于XFS文件系统扩展的空间。这虽然是很显然的事但是如果在所在的分区或磁盘卷上没有空闲空间可用的话xfs_growfs就没有办法了。同时如果你尝试扩展XFS文件系统大小到超过磁盘分区或卷的大小xfs_growfs将会失败。
![](https://farm4.staticflickr.com/3870/15101281542_98a49a7c3a_z.jpg)
@ -33,6 +33,6 @@ XFS是一个开源的GPL日子文件系统最初由硅谷图形开发
via: http://ask.xmodulo.com/expand-xfs-file-system.html
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,4 +1,4 @@
在Ubuntu 14.04中重置Unity和Compiz设置【小贴士】
小技巧:在Ubuntu 14.04中重置Unity和Compiz设置
================================================================================
如果你一直在试验你的Ubuntu系统你可能最终以Unity和Compiz的一片混乱收场。在此贴士中我们将看看怎样来重置Ubuntu 14.04中的Unity和Compiz。事实上全部要做的事仅仅是运行几个命令而已。
@ -34,7 +34,7 @@ via: http://itsfoss.com/reset-unity-compiz-settings-ubuntu-1404/
作者:[Abhishek][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,10 +1,10 @@
如何使用系统定时器
如何使用 systemd 中的定时器
================================================================================
我最近在写一些运行备份的脚本,我决定使用[systemd timers][1]而不是对我而已更熟悉的[cron jobs][2]来管理它们。
我最近在写一些执行备份工作的脚本,我决定使用[systemd timers][1]而不是对我而已更熟悉的[cron jobs][2]来管理它们。
在我使用时,出现了很多问题需要我去各个地方找资料,这个过程非常麻烦。因此,我想要把我目前所做的记录下来,方便自己的记忆,也方便读者不必像我这样,满世界的找资料了。
在我下面提到的步骤中有其他的选择,但是这边是最简单的方法。在此之前,查看**systemd.service**, **systemd.timer**,和**systemd.target**的帮助页面(man),学习你能用它们做些什么。
在我下面提到的步骤中有其他的选择,但是这里是最简单的方法。在此之前,请查看**systemd.service**, **systemd.timer**,和**systemd.target**的帮助页面(man),学习你能用它们做些什么。
### 运行一个简单的脚本 ###
@ -35,9 +35,9 @@ myscript.timer
Description=Runs myscript every hour
[Timer]
# Time to wait after booting before we run first time
# 首次运行要在启动后10分钟后
OnBootSec=10min
# Time between running each consecutive time
# 每次运行间隔时间
OnUnitActiveSec=1h
Unit=myscript.service
@ -48,14 +48,14 @@ myscript.timer
授权并运行的是timer文件而不是service文件。
# Start timer, as root
# 以 root 身份启动定时器
systemctl start myscript.timer
# Enable timer to start at boot
# 在系统引导起来后就启用该定时器
systemctl enable myscript.timer
### 在同一个Timer上运行多个脚本 ###
现在我们假设你在相同时间想要运行多个脚本。这种情况,你需要在上面的文件中做适当的修改。
现在我们假设你在相同时间想要运行多个脚本。这种情况,**你需要在上面的文件中做适当的修改**
#### Service 文件 ####
@ -64,9 +64,9 @@ myscript.timer
[Install]
WantedBy=mytimer.target
如果在你的service 文件中有一些规则,确保你使用**Description**字段中的值具体化**After=something.service**和**Before=whatever.service**中的参数。
如果在你的service 文件中有一些依赖顺序,确保你使用**Description**字段中的值具体指定**After=something.service**和**Before=whatever.service**中的参数。
另外的一种选择是(或许更加简单),创建一个包装者脚本来使用正确的规则运行合理的命令并在你的service文件中使用这个脚本。
另外的一种选择是(或许更加简单),创建一个包装脚本来使用正确的顺序来运行命令并在你的service文件中使用这个脚本。
#### Timer 文件 ####
@ -97,11 +97,11 @@ Good luck.
--------------------------------------------------------------------------------
via: http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#enable--start-1
via: http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/
作者Jason Graham
译者:[译者ID](https://github.com/johnhoow)
校对:[校对者ID](https://github.com/校对者ID)
译者:[johnhoow](https://github.com/johnhoow)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,3 +1,4 @@
Translating by instdio
How To Use Steam Music Player on Ubuntu Desktop
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/steam-music.jpg)
@ -76,4 +77,4 @@ via: http://www.omgubuntu.co.uk/2014/10/use-steam-music-player-linux
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[a]:https://plus.google.com/117485690627814051450/?rel=author

View File

@ -1,56 +0,0 @@
Linux Calendar App California 0.2 Released
================================================================================
**Following on from [last months update to Geary and Shotwell][1] the non-profit software outfit Yorba is back, this time with a new release of their [California][2] calendaring application.**
A capable desktop calendar is a must-have for the well-organised (and wannabe well-organised!). The release of the [hugely popular Sunrise app to the Chrome Web Store][3] means choices arent as scant as they once were. California bolsters this.
“A lot has happened since [then],“ Yorbas Jim Nelson writes on the Yorba Blog, adding that hes “…happy to say that we got more features into this first release than I thought wed make.”
![California 0.2 Looks Great on GNOME](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/california-point-2.jpg)
California 0.2 Looks Great on GNOME
The standout addition is the natural language parser. This makes adding events easier. Instead of needing to manually fill in each bit of information (date, time, etc.), you can just type in “**Meet Sam for Nachos on Monday at 2PM**” and California will schedule it for the upcoming Monday at 2PM.
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/05/Screen-Shot-2014-05-15-at-21.26.20.png)
The feature works just as well as it did when we reviewed a development release in May, and even fixes our one want from it: recurring events.
To create a recurring event (e.g., “Google own name every Thursday”) you need to include the word “every” before the date. To make sure that a location is picked up (e.g., “Coffee with Samba De Amigo on Wednesday, 12 PM at Boston Tea Party“) the term “at” or “@” is required.
For detailed information on how to use it see the [Quick Add page on the GNOME Wiki][4].
Other changes include:
- View events by Month and Week
- Add/Remove Google, CalDAV, and web cal (.ics) calendars
- Evolution Data Server integration
- Add/edit/remove remote events (including recurring events)
- Natural-language scheduling
- F1 shortcut for online help
- New animations and popovers
### Install California 0.2 on Ubuntu 14.10 ###
Being a GNOME 3 application, the application does, arguably, look and feel better under it.
Yorba arent ignoring Ubuntu users, however. Theyve diligently (one could say patiently) worked around theming issues resulting from Ubuntus need to ship a mish-mash of the GTK+ and GNOME stack. The result is an app that may look a little out of place on Ubuntu but works great all the same.
California 0.2 is available to [install from the Yorba Stable Software PPA][5] on Ubuntu 14.10 only.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/10/california-calendar-natural-language-parser
作者:[Joey-Elijah Sneddon][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2014/09/new-shotwell-geary-stable-release-available-to-downed
[2]:https://wiki.gnome.org/Apps/California
[3]:http://www.omgchrome.com/sunrise-calendar-app-for-google-chrome/
[4]:https://wiki.gnome.org/Apps/California/HowToUseQuickAdd
[5]:https://launchpad.net/~yorba/+archive/ubuntu/ppa?field.series_filter=utopic

View File

@ -1,54 +0,0 @@
Linux Kernel 3.17 Is Out With Plenty of New Features
================================================================================
Linus Torvalds has announced the latest stable release of the Linux kernel, version 3.17.
![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg)
Announced in his typical [laissez-faire style][1] in a post on the Linux Kernel Mailing List Torvalds explained:
> “So the past week was fairly calm, and so I have no qualms about releasing 3.17 on the normal schedule (as opposed to the optimistic “maybe I can release it one week early” schedule that was not to be).”
Due to travel Linus says he wont start merging changes for Linux 3.18 just yet:
> “I now have travel coming up something I hoped to avoid when I was hoping for releasing early. Which means that while 3.17 is out, Im not going to be merging stuff very actively next week, and the week after that is LinuxCon EU…”
### Whats New In Linux 3.17? ###
As with every new release, Linux 3.17 sees the kernel loaded up on the latest improvements, hardware support, fixes and so on. These range from the bamboozling e.g., [memfd and file sealing patches][2] to the sort of things most of us appreciate, such as support for new hardware.
Below is a short list compiling some notable highlights of this release. Its by no means exhaustive.
- Microsoft Xbox One controller support (without vibration)
- Additional improvements to Sony SIXAXIS support
- Toshiba “Active Protection Sensor” support
- New ARM support includes Rockchip RK3288 and AllWinner A23 SoCs
- “Cross-thread filter setting” for secure computing facility
- Broadcom BCM7XXX-based board support (used in various set-top boxes)
- Enhanced AMD Radeon R9 290 support
- Misc. Nouveau driver improvements, including Kepler GPU fixes
- Audio support includes Wildcatpoint Audio DSP on Intel Broadwell Ultrabooks.
### Installing Linux 3.17 on Ubuntu ###
Although classed as stable there is, at present, little need for most of us to “have it now”.
But if youre impatient and — **more importantly** — skilled enough to handle issues resulting from it, you can install Linux 3.17 in Ubuntu 14.10 by installing the appropriate set of packages for your system from the mainline kernel archive maintained by Canonical.
**Do not attempt to install anything from this link unless you know what youre doing.**
- [Visit the Ubuntu Kernel Mainline Archive][3]
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/10/linux-kernel-3-17-whats-new-improved
作者:[Joey-Elijah Sneddon][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://lkml.iu.edu/hypermail/linux/kernel/1410.0/02818.html
[2]:http://lwn.net/Articles/607627/
[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

1
sources/share/README.md Normal file
View File

@ -0,0 +1 @@
这里放分享类文章,包括各种软件的简单介绍、有用的书籍和网站等。

View File

@ -1,66 +0,0 @@
barney-ro translating
What is a good subtitle editor on Linux
================================================================================
If you watch foreign movies regularly, chances are you prefer having subtitles rather than the dub. Grown up in France, I know that most Disney movies during my childhood sounded weird because of the French dub. If now I have the chance to be able to watch them in their original version, I know that for a lot of people subtitles are still required. And I surprise myself sometimes making subtitles for my family. Hopefully for me, Linux is not devoid of fancy and open source subtitle editors. In short, this is the non-exhaustive list of open source subtitle editors for Linux. Share your opinion on what you think of the best subtitle editor.
### 1. Gnome Subtitles ###
![](https://farm6.staticflickr.com/5596/15323769611_59bc5fb4b7_z.jpg)
[Gnome Subtitles][2] is a bit my go to when it comes to quickly editing some existing subtitles. You can load the video, load the subtitle text files and instantly get going. I appreciate its balance between ease of use and advanced features. It comes with a synchronization tool as well as a spell check. Finally, last but not least, the shortcuts are what makes it good in the end: when you edit a lot of lines, you prefer to keep your hands on the keyboard, and use the built in shortcuts to move around.
### 2. Aegisub ###
![](https://farm3.staticflickr.com/2944/15323964121_59e9b26ba5_z.jpg)
[Aegisub][2] is already one level of complexity higher. Just the interface reflects a learning curve. But besides its intimidating aspect, Aegisub is very complete software, providing tools beyond anything I could have imagined before. Like Gnome Subtitles, Aegisub has a WYSIWYG approach, but to a whole new level: it is possible to drag and drop the subtitles on the screen, see the audio spectrum on the side, and do everything with shortcuts. In addition to that, it comes with a Kanji tool, a karaoke mode, and the possibility to import lua script to automate some tasks. I really invite you to go read the [manual page][3] before starting using it.
### 3. Gaupol ###
![](https://farm3.staticflickr.com/2942/15326817292_6702cc63fc_z.jpg)
At the other end of the complexity spectrum is [Gaupol][4]. Unlike Aegisub, Gaupol is quick to pick up and adopts an interface very close to Gnome Subtitles. But behind this relative simplicity, it comes with all the necessary tools: shortcuts, third party extension, spell checking, and even speech recognition (courtesy of [CMU Sphinx][5]). As a downside, however, I did notice some slow-downs while testing it, nothing too serious, but just enough to make me prefer Gnome Subtitles still.
### 4. Subtitle Editor ###
![](https://farm4.staticflickr.com/3914/15323911521_8e33126610_z.jpg)
[Subtitle Editor][6] is very close to Gaupol. However, the interface is a little bit less intuitive, and the features are slightly more advanced. I appreciate the possibility to define "key frames" and all the given synchronization options. However, maybe more icons and less text would enhance the interface. As a goodie, Subtitle Editor can simulate a "type writer" effect, while I am not sure if it is extremely useful. And last but not least, the possibility to redefine the shortcuts is always handy.
### 5. Jubler ###
![](https://farm4.staticflickr.com/3912/15323769701_3d94ca8884_z.jpg)
Written in Java, [Jubler][7] is a multi-platform subtitle editor. I was actually very impressed by its interface. I definitely see the Java-ish aspect of it, but it remains well conceived and clear. Like Aegisub, you can drag and drop the subtitles on the image, making the experience far more pleasant than just typing. It is also possible to define a style for subtitles, play sound from another track, translate the subtitles, or use the spell checker. However, be careful as you will need MPlayer installed and correctly configured beforehand if you want to use Jubler fully. Oh and I give it a special credit for its easy installation process after downloading the script from the [official page][8].
### 6. Subtitle Composer ###
![](https://farm6.staticflickr.com/5578/15323769711_6c6dfbe405_z.jpg)
Defined as a "KDE subtitle composer," [Subtitle Composer][9] comes with most of the traditional features evoked previously, but with the KDE interface that we expect. This comes naturally with the option to redefine the shortcuts, which is very dear to me. But beyond all of this, what differentiates Subtitle Composer from all the previously mentioned programs is its ability to follow scripts written in JavaScript, Python, and even Ruby. A few examples are packaged with the software, and will definitely help you pick up the syntax and the usefulness of such feature.
To conclude, whether you, like me, just edit a few subtitles for your family, re-synchronize the entire track, or write everything from scratch, Linux has the tools for you. For me in the end, the shortcuts and the ease-of-use make all the difference, but for any higher usage, scripting or speech recognition can become super handy.
Which subtitle editor do you use and why? Or is there another one that you prefer not mentioned here? Let us know in the comments.
--------------------------------------------------------------------------------
via: http://xmodulo.com/good-subtitle-editor-linux.html
作者:[Adrien Brochard][a]
译者:[barney-ro](https://github.com/barney-ro)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:http://gnomesubtitles.org/
[2]:http://www.aegisub.org/
[3]:http://docs.aegisub.org/3.2/Main_Page/
[4]:http://home.gna.org/gaupol/
[5]:http://cmusphinx.sourceforge.net/
[6]:http://home.gna.org/subtitleeditor/
[7]:http://www.jubler.org/
[8]:http://www.jubler.org/download.html
[9]:http://sourceforge.net/projects/subcomposer/

View File

@ -1,3 +1,4 @@
惊现译者CHINAANSHE 翻译!!
How to configure HTTP load balancer with HAProxy on Linux
================================================================================
Increased demand on web based applications and services are putting more and more weight on the shoulders of IT administrators. When faced with unexpected traffic spikes, organic traffic growth, or internal challenges such as hardware failures and urgent maintenance, your web application must remain available, no matter what. Even modern devops and continuous delivery practices can threaten the reliability and consistent performance of your web service.
@ -270,4 +271,4 @@ via: http://xmodulo.com/haproxy-http-load-balancer-linux.html
[a]:http://xmodulo.com/author/jaroslav
[1]:http://www.haproxy.org/
[2]:http://www.haproxy.org/10g.html
[3]:http://xmodulo.com/how-to-install-lamp-server-on-ubuntu.html
[3]:http://xmodulo.com/how-to-install-lamp-server-on-ubuntu.html

View File

@ -1,172 +0,0 @@
SPccman Translating
How to debug a C/C++ program with GDB command-line debugger
================================================================================
What is the worst part of coding without a debugger? Compiling on your knees praying that nothing will crash? Running the executable with a blood offering? Or just having to write printf("test") at every line hoping to find where the problem is coming from? As you probably know, there are not many advantages to coding without a debugger. But the good side is that debugging on Linux is easy. While most people use the debugger included in their favorite IDE, Linux is famous for its powerful command line C/C++ debugger: GDB. However, like most command line utilities, GDB requires a bit of training to master fully. In this tutorial, I will give you a quick rundown of GDB debugger.
### Installation of GDB ###
GDB is available in most distributions' repositories.
For Debian or Ubuntu:
$ sudo apt-get install gdb
For Arch Linux:
$ sudo pacman -S gdb
For Fedora, CentOS or RHEL:
$ sudo yum install gdb
If you cannot find it anywhere else, it is always possible to download it from the [official page][1].
### Code Sample ###
When you are learning GDB, it is always better to have a piece of code to try things. Here is a quick sample that I coded to show the best features of GDB. Feel free to copy paste it to try the examples. That's the best way to learn.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int i;
int a=0, b=0, c=0;
double d;
for (i=0; i<100; i++)
{
a++;
if (i>97)
d = i / 2.0;
b++;
}
return 0;
}
### Usage of GDB ###
First and foremost, you will need to compile your program with the flag "-g" (for debug) to run it via GDB. From there the syntax to start debugging is:
$ gdb -tui [executable's name]
The "-tui” option will show your code in a nice interactive terminal window (so-called "text user interface") that you can navigate in with the arrow keys, while typing in the GDB shell below.
![](https://farm3.staticflickr.com/2947/15397534362_ac0b5692c8_z.jpg)
We can now start playing around placing breakpoints anywhere in the source code with debugger. Here you have the options to set a breakpoint at a line number of the current source file:
break [line number]
or at a line number of a specific source file:
break [file name]:[line number]
or at a particular function:
break [function name]
And even better, you can set conditional breakpoints:
break [line number] if [condition]
For example, in our code sample, I can set:
break 11 if i > 97
![](https://farm3.staticflickr.com/2948/15374839066_8c7c0eb8a4_o.png)
which will have an effect of stopping me at "a++;" after 97 iterations of the for loop. As you have guessed, this is very handy when you do not want to step through the loop 97 times on your own.
Last but not least, you can place a "watchpoint" which will pause the program if a variable is modified:
watch [variable]
Here, I can set one like:
watch d
which will stop the program as soon as variable d is set to a new value (i.e. when i > 97 is true).
Once our breakpoints are set, we can run the program with the "run" command, or simply:
r [command line arguments if your program takes some]
as most words can be abbreviated in just a letter with gdb.
And without surprises, we are stopped at line 11. From there, we can do interesting things. The command:
bt
for backtrack will tell us how we got to that point.
![](https://farm3.staticflickr.com/2943/15211202760_1e77a3bb2e_z.jpg)
info locals
will display all the local variables and their current values (as you can see I didn't set my d variable to anything so its value is currently garbage).
![](https://farm4.staticflickr.com/3843/15374838916_8b65e4e3c7_z.jpg)
Of course:
p [variable]
will show the value of a particular variable. But even better:
ptype [variable]
shows the type of a local variable. So here we can confirm that d is double type.
![](https://farm4.staticflickr.com/3881/15397534242_3cb6163252_o.jpg)
And since we are playing with fire, might as well do it all the way:
set var [variable] = [new value]
will override the value of the variable. Be careful though as you can't create a new variable or change its type. But here we can do:
set var a = 0
![](https://farm3.staticflickr.com/2949/15211357497_d28963a9eb_o.png)
And just like any good debugger, we can "step" with:
step
to run the next line and potentially step into a function. Or just:
next
to just go straight to the line below, ignoring any function call.
![](https://farm4.staticflickr.com/3927/15397863215_fb2f5912ac_o.jpg)
And to finish testing, you can delete a breakpoint with:
delete [line number]
Keep running the program from the current breakpoint with:
continue
and exit GDB with:
quit
To conclude, with GDB, no more praying to compile, no more blood offerings to run, no more printf("test"). Of course this post is not exhaustive and GDB's capabilities run beyond this, so I really encourage you to learn more about it on your own (or in a future post maybe?). What I am the most interested now is to integrate GDB nicely in Vim. In the meantime, here is a very [big memo][2] of all the GDB commands for future reference.
What do you think of GDB? Would you consider its advantages over a graphical debugger or an IDE's? And what about integrating into Vim? Let us know in the comments.
--------------------------------------------------------------------------------
via: http://xmodulo.com/gdb-command-line-debugger.html
作者:[Adrien Brochard][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:https://www.gnu.org/software/gdb/
[2]:http://users.ece.utexas.edu/~adnan/gdb-refcard.pdf

View File

@ -1,119 +0,0 @@
su-kaiyao translating
How to speed up slow apt-get install on Debian or Ubuntu
================================================================================
If you feel that package installation by **apt-get** or **aptitude** is often too slow on your Debian or Ubuntu system, there are several ways to improve the situation. Have you considered switching default mirror sites being used? Have you checked the upstream bandwidth of your Internet connection to see if that is the bottleneck?
Nothing else, you can try this third option: use [apt-fast][1] tool. apt-fast is actually a shell script wrapper written around apt-get and aptitude, which can accelerate package download speed. Internally, apt-fast uses [aria2][2] download utility which can download a file in "chunked" forms from multiple mirrors simultaneously (like in BitTorrent download).
### Install apt-fast on Debian or Ubuntu ###
Here are the steps to install apt-fast on Debian-based Linux.
#### Debian ####
$ sudo apt-get install aria2
$ wget https://github.com/ilikenwf/apt-fast/archive/master.zip
$ unzip master.zip
$ cd apt-fast-master
$ sudo cp apt-fast /usr/bin
$ sudo cp apt-fast.conf /etc
$ sudo cp ./man/apt-fast.8 /usr/share/man/man8
$ sudo gzip /usr/share/man/man8/apt-fast.8
$ sudo cp ./man/apt-fast.conf.5 /usr/share/man/man5
$ sudo gzip /usr/share/man/man5/apt-fast.conf.5
#### Ubuntu 14.04 and higher ####
$ sudo add-apt-repository ppa:saiarcot895/myppa
$ sudo apt-get update
$ sudo apt-get install apt-fast
#### Ubuntu 11.04 to 13.10 ####
$ sudo add-apt-repository ppa:apt-fast/stable
$ sudo apt-get update
$ sudo apt-get install apt-fast
During installation on Ubuntu, you will be asked to choose a default package manager (e.g., apt-get, aptitude), and other settings. You can always change the settings later by editing a configuration file /etc/apt-fast.conf.
![](https://farm6.staticflickr.com/5615/15285526898_1b18f64d58_z.jpg)
![](https://farm3.staticflickr.com/2949/15449069896_76ee00851b_z.jpg)
![](https://farm6.staticflickr.com/5600/15471817412_9ef7f16096_z.jpg)
### Configure apt-fast ###
After installation, you need to configure a list of mirrors used by **apt-fast** in /etc/apt-fast.conf.
You can find a list of Debian/Ubuntu mirrors to choose from at the following URLs.
- **Debian**: [http://www.debian.org/mirror/list][3]
- **Ubuntu**: [https://launchpad.net/ubuntu/+archivemirrors][4]
After choosing mirrors which are geographically close to your location, add those chosen mirrors to /etc/apt-fast.conf in the following format.
$ sudo vi /etc/apt-fast.conf
Debian:
MIRRORS=('http://ftp.us.debian.org/debian/,http://carroll.aset.psu.edu/pub/linux/distributions/debian/,http://debian.gtisc.gatech.edu/debian/,http://debian.lcs.mit.edu/debian/,http://mirror.cc.columbia.edu/debian/')
Ubuntu/Mint:
MIRRORS=('http://us.archive.ubuntu.com/ubuntu,http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/,http://mirror.cc.vt.edu/pub2/ubuntu/,http://mirror.umd.edu/ubuntu/,http://mirrors.mit.edu/ubuntu/')
As shown above, individual mirrors for a particular archive should be separated by commas. It is recommended that you include the default mirror site specified in /etc/apt/sources.list in the MIRRORS string.
### Install a Package with apt-fast ###
Now you are ready to test the power of apt-fast. Here is the command-line usage of **apt-fast**:
apt-fast [apt-get options and arguments]
apt-fast [aptitude options and arguments]
apt-fast { { install | upgrade | dist-upgrade | build-dep | download | source } [ -y | --yes | --assume-yes | --assume-no ] ... | clean }
To install a package with **apt-fast**:
$ sudo apt-fast install texlive-full
To download a package in the current directory without installing it:
$ sudo apt-fast download texlive-full
![](http://farm8.staticflickr.com/7309/10585846956_6c98c6dcc9_z.jpg)
As mentioned earlier, parallel downloading of apt-fast is done by aria2. You can verify parallel downloads from multiple mirrors as follows.
$ sudo netstat -nap | grep aria2c
![](http://farm8.staticflickr.com/7328/10585846886_4744a0e021_z.jpg)
Note that **apt-fast** does not make "apt-get update" faster. Parallel downloading gets triggered only for "install", "upgrade", "dist-upgrade" and "build-dep" operations. For other operations, apt-fast simply falls back to the default package manager **apt-get** or **aptitude**.
### How Fast is apt-fast? ###
To compare apt-fast and apt-get, I tried installing several packages using two methods on two identical Ubuntu instances. The following graph shows total package installation time (in seconds).
![](http://farm4.staticflickr.com/3810/10585846986_504d07b4a7_z.jpg)
As you can see, **apt-fast** is substantially faster (e.g., 3--4 times faster) than **apt-get**, especially when a bulky package is installed.
Be aware that performance improvement will of course vary, depending on your upstream Internet connectivity. In my case, I had ample spare bandwidth to leverage in my upstream connection, and that's why I see dramatic improvement by using parallel download.
--------------------------------------------------------------------------------
via: http://xmodulo.com/speed-slow-apt-get-install-debian-ubuntu.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:https://github.com/ilikenwf/apt-fast
[2]:http://aria2.sourceforge.net/
[3]:http://www.debian.org/mirror/list
[4]:https://launchpad.net/ubuntu/+archivemirrors

View File

@ -1,3 +1,4 @@
[bazz222222222222222222222]
The Why and How of Ansible and Docker
================================================================================
There is a lot of interest from the tech community in both [Docker][1] and [Ansible][2], I am hoping that after reading this article you will share our enthusiasm. You will also gain a practical insight into using Ansible and Docker for setting up a complete server environment for a Rails application.
@ -100,4 +101,4 @@ via: http://thechangelog.com/ansible-docker/
[6]:http://blog.docker.io/2013/10/docker-0-6-5-links-container-naming-advanced-port-redirects-host-integration/
[7]:https://speakerdeck.com/gerhardlazu/ansible-and-docker-the-path-to-continuous-delivery-part-1
[8]:http://thechangelog.com/weekly/
[9]:https://github.com/thechangelog/draft
[9]:https://github.com/thechangelog/draft

View File

@ -1,3 +1,4 @@
[translating by KayGuoWhu]
How to set up RAID 10 for high performance and fault tolerant disk I/O on Linux
================================================================================
A RAID 10 (aka RAID 1+0 or stripe of mirrors) array provides high performance and fault-tolerant disk I/O operations by combining features of RAID 0 (where read/write operations are performed in parallel across multiple drives) and RAID 1 (where data is written identically to two or more drives).

View File

@ -0,0 +1,58 @@
Simple guide to forks in GitHub and Git
==========================================
In my experience, one of the most confusing parts about getting started in Git and GitHub is trying to figure out the following: **What do I do in Git, and what do I do in GitHub?**
Git tutorials tend not to address this question, since they are (purposefully) focused on teaching you Git commands and concepts, and do not presume you will use GitHub. [GitHub help articles](https://help.github.com/) bridge this gap somewhat, but each article is narrowly focused and ultimately doesn't provide a conceptual overview of the "Git vs GitHub" question.
**If you are the type of learner that benefits from understanding concepts before diving into code**, and you are new to Git and GitHub, I suggest that the first step is to understand forking. Why?
1. Forking is a common way to get started in GitHub.
2. Forking requires very few Git commands, but the ones it does use are very important.
3. Forking provides a foundational understanding of Git and GitHub that will benefit you later.
**This guide uses two simple diagrams to teach you the two main workflows for forks.** I'm not going to cover any code, but in the Conclusion I'll link to the code you should use.
###Forking and updating a repo
Let's say there's a programmer named Joe who built a game you would like to improve, and he is hosting his code in a GitHub repository. Here's what you do:
![Alt text](https://app.yinxiang.com/shard/s14/sh/ff60f113-2880-47b0-ba99-c296803dbe7d/700ebd0916916079da437d9e231f73d4/res/8aab524b-6ea1-4a2f-b03b-143f12b0e71b/github1.png)
*Diagram of forking and updating a GitHub repo*
1. **Fork his repo**: This is a GitHub operation, in which you are making a copy of Joe's repository (including the files, commit history, issues, and more). This repository now lives in your GitHub account. Nothing has yet happened to your local computer.
2. **Clone your repo**: This is a Git operation, in which you are using Git to tell GitHub "please send me a copy of my repo." The repo is now stored on your local computer.
3. **Update some files**: You can now make updates to the files in whatever program or environment you like.
4. **Commit your changes**: This is a Git operation, in which you are telling Git to record the file changes you have made. This is an operation on your local computer only.
5. **Push your changes to your GitHub repo**: This is a Git operation, in which you are using Git to tell GitHub "here are my changes." Pushing does not happen automatically, so until you do this step, GitHub does not know about your commits.
6. **Send a pull request to Joe**: If you think that Joe might like to incorporate your changes, you send him a pull request. This is a GitHub operation, in which you are communicating your changes to Joe, and "requesting" that he "pull" from your repo. It is up to him whether he pulls from you or not.
If Joe accepts your pull request, he will pull your changes into his repo. Victory!
###Syncing a fork
Let's say that Joe and other contributors have made some more updates to the game, and you've thought of some more updates you'd like to make. Before you do anything else, it's best to "sync your fork" so that you are working on the latest copy of the files. Here's what you do:
![Alt text](https://app.yinxiang.com/shard/s14/sh/ff60f113-2880-47b0-ba99-c296803dbe7d/700ebd0916916079da437d9e231f73d4/res/9ae7ff2b-ebda-478b-ac57-002e92ffde72/github2.png)
*Diagram of syncing a GitHub fork*
1. **Fetch changes from Joe's repo**: This is a Git operation, in which you are using Git to tell GitHub that you would like to retrieve the latest files from Joe's repo.
2. **Merge those changes into your repo**: This is a Git operation, in which you are updating the repo on your local computer with those changes (which have been temporarily stored in a "branch"). Note: Steps 1 and 2 are often combined into a single Git operation called a "pull."
3. **Push the updates to your GitHub repo** (optional): Remember that your local computer does not automatically update your GitHub repo. Therefore, the only way to get your GitHub repo up-to-date is by pushing up the latest changes. You can either do this right away, or you can wait until you have made some updates of your own and committed them locally.
**Take note of the contrast between the workflow for forking and the workflow for syncing**: When you initially fork a repo, the flow of information is from Joe's repo to your repo, and then down to your local computer. But after that initial process, the flow of information is from Joe's repo to your local computer, and then up to your repo.
###Conclusion
I hope this was a helpful overview of [forking](https://help.github.com/articles/fork-a-repo) in GitHub and Git. Now that you understand the concepts, you should be much better prepared to actually execute the code! The GitHub articles on forking and [syncing](https://help.github.com/articles/syncing-a-fork) will give you most of the code you need.
If you are new to Git and this style of learning appeals to you, I highly recommend the first two chapters of the book [Pro Git](http://git-scm.com/book), which is available online for free.
If you enjoy learning via videos, I created a [11-part video series](http://www.dataschool.io/git-and-github-videos-for-beginners/) (36 minutes total) introducing Git and GitHub to beginners.

View File

@ -0,0 +1,57 @@
Linux日历程序California 0.2 发布了
================================================================================
**随着[上月的Geary和Shotwell的更新][1]非盈利软件套装Yobra又回来了这次带来的是新的[California][2]日历程序的发布。**
一个合格的桌面日历是工作井井有条(和想要井井有条)的必备工具。[广受欢迎Chrome Web Store上的Sunrise应用][3]的发布意味着选择并不像以前那么少了。California又为这个撑腰了。
Yorba的Jim Nelson在Yorba博客上写道“发生了很多变化“接着写道“初次发布比我想的加入了更多的特性。”
![California 0.2 Looks Great on GNOME](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/california-point-2.jpg)
California 0.2在GNOME上看上去棒极了。
最突出的是添加了“自然语言”解析器。这使得添加事件更容易。相反,你可以直接输入“**在下午2点就Nachos会见Sam”接着California就会自动把它安排下接下来的星期一的下午两点而不必你手动输入位的信息日期时间等等
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/05/Screen-Shot-2014-05-15-at-21.26.20.png)
当我们在5月份回顾开发版本时这个特性也能工作了甚至修复了一个问题重复事件。
要创建一个重复时间比如“每个星期四搜索自己的名字”你需要在日期前包含文字“every”每个。要确保地点也在内比如中午12点和Samba De Amigo在Boston Tea Party喝咖啡。条目中需要有“at”或者“@”。
至于详细信息,我们可以见[GNOME Wiki上的快速添加页面][4]
其他的改变包括:
- 通过‘月’和‘周’查看事件
-添加/删除 GoogleCalDAV和web.ics日历
- 改进数据服务器整合
-添加/编辑/啥是拿出远程事件(包括重复事件)
-自然语言计划
-F1在线帮助快捷键
- 新的动画和弹出窗口
### 在Ubuntu 14.10上安装 California 0.2 ###
由于是GNOME 3的程序可以说这下面程序看起来和感受上更好。
Yorba没有忽略Ubuntu用户。他们已经努力也可以说是耐心地地解决导致Ubuntu需要同时安装GTK+和GNOME的主题问题。结果就是在Ubuntu上程序可能看上去有点错位但是同样工作的很好。
California 0.2在[Yorba稳定版软件PPA][5]中可以下载且只针对Ubuntu 14.10。
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/10/california-calendar-natural-language-parser
作者:[Joey-Elijah Sneddon][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2014/09/new-shotwell-geary-stable-release-available-to-downed
[2]:https://wiki.gnome.org/Apps/California
[3]:http://www.omgchrome.com/sunrise-calendar-app-for-google-chrome/
[4]:https://wiki.gnome.org/Apps/California/HowToUseQuickAdd
[5]:https://launchpad.net/~yorba/+archive/ubuntu/ppa?field.series_filter=utopic

View File

@ -0,0 +1,54 @@
Linux Kernel 3.17 带来了很多新特性
================================================================================
Linus Torvalds已经发布了最新的稳定版内核3.17。
![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg)
Torvalds以他典型的[放任式][1]的口吻在Linux内核邮件列表中解释说
> “过去的一周很平静我对3.17的如期发布没有疑虑(相对于乐观的“我应该早一周发布么”的计划而言)。”
由于假期Linux说他还没有开始合并3.18的改变:
>“我马上要去旅行了- 在我期盼早点发布的时候我希望避免一些事情。这意味着在3.17发布后我不会在下周非常活跃地合并新的东西并且下下周是LinuxCon EU”
### Linux 3.17有哪些新的? ###
最为一个新的发布Linux 3.17 加入了最新的改进,硬件支持,修复等等。范围从有迷惑性的 - 比如:[memfd 和 文件密封补丁][2] - 到大多数人感兴趣的,比如最新硬件的支持。
下面是这次发布的一些亮点的列表,但她们并不详尽。
- Microsoft Xbox One 控制器支持 (没有震动)
- 额外的Sony SIXAXIS支持改进
- 东芝 “Active Protection Sensor” 支持
- 新的包括Rockchip RK3288和AllWinner A23 SoC的ARM芯片支持
- 安全计算设备上的“跨线程过滤设置”
- 基于Broadcom BCM7XXX板卡的支持用在不同的机顶盒上
- 增强的AMD Radeon R9 290支持
- Nouveau 驱动改进包括Kepler GPU修复
- 包含Intel Broadwell超级本上的Wildcatpoint Audio DSP音频支持
### 在Ubuntu上安装 Linux 3.17 ###
虽然被列为稳定版,但是目前对于大多数人而言只有很少的功能需要我们“现在去安装”。
但是如果你很耐心- **更重要的是**-有足够的技能去处理从中导致的问题你可以通过在由Canonical维护的主线内核存档中安装一系列合适的包来在你的Ubuntu 14.10中安装Linux 3.17
**除非你知道你正在做什么,不要尝试从下面的链接中安装任何东西。**
- [访问Ubuntu内核主线存档][3]
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/10/linux-kernel-3-17-whats-new-improved
作者:[Joey-Elijah Sneddon][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://lkml.iu.edu/hypermail/linux/kernel/1410.0/02818.html
[2]:http://lwn.net/Articles/607627/
[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

View File

@ -0,0 +1 @@
这里放分享类文章,包括各种软件的简单介绍、有用的书籍和网站等。

View File

@ -0,0 +1,64 @@
Linux 上好用的几款字幕编辑器介绍
================================================================================
如果你经常看国外的大片你应该会喜欢带字幕版本而不是有国语配音的版本。在法国长大我的童年记忆里充满了迪斯尼电影。但是这些电影因为有了法语的配音而听起来很怪。如果现在有机会能看原始的版本我知道对于大多数的人来说字幕还是必须的。我很高兴能为家人制作字幕。最让我感到希望的是Linux 也不无花哨而且有很多开源的字幕编辑器。总之一句话这篇文章并不是一个详尽的Linux上字幕编辑器的列表。你可以告诉我那一款是你认为最好的字幕编辑器。
### 1. Gnome Subtitles ###
![](https://farm6.staticflickr.com/5596/15323769611_59bc5fb4b7_z.jpg)
[Gnome Subtitles][1] 我的一个选择,当有字幕需要快速编辑时。你可以载入视频,载入字幕文本,然后就可以即刻开始了。我很欣赏其对于易用性和高级特性之间的平衡性。它带有一个同步工具以及一个拼写检查工具。最后,虽然最后,但并不是不重要,这么好用最主要的是因为它的快捷键:当你编辑很多的台词的时候,你最好把你的手放在键盘上,使用其内置的快捷键来移动。
### 2. Aegisub ###
![](https://farm3.staticflickr.com/2944/15323964121_59e9b26ba5_z.jpg)
[Aegisub][2] 有更高级别的复杂性。接口仅仅反映了学习曲线。但是除了它吓人的样子以外Aegisub 是一个非常完整的软件提供的工具远远超出你能想象的。和Gnome Subtitles 一样Aegisub也采用了所见即所得WYSIWYG:what you see is what you get的处理方式。但是是一个全新的高度可以再屏幕上任意拖动字幕也可以在另一边查看音频的频谱并且可以利用快捷键做任何的事情。除此以外它还带有一个汉字工具有一个kalaok模式并且你可以导入lua 脚本让它自动完成一些任务。我希望你在用之前,先去阅读下它的[指南][3]。
### 3. Gaupol ###
![](https://farm3.staticflickr.com/2942/15326817292_6702cc63fc_z.jpg)
另一个操作复杂的软件是[Gaupol][4],不像Aegisub Gaupol 很容易上手而且采用了一个和Gnome Subtitles 很像的界面。但是在这些相对简单背后,它拥有很多很必要的工具:快捷键、第三方扩展、拼写检查,甚至是语音识别(由[CMU Sphinx][5]提供。这里也提一个缺点我注意到有时候在测试的时候也软件会有消极怠工的表现不是很严重但是也足以让我更有理由喜欢Gnome Subtitles了。
### 4. Subtitle Editor ###
![](https://farm4.staticflickr.com/3914/15323911521_8e33126610_z.jpg)
[Subtitle Editor][6]和Gaupol 很像。但是它的界面有点不太直观特性也只是稍微的高级一点点。我很欣赏的一点是它可以定义“关键帧”而且提供所有的同步选项。然而多一点的图标或者是少一点的文字都能提供界面的特性。作为一个好人我认为Subtitle Editor 可以模仿“作家”打字的效果,虽然我不知道它是否有用。最后但并非不重要。重定义快捷键的功能很实用。
### 5. Jubler ###
![](https://farm4.staticflickr.com/3912/15323769701_3d94ca8884_z.jpg)
用Java 写的,[Jubler][7]是一个多平台支持的字幕编辑器。我对它的界面印象特别深刻。在上面我确实看出了Java-ish 方面的东西但是它仍然是经过精心的构造和构思的。像Aegisub 一样你可以再屏幕上任意的拖动字幕让你有愉快的体验而不单单是打字。它也可以为字幕自定义一个风格在另外的一个轨道播放音频翻译字幕或者是是做拼写检查然而你必须要注意的是你必须事先安装好媒体播放器并且正确的配置如果你想完整的使用Jubler。我把这些归功于在[官方页面][8]下载了脚本以后其简便的安装方式。
### 6. Subtitle Composer ###
![](https://farm6.staticflickr.com/5578/15323769711_6c6dfbe405_z.jpg)
被视为“KDE里的字幕作曲家”[Subtitle Composer][9]能够唤起对很多传统功能的回忆。伴随着KDE界面我们很期望。很自然的我们就会说到快捷键我特别喜欢这个功能。除此之外Subtitle Composer 与上面提到的编辑器最大的不同地方就在于它可以执行用JavaScriptPython甚至是Ruby写成的脚本。软件带有几个例子肯定能够帮助你很好的学习使用这些特性的语法。
最后不管你喜不喜欢我都要为你的家庭编辑几个字幕重新同步整个轨道或者是一切从头开始那么Linux 有很好的工具给你。对我来说,快捷键和易用性使得各个工具有差异,想要更高级别的使用体验,脚本和语音识别就成了很便利的一个功能。
你会使用哪个字幕编辑器,为什么?你认为还有没有更好用的字幕编辑器这里没有提到的?在评论里告诉我们。
--------------------------------------------------------------------------------
via: http://xmodulo.com/good-subtitle-editor-linux.html
作者:[Adrien Brochard][a]
译者:[barney-ro](https://github.com/barney-ro)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:http://gnomesubtitles.org/
[2]:http://www.aegisub.org/
[3]:http://docs.aegisub.org/3.2/Main_Page/
[4]:http://home.gna.org/gaupol/
[5]:http://cmusphinx.sourceforge.net/
[6]:http://home.gna.org/subtitleeditor/
[7]:http://www.jubler.org/
[8]:http://www.jubler.org/download.html
[9]:http://sourceforge.net/projects/subcomposer/

View File

@ -0,0 +1,120 @@
如何加速Debian或Ubuntu上缓慢的apt-get安装
===
如果你在Debian或Ubuntu系统上经常感觉到**apt-get** 或 **aptitude**包安装速度过慢,那么这里就有几种改善这一情况的方法。你有没有考虑过改变正被使用的默认镜像站点?你有没有排除因特网连接的上游带宽成为瓶颈的可能?
没有别的,你可以尝试第三个选择:使用[apt-fast][1]工具。apt-fast实际上是一个围绕apt-get和aptitude所写的shell脚本容器它能过加速包的下载速度。apt-fast本质上采用[aria2][2]下载工具,这款工具能够以“块”的方式从多个镜像并行下载一个文件(就像BitTorrent下载)。
### 在Debian或Ubuntu上安装apt-fast
下面是在基于Debian的Linux上安装apt-fast的步骤
### Debian ###
$ sudo apt-get install aria2
$ wget https://github.com/ilikenwf/apt-fast/archive/master.zip
$ unzip master.zip
$ cd apt-fast-master
$ sudo cp apt-fast /usr/bin
$ sudo cp apt-fast.conf /etc
$ sudo cp ./man/apt-fast.8 /usr/share/man/man8
$ sudo gzip /usr/share/man/man8/apt-fast.8
$ sudo cp ./man/apt-fast.conf.5 /usr/share/man/man5
$ sudo gzip /usr/share/man/man5/apt-fast.conf.5
### Ubuntu 14.04 以及更高版本 ###
$ sudo add-apt-repository ppa:saiarcot895/myppa
$ sudo apt-get update
$ sudo apt-get install apt-fast
### Ubuntu 11.04 到 Ubuntu 13.10 ###
$ sudo add-apt-repository ppa:apt-fast/stable
$ sudo apt-get update
$ sudo apt-get install apt-fast
在安装期间,你需要选择一个默认的软件包管理器 (e.g., apt-get. aptitude ),还需要设置其余选项。但是你可以随时通过编辑配置文件 /etc/apt-fast/conf 来更改设置。
![](https://farm6.staticflickr.com/5615/15285526898_1b18f64d58_z.jpg)
![](https://farm3.staticflickr.com/2949/15449069896_76ee00851b_z.jpg)
![](https://farm6.staticflickr.com/5600/15471817412_9ef7f16096_z.jpg)
### 配置 apt-get ###
安装完成后,你需要在/etc/apt-fast.conf里配置**apt-fast**使用的一系列镜像。
你可以在下面的URL中找到一系列Debian/Ubuntu镜像。
- **Debian**: [http://www.debian.org/mirror/list][3]
- **Ubuntu**: [https://launchpad.net/ubuntu/+archivemirrors][4]
选择完那些地理上靠近你的镜像后,你需按照下面的格式将选择的镜像加入到/etc/apt-fast.conf。
$ sudo vi /etc/apt-fast.conf
Debian
MIRRORS=('http://ftp.us.debian.org/debian/,http://carroll.aset.psu.edu/pub/linux/distributions/debian/,http://debian.gtisc.gatech.edu/debian/,http://debian.lcs.mit.edu/debian/,http://mirror.cc.columbia.edu/debian/')
Ubuntu/Mint
MIRRORS=('http://us.archive.ubuntu.com/ubuntu,http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/,http://mirror.cc.vt.edu/pub2/ubuntu/,http://mirror.umd.edu/ubuntu/,http://mirrors.mit.edu/ubuntu/')
如上面所示,对于一个特定档案的个别镜像,需要用逗号分割开来。你需要在/etc/apt/sources.list的MIRRORS字符串中包含默认的镜像指定站点。
### 使用apt-fast安装一个包 ###
现在你就可以测试apt-fast的强大了。下面是使用**apt-fast**的示例:
apt-fast [apt-get options and arguments]
apt-fast [aptitude options and arguments]
apt-fast { { install | upgrade | dist-upgrade | build-dep | download | source } [ -y | --yes | --assume-yes | --assume-no ] ... | clean }
使用**apt-fast**安装包:
$ sudo apt-fast install texlive-full
在当前目录下载软件包,但不安装:
$ sudo apt-fast download texlive-full
![](http://farm8.staticflickr.com/7309/10585846956_6c98c6dcc9_z.jpg)
如前面所示apt-fast的并行下载是通过aria2完成的。你可以从下面多个镜像验证并行下载。
$ sudo netstat -nap | grep aria2c
![](http://farm8.staticflickr.com/7328/10585846886_4744a0e021_z.jpg)
请注意,**apt-fast**并没有加速"apt-get update"。并行下载只在"install", "upgrade", "dist-upgrage"和"build-dep"操作中触发。其余的操作apt-fast就会简单地回到默认的包管理器apt-get或aptitude。
### apt-fast有多快 ###
为了比较apt-fast和apt-get我尝试在两个相同的Ubuntu实例上使用两种方法安装几个软件包。下面的图表展示了所有软件包安装的时间(单位为秒)。
![](http://farm4.staticflickr.com/3810/10585846986_504d07b4a7_z.jpg)
正如你所见到的,**apt-fast**实质上比**apt-get**快(e.g. 快3--4秒),特别是安装庞大软件包的时候。
当然,安装性能的提高程度还依赖你上游因特网连通性。以我为例,我有富足的带宽来支持我的上游连接。这也是为什么我看到并行下载带来了成功的提高。
---
via: http://xmodulo.com/speed-slow-apt-get-install-debian-ubuntu.html
作者:[Dan Nanni][a]
译者:[su-kaiyao](https://github.com/su-kaiyao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:https://github.com/ilikenwf/apt-fast
[2]:http://aria2.sourceforge.net/
[3]:http://www.debian.org/mirror/list
[4]:https://launchpad.net/ubuntu/+archivemirrors

View File

@ -0,0 +1,166 @@
使用GDB命令行调试器调试C/C++程序
============================================================
没有调试器的情况下编写程序时最糟糕的状况是什么编译时跪着祈祷不要出错用生命在运行可执行程序blood offering不知道怎么翻译好...或者在每一行代码间添加printf("test")语句来定位错误点如你所知编写程序时不使用调试器的话是不利的。幸好linux下调试还是很方便的。大多数人使用的IDE都集成了调试器但linxu著名的调试器是命令行形式的C/C++调试器GDB。然而与其他命令行工具一致DGB需要一定的练习才能完全掌握。这里我会告诉你GDB的基本情况及使用方法。
###安装GDB###
大多数的发行版仓库中都有GDB
Debian 或 Ubuntu
$ sudo apt-get install gdb
Arch Linux
$ sudo pacman -S gdb
Fedora,CentOS 或 RHEL
$sudo yum install gdb
如果在仓库中找不到的话,可以从官网中下载[official page][1]
###示例代码###
当学习GDB时最好有一份代码动手试验。下列代码是我编写的简单例子它可以很好的体现GDB的特性。将它拷贝下来并且进行实验。这是最好的方法。
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int i;
int a=0, b=0, c=0;
double d;
for (i=0; i<100; i++)
{
a++;
if (i>97)
d = i / 2.0;
b++;
}
return 0;
}
###GDB的使用###
首先最重要的,你需要使用编译器的 “-g“选项来编译程序这样可执行程序才能通过GDB来运行。通过下列语句开始调试
$ gdb -tui [executable's name]
使用”-tui“选项可以将代码显示在一个窗口内被称为”文本接口”在这个窗口内可以使用光标来操控同时在下面输入GDB shell命令。
![](https://farm3.staticflickr.com/2947/15397534362_ac0b5692c8_z.jpg)
现在我们可以在程序的任何地方设置断点。你可以通过下列命令来为当前源文件的某一行设置断点。
break [line number]
或者为一个特定的函数设置断点:
break [function name]
甚至可以设置条件断点
break [line number] if [condition]
例如,在我们的示例代码中,可以设置如下:
break 11 if i > 97
![](https://farm3.staticflickr.com/2948/15374839066_8c7c0eb8a4_o.png)
这样程序循环97次之后停留在“a++”语句上。这样是非常方便的避免了我们需要手动循环97次。
最后但也是很重要的是,我们可以设置一个“观察断点”,当这个被观察的变量发生变化时,程序会被停止。
watch [variable]
可以设置如下:
watch d
当d的值发生变化时程序会停止运行例如当i>97为真时
当设置后断点后,使用"run"命令开始运行程序,或按如下所示:
r [程序的输入参数(如果有的话)]
gdb中大多数的单词都可以简写为一个字母。
不出意外程序会停留在11行。这里我们可以做些有趣的事情。下列命令
bt
回溯功能可以让我们知道程序如何到达这条语句的。
![](https://farm3.staticflickr.com/2943/15211202760_1e77a3bb2e_z.jpg)
info locals
这条语句会显示所有的局部变量以及它们的值(你可以看到,我没有为d设置初始值,所以它现在的值是任意值)。
当然
![](https://farm4.staticflickr.com/3843/15374838916_8b65e4e3c7_z.jpg)
p [variable]
这可以显示特定变量的值,但是还有更好的:
ptype [variable]
可以显示变量的类型。所以这里可以确定d是double型。
![](https://farm4.staticflickr.com/3881/15397534242_3cb6163252_o.jpg)
既然已经到这一步了,我么不妨这么做:
    set var [variable] = [new value]
这样会覆盖变量的值。不过需要注意,你不能创建一个新的变量或改变变量的类型。我们可以这样做:
    set var a = 0
![](https://farm3.staticflickr.com/2949/15211357497_d28963a9eb_o.png)
如其他优秀的调试器一样,我们可以单步调试:
step
使用如上命令,运行到下一条语句,也可以进入到一个函数里面。或者使用:
next
这可以直接下一条语句,并且不进入子函数内部。
![](https://farm4.staticflickr.com/3927/15397863215_fb2f5912ac_o.jpg)
结束测试后,删除断点:
delete [line number]
从当前断点继续运行程序:
continue
退出GDB
quit
总结有了GDB编译时不用祈祷上帝了运行时不用血祭再也不用printf(“test“了。当然这里所讲的并不完整而且GDB的功能远不止这些。所以我强烈建议你自己更加深入的学习它。我现在感兴趣的是将GDB整合到Vim中。同时这里有一个[备忘录][2]记录了GDB所有的命令行以供查阅。
你对GDB有什么看法你会将它与图形调试器对比吗它有什么优势呢对于将GDB集成到Vim有什么看法呢将你的想法写到评论里。
--------------------------------------------------------------------------------
via: http://xmodulo.com/gdb-command-line-debugger.html
作者:[Adrien Brochard][a]
译者:[SPccman](https://github.com/SPccman)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:https://www.gnu.org/software/gdb/
[2]:http://users.ece.utexas.edu/~adnan/gdb-refcard.pdf