diff --git a/translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md b/published/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md similarity index 91% rename from translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md rename to published/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md index 9cb0a3765d..0decb425e1 100644 --- a/translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md +++ b/published/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md @@ -1,10 +1,10 @@ -Flow 'N Play视频播放器有着独具风格的界面[在Ubuntu上安装] +在Ubuntu上安装Flow 'N Play—界面独具风格的视频播放器 ================================================================================ **Flow ‘N Play**是个用Qt编写的新视频播放器。它有着漂亮又简洁的界面,只提供基本播放功能。 ![](http://www.tuxarena.com/wp-content/uploads/2014/11/flow_n_play.jpg) -[Flow ‘N Play][1]是个比较新的视频播放器,它有着漂亮的界面和简单的操作(今年三月份第一次发行)。其中一个功能就是能通过拖动鼠标滑动视频列表。播放器带有基本功能,一个搜索功能,支持彩色主题。 +[Flow ‘N Play][1]是个比较新的视频播放器,它有着漂亮的界面和简单的操作(2014年3月份第一次发行)。其中一个功能就是能通过拖动鼠标滑动视频列表。播放器带有基本功能,一个搜索功能,支持彩色主题。 打开一个新的视频——你还可以在同一个对话框下自定义一个封面: diff --git a/published/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md b/published/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md new file mode 100644 index 0000000000..1910310f2d --- /dev/null +++ b/published/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md @@ -0,0 +1,105 @@ +dupeGuru - 直接从硬盘中查找并移除重复文件 +================================================================================ + +### 简介 ### + +对我们来说,磁盘被装满是棘手问题之一。无论我们如何小心谨慎,我们总可能将相同的文件复制到多个不同的地方,或者在不知情的情况下,重复下载了同一个文件。因此,迟早你会看到“磁盘已满”的错误提示,若此时我们确实需要一些磁盘空间来存储重要数据,以上情形无疑是最糟糕的。假如你确信自己的系统中有重复文件,那么 **dupeGuru** 可能会帮助到你。 + +dupeGuru 团队也开发了名为 **dupeGuru 音乐版** 的应用来移除重复的音乐文件,和名为 **dupeGuru 图片版** 的应用来移除重复的图片文件。 + +### 1. dupeGuru (标准版) ### + +需要告诉那些不熟悉 [dupeGuru][1] 的人,它是一个免费、开源、跨平台的应用,其用途是在系统中查找和移除重复文件。它可以在 Linux, Windows, 和 Mac OS X 等平台下使用。通过使用一个快速的模糊匹配算法,它可以在几分钟内找到重复文件。同时,你还可以调整 dupeGuru 使它去精确查找特定文件类型的重复文件,以及从你想删除的文件中,清除某种文件。它支持英语、 法语、 德语、 中文 (简体)、 捷克语、 意大利语、亚美尼亚语、俄语、乌克兰语、巴西语和越南语。 + +#### 在 Ubuntu 14.10/14.04/13.10/13.04/12.04 中安装 dupeGuru #### + +dupeGuru 开发者已经构建了一个 Ubuntu PPA (Personal Package Archives)来简化安装过程。想要安装 dupeGuru,依次在终端中键入以下命令: + +``` +sudo apt-add-repository ppa:hsoft/ppa +sudo apt-get update +sudo apt-get install dupeguru-se +``` + +### 使用 ### + +使用非常简单,可从 Unity 面板或菜单中启动 dupeGuru。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/dupeGuru_007.png) + +点击位于底部的 `+` 按钮来添加你想扫描的文件目录。点击 `扫描` 按钮开始查找重复文件。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/dupeGuru_008.png) + +一旦所选目录中含有重复文件,那么它将在窗口中展示重复文件。正如你所看到的,在下面的截图中,我的下载目录中有一个重复文件。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/dupeGuru-Results_009.png) + +现在,你可以决定下一步如何操作。你可以删除这个重复的文件,或者对它进行重命名,抑或是 复制/移动 到另一个位置。为此,选定该重复文件,或在菜单栏中选定写有“**仅显示重复**”选项 ,如果你选择了“**仅显示重复**”选项,则只有重复文件在窗口中可见,这样你便可以轻松选择并删除这些文件。点击“操作”下拉菜单,最后选择你将执行的操作。在这里,我只想删除重复文件,所以我选择了“移动标记文件到垃圾箱”这个选项。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/Menu_010.png) + +接着,点击“继续”选项来移除重复文件。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/Deletion-Options_011.png) + +### 2. dupeGuru 音乐版 ### + +[dupeGuru 音乐版][2] 或简称 dupeGuru ME,它的功能与 dupeGuru 类似。它拥有 dupeGuru 的所有功能,但它包含更多的信息列 (如比特率,持续时间,标签等)和更多的扫描类型(如带有字段的文件名,标签以及音频内容)。和 dupeGuru 一样,dupeGuru ME 也运行在 Linux、Windows 和 Mac OS X 中。 + +它支持众多的格式,诸如 MP3、WMA、AAC (iTunes 格式)、OGG、FLAC,以及失真率较少的 AAC 和 WMA 格式等。 + +#### 在 Ubuntu 14.10/14.04/13.10/13.04/12.04 中安装 dupeGuru ME #### + +现在,我们不必再添加任何 PPA,因为在前面的步骤中,我们已经进行了添加。所以在终端中键入以下命令来安装它: + +``` +sudo apt-get install dupeguru-me +``` + +### 使用 ### + +你可以从 Unity 面板或菜单中启动它。dupeGuru ME 的使用方法、操作界面以及外观和正常的 dupeGuru 类似。添加你想扫描的目录并选择你想执行的操作。重复的音乐文件就会被删除。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/dupeGuru-Music-Edition-Results_012.png) + +### 3. dupeGuru 图片版 ### + +[dupeGuru 图片版][3],或简称为 duepGuru PE,是一个在你的电脑中查找重复图片的工具。它和 dupeGuru 类似,但独具匹配重复图片的功能。dupeGuru PE 可运行在 Linux、Windows 和 Mac OS X 中。 + +dupeGuru PE 支持 JPG、PNG、TIFF、GIF 和 BMP 等图片格式。所有的这些格式可以被同时比较。Mac OS X 版的 dupeGuru PE 还支持 PSD 和 RAW (CR2 和 NEF) 格式。 + +#### 在 Ubuntu 14.10/14.04/13.10/13.04/12.04 中安装 dupeGuru PE #### + +由于我们已经添加了 PPA,我们也不必为 dupeGuru PE 再次添加。只需运行如下命令来安装它。 + +``` +sudo apt-get install dupeguru-pe +``` + +#### 使用 #### + +就使用方法,操作界面和外观而言,它与 dupeGuru,dupeGuru ME 类似。我就纳闷为什么开发者为不同的类别开发了不同的版本。我想如果开发一个结合以上三个版本功能的应用,或许会更好。 + +启动它,添加你想扫描的目录,并选择你想执行的操作。就这样,你的重复文件将被清除。 + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/11/dupeGuru-Picture-Edition-Results_014.png) + +如果因为任何的安全问题而不能移除某些重复文件,请记下这些文件的位置,通过终端或文件管理器来手动删除它们。 + +欢呼吧! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/dupeguru-find-remove-duplicate-files-instantly-hard-drive/ + +作者:[SK][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:http://www.hardcoded.net/dupeguru/ +[2]:http://www.hardcoded.net/dupeguru_me/ +[3]:http://www.hardcoded.net/dupeguru_pe/ diff --git a/translated/tech/20141204 Linux Namespaces.md b/published/20141204 Linux Namespaces.md similarity index 79% rename from translated/tech/20141204 Linux Namespaces.md rename to published/20141204 Linux Namespaces.md index 522131a50b..c40854d780 100644 --- a/translated/tech/20141204 Linux Namespaces.md +++ b/published/20141204 Linux Namespaces.md @@ -1,32 +1,36 @@ -Linux 命名空间 +介绍 Linux 的命名空间 ================================================================================ ### 背景 ### -从2.6.24版的内核开始,Linux 就支持6种不同类型的命名空间。它们的出现,使用户创建的进程能够与系统分离得更加彻底,从而不需要考虑太多底层的虚拟化技术。 +从Linux 2.6.24版的内核开始,Linux 就支持6种不同类型的命名空间。它们的出现,使用户创建的进程能够与系统分离得更加彻底,从而不需要使用更多的底层虚拟化技术。 - **CLONE_NEWIPC**: 进程间通信(IPC)的命名空间,可以将 SystemV 的 IPC 和 POSIX 的消息队列独立出来。 -- **CLONE_NEWPID**: 进程 ID 的命名空间,进程 ID 独立,意思就是命名空间内的进程 ID 可能会与命名空间外的进程 ID 冲突,于是命名空间内的进程 ID 映射到命名空间外时会使用另外一个进程 ID。比如说,命名空间内 ID 为1的进程,在命名空间外就是指 init 进程。 +- **CLONE_NEWPID**: PID 命名空间。空间内的PID 是独立分配的,意思就是命名空间内的虚拟 PID 可能会与命名空间外的 PID 相冲突,于是命名空间内的 PID 映射到命名空间外时会使用另外一个 PID。比如说,命名空间内第一个 PID 为1,而在命名空间外就是该 PID 已被 init 进程所使用。 - **CLONE_NEWNET**: 网络命名空间,用于隔离网络资源(/proc/net、IP 地址、网卡、路由等)。后台进程可以运行在不同命名空间内的相同端口上,用户还可以虚拟出一块网卡。 - **CLONE_NEWNS**: 挂载命名空间,进程运行时可以将挂载点与系统分离,使用这个功能时,我们可以达到 chroot 的功能,而在安全性方面比 chroot 更高。 - **CLONE_NEWUTS**: UTS 命名空间,主要目的是独立出主机名和网络信息服务(NIS)。 - **CLONE_NEWUSER**: 用户命名空间,同进程 ID 一样,用户 ID 和组 ID 在命名空间内外是不一样的,并且在不同命名空间内可以存在相同的 ID。 +下面我们介绍一下进程命名空间和网络命名空间。 + +### 进程命名空间 + 本文用 C 语言介绍上述概念,因为演示进程命名空间的时候需要用到 C 语言。下面的测试过程在 Debian 6 和 Debian 7 上执行。首先,在栈内分配一页内存空间,并将指针指向内存页的末尾。这里我们使用 **alloca()** 函数来分配内存,不要用 malloc() 函数,它会把内存分配在堆上。 void *mem = alloca(sysconf(_SC_PAGESIZE)) + sysconf(_SC_PAGESIZE); -然后使用 **clone()** 函数创建子进程,传入栈空间的地址 "mem",以及指定命名空间的标记。同时我们还指定“callee”作为子进程运行的函数。 +然后使用 **clone()** 函数创建子进程,传入我们的子栈空间地址 "mem",并指定命名空间的标记。同时我们还指定“callee”作为子进程运行的函数。 mypid = clone(callee, mem, SIGCHLD | CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWNS | CLONE_FILES, NULL); -**clone** 之后我们要在父进程中等待子进程先退出,否则的话,父进程会继续运行下去,直到进程结束,留下子进程变成孤儿进程: +**clone** 之后我们要在父进程中等待子进程先退出,否则的话,父进程会继续运行下去,并马上进程结束,留下子进程变成孤儿进程: while (waitpid(mypid, &r, 0) < 0 && errno == EINTR) { continue; } -最后当子进程退出后,我们会回到 shell 界面。 +最后当子进程退出后,我们会回到 shell 界面,并返回子进程的退出码。 if (WIFEXITED(r)) { @@ -47,7 +51,7 @@ Linux 命名空间 return ret; } -程序挂载 **/proc** 文件系统,设置用户 ID 和组 ID,值都为“u”,然后运行 **/bin/bash** 程序,[LXC][1] 是操作系统级的虚拟化工具,使用 cgroups 和命名空间来完成资源的分离。现在我们把所有代码放在一起,变量“u”的值设为65534,在 Debian 系统中,这是“nobody”和“nogroup”: +程序挂载了 **/proc** 文件系统,设置用户 ID 和组 ID,值都为“u”,然后运行 **/bin/bash** 程序,[LXC][1] 是一个操作系统级的虚拟化工具,使用 cgroups 和命名空间来完成资源的分离。现在我们把所有代码放在一起,变量“u”的值设为65534,在 Debian 系统中,这是“nobody”和“nogroup”: #define _GNU_SOURCE #include @@ -101,12 +105,16 @@ Linux 命名空间 nobody 5 0.0 0.0 2784 1064 pts/1 R+ 21:21 0:00 ps auxw nobody@w:~/pen/tmp$ -注意上面的结果,UID 和 GID 被设置成 nobody 和 nogroup 了,特别是 ps 工具只输出两个进程,它们的 ID 分别是1和5(LCTT注:这就是上文介绍 CLONE_NEWPID 时提到的功能,在线程所在的命名空间内,进程 ID 可以为1,映射到命名空间外就是65534;而命名空间外的 ID 为1的进程一直是 init)。接下来轮到使用 ip netns 来设置网络的命名空间。第一步先确定当前系统没有命名空间: +注意上面的结果,UID 和 GID 被设置成 nobody 和 nogroup 了,特别是 ps 工具只输出两个进程,它们的 ID 分别是1和5(LCTT注:这就是上文介绍 CLONE_NEWPID 时提到的功能,在线程所在的命名空间内,进程 ID 可以为1,映射到命名空间外是另外一个 PID;而命名空间外的 ID 为1的进程一直是 init)。 + +### 网络命名空间 + +接下来轮到使用 ip netns 来设置网络的命名空间。第一步先确定当前系统没有命名空间: root@w:~# ip netns list Object "netns" is unknown, try "ip help". -这种情况下,你需要更新你的系统内核,以及 ip 工具。这里假设你的内核版高于2.6.24,ip 工具版本也差不多,高于2.6.24(LCTT注:ip 工具由 iproute 安装包提供,此安装包版本与内核版本相近)。更新好后,**ip netns list** 在没有命名空间存在的情况下不会输出任务信息。加个名为“ns1”的命名空间看看: +如果报了上述错误,你需要更新你的系统内核,以及 ip 工具程序。这里假设你的内核版高于2.6.24,ip 工具版本也差不多,高于2.6.24(LCTT注:ip 工具由 iproute 安装包提供,此安装包版本与内核版本相近)。更新好后,**ip netns list** 在没有命名空间存在的情况下不会输出任务信息。加个名为“ns1”的命名空间看看: root@w:~# ip netns add ns1 root@w:~# ip netns list @@ -120,7 +128,7 @@ Linux 命名空间 2: eth0: mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000 link/ether 00:0c:29:65:25:9e brd ff:ff:ff:ff:ff:ff -创建新的虚拟网卡,加到命名空间。虚拟网卡需要成对创建,互相关联——想想交叉电缆吧: +创建新的虚拟网卡,并加到命名空间。虚拟网卡需要成对创建,互相关联——就像交叉电缆一样: root@w:~# ip link add veth0 type veth peer name veth1 root@w:~# ip link list @@ -146,11 +154,11 @@ Linux 命名空间 这个时候 **ifconfig** -a 命令只能显示 veth0,不能显示 veth1,因为后者现在在 ns1 命名空间中。 -如果想删除 veth1,可以执行下面的命令: +如果想删除 veth0/veth1,可以执行下面的命令: ip netns exec ns1 ip link del veth1 -为 veth0 分配 IP 地址: +我们可以为 veth0 分配 IP 地址: ifconfig veth0 192.168.5.5/24 @@ -229,7 +237,7 @@ via: http://www.howtoforge.com/linux-namespaces 作者:[aziods][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141217 Centralized Secure Storage (iSCSI)-- 'Initiator Client' Setup on RHEL or CentOS or Fedora -Part III.md b/published/20141217 Centralized Secure Storage (iSCSI)-- 'Initiator Client' Setup on RHEL or CentOS or Fedora -Part III.md similarity index 68% rename from translated/tech/20141217 Centralized Secure Storage (iSCSI)-- 'Initiator Client' Setup on RHEL or CentOS or Fedora -Part III.md rename to published/20141217 Centralized Secure Storage (iSCSI)-- 'Initiator Client' Setup on RHEL or CentOS or Fedora -Part III.md index f4754a6bb8..482733a3a2 100644 --- a/translated/tech/20141217 Centralized Secure Storage (iSCSI)-- 'Initiator Client' Setup on RHEL or CentOS or Fedora -Part III.md +++ b/published/20141217 Centralized Secure Storage (iSCSI)-- 'Initiator Client' Setup on RHEL or CentOS or Fedora -Part III.md @@ -1,33 +1,33 @@ -中心化存储(iSCSI)- “初始器客户端” 在RHEL/CentOS/Fedora上的设置 - 第三部分 -================================================================================ -**iSCSI** 初始化器是一种用于与iSCSI target服务器认证并访问服务器上共享的的LUN的客户端。我们可以在本地挂载的硬盘上部署任何操作系统,只需要安装一个包来与target服务器验证。 +设置iSCSI的发起程序(客户端)(三) +============================ + +**iSCSI** 发起程序是一种用于同 iSCSI 目标器认证并访问服务器上共享的LUN的客户端。我们可以在本地挂载的硬盘上部署任何操作系统,只需要安装一个包来与目标器验证。 ![Client Initiator Setup](http://www.tecmint.com/wp-content/uploads/2014/07/Client-Initiator-Setup.jpg) -初始器客户端设置 +*初始器客户端设置* -#### 功能 #### +### 功能 ### - 可以处理本地挂载磁盘上的任意文件系统 -- 在使用fdisk命令后不需要重启系统 +- 在使用fdisk命令分区后不需要重启系统 -#### 要求 #### +### 前置阅读 ### -- [使用iSCSI Target创建集中化安全存储- 第一部分][1] -- [在Target服务器中使用LVM创建LUN - 第二部分][2] +- [使用iSCSI Target创建集中式安全存储(一)][1] +- [在 iSCSI Target 服务器中使用LVM创建和设置LUN(二)][2] #### 我的客户端设置 #### -- 操作系统 – CentOS release 6.5 (最终版) -- iSCSI Target IP – 192.168.0.50 +- 操作系统 – CentOS 6.5 (Final) +- iSCSI 目标器 IP – 192.168.0.50 - 使用的端口 : TCP 3260 -**Warning**: Never stop the service while LUNs Mounted in Client machines (Initiator). -**Warning**:永远不要在使用LUN的时候在客户端中(初始化器)停止服务。 +**警告**:永远不要在LUN还挂载在客户端(发起程序)时停止服务。 ### 客户端设置 ### -**1.** 在客户端,我们需要安装包‘**iSCSI-initiator-utils**‘,用下面的命令搜索包。 +**1.** 在客户端,我们需要安装包‘**iSCSI-initiator-utils**’,用下面的命令搜索包。 # yum search iscsi @@ -37,29 +37,29 @@ iscsi-initiator-utils.x86_64 : iSCSI daemon and utility programs iscsi-initiator-utils-devel.x86_64 : Development files for iscsi-initiator-utils -**2.** 一旦定位了包,就用下面的yum命令安装初始化包。 +**2.** 找到了包,就用下面的yum命令安装初始化包。 # yum install iscsi-initiator-utils.x86_64 -**3.** 安装完毕后,我们需要发现**Target 服务器**上的共享。客户端的命令有点难记,因此我们使用man来的到需要运行的命令列表 +**3.** 安装完毕后,我们需要发现**目标器**上的共享。客户端的命令有点难记,因此我们使用man找到需要运行的命令列表。 # man iscsiadm ![man iscsiadm](http://www.tecmint.com/wp-content/uploads/2014/07/man-iscsiadm.jpg) -man iscsiadm +*man iscsiadm* -**4.** 按下**SHIFT+G** 进入man页的底部并且稍微向上滚动来的到登录的示例命令。下面的发现命令中,需要用我们的**服务器IP地址**来替换。 +**4.** 按下**SHIFT+G** 进入man页的底部并且稍微向上滚动找到示例的登录命令。下面的发现命令中,需要用我们的**服务器IP地址**来替换。 # iscsiadm --mode discoverydb --type sendtargets --portal 192.168.0.200 --discover -**5.** 这里我们从下面的命令中得到了iSCSIi限定名(iqn)。 +**5.** 这里我们从下面的命令输出中找到了iSCSI的限定名(iqn)。 192.168.0.200:3260,1 iqn.2014-07.com.tecmint:tgt1 ![Discover Target](http://www.tecmint.com/wp-content/uploads/2014/07/Discover-Target.jpg) -发现服务器 +*发现服务器* **6.** 要登录就用下面的命令来连接一台LUN到我们本地系统中,这会与服务器验证并允许我们登录LUN。 @@ -67,7 +67,7 @@ man iscsiadm ![Login To Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Login-To-Target-Server.jpg) -登录到服务器 +*登录到服务器* **注意**:登出使用登录命令并在命令的最后使用logout来替换。 @@ -75,15 +75,15 @@ man iscsiadm ![Logout from Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Logout-from-Target-Server.jpg) -等出服务器 +*登出服务器* -**7.** 登录服务器后,使用下面的命令列出节点的记录。 +**7.** 登录服务器后,使用下面的命令列出节点的记录行。 # iscsiadm --mode node ![List Node](http://www.tecmint.com/wp-content/uploads/2014/07/List-Node.jpg) -列出节点 +*列出节点* **8.** 显示特定节点的所有数据 @@ -109,7 +109,7 @@ man iscsiadm iface.linklocal_autocfg = .... -**9.** 接着列出使用的磁盘,fdisk会列出所有的认证过的磁盘。 +**9.** 接着列出使用的磁盘,fdisk会列出所有的登录认证过的磁盘。 # fdisk -l /dev/sda @@ -123,7 +123,7 @@ man iscsiadm ![Create New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Create-New-Partition.jpg) -创建新分区 +*创建新分区* **注意**:在使用fdisk创建新分区之后,我们无需重启,就像使用我们本地的文件系统一样就行。因为这个将远程共享存储挂载到本地了。 @@ -133,7 +133,7 @@ man iscsiadm ![Format New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Format-New-Partition.jpg) -格式化新分区 +*格式化新分区* **12.** 创建一个目录来挂载新创建的分区 @@ -143,20 +143,20 @@ man iscsiadm ![Mount New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Mount-New-Partition.jpg) -挂载新分区 +*挂载新分区* **13.** 列出挂载点 # df -Th -- **-T** – Prints files system types. -- **-h** – Prints in human readable format eg : Megabyte or Gigabyte. +- **-T** – 输出文件系统类型 +- **-h** – 以易读的方式显示大小 ![List New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/List-New-Partition.jpg) -列出新分区 +*列出新分区* -**14.** 如果需要永久挂在使用fdtab文件 +**14.** 如果需要永久挂载,使用fdtab文件 # vim /etc/fstab @@ -168,18 +168,18 @@ man iscsiadm ![Auto Mount Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Auto-Mount-Partition.jpg) -自动挂载分区 +*自动挂载分区* **16.** 最后检查我们fstab文件是否有错误。 # mount -av - **-a** – 所有挂载点 -- **-v** – 繁琐模式 +- **-v** – 冗余模式 ![Verify fstab Entries](http://www.tecmint.com/wp-content/uploads/2014/07/Verify-fstab-Entries.jpg) -验证fstab文件 +*验证fstab文件* 我们已经成功完成了我们的客户端配置。现在让我们像本地磁盘一样使用它吧。 @@ -189,10 +189,10 @@ via: http://www.tecmint.com/iscsi-initiator-client-setup/ 作者:[Babin Lonston][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/ -[2]:http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/ +[1]:http://linux.cn/article-4971-1.html +[2]:http://linux.cn/article-4972-1.html diff --git a/translated/tech/20141217 Create Centralized Secure Storage using iSCSI Target on RHEL or CentOS or Fedora Part -I.md b/published/20141217 Create Centralized Secure Storage using iSCSI Target on RHEL or CentOS or Fedora Part -I.md similarity index 59% rename from translated/tech/20141217 Create Centralized Secure Storage using iSCSI Target on RHEL or CentOS or Fedora Part -I.md rename to published/20141217 Create Centralized Secure Storage using iSCSI Target on RHEL or CentOS or Fedora Part -I.md index 8455aeb5cb..34352ed08c 100644 --- a/translated/tech/20141217 Create Centralized Secure Storage using iSCSI Target on RHEL or CentOS or Fedora Part -I.md +++ b/published/20141217 Create Centralized Secure Storage using iSCSI Target on RHEL or CentOS or Fedora Part -I.md @@ -1,46 +1,47 @@ -在RHEL/CentOS/Fedora上使用iSCSI Target创建集中式安全存储 - 第一部分 +使用iSCSI Target创建集中式安全存储(一) ================================================================================ -**iSCSI** 是一种就块级别协议,用于通过TCP/IP网络共享**原始存储设备**,可以用已经存在的IP和以太网如网卡、交换机、路由器等通过iSCSI协议共享和访问存储。iSCSI target是一种远程iSCSI服务器或者taget上的远程硬盘。 +**iSCSI** 是一种块级别的协议,用于通过TCP/IP网络共享**原始存储设备**,可以用已经存在的IP和以太网如网卡、交换机、路由器等通过iSCSI协议共享和访问存储。iSCSI target是一种由远程iSCSI服务器(target)提供的远程硬盘。 ![Install iSCSI Target in Linux](http://www.tecmint.com/wp-content/uploads/2014/07/Install-iSCSI-Target-in-Linux.jpg) -在Linux中安装iSCSI Target -我们不需要在客户端为了稳定的连接和性能而占用很大的资源。iSCSI服务器称为Target,它共享存储。iSCSI客户端称为Initiator,它访问Target服务器行的存储。市场中有用于大型存储服务如SAN的iSCSI适配器。 +*在Linux中安装iSCSI Target* + +我们不需要占用很大的资源就可以为客户端提供稳定的连接和性能。iSCSI服务器称为“Target(目标器)”,它提供服务器上的存储共享。iSCSI客户端称为“Initiator(发起程序)”,它访问目标器共享的存储。市场中有卖的用于大型存储服务如SAN的iSCSI适配器。 **我们为什么要在大型存储领域中使用iSCSI适配器** -以太网适配器(NIC)被设计用于在系统、服务器和存储设备如NAS间传输分组数据,它不适合在Internet中传输块级别数据。 +以太网适配器(NIC)被设计用于在系统、服务器和存储设备如NAS间传输分组数据,它不适合在Internet中传输块级数据。 ### iSCSI Target的功能 ### -- 可以在一台机器上运行几个iSCSI target -- 一台机器的多个iSCSI target可以在iSCSI中访问 -- 一个target就是一块存储,并且可以通过网络被初始化器(客户端)访问 +- 可以在一台机器上运行几个iSCSI 目标器 +- 一台机器可以提供多个iSCSI 目标器用于iSCSI SAN访问 +- 一个目标器就是一块存储,并且可以通过网络被发起程序(客户端)访问 - 把这些存储汇聚在一起让它们在网络中可以访问的是iSCSI LUN(逻辑单元号) -- iSCSI支持在同一个会话中含有多个连接 -- iSCSI初始化器在网络中发现目标接着用LUN验证并登录,这样就可以本地访问远程存储。 -- 我们了一在本地挂载的LUN上安装任何操作系统,就像我们安装我们本地的操作系统一样。 +- iSCSI支持在同一个会话中使用多个连接 +- iSCSI发起程序在网络中发现目标接着用LUN验证并登录,这样就可以本地访问远程存储。 +- 我们可以在本地挂载的LUN上安装任何操作系统,就像我们安装我们本地的操作系统一样。 ### 为什么需要iSCSI? ### 在虚拟化中,我们需要存储拥有高度的冗余性、稳定性,iSCSI以低成本的方式提供了这些特性。与使用光纤通道的SAN比起来,我们可以使用已经存在的设备比如NIC、以太网交换机等建造一个低成本的SAN。 -现在我开始使用iSCSI Target安装并配置安全存储。本篇中,我们遵循下面的步骤 +现在我开始使用iSCSI 目标器安装并配置安全存储。本篇中,我们遵循下面的步骤: -- 我们需要隔离一个系统来设置iSCSI Target服务器和初始化器(客户端)。 -- 可以在大型存储环境中添加多个硬盘,但是我们除了基本的安装盘之外只使用一个额外的驱动器。 -- 现在我们只使用2块硬盘,一个用于基本的服务器安装,另外一个用于存储(LUN),这个我们会在这个系列的第二篇描述。 +- 我们需要隔离一个系统来设置iSCSI Target服务器和发起程序(客户端)。 +- 在大型存储环境中可以添加多个硬盘,但是这里我们除了基本的安装盘之外只使用了一个额外的驱动器。 +- 这里我们只使用了2块硬盘,一个用于基本的服务器安装,另外一个用于存储(LUN),这个我们会在这个系列的第二篇描述。 #### 主服务器设置 #### -- 操作系统 – CentOS release 6.5 (最终版) -- iSCSI Target IP – 192.168.0.200 +- 操作系统 – CentOS 6.5 (Final) +- iSCSI 目标器 IP – 192.168.0.200 - 使用的端口 : TCP 860, 3260 - 配置文件 : /etc/tgt/targets.conf -## 安装 iSCSI Target ## +### 安装 iSCSI Target ### -打开终端并使用yum命令来搜索我们需要在iscsi target上安装的包名。 +打开终端并使用yum命令来搜索需要在iscsi 目标器上安装的包名。 # yum search iscsi @@ -52,21 +53,21 @@ lsscsi.x86_64 : List SCSI devices (or hosts) and associated information scsi-target-utils.x86_64 : The SCSI target daemon and utility programs -We got the search result as above, choose the **Target** package and install to play around. -你会的到上面的那些结果,选择**Target**包来安装 +你会的到上面的那些结果,选择**Target**包来安装。 # yum install scsi-target-utils -y ![Install iSCSI Utils](http://www.tecmint.com/wp-content/uploads/2014/07/Install-iSCSI-in-Linux.jpg) -安装iSCSI工具 -列出安装的包来了解默认的配置、服务和man页面的位置 +*安装iSCSI工具* + +列出安装的包里面的内容来了解默认的配置、服务和man页面的位置。 # rpm -ql scsi-target-utils.x86_64 ![List All iSCSI Files](http://www.tecmint.com/wp-content/uploads/2014/07/List-All-ISCSI-Files.jpg) -列出所有的iSCSI文件 +*列出所有的iSCSI包里面的文件* 让我们启动iSCSI服务,并检查服务运行的状态,iSCSI的服务名是**tgtd**。 @@ -75,7 +76,7 @@ We got the search result as above, choose the **Target** package and install to ![Start iSCSI Service](http://www.tecmint.com/wp-content/uploads/2014/07/Start-iSCSI-Service.jpg) -启动iSCSI服务 +*启动iSCSI服务* 现在我们需要配置开机自动启动。 @@ -87,53 +88,53 @@ We got the search result as above, choose the **Target** package and install to ![Enable iSCSI on Startup](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-iSCSI-on-Startup.jpg) -开机启动iSCSI +*开机启动iSCSI* -现在使用**tgtadm**来列出在我们的服务器上已经配置了哪些target和LUN。 +现在使用**tgtadm**来列出在我们的服务器上已经配置了哪些目标器和LUN。 # tgtadm --mode target --op show -**tgtd**已经安装并在运行了,但是上面的命令没有**输出**因为我们还没有在Target服务器上定义LUN。要查看手册,运行‘**man**‘命令。 +**tgtd**已经安装并在运行了,但是上面的命令没有**输出**因为我们还没有在目标器上定义LUN。要查看手册,可以运行‘**man**‘命令。 # man tgtadm ![iSCSI Man Pages](http://www.tecmint.com/wp-content/uploads/2014/07/iSCSI-Man-Pages.jpg) -iSCSI Man 页面 +*iSCSI Man 页面* -最终我们需要为iSCSI添加iptable规则,如果你的target服务器上存在iptable的话。首先使用netstat命令找出iscsi target的端口号,target总是监听TCP端口3260。 +如果你的target服务器上有iptable的话,那么我们需要为iSCSI添加iptable规则。首先使用netstat命令找出iscsi target的端口号,target总是监听TCP端口3260。 # netstat -tulnp | grep tgtd ![Find iSCSI Port](http://www.tecmint.com/wp-content/uploads/2014/07/Find-iSCSI-Port.jpg) -找出iSCSI端口 +*找出iSCSI端口* -下面加入如下规则让iptable允许广播iSCSI target发现包。 +下面加入如下规则让iptable允许广播iSCSI 目标器发现包。 # iptables -A INPUT -i eth0 -p tcp --dport 860 -m state --state NEW,ESTABLISHED -j ACCEPT # iptables -A INPUT -i eth0 -p tcp --dport 3260 -m state --state NEW,ESTABLISHED -j ACCEPT ![Open iSCSI Ports](http://www.tecmint.com/wp-content/uploads/2014/07/Open-iSCSI-Ports.jpg) -打开iSCSI端口 +*打开iSCSI端口* ![Add iSCSI Ports to Iptables](http://www.tecmint.com/wp-content/uploads/2014/07/Add-iSCSI-Ports-to-Iptables.jpg) -添加iSCSI端口到iptable中 +*添加iSCSI端口到iptable中* -**注意**: 规则可能根据你的 **默认链策略**而不同。接着保存iptable并重启。 +**注意**: 规则可能根据你的 **默认链策略**而不同。接着保存iptable并重启该服务。 # iptables-save # /etc/init.d/iptables restart ![Restart iptables](http://www.tecmint.com/wp-content/uploads/2014/07/Restart-iptables.jpg) -重启iptable +*重启iptable* -现在我们已经部署了一个target服务器来共享LUN给通过TCP/IP认证的初始化器。这也适用于从小到大规模的生产环境。 +现在我们已经部署了一个目标器来共享LUN给通过TCP/IP认证的发起程序。这也适用于从小到大规模的生产环境。 -在我的下篇文章中,我会展示如何[在Target服务器中使用LVM创建LUN][1],并且如何在客户端中共享LUN,在此之前请继续关注TecMint获取更多的更新,并且不要忘记留下有价值的评论。 +在我的下篇文章中,我会展示如何[在目标器中使用LVM创建LUN][1],并且如何在客户端中共享LUN,不要忘记留下有价值的评论。 -------------------------------------------------------------------------------- @@ -141,7 +142,7 @@ via: http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-target 作者:[Babin Lonston][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141217 How to Create and Setup LUNs using LVM in 'iSCSI Target Server' on RHEL or CentOS or Fedora -Part II.md b/published/20141217 How to Create and Setup LUNs using LVM in 'iSCSI Target Server' on RHEL or CentOS or Fedora -Part II.md similarity index 65% rename from translated/tech/20141217 How to Create and Setup LUNs using LVM in 'iSCSI Target Server' on RHEL or CentOS or Fedora -Part II.md rename to published/20141217 How to Create and Setup LUNs using LVM in 'iSCSI Target Server' on RHEL or CentOS or Fedora -Part II.md index bac7aba27f..3c8f09a168 100644 --- a/translated/tech/20141217 How to Create and Setup LUNs using LVM in 'iSCSI Target Server' on RHEL or CentOS or Fedora -Part II.md +++ b/published/20141217 How to Create and Setup LUNs using LVM in 'iSCSI Target Server' on RHEL or CentOS or Fedora -Part II.md @@ -1,47 +1,47 @@ -如何在RHEL/CentOS/Fedora中使用LVM创建和设置LUN- 第二部分 +在 iSCSI Target 服务器中使用LVM创建和设置LUN(二) ================================================================================ -LUN是逻辑单元号,它与iSCSI存储服务器共享。物理iSCSI target服务器共享它的驱动器来初始化TCP/IP网络。驱动器的集合称作LUN来幸存一个大型存储也就是SAN(Storage Area Network)。在真实环境中LUN在LVM中定义,因此它可以按需扩展。 +LUN是逻辑单元号,它与iSCSI存储服务器共享。iSCSI 目标器通过TCP/IP网络共享它的物理驱动器给发起程序(initiator)。这些来自一个大型存储(SAN:Storage Area Network)的驱动器集合称作LUN。在真实环境中LUN是在LVM中定义的,因为它可以按需扩展。 ![Create LUNS using LVM in Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Create-LUNS-inLVM.png) -Create LUNS using LVM in Target Server + +*在目标器中使用 LVM 创建 LUN* ### 为什么使用LUN? ### -LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块物理驱动器组成。我们可以使用LUN作为系统物理驱动器来安装操作系统,LUN在集群、虚拟服务器、SAN中使用。在虚拟服务器中使用LUN的目的是作为系统存储。LUN的性能和可靠性根据在创建目标存储服务器时所使用的驱动器决定。 +LUN用于存储,SAN存储大多数由LUN的集群来组成存储池,LUN由目标器的几块物理驱动器组成。我们可以使用LUN作为系统物理驱动器来安装操作系统,LUN可以用在集群、虚拟服务器、SAN中。在虚拟服务器中使用LUN的主要用途是作为操作系统的存储。LUN的性能和可靠性根据在创建目标存储服务器时所使用的驱动器决定。 -### 需求 ### +### 前置阅读 ### -要了解创建iSCSI target服务器点击下面的链接。 +要了解创建iSCSI 目标器,点击下面的链接。 -- [使用iSCSI target创建爱你集中话安全存储][1] +- [使用iSCSI Target创建集中式安全存储(一)][1] #### 主服务器设置 #### -系统信息和网络设置部分与已经写的iSCSI Target服务相同 - 我们在相同的服务器上定义LUN。 +系统信息和网络设置部分与前文的iSCSI 目标器相同 - 我们在相同的服务器上定义LUN。 - -- 操作系统 – CentOS release 6.5 (最终版) -- iSCSI Target IP – 192.168.0.200 +- 操作系统 – CentOS 6.5 (Final) +- iSCSI 目标器 IP – 192.168.0.200 - 使用的端口 : TCP 860, 3260 - 配置文件 : /etc/tgt/targets.conf -## 在iSCSI Target Server使用LVM创建LUN ## +### 在iSCSI 目标器使用LVM创建LUN ### 首先,用**fdisk -l**命令找出驱动器的列表,这会列出系统中所有分区的列表。 # fdisk -l -上面的命令只会给出基本系统的驱动器信息。为了个到存储设备的信息,使用下面的命令来的到存储设备的列表。 +上面的命令只会给出基本系统的驱动器信息。为了得到存储设备的信息,使用下面的命令来得到存储设备的列表。 # fdisk -l /dev/vda && fdisk -l /dev/sda ![List Storage Drives](http://www.tecmint.com/wp-content/uploads/2014/07/1.jpg) -列出存储设备 +*列出存储设备* **注意**:这里**vda**是虚拟机硬盘,因为我使用的是虚拟机来用于演示,**/dev/sda** 是额外加入的存储。 -### 第一步: 创建用于LUN的LVM ### +### 第一步: 创建用于LUN的LVM驱动器 ### 我们使用**/dev/sda**驱动器来创建LVM。 @@ -49,14 +49,14 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 ![List LVM Drive](http://www.tecmint.com/wp-content/uploads/2014/07/2.jpg) -列出LVM驱动器 +*列出LVM驱动器* -现在让我们如下使用fdisk命令列出驱动器分区。 +现在让我们使用如下fdisk命令列出驱动器分区。 # fdisk -cu /dev/sda -- The option ‘**-c**‘ 关闭DOS兼容模式。 -- The option ‘**-u**‘ 用于列出分区表,给出扇区而不是柱面的大小。 +- 选项 ‘**-c**’ 关闭DOS兼容模式。 +- 选项 ‘**-u**’ 用于列出分区表时给出扇区而不是柱面的大小。 使用**n**创建新的分区。 @@ -109,7 +109,7 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 ![Create LVM Partition](http://www.tecmint.com/wp-content/uploads/2014/07/3.jpg) -创建LVM分区 +*创建LVM分区* 系统重启后,使用fdisk命令列出分区表。 @@ -117,7 +117,7 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 ![Verify LVM Partition](http://www.tecmint.com/wp-content/uploads/2014/07/4.jpg) -验证LVM分区 +*验证LVM分区* ### 第二步: 为LUN创建逻辑卷 ### @@ -125,7 +125,7 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 # pvcreate /dev/sda1 -用iSCSI的名字创建卷组来区分组。 +用iSCSI的名字创建卷组来区分这个卷组。 # vgcreate vg_iscsi /dev/sda1 @@ -148,17 +148,17 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 ![Creating LVM Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/5.jpg) -创建LVM逻辑卷 +*创建LVM逻辑卷* ![Verify LVM Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/6.jpg) -验证LVM逻辑卷 +*验证LVM逻辑卷* -### 第三步: 在Target Server中定义LUN ### +### 第三步: 在目标器中定义LUN ### -我们已经创建了逻辑卷并准备使用LUN,现在我们在target配置中定义LUN,如果这样那么它只能用在客户机中(启动器)。 +我们已经创建了逻辑卷并准备使用LUN,现在我们在目标器配置中定义LUN,只有这样做它才能用在客户机中(发起程序)。 -用你选择的编辑器打开位于‘/etc/tgt/targets.conf’的target配置文件。 +用你选择的编辑器打开位于‘/etc/tgt/targets.conf’的目标器配置文件。 # vim /etc/tgt/targets.conf @@ -179,20 +179,22 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 ![Configure LUNs in Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/7.jpg) -在target中配置LUN +*在target中配置LUN* -- iSCSI 限定名 (iqn.2014-07.com.tecmint:tgt1). -- 随你怎么使用 -- 确定使用目标, 这台服务器中的第一个目标 -- 4. LVM共享特定的LUN。 +上图的解释: -接下来使用下面命令重载**tgd**服务配置。 +1. iSCSI 采取限定名 (iqn.2014-07.com.tecmint:tgt1). +2. 名称随便你 +3. 用于确定目标名, 这是这台服务器中的第一个目标 +4. LVM共享特定的LUN。 + +接下来使用下面的命令重载**tgd**服务配置。 # /etc/init.d/tgtd reload ![Reload Configuration](http://www.tecmint.com/wp-content/uploads/2014/07/8.jpg) -重载配置 +*重载配置* 接下来使用下面的命令验证可用的LUN。 @@ -200,23 +202,22 @@ LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块 ![List Available LUNs](http://www.tecmint.com/wp-content/uploads/2014/07/9.jpg) -列出可用LUN +*列出可用LUN* ![LUNs Information](http://www.tecmint.com/wp-content/uploads/2014/07/10.jpg) -LUN信息 +*LUN信息* -The above command will give long list of available LUNs with following information. 上面的命令会列出可用LUN的下面这些信息 -- iSCSI 限定名 -- iSCSI 准备使用 -- 默认LUN 0被控制器保留 -- LUN 1是我们定义的target服务器 -- 这里我为每个LUN都定义了4GB -- 在线: 是的,这就是可以使用的LUN +1. iSCSI 限定名 +2. iSCSI 已经准备好 +3. 默认LUN 0被控制器所保留 +4. LUN 1是我们定义的目标器 +5. 这里我为每个LUN都定义了4GB +6. 在线: 是的,这就是可以使用的LUN -现在我们已经使用LVM为target服务器定义了LUN,这可扩展并且支持很多特性,如快照。我们将会在第三部分了解如何用target服务器授权,并且本地挂载远程存储。 +现在我们已经使用LVM为目标器定义了LUN,这可扩展并且支持很多特性,如快照。我们将会在第三部分了解如何用目标器授权,并且本地挂载远程存储。 -------------------------------------------------------------------------------- @@ -224,9 +225,9 @@ via: http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/ 作者:[Babin Lonston][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/ \ No newline at end of file +[1]:http://linux.cn/article-4971-1.html \ No newline at end of file diff --git a/translated/tech/20141224 Linux FAQs with Answers--How to fix 'XXX is not in the sudoers file' error.md b/published/20141224 Linux FAQs with Answers--How to fix 'XXX is not in the sudoers file' error.md similarity index 72% rename from translated/tech/20141224 Linux FAQs with Answers--How to fix 'XXX is not in the sudoers file' error.md rename to published/20141224 Linux FAQs with Answers--How to fix 'XXX is not in the sudoers file' error.md index 996f833bff..0cd74b4e3d 100644 --- a/translated/tech/20141224 Linux FAQs with Answers--How to fix 'XXX is not in the sudoers file' error.md +++ b/published/20141224 Linux FAQs with Answers--How to fix 'XXX is not in the sudoers file' error.md @@ -1,16 +1,16 @@ -Linux有问必答时间--怎样解决“XXX is not in the sudoers file”错误 +Linux有问必答时间:怎样解决“XXX is not in the sudoers file”错误 ================================================================================ -> **问题**:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户ID] is not in the sudoers file. This incident will be reported."的错误信息。我该怎么处理这种sudo错误呢? +> **问题**:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incident will be reported."的错误信息。我该怎么处理这种sudo错误呢? -sudo是一个允许特定的用户组用另一个用户(典型的代表是root)的特权来运行一个命令。sudo有详细的日志功能并且提供了细粒度控制来覆盖用户通过sudo敲入的命令。 +sudo是一个允许特定的用户组用另一个用户(典型的是root)的特权来运行一个命令。sudo有详细的日志功能,并且提供了对用户可通过sudo来运行哪些命令的细粒度控制。 ### Sudo vs. Su ### -su命令也提供了同样的特权升级功能,两者不同的是它们认证过程和特权变化的粒度。su允许你从你的登录会话切换到另一个用户的会话,然后你可以随心所欲地用该用户的特权来运行任何程序,但是你需要知道目标用户的密码才能切换这个用户。另一方面,sudo能在每个命令的基础上工作,允许你用root的特权来运行单个命令。用sudo你不必一定要知道root的密码,但是在提示输入sudo密码的时候要输入你的密码。 +su命令也提供了同样的特权提升功能,两者不同的是它们认证过程和特权变化的粒度。su允许你从你的登录会话切换到另一个用户的会话,然后你可以随心所欲地用该用户的特权来运行任何程序,但是你需要知道目标用户的密码才能切换这个用户。而另一方面,sudo能在单个命令的基础上工作,允许你用root的特权来运行单个命令。用sudo你不必一定要知道root的密码,但是在提示输入sudo密码的时候要输入你的密码。 ### 在Sudoers列表里添加用户 ### -作为一个新用户的你如果试图运行sudo命令,你会碰到以下错误。意思是你不在这个包含经过认证可以使用sudo特权的这么一个用户组的sudoers列表里。 +作为一个新用户的你如果试图运行sudo命令,你会碰到以下错误。意思是你不在这个包含经过认证就可以使用sudo特权的这么一个用户组的sudoers列表里。 [my-user-id] is not in the sudoers file. This incident will be reported. @@ -32,11 +32,11 @@ su命令也提供了同样的特权升级功能,两者不同的是它们认证 alice adm cdrom sudo dip plugdev fuse lpadmin netdev sambashare davfs2 libvirtd docker promiscuous -组员资格变动(和sudo访问)会在你登出登录后生效。 +组员资格变动(和sudo访问)会在你登出后重新登录后生效。 ### 方法二 ### -第二个能让你使用sudo的方法是直接把你自己添加到路径为 /etc/sudoers 这个配置文件中去。 +第二个能让你使用sudo的方法是直接把你自己添加到 /etc/sudoers 这个配置文件中去。 要修改 /etc/sudoers 文件,你可以使用一个名为visudo的特殊sudo编辑器命令。用root身份简单调用以下命令。 @@ -55,6 +55,6 @@ su命令也提供了同样的特权升级功能,两者不同的是它们认证 via: http://ask.xmodulo.com/fix-is-not-in-the-sudoers-file.html 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/share/20150115 How To Run Linux Applications From The Terminal In Background Mode.md b/published/20150115 How To Run Linux Applications From The Terminal In Background Mode.md similarity index 100% rename from translated/share/20150115 How To Run Linux Applications From The Terminal In Background Mode.md rename to published/20150115 How To Run Linux Applications From The Terminal In Background Mode.md diff --git a/translated/tech/20150122 Linux FAQs with Answers--How to create and configure a MySQL user from the command line.md b/published/20150122 Linux FAQs with Answers--How to create and configure a MySQL user from the command line.md similarity index 81% rename from translated/tech/20150122 Linux FAQs with Answers--How to create and configure a MySQL user from the command line.md rename to published/20150122 Linux FAQs with Answers--How to create and configure a MySQL user from the command line.md index 9318d87821..0b393aa3b1 100644 --- a/translated/tech/20150122 Linux FAQs with Answers--How to create and configure a MySQL user from the command line.md +++ b/published/20150122 Linux FAQs with Answers--How to create and configure a MySQL user from the command line.md @@ -1,4 +1,4 @@ -Linux有问必答: 如何通过命令行创建和设置一个MySQL用户 +Linux有问必答:如何通过命令行创建和设置一个MySQL用户 ================================================================================ > **问题**:我想要在MySQL服务器上创建一个新的用户帐号,并且赋予他适当的权限和资源限制。如何通过命令行的方式来创建并且设置一个MySQL用户呢? @@ -21,7 +21,7 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户 mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; -一旦用户被创建后,包括加密的密码、权限和资源限制在内的所有帐号细节都会被存储在一个名为**user**的表中,这个表则存在与**mysql**这个特殊的数据库里。 +一旦用户被创建后,包括加密的密码、权限和资源限制在内的所有帐号细节都会被存储在一个名为**user**的表中,这个表则存在于**mysql**这个特殊的数据库里。 运行下列命令,验证帐号是否创建成功 @@ -33,14 +33,14 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户 - **ALL**: 所有可用的权限 - **CREATE**: 创建库、表和索引 -- **LOCK_TABLES**: 锁定表. -- **ALTER**: 修改表. -- **DELETE**: 删除表. -- **INSERT**: 插入表或列. -- **SELECT**: 选择表或列. -- **CREATE_VIEW**: 创建视图. -- **SHOW_DATABASES**: 展示数据库. -- **DROP**: 删除库、表和视图. +- **LOCK_TABLES**: 锁定表 +- **ALTER**: 修改表 +- **DELETE**: 删除表 +- **INSERT**: 插入表或列 +- **SELECT**: 检索表或列的数据 +- **CREATE_VIEW**: 创建视图 +- **SHOW_DATABASES**: 列出数据库 +- **DROP**: 删除库、表和视图 运行以下命令赋予"myuser"用户特定权限。 @@ -70,10 +70,10 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户 在MySQL中,你可以为单独的用户设置MySQL的资源使用限制。可用的资源限制如下: -- **MAX_QUERIES_PER_HOUR**: 允许的每小时最大请求数量. -- **MAX_UPDATES_PER_HOUR**: 允许的每小时最大更新数量. -- **MAX_CONNECTIONS_PER_HOUR**: 允许的每小时最大连接(译者注:[其与 MySQL全局变量: max_user_connections 共同决定用户到数据库的同时连接数量](http://dev.mysql.com/doc/refman/5.0/en/user-resources.html))数量. -- **MAX_USER_CONNECTIONS**: 对服务器的同时连接量. +- **MAX\_QUERIES\_PER\_HOUR**: 允许的每小时最大请求数量 +- **MAX\_UPDATES\_PER\_HOUR**: 允许的每小时最大更新数量 +- **MAX\_CONNECTIONS\_PER\_HOUR**: 允许的每小时最大连接(译者注:[其与 MySQL全局变量: max\_user\_connections 共同决定用户到数据库的同时连接数量](http://dev.mysql.com/doc/refman/5.0/en/user-resources.html))数量 +- **MAX\_USER\_CONNECTIONS**: 对服务器的同时连接量 使用以下命令为"myuser"帐号增加一个资源限制: @@ -102,6 +102,6 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户 via: http://ask.xmodulo.com/create-configure-mysql-user-command-line.html 译者:[Ping](http://weibo.com/370321376) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/translated/share/20140819 Top 4 Linux download managers.md b/published/201502/20140819 Top 4 Linux download managers.md similarity index 69% rename from translated/share/20140819 Top 4 Linux download managers.md rename to published/201502/20140819 Top 4 Linux download managers.md index 78c5b9ec12..5896665a80 100644 --- a/translated/share/20140819 Top 4 Linux download managers.md +++ b/published/201502/20140819 Top 4 Linux download managers.md @@ -1,17 +1,16 @@ -Translated By H-mudcup - -Linux排名前四的下载管理器 +Linux下的四大下载管理器 ================================================================================ -**改善并更好的管理你的网页下载,不论是镜像、抓取数据包还是仅仅更好的掌控你的文件。** +**改善你的网页下载,以便更好的管理文件镜像、批量下载还是仅仅希望更好的管理你的文件。** -下载管理器现在似乎已经是旧闻了,但是他们仍然非常有用。我们来比较一下Linux上排名前四的下载管理器。 +下载管理器现在似乎已经不新鲜了,但是他们仍然非常有用。我们来比较一下Linux上排名前四的下载管理器。 ### [uGet][1] ### -如同很多其他的Linux应用一样uGet把体积轻巧和功能全面作为宣传亮点。它能处理有着过滤器的多线程数据流,还能与任何网络浏览器进行整合。它从当初的UrlGet开始,如今已经经过了十年。它还能在Windows上运行。 +如同很多其他的Linux应用一样,uGet把体积轻巧和功能全面作为宣传亮点。它能处理多线程下载,支持过滤器,还能与任何网络浏览器进行整合。它从当初的UrlGet开始,如今已经经过了十年。它还能在Windows上运行。 ![uGet is actually very full-featured, with a lot of the kind of functions that advanced torrent clients use](http://www.linuxuser.co.uk/wp-content/uploads/2014/08/uget1.png) -uGet的功能其实非常全面,有很多先进的BT下载客户端所拥有的功能 + +*uGet的功能其实非常全面,有很多先进的BT下载客户端所拥有的功能* #### 界面 #### @@ -23,40 +22,41 @@ uGet让我们想起了许多BT下载客户端的界面:有着活跃、结束 #### 功能 #### -成熟的uGet完备了各种功能,包括按计划进行下载任务的启动和终止的高级功能,通过剪贴板批量下载,还能改变它在剪贴板里查找的文件的类型。虽然有插件选项,但不多。 +成熟的uGet完备了各种功能,包括按计划启动和终止下载任务的高级功能,通过剪贴板批量下载,还能改变它在剪贴板里查找的文件的类型。虽然有插件选项,但不多。 -#### 可得性 #### +#### 可获得性 #### -虽然在多数主要的发行版的软件库中都能得到它,但uGet网站上有着定期更新的适用于各种流行的发行版的二进制安装文件,还能轻易获得源代码。它的运行基于GTK 3+的图形库,所以它在某些桌面环境上的封装要比其他的小,然而我们得说,在KDE或其他Qt桌面上值得有这么一个额外的从属。 +虽然在多数主要的发行版的软件库中都能得到它,但uGet网站上有着定期更新的适用于各种流行的发行版的二进制安装文件,还能轻易获得源代码。它的运行基于GTK 3+的图形库,所以它在某些桌面环境上的封装要比其他的小,然而我们得说,在KDE或其他Qt桌面上值得为此添加额外的依赖库。 #### 总体评价 #### 8/10 -我们非常喜欢uGet——它种类繁多的功能和极高的人气,让它成为了能与Linux浏览器优雅结合的,万能的下载管理器。 +我们非常喜欢uGet——它种类繁多的功能和极高的人气,让它成为了能与Linux浏览器优雅结合的万能下载管理器。 ### [KGet][2] ### -KDE自家的下载管理器貌似原本是设计成与KDE的网页浏览器,Konqueror,一同工作的。它带来了我们这次测试中所期待的功能:多下载控制和对下载完成的文件计算校验和的能力。 +KDE自家的下载管理器貌似原本是设计成与KDE的网页浏览器 Konqueror 一同工作的。它带来了我们这次测试中所期待的功能:多下载控制和对下载完成的文件计算校验和的能力。 ![You need to manually activate the ability to keep an eye on the clipboard for links](http://www.linuxuser.co.uk/wp-content/uploads/2014/08/kget1.png) -你需要手动激活查看剪贴板中下载链接的功能 + +*你需要手动激活查看剪贴板中下载链接的功能* #### 界面 #### -作为一个备受期待的KDE应用软件,KGet用一贯的图标和线条,与桌面环境的审美风格完美融合。它的设计也相当简洁,在主工具栏里只显示最必要的功能,当前下载也以最小界面显示。 +作为一个备受期待的KDE应用软件,KGet采用一贯的图标和线条,与桌面环境的审美风格完美融合。它的设计也相当简洁,在主工具栏里只显示最必要的功能,当前下载也以最小界面显示。 #### 集成 #### -KGet会集成到本地的KDE的Konqueror浏览器里,虽然它并不是最流行的浏览器。Firefox对KGet的支持是一如往常的是通过FlashGot完成的,但是在Chromium里并没有任何一种方法能真正的将它集成进去。你可以打开一个询问你是否想下载已复制的URL的功能,然而KGet对于剪贴板的分析并不是很好,有的时候会把文本下载下来。 +KGet会集成到本地的KDE的Konqueror浏览器里,虽然它并不是最流行的浏览器。Firefox对KGet的支持是一如既往的是通过FlashGot完成的,但是在Chromium里并没有任何一种方法能真正的将它集成进去。你可以打开一个“询问你是否想下载已复制好的URL”的功能,然而KGet对于剪贴板的分析并不是很好,有的时候会把文本下载下来。 #### 功能 #### -能够选择的功能并不多。没有计划任务,没有批量下载,而且通常情况下,下载功能的数量几乎是光秃秃的。剪贴板扫描功能,想法很不错就是有点问题。设置菜单看起来有点怪怪的,因为它看起来应该设计有更多的功能。 +能够选择的功能并不多。没有计划任务,没有批量下载,基本上没有什么特色的下载功能。剪贴板扫描功能,想法很不错就是有点问题。设置菜单看起来有点怪怪的,因为它看起来应该设计有更多的功能。 -#### 可得性 #### +#### 可获得性 #### -虽然它不会随着KDE默认安装,但可以在任何支持KDE的发行版里得到它。虽然它的运行需要几个KDE库,找到它的源代码也很困难。支持如此少的发行版,二进制安装文件也没什么可选的。 +虽然它不会随着KDE默认安装,但可以在任何支持KDE的发行版里得到它。虽然它的运行需要几个KDE库,找到它的源代码也很困难。除了少数几个发行版之外也没有什么二进制安装文件。 #### 总体评价 #### @@ -66,14 +66,15 @@ KGet并没有真正的给予用户比大多数主流浏览器内置下载管理 ### [DownThemAll!][3] ### -经由Firefox的附件进入Linux的DownThemAll某种程度上可以说是跨平台。这让它只能通过Firefox使用,然而作为世界上最流行的浏览器之一,它这更加紧凑的集成也许正是某些人对下载管理器所期望的。 +经由Firefox的附属组件进入Linux的DownThemAll从某种程度上可以说是跨平台。这让它只能通过Firefox使用,然而作为世界上最流行的浏览器之一,它这更加紧凑的集成也许正是某些人对下载管理器所期望的。 ![There are actually a whole lot of options available for DownThemAll! that make it very flexible](http://www.linuxuser.co.uk/wp-content/uploads/2014/08/down1.png) -其实在DownThemALL!上有很多选项可以设置,这让它非常的灵活 + +*其实在DownThemALL!上有很多选项可以设置,这让它非常的灵活* #### 界面 #### -与Firefox的集成使得DownThemAll!的风格符合浏览器的审美标准,右键单击可以唤出普通下载和DownThemAll选项。额外的对话框菜单通常和Firefox使用相同的主题,然而主下载窗口则非常整洁并且是基于它本身的设计。 +与Firefox的集成使得DownThemAll!的风格符合浏览器的审美标准,右键单击可以唤出普通下载和DownThemAll选项。额外的对话框菜单通常和Firefox的主题风格一致,然而主下载窗口则非常整洁并采用了它自己的设计。 #### 集成 #### @@ -81,11 +82,11 @@ KGet并没有真正的给予用户比大多数主流浏览器内置下载管理 #### 功能 #### -拥有着能同时控制多个下载任务的能力,限制而不荒废带宽以及先进的自动或手动过滤功能,DownThemAll!有着一大堆有助于大规模下载的优秀功能。“一键”功能还让它能非常迅速的启动到预定的文件夹中的下载。这比普通下载功能快多了。 +拥有着能同时控制多个下载任务的能力,限制而不浪费带宽以及先进的自动或手动过滤功能,DownThemAll!有着一大堆有助于大规模下载的优秀功能。“一键”功能还让它能非常迅速的启动预定文件夹的下载。这比普通下载功能快多了。 -#### 可得性 #### +#### 可获得性 #### -Firefox几乎能在所有的发行版和Linux以外的操作系统中获得。这让DownThemAll!也和它一样多产。不幸的是,这是一把双刃剑,因为Firefox可能不是你喜欢的浏览器。它还给浏览器增加了一些负担,让它的启动不再那么轻松。 +Firefox几乎能在所有的发行版和Linux以外的操作系统中获得。这让DownThemAll!也和它一样多能。不幸的是,这是一把双刃剑,因为Firefox可能不是你喜欢的浏览器。它还给浏览器增加了一些负担,让它的启动不再那么轻松。 #### 总体评价 #### @@ -95,10 +96,11 @@ DownThemAll!是很优秀的,如果你使用Firefox你也许就不再需要用 ### [Steadyflow][4] ### -Steadyflow很容易在Ubuntu和一些基于Debian的发行版中获得,获取到它的方式可能受到了限制,但它在某些圈子里一直被认为是你能得到的任何发行版里最好的管理器。它能查找剪贴板里的URL,使用GNOME的预设代理,还有许多其他的功能。 +Steadyflow很容易在Ubuntu和一些基于Debian的发行版中获得,获取它的方式可能受到了一些制约,但它在某些圈子里一直被认为是你能得到的任何发行版里最好的管理器。它能查找剪贴板里的URL,使用GNOME的预设代理,还有许多其他的功能。 ![The settings in Steady flow are extremely limiting and somewhat difficult to access](http://www.linuxuser.co.uk/wp-content/uploads/2014/08/steady1.png) -Steady flow里的设置非常受限,而且有点难以使用。 + +*Steady flow里的设置非常少,而且有点难以使用。* #### 界面 #### @@ -112,7 +114,7 @@ Steadyflow的形象相当简洁,令人愉悦的、干净的界面并没有让 极度缺少功能,选项菜单也受到很大限制。暂停和恢复功能看起来也不怎么好使——这是任何浏览器文件下载功能的最基本的部分。文件下载结束的通知和默认行为是可以设置的,还可以选择在文件下载完成之后运行脚本。 -#### 可得性 #### +#### 可获得性 #### 只能在Ubuntu上获取,还不容易得到这个应用的源代码。这意味着虽然在所有基于Ubuntu的发行版中都能很容易的得到它,但也仅限于这些发行版。由于它不是Linux上能得到的最好的下载管理器,所以也不用想太多。 @@ -126,7 +128,7 @@ Steadyflow的形象相当简洁,令人愉悦的、干净的界面并没有让 #### uGet #### -在此次测试中,我们已经证明了现代电脑中还是有下载管理器的一席之地的,即便它们中的佼佼者们从BT下载客户端中抄袭了某些功能,貌似侵犯了他们的权益。对于某些人来说BT下载可能是个更有效率的方式,随着ISP们对待BT流量越来越机智,一些人可能用一个好的下载管理器就得到更好的效果。大多数主流ISP不仅仅强加了数据转移标记,在高峰时段他们中的一些甚至开始减慢或封掉BT流量——甚至连发行版的ISO文件和其他免费软件的合法数据流都被限制了。 +在此次测试中,我们已经证明了现代电脑中还是有下载管理器的一席之地的,即便它们中的佼佼者们从BT下载客户端中抄袭了某些功能,貌似侵犯了他们的权益。对于某些人来说BT下载可能是个更有效率的方式,随着ISP们对待BT流量越来越机智,一些人可能用一个好的下载管理器就得到更好的效果。大多数主流ISP不仅仅强加了数据传输限额,在高峰时段他们中的一些甚至开始减慢或封掉BT流量——甚至连发行版的ISO文件和其他免费软件的合法数据流都被限制了。 对于这类问题Steadyflow看起来是非常受欢迎的解决方式,但我们的使用和测试显示出,它是一个未完成的简陋的产品。更加古老的uGet则是这场表演的明星,有着惊人数量的可选功能,这些功能既能在下载单一文件中有所帮助,还能在整个网页里过滤出相关元素进行抓取。DownThemAll!与之类似,优秀的Firefox有加分,但它也离不开Firefox,有着几乎同级别的功能,但集成效果更好。 @@ -140,7 +142,7 @@ via: http://www.linuxuser.co.uk/reviews/top-4-linux-download-managers 作者:Rob Zwetsloot 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/share/20140821 What is a good EPUB reader on Linux.md b/published/201502/20140821 What is a good EPUB reader on Linux.md similarity index 65% rename from translated/share/20140821 What is a good EPUB reader on Linux.md rename to published/201502/20140821 What is a good EPUB reader on Linux.md index 2b919ee6bb..7c3c4ea287 100644 --- a/translated/share/20140821 What is a good EPUB reader on Linux.md +++ b/published/201502/20140821 What is a good EPUB reader on Linux.md @@ -1,25 +1,25 @@ Linux版EPUB阅读器 ================================================================================ -如果说用平板电脑看书尚属主流的话,那么在电脑上读书就非常少见了。专注阅读16世纪的书是非常困难的了,没人希望后台蹦出Facebook聊天窗口。但是如果你非要在电脑上打开电子书的话,那么你需要一个电子书阅读软件。大多数编辑支持使用EPUB格式来存放电子书(电子出版物)。幸运的书,linux上从不缺乏此类软件。以下书一些Linux上比较好的EPUB阅读软件。 +如果说用平板电脑看书尚属主流的话,那么在电脑上读书就非常少见了。专注阅读16世纪的书是非常困难的了,没人希望后台蹦出QQ聊天窗口。但是如果你非要在电脑上打开电子书的话,那么你需要一个电子书阅读软件。大多数出版物支持使用EPUB格式的电子书(电子出版物)。幸运的是,linux上从不缺乏EPUB阅读器类的软件。以下是一些Linux上不错的EPUB阅读软件。 ### 1. Calibre ### ![](https://farm6.staticflickr.com/5577/14975176155_0989766bb3_z.jpg) -先从列表中最有名的软件开始: [Calibre][1]。Calibre 不仅仅是个阅读器,他还是个电子图书馆。软件支持几乎所有的格式,集成了阅读器,管理器,一个可以从互联网下载书籍封面的元数据编辑器,一个EPUB编辑器,新闻阅读器和一个用来下载电子书的搜索引擎。可喜的是,界面丝毫不逊色专业的阅读软件。唯一的缺点书如果你只想要一个EPUB阅读器的话,这个软件还是太大了。 +先从列表中最有名的软件开始: [Calibre][1]。Calibre 不仅仅是个阅读器,它还是个电子图书馆。软件支持几乎所有的格式,集成了阅读器、管理器、一个可以从互联网下载书籍封面的元数据编辑器、一个EPUB编辑器、新闻阅读器和一个用来下载电子书的搜索引擎。可喜的是,界面丝毫不逊色专业的阅读软件。唯一的缺点是如果你只想要一个EPUB阅读器的话,这个软件还是太大了。 ### 2. FBReader ### ![](https://farm4.staticflickr.com/3900/14975176165_f2e4afd2fa_o.jpg) -[FBReader][2] 也是一个图书馆管理软件,但是比Calibre小。界面简洁分为两个部分:左边书文件管理、元数据编辑、和下载新书等功能;右边书阅读区。如果你喜欢简洁,这个软件挺不错。我个人非常喜欢这类直观标记书籍和分类的做法。 +[FBReader][2] 也是一个图书馆管理软件,但是比Calibre小。界面简洁分为两个部分:左边是文件管理、元数据编辑和下载新书等功能;右边是阅读区。如果你喜欢简洁,这个软件挺不错。我个人非常喜欢这类直观标记书籍和分类的做法。 ### 3. Cool Reader ### ![](https://farm6.staticflickr.com/5594/14975176195_ac46952150.jpg) -对于那些只想想看EPUB书内容的用户,我推荐 [Cool Reader][5]。遵循Linux应用程序的规则,Cool Reader 做了优化,每次只打开一个EPUB文件,可以使用简单的快捷键进行阅读和导航。由于程序书基于Qt开发的,所以他也遵循Qt的规则,需要大量的设置项。 +对于那些只想想看EPUB书内容的用户,我推荐 [Cool Reader][5]。遵循Linux应用程序的文化,Cool Reader 做了优化,每次只打开一个EPUB文件,可以使用简单的快捷键进行阅读和导航。由于程序书基于Qt开发的,所以他也遵循Qt的风格,需要大量的设置项。 ### 4. Okular ### @@ -31,19 +31,19 @@ Linux版EPUB阅读器 ![](https://farm4.staticflickr.com/3835/14788504789_e7c742fa20_z.jpg) -[pPub][4]是个老项目,Github上可以找到这个项目,他最后的更新已经是在两年前了。尽管如此,这个软件还是值得使用的,pPub是用Python编写的,基于GTK3和WebKit,是个简单轻量的软件。界面可能需要一些更新,不够简洁,但是内部却非常好。软件支持JavaScript。所以,谁来捡起这个项目呢? +[pPub][4]是个老项目,Github上可以找到这个项目,它最后的更新已经是在两年前了。尽管如此,这个软件还是值得使用的,pPub是用Python编写的,基于GTK3和WebKit,是个简单轻量的软件。界面可能需要一些更新,不够简洁,但是内部却非常好。软件支持JavaScript。所以,谁来捡起这个项目呢? ### 6. epub ### ![](https://farm4.staticflickr.com/3871/14788844378_16fb51a1b9_z.jpg) -如果你只是想快速简单的查看EPUB文件的内容,不关心任何图形化界面功能的话,最好使用命令行模式打开EPUB。[epub][6] 是一个用Python编写的阅读器,可以在终端环境读取EPUB文件的内容。软件可以在章节、页面见切换,没有其他的功能。这是最简洁的EPUB阅读器了。 +如果你只是想快速简单的查看EPUB文件的内容,不关心任何图形化界面功能的话,最好使用命令行模式打开EPUB。[epub][6] 是一个用Python编写的阅读器,可以在终端环境读取EPUB文件的内容。软件可以在章节、页面间切换,没有其他的功能。这是最简洁的EPUB阅读器了。 ### 7. Sigil ### ![](https://farm4.staticflickr.com/3921/14788640417_7940627871_z.jpg) -最后介绍的这个实际上不是个EPUB阅读器,应该是个独立的编辑器。[Sigil][7] 可以提取EPUB文件的内容并转换成其他格式:xhtml文本,图像,格式,还有其他的内容,比如音频等。界面比基本的阅读器复杂,但是功能还是比较丰富的。我很喜欢他的标签体系,如果你对网页比较熟悉的话,这个软件书很好使用的。 +最后介绍的这个实际上不是个EPUB阅读器,应该是个独立的编辑器。[Sigil][7] 可以提取EPUB文件的内容并将其分离成其他格式:xhtml文本、图像、css,及其他的内容比如音频等。界面比基本的阅读器复杂,但是功能还是比较丰富的。我很喜它的标签体系,如果你对网页比较熟悉的话,这个软件是很好使用的。 总结,有很多的开源的EPUB阅读器,有一些只有最基本的功能, 另外一些功能却太多了。一般来说,我建议你选择一个最合适的使用。如果你有更好的EPUB阅读器,请在评论里告诉我们! @@ -53,7 +53,7 @@ via: http://xmodulo.com/2014/08/good-epub-reader-linux.html 作者:[Adrien Brochard][a] 译者:[shipsw](https://github.com/shipsw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md b/published/201502/20140917 How to create a software RAID-1 array with mdadm on Linux.md similarity index 83% rename from translated/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md rename to published/201502/20140917 How to create a software RAID-1 array with mdadm on Linux.md index ddbdfc8689..4c183956d3 100644 --- a/translated/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md +++ b/published/201502/20140917 How to create a software RAID-1 array with mdadm on Linux.md @@ -1,10 +1,10 @@ 如何使用linux程序mdadm创建软件RAID1软阵列 ================================================================================ -磁盘冗余阵列(RAID)是将多个物理磁盘结合成一个逻辑磁盘的技术,该技术可以提高磁盘容错性能,提高磁盘的读写速度。根据数据存储的排列(如 条带存储,镜像存储,奇偶或者他们的组合),定义了几个不同级别的RAID(RAID-0,RAID-1,RAID-5 等等)。磁盘阵列可以使用软件或者硬件方式实现。现代Linux操作系统中,基本的软件RAID功能是默认安装的。 +磁盘冗余阵列(RAID)是将多个物理磁盘结合成一个逻辑磁盘的技术,该技术可以提高磁盘容错性能,提高磁盘的读写速度。根据数据存储的排列(如:条带存储,镜像存储,奇偶或者他们的组合),定义了几个不同级别的RAID(RAID-0,RAID-1,RAID-5 等等)。磁盘阵列可以使用软件或者硬件方式实现。现代Linux操作系统中,基本的软件RAID功能是默认安装的。 本文中,我们将介绍软件方式构建RAID-1阵列(镜像阵列),RAID-1将相同的数据写到不同的设备中。虽然可以使用同一个磁盘的两个分区实现RAID-1,但是如果磁盘坏了的话数据就都丢了,所以没什么意义。实际上,这也是为什么大多数RAID级别都使用多个物理磁盘提供冗余。当单盘失效后不影响整个阵列的运行,并且可以在线更换磁盘,最重要的是数据不会丢失。尽管如此,阵列不能取代外部存储的定期备份。 -由于RAID-1阵列的大小是最小磁盘的大小,一般来说应该使用两个大小相同的磁盘来组建RAID-1。 +由于RAID-1阵列的大小是阵列中最小磁盘的大小,一般来说应该使用两个大小相同的磁盘来组建RAID-1。 ### 安装mdadm ### @@ -28,7 +28,7 @@ # aptitude install mdadm -Ubuntu系统中,会要求为电子邮件通知配置后缀MTA。你可以跳过去。 +Ubuntu系统中,会要求配置Postfix MTA 以发送电子邮件通知。你可以跳过去。 Debian系统中,安装程序会显示以下解释信息,用来帮助我们去判断是否将根目录安装到RAID阵列中。下面的所有操作都有赖于这一步,所以应该仔细阅读他。 @@ -38,13 +38,13 @@ Debian系统中,安装程序会显示以下解释信息,用来帮助我们 ![](https://farm6.staticflickr.com/5555/15198241896_29e08b977f.jpg) -提示是否开机启动阵列的时候,选择是。注意,这里需要往/etc/fstab 文件中添加一个条目使得系统启动的时候正确挂载阵列。 +提示是否开机启动阵列的时候,选择“是”。注意,这里需要往/etc/fstab 文件中添加一个条目使得系统启动的时候正确挂载阵列。 ![](https://farm4.staticflickr.com/3875/15220883342_2b1d689a0a_z.jpg) ### 硬盘分区 ### -现在开始准备建立阵列需要的硬盘。这里往插入两个8GB的usb磁盘,使用dmesg命令设备显示设备 /dev/sdb 和 /dev/sdc +现在开始准备建立阵列需要的硬盘。这里插入两个8GB的usb磁盘,使用dmesg命令设备显示设备 /dev/sdb 和 /dev/sdc # dmesg | less @@ -107,7 +107,7 @@ Debian系统中,安装程序会显示以下解释信息,用来帮助我们 ![](https://farm6.staticflickr.com/5583/15034683868_6c28564e5a_z.jpg) -'mdadm -D'命令提供的信息中,最重要就是阵列状态类。激活状态说明阵列正在进行读写操作。其他几个状态分别为 完成(读写完成)、降级(有一块磁盘失效或丢失)或者恢复中(一张新盘已插入,系统正在写入数据)。这几个状态涵盖类大多数情况。 +'mdadm -D'命令提供的信息中,最重要就是阵列状态类。激活状态说明阵列正在进行读写操作。其他几个状态分别为:完成(读写完成)、降级(有一块磁盘失效或丢失)或者恢复中(一张新盘已插入,系统正在写入数据)。这几个状态涵盖了大多数情况。 ### 格式化或加载磁盘阵列 ### @@ -128,7 +128,7 @@ Debian系统中,安装程序会显示以下解释信息,用来帮助我们 mdadm工具内置有磁盘阵列监控功能。当mdadm作为守护程序运行的时候(就像我们上文那样),会周期性的检测阵列运行状态,将检测到的信息通过电子邮件或者系统日志报告上来。当然,也可以配置其在发生致命性错误的时候调用紧急命令。 -mdadm默认会记录所有已知分区和阵列的事件,并将他们记录到 /var/log/syslog中。或者你可以在配置文件中(/etc/mdadm/mdadm.conf debian系统 /etc/mdadm.conf 红帽子系统)以以下格式指定监控设备或者阵列。如果mdadm.conf文件不存在,你可以创建一个。 +mdadm默认会记录所有已知分区和阵列的事件,并将他们记录到 /var/log/syslog中。或者你可以在配置文件中(debian系统:/etc/mdadm/mdadm.conf ,红帽子系统:/etc/mdadm.conf )用以下格式指定监控设备或者阵列。如果mdadm.conf文件不存在,你可以创建一个。 DEVICE /dev/sd[bcde]1 /dev/sd[ab]1 @@ -169,7 +169,7 @@ CentOS或者RHEL 6: ![](https://farm6.staticflickr.com/5563/15218183681_63a10da704_z.jpg) -现在我们的阵列已经可以访问类,拷贝文件/etc/passwd到/mnt中测试一下: +现在我们的阵列已经可以访问了,拷贝文件/etc/passwd到/mnt中测试一下: ![](https://farm6.staticflickr.com/5593/15034475219_a3476aec0a_o.png) @@ -179,7 +179,7 @@ Debian系统中,需要在/etc/default/mdadm 设置 AUTOSTART 变量为 true ### 模拟磁盘丢失故障 ### -我们将使用以下命令卸载磁盘来模拟磁盘故障。注意,在实际应用中,磁盘已经上故障状态了,不需要卸载。 +我们将使用以下命令卸载磁盘来模拟磁盘故障。注意,在实际应用中,磁盘如果已经是故障状态了,不需要卸载。 首先,卸载阵列: @@ -190,7 +190,7 @@ Debian系统中,需要在/etc/default/mdadm 设置 AUTOSTART 变量为 true # mdadm /dev/md0 --fail /dev/sdb1 #Marks /dev/sdb1 as faulty # mdadm --remove /dev/md0 /dev/sdb1 #Removes /dev/sdb1 from the array -然后,如果你有个备用盘的话,重新添加以下: +然后,如果你有个备用盘的话,重新添加一下: # mdadm /dev/md0 --add /dev/sdb1 @@ -208,7 +208,7 @@ Debian系统中,需要在/etc/default/mdadm 设置 AUTOSTART 变量为 true # mdadm /dev/md0 --add /dev/sdb1 # mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 -希望本文对你有所帮助 +希望本文对你有所帮助。 -------------------------------------------------------------------------------- @@ -216,7 +216,7 @@ via: http://xmodulo.com/2014/09/create-software-raid1-array-mdadm-linux.html 作者:[Gabriel Cánepa][a] 译者:[shipsw](https://github.com/shipsw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141029 How to Install and Setup My Weather Indicator in Ubuntu 14.10.md b/published/201502/20141029 How to Install and Setup My Weather Indicator in Ubuntu 14.10.md similarity index 83% rename from translated/tech/20141029 How to Install and Setup My Weather Indicator in Ubuntu 14.10.md rename to published/201502/20141029 How to Install and Setup My Weather Indicator in Ubuntu 14.10.md index 37c497511c..15c6896b3e 100644 --- a/translated/tech/20141029 How to Install and Setup My Weather Indicator in Ubuntu 14.10.md +++ b/published/201502/20141029 How to Install and Setup My Weather Indicator in Ubuntu 14.10.md @@ -1,10 +1,10 @@ -在Ubuntu 14.10中如何安装和配置‘My Weather Indicator’ +在Ubuntu 14.10中如何安装和配置‘天气信息指示器’ ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/my-weather-indicator.jpg) -**在Ubuntu桌面中不缺乏若干应用同时提供天气信息的方法,你可以使用Unity Dash和桌面应用,比如[Typhoon][1],来获得天气信息。** +**在Ubuntu桌面中有各种提供天气信息的方法,你可以使用Unity Dash和桌面应用来获得天气信息,比如[Typhoon][1]。** -但是可以提供快速查询天气状况和温度数据,并且只需要一次鼠标点击而获得大量气象数据的面板插件,是到目前为止Linux平台下最受欢迎的天气应用。 +但是可以提供快速查询天气状况和温度数据,并且只需要一次鼠标点击而获得大量气象数据的面板插件,才是到目前为止Linux平台下最受欢迎的天气应用。 Atareao开发的[My Weather Indicator][2]就是这类应用中的一个,也可以说是最好的一个。 @@ -18,7 +18,7 @@ My Weather Indicator无法从Ubuntu软件商店中直接获取。不过开发者 - 下载My Weather Indicator (.deb安装包) -为了确保你的应用最是最新版本,我建议将[Atareao PPA][3]添加到你的软件镜像源然后通过PPA来安装。 +为了确保你的应用是最新版本,我建议将[Atareao PPA][3]添加到你的软件镜像源,然后通过PPA来安装。 怎么做?**打开一个新的终端**窗口(Unity Dash > 终端,或者按Ctrl+Alt+T快捷键),然后**输入下面的两行命令**,期间你需要在提示处输入你的系统密码: @@ -36,7 +36,7 @@ My Weather Indicator无法从Ubuntu软件商店中直接获取。不过开发者 ![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/Screen-Shot-2014-10-27-at-17.39.07.jpeg) -如果你正在旅行(或者是出于聊天需要),**你可以添加一个第二地区**。这个设置和第一地区的设置相同,只不过是在“第二地区”的标签栏罢了。 +如果你正在旅行(或者是出于聊天的需要),**你可以添加一个第二地区**。这个设置和第一地区的设置相同,只不过是出现在“第二地区”的标签栏罢了。 在“**小部件设置**”区域勾选“**显示桌面小部件**”选项就会在你的桌面上添加一个小的天气小部件。小部件提供许多不同的皮肤,所以你一定要精心挑选你最喜欢的一个(注释:点击“确定”后对小部件的更改才会保存)。 @@ -55,7 +55,7 @@ My Weather Indicator使用[Open Weather Map][4]作为默认的天气数据提供 最后,在‘General Options‘标签页,你可以设置数据更新间隔、设置开机自动运行选项以及从两个图标中选择一个作为面板图标。 -如果你不喜欢该应用,你可以尝试[Linux下查看天气数据的方法][5]。 +如果你是命令行控,你也可以尝试[Linux下查看天气数据的方法][5]。 -------------------------------------------------------------------------------- @@ -63,7 +63,7 @@ via: http://www.omgubuntu.co.uk/2014/10/install-weather-indicator-ubuntu-14-10 作者:[Joey-Elijah Sneddon][a] 译者:[JonathanKang](https://github.com/JonathanKang) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141030 Test drive Linux with nothing but a flash drive.md b/published/201502/20141030 Test drive Linux with nothing but a flash drive.md similarity index 83% rename from translated/tech/20141030 Test drive Linux with nothing but a flash drive.md rename to published/201502/20141030 Test drive Linux with nothing but a flash drive.md index 9c1c8684d6..602c99eb18 100644 --- a/translated/tech/20141030 Test drive Linux with nothing but a flash drive.md +++ b/published/201502/20141030 Test drive Linux with nothing but a flash drive.md @@ -1,7 +1,5 @@ 试试只用U盘加载Linux系统 ================================================================================ -![Penguins gathered together: Linux for the win](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png) -图片来源:Opensource.com 也许你听过Linux并对它有点好奇,终于想要实际体验一下,但可能不知道从哪儿开始。 @@ -9,25 +7,27 @@ 如果你手上正好有个U盘的话,那就可以试试做一个USB Linux启动盘。它是一个包含了整个操作系统并可以直接引导开机的U盘。创建它并不需要什么专业技术能力,让我们来看看怎么做,以及如何从USB引导进入Linux系统。 +![Penguins gathered together: Linux for the win](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png) + ### 你需要准备的 ### 除了一台台式机或笔记本电脑外,你还需要: - 一个空白的U盘-最好容量能有4GB或更多。 - 一个你想尝试的Linux发行版[ISO镜像][1](一种把所有磁盘内容打包起来的档案文件)。待会再详细介绍。 -- 一个叫[Unetbootin][2]的应用程序,它是一个开源的,跨平台的工具,用来创建USB启动盘。运行它并不需要启动Linux。在下面的教程中,我是在MacBook上运行的Unetbootiin。 +- 一个叫[Unetbootin][2]的应用程序,它是一个开源的,跨平台的工具,用来创建USB启动盘。运行它并不需要启动Linux。在下面的教程中,我是在MacBook上运行的Unetbootiin(LCTT 译注:它还有 Windows 和 Linux 版本)。 ### 开始干活 ### -把U盘插到你电脑的USB端口上,然后启动Unetbootin。然后会要求你输入电脑的登录密码。 +把U盘插到你电脑的USB端口上,然后启动Unetbootin。然后会要求你输入当前电脑的登录密码。 ![Unetbootin main window](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-main.png) -还记得之前提到的ISO镜像文件吗?有两种方式可以获得:要么自己从你想尝试的Linux发行版网站上下载,或者让Unetbootin帮你下载。还是选后者,在窗口顶部点击**选择发行版**,选择你想下载的发行版,然后点击**选择版本**来选择你希望尝试的发行版版本。 +还记得之前提到的ISO镜像文件吗?有两种方式可以获得:要么自己从你想尝试的Linux发行版网站上下载,或者让Unetbootin帮你下载。如果选后者,在窗口顶部点击**选择发行版**,选择你想下载的发行版,然后点击**选择版本**来选择你希望尝试的发行版版本。 ![Downloading a Linux distribution](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-download-distro.png) -或者,你也可以自己下载发行版。通常,我想尝试的Linux发行版都没有在列表中。如果选择另一个方向,点击**磁盘镜像**,然后点击按钮来选择你下载好的.iso文件。 +或者,你也可以自己下载发行版。通常,我想尝试的Linux发行版都没有在列表中。如果选择自己下载,那么点击**磁盘镜像**,然后点击按钮来选择你下载好的.iso文件。 注意到下面的选项**预留每次重新启动后保存文件的空间(仅Ubuntu有效)**吗?如果你尝试的是Ubuntu或它的任一个衍生版(比如Lubuntu或Xubuntu),你可以在U盘上留出几M空间用来保存文件,比如网页书签或你自己创建的文档。当用这个U盘下次启动Ubuntu的时候,你可以继续使用这些文件。 @@ -39,21 +39,21 @@ ### 检验USB启动盘 ### -这个时候,你需要拥抱一下自己内在的极客精神。不会太难,不过你将需要进入[BIOS][3]去偷看一下你电脑内部空间。你的电脑的BIOS会加载各种硬件,并控制电脑操作系统的引导或启动。 +这个时候,你需要拥抱一下自己内在的极客精神。这不会太难,不过你将需要进入[BIOS][3]去偷看一下你的电脑内部空间。你的电脑的BIOS会加载各种硬件,并控制电脑操作系统的引导或启动。 -BIOS通常会按这个顺序搜索操作系统(或者类似的顺序):硬盘,然后是CD/DVD光驱,然后是外部存储设备。你需要调整这个顺序,让外部存储设备(在这里,意味着你的U盘启动盘)成为BIOS第一个搜索的设备。 +BIOS通常会按这个顺序搜索操作系统(或者类似的顺序):硬盘,然后是CD/DVD光驱,然后是外部存储设备。你需要调整这个顺序,让外部存储设备(在这里,指的是你的U盘启动盘)成为BIOS第一个搜索的设备。 -要做到这个,把U盘插到电脑上再重启电脑。在看到提示信息**Press F2 to enter setup**之后,按它要求的做。在有的电脑上,这个键可能是F10。 +要做到这一点,请把U盘插到电脑上再重启电脑。在看到提示信息**Press F2 to enter setup**之后,按它要求的做。在有的电脑上,这个键可能是F10。 在BIOS里,用键盘上的向右方向键切换到**Boot**菜单。然后你将看到你电脑上的驱动器列表。使用键盘上的向下方向键选中名字为**USB HDD**的选项,然后按下**F6**移动这个选项到列表的顶部。 -完成后,按下**F10**来保存改动。然后你会从BIOS里被踢出来,然后电脑会自己启动。等一小会,你就会看到一个你正在尝试的Linux发行版的启动菜单。选择**Run without installing**(或者最接近的选项)。 +完成后,按下**F10**来保存改动。然后你会从BIOS里被踢出来,然后电脑会自己启动。等一小会,你就会看到一个你正在尝试的Linux发行版的启动菜单。选择**Run without installing**(或者最类似的选项)。 在进入桌面后,你可以连接上无线或有线网络,看看网页,试一试预装的软件。你还可以看看,比如说,你的打印机或扫描仪是否能在你试的这个发行版下正常工作。你要是真的想不开,也可以去摸一下命令行。 ### 能干什么 ### -根据你尝试的Linux发行版和你使用的U盘的速度,操作系统可能会需要更长的时间来加载,而且很可能比直接装到硬盘上会慢一点。 +根据你尝试的Linux发行版和你使用的U盘的速度,操作系统可能会需要较长的时间来加载,而且很可能比直接装到硬盘上会慢一点。 还有,你也只能运行Linux发行版里预装好的基本软件。通常会有网页浏览器,一个文字处理软件,一个文本编辑器,一个媒体播放器,一个相片浏览器,以及一套实用工具。这些应该足够给你使用Linux的感觉了。 @@ -65,7 +65,7 @@ via: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive 作者:[Scott Nesbitt][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141108 Adding Ubuntu 14.10, Ubuntu 14.04 and Debian 7 to PXE Network Boot Environment Setup on RHEL or CentOS 7.md b/published/201502/20141108 Adding Ubuntu 14.10, Ubuntu 14.04 and Debian 7 to PXE Network Boot Environment Setup on RHEL or CentOS 7.md similarity index 91% rename from translated/tech/20141108 Adding Ubuntu 14.10, Ubuntu 14.04 and Debian 7 to PXE Network Boot Environment Setup on RHEL or CentOS 7.md rename to published/201502/20141108 Adding Ubuntu 14.10, Ubuntu 14.04 and Debian 7 to PXE Network Boot Environment Setup on RHEL or CentOS 7.md index 35936459d3..e131acbbc7 100644 --- a/translated/tech/20141108 Adding Ubuntu 14.10, Ubuntu 14.04 and Debian 7 to PXE Network Boot Environment Setup on RHEL or CentOS 7.md +++ b/published/201502/20141108 Adding Ubuntu 14.10, Ubuntu 14.04 and Debian 7 to PXE Network Boot Environment Setup on RHEL or CentOS 7.md @@ -1,24 +1,26 @@ 添加Ubuntu 14.10,Ubuntu 14.04和Debian 7到RHEL/CentOS 7的PXE网络启动环境 ================================================================================ 本教程将指引你添加**Ubuntu 14.10 Server, Ubuntu 14.04 Server**和**Debian 7 Wheezy**发行版到**RHEL/CentOS 7**的PXE网络启动环境中。 + ![Add Ubuntu and Debian to PXE Network](http://www.tecmint.com/wp-content/uploads/2014/11/Add-Ubuntu-and-Debian-to-PXE.png) -添加Ubuntu和Debian到PXE网络 + +*添加Ubuntu和Debian到PXE网络* 虽然对于本教程,我只会演示怎样来添加**64位**网络安装镜像,但对于Ubuntu或者Debian的**32位**系统,或者其它架构的镜像,操作步骤也基本相同。同时,就我而言,我会解释添加Ubuntu 32位源的方法,但不会演示配置。 从PXE服务器安装 **Ubuntu**或者**Debian**要求你的客户机必须激活网络连接,最好是使用**DHCP**通过**NAT**来进行动态分配地址。以便安装器拉取所需的包并完成安装过程。 -#### 需求 #### +#### 前置阅读 #### - [在RHEL/CentOS 7中为多种Linux发行版安装PXE网络启动服务器][1] ## 步骤 1: 添加Ubuntu 14.10和Ubuntu 14.04服务器到PXE菜单 ## -**1.** 为**Ubuntu 14.10**和**Ubuntu 14.04**添加网络安装源到PXE菜单可以通过两种方式实现:其一是通过下载Ubuntu CD ISO镜像并挂载到PXE服务器机器上以便可以读取Ubuntu网络启动文件,其二是通过直接下载Ubuntu网络启动归档包并将其解压缩到系统中。下面,我将进一步讨论这两种方法: +**1.** 要将**Ubuntu 14.10**和**Ubuntu 14.04**添加网络安装源到PXE菜单可以通过两种方式实现:其一是通过下载Ubuntu CD ISO镜像并挂载到PXE服务器机器上,以便可以读取Ubuntu网络启动文件,其二是通过直接下载Ubuntu网络启动归档包并将其解压缩到系统中。下面,我将进一步讨论这两种方法: ### 使用Ubuntu 14.10和Ubuntu 14.04 CD ISO镜像 ### -为了能使用此方法,你的PXE服务器需要有一台可工作的CD/DVD驱动器。在一台专有计算机上,转到[Ubuntu 14.10下载][2]和[Ubuntu 14.04 下载][3]页,获取64位**服务器安装镜像**,将它烧录到CD,并将CD镜像放到PXE服务器DVD/CD驱动器,然后使用以下命令挂载到系统。 +为了能使用此方法,你的PXE服务器需要有一台可工作的CD/DVD驱动器(LCTT 译注:也可以不用,参考下面内容)。在一台专用的计算机上,转到[Ubuntu 14.10下载][2]和[Ubuntu 14.04 下载][3]页,获取64位**服务器安装镜像**,将它烧录到CD,并将CD镜像放到PXE服务器DVD/CD驱动器,然后使用以下命令挂载到系统。 # mount /dev/cdrom /mnt @@ -160,16 +162,20 @@ 下面是**Ubuntu 14.04**PXE客户端安装测试的截图。 ![Select Ubuntu from PXE Menu](http://www.tecmint.com/wp-content/uploads/2014/11/Select-Ubuntu-from-PXE-Menu.jpg) -从PXE菜单选择Ubuntu + +*从PXE菜单选择Ubuntu* ![Choose Ubuntu Installation Language](http://www.tecmint.com/wp-content/uploads/2014/11/Select-Ubuntu-Installation-Language.jpg) -选择Ubuntu安装语言 + +*选择Ubuntu安装语言* ![Choose Ubuntu Rescue Mode](http://www.tecmint.com/wp-content/uploads/2014/11/Select-Ubuntu-Rescue-Mode.jpg) -选择Ubuntu救援模式 + +*选择Ubuntu救援模式* ![Ubuntu Rescue Mode Shell](http://www.tecmint.com/wp-content/uploads/2014/11/Ubuntu-Rescue-Mode-Shell.jpg) -Ubuntu救援模式Shell + +*Ubuntu救援模式Shell* ## 步骤 2: 添加Debian 7 Wheezy到PXE菜单 ## @@ -184,7 +190,8 @@ Ubuntu救援模式Shell # wget http://ftp.nl.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/netboot.tar.gz ![Download Debain 7 Netboot](http://www.tecmint.com/wp-content/uploads/2014/11/Download-Debain-7-Netboot.jpg) -下载Debian 7网络启动包 + +*下载Debian 7网络启动包* **6.** 在**wget**下载完成**netboot.tar.gz**文件后,请将其解压缩并运行以下命令拷贝**debian-installer**目录到tftp服务器默认路径。 @@ -192,10 +199,12 @@ Ubuntu救援模式Shell # cp -rf debian-installer/ /var/lib/tftpboot/ ![Extract Debain 7 Netboot](http://www.tecmint.com/wp-content/uploads/2014/11/Extract-Debain-7-Netboot.jpg) -解压缩Debian 7网络启动包 + +*解压缩Debian 7网络启动包* ![Copy Debain 7 Netboot to FTP](http://www.tecmint.com/wp-content/uploads/2014/11/Copy-Debain-7-Netboot-to-FTP.jpg) -拷贝Debian 7网络启动文件到FTP + +*拷贝Debian 7网络启动文件到FTP* **7.** 要添加**Debian Wheezy**标签到**PXE菜单**,请用你最喜爱的文本编辑器打开PXE服务器默认配置文件并添加以下标签。 @@ -214,7 +223,8 @@ Debian Wheezy 64位的PXE标签菜单。 append auto=true priority=critical vga=788 initrd=debian-installer/amd64/initrd.gz -- quiet ![Add Debian to PXE Boot](http://www.tecmint.com/wp-content/uploads/2014/11/Add-Debian-to-PXE-Boot.jpg) -添加Debian到PXE启动 + +*添加Debian到PXE启动* **注**:如果你想要添加其它Debian架构,请重复上述步骤,并相应替换PXE默认菜单配置文件中的标签号和**debian-installer/$architecture_name/**目录。 @@ -225,10 +235,12 @@ Debian Wheezy 64位的PXE标签菜单。 **9.** 然后通过网络启动一台客户机,选择从PXE菜单安装Debian,并像正常安装一样进一步下去。 ![Select Install Debian from PXE](http://www.tecmint.com/wp-content/uploads/2014/11/Select-Install-Debian-from-PXE.jpg) -选择从PXE安装Debian + +*选择从PXE安装Debian* ![Select Debian Install Language](http://www.tecmint.com/wp-content/uploads/2014/11/Select-Debian-Install-Language.jpg) -选择Debian安装语言 + +*选择Debian安装语言* 以上是要求添加并从RHEL/CentOS 7 PXE服务器安装**Ubuntu**或**Debian**到客户机上的全部步骤。在我的下一篇文章中,我将讨论一种更为复杂的方法,如何使用RHEL/CentOS 7 PXE网络启动服务器来安装**Windows 7**到客户机。 @@ -243,7 +255,7 @@ via: http://www.tecmint.com/add-ubuntu-to-pxe-network-boot/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/cezarmatei/ -[1]:http://www.tecmint.com/install-pxe-network-boot-server-in-centos-7/ +[1]:http://linux.cn/article-4902-1.html [2]:http://releases.ubuntu.com/14.10/ [3]:http://releases.ubuntu.com/14.04/ [4]:http://cdimage.ubuntu.com/netboot/14.10/ diff --git a/translated/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md b/published/201502/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md similarity index 63% rename from translated/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md rename to published/201502/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md index 6f1e2b5b56..ab8046d43e 100644 --- a/translated/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md +++ b/published/201502/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md @@ -1,36 +1,36 @@ - 怎样通过 Twitter 的开源库来随处使用 Emoji 表情符号 +怎样通过 Twitter 的开源库来随处使用 Emoji 表情符号 ================================================================================ > 通过 GitHub 将它们嵌入到网页和其他项目中。 ![](http://a3.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2OTIyNTI3MjcxNTU1.png) -Emoji, 来自日本的小巧符号,通过图像表达感情,已经征服了手机文字信息的世界。 +Emoji, 来自日本的小巧符号,通过图像表达感情,已经征服了移动互联网的信息世界。 现在,你可以在虚拟世界中随处使用它们了。 Twitter 最近[开源了][1]他们的 emoji 符号库,使得你可以在你自己的网站,应用,和项目中使用它们。 -但这需要一点体力活。 Unicode 已经识别甚至标准化了 emoji 字母表, 然而 emoji 仍然[不能完全与所有的网络浏览器相兼容][2],这意味着大多数情况下,它们将呈现为 “豆腐块”或 空白盒子。当 Twitter 想使得 emoji 可用时,社交网络联合一家名为[Icon Factory][3]的公司共同渲染浏览器以模仿 文本信息符号的效果。结果,Twiter 说道 人们对他们的 emoji 库有很大的需求。 +但这需要一点体力活。 Unicode 已经识别甚至标准化了 emoji 字母表, 然而 emoji 仍然[不能完全与所有的网络浏览器相兼容][2],这意味着大多数情况下,它们将呈现为 “豆腐块”或“空白盒子”。当 Twitter 想使得 emoji 到处可用时,这家社交网络联合了一家名为[Icon Factory][3]的公司来渲染浏览器以模仿文本信息符号的效果。Twiter 认为人们对他们的 emoji 库有很大的需求。 现在, 你可以从 [GitHub][4] 上克隆 Twitter 的整个库,从而在你的开发项目中使用它们。 下面将为你介绍如何达到上面的目的以及如何使得 emoji 更容易被使用。 ### 为 Emoji 得到 Unicode 支持 ### -Unicode 是国际编码标准,它为任意的符号,字母或人们想在网络上使用的数字配置了一串符号。换句话说,它是 你如何在计算机上阅读文本 与 计算机如何读取文本 之间的缺失环节。例如,对于你正看到的位于这些句子中的`空白`,计算机读取为 “&mbsp”。 +Unicode 是国际编码标准,它为任意的符号、字母或人们想在网络上使用的数字配置了一串编码。换句话说,它是你如何在计算机上阅读文本与计算机如何读取文本之间的缺失环节。例如,对于你正看到的位于这些句子中的`空格`(LCTT 译注:英文分词中间的空格),计算机读取为 “ ”。 -Unicode 甚至拥有其自己的 [原始 emoji][5],它们可以 在没有你的任何努力的情况下在浏览器中被阅读。例如,当你看到了 一个 ❤ 符号,你的计算机正在解码字符串 “2665” 。 +Unicode 甚至拥有其自己的[原始 emoji][5],它们可以在没有你的任何努力的情况下在浏览器中被阅读。例如,当你看到了 一个 ❤ 符号,你的计算机正在解码字符串 “2665” 。 要在大多数情况下使用 Twitter 的 emoji 库,你只需在你的 HTML 网页中的 ``块中添加如下脚本: -这样就使得你的项目可以访问 包含有已经在 Twitter 中可使用的数以百计的 Emoji 符号的 JavaScript 库。然而,创建一个仅仅包含这个脚本的文档并不能使得在你的网站中呈现出 emoji 符号,实际上,你仍需要嵌入一些 emoji 符号! +这样就使得你的项目可以访问包含有已经在 Twitter 中可使用的数以百计的 Emoji 符号的 JavaScript 库。然而,创建一个仅仅包含这个脚本的文档并不能使得在你的网站中呈现出 emoji 符号,实际上,你仍需要嵌入这些 emoji 符号! -在 ``块中,粘贴一些可以在 Twitter 的[preview.html 文件源代码][6] 中找到的 emoji 字符串。我使用了 🎹 和 🏁,当然我并不知道在浏览器窗口中它们的样子。是的,你必须粘贴并猜测它们。你已经看出了问题,我们将在 第二小节中予以解决。 +在 ``块中,粘贴一些可以在 Twitter 的[preview.html 文件源代码][6] 中找到的 emoji 字符串。我使用了 🎹 和 🏁,当然我并不知道在浏览器窗口中它们的样子。是的,你必须粘贴并猜测它们。你已经看出了问题,我们将在第二小节中予以解决。 无论如何,通过一些尝试,你可以将一个如下图的原始 HTML 文件--- ![](http://a4.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODQyNTMzNTQ1OTk0.png) ----转变成如下图的网页: +---显示为如下图的网页: ![](http://a1.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODExNjYzNDU1NTA2.png) @@ -52,11 +52,11 @@ Unicode 甚至拥有其自己的 [原始 emoji][5],它们可以 在没有你 - 一旦你将上面的代码添加了进去,你便可以删除先前添加的 Twitter 的脚本链接。 +一旦你将上面的代码添加了进去,你便可以删除先前添加的 Twitter 的脚本链接。 - 现在,找到 `body` 块部分的代码,然后添加一些 emoji 符号。我使用了 ``, ``, `` 和 ``。 +现在,找到 `body` 块部分的代码,然后添加一些 emoji 符号。我使用了 ``, ``, `` 和 ``。 - 最终,你将得到如下的代码: +最终,你将得到如下的代码: ![](http://a2.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODcyMDYxNDU2MzU0.png) @@ -64,9 +64,9 @@ Unicode 甚至拥有其自己的 [原始 emoji][5],它们可以 在没有你 ![](http://a1.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODExOTMxODkwOTYy.png) -当当!这样你不仅得到了一个可以在浏览器中支持 emoji 符号的基本网页,而且还知道了如何简单地实现它。你可以随意的在[我的 GitHub][9] 中查看这个教程,并且可以克隆这些实际的文件而不只是看看这些截图。 +Duang!这样你不仅得到了一个可以在浏览器中支持 emoji 符号的基本网页,而且还知道了如何简单地实现它。你可以随意的在[我的 GitHub][9] 中查看这个教程,并且可以克隆这些实际的文件而不只是看看这些截图。 -来自于[得到 Emoji][10]的引导图像; Lauren Orsini 截图。 +题图来自于[得到 Emoji][10]; Lauren Orsini 截图。 -------------------------------------------------------------------------------- @@ -74,7 +74,7 @@ via: http://readwrite.com/2014/11/12/how-to-use-emoji-in-the-browser-window 作者:[Lauren Orsini][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141120 How to install Xen hypervisor on unused old hardware.md b/published/201502/20141120 How to install Xen hypervisor on unused old hardware.md similarity index 82% rename from translated/tech/20141120 How to install Xen hypervisor on unused old hardware.md rename to published/201502/20141120 How to install Xen hypervisor on unused old hardware.md index 87a28c57fc..f26d753e00 100644 --- a/translated/tech/20141120 How to install Xen hypervisor on unused old hardware.md +++ b/published/201502/20141120 How to install Xen hypervisor on unused old hardware.md @@ -1,11 +1,11 @@ - 怎样在废旧的硬件上安装 Xen 虚拟机监视器 ================================================================================ -Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必须准备一个裸机来安装和运行 Xen。KVM 和 Xen 有一些不同 —— 你可以把它安装在任何已经正在运行 Linux 的机器上。本教程描述了如何在废旧的硬件上安装和配置 Xen 虚拟机监视器。 +Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必须准备一个裸机来安装和运行 Xen。而 KVM 则和 Xen 有一些不同 —— 你可以把它添加到任何已经正在运行 Linux 的机器上。本教程描述了如何在废旧的硬件上安装和配置 Xen 虚拟机监视器。 整个安装过程使用 Debian Jessie(Debian 的测试发行版)作为宿主机操作系统(也称作 [Dom0][1])。Jessie 并不是唯一的选择 —— Xen 的支持是内建在 Linux 内核中的,[许多 Linux 发行版][2] 都包含支持 Xen 的内核。 ### 找点废旧的硬件 ### + 首先,找一个可以格式化的合适的工作站,比如一台旧的笔记本或者台式机。旧的硬件可能不适合玩游戏,但是足够安装一个宿主机和一些客户机了。一个满足下面这些要求的 PC 机就可以了。 - 一个双核 CPU(64 位) @@ -14,7 +14,7 @@ Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必 - 能够从 CD,DVD 或者 USB 引导启动 - 一块网卡 -注意 CPU 必须是 64 位的,因为 Debian 已经不再支持 32 位的 Xen 安装包。如果你没有空余的硬件,你可以花点钱投资一台旧机器。2010 年值 $1000 的旗舰级笔记本现在只需要 $100。从 eBay 买台二手笔记本并升级下内存也可以满足需求。 +注意 **CPU 必须是 64 位的,因为 Debian 已经不再支持 32 位的 Xen 安装包**。如果你没有空余的硬件,你可以花点钱买一台旧机器。2010 年值 $1000 的旗舰级笔记本现在只需要 $100。从 eBay 买台二手笔记本并升级下内存也可以满足需求。 ### 刻录一个引导 CD/USB ### @@ -41,19 +41,19 @@ Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必 这里的设置使用了四个分区。自动安装时通常会创建一个包含逻辑分区的扩展分区。像下面这样给硬盘分四个区。 - sda1 挂载至 /boot,200MB -- sda2 /, 20GB, Ubuntu 占用 4GB -- sda3 swap, 6GB (4GB x 1.5 = 6) +- sda2 做为 /, 20GB, Ubuntu 占用 4GB +- sda3 做为 swap, 6GB (4GB x 1.5 = 6) - sda4 保留用作 LVM, 不挂载,大小为剩余的硬盘大小 ### 安装基本的系统 ### -这里尽可能的让系统的安装更简单快速一些。一个基本的工作用系统可以稍后再添加。Debian 的 APT(Advanced Package Tool)使得添加软件非常的简单。在一个工作站上安装 Deibian 可能会有一些很浪费时间的问题。可能显卡驱动与内核不监控或者可能老旧的 CD-ROM 驱动器只能间歇性的工作。 +这里尽可能的让系统的安装更简单快速一些。一个基本的工作用系统可以稍后再添加。Debian 的 APT(Advanced Package Tool)使得添加软件非常的简单。在机器上安装 Debian 可能会有一些很浪费时间的问题。可能显卡驱动与内核不监控或者可能老旧的 CD-ROM 驱动器只能间歇性的工作。 当选择安装软件时,选择安装一个 SSH 服务器,不要安装桌面环境如 Gnome。 ![](https://farm9.staticflickr.com/8541/15176520633_5d31beda9c_z.jpg) -安装一个图形桌面需要安装成百上千的包 —— 这些额外的工作可以稍后再进行。如果你遇到问题了,等到图形桌面的安装会浪费很多事件。同时,没有桌面组件,系统的启动可以更快一些 —— 只需要几十秒而不是几分钟。整个安装过程会需要重启几次,因此这样做可以节省不少时间。 +安装一个图形桌面需要安装成百上千的包 —— 这些额外的工作可以稍后再进行。如果你遇到问题了,等待图形桌面的安装会浪费很多时间。同时,没有桌面组件,系统的启动可以更快一些 —— 只需要几十秒而不是几分钟。整个安装过程会需要重启几次,因此这样做可以节省不少时间。 一个 SSH 服务器可以让你从另一台电脑来配置这台工作站。这可以避免一些旧硬件的问题 —— 可能旧机器的键盘少了几个键,LCD 屏幕有坏点或者触摸板没有反应等等。 @@ -79,9 +79,9 @@ Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必 检查 LVM 状态。 - # pvs (to view information about physical volumes) - # vgs (to view information about volume groups) - # lvs (to view information about logical volumes) + # pvs (查看物理卷的信息) + # vgs (查看卷组的信息) + # lvs (查看逻辑卷的信息) ### 添加一个 Linux 网桥 ### @@ -92,7 +92,6 @@ Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必 # apt-get install bridge-utils 查看在哪块网卡配置桥接。 -See what interfaces are configured. # ip addr @@ -156,13 +155,13 @@ See what interfaces are configured. ![](https://farm8.staticflickr.com/7535/15794086091_bf1bce6b4b_z.jpg) -第一个选项会在 5 秒钟内自动启动(在 /etc/default/grub 的 GRUB_TIMEOUT 这行设置),因此这点时间还来不及喝咖啡的。 +第一个选项会在 5 秒钟内自动启动(在 /etc/default/grub 的 GRUB_TIMEOUT 这行设置),因此这点时间可来不及喝咖啡。 按下方向键选择 "Debian GNU/Linux, with Xen hypervisor" 这个选项,然后按回车。这时屏幕会出现很多行信息,接着是正常的登录界面。 ### 检查 Xen 工作是否正常 ### -Xen 虚拟机监视器嗲有一个管理 Xen 的命令行工序叫做 xl,可以用来创建和管理 Xen 虚拟机。使用 xl 命令来检查 Xen 是否成功安装了。 +Xen 虚拟机监视器带有一个管理 Xen 的命令行程序叫做 xl,可以用来创建和管理 Xen 虚拟机。使用 xl 命令来检查 Xen 是否成功安装了。 以 root 用户登录,执行: @@ -206,9 +205,11 @@ Xen 虚拟机监视器嗲有一个管理 Xen 的命令行工序叫做 xl,可 ### 最后 ### -如果你使用这台主机作为你的工作站,可以安装一个图形桌面。Debian 包好几种[桌面环境][6]。如果你想要一个包含所有东西的图形桌面,那么安装 Gnome 吧。如果图形效果并不是你的菜,试试 Awesome 吧。 +如果你使用这台主机作为你的工作站,可以安装一个图形桌面。Debian 包括好几种[桌面环境][6]。如果你想要一个包含所有东西的图形桌面,那么安装 Gnome 吧。如果它的图形效果并不是你的菜,试试 Awesome 吧。 -注意 Debian 的默认 Gnome 环境有大量的额外应用程序包括办公套件 LibreOffice,Iceweasel 浏览器和 Rhythmbox 音乐播放器。安装命令 "apt-get install gnome" 会安装 1,000 多个包并需要将近 2GB 的硬盘空间。运行这个重量级的桌面环境需要占用 1GB 的内存。 +注意 Debian 的默认 Gnome 环境有大量的额外应用程序包括办公套件 LibreOffice,Iceweasel 浏览器和 Rhythmbox 音乐播放器。安装命令 "apt-get install gnome" 会安装 1,000 多个包并需要将近 2GB 的硬盘空间。运行这个重量级的桌面环境需要占用 1GB 的内存。 + +(LCTT 译注:本文没有涉及如何安装 guest 虚拟机,请关注后继文章) -------------------------------------------------------------------------------- @@ -216,7 +217,7 @@ via: http://xmodulo.com/install-xen-hypervisor.html 作者:[Nick Hardiman][a] 译者:[Liao](https://github.com/liaoishere) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/201502/20141203 Undelete Files on Linux Systems.md b/published/201502/20141203 Undelete Files on Linux Systems.md new file mode 100644 index 0000000000..59367ed918 --- /dev/null +++ b/published/201502/20141203 Undelete Files on Linux Systems.md @@ -0,0 +1,127 @@ +怎样在 Linux 系统中恢复已删除文件 +================================================================================ + +当用户意外地删除了一个仍然需要的文件时,大多数情况下,是没有简便的方法可以重新找回或重建这个文件。不过,幸运的是文件是可以通过一些方法恢复的。当用户删除了一个文件,该文件并没有消失,只是被隐藏了一段时间。 + +这里将解释它是如何工作的。在一个文件系统中,有一个叫做 `文件分配表` 的东西,这个表跟踪文件在存储单元(如硬盘, MicroSD 卡,闪存驱动器等等)中的位置。当一个文件被删除,文件系统将会在`文件分配表`中执行以下两个任务之一:这个文件在`文件分配表`上的条目被标记为 “自由空间” 或删除`文件分配表`里这个文件的条目,且将相应的空间被标记为自由空间 。现在,如果有一个新的文件需要被放置在一个存储单元上,操作系统将会把这个文件放置到标记为空位的地方。在新文件被写入到这个空位后,被删除的文件就彻底消失了。当需要恢复一个已经删除的文件时,用户绝对不能再对任何文件进行操作,因为假如该文件对应的“空位”被占用,这个文件就永远也不能恢复了。 + +### 恢复软件是如何工作的? ### + +大多数的文件系统(在删除文件时)只是标记空间为空白。在这些文件系统下,恢复软件查看`文件分配表`这个文件,然后复制被删除的文件到另外的存储单元中。假如该文件被复制到其它需要恢复的被删除的存储单元中,那么用户将有可能会失去那个所需的删除文件。 + +文件系统很少会擦除`文件分配表`中的条目。假如文件系统真的这样做了, 这便是恢复软件在恢复文件了。恢复软件在存储单元中扫描文件头,所有文件都拥有一个特殊的编码字符串,它们位于文件的最前面,也被叫做 `魔法数字`。例如,一个编译的 JAVA 类文件的魔法数字在十六进制中是“CAFEBABE”。所以,假如要恢复该类型的文件,恢复软件会查找 “CAFEBABE” 然后复制文件到另一个存储单元。一些恢复软件可以查找某种特殊的文件类型。若用户想恢复一个 PDF 文件,则恢复软件将会查找十六进制的魔法数字 “25504446”,这恰恰是 ASCII 编码中的 “%PDF”。恢复软件将会查找所有的魔法数字,然后用户可以选择恢复哪个已删除的文件。 + +假如一个文件的部分被覆写了,则整个文件就会被损坏。通常这个文件可以被恢复,但是其中的内容可能已经没有什么用处。例如,恢复一个已损坏的 JPEG 文件将会是无意义的,因为图片查看器不能从这个损坏的文件产生一幅图片。因此,即使用户拥有了这个文件,该文件也将毫无用处。 + +### 设备的位置:### + +在我们继续之前,下面的一些信息将会对指引恢复软件找到正确的存储单元起到一定的帮助。所有的设备均挂载在 `/dev/` 目录下。操作系统赋予每个设备的名称(并不是管理员给予每个分区或设备的名称)遵循一定的命名规律。 + +第一个 SATA 硬盘的第二个分区的名称将会是 sda2。名称的第一个字母暗示了存储类型,在这里指的是 SATA,但字母 “s” 也可能指的是 SCSI、 FireWire(火线端口)或 USB。第二个字母 “d” 指的是 disk(硬盘)。第三个字母指的是设备序数,即字母 “a” 指的是第一个 SATA 而 “b” 指的是第二个。最后的数字代表分区。没有分区数字的设备名代表该设置的所有分区。对于上面的例子,对应的名称为 sda 。作为命名的第一个字母还可能是 “h” ,这对应 PATA 硬盘(IDE)。 + +以下为命名规律的一些例子。假如一个用户有一个 SATA 硬盘(sda),这个设备有 4 个分区- sda1、 sda2、 sda3 和 sda4 。该用户删除了第三个分区,但直到格式化第四个分区之前,第四个分区名 sda4 都将保留不变。然后该用户插入了一个带有一个分区 - 即sdb1- 的 usb 存储卡(sdb),又增加了一个带有一个分区 -hda1- 的 IDE 硬盘 ,接着该用户又增加了一个 SCSI 硬盘 - sdc1 。接着用户移除了 USB 存储卡(sdb)。现在,SCSI 硬盘的名称仍然为 sdc,但如果这个 SCSI 被移除接着再被插入,则它的名称将变为 sdb。虽然还有其他的存储设备存在, 那个 IDE 硬盘的名称仍会有一个 “a”, 因为它是第一个 IDE 硬盘,IDE 设备的命名与 SCSI、 SATA、 FireWire 和 USB 设备要分开计数。 + +### 使用 TestDisk 进行恢复:### + +每个恢复软件有其不同的功能,特征及支持的不同文件系统。下面是一些关于 使用 TestDisk 在各种文件系统中恢复文件的指南。 + +####FAT16、 FAT32、 exFAT (FAT64)、 NTFS 以及 ext2/3/4:#### + +TestDisk 是一个运行在 Linux、 *BSD、 SunOS、 Mac OS X、 DOS 和 Windows 等操作系统下的开源的自由软件。 TestDisk 可以从下面的链接中找到 :[http://www.cgsecurity.org/wiki/TestDisk][1]。TestDisk 也可以通过键入 `sudo apt-get install testdisk` 来安装。TestDisk 有着许多的功能,但这篇文章将只关注恢复文件这个功能。 + +使用 root 权限从终端中打开 TestDisk 可以通过键入 `sudo testdisk` 命令。 + +现在, TestDisk 命令行应用将会被执行。终端的显示将会改变。TestDisk 询问用户它是否可以保留日志,这完全由用户决定。假如一个用户正从系统存储中恢复文件,则不必保留日志。可选择的选项有“生成”、 “追加” 和 “无日志”。假如用户想保留日志,则日志将会保留在该用户的主目录。 + +![](http://www.linux.org/attachments/screen1-jpg.342/?.jpg) + +在接着的屏幕中,存储设备以 `/dev/*`的方式被罗列出来。对于我的系统,系统的存储单元为 `/dev/sda`,这意味着我的存储单元为 一个 SATA硬盘(sd)且它是第一个硬盘(a)。每个存储单元的容量以 Gigabyte(千兆字节)为单位显示的。使用上下键来选择一个存储设备然后点击进入。 + +![](http://www.linux.org/attachments/screen2-jpg.343/?.jpg) + +下一屏显示出一个列有分区表(也叫做分区映射表)的清单。正如文件有`文件配置表`,分区有着分区表。分区是存储设备上的分段。例如在几乎所有的 Linux 系统中,至少存在两种分区类型 - EXT3/4 和 Swap 。每一个分区表将会在下面被简要地描述。TestDisk 并不支持所有类型的分区表,所以这并不是完整的列表。 + +![](http://www.linux.org/attachments/screen3-jpg.344/?.jpg) + +- **Intel** - 这类分区表在 Windows 系统和许多的 Linux 系统中非常普遍,它也常常称作 MBR 分区表。 +- **EFI GPT** - 这种类型的分区表通常用在 Linux 系统中。对于 Linux 系统,这种分区表是最为推荐的, 因为逻辑分区或扩展分区的概念并不适用于 GPT (GUID Partition Table) 分区表。 这意味着,如果每个分区中有一个 Linux 系统,一个 Linux 用户可以从多种类型的 Linux 系统中进行多重启动。当然使用 GPT 分区表还有其他的优势,但那些已超出了本文的讨论范围。 +- **Humax** - Humax 分区映射表适用于韩国公司 Humax 生产的设备。 +- **Mac** - Apple 分区映射表 (APM) 适用于 Apple 的设备。 +- **None** - 某些设备并没有分区表。例如,许多 Subor 游戏控制台不使用分区映射表。如果一个用户试图以其它分区表类型从这类设备中恢复文件,用户就会困扰 TestDisk 为何找卟到任何的文件系统或者文件。 +- **Sun** - Sun 分区表适用于 Sun 系统。 +- **Xbox** -Xbox 适用于使用 Xbox 分区映射表的存储设备。 + +假如用户选择了 “Xbox” ,尽管他的系统使用了 GPT 分区表, 那么 TestDisk 将不能找到任何分区或文件系统。假如 TestDisk 按照用户的选择执行,则它可能猜测错误。(下面的图片显示的是当分区表类型错误时的输出) + +![](http://www.linux.org/attachments/xbox-jpg.350/?.jpg) + +当用户为他们的设备选择了正确的选项,则在下一屏中,选择 “高级” 选项。 + +![](http://www.linux.org/attachments/screen4-jpg.345/?.jpg) + +现在,用户将看到一个列有用户存储设备中所有的文件系统或分区的列表。假如用户选择了错误的分区映射表,则在这一步中用户就将会知道他们做出了错误的选择。假如没有错误,通过移动文字光标来高亮选择含有被删除文件的分区。使用 左右键来高亮位于终端底部的 “列表”。接着,按下回车确认。 + +![](http://www.linux.org/attachments/screen5-jpg.346/?.jpg) + +新的一屏便会呈现出列有文件和目录的列表。那些白色的文件名就是未被删除的文件,而红色的文件名是那些已被删除的文件。最右边的一列是文件的名称,从右到左方向的接着一列是文件的创建日期,再往左的一列是文件的大小(以 byte/ 比特为单位),最左边带有“-”,“d” ,“r”, “w” 和"x"的一列则代表的是文件的权限情况。“d” 表示该文件为一个目录,其他的权限术语与本文关系不大。在列表的最顶端以“.”代表的一项表示当前目录,第二行以".."代表的一项表示当前目录的上级目录,所以用户可以通过选择目录所在行到达该目录。 + +![](http://www.linux.org/attachments/screen6-jpg.347/?.jpg) + +举个例子,我想进入"Xaiml\_Dataset" 目录,该目录基本上由被删除的文件组成。通过按键盘上的 "c"键,我将恢复文件 "computers.xaiml",接着我被询问选择一个目标目录,当然,我应该放置该文件到另一个分区中。现在,当我在我的家目录时,按下了“c”键。(选择目标目录时)哪个目录被高亮并没有什么影响,当前目录就是目标目录,在屏幕的上方,将会显示“复制完成”的消息。在我的家目录中便会有一个名为"Xaiml_Dataset"的目录,里面里有一个 Xaiml 文件。 假如我在更多的已删除文件上按“c” 键,则这些文件将会被放置到新的文件夹中而无需再向我询问目标目录。 + +![](http://www.linux.org/attachments/screen7-jpg.348/?.jpg) + +![](http://www.linux.org/attachments/screen8-jpg.349/?.jpg) + +当这些步骤完成后,重复按“q”键直到看到正常的终端模样。目录"Xaiml_Dataset" 只能被 root 用户访问。为了解决这个问题,使用 root 权限改变该目录及其子目录的权限。做完这些后,文件便被恢复了且用户可以访问它们。 + +### 特别的 ReiserFS:### + +为了从 ReiserFS 文件系统中恢复一个文件,首先需将分区中的所有文件做一个备份。因为如果发生某些错误, 这个方法可能会引起文件丢失。接着执行下面的命令,其中 `DEVICE`指的是那些以 sda2 形式命名的设备。一些文件将被放入 lost+found 目录而其他则会保存到原先被删除的位置。 + + reiserfsck --rebuild-tree --scan-whole-partition /dev/DEVICE + +### 恢复被某个程序打开的删除文件: ### + +假设用户意外地删除了一个文件,且该文件被某个程序打开。虽然在硬盘中该文件被删除了,但这个程序正使用着位于 RAM 中的该文件的副本。幸好,我们有两种简单的解决方法来恢复该文件。 + +假如这个软件有保存功能,如文本编辑器,则用户可以重新保存该文件,这样,文本编辑器可以将该文件写入硬盘中。 + +假设在音乐播放器中有一个 MP3 文件,而该音乐播放器并不能保存该 MP3 文件,则这种情形下需要比先前花更多的时间来恢复文件。不幸的是,这种方法并不能保证在所有的系统和应用中有效。首先,键入下面的命令。 + + lsof -c smplayer | grep mp3 + +上面的命令会列出所有由 smplayer 使用的文件,这个列表由 `grep` 命令通过管道搜索 mp3 。命令的输入类似于下面: + + smplayer 10037 collier mp3 169r 8,1 676376 1704294 /usr/bin/smplayer + +现在,键入下面的命令来直接从 RAM(在 Linux 系统中,`/proc/`映射到 RAM)中恢复文件,并复制该文件到选定的文件夹中。其中 `cp` 指的是复制命令,输出中的数字 10037 来自于进程数,输出中的数字 169 指的是文件描述符,"~/Music/"为目标目录,最后的 "music.mp3" 为用户想恢复的文件的名称。 + + cp /proc/10037/fd/169 ~/Music/music.mp3 + +### 真正的删除: ### + +为确保一个文件不能被恢复,可以使用一个命令来 “擦除” 硬盘。擦除硬盘实际上是向硬盘中写入无意义的数据。例如,许多擦除程序向硬盘中写入零,随机字母或随机数据。不会有空间被占用或丢失,擦除程序只是对空位进行重写覆盖。假如存储单元被文件占满而没有空余空间,则所有先前被删除的文件将会消失而不能恢复。 + +擦除硬盘的目的是确保隐私数据不被他人看见。举个例子,一个公司可能预订了一些新的电脑,总经理决定将旧的电脑卖掉,然而,新的电脑拥有者可能会看到公司的一些机密或诸如信用卡号码,地址等顾客信息。幸好,公司的电脑技术人员可以在卖掉这些旧电脑之前,擦除这些硬盘。 + +为了安装擦除程序 secure-delete,键入 `sudo apt-get install secure-delete`,这个命令将会安装一个包含 4 个程序的程序集,用以确保被删除的文件不能被恢复。 + +- srm - 永久删除一个文件。使用方法: `srm -f ./secret_file.txt` +- sfill - 擦除空白空间。使用方法: `sfill -f /mount/point/of/partition` +- sswap - 擦除 swap 空间。使用方法: `sswap -f /dev/SWAP_DEVICE` + +假如电脑实际去清除那些删除的文件,那么就需要花费更长的时间去执行删除任务。将某些空间标记为空位是快速且容易的,但使得文件永远消失需要花费一定的时间。例如,擦除一个存储单元,可能需要花费几个小时的时间(根据磁盘容量大小)。总之,现在的系统工作的就挺好,因为即便用户清空了垃圾箱,他们仍然有另一次机会来改变他们当初的想法(或错误)。 + +-------------------------------------------------------------------------------- + +via: http://www.linux.org/threads/undelete-files-on-linux-systems.4316/ + +作者:[DevynCJohnson][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linux.org/members/devyncjohnson.4843/ +[1]:http://www.cgsecurity.org/wiki/TestDisk diff --git a/published/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md b/published/201502/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md similarity index 100% rename from published/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md rename to published/201502/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md diff --git a/translated/tech/20141205 What is a good free control panel for VPS.md b/published/201502/20141205 What is a good free control panel for VPS.md similarity index 61% rename from translated/tech/20141205 What is a good free control panel for VPS.md rename to published/201502/20141205 What is a good free control panel for VPS.md index b9c3f3fafd..dbd1759145 100644 --- a/translated/tech/20141205 What is a good free control panel for VPS.md +++ b/published/201502/20141205 What is a good free control panel for VPS.md @@ -1,18 +1,18 @@ -VPS上好的控制面板是什么 +推荐一款不错的 VPS 控制面板:Ajenti ================================================================================ -任何有经验的Linux人员都认为没有一款控制面板可以打败纯命令行界面来管理[虚拟主机][1](VPS)。也有人争论有一款好的面板的一席之地,因为流线型的界面让常规管理操作可以通过点几下鼠标就可以完成。 +任何有经验的Linux人员都认为没有任何一款控制面板可以打败纯命令行界面来管理[虚拟主机][1](VPS)。也有人争辩说好的控制面板还是应该有一席之地,因为顺滑的操作界面让常规管理操作通过点几下鼠标就可以完成。 -至于控制面板,有共恩那个强大的充满警铃和汽笛的商业控制面板,也有不同免费的但也强大多功能的免费开源面板替代。这之中杰出的代表是[Ajenti][2]控制面板。 +至于控制面板,有那种强大的充满警铃和汽笛的商业控制面板,也有不同免费的但也强大多功能的免费开源面板替代品。这之中杰出的代表是[Ajenti][2]控制面板。 -Ajenti可以让你很简单地配置不同的通用服务程序,如Apache/nginx、Samba、BIND、Squid、MySQL、cron、防火墙等等,对管理通用VPS实例可以节省大量的时间。对于生产环境,Ajenti同样提供了插件和平台来支持虚拟web主机管理和自定义web UI开发。 +Ajenti可以让你很简单地配置不同的常规服务程序,如Apache/nginx、Samba、BIND、Squid、MySQL、cron、防火墙等等,对管理常规的 VPS 实例可以节省大量的时间。对于生产环境,Ajenti同样提供了插件和平台来支持虚拟 web 主机管理和自定义 web UI开发。 -Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免费使用的AGPLv3。然而,如果你是一家托管企业或者硬件提供商,那么你需要购买商业授权来使用Ajenti作为商业供应。 +Ajenti有[双重授权][3];一个是针对个人、企业内部或者教育用途免费使用的AGPLv3。然而,如果你是一家托管企业或者硬件提供商,那么你需要购买商业授权来使用Ajenti作为商业服务。 ### 在Linux上安装Ajenti ### 为了简化安装,Ajenti为主流Linux发行版提供了自己的仓库。安装Ajenti要做的就是配置目标仓库,并用默认包管理器来安装。 -安装前,一个RSA密钥和证书会生成用于SSL,Ajenti会见在8000端口监听HTTPS的web请求。如果你正在使用防火墙,你需要在防火墙中允许8000端口。为了安全,最好默认禁止8000端口的访问,并添加少数IP地址到白名单中。 +安装前会生成用于SSL的一个RSA密钥和证书,Ajenti会在8000端口监听HTTPS的web请求。如果你正在使用防火墙,你需要在防火墙中允许8000端口访问。为了安全,最好默认禁止8000端口的公开访问,并添加你的少数IP地址到白名单中。 #### 在Debian上安装Ajenti #### @@ -54,7 +54,7 @@ Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免 $ sudo service ajenti restart -直接在浏览器中输入https://:8000,你就会看到下面的Ajenti的登录界面。 +直接在浏览器中输入https://\:8000,你就会看到下面的Ajenti的登录界面。 ![](https://farm8.staticflickr.com/7512/15712738197_eeccd0f9dd_z.jpg) @@ -62,7 +62,7 @@ Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免 ![](https://farm8.staticflickr.com/7498/15897850312_d2ca46fa4b_z.jpg) -在左边面板的"SOFTWARE"选项下,你会看接一列安装的服务。当你安装了任何Ajenti支持的服务端程序时,软件会在重启ajenti服务后被自动加入列表。 +在左边面板的"SOFTWARE"选项下,你会看带一些已安装的服务。当你安装了任何Ajenti支持的服务端程序时,软件会在重启ajenti服务后被自动加入列表。 $ sudo service ajenti restart @@ -84,7 +84,7 @@ Ajenti提供了一个web界面来安装和升级VPS上的包。 #### 防火墙配置 #### -Ajenti允许你用两种方法管理防火墙规则(iptables或者CSF)。一种是使用用户友好的web面板,另一种是直接编辑原生的防火墙规则。 +Ajenti允许你用两种方法管理防火墙规则(使用iptables或者CSF)。一种方法是使用用户友好的web面板,另一种是直接编辑原始的防火墙规则。 ![](https://farm8.staticflickr.com/7490/15276234634_a220f2a555_z.jpg) @@ -98,25 +98,25 @@ Ajenti允许你用两种方法管理防火墙规则(iptables或者CSF)。一 #### 进程监控 #### -你可以u看见按照CPU和内存使用率排序的进程列表,按需可以结束它们。 +你可以看见按照CPU和内存使用率排序的进程列表,如果需要的话,也可以干掉它们。 ![](https://farm8.staticflickr.com/7556/15711008948_ed359c284d_z.jpg) #### 终端访问 #### -对于底层VPS访问,Ajenti提供了基于web的终端界面,你在这可以输入Linux命令。你也可以像下面那样在一个面板中打开多个终端。 +如果需要更低层面的VPS访问,Ajenti提供了基于web的终端界面,你在这可以输入Linux命令。你也可以像下面那样在一个面板中打开多个终端。 ![](https://farm8.staticflickr.com/7568/15896505251_8271ac16dd_z.jpg) #### Apache Web服务管理 #### -你可以编辑Apache配额文件,并管理apche2服务。 +你可以编辑Apache配置文件,并管理apache2服务。 ![](https://farm8.staticflickr.com/7572/15711009108_bb806d2dcd_z.jpg) #### MySQL/MariaDB 管理 #### -你可以访问MySQL/MariaDB服务并直接在上面执行原生SQL命令。 +你可以访问MySQL/MariaDB服务并直接在上面执行原始SQL命令。 ![](https://farm8.staticflickr.com/7580/15276234754_02375fd17b_z.jpg) @@ -128,13 +128,13 @@ Ajenti允许你用两种方法管理防火墙规则(iptables或者CSF)。一 #### 启动服务管理 #### -你可以浏览、启动、停止、重启安装的服务。 +你可以浏览、启动、停止、重启已安装的服务。 ![](https://farm8.staticflickr.com/7538/15898503935_1edf5c67ae_z.jpg) ### 总结 ### -Ajenti是一款易于使用的服务器管理控制面板,可以加入你开发的[自定义插件][5]。然而,记住任何好的控制面板都不会排除你学习面板后[VPS][6]上发生的情况的需求。一款面板会在你完全了解你正在做的事情的时候成会一款真正节省时间的利器,并且不依赖于控制面版来处理你行动的结果。 +Ajenti是一款易于使用的服务器管理控制面板,可以加入你开发的[自定义插件][5]。然而请记住,任何好的控制面板都不是阻止你学习在控制面板之后[VPS][6]里发生了什么的原因。一款好的面板会在你完全了解你正在做的事情时成会一款真正节省时间的利器,并且不依赖于控制面版来达成你所需要的目标。 -------------------------------------------------------------------------------- @@ -142,7 +142,7 @@ via: http://xmodulo.com/free-control-panel-for-vps.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -150,6 +150,6 @@ via: http://xmodulo.com/free-control-panel-for-vps.html [1]:http://xmodulo.com/go/digitalocean [2]:http://ajenti.org/ [3]:http://ajenti.org/licensing -[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[4]:http://linux.cn/article-2324-1.html [5]:http://docs.ajenti.org/en/latest/dev/intro.html [6]:http://xmodulo.com/go/digitalocean \ No newline at end of file diff --git a/published/20141210 How to configure rsyslog client for remote logging on CentOS.md b/published/201502/20141210 How to configure rsyslog client for remote logging on CentOS.md similarity index 100% rename from published/20141210 How to configure rsyslog client for remote logging on CentOS.md rename to published/201502/20141210 How to configure rsyslog client for remote logging on CentOS.md diff --git a/published/201502/20141211 How to use matplotlib for scientific plotting on Linux.md b/published/201502/20141211 How to use matplotlib for scientific plotting on Linux.md new file mode 100644 index 0000000000..00ae499ed7 --- /dev/null +++ b/published/201502/20141211 How to use matplotlib for scientific plotting on Linux.md @@ -0,0 +1,164 @@ +在Linux中使用matplotlib进行科学画图 +================================================================================ + +如果你想要在Linxu中获得一个高效、自动化、高质量的科学画图的解决方案,应该考虑尝试下matplotlib库。Matplotlib是基于python的开源科学测绘包,基于python软件基金会许可证发布。大量的文档和例子、集成了Python和Numpy科学计算包、以及自动化能力,是作为Linux环境中进行科学画图的可靠选择的几个原因。这个教程将提供几个用matplotlib画图的例子。 + +###特性### + +- 支持众多的图表类型,如:bar,box,contour,histogram,scatter,line plots.... +- 基于python的语法 +- 集成Numpy科学计算包 +- 数据源可以是 python 的列表、键值对和数组 +- 可定制的图表格式(坐标轴缩放、标签位置及标签内容等) +- 可定制文本(字体,大小,位置...) +- 支持TeX格式(等式,符号,希腊字体...) +- 与IPython相兼容(允许在 python shell 中与图表交互) +- 自动化(使用 Python 循环创建图表) +- 用Python 的循环迭代生成图片 +- 保存所绘图片格式为图片文件,如:png,pdf,ps,eps,svg等 + +基于Python语法的matplotlib是其许多特性和高效工作流的基础。世面上有许多用于绘制高质量图的科学绘图包,但是这些包允许你直接在你的Python代码中去使用吗?除此以外,这些包允许你创建可以保存为图片文件的图片吗?Matplotlib允许你完成所有的这些任务。从而你可以节省时间,使用它你能够花更少的时间创建更多的图片。 + +###安装### +安装Python和Numpy包是使用Matplotlib的前提,安装Numpy的指引请见[该链接][1]。 + + +可以通过如下命令在Debian或Ubuntu中安装Matplotlib: + + $ sudo apt-get install python-matplotlib + +在Fedora或CentOS/RHEL环境则可用如下命令: + + $ sudo yum install python-matplotlib + + +###Matplotlib 例子### + +本教程会提供几个绘图例子演示如何使用matplotlib: + +- 离散图和线性图 +- 柱状图 +- 饼状图 + +在这些例子中我们将用Python脚本来执行Mapplotlib命令。注意numpy和matplotlib模块需要通过import命令在脚本中进行导入。 + +np为nuupy模块的命名空间引用,plt为matplotlib.pyplot的命名空间引用: + + import numpy as np + import matplotlib.pyplot as plt + + +###例1:离散和线性图### + +第一个脚本,script1.py 完成如下任务: + +- 创建3个数据集(xData,yData1和yData2) +- 创建一个宽8英寸、高6英寸的图(赋值1) +- 设置图画的标题、x轴标签、y轴标签(字号均为14) +- 绘制第一个数据集:yData1为xData数据集的函数,用圆点标识的离散蓝线,标识为"y1 data" +- 绘制第二个数据集:yData2为xData数据集的函数,采用红实线,标识为"y2 data" +- 把图例放置在图的左上角 +- 保存图片为PNG格式文件 + +script1.py的内容如下: + + import numpy as np + import matplotlib.pyplot as plt + + xData = np.arange(0, 10, 1) + yData1 = xData.__pow__(2.0) + yData2 = np.arange(15, 61, 5) + plt.figure(num=1, figsize=(8, 6)) + plt.title('Plot 1', size=14) + plt.xlabel('x-axis', size=14) + plt.ylabel('y-axis', size=14) + plt.plot(xData, yData1, color='b', linestyle='--', marker='o', label='y1 data') + plt.plot(xData, yData2, color='r', linestyle='-', label='y2 data') + plt.legend(loc='upper left') + plt.savefig('images/plot1.png', format='png') + + +所画之图如下: + +![](https://farm8.staticflickr.com/7529/15927002365_f5ae11cf02_z.jpg) + + +###例2:柱状图### + +第二个脚本,script2.py 完成如下任务: + +- 创建一个包含1000个随机样本的正态分布数据集。 +- 创建一个宽8英寸、高6英寸的图(赋值1) +- 设置图的标题、x轴标签、y轴标签(字号均为14) +- 用samples这个数据集画一个40个柱状,边从-10到10的柱状图 +- 添加文本,用TeX格式显示希腊字母mu和sigma(字号为16) +- 保存图片为PNG格式。 + +script2.py代码如下: + + import numpy as np + import matplotlib.pyplot as plt + + mu = 0.0 + sigma = 2.0 + samples = np.random.normal(loc=mu, scale=sigma, size=1000) + plt.figure(num=1, figsize=(8, 6)) + plt.title('Plot 2', size=14) + plt.xlabel('value', size=14) + plt.ylabel('counts', size=14) + plt.hist(samples, bins=40, range=(-10, 10)) + plt.text(-9, 100, r'$\mu$ = 0.0, $\sigma$ = 2.0', size=16) + plt.savefig('images/plot2.png', format='png') + + +结果见如下链接: + +![](https://farm8.staticflickr.com/7531/15304765024_1cc271b6e0_z.jpg) + + +###例3:饼状图### + +第三个脚本,script3.py 完成如下任务: + +- 创建一个包含5个整数的列表 +- 创建一个宽6英寸、高6英寸的图(赋值1) +- 添加一个长宽比为1的轴图 +- 设置图的标题(字号为14) +- 用data列表画一个包含标签的饼状图 +- 保存图为PNG格式 + +脚本script3.py的代码如下: + + import numpy as np + import matplotlib.pyplot as plt + + data = [33, 25, 20, 12, 10] + plt.figure(num=1, figsize=(6, 6)) + plt.axes(aspect=1) + plt.title('Plot 3', size=14) + plt.pie(data, labels=('Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5')) + plt.savefig('images/plot3.png', format='png') + + +结果如下链接所示: + +![](https://farm8.staticflickr.com/7504/15926356092_7c3e5217aa_z.jpg) + + +###总结### + +这个教程提供了几个用matplotlib科学画图包进行画图的例子,Matplotlib是在Linux环境中用于解决科学画图的绝佳方案,表现在其无缝地和Python、Numpy连接、自动化能力,和提供多种自定义的高质量的画图产品。matplotlib包的文档和例子详见[这里][2]。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/matplotlib-scientific-plotting-linux.html + +作者:[Joshua Reed][a] +译者:[ideas4u](https://github.com/ideas4u) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/joshua +[1]:http://xmodulo.com/numpy-scientific-computing-linux.html +[2]:http://matplotlib.org/ diff --git a/translated/tech/20141219 How to block unwanted IP addresses on Linux efficiently.md b/published/201502/20141219 How to block unwanted IP addresses on Linux efficiently.md similarity index 75% rename from translated/tech/20141219 How to block unwanted IP addresses on Linux efficiently.md rename to published/201502/20141219 How to block unwanted IP addresses on Linux efficiently.md index 5d45755066..feb53945b0 100644 --- a/translated/tech/20141219 How to block unwanted IP addresses on Linux efficiently.md +++ b/published/201502/20141219 How to block unwanted IP addresses on Linux efficiently.md @@ -1,6 +1,7 @@ -如何在Linux有效地屏蔽不需要的IP +如何在 Linux 下大量屏蔽恶意 IP 地址 ================================================================================ -你可能需要在Linux的不同的环境下屏蔽IP地址。比如,作为一个终端用户,你可能想要免受间谍软件或者IP追踪的困扰。或者当你在运行P2P软件时。你可能想要过滤反P2P活动的网络链接。如果你是一名系统管理员,你可能想要禁止垃圾IP地址访问你们的生产邮件服务器。或者你因一些原因想要禁止某些国家访问web服务。在许多情况下,然而,你的IP地址屏蔽列表可能会很快地增长到几万的IP。该如何处理这个? + +很多情况下,你可能需要在Linux下屏蔽IP地址。比如,作为一个终端用户,你可能想要免受间谍软件或者IP追踪的困扰。或者当你在运行P2P软件时。你可能想要过滤反P2P活动的网络链接。如果你是一名系统管理员,你可能想要禁止垃圾IP地址访问你们的公司邮件服务器。或者你因一些原因想要禁止某些国家访问你的web服务。在许多情况下,然而,你的IP地址屏蔽列表可能会很快地增长到几万的IP。该如何处理这个? ### Netfilter/IPtables 的问题 ### @@ -8,11 +9,11 @@ $ sudo iptables -A INPUT -s 1.1.1.1 -p TCP -j DROP -如果你想要完全屏蔽一个IP地址,你可以用下面的命令很简单地做到: +如果你想要完全屏蔽一个IP地址段,你可以用下面的命令很简单地做到: $ sudo iptables -A INPUT -s 1.1.2.0/24 -p TCP -j DROP -然而,当你有1000个独立IP地址,且不带CIDR(无类别域间路由)前缀,你该怎么做?你要有1000条iptable规则!这显然无法扩展。 +然而,当你有1000个独立IP地址,且不带CIDR(无类别域间路由)前缀,你该怎么做?你要有1000条iptable规则!这显然这并不适于大规模屏蔽。 $ sudo iptables -A INPUT -s 1.1.1.1 -p TCP -j DROP $ sudo iptables -A INPUT -s 2.2.2.2 -p TCP -j DROP @@ -21,13 +22,13 @@ ### 什么是IP集? ### -这时候就是[IP集][1]登场了。IP集是一个内核特性,它允许多个(独立)IP地址、MAC地址或者甚至是端口号编码并有效地存储在位图/哈希内核数据结构中。一旦IP集创建之后,你可以创建一条iptable规则来匹配这个集合。 +这时候就是[IP集][1]登场了。IP集是一个内核特性,它允许多个(独立)IP地址、MAC地址或者甚至是端口号被编码和有效地存储在位图/哈希内核数据结构中。一旦IP集创建之后,你可以创建一条iptables规则来匹配这个集合。 -你应该马上看见IP集合的好处了,它可以让你用一条iptable规则匹配多个ip地址!你可以用多个IP地址和端口号的方式来构造IP集,并且可以动态地更新规则而没有请能影响。 +你马上就会看见IP集合的好处了,它可以让你用一条iptable规则匹配多个ip地址!你可以用多个IP地址和端口号的方式来构造IP集,并且可以动态地更新规则而没有性能影响。 ### 在Linux中安装IPset工具 ### -为了创建和管理IP集,你需要使用成为ipset的用户空间工具。 +为了创建和管理IP集,你需要使用称为ipset的用户空间工具。 要在Debian、Ubuntu或者Linux Mint上安装: @@ -45,7 +46,7 @@ Fedora或者CentOS/RHEL 7上安装: $ sudo ipset create banthis hash:net -第二个参数(hash:net)是必须的,代表的是集合的类型。IP集有[多个类型][2]。hash:net类型的IP集使用哈希来存储多个CIDR块。如果你想要在一个集合中存储独立的IP地址,你可以使用hash:ip类型。 +第二个参数(hash:net)是必须的,代表的是集合的类型。IP集有[多个类型][2]。hash:net类型的IP集使用哈希来存储多个CIDR块。如果你想要在一个集合中存储单独的IP地址,你可以使用hash:ip类型。 一旦创建了一个IP集之后,你可以用下面的命令来检查: @@ -70,25 +71,25 @@ Fedora或者CentOS/RHEL 7上安装: ![](https://farm8.staticflickr.com/7518/15380353474_4d6b9dbf63_z.jpg) -现在是时候去创建一个使用IP集的iptable规则了。这里的关键是使用"-m set --match-set "选项。 +现在是时候去创建一个使用IP集的iptables规则了。这里的关键是使用"-m set --match-set "选项。 现在让我们创建一条让之前那些IP块不能通过80端口访问web服务的iptable规则。可以通过下面的命令: $ sudo iptables -I INPUT -m set --match-set banthis src -p tcp --destination-port 80 -j DROP -如果你想,你可以保存特定的IP集到一个文件中,以后可以从文件中还原: +如果你愿意,你可以保存特定的IP集到一个文件中,以后可以从文件中还原: $ sudo ipset save banthis -f banthis.txt $ sudo ipset destroy banthis $ sudo ipset restore -f banthis.txt -上面的命令中,我使用了destory选项来删除一个已有的IP集来见证我可以还原它。 +上面的命令中,我使用了destory选项来删除一个已有的IP集来看看我是否可以还原它。 ### 自动IP地址禁用 ### -现在你应该看到了IP集合的强大了。维护IP黑名单是一件繁琐和费时的工作。实际上,有很多免费或者收费的服务可以来帮你完成这个。一个额外的好处是,让我们看看如何自动将IP黑名单家到IP集中。 +现在你应该看到了IP集合的强大了。维护IP黑名单是一件繁琐和费时的工作。实际上,有很多免费或者收费的服务可以来帮你完成这个。一个额外的好处是,让我们看看如何自动将IP黑名单加到IP集中。 -首先让我们从[iblocklist.com][3]抓取免费的黑名单,这个网站u有不同的免费和收费的名单。免费的版本是P2P格式。 +首先让我们从[iblocklist.com][3]得到免费的黑名单,这个网站有不同的免费和收费的名单。免费的版本是P2P格式。 接下来我要使用一个名为iblocklist2ipset的开源Python工具来将P2P格式的黑名单转化成IP集。 @@ -131,14 +132,13 @@ Fedora或者CentOS/RHEL 7上安装: $ sudo ipset list banthis - 在写这篇文章时候,“level1”类表包含了237,000个屏蔽的IP列表。你可以看到很多IP地址已经加入到IP集中了。 -最后,创建一条iptable命令来屏蔽它们! +最后,创建一条iptables命令来屏蔽这些坏蛋! ### 总结 ### -这篇文章中,我描述了你该如何用强大的ipset来·屏蔽不想要的IP地址。同时结合了第三方工具iblocklist2ipset,这样你就可以流畅地维护你的IP屏蔽列表了。对于那些对于ipset的速度提升好奇的人来说,下图显示了iptables在使用和不使用ipset的基准测试结果。 +这篇文章中,我描述了你该如何用强大的ipset来屏蔽不想要的IP地址。同时结合了第三方工具iblocklist2ipset,这样你就可以流畅地维护你的IP屏蔽列表了。那些对ipset的性能提升好奇的人,下图显示了iptables在使用和不使用ipset的基准测试结果。 ![](https://farm8.staticflickr.com/7575/15815220998_e1935c94c0_z.jpg) @@ -150,7 +150,7 @@ via: http://xmodulo.com/block-unwanted-ip-addresses-linux.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20141219 How to schedule appointments and to-do tasks in a Linux terminal.md b/published/201502/20141219 How to schedule appointments and to-do tasks in a Linux terminal.md similarity index 76% rename from translated/tech/20141219 How to schedule appointments and to-do tasks in a Linux terminal.md rename to published/201502/20141219 How to schedule appointments and to-do tasks in a Linux terminal.md index c419029716..1e2d5c39cd 100644 --- a/translated/tech/20141219 How to schedule appointments and to-do tasks in a Linux terminal.md +++ b/published/201502/20141219 How to schedule appointments and to-do tasks in a Linux terminal.md @@ -1,12 +1,12 @@ -如何在Linux终端下安排约会和待办事项 +在Linux终端下使用 calcurse 安排约会和待办事项 ================================================================================ -如果你是一个享受linux终端的系统管理员,但同样需要一中方法来安排每天最重要的任务、约会和会议,你会发现[calcurse][1]是一个很有用的工具。calcurse包含了日历、一个待办事项管理、一个调度程序和一个可配置的通知系统,这些都集成进了一个软件中,基于的都是ncurse的接口。同时,它不会限制你在终端中,你可以将你的日历和笔记导出成可以打印的格式。 +如果你是一个享受linux终端的系统管理员,但同样需要一种方法来安排每天最重要的任务、约会和会议,你会发现[calcurse][1]是一个很有用的工具。calcurse包含了日历、一个待办事项管理、一个调度程序和一个可配置的通知系统,这些都集成进了一个软件中,基于的都是ncurse的接口。同时,它不会限制你在终端中,你可以将你的日历和笔记导出成可以打印的格式。 -本片文章我们会探索如何在Linux上安装calcurse,并且教你如何利用它的特性。 +本篇文章我们会探索如何在Linux上安装calcurse,并且教你如何利用它的特性。 ### 在Linux上安装Culcurse ### -calcurse在大多数Linux发行版的标准仓库都有。万一在你的发行版上没有(比如CentOS/RHEL),一旦你安装了gcc和ncurse开发文件后就可以很简单地从源码安装。 +calcurse在大多数Linux发行版的标准仓库都有。万一在你的发行版上没有(比如CentOS/RHEL),只要你安装了gcc和ncurse开发文件后就可以很简单地从源码安装。 Debian、Ubuntu或者Linux Mint @@ -32,22 +32,22 @@ CentOS/RHEL $ calcurse -你将会看到下面的空白界面。如果配色不吸引你,你可以以后改变它们。 +你将会看到下面的空白界面。如果这配色不吸引你,你可以以后换一个。 ![](https://farm8.staticflickr.com/7567/15410270544_0af50a4eb6_c.jpg) -我们现在可以按下回车-‘q’- 再次按下回车- ‘y’来退出主界面。这个序列会告诉地不的菜单退出、保存当前的笔记并确认退出。 +我们现在可以按下回车-‘q’- 再次按下回车- ‘y’来退出主界面。这个按键序列激活界面底部的主菜单,并告诉它保存当前的笔记并确认退出。 -When we run calcurse for the first time, the following directory structure is created in our home directory: +我们第一次运行 calcurse 时,会在主目录创建如下子目录: ![](https://farm8.staticflickr.com/7482/15845194188_2ba15035e7_o.png) -这里是每一项的简要描述: +这里是每一个子目录的简要描述: -- **apts** 文件包含了用户所有的约会和事项,todo文件包含了所有的**todo** 列表。 +- **apts**文件包含了用户所有的约会和事项,todo文件包含了所有的**待办事项** 列表。 - **conf**文件,如你所想的那样,包含当前用户的独立设置。 -- **keys**文件包含了用户定义的按键绑定(比如:q或者Q推出,x或者X导出内容等等)。 -- 在**notes**子目录你会看到包含了笔记描述的文件,你可以附到任何一个安排事项中。 +- **keys**文件包含了用户定义的按键绑定(比如:q或者Q退出,x或者X导出内容等等)。 +- 在**notes**子目录你会看到包含了笔记描述的文件,这些笔记你可以附到任何一个安排事项中。 ### 改变配色 ### @@ -55,13 +55,13 @@ When we run calcurse for the first time, the following directory structure is cr ![](https://farm9.staticflickr.com/8595/16006755476_5289384f81_z.jpg) -使用最后一幅图的按键绑定来选色前景色和背景色配置来更好地适应你的需求: +使用最后一幅图的按键绑定来选择前景色和背景色配置,以更好地适应你的需求: ![](https://farm8.staticflickr.com/7499/15845274420_70bb95c221_b.jpg) -### A添加约会和待办任务 ### +### 添加约会和待办任务 ### -在前面的选项卡中浏览命令菜单时,我们看到按下‘o’可以从一个菜单到下一个菜单。我们可以把第二个菜单作为**安排编辑菜单**。 +在前面的选项卡中浏览命令菜单时,我们看到按下‘o’可以从一个菜单跳到下一个菜单。我们可以把第二个菜单作为**安排编辑菜单**。 ![](https://farm9.staticflickr.com/8634/16031851732_b947951f76_c.jpg) @@ -87,7 +87,7 @@ When we run calcurse for the first time, the following directory structure is cr ### 为事项设置通知 ### -你可以在通知菜单下配置通知。按照相同的步骤来以防改变了配色,但是选择**Notify**而不是**Colour**: +你可以在通知菜单下配置通知。按照相同的步骤来改变配色方案,但是选择**Notify**而不是**Colour**: ![](https://farm8.staticflickr.com/7569/15412900863_eaf2767e19_z.jpg) @@ -103,7 +103,7 @@ When we run calcurse for the first time, the following directory structure is cr ### 总结 ### -本篇教程中我们展示了如何设置一个多样化的调度器和提醒器来帮助你组织每日的活动和提前安排重要的事项。你或许还要calcurse的[PDF 手册][2],还请随意在下面的评论中提出你的疑问。欢迎你的评论,我也很高兴看到这些。 +本篇教程中我们展示了如何设置一个多样化的调度器和提醒器来帮助你组织每日的活动和提前安排重要的事项。你或许还要看看calcurse的[PDF 手册][2],请随意在下面的评论中提出你的疑问。欢迎你的评论,我也很高兴看到这些。 -------------------------------------------------------------------------------- @@ -111,7 +111,7 @@ via: http://xmodulo.com/schedule-appointments-todo-tasks-linux-terminal.html 作者:[Gabriel Cánepa][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20141223 20 Linux Commands Interview Questions & Answers.md b/published/201502/20141223 20 Linux Commands Interview Questions & Answers.md similarity index 100% rename from published/20141223 20 Linux Commands Interview Questions & Answers.md rename to published/201502/20141223 20 Linux Commands Interview Questions & Answers.md diff --git a/translated/tech/20141223 Setting up a 'PXE Network Boot Server' for Multiple Linux Distribution Installations in RHEL or CentOS 7.md b/published/201502/20141223 Setting up a 'PXE Network Boot Server' for Multiple Linux Distribution Installations in RHEL or CentOS 7.md similarity index 86% rename from translated/tech/20141223 Setting up a 'PXE Network Boot Server' for Multiple Linux Distribution Installations in RHEL or CentOS 7.md rename to published/201502/20141223 Setting up a 'PXE Network Boot Server' for Multiple Linux Distribution Installations in RHEL or CentOS 7.md index db3cd3b706..046cee4f98 100644 --- a/translated/tech/20141223 Setting up a 'PXE Network Boot Server' for Multiple Linux Distribution Installations in RHEL or CentOS 7.md +++ b/published/201502/20141223 Setting up a 'PXE Network Boot Server' for Multiple Linux Distribution Installations in RHEL or CentOS 7.md @@ -1,12 +1,13 @@ RHEL/CentOS 7中配置用于多版本Linux安装的“PXE网络启动服务器” ================================================================================ -**PXE服务器**——预启动执行环境——指示客户端计算机直接从网络接口启动、运行或安装操作系统,而不需要烧录CD/DVD或使用某个物理介质,它也可以减轻你网络中多台机器同时安装Linux发行版的工作。 +**PXE服务器**——预启动执行环境——指示客户端计算机直接从网络接口启动、运行或安装操作系统,而不需要烧录CD/DVD或使用某个物理介质,它可以减轻你网络中多台机器同时安装Linux发行版的工作。 ![Setting PXE Network Boot in RHEL/CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/10/Setting-PXE-Network-Boot-in-CentOS.png) -在RHEL/CentOS 7中设置PXE网络启动 -#### 需求 #### +*在RHEL/CentOS 7中设置PXE网络启动* + +#### 前置阅读 #### - [CentOS 7最小化安装步骤][1] - [RHEL 7最小化安装步骤][2] @@ -14,7 +15,7 @@ RHEL/CentOS 7中配置用于多版本Linux安装的“PXE网络启动服务器 - [移除RHEL/CentOS 7中不要的服务][4] - [安装NTP服务器以设置RHEL/CentOS 7的正确时间][5] -本文将介绍如何在配置有本地镜像安装仓库的**RHEL/CentOS 7** 64位上安装并配置一台**PXE服务器**,仓库源由CentOS 7 DVD ISO镜像提供,并由**DNSMASQ**服务器提供解析。 +本文将介绍如何在配置有本地镜像安装仓库的**RHEL/CentOS 7** 64位上安装并配置一台**PXE服务器**,仓库源由CentOS 7 DVD 的 ISO镜像提供,并由**DNSMASQ**服务器提供解析。 该机器提供了**DNS**和**DHCP**服务,用于网络启动引导的**Syslinux**包,**TFTP-Server**——提供了可通过网络使用**小文件传输协议**下载的可启动镜像,以及提供本地挂载DVD镜像的**VSFTPD**服务器——它将扮演官方RHEL/CentOS 7镜像安装仓库的角色,安装器将从这里提取所需的包。 @@ -27,11 +28,12 @@ RHEL/CentOS 7中配置用于多版本Linux安装的“PXE网络启动服务器 # yum install dnsmasq ![Install dnsmasq Package](http://www.tecmint.com/wp-content/uploads/2014/10/Install-dnsmasq-in-CentOS.jpg) -安装dnsmasq包 -**2.** DNSMASQ的默认主配置文件位于**/etc**目录中,虽然不需要任何说明就能看懂,但编辑起来确实相当困难的,即使有很详细的说明性注释。 +*安装dnsmasq包* -首先,确保你备份了该文件,以便你需要在以后对它进行恢复。然后使用你喜爱的文本编辑器创建一个新的空配置文件,命令如下。 +**2.** DNSMASQ的默认的主配置文件位于**/etc**目录中,虽然不需要任何说明就能看懂,但编辑起来确实相当困难的,即使有很详细的说明性注释。 + +首先,确保你备份了该文件,以便你需要在以后对它进行恢复。然后使用你爱用的文本编辑器创建一个新的空配置文件,命令如下。 # mv /etc/dnsmasq.conf /etc/dnsmasq.conf.backup # nano /etc/dnsmasq.conf @@ -61,7 +63,8 @@ RHEL/CentOS 7中配置用于多版本Linux安装的“PXE网络启动服务器 tftp-root=/var/lib/tftpboot ![Dnsmasq Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/dnsmasq-configuration.jpg) -Dnsmasq配置 + +*Dnsmasq配置* 你需要修改的声明有以下这些: @@ -89,14 +92,16 @@ Dnsmasq配置 # yum install syslinux ![Install Syslinux Bootloaders](http://www.tecmint.com/wp-content/uploads/2014/10/install-syslinux-bootloaders.jpg) -安装Syslinux启动加载器 + +*安装Syslinux启动加载器* **5.** PXE启动加载器文件位于**/usr/share/syslinux**系统绝对路径下,你可以通过列出该路径下的内容来查看。该步骤不是必须的,但你可能需要知道该路径,因为在下一步中,我们将拷贝该路径下的所有内容到**TFTP服务器**路径下。 # ls /usr/share/syslinux ![Syslinux Files](http://www.tecmint.com/wp-content/uploads/2014/10/syslinux-files.jpg) -Syslinux文件 + +*Syslinux文件* ### 步骤3: 安装TFTP-Server并加入SYSLINUX加载启动器 ### @@ -106,7 +111,8 @@ Syslinux文件 # cp -r /usr/share/syslinux/* /var/lib/tftpboot ![Install TFTP Server](http://www.tecmint.com/wp-content/uploads/2014/10/install-tftp-server.jpg) -安装TFTP服务器 + +*安装TFTP服务器* ### 步骤4: 设置PXE服务器配置文件 ### @@ -117,13 +123,13 @@ Syslinux文件 # mkdir /var/lib/tftpboot/pxelinux.cfg # touch /var/lib/tftpboot/pxelinux.cfg/default -**8.** 现在,该来编辑**PXE服务器**配置文件了,为它添加合法的Linux发行版安装选项。请注意,该文件中使用的所有路径必须是相对于**/var/lib/tftpboot**目录的。 +**8.** 现在,该来编辑**PXE服务器**配置文件了,为它添加合理的Linux发行版安装选项。请注意,该文件中使用的所有路径必须是相对于**/var/lib/tftpboot**目录的。 -下面,你可以看到配置文件的样例,你可以使用该模板,但请修改安装镜像(kernel和initrd文件)、协议(FTP、HTTP、HTTPS、NFS)以及映射你网络安装源仓库和路径的IP地址。 +下面,你可以看到配置文件的样例,你可以使用该模板,但请修改安装镜像(kernel和initrd文件)、协议(FTP、HTTP、HTTPS、NFS)以及映射你网络安装源仓库和路径的IP地址等参数。 # nano /var/lib/tftpboot/pxelinux.cfg/default -添加一下整个节录到文件中。 +添加以下整个节录到文件中。 default menu.c32 prompt 0 @@ -151,17 +157,18 @@ Syslinux文件 menu label ^4) Boot from local drive ![Configure PXE Server](http://www.tecmint.com/wp-content/uploads/2014/10/configure-pxe-server.jpg) -配置PXE服务器 + +*配置PXE服务器* 正如你所见,CentOS 7启动镜像(kernel和initrd)位于名为**centos7**的目录,该目录是**/var/lib/tftpboot**目录的相对路径(其系统绝对路径为**/var/lib/tftpboot/centos7**),而安装器仓库位于可通过FTP协议访问的**192.168.1.20/pub**网络位置中——在本例中,这些仓库位于本地,因为IP地址和PXE服务器地址相同。 同时,菜单**label 3**指定客户端安装应该通过**VNC**从一个远程位置实现(这里替换VNC密码为一个健壮的密码),如果你在一台没有输入输出的客户端上安装,菜单**label 2**指定了作为安装源的一个CentOS 7官方互联网镜像(这种情况要求客户端通过DHCP和NAT连接到互联网)。 -**重要**:正如你在上述配置中说看到的,我们使用了CentOS 7进行演示,但是你也可以定义RHEL 7镜像。而下面的完整说明和配置都只是基于CentOS 7的,所以在选在发行版时要当心。 +**重要**:正如你在上述配置中所看到的,我们使用了CentOS 7进行演示,但是你也可以定义一个 RHEL 7镜像。而下面的整个的说明和配置都只是基于CentOS 7的,所以在选发行版时要注意一下。 ### 步骤5: 添加CentOS 7启动镜像到PXE服务器 ### -**9.** 对于此步骤,需要用到CentOS的kernel和initrd文件。要获取这些文件,你需要**CentOS 7 DVD ISO**镜像。所以,去下载CentOS DVD镜像吧,然后把它放入你的DVD驱动器并挂载镜像到**/mnt**路径,命令见下面。 +**9.** 对于此步骤,需要用到CentOS的kernel和initrd文件。要获取这些文件,你需要**CentOS 7 DVD ISO**镜像。所以,去下载CentOS DVD镜像吧,然后把它(刻录成光盘)放入你的DVD驱动器并挂载镜像到**/mnt**路径,命令见下面。 使用DVD,而不是最小化CD镜像的原因在于,在后面我们将使用该DVD的内容为**FTP**源创建本地安装器仓库。 @@ -169,27 +176,29 @@ Syslinux文件 # ls /mnt ![Mount CentOS DVD](http://www.tecmint.com/wp-content/uploads/2014/10/mount-centos-dvd.jpg) -挂载CentOS DVD + +*挂载CentOS DVD* 如果你的机器没有DVD驱动器,你也可以使用**wget**或**curl**工具从[CentOS镜像站][7]下载**CentOS 7 DVD ISO**到本地并挂载。 # wget http://mirrors.xservers.ro/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso # mount -o loop /path/to/centos-dvd.iso /mnt -**10.** 在DVD内容可供使用后,创建**centos7**目录并将CentOS 7可启动kernel和initrd映像文件从DVD挂载位置拷贝到centos7文件夹。 +**10.** 在DVD内容可供使用后,创建**centos7**目录并将CentOS 7 的可启动的 kernel和initrd映像文件从DVD挂载位置拷贝到centos7文件夹。 # mkdir /var/lib/tftpboot/centos7 # cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7 # cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot/centos7 ![Copy CentOS Bootable Files](http://www.tecmint.com/wp-content/uploads/2014/10/copy-centos-bootable-files.jpg) -拷贝CentOS可启动文件 + +*拷贝CentOS可启动文件* 使用该方法的原因在于,今后你可能会在**/var/lib/tftpboot**路径中创建新的独立的目录,并添加其它Linux发行版到PXE菜单中,你就不会将整个目录结构弄得一团糟了。 ### 步骤6: 创建CentOS 7本地镜像安装源 ### -**11.** 虽然你可以通过多种协议设置**安装源镜像**,如HTTP、HTTPS或NFS,但对于本指南,我选择使用**FTP**协议。因为通过**vsftpd**,你可以很便捷地配置,而且它也很稳定。 +**11.** 虽然你可以通过多种协议设置**安装源镜像**,如HTTP、HTTPS或NFS,但对于本指南,我选择了使用**FTP**协议。因为通过**vsftpd**,你可以很便捷地配置,而且它也很稳定。 接下里,安装vsftpd进程,然后复制所有DVD挂载目录中的内容到**vsftpd**默认服务器路径下(**/var/ftp/pub**)——这会花费一些时间,这取决于你的系统资源。然后为该路径设置可读权限,命令如下。 @@ -198,17 +207,20 @@ Syslinux文件 # chmod -R 755 /var/ftp/pub ![Install Vsftpd Server](http://www.tecmint.com/wp-content/uploads/2014/10/install-vsftpd-in-centos.jpg) -安装Vsftpd服务器 + +*安装Vsftpd服务器* ![Copy Files to FTP Path](http://www.tecmint.com/wp-content/uploads/2014/10/copy-files-to-ftp-path.jpg) -拷贝Files到FTP路径 + +*拷贝Files到FTP路径* ![Set Permissions on FTP Path](http://www.tecmint.com/wp-content/uploads/2014/10/set-permission-on-ftp-path.jpg) -设置FTP路径的权限 + +*设置FTP路径的权限* ### 步骤7: 在系统范围内启动并启用进程 ### -**12.** 既然PXE服务器配置已经完成,那么就来启动**DNSMASQ**和**VSFTPD**服务器吧。验证它们的状况并在系统范围内启用,以便让这些服务在每次系统重启后都能随系统启动,命令如下。 +**12.** 既然PXE服务器配置已经完成,那么就来启动**DNSMASQ**和**VSFTPD**服务器吧。验证它们的状况并在系统上启用,以便让这些服务在每次系统重启后都能随系统启动,命令如下。 # systemctl start dnsmasq # systemctl status dnsmasq @@ -218,10 +230,12 @@ Syslinux文件 # systemctl enable vsftpd ![Start Dnsmasq Service](http://www.tecmint.com/wp-content/uploads/2014/10/start-dnsmasq.jpg) -启动Dnsmasq服务 + +*启动Dnsmasq服务* ![Start Vsftpd Service](http://www.tecmint.com/wp-content/uploads/2014/10/start-vsftpd.jpg) -启动Vsftpd服务 + +*启动Vsftpd服务* ### 步骤8: 打开防火墙并测试FTP安装源 ### @@ -236,53 +250,62 @@ Syslinux文件 # firewall-cmd --reload ## Apply rules ![Check Listening Ports](http://www.tecmint.com/wp-content/uploads/2014/10/check-listening-ports.jpg) -检查监听端口 + +*检查监听端口* ![Open Ports in Firewall](http://www.tecmint.com/wp-content/uploads/2014/10/open-ports-on-firewall.jpg) -在防火墙上开启端口 + +*在防火墙上开启端口* **14.** 要测试FTP安装源网络路径,请在本地或另外一台计算机上打开浏览器([**lynx**][8]就可以做此事),然后输入你架设有FTP服务的PXE服务器的IP地址,并在填入的URL后面加上**/pub**网络位置,结果应该和截图中看到的一样。 ftp://192.168.1.20/pub ![Access FTP Files via Browser](http://www.tecmint.com/wp-content/uploads/2014/10/browse-ftp-files.jpg) -通过浏览器访问FTP文件 + +*通过浏览器访问FTP文件* **15.** 要解决PXE服务器最终的配置或其它信息产生的问题,请在live模式下诊断,命令如下: # tailf /var/log/messages ![Check PXE Logs for Errors](http://www.tecmint.com/wp-content/uploads/2014/10/check-pxe-errors.jpg) -检查PXE日志错误 -**16.** 最后,最后所需的步骤就是卸载CentOS 7 DVD,并移除物理介质。 +*检查PXE日志错误* + +**16.** 最后,最终所需的步骤就是卸载CentOS 7 DVD,并移除物理介质。 # umount /mnt ### 步骤9: 配置客户端从网络启动 ### -**17.** 现在,你的客户端可以通过它们的系统BIOS或在**BIOS开机自检**时按指定键来配置网络启动作为**首要启动设备**,具体方法见主板说明手册。 +**17.** 现在,你的客户端可以通过它们的系统BIOS或在**BIOS开机自检**时按指定键来配置网络启动作为**首选启动设备**,具体方法见主板说明手册。 为了选择网络启动,在第一次PXE提示符出现时,请按下**F8**键进入到PXE安装界面,然后敲**回车**键继续进入PXE菜单。 ![PXE Network Boot](http://www.tecmint.com/wp-content/uploads/2014/10/pxe-network-boot.jpg) -PXE网络启动 + +*PXE网络启动* ![PXE Network OS Boot](http://www.tecmint.com/wp-content/uploads/2014/10/pxe-network-os-boot.jpg) -PXE网络OS启动 + +*PXE网络OS启动* **18.** 一旦你进入PXE菜单,请选择你的CentOS 7安装类型,敲**回车**键继续安装过程,就像你使用本地启动介质安装一样。 -请记下这一点,使用菜单中的变体2需要激活目标客户端上的互联网连接。在下面的屏幕截图中,你可以通过VNC看到远程安装的实例。 +请记住这一点,使用菜单中的变体2需要激活目标客户端上的互联网连接。在下面的屏幕截图中,你可以通过VNC看到远程安装的实例。 ![PXE Menu](http://www.tecmint.com/wp-content/uploads/2014/10/pxe-menu.jpg) -PXE菜单 + +*PXE菜单* ![Remote Linux Installation via VNC](http://www.tecmint.com/wp-content/uploads/2014/10/os-installation-via-vnc.jpg) -通过VNC远程安装Linux + +*通过VNC远程安装Linux* ![Remote Installation of CentOS](http://www.tecmint.com/wp-content/uploads/2014/10/remote-centos-installation.jpg) -远程安装CentOS + +*远程安装CentOS* 以上是**CentOS 7**上配置最小化**PXE服务器**的所有内容。在我的本系列下一篇文章中,我将讨论其它PXE服务器配置过程中的其它问题,如怎样使用**Kickstart**文件来配置自动化安装**CentOS 7**,以及添加其它Linux发行版到PXE菜单——**Ubuntu Server**和**Debian 7**。 @@ -292,14 +315,14 @@ via: http://www.tecmint.com/install-pxe-network-boot-server-in-centos-7/ 作者:[Matei Cezar][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/) 荣誉推出 [a]:http://www.tecmint.com/author/cezarmatei/ [1]:http://www.tecmint.com/centos-7-installation/ [2]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ -[3]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/ +[3]:http://linux.cn/article-3977-1.html [4]:http://www.tecmint.com/remove-unwanted-services-in-centos-7/ [5]:http://www.tecmint.com/install-ntp-server-in-centos/ [6]:http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html diff --git a/published/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md b/published/201502/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md similarity index 100% rename from published/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md rename to published/201502/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md diff --git a/translated/tech/20141224 Linux FAQs with Answers--How to rename multiple files on Linux.md b/published/201502/20141224 Linux FAQs with Answers--How to rename multiple files on Linux.md similarity index 67% rename from translated/tech/20141224 Linux FAQs with Answers--How to rename multiple files on Linux.md rename to published/201502/20141224 Linux FAQs with Answers--How to rename multiple files on Linux.md index 24120bd386..d804bd390e 100644 --- a/translated/tech/20141224 Linux FAQs with Answers--How to rename multiple files on Linux.md +++ b/published/201502/20141224 Linux FAQs with Answers--How to rename multiple files on Linux.md @@ -1,21 +1,20 @@ -Linux有问必答-- 如何在Linux重命名多个文件 +Linux有问必答:如何在Linux下重命名多个文件 ================================================================================ > **提问**:我知道我可以用mv命令重命名文件。但是当我想重命名很多文件怎么办?如果为每个文件都这么做将会是很乏味的。有没有办法一次性重命名多个文件? -在Linux中,当你想要改变一个文件名,使用mv命令就好了。然而mv不能使用通配符重命名多个文件。可以用sed、awk或者与[xargs][1]结合使用来处理多个文件的情况。然而,这些命令行即繁琐u又不友好,并且如果不小心的话还很容易出错。你不会想要撤销1000个文件的错误名的。 +在Linux中,当你想要改变一个文件名,使用mv命令就好了。然而mv不能使用通配符重命名多个文件。可以用sed、awk或者与[xargs][1]结合使用来处理多个文件的情况。然而,这些命令行即繁琐又不友好,并且如果不小心的话还很容易出错。你不会想要撤销1000个文件的错误名吧! -When it comes to renaming multiple files, the rename utility is probably the easiest, the safest, and the most powerful command-line tool. The rename command is actually a Perl script, and comes pre-installed on all modern Linux distributions. -当你想要重命名多个文件的时候,重命名的工具或许是最简单、最安全和最强大的命令行工具。重命名命令实际上是一个Perl脚本,它预安装在所有的现在Linux发行班上 +当你想要重命名多个文件的时候,rename 工具或许是最简单、最安全和最强大的命令行工具。这个rename命令实际上是一个Perl脚本,它预安装在所有的现在Linux发行版上。 下面是重命名命令的基本语法。 rename [-v -n -f] - 是Perl兼容正则表达式,它表示的是要重命名的文件和该怎么做。正则表达式的形式是‘s/old-name/new-name/’。 +\ 是Perl兼容正则表达式,它表示的是要重命名的文件和该怎么做。正则表达式的形式是‘s/old-name/new-name/’。 ‘-v’选项会显示文件名改变的细节(比如:XXX重命名成YYY)。 -‘-n’选项告诉rename会在不实际改变名称的情况下显示文件将会重命名的情况。这个选项在你想要在不改变文件名的情况下模拟改变文件名的情况下很有用。 +‘-n’选项告诉rename命令在不实际改变名称的情况下显示文件将会重命名的情况。这个选项在你想要在不改变文件名的情况下模拟改变文件名的情况下很有用。 ‘-f’选项强制覆盖存在的文件。 @@ -43,7 +42,7 @@ When it comes to renaming multiple files, the rename utility is probably the eas ### 更改文件名模式 ### -现在让我们考虑包含子模式的更复杂的正则表达式。在PCRE中,子模式包含在圆括号中,$符后接上数字(比如$1,$2)。 +现在让我们考虑更复杂的包含子模式的正则表达式。在PCRE中,子模式包含在圆括号中,$符后接上数字(比如$1,$2)。 比如,下面的命令会将‘img_NNNN.jpeg’变成‘dan_NNNN.jpg’。 @@ -57,7 +56,7 @@ When it comes to renaming multiple files, the rename utility is probably the eas img_5420.jpeg renamed as dan_5420.jpg img_5421.jpeg renamed as dan_5421.jpg -比如,下面的命令会将‘img_000NNNN.jpeg’变成‘dan_NNNN.jpg’。 +比如,下面的命令会将‘img\_000NNNN.jpeg’变成‘dan\_NNNN.jpg’。 # rename -v 's/img_\d{3}(\d{4})\.jpeg$/dan_$1\.jpg/' *jpeg @@ -76,7 +75,7 @@ When it comes to renaming multiple files, the rename utility is probably the eas via: http://ask.xmodulo.com/rename-multiple-files-linux.html 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/share/20141226 How to Download Music from Grooveshark with a Linux OS.md b/published/201502/20141226 How to Download Music from Grooveshark with a Linux OS.md similarity index 86% rename from translated/share/20141226 How to Download Music from Grooveshark with a Linux OS.md rename to published/201502/20141226 How to Download Music from Grooveshark with a Linux OS.md index 0af3e996d3..b6ecc8acbd 100644 --- a/translated/share/20141226 How to Download Music from Grooveshark with a Linux OS.md +++ b/published/201502/20141226 How to Download Music from Grooveshark with a Linux OS.md @@ -6,7 +6,7 @@ **Grooveshark 对于喜欢音乐的人来说是一个不错的在线平台,同时有多种从上面下载音乐的方法。Groovesquid 是众多允许用户从 Grooveshark 上下载音乐的应用之一,并且是支持多平台的。** -只要有在线流媒体服务,就一定有方法从获取你之前看过或听过的视频及音乐。即使下载接口关闭了,也不是什么大不了的事,因为还有很多种解决方法,无论你用的什么操作系统。比如,网络上就有许多种 YouTube 下载器,同样的道理,从 Grooveshark 上下载音乐也并非难事。 +只要有在线流媒体服务,就一定有方法将你看过或听过的视频及音乐保存到本地。即使下载接口关闭了,也不是什么大不了的事,因为还有很多种解决方法,无论你用的什么操作系统。比如,网络上就有许多种 YouTube 下载器,同样的道理,从 Grooveshark 上下载音乐也并非难事。 现在,得考虑合法性的问题。与许多其他应用一样,Groovesquid 并非是完全不合法的。如果有用户使用应用去做一些非法的事情,那责任应归咎于用户。同样的道理也适用于 utorrent 或者 Bittorrent。只要你不触及版权问题,那你就可以无所顾忌的使用 Groovesquid 了。 @@ -14,7 +14,7 @@ 你能够找到的 Groovesquid 的唯一缺点是,它是基于 Java 而编写的,这从来都不是一个好的兆头。虽然为了确保应用的可移植性这样做确实是一个好方法,但这样做的结果导致了其糟糕的界面。确实是非常糟糕的的界面,不过这一点并不会影响到用户的使用体验,特别是这款应用所完成的工作时如此的有用。 -有一点需要注意的地方。Groovesquid 是一款免费的应用,但为了将免费保持下去,它会在菜单栏的右侧显示一则广告。这对大多数人来说都应该不是问题,不过最好在打开应用后注意下菜单栏右侧。 +有一点需要注意的地方。Groovesquid 是一款免费的应用,但为了将免费保持下去,它会在菜单栏的右侧显示一则广告。这对大多数人来说都应该不是问题,不过最好在打开应用后注意下菜单栏右侧(那不是应用的一部分)。 从易用性的角度来看,这款应用非常简洁。用户可以通过在顶部地址栏里输入链接直接下载单曲,地址栏的位置可以通过其左侧的下拉菜单进行修改。在下拉菜单中,也可以修改为歌曲名称、流行度、专辑名称、播放列表以及艺术家。有些选项向你提供了诸如查看 Grooveshark 上最流行的音乐,或者下载整个播放列表等。 @@ -38,7 +38,7 @@ via: http://news.softpedia.com/news/How-to-Download-Music-from-Grooveshark-with- 作者:[Silviu Stahie][a] 译者:[Stevearzh](https://github.com/Stevearzh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/201502/20141229 4 Steps to Setup Local Repository in Ubuntu using APT-mirror.md b/published/201502/20141229 4 Steps to Setup Local Repository in Ubuntu using APT-mirror.md new file mode 100644 index 0000000000..dc9d72ef77 --- /dev/null +++ b/published/201502/20141229 4 Steps to Setup Local Repository in Ubuntu using APT-mirror.md @@ -0,0 +1,125 @@ +使用 APT-mirror 四步配置 Ubuntu 本地软件仓库 +================================================================================ +今天,我们将向你展示如何在你的 Ubuntu 个人电脑或 Ubuntu 服务器中,直接通过 Ubuntu 官方软件仓库来配置本地软件仓库。在你的电脑中创建一个本地软件仓库有着许多的好处。假如你有许多电脑需要安装软件 、安全升级和修复补丁,那么配置一个本地软件仓库是一个做这些事情的高效方法。因为,所有需要安装的软件包都可以通过快速的局域网连接从你的本地服务器中下载,这样可以节省你的网络带宽,降低互联网接入的年度开支 ... + +你可以使用多种工具在你的本地个人电脑或服务器中配置一个 Ubuntu 的本地软件仓库,但在本教程中,我们将为你介绍 APT-Mirror。这里,我们将把默认的镜像包镜像到我们本地的服务器或个人电脑中,并且在你的本地或外置硬盘中,我们至少需要 **120 GB** 或更多的可用空间才行。 我们可以通过配置一个 **HTTP** 或 **FTP** 服务器来与本地系统客户端共享这个软件仓库。 + +我们需要安装 Apache 网络服务器和 APT-Mirror 来使得我们的工作得以开始。下面是配置一个可工作的本地软件仓库的步骤: + +### 1. 安装需要的软件包 ### + +我们需要从 Ubuntu 的公共软件包仓库中取得所有的软件包,然后在我们本地的 Ubuntu 服务器硬盘中保存它们。 + +首先我们安装一个Web 服务器来承载我们的本地软件仓库。这里我们将安装 Apache Web 服务器,但你可以安装任何你中意的 Web 服务器。对于 http 协议,Web 服务器是必须的。假如你需要配置 ftp 协议 及 rsync 协议,你还可以再分别额外安装 FTP 服务器,如 proftpd, vsftpd 等等 和 Rsync 。 + + $ sudo apt-get install apache2 + +然后我们需要安装 apt-mirror: + + $ sudo apt-get install apt-mirror + +![apt-mirror-installation](http://blog.linoxide.com/wp-content/uploads/2014/12/apt-mirror-install.png) + +**注: 正如我先前提到的,我们需要至少 120 GB 的可用空间来使得所有的软件包被镜像或下载。** + +### 2. 配置 APT-Mirror ### + +现在,在你的硬盘上创建一个目录来保存所有的软件包。例如,我们创建一个名为 `/linoxide`的目录,我们将在这个目录中保存所有的软件包: + + $ sudo mkdir /linoxide + +![repo-dir](http://blog.linoxide.com/wp-content/uploads/2014/12/mkdir-linoxide.png) + +现在,打开文件 **/etc/apt/mirror.list** : + + $ sudo nano /etc/apt/mirror.list + +![apt-mirror-edit](http://blog.linoxide.com/wp-content/uploads/2014/12/edit-mirror-list-300x7.png) + +复制下面的命令行配置到 `mirror.list`文件中并按照你的需求进行修改: + + ############# config ################## + # + set base_path /linoxide + # + # set mirror_path $base_path/mirror + # set skel_path $base_path/skel + # set var_path $base_path/var + # set cleanscript $var_path/clean.sh + # set defaultarch + # set postmirror_script $var_path/postmirror.sh + # set run_postmirror 0 + set nthreads 20 + set _tilde 0 + # + ############# end config ############## + + deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse + #deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse + #deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse + + deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse + deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse + deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse + #deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse + #deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse + + clean http://archive.ubuntu.com/ubuntu + +![mirror-list-config](http://blog.linoxide.com/wp-content/uploads/2014/12/mirror-list-config.png) + +**注: 你可以将上面的官方镜像服务器网址更改为离你最近的服务器的网址,可以通过访问 [Ubuntu Mirror Server][1]来找到这些服务器地址。假如你并不太在意镜像完成的时间,你可以沿用默认的官方镜像服务器网址。** + +这里,我们将要镜像最新和最大的 Ubuntu LTS 发行版 --- 即 Ubuntu 14.04 LTS (Trusty Tahr) --- 的软件包仓库,所以在上面的配置中发行版本号为 trusty 。假如我们需要镜像 Saucy 或其他的 Ubuntu 发行版本,请修改上面的 trusy 为相应的代号。 + +现在,我们必须运行 apt-mirror 来下载或镜像官方仓库中的所有软件包。 + + sudo apt-mirror + +从 Ubuntu 服务器中下载所有的软件包所花费的时间取决于你和镜像服务器之间的网络连接速率和性能。这里我中断了下载,因为我已经下载好了 ... + +![downloading-packages](http://blog.linoxide.com/wp-content/uploads/2014/12/downloading-index.png) + +### 3.配置网络服务器 ### + +为了使得其他的电脑能够访问这个软件仓库,你需要一个Web服务器。你也可以通过 ftp 来完成这件事,但我选择使用一个Web服务器因为在上面的步骤 1 中我提及到使用Web服务器。因此,我们现在要对 Apache 服务器进行配置: + +我们将为我们本地的软件仓库目录 建立一个到 Apache 托管目录 --- 即 `/var/www/ubuntu` --- 的符号链接。 + + $ sudo ln -s /linoxide /var/www/ubuntu + $ sudo service apache2 start + +![symlinks-apache2](http://blog.linoxide.com/wp-content/uploads/2014/12/symblink-apache2.png) + +上面的命令将允许我们从本地主机(localhost) --- 即 http://127.0.0.1(默认情况下) --- 浏览我们的镜像软件仓库。 + +### 4. 配置客户端 ### + +最后,我们需要在其他的电脑中添加软件源,来使得它们可以从我们的电脑中取得软件包或软件仓库。为达到此目的,我们需要编辑 `/etc/apt/sources.list` 文件并添加下面的命令: + + $ sudo nano /etc/apt/sources.list + +添加下面的一行到` /etc/apt/sources.list`中并保存。 + + deb http://192.168.0.100/ubuntu/ trusty main restricted universe + +**注: 这里的 192.168.0.100 是我们的服务器电脑的局域网 IP 地址,你需要替换为你的服务器电脑的局域网 IP 地址** + + $ sudo apt-get update + +最终,我们完成了任务。现在,你可以使用`sudo apt-get install packagename` 命令来从你的本地 Ubuntu 软件仓库中安装所需的软件包,这将会是高速的且消耗很少的带宽。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/setup-local-repository-ubuntu/ + +作者:[Arun Pyasi][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://launchpad.net/ubuntu/+archivemirrors diff --git a/translated/tech/20141229 How to Create Btrfs Filesystem in Linux and its Features.md b/published/201502/20141229 How to Create Btrfs Filesystem in Linux and its Features.md similarity index 91% rename from translated/tech/20141229 How to Create Btrfs Filesystem in Linux and its Features.md rename to published/201502/20141229 How to Create Btrfs Filesystem in Linux and its Features.md index 8ab85e81dc..9439ace204 100644 --- a/translated/tech/20141229 How to Create Btrfs Filesystem in Linux and its Features.md +++ b/published/201502/20141229 How to Create Btrfs Filesystem in Linux and its Features.md @@ -28,7 +28,7 @@ Btrfs文件系统在Linux中的创建及其特性 ### 转换到Btrfs ### -**警告:在尝试转换文件系统前,请务必备份数据。虽然此操作很稳定,也很安全,但它仍然可能导致数据丢失,而防止此情况发生的唯一途径就是进行数据备份。** +**警告:在尝试转换文件系统前,请务必备份数据!虽然此操作很稳定,也很安全,但它仍然可能导致数据丢失,而防止此情况发生的唯一途径就是进行数据备份。** 将现存的ext4文件系统转换到btrfs是相当简单而易懂的。你首先需要使用fsck来检查你现存分区上是否存在错误,然后使用btrfs-convert命令进行转换。如果你想要对/dev/sda3分区进行转换,你可以进行以下操作: @@ -41,7 +41,7 @@ Btrfs文件系统在Linux中的创建及其特性 ### 转换根分区 ### -如果你想要对你系统上的根分区进行转换,你首先需要使用Live CD启动。对于Ubuntu,你可以使用Ubuntu安装CD来完成此操作,在启动后第一个屏幕选择“尝试Ubuntu”。对于其它系统,你同样可以使用Live CD镜像,操作类似。 +如果你想要对你系统上的根分区进行转换,你首先需要使用Live CD启动。对于Ubuntu,你可以使用Ubuntu安装盘来完成此操作,在启动后第一个屏幕选择“尝试Ubuntu”。对于其它系统,你同样可以使用Live CD镜像,操作类似。 在启动后,打开终端,使用下面的命令来转换文件系统。 @@ -57,7 +57,7 @@ Btrfs文件系统在Linux中的创建及其特性 ![btrfs-root-convert](http://blog.linoxide.com/wp-content/uploads/2014/11/btrfs-root-convert.jpg) -现在来编辑fstab,并根据blkid输出的结果来修改当前/文件系统的UUID,并将它的文件系统类型修改为btrfs,修改后的行如下: +现在来编辑fstab,并根据blkid输出的结果来修改当前“/”文件系统的UUID,并将它的文件系统类型修改为btrfs,修改后的行如下: UUID=8e7e80aa-337e-4179-966d-d60128bd3714 / btrfs defaults 0 1 @@ -74,7 +74,7 @@ via: http://linoxide.com/file-system/create-btrfs-features/ 作者:[Adrian Dinu][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/) 荣誉推出 diff --git a/translated/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md b/published/201502/20150104 Auditd--Tool for Security Auditing on Linux Server.md similarity index 73% rename from translated/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md rename to published/201502/20150104 Auditd--Tool for Security Auditing on Linux Server.md index 1071e1521b..3e528fffa6 100644 --- a/translated/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md +++ b/published/201502/20150104 Auditd--Tool for Security Auditing on Linux Server.md @@ -1,14 +1,14 @@ Auditd - Linux 服务器安全审计工具 ================================================================================ -首先,Linoxide组祝读者 **2015新年快乐万事如意!** 。下面开始这个新年版审计工具的介绍。 +首先,Linux中国祝贺读者 **2015羊年春节快乐,万事如意!** 。下面开始这个新年版审计工具的介绍。 -安全防护是首先要考虑的问题。为了避免别人盗取我们的数据,我们需要维护它。安全防护包括很多东西,审计是其中一个。 +安全防护是首先要考虑的问题。为了避免别人盗取我们的数据,我们需要时刻关注它。安全防护包括很多东西,审计是其中之一。 -我们知道Linux系统上有一个叫 **auditd** 的审计工具。这个工具在大多数Linux操作系统中是默认安装的。审计工具是什么?如何使用?下面我们开始介绍。 +我们知道Linux系统上有一个叫 **auditd** 的审计工具。这个工具在大多数Linux操作系统中是默认安装的。那么auditd 是什么?如何使用呢?下面我们开始介绍。 ### 什么是审计? ### -审计(或审计监控)是Linux审计系统中用户部分的一个组件,负责将审计记录写入磁盘。 +auditd(或 auditd 守护进程)是Linux审计系统中用户空间的一个组件,其负责将审计记录写入磁盘。 ![](http://blog.linoxide.com/wp-content/uploads/2014/12/what_is_auditd.png) @@ -20,16 +20,17 @@ Ubuntu系统中,我们可以使用 [wajig][1] 工具或者 **apt-get 工具** 按照下面的说明安装auditd,安装完毕后将自动安装以下auditd和相关的工具: -- **auditctl ;** 运行过程中控制守护进程的工具,比如如添加规则等等。 -- **/etc/audit/audit.rules ;** 记录审计规则的文件。 -- **aureport ;** 查看和生成审计报告的工具。 -- **ausearch ;** 查找审计事件的工具 -- **auditspd ;** 转发事件通知给其他应用程序,不写审计日志文件。 -- **autrace ;** 跟踪处理过程的命令。 -- **/etc/audit/auditd.conf ;** auditd工具的配置文件。 -- 首次安装 **auditd** 后, 审计规则是空的。 +- **auditctl :** 即时控制审计守护进程的行为的工具,比如如添加规则等等。 +- **/etc/audit/audit.rules :** 记录审计规则的文件。 +- **aureport :** 查看和生成审计报告的工具。 +- **ausearch :** 查找审计事件的工具 +- **auditspd :** 转发事件通知给其他应用程序,而不是写入到审计日志文件中。 +- **autrace :** 一个用于跟踪进程的命令。 +- **/etc/audit/auditd.conf :** auditd工具的配置文件。 -可以使用以下命令查看 +首次安装 **auditd** 后, 审计规则是空的。 + +可以使用以下命令查看: $ sudo auditctl -l @@ -41,7 +42,7 @@ Ubuntu系统中,我们可以使用 [wajig][1] 工具或者 **apt-get 工具** #### Audit 文件和目录访问审计 #### -我们使用审计工具的一个目的是监控文件和目录的更改。对于auditd工具,我们可使用命令来配置(注意,以下命令需要root权限)。 +我们使用审计工具的一个基本的需求是监控文件和目录的更改。使用auditd工具,我们可通过如下命令来配置(注意,以下命令需要root权限)。 **文件审计** @@ -51,9 +52,9 @@ Ubuntu系统中,我们可以使用 [wajig][1] 工具或者 **apt-get 工具** **选项 :** -- **-w path ;** 监控指定的路径,上面的命令指定监控路径 /etc/passwd -- **-p ; ** 指定触发审计的文件和目录的访问权限 -- **rwxa ;** 指定的触发条件,r 读取权限,w 写入权限,x 执行权限 +- **-w path :** 指定要监控的路径,上面的命令指定了监控的文件路径 /etc/passwd +- **-p :** 指定触发审计的文件/目录的访问权限 +- **rwxa :** 指定的触发条件,r 读取权限,w 写入权限,x 执行权限,a 属性(attr) #### 目录审计 #### @@ -79,31 +80,41 @@ Ubuntu系统中,我们可以使用 [wajig][1] 工具或者 **apt-get 工具** $ sudo ausearch -f /etc/passwd -- **-f** 设定ausearch审计/etc/passwd文件 -- 下面是输出 : +- **-f** 设定ausearch 调出 /etc/passwd文件的审计内容 + +下面是输出 : + > **time**->Mon Dec 22 09:39:16 2014 + > type=PATH msg=audit(1419215956.471:194): item=0 **name="/etc/passwd"** inode=142512 dev=08:01 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL + > type=CWD msg=audit(1419215956.471:194): **cwd="/home/pungki"** + > type=SYSCALL msg=audit(1419215956.471:194): arch=40000003 **syscall=5** success=yes exit=3 a0=b779694b a1=80000 a2=1b6 a3=b8776aa8 items=1 ppid=2090 pid=2231 **auid=4294967295 uid=1000 gid=1000** euid=0 suid=0 fsuid=0 egid=1000 sgid=1000 fsgid=1000 tty=pts0 ses=4294967295 **comm="sudo" exe="/usr/bin/sudo"** key=(null) 下面开始解读输出结果。 -- **time ;** 审计时间。 -- **name ;** 审计对象 -- **cwd ;** 当前路径 -- **syscall ;** 相关的系统调用 -- **auid ;** 审计用户ID -- **uid and gid ;** 访问文件的用户ID和用户组ID -- **comm ;** 用户访问文件的命令 -- **exe ;** 上面命令的可执行文件路径 -- 以上审计日志显示文件未被改动。 +- **time :** 审计时间。 +- **name :** 审计对象 +- **cwd :** 当前路径 +- **syscall :** 相关的系统调用 +- **auid :** 审计用户ID +- **uid 和 gid :** 访问文件的用户ID和用户组ID +- **comm :** 用户访问文件的命令 +- **exe :** 上面命令的可执行文件路径 - 以下我们将要添加一个用户,看看auditd如何记录文件 /etc/passwd的改动的。 +以上审计日志显示文件未被改动。 + +以下我们将要添加一个用户,看看auditd如何记录文件 /etc/passwd的改动的。 > **time->**Mon Dec 22 11:25:23 2014 + > type=PATH msg=audit(1419222323.628:510): item=1 **name="/etc/passwd.lock"** inode=143992 dev=08:01 mode=0100600 ouid=0 ogid=0 rdev=00:00 nametype=DELETE + > type=PATH msg=audit(1419222323.628:510): item=0 **name="/etc/"** inode=131073 dev=08:01 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT + > type=CWD msg=audit(1419222323.628:510): **cwd="/root"** + > type=SYSCALL msg=audit(1419222323.628:510): arch=40000003 **syscall=10** success=yes exit=0 a0=bfc0ceec a1=0 a2=bfc0ceec a3=897764c items=2 ppid=2978 pid=2994 **auid=4294967295 uid=0 gid=0** euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=4294967295 **comm="chfn" exe="/usr/bin/chfn"** key=(null) 我们可以看到,在指定的时间,**/etc/passwd ** 被root用户(uid =0, gid=0)在/root目录下修改。/etc/passwd 文件是使用**/usr/bin/chfn** 访问的。 @@ -133,7 +144,7 @@ Ubuntu系统中,我们可以使用 [wajig][1] 工具或者 **apt-get 工具** 一旦定义审计规则后,它会自动运行。过一段时间后,我们可以看看auditd是如何帮我们跟踪审计的。 -Auditd提供了另一个工具叫 **aureport** 。从名字上可以猜到, **aureport** 是使用系统日志生成简要报告的工具。 +Auditd提供了另一个工具叫 **aureport** 。从名字上可以猜到, **aureport** 是使用系统审计日志生成简要报告的工具。 我们已经配置auditd去跟踪/etc/passwd文件。auditd参数设置后一段时间后,audit.log 文件就创建出来了。 @@ -155,7 +166,7 @@ Auditd提供了另一个工具叫 **aureport** 。从名字上可以猜到, * 从上图可以看出,由两个用户在特定的时间授权失败。 -如果我们想看所有相关账户修改的事件,可以使用-m参数。 +如果我们想看所有账户修改相关的事件,可以使用-m参数。 $ sudo aureport -m @@ -165,8 +176,10 @@ Auditd提供了另一个工具叫 **aureport** 。从名字上可以猜到, * 我们已经添加如下规则: +- $ sudo auditctl -w /etc/passwd -p rwxa - $ sudo auditctl -w /production/ -- 现在,如果确信这些规则正常,我们可以将其添加到**/etc/audit/audit.rules**中使得规则永久有效。以下介绍如何将他们添加到/etc/audit/audit.rules中去。 + +现在,如果确信这些规则可以正常工作,我们可以将其添加到**/etc/audit/audit.rules**中使得规则永久有效。以下介绍如何将他们添加到/etc/audit/audit.rules中去。 ![](http://blog.linoxide.com/wp-content/uploads/2014/12/audit_rules_file.png) @@ -192,7 +205,7 @@ via: http://linoxide.com/how-tos/auditd-tool-security-auditing/ 作者:[Pungki Arianto][a] 译者:[shipsw](https://github.com/shipsw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150104 How To Install Websvn In CentOS 7.md b/published/201502/20150104 How To Install Websvn In CentOS 7.md similarity index 80% rename from translated/tech/20150104 How To Install Websvn In CentOS 7.md rename to published/201502/20150104 How To Install Websvn In CentOS 7.md index c636f06da0..b1b8f87407 100644 --- a/translated/tech/20150104 How To Install Websvn In CentOS 7.md +++ b/published/201502/20150104 How To Install Websvn In CentOS 7.md @@ -1,6 +1,6 @@ -CentOS 7中安装Websvn +在 CentOS 7中安装Websvn ================================================================================ -**WebSVN**为你的Subversion提供了一个试图,它设计用来反映Subversion的一整套方法。你可以检查任何文件或目录的日志,以及查看任何指定修改库中修改、添加或删除过的文件列表。你也可以检查同一文件两个版本的不同之处,以便确切地查看某个特性修订版中的修改。 +**WebSVN**为你的Subversion提供了一个视图,其设计用来对应Subversion的各种功能。你可以检查任何文件或目录的日志,以及查看任何指定版本中所修改、添加或删除过的文件列表。你也可以检查同一文件两个版本的不同之处,以便确切地查看某个特定的修订版本的变化。 ### 特性 ### @@ -8,31 +8,25 @@ WebSVN提供了以下这些特性: - 易于使用的界面; - 可自定义的模板系统; -- 文件列表的着色; +- 彩色文件列表; - 过错视图; - 日志信息搜索; - 支持RSS订阅; ### 安装 ### -我使用以下链接来将Subversion安装到CentOS 7。 +我按以下链接来将Subversion安装到CentOS 7。 - [CentOS 7上如何安装Subversion][1] **1 – 下载websvn到/var/www/html。** cd /var/www/html - ----------- - wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip **2 – 解压zip包。** unzip websvn-2.3.3.zip - ----------- - mv websvn-2.3.3 websvn **3 – 安装php到你的系统。** @@ -42,13 +36,7 @@ WebSVN提供了以下这些特性: **4 – 编辑web svn配置。** cd /var/www/html/websvn/include - ----------- - cp distconfig.php config.php - ----------- - vi config.php ---------- @@ -96,7 +84,7 @@ via: http://www.unixmen.com/install-websvn-centos-7/ 作者:[M.el Khamlichi][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/) 荣誉推出 diff --git a/published/201502/20150105 How To Install Kodi 14 (XBMC) In Ubuntu 14.04 and Linux Mint 17.md b/published/201502/20150105 How To Install Kodi 14 (XBMC) In Ubuntu 14.04 and Linux Mint 17.md new file mode 100644 index 0000000000..64e065fa5b --- /dev/null +++ b/published/201502/20150105 How To Install Kodi 14 (XBMC) In Ubuntu 14.04 and Linux Mint 17.md @@ -0,0 +1,50 @@ +如何在 Ubuntu 14.04 和 Linux Mint 17 中安装 Kodi14(XBMC) +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Kodi_Xmas.jpg) + +[Kodi][1],原名就是大名鼎鼎的XBMC,发布了开发代号为Helix的[最新版本14][2]。感谢官方XMBC提供的PPA,现在可以很简单地在Ubuntu14.04中安装了。 + +有些人可能还不了解Kodi,它是一个媒体中心软件,支持所有平台,如Windows、Linux、 Mac, Android等。此软件拥有全屏的媒体中心,可以管理所有音乐和视频,不单支持本地文件还支持网络播放,如Tube、[Netflix][3]、 Hulu, Amazon Prime和其他流媒体服务商。 + +### 在 Ubuntu 14.04 和 Linux Mint 17 中安装 XBMC 14 Kodi Helix ### + +再次感谢官方的PPA,让我们可以轻松安装Kodi 14。支持Ubuntu 14.04、Ubuntu 12.04、Linux Mint 17、Pinguy OS 14.04、Deepin 2014、LXLE 14.04、Linux Lite 2.0, Elementary OS 以及其他基于 Ubuntu 的 Linux 发行版。 + +打开终端(Ctrl+Alt+T)然后使用下列命令。 + + sudo add-apt-repository ppa:team-xbmc/ppa + sudo apt-get update + sudo apt-get install kodi + +需要下载大约100MB,在我看来,这不是很大。若需安装解码插件,使用下列命令: + + sudo apt-get install kodi-audioencoder-* kodi-pvr-* + +#### 从 Ubuntu 中移除 Kodi 14 #### + +从系统中移除 Kodi 14,使用下列命令: + + sudo apt-get remove kodi + +同样也应该移除PPA软件源: + + sudo add-apt-repository --remove ppa:team-xbmc/ppa + +我希望这篇简单的文章可以帮助到你在Ubuntu、Linux Mint 和其他 Linux 版本中轻松安装 Kodi 14。你是怎么发现 Kodi 14 Helix 的? + +你有没有使用其他的媒体中心来作为 XBMC 的替代?可以在下面的评论区分享你的观点。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-kodi-14-xbmc-in-ubuntu-14-04-linux-mint-17/ + +作者:[Abhishek][a] +译者:[Vic020/VicYu](http://www.vicyu.net) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/Abhishek/ +[1]:http://kodi.tv/ +[2]:http://kodi.tv/kodi-14-0-helix-unwinds/ +[3]:http://itsfoss.com/watch-netflix-in-ubuntu-14-04/ diff --git a/published/201502/20150105 How To Install Winusb In Ubuntu 14.04.md b/published/201502/20150105 How To Install Winusb In Ubuntu 14.04.md new file mode 100644 index 0000000000..8fb636c6d2 --- /dev/null +++ b/published/201502/20150105 How To Install Winusb In Ubuntu 14.04.md @@ -0,0 +1,47 @@ +如何在 Ubuntu 14.04 中安装 Winusb +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/WinUSB_Ubuntu_1404.jpeg) + +[WinUSB][1]是一款即简单又有用的工具,可以让你从 Windows ISO 镜像或者 DVD 中创建 USB 安装盘(LCTT译注:支持将 Windows Vista/7/8/PE 制作成 USB 安装盘)。它支持 GUI 和命令行,你可以根据你的喜好决定使用哪种。 + +在本文中我们会展示**如何在 Ubuntu 14.04、14.10 和 Linux Mint 17 中安装 WinUSB**。 + +### 在 Ubuntu 14.04、14.10 和 Linux Mint 17 中安装 WinUSB ### + +在 Ubuntu 13.10 之前, WinUSB 一直都在积极开发,且在官方 PPA 中可以找到。但这个 PPA 还没有为 Ubuntu 14.04 和 14.10 更新,不过其二进制文件仍旧可在更新版本的 Ubuntu 和 Linux Mint 中运行。基于[你使用的系统是32位还是64位][2],使用下面的命令来下载二进制文件: + +打开终端,32位的系统下使用下面的命令: + + wget https://launchpad.net/~colingille/+archive/freshlight/+files/winusb_1.0.11+saucy1_i386.deb + +对于64位的系统,使用下面的命令: + + wget https://launchpad.net/~colingille/+archive/freshlight/+files/winusb_1.0.11+saucy1_amd64.deb + +当你下载了正确的二进制包,你可以用下面的命令安装WinUSB: + + sudo dpkg -i winusb* + +不要担心在你安装WinUSB时看到的错误。使用这条命令修复依赖错误: + + sudo apt-get -f install + +之后,你就可以在 Unity Dash 中查找 WinUSB 并且用它在 Ubuntu 14.04 中创建 Windows 的 live USB 了。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/WinUSB_Ubuntu.png) + +我希望这篇文章能够帮到你**在 Ubuntu 14.04、14.10 和 Linux Mint 17 中安装 WinUSB**。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-winusb-in-ubuntu-14-04/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/Abhishek/ +[1]:http://en.congelli.eu/prog_info_winusb.html +[2]:http://itsfoss.com/how-to-know-ubuntu-unity-version/ diff --git a/translated/tech/20150105 Ubuntu apt-get and apt-cache commands with practical examples.md b/published/201502/20150105 Ubuntu apt-get and apt-cache commands with practical examples.md similarity index 90% rename from translated/tech/20150105 Ubuntu apt-get and apt-cache commands with practical examples.md rename to published/201502/20150105 Ubuntu apt-get and apt-cache commands with practical examples.md index 7574a065f8..0b581084a5 100644 --- a/translated/tech/20150105 Ubuntu apt-get and apt-cache commands with practical examples.md +++ b/published/201502/20150105 Ubuntu apt-get and apt-cache commands with practical examples.md @@ -1,6 +1,6 @@ -实例展示Ubuntu中apt-get和apt-cache命令的使用 +apt-get 和 apt-cache 命令实例展示 ================================================================================ -apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具。 apt-get的GUI版本是Synaptic包管理器,本篇中我们会讨论apt-get和apt-cache命令的不同。 +apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具。 apt-get的GUI版本是Synaptic包管理器。本篇中我们会展示apt-get和apt-cache命令的15个不同例子。 ### 示例:1 列出所有可用包 ### @@ -16,7 +16,7 @@ apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具 ### 示例:2 用关键字搜索包 ### -这个命令在你不确定包名时很有用,只要在apt-cache(这里原文是apt-get,应为笔误)后面输入与包相关的关键字即可/ +这个命令在你不确定包名时很有用,只要在apt-cache(LCTT 译注:这里原文是apt-get,应为笔误)后面输入与包相关的关键字即可。 linuxtechi@localhost:~$ apt-cache search "web server" apache2 - Apache HTTP Server @@ -37,7 +37,7 @@ apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具 pnp4nagios-bin: /etc/pnp4nagios/nagios.cfg pnp4nagios-bin: /usr/share/doc/pnp4nagios/examples/nagios.cfg -### 示例:3 显示特定包的基本信息 ### +### 示例:3 显示特定包的基本信息 ### linuxtechi@localhost:~$ apt-cache show postfix Package: postfix @@ -92,7 +92,7 @@ apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具 ### 示例:6 使用 “apt-get update” 更新仓库 ### -使用命令“apt-get update”, 我们可以重新从源仓库中同步文件索引。包的索引从“/etc/apt/sources.list”中检索 +使用命令“apt-get update”, 我们可以重新从源仓库中同步文件索引。包的索引从“/etc/apt/sources.list”中检索。 linuxtechi@localhost:~$ sudo apt-get update Ign http://extras.ubuntu.com utopic InRelease @@ -106,7 +106,7 @@ apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具 Ign http://in.archive.ubuntu.com utopic-backports InRelease ................................................................ -### 示例:7 使用apt-get安装包 ### +### 示例:7 使用apt-get安装包 ### linuxtechi@localhost:~$ sudo apt-get install icinga @@ -140,15 +140,15 @@ apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具 Get:1 http://in.archive.ubuntu.com/ubuntu/ utopic/universe icinga amd64 1.11.6-1build1 [1,474 B] Fetched 1,474 B in 1s (1,363 B/s) -上面的目录会从你当前的目录下载icinga包。 +上面的目录会把icinga包下载到你的当前工作目录。 ### 示例:12 清理本地包占用的磁盘空间 ### linuxtechi@localhost:~$ sudo apt-get clean -上面的命令会清零apt-get在下载包时占用的磁盘空间。 +上面的命令会清空apt-get所下载的包占用的磁盘空间。 -我们也可以使用“**autoclean**”选项来代替“**clean**“,两者之间主要的区别是autoclean清理不再使用且没用的下载。 +我们也可以使用“**autoclean**”选项来代替“**clean**”,两者之间主要的区别是autoclean清理不再使用且没用的下载。 linuxtechi@localhost:~$ sudo apt-get autoclean Reading package lists... Done @@ -167,9 +167,9 @@ apt-get和apt-cache是**Ubuntu Linux**中的命令行下的**包管理**工具 Get:1 Changelog for apache2 (http://changelogs.ubuntu.com/changelogs/pool/main/a/apache2/apache2_2.4.10-1ubuntu1/changelog) [195 kB] Fetched 195 kB in 3s (60.9 kB/s) -上面的命令会下载apache2的更新日志,并在你屏幕上显示。 +上面的命令会下载apache2的更新日志,并在你屏幕上分页显示。 -### 示例15 使用 “check” 选项显示损坏的依赖 ### +### 示例:15 使用 “check” 选项显示损坏的依赖关系 ### linuxtechi@localhost:~$ sudo apt-get check Reading package lists... Done @@ -182,7 +182,7 @@ via: http://www.linuxtechi.com/ubuntu-apt-get-apt-cache-commands-examples/ 作者:[Pradeep Kumar][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150106 How to deduplicate files on Linux with dupeGuru.md b/published/201502/20150106 How to deduplicate files on Linux with dupeGuru.md similarity index 51% rename from translated/tech/20150106 How to deduplicate files on Linux with dupeGuru.md rename to published/201502/20150106 How to deduplicate files on Linux with dupeGuru.md index b8ffbd37e8..143e786e09 100644 --- a/translated/tech/20150106 How to deduplicate files on Linux with dupeGuru.md +++ b/published/201502/20150106 How to deduplicate files on Linux with dupeGuru.md @@ -1,10 +1,10 @@ -如何在Linux上使用dupeGuru删除重复文件 +删除重复文件的神器:dupeGuru ================================================================================ -最近,我被要求清理我父亲的文件和文件夹。有一个难题是,里面存在很多不正确的名字的重复文件。有移动硬盘的备份,同时还为同一个文件编辑了多个版本,甚至改变的目录结构,同一个文件被复制了好几次,改变名字,改变位置等,这些挤满了磁盘空间。追踪每一个文件成了一个最大的问题。万幸的是,有一个小巧的软件可以帮助你省下很多时间来找到删除你系统中重复的文件:[dupeGuru][1]。它用Python写成,这个去重软件几个小时钱前切换到了GPLv3许可证。因此是时候用它来清理你的文件了! +最近,我需要清理我父亲的文件和文件夹。有一个难题是,里面存在很多不正确的名字的重复文件。有移动硬盘的备份,同时还为同一个文件编辑了多个版本,甚至改变的目录结构,同一个文件被复制了好几次,名字改变,位置改变等,这些文件挤满了磁盘空间。追踪每一个文件成了一个最大的问题。万幸的是,有一个小巧的软件可以帮助你省下很多时间来找到删除你系统中重复的文件:[dupeGuru][1]。它用Python写成,这个去重软件几个小时前切换到了GPLv3许可证。因此是时候用它来清理你的文件了! ### dupeGuru的安装 ### -在Ubuntu上, 你可以加入Hardcoded的软件PPA: +在Ubuntu上, 你可以加入如下硬编码的软件PPA: $ sudo apt-add-repository ppa:hsoft/ppa $ sudo apt-get update @@ -33,29 +33,29 @@ DupeGuru的构想是既快又安全。这意味着程序不会在你的系统上 ![](https://farm9.staticflickr.com/8600/16016041367_5ab2834efb_z.jpg) -注意的是默认上dupeGuru基于文件的内容匹配,而不是他们的名字。为了防止意外地删除了重要的文件,匹配那列列出了使用的匹配算法。在这里,你可以选择你想要删除的匹配文件,并按下“Action” 按钮来看到可用的操作。 +注意的是默认上dupeGuru基于文件的内容匹配,而不是他们的名字。为了防止意外地删除了重要的文件,匹配列列出了其使用的匹配算法。在这里,你可以选择你想要删除的匹配文件,并按下“Action” 按钮来看到可用的操作。 ![](https://farm8.staticflickr.com/7516/16199976361_c8f919b06e_b.jpg) -可用的选项是相当广泛的。简而言之,你可以删除重复、移动到另外的位置、忽略它们、打开它们、重命名它们甚至用自定义命令运行它们。如果你选择删除重复文件,你可能会像我一样非常意外竟然还有删除选项。 +可用的选项相当广泛。简而言之,你可以删除重复、移动到另外的位置、忽略它们、打开它们、重命名它们甚至用自定义命令运行它们。如果你希望删除重复文件,你可能会像我一样非常意外竟然有这么多种删除方式。 ![](https://farm8.staticflickr.com/7503/16014366568_54f70e3140.jpg) -你不及可以将删除文件移到垃圾箱或者永久删除,还可以选择留下指向原文件的链接(软链接或者硬链接)。也就是说,重复文件按将会删除但是会保留下指向原文件的链接。这将会省下大量的磁盘空间。如果你将这些文件导入到工作空间或者它们有一些依赖时很有用。 +你不仅可以将删除的文件移到垃圾箱或者永久删除,还可以选择留下指向原文件的链接(软链接或者硬链接)。也就是说,重复文件将会删除文件存储,但是会保留下一个指向原文件的链接。这将会省下大量的磁盘空间。如果你将这些文件导入到工作空间或者它们有一些依赖时很有用。 -还有一个奇特的选项:你可以用HTML或者CSV文件导出结果。不确定你会不会这么做,但是我假设你想追踪重复文件而不是想让dupeGuru处理它们时会有用。 +还有一个奇特的选项:你可以用HTML或者CSV文件导出结果。我不确定你会不会需要这么做,但是我假设你想追踪重复文件而不是想让dupeGuru处理它们时会有用。 -最后但并不是最不重要的是,偏好菜单可以让你对去重的想法成真。 +最后但并不是最不重要的是,偏好菜单可以让你按照你的想法来操作去重这件事。 ![](https://farm8.staticflickr.com/7493/16015755749_a9f343b943_z.jpg) -这里你可以选择扫描的标准,基于内容还是基于文字,并且有一个阈值来控制结果的数量。这里同样可以定义自定义在执行中可以选择的命令。在无数其他小的选项中,要注意的是dupeGuru默认忽略小于10KB的文件。 +这里你可以选择扫描的标准,基于内容还是基于名字,并且有一个阈值来控制结果的数量。这里同样可以定义自定义在执行中可以选择的命令。混在其他那些小的选项中,要注意的是dupeGuru默认忽略小于10KB的文件。 -要了解更多的信息,我建议你到[official website][4]官方网站看下,这里有很多文档、论坛支持和其他好东西。 +要了解更多的信息,我建议你到[官方网站][4]看下,这里有很多文档、论坛支持和其他好东西。 -总结一下,dupeGuru是我无论何时准备备份或者释放空间时想到的软件。我发现这对高级用户而言也足够强大了,对新人而言也很直观。锦上添花的是:dupeGuru是跨平台的额,这意味着你可以在Mac或者在Windows PC上都可以使用。如果你有特定的需求,想要清理音乐或者图片。这里有两个变种:[dupeguru-me][5]和 [dupeguru-pe][6], 相应地可以清理音频和图片文件。与常规版本的不同是它不仅比较文件格式还比较特定的媒体数据像质量和码率。 +总结一下,dupeGuru是我无论何时准备备份或者释放空间时所想到的软件。我发现这对高级用户而言也足够强大了,对新人而言也很直观。锦上添花的是:dupeGuru是跨平台的,这意味着你可以在Mac或者在Windows PC上都可以使用。如果你有特定的需求,想要清理音乐或者图片。这里有两个变种:[dupeguru-me][5]和 [dupeguru-pe][6], 相应地可以清理音频和图片文件。与常规版本的不同是它不仅比较文件格式还比较特定的媒体数据像质量和码率。 -你dupeGuru怎么样?你会考虑使用它么?或者你有任何可以替代的软件的建议么?让我在评论区知道你们的想法。 +你觉得dupeGuru怎么样?你会考虑使用它么?或者你有任何可以替代的软件的建议么?让我在评论区知道你们的想法。 -------------------------------------------------------------------------------- @@ -63,7 +63,7 @@ via: http://xmodulo.com/dupeguru-deduplicate-files-linux.html 作者:[Adrien Brochard][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150106 Managing Linux server configs with the SaltStack.md b/published/201502/20150106 Managing Linux server configs with the SaltStack.md similarity index 90% rename from translated/tech/20150106 Managing Linux server configs with the SaltStack.md rename to published/201502/20150106 Managing Linux server configs with the SaltStack.md index 1acf7c2434..44c980dddc 100644 --- a/translated/tech/20150106 Managing Linux server configs with the SaltStack.md +++ b/published/201502/20150106 Managing Linux server configs with the SaltStack.md @@ -1,20 +1,21 @@ -SaltStack:Linux服务器配置管理神器 +通过 SaltStack 管理服务器配置 ================================================================================ ![](http://techarena51.com/wp-content/uploads/2015/01/SaltStack+logo+-+black+on+white.png) 我在搜索[Puppet][1]的替代品时,偶然间碰到了Salt。我喜欢puppet,但是我又爱上Salt了:)。我发现Salt在配置和使用上都要比Puppet简单,当然这只是一家之言,你大可不必介怀。另外一个爱上Salt的理由是,它可以让你从命令行管理服务器配置,比如: -要通过Salt来更新所有服务器,你只需运行以下命令 +要通过Salt来更新所有服务器,你只需运行以下命令即可 - salt ‘*’ pkg.upgrade + salt '*' pkg.upgrade -**安装SaltStack到Linux上。** -如果你是在CentOS 6/7上安装的话,那么Salt可以通过EPEL仓库获取到。而对于Pi和Ubuntu Linux用户,你可以从[这里][2]添加Salt仓库。Salt是基于python的,所以你也可以使用‘pip’来安装,但是你得用yum-utils或是其它包管理器来自己处理它的依赖关系哦。 +##安装SaltStack到Linux上## -Salt遵循服务器-客户端模式,服务器端称为领主,而客户端则称为下属。 +如果你是在CentOS 6/7上安装的话,那么Salt可以通过EPEL仓库获取到。而对于Pi和Ubuntu Linux用户,你可以从[这里][2]添加Salt仓库。Salt是基于python的,所以你也可以使用‘pip’来安装,但是你得用yum-utils或是其它包管理器来自己处理它的依赖关系。 -**安装并配置Salt领主** +Salt采用服务器-客户端模式,服务器端称为领主,而客户端则称为下属。 + +###安装并配置Salt领主### [root@salt-master~]# yum install salt-master @@ -27,7 +28,7 @@ Salt配置文件位于/etc/salt和/srv/salt。Salt虽然可以开箱即用,但 [root@salt-master ~]# systemctl start salt-master -**安装并配置Salt下属** +###安装并配置Salt下属### [root@salt-minion~]#yum install salt-minion @@ -39,7 +40,7 @@ Salt配置文件位于/etc/salt和/srv/salt。Salt虽然可以开箱即用,但 在启动时,下属客户机会生成一个密钥和一个id。然后,它会连接到Salt领主服务器并验证自己的身份。Salt领主服务器在允许下属客户机下载配置之前,必须接受下属的密钥。 -**在Salt领主服务器上列出并接受密钥** +###在Salt领主服务器上列出并接受密钥### # 列出所有密钥 [root@salt-master~] salt-key -L @@ -59,7 +60,7 @@ Salt配置文件位于/etc/salt和/srv/salt。Salt虽然可以开箱即用,但 在接受下属客户机的密钥后,你可以使用‘salt’命令来立即获取信息。 -**Salt命令行实例** +##Salt命令行实例## # 检查下属是否启动并运行 [root@salt-master~] salt 'minion.com' test.ping @@ -75,15 +76,15 @@ Salt配置文件位于/etc/salt和/srv/salt。Salt虽然可以开箱即用,但 # 安装/更新所有服务器上的软件 [root@salt-master ~]# salt '*' pkg.install git -salt命令需要一些组件来发送信息,其中之一是mimion id,而另一个是下属客户机上要调用的函数。 +salt命令需要一些组件来发送信息,其中之一是下属客户机的id,而另一个是下属客户机上要调用的函数。 在第一个实例中,我使用‘test’模块的‘ping’函数来检查系统是否启动。该函数并不是真的实施一次ping,它仅仅是在下属客户机作出回应时返回‘真’。 ‘cmd.run’用于执行远程命令,而‘pkg’模块包含了包管理的函数。本文结尾提供了全部内建模块的列表。 -**颗粒实例** +###颗粒实例### -Salt使用一个名为**颗粒**的界面来获取系统信息。你可以使用颗粒在指定属性的系统上运行命令。 +Salt使用一个名为**颗粒(Grains)**的界面来获取系统信息。你可以使用颗粒在指定属性的系统上运行命令。 [root@vps4544 ~]# salt -G 'os:Centos' test.ping minion: @@ -91,11 +92,11 @@ Salt使用一个名为**颗粒**的界面来获取系统信息。你可以使用 更多颗粒实例,请访问http://docs.saltstack.com/en/latest/topics/targeting/grains.html -**通过状态文件系统进行包管理。** +##通过状态文件系统进行包管理## -为了是软件配置自动化,你需要使用状态系统,并创建状态文件。这些文件使用YAML格式和python字典、列表、字符串以及编号来构成数据结构。将这些文件从头到尾研读一遍,这将有助于你更好地理解它的配置。 +为了使软件配置自动化,你需要使用状态系统,并创建状态文件。这些文件使用YAML格式和python字典、列表、字符串以及编号来构成数据结构。将这些文件从头到尾研读一遍,这将有助于你更好地理解它的配置。 -**VIM状态文件实例** +###VIM状态文件实例### [root@salt-master~]# vim /srv/salt/vim.sls vim-enhanced: @@ -107,7 +108,7 @@ Salt使用一个名为**颗粒**的界面来获取系统信息。你可以使用 - group: root - mode: 644 -该文件的第一和第三行成为状态id,它们必须包含有需要管理的包或文件的确切名称或路径。在状态id之后是状态和函数声明,‘pkg’和‘file’是状态声明,而‘installed’和‘managed’是函数声明。函数接受参数,用户、组、模式和源都是函数‘managed’的参数。 +该文件的第一和第三行称为状态id,它们必须包含有需要管理的包或文件的确切名称或路径。在状态id之后是状态和函数声明,‘pkg’和‘file’是状态声明,而‘installed’和‘managed’是函数声明。函数接受参数,用户、组、模式和源都是函数‘managed’的参数。 要将该配置应用到下属客户端,请移动你的‘vimrc’文件到‘/src/salt’,然后运行以下命令。 @@ -253,7 +254,7 @@ Salt使用一个名为**颗粒**的界面来获取系统信息。你可以使用 [root@vps4544 ssh]# cp /etc/ssh/sshd_config /srv/salt/ssh/ [root@vps4544 ssh]# salt 'minion.com' state.sls ssh -**Top文件和环境。** +###Top文件和环境### top文件(top.sls)是用来定义你的环境的文件,它允许你映射下属客户机到包,默认环境是‘base’。你需要定义在基本环境下,哪个包会被安装到哪台服务器。 @@ -268,7 +269,7 @@ top文件(top.sls)是用来定义你的环境的文件,它允许你映射 dev: - /srv/salt/dev -现在,添加一个top.sls文件到/src/salt +现在,添加一个top.sls文件到/src/salt。 [root@salt-master ~]# vim /srv/salt/top.sls base: @@ -299,7 +300,9 @@ top文件(top.sls)是用来定义你的环境的文件,它允许你映射 下属客户机将下载top文件并搜索用于它的配置,领主服务器也会将配置应用到所有下属客户机。 -这仅仅是一个Salt的简明教程,如果你想要深入学习并理解,你可以访问以下链接。如果你已经在使用Salt,那么请告诉我你的建议和意见吧。 +--- + +这仅仅是一个Salt的简明教程,如果你想要深入学习并理解,你可以访问下面的链接。如果你已经在使用Salt,那么请告诉我你的建议和意见吧。 更新: [Foreman][3] 已经通过[插件][4]支持salt。 @@ -329,7 +332,7 @@ via: http://techarena51.com/index.php/getting-started-with-saltstack/ 作者:[Leo G][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/) 荣誉推出 diff --git a/translated/tech/20150108 How to Install SSL on Apache 2.4 in Ubuntu 14.0.4.md b/published/201502/20150108 How to Install SSL on Apache 2.4 in Ubuntu 14.0.4.md similarity index 61% rename from translated/tech/20150108 How to Install SSL on Apache 2.4 in Ubuntu 14.0.4.md rename to published/201502/20150108 How to Install SSL on Apache 2.4 in Ubuntu 14.0.4.md index 6f5a53fdee..638bb2f67f 100644 --- a/translated/tech/20150108 How to Install SSL on Apache 2.4 in Ubuntu 14.0.4.md +++ b/published/201502/20150108 How to Install SSL on Apache 2.4 in Ubuntu 14.0.4.md @@ -1,15 +1,14 @@ -如何在Ubuntu 14.04 上为Apache 2.4 安装SSL +如何在Ubuntu 14.04 上为Apache 2.4 安装SSL支持 ================================================================================ -今天我会站如如何为你的个人网站或者博客安装**SSL 证书**,来保护你的访问者和网站之间通信的安全。 +今天我会讲述如何为你的个人网站或者博客安装**SSL 证书**,来保护你的访问者和网站之间通信的安全。 -安全套接字层或称SSL,是一种加密网站和浏览器之间连接的标准安全技术。这确保服务器和浏览器之间传输的数据保持隐私和安全。这被成千上万的人使用来保护他们与客户的通信。要启用SSL链接,web服务器需要安装SSL证书。 +安全套接字层或称SSL,是一种加密网站和浏览器之间连接的标准安全技术。这确保服务器和浏览器之间传输的数据保持隐私和安全。它被成千上万的人使用来保护他们与客户的通信。要启用SSL链接,Web服务器需要安装SSL证书。 -你可以创建你自己的SSL证书,但是这默认不会被浏览器信任,要修复这个问题,你需要从受信任的证书机构(CA)处购买证书,我们会向你展示如何 -或者证书并在apache中安装。 +你可以创建你自己的SSL证书,但是这默认不会被浏览器所信任,要解决这个问题,你需要从受信任的证书机构(CA)处购买证书,我们会向你展示如何获取证书并在apache中安装。 ### 生成一个证书签名请求 ### -证书机构(CA)会要求你在你的服务器上生成一个证书签名请求(CSR)。这是一个很简单的过程,只需要一会就行,你需要运行下面的命令并输入需要的信息: +证书机构(CA)会要求你在你的服务器上生成一个证书签名请求(CSR)。这是一个很简单的过程,只需要一会儿就行,你需要在你的服务器上运行下面的命令并输入需要的信息: # openssl req -new -newkey rsa:2048 -nodes -keyout yourdomainname.key -out yourdomainname.csr @@ -17,13 +16,13 @@ ![generate csr](http://blog.linoxide.com/wp-content/uploads/2015/01/generate-csr.jpg) -这一步会生成两个文件按:一个用于解密SSL证书的私钥文件,一个证书签名请求(CSR)文件(用于申请你的SSL证书)。 +这一步会生成两个文件:一个用于解密SSL证书的私钥文件,一个证书签名请求(CSR)文件(用于申请你的SSL证书)。 -根据你申请的机构,你会需要上传csr文件或者在网站表格中粘帖他的内容。 +根据你申请的机构,你会需要上传csr文件或者在网站表格中粘帖该文件内容。 ### 在Apache中安装实际的证书 ### -生成步骤完成之后,你会收到新的数字证书,本篇教程中我们使用[Comodo SSL][1]并在一个zip文件中收到了证书。要在apache中使用它,你首先需要用下面的命令为收到的证书创建一个组合的证书: +生成步骤完成之后,你会收到新的数字证书。本篇教程中我们使用[Comodo SSL][1],并在一个它发给我们的zip文件中收到了证书。要在apache中使用它,你首先需要用下面的命令用收到的证书创建一个组合的证书: # cat COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > bundle.crt @@ -48,12 +47,12 @@ 你现在应该可以用https://YOURDOMAIN/(注意使用‘https’而不是‘http’)来访问你的网站了,并可以看到SSL的进度条了(通常在你浏览器中用一把锁来表示)。 -**NOTE:** All the links must now point to https, if some of the content on the website (like images or css files) still point to http links you will get a warning in the browser, to fix this you have to make sure that every link points to https. -**注意:** 现在所有的链接都必须指向https,如果网站上的一些内容(像图片或者css文件等)仍旧指向http链接的话,你会在浏览器中得到一个警告,要修复这个问题,请确保每个链接都指向了https。 + +**注意:** 现在所有的内容链接都必须指向https,如果网站上的一些内容(像图片或者css文件等)仍旧指向http链接的话,你会在浏览器中得到一个警告,要修复这个问题,请确保每个链接都指向了https。 ### 在你的网站上重定向HTTP请求到HTTPS中 ### -如果你希望重定向常规的HTTP请求到HTTPS,添加下面的文本到你希望的虚拟主机或者如果希望给服务器上所有网站都添加的话就加入到apache.conf中: +如果你希望重定向常规的HTTP请求到HTTPS,添加下面的文本到你希望修改的虚拟主机,或者如果希望给服务器上所有网站都添加的话就加入到apache.conf中: RewriteEngine On RewriteCond %{HTTPS} off @@ -65,7 +64,7 @@ via: http://linoxide.com/ubuntu-how-to/install-ssl-apache-2-4-in-ubuntu/ 作者:[Adrian Dinu][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md b/published/201502/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md similarity index 64% rename from translated/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md rename to published/201502/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md index 339ef5f836..1b414e71c0 100644 --- a/translated/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md +++ b/published/201502/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md @@ -2,7 +2,7 @@ Ubuntu 14.04 上 最好的 GNOME Shell 主题 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Best_Gnome_Shell_Themes.jpeg) -自定义主题是自定义你的 Linux 桌面的最好方式。假如你在 [Ubuntu 14.04 中安装 GNOME][1] 或 在 Ubuntu 14.10 中安装了 GNOME,你或许想改变默认的主题以呈现出不同的外观。在这里,为帮助你完成该任务,我已经编制好了一个 **Ubuntu 或其他已经安装了 GNOME shell 的 Linux 操作系统中,最好的 GNOME Shell 主题** 的清单 。但在我们揭晓这份清单之前, 让我们先了解如何在 GNOME shell 中安装和应用新的主题。 +最好的方式来自定义你的 Linux 桌面就是使用自定义主题。假如你在 [Ubuntu 14.04 中安装 GNOME][1] 或 在 Ubuntu 14.10 中安装了 GNOME,你或许想改变默认的主题以呈现出不同的外观。在这里,为了帮助你完成该任务,我已经编制好了一个列表—— **Ubuntu 或其他已经安装了 GNOME shell 的 Linux 操作系统中,最好的 GNOME Shell 主题** 。但在我们揭晓这份列表之前, 让我们先了解如何在 GNOME shell 中安装和应用新的主题。 ### 在 GNOME Shell 中安装主题 ### @@ -12,7 +12,7 @@ Ubuntu 14.04 上 最好的 GNOME Shell 主题 sudo apt-get install gnome-tweak-tool ``` -或者,你可以使用新主题通过把它们放置到 `~/.themes` 目录中。如果你需要,我已经写了一个关于 [如何安装和使用 GNOME shell][2]的具体教程。 +或者,你可以通过把主题放置到 `~/.themes` 目录中来使用。如果你需要,我已经写了一个关于 [如何安装和使用 GNOME shell][2]的具体教程。 ### 最好的 GNOME Shell 主题 ### @@ -22,7 +22,7 @@ sudo apt-get install gnome-tweak-tool ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/02/mockups_numix_5.jpeg) -任何没有提到 [Numix 主题][3] 的清单都是不完整的。这个主题是如此地受欢迎以至于 [Numix 团队开发出一个新的 Linux 操作系统, Ozon][4]。考虑到他们的设计作品 Numix 主题,称在不久的将来发行的 `Ozon` 为 [最美丽的 Linux 操作系统][5] 也不为过。 +任何没有提到 [Numix 主题][3] 的列表都是不完整的。这个主题是如此地受欢迎以至于 [Numix 团队开发出一个新的 Linux 操作系统, Ozon][4]。考虑到他们的设计作品 Numix 主题,把不久将发行的 `Ozon` 称为 [最美丽的 Linux 操作系统][5] 也不为过。 使用下面的命令,在基于 Ubuntu 的发行版本中安装 Numix 主题: @@ -36,7 +36,7 @@ sudo apt-get install numix-icon-theme-circle ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Elegance_Colors_Theme_GNOME_Shell.jpeg) -另一个来自 Numix 团队的成员之一的 Satyajit Sahoo 的美丽主题 。[Elegance Colors][6] 拥有自己的 PPA (译者注: 即 Personal Package Archive 的缩写) 使得你可以轻易地安装它: +另一个美丽主题来自 Numix 团队成员之一 Satyajit Sahoo。[Elegance Colors][6] 拥有自己的 PPA (译者注: 即 Personal Package Archive 的缩写) 使得你可以轻松安装它: ``` sudo add-apt-repository ppa:satyajit-happy/themes @@ -48,7 +48,7 @@ sudo apt-get install gnome-shell-theme-elegance-colors ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Moka_GNOME_Shell.jpeg) -[Moka][7] 是另一个迷人的主题,它总是位于美丽的主题的清单之中。它是由给我们带来 Unity Tweak Tool 的开发者所设计。 Moka 是你绝对要尝试的主题之一: +[Moka][7] 是另一个迷人的主题,它总是位于美丽的主题列表之中。它是由 Unity Tweak Tool 的开发者所设计。 Moka 是你一定要尝试的主题: ``` sudo add-apt-repository ppa:moka/stable @@ -68,7 +68,7 @@ sudo apt-get install moka-gnome-shell-theme ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Ciliora_Prima_Gnome_Shell.jpeg) -以前它以 Zukitwo Dark 的名字为人们熟知, Ciliora-Prima 是一个拥有方块图标的主题,可得到的三种版本之间相互略有不同。你可以从下面的链接中下载它们: +以前它以 Zukitwo Dark 的名字为人们熟知, Ciliora-Prima 是一个拥有方块图标的主题,可使用的三种版本之间彼此略有不同。你可以从下面的链接中下载它们: - [Download Ciliora-Prima GNOME Shell Theme][9] @@ -76,7 +76,7 @@ sudo apt-get install moka-gnome-shell-theme ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Faience_GNOME_Shell_Theme.jpeg) -Faience 作为一个受欢迎的主题已经有一段时间了。你可以通过下面的 PPA 为 GNOME 3.10 及更高版本 安装 Faience: +Faience 作为一个受欢迎的主题已经有一段时间了。你可以通过下面的 PPA 为 GNOME 3.10 及更高版本安装 Faience: ``` sudo add-apt-repository ppa:tiheum/equinox @@ -88,7 +88,7 @@ sudo apt-get install faience-theme ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Paper_GTK_Theme.jpeg) -自从 Google 提出 `Material Design`,人们一直为之疯狂。Paper GTK 主题受 Google Material design 启发, 作者为 Sam Hewitt( Moka 项目开发者之一); 它正处于开发中,这意味着当前你将不能对 Paper 拥有最好的体验。假如你和我一样,具有一点实验精神,你绝对可以试一试。 +自从 Google 提出 `Material Design`,人们一直为之疯狂。Paper GTK 主题受 Google Material design 启发,作者为 Sam Hewitt( Moka 项目开发者之一);它正处于开发中,这意味着当前你还不能拥有 Paper 的最好体验。假如你和我一样,具有一点实验精神,你绝对可以试一试。 ``` sudo add-apt-repository ppa:snwh/pulp @@ -96,9 +96,9 @@ sudo apt-get update sudo apt-get install paper-gtk-theme ``` -以上就是我的清单。假如你正试着给你的 Ubuntu 换一个不同的模样,你也应该试试这个清单: [Ubuntu 14.04 中最好的图标主题][10]。 +以上就是我的列表。如果你正试着给你的 Ubuntu 换一个不同的模样,你也应该试试这个列表: [Ubuntu 14.04 中最好的图标主题][10]。 -你是怎样找到这份 **最好的 GNOME shell 主题** 清单的呢?在上面列举的主题中,哪个是你最中意的呢? 如果它没有在这里列出,请一定让我们知道那个你心目中最好的 GNOME shell 主题 。 +你是怎样找到这份 **最好的 GNOME shell 主题** 列表的呢?在上面列举的主题中,哪个是你最中意的? 如果它没有在这里列出,请一定在评论中告诉我们哪个是你心目中最好的 GNOME shell 主题 。 -------------------------------------------------------------------------------- @@ -106,7 +106,7 @@ via: http://itsfoss.com/gnome-shell-themes-ubuntu-1404/ 作者:[Abhishek][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/201502/20150114 How to Configure Chroot Environment in Ubuntu 14.04.md b/published/201502/20150114 How to Configure Chroot Environment in Ubuntu 14.04.md new file mode 100644 index 0000000000..250b223b2a --- /dev/null +++ b/published/201502/20150114 How to Configure Chroot Environment in Ubuntu 14.04.md @@ -0,0 +1,146 @@ +如何在 Ubuntu 14.04 里面配置 chroot 环境 +================================================================================ +你可能会有很多理由想要把一个应用、一个用户或者一个环境与你的 linux 系统隔离开来。不同的操作系统有不同的实现方式,而在 linux 中,一个典型的方式就是 chroot 环境。 + +在这份教程中,我会一步一步指导你怎么使用 chroot 命令去配置一个与真实系统分离出来的独立环境。这个功能主要可以用于测试项目,以下这些步骤都在 **Ubuntu 14.04** 虚拟专用服务器(VPS)上执行。 + +学会快速搭建一个简单的 chroot 环境是一项非常实用的技能,绝大多数系统管理员都能从中受益。 + +### Chroot 环境 ### + +一个 chroot 环境就是通过系统调用,将一个本地目录临时变成根目录。一般所说的系统根目录就是挂载点"/",然而使用 chroot 命令后,你可以使用其它目录作为根目录。 + +原则上,任何运行在 chroot 环境内的应用都不能访问系统中其他信息(LCTT译注:使用 chroot 把一个目录变成根目录,在里面运行的应用只能访问本目录内的文件,无法访问到目录外的文件。然而,运行在 chroot 环境的应用可以通过 sysfs 文件系统访问到环境外的信息,所以,这里有个“原则上”的修饰语)。 + +### Chroot 环境的用处 ### + +> - 测试一个不稳定的应用服务不会影响到整个主机系统。 +> +> - 就算使用 root 权限做了些不当的操作,把 chroot 环境搞得一塌糊涂,也不会影响到主机系统。 +> +> - 可以在你的系统中运行另外一个操作系统。 + +举个例子,你可以在 chroot 环境中编译、安装、测试软件,而不去动真实的系统。你也可以**在64位环境下使用 chroot 创建一个32位环境,然后运行一个32位的程序**(LCTT泽注:如果你的真实环境是32位的,那就不能 chroot 一个64位的环境了)。 + +但是为了安全考虑,chroot 环境为非特权用户设立了非常严格的限制,而不是提供完整的安全策略。如果你需要的是有完善的安全策略的隔离方案,可以考虑下 LXC、Docker、vservers等等。 + +### Debootstrap 和 Schroot ### + +使用 chroot 环境需要安装 **debootstrap** 和 **schroot**,这两个软件都在 Ubuntu 的镜像源中。其中 schroot 用于创建 chroot 环境。 + +**Debootstrap** 可以让你通过镜像源安装任何 Debian(或基于 Debian 的)系统,装好的系统会包含最基本的命令。 + +**Schroot** 命令允许用户使用相同的机制去创建 chroot 环境,但在访问 chroot 环境时会做些权限检查,并且会允许用户做些额外的自动设置,比如挂载一些文件系统。 + +在 Ubuntu 14.04 LTS 上,我们可以通过两步来实现这个功能: + +### 1. 安装软件包 ### + +第一步,在Ubuntu 14.04 LTS 主机系统上安装 debootstrap 和 schroot: + + $ sudo apt-get install debootstrap + $ sudo apt-get install schroot + +### 2. 配置 Schroot ### + +现在我们有工具在手,需要指定一个目录作为我们的 chroot 环境。这里创建一个目录先: + + sudo mkdir /linoxide + +编辑 schroot 的配置文件: + + sudo nano /etc/schroot/schroot.conf + +再提醒一下,我们现在是在 Ubuntu 14.04 LTS 系统上。如果我们想测试一个软件包能不能在 Ubuntu 13.10(代号是“Saucy Salamander”) 上运行,就可以在配置文件中添加下面的内容: + + [saucy] + description=Ubuntu Saucy + location=/linoxide + priority=3 + users=arun + root-groups=root + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/schroot-config.png) + +根据你的系统要求,调整上面的配置信息。 + +### 3. 使用 debootstrap 安装32位 Ubuntu 系统 ### + +Debootstrap 命令会在你的 **chroot 环境**里面下载安装一个最小系统。只要你能访问镜像源,你就可以安装任何基于 Debian 的系统版本。 + +前面我们已经创建了 **/linoxide** 目录用于放置 chroot 环境,现在我们可以在这个目录里面运行 debootstrap 了: + + cd /linoxide + sudo debootstrap --variant=buildd --arch amd64 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/ + sudo chroot /linoxide /debootstrap/debootstrap --second-stage + +你可以将 --arch 的参数换成 i386 或其他架构,只要存在这种架构的镜像源。你也可以把镜像源 http://archive.ubuntu.com/ubuntu/ 换成离你最近的镜像源,具体可参考 [Ubuntu 官方镜像主页][1]。 + +**注意:如果你是在64位系统中创建32位系统,你需要在上面第3行命令中加入 --foreign 选项,就像下面的命令:** + + sudo debootstrap --variant=buildd --foreign --arch i386 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/ + +下载需要一段时间,看你网络带宽性能。最小系统大概有500M。 + +### 4. 完成 chroot 环境 ### + +安装完系统后,我们需要做一些收尾工作,确保系统运行正常。首先,保证主机的 fstab 程序能意识到 chroot 环境的存在: + + sudo nano /etc/fstab + +在文件最后面添加下面的配置: + + proc /linoxide/proc proc defaults 0 0 + sysfs /linoxide/sys sysfs defaults 0 0 + +保存并关闭文件。 + +挂载一些文件系统到 chroot 环境: + + $ sudo mount proc /linoxide/proc -t proc + $ sudo mount sysfs /linoxide/sys -t sysfs + +复制 /etc/hosts 文件到 chroot 环境,这样 chroot 环境就可以使用网络了: + + $ sudo cp /etc/hosts /linoxide/etc/hosts + +最后使用 schroot -l 命令列出系统上所有的 chroot 环境: + + $ schroot -l + +使用下面的命令进入 chroot 环境: + + $ sudo chroot /linoxide/ /bin/bash + +测试安装的版本: + + # lsb_release -a + # uname -a + +为了在 chroot 环境中使用图形界面,你需要设置 DISPLAY 环境变量: + + $ DISPLAY=:0.0 ./apps + +目前为止,我已经成功地在 Ubuntu 14.04 LTS 上安装了 Ubuntu 13.10。 + +退出 chroot 环境: + + # exit + +清理一下,卸载文件系统: + + $ sudo umount /test/proc + $ sudo umount /test/sys + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/configure-chroot-environment-ubuntu-14-04/ + +作者:[Arun Pyasi][a] +译者:[bazz2](https://github.com/bazz2) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://launchpad.net/ubuntu/+archivemirrors diff --git a/translated/tech/20150114 How to Install Ghost on Ubuntu Server 14.04 LTS (Trusty).md b/published/201502/20150114 How to Install Ghost on Ubuntu Server 14.04 LTS (Trusty).md similarity index 84% rename from translated/tech/20150114 How to Install Ghost on Ubuntu Server 14.04 LTS (Trusty).md rename to published/201502/20150114 How to Install Ghost on Ubuntu Server 14.04 LTS (Trusty).md index 95dca20588..ccbee5e704 100644 --- a/translated/tech/20150114 How to Install Ghost on Ubuntu Server 14.04 LTS (Trusty).md +++ b/published/201502/20150114 How to Install Ghost on Ubuntu Server 14.04 LTS (Trusty).md @@ -2,7 +2,7 @@ ================================================================================ 今天我们将会在Ubuntu Server 14.04 LTS (Trusty)上安装一个博客平台Ghost。 -Ghost是一款设计优美的发布平台,很容易使用且对任何人都免费。它是免费的开源软件(FOSS),它的源码在Github上。截至2014年1月,它的界面很简单还有分析面板。编辑使用的是分屏显示。 +Ghost是一款设计优美的发布平台,很容易使用且对任何人都免费。它是免费的开源软件(FOSS),它的源码在Github上。截至2015年1月(LCTT 译注:原文为2014,应为2015),它的界面很简单还有分析面板。编辑使用的是很便利的分屏显示。 因此有了这篇步骤明确的在Ubuntu Server上安装Ghost的教程: @@ -52,12 +52,12 @@ Ghost是一款设计优美的发布平台,很容易使用且对任何人都免 sudo adduser --shell /bin/bash --gecos 'Ghost application' ghost sudo chown -R ghost:ghost /var/www/ghost/ -现在启动Ghost,你需要以“ghsot”用户登录。 +现在启动Ghost,你需要以“ghost”用户登录。 su - ghost cd /var/www/ghost/ -现在,你已经以“ghsot”用户登录,并可启动Ghost: +现在,你已经以“ghost”用户登录,并可启动Ghost: npm start --production @@ -67,7 +67,7 @@ via: http://linoxide.com/ubuntu-how-to/install-ghost-ubuntu-server-14-04/ 作者:[Arun Pyasi][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150114 How to Manage Network using nmcli Tool in RedHat or CentOS 7.x.md b/published/201502/20150114 How to Manage Network using nmcli Tool in RedHat or CentOS 7.x.md similarity index 73% rename from translated/tech/20150114 How to Manage Network using nmcli Tool in RedHat or CentOS 7.x.md rename to published/201502/20150114 How to Manage Network using nmcli Tool in RedHat or CentOS 7.x.md index 10c19b2d92..62bb475206 100644 --- a/translated/tech/20150114 How to Manage Network using nmcli Tool in RedHat or CentOS 7.x.md +++ b/published/201502/20150114 How to Manage Network using nmcli Tool in RedHat or CentOS 7.x.md @@ -10,7 +10,7 @@ nmcli的通常语法是: # nmcli [ OPTIONS ] OBJECT { COMMAND | help } -一件很酷的事情是你可以使用tab键来补全操作,这样你在何时忘记了语法你都可以用tab来看到可用的选项了。 +一件很酷的事情是你可以使用tab键来补全操作,这样你在何时忘记了语法你都可以按下tab来看到可用的选项了。 ![nmcli tab](http://blog.linoxide.com/wp-content/uploads/2014/12/nmcli-tab.jpg) @@ -46,33 +46,33 @@ nmcli通常用法的一些例子: # nmcli device connect eno16777736 -### 使用静态IP添加一个以太网连接 ### +### 添加一个使用静态IP的以太网连接 ### 要用静态IP添加一个以太网连接可以使用下面的命令: - # nmcli connection add type ethernet con-name NAME_OF_CONNECTION ifname interface-name ip4 IP_ADDRESS gw4 GW_ADDRESS + # nmcli connection add type ethernet con-name NAME_OF_CONNECTION ifname INTERFACE-NAME ip4 IP_ADDRESS gw4 GW_ADDRESS -将NAME_OF_CONNECTION替换成新的连接名,IP_ADDRESS替换成你要的IP地址,GW_ADDRESS替换成你使用的网关地址(如果你并不使用网关,你可以忽略这部分)。 +将NAME_OF_CONNECTION替换成新的连接名(LCTT 译注:这个名字以后可以用来对其操作,可以使用任何简单明了的名称),INTERFACE-NAME 替换成你的接口名,IP_ADDRESS替换成你要的IP地址,GW_ADDRESS替换成你使用的网关地址(如果你并不使用网关,你可以忽略这部分)。 - # nmcli connection add type ethernet con-name NEW ifname eno16777736 ip4 192.168.1.141 gw4 192.168.1.1 + # nmcli connection add type ethernet con-name NEW_STATIC ifname eno16777736 ip4 192.168.1.141 gw4 192.168.1.1 -=要设置这个连接的DNS服务器使用下面的命令: +要设置这个连接所使用的DNS服务器使用下面的命令: - # nmcli connection modify NEW ipv4.dns "8.8.8.8 8.8.4.4" + # nmcli connection modify NEW_STATIC ipv4.dns "8.8.8.8 8.8.4.4" 要启用新的以太网连接,使用下面的命令: - # nmcli connection up NEW ifname eno16777736 + # nmcli connection up NEW_STATIC ifname eno16777736 要查看新配置连接的详细信息,使用下面的命令: - # nmcli -p connection show NEW + # nmcli -p connection show NEW_STATIC ![nmcli add static](http://blog.linoxide.com/wp-content/uploads/2014/12/nmcli-add-static.jpg) ### 添加一个使用DHCP的连接 ### -如果你想要添加一个使用DHCP来配置接口IP地址、网关地址和dns服务器地址的新的连接,你要做的就是忽略命令中的ip/gw部分,NetworkManager会自动使用DHCP来获取配置细节。 +如果你想要添加一个使用DHCP来配置接口IP地址、网关地址和dns服务器地址的新的连接,你要做的就是忽略上述命令中的ip/gw部分,NetworkManager会自动使用DHCP来获取配置细节。 比如,要创建一个新的叫NEW_DHCP的DHCP连接,在设备eno16777736上你可以使用下面的命令: @@ -84,7 +84,7 @@ via: http://linoxide.com/linux-command/nmcli-tool-red-hat-centos-7/ 作者:[Adrian Dinu][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150114 Installing Telnet In CentOS or RHEL or Scientific Linux 6 & 7.md b/published/201502/20150114 Installing Telnet In CentOS or RHEL or Scientific Linux 6 & 7.md similarity index 97% rename from translated/tech/20150114 Installing Telnet In CentOS or RHEL or Scientific Linux 6 & 7.md rename to published/201502/20150114 Installing Telnet In CentOS or RHEL or Scientific Linux 6 & 7.md index 901ce4380f..0777cc4d0d 100644 --- a/translated/tech/20150114 Installing Telnet In CentOS or RHEL or Scientific Linux 6 & 7.md +++ b/published/201502/20150114 Installing Telnet In CentOS or RHEL or Scientific Linux 6 & 7.md @@ -65,7 +65,7 @@ vi /etc/sysconfig/iptables -加入红色显示的行: +加入如下行“-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT”: # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. @@ -151,7 +151,7 @@ via: http://www.unixmen.com/installing-telnet-centosrhelscientific-linux-6-7/ 作者:[SK][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/talk/20150114 Why Mac users don't switch to Linux.md b/published/201502/20150114 Why Mac users don't switch to Linux.md similarity index 100% rename from translated/talk/20150114 Why Mac users don't switch to Linux.md rename to published/201502/20150114 Why Mac users don't switch to Linux.md diff --git a/translated/tech/20150115 Configure Mate Desktop With Mate Tweak.md b/published/201502/20150115 Configure Mate Desktop With Mate Tweak.md similarity index 92% rename from translated/tech/20150115 Configure Mate Desktop With Mate Tweak.md rename to published/201502/20150115 Configure Mate Desktop With Mate Tweak.md index 7ae68abaae..3b2f1c972b 100644 --- a/translated/tech/20150115 Configure Mate Desktop With Mate Tweak.md +++ b/published/201502/20150115 Configure Mate Desktop With Mate Tweak.md @@ -4,7 +4,7 @@ [在Ubuntu中安装Mate桌面][1]是一码事但是你或许想要知道如何**配置Mate桌面**? 大多数桌面环境都有它们自己的调整工具。比如Unity有Unity Tweak,Gnome有Gnome Tweak,Elementary OS有 Elementary OS Teweak。好消息是Mate桌面也有它自己的调整工具,叫Mate Tweak][2]。 -Mate Tweak是[mintDesktop][3]的克隆分支,一款Linux Mint的配置工具。 +Mate Tweak是[mintDesktop][3]的克隆分支,那是一款Linux Mint的配置工具。 ### 安装Mate Tweak来配置Mate桌面 ### @@ -22,7 +22,7 @@ via: http://itsfoss.com/configure-mate-desktop-mate-tweak/ 作者:[Abhishek][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md b/published/201502/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md similarity index 100% rename from published/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md rename to published/201502/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md diff --git a/published/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md b/published/201502/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md similarity index 100% rename from published/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md rename to published/201502/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md diff --git a/translated/share/20150116 A Step By Step Guide To Installing Xubuntu Linux.md b/published/201502/20150116 A Step By Step Guide To Installing Xubuntu Linux.md similarity index 76% rename from translated/share/20150116 A Step By Step Guide To Installing Xubuntu Linux.md rename to published/201502/20150116 A Step By Step Guide To Installing Xubuntu Linux.md index 3fc83ba9ef..ed6c31e46e 100644 --- a/translated/share/20150116 A Step By Step Guide To Installing Xubuntu Linux.md +++ b/published/201502/20150116 A Step By Step Guide To Installing Xubuntu Linux.md @@ -5,17 +5,17 @@ ![Xubuntu](http://f.tqn.com/y/linux/1/S/J/J/1/fulldesktop.png) -这个教程会一步一步的教你如何安装Xubuntu Linux。 +这个教程会一步步教你如何安装Xubuntu Linux。 为什么你会想要安装Xubuntu呢?这里有三个原因: 1. 你有一台安装Windows XP的计算机,但是微软已经不再对Windows XP提供支持 -2. 你的[电脑运行很慢][1],并且你想要一个轻量级并且跟得上时代潮流的操作系统 -3. 你想要增加一些DIY经验 +2. 你的[电脑运行很慢][1],你想要一个轻量级并且跟得上时代潮流的操作系统 +3. 你想要自定义你的电脑使用体验 -首先,你需要[下载Xubuntu,并且创建一个启动优盘][2]。 +首先,你需要[下载Xubuntu,并且创建一个可启动的USB驱动器][2]。 -完成以后,用优盘启动到Xubuntu,然后点击安装Xubuntu图标。 +完成以后,用优盘启动到当前版本的Xubuntu,然后点击安装Xubuntu图标。 ### 选择你的安装语言 ### @@ -29,9 +29,9 @@ ![选择无线网络](http://f.tqn.com/y/linux/1/S/L/J/1/xubuntuinstall2.png) -第二步,需要你来选择你的网络链接。这个步骤不是必须的。 +第二步,需要你来选择你的网络链接。这个步骤不是必须的,你在这个阶段可能会选择不设置网络链接是有原因的。 -如果你[网络状况十分糟糕][3],直接跳过是一个明智的选择,因为安装程序会在安装过程中从网络上下载一些更新包。那么可想而知,你的安装过程就会花费很长的时间。 +如果你的[网络状况十分糟糕][3],不选无线网络是一个明智的选择,因为安装程序会在安装过程中从网络上下载一些更新包。那么可想而知,你的安装过程就会花费很长的时间。 当然,如果你的[网速很快][4],选择一个无线网,然后输入密码就行了。 @@ -51,17 +51,19 @@ 安装过程中,如果电池电量耗完的话,你才必须要链接到到电源。 +请注意,如果你连网了,这里有一个关闭安装过程中下载更新包的复选框。 + 这里还有一个复选框,提示你是否安装用于[播放MP3][5]或者[Flash视频][6]的第三方软件,当然,这些内容也可以在安装完成以后进行。 ### 选择安装类型 ### ![选择安装类型](http://f.tqn.com/y/linux/1/S/N/J/1/xubuntuinstall4.png) -接下来的步骤是选择安装类型。显示那些选项,取决于之前电脑上安装了什么系统。 +接下来的步骤是选择安装类型。显示哪些选项,取决于之前电脑上安装了什么系统。 -在我的示例中,我已经安装了[Ubuntu MATE][7],所以,我的选项是重装Ubuntu、删除并且重装、Xubuntu和Ubuntu双系统、以及其他。 +在我的示例中,我已经安装了[Ubuntu MATE][7],所以,我的选项是重装Ubuntu、删除并且重装、安装Xubuntu和Ubuntu双系统,或者其它。 -如果你的计算机上安装了Windows,那么你得到的选项就是,安装双系统、使用Xubuntu替换Windows以及其他。 +如果你的计算机上安装了Windows,那么你得到的选项就是,安装双系统,使用Xubuntu替换Windows或者其他。 这个教程只是用来说明如何在计算机上安装Xubuntu,而不是怎么安装双系统,那将是一个完全不同的教程。 @@ -73,11 +75,11 @@ ![清除磁盘并且安装Xubuntu](http://f.tqn.com/y/linux/1/S/O/J/1/xubuntuinstall5.png) -选择你要在那个磁盘上安装的Xubuntu。 +选择你要安装Xubuntu的磁盘。 点击“Install Now”。 -这时候会弹出一个警告窗口,会提示你,选择的磁盘驱动器会被完全清除,然后会显示一个新创建的分区列表。 +这时候会弹出一个警告窗口,会提示你选择的磁盘驱动器会被完全清除,然后会显示一个新创建的分区列表。 > 备注:这是你改变主意的最后一个机会,如果你点击继续,磁盘就会被完全清除,然后开始安装Xubuntu。 @@ -103,7 +105,7 @@ 如果你需要确认键盘布局是否正确,可以在“Type here to test your keyboard”输入字符。你需要特别注意fn键和一些符号,例如英镑和美元符号。 -如果在安装过程中没有设对也没关系,安装完成以后在Xubuntu系统设置中也可以进行调整。 +如果在安装过程中没有设置正确也没关系,安装完成以后在Xubuntu系统设置中也可以进行调整。 ### 新增用户 ### @@ -115,9 +117,9 @@ 为用户选择一个用户名并且[创建一个密码][8]。为了保证你的密码输入正确,你需要输入两遍。 -如果你想要系统自动登入,而不是在每次启动的时候输入密码,选择“Log in automatically”。尽管对于我来说,我肯定不会选择这个选项。 +如果你想要系统自动登入,而不是在每次启动的时候输入密码,选择“Log in automatically”。对于我来说,我肯定不会选择这个选项。 -更好的选项是“Require my password to log in”,并且如果你想要更高的安全等级,勾选“Encrypt my home fodler”选项。 +更好的选项是“Require my password to log in”,并且如果你想要更高的安全等级,勾选“Encrypt my home folder”选项。 点击“Continue”然后继续。 @@ -125,9 +127,9 @@ ![等待安装完成](http://f.tqn.com/y/linux/1/S/S/J/1/xubuntuinstall10.png) -这个步骤中,将会会拷贝文件到你的电脑,并且安装Xubuntu。 +这个步骤中,将会拷贝文件到你的电脑,并且安装Xubuntu。 -在这个过程中,你会看到一个简短的幻灯片。在这个时候你可以去[泡一杯咖啡][9]或者放松一下什么的。 +在这个过程中,你会看到一个简短的幻灯片。在这个时候你可以去[泡一杯咖啡][9]或者放松一下。 安装完成以后,会弹出提示告诉你是否重新启动,并且开始体验一下新安装的Xubuntu系统。 @@ -139,7 +141,7 @@ via : http://linux.about.com/od/howtos/ss/A-Step-By-Step-Guide-To-Installing-Xu 作者:[Gary Newell][a] 译者:[zhouj-sh](https://github.com/zhouj-sh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -152,4 +154,4 @@ via : http://linux.about.com/od/howtos/ss/A-Step-By-Step-Guide-To-Installing-Xu [6]:http://animation.about.com/od/2danimationtutorials/ss/2d_fla_lesson1.htm [7]:http://www.everydaylinuxuser.com/2014/11/ubuntu-mate-vs-lubuntu-on-old-netbook.html [8]:http://netsecurity.about.com/cs/generalsecurity/a/aa112103b.htm -[9]:http://coffeetea.about.com/od/preparationandrecipes/ \ No newline at end of file +[9]:http://coffeetea.about.com/od/preparationandrecipes/ diff --git a/translated/share/20150119 3 Ways To Create A Lightweight And Persistent Xubuntu Linux USB Drive.md b/published/201502/20150119 3 Ways To Create A Lightweight And Persistent Xubuntu Linux USB Drive.md similarity index 87% rename from translated/share/20150119 3 Ways To Create A Lightweight And Persistent Xubuntu Linux USB Drive.md rename to published/201502/20150119 3 Ways To Create A Lightweight And Persistent Xubuntu Linux USB Drive.md index 8025e91aa1..df7266a7a1 100644 --- a/translated/share/20150119 3 Ways To Create A Lightweight And Persistent Xubuntu Linux USB Drive.md +++ b/published/201502/20150119 3 Ways To Create A Lightweight And Persistent Xubuntu Linux USB Drive.md @@ -1,4 +1,4 @@ -3种创建轻量、持久化的Xubuntu Linux USB系统盘的方法 +3种方法来创建轻量、持久化的Xubuntu Linux USB系统盘 ================================================================================ ### 使用Universal USB Install创建持久化USB Xubuntu系统盘 ### @@ -9,13 +9,13 @@ > 译者注:持久化Linux USB系统盘(Persistent Linux USB drive),安装在优盘的Linux系统,允许用户保存数据到优盘而不是仅仅将这些修改留在内存中。这些数据可以在重启后恢复并且重新使用,甚至是在其他的机器上面启动也没有关系。一般情况下,持久化系统盘会安装一个压缩过的Linux操作系统。 -为什么你需要做这些事情呢,这里有5个很好的理由: +为什么要这样做呢,这里有5个很好的理由: -1. 你想要在你的电脑上安装一个轻量的并且功能完善的Linux版本。 +1. 你想要在你的电脑上安装一个轻量并且功能完善的Linux版本。 2. 你的电脑没有硬盘,那么一个Linux USB系统盘就可以让这台电脑摆脱被扔到垃圾堆的命运。 3. 你想体验一下Linux,但是你却不想花太多的时间去准备。 4. 你想创建一个USB系统恢复盘,并且在优盘上安装一些特定的应用程序。 -5. 你想要一个可以装在屁股口袋或者可以挂在钥匙圈上面的可定制的Linux版本。 +5. 你想要一个可定制的Linux版本,能装在后兜或者挂在钥匙圈上。 现在,我们有了充足的理由,那么开始做一些准备工作吧。 @@ -51,7 +51,7 @@ 14.04版是一个长期维护的版本,维护周期会持续3年。14.10是最新版本,但是只提供9个月的维护。 -你选择了下载站点以后,会提示你选择32位版本或者64位版本。如果你的电脑是32位,就选32位版本,同样,如果你的电脑是64位选64位版本就行了。 +你选择了下载站点以后,会提示你选择32位版本或者64位版本。如果你的电脑是32位,就选32位版本,同样,如果你的电脑是64位,那就选64位版本。 [点击这里,有一个教程来教你辨别你的电脑是32位还是64位][5]。 @@ -105,7 +105,7 @@ Universal USB Installer主界面出现以后,从下拉列表中选择你想要 Startup Disk Creator使用起来很简单。 -界面被划分成两个部分。在上面部分指定下载的系统盘路径,在下面指定安装的优盘。 +界面被划分成两个部分。上部分指定下载的系统盘路径,下部分指定安装的优盘。 首先,点击“Other”按钮,第二步,选择你所下载的Xubuntu ISO文件。 @@ -119,7 +119,7 @@ Startup Disk Creator使用起来很简单。 你创建的过程中,你可能需要输入几次你的系统密码,USB系统盘创建完成以后,你就可以使用它启动到Xubuntu了。 -### 使用UNetbootin创建持久化Xubuntu系统盘 ### +### 使用UNetbootin创建持久化的Xubuntu系统盘 ### ![](http://f.tqn.com/y/linux/1/S/I/J/1/unetbootin1.png) @@ -127,7 +127,7 @@ Startup Disk Creator使用起来很简单。 个人来说,在Windows系统上面我喜欢用Universal USB Installer,但Linux的话,UNetbootin更合适一些。 -> 注:UNetbootin并不是100%完美的,它并不支持所有的Linux发行版。 +> 注:UNetbootin并不是100%完美的,不是所有的Linux发行版都支持。 Windows平台可以点击[这里][8]下载UNetbootin。 @@ -141,11 +141,11 @@ Linux平台可以使用package manager安装UNetbootin。 > sudo unetbootin -UNetbootin的界面分为两个部分。你可以在上面的部分选择一个Linux发行版,然后下载它,如果已经下载了某个发行版,可以在下半部分选择已经下载的系统盘。 +UNetbootin的界面分为两个部分。你可以在上半部分选择一个Linux发行版,然后下载它,如果已经下载了某个发行版,可以在下半部分选择已经下载的系统盘。 点击“Diskimage”单选框,然后点击三个点的按钮。找到已经下载的Xubuntu ISO文件。路径会显示到按钮旁边的文本框里面。 -修改“Space used to preserve files across reboots”的值,来指定你想要用来存储“持久化”数据的空间大小。 +设置“Space used to preserve files across reboots”的值,来指定你想要用来存储“持久化”数据的空间大小。 类型选择USB drive,然后选择优盘的盘符。 @@ -159,7 +159,7 @@ via : http://linux.about.com/od/howtos/ss/How-To-Create-A-Persistent-Bootable-Xu 作者:[Gary Newell][a] 译者:[zhouj-sh](https://github.com/Zhouj-sh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -171,4 +171,4 @@ via : http://linux.about.com/od/howtos/ss/How-To-Create-A-Persistent-Bootable-Xu [5]:http://pcsupport.about.com/od/fixtheproblem/f/32-bit-64-bit-windows.htm [6]:http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/ [7]:http://linux.about.com/od/howtos/fl/Learn-Ubuntu-The-Unity-Dash.htm -[8]:http://linux.about.com/od/howtos/ss/How-To-Create-A-UEFI-Bootable-Ubuntu-USB-Drive-Using-Windows.htm \ No newline at end of file +[8]:http://linux.about.com/od/howtos/ss/How-To-Create-A-UEFI-Bootable-Ubuntu-USB-Drive-Using-Windows.htm diff --git a/published/201502/20150119 Cutegram--A Better Telegram Client For GNU or Linux.md b/published/201502/20150119 Cutegram--A Better Telegram Client For GNU or Linux.md new file mode 100644 index 0000000000..57511dd73c --- /dev/null +++ b/published/201502/20150119 Cutegram--A Better Telegram Client For GNU or Linux.md @@ -0,0 +1,76 @@ +Cutegram: 一个GNU/Linux下不错的Telegram客户端 +================================================================================ +不需要再介绍**Telegram**了,对吧。Telegram是一款流行的免费即时通信工具,帮助你在全球与朋友聊天。不像Whatsapp,Telegram是永久免费、没有广告、没有订阅费用的。并且Telegram客户端也是开源的。Telegram在许多不同的平台中都有,包括Linux、Android、iOS、Windows Phone和Mac OS X。使用telegram发送的消息是高度加密且会自我销毁。它很安全,并且没有对你的多媒体和聊天的大小作限制。 + +在[先前的教程][1]中我们已经提到你可以在Ubuntu/Debian中安装Telegram。然而,有一个新的Telegram客户端叫**Cutegram**出现了,可以使你的聊天体验更加有趣和简单。 + +### Cutegram是什么? ### + +Cutegram是一款专注于用户友好、与Linux桌面环境兼容和易于使用的开源 telegram 的 GNU/Linux客户端。Cutegram使用Qt5、QML、libqtelegram、libappindication、AsemanQtTools技术和Faenzatu图标和Twitter emojie图片集。它在GPLv3许可证下免费发布。 + +### 安装 Cutegram ### + +进入Cutegrm的首页病根据你的发行版版本选择最新的版本。我使用的是Ubuntu 64位版,所以我下载的是.deb文件。 + + wget http://aseman.co/downloads/cutegram/cutegram_1.0.2-1-amd64.deb + +现在,如下安装Cutegram: + + sudo apt-get install gdebi + sudo gdebi cutegram_1.0.2-1-amd64.deb + +对于其他发行版,运行下面的命令。 + +**64位:** + + wget http://aseman.co/downloads/cutegram/cutegram-1.0.2-linux-x64-installer.run + +**32位:** + + wget http://aseman.co/downloads/cutegram/cutegram-1.0.2-linux-installer.run + +设置执行权限: + + chmod a+x cutegram-1.0.2-linux*.run + +如下进行安装。 + + sudo ./cutegram-1.0.2-linux*.run + +### 使用 ### + +在菜单或者Unity dash中启动Cutegram。在登录界面,选择你的国家并输入电话号码,最好点击**Login** + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Cutegram_005.png) + +一个验证码将会发送到你手机上。输入验证码并点击**Sign in** + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Cutegram_002.png) + +你会看到 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Cutegram_003.png) + +开始聊天吧! + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Cutegram_004.png) + +接着,你可以设置头像,开始新的聊天/群聊,或者使用左边面板的按钮开始秘密聊天。 + +玩得开心!干杯!! + +更多细节,请关注[Cutegram 网站][2] + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/cutegram-better-telegram-client-gnulinux/ + +作者:[SK][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:http://www.unixmen.com/install-telegram-desktop-via-ppa/ +[2]:http://aseman.co/en/products/cutegram/ diff --git a/translated/tech/20150119 How To Disable IPv6 In CentOS 7.md b/published/201502/20150119 How To Disable IPv6 In CentOS 7.md similarity index 88% rename from translated/tech/20150119 How To Disable IPv6 In CentOS 7.md rename to published/201502/20150119 How To Disable IPv6 In CentOS 7.md index 080799f17c..a148053251 100644 --- a/translated/tech/20150119 How To Disable IPv6 In CentOS 7.md +++ b/published/201502/20150119 How To Disable IPv6 In CentOS 7.md @@ -1,6 +1,6 @@ 如何在CentOS 7中禁止IPv6 ================================================================================ -最近,我的一位朋友问我该如何禁止IPv6。在搜索了一番之后,我找到了下面的方案。下面就是我在CentOS 7迷你版中禁止IPv6的方法。 +最近,我的一位朋友问我该如何禁止IPv6。在搜索了一番之后,我找到了下面的方案。下面就是在我的CentOS 7 迷你服务器禁止IPv6的方法。 你可以用两个方法做到这个。 @@ -41,7 +41,6 @@ ### 我在禁止IPv6后遇到问题怎么办 ### -You may get problems after disabling IPv6. 你可能在禁止IPv6后遇到一些问题 #### 问题1: #### @@ -60,9 +59,7 @@ vi /etc/ssh/sshd_config AddressFamily inet -或者, - -在这行的前面去掉注释**(#)**: +或者,在这行的前面去掉注释**(#)**: #ListenAddress 0.0.0.0 @@ -89,7 +86,7 @@ via: http://www.unixmen.com/disable-ipv6-centos-7/ 作者:[SK][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150119 Quick Tip--How To Restart Cinnamon After Crash.md b/published/201502/20150119 Quick Tip--How To Restart Cinnamon After Crash.md similarity index 83% rename from translated/tech/20150119 Quick Tip--How To Restart Cinnamon After Crash.md rename to published/201502/20150119 Quick Tip--How To Restart Cinnamon After Crash.md index eee9d41d0c..e5b6cbae5a 100644 --- a/translated/tech/20150119 Quick Tip--How To Restart Cinnamon After Crash.md +++ b/published/201502/20150119 Quick Tip--How To Restart Cinnamon After Crash.md @@ -1,6 +1,6 @@ 如何在崩溃后重启Cinnamon ================================================================================ -Cinnamon是一个提供了高级创新特性和传统用户体验的Linux桌面环境。桌面布局和Gnome 2相似。底层的技术与Gnome Shell相似。它的重点是让用户有宾至如归的感觉并提供一个简单和舒适的桌面体验。 +Cinnamon是一个提供了高级创新特性和传统用户体验的Linux桌面环境。桌面布局和Gnome 2相似。底层的技术与Gnome Shell相似。它的重点是让用户以熟悉的方式得到简单和舒适的桌面体验。 本篇中我们会展示一个快速的方法来重启Cinnamon而不用在崩溃后登出或者重启。 @@ -18,15 +18,15 @@ Cinnamon应该会重新在面板和菜单中显示图标和文本了。 ![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/linux_mint_cinnamon_menu.png) -享受吧! +试试吧! -------------------------------------------------------------------------------- via: http://www.unixmen.com/quick-tip-restart-cinnamon-crash/ 作者:[Enock Seth Nyamador][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/talk/20150121 If a 32-bit integer overflows.md b/published/201502/20150121 If a 32-bit integer overflows.md similarity index 87% rename from translated/talk/20150121 If a 32-bit integer overflows.md rename to published/201502/20150121 If a 32-bit integer overflows.md index 651e829189..30687f4bc8 100644 --- a/translated/talk/20150121 If a 32-bit integer overflows.md +++ b/published/201502/20150121 If a 32-bit integer overflows.md @@ -1,16 +1,17 @@ 如果使用32位整型会溢出,那么是否可以使用一个40位结构体代替64位长整型? ---------- +====== + +###问题: -#问题: 假如说,使用32位的整型会溢出,在不考虑使用长整型的情况下,如果我们只需要表示2的40次方范围内的数,是否可以利用某些40位长的数据类型来表示呢?这样的话,每个整型数就可以节省24位的空间。 如果可以,该怎么做? 需求是:我现在必须处理数以亿计的数字,所以在存储空间上受到了很大的限制。 -#回答: +###回答: -##可以是可以,但是…… +可以是可以,但是…… 这种方法的确可行,但这么做通常没什么意义(因为几乎没有程序需要处理多达十亿的数字): @@ -22,14 +23,15 @@ struct bad_idea }; ``` -在这里,变量var占据40位大小,但是以生成代码时拥有非常低的运行效率来换取的(事实证明“非常”二字言过其实了——测试中程序开销仅仅增加了1%到2%,正如下面的测试时间所示),而且这么做通常没什么用。除非你还需要保存一个24位的值(或者是8位、16位的值),这样你皆可以它们放到同一个结构中。不然的话,因为对齐内存地址产生的开销会抵消这么做带来的好处。 +在这里,变量var占据40位大小,但是这是以生成代码时拥有非常低的运行效率来换取的(事实证明“非常”二字言过其实了——测试中程序开销仅仅增加了1%到2%,正如下面的测试时间所示),而且这么做通常没什么用。除非你还需要保存一个24位的值(或者是8位、16位的值),这样你皆可以它们放到同一个结构中。不然的话,因为对齐内存地址产生的开销会抵消这么做带来的好处。 在任何情况下,除非你是真的需要保存数以亿计的数字,否则这样做给内存消耗带来的好处是可以忽略不计的(但是为了处理这些位字段的额外代码量是不可忽略的!)。 ###说明: 在此期间,这个问题已经被更新了,是为了说明实际上确实有需要处理数以亿计数字的情况。假设,采取某些措施来防止因为结构体对齐和填充抵消好处(比如在后24位中存储其它的内容,或者使用多个8位来存储40位),那么这么做就变得有意义了。 -如果有十亿个数,每个数都节省三个字节的空间,那么这么做就非常有用了。因为使用更小的空间存储要求更少的内存页,也就会产生更少的cache和TLB不命中和内存缺页(单个缺页会产生数以千万计的指令(译者注:直译是这样,但语义说不通!))。 + +如果有十亿个数,每个数都节省三个字节的空间,那么这么做就非常有用了。因为使用更小的空间存储要求更少的内存页,也就会产生更少的cache和TLB不命中和内存缺页(单个缺页会产生数以千万计的指令 [译者注:直译是这样,但语义说不通!])。 尽管上面提到的情况不足以充分利用到剩余的24位(它仅仅使用了40位部分),如果确实在剩余位中放入了有用的数据,那么使用类似下面的方法会使得这种思路就管理内存而言显得非常有用。 @@ -43,9 +45,10 @@ struct using_gaps ``` 结构体大小和对齐长度等于64位整型的大小,所以只要使用得当就不会浪费空间,比如对一个保存10亿个数的数组使用这个结构(不考虑使用指定编译器的扩展)。如果你不会用到一个8位的值,那么你可以使用一个48位和16位的值(giving a bigger overflow margin)。 + 或者以牺牲可用性为代价,把8个64位的值放入这样的结构体中(或者使用40和64的组合使得其和满足320)。当然,在这种情况下,通过代码去访问数组结构体中的元素会变得非常麻烦(尽管一种方法是实现一个operator[]在功能上还原线性数组,隐藏结构体的复杂性)。 -更新: +###更新: 我写了一个快速测试工具,只是为了获得位字段的开销(以及伴随位字段引用的重载操作)。由于长度限制将代码发布在gcc.godbolt.org上,在本人64位Win7上的测试结果如下: @@ -85,7 +88,7 @@ via:[stackoverflow](http://stackoverflow.com/questions/27705409/if-a-32-bit-inte 作者:[Damon][a][Michael Kohne][b] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md b/published/201502/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md similarity index 100% rename from published/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md rename to published/201502/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md diff --git a/translated/tech/20150122 Linux FAQs with Answers--How to add a cron job on Linux.md b/published/201502/20150122 Linux FAQs with Answers--How to add a cron job on Linux.md similarity index 81% rename from translated/tech/20150122 Linux FAQs with Answers--How to add a cron job on Linux.md rename to published/201502/20150122 Linux FAQs with Answers--How to add a cron job on Linux.md index 6f0a5effe3..70326e249f 100644 --- a/translated/tech/20150122 Linux FAQs with Answers--How to add a cron job on Linux.md +++ b/published/201502/20150122 Linux FAQs with Answers--How to add a cron job on Linux.md @@ -2,7 +2,7 @@ Linux 有问必答: 如何在Linux中加入cron任务 ================================================================================ > **提问**: 我想在我的Linux中安排一个计划任务,该任务在固定时间周期性地运行。我该如何在Linux中添加一个cron任务? -cron是Linux中默认的计划任务。使用cron,你可以安排一个计划(比如:命令或者shell脚本)周期性地运行或者在指定的小时、天、周、月等特定时间运行。cron在你安排不同的常规维护任务时是很有用的,比如周期性地备份、日志循环、检查文件系统、监测磁盘空间等等。 +cron是Linux中默认的计划任务。使用cron,你可以安排一个计划(比如:命令或者shell脚本)周期性地运行或者在指定的分钟、小时、天、周、月等特定时间运行。cron在你安排不同的常规维护任务时是很有用的,比如周期性地备份、日志循环、检查文件系统、监测磁盘空间等等。 ### 从命令行中添加cron任务 ### @@ -22,7 +22,7 @@ cron是Linux中默认的计划任务。使用cron,你可以安排一个计划 每个cron任务的格式如下。 - + <分钟> <小时> <日> <月> <星期> <命令> 前5个元素定义了任务的计划,最后一个元素是命令或者脚本的完整路径。 @@ -30,13 +30,13 @@ cron是Linux中默认的计划任务。使用cron,你可以安排一个计划 下面是一些cron任务示例。 -- *** * * * * /home/dan/bin/script.sh**: 每分钟运行。 +- **\* * * * * /home/dan/bin/script.sh**: 每分钟运行。 - **0 * * * * /home/dan/bin/script.sh**: 每小时运行。 -- **0 0 * * * /home/dan/bin/script.sh**: 每12小时运行。 +- **0 0 * * * /home/dan/bin/script.sh**: 每天零点运行。 - **0 9,18 * * * /home/dan/bin/script.sh**: 在每天的9AM和6PM运行。 - **0 9-18 * * * /home/dan/bin/script.sh**: 在9AM到6PM的每个小时运行。 - **0 9-18 * * 1-5 /home/dan/bin/script.sh**: 周一到周五的9AM到6PM每小时运行。 -- ***/10 * * * * /home/dan/bin/script.sh**: 每10分钟运行。 +- **\*/10 * * * * /home/dan/bin/script.sh**: 每10分钟运行。 一旦完成上面的设置步骤后,按下Ctrl+X来保存并退出编辑器。此时,新增的计划任务应该已经激活了。 @@ -61,6 +61,6 @@ cron是Linux中默认的计划任务。使用cron,你可以安排一个计划 via: http://ask.xmodulo.com/add-cron-job-linux.html 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/published/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md b/published/201502/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md similarity index 100% rename from published/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md rename to published/201502/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md diff --git a/translated/tech/20150122 Linux FAQs with Answers--How to set a custom HTTP header in curl.md b/published/201502/20150122 Linux FAQs with Answers--How to set a custom HTTP header in curl.md similarity index 94% rename from translated/tech/20150122 Linux FAQs with Answers--How to set a custom HTTP header in curl.md rename to published/201502/20150122 Linux FAQs with Answers--How to set a custom HTTP header in curl.md index 7c382558eb..145ef9168e 100644 --- a/translated/tech/20150122 Linux FAQs with Answers--How to set a custom HTTP header in curl.md +++ b/published/201502/20150122 Linux FAQs with Answers--How to set a custom HTTP header in curl.md @@ -6,7 +6,7 @@ curl是一个强大的命令行工具,它可以通过网络将信息传递给 ![](https://farm8.staticflickr.com/7568/16225032086_fb8f1c508a_b.jpg) -在一些个例中,或许你想要在一个HTTP请求中覆盖掉默认的HTTP头或者添加一个新的自定义头部字段。例如,你或许想要重写“HOST”字段来测试一个[负载均衡][1],或者通过重写"User-Agent"字符串来欺骗特定浏览器以解决其访问限制的问题。 +在一些个例中,或许你想要在一个HTTP请求中覆盖掉默认的HTTP头或者添加一个新的自定义头部字段。例如,你或许想要重写“HOST”字段来测试一个[负载均衡][1],或者通过重写"User-Agent"字符串来假冒特定浏览器以解决一些访问限制的问题。 为了解决所有这些问题,curl提供了一个简单的方法来完全控制传出HTTP请求的HTTP头。你需要的这个参数是“-H” 或者 “--header”。 @@ -36,7 +36,7 @@ wget是另外一个类似于curl,可以用来获取URL的命令行工具。并 via: http://ask.xmodulo.com/custom-http-header-curl.html 译者:[Ping](http://mr-ping.com) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20150125 4 Best Modern Open Source Code Editors For Linux.md b/published/201502/20150125 4 Best Modern Open Source Code Editors For Linux.md similarity index 100% rename from published/20150125 4 Best Modern Open Source Code Editors For Linux.md rename to published/201502/20150125 4 Best Modern Open Source Code Editors For Linux.md diff --git a/published/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md b/published/201502/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md similarity index 100% rename from published/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md rename to published/201502/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md diff --git a/published/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md b/published/201502/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md similarity index 100% rename from published/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md rename to published/201502/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md diff --git a/published/20150127 Install Jetty Web Server On CentOS 7.md b/published/201502/20150127 Install Jetty Web Server On CentOS 7.md similarity index 100% rename from published/20150127 Install Jetty Web Server On CentOS 7.md rename to published/201502/20150127 Install Jetty Web Server On CentOS 7.md diff --git a/published/201502/20150128 Meet Vivaldi--A New Web Browser Built for Power Users.md b/published/201502/20150128 Meet Vivaldi--A New Web Browser Built for Power Users.md new file mode 100644 index 0000000000..f82ca8965d --- /dev/null +++ b/published/201502/20150128 Meet Vivaldi--A New Web Browser Built for Power Users.md @@ -0,0 +1,60 @@ +认识Vivaldi——一款为高手级用户定制的全新网页浏览器 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/Screen-Shot-2015-01-27-at-17.36.jpg) + +**这周一个为了满足高手级用户的需要而定制的全新网页浏览器已然来临——而且它已经可以在Linux上使用了。** + +Vivaldi就是这个新浏览器的名字,而且它还面向64位Linux、Windows 和 Mac 机发布了技术预览版(注解:无责任测试版)。它是建立在已测试过的Chromium开源框架,Blink和Google的开源V8 JavaScript引擎(以及其他项目)的基础上。 + +这个世界真的还需要一个浏览器吗?Opera软件前首席执行官Jon S.von Tetzchner的构想——Vivaldi不怎么关注所要,更关注所需。 + +Vivaldi被制造成带有着偏向于键盘操作的tab键痴迷者所需的那种功能。并没有为那些认为Firefox复杂或是批评Chrome改动了书签按钮的用户而进行修改。 + +这也并不是什么俗气的营销噱头。尽管它带有‘技术预览版’标签,Vivaldi已经有了明显偏向于高手级用户们的功能。 + +相当多的人觉得自己被其他软件公司所生产的简化的,配对后发行的产品遗弃了、糊弄了。Vivaldi——即使在这个过渡期的早期——看起来适逢其会,可以打败其他产品。 + +### Vivaldi功能### + +以下是几个Vivaldi已展示过的关键功能: + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/quick.jpg) + +**快捷命令** (Ctrl + Q)是个内置的HUD应用,它可以让你快速过滤设置、选项和功能,用它打开一个书签或是隐藏状态栏,只需用你的键盘,无需鼠标点击。 + +**标签堆** 让你可以通过把多个不同标签分到一组来清理你的工作区,然后可以通过键盘命令或者可预览标签选择器在标签组之间进行切换。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/tab-stacks.jpg) + +一个可折叠的**侧边栏**藏有额外功能(就像旧Opera)包括一个(目前还不能工作的)邮箱客户端,链接,书签浏览器和可以让你截屏并做注释的笔记专区。 + +还提供了一大堆其他的功能,包括设置键盘快捷键,一个可以被设置在浏览器任何一个边(或完全隐藏)的标签栏,隐私选项和一个快速打开文件夹的功能。 + +### Opera二代的印记 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/vivaldi-settings-in-ubuntu-750x434.jpg) + +把Vivaldi当作Opera post-Presto(Opera拥有版权的旧引擎)的真正继承者并不是什么值得惊奇的事。当Opera(今天也推出了一个小更新)追求一个更轻、更好管理的一套功能时,已经剔除了它很多“高手级用户”功能。 + +Vivaldi想要捡起Opera曾急于脱手的负担。虽然这么做没有帮它抓住什么预期的市场份额,但是它吸引了高手级用户的眼球。他们大多数无疑已经在使用Linux了。 + +### 下载 ### + +有兴趣尝尝鲜?完全可以。Vivaldi可以下载到Windows,Mac以及64位Linux版本。不久的将来你还能选择Debian或RPM安装器。 + +请记住,它还没有完成,而且更多的功能(包括扩展、同步等等)正计划着在将来加入。 + +- [Download Vivaldi Tech Preview for Linux][1] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/01/vivaldi-web-browser-linux-download-power-users + +作者:[Joey-Elijah Sneddon][a] +译者:[H-mudcup](https://github.com/H-mudcup) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://vivaldi.com/#Download diff --git a/published/201502/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md b/published/201502/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md new file mode 100644 index 0000000000..e49dd12654 --- /dev/null +++ b/published/201502/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md @@ -0,0 +1,29 @@ +OpenJDK 7的漏洞已经在Ubuntu 14.04 和Ubuntu 14.10中解决了 +---- +*建议用户尽快升级* + +**Canonical发布新 OpenJDK 7 的安全公告,它已经提交到Ubuntu 14.04 LTS和Ubuntu 14.10 的仓库中。该更新修复了大量的问题和漏洞。** + +Ubuntu维护者已经升级了仓库中的OpenJDK包,并且含有大量的修复。这是一个重要的更新,其涵盖了少量的库。 + +安全公告中说“OpenJDK JRE中发现了一些信息泄露、数据完整性和可用性的漏洞。攻击者可以利用这些通过网络执行拒绝服务或者泄露信息。” + +同样,“OpenJDK JRE中发现了关于信息泄露和完整性的漏洞。攻击者可以利用这点通过网络泄露敏感信息。” + +这里有几个漏洞被开发者确认,并且由维护人员解决。关于该问题的详细描述,你可以参考Canonical的安全通告。建议用户尽快升级系统。 + +这个漏洞只要你升级到最新的openjdk 7相关的包就可以修复。要应用该补丁,用户需要运行升级管理程序。通常上,一个标准系统更新就会安装必要的更新。所有java相关的程序需要重新启动。 + +-------------------------------------------------------------------------------- + +via: http://linux.softpedia.com/blog/OpenJDK-7-Vulnerabilities-Closed-in-Ubuntu-14-04-and-Ubuntu-14-10-471605.shtml + +本文发布时间:29 Jan 2015, 16:53 GMT + +作者:[Silviu Stahie][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie diff --git a/published/201502/20150202 How to create and show a presentation from the command line on Linux.md b/published/201502/20150202 How to create and show a presentation from the command line on Linux.md new file mode 100644 index 0000000000..04deb0264c --- /dev/null +++ b/published/201502/20150202 How to create and show a presentation from the command line on Linux.md @@ -0,0 +1,186 @@ +如何在Linux命令行中创建以及展示演示稿 +================================================================================ +你在准备一场演讲的时候,脑海可能会先被图文并茂、形象华丽的演示图稿所占据。诚然,没有人会否认一份生动形象的演讲稿所带来的积极作用。然而,并非所有的演讲都需要TED Talk的质量。更多时候,演讲稿只为传达特定的信息。 而这个,使用文本信息足以完成。在这种情况下,你的时间可以更好的花在信息的搜集和核实上面,而不是在谷歌图片搜索(Google Image)上寻找好看的图片。 + +在Linux的世界里,有几个不同的方式供你选择来做演讲。比如带有大量多媒体展示、视觉冲击效果极佳的[Impress.js][1],专为LaTex用户提供的Beamer,等等。而如果你苦于寻找一种简单的方式来创建并且展示文本演示稿,[mdp][2] 就能帮你实现。 + +### 什么是Mdp? ### + +mdp是Linux下一款基于ncurses的命令行演示工具。我喜欢mdp在于它对[markdown][3]的支持,使得我很容易以熟悉的markdown格式来创建幻灯片。自然,它还可以很轻松地用HTML格式来发布幻灯片。另一个好处是它支持UTF-8字符编码,这让非英语字符(如希腊或西里尔字母)的展示也变得很方便。 + +### 在Linux中安装Mdp ### + +mdp的依赖需求很少(如 ncursesw),这使得安装非常简单。 + +#### Debian、Ubuntu或者它们的衍生版 #### + + $ sudo apt-get install git gcc make libncursesw5-dev + $ git clone https://github.com/visit1985/mdp.git + $ cd mdp + $ make + $ sudo make install + +#### Fedora或者CentOS/RHEL #### + + $ sudo yum install git gcc make ncurses-devel + $ git clone https://github.com/visit1985/mdp.git + $ cd mdp + $ make + $ sudo make install + +#### Arch Linux #### + +Arch Linux可以通过[AUR][4]轻松安装mdp。 + +### 在命令行中创建演示稿 ### + +安装mdp完毕,你可以使用你喜欢的文本编辑器来轻松创建一个演示稿。如果你熟悉markdown的话,很快就可以驾驭mdp。而对于那些不熟悉markdown的人来说,学习mdp最好的方式就是从一个实例着手。 + +这里有一份6页的演示稿样本可供参考。 + + %title: Sample Presentation made with mdp (Xmodulo.com) + %author: Dan Nanni + %date: 2015-01-28 + + -> This is a slide title <- + ========= + + -> mdp is a command-line based presentation tool with markdown support. <- + + *_Features_* + + * Multi-level headers + * Code block formatting + * Nested quotes + * Nested list + * Text highlight and underline + * Citation + * UTF-8 special characters + + ------------------------------------------------- + + -> # Example of nested list <- + + This is an example of multi-level headers and a nested list. + + # first-level title + + second-level + ------------ + + - *item 1* + - sub-item 1 + - sub-sub-item 1 + - sub-sub-item 2 + - sub-sub-item 3 + - sub-item 2 + + ------------------------------------------------- + + -> # Example of code block formatting <- + + This example shows how to format a code snippet. + + 1 /* Hello World program */ + 2 + 3 #include + 4 + 5 int main() + 6 { + 7 printf("Hello World"); + 8 return 0; + 9 } + + This example shows inline code: `sudo reboot` + + ------------------------------------------------- + + -> # Example of nested quotes <- + + This is an example of nested quotes. + + # three-level nested quotes + + > This is the first-level quote. + >> This is the second-level quote + >> and continues. + >>> *This is the third-level quote, and so on.* + + ------------------------------------------------- + + -> # Example of citations <- + + This example shows how to place a citation inside a presentation. + + This tutorial is published at [Xmodulo](http://xmodulo.com) + + You are welcome to connect with me at [LinkedIn](http://www.linkedin.com/in/xmodulo) + + Pretty cool, huh? + + ------------------------------------------------- + + -> # Example of UTF-8 special characters <- + + This example shows UTF-8 special characters. + + ae = ä, oe = ö, ue = ü, ss = ß + alpha = ?, beta = ?, upsilon = ?, phi = ? + Omega = ?, Delta = ?, Sigma = ? + + ??????????? + ?rectangle? + ??????????? + +### 在命令行中展示演示稿 ### + +当你把以上代码保存为slide.md的文本文件后,你可以运行以下命令来展示演示稿: + + $ mdp slide.md + +你可以通过按键 回车/空格/下翻页/向下光标键 (下一张幻灯)、回退/上翻页/向上光标键 (上一张幻灯)、Home (幻灯首页)、 End (幻灯末页)或者 数字N (第N页幻灯)来操作你的演示稿。 + +演示稿的标题将在每页幻灯的顶部展示,而你的名字和页码则会出现在幻灯的底部。 + +![](https://farm9.staticflickr.com/8637/16392457702_ec732d0094_c.jpg) + +这是嵌套列表和多层次标题的实例效果。 + +![](https://farm9.staticflickr.com/8567/16367397606_29be7df633_c.jpg) + +这是代码片段和内联代码的实例效果。 + +![](https://farm9.staticflickr.com/8682/15770926144_0f982b0863_b.jpg) + +这是嵌套引用的实例效果。 + +![](https://farm9.staticflickr.com/8587/16393383115_0865c8b89b_c.jpg) + +这是放置引文的实例效果。 + +![](https://farm8.staticflickr.com/7409/16392457712_ed36c14bc2_c.jpg) + +这是UTF-8编码特殊字符支持的实例效果。 + +![](https://farm9.staticflickr.com/8648/16205981560_7fa3debc75_c.jpg) + +### 总结 ### + +在本教程中,我演示了在命令行中如何使用mdp来创建并且展示一个演示稿。mdp的markdown兼容性让我们省去了学习其它新格式的麻烦,这相对于另一种名为[tpp][5]的演示工具来说是一个优势。拘于mdp的局限性,它可能无法作为你的默认演示工具。但是,值得肯定的是它一定能在某个场合下派上用场。你觉得mdp怎么样呢?你还喜欢其它的什么东西吗? + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/presentation-command-line-linux.html + +作者:[Dan Nanni][a] +译者:[soooogreen](https://github.com/soooogreen) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://bartaz.github.io/impress.js/ +[2]:https://github.com/visit1985/mdp +[3]:http://daringfireball.net/projects/markdown/ +[4]:https://aur.archlinux.org/packages/mdp-git/ +[5]:http://www.ngolde.de/tpp.html \ No newline at end of file diff --git a/translated/tech/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md b/published/201502/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md similarity index 63% rename from translated/tech/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md rename to published/201502/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md index 0a10253031..faf724786c 100644 --- a/translated/tech/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md +++ b/published/201502/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md @@ -1,8 +1,8 @@ -Linux有问必答--如果修复Google Chrome 的 ‘Your profile could not be opened correctly’错误 +Linux有问必答——如何修复Google Chrome 的“Your profile could not be opened correctly”错误 ================================================================================ > **提问**:当我在linux打开Google Chrome 浏览器时,我已经几次收到弹出窗口,提示我的档案文件没有被正确打开(Your profile could not be opened correctly.)。每次我打开Chrome都要弹出来,我应该如何修复这个问题? -当你在你的Chrome上看见"Your profile could not be opened correctly"错误信息时,那是因为你的Chrome档案数据已经损坏。这个问题经常发生在手动升级Google Chrome时候。 +当你在你的Chrome上看见"Your profile could not be opened correctly"错误信息时,从某种程度上讲,那是因为你的Chrome配置文件数据已经损坏。这个问题经常发生在手动升级Google Chrome的时候。 ![](https://farm8.staticflickr.com/7428/16238502737_27bdda6685_o.png) @@ -10,7 +10,7 @@ Linux有问必答--如果修复Google Chrome 的 ‘Your profile could not be op ### 方法一 ### -关掉所有Chrome窗口和子窗口。 +关掉所有Chrome窗口和标签页。 进入~/.config/google-chrome/Default,移除或者重命名"Web Data"文件。 @@ -21,9 +21,9 @@ Linux有问必答--如果修复Google Chrome 的 ‘Your profile could not be op ### 方法二 ### -关掉所有Chrome窗口和子窗口。 +关掉所有Chrome窗口和标签页。 -进入~/.config/google-chrome/"Profile 1", 并重命名"History"文件。 +进入~/.config/google-chrome/"Profile 1",并重命名"History"文件。 $ cd ~/.config/google-chrome/"Profile 1" $ mv History History.bak @@ -32,9 +32,9 @@ Linux有问必答--如果修复Google Chrome 的 ‘Your profile could not be op ### 方法三 ### -如果依然没有解决,你可以试试移除所有默认档案文件夹(~/.config/google-chrome/Default)。注意:如果这样做,你将会遗失所有之前打开的Google子窗口,导入的书签,浏览记录和登录数据等。 +如果依然没有解决,你可以试试移除所有默认配置文件夹(~/.config/google-chrome/Default)。注意:如果这样做,你将会遗失所有之前打开的Google标签、导入的书签,浏览记录和登录数据等。 -在移除之前,先关掉所有Chrome窗口和子窗口 +在移除之前,先关掉所有Chrome窗口和标签页 $ rm -rf ~/.config/google-chrome/Default @@ -45,6 +45,6 @@ Linux有问必答--如果修复Google Chrome 的 ‘Your profile could not be op via: http://ask.xmodulo.com/your-profile-could-not-be-opened-correctly-google-chrome.html 译者:[VicYu/Vic020](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150205 Linux FAQs with Answers--How to install Go language on Linux.md b/published/201502/20150205 Linux FAQs with Answers--How to install Go language on Linux.md similarity index 71% rename from translated/tech/20150205 Linux FAQs with Answers--How to install Go language on Linux.md rename to published/201502/20150205 Linux FAQs with Answers--How to install Go language on Linux.md index d7dd2bb1c6..110fe965a5 100644 --- a/translated/tech/20150205 Linux FAQs with Answers--How to install Go language on Linux.md +++ b/published/201502/20150205 Linux FAQs with Answers--How to install Go language on Linux.md @@ -1,6 +1,6 @@ 如何在Linux中安装Go语言 ================================================================================ -Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几个设计原则:简单、安全、速度。Go语言发行版拥有各种调试、测试、调优和代码审查工具。如今Go语言和它的工具链在大多数Linux发行版的基础仓库都有了,用默认的包管理器就可以安装。 +Go (也叫 "golang")是一款由Google最初开发的编程语言。它的诞生有几个设计原则:简单、安全、速度。Go语言发行版拥有各种调试、测试、调优和代码审查工具。如今Go语言和它的工具链在大多数Linux发行版的基础仓库都可用,用默认的包管理器就可以安装。 ### 在Ubuntu、Debian 或者 Linux Mint上安装Go语言 ### @@ -16,7 +16,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几 go version go1.2.1 linux/amd64 -按照你的需要,你或许想要使用apt-get安装额外的Go工具。 +根据你的需要,你或许想要使用apt-get安装额外的Go工具。 $ sudo apt-cache search golang @@ -36,7 +36,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几 go version go1.3.3 linux/amd64 -按照你的需要,你或许想要使用yum安装额外的Go工具。 +根据你的需要,你或许想要使用yum安装额外的Go工具。 $ yum search golang @@ -44,7 +44,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几 ### 从官网安装Go语言 ### -有时发行版中的版本并不是最新的。为防这样,你可以从官网安装最新的Go语言。下面是步骤。 +有时发行版中的go语言版本并不是最新的。为了避免这种情况,你可以从官网安装最新的Go语言。下面是步骤。 进入Go语言的[官方源码][1],并下载预编译二进制代码。 @@ -68,7 +68,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几 export PATH=$PATH:/usr/local/go/bin -如果你在/usr/local之外安装了了Go,你同样需要设置GOROOT环境变量来指向自定义的安装位置。 +如果你在/usr/local之外的自定义位置中安装了Go,你同样需要设置GOROOT环境变量来指向自定义的安装位置。 $ sudo vi /etc/profile @@ -89,7 +89,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几 via: http://ask.xmodulo.com/install-go-language-linux.html 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md b/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md new file mode 100644 index 0000000000..9430f11ada --- /dev/null +++ b/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md @@ -0,0 +1,32 @@ +LinuxQuestions 问卷调查揭晓最佳开源项目 +================================================================================ +![](http://farm5.static.flickr.com/4099/4777335328_3cc363c419_m.jpg) + +在Linux用户社区中, 很多人每年都会期待来自 LinuxQuestions.org 细致可靠的年度问卷调查报告。如同[Susan在她的报告][1]中指出的那样, 今年的[结果][2]着重于调查网站读者心中最棒的开源项目。 这份报告目前已经完成。 在LinuxQuestions的大多数人都是“专家级”的用户, 他们经常在网站上在线回答Linux新手们的提问。 + +在Susan所作的报告的附加内容里, 你可以看到由“专家”们对开源世界的关注点分布。 + +你也可以在[这里][3]找到一份较为精美的调查问卷总结图.这里呈现了网站投票得出的最佳Linux发行版, 可以看到Mint和Slackwaer平分了半壁江山: + +![](http://i1311.photobucket.com/albums/s669/webworkerdaily/lin_zps9ogvyrty.png) + +而下图则是网站票选出的得出的最佳云项目。值得注意的是, LinuxQuestions的用户群体给予了ownCloud项目极高的评价。 你一定得亲自去看看调查结果的详情, 也看看 [Susan 关于各项目“赢家”][4]的总结, 还有[一堆精美的图表][5]。 + +![](http://i1311.photobucket.com/albums/s669/webworkerdaily/lin2_zps9nxf7yyi.png) + +-------------------------------------------------------------------------------- + +via: http://ostatic.com/blog/linuxquestions-survey-results-surface-top-open-source-projects + +作者:[Sam Dean][a] +译者:[jerryling315](https://github.com/jerryling315) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://ostatic.com/member/samdean +[1]:http://ostatic.com/blog/lq-members-choice-award-winners-announced +[2]:http://www.linuxquestions.org/questions/linux-news-59/2014-linuxquestions-org-members-choice-award-winners-4175532948/ +[3]:http://www.linuxquestions.org/questions/2014mca.php +[4]:http://ostatic.com/blog/lq-members-choice-award-winners-announced +[5]:http://www.linuxquestions.org/questions/2014mca.php \ No newline at end of file diff --git a/published/201502/20150209 CrunchBang Linux Is Dead.md b/published/201502/20150209 CrunchBang Linux Is Dead.md new file mode 100644 index 0000000000..7adfa42887 --- /dev/null +++ b/published/201502/20150209 CrunchBang Linux Is Dead.md @@ -0,0 +1,32 @@ +CrunchBang Linux 已死!!! +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Crunchbang_Linux_Dead.jpeg) + +是的,你没看错。最小的Linux发行版**CrunchBang Linux 已经消失了**。 + +CrunchBang Linux,被大家所熟知的缩写标志“#!”,其基于Debian和[Openbox][1]窗口管理器。这个黑色主题的 Linux 发行版是许多资深 Linux用户的选择。 + +### CrunchBang 因为 “不再有继续下去的价值” 而消失了 ### + +其[公告][2]称,CrunchBang将不在继续开发,项目的领头人Philip Newborough说他在开始这个项目的时候,Linux 世界和现在不同。他指出那时在这种发行版还没有‘竞争’,但是随着Linux发行版的进步,如Lubuntu,Crunchbang这样的发行版就不具备原来的价值了。 + +> 对于任何十年前使用Linux的人而言,我想他们都会看到事物在不断发展。虽然一些事情一直保持不变,还有一些的变化超出了认知。这称之为进步。对于大部分事物而言,进步是一件好事。也就是说当进步发生时,一些事物落后了。对于我而言,CrunchBang就是我需要抛弃的东西。我抛弃它的原因是我真的认为它不再具有任何价值了,虽然我还可以因为一些多愁善感的原因把它留下来,但是我不认为那些使用原生Debian用户还有兴趣了。 + +### CrunchBang消失之后会怎么样? ### + +就像[Pear OS][3]那样,CrunchBang论坛仍将在线。现在仍可以下载但是不久的将来就会停止。Philip对他即将面对的新的项目和工作感到很激动。我希望他今后工作顺利。很难过见到一个像CrunchBang这样好的Linux发行版的消失。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/crunchbang-linux-dead/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://en.wikipedia.org/wiki/Openbox +[2]:http://crunchbang.org/forums/viewtopic.php?id=38916 +[3]:http://itsfoss.com/pear-os-history/ diff --git a/published/201502/20150209 Non-Linux FOSS--Homebrew.md b/published/201502/20150209 Non-Linux FOSS--Homebrew.md new file mode 100644 index 0000000000..d132d55555 --- /dev/null +++ b/published/201502/20150209 Non-Linux FOSS--Homebrew.md @@ -0,0 +1,24 @@ +非Linux的自由开源软件:Homebrew +================================================================================ +我日常工作中使用的是OS X。我能容忍它很大程序上是因为它的终端。如果我不能在黑色背景绿色文字的终端下工作,我想我会疯了。不幸的是,OS X 没有我需要的全部命令行工具。Homebrew的到来拯救了我。 + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11811fossf1.png) + +Homebrew扮演了OS X中所缺乏的包管理器的角色。命令的使用很像apt-get,它能够安装无数的应用。一个最好的例子是wget。我很惊讶OS X中没有包含wget,但是homebrew中有,很简单就安装上了。 + +最棒的是homebrew在/usr/local文件夹下安装软件。你不必担心homebrew会破坏你的系统,因为它不会访问/usr/local之外的其他文件。OSX系统更新不会覆盖你的程序,并且/usr/local/bin已经在PATH中,使用homebrew安装的程序可以直接工作。 + +homebrew使用ruby管理它的包和功能,但是使用它不需要任何编程知识。并且安装过程只需要在命令行中复制粘贴就好了。如果你使用的是OS X,但是你希望像在Linux中那样方便地安装,就试一试homrbrew吧:[http://brew.sh][1]。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxjournal.com/content/non-linux-foss-homebrew + +作者:[Shawn Powers][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxjournal.com/users/shawn-powers +[1]:http://brew.sh/ diff --git a/published/201502/20150215 Get Rid Of Two Google Chrome Icons From Dock In Elementary OS Freya.md b/published/201502/20150215 Get Rid Of Two Google Chrome Icons From Dock In Elementary OS Freya.md new file mode 100644 index 0000000000..fb593dbf68 --- /dev/null +++ b/published/201502/20150215 Get Rid Of Two Google Chrome Icons From Dock In Elementary OS Freya.md @@ -0,0 +1,56 @@ +如何避免在ELemetary OS Freya中出现两个Google Chrome 图标 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Two_Google_Chrome_ElementaryOS_Freya.jpeg) + +这篇文章会教你**如何避免在ELemetary OS Freya中出现两个Google Chrome 图标**。 + +Chrome才是我在所有系统中使用的主浏览器。[Modori][2] 是默认放在dock中的浏览器,所以你每次使用Chrome时都需要在Slingshot中搜索Google Chrome,而为了节省时间,我通常会将它“保持在dock”中。 + +这里的问题是当你点击dock中的Chrome图标时,它会创建另外一个Google Chrome的实例。这就在dock中留下两个Chrome图标,这或许你可以不在意,但是很显然处女座不能忍!如果你有相同的感受,让我们看下如何移除这第二个Google Chrome图标。 + +### 在Elementary OS Freya的dock中删除第二个Google Chrome 图标 ### + +#### 第一步: #### + +从dock中删除Google Chrome。 + +#### 第二步: #### + +打开终端并使用下面的命令: + + cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications + +#### 第三步: #### + +接下来我们要编辑google-chrome.destop文件。使用下面的命令: + + scratch-text-editor ~/.local/share/applications/google-chrome.desktop + +这会用Scratch打开google-chrome.destop文件。在[Desktop Entry]段落下,加入下面的行: + + + StartupWMClass=Google-chrome-stable + +看上去像这样: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/two_Google_Chrome_Elementary_Freya.png) + +#### 第四步: #### + +进入Slingshot并且再次打开Google Chrome。再次选择“keep in dock”。关闭并重新打开它来验证它是否在dock中打开了另外一个新的Chrome图标。这里不需要重启系统。 + +我希望这篇提示能够帮助你删除Elementary OS Freya中多出的Chrome图标。有任何问题或建议让我在评论区中知道。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/rid-google-chrome-icons-dock-elementary-os-freya/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://elementary.io/ +[2]:http://midori-browser.org/ diff --git a/published/20150215 How To Make GDebi Default Instead of Ubuntu Software Center.md b/published/20150215 How To Make GDebi Default Instead of Ubuntu Software Center.md new file mode 100644 index 0000000000..9e6499eb2b --- /dev/null +++ b/published/20150215 How To Make GDebi Default Instead of Ubuntu Software Center.md @@ -0,0 +1,46 @@ +如何使 GDebi 默认代替 Ubuntu 软件中心 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Make_GDebi_Default.jpeg) + +如果你使用 Ubuntu 或基于 Ubuntu 的 Linux 发行版本,比如Elementary OS Freya,也许你使用 Ubuntu 软件中心来安装 `.deb` 可执行文件。对于查找和安装应用,Ubuntu 软件中心是一个很好的应用,但它会消耗很多资源且运行速度缓慢。这就是为什么我更偏爱使用 [一个 Ubuntu 软件中心的轻量级替代品——App Grid][1] 的原因。 + +现在,假如你只是尝试安装一个 `.deb` 文件,我不会向你推荐 Ubuntu 软件中心或 App Grid ,我的建议为 GDebi,一个安装 Debian 可执行文件的专用程序。它极其轻量,且专注于安装 `.deb` 文件。GDebi 最有用的功能是它也可以为你展示出将要安装的程序的依赖。 + +在这篇文章中,我们将看一看 **如何安装 GDebi 以及使用它代替 Ubuntu 软件中心作为默认的安装器**。 + +### 在 Ubuntu 和其他 Linux 发行版本中安装 GDebi ### + +打开终端并使用下面的命令: + + sudo apt-get install gdebi + +### 使得 GDebi 成为默认的 `.deb`包安装器 ### + +一旦你安装了 GDebi,就是时候来看看如何使它成为安装 `.deb` 文件的默认应用了。请读者注意在这篇教程中我使用的是 Elementary OS Freya ,但下面的步骤对于所有基于 Ubuntu 的发行版本都是适用的。可能截屏显示会有点不同。 + +首先下载一个 `.deb`文件。例如你已经下载了一个 Google Chrome 的 `.deb`包。进入下载目录并右击该 `.deb`文件。在这里,接着选择 **属性**选项。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/GDebi_default.jpeg) + +在属性中,你应该可以看到 **打开方式** 选项。点击它并选择为 GDebi。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/GDebi_default_Ubuntu.jpeg) + +这样下次你双击一个 `.deb` 文件,便会自动打开 GDebi 来安装这个`.deb` 文件。使用这样轻量级的应用的确是一个[加速 Ubuntu][2] 或其他 Linux 系统的好方法。 + +你怎么看呢?对于安装应用,你仍然偏爱 Ubuntu 软件中心还是 GDebi 呢?如果你是一个守旧派,也许你更喜欢 [新立得软件包管理器(Synaptic Package Manager)][3]?那么,哪一个是你的最爱? + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/gdebi-default-ubuntu-software-center/ + +作者:[Abhishek][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/app-grid-lighter-alternative-ubuntu-software-center/ +[2]:http://itsfoss.com/speed-up-ubuntu-1310/ +[3]:http://www.nongnu.org/synaptic/ diff --git a/published/20150225 Linux FAQs with Answers--How to install full kernel source on Debian or Ubuntu.md b/published/20150225 Linux FAQs with Answers--How to install full kernel source on Debian or Ubuntu.md new file mode 100644 index 0000000000..3c0f4ec412 --- /dev/null +++ b/published/20150225 Linux FAQs with Answers--How to install full kernel source on Debian or Ubuntu.md @@ -0,0 +1,58 @@ +Linux有问必答:如何在Debian或Ubuntu上安装完整的内核源码 +================================================================================ +> **问题**:我需要为我的Debian或Ubuntu下载并安装完整树结构的内核源码以供编译一个定制的内核。那么在Debian或Ubuntu上有什么可行的方法来下载完整的内核源码呢? + +在给你的Linux安装完整内核源码之前,先问问自己是否真的需要这样做。如果你仅仅是尝试去编译一个内核模块或是为内核定制驱动,你并不需要完整的内核源码树。你只需要安装[一些与内核对应的头文件][1],这样就足够了。 + +只有在你需要生成一个定制的内核,而且内核源码中的一些内核默认设置要被你调整了的情况下,你才需要完整的内核源码树。 + +这里将会解答如何**在Debian或Ubuntu的库中下载并安装完整树结构的内核源码**。你可以在[https://www.kernel.org/pub/linux/kernel/][2]下载官方的内核源码,不过使用发行版软件仓库可以允许你下载包含补丁的内核源码。 + +### 在Debian上安装完整的内核源码 ### + +在下载内核源码之前,先安装dpkg-dev,其中包含你在Debian上生成源代码时需要的开发工具套件。不仅如此,dpkg-dev中还包含在用来解压Debian源码包并自动打补丁的工具dpgk-source。 + + $ sudo apt-get install dpkg-dev + +然后,运行以下命令下载完整的内核源码。 + + $ apt-get source linux-image-$(uname -r) + +伴随着完整内核源码(linux_X.X.XX.orig.tar.xz)的还有一些可用的内核补丁(linux_X.X.X+XXX.debian.tar.xz)和源码控制文件(linux_XXXX.dsc),这些都将被下载并存储到当前目录。在.dsc文件中会指出如何给内核源码打补丁。 + +当下载完成,以上的命令将会自动调用工具dpkg-source将下载的内核源码解压到当前的目录中,与此同时根据.dsc文件来下补丁。 + +最终完整的内核源码树将会以"linux-X.X.XX"的形式呈现在当前目录中。 + +![](https://farm9.staticflickr.com/8676/16341110300_b4f059eeb0_b.jpg) + +### 在Ubuntu上安装完整内核源码 ### + +如果你想安装完整内核源码的话,以上在Debian上的那一套做法在Ubuntu上仍然奏效。 + +在Ubuntu上还有另一套方法安装完整内核源码。事实上,你可以查一下由Canonical为Ubuntu不同发行版维护的内核源码树。 + + $ sudo apt-get install git + $ git clone git://kernel.ubuntu.com/ubuntu/ubuntu-$(lsb_release --codename | cut -f2).git + +举个例子,如果你使用的是Ubuntu 14.04,以上的命令将会查看Git的"ubuntu-trusty"仓库中的代码。 + +![](https://farm9.staticflickr.com/8642/16526856391_de636ff9b8_c.jpg) + +一旦在你对Git仓库的查询结束后,使用以下的命令来安装用来访问生成内核源码树所需依赖的重要开发包。 + + $ sudo apt-get build-dep linux-image-$(uname -r) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-full-kernel-source-debian-ubuntu.html + +作者:[Dan Nanni][a] +译者:[martin qi](https://github.com/martin2011qi) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://ask.xmodulo.com/install-kernel-headers-linux.html +[2]:https://www.kernel.org/pub/linux/kernel/ diff --git a/published/New Debian TC Members Appointed For Going Past The Systemd Fallout.md b/published/New Debian TC Members Appointed For Going Past The Systemd Fallout.md new file mode 100644 index 0000000000..d33e7d3b5d --- /dev/null +++ b/published/New Debian TC Members Appointed For Going Past The Systemd Fallout.md @@ -0,0 +1,26 @@ +经过 systemd 争执后,辞职的 Debian TC 席位已被增补 +================================================================================ + +去年随着Debian 以 systemd 作为 init 管理器的决议,以及随后的 [init 系统投票][1],有三个人从 Debian 技术委员会退出:Colin Watson, [Ian Jackson][2], 以及 [Russ Allbery][3]。现在,这些空缺席位现已由现有的技术委员会成员任命。 + +新任命的技术委员会成员是 Sam Hartman, Tollef Fog Heen 以及 Didier Raboud。这些新成员加上Bdale Garbee, Don Armstrong, Andreas Barth, Steve Langasek 以及 Keith Packard 组成了现在的Debian技术委员会。由Debian章程确定的 Debian 技术委员会(TC)负责对 Debian 项目中的技术争端做出最后的决定,他们在去年所有的关于 init 系统的讨论中变得十分重要。 + +![](http://www.phoronix.net/image.php?id=debconf12_managua&image=debconf_12_conference_med) + +新技术委员会成员的委任公告可以从 [debian-devel-announce列表][4] 中获悉。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=Debian-TC-Three-Appointments + +作者:[Michael Larabel][a] +译者:[alim0x](https://github.com/alim0x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:http://www.phoronix.com/scan.php?page=news_item&px=MTg0MzY +[2]:http://www.phoronix.com/scan.php?page=news_item&px=MTg0NDA +[3]:http://www.phoronix.com/scan.php?page=news_item&px=MTg0MjM +[4]:https://lists.debian.org/debian-devel-announce/2015/03/msg00003.html diff --git a/sources/news/20150130 LibreOffice 4.4 Released as the Most Beautiful LibreOffice Ever.md b/sources/news/20150130 LibreOffice 4.4 Released as the Most Beautiful LibreOffice Ever.md deleted file mode 100644 index 3718ee58a6..0000000000 --- a/sources/news/20150130 LibreOffice 4.4 Released as the Most Beautiful LibreOffice Ever.md +++ /dev/null @@ -1,38 +0,0 @@ -LibreOffice 4.4 Released as the Most Beautiful LibreOffice Ever ----- -*The developer has made a lot of UI improvements* - -![LibreOffice 4.4](http://i1-news.softpedia-static.com/images/news2/LibreOffice-4-4-Releases-As-the-Most-Beautiful-LibreOffice-Ever-471575-2.jpg) - -The Document Foundation has just announced that a new major update has been released for LibreOffice and it brings important UI improvements, enough for them to call this the most beautiful version ever. - -The Document Foundation doesn't usually make the UI the main focus of an update, but now the developers are saying that this is the most beautiful release made so far and that says a lot. Fortunately, this version is not just about interface fixes and there are plenty of other major improvements that should really provide a very good reason to get LibreOffice 4.4. - -LibreOffice has been gaining quite a lot of fans and users, and the past couple of years have been very successful. The office suite is implemented by default in most of the important Linux distributions out there and it was adopted by numerous administrations and companies across the world. LibreOffice is proving to be a difficult adversary for Microsoft's Office and each new version makes it even better. -LibreOffice 4.4 brings a lot of new features - -If we move aside all the improvements made to the interface, we're still left with a ton of fixes and changes. The Document Foundation takes its job very seriously and all upgrades really improve the users' experience tremendously. - -"LibreOffice 4.4 has got a lot of UX and design love, and in my opinion is the most beautiful ever. We have completed the dialog conversion, redesigned menu bars, context menus, toolbars, status bars and rulers to make them much more useful. The Sifr monochrome icon theme is extended and now the default on OS X. We also developed a new Color Selector, improved the Sidebar to integrate more smoothly with menus, and reworked many user interface details to follow today’s UX trends," [says Jan "Kendy" Holesovsky](1), a member of the Membership Committee and the leader of the design team. - -Some of the other improvements include much better support for OOXML file formats, the source code has been "groomed" and cleaned after a Coverity Scan analysis, digital signatures for exported PDF files, improved import filters for Microsoft Visio, Microsoft Publisher and AbiWord files, and Microsoft Works spreadsheets, and much more. - -For now, the PPA doesn't have the latest version, but that should change soon. For the time being, you can download the [LibreOffice 4.4](2) source packages from Softpedia, if you want to compile them yourself. - --------------------------------------------------------------------------------- - -via:http://news.softpedia.com/news/LibreOffice-4-4-Releases-As-the-Most-Beautiful-LibreOffice-Ever-471575.shtml - -本文发布时间:29 Jan 2015, 14:16 GMT - -作者:[Silviu Stahie][a] - -译者:[译者ID](https://github.com/译者ID) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie -[1]:http://blog.documentfoundation.org/2015/01/29/libreoffice-4-4-the-most-beautiful-libreoffice-ever/ -[2]:http://linux.softpedia.com/get/Office/Office-Suites/LibreOffice-60713.shtml \ No newline at end of file diff --git a/sources/news/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md b/sources/news/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md deleted file mode 100644 index 552f98e3f2..0000000000 --- a/sources/news/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md +++ /dev/null @@ -1,33 +0,0 @@ -OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10 ----- -*Users have been advised to upgrade as soon as possible* - -##Canonical published details about a new OpenJDK 7 version has been pushed to the Ubuntu 14.04 LTS and Ubuntu 14.10 repositories. This update fixes a number of problems and various vulnerabilities. - -The Ubuntu maintainers have upgraded the OpenJDK packages in the repositories and numerous fixes have been implemented. This is an important update and it covers a few libraries. - -"Several vulnerabilities were discovered in the OpenJDK JRE related to information disclosure, data integrity and availability. An attacker could -exploit these to cause a denial of service or expose sensitive data over the network,” reads the security notice. - -Also, "a vulnerability was discovered in the OpenJDK JRE related to information disclosure and integrity. An attacker could exploit this to -expose sensitive data over the network." - -These are just a couple of the vulnerabilities identified and corrected by the developer and implemented by the maintainers/., and for a more detailed description of the problems, you can see Canonical's security notification. Users have been advised to upgrade their systems as soon as possible. - -The flaws can be fixed if you upgrade your system to the latest openjdk-7-related packages specific to each distribution. To apply the patch, users will have to run the Update Manager application. In general, a standard system update will make all the necessary changes. All Java-related applications will have to be restarted. - --------------------------------------------------------------------------------- - -via:http://linux.softpedia.com/blog/OpenJDK-7-Vulnerabilities-Closed-in-Ubuntu-14-04-and-Ubuntu-14-10-471605.shtml - -本文发布时间:29 Jan 2015, 16:53 GMT - -作者:[Silviu Stahie][a] - -译者:[译者ID](https://github.com/译者ID) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie \ No newline at end of file diff --git a/sources/news/20150202 The Pirate Bay Is Now Back Online.md b/sources/news/20150202 The Pirate Bay Is Now Back Online.md deleted file mode 100644 index acde800ad8..0000000000 --- a/sources/news/20150202 The Pirate Bay Is Now Back Online.md +++ /dev/null @@ -1,38 +0,0 @@ -The Pirate Bay Is Now Back Online ------- -*The website was closed for about seven weeks* -![The Pirate Bay](http://i1-news.softpedia-static.com/images/news2/The-Pirate-Bay-Is-Now-Back-Online-471802-2.jpg) -##After being [raided](1) by the police almost two months ago, (in)famous torrent website The Pirate Bay is now back online. Those who thought the website will never return will be either disappointed or happy given that The Pirate Bay seems to live once again. - -In order to celebrate its coming back, The Pirate Bay admins have posted a Phoenix bird on the front page, which signifies the fact that the website can't be killed only damaged. - -About two weeks after The Pirate Bay was raided the domain miraculously came back to life. Soon after a countdown appeared on the temporary homepage of The Pirate Bay indicating that the website is almost ready for a comeback. - -The countdown hinted to February 1, as the possible date for The Pirate Bay's comeback, but it looks like those who manage the website manage to pull it out one day earlier. - -Beginning today, those who have accounts on The Pirate Bay can start downloading the torrents they want. Other than the Phoenix on the front page there are no other messages that might point to the resurrection The Pirate Bay except for the fact that it's now operational. - -Admins of the website said a few weeks ago they will find ways to manage and optimize The Pirate Bay, so that there will be minimal chances for the website to be closed once again. Let's see how it lasts this time. - -##Another version of The Pirate Bay may be launched soon - -In related news, one of the members of the original staff was dissatisfied with the decisions made by the majority regarding some of the changes made in the way admins interact with the website. - -He told [Torrentfreak](2) earlier this week that he, along with a few others, will open his version of The Pirate Bay, which they claim will be the "real" one. - ------- -via:http://news.softpedia.com/news/The-Pirate-Bay-Is-Now-Back-Online-471802.shtml - -本文发布时间:31 Jan 2015, 22:49 GMT - -作者:[Cosmin Vasile][a] - -译者:[译者ID](https://github.com/译者ID) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/cosmin-vasile -[1]:http://news.softpedia.com/news/The-Pirate-Bay-Is-Down-December-9-2014-466987.shtml -[2]:http://torrentfreak.com/pirate-bay-back-online-150131/ \ No newline at end of file diff --git a/sources/news/20150205 Debian Forked over systemd--Birth of Devuan GNU or Linux Distribution.md b/sources/news/20150205 Debian Forked over systemd--Birth of Devuan GNU or Linux Distribution.md deleted file mode 100644 index 89299a55d5..0000000000 --- a/sources/news/20150205 Debian Forked over systemd--Birth of Devuan GNU or Linux Distribution.md +++ /dev/null @@ -1,98 +0,0 @@ -Debian Forked over systemd: Birth of Devuan GNU/Linux Distribution -================================================================================ -Debian GNU/Linux distribution is one of the oldest Linux distribution that is currently in working state. init used to be the default central management and configuration platform for Linux operating system before systemd emerged. Systemd from the date of its release has been very much controversial. - -Sooner or later it has replaced init on most of the Linux distribution. Debian remained no exception and Debian 8 codename JESSIE will be having systemd by default. The Debian adaptation of systemd in replacement of init caused polarization. This led to forking of Debian and hence Devuan GNU/Linux distribution born. - -Devuan project started with the primary goal to put back nit and remove controversial systemd. A lot of Linux Distribution are based on Debian or a derivative of Debian and one does not simply fork Debian. Debian will always attract developers. - -### What Devuan is all About? ### - -Devuan in Italian (pronounced Devone in English) suggests “Don’t panic and keep forking Debian”, for Init-Freedom lovers. Developers see Devuan as the beginning of a process which aims at base distribution and is able to protect the freedom of developers and community. - -![Devuan Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Devuan-Linux.jpg) - -Debian Forked over systemd: Birth of Devuan Linux - -Devuan project priority includes – interoperability, diversity and backward compatibility. It will derive its own installer and repos from Debian and modify where ever required. If everything works smooth by the mid of 2015 users can switch to Devuan from Debian 7 and start using devuan repos. - -The process of switching will fairly remain as simple as upgrading a Debian installation. The project will be as minimal as possible and completely in accordance of UNIX philosophy – “Doing one thing and doing it well”. The targeted users of Devuan will be System Admins, Developers and users having experience of Debian. - -The project started by italian developers has raised a fund of 4.5k€ (EUR) in the year 2014. They have moved distro infrastructure from GitHub to GitLab, progress on Loginkit (systemd Logind replaced), discussing Logo and other important aspects useful in long run. - -A few of the Logos are in discussion now are shown in the picture. - -![Devuan Logo Proposals](http://www.tecmint.com/wp-content/uploads/2015/02/Devuan-Logos.jpeg) - -Devuan Logo Proposals - -Have a look at them here at: [http://without-systemd.org/wiki/index.php/Category:Logo][1] - -The unrest over systemd that gave birth to Devuan is good or bad? Lets have a look. - -### Is Devuan fork a good thing? ### - -Well! difficult to answer that forking such a huge distro is really going to be of any good. A (group of) developer(s) who initially were working with Debian got unsatisfied with systemd and forked it. - -Now the actual number of developers working on Debian/Systemd decreased which is going to affect the productivity of both the projects. Now the same number of developers are working on two different projects. - -What you think would be the fate of Devuan as well as Debian project? Won’t it hinder the progress of either distro and Linux in the long run? - -Please give your [comments][2] about Devuan project. - -注:如果可以在发布文章的时候发布一个调查,就把下面这段发成一个调查,如果不行,就直接嵌入js代码 - - - -Do you think systemd for Debian is - -Good -Bad -Don't Know -Don't Care -Other: - -VoteView ResultsPolldaddy.com - - -**Do you really feel that Debian with systemd will have a bad fate as depicted below** - -![Strip SystmeD](http://www.tecmint.com/wp-content/uploads/2015/02/Strip-SystmeD.jpg) - -Strip SystmeD - -Time to wait for Devuan 1.0 and lets see what it could contain. - -### Conclusion ### - -All the major Linux Distributions Like Fedora, RedHat, openSUSE, SUSE Enterprise, Arch, Megia have already switched to Systemd, Ubuntu and Debian are in the way to replace init with systemd. Only Gentoo and Slack till date have shown no interest in systemd but who knows someday even Gentoo and slack too started moving in the same direction. - -The reputation of Debian as a Linux Distro is something very few have reached the mark. It is blessed by some hundreds of developers and millions of users. The actual question is what percentage of users and developers were not comfortable with systemd. If the percentage is really high then what led debian to switch to systemd. Had it moved against the wishes of its users and developers. If this is the case the chance of success of devuan is pretty fair. Well how many developers put long hours of code punching for the project. - -Hope the fate of this project will not be something like those distros which once was started with high degree of passion and enthusiasm and later the developers got uninterested. - -Post Script : Linus Torvalds do not mind systemd that much. - -**If you need Devuan, then join and support it now!** - -Development : [https://git.devuan.org][3] -Donations : [https://devuan.org/donate.html][4] -Discussions : [https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng][5] -Devuan Developers : onelove@devuan.org - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/debian-forked-over-systemd-birth-of-devuan-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://without-systemd.org/wiki/index.php/Category:Logo -[2]:http://www.tecmint.com/debian-forked-over-systemd-birth-of-devuan-linux/#comments -[3]:https://git.devuan.org/ -[4]:https://devuan.org/donate.html -[5]:https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng \ No newline at end of file diff --git a/sources/news/20150207 BQ and Canonical Officially Launch Aquaris E4.5 Ubuntu Edition, the First Ubuntu Phone.md b/sources/news/20150207 BQ and Canonical Officially Launch Aquaris E4.5 Ubuntu Edition, the First Ubuntu Phone.md deleted file mode 100644 index 02b147abd9..0000000000 --- a/sources/news/20150207 BQ and Canonical Officially Launch Aquaris E4.5 Ubuntu Edition, the First Ubuntu Phone.md +++ /dev/null @@ -1,45 +0,0 @@ -BQ and Canonical Officially Launch Aquaris E4.5 Ubuntu Edition, the First Ubuntu Phone ------- -*Everything you need to know about Aquaris E4.5* - -##BQ and Canonical have officially announced the new Aquaris E4.5 Ubuntu Edition and the fact that the phone will be available in the coming weeks through a series of flash sales. - -Information about the imminent launch of BQ Ubuntu phone has been around for some time and now it the two companies seem to have decided to make it official. This is the first device powered by Ubuntu Touch and a lot of people will be paying very close attention to what is happening in the mobile world. - -Ubuntu Touch is the latest operating system from Canonical and it's a brand new experience that aims to be very different from what users can find right now on the market, and that includes systems like Jola or Firefox OS. The OS has been in the works for more than two years and it's a system designed to work on all kind of devices, across the hardware spectrum. - -##Who is BQ and why has Canonical chosen them? - -When Mark Shuttleworth announced the two partners for the launch of Ubuntu Touch, BQ and Meizu, most of the people watching asked the same question. Who? BQ is not a very big company, but it's a young company and it has already started to penetrate the European market with some interesting devices. In many ways, they are doing the same thing companies like Meizu or Xiaomi are trying and succeeded in China: to offer devices that are interesting and different from what everyone else is doing. - -Many Ubuntu fans have questioned Canonical’s decision of choosing small companies and not big ones, but they are trying to do the same thing as the just-mentioned hardware makers. They want to offer an operating system radically different from what everyone else is doing. It's easy to understand why the goals of Canonical and BQ are actually one and the same. - -##What is Ubuntu Touch? - -The new operating system developed by Canonical embraces the fact that people are now swiping a lot more than they are tapping. Smartphones are no longer something new and everyone can understand how to swipe and get things done on a phone. Ubuntu devs have taken this to a whole new level. The operating system has no buttons, with the exception of the regular power and volume buttons. Everything is done with swiped gestures, from all sides of the screen. - -Also, Ubuntu Touch brings a new concept to the market, that of scopes. There is no longer a home screen, just scopes defined by the user to expand the experience. For example, you can have a Music scope that aggregates all your music sources on a single screen. It's a different way of looking at your smartphone, but this is built for people who crave a new experience. Don't worry, regular apps still exist, but they are differently integrated. - -![Aquaris E4.5 Ubuntu Edition start screen](http://i1-news.softpedia-static.com/images/news2/BQ-and-Canonical-Officially-Launch-Aquaris-E4-5-Ubuntu-Edition-472397-5.jpg) - -"As any kind of content can be presented via Scopes - they provide developers an easy path for their creations to be integral to the device experience. It is simple to create new Scopes via an easy to use UI toolkit with much lower development and maintenance costs than traditional apps. Canonical and BQ have worked with a host of partners to ensure that there is a wealth of interesting, relevant and dynamic content available at launch, with more content partners to follow," said Cristian Parrino, VP Mobile at Canonical. - -##BQ’s Aquaris E4.5 Ubuntu Edition hardware specs - -First of all, it's important to know that Aquaris E4.5 Ubuntu Edition is a dual-sim phone and it comes unlocked so that everyone can use it with their network. It boasts a MediaTek Quad-Core Cortex A7 processor running at up to 1.3 GHz, a 4.5-inch screen, 1GB RAM, rear camera with high-quality BSI sensors, Largan lens, and autofocus with dual flash(8MP), and front camera with 5MP. - -It's also worth mentioning that several operators in Europe, including 3 Sweden, amena.com, giffgaff, and Portugal Telecom have decided to provide SIM bundles at purchase. The price is €169.90 ($191). - -So, are you ready to buy the Aquaris E4.5 Ubuntu Edition? - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/BQ-and-Canonical-Officially-Launch-Aquaris-E4-5-Ubuntu-Edition-472397.shtml - -作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie \ No newline at end of file diff --git a/sources/news/20150225 Italian Region Emilia-Romagna Is Switching To OpenOffice.md b/sources/news/20150225 Italian Region Emilia-Romagna Is Switching To OpenOffice.md new file mode 100644 index 0000000000..59df5a0b2d --- /dev/null +++ b/sources/news/20150225 Italian Region Emilia-Romagna Is Switching To OpenOffice.md @@ -0,0 +1,40 @@ +Italian Region Emilia-Romagna Is Switching To OpenOffice +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Turin_Open_Source.jpg) + +Italy seems to be winning the race to Open Source adoption, it seems. We have learned about how various Italian cities like [Udine][1], [Turin][2], [Todi and Turni][3] opted for [open source alternatives of Microsoft office][4] in the past. Now the news comes that [Emilia-Romagna][5] region in northern Italy is about to complete its switch to [Apache OpenOffice][6] next month. + +### Switching to OpenOffice ### + +The migration to OpenOffice will be complete by next month and will cover 4200 workstations, across 10 departments and 5 agencies. In addition, Open Document Format (ODF) will be the default document format. The initiative to switch to OpenOffice was approved in late 2013 and was originally planned to be completed by end of 2014. The move to OpenOffice from proprietary office product is believed to [save around 2 million euro][8] in licensing fee. + +To ease this migration and improve interoperability, several custom tools and plugins are also being developed by the team in charge of the migration. + +Head of the project, Giovanni Grazia is enthusiastic about the migration but he is prepared for the brickbats as well. + +> “Changing office suite is hard work, and we use the occasion to advocate for free and open source software. Some of the region’s civil servants are keen to switch, and some are very annoyed, as they have been using the proprietary alternative for 20 years. To deal with any issues during the transition, a team of five support staffers is backed up by three IT specialists. Department by department, one at a time, we’re completing the switch. Step by step, change is coming.” + +#### Best wishes #### + +I wish good luck to Grazia and hope that other administrative regions in Italy will follow the suit. I also hope that neighboring countries like [France will also speed up the open source adoption process][8]. + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/emiliaromagna-completes-switch-openoffice/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/udine-open-source/ +[2]:http://itsfoss.com/italian-city-turin-open-source/ +[3]:http://itsfoss.com/italian-cities-switch-libreoffice/ +[4]:http://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[5]:http://en.wikipedia.org/wiki/Emilia-Romagna +[6]:https://www.openoffice.org/ +[7]:http://www.slwoods.co.uk/?p=2886 +[8]:http://itsfoss.com/french-city-toulouse-saved-1-million-euro-libreoffice/ \ No newline at end of file diff --git a/sources/share/20141127 11 Useful Utilities To Supercharge Your Ubuntu Experience.md b/sources/share/20141127 11 Useful Utilities To Supercharge Your Ubuntu Experience.md deleted file mode 100644 index e947762b7c..0000000000 --- a/sources/share/20141127 11 Useful Utilities To Supercharge Your Ubuntu Experience.md +++ /dev/null @@ -1,154 +0,0 @@ -11 Useful Utilities To Supercharge Your Ubuntu Experience -================================================================================ -**Whether you’re a relative novice or a seasoned pro, we all want to get the most from our operating system. Ubuntu, like most modern OSes, has more to offer than what is presented at first blush.** - -From tweaking and refining the look, behaviour and performance of the Unity desktop to performing system maintenance, there are a huge array of useful utilities and apps that can help **tune Ubuntu to meet your needs in no time**. - -Caveat time: Ubuntu has always shipped with ‘sane defaults’ — options that just work — out of the box. These defaults are well suited for the majority of people. They’re tested, accepted and recommended. - -But one size doesn’t fit all. For the tinkerers and experimenters among us the default experience is a starting point from which to tailor. - -So, without any more waffle, here is a set of 11 nifty utilities to help you supercharge your Ubuntu experience. - -### Unity Tweak Tool ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/unity-tweak-tool.jpg) - -I’ll kick off this list with the big one: **Unity Tweak** Tool. The kitchen sink of customisation, Unity Tweak Tool offers a comprehensive set of system tweaks tuned for Ubuntu and the Unity desktop. - -It’s stuffed full of switches, toggles and control, letting you configure everything from the way Unity looks to the way it behaves. Use it to **quickly and easily change the GTK theme and icon set**, set up hot corners, adjust launcher size, add or remove workspaces, and — notably — enable Unity’s elusive ‘minimise on click’ feature. - -Free and readily available from the Software Center, Unity Tweak Tool is one well worth keeping in your back pocket. - -### Unity Privacy Indicator ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/indicator-privacy-in-ubuntu.jpg) - -Privacy. A big, big issue and rightly so. But the topic is often shaded rather than binary; you may be happy to let some data or habits, say apps you frequently open, be logged locally, but not be ok with the searches you make in the Dash being ferried to a third-party server (however anonymous that data may be). - -[Privacy Indicator][1] is a useful tool to help you stay abreast of what files, folders and services are being accessed, logged and recce’d on the Ubuntu desktop. - -With a quick click on the ‘eye’ icon added to the desktop panel you can: - -- Toggle Online Search Results, Zeitgeist, HUD Logging & GeoIP -- Quick access to clean Zeitgeist, F2, Recent Files, etc. -- Options to show/hide desktop icons and name in the panel - -The latter two options may seem a little misplaced in this app but have less obvious privacy implications for those who take screenshots or screen share. - -- [Download Indicator Privacy (.deb)][2] - -### Unity Folders ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/unity-folders.jpg) - -**Android, iOS, OS X, Chrome OS, and GNOME Shell have app folders, and so can Unity with a nifty third-party app. ** - -“Unity Folders” allows you to organise apps on the Unity Launcher into handy folders — think ‘games’, ‘office’, ‘social‘, etc. You get quick access to your favourite apps without needing to open the Dash, which may suit your workflow. - -Each ‘folder’ is, actually, an application that opens up and positions itself near the origin point. But the overall effect is one that looks like an OS X style stack or an Android folder popover. - -Folder icons can be customised or auto-generated based on the applications tucked up inside. Existing folders can be edited, rearranged, rename and re-other stuff, too. - -- Create as many folders as you like -- Choose custom or auto-generated folder icon -- 3 folder layouts to choose from -- Set custom icons for apps added to folders -- Edit existing folders - -- Unity Folders Website - -### Caffeine ### - -A staple for many of us, and not just in our drinks, Caffeine offers a fast, silent way to stop your screensaver or lock-screen kicking in. The degree of usefulness will depend on your circumstances (read: quirks of your system), and though it’s not quite as user friendly as it once was, it’s still worth [checking out][3]. - -### System Monitor Indicator ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/multiload-indicator-in-ubuntu.jpg) - -If you’re a stat hound who likes to keep tabs on apps, processes and hardware status, Linux makes it easy. From Conky Configs to Terminal Commands — there’s no shortage of ways to monitor your CPU usage, network traffic or GPU temperature. - -But by far my favourite is System **Monitor Indicator** – also known as indicator-multiload — available from the Ubuntu Software Center. It has a host of configuration options, too. - -- [Click to Install ‘System Load Indicator’ on Ubuntu][4] - -### Power Saving Tools for Linux Laptops ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/08/front.jpg) - -**TLP** - -Linux distributions don’t have the best reputation when it comes to power efficiency on portable devices. - -If your own Linux laptop can barely get you from the sofa to the kitchen before needing a recharge, there are some tools you can try. - -TLP is one of the most popular automated background tool promising to prolong battery life of laptops running Linux. It does this by adjusting the settings and behaviour of system processes and hardware, such as enabling Wi-Fi power saving mode, runtime power management of PCI bus devices, and processor frequency scaling. - -It’s available to [install on Ubuntu 14.04 LTS and later using the dedicated TLP PPA][5] and comes with a ‘catch-all’ config to get you started. The more advanced users among you can dive in and manually adjust the settings to suit your own hardware, something that a [thorough guide on the TLP wiki][6] makes easy. - -**Laptop Mode Tools** - -If TLP sounds a little too complex — and there’s no shame if it does — there’s a simpler alternative: **Laptop Mode Tools**. This package is available to install from the Ubuntu Software Center and keeps the tweaks made to a set of sane defaults (Wi-Fi, Bluetooth, etc.). - -Laptop Mode Tools cannot be installed at the same time as TLP. - -- [Laptop Mode Tools in Ubuntu Software Center][7] - -### Intel Graphics Installer ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/intelgraphicsdriverinstaller.png) - -The Intel Graphics Installer tool is a must-have for those running Intel graphics hardware who want the best performance they can get. It makes finding and installing the latest Intel GPU drivers a painless, fuss-free affair — no PPAs or Terminal kung foo needed. - -- [Download Intel Graphics Installer for Linux 0.7][8] - -### Hardware Stats ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/Screen-Shot-2014-02-10-at-21.05.37.png) - -If you plan on upgrading your PC or replacing a worn-out part you’ll need to get some specific hardware details, such as RAM type, CPU socket set or what PCI slots are available. - -**I-Nex** makes unearthing this, and host of other detailed system stats, easy. Use it to find your motherboard model number, RAM stepping, S.M.A.R.T. status and…well, pretty much anything else you can think of! - -- [Learn More About I-Nex on Launchpad][9] - -### Disk Space Visualizer ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/disk-usage-visualizer-for-ubuntu.jpg) - -In this age of 1TB hard drives we might not need to be as prudent with disk space as we once were. But for those of using a smallish SSD, running multiple partitions or working in a virtual machine with a fixed-size virtual disk, there’ll be times when freeing up a bit of extra space is required. - -GNOME Disks, installed in Ubuntu by default, makes finding the biggest space-gobbling culprits easy. Ideal for locating hidden logs, caches, and media files. - -### BleachBit (Cruft Cleaner) ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/bleachbit.jpg) - -Windows users will be familiar with applications like CCleaner, which scan for and clean out junk files, empty folders, bloated caches, and obsolete packages. For a a similarly quick and effortless click n’ clean solution on Ubuntu try **BleachBit**. - -It is a powerful tool, so do pay attention to what you’re cleaning. Don’t aimlessly check every box; not everything that it can clean needs to be. Play it smart; when in doubt, leave it out. - -- [Install BleachBit from Ubuntu Software Center][10] - -Got a favourite system utility of your own? Let others know about it in the comments. --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2014/11/useful-tools-for-ubuntu-do-you-use-them - -作者:[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.florian-diesch.de/software/indicator-privacy/index.html -[2]:http://www.florian-diesch.de/software/indicator-privacy/dist/indicator-privacy_0.04-1_all.deb -[3]:http://www.omgubuntu.co.uk/2014/05/stop-ubuntu-sleeping-caffeine -[4]:apt://indicator-mulitload -[5]:https://launchpad.net/~linrunner/+archive/ubuntu/tlp/+packages -[6]:http://linrunner.de/en/tlp/docs/tlp-configuration.html -[7]:https://apps.ubuntu.com/cat/applications/laptop-mode-tools/ -[8]:https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-linux-1.0.7 -[9]:https://launchpad.net/i-nex -[10]:https://apps.ubuntu.com/cat/applications/bleachbit/ diff --git a/sources/share/20150119 Cutegram--A Better Telegram Client For GNU or Linux.md b/sources/share/20150119 Cutegram--A Better Telegram Client For GNU or Linux.md deleted file mode 100644 index 7a051be4fc..0000000000 --- a/sources/share/20150119 Cutegram--A Better Telegram Client For GNU or Linux.md +++ /dev/null @@ -1,76 +0,0 @@ -Cutegram: A Better Telegram Client For GNU/Linux -================================================================================ -No need for a introduction to **Telegram**, right? Telegram is a popular free Instant messenger application that can be used to chat with your friends all over the world. Unlike Whatsapp, Telegram is free forever, no ads, no subscription fees. And, the Telegram client is open source too. Telegram is available for many different platforms, including Linux, Android, iOS, Windows Phone, Windows, and Mac OS X. The messages which are sending using telegram are highly encrypted and self-destructive. It is very secure, and there is no limit on the size of your media and chats. - -You can install and use Telegram desktop on your Debian/Ubuntu systems as mentioned in [our previous tutorial][1]. However, a new telegram client called **Cutegram** is available now to make your chat experience more fun and easy. - -### What is Cutegram? ### - -Cutegram is a free and opensource telegram clients for GNU/Linux focusing on user friendly, compatibility with Linux desktop environments and easy to use. Cutegram using Qt5, QML, libqtelegram, libappindication, AsemanQtTools technologies and Faenza icons and Twitter emojies graphic sets. It’s free and released under GPLv3 license. - -### Install Cutegram ### - -Head over to the Cutegram homepage and download the latest version of your distribution’s choice. As I use Ubuntu 64 bit, I downloaded the .deb file. - - wget http://aseman.co/downloads/cutegram/cutegram_1.0.2-1-amd64.deb - -Now, Install Cutegram as shown below. - - sudo apt-get install gdebi - sudo gdebi cutegram_1.0.2-1-amd64.deb - -For other distributions, run the following commands. - -**64bit:** - - wget http://aseman.co/downloads/cutegram/cutegram-1.0.2-linux-x64-installer.run - -**32 bit:** - - wget http://aseman.co/downloads/cutegram/cutegram-1.0.2-linux-installer.run - -Set executable permission: - - chmod + cutegram-1.0.2-linux*.run - -And, install it as shown below. - - sudo ./cutegram-1.0.2-linux*.run - -### Usage ### - -Launch Cutegram either from Menu or Unity dash. From the login screen, select your country, and enter your mobile number, finally click **Login**. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Cutegram_005.png) - -A code will be sent to your mobile number. Enter the code and click **Sign in**. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Cutegram_002.png) - -There you go. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Cutegram_003.png) - -Start Chatting! - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Cutegram_004.png) - -And, you can set a profile picture, start new chat/group chat, or secret chat from using the buttons on the left pane. - -Stay happy! Cheers!! - -For more details, check the [Cutegram website][2]. - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/cutegram-better-telegram-client-gnulinux/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:http://www.unixmen.com/install-telegram-desktop-via-ppa/ -[2]:http://aseman.co/en/products/cutegram/ \ No newline at end of file diff --git a/sources/share/20150126 CD Audio Grabbers--Graphical Based.md b/sources/share/20150126 CD Audio Grabbers--Graphical Based.md deleted file mode 100644 index 5dcfa26cca..0000000000 --- a/sources/share/20150126 CD Audio Grabbers--Graphical Based.md +++ /dev/null @@ -1,128 +0,0 @@ -CD Audio Grabbers - Graphical Based -================================================================================ -CD audio grabbers are designed to extract ("rip") the raw digital audio (in a format commonly called CDDA) from a compact disc to a file or other output. This type of software enables a user to encode the digital audio into a variety of formats, and download and upload disc info from freedb, an internet compact disc database. - -Is copying CDs legal? Under US copyright law, converting an original CD to digital files for personal use has been cited as qualifying as 'fair use'. However, US copyright law does not explicitly allow or forbid making copies of a personally-owned audio CD, and case law has not yet established what specific scenarios are permitted as fair use. The copyright position is much clearer in the UK. From 2014 it become legal for UK citizens to make copies of CDs, MP3s, DVD, Blu-rays and e-books. This only applies if the individual owns the physical media being ripped, and the copy is made only for their own private use. For other countries in the European Union, member nations can allow a private copy exception too. - -If you are not sure what the position is for the country you live in, please check your local copyright law to make sure that you are on the right side of the law before using the software featured in this two page article. - -To some extent, it may seem a bit of a chore to rip CDs. Streaming services like Spotify and Google Play Music offer access to a huge library of music in a convenient form, and without having to rip your CD collection. However, if you already have a large CD collection, it is still desirable to be able to convert your CDs to enjoy on mobile devices like smartphones, tablets, and portable MP3 players. - -This two page article highlights my favorite audio CD grabbers. I pick the best four graphical audio grabbers, and the best four console audio grabbers. All of the utilities are released under an open source license. - ----------- - -![](http://www.linuxlinks.com/portal/content2/png/freac.png) - -![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-freac.png) - -fre:ac is an open source audio converter and CD ripper that supports a wide range of popular formats and encoders. The utility currently converts between MP3, MP4/M4A, WMA, Ogg Vorbis, FLAC, AAC, WAV and Bonk formats. It comes with several different presents for the LAME encoder. - -#### Features include: #### - -- Easy to learn and use -- Converter for MP3, MP4/M4A, WMA, Ogg Vorbis, FLAC, AAC, WAV and Bonk formats -- Integrated CD ripper with CDDB/freedb title database support -- Multi-core optimized encoders to speed up conversions on modern PCs -- Full Unicode support for tags and file names -- Easy to learn and use, still offers expert options when you need them -- Joblists -- Can use Winamp 2 input plugins -- Multilingual user interface available in 41 languages - -- Website: [freac.org][1] -- Developer: Robert Kausch -- License: GNU GPL v2 -- Version Number: 20141005 - ----------- - -![](http://www.linuxlinks.com/portal/content2/png/Audex.png) - -![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Audex.png) - -Audex is an easy to use open source audio CD ripping application. Whilst it is in a fairly early stage of development, this KDE desktop tool is stable, slick and simple to use. - -The assistant is able to create profiles for LAME, OGG Vorbis (oggenc), FLAC, FAAC (AAC/MP4) and RIFF WAVE. Beyond the assistant you can define your own profile, which means, that Audex works together with commmand line encoders in general. - -#### Features include: #### - -- Extract with CDDA Paranoia -- Extract and encode run parallel -- Filename editing with local and remote CDDB/FreeDB database -- Submit new entries to CDDB/FreeDB database -- Metadata correction tools like capitalize etc -- Multi-profile extraction (with one commandline-encoder per profile) -- Fetch covers from the internet and store them in the database -- Create playlists, cover and template-based-info files in target directory -- Create extraction and encoding protocols -- Transfer files to a FTP-server -- Internationalization support - -- Website: [kde.maniatek.com/audex][2] -- Developer: Marco Nelles -- License: GNU GPL v3 -- Version Number: 0.79 - ----------- - -![](http://www.linuxlinks.com/portal/content2/png/SoundJuicer.png) - -![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-SoundJuicer.png) - -Sound Juicer is a lean CD ripper using GTK+ and GStreamer. It extracts audio from CDs and converts it into audio files. Sound Juicer can also play audio tracks directly from the CD, offering a preview before ripping. - -It supports any audio codec supported by a GStreamer plugin, including MP3, Ogg Vorbis, FLAC, and uncompressed PCM formats. - -It is an established part of the GNOME desktop environment. - -#### Features include: #### - -- Automatic track tagging via CDDB -- Encoding to ogg / vorbis, FLAC and raw WAV -- Easy to configure encoding path -- Multiple genres -- Internationalization support - -- Website: [burtonini.com][3] -- Developer: Ross Burton -- License: GNU GPL v2 -- Version Number: 3.14 - ----------- - -![](http://www.linuxlinks.com/portal/content2/png/ripperX.png) - -![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-ripperX.png) - -ripperX is an open source graphical interface for ripping CD audio tracks and encoding them to Ogg, MP2, MP3, or FLAC formats. It's goal is to be easy to use, requiring only a few mouse clicks to convert an entire album. It supports CDDB lookups for album and track information. - -It uses cdparanoia to convert (i.e. "rip") CD audio tracks to WAV files, and then calls the Vorbis/Ogg encoder oggenc to convert the WAV to an OGG file. It can also call flac to perform lossless compression on the WAV file, resulting in a FLAC file. - -#### Features include: #### - -- Very simple to use -- Rip audio CD tracks into WAV, MP3, OGG, or FLAC files -- Supports CDDB lookups -- Supports ID3v2 tags -- Pause the ripping process - -- Website: [sourceforge.net/projects/ripperx][4] -- Developer: Marc André Tanner -- License: MIT/X Consortium License -- Version Number: 2.8.0 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150125043738417/AudioGrabbersGraphical.html - -作者:Frazer Kline -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://www.freac.org/ -[2]:http://kde.maniatek.com/audex/ -[3]:http://burtonini.com/blog/computers/sound-juicer -[4]:http://sourceforge.net/projects/ripperx/ \ No newline at end of file diff --git a/sources/share/20150128 Meet Vivaldi--A New Web Browser Built for Power Users.md b/sources/share/20150128 Meet Vivaldi--A New Web Browser Built for Power Users.md deleted file mode 100644 index d8df2ec586..0000000000 --- a/sources/share/20150128 Meet Vivaldi--A New Web Browser Built for Power Users.md +++ /dev/null @@ -1,62 +0,0 @@ -Translating by H-mudcup - -Meet Vivaldi — A New Web Browser Built for Power Users -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/Screen-Shot-2015-01-27-at-17.36.jpg) - -**A brand new web browser has arrived this week that aims to meet the needs of power users — and it’s already available for Linux.** - -Vivaldi is the name of this new browser and it has been launched as a tech preview (read: a beta without the responsibility) for 64-bit Linux machines, Windows and Mac. It is built — shock — on the tried-and-tested open-source frameworks of Chromium, Blink and Google’s open-source V8 JavaScript engine (among other projects). - -Does the world really want another browser? Vivaldi, the brain child of former Opera Software CEO Jon von Tetzchner, is less concerned about want and more about need. - -Vivaldi is being built with the sort of features that keyboard preferring tab addicts need. It is not being pitched at users who find Firefox perplexing or whose sole criticism of Chrome is that it moved the bookmarks button. - -That’s not tacky marketing spiel either. Despite the ‘technical preview’ badge it comes with, Vivaldi is already packed with features that demonstrate its power user slant. - -Plenty of folks feel left behind and underserved by the simplified, paired back offerings other software companies are producing. Vivaldi, even at this early juncture, looks well placed to succeed in winning them over. - -### Vivaldi Features ### - -A few of Vivaldi’s key features already present include: - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/quick.jpg) - -**Quick Commands** (Ctrl + Q) is an in-app HUD that lets you quickly filter through settings, options and features, be it opening a bookmark or hiding the status bar, using your keyboard. No clicks needed. - -**Tab Stacks** let you clean up your workspace by grouping separate tabs into one, and then using a keyboard command or the tab preview picker to switch between them. - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/tab-stacks.jpg) - -A collapsible **side panel** that houses extra features (just like old Opera) including a (not yet working) mail client, contacts, bookmarks browser and note taking section that lets you take and annotate screenshots. - -A bunch of other features are on offer too, including customizable keyboard shortcuts, a tabs bar that can be set on any edge of the browser (or hidden entirely), privacy options and a speed dial with folders. - -### Opera Mark II ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/vivaldi-settings-in-ubuntu-750x434.jpg) - -It’s not a leap to see Vivaldi as the true successor to Opera post-Presto (Opera’s old, proprietary rendering engine). Opera (which also pushed out a minor new update today) has split out many of its “power user” features as it chases a lighter, more manageable set of features. - -Vivaldi wants to pick up the baggage Opera has been so keen to offload. And while that might not help it grab marketshare it will see it grab the attention of power users, many of whom will no doubt already be using Linux. - -### Download ### - -Interested in taking it for a spin? You can. Vivaldi is available to download for Windows, Mac and 64-bit Linux distributions. On the latter you have a choice of Debian or RPM installer. - -Bear in mind that it’s not finished and that more features (including extensions, sync and more) are planned for future builds. - -- [Download Vivaldi Tech Preview for Linux][1] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/01/vivaldi-web-browser-linux-download-power-users - -作者:[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]:https://vivaldi.com/#Download diff --git a/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md new file mode 100644 index 0000000000..33aa731843 --- /dev/null +++ b/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md @@ -0,0 +1,67 @@ +Install Google’s Material Design Inspired GTK And Icon Theme Paper in Linux +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Paper_theme_Material_Design.jpg) + +[Paper][1] is a new upcoming GTK and icon theme inspired by Google’s [Material design][2] guidelines. It is developed by Sam Hewitt, the man behind [Moka Project][3]. Moka has always been in the list of [best themes for Ubuntu][4] and looking at Paper, I can say that once it is developed completely, it will surely be listed as one of the [best GTK themes][5]. + +Yes, you heard it right. The theme is still under development. Therefore I suggest that if you want to install Paper theme in Ubuntu or any other Linux distributions, do it only for experimentation purpose. You may see some broken icons here and there but the over all experience is nice. + +### Install Paper theme in Ubuntu based distributions via PPA ### + +Sam has a dedicated PPA for Ubuntu based distributions. I recommend that you use this PPA instead of downloading the theme because you’ll be getting the updates on the themes regularly. This PPA is available for Ubuntu 15.04, Ubuntu 14.10, Ubuntu 14.04, Elementary OS Freya, Elementary OS Luna, Linux Mint 17, Linux Mint 16 and other Linux distributions based on Ubuntu. + +Open a terminal and use the following commands: + + sudo add-apt-repository ppa:snwh/pulp + sudo apt-get update + sudo apt-get install paper-gtk-theme paper-icon-theme + +### Download Paper GTK and icon theme ### + +If you do not want to use the PPA, you can download the themes and icons manually. As I said previously, you won’t get the updates automatically this way. + +- [Download Paper icon themes][6] +- [Download Paper GTK themes][7] + +#### Using Paper themes and icons #### + +I hope that you know how to change or install themes in your respective Linux distributions. If you are not unaware of it, below are few tutorials that could help you to install new themes: + +- [How to change themes in Ubuntu Unity][8] +- [How to change themes in GNOME Shell][9] +- [How to change themes in Linux Mint][10] +- [How to change theme in Elementary OS Freya][11] + +#### Here is what Paper theme looks like #### + +Since I am using [Elementary OS Freya][12] these days, here are some of the screenshots of how Paper theme and icons look like in Elementary OS Freya. I have used a wallpaper with Material design look so that it blends well with the icon and themes. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya_1.jpeg) + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya.jpeg) + +How do you find this Material design inspired theme? If you did use it, do share the screenshot of your desktop with rest of us here. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-paper-theme-linux/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://snwh.org/paper/ +[2]:http://www.google.fr/design/spec/material-design/introduction.html +[3]:http://mokaproject.com/moka-icon-theme/ +[4]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ +[5]:http://itsfoss.com/gnome-shell-themes-ubuntu-1404/ +[6]:https://github.com/snwh/paper-icon-theme +[7]:https://github.com/snwh/paper-gtk-theme +[8]:http://itsfoss.com/how-to-install-themes-in-ubuntu-13-10/ +[9]:http://itsfoss.com/install-switch-themes-gnome-shell/ +[10]:http://itsfoss.com/install-icon-linux-mint/ +[11]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ +[12]:http://itsfoss.com/tag/elementary-os-freya/ \ No newline at end of file diff --git a/sources/share/20150227 Chess in a Few Bytes.md b/sources/share/20150227 Chess in a Few Bytes.md new file mode 100644 index 0000000000..26ef9d523d --- /dev/null +++ b/sources/share/20150227 Chess in a Few Bytes.md @@ -0,0 +1,114 @@ +Chess in a Few Bytes +================================================================================ +I am showing my age by mentioning that my introduction to computing was a ZX81, a home computer produced by a UK developer (Sinclair Research) which had a whopping 1KB of RAM. The 1KB is not a typographical error, the home computer really shipped with a mere 1KB of onboard memory. But this memory limitation did not prevent enthusiasts producing a huge variety of software. In fact the machine sparked a generation of programming wizards who were forced to get to grips with its workings. The machine was upgradable with a 16KB RAM pack which offered so many more coding possibilities. But the unexpanded 1KB machine still inspired programmers to release remarkable software. + +![1K ZX Chess ](http://www.linuxlinks.com/portal/content2/reviews/Games2/1KZXChess.jpg) + +My favourite ZX81 games were Flight Simulation, 3D Monster Maze, Galaxians, and above all 1K ZX Chess. Only the latter was written for the unexpanded ZX81. In fact, David Horne's 1K ZX Chess was coded in a mere 672 bytes of RAM. However, the game managed to implement most chess rules, and offer a computer opponent. While some important rules were omitted (castling, pawn promotion, and en passant capture), it was still amazing to be able to play against artificial intelligence. The game took up a fair chunk of my misspent youth. + +1K ZX Chess remained the smallest implementation of chess on any computer for 33 years until the record was broken by BootChess this year, and subsequently by Toledo AtomChess. These three games do not implement all of the chess rules, so for completeness I have included my favourite small implementation of chess that implements a complete set of chess rules. + +Linux has a good range of extremely strong chess engines such as Stockfish, Critter, Togo II, Crafty, GNU Chess, and Komodo. The chess engines featured in this article offer no match to a good chess engine, but they show how much can be achieved with a minuscule codebase. + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/ToledoAtomchess.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Toledo.png) + +You may have seen a considerable amount of press coverage about BootChess, a chess program written in 487 bytes of code, smashing the record of the then smallest chess program, 1K ZX Chess. Óscar Toledo Gutiérrez took up the mantle and decided to code an even more compact chess game. Toledo Atomchess is a mere 481 bytes of x86 assembly code which fits in a boot sector. The engine plays a reasonable game of chess given the limitations of its incredibly small codebase. + +Features include: + +- Basic chess movements +- ASCII text representation of chess board +- Moves are entered in algebraic form +- Search depth of 3-ply + +Obviously, to fit the chess of game into 481 bytes, the author had to make some sacrifices. These limitations include: + +- No promotion of pawns +- No castling +- No en passant +- No move validation + +The author has also written chess programs in C, JavaScript and Java; each are very small implementations of chess. + +- Website: [nanochess.org/chess6.html][1] +- Developer: Óscar Toledo Gutiérrez +- License: Free for non-commercial use +- Version Number: - + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/BootChess.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-BootChess.png) + +BootChess is an extremely small computer implementation of chess. The game is crammed into a mere 487 bytes and runs on Windows, Mac OS X and Linux operating systems. The board and pieces of BootChess are represented by text alone, with P representing pawns, Q used for the queens and full stops entered for empty squares. + +Features include: + +- Graphic text representation of chess board and use input +- Bootsector sized (512 bytes) with a playable chess game +- x86 bios hardware only bootstrap (no software dependencies) +- All main legal moves including double square pawn start +- Pawn promotion to queen (contrary to 1k ZX Chess) +- CPU artificial intelligence called taxiMax > minMax half-ply +- Hard-coded Spanish white pieces opening + +Again, there are some important limitations. Omissions include: + +- Under-promotion +- En passant pawn capture +- No castling +- 3-repetition rule +- 50 move draw rule +- No opening or closing books +- One or more minMax/negaMax full plies for artificial intelligence + +- Website: [www.pouet.net/prod.php?which=64962][2] +- Developer: Olivier "Baudsurfer/RSi" Poudade +- License: WTFPL v2 +- Version Number: .02 + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/Micro-Max.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Micro-Max.png) + +Micro-Max is a 133-line chess source which is written in C + +The author has implemented a (hash) transposition table, the engine checks the legality of the input moves, and full FIDE rules except for for under-promotions. + +Features include: + +- Recursive negamax search +- Quiescence search with recaptures +- Recapture extensions +- Iterative deepening +- Best-move-first 'sorting' +- Hash table storing score and best move +- Full FIDE rules (except under promotion) and move-legality checking + +There is also a stripped-down 1433-character version, but allowing you to play under-promotions for full FIDE-rule compliance. + +- Website: [home.hccnet.nl/h.g.muller/max-src2.html][3] +- Developer: Harm Geert Muller +- License: The MIT License +- Version Number: 3.2 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150222033906262/ChessBytes.html + +作者:Frazer Kline +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://nanochess.org/chess6.html +[2]:http://www.pouet.net/prod.php?which=64962 +[3]:http://home.hccnet.nl/h.g.muller/max-src2.html \ No newline at end of file diff --git a/sources/share/20150306 Pinta 1.6 Released Install It In Ubuntu And Linux Mint.md b/sources/share/20150306 Pinta 1.6 Released Install It In Ubuntu And Linux Mint.md new file mode 100644 index 0000000000..8aef952736 --- /dev/null +++ b/sources/share/20150306 Pinta 1.6 Released Install It In Ubuntu And Linux Mint.md @@ -0,0 +1,49 @@ +Pinta 1.6 Released! Install It In Ubuntu And Linux Mint +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Pinta_Ubuntu_Linux.jpeg) + +[Pinta][1] is a free and open source drawing application which is very popular among Linux users. It won’t be incorrect to term it as an **open source alternative to Microsoft Paint**. Pinta is available for all major platforms such as Linux, Windows and Mac OS X. + +While Gimp is popular as full featured image editing software, Pinta is more of a paint and drawing tool. I have used it extensively in my tutorials for drawing arrows and curves on the screenshots and I can say that it’s my favorite drawing app in Linux. + +### New features in Pinta 1.6 ### + +After over an year, Pinta has released version 1.6, fixing over 50 bugs and introducing some new features. New features are as following: + +- Line tool now supports drawing curves and arrows +- Shapes can be edited even after being drawn +- All shape tools now support drawing dashed lines +- All selection tools now support the Union, Exclude, Xor, and Intersection modes +- Add-in manager now consists of ‘add ins’ +- New options in command line usage + +New version also fixes the annoying bug where you [cannot open a file with Pinta in right click menu option][2]. You can read all the changes in the [release note][3]. + +### Install Pinta 1.6 in Ubuntu and Linux Mint ### + +Pinta 1.5 is available in Ubuntu 14.04, 14.10, Linux Mint 17, elementary OS. If you want to install the latest version 1.6, you can use the official PPA from Pinta team. Don’t worry if you have Pinta 1.5 installed already. Installing it again will upgrade the version. + +Open a terminal and use the following commands: + + sudo add-apt-repository ppa:pinta-maintainers/pinta-stable + sudo apt-get update + sudo apt-get install pinta + +To download the source code or to get the installation files for Windows and Mac OS X, check the [download page of Pinta][4]. In a related post, you can also check out [best photo applications for Linux][5]. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/pinta-1-6-ubuntu-linux-mint/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://pinta-project.com/ +[2]:http://itsfoss.com/add-application-list-open-applications-ubuntu-1310/ +[3]:http://pinta-project.com/releases/1-6 +[4]:http://pinta-project.com/releases +[5]:http://itsfoss.com/image-applications-ubuntu-linux/ \ No newline at end of file diff --git a/sources/share/20150309 New App Brings Android Notifications to The GNOME Desktop.md b/sources/share/20150309 New App Brings Android Notifications to The GNOME Desktop.md new file mode 100644 index 0000000000..0a67dab449 --- /dev/null +++ b/sources/share/20150309 New App Brings Android Notifications to The GNOME Desktop.md @@ -0,0 +1,38 @@ +New App Brings Android Notifications to The GNOME Desktop +================================================================================ +![Fancy seeing your Android alerts here? You can.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/02/Screen-Shot-2015-02-24-at-17.47.48.png) +Fancy seeing your Android alerts here? You can. + +**You’ll shortly be able to view your Android notifications on the GNOME desktop thanks to a new application in development.** + +The new project is called ‘Nuntius’ and lets notifications received on an Android phone appear on the GNOME desktop. It’s with GNOME 3.16 and its (wonderfully) [redesigned notification system][1] that the app and its features will be used by more. + +The app, which developers are hoping will be ready in time for this month’s release of GNOME 3.16, will work over Bluetooth to ensure that nothing is passed to external servers or stored online. This does mean that your phone will need to be in a certain proximity to your GNOME desktop for the feature to work. + +It also isn’t yet possible to reply to a text message or act on a news alert. + +The development team do caution that **this is an early release** and those planning on diving in to use it should expect minimum functionality for now. + +The mobile app required to see Android notifications in GNOME’s new notification shade is already available [from the Google Play Store][2] and the GNOME application is already available in the Fedora repos. + +The developers have open-sourced both the Android app and the GNOME application receiver and hosted them (where else) on GitHub. + +A similar tool [has been available for KDE desktops][3] – ‘KDE Connect’ – for a year or two, while the ever-gaining Pushbullet offers similar features on Windows, Mac and Linux desktops for iOS and Android platforms using Google Chrome. + +- [Nuntius for Android & GNOME on GitHub][4] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/03/new-app-brings-android-notifications-to-the-gnome-desktop + +作者:[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/2015/02/4-reason-why-gnome-3-16-might-be-the-best-version-yet-gallery +[2]:https://play.google.com/store/apps/details?id=org.holylobster.nuntius +[3]:http://www.omgubuntu.co.uk/2014/06/kde-connect-android-notifications-linux-desktop +[4]:https://github.com/holylobster \ No newline at end of file diff --git a/sources/talk/20141211 Open source all over the world.md b/sources/talk/20141211 Open source all over the world.md index 175d870cb7..bd306edd5a 100644 --- a/sources/talk/20141211 Open source all over the world.md +++ b/sources/talk/20141211 Open source all over the world.md @@ -1,6 +1,3 @@ -////translating by yupmoon - - Open source all over the world ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) diff --git a/sources/talk/20141217 Docker and the Integrated Open Source Company.md b/sources/talk/20141217 Docker and the Integrated Open Source Company.md deleted file mode 100644 index 5a98324135..0000000000 --- a/sources/talk/20141217 Docker and the Integrated Open Source Company.md +++ /dev/null @@ -1,81 +0,0 @@ -Docker and the Integrated Open Source Company -================================================================================ -It’s been a long time since an open source project has gotten as much buzz and attention as Docker. The easiest way to explain the concept is, well, to look at the logo of the eponymous1 company that created and manages the project: - -![](http://2yj23r14cytosbxol4cavq337g.wpengine.netdna-cdn.com/wp-content/uploads/2014/12/docker.png) - -The reference in the logo is to shipping containers, one of the most important inventions of the 20th century. Actually, the word “invention” is not quite right: the idea of putting bulk goods into consistently-sized boxes goes back at least a few hundred years.[2][1] What changed the world was the standardization of containers by a trucking magnate named Malcom McLean and Keith Tantlinger, his head engineer. Tantlinger developed much of the technology undergirding the intermodal container, especially its corner casting and Twistlock mechanism that allowed the containers to be stacked on ships, transported by trucks, and moved by crane. More importantly, Tantlinger convinced McLean to release the patented design for anyone to copy without license, knowing that the technology would only be valuable if it were deployed in every port and on every transport ship in the world. Tantlinger, to put it in software terms, open-sourced the design. - -Shipping containers really are a perfect metaphor for what Docker is building: standardized containers for applications. - - -- Just as the idea of a container wasn’t invented by Tantlinger, Docker is building on a concept that has been around for quite a while. Companies like Oracle, HP, and IBM have used containers for many years, and Google especially has a very similar implementation to Docker that they use for internal projects. Docker, though, by being open source and [community-centric][2], offers the promise of standardization -- It doesn’t matter what is inside of a shipping container; the container itself will fit on any ship, truck, or crane in the world. Similarly, it doesn’t matter what app (and associated files, frameworks, dependencies, etc.) is inside of a docker container; the container will run on any Linux distribution and, more importantly, just about every cloud provider including AWS, Azure, Google Cloud Platform, Rackspace, etc. -- When you move abroad, you can literally have a container brought to your house, stick in your belongings, and then have the entire thing moved to a truck to a crane to a ship to your new country. Similarly, containers allow developers to build and test an application on their local machine and have confidence that the application will behave the exact same way when it is pushed out to a server. Because everything is self-contained, the developer does not need to worry about there being different frameworks, versions, and other dependencies in the various places the application might be run - -The implications of this are far-reaching: not only do containers make it easier to manage the lifecycle of an application, they also (theoretically) commoditize cloud services through the age-old hope of “write once run anywhere.” More importantly, at least for now, docker containers offer the potential of being far more efficient than virtual machines. Relative to a container, using virtual machines is like using a car transport ship to move cargo: each unique entity on the ship is self-powered, which means a lot of wasted resources (those car engines aren’t very useful while crossing the ocean). Similarly, each virtual machine has to deal with the overhead of its own OS; containers, on the other hand, all share the same OS resulting in huge efficiency gains.[3][4] - -In short, Docker is a really big deal from a technical perspective. What excites me, though, is that the company is also innovating when it comes to their business model. - ----------- - -The problem with monetizing open source is self-evident: if the software is freely available, what exactly is worth paying for? And, unlike media, you can’t exactly stick an advertisement next to some code! - -For many years the default answer has been to “be like Red Hat.” Red Hat is the creator and maintainer of the Red Hat Enterprise Linux (RHEL) distribution, which, like all Linux distributions, is freely available.[4][5] Red Hat, however, makes money by offering support, training, a certification program, etc. for enterprises looking to use their software. It is very much a traditional enterprise model – make money on support! – just minus the up-front license fees. - -This sort of business is certainly still viable; Hortonworks is [set to IPO][3] with a similar model based on Hadoop, albeit at a much lower valuation than it received during its last VC round. That doesn’t surprise me: I don’t think this is a particularly great model from a business perspective. - -To understand why it’s useful to think about there being three distinct parts of any company that is based on open source: the open source project itself, any value-added software built on top of that project, and the actual means of making money: - -![](http://2yj23r14cytosbxol4cavq337g.wpengine.netdna-cdn.com/wp-content/uploads/2014/12/opensourcepaper.jpg) - -*There are three parts of an open source business: the project itself, the value-added software on top of that project, and the means of monetization* - -The problem with the “Red Hat” model is the complete separation of all three of these parts: Red Hat doesn’t control the core project (Linux), and their value-added software (RHEL) is free, leaving their money-making support program to stand alone. To the company’s credit they have pulled this model off, but I think a big reason is because utilizing Linux was so much more of a challenge back in the 90s.[5][11] I highly doubt Red Hat could successfully build a similar business from scratch today. - -![](http://2yj23r14cytosbxol4cavq337g.wpengine.netdna-cdn.com/wp-content/uploads/2014/12/redhatpaper.jpg) - -*The three parts of Red Hat’s business are separate and more difficult for the company to control and monetize* - -GitHub, the repository hosting service, is exploring what is to my mind a more compelling model. GitHub’s value-added software is a hosting service based on Git, an open-source project designed by Linux creator Linus Torvalds. Crucially, GitHub is seeking to monetize that hosting service directly, both through a SaaS model and through an on-premise enterprise offering[6][6]. This means that, in comparison to Red Hat, there is one less place to disintermediate GitHub: you can’t get their value-added software (for private projects – public is free) unless you’re willing to pay. - -![](http://2yj23r14cytosbxol4cavq337g.wpengine.netdna-cdn.com/wp-content/uploads/2014/12/githubpaper.jpg) - -*While GitHub does not control Git, their value-added software and means of monetization are unified, making the latter much easier and more sustainable* - -Docker takes the GitHub model a step further: the company controls everything from the open source project itself to the value-added software (DockerHub) built on top of that, and, just last week, [announced a monetization model][7] that is very similar to GitHub’s enterprise offering. Presuming Docker continues its present momentum and finds success with this enterprise offering, they have the potential to be a fully integrated open source software company: project, value-added software, and monetization all rolled into one. - -![](http://2yj23r14cytosbxol4cavq337g.wpengine.netdna-cdn.com/wp-content/uploads/2014/12/dockerpaper.jpg) - -*Docker controls all the parts of their business: they are a fully integrated open source company.* - -This is exciting, and, to be honest, a little scary. What is exciting is that very few movements have had such a profound effect as open source software, and not just on the tech industry. Open source products are responsible for end user products like this blog; more importantly, open source technologies have enabled exponentially more startups to get off the ground with minimal investment, vastly accelerating the rate of innovation and iteration in tech.[7][8] The ongoing challenge for any open source project, though, is funding, and Docker’s business model is a potentially sustainable solution not just for Docker but for future open source technologies. - -That said, if Docker is successful, over the long run commercial incentives will steer the Docker open source project in a way that benefits Docker the company, which may not be what is best for the community broadly. That is what is scary about this: might open source in the long run be subtly corrupted by this business model? The makers of CoreOS, a stripped-down Linux distribution that is a perfect complement for Docker, [argued that was the case][9] last week: - -> We thought Docker would become a simple unit that we can all agree on. Unfortunately, a simple re-usable component is not how things are playing out. Docker now is building tools for launching cloud servers, systems for clustering, and a wide range of functions: building images, running images, uploading, downloading, and eventually even overlay networking, all compiled into one monolithic binary running primarily as root on your server. The standard container manifesto was removed. We should stop talking about Docker containers, and start talking about the Docker Platform. It is not becoming the simple composable building block we had envisioned. - -This, I suppose, is the beauty of open source: if you disagree, fork, which is essentially what CoreOS did, launching their own “Rocket” container.[8][10] It also shows that Docker’s business model – and any business model that contains open source – will never be completely defensible: there will always be a disintermediation point. I suspect, though, that Rocket will fail and Docker’s momentum will continue: the logic of there being one true container is inexorable, and Docker has already built up quite a bit of infrastructure and – just maybe – a business model to make it sustainable. - --------------------------------------------------------------------------------- - -via: http://stratechery.com/2014/docker-integrated-open-source-company/ - -作者:[Ben Thompson][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://stratechery.com/category/about/ -[1]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:1:1300 -[2]:https://github.com/docker/docker -[3]:http://blogs.wsj.com/digits/2014/12/01/ipo-bound-hortonworks-drops-out-of-billion-dollar-startup-club/ -[4]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:2:1300 -[5]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:3:1300 -[6]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:5:1300 -[7]:http://blog.docker.com/2014/12/docker-announces-docker-hub-enterprise/ -[8]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:6:1300 -[9]:https://coreos.com/blog/rocket/ -[10]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:7:1300 -[11]:http://stratechery.com/2014/docker-integrated-open-source-company/#fn:4:1300 \ No newline at end of file diff --git a/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md b/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md index 4718480b82..0d2b26cc98 100644 --- a/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md +++ b/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md @@ -1,5 +1,3 @@ -translating by barney-ro - 2015 will be the year Linux takes over the enterprise (and other predictions) ================================================================================ > Jack Wallen removes his rose-colored glasses and peers into the crystal ball to predict what 2015 has in store for Linux. diff --git a/sources/talk/20141224 The Curious Case of the Disappearing Distros.md b/sources/talk/20141224 The Curious Case of the Disappearing Distros.md index 5efa2f4d1f..3fe7cd788c 100644 --- a/sources/talk/20141224 The Curious Case of the Disappearing Distros.md +++ b/sources/talk/20141224 The Curious Case of the Disappearing Distros.md @@ -1,8 +1,12 @@ +theol-l translating + The Curious Case of the Disappearing Distros +关于消失的发行版的古怪情形。 ================================================================================ ![](http://www.linuxinsider.com/ai/828896/linux-distros.jpg) "Linux is a big game now, with billions of dollars of profit, and it's the best thing since sliced bread, but corporations are taking control, and slowly but systematically, community distros are being killed," said Google+ blogger Alessandro Ebersol. "Linux is slowly becoming just like BSD, where companies use and abuse it and give very little in return." +"Linux现在成为了一个大型的游戏,同时具有巨额的利润,这是有史以来最好的事情。但是公司企业进行了控制,于是缓慢而系统的社区发行版就逐渐被干掉了,",Google+的一个博主 Alessandro Ebersol说到。"Linux开始变得像BSD--一些公司使用和滥用但是没有任何回报--一样缓慢。" Well the holidays are pretty much upon us at last here in the Linux blogosphere, and there's nowhere left to hide. The next two weeks or so promise little more than a blur of forced social occasions and too-large meals, punctuated only -- for the luckier ones among us -- by occasional respite down at the Broken Windows Lounge. @@ -117,4 +121,4 @@ via: http://www.linuxinsider.com/story/The-Curious-Case-of-the-Disappearing-Dist [5]:http://ledgersmbdev.blogspot.com/ [6]:http://www.ledgersmb.org/ [7]:http://www.novell.com/linux -[8]:http://www.redhat.com/ \ No newline at end of file +[8]:http://www.redhat.com/ diff --git a/sources/talk/20150112 Linus Tells Wired Leap Second Irrelevant.md b/sources/talk/20150112 Linus Tells Wired Leap Second Irrelevant.md deleted file mode 100644 index ee1516c474..0000000000 --- a/sources/talk/20150112 Linus Tells Wired Leap Second Irrelevant.md +++ /dev/null @@ -1,29 +0,0 @@ -Linus Tells Wired Leap Second Irrelevant -================================================================================ -![](https://farm4.staticflickr.com/3852/14863156322_a354770b14_o.jpg) - -Two larger publications today featured Linux and the effect of the upcoming leap second. The Register today said that the leap second effects of the past are no longer an issue. Coincidentally, Wired talked to Linus Torvalds about the same issue today as well. - -**Linus Torvalds** spoke with Wired's Robert McMillan about the approaching leap second due to be added in June. The Register said the last leap second in 2012 took out Mozilla, StumbleUpon, Yelp, FourSquare, Reddit and LinkedIn as well as several major airlines and travel reservation services that ran Linux. Torvalds told Wired today that the kernel is patched and he doesn't expect too many issues this time around. [He said][1], "Just take the leap second as an excuse to have a small nonsensical party for your closest friends. Wear silly hats, get a banner printed, and get silly drunk. That’s exactly how relevant it should be to most people." - -**However**, The Register said not everyone agrees with Torvalds' sentiments. They quote Daily Mail saying, "The year 2015 will have an extra second — which could wreak havoc on the infrastructure powering the Internet," then remind us of the Y2K scare that ended up being a non-event. The Register's Gavin [Clarke concluded][2]: - -> No reason the Penguins were caught sans pants. - -> Now they've gone belt and braces. - -The take-away is: move along, nothing to see here. - --------------------------------------------------------------------------------- - -via: http://ostatic.com/blog/linus-tells-wired-leap-second-irrelevant - -作者:[Susan Linton][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://ostatic.com/member/susan-linton -[1]:http://www.wired.com/2015/01/torvalds_leapsecond/ -[2]:http://www.theregister.co.uk/2015/01/09/leap_second_bug_linux_hysteria/ \ No newline at end of file diff --git a/sources/talk/20150119 Linus Torvalds responds to Ars about diversity niceness in open source.md b/sources/talk/20150119 Linus Torvalds responds to Ars about diversity niceness in open source.md deleted file mode 100644 index b98e27eacf..0000000000 --- a/sources/talk/20150119 Linus Torvalds responds to Ars about diversity niceness in open source.md +++ /dev/null @@ -1,44 +0,0 @@ -Linus Torvalds responds to Ars about diversity, niceness in open source -================================================================================ -> Acknowledges diversity factors, says "we're different in so many other ways." - -![See, sometimes Linus isn't flicking people off.](http://cdn.arstechnica.net/wp-content/uploads/2013/09/linus-torvalds.jpg) -See, sometimes Linus isn't flicking people off. - -Athanasios Kasampalis - -On Thursday, Linux legend Linus Torvalds sent a lengthy statement to Ars Technica responding to [statements he made in Auckland, New Zealand earlier that day about diversity and "niceness"][2] in the open source sector. - -"What I wanted to say [at the keynote]—and clearly must have done very badly—is that one of the great things about open source is exactly the fact that different people are so different," Torvalds wrote via e-mail. "I think people sometimes look at it as being just 'programmers,' which is not true. It's about all the people who are more oriented toward commercial things, too. It's about all those people who are interested in legal issues—and the social ones, too!" - -Torvalds spoke to what he thought was a larger concept of "diversity" than what has been mentioned a lot in recent stories on the topic, including economic disparity, language, and culture (even between neighboring European countries). "There's a lot of talk about gender and sexual preferences and race, but we're different in so many other ways, too," he wrote. - -"'Open source' as a term and as a movement hasn't been about 'you have to be a believer,'" Torvalds added. "It's not a religion. It's not an 'us vs them' thing. We've been able to work with all those 'evil commercial interests' and companies who also do proprietary software. And I think that was one of the things that the Linux community (and others—don't get me wrong, it's not unique to us) did and does well." - -Torvalds also talked about progress since the GPL vs. BSD "flame wars" from the '80s and early '90s, saying that the open source movement brought more technology and less "ideology" to the sector. "Which is not to say that a lot of people aren't around because they believe it's the 'ethical' thing to do (I do myself too)," Torvalds added, "but you don't have to believe that, and you can just do it because it's the most fun, or the most efficient way to do technology development." - -### “This ‘you have to be nice’ seems very popular in the US” ### - -He then sent a second e-mail to Ars about the topic of "niceness" that came up during the keynote. He said that his return to his Auckland hotel was delayed by "like three hours" because of hallway conversations about this very topic. - -"I don't know where you happen to be based, but this 'you have to be nice' seems to be very popular in the US," Torvalds continued, calling the concept an "ideology." - -"The same way we have developers and marketing people and legal people who speak different languages, I think we can have some developers who are used to—and prefer—a more confrontational style, and still **also** have people who don't," he wrote. - -He lambasted the "brainstorming" model of having a criticism-free bubble to bounce ideas off of. "Maybe it works for some people, but I happen to simply not believe in it," he said. "I'd rather be really confrontational, and bad ideas should be [taken] down aggressively. Even good ideas need to be vigorously defended." - -"Maybe it's just because I like arguing," Torvalds added. "I'm just not a huge believer in politeness and sensitivity being preferable over bluntly letting people know your feelings. But I also understand that other people are driven away by cursing and crass language when it all gets a bit too carried away." To that point, Torvalds said that the open source movement might simply need more "people who are good at mediating," as opposed to asking developers to calm their own tone or attitude. - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/business/2015/01/linus-torvalds-responds-to-ars-about-diversity-niceness-in-open-source/ - -作者:[Sam Machkovech][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://arstechnica.com/author/samred/ -[1]:https://secure.flickr.com/photos/12693492@N04/1338136415/in/photolist-33fikv-3jXFce-3ALpLy-4m6Shj-4pADUg-4pHwcW-4rNTR7-4GMhKc-4HM2qp-4JSHKa-4PomQo-4SKxMo-58LBYf-5iVNX6-5tXbB8-5xi67A-5A8rRc-5C8fAT-5Ccxjw-5EcYvx-5UoNTc-5UoVJK-5Uti6q-5UuiX2-5UuE2B-5UyEJu-5UyHMf-5UyJ2G-5UFbXP-5UFg8Z-5UFhwV-5UKDkG-5UKDP9-5UTHGv-5XM2s2-5YFmLu-65N31L-6pSwh7-6trmfx-6H2uZP-6JVV4V-71qkot-71BBbk-72vuYo-73j9yB-79aQ2a-79bfqe-79EKPH-79EXvD-79PuG5-7a4BxF -[2]:http://arstechnica.com/business/2015/01/linus-torvalds-on-why-he-isnt-nice-i-dont-care-about-you/ \ No newline at end of file diff --git a/sources/talk/20150119 Ubuntu 15.04 Finally Lets You Set Menus ToAlways Show.md b/sources/talk/20150119 Ubuntu 15.04 Finally Lets You Set Menus ToAlways Show.md deleted file mode 100644 index 346937d2b9..0000000000 --- a/sources/talk/20150119 Ubuntu 15.04 Finally Lets You Set Menus ToAlways Show.md +++ /dev/null @@ -1,41 +0,0 @@ -Ubuntu 15.04 Finally Lets You Set Menus To ‘Always Show’ -================================================================================ -**If you hate the way that Unity’s global menus fade out of view after you mouse away, Ubuntu 15.04 has a little extra to win you around.** - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/locally-integrated-menus-in-ubuntu.png) - -The latest build of Unity for Ubuntu 15.04, currently sitting in the ‘proposed’ channel, offers an option to **make app menus visible in Ubuntu**. - -No fading, no timeout, no missing menus. - -The drawback for now is that it can currently only be enabled through a dconf switch and not a regular user-facing option. - -I’d hope (if not expect) that an option to set the feature is added to the Ubuntu System Settings > Appearance section as development continues. - -Right now, if you’re on Ubuntu 15.04 and have the “Proposed” update channel enabled, you should find this switch waiting in **com > canonical > unity >** ‘always show menus’. - -### Better Late Than Never? ### - -Developers plan to backport the option to Ubuntu 14.04 LTS in the next SRU (assuming nothing unexpected crops up during testing). - -Locally Integrated Menus (LIM) debuted in Ubuntu 14.04 LTS to much appreciation, being widely seen as the best compromise between those who liked the simplicity of the “hidden” approach and those who disliked the mouse and trackpad aerobics using it required. - -While locally integrated menus brought us half way to silencing the criticisms levelled at this aspect of Unity, the default “fade in/fade out” behaviour left an itch unscratched. - -The past few releases of Ubuntu has seen proactive addressing of concerns and issues experienced by its earlier UX decisions. After several years on the ‘to do’ list [we finally got Locally Integrated Menus last year][1], as well as an unsupported [option to minimise and restore apps to the Unity Launcher][2] by clicking on their icon. - -A year on from that we finally get an option to make application menus always show, no matter where our mouse is. Better late than never, right? - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/01/ubuntu-15-04-always-show-menu-bar-option - -作者:[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/02/locally-integrated-menus-ubuntu-14-04 -[2]:http://www.omgubuntu.co.uk/2014/03/minimize-click-launcher-option-ubuntu-14-04 \ No newline at end of file diff --git a/sources/talk/20150122 Top 10 FOSS legal developments of 2014.md b/sources/talk/20150122 Top 10 FOSS legal developments of 2014.md deleted file mode 100644 index a97e4910c6..0000000000 --- a/sources/talk/20150122 Top 10 FOSS legal developments of 2014.md +++ /dev/null @@ -1,72 +0,0 @@ -Top 10 FOSS legal developments of 2014 -================================================================================ -![](http://opensource.com/sites/default/files/styles/image-full-size/public/images/law/LAW_PatentSpotlight_520x292_cm.png.png?itok=N-O9b4FW) - -Image by : opensource.com - -The year 2014 continued the trend of the increasing importance of legal issues for the FOSS community. Continuing [the tradition of looking back][1] over the top ten legal developments in FOSS, my selection of the top ten issues for 2014 is as follows: - -### 1. Courts interpret General Public License version 2 (GPLv2) ### - -The GPLv2 continues to be the most widely used and most important license for free and open source software. Black Duck Software estimates that 16 billion lines of code are licensed under the GPLv2. Despite its importance, the GPLv2 has been the subject of very few court decisions, and virtually all of the most important terms of the GPLv2 have not been interpreted by courts. This lack of court decisions is about to change due to the five interrelated cases arising from an attempt by Versata Software, Inc. (Versata) to terminate its software license to Ameriprise Financial, Inc. Versata’s product included software licensed by Ximpleware, Inc. (Ximpleware) under the GPLv2, but Versata had not complied with the terms of the GPLv2. Ximpleware sued Versata and eight of its customers for both copyright and patent infringement. (For a more detailed description of the facts [read this article][2].) This dispute is important because Ximpleware is the first commercial enforcer of the GPLv2 in which the courts are likely to issue decisions and Ximpleware is seeking monetary damages rather than compliance. - -### 2. GPL guides ### - -Two of the most important organizations enforcing the GPL family of licenses recently provided [guidance on compliance][3]: On October 31, the Software Freedom Law Center published the second version of their Practical Guide to GPL Compliance. Several days later, the Software Conservancy and the Free Software Foundation published the first version of their guide, the Copyleft, and the GNU General Public License: [A Comprehensive Tutorial and Guide][4]. These guides are required reading for anyone managing FOSS. - -### 3. EU Commission (EC) to revise FOSS policy ### - -Governments are one of the most important users of software but have had a mixed record in using and contributing to FOSS (free and open source software). The EC recently announced that it intends to remove the barriers that may hinder code contributions to FOSS projects. In particular, the EC wants to clarify legal aspects, including intellectual property rights, copyright, and which author or authors to name when submitting code to the upstream repositories. Pierre Damas, Head of Sector at the Directorate General for IT, [hopes that such clarification][5] will motivate many of the EC’s software developers and functionaries to promote the use of FOSS at the EC. - -### 4. Validation of FOSS business model by Hortonworks IPO ### - -Hortonworks provides services and support for the Hadoop data analysis software managed by the Apache Software Foundation. Hortonworks is one of three venture backed companies based on the Hadoop software. Hortonworks went public this fall and immediately rose 65% in share price, valuing the company at over $1 billion. The market for Hadoop products, software, and services is projected to reach $50.2 billion in 2020, up from $1.5 billion in 2012. - -### 5. Core Infrastructure Initiative ### - -The Linux Foundation put together [a consortium of companies][6] to support the many smaller open source projects that are critical to software ecosystem, such as OpenSSL. This effort was a response to the Heartbleed problem with OpenSSL in 2013, which I described in last year’s summary. This consortium is a great example of the ability of the FOSS community to come together to solve community problems. - -### 6. Linux SCO case terminated again ### - -The lawsuit by Santa Cruz Operations, Inc. (SCO) against IBM claiming that Linux includes Unix code was once a potentially major challenge to FOSS. Despite losing its suit against Novell, the bankruptcy court allowed SCO to continue its suit against IBM. I thought this case [had been concluded in 2008][7], but Judge Nuffer appears to have put the case to rest on December 15, 2014. He dismissed the case against IBM based on the decisions in the Novell case (although SCO could still appeal once again): - -*It is further ORDERED that, with respect to all remaining claims and counterclaims, SCO is bound by, and may not here re-litigate, the rulings in the Novell Judgment that Novell (not SCO) owns the copyrights to the pre-1996 UNIX source code, and that Novell waived SCO’s contract claims against IBM for alleged breaches of the licensing agreements pursuant to which IBM licensed such source code.* - -### 7. FOSS trademark issues ### - -The use of trademarks in FOSS projects continues to raise issues. This year brought the settlement of the dispute over the “Python” mark between the Python Software Foundation and Veber, a small hosting company in the UK. Veber had decided to use "Python" in branding certain of its products and services. In addition, the OpenStack Foundation is working through the application of trademarks to the OpenStack project through its [DefCore committee][8]. - -### 8. Use of FOSS by commercial companies expands ### - -We have discussed in the past how many large companies are using FOSS as an explicit strategy to build their software. Jim Zemlin, Executive Director of the Linux Foundation, has described this strategic use of FOSS as external “research and development.” His conclusions are supported by Gartner who noted that “the top tech companies are still spending tens of billions of dollars on software research and development, the smart ones are leveraging open source for 80 percent of the code and spending their money on the remaining 20 percent, which represents their program’s ‘special sauce.’” The scope of this trend was emphasized by Microsoft’s announcement that it was “open sourcing” the .NET software framework (this software is used by millions of developers to build and operate websites and other large online applications). - -### 9. Rockstar Consortium threat evaporates ### - -The Rockstar Consortium was formed by Microsoft, Blackberry, Ericsson, Sony, and Apple to exploit the 6,000 patents from Nortel Networks. The Rockstar Consortium sued Google for infringement of the Android operating system. This litigation was aimed at fundamental functions of the Android operating system and could have had a significant effect on the Android ecosystem. The Rockstar Consortium settled its litigation with Google this year, but then sold 4,000 of its patents to RPX, the patent defense firm (financed by a number of companies as well as RPX). The remaining patents were distributed to the members of the Rockstar Consortium. - -### 10. Android litigation ### - -The litigation surrounding Android continued this year, with significant developments in the patent litigation between Apple Computer, Inc. (Apple) and Samsung Electronics, Inc. (Samsung) and the copyright litigation over the Java APIs between Oracle Corporation (Oracle) and Google, Inc. (Google). Apple and Samsung have agreed to end patent disputes in nine countries, but they will continue the litigation in the US. As I stated last year, the Rockstar Consortium was a wild card in this dispute. However, the Rockstar Consortium settled its litigation with Google this year and sold off its patents, so it will no longer be a risk to the Android ecosystem. - -The copyright litigation regarding the copyrightability of the Java APIs was brought back to life by the Court of Appeals for the Federal Circuit (CAFC) decision which overturned [the District Court decision][9]. The District Court had found that Google was not liable for copyright infringement for its admitted copying of the Java APIs: the court found that the Java APIs were either not copyrightable or their use by Google was protected by various defenses to copyright. The CAFC overturned both the decision and the analysis and remanded the case to the District Court for a review of the fair use defense raised by Google. Subsequently, Google filed an appeal to the Supreme Court. The impact of a finding that Google was liable for copyright infringement in this case would have a dramatic effect on Android and, depending on the reasoning, would have a ripple effect across the interpretation of the scope of the “copyleft” terms of the GPL family of licenses which use APIs. - --------------------------------------------------------------------------------- - -via: http://opensource.com/law/15/1/top-foss-legal-developments-2014 - -作者:[Mark Radcliffe][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://opensource.com/users/mradcliffe -[1]:http://lawandlifesiliconvalley.com/blog/?p=853 -[2]:http://opensource.com/law/14/12/gplv2-court-decisions-versata -[3]:http://www.softwarefreedom.org/resources/ -[4]:http://www.copyleft.org/guide/ -[5]:https://joinup.ec.europa.eu/community/osor/news/european-commission-update-its-open-source-policy -[6]:http://www.linuxfoundation.org/programs/core-infrastructure-initiative -[7]:http://lawandlifesiliconvalley.com/blog/?m=200812 -[8]:https://wiki.openstack.org/wiki/Governance/CoreDefinition -[9]:http://law.justia.com/cases/federal/appellate-courts/cafc/13-1021/13-1021-2014-05-09.html \ No newline at end of file diff --git a/sources/talk/20150122 Top 10 open source projects of 2014.md b/sources/talk/20150122 Top 10 open source projects of 2014.md deleted file mode 100644 index edc81938d6..0000000000 --- a/sources/talk/20150122 Top 10 open source projects of 2014.md +++ /dev/null @@ -1,126 +0,0 @@ -Top 10 open source projects of 2014 -================================================================================ -![](http://opensource.com/sites/default/files/styles/image-full-size/public/images/life/top10_projects_lead.jpg?itok=tMZo2sYi) - -Image credits : [CC0 Public Domain][1], modifications by Jen Wike Huger - -Every year we collect the best of the best open source projects covered on Opensource.com. [Last year's list of 10 projects][2] guided people working and interested in tech throughout 2014. Now, we're setting you up for 2015 with a brand new list of accomplished open source projects. - -Some faces are new. Some have been around and just keep rocking it. Let's dive in! - -## Top 10 open source projects in 2014 ## - -### Docker ### - -[application container platform][3] - -"In the same way that power management and virtualisation has allowed us to get maximum engineering benefit from our server utilisation, the problem of how to really solve first world problems in virtualisation has remained prevalent. Docker's open sourcing in 2013 can really align itself with these pivotal moments in the evolution of open source—providing the extensible building blocks allowing us as engineers and architects to extend distributed platforms like never before." —Richard Morrell, [Senior software engineer Petazzoni on the breathtaking growth of Docker][4]. - -**Interview**: VP of Services for Docker talks to Jodi Biddle in [Why is Docker the new craze in virtualization and cloud computing?][5] "I think it's the lightweight nature of Docker combined with the workflow. It's fast, easy to use and a developer-centric DevOps-ish tool. Its mission is basically: make it easy to package and ship code." —James Turnbull. - -### Kubernetes ### - -[orchestration system for containers][6] - -"One of the projects you're starting to hear a lot about in the orchestration space is [Kubernetes][7], which came out of Google's internal container work. It aims to provide features such as high availability and replication, service discovery, and service aggregation." —Gordon Haff, [Open source accelerating the pace of software][8]. - -### Taiga ### - -[project management platform][9] - -"It’s almost always the case that the project management tool doesn’t reflect the actual project scenario. One solution to this is using a tool that is intuitive and fits alongside the developer's normal workflow. Additionally, a tool that is quick to update and attracts users to use it. [Taiga][10] is an open source project management tool that aims to solve the basic problem of software usability." —Nitish Tiwari, [Taiga, a new open source project management tool with focus on usability][11]. - -### Apache Mesos ### - -[cluster manager][12] - -"[Apache Mesos][13] is a cluster manager that provides efficient resource isolation and sharing across distributed applications or frameworks. It sits between the application layer and the operating system and makes it easier to deploy and manage applications in large-scale clustered environments more efficiently. It can run many applications on a dynamically shared pool of nodes. Prominent users of Mesos include Twitter, Airbnb, MediaCrossing, Xogito and Categorize. —Sachin P Bappalige, [Open source datacenter computing with Apache Mesos][14]. - -Interview: Head of Open Source at Twitter talks to Jason Hibbets in [Scale like Twitter with Apache Mesos][15]. "As of today, Twitter has over 270 million active users which produces 500+ million tweets a day, up to 150k+ tweets per second, and more than 100TB+ of compressed data per day. Architecturally, Twitter is mostly composed of services, mostly written in the open source project [Finagle][16], representing the core nouns of the platform such as the user service, timeline service, and so on. Mesos allows theses services to scale to tens of thousands of bare-metal machines and leverage a shared pool of servers across data centers." —Chris Aniszczyk - -### OpenStack ### - -[cloud computing platform][17] - -"As OpenStack continues to mature and slowly make its way into production environments, the focus on the user is continuing to grow. And so, to better meet the needs of users, the community is working hard to get users to meet the next step of engagement by highlighting those users who are change agents both in their organization and within the OpenStack community at large: the superusers." —Jason Baker, [What is an OpenStack superuser][18]? - -**Interview**: Infrastructure manager at CERN talks to Jason Hibbets in [How OpenStack powers the research at CERN][19]. "At CERN, the European Organization for Nuclear Research physicists and engineers are probing the fundamental structure of the universe. In order to do this, we use some of the world's largest and most complex scientific instruments such as the Large Hadron Collider, a 27 KM ring 100m underground on the border between France and Switzerland. OpenStack provides the infrastructure cloud which is used to provide much of the compute resources for this processing." —Tim Bell. - -### Ansible ### - -[IT automation tool][20] - -"A lot of what I want to do is enable people to not only have more free time for beer, but to have more free time for their own projects, their own ideas, and to do new an interesting things." —[Michael DeHaan, Making your IT infrastructure boring with Ansible][21]. - -**Interview**: CTO of Ansible talks to Jen Krieger in [Behind the scenes with CTO Michael DeHaan of Ansible][22]. "I like to quote Star Trek 2 a lot. We definitely optimize for 'the needs of the many'. I know Spock dies after he says that, but he does get to come back." —Michael DeHaan - -### ownCloud ### - -[cloud storage tool][23] - -"I was looking for an easy way how to have all my online storage services, such as Google Drive and Dropbox, integrated with my Linux desktop without using some nasty hack, and I finally have a solution that works. I'm here to share it with you. This is not rocket science really, all I did was a little bit of documentation reading, and a couple of clicks." —Jiri Folta, [Using ownCloud to integrate Dropbox, Google Drive, and more in Gnome][24]. - -**Listed**: Top 5 open source alternatives: "ownCloud does most everything that the proprietary names do and it keeps control of your information in your hands." —Scott Nesbitt, [Five open source alternatives to popular web apps][25]. - -### Apache Hadoop ### - -[framework for big data][26] - -"Apache Hadoop is an open source software framework for storage and large scale processing of data-sets on clusters of commodity hardware. Hadoop is an Apache top-level project being built and used by a global community of contributors and users. It is licensed under the Apache License 2.0." —Sachin P Bappalige, [An introduction to Apache Hadoop for big data][27]. - -### Drupal ### - -[content management system (CMS)][28] - -"When it was released in 2011, Drupal 7 was the most accessible open source content management system (CMS) available. I expect that this will be true until the release of Drupal 8. Web accessibility requires constant vigilance and will be something that will always need attention in any piece of software striving to meet the Web Content Accessibility Guidelines (WCAG) 2.0 guidelines." —Mike Gifford, [Drupal 8's accessibility advantage][29]. - -### OpenDaylight ### - -[foundation for software defined networking][30] - -"We are seeing more and more that the networking functions traditionally done in the datacenter by dedicated, almost exclusively proprietary hardware and software combinations, are now being defined through software. Leading that charge within the open source community has been the [OpenDaylight Project][31], a collaborative project through the [Linux Foundation][32] working to define the needs which software defined networking may fill and coordinating the efforts of individuals and companies worldwide to create an open source solution to software defined networking (SDN)." —Jason Baker, [Define your network in software with OpenDaylight][33]. - --------------------------------------------------------------------------------- - -via: http://opensource.com/business/14/12/top-10-open-source-projects-2014 - -作者:[Jen Wike Huger][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://opensource.com/users/jen-wike -[1]:http://pixabay.com/en/lightbulb-lamp-light-hotspot-336193/ -[2]:http://opensource.com/life/13/12/top-open-source-projects-2013 -[3]:https://www.docker.com/ -[4]:http://opensource.com/business/14/7/interview-jerome-petazzoni-docker -[5]:https://opensource.com/business/14/7/why-docker-new-craze-virtualization-and-cloud-computing -[6]:http://kubernetes.io/ -[7]:https://cloud.google.com/compute/docs/containers -[8]:http://opensource.com/business/14/11/open-source-accelerating-pace-software -[9]:https://taiga.io/ -[10]:https://github.com/taigaio -[11]:https://opensource.com/business/14/10/taiga-open-source-project-management-tool -[12]:http://mesos.apache.org/ -[13]:http://mesos.apache.org/ -[14]:https://opensource.com/business/14/9/open-source-datacenter-computing-apache-mesos -[15]:https://opensource.com/business/14/8/interview-chris-aniszczyk-twitter-apache-mesos -[16]:https://twitter.github.io/finagle/ -[17]:http://www.openstack.org/ -[18]:https://opensource.com/business/14/5/what-is-openstack-superuser -[19]:https://opensource.com/business/14/10/interview-tim-bell-cern-it-operating-systems -[20]:http://www.ansible.com/home -[21]:https://opensource.com/business/14/12/ansible-it-infrastructure -[22]:https://opensource.com/business/14/10/interview-michael-dehaan-ansible -[23]:http://owncloud.org/ -[24]:https://opensource.com/life/14/12/using-owncloud-integrate-dropbox-google-drive-gnome -[25]:https://opensource.com/life/14/10/five-open-source-alternatives-popular-web-apps -[26]:http://hadoop.apache.org/ -[27]:http://opensource.com/life/14/8/intro-apache-hadoop-big-data -[28]:https://www.drupal.org/ -[29]:http://opensource.com/business/14/5/new-release-drupal-8-accessibility-advantage -[30]:http://www.opendaylight.org/ -[31]:http://www.opendaylight.org/ -[32]:http://www.linuxfoundation.org/ -[33]:http://opensource.com/business/14/5/defining-your-network-software-opendaylight diff --git a/sources/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md b/sources/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md deleted file mode 100644 index b2e6372a0b..0000000000 --- a/sources/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md +++ /dev/null @@ -1,44 +0,0 @@ -translating by KayGuoWhu -Why does C++ promote an int to a float when a float cannot represent all int values? ---------- - -#Q: - -Say I have the following: - -```C -int i = 23; -float f = 3.14; -if (i == f) // do something -``` - -The i will be promoted to a float and the two float numbers will be compared, but can a float represent all int values? Why not promote both the int and the float to a double? - -#A: - -When `int` is promoted to `unsigned` in the integral promotions, negative values are also lost (which leads to such fun as `0u < -1` being true). - -Like most mechanisms in C (that are inherited in C++), the usual arithmetic conversions should be understood in terms of hardware operations. The makers of C were very familiar with the assembly language of the machines with which they worked, and they wrote C to make immediate sense to themselves and people like themselves when writing things that would until then have been written in assembly (such as the UNIX kernel). - -Now, processors, as a rule, do not have mixed-type instructions (add float to double, compare int to float, etc.) because it would be a huge waste of real estate on the wafer -- you'd have to implement as many times more opcodes as you want to support different types. That you only have instructions for "add int to int," "compare float to float", "multiply unsigned with unsigned" etc. makes the usual arithmetic conversions necessary in the first place -- they are a mapping of two types to the instruction family that makes most sense to use with them. - -From the point of view of someone who's used to writing low-level machine code, if you have mixed types, the assembler instructions you're most likely to consider in the general case are those that require the least conversions. This is particularly the case with floating points, where conversions are runtime-expensive, and particularly back in the early 1970s, when C was developed, computers were slow, and when floating point calculations were done in software. This shows in the usual arithmetic conversions -- only one operand is ever converted (with the single exception of `long/unsigned int`, where the `long` may be converted to `unsigned long`, which does not require anything to be done on most machines. Perhaps not on any where the exception applies). - -So, the usual arithmetic conversions are written to do what an assembly coder would do most of the time: you have two types that don't fit, convert one to the other so that it does. This is what you'd do in assembler code unless you had a specific reason to do otherwise, and to people who are used to writing assembler code and do have a specific reason to force a different conversion, explicitly requesting that conversion is natural. After all, you can simply write - -```C -if((double) i < (double) f) -``` - -It is interesting to note in this context, by the way, that `unsigned` is higher in the hierarchy than `int`, so that comparing `int` with `unsigned` will end in an unsigned comparison (hence the `0u < -1` bit from the beginning). I suspect this to be an indicator that people in olden times considered `unsigned` less as a restriction on `int` than as an extension of its value range: We don't need the sign right now, so let's use the extra bit for a larger value range. You'd use it if you had reason to expect that an `int` would overflow -- a much bigger worry in a world of 16-bit ints. - ----- -via:[stackoverflow](http://stackoverflow.com/questions/28010565/why-does-c-promote-an-int-to-a-float-when-a-float-cannot-represent-all-int-val/28011249#28011249) - -作者:[wintermute][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://stackoverflow.com/users/4301306/wintermute \ No newline at end of file diff --git a/sources/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md b/sources/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md deleted file mode 100644 index 83f5f11293..0000000000 --- a/sources/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md +++ /dev/null @@ -1,82 +0,0 @@ -9 Best IDEs and Code Editors for JavaScript Users -================================================================================ -Web designing and developing is one of the trending sectors in the recent times, where more and more peoples started to search for their career opportunities. But, Getting the right opportunity as a web developer or graphic designer is not just a piece of cake for everyone, It certainly requires a strong mind presence as well as right skills to find the find the right job. There are a lot of websites available today which can help you to get the right job description according to your knowledge. But still if you want to achieve something in this sector you must have some excellent skills like working with different platforms, IDEs and various other tools too. - -Talking about the different platforms and IDEs used for various languages for different purposes, gone is the time when we learn just one IDE and get the optimum solutions for our web design projects easily. Today we are living in the modern lifestyle where competition is getting more and more tough on every single day. Same is the case with the IDEs, IDE is basically a powerful client application for creating and deploying applications. Today we are going to share some best javascript IDE for web designers and developers. - -Please visit this list of best code editors for javascript user and share your thought with us. - -### 1) [Spket][1] ### - -**Spket IDE** is powerful toolkit for JavaScript and XML development. The powerful editor for JavaScript, XUL/XBL and Yahoo! Widget development. The JavaScript editor provides features like code completion, syntax highlighting and content outline that helps developers productively create efficient JavaScript code. - -![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/spket-e1422674329554.png) - -### 2) [Ixedit][2] ### - -IxEdit is a JavaScript-based interaction design tool for the web. With IxEdit, designers can practice DOM-scripting without coding to change, add, move, or transform elements dynamically on your web pages. - -![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ixedit.png) - -### 3) [Komodo Edit][3] ### - -Komode is free and powerful code editor for Javascript and other programming languages. - -![](http://i2.wp.com/devzum.com/wp-content/uploads/2015/01/komodo-edit-e1422674596277.png) - -### 4) [EpicEditor][4] ### - -EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it. - -![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/epiceditor-e1422674732281.png) - -### 5) [codepress][5] ### - -CodePress is web-based source code editor with syntax highlighting written in JavaScript that colors text in real time while it’s being typed in the browser. - -![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/codepres-e1422674893706.png) - -### 6) [ACe][6] ### - -Ace is an embeddable code editor written in JavaScript. It matches the features and performance of native editors such as Sublime, Vim and TextMate. It can be easily embedded in any web page and JavaScript application. - -![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ace-e1422675089912.png) - -### 7) [scripted][7] ### - -Scripted is a fast and lightweight code editor with an initial focus on JavaScript editing. Scripted is a browser based editor and the editor itself is served from a locally running Node.js server instance. - -![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/scripted-e1422675188408.png) - -### 8) [Netbeans][8] ### - -This is another more impressive and useful code editors for javascript and other programming languages. - -![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/code_editing1-e1422675506226.png) - -### 9) [Webstorm][9] ### - -This is the smartest ID for javascript. WebStorm is a lightweight yet powerful IDE, perfectly equipped for complex client-side development and server-side development with Node.js. - -![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/webstorm.png) - --------------------------------------------------------------------------------- - -via: http://devzum.com/2015/01/31/9-best-ides-and-code-editors-for-javascript-users/ - -作者:[vikas][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://devzum.com/author/vikas/ -[1]:http://spket.com/ -[2]:http://www.ixedit.com/ -[3]:http://komodoide.com/komodo-edit/ -[4]:http://oscargodson.github.io/EpicEditor/ -[5]:http://codepress.sourceforge.net/ -[6]:http://ace.c9.io/#nav=about -[7]:https://github.com/scripted-editor/scripted -[8]:https://netbeans.org/ -[9]:http://www.jetbrains.com/webstorm/ \ No newline at end of file diff --git a/sources/talk/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md b/sources/talk/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md deleted file mode 100644 index c591faafcd..0000000000 --- a/sources/talk/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md +++ /dev/null @@ -1,32 +0,0 @@ -LinuxQuestions Survey Results Surface Top Open Source Projects -================================================================================ -![](http://farm5.static.flickr.com/4099/4777335328_3cc363c419_m.jpg) - -Many people in the Linux community look forward to the always highly detailed and reliable results of the annual surveys from LinuxQuestions.org. As [Susan covered in detail in this post][1], this year's [results][2], focused on what readers at the site deem to be the best open source projects, are now available. Most of the people at LinuxQuestions are expert-level users who are on the site to answer questions from newer Linux users. - -In addition to the summary results that Susan provided in her post, below you'll find a graphical snapshot of what the experts took note of on the open source front. - -You can get a very nice graphical summary of the findings from the LinuxQuestions survey [here][3]. Here is a snapshot of the site's determination of the best Linux distributions, where Mint and Slackware fare quite well: - -![](http://i1311.photobucket.com/albums/s669/webworkerdaily/lin_zps9ogvyrty.png) - -And below is a snapshot of the site's determination of the best cloud projects. Notably, the LinuxQuestions crowd gives very high praise to ownCloud. Definiitely check into the full results of the survey at the site, see [Susan's summary][4] of winners, and check out all the good graphics [here][5]. - -![](http://i1311.photobucket.com/albums/s669/webworkerdaily/lin2_zps9nxf7yyi.png) - --------------------------------------------------------------------------------- - -via: http://ostatic.com/blog/linuxquestions-survey-results-surface-top-open-source-projects - -作者:[Sam Dean][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://ostatic.com/member/samdean -[1]:http://ostatic.com/blog/lq-members-choice-award-winners-announced -[2]:http://www.linuxquestions.org/questions/linux-news-59/2014-linuxquestions-org-members-choice-award-winners-4175532948/ -[3]:http://www.linuxquestions.org/questions/2014mca.php -[4]:http://ostatic.com/blog/lq-members-choice-award-winners-announced -[5]:http://www.linuxquestions.org/questions/2014mca.php \ No newline at end of file diff --git a/sources/talk/20150215 A Look At What Linux Games We Will See In 2015 And Beyond.md b/sources/talk/20150215 A Look At What Linux Games We Will See In 2015 And Beyond.md new file mode 100644 index 0000000000..9f11f47573 --- /dev/null +++ b/sources/talk/20150215 A Look At What Linux Games We Will See In 2015 And Beyond.md @@ -0,0 +1,136 @@ +A Look At What Linux Games We Will See In 2015 And Beyond +================================================================================ +Linux Gaming is dead they said, Linux Gaming is pointless they said...ah whatever. Here’s a look at what’s to come for us in 2015 and beyond. + +It's pretty hard to keep up with everything that's going on for us, but here's a quick look at what we could see soon. + +### Confirmed Games ### + +#### Adventure Games #### + +- [Firewatch][1] +- [Paradise Lost: First Contact][2] +- [SteamWorld Heist][3] + +#### Action Games #### + +- [Darksiders][4] +- [Darksiders II][5] +- [Ray's The Dead][6] +- [Skullgirls][7] + +#### FPS Games #### + +- [Bioshock Infinite][8] +- Half Life 3 /troll +- [Homefront: The Revolution][9] +- [Killing Floor 2][10] +- Serious Sam 4 (No official site for it yet) +- [Storm United][11] +- [SUPERHOT][12] + +#### Platformers #### + +- [Broforce][13] +- [Chasm][14] +- [Giana Sisters][15] +- [Heart Forth, Alicia][16] +- [Hot Tin Roof][17] +- [Infinifactory][18] +- [Mighty No. 9][19] +- [Night in the Woods][20] +- [Noct][21] +- [Oddworld: New 'N' Tasty][22] +- [Red Goddess][23] + +#### RPG Games #### + +- [Divinity: Original Sin][24] +- [Pillars Of Eternity][25] +- [Shadowrun: Hong Kong][26] +- [The Banner Saga][27] + +#### Strategy Games #### + +- [Age of Wonders III][28] +- [Banished][29] +- [Cities: Skylines][30] +- [Clockwork Empires][31] +- [Parkitect][32] +- [Scrolls][33] +- [Space Pirates And Zombies 2][34] + +#### Sandbox Games #### + +- [Terraria][35] +- [X Rebirth][36] + +#### Unconfirmed, but highly likely #### + +- [Company of Heroes 2][37] +- [Outlast][38] +- [Shadow Warrior][39] +- [Torchlight II][40] + +Then there’s the [two ports teased from Feral Interactive][41], we can’t let them be left out just because we don’t know what they are. + +We imagine Aspyr Media are also working on new bigger ports, but they have only just released their latest game, so it may be a few months until we see anything. + +**This isn't a complete list** of course, as we can easily forget with the sheer amount of games heading our way, and wow what a list! + +We have GDC next month, and we are expecting a few announcements too. While we don't have anything solid, with Valve's big presence with Steam Machines we are expecting at least some more Linux games, otherwise it we fear it may be a little lacklustre for Valve to only show off older existing games for Linux. + +What did we miss that you’re excited about for Linux? + +-------------------------------------------------------------------------------- + +via: http://www.gamingonlinux.com/articles/a-look-at-what-linux-games-we-will-see-in-2015-and-beyond.4963 + +作者:[liamdawe][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.gamingonlinux.com/profiles/1 +[1]:https://www.gamingonlinux.com/articles/category/17/articles/firewatch-a-first-person-mystery-game-finally-reveals-itself-in-a-trailer.4231 +[2]:http://www.asthreeworks.com/games/ +[3]:https://www.gamingonlinux.com/articles/category/17/articles/image-form-announces-steamworld-heist.4304 +[4]:https://www.gamingonlinux.com/articles/darksiders-linux-port-looks-like-it-is-still-happening.4893 +[5]:https://www.gamingonlinux.com/articles/darksiders-2-confirmed-for-linux.4154 +[6]:http://ragtagstudio.com/?page_id=457 +[7]:https://www.gamingonlinux.com/articles/editorial-skullgirls-on-linux-finally-shows-some-progress.4789 +[8]:https://www.gamingonlinux.com/articles/bioshock-infinite-looks-set-for-a-linux-release-confirmed.4668 +[9]:http://www.homefront-game.com/ +[10]:https://www.gamingonlinux.com/articles/category/17/articles/killing-floor-2-fps-has-a-new-trailer.4676 +[11]:https://www.gamingonlinux.com/articles/storm-united-online-fps-shows-first-real-gameplay-video-first-alpha-due-soon.4872 +[12]:http://superhotgame.com/ +[13]:http://steamcommunity.com/app/274190/discussions/0/540738051503306548/#c540738051518330743 +[14]:https://www.gamingonlinux.com/articles/category/17/articles/chasm-rpg-platformer-will-have-a-same-day-linux-release.4266 +[15]:https://www.gamingonlinux.com/articles/linux-port-of-platformer-giana-sisters-brought-inhouse-sequel-might-get-sameday-release.4913 +[16]:http://www.alonsomartin.mx/hfa/ +[17]:http://www.hottinroofgame.com/ +[18]:https://twitter.com/zachtronics/status/566016742825005057 +[19]:http://www.mightyno9.com/ +[20]:http://www.nightinthewoods.com/ +[21]:https://www.gamingonlinux.com/articles/category/17/articles/noct-a-fantastic-top-down-thermal-image-survival-horror-game.4783 +[22]:https://www.gamingonlinux.com/articles/puzzle-platformer-oddworld-new-n-tasty-will-release-for-linux-next-month.4836 +[23]:https://www.gamingonlinux.com/articles/new-trailer-for-platformer-red-goddesss-looks-really-good.4939 +[24]:https://www.gamingonlinux.com/articles/divinity-original-sin-is-pushing-ahead-for-the-linux-release.4938 +[25]:https://www.gamingonlinux.com/articles/pillars-of-eternity-the-rpg-aims-for-a-sameday-linux-release-on-march-26th.4834 +[26]:https://www.kickstarter.com/projects/webeharebrained/shadowrun-hong-kong +[27]:https://www.gamingonlinux.com/articles/the-banner-saga-rpg-looks-close-to-a-linux-version.4862 +[28]:https://www.gamingonlinux.com/articles/the-linux-port-of-age-of-wonders-iii-is-progressing-a-bit-too-explosive-right-now.4857 +[29]:https://www.gamingonlinux.com/articles/banished-survival-city-building-sim-is-being-ported-to-linux.4813 +[30]:https://www.gamingonlinux.com/articles/city-builder-game-cities-skylines-now-has-a-release-date.4954 +[31]:https://www.gamingonlinux.com/articles/clockwork-empires-still-pushing-towards-a-linux-version-suffering-delays.4734 +[32]:https://www.gamingonlinux.com/articles/category/17/articles/parkitect-what-roller-coaster-tycoon-should-have-grown-into.4528 +[33]:https://www.gamingonlinux.com/articles/mojangs-scrolls-now-has-an-experimental-linux-build.4450 +[34]:https://www.gamingonlinux.com/articles/space-pirates-and-zombies-2-reveals-the-zombies-in-a-brand-new-video.4759 +[35]:https://www.gamingonlinux.com/articles/terraria-officially-confirmed-to-be-in-development-for-linux-finally.4299 +[36]:https://www.gamingonlinux.com/articles/egosofts-x-rebirth-actively-being-ported-to-linux.4822 +[37]:https://www.gamingonlinux.com/articles/company-of-heroes-2-looks-like-it-is-heading-to-linux.4199 +[38]:https://www.gamingonlinux.com/articles/outlast-that-really-scary-game-looks-like-its-still-heading-to-linux.4896 +[39]:https://www.gamingonlinux.com/articles/shadow-warrior-looks-like-it-will-come-to-linux.4859 +[40]:https://www.gamingonlinux.com/articles/torchlight-ii-has-even-more-positive-signs-for-linux.4817 +[41]:http://www.gamingonlinux.com/articles/feralinteractive.com/en/upcoming/ \ No newline at end of file diff --git a/sources/talk/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md b/sources/talk/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md new file mode 100644 index 0000000000..6d7e64f616 --- /dev/null +++ b/sources/talk/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md @@ -0,0 +1,31 @@ +Torvalds: 'People who start writing kernel code get hired really quickly' +================================================================================ +Now more than ever, the development of the Linux kernel is a matter for the professionals, as unpaid volunteer contributions to the project reached their lowest recorded levels in the latest "Who Writes Linux" report, which was released today. + +According to the report, which is compiled by the Linux Foundation, just 11.8 percent of kernel development last year was done by unpaid volunteers -- a 19 percent downturn from the 2012 figure of 14.6 percent. The foundation says that the downward trend in volunteer contributions has been present for years. + +![](http://images.techhive.com/images/article/2015/02/screen-shot-2015-02-17-at-5.25.43-pm-100568680-medium.idge.png) + +Even so, unpaid contributors were still the single biggest source of commits in the latest Who Writes Linux, at 11,968 total changes -- good for 12.4 percent of the whole. However, corporate contributors collectively account for much, much more. The Linux Foundation said that more than 80 percent of all work on the kernel is done by paid professional developers. + +According to Linus Torvalds, the shift towards paid developers hasn't changed much about kernel development on its own. + +"I think one reason it hasn't changed things all that much is that it's not so much 'unpaid volunteers are going away' as 'people who start writing kernel code get hired really quickly,'" he told Network World. + +Torvalds said that, while Linux development has changed for plenty of other reasons -- and that, naturally, new contributors pop up all the time -- many of the original developers, with decades of experience, have simply been snapped up by companies with an interest in Linux. + +"We may have started as volunteers, but we're happily employed doing Linux these days," he said. + +Torvalds' own role in development has become increasingly hands-off, according to the report -- he has personally signed off on 329 patches since version 3.10 of kernel was released, or 0.4 percent. Increasingly, subsystem maintainers do their own reviews and merges of code. + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2885339/application-development/torvalds-people-who-start-writing-kernel-code-get-hired-really-quickly.html + +作者:[Jon Gold][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Jon-Gold/ \ No newline at end of file diff --git a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md new file mode 100644 index 0000000000..6333fea9a7 --- /dev/null +++ b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md @@ -0,0 +1,58 @@ +​No reboot patching comes to Linux 4.0 +================================================================================ +> **Summary**:With the new Linux 4.0 kernel, you'll need to reboot Linux less often than ever. + +With [Linux 4.0][1], you may never need to reboot your operating system again. + +![Using Linux means never having to reboot. -- SUSE ](http://zdnet4.cbsistatic.com/hub/i/r/2015/03/02/5e766833-454b-45b5-a8f7-a55d21e9d26a/resize/270x270/4d0774552c342a1507784ef802619b71/livepatching.jpg) +Using Linux means never having to reboot. -- SUSE + +One reason to love Linux on your servers or in your data-center is that you so seldom needed to reboot it. True, critical patches require a reboot, but you could go months without rebooting. Now, with the latest changes to the Linux kernel you may be able to go years between reboots. + +This is actually a feature that was available in Linux in 2009 thanks to a program called [Ksplice][2]. This program compares the original and patched kernels and then uses a customized kernel module to patch the new code into the running kernel. Each Ksplice-enabled kernel comes with a special set of flags for each function that will be patched. The [Ksplice process][3] then watches for a moment when the code for the function being patched isn't in use, and ta-da, the patch is made and your server runs on. + +[Oracle acquired Ksplice][4] in 2011, and kept it just for its own [Oracle Linux][5], a [Red Hat Enterprise Linux (RHEL)][6] clone, and as a RHEL subscription service. That left all the other enterprise and server Linux back where they started. + +Then [KernelCare released a service that could provide bootless patches][7] for most enterprise Linux distros. This program use proprietary software and is only available as a service with a monthly fee. That was a long way from satisfying many Linux system administrators. + +So, [Red Hat][8] and [SUSE][9] both started working on their own purely open-source means of giving Linux the ability to keep running even while critical patches were being installed. Red Hat's program was named [kpatch][10], while SUSE' is named [kGraft][11]. + +The two companies took different approaches. Kpatch issues a stop_machine() command. After that it looks at the stack of existing processes using [ftrace][12] and, if the patch can be made safely, it redirects the running code to the patched functions and then removes the now outdated code. + +Kgraft also uses ftrace, but it works on the thread level. When an old function is called it makes sure the thread reaches a point that it can switch to the new function. + +While the end result is the same, the operating system keeps running while patches are made, there are significant differences in performance. Kpatch takes from one to forty milliseconds, while kGraft might take several minutes but there's never even a millisecond of down time. + +At the Linux Plumbers Conference in October 2014, the two groups got together and started work on a way to [patch Linux without rebooting that combines the best of both programs][13]. Essentially, what they ended up doing was putting both kpatch and kGraft in the 4.0 Linux kernel. + +Jiri Kosina, a SUSE software engineer and Linux kernel developer, explained, that live-patching in the Linux kernel will "provides a basic infrastructure for function "live patching" (i.e. code redirection), including API [application programming interface] for kernel modules containing the actual patches, and API/ABI [application binary interface] for userspace to be able to operate on the patches. This is "relatively simple and minimalistic, as it's making use of existing kernel infrastructure (namely ftrace) as much as possible. It's also self-contained, in a sense that it doesn't hook itself in any other kernel subsystem (it doesn't even touch any other code)." + +The release candidate for Linux 4.0 is now out. Kosina stated that "It's now implemented for x86 only as a reference architecture, but support for powerpc, s390 and arm is already in the works." And, indeed, the source code for these architectures is already in the [Live Patching Git code][14]. + +Simply having the code in there is just the start. Your Linux distribution will have to support it with patches that can make use of it. With both Red Hat and SUSE behind it, live patching will soon be the default in all serious business Linux distributions. + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/no-reboot-patching-comes-to-linux-4-0/#ftag=RSSbaffb68 + +作者:[Steven J. Vaughan-Nichols][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.zdnet.com/meet-the-team/us/sjvn/ +[1]:http://www.zdnet.com/article/linux-kernel-turns-over-release-odometer-to-4-0/ +[2]:http://www.computerworld.com/article/2466389/open-source-tools/never-reboot-again-with-linux-and-ksplice.html +[3]:http://www.ksplice.com/ +[4]:http://www.zdnet.com/article/oracle-acquires-zero-downtime-linux-upgrade-software/ +[5]:http://www.oracle.com/us/technologies/linux/overview/index.html +[6]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux +[7]:http://www.zdnet.com/article/kernelcare-new-no-reboot-linux-patching-system/ +[8]:http://www.redhat.com/ +[9]:http://www.suse.com/ +[10]:http://rhelblog.redhat.com/2014/02/26/kpatch/ +[11]:http://www.zdnet.com/article/suse-gets-live-patching/ +[12]:http://elinux.org/Ftrace +[13]:http://linuxplumbersconf.org/2014/wp-content/uploads/2014/10/LPC2014_LivePatching.txt +[14]:https://kernel.googlesource.com/pub/scm/linux/kernel/git/jikos/livepatching/+/9ec0de0ee0c9f0ffe4f72da9158194121cc22807 \ No newline at end of file diff --git a/sources/talk/20150309 10 best uses for open source software in the business world.md b/sources/talk/20150309 10 best uses for open source software in the business world.md new file mode 100644 index 0000000000..b0c4475652 --- /dev/null +++ b/sources/talk/20150309 10 best uses for open source software in the business world.md @@ -0,0 +1,85 @@ +10 best uses for open source software in the business world +================================================================================ +> Open source offers some compelling benefits for businesses large and small -- but you might be surprised at some of the ways it's being used. + +![](http://tr2.cbsistatic.com/hub/i/r/2015/03/05/54a9c323-4311-4455-b10b-5182548da424/resize/620x485/95164f01a19cbd7a3e4b843be78febae/foss.jpg) + +Certain inevitabilities occur in technology. For instance, open source software will make its way into your business. Ten years ago, this could easily have been called into question. Now? There's no way to avoid it -- and there's no reason to. With so many powerful (and necessary) pieces of technology, open source has become, in various cases, the savior of tech. But what areas of your business are best suited for open source? The answer to that question is, of course, will be different from one company to the next. But some applications can apply in almost every circumstance. + +Let's take a look at 10 possible best-case uses for open source software that can help make your business grow, bring you a level of flexibility and reliability you haven't experienced, or just save you a welcome percentage of your budget. + +### 1: Server software ### + +If you're still battling Microsoft's IIS platform, you need to experience Apache. The flagship open source web server software is one of the most widely used on the planet. It's free, incredibly reliable, easy to manage, and doesn't require the enormous overhead needed for IIS. But open source isn't limited to just web servers. If you need SMB sharing across your company, consider Samba. Samba 4 even integrates with Active Directory, so you don't have to worry about setting up separate user accounts on the Samba server. + +### 2: Development ### + +Developing with open source is a no-brainer. PHP, Rails, Perl -- there are as many languages to develop with as there are tools (from IDEs to bug tracking). There are a lot of options for developing for open source or with open source tools (as are there with proprietary development). The biggest difference between open source and proprietary is the access you have to the software code. Within the world of FOSS (free open source software) the code is readily available. For many developers, the Linux operating system has everything they need to develop, built right in (especially those who code without a full-blown IDE). If you do require GUI development tools, open source has you covered. + +### 3: Security ### + +The route to security is a challenging one, but there are many paths to success. You can opt for the "security in a box" solution and go with the likes of Cisco (a solid solution) or you can craft your security to perfectly fit your needs with the likes of iptables. Yes, the open source security route will take a bit more time to deploy (with a much higher learning curve), but the end results are generally incredible. This doesn't even address the idea that using open source on the desktop is, generally speaking, a more secure platform than most proprietary systems. Deploy Linux on the desktops and your security woes will drop dramatically. + +### 4: Desktops ### + +This area is where most of the pushback happens. However, you must take into consideration the fact that the daily workflow has undergone a major paradigm shift. Most of what we do now is done via a web browser. So why not deploy Linux on the desktop? Not only does it work with the majority of today's tasks, it will do so without suffering from viruses, malware, and updates that cripple a system. It's not perfect -- what platform is? But it's solid, and in the end, it can save you money. That's a win-win. + +### 5: Workflow ### + +Every business depends upon workflow. For some businesses, a smooth workflow depends upon tools. Open source has this arena covered. CRM, HRM, ERP, BI, BPM... you name it, open source handles just about every possible acronym you can think of -- and it does it very well. With the likes of [Pentaho][1], [Collabtive][2], and [SugarCRM][3], open source can keep up with closed source tools any day. + +### 6: Collaboration ### + +Without the ability to work together on projects, your staff wouldn't be able to get the job done. So the collaboration tools you choose are crucial. You'll find plenty of quality collaboration tools within the world of open source. [Cyn.in community edition][4], [Zimbra Open Source Edition][5], and [Kolab][6] are just three examples of the excellent collaboration tools that exist within the open source world. + +### 7: Big data ### + +When it comes to big data, open source can't be matched. Thanks to the likes of [SUSE][7], big data and open source now go hand in hand. Innovations like in-memory data and live kernel patching make open source an ideal solution for big data. It can be perfectly tuned to meet the massive demands big data places on the platform. Closed source software can't touch this level of flexibility. + +### 8: Cloud ### + +The major players in the cloud are open source. [Red Hat][8], [Ubuntu][9], [SUSE][10], [Amazon][11], [Rackspace][12] -- they all get it and know that open source is the best solution for cloud deployments. But if you don't want to go with the larger companies, there are always up and coming tools like [ownCloud][12], where you can either take advantage of its hosted cloud solutions or build your own. + +### 9: Multimedia ### + +If your company does podcasting or video for PR, open source has you covered. With tools like [Audacity][14] and [OpenShot][15], you can do just about anything with audio or video you need -- and do so on the cheap. In fact, you'll be hard-pressed to find a better podcasting tool than Audacity or an easier-to-use video editor than OpenShot. Both pieces of software do an outstanding job of creating professional-quality results without the steep learning curves or the high prices often associated with closed source tools + +### 10: E-commerce ### + +If your business sells products online, you'd be remiss not to give a tool like [PrestaShop][16] a try. PrestaShop is, hands down, one of the most powerful e-commerce solutions available -- regardless of license. With just about every feature you could possible want (and some you probably haven't even thought of), the open source platform excels at e-commerce on every level. + +### FOSS for business ### + +Open source is no longer hanging around the periphery of the business conversation. In many instances, FOSS leads and dominates that conversation. If you've been looking for areas to consider deploying open source solutions, look no further than these 10. + +### Your turn ### + +Have you added open source software to your business? If so, in what way? + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/blog/10-things/10-best-uses-for-open-source-software-in-the-business-world/ + +作者:[Jack Wallen][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.techrepublic.com/search/?a=jack+wallen +[1]:http://community.pentaho.com/ +[2]:http://collabtive.o-dyn.de/ +[3]:http://www.sugarcrm.com/ +[4]:http://cynapse.com/cyn-in/ +[5]:https://www.zimbra.com/open-source +[6]:http://kolab.org/ +[7]:http://www.suse.org/ +[8]:http://www.redhat.com/ +[9]:http://www.ubuntu.com/ +[10]:http://www.suse.com/ +[11]:http://aws.amazon.com/ec2/ +[12]:http://www.rackspace.com/cloud +[13]:https://owncloud.org/ +[14]:http://audacity.sourceforge.net/ +[15]:http://www.openshot.org/ +[16]:https://www.prestashop.com/ \ No newline at end of file diff --git a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md new file mode 100644 index 0000000000..d29a75cb69 --- /dev/null +++ b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -0,0 +1,98 @@ +Comparative Introduction To FreeBSD For Linux Users +================================================================================ +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) + +### Introduction ### + +BSD was originally derived from UNIX and currently, there are various number of Unix-like operating systems descended from the BSD. While, FreeBSD is the most widely used open source Berkeley Software Distribution (BSD distribution). As it is implicitly said it is a free and open source Unix-like-operating system and a public server platform. FreeBSD source code is generally released under a permissive BSD license. It is true that it has similarities with Linux but we cannot deny that they differs in other points. + +The remainder of this article is organized as follows: the description of FreeBSD will be treated in our first section. The similarities between FreeBSD and Linux will be briefly described in the second section. While their differences will be discussed in the third section. And a comparison of their features will be summarized in our last section. + +### FreeBSD description ### + +#### History #### + +- The first version of FreeBSD was released in 1993, while its first CD-ROM distributed was FreeBSD1.0 on December 1993. Then, FreeBSD 2.1.0 was released in 1995 which gained the satisfaction of all users. Actually, many IT companies use FreeBSD and are satisfied where we can list those companies: IBM, Nokia, NetApp and Juniper Networks. + +#### License #### + +- Concerning its license, FreeBSD is released under various source licenses. Its newest code called Kernel is released under the two-clause BSD license, offering the possibility to use and redistribute FreeBSD with absolute freedom. Other codes are released three- and four-clause BSD license and some others are released under GPL and CDDL. + +#### Users #### + +- One of the important feature of FreeBSD, we can mention the various categories of its users. In fact, it is possible to use FreeBSD as a mail server, web server, FTP server and as a router due to the significant set of server-related software accompanied with it. Furthermore, ARM, PowerPC and MIPS are supported by FreeBSD so it is possible to use x86 and s86-64. + +### FreeBSD and Linux similarities ### + +FreeBSD and Linux are two free and open source systems. Indeed, their users can easily check and modify the source code with an absolute freedom. To add, FreeBSD and Linux, both of them are derived from Unix.-like because they have a kernel, internals, and libraries programmed using algorithms derived from historic AT&T Unix. While FreeBSD’s roots are similar to Unix systems, Linux is released as a free Unix-like option. Various tools and applications can be found either in FreeBSD or in Linux in fact, they almost share the same functionality. + +Furthermore, FreeBSD can run big number of Linux applications. It has a Linux compatibility layer that can be installed. This Linux compatibility layer can be installed while compiling FreeBSD with AAC Compact Linux or downloading compiled FreeBSD systems with a Linux compatibility program such as: aac_linux.ko. Which is not the same case with Linux, Linux cannot run FreeBSD software. + +At the end, we can mention that both of them have the same goal but have also some differences which we will outline in the next section. + +### FreeBSD and Linux differences ### + +Currently, no criteria of choice between FreeBSD and Linux is clear for most users. Since, they share almost the same applications. Those two operating systems are as mentioned previously UNIX-like. + +In this section, we will list the most important differences of those two systems. + +#### License #### + +- The first difference point between those two compared systems consist on their license. To start by Linux license, it is released under the GPL license which offers the possibility to view, distribute and change the source code with an absolute freedom. The GPL license helps users to prevent the distribution of binary-only source. Which is the case with FreeBSD, which is licensed under BSD license. This kind of license is more restrictive and easily allows the distribution of binary-only source. The BSD license is more permissive that the GPL since no derivative work is required to maintain the licensing terms. Means any user can use, distribute and modify the code without need to have the previous version of code before changing made. They only need to have the original license of BSD. +- Depending on the needs of each user, a selection can be made between those two types of license. Starting by BSD license which is more preferred by many users due to its special features. In fact, this license gives the possibility to sell each software licensed under it and retain the source code. Passing now to the GPL license, which requires some care of each user has a software released under it. +- To be able to choose between those two software, it is required to understand the licensing of both of them to more understand the methodology used in their development, to distinguish between their features and know which one will fit user’s need. + +#### Control #### + +- Since FreeBSD and Linux are released under two different type of license, the Linux Torvalds control the Linux kernel which is not the same case with FreeBSD which is not controlled. Personally, I prefer to use FreeBSD instead of Linux since it is an absolute free software, no control permission exists. But it is not enough there is other differences between Linux and FreeBSD, help you to choose between both of them. As an advice don’t choose one of them, follow us and then give us your choice. + +#### Operating system #### + +- Linux concentrates only on the kernel system which is not the case with FreeBSD while the whole operating system is maintained. The kernel and a set of software, some of them are developed by the FreeBSD team, are maintained as one unit. Indeed, the FreeBSD developers have the possibility to manage the essential operating systems remotely and efficiently. +- With Linux, there is some difficulties while managing a system. Since, the different components maintained will be from different sources so the Linux developers need to assemble them into groups having the same functionality. +- FreeBSD and Linux both of them give the possibility to have a big set of optional software and distributions but they differ on the way they are managed. With FreeBSD, they are managed together while with Linux they will be maintained separately. + +#### Hardware support #### + +- Concerning the hardware support, Linux is better than FreeBSD. It doesn’t mean that FreeBSD hasn’t the capability to support hardware as Linux. They differ just on the manner. It depends on your need as usual. So if you are searching for the newest solution, the FreeBSD will fit your needs but if you are looking for greatest graphs, it is better to use Linux. + +#### FreeBSD origin Vs Linux origin #### + +- The origin of each system is also another point of distinction between both of them. As I said previously Linux is an alternative of the operating system Unix, written by Linus Trovalds and assisted by a special group of hackers across the Net. Linux has all the needed features in a modern Unix, such as virtual memory, shared libraries, demand loading, proper memory management and many others. It is released under the General Public License. +- FreeBSD also shared many important features of its Unix heritage. FreeBSD as a type of the Berkeley Software Distribution, the distribution of the Unix developed at the University of California. The most important reason under developing BSD is to replace the AT&T operating system by an open source alternative giving the user the ability to use BSD without carry about the obtaining of the AT&T license. +- The problem of licensing, is the most important worry of developers. They try to offer the maximum open source clone of Unix. Which influences the choice of users regarding the degree of open source of each system as FreeBSD gives more freedom than Linux regarding its use since it is released under BSD license. + +#### Supported Package #### + +- From the user’s perspective, another difference between our two compared systems, is their availability and support of the packaged software and source installed software. The Linux distributions provide just the pre-compiled binary packages which is not the same case with FreeBSD, which has the pre-built packages and the build system for the compilation and installation through their available open source. Due to its ports, FreeBSD gives you the possibility to choose between the default making of pre-compiled packages and your ability to customize your software while it is compiled. +- Those ports enable you to build all the software available with FreeBSD. Furthermore, there is an hierarchy of organization all of them due to the directories /usr/ports where you can find the location of the source files and some documentation about the way to use FreeBSD correctly. +- The ports as mentioned give the possibility produce the packages version of software. Instead of having just the pre-compiled packages using Linux, FreeBSD gives you the possibility to have the source-built and the pre-packages software. You can manage your system using the two installation methods. + +#### FreeBSD Vs Linux common Tools #### + +- A huge number of common tools are available while using FreeBSD and are fully own made by the FreeBSD team. In contrast, the Linux tools are from the GNU that is why there is some control during their usage. +- The fact that FreeBSD is released under BSD license is so beneficial and useful. Since, you have the ability to maintain the core operating system, control the development of these applications. Same of those tools are similar to BSD and Unix tools from where they were derived which is not the same case with GNU suite, which want to just make them less backwards compatible. + +#### The Standard Shell #### + +- The tcsh shell is used by default with FreeBSD. Which is an evaluated version fo csh. Since, the FreeBSD is released under the BSD license, it is not recommended to use the bash shell which is a GNU component. The only difference between bash and tcsh shell consists on the scripting feature which can’t be made by tcsh. Indeed, the sh shell is more recommended for the FreeBSD use since it is more reliable and prevents some issues of scripting can be occurred using the tcsh or csh shell. + +#### A More Stratified Filesystem #### + +- As it was mentioned previously, base operating system and optional components can be easily distinguished using the FreeBSD system. Which causes some specification of their organization. In Linux, /bin, /sbin, /usr/bin, or usr/sbin are the directories for executable systems. With FreeBSD it is not the case. There are some additional specifications concerning their organization. The base system are putted in one of the directories mentioned above while the ports and packages are placed in /usr/local/bin or /usr/local/sbin. This methodology helps to recognize and distinguish between an application considered as a base system or a port. + +### Conclusion ### + +FreeBSD and Linux those two free and open source systems, share various similarities but they also differ in several points. The list giving above isn’t given to say that one of them is better than the other. In fact, FreeBSD and Linux, each one of them has its features and specifications that make it a special regarding the other. And you what is your opinion? Have you already used one on them or both? If yes what is your feedback and if no after reading our description what do you think? Sound off and give us and the fellow readers your opinion. + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ + +作者:[anismaj][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file diff --git a/sources/tech/20130315 How to protect SSH server from brute force attacks using fail2ban.md b/sources/tech/20130315 How to protect SSH server from brute force attacks using fail2ban.md new file mode 100644 index 0000000000..4b79e03cf8 --- /dev/null +++ b/sources/tech/20130315 How to protect SSH server from brute force attacks using fail2ban.md @@ -0,0 +1,174 @@ +theo-l translating + +How to protect SSH server from brute force attacks using fail2ban +如何使用fail2ban来保护SSH服务器避免暴力破解攻击。 +================ + +One common attack on SSH service is brute force attacks where a remote attacker indefinitely attempts to log in with different passwords. Of course there are arguments against password authentication for SSH, and alternative authentication mechanisms such as [public key authentication][1] or [two-factor authentication][2] exist to obsolete such attacks. Putting aside pros and cons of different authentication methods, let's consider the situation where password authentication is required. How would you protect your SSH server against brute-force attacks? +对于SSH服务的常见的攻击就是暴力破解攻击--远程攻击者通过不同的密码来进行无限地登录尝试。当然SSH存在参数来防备密码验证以及可用的验证机制,例如[公钥验证][1]或者[双重验证][2], + +[fail2ban][3] is a well-known open-source intrusion prevention framework on Linux that monitors various system log files (e.g., /var/log/auth.log or /var/log/secure) and automatically triggers various defensive actions upon detecting any suspicious activities. In fact, fail2ban can be quite useful to defend against brute force password guessing attacks on an SSH server. + +In this guide, I will demonstrate **how to install and configure fail2ban to protect an SSH server against brute force attacks from a remote IP address**. + +### Install Fail2ban on Linux + +To install fail2ban on CentOS or RHEL, first [set up EPEL repository][4], and then run the following command. + + $ sudo yum install fail2ban + +To install fail2ban on Fedora, simply run: + + $ sudo yum install fail2ban + +To install fail2ban on Ubuntu, Debian or Linux Mint: + + $ sudo apt-get install fail2ban + +### Configure Fail2ban for SSH Server + +Now you are ready to configure fail2ban to harden your SSH server. You need to edit the configuration file at /etc/fail2ban/jail.conf. The configuration file contains "DEFAULT" section where you define default parameters for all monitored services, and service-specific sections where you define any service-specific jails (e.g., SSH, Apache, etc) to overwrite default parameters. + +In the service-specific jail sections (somewhere after [DEFAULT] section), you need to define [ssh-iptables] section, where you define SSH-specific jail configurations. Actual IP address banning is done by iptables. + +The following is an example of /etc/fail2ban/jail.conf which contains "ssh-iptables" jail configuration. Of course there could be other application-specific jails depending on your needs. + + $ sudo vi /etc/fail2ban/jail.local + +``` +[DEFAULT] +# a space delimited list of IP addresses, CIDR prefixes, or DNS hostnames +# to bypass fail2ban protection +ignoreip = 127.0.0.1 172.31.0.0/24 10.10.0.0/24 192.168.0.0/24 + +# number of seconds during which a client host is blocked +bantime = 86400 + +# number of failures before a client host is blocked +maxretry = 5 + +# number of seconds within which "maxentry" failures result in banning +findtime = 600 + +mta = sendmail + +[ssh-iptables] +enabled = true +filter = sshd +action = iptables[name=SSH, port=ssh, protocol=tcp] +sendmail-whois[name=SSH, dest=your@email.com, sender=fail2ban@email.com] +# for Debian-based distros +logpath = /var/log/auth.log +# for Red Hat-based distros +logpath = /var/log/secure +# ssh-specific max-retry threshold +maxretry = 3 +``` + +According to the above configuration, fail2ban will automatically ban any remote IP address from which there have been at least 3 failed login attempts within the last 10 minutes. Once banned, the offending IP address will remain blocked for 24 hours. Such an event will be notified by sendemail to a recipient email address. + +Once the configuration file is ready, restart fail2ban service as follows. + +On Debian, Ubuntu or CentOS/RHEL 6: + + $ sudo service fail2ban restart + +On Fedora or CentOS/RHEL 7: + + $ sudo systemctl restart fail2ban + +To verify fail2ban is running successfully, run fail2ban-client command with "ping" argument. If fail2ban service is running okay, you should see "pong" as a response. + + $ sudo fail2ban-client ping + Server replied: pong + +### Test Protection against SSH Brute-Force Attacks with Fail2ban + +To test whether fail2ban works, try to SSH to the server using incorrect passwords to simulate a brute-force attack. In the mean time, monitor /var/log/fail2ban.log, which is logging any interesting events that are happening in fail2ban. + + $ sudo tail -f /var/log/fail2ban.log + +![](https://farm8.staticflickr.com/7550/15882084127_fccf9ca7b7_c.jpg) + +According to the log file above, fail2ban has banned an IP address 192.168.1.8, upon detecting multiple failed SSH login attempts from the IP address. + +### Check Fail2ban Status and Unban Blocked IP Addresses + +As fail2ban's "ssh-iptables" jail uses iptables to block offending IP addresses, you can easily verify the ban by checking current iptables rules as follows. + + $ sudo iptables --list -n + +``` +Chain INPUT (policy ACCEPT) +target prot opt source destination +fail2ban-SSH tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 + +Chain FORWARD (policy ACCEPT) +target prot opt source destination + +Chain OUTPUT (policy ACCEPT) +target prot opt source destination + +Chain fail2ban-SSH (1 references) +target prot opt source destination +DROP all -- 192.168.1.8 0.0.0.0/0 +RETURN all -- 0.0.0.0/0 0.0.0.0/0 +``` + +If you want to unblock the IP address from fail2ban, you can also use iptables command: + + $ sudo iptables -D fail2ban-SSH -s 192.168.1.8 -j DROP + +While you can check and manage fail2ban's IP blocklist manually with iptables command like above, a proper way is in fact to use fail2ban-client command-line tool. This tool allows you to manage not only "ssh-iptables" jail, but also any other types of fail2ban jails in a unified command-line interface. + +To check fail2ban status (which will show a list of currently active jails): + + $ sudo fail2ban-client status + +To check the status of a particular jail (e.g., ssh-iptables): + + $ sudo fail2ban-client status ssh-iptables + +The above command will show a list of banned IP addresses. + +![](https://farm8.staticflickr.com/7497/16067847655_021d23e320_b.jpg) + +To unban a particular IP address: + + $ sudo fail2ban-client set ssh-iptables unbanip 192.168.1.8 + +![](https://farm8.staticflickr.com/7465/16065915571_b215a8b344_b.jpg) + +Note that if you stop fail2ban, all blocked IP addresses will be unblocked. When you restart fail2ban, it will find a list of offending IP addresses from /var/log/secure (or /var/log/auth.log), and re-ban those IP addresses if the elapsed time of the offenses are still within ban time. + +### Set Fail2ban to Auto-start on Boot + +Once you haved tested fail2ban successfully, the last step is to enable fail2ban to launch automatically upon powering on your server. On Debian-based distributions, fail2ban auto-start is enabled by default. On Red Hat-based distributions, enable auto-start as follows. + +On CentOS/RHEL 6: + + $ sudo chkconfig fail2ban on + +On Fedora or CentOS/RHEL 7: + + $ sudo systemctl enable fail2ban + +### Summary + +In this tutorial, I demonstrated how to install and configure fail2ban to protect an SSH server. While fail2ban can mitigate brute-force password guessing attacks, please note that it cannot protect SSH servers against sophisticated distributed brute-force campaigns, where an attacker bypasses fail2ban by using many thousands of bot-controlled IP addresses. + +----------- + +via: http://linoxide.com/tools/linux-compress-decompress-tools/ + +作者:[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]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html +[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html +[3]:http://www.fail2ban.org/ +[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html diff --git a/sources/tech/20141203 Undelete Files on Linux Systems.md b/sources/tech/20141203 Undelete Files on Linux Systems.md deleted file mode 100644 index 126501e225..0000000000 --- a/sources/tech/20141203 Undelete Files on Linux Systems.md +++ /dev/null @@ -1,120 +0,0 @@ -Translating by FSSlc - -Undelete Files on Linux Systems -================================================================================ -Often times, a computer user will delete a needed file accidentally and not have an easy way to regain or recreate the file. Thankfully, files can be undeleted. When a user deletes a file, it is not gone, only hidden for some time. Here is how it all works. On a filesystem, the system has what is called a file allocation list. This list keeps track of what files are where on the storage unit (hard-drive, MicroSD card, flash-drive, etc.). When a file is deleted, the filesystem will perform one of two tasks on the allocation table. The file's entry on the file allocation table marked as "free space" or the file's entry on the list is erased and then the space is marked as free. Now, if a file needs to be placed on the storage unit, the operating system will put the file in the space marked as empty. After the new file is written to the "empty space", the deleted file is now gone forever. When a deleted file is to be recovered, the user must not manipulate any files because if the "empty space" is used, then the file can never be retrieved. - -### How do undelete programs work? ### - -The majority of filesystems only mark the space as empty. With these filesystems, the undelete program looks at the file allocation list and copies the deleted file to another storage unit. If the files were copied to the same storage unit, then the user could lose other deleted files that are needed. - -Rarely do filesystems erase the allocation table entry. If a filesystem does, this is how an undelete program undeletes the file. The program searches the storage unit for file headers. All files have a specific string of code that is at the very beginning of the file. This is called a magic number. For example, the magic number of a compiled JAVA class is the hex number "CAFEBABE". So, an undelete program would find "CAFEBABE" and copy that file to another storage unit. Some undelete programs can look for a specific file type. The user may want a PDF, so the program searches for the hex magic number "25504446" which is the ASCII code for "%PDF". Other undelete programs search for all magic numbers. Then, the user can select which deleted files to recover. - -If a part of the file has been written over, then the whole file will be corrupted. The file can usually be recovered, but the contents will be useless. For instance, recovering a corrupted JPEG file will be pointless because the image viewer will not be able to generate an image from the file. So, the user has the file, but the file is useless. - -### Device Locations: ### - -Before we continue, here is some information that will aid in directing the undelete utilities to the correct storage unit. All devices are in the /dev/ folder. The name of each device (not the name that the admin gave each partition or device) that is given by the system follows a predictable scheme. The second partition on the first SATA hard-drive would be sda2. The first letter indicates the storage type, in this case SATA, but an "s" could also mean SCSI, FireWire, or USB. The second letter "d" means disk. The third letter indicates the device number, so an "a" would be the first SATA and a "b" would be the second. The number displays the partition. To name the whole device with all partitions type the letters without the number. For this example that would be sda. Other possible letters "h" as the first letter. This means PATA hard-drive (IDE). As some examples of this scheme, a user has a computer with one SATA hard-drive (sda). The drive has four partitions - sda1, sda2, sda3, and sda4. The user deletes the third one, but sda4 remains sda4 until sda4 is reformatted. The user then plugs in a usb memory card (sdb) with one partition - sdb1. The user then adds a IDE hard-drive with one partition - hda1. Next, the user adds a SCSI hard-drive - sdc1. Then, the user removes the USB memory card (sdb). Now, the SCSI remains sdc, but if the SCSI is removed and added back, it will be sdb. Even though other storage device existed, the IDE drive will have the "a" because it is the first IDE drive. IDE devices are numbered separately from SCSI, SATA, FireWire, and USB devices. - -### Recovery: ### - -Each undelete program has different abilities, features, and support for various filesystems. Below are some instructions for using TestDisk to recover files on a set of filesystems. - -**FAT16, FAT32, exFAT (FAT64), NTFS, and ext2/3/4:** - -TestDisk is an open-source, free program that works on Linux, *BSD, SunOS, Mac OS X, DOS, and Windows. TestDisk can be found here: [http://www.cgsecurity.org/wiki/TestDisk][1]. TestDisk can also be installed by typing "sudo apt-get install testdisk". TestDisk has many abilities, but this article is concerned with undeleting files. - -Open TestDisk in a terminal using root privileges by typing “sudo testdisk”. - -Now, the TestDisk command-line application will execute. The terminal appearance will change. TestDisk asks the user if it can keep logs. This is entirely up to the user. If the user is recovering files from the system storage, then do not keep a log. The choices are "Create", "Append", and "No Log". If the user wants a log, it is kept in that user's home folder. - -![](http://www.linux.org/attachments/screen1-jpg.342/) - -In the following screen, the storage devices are listed using the /dev/* method. For my system, the system's storage unit is /dev/sda. This means that my storage unit is a SATA hard-drive (sd) and it is the first hard-drive (a). The size of each storage unit is displayed in Gigabytes. Use the up and down arrows to select a storage device and hit enter. - -![](http://www.linux.org/attachments/screen2-jpg.343/) - -The next screen displays a list of partition table (also called partition map) types. Just as there is the file allocation table for files, there is a table for the partitions. Partitions are dividers on a storage device. For instance, on almost all Linux systems there is at least two partitions - EXT3/4 and Swap. Each partition table will be briefly described. TestDisk does not support all partition tables, so this is not a complete list. - -![](http://www.linux.org/attachments/screen3-jpg.344/) - -- **Intel** - This partition table is very common on Windows systems and many Linux systems. This table is also know as MBR. -- **EFI GPT** - This is usually used with Linux systems. This partition map is most recommended for Linux because the concept of logical/extended partitions does not apply to GPT (GUID Partition Table) tables. This means that a Linux user can multiboot many forms of Linux with one Linux OS on each partition. There are other advantages to using GPT, but that is beyond this article. -- **Humax** - Humax maps are used with device made by the South Korean company Humax. -- **Mac** - The Apple Partition Map (APM) is used by Apple devices. -- **None** - Some devices do not have a partition table. For instance, many Subor game consoles do not use a partition map. If a user tried to undelete a file on these devices thinking that the partition map was one of the other choices, the user will be confused by the fact that TestDisk does not find any filesystem or files. -- **Sun** - The Sun partition table is used by Sun systems. -- **Xbox** - The Xbox uses the Xbox partition map for its storage devices. - -If a user selects "Xbox" even though their system uses GPT, TestDisk will not be able to find a partition or filesystem. If it does, then it will guess incorrectly. (The image below displays the output when the incorrect partition type) - -![](http://www.linux.org/attachments/xbox-jpg.350/) - -Once the user picks the correct choice for their device, on the next screen, select "Advanced". - -![](http://www.linux.org/attachments/screen4-jpg.345/) - -Now, the user should see a list of all of their filesystems/partitions on the storage unit. If the user had chosen the wrong partition map, then here is where they will know if they made the incorrect selection. If there are no errors, highlight the partition that contains the deleted file by placing the text-based cursor on it. Use the left and right arrows to highlight "List" on the bottom of the terminal. Now, hit enter. - -![](http://www.linux.org/attachments/screen5-jpg.346/) - -A new screen is displayed with a list of files and folders. The whitish files are current files that are not deleted. The red files have been deleted. On the far right column is the files' names. The next column over to the left is the creation date of the file. One column over to the left again is the files' sizes in bytes. To the far left is a column with dashes, "d"s, "r"s, "w"s, and "x"s. These are the file permissions. A "d" indicates that the item is a directory. The rest of the permission syntax is irrelevant to this article. The item on the top of the file list titled "." means the current directory. The second object titled ".." means go up one directory, so a user can move up a directory by selecting this line. For an example, I will go into the directory "Xaiml_Dataset". The folder is nearly full of deleted files. I will undelete "computers.xaiml" by pressing "c" on the keyboard. I am now asked to select a destination directory. Of course, I will put it on another partition. I am in my home folder, and I press "c". It does not matter what folder is highlighted. The current folder is the destination directory. Now, I am back to the list of files. At the top of the screen is a message that says "Copy Done!". In my home folder is a folder called "Xaiml_Dataset", and inside is the Xaiml file. If I press "c" on more deleted files, they will be placed in the new folder without a****g me for a destination. - -![](http://www.linux.org/attachments/screen6-jpg.347/) - -![](http://www.linux.org/attachments/screen7-jpg.348/) - -![](http://www.linux.org/attachments/screen8-jpg.349/) - -When finished press "q" repeatedly until the normal terminal is seen. The folder "Xaiml_Dataset" can only be accessed by the root. To fix this, use root privileges to change the folder permissions and the contained files. After that, the files have been recovered and accessible to the user. - -### ReiserFS: ### - -To undelete a file from a ReiserFS filesystem, make a backup of all of the files on the partition because this method can cause the file to be lost if something goes wrong. Next, execute the following command where DEVICE is the device in the form sda2. Some files will be put in the lost+found directory and other will remain where they were before deletion. - - reiserfsck --rebuild-tree --scan-whole-partition /dev/DEVICE - -### Recover Deleted File that is Open in a Program: ### - -Assume a user accidentally deletes a file that a program has open. The file of the hard-drive was deleted, but the program is using a copy of the file that is on the RAM. Thankfully, there are two easy solutions. - -If the program has save capabilities like a text editor, the user can resave the file. Thus, the file editor will write the file to the hard-drive. - -Assume that this is an MP3 file in a music player. The music player cannot save the MP3 file. This task requires a little more time than the previous situation. Unfortunately, this method does not work on all systems and applications. To begin, type the following command. - - lsof -c smplayer | grep mp3 - -This command LiSts all of the Open Files used by Smplayer. This list is piped (given) to grep which searches for mp3. The output looks like the following. - - smplayer 10037 collier mp3 169r 8,1 676376 1704294 /usr/bin/smplayer - -Now, type the following command to recover the file directly from the RAM (on Linux systems, /proc/ is the RAM) and copy it to a folder of choice. The "cp" is the copy command. The 10037 number comes from the process number given in the output. The 169 is the file descriptor shown in the output. The "~/Music/" is the destination directory. Lastly, "music.mp3" is the file name that the user wants for the file. - - cp /proc/10037/fd/169 ~/Music/music.mp3 - -### Real Deletion: ### - -To make for sure that a file can never be recovered, use a command that "wipes" the hard-drive. Wiping the hard-drive means writing meaningless data to the disk. For example, many wiping programs write zeros, random letters, or random data to the hard-drive. No space is taken up or lost. The wiping program just overwrites the "empty space". If the storage unit is ever full of files with no free space remaining, then all of the previously deleted files will be gone. - -The purpose of wiping hard-drives is to make sure that private data is never seen. For illustration, a company may order new computers. The manager decides to sell the old computers. However, there is concern that the new owners may view company secrets or customer information like credit card numbers and addresses. Thankfully, a computer technician in the company can wipe the hard-drives before selling the old computers. - -To install secure-delete, a wiping program, type "sudo apt-get install secure-delete". This installs a set of four commands that make sure that deleted files are never recovered. - -- srm - permanently delete a file. Usage: srm -f ./secret_file.txt -- sfill - wipe the free space. Usage: sfill -f /mount/point/of/partition -- sswap - wipe swap space. Usage: sswap -f /dev/SWAP_DEVICE - -If computers were to truly delete a file selected for deletion, then more time would be required to perform the task. It is quick and easy to mark some space as free, but to make the file gone forever requires time. Wiping a storage unit, for instance, takes a few hours to complete (depending on storage size). Overall, the current system works well because even when a user empties the recycle bin, they still have another chance to change their mind. - --------------------------------------------------------------------------------- - -via: http://www.linux.org/threads/undelete-files-on-linux-systems.4316/ - -作者:[DevynCJohnson][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.linux.org/members/devyncjohnson.4843/ -[1]:http://www.cgsecurity.org/wiki/TestDisk diff --git a/sources/tech/20141205 How to configure a syslog server with rsyslog on Linux.md b/sources/tech/20141205 How to configure a syslog server with rsyslog on Linux.md deleted file mode 100644 index e55c028ecd..0000000000 --- a/sources/tech/20141205 How to configure a syslog server with rsyslog on Linux.md +++ /dev/null @@ -1,156 +0,0 @@ -translating by coloka... - -How to configure a syslog server with rsyslog on Linux -================================================================================ -A syslog server represents a central log monitoring point on a network, to which all kinds of devices including Linux or Windows servers, routers, switches or any other hosts can send their logs over network. By setting up a syslog server, you can filter and consolidate logs from different hosts and devices into a single location, so that you can view and archive important log messages more easily. - -On most Linux distributions, **rsyslog** is the standard syslog daemon that comes pre-installed. Configured in a client/server architecture, **rsyslog** can play both roles; as a syslog server **rsyslog** can gather logs from other devices, and as a syslog client, **rsyslog** can transmit its internal logs to a remote syslog server. - -In this tutorial, we cover how to configure a centralized syslog server using **rsyslog** on Linux. Before we go into the details, it is instructive to go over syslog standard first. - -### Basic of Syslog Standard ### - -When logs are collected with syslog mechanism, three important things must be taken into consideration: - -- **Facility level**: what type of processes to monitor -- **Severity (priority) level**: what type of log messages to collect -- **Destination**: where to send or record log messages - -Let's take a look at how the configuration is defined in more detail. - -The facility levels define a way to categorize internal system processes. Some of the common standard facilities in Linux are: - -- **auth**: messages related to authentication (login) -- **cron**: messages related to scheduled processes or applications -- **daemon**: messages related to daemons (internal servers) -- **kernel**: messages related to the kernel -- **mail**: messages related to internal mail servers -- **syslog**: messages related to the syslog daemon itself -- **lpr**: messages related to print servers -- **local0 - local7**: messages defined by user (local7 is usually used by Cisco and Windows servers) - -The severity (priority) levels are standardized, and defined by using standard abbreviation and an assigned number with number 7 being the highest level of all. These levels are: - -- emerg: Emergency - 0 -- alert: Alerts - 1 -- crit: Critical - 2 -- err: Errors - 3 -- warn: Warnings - 4 -- notice: Notification - 5 -- info: Information - 6 -- debug: Debugging - 7 - -Finally, the destination statement enforces a syslog client to perform one of three following tasks: (1) save log messages on a local file, (2) route them to a remote syslog server over TCP/UDP, or (3) send them to stdout such as a console. - -In rsyslog, syslog configuration is structured based on the following schema. - - [facility-level].[severity-level] [destination] - -### Configure Rsyslog on Linux ### - -Now that we understand syslog, it's time to configure a Linux server as a central syslog server using rsyslog. We will also see how to configure a Windows based system as a syslog client to send internal logs to the syslog server. - -#### Step One: Initial System Requirements #### - -To set up a Linux host as a central log server, we need to create a separate /var partition, and allocate a large enough disk size or create a LVM special volume group. That way, the syslog server will be able to sustain the exponential growth of collected logs over time. - -#### Step Two: Enable Rsyslog Daemon #### - -rsyslog daemon comes pre-installed on modern Linux distributions, but is not enabled by default. To enable rsyslog daemon to receive external messages, edit its configuration file located in /etc/rsyslog.conf. - -Once the file is opened for editing, search and uncomment the below two lines by removing the # sign from the beginning of lines. - - $ModLoad imudp - $UDPServerRun 514 - -This will enable rsyslog daemon to receive log messages on UDP port 514. UDP is way faster than TCP, but does not provide reliability on data flow the same way as TCP does. If you need to reliable delivery, you can enable TCP by uncommenting the following lines. - - $ModLoad imtcp - $InputTCPServerRun 514 - -Note that both TCP and UDP can be set on the server simultaneously to listen on TCP/UDP connections. - -#### Step Three: Create a Template for Log Receipt #### - -In the next step we need to create a template for remote messages, and tell rsyslog daemon how to record messages received from other client machines. - -Open /etc/rsyslog.conf with a text editor, and append the following template before the GLOBAL DIRECTIVES block: - - $template RemoteLogs,"/var/log/%HOSTNAME%/%PROGRAMNAME%.log" * - *.* ?RemoteLogs - & ~ - -This template needs a little explanation. The $template RemoteLogs directive ("RemoteLogs" string can be changed to any other descriptive name) forces rsyslog daemon to write log messages to separate local log files in /var/log/, where log file names are defined based on the hostname of the remote sending machine as well as the remote application that generated the logs. The second line ("*.* ?RemoteLogs") implies that we apply RemoteLogs template to all received logs. - -The "& ~" sign represents a redirect rule, and is used to tell rsyslog daemon to stop processing log messages further, and not write them locally. If this redirection is not used, all the remote messages would be also written on local log files besides the log files described above, which means they would practically be written twice. Another consequence of using this rule is that the syslog server's own log messages would only be written to dedicated files named after machine's hostname. - -If you want, you can direct log messages with a specific facility or severity level to this new template using the following schema. - - [facility-level].[severity-level] ?RemoteLogs - -For example: - -Direct all internal authentication messages of all priority levels to RemoteLogs template: - - authpriv.* ?RemoteLogs - -Direct informational messages generated by all system processes, except mail, authentication and cron messages to RemoteLogs template: - - *.info,mail.none,authpriv.none,cron.none ?RemoteLogs - -If we want all received messages from remote clients written to a single file named after their IP address, you can use the following template. We assign a new name "IpTemplate" to this template. - - $template IpTemplate,"/var/log/%FROMHOST-IP%.log" - *.* ?IpTemplate - & ~ - -After we have enabled rsyslog daemon and edited its configuration file, we need to restart the daemon. - -On Debian, Ubuntu or CentOS/RHEL 6: - - $ sudo service rsyslog restart - -On Fedora or CentOS/RHEL 7: - - $ sudo systemctl restart rsyslog - -We can verify that rsyslog daemon is functional by using netstat command. - - $ sudo netstat -tulpn | grep rsyslog - -The output should look like the following in case rsyslog daemon listens on UDP port. - - udp 0 0 0.0.0.0:514 0.0.0.0:* 551/rsyslogd - udp6 0 0 :::514 :::* 551/rsyslogd - -If rsyslog daemon is set up to listen on TCP connections, the output should look like this. - - tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 1891/rsyslogd - tcp6 0 0 :::514 :::* LISTEN 1891/rsyslogd - -#### Send Windows Logs to a Remote Rsyslog Server #### - -To forward a Windows based client's log messages to our rsyslog server, we need a Windows syslog agent. While there are a multitude of syslog agents that can run on Windows, we can use [Datagram SyslogAgent][1], which is a freeware program. - -After downloading and installing the syslog agent, we need to configure it to run as a service. Specify the protocol though which it will send data, the IP address and port of a remote rsyslog server, and what type of event logs should be transmitted as follows. - -![](https://farm8.staticflickr.com/7509/15305930594_27b7f4440a_o.jpg) - -After we have set up all the configurations, we can start the service and watch the log files on the central rsyslog server using tailf command line utility. - -### Conclusion ### - -By creating a central rsyslog server that can collect log files of local or remote hosts, we can get a better idea on what is going on internally in their systems, and can debug their problems more easily should any of them become unresponsive or crash. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/configure-syslog-server-linux.html - -作者:[Caezsar M][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/caezsar -[1]:http://www.syslogserver.com/download.html \ No newline at end of file diff --git a/sources/tech/20141229 4 Steps to Setup Local Repository in Ubuntu using APT-mirror.md b/sources/tech/20141229 4 Steps to Setup Local Repository in Ubuntu using APT-mirror.md deleted file mode 100644 index 121f496d6a..0000000000 --- a/sources/tech/20141229 4 Steps to Setup Local Repository in Ubuntu using APT-mirror.md +++ /dev/null @@ -1,126 +0,0 @@ -ideas4u is translating! -4 Steps to Setup Local Repository in Ubuntu using APT-mirror -================================================================================ -Today we will show you how to setup a local repository in your Ubuntu PC or Ubuntu Server straight from the official Ubuntu repository. There are a lot benefit of creating a local repository in your computer if you have a lot of computers to install software, security updates and fixes often in all systems, then having a local Ubuntu repository is an efficient way. Because all required packages are downloaded over the fast LAN connection from your local server, so that it will save your Internet bandwidth and reduces the annual cost of Internet.. - -You can setup a local repository of Ubuntu in your local PC or server using many tools, but we'll featuring about APT-Mirror in this tutorial. Here, we'll be mirroring packages from the default mirror to our Local Server or PC and we'll need at least **120 GB** or more free space in your local or external hard drive. It can be configured through a **HTTP** or **FTP** server to share its software packages with local system clients. - -We'll need to install Apache Web Server and APT-Mirror to get our stuffs working out of the box. Here are the steps below to configure a working local repository: - -### 1. Installing Required Packages ### - -First of all, we are going to pull whole packages from the public repository of Ubuntu package server and save them in our local Ubuntu server hard disk. - -We'll first install a web server to host our local repository. We'll install Apache web server but you can install any web server you wish, web server are necessary for the http protocol. You can additionally install FTP servers like proftpd, vsftpd,etc if you need to configure for ftp protocols and Rsync for rsync protocols. - - $ sudo apt-get install apache2 - -And then we'll need to install apt-mirror: - - $ sudo apt-get install apt-mirror - -![apt-mirror-installation](http://blog.linoxide.com/wp-content/uploads/2014/12/apt-mirror-install.png) - -**Note: As I have already mentioned that we'll need at least 120 GBs free space to get all the packages mirrored or download.** - -### 2. Configuring APT-Mirror ### - -Now create a directory on your harddisk to save all packages. For example, let us create a directory called “/linoxide”. We are going to save all packages in this directory: - - $ sudo mkdir /linoxide - -![repo-dir](http://blog.linoxide.com/wp-content/uploads/2014/12/mkdir-linoxide.png) - -Now, open the file **/etc/apt/mirror.list** file - - $ sudo nano /etc/apt/mirror.list - -![apt-mirror-edit](http://blog.linoxide.com/wp-content/uploads/2014/12/edit-mirror-list-300x7.png) - -Copy the below lines of configuration to mirror.list and edit as your requirements. - - ############# config ################## - # - set base_path /linoxide - # - # set mirror_path $base_path/mirror - # set skel_path $base_path/skel - # set var_path $base_path/var - # set cleanscript $var_path/clean.sh - # set defaultarch - # set postmirror_script $var_path/postmirror.sh - # set run_postmirror 0 - set nthreads 20 - set _tilde 0 - # - ############# end config ############## - - deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse - deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse - deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse - #deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse - #deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse - - deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse - deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse - deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse - #deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse - #deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse - - clean http://archive.ubuntu.com/ubuntu - -![mirror-list-config](http://blog.linoxide.com/wp-content/uploads/2014/12/mirror-list-config.png) - -**Note: You can replace the above official mirror server url by the nearest one, you can get your nearest server by visiting the page [Ubuntu Mirror Server][1]. If you are not in hurry and can wait for the mirroring, you can go with the default official one.** - -Here, we are going to mirror package repository of the latest and greatest LTS release of Ubuntu ie. Ubuntu 14.04 LTS (Trusty Tahr) so, we have configured trusty. If you need to mirror of Saucy or other version of Ubuntu, please edit it as its codename. - -Now, we'll have to run apt-mirror which will now get/mirror all the packages in the repository. - - sudo apt-mirror - -It will take time to download all the packages from the Ubuntu Server which depends upon the connection speed and performance with respect to you and the mirror server. I have interrupted the download as I have already done that... - -![downloading-packages](http://blog.linoxide.com/wp-content/uploads/2014/12/downloading-index.png) - -### 3.Configuring Web Server ### - -To be able to access the repo from other computers you need a webserver. You can also do it via ftp but I choose to use a webserver as I mentioned in above step 1. So, we are now gonna configure Apache Server: - -We will create a symlink from our local repo's directory to a directory ubuntu in the hosting directory of Apache ie /var/www/ubuntu - - $ sudo ln -s /linoxide /var/www/ubuntu - $ sudo service apache2 start - -![symlinks-apache2](http://blog.linoxide.com/wp-content/uploads/2014/12/symblink-apache2.png) - -The above command will allow us to browse our Mirrored Repo from our localhost ie http://127.0.0.1 by default. - -### 4. Configuring Client Side ### - -Finally, we need to add repository source in other computers which will fetch the packages and repository from our computer. To do that, we'll need to edit /etc/apt/sources.list and add the following lines. - - $ sudo nano /etc/apt/sources.list - -Add this line in /etc/apt/sources.list and save. - - deb http://192.168.0.100/ubuntu/ trusty main restricted universe - -**Note: here 192.168.0.100 is the LAN IP address of our server computer, you need to replace that with yours.** - - $ sudo apt-get update - -Finally, we are done. Now you can install the required packages using sudo apt-get install packagename from your local Ubuntu repository with high speed download and with low bandwidth. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/ubuntu-how-to/setup-local-repository-ubuntu/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://launchpad.net/ubuntu/+archivemirrors diff --git a/sources/tech/20150104 How to set up a cross-platform backup server on Linux with BackupPC.md b/sources/tech/20150104 How to set up a cross-platform backup server on Linux with BackupPC.md deleted file mode 100644 index 48df08fa3b..0000000000 --- a/sources/tech/20150104 How to set up a cross-platform backup server on Linux with BackupPC.md +++ /dev/null @@ -1,134 +0,0 @@ -How to set up a cross-platform backup server on Linux with BackupPC -================================================================================ -Just in case you haven't been able to tell from my earlier posts on [backupninja][1] and [backup-manager][2], I am a big backup fan. When it comes to backup, I'd rather have too much than not enough, because if the need arises, you will be grateful that you took the time and effort to generate extra copies of your important data. - -In this post, I will introduce you to [BackupPC][3], a cross-platform backup server software which can perform pull backup of Linux, Windows and MacOS client hosts over network. BackupPC adds a number of features that make managing backups an almost fun thing to do. - -### Features of BackupPC ### - -BackupPC comes with a robust web interface that allows you to collect and manage backups of other remote client hosts in a centralized fashion. Using the web interface, you can examine logs and configuration files, start/cancel/schedule backups of other remote hosts, and visualize current status of backup tasks. You can also browse through archived files and restore individual files or entire jobs from backup archives very easily. To restore individual single files, you can download them from any previous backup directly from the web interface. As if this weren't enough, no special client-side software is needed for client hosts. On Windows clients, the native SMB protocol is used, whereas on *nix clients, you will use `rsync` or tar over SSH, RSH or NFS. - -### Installing BackupPC ### - -On Debian, Ubuntu and their derivatives, run the following command. - - # aptitude install backuppc - -On Fedora, use `yum` command. Note the case sensitive package name. - -On CentOS/RHEL 6, first enable [EPEL repository][4]. On CentOS/RHEL 7, enable [Nux Dextop][5] repository instead. Then go ahead with `yum` command: - - # yum install BackupPC - -As usual, both package management systems will take care of dependency resolution automatically. In addition, as part of the installation process, you may be asked to configure, or reconfigure the web server that will be used for the graphical user interface. The following screenshot is from a Debian system: - -![](https://farm8.staticflickr.com/7573/16163781711_6218b620ef_c.jpg) - -Select your choice by pressing the space bar, and then move to Ok with the tab key and hit ENTER. - -You will then be presented with the following screen informing you that an administrative user account 'backuppc', along with its corresponding password (which can be changed later if desired), has been created to manage BackupPC. Note that both a HTTP user account and a regular Linux account of the same name 'backuppc' will be created with an identical password. The former is needed to access BackupPC's protected web interface, while the latter is needed to perform backup using rsync over SSH. - -![](https://farm8.staticflickr.com/7579/15979622809_25e734658d_c.jpg) - -You can change the default password for the HTTP user 'backuppc' with the following command: - - # htpasswd /path/to/hash/file backuppc - -As for a regular 'backuppc' [Linux][6] user account, use passwd command to change its default password. - - # passwd backuppc - -Note that the installation process creates the web and the program's configuration files automatically. - -### Launching BackupPC and Configuring Backups ### - -To start, open a browser window and point to http:///backuppc/. When prompted, enter the default HTTP user credentials that were supplied to you earlier. If the authentication succeeds, you will be taken to the main page of the web interface. - -![](https://farm9.staticflickr.com/8601/15543330314_f6fdaa235e_z.jpg) - -Most likely the first thing that you will want to do is add a new client host to back up. Go to "Edit Hosts" in the Task pane. We will add two client hosts: - -- Host #1: CentOS 7 [IP 192.168.0.17] -- Host #2: Windows 7 [IP 192.168.0.103] - -We will back up the CentOS host using rsync over SSH and the Windows host using SMB. Prior to performing the backup, we need to set up [key-based authentication][7] to our CentOS host and a shared folder in our Windows machine. - -Here are the instructions for setting up key-based authentication for a remote CentOS host. We create the 'backuppc' user's RSA key pair, and transfer its public key to the root account of the CentOS host. - - # usermod -s /bin/bash backuppc - # su - backuppc - # ssh-keygen -t rsa - # ssh-copy-id root@192.168.0.17 - -When prompted, type yes and enter root's password for 192.168.0.17. - -![](https://farm8.staticflickr.com/7496/16164929932_8fc817125d_b.jpg) - -You will need root access for a remote CentOS host to grant write access to all its file system in case of restoring a backup of files or directories owned by root. - -Once the CentOS and Windows hosts are ready, add them to BackupPC using the web interface: - -![](https://farm9.staticflickr.com/8586/15979622709_76c2dcf68c_z.jpg) - -The next step consists of modifying each host's backup settings: - -![](https://farm8.staticflickr.com/7461/16163781611_765c147f9f_z.jpg) - -The following image shows the configuration for the backup of the Windows machine: - -![](https://farm8.staticflickr.com/7480/16139884676_bddfafed75_z.jpg) - -And the following screenshot shows the settings for the backup of the CentOS box: - -![](https://farm8.staticflickr.com/7557/16139884666_34ff8fd858_z.jpg) - -### Starting a Backup ### - -To start each backup, go to each host's settings, and then click "Start Full Backup": - -![](https://farm8.staticflickr.com/7536/15978247428_458c023f4c.jpg) - -At any time, you can view the status of the process by clicking on the host's home as shown in the image above. If it fails for some reason, a link to a page with the error message(s) will appear in the host menu as well. When a backup completes successfully, a directory with the host's name or IP address is created under /var/lib/backuppc/pc in the server: - -![](https://farm8.staticflickr.com/7549/16165680115_196ee42a49_z.jpg) - -Feel free to browse those directories for the files from the command line, but there is an easier way to look for those files and restore them. - -### Restoring Backup ### - -To view the files that have been saved, go to "Browse backups" under each host's main menu. You can visualize the directories and files at a glance, and select those that you want to restore. Alternatively, you can click on files to open them with the default program, or right click and choose Save link as to download it to the machine where you're working at the time: - -![](https://farm8.staticflickr.com/7506/16165680105_bd5883e0da_c.jpg) - -If you want, you can download a zip or tar file containing the backup's contents: - -![](https://farm8.staticflickr.com/7507/15978247398_18e81667cd_z.jpg) - -or just restore the file(s): - -![](https://farm8.staticflickr.com/7545/15545911003_2aca8a36fc_z.jpg) - -### Conclusion ### - -There is a saying that goes, "the simpler, the better", and that is just what BackupPC has to offer. In BackupPC, you will not only find a backup tool but also a very versatile interface to manage your backups of several operating systems without needing any client-side application. I believe that's more than reason enough for you to give it at least a try. - -Feel free to leave your comments and questions, if you have any, using the form below. I am always happy to hear what readers have to say! - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/backuppc-cross-platform-backup-server-linux.html - -作者:[Gabriel Cánepa][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/gabriel -[1]:http://xmodulo.com/backup-debian-system-backupninja.html -[2]:http://xmodulo.com/linux-backup-manager.html -[3]:http://backuppc.sourceforge.net/ -[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[5]:http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html -[6]:http://xmodulo.com/recommend/linuxguide -[7]:http://xmodulo.com/how-to-enable-ssh-login-without.html \ No newline at end of file diff --git a/sources/tech/20150112 What are useful command-line network monitors on Linux.md b/sources/tech/20150112 What are useful command-line network monitors on Linux.md index f17e45cbf4..eeda3f0542 100644 --- a/sources/tech/20150112 What are useful command-line network monitors on Linux.md +++ b/sources/tech/20150112 What are useful command-line network monitors on Linux.md @@ -1,3 +1,4 @@ +translating by coloka What are useful command-line network monitors on Linux ================================================================================ Network monitoring is a critical IT function for businesses of all sizes. The goal of network monitoring can vary. For example, the monitoring activity can be part of long-term network provisioning, security protection, performance troubleshooting, network usage accounting, and so on. Depending on its goal, network monitoring is done in many different ways, such as performing packet-level sniffing, collecting flow-level statistics, actively injecting probes into the network, parsing server logs, etc. diff --git a/sources/tech/20150114 How to Configure Chroot Environment in Ubuntu 14.04.md b/sources/tech/20150114 How to Configure Chroot Environment in Ubuntu 14.04.md deleted file mode 100644 index 540789d367..0000000000 --- a/sources/tech/20150114 How to Configure Chroot Environment in Ubuntu 14.04.md +++ /dev/null @@ -1,147 +0,0 @@ -[bazz2222222] -How to Configure Chroot Environment in Ubuntu 14.04 -================================================================================ -There are many instances when you may wish to isolate certain applications, user, or environments within a Linux system. Different operating systems have different methods of achieving isolation, and in Linux, a classic way is through a `chroot` environment. - -In this guide, we'll show you step wise on how to setup an isolated environment using chroot in order to create a barrier between your regular operating system and a contained environment. This is mainly useful for testing purposes. We will teach you the steps on an **Ubuntu 14.04** VPS instance. - -Most system administrators will benefit from knowing how to accomplish a quick and easy chroot environment and it is a valuable skill to have. - -### The chroot environment ### - -A chroot environment is an operating system call that will change the root location temporarily to a new folder. Typically, the operating system's conception of the root directory is the actual root located at "/". However, with `chroot`, you can specify another directory to serve as the top-level directory for the duration of a chroot. - -Any applications that are run from within the `chroot` will be unable to see the rest of the operating system in principle. - -#### Advantages of Chroot Environment #### - -> - Test applications without the risk of compromising the entire host system. -> -> - From the security point of view, whatever happens in the chroot environment won't affect the host system (not even under root user). -> -> - A different operating system running in the same hardware. - -For instance, it allows you to build, install, and test software in an environment that is separated from your normal operating system. It could also be used as a method of **running 32-bit applications in a 64-bit environment**. - -But while chroot environments will certainly make additional work for an unprivileged user, they should be considered a hardening feature instead of a security feature, meaning that they attempt to reduce the number of attack vectors instead of creating a full solution. If you need full isolation, consider a more complete solution, such as Linux containers, Docker, vservers, etc. - -### Debootstrap and Schroot ### - -The necessary packages to setup the chroot environment are **debootstrap** and **schroot**, which are available in the ubuntu repository. The schroot command is used to setup the chroot environment. - -**Debootstrap** allows you to install a new fresh copy of any Debian (or debian-based) system from a repository in a directory with all the basic commands and binaries needed to run a basic instance of the operating system. - -The **schroot** allows access to chroots for normal users using the same mechanism, but with permissions checking and allowing additional automated setup of the chroot environment, such as mounting additional filesystems and other configuration tasks. - -These are the steps to implement this functionality in Ubuntu 14.04 LTS: - -### 1. Installing the Packages ### - -Firstly, We're gonna install debootstrap and schroot in our host Ubuntu 14.04 LTS. - - $ sudo apt-get install debootstrap - $ sudo apt-get install schroot - -### 2. Configuring Schroot ### - -Now that we have the appropriate tools, we just need to specify a directory that we want to use as our chroot environment. We will create a directory called linoxide in our root directory to setup chroot there: - - sudo mkdir /linoxide - -We have to configure schroot to suit our needs in the configuration file .we will modify the schroot configuration file with the information we require to get configured. - - sudo nano /etc/schroot/schroot.conf - -We are on an Ubuntu 14.04 LTS (Trusty Tahr) system currently, but let's say that we want to test out some packages available on Ubuntu 13.10, code named "Saucy Salamander". We can do that by creating an entry that looks like this: - - [saucy] - description=Ubuntu Saucy - location=/linoxide - priority=3 - users=arun - root-groups=root - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/schroot-config.png) - -Modify the values of the configuration parameters in the above example to fit your system: - -### 3. Installing 32 bit Ubuntu with debootstrap ### - -Debootstrap downloads and installs a minimal operating system inside your **chroot environment**. You can install any debian-based distro of your choice, as long as you have a repository available. - -Above, we placed the chroot environment under the directory **/linoxide** and this is the root directory of the chroot environment. So we'll need to run debootstrap inside that directory which we have already created: - - cd /linoxide - sudo debootstrap --variant=buildd --arch amd64 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/ - sudo chroot /linoxide /debootstrap/debootstrap --second-stage - -You can replace amd64 in --arch as i386 or other bit OS you wanna setup available in the repository. You can replace the mirror http://archive.ubuntu.com/ubuntu/ above as the one closest, you can get the closest one from the official [Ubuntu Mirror Page][1]. - -**Note: You will need to add --foreign above 3rd line command if you choose to setup i386 bit OS choot in your 64 bit Host Ubuntu as:** - - sudo debootstrap --variant=buildd --foreign --arch i386 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/ - -It takes some time (depending on your bandwidth) to download, install and configure the complete system. It takes about 500 MBs for a minimal installation. - -### 4. Finallizing the chroot environment ### - -After the system is installed, we'll need to do some final configurations to make sure the system functions correctly. First, we'll want to make sure our host `fstab` is aware of some pseudo-systems in our guest. - - sudo nano /etc/fstab - -Add the below lines like these to the bottom of your fstab: - - proc /linoxide/proc proc defaults 0 0 - sysfs /linoxide/sys sysfs defaults 0 0 - -Save and close the file. - -Now, we're going to need to mount these filesystems within our guest: - - $ sudo mount proc /linoxide/proc -t proc - $sudo mount sysfs /linoxide/sys -t sysfs - -We'll also want to copy our /etc/hosts file so that we will have access to the correct network information: - - $ sudo cp /etc/hosts /linoxide/etc/hosts - -Finally, You can list the available chroot environments using the schroot command. - - $ schroot -l - -We can enter the chroot environment through a command like this: - - $ sudo chroot /linoxide/ /bin/bash - -You can test the chroot environment by checking the version of distributions installed. - - # lsb_release -a - # uname -a - -To finish this tutorial, in order to run a graphic application from the chroot, you have to export the DISPLAY environment variable. - - $ DISPLAY=:0.0 ./apps - -Here, we have successfully installed Chrooted Ubuntu 13.10(Saucy Salamander) in your host Ubuntu 14.04 LTS (Trusty Tahr). - -You can exit chroot environment successfully by running the commands below: - - # exit - -Afterwards, we need to unmount our proc and sys filesystems: - - $ sudo umount /test/proc - $ sudo umount /test/sys - --------------------------------------------------------------------------------- - -via: http://linoxide.com/ubuntu-how-to/configure-chroot-environment-ubuntu-14-04/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://launchpad.net/ubuntu/+archivemirrors diff --git a/sources/tech/20150115 Get back your privacy and control.md b/sources/tech/20150115 Get back your privacy and control.md deleted file mode 100644 index 915e3b073e..0000000000 --- a/sources/tech/20150115 Get back your privacy and control.md +++ /dev/null @@ -1,1114 +0,0 @@ -zpl1025 -Get back your privacy and control over your data in just a few hours: build your own cloud for you and your friends -================================================================================ -40'000+ searches over 8 years! That's my Google Search history. How about yours? (you can find out for yourself [here][1]) With so many data points across such a long time, Google has a very precise idea of what you've been interested in, what's been on your mind, what you are worried about, and how that all changed over the years since you first got that Google account. - -### Some of the most personal pieces of your identity are stored on servers around the world beyond your control ### - -Let's say you've been a Gmail user between 2006 and 2013 like me, meaning you received 30'000+ emails and wrote about 5000 emails over that 7 year period. Some of the emails you sent or received are very personal, maybe so personal that you probably wouldn't like even some family members or close friends to go through them systematically. Maybe you also drafted a few emails that you never sent because you changed your mind at the last minute. But even if you never sent them, these emails are still stored somewhere on a server. As a result, it's fair to say that Google servers know more about your personal life than your closest friends or your family. - -Statistically, it's a safe bet to consider that you've got a smartphone. You can barely use the phone without using the contacts app which stores your contacts in Google Contact on Google servers by default. So not only does Google know about your emails, but also about your offline contacts: who you like to call, who calls you, whom you text, and what you text them about. You don't have to take my word for it, you can verify for yourself by taking a look at the permissions you gave apps such as the Google Play Service to read the list of people that called you and the SMS you got. Do you also use the calendar app that comes with your phone? Unless you explicitly opted out while setting up your calendar, this means that Google knows precisely what you're up to, at every time of the day, day after day, year after year. The same applies if you chose an iPhone over an Android phone, except Apple gets to know about your correspondance, contacts and schedule instead of Google. - -Do you also take great care to keep the contacts in your directory up-to-date, updating your friend's, colleagues's and and family's email addresses and phone numbers when they move to a new job or change carrier? That gives Google an extraordinarily accurate, up-to-date picture of your social network. And you love the GPS of your smartphone which you use a lot together with Google Maps. This means Google not only knows what you do from your calendar but also where you are, where you live, where you work. And by correlating GPS location data across users, Google can also tell with whom you may socializing with right now. - -### Your daily habit of handing out your most personal information will impact your life in a way that no one can even forsee ### - -To summarize, if you are an average internet user, Google has up-to-date, in-depth information about your interests, worries, passions, questions, over almost 10 years. It has a collection of some of your most personal messages (emails, SMS), an hour-by-hour detail of your daily activities and location, and a high-quality picture of your social network. Such an intimate knowledge of you likely goes beyond what your closest friends, family, or your sweetheart know of you. - -It wouldn't come to mind to give this mass of deeply personal information to complete strangers, for instance by putting it all on a USB key and leaving it on a table in a random cafe with a note saying 'Personal data of Olivier Martin, use as you please'. Who knows who might find it and what they would do with it? Yet, we have no problem handing in core pieces of your identity to strangers at IT companies with a strong interest in our data (that's how they make their bread) and [world-class experts in data analysis][2], perhaps just because it happens by default without us thinking about it when we hit that green 'Accept' button. - -With so much high-quality information, over the years, Google may well get to know you better than you can ever hope to know yourself: heck, crawling through my digital past right now, I can't remember having written half of the emails I sent five years ago. I am surprised and pleased to rediscover my interest in marxism back in 2005 and my joining [ATTAC][3] (an organization which strives to limit speculation and improve social justice by taxing financial transactions) the next year. And god knows why I was so much into dancing shoes back in 2007. These is pretty harmless information (you wouldn't have expected me to reveal something embarassing here, would you? ;-). But by connecting the dots between high-quality data over different aspects of your life (what, when, with whom, where, ...) over such time spans, one may extrapolate predictive statements about you. For instance, from the shopping habits of a 17-year-old girl, supermarkets can tell that she is pregnant before her dad even hears about it ([true story][4]). Who knows what will become possible with high-quality data the like Google has, which goes well beyond shopping habits? By connecting the dots, maybe one can predict how your tastes or political views will change in the coming years. Today, [companies you have never heard of claim to have 500 data points about you][5], including religion, sexual orientation and political views. Speaking of politics, what if you decide to go into politics in 10 years from now? Your life may change, your views too, and you may even forget, but Google won't. Will you have to worry that your opponent is in touch with someone who has access to your data at Google and can dig up something embarassing on you from those bottomless wells of personal data you gave away over the years? How long until Google or Facebook get hacked [just like Sony was recently hacked][6] and all your personal data end up in the public sphere forever? - -One of the reason most of us have entrusted our personal data to these companies is that they provide their services for free. But how free is it really? The value of the average Google account varies depending on the method used to estimate it: [1000 USD/year][7] accounts for the amount of time you invest in writing emails, while the value of your account for the advertisement industry is somewhere between [220 USD/year][8] and [500 USD/year][9]. So the service is not exactly free: you pay for it through advertisement and the yet unknown uses that our data may find in the future. - -I've been writing about Google mostly because that's the company I've entrusted most of my digital identify to so far and hence the one I know best. But I may well have written Apple or Facebook. These companies truly changed the world with their fantastic advances in design, engineering and services we love(d) to use, every day. But it doesn't mean we should stack up all our most personal data in their servers and entrust them with our digital lives: the potential for harm is just too large. - -### Claim back your privacy and that of people you care for in just 5h ### - -It does not have to be this way. You can live in the 21st century, have a smartphone, use email and GPS on daily basis, and still retain your privacy. All you need to do is get back control over your personal data: emails, calendar, contacts, files, etc.. The [Prism-Break.org][10] website lists software that help controlling the fate of your personal data. Beyond these options, the safest and most powerful way to get back control over your personal data is to host your cloud yourself, by building your own server. But you may just not have the time and energy to research how exactly to do that and make it work smoothly. - -That's where the present article fits in. In just 5 hours, we will set up a server to host your emails, contacts, calendars and files for you, your friends and your family. The server is designed to act as a hub or cloud for your personal data, so that you always retain full control over it. The data will automatically be synchronized between your PC/laptop, your phone and your tablet. Essentially, **we will set up a system that replaces Gmail, Google Drive / Dropbox, Google Contacts, Google Calendar and Picasa**. - -Just doing this for yourself will already be a big step. But then, a significant fraction of your personal information will still leak out and end up on some servers in the silicon valley, just because so many of the people you interact with every day use Gmail and have smartphones. So it's a good idea to have some of the people you are closest to join the adventure. - -We will build a system that - -- **supports an arbitrary number of domains and users**. This makes it easy to share your server with family and friends, so that they get control over their personal data too and can share the cost of the server with you. The people sharing your server can use their own domain name or share yours. -- **lets you send and receive your emails from any network** upon successfully logging in onto the server. This way, you can send your emails from any of your email addresses, from any device (PC, phone, tablet), and any network (at home, at work, from a public network, ...) -- **encrypts network traffic** when sending and receiving emails so people you don't trust won't fish out your password and won't be able to read your private emails. -- **offers state-of-the-art antispam**, combining black lists of known spammers, automatic greylisting, and adaptative spam filtering. Re-training the adaptative spam filter if an email is misclassified is simply done by moving spam in or out of the Junk/Spam folder. Also, the server will contribute to community-based spam fighting efforts. -- **requires just a few minutes of maintenance once in a while**, basically to install security updates and briefly check the server logs. Adding a new email address boils down to adding one record to a database. Apart from that, you can just forget about it and live your life. I set up the system described in this article 14 months ago and the thing has just been running smoothly since then. So I completely forgot about it, until I recently smiled at the thought that casually pressing the 'Check email' button of my phone caused electrons to travel all the way to Iceland (where my server sits) and back. - -To go through this article, you'll need a minimum of technical capabilities. If you know what is the difference between SMTP and IMAP, what is a DNS, and have a basic understanding of TCP/IP, you know enough to follow through. You will also need a basic working knowledge of Unix (working with files from the command line, basic system administration). And you'll need a total of 5 hours of time to set it up. - -Here's an overview what we will do: - -- [Get a Virtual Private Server, a domain name, and set them up][11] -- [Set up postfix and dovecot to send and receive email][12] -- [Prevent SPAM from reaching your INBOX][13] -- [Make sure the emails you send get through spam filters][14] -- [Host calendars, contacts, files with Owncloud and set up webmail][15] -- [Sync your devices to the cloud][16] - -### This article was inspired by and builds upon previous work ### - -This article draws heavily from two other articles, namely [Xavier Claude][17]'s and [Drew Crawford][18]'s introduction to email self-hosting. - -The article includes all the features of Xavier's and Draw's articles, except from three features that Drew had and which I didn't need, namely push support for email (I like to check email only when I decide to, otherwise I get distracted all the time), fulltext search in email (which I don't have a use for), and storing emails in an encrypted form (my emails and data are not critical to the point that I have to encrypt them locally on the server). If you need any of these features, feel free to just add them by following to the respective section of Drew's article, which is compatible with the present one. - -Compared to Xavier's and Drew's work, the present article improves on several aspects: - -- it fixes bugs and typos based on my experience with Drew's article and the numerous comments on his original article. I also went through the present article, setting up the server from scratch several times to replicate it and make sure it would work right out of the box. -- low maintenance: compared to Xavier's work, the present article adds support for multiple email domains on the server. It does so by requiring the minimum amount of server maintenance possible: basically, to add a domain or a user, just add one row to a mysql table and that's it (no need to add sieve scripts, ...). -- I added webmail. -- I added a section on setting up a cloud, to host not just your emails but also your files, your addressbook / contacts (emails, phone numbers, birthdays, ...), calendars and pictures for use across your devices. - -### Get a Virtual Private Server, a domain name, and set them up ### - -Let's start by setting the basic infrastructure: our virtual private server and our domain name. - -I've had an excellent experience with the Virtual Private Servers (VPS) of [1984.is][19] and [Linode][20]. In this article, we will use **Debian Wheezy**, for which both 1984 and Linode provide ready-made images to deploy on your VPS. I like 1984 because the servers are hosted in Iceland which run exclusively on renewable energy (geothermical and hydropower) and hence does not contribute to the climate change, unlike [the coal power plants on which most US-based datacenters currently run on][21]. Also, they put emphasis on [civil liberties, transparency, freedom][22] and [Free Software][23]. - -It could be a good idea to start a file to store the various passwords we will need to set on the server (user accounts, mail accounts, cloud accounts, database accounts). It's definitely a good idea to encrypt this file (maybe with [GnuPG][24]), so that it won't be too easy to attack your server even if the computer you use to set up your server gets stolen or compromised. - -For registering a domain name, I've been using the services of [gandi][25] for over 10 years now, also with satisfaction. For this article, we will set up a zone with the name **jhausse.net**. We then add a host named **cloud.jhausse.net** to it, set the MX record to that host. While you're at it, set short Time To Lives (TTL) to your records like 300 seconds so that you'll be able to make changes to your zone and test the result rapidly while you're setting up the server. - -Finally, set the PTR record (reverse DNS) so that the IP address of the host maps back to its name. If you don't understand the previous sentence, read [this article][26] to get the background. If you use Linode, you can set the PTR record in the control panel in the Remote Access section. With 1984, contact the tech support who will help you with it. - -On the server, we will start by adding a non-privledged user, so that we don't end up working as root all the time. Also, to log in as root will require an extra layer of security. - - adduser roudy - -Then, in **/etc/ssh/sshd_config**, we set - - PermitRootLogin no - -and reload the ssh server - - service ssh reload - -Then, we'll need to change the hostname of the server. Edit **/etc/hostname** so that it has just a single line with your hostname, in our case - - cloud - -Then, edit the ssh server's public key files **/etc/ssh/ssh_host_rsa_key.pub, /etc/ssh/ssh_host_dsa_key.pub, /etc/ssh/ssh_host_ecdsa_key.pub** so that the end of the file reflects your hostname, or instance **root@cloud**. Then restart the system to make sure the hostname is fixed wherever is should be - - reboot - -We will update the system and remove services we don't need to reduce the risk of remote attacks. - - apt-get update - apt-get dist-upgrade - service exim4 stop - apt-get remove exim4 rpcbind - apt-get autoremove - apt-get install vim - -I like to use vim for editing config files remotely. For this, it helps to automatically turn on syntax highlighting. We do so by adding - - syn on - -to **~/.vimrc**. - -### Set up postfix and dovecot to send and receive email ### - - apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-mysql mysql-server dovecot-lmtpd postgrey - -In the [Postfix][27] configuration menu, we select **Internet Site**, and set the system mail name to **jhausse.net**. - -We will now set up a database to store the list of domains hosted on our server, the list of users for each of these domains (together with their password), and a list of mail aliases (to forward email from a given address to another one). - - mysqladmin -p create mailserver - mysql -p mailserver - mysql> GRANT SELECT ON mailserver.* TO 'mailuser'@'localhost' IDENTIFIED BY 'mailuserpass'; - mysql> FLUSH PRIVILEGES; - mysql> CREATE TABLE `virtual_domains` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - mysql> CREATE TABLE `virtual_users` ( - `id` int(11) NOT NULL auto_increment, - `domain_id` int(11) NOT NULL, - `password` varchar(106) NOT NULL, - `email` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `email` (`email`), - FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - mysql> CREATE TABLE `virtual_aliases` ( - `id` int(11) NOT NULL auto_increment, - `domain_id` int(11) NOT NULL, - `source` varchar(100) NOT NULL, - `destination` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -We will host the **jhausse.net** domain. If there are other domains you'd like to host, you can also add them. We also set up a postmaster address for each domain, which forwards to **roudy@jhausse.net**. - - mysql> INSERT INTO virtual_domains (`name`) VALUES ('jhausse.net'); - mysql> INSERT INTO virtual_domains (`name`) VALUES ('otherdomain.net'); - mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('1', 'postmaster', 'roudy@jhausse.net'); - mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('2', 'postmaster', 'roudy@jhausse.net'); - -We now add a locally hosted email account **roudy@jhausse.net**. First, we generate a password hash for it: - - doveadm pw -s SHA512-CRYPT - -and then add the hash to the database - - mysql> INSERT INTO `mailserver`.`virtual_users` (`domain_id`, `password`, `email`) VALUES ('1', '$6$YOURPASSWORDHASH', 'roudy@jhausse.net'); - -Now that our list of domains, aliases and users are in place, we will set up postfix (SMTP server, for outgoing mail). Replace the contents of **/etc/postfix/main.cf** with the following: - - myhostname = cloud.jhausse.net - myorigin = /etc/mailname - mydestination = localhost.localdomain, localhost - mynetworks_style = host - - # We disable relaying in the general case - smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination - # Requirements on servers that contact us: we verify the client is not a - # known spammer (reject_rbl_client) and use a graylist mechanism - # (postgrey) to help reducing spam (check_policy_service) - smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, check_policy_service inet:127.0.0.1:10023 - disable_vrfy_command = yes - inet_interfaces = all - smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) - biff = no - append_dot_mydomain = no - readme_directory = no - - # TLS parameters - smtpd_tls_cert_file=/etc/ssl/certs/cloud.crt - smtpd_tls_key_file=/etc/ssl/private/cloud.key - smtpd_use_tls=yes - smtpd_tls_auth_only = yes - smtp_tls_security_level=may - smtp_tls_loglevel = 1 - smtpd_tls_loglevel = 1 - smtpd_tls_received_header = yes - smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache - smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache - - # Delivery - alias_maps = hash:/etc/aliases - alias_database = hash:/etc/aliases - message_size_limit = 50000000 - recipient_delimiter = + - - # The next lines are useful to set up a backup MX for myfriendsdomain.org - # relay_domains = myfriendsdomain.org - # relay_recipient_maps = - - # Virtual domains - virtual_transport = lmtp:unix:private/dovecot-lmtp - virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf - virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf - virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf - local_recipient_maps = $virtual_mailbox_maps - -Now we need to teach postfix to figure out which domains we would like him to accept emails for using the database we just set up. Create a new file **/etc/postfix/mysql-virtual-mailbox-domains.cf** and add the following: - - user = mailuser - password = mailuserpass - hosts = 127.0.0.1 - dbname = mailserver - query = SELECT 1 FROM virtual_domains WHERE name='%s' - -We teach postfix to find out whether a given email account exists by creating **/etc/postfix/mysql-virtual-mailbox-maps.cf** with the following content - - user = mailuser - password = mailuserpass - hosts = 127.0.0.1 - dbname = mailserver - query = SELECT 1 FROM virtual_users WHERE email='%s' - -Finally, postfix will use **/etc/postfix/mysql-virtual-alias-maps.cf** to look up mail aliases - - user = mailuser - password = mailuserpass - hosts = 127.0.0.1 - dbname = mailserver - query = SELECT virtual_aliases.destination as destination FROM virtual_aliases, virtual_domains WHERE virtual_aliases.source='%u' AND virtual_aliases.domain_id = virtual_domains.id AND virtual_domains.name='%d' - -With all this in place, it is now time to test if postfix can query our database properly. We can do this using **postmap**: - - postmap -q jhausse.net mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf - postmap -q roudy@jhausse.net mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf - postmap -q postmaster@jhausse.net mysql:/etc/postfix/mysql-virtual-alias-maps.cf - postmap -q bob@jhausse.net mysql:/etc/postfix/mysql-virtual-alias-maps.cf - -If you set up everything properly, the first two queries should return 1, the third query should return **roudy@jhausse.net** and the last one should return nothing at all. - -Now, let's set up dovecot (the IMAP server, to fetch incoming mail on the server from our devices). Edit **/etc/dovecot/dovecot.conf** to set the following parameters: - - # Enable installed protocol - # !include_try /usr/share/dovecot/protocols.d/*.protocol - protocols = imap lmtp - -which will only enable imap (to let us fetch emails) and lmtp (which postfix will use to pass incoming emails to dovecot). Edit **/etc/dovecot/conf.d/10-mail.conf** to set the following parameters: - - mail_location = maildir:/var/mail/%d/%n - [...] - mail_privileged_group = mail - [...] - first_valid_uid = 0 - -which will store emails in /var/mail/domainname/username. Note that these settings are spread at different locations in the file, and are sometimes already there for us to set: we just need to comment them out. The other settings which are already in the file, you can leave as is. We will have to do the same to update settings in many more files in the remaining of this article. In **/etc/dovecot/conf.d/10-auth.conf**, set the parameters: - - disable_plaintext_auth = yes - auth_mechanisms = plain - #!include auth-system.conf.ext - !include auth-sql.conf.ext - -In **/etc/dovecot/conf.d/auth-sql.conf.ext**, set the following parameters: - - passdb { - driver = sql - args = /etc/dovecot/dovecot-sql.conf.ext - } - userdb { - driver = static - args = uid=mail gid=mail home=/var/mail/%d/%n - } - -where we just taught dovecot that users have their emails in /var/mail/domainname/username and to look up passwords from the database we just created. Now we still need to teach dovecot how exactly to use the database. To do so, put the following into **/etc/dovecot/dovecot-sql.conf.ext**: - - driver = mysql - connect = host=localhost dbname=mailserver user=mailuser password=mailuserpass - default_pass_scheme = SHA512-CRYPT - password_query = SELECT email as user, password FROM virtual_users WHERE email='%u'; - -We now fix permissions on config files - - chown -R mail:dovecot /etc/dovecot - chmod -R o-rwx /etc/dovecot - -Almost there! We just need to edit a couple files more. In **/etc/dovecot/conf.d/10-master.conf**, set the following parameters: - - service imap-login { - inet_listener imap { - #port = 143 - port = 0 - } - inet_listener imaps { - port = 993 - ssl = yes - } - } - - service pop3-login { - inet_listener pop3 { - #port = 110 - port = 0 - } - inet_listener pop3s { - #port = 995 - #ssl = yes - port = 0 - } - } - - service lmtp { - unix_listener /var/spool/postfix/private/dovecot-lmtp { - mode = 0666 - group = postfix - user = postfix - } - user = mail - } - - service auth { - unix_listener auth-userdb { - mode = 0600 - user = mail - #group = - } - - # Postfix smtp-auth - unix_listener /var/spool/postfix/private/auth { - mode = 0666 - user = postfix - group = postfix - } - - # Auth process is run as this user. - #user = $default_internal_user - user = dovecot - } - - service auth-worker { - user = mail - } - -Note that we set ports for all services but imaps to 0, which effectively disables them. Then, in **/etc/dovecot/conf.d/15-lda.conf**, specify an email address for the postmaster: - - postmaster_address = postmaster@jhausse.net - -Last but not least, we need to generate a pair of public and private key for the server, which we will use both in dovecot and postfix: - - openssl req -new -newkey rsa:4096 -x509 -days 365 -nodes -out "/etc/ssl/certs/cloud.crt" -keyout "/etc/ssl/private/cloud.key" - -Make sure that you specify your the Fully Qualified Domain Name (FQDN) of the server, in our case: - - Common Name (e.g. server FQDN or YOUR name) []:cloud.jhausse.net - -If you don't, our clients may complain that the server name in the SSL certificate does not match the name of the server they are connecting to. We tell dovecot to use these keys by setting the following parameters in **/etc/dovecot/conf.d/10-ssl.conf**: - - ssl = required - ssl_cert = : Relay access denied - -That's good: had the server accepted the mail, it would have meant that we set up postfix as an open relay for all the spammers of the world and beyhond to use. Instead of the 'Relay access denied' message, you may instead get the message - - 554 5.7.1 Service unavailable; Client host [87.68.61.119] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=87.68.61.119 - -This means that you are trying to contact the server from an IP address that is considered as a spammer's address. I got this message while trying to connect to the server through my regular Internet Service Provider (ISP). To fix this issue, you can try to connect from another host, maybe another server you have access to through SSH. Alternatively, you can reconfigure Postfix's **main.cf** not to use Spamhaus's RBL, reload postfix, and verify that the above test works. In both cases, it's important that you find a solution that works for you because we'll test other things in a minute. If you chose to reconfigure Postfix not to use RBLs, don't forget to put the RBLs back in and to reload postfix after finishing the article to avoid getting more spam than necessary. - -Now let's try to send a valid email by SMTP on port 25, which regular mail servers use to talk to each other: - - openssl s_client -connect cloud.jhausse.net:25 -starttls smtp - EHLO cloud.jhausse.net - MAIL FROM:youremail@domain.com - rcpt to:roudy@jhausse.net - -to which the server should respond - - Client host rejected: Greylisted, see http://postgrey.schweikert.ch/help/jhausse.net.html - -which shows that [postgrey][28] is working as it should. What postgrey does it to reject emails with a temporary error if the sender has never been seen before. The technical rules of email require email servers to try to deliver the email again. After five minutes, postgrey will accept the email. Legit email servers around the world will try repeatidly to redeliver the email to us, but most spammers won't. So, wait for 5 minutes, try to send the email again using the command above, and verify that postfix now accepts the email. - -Afterwards, we'll check that we can fetch the two emails that we just sent ourselves by talking IMAP to dovecot: - - openssl s_client -crlf -connect cloud.jhausse.net:993 - 1 login roudy@jhausse.net "mypassword" - 2 LIST "" "*" - 3 SELECT INBOX - 4 UID fetch 1:1 (UID RFC822.SIZE FLAGS BODY.PEEK[]) - 5 LOGOUT - -where you should replace mypassword with the password you set for this email account. If that works, we basically have a functional email server which can receive our incoming emails, and from which we get retreive these emails from our devices (PC/laptop, tablets, phones, ...). But we can't give it our emails to send unless we send them from the server itself. We'll now allow postfix to forward our emails, but only upon successful authentification, that is after it could make sure that the email comes from someone who has a valid account on the server. To do so, we'll open a special, SSL-only, SASL-authentified email submission service. Set the following parameters in **/etc/postfix/master.cf**: - - submission inet n - - - - smtpd - -o syslog_name=postfix/submission - -o smtpd_tls_security_level=encrypt - -o smtpd_sasl_auth_enable=yes - -o smtpd_client_restrictions=permit_sasl_authenticated,reject - -o smtpd_sasl_type=dovecot - -o smtpd_sasl_path=private/auth - -o smtpd_sasl_security_options=noanonymous - -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject_non_fqdn_recipient,reject_unauth_destination - -and reload postfix - - service postfix reload - -Now, let's try to use this service from a different machine than than the server, to verify postfix will now relay our emails and nobody else's: - - openssl s_client -connect cloud.jhausse.net:587 -starttls smtp - EHLO cloud.jhausse.net - -Notice the '250-AUTH PLAIN' capabilities advertized by server, which doesn't appear when we connect to port 25. - - MAIL FROM:asdf@jkl.net - rcpt to:bob@gmail.com - 554 5.7.1 : Relay access denied - QUIT - -That's good, postfix won't relay our emails if he doesn't know us. So let's authentify ourselves first. To do so, we first need to generate an authentification string: - - echo -ne '\000roudy@jhausse.net\000mypassword'|base64 - -and let's try to send emails through the server again: - - openssl s_client -connect cloud.jhausse.net:587 -starttls smtp - EHLO cloud.jhausse.net - AUTH PLAIN DGplYW5AMTk4NGNsb3VQLm5ldAA4bmFmNGNvNG5jOA== - MAIL FROM:asdf@jkl.net - rcpt to:bob@gmail.com - -which postfix should now accept. To complete the test, let's verify that our virtual aliases work by sending an email to postmaster@jhausse.net and making sure it goes to roudy@jhausse.net: - - telnet cloud.jhausse.net 25 - EHLO cloud.jhausse.net - MAIL FROM:youremail@domain.com - rcpt to:postmaster@jhausse.net - data - Subject: Virtual alias test - - Dear postmaster, - Long time no hear! I hope your MX is working smoothly and securely. - Yours sincerely, Roudy - . - QUIT - -Let's check the mail made it all the way to the right inbox: - - openssl s_client -crlf -connect cloud.jhausse.net:993 - 1 login roudy@jhausse.net "mypassword" - 2 LIST "" "*" - 3 SELECT INBOX - * 2 EXISTS - * 2 RECENT - 4 LOGOUT - -At this point, we have a functional email server, both for incoming and outgoing mails. We can set up our devices to use it. - -PS: did you remember to [try sending an email to an account hosted by the server through port 25][29] again, to verify that you are not longer blocked by postgrey? - -### Prevent SPAM from reaching your INBOX ### - -For the sake of SPAM filtering, we already have Realtime BlackLists (RBLs) and greylisting (postgrey) in place. We'll now take our spam fighting capabilities up a notch by adding adaptative spam filtering. This means we'll add artificial intelligence to our email server, so that it can learn from experience what is spam and what is not. We will use [dspam][30] for that. - - apt-get install dspam dovecot-antispam postfix-pcre dovecot-sieve - -dovecot-antispam is a package that allows dovecot to retrain the spam filter if we find an email that is misclassified by dspam. Basically, all we need to do is to move emails in or out of the Junk/Spam folder. dovecot-antispam will then take care of calling dspam to retrain the filter. As for postfix-pcre and dovecot-sieve, we will use them respectively to pass incoming emails through the spam filter and to automatically move spam to the user's Junk/Spam folder. - -In **/etc/dspam/dspam.conf**, set the following parameters to these values: - - TrustedDeliveryAgent "/usr/sbin/sendmail" - UntrustedDeliveryAgent "/usr/lib/dovecot/deliver -d %u" - Tokenizer osb - IgnoreHeader X-Spam-Status - IgnoreHeader X-Spam-Scanned - IgnoreHeader X-Virus-Scanner-Result - IgnoreHeader X-Virus-Scanned - IgnoreHeader X-DKIM - IgnoreHeader DKIM-Signature - IgnoreHeader DomainKey-Signature - IgnoreHeader X-Google-Dkim-Signature - ParseToHeaders on - ChangeModeOnParse off - ChangeUserOnParse full - ServerPID /var/run/dspam/dspam.pid - ServerDomainSocketPath "/var/run/dspam/dspam.sock" - ClientHost /var/run/dspam/dspam.sock - -Then, in **/etc/dspam/default.prefs**, change the following parameters to: - - spamAction=deliver # { quarantine | tag | deliver } -> default:quarantine - signatureLocation=headers # { message | headers } -> default:message - showFactors=on - -Now we need to connect dspam to postfix and dovecot by adding these two lines at the end of **/etc/postfix/master.cf**: - - dspam unix - n n - 10 pipe - flags=Ru user=dspam argv=/usr/bin/dspam --deliver=innocent,spam --user $recipient -i -f $sender -- $recipient - dovecot unix - n n - - pipe - flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} - -Now we will tell postfix to filter every new email that gets submitted to the server on port 25 (normal SMTP traffic) through dspam, except if the email is submitted from the server itself (permit_mynetworks). Note that the emails we submit to postfix with SASL authentication won't be filtered through dspam either, as we set up a separate submission service for those in the previous section. Edit **/etc/postfix/main.cf** to change the **smtpd_client_restrictions** to the following: - - smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, check_policy_service inet:127.0.0.1:10023, check_client_access pcre:/etc/postfix/dspam_filter_access - -At the end of the file, also also add: - - # For DSPAM, only scan one mail at a time - dspam_destination_recipient_limit = 1 - -We now need to specify the filter we defined. Basically, we will tell postfix to send all emails (/./) to dspam through a unix socket. Create a new file **/etc/postfix/dspam_filter_access** and put the following line into it: - - /./ FILTER dspam:unix:/run/dspam/dspam.sock - -That's it for the postfix part. Now let's set up dovecot for spam filtering. In **/etc/dovecot/conf.d/20-imap.conf**, edit the **imap mail_plugins** plugins parameter such that: - - mail_plugins = $mail_plugins antispam - -and add a section for lmtp: - - protocol lmtp { - # Space separated list of plugins to load (default is global mail_plugins). - mail_plugins = $mail_plugins sieve - } - -We now configure the dovecot-antispam plugin. Edit **/etc/dovecot/conf.d/90-plugin.conf** to add the following content to the plugin section: - - plugin { - ... - # Antispam (DSPAM) - antispam_backend = dspam - antispam_allow_append_to_spam = YES - antispam_spam = Junk;Spam - antispam_trash = Trash;trash - antispam_signature = X-DSPAM-Signature - antispam_signature_missing = error - antispam_dspam_binary = /usr/bin/dspam - antispam_dspam_args = --user;%u;--deliver=;--source=error - antispam_dspam_spam = --class=spam - antispam_dspam_notspam = --class=innocent - antispam_dspam_result_header = X-DSPAM-Result - } - -and in **/etc/dovecot/conf.d/90-sieve.conf**, specify a default sieve script which will apply to all users of the server: - - sieve_default = /etc/dovecot/default.sieve - -What is sieve and why do we need a default script for all users? Sieve lets us automatize tasks on the IMAP server. In our case, we won't all emails identified as spam to be put in the Junk folder instead of in the Inbox. We would like this to be the default behavior for all users on the server; that's why we just set this script as default script. Let's create this script now, by creating a new file **/etc/dovecot/default.sieve** with the following content: - - require ["regex", "fileinto", "imap4flags"]; - # Catch mail tagged as Spam, except Spam retrained and delivered to the mailbox - if allof (header :regex "X-DSPAM-Result" "^(Spam|Virus|Bl[ao]cklisted)$", - not header :contains "X-DSPAM-Reclassified" "Innocent") { - # Mark as read - # setflag "\\Seen"; - # Move into the Junk folder - fileinto "Junk"; - # Stop processing here - stop; - } - -Now we need to compile this script so that dovecot can run it. We also need to give it appropriate permissions. - - cd /etc/dovecot - sievec . - chown mail.dovecot default.siev* - chmod 0640 default.sieve - chmod 0750 default.svbin - -Finally, we need to fix permissions on two postfix config files that dspam needs to read from: - - chmod 0644 /etc/postfix/dynamicmaps.cf /etc/postfix/main.cf - -That's it! Let's restart dovecot and postfix - - service dovecot restart - service postfix restart - -and test the antispam, by contacting the server from a remote host (e.g. the computer we are using to set the server): - - openssl s_client -connect cloud.jhausse.net:25 -starttls smtp - EHLO cloud.jhausse.net - MAIL FROM:youremail@domain.com - rcpt to:roudy@jhausse.net - DATA - Subject: DSPAM test - - Hi Roudy, how'd you like to eat some ham tonight? Yours, J - . - QUIT - -Let's check if the mail arrived: - - openssl s_client -crlf -connect cloud.jhausse.net:993 - 1 login roudy@jhausse.net "mypassword" - 2 LIST "" "*" - 3 SELECT INBOX - 4 UID fetch 3:3 (UID RFC822.SIZE FLAGS BODY.PEEK[]) - -Which should return something the email with a collection of flag set by SPAM which look like this: - - X-DSPAM-Result: Innocent - X-DSPAM-Processed: Sun Oct 5 16:25:48 2014 - X-DSPAM-Confidence: 1.0000 - X-DSPAM-Probability: 0.0023 - X-DSPAM-Signature: 5431710c178911166011737 - X-DSPAM-Factors: 27, - Received*Postfix+with, 0.40000, - Received*with+#+id, 0.40000, - like+#+#+#+ham, 0.40000, - some+#+tonight, 0.40000, - Received*certificate+requested, 0.40000, - Received*client+certificate, 0.40000, - Received*for+roudy, 0.40000, - Received*Sun+#+#+#+16, 0.40000, - Received*Sun+#+Oct, 0.40000, - Received*roudy+#+#+#+Oct, 0.40000, - eat+some, 0.40000, - Received*5+#+#+16, 0.40000, - Received*cloud.jhausse.net+#+#+#+id, 0.40000, - Roudy+#+#+#+to, 0.40000, - Received*Oct+#+16, 0.40000, - to+#+#+ham, 0.40000, - Received*No+#+#+requested, 0.40000, - Received*jhausse.net+#+#+Oct, 0.40000, - Received*256+256, 0.40000, - like+#+#+some, 0.40000, - Received*ESMTPS+id, 0.40000, - how'd+#+#+to, 0.40000, - tonight+Yours, 0.40000, - Received*with+cipher, 0.40000 - 5 LOGOUT - -Good! You now have adaptive spam filtering set up for the users of your server. Of course, each user will need to train the filter in the first few weeks. To train a message as spam, just move it to a folder called "Spam" or "Junk" using any of your devices (PC, tablet, phone). Otherwise it'll be trained as ham. - -### Make sure the emails you send get through spam filters ### - -Our goal in this section will be to make our mail server appear as clean as possible to the world and to make it harder for spammers to send emails in our name. As a side-effect, this will help us get our emails through the spam filters of other mail servers. - -#### Sender Policy Framework #### - -Sender Policy Framework (SPF) is a record that your add to your zone which declares which mail servers on the whole internet can send emails for your domain name. Setting it up is very easy, use the SPF wizard at [microsoft.com][31] to generate your SPF record, and then add it to your zone as a TXT record. It will look like this: - - jhausse.net. 300 IN TXT v=spf1 mx mx:cloud.jhausse.net -all - -#### Reverse PTR #### - -We discussed this point [earlier][32] in this article, it's a good idea that you set up the reverse DNS for your server correctly, so that doing a reverse lookup on the IP address of your server returns the actual name of your server. - -#### OpenDKIM #### - -When we activate [OpenDKIM][33], postfix will sign every outgoing email using a cryptographic key. We will then deposit that key in our zone, on the DNS. That way, every mail server in the world will be able to verify if the email actually came from us, or if it was forged by a spammer. Let's install opendkim: - - apt-get install opendkim opendkim-tools - -And set it up by editing **/etc/opendkim.conf** so that it looks like this: - - ## - ## opendkim.conf -- configuration file for OpenDKIM filter - ## - Canonicalization relaxed/relaxed - ExternalIgnoreList refile:/etc/opendkim/TrustedHosts - InternalHosts refile:/etc/opendkim/TrustedHosts - KeyTable refile:/etc/opendkim/KeyTable - LogWhy Yes - MinimumKeyBits 1024 - Mode sv - PidFile /var/run/opendkim/opendkim.pid - SigningTable refile:/etc/opendkim/SigningTable - Socket inet:8891@localhost - Syslog Yes - SyslogSuccess Yes - TemporaryDirectory /var/tmp - UMask 022 - UserID opendkim:opendkim - -We'll need a couple of additional files which we will store in **/etc/opendkim**: - - mkdir -pv /etc/opendkim/ - cd /etc/opendkim/ - -Let's create a new file **/etc/opendkim/TrustedHosts** with the following content - - 127.0.0.1 - -and a new file called **/etc/opendkim/KeyTable** with the following content - - cloudkey jhausse.net:mail:/etc/opendkim/mail.private - -This tells OpenDKIM that we want to use an encryption key named 'cloudkey' whose contents can be found in /etc/opendkim/mail.private. We will create another file named **/etc/opendkim/SigningTable** and add the following line: - - *@jhausse.net cloudkey - -which tells OpenDKIM that every emails of the jhausse.net domain should be signed using the key 'cloudkey'. If we have other domains which we want to sign, we can add them here too. - -The next step is to generate that key and fix permissions on OpenDKIM's config files. - - opendkim-genkey -r -s mail [-t] - chown -Rv opendkim:opendkim /etc/opendkim - chmod 0600 /etc/opendkim/* - chmod 0700 /etc/opendkim - -At first, it's a good idea to use the -t which will signal to other mail servers that you are just in testing mode, and that they shouldn't discard emails based on your OpenDKIM signature (yet). You can get your OpenDKIM key from the mail.txt file: - - cat mail.txt - -and then add it to your zone file as TXT record, which should look like this - - mail._domainkey.cloud1984.net. 300 IN TXT v=DKIM1; k=rsa; p=MIGfMA0GCSqG... - -Finally, we need to tell postfix to sign outgoing emails. At the end of /etc/postfix/main.cf, add: - - # Now for OpenDKIM: we'll sign all outgoing emails - smtpd_milters = inet:127.0.0.1:8891 - non_smtpd_milters = $smtpd_milters - milter_default_action = accept - -And reload the corresponding services - - service postfix reload - service opendkim restart - -Now let's test if our OpenDKIM public key can be found and matches the private key: - - opendkim-testkey -d jhausse.net -s mail -k mail.private -vvv - -which should return - - opendkim-testkey: key OK - -For this, you may need to wait a bit until the name server has reloaded the zone (on Linode, this happens every 15min). You can use **dig** to check if the zone was reloaded yet. - -If this works, let's test if other servers can validate our OpenDKIM signatures and SPF record. To do this, we can use [Brandon Checkett's email test][34]. To send an email to a test address given to us on [Brandon's webpage][34], we can run the following command on the server - - mail -s CloudCheck ihAdmTBmUH@www.brandonchecketts.com - -On Brandon's webpage, you should then see **result = pass** in the 'DKIM Signature' section, and **Result: pass** in the 'SPF Information' section. If our emails pass this test, just regenerate an OpenDKIM key without the -t switch, upload the new key to the zone file, and retest to still if it still passes the tests. If so, congrats! You just successfully set up OpenDKIM and SPF on your server! - -### Host calendars, contacts, files with Owncloud and set up a webmail with Roundcube ### - -Now that we have a top-notch email server, let's add to it the possibility to store your contacts, calendars, and files in the cloud. These are services that the [Owncloud][35] provides out of the box. While we're at it, we'll also set up a webmail, so you can check email even if you're travelling without electronics, or in case your phone and laptop run out of battery. - -Installing Owncloud is straighforward and is well described [here][36]. On Debian, it boils down to adding the owncloud repository to your apt sources, downloading owncloud's release key and adding it to your apt keyring, and then installing owncloud itself using apt-get: - - echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list - wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/Release.key - apt-key add - < Release.key - apt-get update - apt-get install apache2 owncloud roundcube - -When prompted for it, choose **dbconfig** and then say you want **roundcube** to use **mysql**. Then, provide the mysql root password and set a good password for the roundcube mysql user. Then, edit the roundcube config file **/etc/roundcube/main.inc.php** so that logging in on roundcube will default to using your IMAP server: - - $rcmail_config['default_host'] = 'ssl://localhost'; - $rcmail_config['default_port'] = 993; - -Now we will set up the apache2 webserver with SSL so that we can talk to Owncloud and Roundcube using encryption for our passwords and data. Let's turn on Apache's ssl module: - - a2enmod ssl - -and edit **/etc/apache2/ports.conf** to set the following parameters: - -NameVirtualHost *:80 -Listen 80 -ServerName www.jhausse.net - - - # If you add NameVirtualHost *:443 here, you will also have to change - # the VirtualHost statement in /etc/apache2/sites-available/default-ssl - # to - # Server Name Indication for SSL named virtual hosts is currently not - # supported by MSIE on Windows XP. - NameVirtualHost *:443 - Listen 443 - - - - Listen 443 - - -We'll set up a default website for encrypted connections to the webserver as **https://www.jhausse.net** under **/var/www**. Edit **/etc/apache2/sites-available/default-ssl**: - - - ServerAdmin webmaster@localhost - - DocumentRoot /var/www - ServerName www.jhausse.net - [...] - - Deny from all - - [...] - SSLCertificateFile /etc/ssl/certs/cloud.crt - SSLCertificateKeyFile /etc/ssl/private/cloud.key - [...] - - -and let's also set up a website for unencrypted connections to **http://www.jhausse.net** under **/var/www**. Edit **/etc/apache2/sites-available/default**: - - - DocumentRoot /var/www - ServerName www.jhausse.net - [...] - - Deny from all - - - -That way, we can serve pages for www.jhausse.net by putting them in /var/www. The 'Deny from all' directive prevents access to Owncloud through www.jhausse.net: we will set it up to access it through **https://cloud.jhausse.net** instead. - -We will now set up the webmail (roundcube) so that it will be accessed through **https://webmail.jhausse.net**. Edit **/etc/apache2/sites-available/roundcube** to have the following content: - - - - ServerAdmin webmaster@localhost - - DocumentRoot /var/lib/roundcube - # The host name under which you'd like to access the webmail - ServerName webmail.jhausse.net - - Options FollowSymLinks - AllowOverride None - - - ErrorLog ${APACHE_LOG_DIR}/error.log - - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. - LogLevel warn - - CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined - - # SSL Engine Switch: - # Enable/Disable SSL for this virtual host. - SSLEngine on - - # do not allow unsecured connections - # SSLRequireSSL - SSLCipherSuite HIGH:MEDIUM - - # A self-signed (snakeoil) certificate can be created by installing - # the ssl-cert package. See - # /usr/share/doc/apache2.2-common/README.Debian.gz for more info. - # If both key and certificate are stored in the same file, only the - # SSLCertificateFile directive is needed. - SSLCertificateFile /etc/ssl/certs/cloud.crt - SSLCertificateKeyFile /etc/ssl/private/cloud.key - - # Those aliases do not work properly with several hosts on your apache server - # Uncomment them to use it or adapt them to your configuration - Alias /program/js/tiny_mce/ /usr/share/tinymce/www/ - - # Access to tinymce files - - Options Indexes MultiViews FollowSymLinks - AllowOverride None - Order allow,deny - allow from all - - - - Options +FollowSymLinks - # This is needed to parse /var/lib/roundcube/.htaccess. See its - # content before setting AllowOverride to None. - AllowOverride All - order allow,deny - allow from all - - - # Protecting basic directories: - - Options -FollowSymLinks - AllowOverride None - - - - Options -FollowSymLinks - AllowOverride None - Order allow,deny - Deny from all - - - - Options -FollowSymLinks - AllowOverride None - Order allow,deny - Deny from all - - - - SSLOptions +StdEnvVars - - - SSLOptions +StdEnvVars - - # SSL Protocol Adjustments: - # The safe and default but still SSL/TLS standard compliant shutdown - # approach is that mod_ssl sends the close notify alert but doesn't wait for - # the close notify alert from client. When you need a different shutdown - # approach you can use one of the following variables: - # o ssl-unclean-shutdown: - # This forces an unclean shutdown when the connection is closed, i.e. no - # SSL close notify alert is send or allowed to received. This violates - # the SSL/TLS standard but is needed for some brain-dead browsers. Use - # this when you receive I/O errors because of the standard approach where - # mod_ssl sends the close notify alert. - # o ssl-accurate-shutdown: - # This forces an accurate shutdown when the connection is closed, i.e. a - # SSL close notify alert is send and mod_ssl waits for the close notify - # alert of the client. This is 100% SSL/TLS standard compliant, but in - # practice often causes hanging connections with brain-dead browsers. Use - # this only for browsers where you know that their SSL implementation - # works correctly. - # Notice: Most problems of broken clients are also related to the HTTP - # keep-alive facility, so you usually additionally want to disable - # keep-alive for those clients, too. Use variable "nokeepalive" for this. - # Similarly, one has to force some clients to use HTTP/1.0 to workaround - # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and - # "force-response-1.0" for this. - BrowserMatch "MSIE [2-6]" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - # MSIE 7 and newer should be able to use keepalive - BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown - - - -and declare the server in your DNS, for instance: - - webmail.jhausse.net. 300 IN CNAME cloud.jhausse.net. - -Now let's enable these three websites - - a2ensite default default-ssl roundcube - service apache2 restart - -and the webmail, accessible under **https://webmail.jhausse.net**, should basically work. Log in using the full email (e.g. roudy@jhausse.net) and the password you set in mailserver DB at the beginning of this article. The first time you connect, the browser will warn you that the certificate was not signed by a certification authority. That's fine, just add an exception. - -Last but not least, we will create a virtual host for owncloud by putting the following content in **/etc/apache2/sites-available/owncloud**: - - - - ServerAdmin webmaster@localhost - - DocumentRoot /var/www/owncloud - ServerName cloud.jhausse.net - - Options FollowSymLinks - AllowOverride None - - - Options Indexes FollowSymLinks MultiViews - AllowOverride All - Order allow,deny - allow from all - - - ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ - - AllowOverride None - Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - Order allow,deny - Allow from all - - - ErrorLog ${APACHE_LOG_DIR}/error.log - - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. - LogLevel warn - - CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined - - # SSL Engine Switch: - # Enable/Disable SSL for this virtual host. - SSLEngine on - - # do not allow unsecured connections - # SSLRequireSSL - SSLCipherSuite HIGH:MEDIUM - SSLCertificateFile /etc/ssl/certs/cloud.crt - SSLCertificateKeyFile /etc/ssl/private/cloud.key - - - SSLOptions +StdEnvVars - - - SSLOptions +StdEnvVars - - - BrowserMatch "MSIE [2-6]" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - # MSIE 7 and newer should be able to use keepalive - BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown - - - -and activate owncloud by running - - a2ensite owncloud - service apache2 reload - -Then go ahead an configure owncloud by connecting to **https://cloud.jhausse.net/** in a web browswer. - -That's it! Now you've got your own Google Drive, Calendar, Contacts, Dropbox, and Gmail! Enjoy your freshly recovered privacy! :-) - -### Sync your devices to the cloud ### - -To sync your emails, you can just use your favorite email client: the standard email program on Android or iOS, [k9mail][37], or Thunderbird on your PC. Or you can also use the webmail we set up. - -How to sync your calendar and contacts with the cloud is described in the doc of owncloud. On Android, I'm using the CalDAV-Sync and CardDAV-Sync apps which act as bridges between the Android calendar and contacts apps of the phone and the owncloud server. - -For files, there is an Android app called Owncloud to access your files from your phone and automatically upload pictures and videos you take to your cloud. Accessing your files on the your Mac/PC is easy and [well described in the Owncloud documentation][38]. - -### Last tips ### - -During the first few weeks, it's a good idea to monitor **/var/log/syslog** and **/var/log/mail.log** on a daily basis and make sure everything everything is running smoothly. It's important to do so before you invite others (friends, family, ...) to be hosted on your server; you might loose their trust in self-hosting for good if they trust you with their data and the server suddently becomes unavailable. - -To add another email user, just add a row to the **virtual_users** table of the **mailserver** DB. - -To add a domain, just add a row to the **virtual_domains** table. Then update **/etc/opendkim/SigningTable** to get outgoing emails signed, upload the OpenDKIM key to the zone, and reload OpenDKIM. - -Owncloud has its own user DB which can be managed by logging in in Owncloud as administrator. - -Finally, it's important to think in advance of a solution in case your server becomes temporarily unavailable. For instance, where would your mails go until your server returns? One solution would be to find a friend who can act as your backup MX, while you act as his backup MX (see the **relay_domains** and **relay_recipient_maps** setting in Postfix's **main.cf** file). Similarly, what if your server is compromised and a malicious individual erases all your files there? For that, it's important to think of a regular backup system. Linode offers backups as an option. On 1984.is, I set up a basic but sufficient automatic backup system using on crontabs and scp. - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/ - -作者:[Roudy Jhausse ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:aboutlinux@free.fr -[1]:https://history.google.com/history/ -[2]:http://research.google.com/workatgoogle.html -[3]:http://www.attac.org/ -[4]:http://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewanted=all -[5]:http://vimeo.com/ondemand/termsandconditions -[6]:http://www.techtimes.com/articles/21670/20141208/sony-pictures-hack-nightmare-week-celebs-data-leak-and-threatening-emails-to-employees.htm -[7]:http://blog.backupify.com/2012/07/25/what-is-my-gmail-account-really-worth/ -[8]:http://adage.com/article/digital/worth-facebook-google/293042/ -[9]:http://vimeo.com/ondemand/termsandconditions -[10]:https://prism-break.org/en/ -[11]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#VPS -[12]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#mail -[13]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#dspam -[14]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#SPF -[15]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#owncloud -[16]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#sync -[17]:http://linuxfr.org/news/heberger-son-courriel -[18]:http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/ -[19]:http://www.1984.is/ -[20]:http://www.linode.com/ -[21]:http://www.greenpeace.org/international/Global/international/publications/climate/2012/iCoal/HowCleanisYourCloud.pdf -[22]:http://www.1984.is/about/ -[23]:http://www.fsf.org/ -[24]:https://www.gnupg.org/ -[25]:http://www.gandi.net/ -[26]:http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html -[27]:http://www.postfix.org/ -[28]:http://postgrey.schweikert.ch/ -[29]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#testPort25 -[30]:http://dspam.sourceforge.net/ -[31]:http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/ -[32]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#PTR -[33]:http://opendkim.org/opendkim-README -[34]:http://www.brandonchecketts.com/emailtest.php -[35]:http://owncloud.org/ -[36]:http://owncloud.org/install/ -[37]:https://code.google.com/p/k9mail/ -[38]:http://doc.owncloud.org/server/7.0/user_manual/files/files.html diff --git a/sources/tech/20150121 How to Monitor Network Usage with nload in Linux.md b/sources/tech/20150121 How to Monitor Network Usage with nload in Linux.md deleted file mode 100644 index afbfa4eab6..0000000000 --- a/sources/tech/20150121 How to Monitor Network Usage with nload in Linux.md +++ /dev/null @@ -1,206 +0,0 @@ -How to Monitor Network Usage with nload in Linux -================================================================================ -nload is a free linux utility that can help the linux user or sysadmin to monitor network traffic and bandwidth usage in real time by providing two simple graphs: one per incoming traffic and one for outgoing traffic. - -I really like to use **nload** to display information on my screen about the current download speed, the total incoming traffic, and the average download speed. The graphs reported by nload tool are very easy to interpret and what is the most important thing they are very helpful. - -According to the manual pages it monitors all network devices by default, but you can easily specify the device you want to monitor and also switch between different network devices using the arrow keys. There are many options avaliable such as -t to determine refresh interval of the display in milliseconds (the default value of interval is 500), -m to show multiple devices at the same time(traffic graphs are not shown when this option is used), -u to set the type of unit used for the display of traffic numbers and many others that we are going to explore and practise in this tutorial. - -### How to install nload on your linux machine ### - -**Ubuntu** and **Fedora** users can easily install nload from the default repositories. - -Install nload on Ubuntu by using the following command. - - sudo apt-get install nload - -Install nload on Fedora by using the following command. - - sudo yum install nload - -What about **CentOS** users? Just type the following command on your machine and you will get nload installed. - - sudo yum install nload - -The following command will help you to install nload on OpenBSD systems. - - sudo pkg_add -i nload - -A very effective way to install software on linux machine is to compile by source as you can download and install the latest version which usually means better performance, cool features and less bugs. - -### How to install nload from source ### - -The first thing you need to do before installing nload from source you need to download it and to do this I like to use the wget uility which is available by default on many linux machines. This free utility helps linux users to download files from the web in a non-interactive way and has support for the following protocols. - -- HTTP -- HTTPS -- FTP - -Change directory to **/tmp** by using the following command. - - cd /tmp - -Now type the following command in your terminal to download the latest version of nload on your linux machine. - - wget http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz - -If you don't like to use the linux wget utility you can easily download it from the [official][1] source by just a mouse click. - -The download will finish in no time as it is a small software. The next step is to untar the file you downloaded with the help of the **tar** utility. - -The tar archiving utility can be used to store and extract files from a tape or disk archive. There are many options available in this tool but we need the followings to perform our operation: - -1. **-x** to extract files from an archive -1. **-v** to run in verbose mode -1. **-f** to specify the files - -For example: - - tar xvf example.tar - -Now that you learned how to use the tar utility I am very sure you know how to untar .tar archives from the commandline. - - tar xvf nload-0.7.4.tar.gz - -Then use the cd command to change directory to nload*. - - cd nload* - -It looks like this on my system. - - oltjano@baby:/tmp/nload-0.7.4$ - -Now run the command - - ./configure - -to to configure the package for your system. - - ./configure - -Alot of stuff is going to be displayed on your screen. The following screenshot demonstrates how it is going to look like. - -![configuring packages for nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload1.png) - -Then compile the nload with the following command. - - make - -![compiling nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload2.png) - -And finally install nload on your linux machine with the following command. - - sudo make install - -![installing nload from source](http://blog.linoxide.com/wp-content/uploads/2015/01/nload3.png) - -Now that the installation of nload is finished it is time for you to learn how to use it. - -### How to use nload ### - -I like to explore so type the following command on your terminal. - - nload - -What do you see? - -I get the following. - -![running nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.png) - -As you can see from the above screenshot I get information on: - -### Incoming Traffic ### - -#### Current download speed #### - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.1.png) - -#### Average download speed #### - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.2.png) - -#### Minimum download speed #### - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.3.png) - -#### Maximum download speed #### - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.4.png) - -#### Total incoming traffic in bytes by default #### - -![](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.5.png) - -### Outgoing Traffic ### - -The same goes for outgoing traffic. - -#### Some useful options of nload #### - -Use the option - - -u - -to set set the type of unit used for the display of traffic numbers. - -The following command will help you to use the MBit/s unit. - - nload -u m - -The following screenshot shows the result of the above command. - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload5.png) - -Try the following command and see the results. - - nload -u g - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload6.png) - -There is also the option **-U**. According to the manual pages it is same as the option -u but only for an amount of data. I tested this option and to be honest it very helpful when you want to check the total amount of traffic be it incoming or outgoing. - - nload -U G - -![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload7.png) - -As you can see from the above screenshot the command **nload -U G** helps to display the total amount of data (incoming or outgoing) in Gbyte. - -Another useful option I like to use with nload is the option **-t**. This option is used to refresh interval of display in milliseconds which is 500 by default. - -I like to experiment a little by using the following command. - - nload -t 130 - -So what the above command does is that it sets the display to refresh every 130 milliseconds. It is recommended to no specify refresh intervals shorter than about 100 milliseconds as nload will generate reports with mistakes during the calculations. - -Another option is **-a**. It is used when you want to set the length in seconds of the time window for average calculation which is 300 seconds by default. - -What if you want to monitor a specific network device? It is very easy to do that, just specify the device or the list of devices you want to monitor like shown below. - - nload wlan0 - -![nload monitoring wlan0 on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png) - -The following syntax can help to monitor specific multiple devices. - - nload [options] device1 device2 devicen - -For example use the following command to monitor eth0 and wlan0. - - nload wlan0 eth0 - -And if you run the command nload without any option it will monitor all auto-detected devices, you can display graphs for each one of them by using the right and left arrow keys. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/monitoring-2/monitor-network-usage-nload/ - -作者:[Oltjano Terpollari][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/oltjano/ -[1]:http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz \ No newline at end of file diff --git a/sources/tech/20150121 How to apply image effects to pictures on Raspberry Pi.md b/sources/tech/20150121 How to apply image effects to pictures on Raspberry Pi.md deleted file mode 100644 index 920f542832..0000000000 --- a/sources/tech/20150121 How to apply image effects to pictures on Raspberry Pi.md +++ /dev/null @@ -1,69 +0,0 @@ -How to apply image effects to pictures on Raspberry Pi -================================================================================ -Like a common pocket camera which has a built-in function to add various effects on captured photos, [Raspberry Pi camera board][1] ("raspi cam") can actually do the same. With the help of raspistill camera control options, we can add the image effects function like we have in a pocket camera. - -There are [three comman-line applications][2] which can be utilized for [taking videos or pictures][3] with raspi cam, and one of them is the raspistill application. The raspistill tool offers various camera control options such as sharpness, contrast, brightness, saturation, ISO, exposure, automatic white balance (AWB), image effects. - -In this article I will show how to apply exposure, AWB, and other image effects with raspistill while capturing pictures using raspi cam. To automate the process, I wrote a simple Python script which takes pictures and automatically applies a series of image effects to the pictures. The raspi cam documentation describes available types of the exposure, AWB, and image effects. In total, the raspi cam offers 16 types of image effects, 12 types of exposure, and 10 types of AWB values. - -The simple Python script looks like the following. - - #!/usb/bin/python - import os - import time - import subprocess - list_ex=['auto','night'] - list_awb=['auto','cloud',flash'] - list_ifx=['blur','cartoon','colourswap','emboss','film','gpen','hatch','negative','oilpaint','posterise','sketch','solarise','watercolour'] - x=0 - for ex in list_ex: - for awb in list_awb: - for ifx in list_ifx: - x=x+1 - filename='img_'+ex+'_'+awb+'_'+ifx+'.jpg' - cmd='raspistill -o '+filename+' -n -t 1000 -ex '+ex+' -awb '+awb+' -ifx '+ifx+' -w 640 -h 480' - pid=subprocess.call(cmd,shell=True) - print "["+str(x)+"]-"+ex+"_"+awb+"_"+ifx+".jpg" - time.sleep(0.25) - print "End of image capture" - -The Python script operates as follows. First, create three array/list variable for the exposure, AWB and image effects. In the example, we use 2 types of exposure, 3 types of AWB, and 13 types of image effects values. Then make nested loops for applying the value of the three variables that we have. Inside the nested loop, execute the raspistill application. We specify (1) the output filename; (2) exposure value; (3) AWB value; (4) image effect value; (5) the time to take a photo, which is set to 1 second; and (6) the size of the photo, which is set to 640x480px. This Python script will create 78 different versions of a captured photo with a combination of 2 types of exposure, 3 types of AWB, and 13 types of image effects. - -To execute the Python script, simply type: - - $ python name_of_this_script.py - -Here is the first round of the sample result. - -![](https://farm8.staticflickr.com/7483/16134215939_c93291158a_c.jpg) - -### Bonus ### - -For those who are more interested, there is another way to access and control the raspi cam besides raspistill. [Picamera][4] a pure Python interface which provides APIs for accessing and controlling raspi cam, so that one can build a complex program for utilizing raspi cam according to their needs. If you are skilled at Python, picamera is a good feature-complete interface for implementing your raspi cam project. The picamera interface is included by default in the recent image of Raspbian. If your [Raspberry Pi][5] operating system is not new or not Raspbian, you can install it on your system as follows. - -First, install pip on your system by following [this guideline][6]. - -Then, install picamera as follows. - - $ sudo pip install picamera - -Refer to the [official documentation][7] on how to use picamera. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/apply-image-effects-pictures-raspberrypi.html - -作者:[Kristophorus Hadiono][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/kristophorus -[1]:http://xmodulo.com/go/picam -[2]:http://www.raspberrypi.org/documentation/usage/camera/raspicam/ -[3]:http://xmodulo.com/install-raspberry-pi-camera-board.html -[4]:https://pypi.python.org/pypi/picamera -[5]:http://xmodulo.com/go/raspberrypi -[6]:http://ask.xmodulo.com/install-pip-linux.html -[7]:http://picamera.readthedocs.org/ \ No newline at end of file diff --git a/sources/tech/20150122 Linux FAQs with Answers--How to use yum to download a RPM package without installing it.md b/sources/tech/20150122 Linux FAQs with Answers--How to use yum to download a RPM package without installing it.md deleted file mode 100644 index f1663888c8..0000000000 --- a/sources/tech/20150122 Linux FAQs with Answers--How to use yum to download a RPM package without installing it.md +++ /dev/null @@ -1,56 +0,0 @@ -Linux FAQs with Answers--How to use yum to download a RPM package without installing it -================================================================================ -> **Question**: I want to download a RPM package from Red Hat's standard repositories. Can I use yum command to download a RPM package without installing it? - -yum is the default package manager for Red Hat based systems, such as CentOS, Fedora or RHEL. Using yum, you can install or update a RPM package while resolving its package dependencies automatically. What if you want to download a RPM package without installing it on the system? For example, you may want to archive some RPM packages for later use or to install them on another machine. - -Here is how to download a RPM package from yum repositories. - -### Method One: Yum ### - -The yum command itself can be used to download a RPM package. The standard yum command offers '--downloadonly' option for this purpose. - - $ sudo yum install --downloadonly - -By default, a downloaded RPM package will be saved in: - - /var/cache/yum/x86_64/[centos/fedora-version]/[repository]/packages - -In the above, [repository] is the name of the repository (e.g., base, fedora, updates) from which the package is downloaded. - -If you want to download a package to a specific directory (e.g., /tmp): - - $ sudo yum install --downloadonly --downloaddir=/tmp - -Note that if a package to download has any unmet dependencies, yum will download all dependent packages as well. None of them will be installed. - -One important thing is that on CentOS/RHEL 6 or earlier, you will need to install a separate yum plugin (called yum-plugin-downloadonly) to be able to use '--downloadonly' command option: - - $ sudo yum install yum-plugin-downloadonly - -Without this plugin, you will get the following error with yum: - - Command line error: no such option: --downloadonly - -![](https://farm9.staticflickr.com/8627/15571201803_38390aae75_c.jpg) - -### Method Two: Yumdownloader ### - -Another method to download a RPM package is via a dedicated package downloader tool called yumdownloader. This tool is part of yum-utils package which contains a suite of helper tools for yum package manager. - - $ sudo yum install yum-utils - -To download a RPM package: - - $ sudo yumdownloader - -The downloaded package will be saved in the current directory. You need to use root privilege because yumdownloader will update package index files during downloading. Unlike yum command above, none of the dependent package(s) will be downloaded. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/yum-download-rpm-package.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/sources/tech/20150126 Improve system performance by moving your log files to RAM Using Ramlog.md b/sources/tech/20150126 Improve system performance by moving your log files to RAM Using Ramlog.md deleted file mode 100644 index db03257941..0000000000 --- a/sources/tech/20150126 Improve system performance by moving your log files to RAM Using Ramlog.md +++ /dev/null @@ -1,112 +0,0 @@ -Improve system performance by moving your log files to RAM Using Ramlog -================================================================================ -Ramlog act as a system daemon. On startup it creates ramdisk, it copies files from /var/log into ramdisk and mounts ramdisk as /var/log. All logs after that will be updated on ramdisk. Logs on harddrive are kept in folder /var/log.hdd which is updated when ramlog is restarted or stopped. On shutdown it saves log files back to harddisk so logs are consistent. Ramlog 2.x is using tmpfs by default, ramfs and kernel ramdisk are suppored as well. Program rsync is used for log synchronization. - -Note: Logs not saved to harddrive are lost in case of power outage or kernel panic. - -Install ramlog if you have enough of free memory and you want to keep your logs on ramdisk. It is good for notebook users, for systems with UPS or for systems running from flash -- to save some write cycles. - -How it works and what it does: - -1.Ramlog starts among the first daemons (it depends on other daemons you have installed). - -2.Directory /var/log.hdd is created and hardlinked to /var/log. - -3.In case tmpfs (default) or ramfs is used, it is mounted over /var/log - -If kernel ramdisk is used, ramdisk created in /dev/ram9 and it is mounted to /var/log, by default ramlog takes all ramdisk memory specified by kernel argument "ramdisk_size". - -5.All other daemons are started and all logs are updated in ramdisk. Logrotate works on ramdisk as well. - -6.In case ramlog is restarted (by default it is one time per day), directory /var/log.hdd is synchronized with /var/log using rsync. Frequency of the automatic log saves can be controller via cron, by default, the ramlog file is placed into /etc/cron.daily - -7.On shutdown ramlog shuts among the last daemons. - -8. During ramlog stop phase files from /var/log.hdd are synchronized with /var/log -Then /var/log is unmounted, /var/log.hdd is unmounted as well and empty directory /var/log.hdd is deleted. - -**Note:- This article is for advanced users only** - -### Install Ramlog in Ubuntu ### - -First you need to download the .deb package from [here][1] using the following command - - wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb - -Now you should be having ramlog_2.0.0_all.deb package install this package using the following command - - sudo dpkg -i ramlog_2.0.0_all.deb - -This will complete the installation now you need to run the following commands - - sudo update-rc.d ramlog start 2 2 3 4 5 . stop 99 0 1 6 . - -#Now update sysklogd in init levels, so it is stopped properly before ramlog is stopped: - - sudo update-rc.d -f sysklogd remove - - sudo update-rc.d sysklogd start 10 2 3 4 5 . stop 90 0 1 6 . - -Now you need to restart your system - - sudo reboot - -After rebooting you need to run ‘ramlog getlogsize' to determine the size of your actual /var/log.Add about 40% to that number to ensure your ramdisk has sufficient size -- this will be the ramdisk size - -Edit your boot manager config file such as /etc/grub.conf, /boot/grub/menu.lst or /etc/lilo.conf and add update the actual kernel by adding kernel paramter ‘ramdisk_size=xxx' where xxx is calculated ramdisk size - -### Configuring Ramlog ### - -Ramlog configuration file is located in /etc/default/ramlog on deb based systems and you can set there below variables: - -Variable (with default value): - -Description: - - RAMDISKTYPE=0 - # Values: - # 0 -- tmpfs (can be swapped) -- default - # 1 -- ramfs (no max size in older kernels, - # cannot be swapped, not SELinux friendly) - # 2 -- old kernel ramdisk - TMPFS_RAMFS_SIZE= - #Maximum size of memory to be used by tmpfs or ramfs. - # The value can be percentage of total RAM or size in megabytes -- for example: - # TMPFS_RAMFS_SIZE=40% - # TMPFS_RAMFS_SIZE=100m - # Empty value means default tmpfs/ramfs size which is 50% of total RAM. - # For more options please check ‘man mount', section ‘Mount options for tmpfs' - # (btw -- ramfs supports size limit in newer kernels - # as well despite man says there are no mount options) - # It has only effect if RAMDISKTYPE=0 or 1 - KERNEL_RAMDISK_SIZE=MAX - #Kernel ramdisk size in kilobytes or MAX to use entire ramdisk. - #It has only effect if RAMDISKTYPE=2 - LOGGING=1 - # 0=off, 1=on Logs can be found in /var/log/ramdisk - LOGNAME=ramlog - # name of the ramlog log file (makes sense if LOGGING=1) - VERBOSE=1 - # 0=off, 1=on (if 1, teststartstop puts detials - # to the logs and it is called after start or stop fails) - -### How to uninstall Ubuntu ### - -Open the terminal and run the following command - - sudo dpkg -P ramlog - -Note: If ramlog was running before you uninstalled it, you should reboot your box to finish uninstallation procedure. - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/improve-system-performance-by-moving-your-log-files-to-ram-using-ramlog.html - -作者:[ruchi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.ubuntugeek.com/author/ubuntufix -[1]:http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb \ No newline at end of file diff --git a/sources/tech/20150128 Docker-1 Moving to Docker.md b/sources/tech/20150128 Docker-1 Moving to Docker.md deleted file mode 100644 index 1c1d4b78cc..0000000000 --- a/sources/tech/20150128 Docker-1 Moving to Docker.md +++ /dev/null @@ -1,82 +0,0 @@ -Translating by mtunique -Moving to Docker -================================================================================ -![](http://cocoahunter.com/content/images/2015/01/docker1.jpeg) - -[TL;DR] This is the first post in a series of 3 on how my company moved its infrastructure from PaaS to Docker based deployment. If you want, you can skip the intro (this post) and head directly to the technical topics (links at the bottom of the page). - ----------- - -In the last month I've been strggling with devops. This is my very personal story and experience in trying to streamline a deployment process of a Raila app with Docker. - -When I started my company – [Touchware][1] – in 2012 I was a lone developer. Things were small, uncomplicated, they didn't require a lot of maintenance, nor they needed to scale all that much. During the course of last year though, we grew quite a lot (we are now a team of 10 people) and our server-side applications and API grew both in terms of scope and scale. - -### Step 1 - Heroku ### - -We still are a very small team and we need to make things going and run as smoothly as possible. When we looked for possible solutions, we decided to stick with something that would have removed from our shoulders the burden of managing hardware. Since we develop mainly Rails based applications and Heroku has a great support for RoR and various kind of DBs and cached (Postgres / Mongo / Redis etc.), the smartest choice seemed to be going with [Heroku][2]. And that's what we did. - -Heroku has a great support and great documentation and deploying apps is just so snappy! Only problem is, when you start growing, you need to have piles of cash around to pay the bills. Not the best deal, really. - -### Step 2 - Dokku ### - -In a rush to try and cut the costs, we decided to try with Dokku. [Dokku][3], quoting the Github repo is a - -> Docker powered mini-Heroku in around 100 lines of Bash - -We launched some instances on [DigitalOcean][4] with Dokku pre-installed and we gave it spin. Dokku is very much like Heroku, but when you have complex applications for whom you need to twear params, or where you need certain dependencies, it's just not gonna work out. We had an app where we needed to apply multiple transformations on images and we couldn't find a way to install the correct version of imagemagick into the dokku-based Docker container that was hosting our Rails app. We still have a couple of very simple apps that are running on Dokku, but we had to move some of them back to Heroku. - -### Step 3 - Docker ### - -A couple of months ago, since the problem of devops and managing production apps was resurfacing, I decided to try out [Docker][5]. Docker, in simple terms, allows developers to containerize applications and to ease the deployment. Since a Docker container basically has all the dependencies it needs to run your app, if everything runs fine on your laptop, you can be sure it'll also run like a champ in production on a remote server, be it an AWS E2C instance or a VPS on DigitalOcean. - -Docker IMHO is particularly interesting for the following reasons: - -- it promotes modularization and separation of concerns: you need to start thinking about your apps in terms of logical components (load balancer: 1 container, DB: 1 container, webapp: 1 container etc.); -- it's very flexible in terms of deployment options: containers can be deployed to a wide variety of HW and can be easily redeployed to different servers / providers; -- it allows for a very fine grained tuning of your app environment: you build the images your containers runs from, so you have plenty of options for configuring your environment exactly as you would like to. - -There are howerver some downsides: - -- the learning curve is quite steep (this is probably a very personal problem, but I'm talking as a software dev and not as a skilled operations professional); -- setup is not simple, especially if you want to have a private registry / repository (more about this later). - -Following are some tips I put together during the course of the last week with the findings of someone that is new to the game. - ----------- - -In the following articles we'll see how to setup a semi-automated Docker based deployment system. - -- [Setting up a private Docker registry][6] -- [Configuring a Rails app for semi-automated deployment][7] - --------------------------------------------------------------------------------- - -via: http://cocoahunter.com/2015/01/23/docker-1/ - -作者:[Michelangelo Chasseur][a] -译者:[mtunique](https://github.com/mtunique) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://cocoahunter.com/author/michelangelo/ -[1]:http://www.touchwa.re/ -[2]:http://cocoahunter.com/2015/01/23/docker-1/www.heroku.com -[3]:https://github.com/progrium/dokku -[4]:http://cocoahunter.com/2015/01/23/docker-1/www.digitalocean.com -[5]:http://www.docker.com/ -[6]:http://cocoahunter.com/2015/01/23/docker-2/ -[7]:http://cocoahunter.com/2015/01/23/docker-3/ -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: diff --git a/sources/tech/20150202 How to create and show a presentation from the command line on Linux.md b/sources/tech/20150202 How to create and show a presentation from the command line on Linux.md deleted file mode 100644 index e871d29e42..0000000000 --- a/sources/tech/20150202 How to create and show a presentation from the command line on Linux.md +++ /dev/null @@ -1,187 +0,0 @@ -translating by soooogreen -How to create and show a presentation from the command line on Linux -================================================================================ -When you prepare a talk for audience, the first thing that will probably come to your mind is shiny presentation charts filled with fancy diagrams, graphics and animation effects. Fine. No one can deny the power of visually charming presentation. However, not all presentations need to be Ted talk quality. Often times, the purpose of a presentation is to convey specific information, which can easily be done with textual messages. In such cases, your time can be better spent on gathering information and checking facts, rather than searching for good-looking graphics from Google Image. - -In the world of Linux, you can do presentation in several different ways, e.g., Impress for multimedia-rich content, [Impress.js][1] for stunning visualization, Beamer for hardcore LaTex users, and so on. If you are looking for a simple means to create and show a textual presentation, look no further. [mdp][2] can get the job done for you. - -### What is Mdp? ### - -mdp is an ncurses-based command-line presentation tool for Linux. What I like about mdp is its [markdown][3] support, which makes it easy to create slides with familiar markdown format. Naturally, it becomes painless to publish the slides in HTML format as well. Another plus is its support for UTF-8 character encoding, which comes in handy when showing non-English characters (e.g., Greek or Cyrillic alphabets). - -### Install Mdp on Linux ### - -Installation of mdp is mostly painless due to its light dependency requirement (i.e., ncursesw). - -#### Debian, Ubuntu or their derivatives #### - - $ sudo apt-get install git gcc make libncursesw5-dev - $ git clone https://github.com/visit1985/mdp.git - $ cd mdp - $ make - $ sudo make install - -#### Fedora or CentOS/RHEL #### - - $ sudo yum install git gcc make ncurses-devel - $ git clone https://github.com/visit1985/mdp.git - $ cd mdp - $ make - $ sudo make install - -#### Arch Linux #### - -On Arch Linux, you can easily install mdp from [AUR][4]. - -### Create a Presentation from the Command Line ### - -Once you installed mdp, you can easily create a presentation by using your favorite text editor. If you are familiar with markdown, it will take no time to master mdp. For those of you who are not familiar with markdown, starting with an example is the best way to learn mdp. - -Here is a 6-page sample presentation for your reference. - - %title: Sample Presentation made with mdp (Xmodulo.com) - %author: Dan Nanni - %date: 2015-01-28 - - -> This is a slide title <- - ========= - - -> mdp is a command-line based presentation tool with markdown support. <- - - *_Features_* - - * Multi-level headers - * Code block formatting - * Nested quotes - * Nested list - * Text highlight and underline - * Citation - * UTF-8 special characters - - ------------------------------------------------- - - -> # Example of nested list <- - - This is an example of multi-level headers and a nested list. - - # first-level title - - second-level - ------------ - - - *item 1* - - sub-item 1 - - sub-sub-item 1 - - sub-sub-item 2 - - sub-sub-item 3 - - sub-item 2 - - ------------------------------------------------- - - -> # Example of code block formatting <- - - This example shows how to format a code snippet. - - 1 /* Hello World program */ - 2 - 3 #include - 4 - 5 int main() - 6 { - 7 printf("Hello World"); - 8 return 0; - 9 } - - This example shows inline code: `sudo reboot` - - ------------------------------------------------- - - -> # Example of nested quotes <- - - This is an example of nested quotes. - - # three-level nested quotes - - > This is the first-level quote. - >> This is the second-level quote - >> and continues. - >>> *This is the third-level quote, and so on.* - - ------------------------------------------------- - - -> # Example of citations <- - - This example shows how to place a citation inside a presentation. - - This tutorial is published at [Xmodulo](http://xmodulo.com) - - You are welcome to connect with me at [LinkedIn](http://www.linkedin.com/in/xmodulo) - - Pretty cool, huh? - - ------------------------------------------------- - - -> # Example of UTF-8 special characters <- - - This example shows UTF-8 special characters. - - ae = ä, oe = ö, ue = ü, ss = ß - alpha = ?, beta = ?, upsilon = ?, phi = ? - Omega = ?, Delta = ?, Sigma = ? - - ??????????? - ?rectangle? - ??????????? - -### Show a Presentation from the Command Line ### - -Once you save the above code as slide.md text file, you can show the presentation by simply running: - - $ mdp slide.md - -You can navigate the presentation by pressing Enter/Space/Page-Down/Down-Arrow (next slide), Backspace/Page-Up/Up-Arrow (previous slide), Home (first slide), End (last slide), or numeric-N (N-th slide). - -The title of the presentation appears on top of each slide, and your name and page number are shown at the bottom. - -![](https://farm9.staticflickr.com/8637/16392457702_ec732d0094_c.jpg) - -This is an example of a nested list and multi-level headers. - -![](https://farm9.staticflickr.com/8567/16367397606_29be7df633_c.jpg) - -This is an example of a code snippet and inline code. - -![](https://farm9.staticflickr.com/8682/15770926144_0f982b0863_b.jpg) - -This is an example of nested quotes. - -![](https://farm9.staticflickr.com/8587/16393383115_0865c8b89b_c.jpg) - -This is an example of placing citations. - -![](https://farm8.staticflickr.com/7409/16392457712_ed36c14bc2_c.jpg) - -This is an example of UTF-8 special characters. - -![](https://farm9.staticflickr.com/8648/16205981560_7fa3debc75_c.jpg) - -### Summary ### - -In this tutorial, I showed you how to use mdp to create and show a presentation from the command line. Its markdown compatibility saves us the trouble and hassle of having to learn any new formatting, which is an advantage compared to [tpp][5], another command-line presentation tool. Due to its limitations, mdp may not qualify as your default presentation tool, but there should be definitely a use case for that. What do you think of mdp? Do you prefer something else? - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/presentation-command-line-linux.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]:http://bartaz.github.io/impress.js/ -[2]:https://github.com/visit1985/mdp -[3]:http://daringfireball.net/projects/markdown/ -[4]:https://aur.archlinux.org/packages/mdp-git/ -[5]:http://www.ngolde.de/tpp.html diff --git a/sources/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md b/sources/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md deleted file mode 100644 index 11d5e6645a..0000000000 --- a/sources/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md +++ /dev/null @@ -1,378 +0,0 @@ - Vic -25 Linux Shell Scripting interview Questions & Answers -================================================================================ -### Q:1 What is Shell Script and why it is required ? ### - -Ans: A Shell Script is a text file that contains one or more commands. As a system administrator we often need to issue number of commands to accomplish the task, we can add these all commands together in a text file (Shell Script) to complete daily routine task. - -### Q:2 What is the default login shell and how to change default login shell for a specific user ? ### - -Ans: In Linux like Operating system “/bin/bash” is the default login shell which is assigned while user creation. We can change default shell using the “chsh” command . Example is shown below : - - # chsh -s - # chsh linuxtechi -s /bin/sh - -### Q:3 What are the different type of variables used in a shell Script ? ### - -Ans: In a shell script we can use two types of variables : - -- System defined variables -- User defined variables - -System defined variables are defined or created by Operating System(Linux) itself. These variables are generally defined in Capital Letters and can be viewed by “**set**” command. - -User defined variables are created or defined by system users and the values of variables can be viewed by using the command “`echo $`” - -### Q:4 How to redirect both standard output and standard error to the same location ? ### - -Ans: There two method to redirect std output and std error to the same location: - -Method:1 2>&1 (# ls /usr/share/doc > out.txt 2>&1 ) - -Method:2 &> (# ls /usr/share/doc &> out.txt ) - -### Q:5 What is the Syntax of “nested if statement” in shell scripting ? ### - -Ans : Basic Syntax is shown below : - - if [ Condition ] - then - command1 - command2 - ….. - else - if [ condition ] - then - command1 - command2 - …. - else - command1 - command2 - ….. - fi - fi - -### Q:6 What is the use of “$?” sign in shell script ? ### - -Ans:While writing a shell script , if you want to check whether previous command is executed successfully or not , then we can use “$?” with if statement to check the exit status of previous command. Basic example is shown below : - - root@localhost:~# ls /usr/bin/shar - /usr/bin/shar - root@localhost:~# echo $? - 0 - -If exit status is 0 , then command is executed successfully - - root@localhost:~# ls /usr/bin/share - - ls: cannot access /usr/bin/share: No such file or directory - root@localhost:~# echo $? - 2 - -If the exit status is other than 0, then we can say command is not executed successfully. - -### Q:7 How to compare numbers in Linux shell Scripting ? ### - -Ans: test command is used to compare numbers in if-then statement. Example is shown below : - - #!/bin/bash - x=10 - y=20 - - if [ $x -gt $y ] - then - echo “x is greater than y” - else - echo “y is greater than x” - fi - -### Q:8 What is the use of break command ? ### - -Ans: The break command is a simple way to escape out of a loop in progress. We can use the break command to exit out from any loop, including while and until loops. - -### Q:9 What is the use of continue command in shell scripting ? ### - -Ans The continue command is identical to break command except it causes the present iteration of the loop to exit, instead of the entire loop. Continue command is useful in some scenarios where error has occurred but we still want to execute the next commands of the loop. - -### Q:10 Tell me the Syntax of “Case statement” in Linux shell scripting ? ### - -Ans: The basic syntax is shown below : - - case word in - value1) - command1 - command2 - ….. - last_command - !! - value2) - command1 - command2 - …… - last_command - ;; - esac - -### Q:11 What is the basic syntax of while loop in shell scripting ? ### - -Ans: Like the for loop, the while loop repeats its block of commands a number of times. Unlike the for loop, however, the while loop iterates until its while condition is no longer true. The basic syntax is : - - while [ test_condition ] - do - commands… - done - -### Q:12 How to make a shell script executable ? ### - -Ans: Using the chmod command we can make a shell script executable. Example is shown below : - - # chmod a+x myscript.sh - -### Q:13 What is the use of “#!/bin/bash” ? ### - -Ans: #!/bin/bash is the first of a shell script , known as shebang , where # symbol is called hash and ‘!’ is called as bang. It shows that command to be executed via /bin/bash. - -### Q:14 What is the syntax of for loop in shell script ? ### - -Ans: Basic Syntax of for loop is given below : - - for variables in list_of_items - do - command1 - command2 - …. - last_command - done - -### Q:15 How to debug a shell script ? ### - -Ans: A shell script can be debug if we execute the script with ‘-x’ option ( sh -x myscript.sh). Another way to debug a shell script is by using ‘-nv’ option ( sh -nv myscript.sh). - -### Q:16 How compare the strings in shell script ? ### - -Ans: test command is used to compare the text strings. The test command compares text strings by comparing each character in each string. - -### Q:17 What are the Special Variables set by Bourne shell for command line arguments ? ### - -Ans: The following table lists the special variables set by the Bourne shell for command line arguments . - -注:表格部分 - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Special Variables

-
-

Holds

-
-

$0

-
-

Name of the Script from the command line

-
-

$1

-
-

First Command-line argument

-
-

$2

-
-

Second Command-line argument

-
-

…..

-
-

…….

-
-

$9

-
-

Ninth Command line argument

-
-

$#

-
-

Number of Command line arguments

-
-

$*

-
-

All Command-line arguments, separated with spaces

-
- -### Q:18 How to test files in a shell script ? ### - -Ans: test command is used to perform different test on the files. Basic test are listed below : - -注:表格部分 - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Test

-
-

Usage

-
-

-d file_name

-
-

Returns true if the file exists and is a directory

-
-

-e file_name

-
-

Returns true if the file exists

-
-

-f file_name

-
-

Returns true if the file exists and is a regular file

-
-

-r file_name

-
-

Returns true if the file exists and have read permissions

-
-

-s file_name

-
-

Returns true if the file exists and is not empty

-
-

-w file_name

-
-

Returns true if the file exists and have write permissions

-
-

-x file_name

-
-

Returns true if the file exists and have execute permissions

-
- -### Q:19 How to put comments in your shell script ? ### - -Ans: Comments are the messages to yourself and for other users that describe what a script is supposed to do and how its works.To put comments in your script, start each comment line with a hash sign (#) . Example is shown below : - - #!/bin/bash - # This is a command - echo “I am logged in as $USER” - -### Q:20 How to get input from the terminal for shell script ? ### - -Ans: ‘read’ command reads in data from the terminal (using keyboard). The read command takes in whatever the user types and places the text into the variable you name. Example is shown below : - - # vi /tmp/test.sh - - #!/bin/bash - echo ‘Please enter your name’ - read name - echo “My Name is $name” - - # ./test.sh - Please enter your name - LinuxTechi - My Name is LinuxTechi - -### Q:21 How to unset or de-assign variables ? ### - -Ans: ‘unset’ command is used to de-assign or unset a variable. Syntax is shown below : - - # unset - -### Q:22 How to perform arithmetic operation ? ### - -Ans: There are two ways to perform arithmetic operations : - -1. Using `expr` command (# expr 5 + 2 ) -2. using a dollar sign and square brackets ( `$[ operation ]` ) Example : test=$[16 + 4] ; test=$[16 + 4] - -### Q:23 Basic Syntax of do-while statement ? ### - -Ans: The do-while statement is similar to the while statement but performs the statements before checking the condition statement. The following is the format for the do-while statement: - - do - { - statements - } while (condition) - -### Q:24 How to define functions in shell scripting ? ### - -Ans: A function is simply a block of of code with a name. When we give a name to a block of code, we can then call that name in our script, and that block will be executed. Example is shown below : - - $ diskusage () { df -h ; } - -### Q:25 How to use bc (bash calculator) in a shell script ? ### - -Ans: Use the below Syntax to use bc in shell script. - - variable=`echo “options; expression” | bc` - --------------------------------------------------------------------------------- - -via: http://www.linuxtechi.com/linux-shell-scripting-interview-questions-answers/ - -作者:[Pradeep Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.linuxtechi.com/author/pradeep/ diff --git a/sources/tech/20150205 How To Use Smartphones Like Weather Conky In Linux.md b/sources/tech/20150205 How To Use Smartphones Like Weather Conky In Linux.md index b5bbc69a3b..7607920dd3 100644 --- a/sources/tech/20150205 How To Use Smartphones Like Weather Conky In Linux.md +++ b/sources/tech/20150205 How To Use Smartphones Like Weather Conky In Linux.md @@ -1,3 +1,5 @@ +FSSlc translating + How To Use Smartphones Like Weather Conky In Linux ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Use_Weather_Conky_Linux.jpeg) @@ -81,4 +83,4 @@ via: http://itsfoss.com/weather-conky-linux/ [2]:http://www.computerhope.com/unix/curl.htm [3]:http://speedracker.deviantart.com/art/Flair-Weather-Conky-Made-for-Conky-Manager-510130311 [4]:http://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ -[5]:https://weather.yahoo.com/ \ No newline at end of file +[5]:https://weather.yahoo.com/ diff --git a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md new file mode 100644 index 0000000000..58a0841280 --- /dev/null +++ b/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -0,0 +1,106 @@ +How to access Feedly RSS feed from the command line on Linux +================================================================================ +In case you didn't know, [Feedly][1] is one of the most popular online news aggregation services. It offers seamlessly unified news reading experience across desktops, Android and iOS devices via browser extensions and mobile apps. Feedly took on the demise of Google Reader in 2013, quickly gaining a lot of then Google Reader users. I was one of them, and Feedly has remained my default RSS reader since then. + +While I appreciate the sleek interface of Feedly's browser extensions and mobile apps, there is yet another way to access Feedly: Linux command-line. That's right. You can access Feedly's news feed from the command line. Sounds geeky? Well, at least for system admins who live on headless servers, this can be pretty useful. + +Enter [Feednix][2]. This open-source software is a Feedly's unofficial command-line client written in C++. It allows you to browse Feedly's news feed in ncurses-based terminal interface. By default, Feednix is linked with a console-based browser called w3m to allow you to read articles within a terminal environment. You can choose to read from your favorite web browser though. + +In this tutorial, I am going to demonstrate how to install and configure Feednix to access Feedly from the command line. + +### Install Feednix on Linux ### + +You can build Feednix from the source using the following instructions. At the moment, the "Ubuntu-stable" branch of the official Github repository has the most up-to-date code. So let's use this branch to build it. + +As prerequisites, you will need to install a couple of development libraries, as well as w3m browser. + +#### Debian, Ubuntu or Linux Mint #### + + $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + +#### Fedora #### + + $ sudo yum groupinstall "C Development Tools and Libraries" + $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + +Arch Linux + +On Arch Linux, you can easily install Feednix from [AUR][3]. + +### Configure Feednix for the First Time ### + +After installing it, launch Feednix as follows. + + $ feednix + +The first time you run Feednix, it will pop up a web browser window, where you need to sign up to create a Feedly's user ID and its corresponding developer access token. If you are running Feednix in a desktop-less environment, open a web browser on another computer, and go to https://feedly.com/v3/auth/dev. + +![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) + +Once you sign in, you will see your Feedly user ID generated. + +![](https://www.flickr.com/photos/xmodulo/15827565143/) + +To retrieve an access token, you need to follow the token link sent to your email address in your browser. Only then will you see the window showing your user ID, access token, and its expiration date. Be aware that access token is quite long (more than 200 characters). The token appears in a horizontally scrollable text box, so make sure to copy the whole access token string. + +![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) + +Paste your user ID and access token into the Feednix' command-line prompt. + + [Enter User ID] >> XXXXXX + [Enter token] >> YYYYY + +After successful authentication, you will see an initial Feednix screen with two panes. The left-side "Categories" pane shows a list of news categories, while the right-side "Posts" pane displays a list of news articles in the current category. + +![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) + +### Read News in Feednix ### + +Here I am going to briefly describe how to access Feedly via Feednix. + +#### Navigate Feednix #### + +As I mentioned, the top screen of Feednix consists of two panes. To switch focus between the two panes, use TAB key. To move up and down the list within a pane, use 'j' and 'k' keys, respectively. These keyboard shorcuts are obviously inspired by Vim text editor. + +#### Read an Article #### + +To read a particular article, press 'o' key at the current article. It will invoke w2m browser, and load the article inside the browser. Once you are done reading, press 'q' to quit the browser, and come back to Feednix. If your environment can open a web browser, you can press 'O' to load an article on your default web browser such as Firefox. + +![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) + +#### Subscribe to a News Feed #### + +You can add any arbitrary RSS news feed to your Feedly account from Feednix interface. To do so, simply press 'a' key. This will show "[ENTER FEED]:" prompt at the bottom of the screen. After typing the RSS feed, go ahead and fill in the name of the feed and its preferred category. + +![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) + +#### Summary #### + +As you can see, Feednix is a quite convenient and easy-to-use command-line RSS reader. If you are a command-line junkie as well as a regular Feedly user, Feednix is definitely worth trying. I have been communicating with the creator of Feednix, Jarkore, to troubleshoot some issue. As far as I can tell, he is very active in responding to bug reports and fixing bugs. I encourage you to try out Feednix and let him know your feedback. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/feedly-rss-feed-command-line-linux.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://feedly.com/ +[2]:https://github.com/Jarkore/Feednix +[3]:https://aur.archlinux.org/packages/feednix/ \ No newline at end of file diff --git a/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md b/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md new file mode 100644 index 0000000000..127f10affc --- /dev/null +++ b/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md @@ -0,0 +1,149 @@ +Install OpenQRM Cloud Computing Platform In Debian +================================================================================ +### Introduction ### + +**openQRM** is a web-based open source Cloud computing and datacenter management platform that integrates flexibly with existing components in enterprise data centers. + +It supports the following virtualization technologies: + +- KVM, +- XEN, +- Citrix XenServer, +- VMWare ESX, +- LXC, +- OpenVZ. + +The Hybrid Cloud Connector in openQRM supports a range of private or public cloud providers to extend your infrastructure on demand via **Amazon AWS**, **Eucalyptus** or **OpenStack**. It, also, automates provisioning, virtualization, storage and configuration management, and it takes care of high-availability. A self-service cloud portal with integrated billing system enables end-users to request new servers and application stacks on-demand. + +openQRM is available in two different flavours such as: + +- Enterprise Edition +- Community Edition + +You can view the difference between both editions [here][1]. + +### Features ### + +- Private/Hybrid Cloud Computing Platform; +- Manages physical and virtualized server systems; +- Integrates with all major open and commercial storage technologies; +- Cross-platform: Linux, Windows, OpenSolaris, and *BSD; +- Supports KVM, XEN, Citrix XenServer, VMWare ESX(i), lxc, OpenVZ and VirtualBox; +- Support for Hybrid Cloud setups using additional Amazon AWS, Eucalyptus, Ubuntu UEC cloud resources; +- Supports P2V, P2P, V2P, V2V Migrations and High-Availability; +- Integrates with the best Open Source management tools – like puppet, nagios/Icinga or collectd; +- Over 50 plugins for extended features and integration with your infrastructure; +- Self-Service Portal for end-users; +- Integrated billing system. + +### Installation ### + +Here, we will install openQRM in Ubuntu 14.04 LTS. Your server must atleast meet the following requirements. + +- 1 GB RAM; +- 100 GB Hdd; +- Optional: Virtualization enabled (VT for Intel CPUs or AMD-V for AMD CPUs) in Bios. + +First, install make package to compile openQRM source package. + + sudo apt-get update + sudo apt-get upgrade + sudo apt-get install make + +Then, run the following commands one by one to install openQRM. + +Download the latest available version [from here][2]. + + wget http://sourceforge.net/projects/openqrm/files/openQRM-Community-5.1/openqrm-community-5.1.tgz + + tar -xvzf openqrm-community-5.1.tgz + + cd openqrm-community-5.1/src/ + + sudo make + + sudo make install + + sudo make start + +During installation, you’ll be asked to update the php.ini file. + +![~-openqrm-community-5.1-src_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_001.png) + +Enter mysql root user password. + +![~-openqrm-community-5.1-src_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_002.png) + +Re-enter password: + +![~-openqrm-community-5.1-src_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_003.png) + +Select the mail server configuration type. + +![~-openqrm-community-5.1-src_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_004.png) + +If you’re not sure, select Local only. In our case, I go with **Local only** option. + +![~-openqrm-community-5.1-src_005](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_005.png) + +Enter your system mail name, and finally enter the Nagios administration password. + +![~-openqrm-community-5.1-src_007](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_007.png) + +The above commands will take long time depending upon your Internet connection to download all packages required to run openQRM. Be patient. + +Finally, you’ll get the openQRM configuration URL along with username and password. + +![~_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@debian-_002.png) + +### Configuration ### + +After installing openQRM, open up your web browser and navigate to the URL: **http://ip-address/openqrm**. + +For example, in my case http://192.168.1.100/openqrm. + +The default username and password is: **openqrm/openqrm**. + +![Mozilla Firefox_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/Mozilla-Firefox_003.png) + +Select a network card to use for the openQRM management network. + +![openQRM Server - Mozilla Firefox_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_004.png) + +Select a database type. In our case, I selected mysql. + +![openQRM Server - Mozilla Firefox_006](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_006.png) + +Now, configure the database connection and initialize openQRM. Here, I use **openQRM** as database name, and user as **root** and debian as password for the database. Be mindful that you should enter the mysql root user password that you have created while installing openQRM. + +![openQRM Server - Mozilla Firefox_012](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_012.png) + +Congratulations!! openQRM has been installed and configured. + +![openQRM Server - Mozilla Firefox_013](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png) + +### Update openQRM ### + +To update openQRM at any time run the following command: + + cd openqrm/src/ + make update + +What we have done so far is just installed and configured openQRM in our Ubuntu server. For creating, running Virtual Machines, managing Storage, integrating additional systems and running your own private Cloud, I suggest you to read the [openQRM Administrator Guide][3]. + +That’s all now. Cheers! Happy weekend!! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/install-openqrm-cloud-computing-platform-debian/ + +作者:[SK][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:http://www.openqrm-enterprise.com/products/edition-comparison.html +[2]:http://sourceforge.net/projects/openqrm/files/?source=navbar +[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf \ No newline at end of file diff --git a/sources/tech/20150211 25 Tips for Intermediate Git Users.md b/sources/tech/20150211 25 Tips for Intermediate Git Users.md new file mode 100644 index 0000000000..71ead3ad6a --- /dev/null +++ b/sources/tech/20150211 25 Tips for Intermediate Git Users.md @@ -0,0 +1,470 @@ +zpl1025 +25 Tips for Intermediate Git Users +================================================================================ +I’ve been using git for about 18 months now and thought I knew it pretty well. Then we had [Scott Chacon][1] from GitHub over to do some training at [LVS, a supplier/developer of betting/gaming software][2] (where contracted until 2013) and I learnt a ton in the first day. + +As someone who’s always felt fairly comfortable in Git, I thought sharing some of the nuggets I learnt with the community might help someone to find an answer without needing to do lots of research. + +### Basic Tips ### + +#### 1. First Steps After Install #### + +After installing Git, the first thing you should do is configure your name and email, as every commit will have these details: + + $ git config --global user.name "Some One" + $ git config --global user.email "someone@gmail.com" + +#### 2. Git is Pointer-Based #### + +Everything stored in git is in a file. When you create a commit it creates a file containing your commit message and associated data (name, email, date/time, previous commit, etc) and links it to a tree file. The tree file contains a list of objects or other trees. The object or blob is the actual content associated with the commit (a file, if you will, although the filename isn’t stored in the object, but in the tree). All of these files are stored with a filename of a SHA-1 hash of the object. + +From there branches and tags are simply files containing (basically) a SHA-1 hash which points to the commit. Using these references allows for a lot of flexibility and speed, as creating a new branch is as simple as creating a file with the name of the branch and the SHA-1 reference to the commit you’re branching from. Of course, you’d never do that as you’d use the Git command line tools (or a GUI), but it’s that simple. + +You may have heard references to the HEAD. This is simply a file containing the SHA-1 reference of the commit you’re currently pointing to. If you’re resolving a merge conflict and see HEAD, that’s nothing to do with a particular branch or necessarily a particular point on the branch but where you currently are. + +All the branch pointers are kept in .git/refs/heads, HEAD is in .git/HEAD and tags are in .git/refs/tags – feel free to have a look in there. + +#### 3. Two Parents – of course! #### + +When viewing a merge commit message in a log, you will see two parents (as opposed to the normal one for a work-based commit). The first parent is the branch you were on and the second is the one you merged in to it. + +#### 4. Merge Conflicts #### + +By now I’m sure you have had a merge conflict and had to resolve it. This is normally done by editing the file, removing the <<<<, ====, >>>> markers and the keeping the code you want to store. Sometimes it’s nice to see the code before either change, i.e. before you made the change in both branches that now conflicts. This is one command away: + + $ git diff --merge + diff --cc dummy.rb + index 5175dde,0c65895..4a00477 + --- a/dummy.rb + +++ b/dummy.rb + @@@ -1,5 -1,5 +1,5 @@@ + class MyFoo + def say + - puts "Bonjour" + - puts "Hello world" + ++ puts "Annyong Haseyo" + end + end + +If the file is binary, diffing files isn’t so easy… What you’ll normally want to do is to try each version of the binary file and decide which one to use (or manually copy portions over in the binary file’s editor). To pull a copy of the file from a particular branch (say you’re merging master and feature132): + + $ git checkout master flash/foo.fla # or... + $ git checkout feature132 flash/foo.fla + $ # Then... + $ git add flash/foo.fla + +Another way is to cat the file from git – you can do this to another filename then copy the correct file over (when you’ve decided which it is) to the normal filename: + + $ git show master:flash/foo.fla > master-foo.fla + $ git show feature132:flash/foo.fla > feature132-foo.fla + $ # Check out master-foo.fla and feature132-foo.fla + $ # Let's say we decide that feature132's is correct + $ rm flash/foo.fla + $ mv feature132-foo.fla flash/foo.fla + $ rm master-foo.fla + $ git add flash/foo.fla + +UPDATE: Thanks to Carl in the comments on the original blog post for the reminder, you can actually use “git checkout —ours flash/foo.fla” and “git checkout —theirs flash/foo.fla” to checkout a particular version without remembering which branches you merge in. Personally I prefer to be more explicit, but the option is there… + +Remember to add the file after resolving the merge conflict (as I do above). + +### Servers, Branching and Tagging ### + +#### 5. Remote Servers #### + +One of the most powerful features of Git is the ability to have more than one remote server (as well as the fact that you’re running a local repository always). You don’t always need write access either, you may have multiple servers you read from (to merge work in) and then write to another. To add a new remote server is simple: + + $ git remote add john git@github.com:johnsomeone/someproject.git + +If you want to see information about your remote servers you can do: + + # shows URLs of each remote server + $ git remote -v + + # gives more details about each + $ git remote show name + +You can always see the differences between a local branch and a remote branch: + + $ git diff master..john/master + +You can also see the changes on HEAD that aren’t on that remote branch: + + $ git log remote/branch.. + # Note: no final refspec after .. + +#### 6. Tagging #### + +In Git there are two types of tag – a lightweight tag and an annotated tag. Bearing in mind Tip 2 about Git being pointer based, the difference between the two is simple. A lightweight tag is simply a named pointer to a commit. You can always change it to point to another commit. An annotated tag is a name pointer to a tag object, with it’s own message and history. As it has it’s own message it can be GPG signed if required. + +Creating the two types of tag is easy (and one command line switch different) + + $ git tag to-be-tested + $ git tag -a v1.1.0 # Prompts for a tag message + +#### 7. Creating Branches #### + +Creating branches in git is very easy (and lightning quick due to it only needing to create a less than 100 byte file). The longhand way of creating a new branch and switching to it: + + $ git branch feature132 + $ git checkout feature132 + +Of course, if you know you’re going to want to switch to it straight away you can do it in one command: + + $ git checkout -b feature132 + +If you want to rename a local branch it’s as easy as (the long way to show what happens): + + $ git checkout -b twitter-experiment feature132 + $ git branch -d feature132 + +Update: Or you can (as Brian Palmer points out in the comments on the original blog post) just use the -m switch to “git branch” to do it in one step (as Mike points out, if you only specify one branch it renames your current branch): + + $ git branch -m twitter-experiment + $ git branch -m feature132 twitter-experiment + +#### 8. Merging Branches #### + +At some point in the future, you’re going to want to merge your changes back in. There are two ways to do this: + + $ git checkout master + $ git merge feature83 # Or... + $ git rebase feature83 + +The difference between merge and rebase is that merge tries to resolve the changes and create a new commit that blends them. Rebase tries to take your changes since you last diverged from the other branch and replay them from the HEAD of the other branch. However, don’t rebase after you’ve pushed a branch to a remote server – this can cause confusion/problems. + +If you aren’t sure which branches still have unique work on them – so you know which you need to merge and which ones can be removed, there are two switches to git branch that help: + + # Shows branches that are all merged in to your current branch + $ git branch --merged + + # Shows branches that are not merged in to your current branch + $ git branch --no-merged + +#### 9. Remote Branches #### + +If you have a local branch that you’d like to appear on a remote server, you can push it up with one command: + + $ git push origin twitter-experiment:refs/heads/twitter-experiment + # Where origin is our server name and twitter-experiment is the branch + +Update: Thanks to Erlend in the comments on the original blog post – this is actually the same as doing `git push origin twitter-experiment` but by using the full syntax you can see that you can actually use different names on both ends (so your local can be `add-ssl-support` while your remote name can be `issue-1723`). + +If you want to delete a branch from the server (note the colon before the branch name): + + $ git push origin :twitter-experiment + +If you want to show the state of all remote branches you can view them like this: + + $ git remote show origin + +This may list some branches that used to exist on the server but now don’t exist. If this is the case you can easily remove them from your local checkout using: + + $ git remote prune + +Finally, if you have a remote branch that you want to track locally, the longhand way is: + + $ git branch --track myfeature origin/myfeature + $ git checkout myfeature + +However, newer versions of Git automatically set up tracking if you use the -b flag to checkout: + + $ git checkout -b myfeature origin/myfeature + +### Storing Content in Stashes, Index and File System ### + +#### 10. Stashing #### + +In Git you can drop your current work state in to a temporary storage area stack and then re-apply it later. The simple case is as follows: + + $ git stash + # Do something... + $ git stash pop + +A lot of people recommend using `git stash apply` instead of pop, however if you do this you end up with a long list of stashes left hanging around. “pop” will only remove it from the stack if it applies cleanly. If you’ve used `git stash apply` you can remove the last item from the stack anyway using: + + $ git stash drop + +Git will automatically create a comment based on the current commit message. If you’d prefer to use a custom message (as it may have nothing to do with the previous commit): + + $ git stash save "My stash message" + +If you want to apply a particular stash from your list (not necessarily the last one) you can list them and apply it like this: + + $ git stash list + stash@{0}: On master: Changed to German + stash@{1}: On master: Language is now Italian + $ git stash apply stash@{1} + +#### 11. Adding Interactively #### + +In the subversion world you change files and then just commit everything that has changed. In Git you have a LOT more power to commit just certain files or even certain patches. To commit certain files or parts of files you need to go in to interactive mode. + + $ git add -i + staged unstaged path + + + *** Commands *** + 1: status 2: update 3: revert 4: add untracked + 5: patch 6: diff 7: quit 8: help + What now> + +This drops you in to a menu based interactive prompt. You can use the numbers of the commands or the highlighted letters (if you have colour highlighting turned on) to go in to that mode. Then it’s normally a matter of typing the numbers of the files you want to apply that action to (you can use formats like 1 or 1-4 or 2,4,7). + +If you want to go to patch mode (‘p’ or ‘5’ from interactive mode) you can also go straight in to that mode: + + $ git add -p + diff --git a/dummy.rb b/dummy.rb + index 4a00477..f856fb0 100644 + --- a/dummy.rb + +++ b/dummy.rb + @@ -1,5 +1,5 @@ + class MyFoo + def say + - puts "Annyong Haseyo" + + puts "Guten Tag" + end + end + Stage this hunk [y,n,q,a,d,/,e,?]? + +As you can see you then get a set of options at the bottom for choosing to add this changed part of the file, all changes from this file, etc. Using the ‘?’ command will explain the options. + +#### 12. Storing/Retrieving from the File System #### + +Some projects (the Git project itself for example) store additional files directly in the Git file system without them necessarily being a checked in file. + +Let’s start off by storing a random file in Git: + + $ echo "Foo" | git hash-object -w --stdin + 51fc03a9bb365fae74fd2bf66517b30bf48020cb + +At this point the object is in the database, but if you don’t set something up to point to that object it will be garbage collected. The easiest way is to tag it: + + $ git tag myfile 51fc03a9bb365fae74fd2bf66517b30bf48020cb + +Note that here we’ve used the tag myfile. When we need to retrieve the file we can do it with: + + $ git cat-file blob myfile + +This can be useful for utility files that developers may need (passwords, gpg keys, etc) but you don’t want to actually check out on to disk every time (particularly in production). + +### Logging and What Changed? ### + +#### 13. Viewing a Log #### + +You can’t use Git for long without using ‘git log’ to view your recent commits. However, there are some tips on how to use it better. For example, you can view a patch of what changed in each commit with: + + $ git log -p + +Or you can just view a summary of which files changed with: + + $ git log --stat + +There’s a nice alias you can set up which shows abbreviated commits and a nice graph of branches with the messages on a single line (like gitk, but on the command line): + + $ git config --global alias.lol "log --pretty=oneline --abbrev-commit --graph --decorate" + $ git lol + * 4d2409a (master) Oops, meant that to be in Korean + * 169b845 Hello world + +#### 14. Searching in the Log #### + +If you want to search for a particular author you can specify that: + + $ git log --author=Andy + +Update: Thanks to Johannes in the comments, I’ve cleared up some of the confusion here. + +Or if you have a search term that appears in the commit message: + + $ git log --grep="Something in the message" + +There’s also a more powerful command called the pickaxe command that look for the entry that removes or adds a particular piece of content (i.e. when it first appeared or was removed). This can tell you when a line was added (but not if a character on that line was later changed): + + $ git log -S "TODO: Check for admin status" + +What about if you changed a particular file, e.g. `lib/foo.rb` + + $ git log lib/foo.rb + +Let’s say you have a `feature/132` branch and a `feature/145` and you want to view the commits on those branches that aren’t on master (note the ^ meaning not): + + $ git log feature/132 feature/145 ^master + +You can also narrow it down to a date range using ActiveSupport style dates: + + $ git log --since=2.months.ago --until=1.day.ago + +By default it will use OR to combine the query, but you can easily change it to use AND (if you have more than one criteria) + + $ git log --since=2.months.ago --until=1.day.ago --author=andy -S "something" --all-match + +#### 15. Selecting Revisions to View/Change #### + +There are a number of items you can specify when referring to a revision, depending on what you know about it: + + $ git show 12a86bc38 # By revision + $ git show v1.0.1 # By tag + $ git show feature132 # By branch name + $ git show 12a86bc38^ # Parent of a commit + $ git show 12a86bc38~2 # Grandparent of a commit + $ git show feature132@{yesterday} # Time relative + $ git show feature132@{2.hours.ago} # Time relative + +Note that unlike the previous section, a caret on the end means the parent of that commit – a caret at the start means not on this branch. + +#### 16. Selecting a Range #### + +The easiest way is to use: + + $ git log origin/master..new + # [old]..[new] - everything you haven't pushed yet + +You can also omit the [new] and it will use your current HEAD. + +### Rewinding Time & Fixing Mistakes ### + +#### 17. Resetting changes #### + +You can easily unstage a change if you haven’t committed it using: + + $ git reset HEAD lib/foo.rb + +Often this is aliased to ‘unstage’ as it’s a bit non-obvious. + + $ git config --global alias.unstage "reset HEAD" + $ git unstage lib/foo.rb + +If you’ve committed the file already, you can do two things – if it’s the last commit you can just amend it: + + $ git commit --amend + +This undoes the last commit, puts your working copy back as it was with the changes staged and the commit message ready to edit/commit next time you commit. + +If you’ve committed more than once and just want to completely undo them, you can reset the branch back to a previous point in time. + + $ git checkout feature132 + $ git reset --hard HEAD~2 + +If you actually want to bring a branch to point to a completely different SHA1 (maybe you’re bringing the HEAD of a branch to another branch, or a further commit) you can do the following to do it the long way: + + $ git checkout FOO + $ git reset --hard SHA + +There’s actually a quicker way (as it doesn’t change your working copy back to the state of FOO first then forward to SHA): + + $ git update-ref refs/heads/FOO SHA + +#### 18. Committing to the Wrong Branch #### + +OK, let’s assume you committed to master but should have created a topic branch called experimental instead. To move those changes over, you can create a branch at your current point, rewind head and then checkout your new branch: + + $ git branch experimental # Creates a pointer to the current master state + $ git reset --hard master~3 # Moves the master branch pointer back to 3 revisions ago + $ git checkout experimental + +This can be more complex if you’ve made the changes on a branch of a branch of a branch etc. Then what you need to do is rebase the change on a branch on to somewhere else: + + $ git branch newtopic STARTPOINT + $ git rebase oldtopic --onto newtopic + +#### 19. Interactive Rebasing #### + +This is a cool feature I’ve seen demoed before but never actually understood, now it’s easy. Let’s say you’ve made 3 commits but you want to re-order them or edit them (or combine them): + + $ git rebase -i master~3 + +Then you get your editor pop open with some instructions. All you have to do is amend the instructions to pick/squash/edit (or remove them) commits and save/exit. Then after editing you can `git rebase —continue` to keep stepping through each of your instructions. + +If you choose to edit one, it will leave you in the state you were in at the time you committed that, so you need to use git commit —amend to edit it. + +**Note: DO NOT COMMIT DURING REBASE – only add then use —continue, —skip or —abort.** + +#### 20. Cleaning Up #### + +If you’ve committed some content to your branch (maybe you’ve imported an old repo from SVN) and you want to remove all occurrences of a file from the history: + + $ git filter-branch --tree-filter 'rm -f *.class' HEAD + +If you’ve already pushed to origin, but have committed the rubbish since then, you can also do this for your local system before pushing: + + $ git filter-branch --tree-filter 'rm -f *.class' origin/master..HEAD + +### Miscellaneous Tips ### + +#### 21. Previous References You’ve Viewed #### + +If you know you’ve previously viewed a SHA-1, but you’ve done some resetting/rewinding you can use the reflog commands to view the SHA-1s you’ve recently viewed: + + $ git reflog + $ git log -g # Same as above, but shows in 'log' format + +#### 22. Branch Naming #### + +A lovely little tip – don’t forget that branch names aren’t limited to a-z and 0-9. It can be quite nice to use / and . in names for fake namespacing or versionin, for example: + + $ # Generate a changelog of Release 132 + $ git shortlog release/132 ^release/131 + $ # Tag this as v1.0.1 + $ git tag v1.0.1 release/132 + +#### 23. Finding Who Dunnit #### + +Often it can be useful to find out who changed a line of code in a file. The simple command to do this is: + + $ git blame FILE + +Sometimes the change has come from a previous file (if you’ve combined two files, or you’ve moved a function) so you can use: + + $ # shows which file names the content came from + $ git blame -C FILE + +Sometimes it’s nice to track this down by clicking through changes and going further and further back. There’s a nice in-built gui for this: + + $ git gui blame FILE + +#### 24. Database Maintenance #### + +Git doesn’t generally require a lot of maintenance, it pretty much takes care of itself. However, you can view the statistics of your database using: + + $ git count-objects -v + +If this is high you can choose to garbage collect your clone. This won’t affect pushes or other people but it can make some of your commands run much faster and take less space: + + $ git gc + +It also might be worth running a consistency check every so often: + + $ git fsck --full + +You can also add a `—auto` parameter on the end (if you’re running it frequently/daily from crontab on your server) and it will only fsck if the stats show it’s necessary. + +When checking, getting “dangling” or “unreachable” is fine, this is often a result of rewinding heads or rebasing. Getting “missing” or “sha1 mismatch” is bad… Get professional help! + +#### 25. Recovering a Lost Branch #### + +If you delete a branch experimental with -D you can recreate it with: + + $ git branch experimental SHA1_OF_HASH + +You can often find the SHA1 hash using git reflog if you’ve accessed it recently. + +Another way is to use `git fsck —lost-found`. A dangling commit here is the lost HEAD (it will only be the HEAD of the deleted branch as the HEAD^ is referred to by HEAD so it’s not dangling) + +### Done! ### + +Wow, the longest blog post I’ve ever written, I hope someone finds it useful. If you did, or if you have any questions let me know in the comments… + +-------------------------------------------------------------------------------- + +via: https://www.andyjeffries.co.uk/25-tips-for-intermediate-git-users/ + +作者:[Andy Jeffries][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.andyjeffries.co.uk/author/andy-jeffries/ +[1]:http://gitcasts.com/about +[2]:http://www.lvs.co.uk/ diff --git a/sources/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/sources/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md new file mode 100644 index 0000000000..fe2432f8b3 --- /dev/null +++ b/sources/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md @@ -0,0 +1,70 @@ +Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10 +================================================================================ +A low-overhead monitoring web dashboard for a GNU/Linux machine. Simply drop-in the app and go!.Linux Dash's interface provides a detailed overview of all vital aspects of your server, including RAM and disk usage, network, installed software, users, and running processes. All information is organized into sections, and you can jump to a specific section using the buttons in the main toolbar. Linux Dash is not the most advanced monitoring tool out there, but it might be a good fit for users looking for a slick, lightweight, and easy to deploy application. + +### Linux-Dash Features ### + +A beautiful web-based dashboard for monitoring server info + +Live, on-demand monitoring of RAM, Load, Uptime, Disk Allocation, Users and many more system stats + +Drop-in install for servers with Apache2/nginx + PHP + +Click and drag to re-arrange widgets + +Support for wide range of linux server flavors + +### List of Current Widgets ### + +- General info +- Load Average +- RAM +- Disk Usage +- Users +- Software +- IP +- Internet Speed +- Online +- Processes +- Logs + +### Install Linux-dash on ubuntu server 14.10 ### + +First you need to make sure you have [Ubuntu LAMP server 14.10][1] installed and Now you have to install the following package + + sudo apt-get install php5-json unzip + +After the installation this module will enable for apache2 so you need to restart the apache2 server using the following command + + sudo service apache2 restart + +Now you need to download the linux-dash package and install + + wget https://github.com/afaqurk/linux-dash/archive/master.zip + + unzip master.zip + + sudo mv linux-dash-master/ /var/www/html/linux-dash-master/ + +Now you need to change the permissions using the following command + + sudo chmod 755 /var/www/html/linux-dash-master/ + +Now you need to go to http://serverip/linux-dash-master/ you should see similar to the following output + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/2.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/install-linux-dash-web-based-monitoring-tool-on-ubntu-14-10.html + +作者:[ruchi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix +[1]:http://www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html diff --git a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md new file mode 100644 index 0000000000..29bb770e5d --- /dev/null +++ b/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md @@ -0,0 +1,270 @@ +Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules +================================================================================ +For those of you in the hosting business, or if you’re hosting your own servers and exposing them to the Internet, securing your systems against attackers must be a high priority. + +mod_security (an open source intrusion detection and prevention engine for web applications that integrates seamlessly with the web server) and mod_evasive are two very important tools that can be used to protect a web server against brute force or (D)DoS attacks. + +mod_evasive, as its name suggests, provides evasive capabilities while under attack, acting as an umbrella that shields web servers from such threats. + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg) +Install Mod_Security and Mod_Evasive to Protect Apache + +In this article we will discuss how to install, configure, and put them into play along with Apache on RHEL/CentOS 6 and 7 as well as Fedora 21-15. In addition, we will simulate attacks in order to verify that the server reacts accordingly. + +This assumes that you have a LAMP server installed on your system. If not, please check this article before proceeding further. + +- [Install LAMP stack in RHEL/CentOS 7][1] + +You will also need to setup iptables as the default [firewall][2] front-end instead of firewalld if you’re running RHEL/CentOS 7 or Fedora 21. We do this in order to use the same tool in both RHEL/CentOS 7/6 and Fedora 21. + +### Step 1: Installing Iptables Firewall on RHEL/CentOS 7 and Fedora 21 ### + +To begin, stop and disable firewalld: + + # systemctl stop firewalld + # systemctl disable firewalld + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-Firewalld-Service.png) +Disable Firewalld Service + +Then install the iptables-services package before enabling iptables: + + # yum update && yum install iptables-services + # systemctl enable iptables + # systemctl start iptables + # systemctl status iptables + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Iptables-Firewall.png) +Install Iptables Firewall + +### Step 2: Installing Mod_Security and Mod_evasive ### + +In addition to having a LAMP setup already in place, you will also have to [enable the EPEL repository][3] in RHEL/CentOS 7/6 in order to install both packages. Fedora users don’t need to enable any repo, because epel is a already part of Fedora project. + + # yum update && yum install mod_security mod_evasive + +When the installation is complete, you will find the configuration files for both tools in /etc/httpd/conf.d. + + # ls -l /etc/httpd/conf.d + +![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png) +mod_security + mod_evasive Configurations + +Now, in order to integrate these two modules with Apache and have it load them when it starts, make sure the following lines appear in the top level section of mod_evasive.conf and mod_security.conf, respectively: + + LoadModule evasive20_module modules/mod_evasive24.so + LoadModule security2_module modules/mod_security2.so + +Note that modules/mod_security2.so and modules/mod_evasive24.so are the relative paths, from the /etc/httpd directory to the source file of the module. You can verify this (and change it, if needed) by listing the contents of the /etc/httpd/modules directory: + + # cd /etc/httpd/modules + # pwd + # ls -l | grep -Ei '(evasive|security)' + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png) +Verify mod_security + mod_evasive Modules + +Then restart Apache and verify that it loads mod_evasive and mod_security: + + # service httpd restart [On RHEL/CentOS 6 and Fedora 20-18] + # systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21] + +---------- + + [Dump a list of loaded Static and Shared Modules] + + # httpd -M | grep -Ei '(evasive|security)' + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png) +Check mod_security + mod_evasive Modules Loaded + +### Step 3: Installing A Core Rule Set and Configuring Mod_Security ### + +In few words, a Core Rule Set (aka CRS) provides the web server with instructions on how to behave under certain conditions. The developer firm of mod_security provide a free CRS called OWASP ([Open Web Application Security Project][4]) ModSecurity CRS that can be downloaded and installed as follows. + +1. Download the OWASP CRS to a directory created for that purpose. + + # mkdir /etc/httpd/crs-tecmint + # cd /etc/httpd/crs-tecmint + # wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png) +Download mod_security Core Rules + +2. Untar the CRS file and change the name of the directory for one of our convenience. + + # tar xzf master + # mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) +Extract mod_security Core Rules + +3. Now it’s time to configure mod_security. Copy the sample file with rules (owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example) into another file without the .example extension: + + # cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf + +and tell Apache to use this file along with the module by inserting the following lines in the web server’s main configuration file /etc/httpd/conf/httpd.conf file. If you chose to unpack the tarball in another directory you will need to edit the paths following the Include directives: + + + Include crs-tecmint/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf + Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf + + +Finally, it is recommended that we create our own configuration file within the /etc/httpd/modsecurity.d directory where we will place our customized directives (we will name it tecmint.conf in the following example) instead of modifying the CRS files directly. Doing so will allow for easier upgrading the CRSs as new versions are released. + + + SecRuleEngine On + SecRequestBodyAccess On + SecResponseBodyAccess On + SecResponseBodyMimeType text/plain text/html text/xml application/octet-stream + SecDataDir /tmp + + +You can refer to the [SpiderLabs’ ModSecurity GitHub][5] repository for a complete explanatory guide of mod_security configuration directives. + +### Step 4: Configuring Mod_Evasive ### + +mod_evasive is configured using directives in /etc/httpd/conf.d/mod_evasive.conf. Since there are no rules to update during a package upgrade, we don’t need a separate file to add customized directives, as opposed to mod_security. + +The default mod_evasive.conf file has the following directives enabled (note that this file is heavily commented, so we have stripped out the comments to highlight the configuration directives below): + + + DOSHashTableSize 3097 + DOSPageCount 2 + DOSSiteCount 50 + DOSPageInterval 1 + DOSSiteInterval 1 + DOSBlockingPeriod 10 + + +Explanation of the directives: + +- DOSHashTableSize: This directive specifies the size of the hash table that is used to keep track of activity on a per-IP address basis. Increasing this number will provide a faster look up of the sites that the client has visited in the past, but may impact overall performance if it is set too high. +- DOSPageCount: Legitimate number of identical requests to a specific URI (for example, any file that is being served by Apache) that can be made by a visitor over the DOSPageInterval interval. +- DOSSiteCount: Similar to DOSPageCount, but refers to how many overall requests can be made to the entire site over the DOSSiteInterval interval. +- DOSBlockingPeriod: If a visitor exceeds the limits set by DOSSPageCount or DOSSiteCount, his source IP address will be blacklisted during the DOSBlockingPeriod amount of time. During DOSBlockingPeriod, any requests coming from that IP address will encounter a 403 Forbidden error. + +Feel free to experiment with these values so that your web server will be able to handle the required amount and type of traffic. + +**Only a small caveat**: if these values are not set properly, you run the risk of ending up blocking legitimate visitors. + +You may also want to consider other useful directives: + +#### DOSEmailNotify #### + +If you have a mail server up and running, you can send out warning messages via Apache. Note that you will need to grant the apache user SELinux permission to send emails if SELinux is set to enforcing. You can do so by running + + # setsebool -P httpd_can_sendmail 1 + +Next, add this directive in the mod_evasive.conf file with the rest of the other directives: + + DOSEmailNotify you@yourdomain.com + +If this value is set and your mail server is working properly, an email will be sent to the address specified whenever an IP address becomes blacklisted. + +#### DOSSystemCommand #### + +This needs a valid system command as argument, + + DOSSystemCommand
+ +This directive specifies a command to be executed whenever an IP address becomes blacklisted. It is often used in conjunction with a shell script that adds a firewall rule to block further connections coming from that IP address. + +**Write a shell script that handles IP blacklisting at the firewall level** + +When an IP address becomes blacklisted, we need to block future connections coming from it. We will use the following shell script that performs this job. Create a directory named scripts-tecmint (or whatever name of your choice) in /usr/local/bin and a file called ban_ip.sh in that directory. + + #!/bin/sh + # IP that will be blocked, as detected by mod_evasive + IP=$1 + # Full path to iptables + IPTABLES="/sbin/iptables" + # mod_evasive lock directory + MOD_EVASIVE_LOGDIR=/var/log/mod_evasive + # Add the following firewall rule (block all traffic coming from $IP) + $IPTABLES -I INPUT -s $IP -j DROP + # Remove lock file for future checks + rm -f "$MOD_EVASIVE_LOGDIR"/dos-"$IP" + +Our DOSSystemCommand directive should read as follows: + + DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" + +In the line above, %s represents the offending IP as detected by mod_evasive. + +**Add the apache user to the sudoers file** + +Note that all of this just won’t work unless you to give permissions to user apache to run our script (and that script only!) without a terminal and password. As usual, you can just type visudo as root to access the /etc/sudoers file and then add the following 2 lines as shown in the image below: + + apache ALL=NOPASSWD: /usr/local/bin/scripts-tecmint/ban_ip.sh + Defaults:apache !requiretty + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png) +Add Apache User to Sudoers + +**IMPORTANT**: As a default security policy, you can only run sudo in a terminal. Since in this case we need to use sudo without a tty, we have to comment out the line that is highlighted in the following image: + + #Defaults requiretty + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png) +Disable tty for Sudo + +Finally, restart the web server: + + # service httpd restart [On RHEL/CentOS 6 and Fedora 20-18] + # systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21] + +### Step 4: Simulating an DDoS Attacks on Apache ### + +There are several tools that you can use to simulate an external attack on your server. You can just google for “tools for simulating ddos attacks” to find several of them. + +Note that you, and only you, will be held responsible for the results of your simulation. Do not even think of launching a simulated attack to a server that you’re not hosting within your own network. + +Should you want to do the same with a VPS that is hosted by someone else, you need to appropriately warn your hosting provider or ask permission for such a traffic flood to go through their networks. Tecmint.com is not, by any means, responsible for your acts! + +In addition, launching a simulated DoS attack from only one host does not represent a real life attack. To simulate such, you would need to target your server from several clients at the same time. + +Our test environment is composed of a CentOS 7 server [IP 192.168.0.17] and a Windows host from which we will launch the attack [IP 192.168.0.103]: + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) +Confirm Host IPAddress + +Please play the video below and follow the steps outlined in the indicated order to simulate a simple DoS attack: + +注:youtube视频,发布的时候不行做个链接吧 + + +Then the offending IP is blocked by iptables: + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png) +Blocked Attacker IP + +### Conclusion ### + +With mod_security and mod_evasive enabled, the simulated attack causes the CPU and RAM to experiment a temporary usage peak for only a couple of seconds before the source IPs are blacklisted and blocked by the firewall. Without these tools, the simulation will surely knock down the server very fast and render it unusable during the duration of the attack. + +We would love to hear if you’re planning on using (or have used in the past) these tools. We always look forward to hearing from you, so don’t hesitate to leave your comments and questions, if any, using the form below. + +### Reference Links ### + +- [https://www.modsecurity.org/][6] +- [http://www.zdziarski.com/blog/?page_id=442][7] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/ +[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project +[5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives +[6]:https://www.modsecurity.org/ +[7]:http://www.zdziarski.com/blog/?page_id=442 \ No newline at end of file diff --git a/sources/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md b/sources/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md new file mode 100644 index 0000000000..f2f7a9a270 --- /dev/null +++ b/sources/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md @@ -0,0 +1,143 @@ +How to analyze and view Apache web server logs interactively on Linux +================================================================================ +Whether you are in the web hosting business, or run a few web sites on a VPS yourself, chances are you want to display visitor statistics such as top visitors, requested files (dynamic or static), used bandwidth, client browsers, and referring sites, and so forth. + +[GoAccess][1] is a command-line log analyzer and interactive viewer for Apache or Nginx web server. With this tool, you will not only be able to browse the data mentioned earlier, but also parse the web server logs to dig for further data as well - and **all of this within a terminal window in real time**. Since as of today [most web servers][2] use either a Debian derivative or a Red Hat based distribution as the underlying operating system, I will show you how to install and use GoAccess in Debian and CentOS. + +### Installing GoAccess on Linux ### + +In Debian, Ubuntu and derivatives, run the following command to install GoAccess: + + # aptitude install goaccess + +In CentOS, you'll need to enable the [EPEL repository][3] and then: + + # yum install goaccess + +In Fedora, simply use yum command: + + # yum install goaccess + +If you want to install GoAccess from the source to enable further options (such as GeoIP location), install [required dependencies][4] for your operating system, and then follow these steps: + + # wget http://tar.goaccess.io/goaccess-0.8.5.tar.gz + # tar -xzvf goaccess-0.8.5.tar.gz + # cd goaccess-0.8.5/ + # ./configure --enable-geoip + # make + # make install + +That will install version 0.8.5, but you can always verify what is the latest version in the [Downloads page][5] of the project's web site. + +Since GoAccess does not require any further configurations, once it's installed you are ready to go. + +### Running GoAccess ### + +To start using GoAccess, just run it against your Apache access log. + +For Debian and derivatives: + + # goaccess -f /var/log/apache2/access.log + +For Red Hat based distros: + + # goaccess -f /var/log/httpd/access_log + +When you first launch GoAccess, you will be presented with the following screen to choose the date and log format. As explained, you can toggle between options using the spacebar and proceed with F10. As for the date and log formats, you may want to refer to the [Apache documentation][6] if you need to refresh your memory. + +In this case, Choose Common Log Format (CLF): + +![](https://farm8.staticflickr.com/7422/15868350373_30c16d7c30.jpg) + +and then press F10. You will be presented with the statistics screen. For the sake of brevity, only the header, which shows the summary of the log file, is shown in the next image: + +![](https://farm9.staticflickr.com/8683/16486742901_7a35b5df69_b.jpg) + +### Browsing Web Server Statistics with GoAccess ### + +As you scroll down the page with the down arrow, you will find the following sections, sorted by requests. The order of the categories presented here may vary depending on your distribution or your preferred installation method (from repositories or from source): + +1. Unique visitors per day (HTTP requests having the same IP, same date and same agent are considered an unique visit) + +![](https://farm8.staticflickr.com/7308/16488483965_a439dbc5e2_b.jpg) + +2. Requested files (Pages-URL) + +![](https://farm9.staticflickr.com/8651/16488483975_66d05dce51_b.jpg) + +3. Requested static files (e.g., .png, .js, etc) + +4. Referrers URLs (the URLs where each request came from) + +5. HTTP 404 Not Found response code + +![](https://farm9.staticflickr.com/8669/16486742951_436539b0da_b.jpg) + +6. Operating Systems + +7. Browsers + +8. Hosts (client IPs) + +![](https://farm8.staticflickr.com/7392/16488483995_56e706d77c_z.jpg) + +9. HTTP status codes + +![](https://farm8.staticflickr.com/7282/16462493896_77b856f670_b.jpg) + +10. Top referring sites + +11. Top keyphrases used on Google's search engine + +If you also want to inspect the archived logs, you can pipe them to GoAccess as follows. + +For Debian and derivatives: + + # zcat -f /var/log/apache2/access.log* | goaccess + +For Red Hat based distributions: + + # cat /var/log/httpd/access* | goaccess + +Should you need a more detailed report of any of the above (1 through 11), press the desired section number and then O (uppercase o) to bring up what is called the Detailed View. The following image shows the output of 5-O (press 5, then press O): + +![](https://farm8.staticflickr.com/7382/16302213429_48d9233f40_b.jpg) + +To display GeoIP location information, open the Detail View in the Hosts section, as explained earlier, and you will see the location of the client IPs that performed requests to your web server: + +![](https://farm8.staticflickr.com/7393/16488484075_d778aa91a2_z.jpg) + +If your system has not been very busy lately, some of the above sections will not show a great deal of information, but that situation can change as more and more requests are made to your web server. + +### Saving Reports for Offline Analysis ### + +There will be times when you don't want to inspect your system's stats in real time, but save it to a file for offline analysis or printing. To generate an HTML report, simply redirect the output of the GoAccess commands mentioned earlier to an HTML file. Then just point your web browser to the file to open it. + + # zcat -f /var/log/apache2/access.log* | goaccess > /var/www/webserverstats.html + +Once the report is displayed, you will need to click on the Expand link to show the detail view on each category: + +![](https://farm9.staticflickr.com/8658/16486743041_bd8a80794d_o.png) + +注释:youtube视频 + + +As we have discussed throughout this article, GoAccess is an invaluable tool that will provide you, as a system administrator, with HTTP statistics in a visual report on the fly. Although GoAccess by default presents its results to the standard output, you can also save them to JSON, HTML, or CSV files. This converts GoAccess in an incredibly useful tool to monitor and display statistics of a web server. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html + +作者:[Gabriel Cánepa][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/gabriel +[1]:http://goaccess.io/ +[2]:http://w3techs.com/technologies/details/os-linux/all/all +[3]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[4]:http://goaccess.io/download#dependencies +[5]:http://goaccess.io/download +[6]:http://httpd.apache.org/docs/2.4/logs.html \ No newline at end of file diff --git a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md new file mode 100644 index 0000000000..64e872c4b7 --- /dev/null +++ b/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md @@ -0,0 +1,80 @@ +How to make remote incremental backup of LUKS-encrypted disk/partition +================================================================================ +Some of us have our hard drives at home or on a [VPS][1] encrypted by [Linux Unified Key Setup (LUKS)][2] for security reasons, and these drives can quickly grow to tens or hundreds of GBs in size. So while we enjoy the security of our LUKS device, we may start to think about a possible remote backup solution. For secure off-site backup, we will need something that operates at the block level of the encrypted LUKS device, and not at the un-encrypted file system level. So in the end we find ourselves in a situation where we will need to transfer the entire LUKS device (let's say 200GB for example) each time we want to make a backup. Clearly not feasible. How can we deal with this problem? + +### A Solution: Bdsync ### + +This is when a brilliant open-source tool called [Bdsync][3] (thanks to Rolf Fokkens) comes to our rescue. As the name implies, Bdsync can synchronize "block devices" over network. For fast synchronization, Bdsync generates and compares MD5 checksums of blocks in the local/remote block devices, and sync only the differences. What rsync can do at the file system level, Bdsync can do it at the block device level. Naturally, it works with encrypted LUKS devices as well. Pretty neat! + +Using Bdsync, the first-time backup will copy the entire LUKS block device to a remote host, so it will take a lot of time to finish. However, after that initial backup, if we make some new files on the LUKS device, the second backup will be finished quickly because we will need to copy only that blocks which have been changed. Classic incremental backup at play! + +### Install Bdsync on Linux ### + +Bdsync is not included in the standard repositories of [Linux][4] distributions. Thus you need to build it from the source. Use the following distro-specific instructions to install Bdsync and its man page on your system. + +#### Debian, Ubuntu or Linux Mint #### + + $ sudo apt-get install git gcc libssl-dev + $ git clone https://github.com/TargetHolding/bdsync.git + $ cd bdsync + $ make + $ sudo cp bdsync /usr/local/sbin + $ sudo mkdir -p /usr/local/man/man1 + $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' + +#### Fedora or CentOS/RHEL #### + + $ sudo yum install git gcc openssl-devel + $ git clone https://github.com/TargetHolding/bdsync.git + $ cd bdsync + $ make + $ sudo cp bdsync /usr/local/sbin + $ sudo mkdir -p /usr/local/man/man1 + $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' + +### Perform Off-site Incremental Backup of LUKS-Encrypted Device ### + +I assume that you have already provisioned a LUKS-encrypted block device as a backup source (e.g., /dev/LOCDEV). I also assume that you have a remote host where the source device will be backed up (e.g., as /dev/REMDEV). + +You need to access the root account on both systems, and set up [password-less SSH access][5] from the local host to a remote host. Finally, you need to install Bdsync on both hosts. + +To initiate a remote backup process on the local host, we execute the following command as the root: + + # bdsync "ssh root@remote_host bdsync --server" /dev/LOCDEV /dev/REMDEV | gzip > /some_local_path/DEV.bdsync.gz + +Some explanations are needed here. Bdsync client will open an SSH connection to the remote host as the root, and execute Bdsync client with --server option. As clarified, /dev/LOCDEV is our source LUKS block device on the local host, and /dev/REMDEV is the target block device on the remote host. They could be /dev/sda (for an entire disk) or /dev/sda2 (for a single partition). The output of the local Bdsync client is then piped to gzip, which creates DEV.bdsync.gz (so-called binary patch file) in the local host. + +The first time you run the above command, it will take very long time, depending on your Internet/LAN speed and the size of /dev/LOCDEV. Remember that you must have two block devices (/dev/LOCDEV and /dev/REMDEV) with the same size. + +The next step is to copy the generated patch file from the local host to the remote host. Using scp is one possibility: + + # scp /some_local_path/DEV.bdsync.gz root@remote_host:/remote_path + +The final step is to execute the following command on the remote host, which will apply the patch file to /dev/REMDEV: + + # gzip -d < /remote_path/DEV.bdsync.gz | bdsync --patch=/dev/DSTDEV + +I recommend doing some tests with small partitions (without any important data) before deploying Bdsync with real data. After you fully understand how the entire setup works, you can start backing up real data. + +### Conclusion ### + +In conclusion, we showed how to use Bdsync to perform incremental backups for LUKS devices. Like rsync, only a fraction of data, not the entire LUKS device, is needed to be pushed to an off-site backup site at each backup, which saves bandwidth and backup time. Rest assured that all the data transfer is secured by SSH or SCP, on top of the fact that the device itself is encrypted by LUKS. It is also possible to improve this setup by using a dedicated user (instead of the root) who can run bdsync. We can also use bdsync for ANY block device, such as LVM volumes or RAID disks, and can easily set up Bdsync to back up local disks on to USB drives as well. As you can see, its possibility is limitless! + +Feel free to share your thought. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition.html + +作者:[Iulian Murgulet][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/iulian +[1]:http://xmodulo.com/go/digitalocean +[2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html +[3]:http://bdsync.rolf-fokkens.nl/ +[4]:http://xmodulo.com/recommend/linuxbook +[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html \ No newline at end of file diff --git a/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md b/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md new file mode 100644 index 0000000000..cae05670ba --- /dev/null +++ b/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md @@ -0,0 +1,258 @@ +How to set up IPv6 BGP peering and filtering in Quagga BGP router +================================================================================ +In the previous tutorials, we demonstrated how we can set up a [full-fledged BGP router][1] and configure [prefix filtering][2] with Quagga. In this tutorial, we are going to show you how we can set up IPv6 BGP peering and advertise IPv6 prefixes through BGP. We will also demonstrate how we can filter IPv6 prefixes advertised or received by using prefix-list and route-map features. + +### Topology ### + +For this tutorial, we will be considering the following topology. + +![](https://farm9.staticflickr.com/8599/15944659374_1c65852df2_c.jpg) + +Service providers A and B want to establish an IPv6 BGP peering between them. Their IPv6 and AS information is as follows. + +- Peering IP block: 2001:DB8:3::/64 +- Service provider A: AS 100, 2001:DB8:1::/48 +- Service provider B: AS 200, 2001:DB8:2::/48 + +### Installing Quagga on CentOS/RHEL ### + +If Quagga has not already been installed, we can install it using yum. + + # yum install quagga + +On CentOS/RHEL 7, the default SELinux policy, which prevents /usr/sbin/zebra from writing to its configuration directory, can interfere with the setup procedure we are going to describe. Thus we want to disable this policy as follows. Skip this step if you are using CentOS/RHEL 6. + + # setsebool -P zebra_write_config 1 + +### Creating Configuration Files ### + +After installation, we start the configuration process by creating the zebra/bgpd configuration files. + + # cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf + # cp /usr/share/doc/quagga-XXXXX/bgpd.conf.sample /etc/quagga/bgpd.conf + +Next, enable auto-start of these services. + +**On CentOS/RHEL 6:** + + # service zebra start; service bgpd start + # chkconfig zebra on; chkconfig bgpd on + +**On CentOS/RHEL 7:** + + # systemctl start zebra; systemctl start bgpd + # systemctl enable zebra; systmectl enable bgpd + +Quagga provides a built-in shell called vtysh, whose interface is similar to those of major router vendors such as Cisco or Juniper. Launch vtysh command shell: + + # vtysh + +The prompt will be changed to: + + router-a# + +or + + router-b# + +In the rest of the tutorials, these prompts indicate that you are inside vtysh shell of either router. + +### Specifying Log File for Zebra ### + +Let's configure the log file for Zebra, which will be helpful for debugging. + +First, enter the global configuration mode by typing: + + router-a# configure terminal + +The prompt will be changed to: + + router-a(config)# + +Now specify log file location. Then exit the configuration mode: + + router-a(config)# log file /var/log/quagga/quagga.log + router-a(config)# exit + +Save configuration permanently by: + + router-a# write + +### Configuring Interface IP Addresses ### + +Let's now configure the IP addresses for Quagga's physical interfaces. + +First, we check the available interfaces from inside vtysh. + + router-a# show interfaces + +---------- + + Interface eth0 is up, line protocol detection is disabled + ## OUTPUT TRUNCATED ### + Interface eth1 is up, line protocol detection is disabled + ## OUTPUT TRUNCATED ## + +Now we assign necessary IPv6 addresses. + + router-a# conf terminal + router-a(config)# interface eth0 + router-a(config-if)# ipv6 address 2001:db8:3::1/64 + router-a(config-if)# interface eth1 + router-a(config-if)# ipv6 address 2001:db8:1::1/64 + +We use the same method to assign IPv6 addresses to router-B. I am summarizing the configuration below. + + router-b# show running-config + +---------- + + interface eth0 + ipv6 address 2001:db8:3::2/64 + + interface eth1 + ipv6 address 2001:db8:2::1/64 + +Since the eth0 interface of both routers are in the same subnet, i.e., 2001:DB8:3::/64, you should be able to ping from one router to another. Make sure that you can ping successfully before moving on to the next step. + + router-a# ping ipv6 2001:db8:3::2 + +---------- + + PING 2001:db8:3::2(2001:db8:3::2) 56 data bytes + 64 bytes from 2001:db8:3::2: icmp_seq=1 ttl=64 time=3.20 ms + 64 bytes from 2001:db8:3::2: icmp_seq=2 ttl=64 time=1.05 ms + +### Phase 1: IPv6 BGP Peering ### + +In this section, we will configure IPv6 BGP between the two routers. We start by specifying BGP neighbors in router-A. + + router-a# conf t + router-a(config)# router bgp 100 + router-a(config-router)# no auto-summary + router-a(config-router)# no synchronization + router-a(config-router)# neighbor 2001:DB8:3::2 remote-as 200 + +Next, we define the address family for IPv6. Within the address family section, we will define the network to be advertised, and activate the neighbors as well. + + router-a(config-router)# address-family ipv6 + router-a(config-router-af)# network 2001:DB8:1::/48 + router-a(config-router-af)# neighbor 2001:DB8:3::2 activate + +We will go through the same configuration for router-B. I'm providing the summary of the configuration. + + router-b# conf t + router-b(config)# router bgp 200 + router-b(config-router)# no auto-summary + router-b(config-router)# no synchronization + router-b(config-router)# neighbor 2001:DB8:3::1 remote-as 100 + router-b(config-router)# address-family ipv6 + router-b(config-router-af)# network 2001:DB8:2::/48 + router-b(config-router-af)# neighbor 2001:DB8:3::1 activate + +If all goes well, an IPv6 BGP session should be up between the two routers. If not already done, please make sure that necessary ports (TCP 179) are [open in your firewall][3]. + +We can check IPv6 BGP session information using the following commands. + +**For BGP summary:** + + router-a# show bgp ipv6 unicast summary + +**For BGP advertised routes:** + + router-a# show bgp ipv6 neighbors advertised-routes + +**For BGP received routes:** + + router-a# show bgp ipv6 neighbors routes + +![](https://farm8.staticflickr.com/7317/16379555088_6e29cb6884_b.jpg) + +### Phase 2: Filtering IPv6 Prefixes ### + +As we can see from the above output, the routers are advertising their full /48 IPv6 prefix. For demonstration purposes, we will consider the following requirements. + +- Router-B will advertise one /64 prefix, one /56 prefix, as well as one full /48 prefix. +- Router-A will accept any IPv6 prefix owned by service provider B, which has a netmask length between /56 and /64. + +We are going to filter the prefix as required, using prefix-list and route-map in router-A. + +![](https://farm8.staticflickr.com/7367/16381297417_6549218289_c.jpg) + +#### Modifying prefix advertisement for Router-B #### + +Currently, router-B is advertising only one /48 prefix. We will modify router-B's BGP configuration so that it advertises additional /56 and /64 prefixes as well. + + router-b# conf t + router-b(config)# router bgp 200 + router-b(config-router)# address-family ipv6 + router-b(config-router-af)# network 2001:DB8:2::/56 + router-b(config-router-af)# network 2001:DB8:2::/64 + +We will verify that all prefixes are received at router-A. + +![](https://farm9.staticflickr.com/8598/16379761980_7c083ae977_b.jpg) + +Great! As we are receiving all prefixes in router-A, we will move forward and create prefix-list and route-map entries to filter these prefixes. + +#### Creating Prefix-List #### + +As described in the [previous tutorial][4], prefix-list is a mechanism that is used to match an IP address prefix with a subnet length. Once a matched prefix is found, we can apply filtering or other actions to the matched prefix. To meet our requirements, we will go ahead and create a necessary prefix-list entry in router-A. + + router-a# conf t + router-a(config)# ipv6 prefix-list FILTER-IPV6-PRFX permit 2001:DB8:2::/56 le 64 + +The above commands will create a prefix-list entry named 'FILTER-IPV6-PRFX' which will match any prefix in the 2001:DB8:2:: pool with a netmask between 56 and 64. + +#### Creating and Applying Route-Map #### + +Now that the prefix-list entry is created, we will create a corresponding route-map rule which uses the prefix-list entry. + + router-a# conf t + router-a(config)# route-map FILTER-IPV6-RMAP permit 10 + router-a(config-route-map)# match ipv6 address prefix-list FILTER-IPV6-PRFX + +The above commands will create a route-map rule named 'FILTER-IPV6-RMAP'. This rule will permit IPv6 addresses matched by the prefix-list 'FILTER-IPV6-PRFX' that we have created earlier. + +Remember that a route-map rule is only effective when it is applied to a neighbor or an interface in a certain direction. We will apply the route-map in the BGP neighbor configuration. As the filter is meant for inbound prefixes, we apply the route-map in the inbound direction. + + router-a# conf t + router-a(config)# router bgp 100 + router-a(config-router)# address-family ipv6 + router-a(config-router-af)# neighbor 2001:DB8:3::2 route-map FILTER-IPV6-RMAP in + +Now when we check the routes received at router-A, we should see only two prefixes that are allowed. + +![](https://farm8.staticflickr.com/7337/16379762020_ec2dc39b31_c.jpg) + +**Note**: You may need to reset the BGP session for the route-map to take effect. + +All IPv6 BGP sessions can be restarted using the following command: + + router-a# clear bgp ipv6 * + +I am summarizing the configuration of both routers so you get a clear picture at a glance. + +![](https://farm9.staticflickr.com/8672/16567240165_eee4398dc8_c.jpg) + +### Summary ### + +To sum up, this tutorial focused on how to set up BGP peering and filtering using IPv6. We showed how to advertise IPv6 prefixes to a neighboring BGP router, and how to filter the prefixes advertised or received are advertised. Note that the process described in this tutorial may affect production networks of a service provider, so please use caution. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/ipv6-bgp-peering-filtering-quagga-bgp-router.html + +作者:[Sarmed Rahman][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/sarmed +[1]:http://xmodulo.com/centos-bgp-router-quagga.html +[2]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html +[3]:http://ask.xmodulo.com/open-port-firewall-centos-rhel.html +[4]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html \ No newline at end of file diff --git a/sources/tech/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md b/sources/tech/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md new file mode 100644 index 0000000000..c6f0cde895 --- /dev/null +++ b/sources/tech/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md @@ -0,0 +1,148 @@ +Linux FAQs with Answers--How to disable IPv6 on Linux +================================================================================ +> **Question**: I notice that one of my applications is trying to establish a connection over IPv6. But since our local network is not able to route IPv6 traffic, the IPv6 connection times out, and the application falls back to IPv4, which causes unnecessary delay. As I don't have any need for IPv6 at the moment, I would like to disable IPv6 on my Linux box. What is a proper way to turn off IPv6 on Linux? + +IPv6 has been introduced as a replacement of IPv4, the traditional 32-bit address space used in the Internet, to solve the imminent exhaustion of available IPv4 address space. However, since IPv4 has been used by every host or device connected to the Internet, it is practically impossible to switch every one of them to IPv6 overnight. Numerous IPv4 to IPv6 transition mechanisms (e.g., dual IP stack, tunneling, proxying) have been proposed to facilitate the adoption of IPv6, and many applications are being rewritten, as we speak, to add support for IPv6. One thing for sure is that IPv4 and IPv6 will inevitably coexist for the forseeable future. + +Ideally the [ongoing IPv6 transition process][1] should not be visible to end users, but the mixed IPv4/IPv6 environment might sometimes cause you to encounter various hiccups originating from unintended interaction between IPv4 and IPv6. For example, you may experience timeouts from applications such as apt-get or ssh trying to unsuccessfully connecting via IPv6, DNS server accidentally dropping AAAA DNS records for IPv6, or your IPv6-capable device not compatible with your ISP's legacy IPv4 network, etc. + +Of course this doesn't mean that you should blindly disable IPv6 on you Linux box. With all the benefits promised by IPv6, we as a society want to fully embrace it eventually, but as part of troubleshooting process for end-user experienced hiccups, you may try turning off IPv6 to see if indeed IPv6 is a culprit. + +Here are a few techniques allowing you to disable IPv6 partially (e.g., for a certain network interface) or completely on Linux. These tips should be applicable to all major Linux distributions including Ubuntu, Debian, Linux Mint, CentOS, Fedora, RHEL, and Arch Linux. + +### Check if IPv6 is Enabled on Linux ### + +All modern Linux distributions have IPv6 automatically enabled by default. To see IPv6 is activated on your Linux, use ifconfig or ip commands. If you see "inet6" in the output of these commands, this means your Linux has IPv6 enabled. + + $ ifconfig + +![](https://farm8.staticflickr.com/7282/16415082398_5fb0920506_b.jpg) + + $ ip addr + +![](https://farm8.staticflickr.com/7290/16415082248_c4e075548b_c.jpg) + +### Disable IPv6 Temporarily ### + +If you want to turn off IPv6 temporarily on your Linux system, you can use /proc file system. By "temporarily", we mean that the change we make to disable IPv6 will not be preserved across reboots. IPv6 will be enabled back again after you reboot your Linux box. + +To disable IPv6 for a particular network interface, use the following command. + + $ sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf//disable_ipv6' + +For example, to disable IPv6 for eth0 interface: + + $ sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6' + +![](https://farm8.staticflickr.com/7288/15982511863_0c1feafe7f_b.jpg) + +To enable IPv6 back on eth0 interface: + + $ sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6' + +If you want to disable IPv6 system-wide for all interfaces including loopback interface, use this command: + + $ sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' + +### Disable IPv6 Permanently across Reboots ### + +The above method does not permanently disable IPv6 across reboots. IPv6 will be activated again once you reboot your system. If you want to turn off IPv6 for good, there are several ways you can do it. + +#### Method One #### + +The first method is to apply the above /proc changes persistently in /etc/sysctl.conf file. + +That is, open /etc/sysctl.conf with a text editor, and add the following lines. + + # to disable IPv6 on all interfaces system wide + net.ipv6.conf.all.disable_ipv6 = 1 + + # to disable IPv6 on a specific interface (e.g., eth0, lo) + net.ipv6.conf.lo.disable_ipv6 = 1 + net.ipv6.conf.eth0.disable_ipv6 = 1 + +To activate these changes in /etc/sysctl.conf, run: + + $ sudo sysctl -p /etc/sysctl.conf + +or simply reboot. + +#### Method Two #### + +An alternative way to disable IPv6 permanently is to pass a necessary kernel parameter via GRUB/GRUB2 during boot time. + +Open /etc/default/grub with a text editor, and add "ipv6.disable=1" to GRUB_CMDLINE_LINUX variable. + + $ sudo vi /etc/default/grub + +---------- + + GRUB_CMDLINE_LINUX="xxxxx ipv6.disable=1" + +In the above, "xxxxx" denotes any existing kernel parameter(s). Add "ipv6.disable=1" after them. + +![](https://farm8.staticflickr.com/7286/15982512103_ec5d940e58_b.jpg) + +Finally, don't forget to apply the modified GRUB/GRUB2 settings by running: + +On Debian, Ubuntu or Linux Mint: + + $ sudo update-grub + +On Fedora, CentOS/RHEL: + + $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg + +Now IPv6 will be completely disabled once you reboot your Linux system. + +### Other Optional Steps after Disabling IPv6 ### + +Here are a few optional steps you can consider after disabling IPv6. This is because while you disable IPv6 in the kernel, other programs may still try to use IPv6. In most cases, such application behaviors will not break things, but you want to disable IPv6 for them for efficiency or safety reason. + +#### /etc/hosts #### + +Depending on your setup, /etc/hosts may contain one or more IPv6 hosts and their addresses. Open /etc/hosts with a text editor, and comment out all lines which contain IPv6 hosts. + + $ sudo vi /etc/hosts + +---------- + + # comment these IPv6 hosts + # ::1 ip6-localhost ip6-loopback + # fe00::0 ip6-localnet + # ff00::0 ip6-mcastprefix + # ff02::1 ip6-allnodes + # ff02::2 ip6-allrouters + +#### Network Manager #### + +If you are using NetworkManager to manage your network settings, you can disable IPv6 on NetworkManager as follows. Open the wired connection on NetworkManager, click on "IPv6 Settings" tab, and choose "Ignore" in "Method" field. Save the change and exit. + +![](https://farm8.staticflickr.com/7293/16394993017_21917f027b_o.png) + +#### SSH server #### + +By default, OpenSSH server (sshd) tries to bind on both IPv4 and IPv6 addresses. + +To force sshd to bind only on IPv4 address, open /etc/ssh/sshd_config with a text editor, and add the following line. inet is for IPv4 only, and inet6 is for IPv6 only. + + $ sudo vi /etc/ssh/sshd_config + +---------- + + AddressFamily inet + +and restart sshd server. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/disable-ipv6-linux.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://ask.xmodulo.com/author/nanni +[1]:http://www.google.com/intl/en/ipv6/statistics.html \ No newline at end of file diff --git a/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md b/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md new file mode 100644 index 0000000000..f85b2cf725 --- /dev/null +++ b/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md @@ -0,0 +1,114 @@ +Enjoy Android Apps on Ubuntu using ARChon Runtime +================================================================================ +Before, we gave try to many android app emulating tools like Genymotion, Virtualbox, Android SDK, etc to try to run android apps on it. But, with this new Chrome Android Runtime, we are able to run Android Apps on our Chrome Browser. So, here are the steps we'll need to follow to install Android Apps on Ubuntu using ARChon Runtime. + +Google had [announced the first set of Android apps is ready to run natively on Chrome OS][1], a feature made possible using a new ‘**Android Runtime**’ extension. Now, a developer named Vlad Filippov has figured out a way to bring Android Apps to Chrome on the desktop. His chromeos-apk script and ARChon Android Runtime extension work hand-in-hand to bring Android apps to Chrome browser on the Windows, Mac and Linux desktop. + +Performance of this apps through the runtime is not pretty good. Similarly, as its both an unofficial repackaging of the official runtime and running outside of Google's Chrome OS, system integration like webcam, speakers, etc. may be patchy or non-existent. + +### Installing Chrome ### + +First of all, we'll need Chrome installed in our machine, Chrome version 37 or higher is required. We can download them from the [download page of Chrome Browser][2]. + +If you wanna install a Dev Channel version you'll need to follow below procedure. + +We'll need to add repository source list for Google Chrome which can be done my using the following command. + + $ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + $ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' + +![Adding google source list](http://blog.linoxide.com/wp-content/uploads/2015/02/adding-google-source-list.png) + +After adding the repository source list, we'll need to update the local repository index by the command below. + + $ sudo apt-get update + +Now, we'll gonna install google chrome unstable which is dev version. + + $ sudo apt-get install google-chrome-unstable + +![Installing Google chrome unstable](http://blog.linoxide.com/wp-content/uploads/2015/02/installing-google-chrome-unstable.png) + +### Installing Archon Runtime ### + +Next we'll need to download the custom-made ergo officially not endorsed by Google or Chromium Android Runtime created by Vlad Filippov. This differs from the official version in a number of ways, the chief being it can be used on desktop versions of the browser. Here below is the runtime we need to download, please select anyone of the following according to your bit of Ubuntu installed. + +For **32-bit** Ubuntu Distributions: + +- [Download Archron for 32-bit Ubuntu][3] + +For **64-bit** Ubuntu Distributions: + +- [Download Archron for 64-bit Ubuntu][4] + +Once the runtime has fully downloaded you will need to extract the contents from the .zip files and move the resulting directory to Home. Here is the gist commands for this steps to download and extract the contents. + + $ wget https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_32.zip + +![Downloading ARChon](http://blog.linoxide.com/wp-content/uploads/2015/02/download-archon.png) + + $ unzip ARChon-v1.1-x86_32.zip ~/ + +Now to install the runtime, we'll gonna Open our latest Google Chrome and goto the url **chrome://extensions/** then, we'll need to check ‘**Enable developer mode**’. Finally, we'll gonna click on the ‘**load unpacked extension**’ button and select the folder which was placed into **~/Home**. + +### Installing ChromeOS-APK ### + +To convert APKs manually is something you really don’t need to do any more if you use one of the apps mentioned above — you will need to install the ‘[chromeos-apk][5]’ command line JavaScript utility. This is available to install through the Node Packaged Modules (npm) manager. To install nmp and chromeos-apk, we'll need to run the following command in a shell or terminal. + + $ sudo apt-get install npm nodejs nodejs-legacy + +**If you are running 64 bit OS**, you should grab the following library, to do so run the below commands in a shell or terminal. + + $ sudo apt-get install lib32stdc++6 + +Now run the command to install the the latest chromeos-apk is: + + $ npm install -g chromeos-apk@latest + +![chromeos apk installation](http://blog.linoxide.com/wp-content/uploads/2015/02/chomeos-apk-installation.png) + +Depending on your system configuration you may need to need to run this latter command as sudo. + +Now, we'll gonna for Google to find an APK of an app to give it a try, bearing in mind **not all Android apps will work**, and those that do may be unstable or lack features. Most of the messenger out of the box are not working. + +### Converting APK ### + +Place your **Android APK in ~/Home**, then return to **Terminal** to convert it using the following command: + + $ chromeos-apk myapp.apk --archon + +If you want the app in fullscreen mode then run the following instead: + + $ chromeos-apk myapp.apk --archon --tablet + +Note: Please replace myapp.apk to the Android APK app filename you want to convert. + +For our ease, we can also use [Twerk][6] for the conversion process if we want to skip this step. + +### Running Android Apk ### + +Finally, we'll need to open our chrome browser and then goto chrome://extensions page and enable developer mode then tap the ‘load unpacked extension’ button and select the folder the script above created. + +Now, we can Open the Chrome App Launcher to run it. + +### Conclusion ### + +Hurray! We have successfully installed Android Apk App in our favorite desktop browser ie Chrome Browser. This article is all about the popular Chrome Android Runtime called Archon created by Vlad Filippov. This runtime allows us to run converted Apk files in our Chrome browser. It has not yet supported messaging apps like Whatsapp, etc. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy Archon :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/android-apps-ubuntu-archon-runtime/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://chrome.blogspot.com/2014/09/first-set-of-android-apps-coming-to.html +[2]:https://www.google.com/chrome/browser +[3]:https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_32.zip +[4]:https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_64.zip +[5]:https://github.com/vladikoff/chromeos-apk/blob/master/README.md +[6]:https://chrome.google.com/webstore/detail/twerk/jhdnjmjhmfihbfjdgmnappnoaehnhiaf \ No newline at end of file diff --git a/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md b/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md new file mode 100644 index 0000000000..88b742d4f9 --- /dev/null +++ b/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md @@ -0,0 +1,86 @@ +Fix Minimal BASH like line editing is supported GRUB Error In Linux +================================================================================ +The other day when I [installed Elementary OS in dual boot with Windows][1], I encountered a Grub error at the reboot time. I was presented with command line with error message: + +**Minimal BASH like line editing is supported. For the first word, TAB lists possible command completions. anywhere else TAB lists possible device or file completions.** + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_1.jpeg) + +Indeed this is not an error specific to Elementary OS. It is a common [Grub][2] error that could occur with any Linux OS be it Ubuntu, Fedora, Linux Mint etc. + +In this post we shall see **how to fix this “minimal BASH like line editing is supported” Grub error in Ubuntu** based Linux systems. + +> You can read this tutorial to fix similar and more frequent issue, [error: no such partition grub rescue in Linux][3]. + +### Prerequisites ### + +To fix this issue, you would need the followings: + +- A live USB or disk of the same OS and same version +- A working internet connection in the live session + +Once you make sure that you have the prerequisites, let’s see how to fix the black screen of death for Linux (if I can call it that ;)). + +### How to fix this “minimal BASH like line editing is supported” Grub error in Ubuntu based Linux ### + +I know that you might point out that this Grub error is not exclusive to Ubuntu or Ubuntu based Linux distributions, then why am I putting emphasis on the world Ubuntu? The reason is, here we will take an easy way out and use a tool called **Boot Repair** to fix our problem. I am not sure if this tool is available for other distributions like Fedora. Without wasting anymore time, let’s see how to solve minimal BASH like line editing is supported Grub error. + +### Step 1: Boot in lives session ### + +Plug in the live USB and boot in to the live session. + +### Step 2: Install Boot Repair ### + +Once you are in the lives session, open the terminal and use the following commands to install Boot Repair: + + sudo add-apt-repository ppa:yannubuntu/boot-repair + sudo apt-get update + sudo apt-get install boot-repair + +Note: Follow this tutorial to [fix failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs error][4], if you encounter it while running the above command. + +### Step 3: Repair boot with Boot Repair ### + +Once you installed Boot Repair, run it from the command line using the following command: + + boot-repair & + +Actually things are pretty straight forward from here. You just need to follow the instructions provided by Boot Repair tool. First, click on **Recommended repair** option in the Boot Repair. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu.png) + +It will take couple of minutes for Boot Repair to analyze the problem with boot and Grub. Afterwards, it will provide you some commands to use in the command line. Copy the commands one by one in terminal. For me it showed me a screen like this: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_1.png) + +It will do some processes after you enter these commands: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_2.png) + +Once the process finishes, it will provide you a URL which consists of the logs of the boot repair. If your boot issue is not fixed even now, you can go to the forum or mail to the dev team and provide them the URL as a reference. Cool, isn’t it? + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Final_Ubuntu.png) + +After the boot repair finishes successfully, shutdown your computer, remove the USB and boot again. For me it booted successfully but added two additional lines in the Grub screen. Something which was not of importance to me as I was happy to see the system booting normally again. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_2.jpeg) + +### Did it work for you? ### + +So this is how I fixed **minimal BASH like line editing is supported Grub error in Elementary OS Freya**. How about you? Did it work for you? Feel free to ask a question or drop a suggestion in the comment box below. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-minimal-bash-line-editing-supported-grub-error-linux/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/guide-install-elementary-os-luna/ +[2]:http://www.gnu.org/software/grub/ +[3]:http://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ +[4]:http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ \ No newline at end of file diff --git a/sources/tech/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md b/sources/tech/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md new file mode 100644 index 0000000000..60155b9f68 --- /dev/null +++ b/sources/tech/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md @@ -0,0 +1,99 @@ +johnhoow translating... +How to Install Lightweight Budgie ( v8) Desktop in Ubuntu 14.04 +================================================================================ +Budgie is the flagship desktop of the Evolve OS Linux Distribution, and is an Evolve OS project. Designed with the modern user in mind, it focuses on simplicity and elegance. A huge advantage for the Budgie desktop is that it is not a fork of another project, but rather one written from scratch with integration in mind. + +The [Budgie Desktop][1] tightly integrates with the GNOME stack, employing underlying technologies to offer an alternative desktop experience. In the spirit of open source, the project is compatible with and available for other Linux distributions. + +Also note that Budgie can now emulate the look and feel of the GNOME 2 desktop, optionally, via a setting in the panel preferences. + +### Features in the 0.8 release ### + +- IconTasklist: Add pinning support +- IconTasklist: Use .desktop files for quicklists +- IconTasklist: Use .desktop files for icon resolution +- IconTasklist: Support “attention” hint (blue blink) +- Panel: Support dark theme (used by default) +- Add Menubar applet +- Panel: Initial autohide support (manual, not automatic) +- Panel: Support shadow onall screen edges +- Panel: Dynamic support for gnome panel theming +- RunDialog: Complete visual refresh (bootiful) +- BudgieMenu: Add compact mode, use by default +- BudgieMenu: Sort items by usage +- BudgieMenu: Remove old power option +- Editor: Add all menu options to UI +- Support from GNOME 3.10 up to 3.16 (unreleased, git) +- wm: Kill workspace animation (resolve after v8) +- wm: Better animations for changing of wallpapers + +### Important information ### + +- Budgie [released version 0.8][2] so it is still in development and a beta. +- No nnative network management; can be fixed by using Ubuntu's applet. +- Budgie is intended for the Evolve OS so even with this PPA it might be buggy. +- GNOME themes work better than the native Ubuntu themes. +- Ubuntu’s overlay scrollbars are not working. +- If you want to read more visit the Evolve OS website. + +### Installation ### + +Now, we'll install our Lightweight Budgie Desktop in our Ubuntu 14.04 LTS "Trusty" distribution of Linux Operating System. First of all, we'll need to add ppa repository to our Ubuntu PC. To do so, we'll need to execute the below command in a shell or terminal. + + $ sudo add-apt-repository ppa:evolve-os/ppa + +![Add Budgie Desktop PPA Repo](http://blog.linoxide.com/wp-content/uploads/2015/01/budgie-desktop-ppa.png) + +Now, after we finish adding PPA to our Ubuntu Computer, we'll need to update the local repository index in it. It can be done by running the following command in the same terminal or shell after above is done. + + $ sudo apt-get update + +Then, finally, we'll install the one and only Budgie Desktop Environment in our Ubuntu machine running the latest version 14.04 LTS. + + $ sudo apt-get install budgie-desktop + +![Install Budgie Desktop](http://blog.linoxide.com/wp-content/uploads/2015/02/install-budgie-desktop.png) + +**Notes** + +It is in active development and features remain missing, including, but not limited to: no network management support, no volume control applet (keyboard keys will work fine), no notification system and no way to ‘pin’ apps to the task bar. + +As a workaround you can disable overlay scrollbars, set a different default theme and quit a session from the terminal using the following command: + + $ gnome-session-quit + +![Quitting Gnome Session](http://blog.linoxide.com/wp-content/uploads/2015/02/gnome-seesion-quit.png) + +### Log into the Budgie Session ### + +After installation is completed, we’ll be able to select ‘Budgie’ from the session selector of the Unity Greeter. For that, we'll need to logout the current user and get back to the login screen. Then, we'll be able to switch to Budgie Desktop Environment. + +![Select Desktop Session](http://blog.linoxide.com/wp-content/uploads/2015/02/session-select.png) + +### Budgie Desktop Environment ### + +![Budgie Desktop Environment](http://blog.linoxide.com/wp-content/uploads/2015/02/budgie-desktop.png) + +### Logging Out ### + +You can simply execute **budgie-session --logout** in a shell or terminal to logout it. + + $ budgie-sessioon --logout + +### Conclusion ### + +Hurray! We have successfully installed our Lightweight Budgie Desktop Environment in our Ubuntu 14.04 LTS "Trusty" box. As we know, Budgie Desktop is still underdevelopment which makes it a lot of stuffs missing. Though it’s based on Gnome’s GTK3, it’s not a fork. The desktop is written completely from scratch, and the design is elegant and well thought out. If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy Budgie Desktop 0.8 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/install-lightweight-budgie-v8-desktop-ubuntu/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://evolve-os.com/budgie/ +[2]:https://evolve-os.com/2014/11/16/courageous-budgie-v8-released/ diff --git a/sources/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md b/sources/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md new file mode 100644 index 0000000000..18607f7f96 --- /dev/null +++ b/sources/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md @@ -0,0 +1,296 @@ +How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle +================================================================================ +Have you ever encountered situations where one application dominated you all network bandwidth? If you have ever been in a situation where one application ate all your traffic, then you will value the role of the trickle bandwidth shaper application. Either you are a system admin or just a Linux user, you need to learn how to control the upload and download speeds for applications to make sure that your network bandwidth is not burned by a single application. + +![Install Trickle Bandwidth Limit in Linux](http://www.tecmint.com/wp-content/uploads/2013/11/Bandwidth-limit-trickle.png) +Install Trickle Bandwidth Limit in Linux + +### What is Trickle? ### + +Trickle is a network bandwidth shaper tool that allows us to manage the upload and download speeds of applications in order to prevent any single one of them to hog all (or most) of the available bandwidth. In few words, trickle lets you control the network traffic rate on a per-application basis, as opposed to per-user control, which is the classic example of bandwidth shaping in a client-server environment, and is probably the setup we are more familiar with. + +### How Trickle Works? ### + +In addition, trickle can help us to define priorities on a per-application basis, so that when overall limits have been set for the entire system, priority apps will still get more bandwidth automatically. To accomplish this task, trickle sets traffic limits to the way in which data is sent to, and received from, sockets using TCP connections. We must note that, other than the data transfer rates, trickle does not modify in any way the behavior of the process it is shaping at any given moment. + +### What Can’t Trickle do? ### + +The only limitation, so to speak, is that trickle will not work with statically linked applications or binaries with the SUID or SGID bits set since it uses dynamic linking and loading to place itself between the shaped process and its associated network socket. Trickle then acts as a proxy between these two software components. + +Since trickle does not require superuser privileges in order to run, users can set their own traffic limits. Since this may not be desirable, we will explore how to set overall limits that system users cannot exceed. In other words, users will still be able to manage their traffic rates, but always within the boundaries set by the system administrator. + +In this article we will explain how to limit the network bandwidth used by applications in a Linux server with trickle. To generate the necessary traffic, we will use ncftpput and ncftpget (both tools are available by installing ncftp) on the client (CentOS 7 server – dev1: 192.168.0.17), and vsftpd on the server (Debian Wheezy 7.5 – dev2: 192.168.0.15) for demonstration purposes. The same instructions also works on RedHat, Fedora and Ubuntu based systems. + +#### Prerequisites #### + +1. For RHEL/CentOS 7/6, [enable the EPEL repository][1]. Extra Packages for Enterprise Linux (EPEL) is a repository of high-quality free and open-source software maintained by the Fedora project and is 100% compatible with its spinoffs, such as Red Hat Enterprise Linux and CentOS. Both trickle and ncftp are made available from this repository. + +2. Install ncftp as follows: + + # yum update && sudo yum install ncftp [On RedHat based systems] + # aptitude update && aptitude install ncftp [On Debian based systems] + +3. Set up a FTP server in a separate server. Please note that although FTP is inherently insecure, it is still widely used in cases when security in uploading or downloading files is not needed. We are using it in this article to illustrate the bounties of trickle and because it shows the transfer rates in stdout on the client, and we will leave the discussion of whether it should or should not be used for another date and time :). + + # yum update && yum install vsftpd [On RedHat based systems] + # aptitude update && aptitude install vsftpd [On Debian based systems] + +Now, edit the /etc/vsftpd/vsftpd.conf file on the FTP server as follows: + + anonymous_enable=NO + local_enable=YES + chroot_local_user=YES + allow_writeable_chroot=YES + +After that, make sure to start vsftpd for your current session and to enable it for automatic start on future boots: + + # systemctl start vsftpd [For systemd-based systems] + # systemctl enable vsftpd + # service vsftpd start [For init-based systems] + # chkconfig vsftpd on + +4. If you chose to set up the FTP server in a CentOS/RHEL 7 droplet with SSH keys for remote access, you will need a password-protected user account with the appropriate directory and file permissions for uploading and downloading the desired content OUTSIDE root’s home directory. + +You can then browse to your home directory by entering the following URL in your browser. A login window will pop up prompting you for a valid user account and password on the FTP server. + + ftp://192.168.0.15 + +If the authentication succeeds, you will see the contents of your home directory. Later in this tutorial you will be able to refresh that page to display the files that have been uploaded during previous steps. + +![FTP Directory Tree](http://www.tecmint.com/wp-content/uploads/2013/11/FTP-Directory-Tree.png) +FTP Directory Tree + +### How to Install Trickle in Linux ### + +1. Install trickle via yum or aptitude. + +To ensure a successful installation, it is considered good practice to make sure the currently installed packages are up-to-date (using yum update) before installing the tool itself. + + # yum -y update && yum install trickle [On RedHat based systems] + # aptitude -y update && aptitude install trickle [On Debian based systems] + +2. Verify whether trickle will work with the desired binary. + +As we explained earlier, trickle will only work with binaries using dynamic, or shared, libraries. To verify whether we can use this tool with a certain application, we can use the well-known ldd utility, where ldd stands for list dynamic dependencies. Specifically, we will look for the presence of glibc (the GNU C library) in the list of dynamic dependencies of any given program because it is precisely that library which defines the system calls involved in communication through sockets. + +Run the following command against a given binary to see if trickle can be used to shape its bandwidth: + + # ldd $(which [binary]) | grep libc.so + +For example, + + # ldd $(which ncftp) | grep libc.so + +whose output is: + + # libc.so.6 => /lib64/libc.so.6 (0x00007efff2e6c000) + +The string between brackets in the output may change from system to system and even between subsequent runs of the same command, since it represents the load address of the library in physical memory. + +If the above command does not return any results, it means that the binary it was run against does not use libc and thus trickle cannot be used as bandwidth shaper in that case. + +### Learn How to Use Trickle ### + +The most basic usage of trickle is in standalone mode. Using this approach, trickle is used to explicitly define the download and upload speeds of a given application. As we explained earlier, for the sake of brevity, we will use the same application for download and upload tests. + +#### Running Trickle in Standalone Mode #### + +We will compare the download and upload speeds with and without using trickle. The -d option indicates the download speed in KB/s, while the -u flag tells trickle to limit the upload speed by the same unit. In addition, we will use the -s flag, which specifies that trickle should run in standalone mode. + +The basic syntax to run trickle in standalone mode is as follows: + + # trickle -s -d [download rate in KB/s] -u [upload rate in KB/s] + +In order to perform the following examples on your own, make sure to have trickle and ncftp installed on the client machine (192.168.0.17 in my case). + +**Example 1: Uploading a 2.8 MB PDF file with and without trickle.** + +We are using the freely-distributable Linux Fundamentals PDF file (available from [here][2]) for the following tests. + +You can initially download this file to your current working directory with the following command: + + # wget http://linux-training.be/files/books/LinuxFun.pdf + +The syntax to upload a file to our FTP server without trickle is as follows: + + # ncftpput -u username -p password 192.168.0.15 /remote_directory local-filename + +Where /remote_directory is the path of the upload directory relative to username’s home, and local-filename is a file in your current working directory. + +Specifically, without trickle we get a peak upload speed of 52.02 MB/s (please note that this is not the real average upload speed, but an instant starting peak), and the file gets uploaded almost instantly: + + # ncftpput -u username -p password 192.168.0.15 /testdir LinuxFun.pdf + +Output: + + LinuxFun.pdf: 2.79 MB 52.02 MB/s + +With trickle, we will limit the upload transfer rate at 5 KB/s. Before uploading the file for the second time, we need to delete it from the destination directory; otherwise, ncftp will inform us that the file at the destination directory is the same that we are trying to upload, and will not perform the transfer: + + # rm /absolute/path/to/destination/directory/LinuxFun.pdf + +Then: + + # trickle -s -u 5 ncftpput -u username -p password 111.111.111.111 /testdir LinuxFun.pdf + +Output: + + LinuxFun.pdf: 2.79 MB 4.94 kB/s + +In the example above, we can see that the average upload speed dropped to ~5 KB/s. + +**Example 2: Downloading the same 2.8 MB PDF file with and without trickle** + +First, remember to delete the PDF from the original source directory: + + # rm /absolute/path/to/source/directory/LinuxFun.pdf + +Please note that the following cases will download the remote file to the current directory in the client machine. This fact is indicated by the period (‘.‘) that appears after the IP address of the FTP server. + +Without trickle: + + # ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf + +Output: + + LinuxFun.pdf: 2.79 MB 260.53 MB/s + +With trickle, limiting the download speed at 20 KB/s: + + # trickle -s -d 30 ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf + +Output: + + LinuxFun.pdf: 2.79 MB 17.76 kB/s + +### Running Trickle in Supervised [unmanaged] Mode ### + +Trickle can also run in unmanaged mode, following a series of parameters defined in /etc/trickled.conf. This file defines how trickled (the daemon) behaves and manages trickle. + +In addition, if we want to set global settings to be used, overall, by all applications, we will need to use the trickled command. This command runs the daemon and allows us to define download and upload limits that will be shared by all the applications run through trickle without us needing to specify limits each time. + +For example, running: + + # trickled -d 50 -u 10 + +Will cause that the download and upload speeds of any application run through trickle be limited to 30 KB/s and 10 KB/s, respectively. + +Please note that you can check at any time whether trickled is running and with what arguments: + + # ps -ef | grep trickled | grep -v grep + +Output: + + root 16475 1 0 Dec24 ? 00:00:04 trickled -d 50 -u 10 + +**Example 3: Uploading a 19 MB mp4 file to our FTP server using with and without trickle.** + +In this example we will use the freely-distributable “He is the gift” video, available for download from [this link][3]. + +We will initially download this file to your current working directory with the following command: + + # wget http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4 + +First off, we will start the trickled daemon with the command listed above: + + # trickled -d 30 -u 10 + +Without trickle: + + # ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4 + +Output: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 36.31 MB/s + +With trickle: + + # trickle ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4 + +Output: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 9.51 kB/s + +As we can see in the output above, the upload transfer rate dropped to ~10 KB/s. + +**Example 4: Downloading the same video with and without trickle** + +As in Example 2, we will be downloading the file to the current working directory. + +Without trickle: + + # ncftpget -u username -p password 192.168.0.15 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4 + +Output: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 108.34 MB/s + +With trickle: + + # trickle ncftpget -u username -p password 111.111.111.111 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4 + +Output: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 29.28 kB/s + +Which is in accordance with the download limit set earlier (30 KB/s). + +**Note:** That once the daemon has been started, there is no need to set individual limits for each application that uses trickle. + +As we mentioned earlier, one can further customize trickle’s bandwidth shaping through trickled.conf. A typical section in this file consists of the following: + + [service] + Priority = + Time-Smoothing = + Length-Smoothing = + +Where, + +- [service] indicates the name of the application whose bandwidth usage we intend to shape. +- Priority allows us to specify a service to have a higher priority relative to another, thus not allowing a single application to hog all the bandwidth which the daemon is managing. The lower the number, the more bandwidth that is assigned to [service]. +- Time-Smoothing [in seconds]: defines with what time intervals trickled will try to let the application transfer and / or receive data. Smaller values (something between the range of 0.1 – 1s) are ideal for interactive applications and will result in a more continuous (smooth) session while slightly larger values (1 – 10 s) are better for applications that need bulk transfer. If no value is specified, the default (5 s) is used. +- Length-Smoothing [in KB]: the idea is the same as in Time-Smoothing, but based on the length of an I/O operation. If no value is specified, the default (10 KB) is used. + +Changing the smoothing values will translate into the application specified by [service] using transfer rates within an interval instead of a fixed value. Unfortunately, there is no formula to calculate the lower and upper limits of this interval as it mainly depends of each specific case scenario. + +The following is a trickled.conf sample file in the CentOS 7 client (192.168.0.17): + + [ssh] + Priority = 1 + Time-Smoothing = 0.1 + Length-Smoothing = 2 + + [ftp] + Priority = 2 + Time-Smoothing = 1 + Length-Smoothing = 3 + +Using this setup, trickled will prioritize SSH connections over FTP transfers. Note that an interactive process, such as SSH, uses smaller time-smoothing values, whereas a service that performs bulk data transfers (FTP) uses a greater value. The smoothing values are responsible for the download and upload speeds in our previous example not matching the exact value specified by the trickled daemon but moving in an interval close to it. + +### Conclusion ### + +In this article we have explored how to limit the bandwidth used by applications using trickle on Fedora-based distributions and Debian / derivatives. Other possible use cases include, but are not limited to: + +- Limiting the download speed via a system utility such as [wget][4], or a torrent client, for example. +- Limiting the speed at which your system can be updated via `[yum][5]` (or `[aptitude][6]`, if you’re in a Debian-based system), the package management system. +- If your server happens to be behind a proxy or firewall (or is the proxy or firewall itself), you can use trickle to set limits on both the download and upload, or communication speed with the clients or the outside. + +Questions and comments are most welcome. Feel free to use the form below to send them our way. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]:http://linux-training.be/files/books/LinuxFun.pdf +[3]:http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4 +[4]:http://www.tecmint.com/10-wget-command-examples-in-linux/ +[5]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[6]:http://www.tecmint.com/dpkg-command-examples/ \ No newline at end of file diff --git a/sources/tech/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md b/sources/tech/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md new file mode 100644 index 0000000000..dcd3fcf919 --- /dev/null +++ b/sources/tech/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md @@ -0,0 +1,152 @@ +How to Manage KVM Virtual Environment using Commandline Tools in Linux +================================================================================ +In this 4th part of our [KVM series][1], we are discussing KVM environment management using CLI. We use ‘virt-install’ CL tool to create and configure virtual machines, virsh CL tool to create and configure storage pools and qemu-img CL tool to create and manage disk images. + +![KVM Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/KVM-Management-in-Linux.jpg) +KVM Management in Linux + +There is nothing new concepts in this article, we just do the previous tasks using command line tools. There is no new prerequisite, just the same procedure, we have discussed in previous parts. + +### Step 1: Configure Storage Pool ### + +Virsh CLI tool is a management user interface for managing virsh guest domains. The virsh program can be used either to run one command by giving the command and its arguments on the shell command line. + +In this section, we will use it to create storage pool for our KVM environment. For more information about the tool, use the following command. + + # man virsh + +**1. Using the command pool-define-as with virsh to define new storage pool, you need also to specify name, type and type’s arguments.** + +In our case, name will be Spool1, type will be dir. By default you could provide five arguments for the type: + +- source-host +- source-path +- source-dev +- source-name +- target + +For (Dir) type, we need the last argumet “target” to specify the path of storage pool, for the other arguments we could use “-” to unspecific them. + + # virsh pool-define-as Spool1 dir - - - - "/mnt/personal-data/SPool1/" + +![Create New Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Storage-Pool.png) +Create New Storage Pool + +**2. To check the all storage pools you have in the environment, use the following command.** + + # virsh pool-list --all + +![List All Storage Pools](http://www.tecmint.com/wp-content/uploads/2015/02/List-All-Storage-Pools.png) +List All Storage Pools + +**3. Now it’s time to build the storage pool, which we have defined above with the following command.** + + # virsh pool-build Spool1 + +![Build Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Build-Storage-Pool.png) +Build Storage Pool + +**4. Using the virsh command pool-start to active/enable the storage pool we have just created/built above.** + + # virsh pool-start Spool1 + +![Active Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Active-Storage-Pool.png) +Active Storage Pool + +**5. Check the status of environment storage pools using the following command.** + + # virsh pool-list --all + +![Check Storage Pool Status](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Status.png) +Check Storage Pool Status + +You will notice that the status of Spool1 converted to active. + +**6. Configure Spool1 to start by libvirtd service every time automaticlly.** + + # virsh pool-autostart Spool1 + +![Configure KVM Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Configure-Storage-Pool.png) +Configure KVM Storage Pool + +**7. Finally lets display information about our new storage pool.** + + # virsh pool-info Spool1 + +![Check KVM Storage Pool Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Information.png) +Check KVM Storage Pool Information + +Congratulations, Spool1 is ready to be used lets try to create storage volumes using it. + +### Step 2: Configure Storage Volumes/Disk Images ### + +Now it is disk image’s turn, using qemu-img to create new disk image from Spool1. For more details about qemy-img, use the man page. + + # man qemu-img + +**8. We should specify the qemu-img command “create, check,….etc”, disk image format, the path of disk image you want to create and the size.** + + # qemu-img create -f raw /mnt/personal-data/SPool1/SVol1.img 10G + +![Create Storage Volume](http://www.tecmint.com/wp-content/uploads/2015/02/Create-Storage-Volumes.png) +Create Storage Volume + +**9. By using qemu-img command info, you could get information about your new disk image.** + +![Check Storage Volume Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Volume-Information.png) +Check Storage Volume Information + +**Warning**: Never use qemu-img to modify images in use by a running virtual machine or any other process; this may destroy the image. + +Now its time to create virtual machines in the next step. + +### Step 3: Create Virtual Machines ### + +10. Now with the last and latest part, we will create virtual machines using virt-istall. The virt-install is a command line tool for creating new KVM virtual machines using the “libvirt” hypervisor management library. For more details about it, use: + + # man virt-install + +To create new KVM virtual machine, you need to use the following command with all the details like shown in the below. + +- Name: Virtual Machine’s name. +- Disk Location: Location of disk image. +- Graphics : How to connect to VM “Usually be SPICE”. +- vcpu : Number of virtual CPU’s. +- ram : Amount of allocated memory in megabytes. +- Location : Specify the installation source path. +- Network : Specify the virtual network “Usually be vibr00 bridge”. + + # virt-install --name=rhel7 --disk path=/mnt/personal-data/SPool1/SVol1.img --graphics spice --vcpu=1 --ram=1024 --location=/run/media/dos/9e6f605a-f502-4e98-826e-e6376caea288/rhel-server-7.0-x86_64-dvd.iso --network bridge=virbr0 + +![Create New Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Virtual-Machines.png) +Create New Virtual Machine + +**11. You will find also a pop-up virt-vierwer window appears to communicate with virtual machine through it.** + +![Booting Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Booting-Virtual-Machine.jpeg) +Booting Virtual Machine + +![Installation of Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Installation-of-Virtual-Machine.jpeg) +Installation of Virtual Machine + +### Conclusion ### + +This is the latest part of our KVM tutorial, we haven’t covered everything of course. It a shot to scratch the KVM environment so its your turn to search and keep hands dirty using this nice resources. + +- [KVM Getting Started Guide][2] +- [KVM Virtualization Deployment and Administration Guide][3] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/kvm-management-tools-to-manage-virtual-machines/ + +作者:[Mohammad Dosoukey][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/dos2009/ +[1]:http://www.tecmint.com/install-and-configure-kvm-in-linux/ +[2]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html +[3]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html \ No newline at end of file diff --git a/sources/tech/20150304 Share Folders On Local Network Between Ubuntu And Windows.md b/sources/tech/20150304 Share Folders On Local Network Between Ubuntu And Windows.md new file mode 100644 index 0000000000..d0f6d9f1df --- /dev/null +++ b/sources/tech/20150304 Share Folders On Local Network Between Ubuntu And Windows.md @@ -0,0 +1,177 @@ +Share Folders On Local Network Between Ubuntu And Windows +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_windows.jpeg) + +This is a complete tutorial to show you **how to share folders over local network in Ubuntu**. + +Do you have multiple devices in your home? Do you have to use Flash Drive or SD card to transfer data from Ubuntu to another computer? Do you find it annoying? We know you do. Because we don’t want you to waste your precious time while you can transfer your files, documents and other large stuff quickly and easily, over the local network. It’s one time setup and then with some clicks you will be able to **share files between Ubuntu and Windows** or any other Linux system. And don’t worry it’s easy and takes only little time. + +One more thing to add, while we performed this tutorial on Ubuntu, this tutorial should be valid for any other Linux OS. + +#### Share folder on local network in Ubuntu #### + +If you are using Ubuntu 14.04, 14.10 or 12.04, there are two ways you can share your local files over the local network to access it from Windows or other Linux computers. + +- Share it for everyone’s access on local network, without password +- Password protect the folders for restricted access + +We’ll see both methods in this post and will let you decide which one you would prefer to use. + +### 1. Share folders on local network without password ### + +#### Step 1: #### + +To share a folder on local network in Ubuntu, right click on the desired folder and select Local Network Share: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Share_Folder_Ubuntu.jpeg) + +**Possible troubleshoot**: If do not see the option of Local Network Share in right click menu, open a terminal and use the following command to install nautlius-share: + + sudo apt-get install nautilus-share + +You’ll need to restart Nautilus. Either log out and log in back or use the command below: + + nautilus -q + +#### Step 2: #### + +When you click on Local Network Share, you will see the option of sharing the folder. Just check the option of Share this folder: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_1.jpeg) + +Possible troubleshoot: If you are prompted about Sharing service not being installed, like in the screenshot below, just click on Install service and follow the instructions. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_2.jpeg) + +#### Step 3: #### + +When you check the option of Share this folder, you’ll see option of Create Share available for you. You can also allow other users to edit the files in the shared folder. Option for guest access can be checked as well. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_folder_Ubuntu_3.png) + +You’ll see that the folder icon have been changed to show that it has been shared. To stop sharing a folder, just uncheck the Share this folder option. + +Now this was the easy way out. This provides access to anyone on your local network to access these files. In normal condition, you should prefer this. I mean, devices on your home network should be generally know devices. But this could not be the case always. What if you want only certain people to access it? This is where Samba server comes in picture. We’ll see that in the second part of the tutorial. + +### 2. Share the folders on local network in Ubuntu with password protection ### + +To do this, we need to configure Samba server. Actually, we did use Samba in the previous part of this tutorial. We just did not emphasize on it. Before we go on seeing how to set up Samba server for local network sharing in Ubuntu, let’s first have a quick look on what actually is [Samba][1]. + +#### What is Samba? #### + +Samba is the software package that allows you to share files, documents and printers across a network, irrespective of whether you are using Linux, Windows and Mac. It’s available for all major platforms and can work tremendously nice in all of them. Quoting from Wikipedia: + +> Samba a free software re-implementation of the SMB/CIFS networking protocol, and was originally developed by Andrew Tridgell. As of version 3, Samba provides file and print services for various Windows Clients and can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a domain member. It can also be part an Active Directory domain. + +#### Install Samba server on Ubuntu #### + +You can easily install Samba on you Ubuntu box. Before installing update your system so that you can install any available updates. + + sudo apt-get update && apt-get upgrade + +Now install Samba serer and few other required stuffs with the following command: + + sudo apt-get install samba samba-common system-config-samba python-glade2 gksu + +Once you’ve installed Samba server, it’s time to configure Samba from the graphical interface window to share files. + +#### Configure Samba server on Ubuntu #### + +Open Samba Configuration tool from the dash: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Setup-Samba.png) + +Go to **Preference->Server Settings**. Although the default settings are good and may be same you need. But you may need to make change to it in some cases. + +Now in Server Settings you’ve two tabs, ‘Basic’ and ‘Security’. Under Basic tab you’ve the following options that mean: + +- Workgroup – This is the name of the Workgroup of the computer you want to connect to. For example, if you want to connect to a Windows computer so you will enter the workgroup name of Windows computer, and in Windows you already have the same workgroup name as is set by default in Samba Server Settings. But if you have a different workgroup name on Windows then you will enter that workgroup name in this field. (In Windows 7 to get the workgroup name, right-click Computer icon and go to Properties, there you’ll see Windows Workgroup name.) +- Description – This is the name of your computer as seen by others. Don’t use spaces or non-internet friendly characters. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-server-settings.png) + +setting up samba serverAllowing ‘Guests’ is not advisable so there is no reason to change security settings. Keep as it is. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Samba-Security-Settings-compressed.jpg) + +Samba Security security settingsIt is all done! You’ve setup Samba Server. We are not far from sharing our first folder on network. + +#### Create a system user for network file sharing #### + +We will now create a system user for sharing file on network. This is how simple it is. + +- Go to **System Settings**. +- Under Systems Settings Click **User Accounts**. +- Click **unlock** to Enable + (**plus**) icon. +- Click + (plus) icon to create a new system user. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/create-system-user1.jpg) + +Now as you can see the above image, you can enter ‘Full name’. As you enter ‘Full name’ Username will be taken as Full name automatically. Because we are creating this user to share files so we will assign Account Type to ‘**Standard**‘. + +Done above steps? Click add. You have created a system user. The user is not yet activated so we will activate it by setting up password for this account. Make sure Users accounts panel is unlocked. Click Account disabled and type a new password, then confirm password and click Change. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/activate-system-user.jpg) + +Yipee… Upto now we have installed and configured Samba and We have created a System user to share files on network from the account and we have activated our newly created account, too. Now We will move to Samba for the last step of configuring everything, then we will share a folder. + +#### Add new Samba user #### + +Open Samba and click Samba Users under Preference. Fill up the the simple dialogue. Here are couple of details about the fields: + +**Unix Username** – In this case I am selecting the user that I just created. + +**Windows Username** – You will enter this username when you are accessing from Windows Machine. + +**Samba Password** – You will enter this password when you are accessing from Windows Machine. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-user-setting.jpg) + +Once you’ve done click OK. Now take a deep breath. You have successfully created a network with the help of Samba. Now restart the network or Samba services and ready to share files with other machines. + + sudo restart smbd && sudo restart nmbd + +#### Share folders or files over the network #### + +To share files with Samba it’s simple with graphical user interface. Click the Plus icon in Samba and you will get dialogue like this: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/share-files-and-folders.jpg) + +share files and folders over network with sambaComplete the fields. In ‘Directory‘ browse the folder you want to share. Here are the details about the fields you will see here: + +- **Share name** is the name of the folder that other would see. +- **Description** is simply about the content you are sharing on network. +- **Writable** You shared folders are ‘read only’ by default. You can set them to writable if you want others on network to change them. +- **Visible** As the name suggests when you click Visible, the shared folder will be visible to the people on network. + +Now you can set permissions for the folder you are sharing. To do this click ‘Access’ tab and check the users you want to share the folder with. When you select Allow access to everyone, the folder will be accessible to everyone on the network. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Screenshot-from-2015-02-28-202031.png) + +Finally click OK to complete the sharing. Now the folder is shared with the people you want. You have completed sharing file on network. Is there everything left? Yes! How to remove the folders from the network? + +#### Remove shared folders #### + +We will also need to remove some of the folders after sometime from network. It is very simple and here is how we can do that. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/remove-shared-folder-from-network.jpg) + +This is all done! We can also share files over network using terminal but that would not be as easy as this one. If you request for command line sharing then I will write a tutorial on how to share files over network with command line in Linux. + +So, how do you find this tutorial to share files on local network in Ubuntu? I hope with this tutorial you can **easily share files between Ubuntu and Windows**. If you have questions or suggestions, feel free to ask it in the comment box below. + +This tutorial was requested by Kalc. If you would like, you can [request your own tutorial][2]. We would be happy to help you out along with other readers facing the same issue. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/share-folders-local-network-ubuntu-windows/ + +作者:[Mohd Sohail][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/sohail/ +[1]:http://en.wikipedia.org/wiki/Samba_%28software%29 +[2]:http://itsfoss.com/request-tutorial/ \ No newline at end of file diff --git a/sources/tech/20150306 How to Setup lftp--A Simple Command line FTP Program.md b/sources/tech/20150306 How to Setup lftp--A Simple Command line FTP Program.md new file mode 100644 index 0000000000..b4fe88cd12 --- /dev/null +++ b/sources/tech/20150306 How to Setup lftp--A Simple Command line FTP Program.md @@ -0,0 +1,174 @@ +How to Setup lftp - A Simple Command line FTP Program +================================================================================ +Hi everyone, this article is about Lftp and how we can install Lftp in our Linux Operating System. [Lftp][1] is a command line based File Transfer Software also known as FTP Client which was developed by Alexander Lukyanov and was distributed as GNU General Public License. Besides FTP, it also supports FTPS, HTTP, HTTPS, HFTP, FISH, and SFTP. The program also supports FXP, allowing for data transfers between two FTP servers bypassing the client machine. + +It has some awesome advanced features such as recursively mirroring entire directory trees and resuming downloads. Transfers can be scheduled for execution at a later time, bandwidth can be throttled, transfer queues can be created, and Unix shell-like job control is supported. The client can also be used interactively or automated with scripts. + +### Installing Lftp ### + +Before we try to run lftp, we have make sure that it is properly installed in our Linux Distribution. Here are some commands mentioned for installing lftp in the list common distribution of Linux. + +**On Ubuntu 14.04 LTS** + +In Ubuntu 14.04 LTS and its derivatives, we can install lftp using apt manager. So, to install it, we'll need to run the following commands in a shell or a terminal under sudo privilege. + + $ sudo apt-get install lftp + +![ubuntu install lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/ubuntu-install-lftp.png) + +**On CentOS/Fedora/RHEL** + +As lftp is also available in the repository of Fedora, CentOS and RHEL, we can use **yum** manager to install it. + + $ sudo yum install lftp + +![fedora lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/fedora-lftp.png) + +**On Arch Linux** + +It is also available in Arch Linux Package Repository so, we can simply use pacman to install it. + + $ sudo pacman -S lftp + +![archlinux install lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/archlinux-install-lftp.png) + +**On OpenSuse** + +Zypper, package management software for OpenSuse can be used to install lftp. Here is the command with which one can install it on their OpenSuse machine. + + $ sudo zypper install lftp + +![opensuse lftp install](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp_install.png) + +### Logging in ### + +To login to a ftp server or sftp server, we'll first need to know about the required credential for the login like username, password, ports. + +After that, we'll want to login using lftp client as basic usage. + + $ lftp ftp://linoxide@localhost + +![ftp login](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login.png) + +If we need to point a port to the login then, we'll need to add port as shown below. + + $ lftp ftp://linoxide@localhost:21 + +![ftp login with ports](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login-port.png) + +### Navigation ### + +We can use **ls** to list files and directories, **cd** to enter into a directory. + +![ls and cd](http://blog.linoxide.com/wp-content/uploads/2015/03/ls-cd-lftp.png) + +### Uploading and Download Files ### + +We can use **pget** for downloading files from the remote server. + + > pget linspeed.svg + +![pget lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/pget-lftp.png) + +We can use **put** for uploading files to the remote server. + + > put linoxide.tar + +![upload with put](http://blog.linoxide.com/wp-content/uploads/2015/03/put-upload.png) + +To resume partially downloaded files/directories, we will use the -c switch: + + > mirror -c Directory + + >pget -c linoxide.tar + + > put -c upload.tar + +### Using Mirror ### + +We can use mirror to download the whole directory pointed as the source. + + > mirror remote local + +![download with mirror](http://blog.linoxide.com/wp-content/uploads/2015/03/mirror.png) + +There is also reverse mirror (mirror -R) which uploads or updates a directory tree on server. + + > mirror -R local remote + +![upload or update with mirror reverse](http://blog.linoxide.com/wp-content/uploads/2015/03/mirror-reverse.png) + +To resume partially downloaded files/directories, we will use the -c switch: + + > mirror -c Directory + +### To Queue Items to Download ### + +We can use queue option with lftp so that we can download selected files in a queue one by one as there is an option in GUI based clients to select and download in a queue. Here's an example on it. + +To prevent queue from auto transferring while you add to it : + + > queue stop + +Now, we'll add them into queue. + + > queue mirror "directory" + + > queue pget "file.tar" + +After the queue has been added, we should run queue start command. + + > queue start + +To remove the entire queue run the following command. + + > queue -d + +### Segmented Downloading ### + +Here, in this example we are segmenting files into 3 segments, one can change it according to their own need. + +A pget command using segmentation is **pget -n 3 file.tar**, where 3 is the number of segments. + + > pget -n 3 file.tar + +A mirror command using segmentation is **mirror --use-pget-n=3 directory**, where 3 is the number of segments. + + > mirror --use-pget-n=3 linxoxide + +We can use jobs -v to see the speeds of the individual segments as well as the total speed. + +### To Stop, Resume or Kill a Transfer ### + +To cancel a transfer we can press Ctrl+c . And to resume a download we can use the -c (--continue) switch as shown below. + + > mirror -c directory + +And to kill an active transfer we should run **kill** and to kill and delete all we'll need to run **kill all** as shown below. + + > kill + + > kill all + +### Exiting ### + +To quit from lftp, we should run exit command in the terminal or inside lftp interface. + + > exit + +### Conclusion ### + +Hurray! We have successfully installed lftp and learned some basic major ways to use it. lftp is an awesome command line ftp client which supports a lot of additional functionality and cool features. It has a lot stuffs more than the other common ftp client. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy lftp :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-lftp-command-line-ftp/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://lftp.yar.ru/ \ No newline at end of file diff --git a/sources/tech/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md b/sources/tech/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md new file mode 100644 index 0000000000..bd9a956d12 --- /dev/null +++ b/sources/tech/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md @@ -0,0 +1,167 @@ +10 Useful ‘ls’ Command Interview Questions – Part 2 +================================================================================ +Continuing the legacy of ls command here is the second interview article on Listing command. The first article of the series was highly appreciated by the Tecmint Community. If you’ve missed the first part of this series you may like to visit at: + +- [15 Interview Questions on “ls” Command – Part 1][1] + +This article is well presented in the manner that it gives deep insight of ls command with examples. We have taken extra care in the making of article so that it remains simple to understand yet serve the purpose to the fullest. + +![10 Interview Questions on ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Interview-Questions.jpg) +10 Interview Questions on ls Command + +### 1. You are supposed to list the content of a directory in long list format, but not print the name of the author and group the file belongs. Also show the difference in output. ### + +a. ls command listing the name of the files in long listing format when used with switch (-l). + + # ls -l + +![List Files in- Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-inLong-List-Format.gif) +List Files in- Long List Format + +b. ls command listing the name of the files in long listing format along with the name of the author file belongs, when used with switch (–author) along with switch (-l). + + # ls -l --author + +![List Files By Author](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-By-Author.gif) +List Files By Author + +c. ls command listing the name of the files without the name of its owner, when used with switch (-g). + + # ls -g + +![List Files Without Printing Owner Name](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Author.gif) +List Files Without Printing Owner Name + +d. ls command listing the name of files in long listing format without the name of group it belongs, when used with switch (-G) along with switch (-l). + + # ls -Gl + +![List Files Without Printing Group](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Group.gif) +List Files Without Printing Group + +### 2. Print the size of files and folders in the current directory, in human readable format. How will you do this? ### + +Well we need to use switch -h (human-readable) along with switch (-l) and/or (-s) with the command ls to get the desired output. + + # ls -hl + +![List Files in Human Readable Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Size-of-Files-with-ls.gif) +List Files in Human Readable Format + + # ls -hs + +![List File Sizes in Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-File-Sizes-in-Readable-Format.gif) +List File Sizes in Long List Format + +**Note**: The option -h uses the power of 1024 (standard in computation) and output the size of files and folders in the units of K, M and G. + +### 3. Well if switch (-h) output size in power of 1024, that is standard, What else power values are supported in ls command? ### + +There exist a switch -si which is similar to switch -h. The only difference is switch -si uses power of 1000 unlike switch -h which uses the power of 1024. + + # ls -si + +![Supported Power Values of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-supported-power-values.gif) +Supported Power Values of ls Command + +It can also be used with switch -l to output the size of folder in the power of 1000, in long listing format. + + # ls -si -l + +![List Files by Power Values](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-by-Power-Values.gif) +List Files by Power Values + +### 4. You are supposed to print the contents of a directory separated with comma. Is it possible? Can it be done in long listing format? ### + +Yup! Linux ls command can output the contents of a directory separated by comma when used with the switch (-m). Since this comma separated entries are filled horizontally, ls command can’t separate contents with comma when listing contents vertically. + + # ls -m + +![Print Contents of Directory by Comma](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Contents-of-Directory-by-Comma.gif) +Print Contents of Directory by Comma + +When used in long listing format, switch -m gets useless. + + # ls -ml + +![Listing Content Horizontally](http://www.tecmint.com/wp-content/uploads/2015/03/Listing-Content-Horizentally.gif) +Listing Content Horizontally + +### 5. If there any way to print the contents of a directory upside down? i.e., in reverse order. ### + +Yeah! The above situation can easily be achieved using the switch -r. The switch ‘-r‘ reverse the order of output. It can also be used with switch -l (long listing format). + + # ls -r + +![List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-in-Reverse-Order.gif) +List Content in Reverse Order + + # ls -rl + +![Long List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Content-in-Reverse-Order.gif) +Long List Content in Reverse Order + +### 6. You are given a situation to print the sub-directories recursively. How will you achieve this situation? Mind it only sub directories and no files. ### + +Okay! That is pretty easy with the switch -R when used with command ls. It can further be grouped with other options like -l (long list) and -m (comma separated), etc. + + # ls -R + +![Print Sub Directories in Recursively](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Sub-Directories-in-Recursively.gif) +Print Sub Directories in Recursively + +### 7. How to sort the files based upon the size? ### + +The Linux command line option -S when used with ls gives the desired output. To sort the files based upon size in descending order with the largest file listed at first and smallest at last. + + # ls -S + +![Sort Files with ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Linux.gif) +Sort Files with ls Command + +To sort the files based upon size in descending order with the smallest file listed at first and largest at last. + + # ls -Sr + +![Sort Files in Descending Order](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Descending-Order.gif) +Sort Files in Descending Order + +### 8. List the contents of a directory with no additional information appearing one file per line. ### + +The switch -1 comes to rescue here. ls command with switch -1 output the contents of the directory with one file per line and no additional information. + + # ls -1 + +![List Files Without Information](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Information.gif) +List Files Without Information + +### 9. You are given a situation in which you have to print the contents of a directory on standard output enclosed by double quotes. How will you do this? ### + +There exist an option -Q (quote-name) which output the content of ls enclosed in double quotes. + + # ls -Q + +![Print Files with Double Quotes](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Files-with-Double-Quotes.gif) +Print Files with Double Quotes + +### 10. You are working in a directory which contains lots of files and folders. You need to print the name of folders before directories. How will you get this? ### + + # ls --group-directories-first + +![Print Directories First](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Directories-First.gif) +Print Directories First + +That’s all for now. We will be coming up with the next part of this article series very soon. Till then stay tuned and connected to Tecmint. Do not forget to provide us with valuable feedback in the comment section below. Like and share us and help us get spread! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/ls-interview-questions/ + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:http://www.tecmint.com/ls-command-interview-questions/ \ No newline at end of file diff --git a/sources/tech/20150309 15 Basic 'ls' Command Examples in Linux.md b/sources/tech/20150309 15 Basic 'ls' Command Examples in Linux.md new file mode 100644 index 0000000000..3ff1e4df47 --- /dev/null +++ b/sources/tech/20150309 15 Basic 'ls' Command Examples in Linux.md @@ -0,0 +1,262 @@ +15 Basic ‘ls’ Command Examples in Linux +================================================================================ +ls command is one of the most frequently used command in Linux. I believe ls command is the first command you may use when you get into the command prompt of Linux Box. We use ls command daily basis and frequently even though we may not aware and never use all the option available. In this article, we’ll be discussing basic ls command where we have tried to cover as much parameters as possible. + +![Linux ls Command](http://www.tecmint.com/wp-content/uploads/2012/08/Linux-ls-Commands.png) +Linux ls Command + +### 1. List Files using ls with no option ### + +ls with no option list files and directories in bare format where we won’t be able to view details like file types, size, modified date and time, permission and links etc. + + # ls + + 0001.pcap Desktop Downloads index.html install.log.syslog Pictures Templates + anaconda-ks.cfg Documents fbcmd_update.php install.log Music Public Videos + +### 2 List Files With option –l ### + +Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder name and owner of file and it’s permission. + + # ls -l + + total 176 + -rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap + -rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents + drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads + -rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php + -rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html + -rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log + -rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos + +### 3. View Hidden Files ### + +List all files including hidden file starting with ‘.‘. + + # ls -a + + . .bashrc Documents .gconfd install.log .nautilus .pulse-cookie + .. .cache Downloads .gnome2 install.log.syslog .netstat.swp .recently-used.xbel + 0001.pcap .config .elinks .gnome2_private .kde .opera .spice-vdagent + anaconda-ks.cfg .cshrc .esd_auth .gtk-bookmarks .libreoffice Pictures .tcshrc + .bash_history .dbus .fbcmd .gvfs .local .pki Templates + .bash_logout Desktop fbcmd_update.php .ICEauthority .mozilla Public Videos + .bash_profile .digrc .gconf index.html Music .pulse .wireshark + +### 4. List Files with Human Readable Format with option -lh ### + +With combination of -lh option, shows sizes in human readable format. + + # ls -lh + + total 176K + -rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap + -rw-------. 1 root root 1.6K Jul 31 02:17 anaconda-ks.cfg + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Desktop + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Documents + drwxr-xr-x. 4 root root 4.0K Aug 16 02:55 Downloads + -rw-r--r--. 1 root root 21K Aug 12 12:42 fbcmd_update.php + -rw-r--r--. 1 root root 46K Jul 31 09:58 index.html + -rw-r--r--. 1 root root 48K Jul 31 02:17 install.log + -rw-r--r--. 1 root root 12K Jul 31 02:13 install.log.syslog + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Music + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Pictures + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Public + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Templates + drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Videos + +### 5. List Files and Directories with ‘/’ Character at the end ### + +Using -F option with ls command, will add the ‘/’ Character at the end each directory. + + # ls -F + + 0001.pcap Desktop/ Downloads/ index.html install.log.syslog Pictures/ Templates/ + anaconda-ks.cfg Documents/ fbcmd_update.php install.log Music/ Public/ Videos/ + +### 6. List Files in Reverse Order ### + +The following command with ls -r option display files and directories in reverse order. + + # ls -r + + Videos Public Music install.log fbcmd_update.php Documents anaconda-ks.cfg + Templates Pictures install.log.syslog index.html Downloads Desktop 0001.pcap + +### 7. Recursively list Sub-Directories ### + +ls -R option will list very long listing directory trees. See an example of output of the command. + + # ls -R + + total 1384 + -rw-------. 1 root root 33408 Aug 8 17:25 anaconda.log + -rw-------. 1 root root 30508 Aug 8 17:25 anaconda.program.log + + ./httpd: + total 132 + -rw-r--r-- 1 root root 0 Aug 19 03:14 access_log + -rw-r--r--. 1 root root 61916 Aug 10 17:55 access_log-20120812 + + ./lighttpd: + total 68 + -rw-r--r-- 1 lighttpd lighttpd 7858 Aug 21 15:26 access.log + -rw-r--r--. 1 lighttpd lighttpd 37531 Aug 17 18:21 access.log-20120819 + + ./nginx: + total 12 + -rw-r--r--. 1 root root 0 Aug 12 03:17 access.log + -rw-r--r--. 1 root root 390 Aug 12 03:17 access.log-20120812.gz + +### 8. Reverse Output Order ### + +With combination of -ltr will shows latest modification file or directory date as last. + + # ls -ltr + + total 176 + -rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog + -rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log + -rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents + -rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html + -rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php + drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads + -rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap + +### 9. Sort Files by File Size ### + +With combination of -lS displays file size in order, will display big in size first. + + # ls -lS + + total 176 + -rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log + -rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html + -rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php + -rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents + drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates + drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos + -rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg + -rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap + +### 10. Display Inode number of File or Directory ### + +We can see some number printed before file / directory name. With -i options list file / directory with inode number. + + # ls -i + + 20112 0001.pcap 23610 Documents 23793 index.html 23611 Music 23597 Templates + 23564 anaconda-ks.cfg 23595 Downloads 22 install.log 23612 Pictures 23613 Videos + 23594 Desktop 23585 fbcmd_update.php 35 install.log.syslog 23601 Public + +### 11. Shows version of ls command ### + +Check version of ls command. + + # ls --version + + ls (GNU coreutils) 8.4 + Copyright (C) 2010 Free Software Foundation, Inc. + License GPLv3+: GNU GPL version 3 or later . + This is free software: you are free to change and redistribute it. + There is NO WARRANTY, to the extent permitted by law. + Written by Richard M. Stallman and David MacKenzie. + +### 12. Show Help Page ### + +List help page of ls command with their option. + + # ls --help + + Usage: ls [OPTION]... [FILE]... + +### 13. List Directory Information ### + +With ls -l command list files under directory /tmp. Wherein with -ld parameters displays information of /tmp directory. + + # ls -l /tmp + total 408 + drwx------. 2 narad narad 4096 Aug 2 02:00 CRX_75DAF8CB7768 + -r--------. 1 root root 384683 Aug 4 12:28 htop-1.0.1.tar.gz + drwx------. 2 root root 4096 Aug 4 11:20 keyring-6Mfjnk + drwx------. 2 root root 4096 Aug 16 01:33 keyring-pioZJr + drwx------. 2 gdm gdm 4096 Aug 21 11:26 orbit-gdm + drwx------. 2 root root 4096 Aug 19 08:41 pulse-gl6o4ZdxQVrX + drwx------. 2 narad narad 4096 Aug 4 08:16 pulse-UDH76ExwUVoU + drwx------. 2 gdm gdm 4096 Aug 21 11:26 pulse-wJtcweUCtvhn + -rw-------. 1 root root 300 Aug 16 03:34 yum_save_tx-2012-08-16-03-34LJTAa1.yumtx + +---------- + + # ls -ld /tmp/ + + drwxrwxrwt. 13 root root 4096 Aug 21 12:48 /tmp/ + +### 14. Display UID and GID of Files ### + +To display UID and GID of files and directories. use option -n with ls command. + + # ls -n + + total 36 + drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Downloads + drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Music + drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Pictures + -rw-rw-r--. 1 500 500 12 Aug 21 13:06 tmp.txt + drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Videos + +### 15. ls command and it’s Aliases ### + +We have made alias for ls command, when we execute ls command it’ll take -l option by default and display long listing as mentioned earlier. + + # alias ls="ls -l" + +Note: We can see number of alias available in your system with below alias command and same can be unalias as shown below example. + + # alias + + alias cp='cp -i' + alias l.='ls -d .* --color=auto' + alias ll='ls -l --color=auto' + alias ls='ls --color=auto' + alias mv='mv -i' + alias rm='rm -i' + alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' + +To remove an alias previously defined, just use the unalias command. + + # unalias ls + +In our next article we’ll cover up more or advanced ls command with their examples. If we’ve missed anything in the list, please update us via comment section. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ \ No newline at end of file diff --git a/sources/tech/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md b/sources/tech/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md new file mode 100644 index 0000000000..29804f5874 --- /dev/null +++ b/sources/tech/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md @@ -0,0 +1,187 @@ +15 Interview Questions on Linux “ls” Command – Part 1 +================================================================================ +The listing command in UNIX and UNIX like operating System ‘ls‘ is one of the most basic and widely used utility in command-line. It is POSIX compliant utility available for GNU coreutils and BSD variants. The ‘ls’ command can be used with a variety of options to get desired results. This article aims at deep insight of file listing command in Linux with relevant examples. + +![15 ls Command Questions](http://www.tecmint.com/wp-content/uploads/2014/09/ls-Command-Questions.png) +15 ls Command Questions + +### 1. How will you List files from a directory? ### + +Ans: The Linux file listing command ‘ls‘ comes to rescue here. + + # ls + +![List Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-files.gif) +List Files + +Alternatively, we can use ‘echo‘ command to list files within a directory in association with wildcard (*). + + # echo * + +![List All Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-files.gif) +List All Files + +### 2. How will you list all the directories only using echo command? ### + + # echo */ + +![List All Directories](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-directories.gif) +List All Directories + +### 3. How will you list all the files within a directory including hidden files aka (.) dot files? ### + +Ans: We need to use option ‘-a‘ (list hidden files) with command ‘ls‘. + + # ls -a + +![List All Hidden Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-hidden-files.gif) +List All Hidden Files + +### 4. How do you list all the files within a directory including hidden files, but do not list implied ‘.’ and ‘..’? ### + +Ans: We need to use option ‘-A‘ (do not list implied . and ..) with command ‘ls‘. + + # ls -A + +![Do Not List Implied](http://www.tecmint.com/wp-content/uploads/2014/09/Do-not-list-Implied.gif) +Do Not List Implied + +### 5. How will you print the content of a directory in long format listing? ### + +Ans: We need to use option ‘l‘ (long format) with command ‘ls‘. + + # ls -l + +![List Files Long](http://www.tecmint.com/wp-content/uploads/2014/09/list-files-long.gif) +List Files Long + +In the above example, the output seems like. + + drwxr-xr-x 5 avi tecmint 4096 Sep 30 11:31 Binary + +Here, drwxr-xr-x is file permission for owner, group and world. Owner has Read(r), Write(w) and Execute(x) permission. The group to which this file belongs has Read(r) and Execute(x) permission but not Write(w) permission, same permission implies for the world that have access to this file. + +- The Initial ‘d‘ means its a Directory. +- Number ‘5‘ represents Symbolic Link. +- The File Binary belongs to user avi and group tecmint. +- Sep 30 11:31 represents the date and time it was last modified. + +### 6. You are supposed to print the content of directory in long format listing, showing hidden/dot files. How will you achieve this? ### + +Ans: We need to use option ‘-a‘ (list hidden files) and ‘-l‘ (long listing) together with command ‘ls‘. + + # ls -la + +![Print Content of Directory](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Content-of-Directory.gif) +Print Content of Directory + +Alternatively We can use option ‘-A‘ and ‘-l‘ with ‘ls‘ command, if we do not want to list implied ‘.’ and ‘..’. + + # ls -lA + +### 7. How will you figure out the author of each file? ### + +Ans: We need to use option ‘–author‘ along with option ‘-l‘ to print the author name of each file. + + # ls --author -l + +![List Author Files](http://www.tecmint.com/wp-content/uploads/2014/09/List-Author-Files.gif) +List Author Files + +### 8. How will you print escape for non-graphic character? ### + +Ans: We just need to use option ‘-b‘ to print escape for non-graphic character. + + # ls -b + +![Print Escape Character](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Escape-Character.gif) + +### 9. List the size of files and folders in desired scale format. How will you achieve this? ### + +Ans: Here option ‘–block-size=scale‘ along with option ‘-l‘ needs to be used. We need to remove ‘scale’ in the example with the desired scale viz M, K, etc. + + # ls --block-size=M -l + # ls --block-size=K -l + +![List File Scale Format](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Scale-Format.gif) +List File Scale Format + +### 10. List the files within a directory, but don’t show the backup files, i.e., those files that end with ~. ### + +Ans: Here option ‘-B‘ (do not list implied entries ending with ~) comes to rescue. + + # ls -B + +![List File Without Backup](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Without-Backup.gif) +List File Without Backup + +### 11. Sort all the files within a directory by name and show associated last modification information. ### + +Ans: We need to use option ‘-c‘ and option ‘-l‘ with command ls to fulfil the need as suggested above. + + # ls -cl + +![Sort Files](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files.gif) +Sort Files + +### 12. Sort all the files within a directory by modification time and show associated information. ### + +Ans: We need to use three options together i.e., ‘-l‘, ‘-t‘ and ‘-c‘ with command ls to sort files by modification time, newest first. + + # ls -ltc + +![Sort Files by Modification](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files-by-Modification.gif) +Sort Files by Modification + +### 13. How will you control the output of ‘ls’ command to be colorful or no-color? ### + +Ans: We need to use option ‘–color=parameter‘. The parameter to be used with color option are ‘auto’, ‘always’ and ‘never’ which are self explanatory. + + # ls --color=never + # ls --color=auto + # ls --color=always + +![ls Colorful Output](http://www.tecmint.com/wp-content/uploads/2014/09/ls-colorful-output.gif) +ls Colorful Output + +### 14. You are supposed to list directory entries themselves, not their contents. What will you do? ### + +Ans: Here the option ‘-d‘ comes handy. + + # ls -d + +![List Directory Entries](http://www.tecmint.com/wp-content/uploads/2014/09/List-Directory-Entries.gif) +List Directory Entries + +### 15. Create an alias for long format listing “ls -l” as “ll” and output the result to a file and not standard output. ### + +Ans: Here in the above scenario, we need to add alias to .bashrc file and then use redirect operator to write the output to file and not standard output. We will be using editor nano. + + # ls -a + # nano .bashrc + # ll >> ll.txt + # nano ll.txt + +![Create Alias for ls command](http://www.tecmint.com/wp-content/uploads/2014/09/Create-ls-Alias.gif) +Create Alias for ls command + +That’s all for now. Don’t forget to provide us with your valuable feedback in the comments below. I’ll be here again with another interesting article soon. Till then stay tuned and connected. + +### Real Also: ### + +- [10 ‘ls’ Command Interview Questions – Part 2][1] +- [15 Basic ‘ls’ Commands in Linux][2] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/ls-command-interview-questions/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/ls-interview-questions/ +[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server.md b/sources/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server.md new file mode 100644 index 0000000000..550d373d65 --- /dev/null +++ b/sources/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server.md @@ -0,0 +1,81 @@ +List Of Free Windows SSH Client Tools To Connect To Your Linux Server +================================================================================ +You have Windows as operating system and you need to connect to Linux server to transfer files from Linux to Windows and inversely. So you need to have Secure Shell known as SSH. In fact, SSH is a network protocol which enables you to connect to Linux and Unix servers over the network. It uses public key cryptography to authenticate the remote computer. You can use SSH by several ways, either by using it automatically or by using a password authentication to log in. + +This article provides a list of SSH clients let you to connect SSH to your Linux servers. + +let’s start. + +### PuTTY ### + +**PuTTY** is the most famous SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/putty.png) + +Putty is very easy to install and to use.You don’t usually need to change most of the configuration options. To start the simplest kind of session, all you need to do is to enter a few basic parameters.You can download PuTTY [here][1] + +### Bitvise SSH Client ### + +**Bitvise SSH** Client is an SSH and SFTP client for Windows. It is developed and supported professionally by Bitvise. The SSH Client is robust, easy to install, easy to use. Bitvise SSH Client is a feature-rich graphical SSH/SFTP client for windows and allow you dynamic port forwarding through an integrated proxy with auto-reconnecting capability. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png) + +Bitvise SSH Client is **free for personal use**, as well as for individual commercial use inside organizations. You can [download Bitvise SSH Client here][2]. + +### MobaXterm ### + +**MobaXterm** is your **ultimate toolbox for remote computing**. In a single Windows application, it provides loads of functions that are tailored for programmers, webmasters, IT administrators and pretty much all users who need to handle their remote jobs in a more simple fashion. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png) + +MobaXterm provides all the important **remote network tools** (SSH, X11, RDP, VNC, FTP, MOSH, …) and **Unix commands** (bash, ls, cat, sed, grep, awk, rsync, …) to Windows desktop, in a **single portable exe file** which works out of the box. MobaXterm is **free for personal use**. You can download MobaXterm [from here][3]. + +### DameWare SSH ### + +I think that **DameWare SSH** is the best free ssh client. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/ssh.png) + +This free tool is a terminal emulator that lets you make multiple telnet and SSH connections from one easy-to-use console. + +- Manage multiple sessions from one console with a tabbed interface +- Save favorite sessions within the Windows file system +- Access multiple sets of saved credentials for easy log-in to different devices +- Connect to computers and devices using telnet, SSH1, and SSH2 protocols + +You can download **DameWare SSH** from [this link][4]. + +### SmarTTY ### + +SmarTTY is a free multi-tabbed SSH client that supports copying files and directories with SCP on-the-fly. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/smart.png) + +Most SSH servers support up to 10 sub-sessions per connection. SmarTTY makes the best of it: no annoying multiple windows, no need to relogin, just open a new tab and go! + +### Cygwin ### + +Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/cyq.png) + +**Cygwin** consists of a Unix system call emulation library, cygwin1.dll, together with a [vast set][5] of GNU and other free software applications organized into a large number of optional packages. Among these packages are high-quality compilers and other software development tools, an X11 server, a complete X11 development toolkit, GNU emacs, TeX and LaTeX, OpenSSH (client and server), and much more, including everything needed to compile and use PhysioToolkit software under MS-Windows. + +After reading our article, which is your favorite SSH client? You can leave a comment describing your favorite system and the reasons of your choice. And of course if there is another SSH client doesn’t appear in this article, you can help us to add it. + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/ + +作者:[anismaj][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.unixmen.com/author/anis/ +[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html +[2]:http://www.bitvise.com/download-area +[3]:http://mobaxterm.mobatek.net/download.html +[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM +[5]:http://cygwin.com/packages/ \ No newline at end of file diff --git a/translated/share/20141127 11 Useful Utilities To Supercharge Your Ubuntu Experience.md b/translated/share/20141127 11 Useful Utilities To Supercharge Your Ubuntu Experience.md new file mode 100644 index 0000000000..5b60043bcd --- /dev/null +++ b/translated/share/20141127 11 Useful Utilities To Supercharge Your Ubuntu Experience.md @@ -0,0 +1,155 @@ +11 个 增强你的 Ubuntu 使用体验的实用工具 +================================================================================ +**无论你是一个相对的新手还是经验丰富的专家,我们都想从我们的操作系统中得到更多的东西。正如大多数现代的操作系统,相比于乍一看呈现出的内容,Ubuntu 有更多东西可以向我们提供。** + +从调整和优化 Unity 桌面的外观、行为、性能 到 执行系统维护,有着大量的实用工具和应用可以帮助你 **调整 Ubuntu 来无时不刻地满足你的需求**。 + +注意时刻: Ubuntu 一直都配备了‘合理的默认设置---即工作良好的选项---’,以达到开箱即用,这些默认设置适合大多数人,并且它们都是经过了测试,采用及推荐等过程的。 + +但一个尺寸并不适合所有。对于我们当中的能工巧匠和实验主义者来说,默认设置只是他们定制系统的起点。 + +所以,无需更多的唠叨, 这里有 11 个极好的实用工具来帮助你增强你的 Ubuntu 使用体验。 + +### Unity Tweak Tool ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/unity-tweak-tool.jpg) + +我将以这个列表中最重要的一个工具: **Unity Tweak Tool** 来开始这次的介绍。定制的厨房水槽(注:不知该如何翻译,感觉意思是:水槽之于厨房的重要性相当于该软件之于定制 Ubuntu 的重要性), Unity Tweak Tool 提供了一系列针对 Ubuntu 和 Unity 桌面的系统综合调整功能。 + +它被各种开关,切换和控制塞得满满的,使得你可以任意设置从 Unity 桌面的外观到 Unity 的行为之类的任何东西。你可以使用它 **快速简便地改变 GTK 主题和图标集**、设置热区、调整启动器图标尺寸、增加或移除工作区,以及 ---特别地---开启 Unity 桌面中被巧妙隐藏的“通过点击最小化”的特点。 + +免费并可直接从 Ubuntu 软件中心里找到, Unity Tweak Tool 是非常值得保留在你的口袋里的工具之一。 + +### Unity Privacy Indicator ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/indicator-privacy-in-ubuntu.jpg) + +隐私是一个非常,非常重要的事,事实也恰恰如此。但这个话题总是被隐藏在二进制之下(注:感觉这里翻译有误,不太确定)。让一些数据或习惯,比如说你经常打开的应用,在本地被记录下来,这或许会让你感到高兴,但对于 你在 Dash 中的搜索数据被发送带第三方服务机构(尽管这些数据或许是匿名的)这类事情,你就高兴不起来了。 + +[Privacy Indicator][1] 是一个帮助你时刻跟踪 Ubuntu桌面系统中哪些文件、目录和服务正被获取、记录及搜索的实用工具。 + +通过快速的点击被添加到桌面面板上的‘眼睛’图标,你可以: + +- 开启或关闭在线搜索结果,Zeitgeist(注:根据图片看,Zeitgeist 指的是 record activity), HUD 记录 和 GeoIP 服务 +- 快速的启用 清理 Zeitgeist,F2(注:根据图片看,F2 指的是 通过 Alt-F2 执行的命令),当前文件等等的记录数据 +- 展示或隐藏桌面图标以及它们在桌面面板上的名称 + +上面的最后两个选项在这个应用中似乎有点被放错了位置,但对于那些要分享截图或截屏的人来说,将会泄露更少的隐私。 + +- [从这里下载 Indicator Privacy (.deb)][2] + +### Unity Folders ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/unity-folders.jpg) + +**Android, iOS, OS X, Chrome OS, 和 GNOME Shell 都有应用橱窗, 借助一个极好的第三方应用,Unity 也可以实现类似功能。** + +“Unity Folders” 允许你组织位于 Unity 启动器中的应用到实用的橱窗中,--- 如 游戏,办公,社交等。不必打开 Dash,你就可以快速启动你喜爱的应用,这非常适合你的工作流。 + +每一个 ‘橱窗’其实一个打开 ,但总体效果看上去就像是一个 OS X 的风格栈 或 Android 的切换框(注:这里的翻译我拿不准)。 + +橱窗的图标可以自定义或根据橱窗内的应用来自动生成。已经存在的橱窗可以被编辑,重新组织,重命名以及如下的更多选择: + +- 根据你的喜好创建任意多的橱窗 +- 选择自定义或自动生成橱窗图标 +- 可选择 3 种橱窗样式 +- 为添加到橱窗中的应用设定自定义图标 +- 编辑现有橱窗 + +[Unity Folders 的网址](http://unity-folders.exceptionfound.com/) +(注:根据原文来看,这里应该有链接,转换为 md 文档时没有加上链接) + +### 咖啡因 ### + +对于我们中的许多人来说,咖啡因是主食,它并不只存在于饮料之中。咖啡因提供了一个快速,温和的方式来阻止你的屏保或锁屏起作用。有用的程度将取决于你的环境(即你系统的怪癖) (注:这一句我没有完全理解原文的意思),并且尽管它不像以前那样对用户友好,它仍然值得你[尝试一下][3]。 + +### 系统状态指示器 (System Monitor Indicator) ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/multiload-indicator-in-ubuntu.jpg) + +假如你是一个状态迷,即一个喜欢密切关注程序,进程和硬件的状态的人, Linux 很容易满足你的需求。从 Conky 的配置到终端命令,并不缺少监视你的 CPU 使用情况、网络流量或 GPU 温度的方法。 + +但至今为止,我最喜爱的应用是 系统**监视指示器**,---也被叫做多负载指示器---它可从 Ubuntu 软件中心获得。它也有着大量的配置选项。 + +- [点击这个链接,在 Ubuntu 中 下载 ‘System Load Indicator’][4] + +### 针对 Linux 笔记本电脑的省电工具 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/08/front.jpg) + +**TLP** + +当提到便携式设备上的电池使用效率时,Linux 发行版本并没有最好的声誉。 + +如果你自己的 Linux 笔记本可以勉强在再次充电之前,让你从沙发到厨房,那么这里有几个你可以试试的工具。 + +TLP 是最受欢迎的确保延长 Linux 笔记本的电池寿命的自动化后台工具之一,它是通过调整系统进程和硬件的设置及行为来达到此目的的,例如 启动 Wi-Fi 省电模式, PCI 总线设备的实时电量管理和处理器的频率缩放调整。 + +在 Ubuntu 14.04 LTS 以及后续发行版本中可以使用 TLP 专用的 PPA 来安装它。且它只带了‘包罗万象’的设置来使你踏上配置它的旅程。 在我们之中的高级用户可以潜心研究并根据你自己的硬件来调整设置,一个 [关于 TLP 的完整指导 wiki][6] 使得设置更加容易。 + +**Laptop Mode Tools** + +假如 TLP 听起来有一点复杂 --这也并没有什么可羞耻的--这里有一个更简单的替代品: **Laptop Mode Tools**。 这个软件包可从 Ubuntu 软件中心直接安装,且本身设置好了一系列合理的默认设置(Wi-Fi,蓝牙等等)。 + +Laptop Mode Tools 不能和 TLP 同时被安装在电脑中。 + +- [Ubuntu 软件中心里的 Laptop Mode Tools ][7] + +### Intel 显卡驱动安装工具 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/intelgraphicsdriverinstaller.png) + +对于那些运行 Intel 显卡硬件,并想使得这些硬件发挥出最佳性能的人来说,Intel 显卡安装工具是必须拥有的。 它使得 查找并安装最新的 Intel GPU 驱动变得不再是一件痛苦和大费周折的事 ---因为这无需 PPA 或任何的终端使用知识。 + +- [下载针对 Linux平台的 Intel 图形安装器 0.7 版本][8] + +### Hardware Stats ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/Screen-Shot-2014-02-10-at-21.05.37.png) + +假如你计划 升级你的 PC 或替换一个坏掉的零部件,你需要知道一些特定的硬件信息,例如 RAM 类型,CPU插座类型 或 查看那个PCI 槽是可用的等信息。 + +**I-Nex**可以使得 发掘出以上的信息以及其他的系统具体状态变得更加容易。使用它来查找你的主板型号、S.M.A.R.T.(注:为 Self-Monitoring, Analysis and Reporting Technology 的缩写,经常写为 SMART ) 状态,以及你想得出的很多东西! + +- [可从 Launchpad 了解到更多关于 I-Nex 的信息][9] + +### 磁盘空间可视化程序(Disk Space Visualizer) ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/disk-usage-visualizer-for-ubuntu.jpg) + +在这个硬盘以 1TB 计数的时代,我们或许不必同以前一样对硬盘空间的使用三思而后行。但对于那些使用小容量的 SSD,运行多个分区或在一个拥有固定虚拟磁盘大小的虚拟机上工作,总有感觉 释放一些额外空间是必要的 这种想法的时候。 + +GNOME Disks,在 Ubuntu 中被默认安装,使得查找占用最大磁盘空间的罪魁祸首变得容易。对于定位隐藏的日志、缓存和视频文件,它是非常完美的工具。 + +### BleachBit (Cruft Cleaner) ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/bleachbit.jpg) + +Windows 用户可能对像 CCleaner 之类的应用很熟悉,它可以扫描并清理垃圾文件、空白文件夹、臃肿的缓存以及陈旧的软件包。在 Ubuntu 上,一个相似的快速且毫不费力的一键式清理方法可以试试 **BleachBit** 。 + +它是一个强大的工具,所以一定要注意你正在清理什么。不要漫无目的地确认每个选项框;不是所有的东西它都可以清理。所以请合理地使用它,当你对某个选项有疑问时,就跳过它。 + +- [Install BleachBit from Ubuntu Software Center][10] + +你已经有了自己最喜欢的系统实用工具了吗?可以在下面的评论中让其他人知晓它。 +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2014/11/useful-tools-for-ubuntu-do-you-use-them + +作者:[Joey-Elijah Sneddon][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者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.florian-diesch.de/software/indicator-privacy/index.html +[2]:http://www.florian-diesch.de/software/indicator-privacy/dist/indicator-privacy_0.04-1_all.deb +[3]:http://www.omgubuntu.co.uk/2014/05/stop-ubuntu-sleeping-caffeine +[4]:apt://indicator-mulitload +[5]:https://launchpad.net/~linrunner/+archive/ubuntu/tlp/+packages +[6]:http://linrunner.de/en/tlp/docs/tlp-configuration.html +[7]:https://apps.ubuntu.com/cat/applications/laptop-mode-tools/ +[8]:https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-linux-1.0.7 +[9]:https://launchpad.net/i-nex +[10]:https://apps.ubuntu.com/cat/applications/bleachbit/ diff --git a/translated/share/20150126 CD Audio Grabbers--Graphical Based.md b/translated/share/20150126 CD Audio Grabbers--Graphical Based.md new file mode 100644 index 0000000000..45254072cb --- /dev/null +++ b/translated/share/20150126 CD Audio Grabbers--Graphical Based.md @@ -0,0 +1,129 @@ + +CD音频抓取器——基于图形界面 +================================================================================ +CD音频抓取器是为了从光盘中提取(“剖出”)原始数字音频(它在一个通常被称为CDDA的格式中)并把它保存成文件或以其他形式输出而设计的。这类软件使用户能把数字音频编码成各种格式,并能下载和上传在线CD目录服务——一个在线的光盘数据库——中的光盘信息。 + +复制CD合法吗?在美国版权法中,把一个原始CD转换成数字文件用于个人使用在被引用时等同于‘合理使用’。然而,美国版权法并没有明确的允许或禁止拷贝私人音频CD,而且判例法还没有确立出在具体的哪种情况下可以视为合理使用。在英国版权的位置更清晰一些。从2014年开始,英国公民制造CD,MP3,DVD,蓝光和电子书的行为成为合法行为。这仅适用于这个人拥有被采集的媒体的实体,并且复制品仅用于他们个人使用。对于欧盟的其他国家,成员国可以允许私人复制这种特例。 + +如果你不确定在你生活的国家里版权处于什么位置,在你使用这两页文章中所列举的软件前请查询本地的版权法以确定你处在合法的一边。 + +在某种程度上,提取CD音轨看起来有点多余。如Spotify和Google Play Music这类流服务提供了一个巨大的以通用格式存在的音乐的库,无需采集你的CD集。但是,如果你已将收藏了一个数量巨大的CD集。能把你的CD转换成可以在便携设备如智能手机、平板和便携式MP3播放器上播放的格式仍然是个诱人的选择。 + +这两页文章推荐了我最喜欢的音频CD抓取器。我挑了四个最好的图形界面的音频抓取器,四个最好的控制台音频抓取器。所有这些应用程序都是在开源许可下发行的。 + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/freac.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-freac.png) + +fre:ac是个开源音频转换器和CD提取器,支持很多种流行格式和编码器。目前这个应用可以在MA3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式间转换。这来源于几种不同形式的LAME编码器。 + +#### 功能包括: #### + +- 易学易用 +- MP3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式转换器 +- 集成了CDDB/freedb标题数据库支持的CD提取器 +- 多核优化的编码器加速了现代PC上的转换速度 +- 对于标签和文件名称的全Unicode支持 +- 易学易用,当你需要时还提供专家级选项 +- 任务列表 +- 可以使用Winamp 2加入附件 +- 多语言用户界面可以使用41种语言 + +- 网址: [freac.org][1] +- 开发人员:Robert Kausch +- 许可证: GNU GPL v2 +- 版本号: 20141005 + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/Audex.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Audex.png) + +Audex是个简单易用的开源音频CD提取应用。虽然它还处于早期开发阶段,这个KDE桌面工具足够稳定、聪明和简单,可以使用。 + +助手可以给LAME、OGG Vorbis(oggenc)、FLAC、FAAC(AAC/MP4)和RIFF WAVE创建配置文件。除去这个助手,你可以定义你自己的配置文件,这意味着,Audex适用于大部分的命令行编码器。 + +#### 功能包括: #### + +- 可提取CDDA Paranoia +- 提取和编码同时进行 +- 文件名采用本地和远程CDDB/FreeDB数据库 +- 提供新的CDDB/FreeDB数据库入口 +- 类似capitalize的元数据纠正工具 +- 多配置文件提取(每个配置文件文件有一个命令行编码器) +- 从互联网上抓取封面并将他们存在数据库中 +- 在目标目录中创建播放列表、封面和基于模板的信息文件 +- 创建提取和编码协议 +- 将文件传送到FTP服务器 +- 支持国际化 + +- 网址: [kde.maniatek.com/audex][2] +- 开发人员: Marco Nelles +- 许可证: GNU GPL v3 +- 版本号: 0.79 + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/SoundJuicer.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-SoundJuicer.png) + +Sound Juicer是个使用GTK+和GStreamer的轻量级CD提取器。它从CD中提取音频并把它转换成音频文件。Sound Juicer还可以直接播放CD中的音轨,在提取前提供预览。 + +由于GStreamer插件它支持任何音频编码,包括 MP3、Ogg Vorbis、FLAC和未压缩的PCM格式。 + +它是GNOME桌面环境已建成的一部分。 + +#### 功能包括: #### + +- 自动通过CDDB给音轨加标签 +- 可编码成ogg/vorbis、FLAC和原始WAV +- 编码路径的设置很简单 +- 多种流派 +- 国际化支持 + +- 网址:[burtonini.com][3] +- 开发人员: Ross Burton +- 许可证:GNU GPL v2 +- 版本号:3.14 + +---------- + +![](http://www.linuxlinks.com/portal/content2/png/ripperX.png) + +![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-ripperX.png) + +ripperX是个开源的图形交互界面,用于提取CD音轨并把他们编码成Ogg、MP2、MP3或FLAC格式。它的目的是容易使用,只需要点几下鼠标就能转换整张专辑。它支持在CDDB寻找专辑和音轨信息。 + +他使用cdparanoia把CD音轨转换(也就是“提取”)成WAV文件,然后访问Vorbis/Ogg编码器oggenc把WAV文件转换成OGG文件。它还可以访问flac让WAV文件有无损压缩的表现,制成FLAC文件。 + +#### 功能包括: #### + +- 非常简单易用 +- 可以把CD音轨提取成WAV、MP3、OGG或FLAC文件 +- 支持CDDB查找 +- 支持ID3v2标签 +- 可暂停提取进程 + +- 网址:[sourceforge.net/projects/ripperx][4] +- 开发人员:Marc André Tanner +- 许可证:MIT/X Consortium License +- 版本号:2.8.0 + +-------------------------------------------------------------------------------- + +转自:http://www.linuxlinks.com/article/20150125043738417/AudioGrabbersGraphical.html + +作者:Frazer Kline +译者:[H-mudcup](https://github.com/H-mudcup) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.freac.org/ +[2]:http://kde.maniatek.com/audex/ +[3]:http://burtonini.com/blog/computers/sound-juicer +[4]:http://sourceforge.net/projects/ripperx/ diff --git a/translated/talk/20150119 Ubuntu 15.04 Finally Lets You Set Menus ToAlways Show.md b/translated/talk/20150119 Ubuntu 15.04 Finally Lets You Set Menus ToAlways Show.md new file mode 100644 index 0000000000..1247c8eb78 --- /dev/null +++ b/translated/talk/20150119 Ubuntu 15.04 Finally Lets You Set Menus ToAlways Show.md @@ -0,0 +1,42 @@ +Ubuntu 15.04 最终实现你可以设置你的菜单 ‘始终可见’ +================================================================================ +**如果你不喜欢 Unity 的全局菜单在你的鼠标离开后就淡出你的视野, Ubuntu 15.04 有一些额外附加去实现这点.** + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/locally-integrated-menus-in-ubuntu.png) + +最新的Ubuntu 15.04的Unity界面通过在提议通道提供了一个选项**使应用程序菜单在Ubuntu中可见**. + +不时尚, 不过时, 没有丢失的菜单. + +最大的缺点是它目前只能通过dconf来控制,而不是常规的面向用户的选项设置。 + +我希望(如果不是期望)能有一个设置这个特性的选项被加入到Ubuntu的【系统设置】>【外观】部分的开发仍在继续。 + +现在,如果你使用的是Ubuntu15.04,并启用“建议”的更新通道后,你会发现这个开关存在于在COM>规范>Unity>“始终显示菜单”。 + + +### 迟到总比没有要好? ### + +开发者计划在Ubuntu14.04 LTS的下一个SRU中反向移植这个选项(假设在测试阶段没有任何意外发生)。 + +本地集成菜单(LIM)在Ubuntu 14.04 LTS 首次获得了欣赏,被广泛认为在那些喜欢隐藏方式的和那些不喜欢必须使用鼠标和触摸板的人之间的最佳的折衷方法 + +虽然本地集成菜单给我们带来了半路上沉默的批评在统一方面,默认的“淡入/淡出”行为给我们留下了令人发痒的伤痕 + +在Ubuntu 过去的几个版本中已经能够看到积极的去解决早期UX的经历过的关切的问题。在经过几年“打算去做”的列表[我们去年终于得到了本地集成菜单][1],以及不支持的通过点击图标实现[减少和恢复Unity启动程序中不支持的应用程序的选项]。 + +一年以来我们终于得到一个选项以使应用程序菜单始终显示,无论我们的鼠标在哪里。迟来总比没有好,对不对? + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/01/ubuntu-15-04-always-show-menu-bar-option + +作者:[Joey-Elijah Sneddon][a] +译者:[JeffDing](https://github.com/JeffDing) +校对:[校对者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/02/locally-integrated-menus-ubuntu-14-04 +[2]:http://www.omgubuntu.co.uk/2014/03/minimize-click-launcher-option-ubuntu-14-04 diff --git a/translated/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md b/translated/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md new file mode 100644 index 0000000000..e9dd6e997c --- /dev/null +++ b/translated/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md @@ -0,0 +1,43 @@ +既然float不能表示所有的int,那为什么在类型转换时C++将int转换成float? +--------- + +#问题: + +代码如下: + +```C +int i = 23; +float f = 3.14; +if (i == f) // 执行某段代码 +``` + +编译器会将i转换成float类型,然后比较这两个float的大小,但是float能够表示所有的int吗?为什么没有将int和float转换成double类型进行比较呢? + +#回答: + +在整型数的演变中,当`int`变成`unsigned`时,会丢掉负数部分(有趣的是,这样的话,`0u < -1`就是对的了)。 + +和C语言中的大部分机制(在C++中得到继承)一样,就硬件操作而言,常见的算术转换应该简明易懂。C语言的发明者精通他们所使用机器上的汇编语言,他们编写的C语言对他们和像他们一样编写程序的人有直接的意义,直到使用汇编语言编写(诸如UNIX内核)的程序时。 + +现如今,一般来说,处理器并不具有混合类型的指令系统(如float和double相加、比较int和float,诸如此类),因为如果这样做造成芯片晶圆的巨大浪费——如果你想支持更多不同的类型,你不得不实现更多的操作码。然而,在实际中,你只有实现"add int to int"、"compare float to float"和"multiply unsigned with unsigned"等功能的常见指令,这使得优先进行算术转换变得很有必要——它们是指令系统中两种类型的映射关系,它们中的大部分很有用处。 + +从习惯编写低级别机器代码的编程人员的角度来说,如果有了混合类型,那么在一般情况下最有可能使用的汇编指令就是那些只需要进行最少类型转换的指令。其中,有一种特殊情况就是浮点数的转换,特别是在20世纪70年代早期,当时C语言正在被开发,计算机运行速度很慢,而浮点数的计算是通过软件完成的,所以进行转换的成本很高。这拖慢了常用算术运算的转换开发——当时只有一种操作数实现了转换(这个例外就是long到unsigned int的转换,这种转换没有任何要求,在大部分机器上都可以进行。当然并不是全部,因为总有例外情况)。 + +所以,编写常用的算术转换是为了完成汇编程序员在大部分时间需要做的事情:即有两种不匹配的类型,将一种转换成另一种。这也就是汇编代码所做的事情,除非有特别原因需要进行其它类型转换。对于那些习惯编写汇编代码的人来说,除非是特殊需要,才会被迫去编写一种不同的类型转换。显然,这种情况下提出编写转换是很自然的事情。虽然,你可以简单地写成这样 + +```C +if((double) i < (double) f) +``` + +顺便提一下,在这个问题中有趣的是,`unsigned`的优先级高于`int`,所以把`int`和`unsigned`进行比较时,最终进行的是unsigned类型的比较(开头提到的`0u < -1`就是这个道理)。我猜测这可能是在早些时候(计算机发展初期),当时的人们认为`unsigned`比`int`在所表示的数值范围上受到的限制更小:现在还不需要符号位,所以可以使用额外的位来表示更大的数值范围。如果你觉得`int`可能会溢出,那么就使用unsigned好了——在使用16位表示的ints时这个担心会更明显。 + +---- +via:[stackoverflow](http://stackoverflow.com/questions/28010565/why-does-c-promote-an-int-to-a-float-when-a-float-cannot-represent-all-int-val/28011249#28011249) + +作者:[wintermute][a] +译者:[KayGuoWhu](https://github.com/KayGuoWhu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://stackoverflow.com/users/4301306/wintermute \ No newline at end of file diff --git a/translated/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md b/translated/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md new file mode 100644 index 0000000000..c0bd5881ed --- /dev/null +++ b/translated/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md @@ -0,0 +1,82 @@ +9款最好的Javacript用户的IDE和代码编辑器。 +================================================================================ +网络应用设计和开发是最近一段时间的发展趋势,也有越来越多的人开始在此寻找他们的职业机会。但是,作为网络开发人员或图形设计人员来说,一个好的机会并不是每个人都能够轻易获得到的,它需要很好的思维展现,以及对于工作的熟练技巧。现在有许多可用的网站来根据你的知识帮助你找到正确的工作描述。但是如果你想要在这个领域有所成就,你仍然需要具有一些出色的手段,例如可以在不同的平台、IDE以及其他的工具上开展工作。 + +说到根据不同目的所使用的大量语言用到的不同平台以及IDE,只靠学习一个IDE来容易地获取项目设计的最佳方案的惯例已经属于过去时了。今天我们活在一个竞争日益激烈的现代生活节奏中,对于IDE们也是相同的处境,IDE是一个用来创建和部署应用的强大的客户端应用。今天我们打算为网络设计者和开发人员分享一些最好的Javacript IDE。 + +请访问作为javascript 用户最好的代码编辑器列表,并将你的想法与我们一起分享。 + +### 1) [Spket][1] ### + +**Spket IDE** 是JavaScript和XML开发的强大工具包。该编辑器可以用来进行开发 JavaScript,XUL/XBL 和Yahoo!小组件。 JavaScript编辑器提供了例如代码补全,语法高亮以及代码内容大纲等特性,可以帮助开发者提高创建高效JavaScript代码的生产率。 + + +![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/spket-e1422674329554.png) + +### 2) [Ixedit][2] ### + +IxEdit 基于Javascript交互的网络设计工具。通过IxEdit,设计者可以在不需要通过代码改变,添加,删除或变换页面元素的情况下,在网页上进行动态进行DOM脚本编写。 + +![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ixedit.png) + +### 3) [Komodo Edit][3] ### + +Komodo是一款免费而强大的编辑器,可以用来编辑JavaScript和其他的编程语言。 +![](http://i2.wp.com/devzum.com/wp-content/uploads/2015/01/komodo-edit-e1422674596277.png) + +### 4) [EpicEditor][4] ### + +EpicEditor是一个可嵌入的 JavaScript Markdown编辑器,具有分割全屏进行编辑,实时预览,自动草稿保存,离线支持等特性。对于开发人员,它提供了健壮的API,可以容易地设置主题,并允许你以任何其他的事物来替换绑定的Markdown解析器。 + +![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/epiceditor-e1422674732281.png) + +### 5) [codepress][5] ### + +CodePress是一个用JavaScript编写的基于网络的源代码编辑器,具有语法高亮,并且是在你将代码输入到浏览器后实时进行文本颜色渲染。 + +![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/codepres-e1422674893706.png) + +### 6) [ACe][6] ### + +Ace 是一个使用JavaScript编写的嵌入式代码编辑器,它能够匹配宿主编辑器的特性和性能,例如Sublime,Vim和Textate。它能够容易地嵌入到任何的网页和JavaScript应用中。 + +![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ace-e1422675089912.png) + +### 7) [scripted][7] ### + +Scripted是一个快速的轻量级代码编辑器,最初是为了JavaScript编写实现的。 Scripted是一个基于浏览器的编辑器,而编辑器本身有本地运行的Node.js服务器实例来提供服务支持。 + +![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/scripted-e1422675188408.png) + +### 8) [Netbeans][8] ### + +这是另外的一个更加震撼而且有用的编辑器,可以用来编写javascript和其他的编程语言。 + +![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/code_editing1-e1422675506226.png) + +### 9) [Webstorm][9] ### + +这是最智能的JavaScript IDE。 它是为使用Node.js进行复杂的客户端开发和服务器端开发而装备的一个轻巧而强大的完美IDE。 + +![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/webstorm.png) + +-------------------------------------------------------------------------------- + +via: http://devzum.com/2015/01/31/9-best-ides-and-code-editors-for-javascript-users/ + +作者:[vikas][a] +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://devzum.com/author/vikas/ +[1]:http://spket.com/ +[2]:http://www.ixedit.com/ +[3]:http://komodoide.com/komodo-edit/ +[4]:http://oscargodson.github.io/EpicEditor/ +[5]:http://codepress.sourceforge.net/ +[6]:http://ace.c9.io/#nav=about +[7]:https://github.com/scripted-editor/scripted +[8]:https://netbeans.org/ +[9]:http://www.jetbrains.com/webstorm/ diff --git a/translated/tech/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md b/translated/tech/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md deleted file mode 100644 index 17da6a9508..0000000000 --- a/translated/tech/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md +++ /dev/null @@ -1,105 +0,0 @@ -dupeGuru - 直接从硬盘中查找并移除重复文件 -================================================================================ - -### 简介 ### - -对我们来说,磁盘被装满是一个较大的困扰。无论我们如何小心谨慎,我们总可能将相同的文件复制到多个不同的地方,或者在不知情的情况下,重复下载了同一个文件。因此,迟早你会看到“磁盘已满”的错误提示,若此时我们确实需要一些磁盘空间来存储重要数据,以上情形无疑是最糟糕的。假如你确信自己的系统中有重复文件,那么 **dupeGuru** 可能会帮助到你。 - -dupeGuru 团队也开发了名为 **dupeGuru 音乐版** 的应用来移除重复的音乐文件,和名为 **dupeGuru 图片版** 的应用来移除重复的图片文件。 - -### 1. dupeGuru (标准版) ### - -对于那些不熟悉 [dupeGuru][1] 的人来说,它是一个免费,开源,跨平台的应用,其用途是在系统中查找和移除重复文件。它可以在 Linux, Windows, 和 Mac OS X 等平台下使用。通过使用一个快速的模糊匹配算法,它可以在几分钟内找到重复文件。同时,你还可以调整 dupeGuru 使它去精确查找特定文件类型的重复文件,以及从你想删除的文件中,消除特定的某些文件。它支持英语、 法语、 德语、 中文 (简体)、 捷克语、 意大利语、亚美尼亚语、 俄语、乌克兰语、巴西语和越南语。 - -#### 在 Ubuntu 14.10/14.04/13.10/13.04/12.04 中安装 dupeGuru #### - -dupeGuru 开发者已经构建了一个 Ubuntu PPA (Personal Package Archives)来简化安装过程。为了安装 dupeGuru,依次在终端中键入以下命令: - -``` -sudo apt-add-repository ppa:hsoft/ppa -sudo apt-get update -sudo apt-get install dupeguru-se -``` - -### 使用 ### - -使用非常简单,可从 Unity 面板或菜单中启动 dupeGuru 。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru_007.png) - -点击位于底部的 `+` 按钮来添加你想扫描的文件目录。点击 `扫描` 按钮开始查找重复文件。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru_008.png) - -一旦所选目录中含有重复文件,则它将在窗口中展示重复文件。正如你所看到的,在下面的截图中,我的下载目录中有一个重复文件。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Results_009.png) - -现在,你可以决定下一步如何操作。你可以删除这个重复的文件,或者对它进行重命名,抑或是 复制/移动 这个文件到另一个位置。为此,选定该重复文件,或 在菜单栏中选定写有“**仅显示重复**”选项 ,如果你选择了“**仅显示重复**”选项,则只有重复文件在窗口中可见,这样你便可以轻易地选择并删除这些文件。点击“操作”下拉菜单,最后选择你将执行的操作。在这里,我只想删除重复文件,所以我选择了“移动标记文件到垃圾箱”这个选项。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Menu_010.png) - -接着,点击“继续”选项来移除重复文件。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Deletion-Options_011.png) - -### 2. dupeGuru 音乐版 ### - -[dupeGuru 音乐版][2] 或 简称 dupeGuru ME ,它的功能与 dupeGuru 类似。它拥有 dupeGuru 的所有功能,但它包含更多的信息列 (如比特率,持续时间,标签等)和更多的扫描类型(如带有字段的文件名,标签以及音频内容)。同 dupeGuru 一样, dupeGuru ME 也运行在 Linux, Windows, 和 Mac OS X 中。 - -它支持众多的格式,诸如 MP3, WMA, AAC (iTunes 格式), OGG, FLAC, 即失真率较少的 AAC 和 WMA 格式等。 - -#### 在 Ubuntu 14.10/14.04/13.10/13.04/12.04 中安装 dupeGuru ME #### - -现在,我们不必再添加任何 PPA,因为在前面的步骤中,我们已经进行了添加。所以在终端中键入以下命令来安装它: - -``` -sudo apt-get install dupeguru-me -``` - -### 使用 ### - -你可以从 Unity 面板或菜单中启动它。dupeGuru ME 的使用方法,操作界面和外观与正常的 dupeGuru 类似。添加你想扫描的目录并选择你想执行的操作。重复的音乐文件就会被删除。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Music-Edition-Results_012.png) - -### 3. dupeGuru 图片版 ### - -[dupeGuru 图片版][3],或简称为 duepGuru PE,是一个在你的电脑中查找重复图片的工具。它与 dupeGuru 类似,但独具匹配重复图片的功能。dupeGuru PE 可运行在 Linux, Windows, 和 Mac OS X 中。 - -dupeGuru PE 支持 JPG, PNG, TIFF, GIF 和 BMP 等图片格式。所有的这些格式可以被同时比较。Mac OS X 版的 dupeGuru PE 还支持 PSD 和 RAW (CR2 和 NEF) 格式。 - -#### 在 Ubuntu 14.10/14.04/13.10/13.04/12.04 中安装 dupeGuru PE #### - -由于我们已经添加了 PPA, 我们也不必为 dupeGuru PE 添加 PPA。只需运行如下命令来安装它。 - -``` -sudo apt-get install dupeguru-pe -``` - -#### 使用 #### - -就使用方法,操作界面和外观而言,它与 dupeGuru ,dupeGuru ME 类似。我就纳闷为什么开发者为不同的类别开发了不同的版本。我想如果开发一个结合以上三个版本功能的应用,或许会更好。 - -启动它,添加你想扫描的目录,并选择你想执行的操作。就这样,你的重复文件将消失。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Picture-Edition-Results_014.png) - -如若因为任何的安全问题而不能移除某些重复文件,请记下这些文件的位置,通过终端或文件管理器来手动删除它们。 - -欢呼吧! - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/dupeguru-find-remove-duplicate-files-instantly-hard-drive/ - -作者:[SK][a] -译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:http://www.hardcoded.net/dupeguru/ -[2]:http://www.hardcoded.net/dupeguru_me/ -[3]:http://www.hardcoded.net/dupeguru_pe/ diff --git a/translated/tech/20141205 How to configure a syslog server with rsyslog on Linux.md b/translated/tech/20141205 How to configure a syslog server with rsyslog on Linux.md new file mode 100644 index 0000000000..21d6e8993b --- /dev/null +++ b/translated/tech/20141205 How to configure a syslog server with rsyslog on Linux.md @@ -0,0 +1,166 @@ +如何在linux上通过rsyslog来配置一个syslog服务器 +======================================================================== +syslog服务器表示一个用来监控一个网络中的端点--所有能够通过网络来发送日志的设施(包含了Linux或Windows服务器,路由器,交换机以及其他主机)--的中央日志。 通过设置一个syslog服务器,可以将不同设施/主机发送的日志,过滤和合并到一个独立的位置,这样使得你更容易地查看和获取重要的日志消息。 + +**rsyslog** 被作为标准的syslog守护进程预装在了大多数的Linux发行版中。在客户端/服务器架构的配置下,**rsyslog**同时扮演了两种角色:1.作为一个syslog服务器,**rsyslog**可以收集来自其他设施的日志信息;2.作为一个syslog客户端,**rsyslog**可以将其内部的日志信息传输到远程的syslog服务器。 + + +在此,我们演示了在linux上如何通过**rsyslog**来配置一个中心化syslog服务器。 在进入详解之前,先温习一下syslog标准。 + +### syslog标准基础### + +当通过syslog机制来收集日志时,有3个必须要考虑到的重要事情: + +- **设施层级**: 监听何种类型的进程 +- **严重性 (优先) 级别**: 收集何种类型的日志消息 +- **目标**: 发送或记录日志消息到何处 + +现在我们更加深入地了解一下配置是如何定义的。 + + +设施层级定义了一种用来对内部系统进程进行分类的方法,linux中的一些常见的设施包括: + +- **auth**: 身份验证相关的消息(登录时) +- **cron**: 进程或应用调度相关的消息 +- **daemon**: 守护进程相关的消息(内部服务器) +- **kernel**: 内核相关的消息 +- **mail**: 内部邮件服务器相关的消息 +- **syslog**: syslog 守护进程本身相关的消息 +- **lpr**: 打印服务相关的消息 +- **local0 - local7**: 用户自定义的消息 (local7 通常被Cisco 和 Windows 服务器 使用) + +严重性(优先)级别是通过标准的缩写和赋予的数字来进行定义和标准化的,其中的数字7具有最高的级别,这些级别包含了: + +- emerg: Emergency(紧急)- 0 +- alert: Alerts (报警)- 1 +- crit: Critical (关键)- 2 +- err: Errors (错误)- 3 +- warn: Warnings (警告)- 4 +- notice: Notification (通知)- 5 +- info: Information (消息)- 6 +- debug: Debugging (调试)- 7 + +最后,目标语句迫使一个syslog客户端来执行以下3个任务中的一个:1.保存日志消息到一个本地文件;2. 通过TCP/UDP将消息路由到远程的syslog服务器中 +;3.将其发送到一个标准输出中,例如控制台。 + +在rsyslog, syslog配置是基于以下模式进行结构化的。 + + [facility-level].[severity-level] [destination] + +### Configure Rsyslog on Linux ### +### 在Linux中配置Rsyslog### + +在我们理解syslog之后,现在是时候来通过rsyslog来将一个Linux服务器配置为一个中心syslog服务器了,另外我们也将看到如何将基于Windows的系统配置为一个syslog客户端来发送内部日志到该syslog服务器中。 + +### 第1步: 初始化系统需求 ### + +为了将linux主机设置为一个中央日志服务器, 我们需要创建一个隔离的/var 分区,并分配足够大的磁盘空间或者创建一个特殊的LVM卷组。这样就会使得syslog服务器能够承担在日积月累收集日志所带来的潜在增长。 + + +### 第2步: 让rsyslog 后台进程生效 ### + +rsyslog守护进程来自于当前的linux发布版本的预装模块,但是默认并没有启动。为了能够让rsyslog守护进程能够接受外部的消息,需要编辑其配置文件/etc/rsyslog.conf. + +如果已经准备好打开文件进行编辑,查找到下面的两行所在的位置,通过删除其行首的#字符来取消其注释。 + + $ModLoad imudp + $UDPServerRun 514 + +这会使得rsysolog守护进程能够在UDP端口514上接受日志消息了---UDP是一种比TCP速度快,但是并不具有TCP一样的数据流程的可靠性。所以如果你需要使用可靠的传送机制,就可以通过取消以下行的注释。 + + $ModLoad imtcp + $InputTCPServerRun 514 + +需要注意的是,TCP和UDP可以被同时生效来监听TCP/UDP 连接。 + +### 第3步:创建日志接受模板### + +接下来的这步,需要我们来为远程消息创建模板,并告知rsyslog守护进程如何记录从其他客户端机器所接受到的消息。 + + +使用文本编辑器来打开 /etc/rsyslog.conf,然后在GLOBAL DIRECTIVE块前追加以下的模板。 + + $template RemoteLogs,"/var/log/%HOSTNAME%/%PROGRAMNAME%.log" * + *.* ?RemoteLogs + & ~ + +在此对该模板进行简单解释,$template RemoteLogs(“RemoteLogs” 字符串可以为任何其他的指令名称)指令强制rsyslog后台进程将日志消息写道/var/log下的分开的本地日志文件中,其中日志文件的名称是基于远程日志发送机器的主机名以及生成该日志的应用程序名进行定义的。其中第二行暗示了我们将RemoteLogs模板应用到所有接受到的日志上。 + + +符号"& ~"表示了一个重定向规则,被用来告知rsyslog守护进程停止对日志消息的进一步处理,并且不要在本地写入。如果该重定向规则没有使用,那么所有的远程消息都会在写入上述描述的日志文件之外同时被写入到本地日志文件,这就意味着日志消息实际上被写了两次。使用该规则的另外一个结果就是syslog服务器本身的日志消息只会被以该机器主机名命名的专有文件中。 + + +如果你想要的话,也可以使用下面的模式对特定的设备或严重性级别使用新的模板直接来记录日志消息。 + + + [facility-level].[severity-level] ?RemoteLogs + +例如: + +将所有内部的所有优先级别的用户验证消息指定为RemoteLogs模板: + + authpriv.* ?RemoteLogs + +将所有系统进程中除开mail,用户验证和cron消息之外的进程产生的消息级别的日志指定为RemoteLogs模板: + + + *.info,mail.none,authpriv.none,cron.none ?RemoteLogs + +如果我们想要将所有从远程客户端接受到的消息写入到一个以它们的IP地址命名的单个文件中,可以使用以下的模板。在此我们为该模板赋予了“IPTemplate”名称。 + + $template IpTemplate,"/var/log/%FROMHOST-IP%.log" + *.* ?IpTemplate + & ~ + +在我们生效rsyslog守护进程以及编辑其配置文件之后,需要重启该守护进程。 + +在 Debian,Ubuntu 或 CentOS/RHEL 6中: + + $ sudo service rsyslog restart + +在 Fedora 或 CentOS/RHEL 7中: + + $ sudo systemctl restart rsyslog + +我们可以通过netstat命令来验证rsyslog守护进程是否正常工作。 + + $ sudo netstat -tulpn | grep rsyslog + +在UDP监听端口下工作的rsyslog守护进程会有类似下面的输出。 + + udp 0 0 0.0.0.0:514 0.0.0.0:* 551/rsyslogd + udp6 0 0 :::514 :::* 551/rsyslogd + +如果rsyslog守护进程被设置在TCP连接端口,那么应该有类似下面所示的输出。 + + tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 1891/rsyslogd + tcp6 0 0 :::514 :::* LISTEN 1891/rsyslogd + +### 发送Windows日志到一个远程的rsyslog服务器### + +为了将一个Windows客户端的日志消息转发到我们的rsyslog服务器,需要一个Windows syslog 代理。当然,有许多的syslog代理可以在windows上运行,在此我们可以使用一个自由软件程序 [Datagram SyslogAgent][1]. + + + +在下载安装该syslog代理后,需要将其配置为作为服务运行。指定使用何种协议来发送数据,以及远程rsyslog服务器的IP地址和端口,最后指定应该传输的事件日志类型,如下所示。 + +![](https://farm8.staticflickr.com/7509/15305930594_27b7f4440a_o.jpg) + +在我们完成所有的这些配置之后,我们就可以启动该服务并且在中央rsyslog服务器中使用命令行工具tailf来查看日志文件了。 + +### 总结### + +通过创建一个可以收集本地和远程主机的中央rsyslog服务器,我们可以更好地了解在这些系统内部究竟发生着什么,而且可以更加容易地调试他们的问题,是否在他们之间有任何缓慢或崩溃存在。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/configure-syslog-server-linux.html + +作者:[Caezsar M][a] +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/caezsar +[1]:http://www.syslogserver.com/download.html diff --git a/translated/tech/20141211 How to use matplotlib for scientific plotting on Linux.md b/translated/tech/20141211 How to use matplotlib for scientific plotting on Linux.md deleted file mode 100644 index 29c03c4c91..0000000000 --- a/translated/tech/20141211 How to use matplotlib for scientific plotting on Linux.md +++ /dev/null @@ -1,158 +0,0 @@ -+在Linux中使用matplotlib进行科学画图 -+================================================================================ -+ -+如果你想要在Linxu中获得一个高效、自动化、高质量的科学画图的解决方案,那就要考虑一下使用matplotlib库了。Matplotlib是基于python的开源科学测绘包,版权基于python软件基金许可证。大量的文档和例子,整合在Python和Numpy科学计处包中,其自动化性能是少数几个为什么这个包是在Linux环境中进行科学画图的可靠选择。这个教程将提供几个用matplotlib画图的例子。 -+ -+###特性### -+- -+-众多的画图类型,如:bar,box,contour,histogram,scatter,line plots.... -+-基于python的语法 -+-集成Numpy科学计算包 -+-可定制的画图格式(axes scales,tick positions, tick labels...) -+-可定制文本(字体,大小,位置...) -+-TeX 格式化(等式,符号,希腊字体...) -+-与IPython相兼容 -+-自动化 -用Python 的循环迭代生成图片 -+-保存所绘图片格式为图片文件,如:png,pdf,ps,eps,svg等 -+ -+ -+基于Python语法的matplotlib通过许多自身特性和高效工作流基础进行表现。 -+世面上有许多用于绘制高质量图的科学绘图包,但是这些包允许你直接在你的Python代码中去使用吗? -+除那以外,这些包允许你创建可以保存为图片文件的图片吗? -+Matplotlib允许你完成所有的这些任务。 -+你可以期望着节省你的时间,从于使用你能够花更多的时间在如何创建更多的图片。 -+ -+###安装### -+ 安装Python和Numpy包是使用Matplotlib的前提,安装Numpy的指引请见该链接。[here][1]. -+ -+ -+可以通过如下命令在Debian或Ubuntu中安装Matplotlib: -+ -+ $ sudo apt-get install python-matplotlib -+ -+ -+在Fedora或CentOS/RHEL环境则可用如下命令: -+ $ sudo yum install python-matplotlib -+ -+ -+###Matplotlib 例子### -+ -+该教程会提供几个绘图例子演示如何使用matplotlib: -+-离散和线性画图 -+-柱状图画图 -+-饼状图 -+ -+在这些例子中我们将用Python脚本来执行Mapplotlib命令。注意numpy和matplotlib模块需要通过import命令在脚本中进行导入。 -+在命令空间中,np指定为nuupy模块的引用,plt指定为matplotlib.pyplot的引用: -+ import numpy as np -+ import matplotlib.pyplot as plt -+ -+ -+###例1:离散和线性图### -+ -+第一个脚本,script1.py 完成如下任务: -+ -+-创建3个数据集(xData,yData1和yData2) -+-创建一个宽8英寸、高6英寸的图(赋值1) -+-设置图画的标题、x轴标签、y轴标签(字号均为14) -+-绘制第一个数据集:yData1为xData数据集的函数,用圆点标识的离散蓝线,标识为"y1 data" -+-绘制第二个数据集:yData2为xData数据集的函数,采用红实线,标识为"y2 data" -+-把图例放置在图的左上角 -+-保存图片为PNG格式文件 -+ -+script1.py的内容如下: -+ import numpy as np -+ import matplotlib.pyplot as plt -+ -+ xData = np.arange(0, 10, 1) -+ yData1 = xData.__pow__(2.0) -+ yData2 = np.arange(15, 61, 5) -+ plt.figure(num=1, figsize=(8, 6)) -+ plt.title('Plot 1', size=14) -+ plt.xlabel('x-axis', size=14) -+ plt.ylabel('y-axis', size=14) -+ plt.plot(xData, yData1, color='b', linestyle='--', marker='o', label='y1 data') -+ plt.plot(xData, yData2, color='r', linestyle='-', label='y2 data') -+ plt.legend(loc='upper left') -+ plt.savefig('images/plot1.png', format='png') -+ -+ -+所画之图如下: -+![](https://farm8.staticflickr.com/7529/15927002365_f5ae11cf02_z.jpg) -+ -+ -+###例2:柱状图### -+ -+第二个脚本,script2.py 完成如下任务: -+ -+-创建一个包含1000个随机样本的正态分布数据集。 -+-创建一个宽8英寸、高6英寸的图(赋值1) -+-设置图的标题、x轴标签、y轴标签(字号均为14) -+-用samples这个数据集画一个40个柱状,边从-10到10的柱状图 -+-添加文本,用TeX格式显示希腊字母mu和sigma(字号为16) -+-保存图片为PNG格式。 -+ -+script2.py代码如下: -+ import numpy as np -+ import matplotlib.pyplot as plt -+ -+ mu = 0.0 -+ sigma = 2.0 -+ samples = np.random.normal(loc=mu, scale=sigma, size=1000) -+ plt.figure(num=1, figsize=(8, 6)) -+ plt.title('Plot 2', size=14) -+ plt.xlabel('value', size=14) -+ plt.ylabel('counts', size=14) -+ plt.hist(samples, bins=40, range=(-10, 10)) -+ plt.text(-9, 100, r'$\mu$ = 0.0, $\sigma$ = 2.0', size=16) -+ plt.savefig('images/plot2.png', format='png') -+ -+ -+结果见如下链接: -+![](https://farm8.staticflickr.com/7531/15304765024_1cc271b6e0_z.jpg) -+ -+ -+###例3:饼状图### -+ -+第三个脚本,script3.py 完成如下任务: -+ -+-创建一个包含5个整数的列表 -+-创建一个宽6英寸、高6英寸的图(赋值1) -+-添加一个长宽比为1的轴图 -+-设置图的标题(字号为14) -+-用data列表画一个包含标签的饼状图 -+-保存图为PNG格式 -+ -+脚本script3.py的代码如下: -+ import numpy as np -+ import matplotlib.pyplot as plt -+ -+ data = [33, 25, 20, 12, 10] -+ plt.figure(num=1, figsize=(6, 6)) -+ plt.axes(aspect=1) -+ plt.title('Plot 3', size=14) -+ plt.pie(data, labels=('Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5')) -+ plt.savefig('images/plot3.png', format='png') -+ -+ -+结果如下链接所示: -+![](https://farm8.staticflickr.com/7504/15926356092_7c3e5217aa_z.jpg) -+ -+ -+###总结### -+ 这个教程提供了几个用matplotlib科学画图包进行画图的例子,Matplotlib是在Linux环境中用于解决科学画图的绝佳方案,表现在其无缝地和Python、Numpy连接,自动化能力,和提供多种自定义的高质量的画图产品。[here][2]. -+ -+matplotlib包的文档和例子详见: -+-------------------------------------------------------------------------------- -+ -+via: http://xmodulo.com/matplotlib-scientific-plotting-linux.html -+ -+作者:[Joshua Reed][a] -+译者:[ideas4u](https://github.com/ideas4u) -+校对:[校对者ID](https://github.com/校对者ID) -+ -+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -+ -+[a]:http://xmodulo.com/author/joshua -+[1]:http://xmodulo.com/numpy-scientific-computing-linux.html -+[2]:http://matplotlib.org/ diff --git a/translated/tech/20150104 How to set up a cross-platform backup server on Linux with BackupPC.md b/translated/tech/20150104 How to set up a cross-platform backup server on Linux with BackupPC.md new file mode 100644 index 0000000000..9dd434a809 --- /dev/null +++ b/translated/tech/20150104 How to set up a cross-platform backup server on Linux with BackupPC.md @@ -0,0 +1,133 @@ +如何在 Linux 上使用 BackupPC 来设置一个跨平台的备份服务器 +================================================================================ +为了防止你不能分辨这篇教程和我先前关于[backupninja][1] 和 [backup-manager][2] 的帖子,=== 我是一个积极的备份迷。当提到备份,我宁愿备份的太多而不希望备份不足,因为如果我们有需要的话,你将会感激你花费了时间和精力来为你的重要数据生成额外的拷贝。 + +在这篇帖子中,我将向你介绍 [BackupPC][3],一个跨平台的备份服务器软件,它可以通过网络为 Linux,Windows 和 MacOS 等系统上的客户端主机拉取备份。BackupPC 添加了一系列的特点使得管理备份变为一件快乐的事。 + +### BackupPC 的特点 ### + +BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收集和管理其他远程客户端主机上的备份。通过使用它的 Web 界面,你可以检查日志和配置文件、为其他远程主机启动/取消/安排备份任务以及可视化备份任务的当前状态。你也可以非常容易地浏览归档的文件以及从备份的归档中恢复个人文件或整个作业。为了恢复单一的个人文件,你可以直接通过 Web 界面来下载任何先前备份的文件。若如这还不够,针对客户端主机,没有特别的客户端软件需要安装。在 Windows 客户端上, 本机 SMB 协议将被使用,而对于 *nix 客户端,你将使用 `rsync` 或 通过 SSH, RSH 或 NFS 来使用 `tar` 。 + +### 安装 BackupPC ### + +在 Debian,Ubuntu 和它们的衍生版本上,运行下面的命令: + + # aptitude install backuppc + +在 Fedora上, 使用 `yum` 命令。请注意软件包名字对大小写敏感。 + +在 CentOS/RHEL 6 上,首先要启用 [EPEL 软件仓库][4]。在 CentOS/RHEL 7 上,请替代启用 [Nux Dextop][5] 软件仓库。然后接着使用 `yum` 命令: + + # yum install BackupPC + +同往常一样,这两种包管理系统都会自动地对依赖问题进行解决。另外,作为安装过程中的一部分,你可能会被要求去配置或重新配置用于图形用户界面的 Web 服务器。下面的截图来自于 Debian 系统: + +![](https://farm8.staticflickr.com/7573/16163781711_6218b620ef_c.jpg) + +通过空格键来确定你的选择,然后使用 tab 键移动到 Ok 选项并敲回车键。 + +接着类似于下面的截屏将会呈现在你眼前,通知你一个用来管理 BackupPC 的名为 ‘backuppc’的管理员用户以及相应的密码(这个密码可以在以后被更改,如果你希望的话)已经被创建。这里需要注意的是:同样名为 ‘backuppc’的一个 HTTP 账户和一个常规的 Linux 账户将会被创建,它们使用同一个密码。需要前者的目的是来访问受保护的 BackupPC 的 Web 界面,而后者则是为了通过 SSH 来使用 `rsync` 来执行备份任务。 + +![](https://farm8.staticflickr.com/7579/15979622809_25e734658d_c.jpg) + +你可以使用下面的命令来更改 HTTP 账户 ‘backuppc’ 的默认密码: + + # htpasswd /path/to/hash/file backuppc + +至于常规的 ‘backuppc’ [Linux][6]账户,可以使用 `passwd`命令来更改它的默认密码: + + # passwd backuppc + +需要提及的是:安装过程中会自动创建 Web 和程序的配置文件。 + +### 启动 BackupPC 并设置备份 ### + +首先,打开一个浏览器窗口并指向 http:///backuppc/ 。当弹出提示框时,输入先前向你提供的默认 HTTP 用户凭据(注:即用户名 backuppc 和相应的默认密码)。假如认证成功,你就会被带入到 Web 界面的主页: + +![](https://farm9.staticflickr.com/8601/15543330314_f6fdaa235e_z.jpg) + +你想做的第一件事最有可能是通过新增一个客户端主机来备份。进入任务窗格中的 “编辑主机”选项。我们将添加两个客户端主机: + +- Host #1: CentOS 7 [IP 192.168.0.17] +- Host #2: Windows 7 [IP 192.168.0.103] + +我们将通过 SSH 使用 `rsync`来备份 CentOS 主机,使用 SMB 来备份 Windows 主机。在执行备份之前,我们需要向我们的 CentOS 主机设置 [基于密码认证][7](注:这里我不知如何翻译,根据链接,感觉是无需密码来连接主机)以及在我们的 Windows 主机中设置一个共享目录。 + +下面是关于如何为一个远程 CentOS 主机设置 key-based authentication 的指导。我们创建 ‘backuppc’ 用户的 RSA 密钥对,并向 CentOS 主机上的 root 账户传递它的公共密钥。 + + # usermod -s /bin/bash backuppc + # su - backuppc + # ssh-keygen -t rsa + # ssh-copy-id root@192.168.0.17 + +当弹出提示框时,键入 yes 并为 192.168.0.17 键入 root 用户的密码: + +![](https://farm8.staticflickr.com/7496/16164929932_8fc817125d_b.jpg) + +你需要一个远程的 CentOS 主机的 root 权限来在该主机中的文件系统中发放写权限,以防要恢复的备份文件或目录的所有者为 root 账户。 + +一旦 CentOS 和 Windows 主机都准备完毕,使用 Web 界面将它们添加到 BackupPC: + +![](https://farm9.staticflickr.com/8586/15979622709_76c2dcf68c_z.jpg) + +下一步的内容由更改每个主机的备份设置组成: + +![](https://farm8.staticflickr.com/7461/16163781611_765c147f9f_z.jpg) + +接下来的图片展示了 Windows 主机的备份设置: + +![](https://farm8.staticflickr.com/7480/16139884676_bddfafed75_z.jpg) + +而接着的截图展示了 CentOS 主机的备份设置: + +![](https://farm8.staticflickr.com/7557/16139884666_34ff8fd858_z.jpg) + +### 开始一个备份任务 ### + +为了开始备份,到每个主机的设定选项,然后点击“开始全备份”: + +![](https://farm8.staticflickr.com/7536/15978247428_458c023f4c.jpg) + +在任何时候,你都可以通过点击如上图展示的每个主机的备份主页来查看备份任务的状态。假如因为某些原因备份失败,在主机菜单中将会出现一个指向包含错误信息的网页的链接。当一个备份任务被成功地完成,一个被命名为主机名或 IP 地址的目录将会在服务器的 /var/lib/backuppc/pc 目录下被创建。 + +![](https://farm8.staticflickr.com/7549/16165680115_196ee42a49_z.jpg) + +我们也可以随意地在命令行中浏览这个目录中的文件,但存在一个更加简单的方式来查找和恢复这些文件。 + +### 恢复备份 ### + +为了浏览已经保存过的文件。进入每个主机的主菜单下的 “浏览备份”选项,你可以一目了然地看到目录和文件,并选择那些你想恢复的文件。另外,你还可以通过点击文件来使用默认程序打开文件或右击文件并选择“另存为”来下载该文件到你正在工作的机器上: + +![](https://farm8.staticflickr.com/7506/16165680105_bd5883e0da_c.jpg) + +如若你想,你可以下载一个包含所有你想备份的内容的 zip 或 tar 文件: + +![](https://farm8.staticflickr.com/7507/15978247398_18e81667cd_z.jpg) + +或只是恢复文件: + +![](https://farm8.staticflickr.com/7545/15545911003_2aca8a36fc_z.jpg) + +### 总结 ### + +有句俗话说,"越简单,越好",而这正是 BackupPC 所提供的东西。在 BackupPC 中,你将不仅找到了一个备份工具,而且还找到了一个无需任何客户端应用来在几个不同的操作系统中管理你的备份的方法。我相信这就有足够的理由让你去尝试一下。 + +欢迎使用下面的评论框来留下你的评论和问题,假如你有的话。我总是乐于听取读者想说的话! +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/backuppc-cross-platform-backup-server-linux.html + +作者:[Gabriel Cánepa][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/gabriel +[1]:http://xmodulo.com/backup-debian-system-backupninja.html +[2]:http://xmodulo.com/linux-backup-manager.html +[3]:http://backuppc.sourceforge.net/ +[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[5]:http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html +[6]:http://xmodulo.com/recommend/linuxguide +[7]:http://xmodulo.com/how-to-enable-ssh-login-without.html diff --git a/translated/tech/20150105 How To Install Kodi 14 (XBMC) In Ubuntu 14.04 and Linux Mint 17.md b/translated/tech/20150105 How To Install Kodi 14 (XBMC) In Ubuntu 14.04 and Linux Mint 17.md deleted file mode 100644 index 20b6715d38..0000000000 --- a/translated/tech/20150105 How To Install Kodi 14 (XBMC) In Ubuntu 14.04 and Linux Mint 17.md +++ /dev/null @@ -1,51 +0,0 @@ -Ubuntu14.04或Mint17如何安装Kodi14(XBMC) -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Kodi_Xmas.jpg) - -[Kodi][1],原名就是大名鼎鼎的XBMC,发布[最新版本14][2],命名为Helix。感谢官方XMBC提供的PPA,现在可以很简单地在Ubuntu14.04中安装了。 - -Kodi是一个优秀的自由和开源的(GPL)媒体中心软件,支持所有平台,如Windows, Linux, Mac, Android等。此软件拥有全屏幕的媒体中心,可以管理所有音乐和视频,不单支持本地文件还支持网络播放,如Tube,[Netflix][3], Hulu, Amazon Prime和其他串流服务商。 - -### Ubuntu 14.04, 14.10 和 Linux Mint 17 中安装XBMC 14 Kodi Helix ### - -再次感谢官方的PPA,让我们可以轻松安装Kodi 14。 -支持Ubuntu 14.04, Ubuntu 12.04, Linux Mint 17, Pinguy OS 14.04, Deepin 2014, LXLE 14.04, Linux Lite 2.0, Elementary OS and 其他基于Ubuntu的Linux 发行版。 -打开终端(Ctrl+Alt+T)然后使用下列命令。 - - sudo add-apt-repository ppa:team-xbmc/ppa - sudo apt-get update - sudo apt-get install kodi - -需要下载大约100MB,在我的观点这不是很大。若需安装解码插件,使用下列命令: - - sudo apt-get install kodi-audioencoder-* kodi-pvr-* - -#### 从Ubuntu中移除Kodi 14 #### - -从系统中移除Kodi 14 ,使用下列命令: - - sudo apt-get remove kodi - -同样也应该移除PPA软件源: - - sudo add-apt-repository --remove ppa:team-xbmc/ppa - -我希望这个简单的文章可以帮助到你,在Ubuntu, Linux Mint 和其他 Linux版本中轻松安装Kodi 14。 -你怎么发现Kodi 14 Helix? -你有没有使用其他的什么媒体中心? -可以在下面的评论区分享你的观点。 - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-kodi-14-xbmc-in-ubuntu-14-04-linux-mint-17/ - -作者:[Abhishek][a] -译者:[Vic020/VicYu](http://www.vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/Abhishek/ -[1]:http://kodi.tv/ -[2]:http://kodi.tv/kodi-14-0-helix-unwinds/ -[3]:http://itsfoss.com/watch-netflix-in-ubuntu-14-04/ diff --git a/translated/tech/20150105 How To Install Winusb In Ubuntu 14.04.md b/translated/tech/20150105 How To Install Winusb In Ubuntu 14.04.md deleted file mode 100644 index b9fe775752..0000000000 --- a/translated/tech/20150105 How To Install Winusb In Ubuntu 14.04.md +++ /dev/null @@ -1,47 +0,0 @@ -如何在Ubuntu 14.04 中安装Winusb -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/WinUSB_Ubuntu_1404.jpeg) - -[WinUSB][1]是一款简单的且有用的工具,可以让你从Windows ISO镜像或者DVD中创建USB安装盘。它结合了GUI和命令行,你可以根据你的喜好决定使用哪种。 - -在本篇中我们会展示**如何在Ubuntu 14.04、14.10 和 Linux Mint 17 中安装WinUSB**。 - -### 在Ubuntu 14.04、14.10 和 Linux Mint 17 中安装WinUSB ### - -直到Ubuntu 13.10, WinUSBu一直都在积极开发,且在官方PPA中可以找到。这个PPA还没有为Ubuntu 14.04 和14.10更新,但是二进制文件仍旧可在更新版本的Ubuntu和Linux Mint中运行。基于[基于你使用的系统是32位还是64位的][2],使用下面的命令来下载二进制文件: - -打开终端,并在32位的系统下使用下面的命令: - - wget https://launchpad.net/~colingille/+archive/freshlight/+files/winusb_1.0.11+saucy1_i386.deb - -对于64位的系统,使用下面的命令: - - wget https://launchpad.net/~colingille/+archive/freshlight/+files/winusb_1.0.11+saucy1_amd64.deb - -一旦你下载了正确的二进制包,你可以用下面的命令安装WinUSB: - - sudo dpkg -i winusb* - -不要担心在你安装WinUSB时看见错误。使用这条命令修复依赖: - - sudo apt-get -f install - -之后,你就可以在Unity Dash中查找WinUSB并且用它在Ubuntu 14.04 中创建Windows的live USB了。 - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/WinUSB_Ubuntu.png) - -我希望这篇文章能够帮到你**在Ubuntu 14.04、14.10 和 Linux Mint 17 中安装WinUSB**。 - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-winusb-in-ubuntu-14-04/ - -作者:[Abhishek][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/Abhishek/ -[1]:http://en.congelli.eu/prog_info_winusb.html -[2]:http://itsfoss.com/how-to-know-ubuntu-unity-version/ \ No newline at end of file diff --git a/translated/tech/20150115 Get back your privacy and control.md b/translated/tech/20150115 Get back your privacy and control.md new file mode 100644 index 0000000000..9695c1f3de --- /dev/null +++ b/translated/tech/20150115 Get back your privacy and control.md @@ -0,0 +1,1111 @@ +在短短几个小时里拿回自己数据的隐私和控制权:为自己和朋友们搭建私有云 +================================================================================ +8年里40'000多次搜索!这是我的Google搜索历史。你的呢?(可以在[这里][1]自己找一下)有经过这么长时间积累下来的这么多数据点,Google已经能非常精确的推测你对什么感兴趣,曾经的想法,担忧过的事情,以及从你第一次获得Google帐号后这些年里所有这些的变化。 + +### 很多非常私人的信息不受自己控制地存储在世界范围内的服务器上 ### + +比如说你也像我一样从2006年到2013年都是Gmail用户,意味着你收到了30'000+的电子邮件以及在这7年里写了差不多5000封电子邮件。这些发送或收到的电子邮件里有很多是非常私人的,私人到你甚至不希望自己的家人或好友能系统地查看。也许你还写过一些草稿邮件,因为最后一分钟改变主意而从没发出去。但是尽管你从未发出去,这些邮件仍然保存在服务器上的某个地方。结论是,说Google服务器比你最亲密的朋友或家人都更了解你的个人生活一点也不过分。 + +从统计数据来看,可以很安全地赌你拥有一部智能手机。如果不使用联系人应用的话手机将基本没法用,而它默认会将你的联系人信息保存到Google服务器上的Google联系人里。所以,现在Google不仅知道了你的电子邮件,还有了你的离线联系人:你喜欢打给谁,谁来过电话,你发过短信给谁,以及发了些什么。你也不需要听我的片面之词,可以自己检查一下,看看你开放给类似Google Play服务的一些应用的权限,用来读取来电信息以及收到的短信。你是否还会用到手机里自带的日历应用?除非你在设置日程的时候明确地去掉,那么Google将精确地知道你将要做什么,一天里的每个时段,每一天,每一年。用iPhone代替Android手机也是一样的,只是Apple会代替Google来掌握你的往来邮件,联系人和日程计划。 + +你是否还会非常小心地同步自己的联系人信息,在你朋友,同事或家人换工作或换服务商的时候更新他们的电子邮件地址和手机号?这给Google提供了一副你社交网络的非常精确的,最新的图片。还有你非常喜欢手机的GPS功能,经常配合Google地图使用。这意味着Google不仅能从日程里知道你在干什么,还知道你在哪儿,住在哪儿,在哪儿工作。然后再关联用户之间的GPS位置信息,GOogle还能知道你现在可能正在和哪些人来往。 + +### 这种泄漏自己私人信息的日常爱好会以一种甚至没人能够预测的方式影响你的生活 ### + +总结一下,如果你是一个普通的因特网用户,Google拥有过去差不多10年里你最新的,深度的信息,关于你的兴趣,忧虑,热情,疑问。它还收集了一些你很私人的信息(电子邮件,短信),精确到小时的你的日常活动和位置,一副你社交网络的高品质图片。关于你的如此私密的数据,很可能已经超越了你最亲密的朋友,家人或爱人对你的了解。 + +不敢想象把这些深度的个人信息交给完全陌生的人,就好像把这些信息拷到一个U盘里,然后随便放到某个咖啡厅的桌上,留张纸条说“Olivier Martin的个人数据,请随便”。谁知道什么人会拿到它以及用来干嘛?然而,我们毫不犹豫地把自己的主要信息交给那些对我们的数据很感兴趣的IT公司的陌生人(这是他们制造面包的材料)以及[世界级的数据分析专家][2]手里,也许只是因为我们在点击那个绿色的'接受'按钮时根本没有想这么多。 + +有这么多的高质量信息,这么多年里,Google可能会比你希望自我了解的更了解你自己:尼玛,回想我过去的数字生活,我已经不记得5年前发出的邮件里的一半了。我很高兴能重新发现早在2005年对马克思主义的兴趣以及第二年加入了[ATTAC][3](一个致力于通过征收金融交易税来限制投机和改善社会公平的组织)。天知道为什么我竟然在2007年这么喜欢跳舞。这些都是无关紧要的信息(你不要指望我能爆出什么猛料,不会吧?;-)。但是,连接起这些高质量数据点,关于你生活的方方面面(做什么,什么时候,和谁一起,在哪里,...),并跨越这么长时间间隔,应该能推测出你的未来状态。比如说,根据一个17岁女孩的购物习惯,超市甚至可以在他父亲听说之前断定这个女孩怀孕了([真实故事][4])。谁知道通过像Google所掌握的这些远远超出购物习惯的高质量数据能做些什么?连接起这些点,也许有人能预测你未来几年里口味或政治观点的变化。如今,[你从未听过的公司声称拥有你500项数据点][5],包括宗教信仰,性取向和政治观点。提到政治,如果说你决定今后10年内进入政坛会怎么样?你的生活会改变,你的观点也一样,甚至你有时候会有所遗忘,但是Google不会。那你会不会担心你的对手会接触一些可以从Google访问你数据的人并会从你过去这些年里积累的个人数据深渊里挖出一些猛料呢?[就像最近Sony被黑][6]一样,多久以后会轮到Google或Facebook,以致让你的个人信息最终永远暴露? + +我们大多数人把自己的个人数据托付给这些公司的一个原因就是它们提供免费服务。但是真的免费吗?一般的Google帐号的价值根据评估方式不同会有些差别:你花在写邮件上的时间占到[1000美元/年][7],你的帐号对于广告产业的价值差不多在[220美元/年][8]到[500美元/年][9]之间。所以这些服务并不是真的免费:会通过广告和我们的数据在未来的一些未知使用来间接付费。 + +我写的最多的是Google,这是因为这是我托付个人数字信息的,以及目前我所知道做的最好的公司。但是我也提到过Apple或Facebook。这些公司通过它们在设计,工程和我们(曾经)喜欢每天使用的服务方面的神奇进步实实在在地改变了世界。但是这并不是说我们应该把所有我们最私人的个人数据堆积到它们的服务器上并把我们的数字生活托付给它们:潜在的危害实在太大了。 + +### 只要5小时,拿回自己以及关心的人的隐私权 ### + +并不是一定要这样做。你可以生活在21世纪,拿着智能手机,每天都用电子邮件和GPS,却仍然可以保留自己的隐私。你所需要的就是拿回自己个人数据的控制权:邮件、日程、联系人、文件,等等。[Prism-Break.org][10]网站上列出了一些能帮你掌握个人数据命运的软件。除此以外,控制自己个人数据的最安全和最有效的方式是架设自己的服务器并搭建自己的云。不过你也许只是没有时间或精力去研究具体该怎么做以及如何让它能流畅工作。 + +这也是这篇文章的意义所在。仅仅5个小时内,我们将配置出一台服务器来支撑你的邮件、联系人、日程表和各种文件,为你、你的朋友和你的家人。这个服务器将设计成一个个人数据中心或云,所以你能时刻保留它的完整控制。数据将自动在你的台式机/笔记本、手机和平板之间同步。从根本上来说,**我们将建立一个系统来代替Gmail、Google文件/Dropbox、Google联系人、Google日历和Picasa**。 + +为自己做这件事情已经是迈出很大一步了。但是,你个人信息的很大一部分将仍然泄漏出去并保存到硅谷的一些主机上,只是因为和你日常来往的太多人在用Gmail和使用智能手机。所以最好是带上你一些比较亲近的人加入这次探险。 + +我们将构建的系统能够 + +- **支持任意数目的域名和用户**。这样就能轻易地和你的家人朋友共享这台服务器,所以他们也能掌控自己的个人数据,并且还能和你一起分摊服务费用。和你一起共享服务器的人可以使用他们自己的域名或者共享你的。 +- **允许你从任意网络发送和接收电子邮件**,需要成功登录服务器之后。这样,你可以通过任意的邮件地址,任意设备(台式机、手机、平板),任意网络(家里、公司、公共网络、...)来发送电子邮件。 +- **在发送和接收邮件的时候加密网络数据**,这样,你不信任的人不能钓出你的密码,也不能看到你的私人邮件。 +- **提供最先进的反垃圾邮件技术**,结合了已知垃圾邮件黑名单,自动灰名单,和自适应垃圾邮件过滤。如果邮件被误判了只需要简单地把它拖入或拖出垃圾目录就可以重新配置垃圾邮件过滤器。而且,服务器还会为基于社区的反垃圾邮件努力做出贡献。 +- **一段时间里只需要几分钟的维护**,基本上只是安装安全更新和简单地检查一下服务器日志。添加一个新的邮件地址只需要在数据库中插入一条记录。除此之外,你可以忘记它的存在过自己的生活。我在14个月之前搭建了本文描述的这个系统,从那以后就一直顺利运行。所以我完全把它给忘了,直到我最近觉得随便按下手机上的‘检查邮件’会导致电子一路跑到冰岛(我放置服务器的地方)再回来的想法有点好笑才想起来。 + +要完成这篇文章里的工作,你需要一点基本的技术能力。如果你知道SMTP和IMAP的区别,什么是DNS,以及对TCP/IP有基本了解的话,就够了。你还将需要一点基本的Unix知识(在命令行下和文件一起工作,基本的系统管理)。然后你需要花总共5小时时间来搭建。 + +下面是我们将要做的事情的概述。 + +- [申请一个虚拟私人服务器,一个域名,并把它们配置好][11] +- [设置postfix和dovecot来收发电子邮件][12] +- [阻止垃圾邮件进入你的收件箱][13] +- [确保你发出的邮件能通过垃圾邮件过滤器][14] +- [使用Owncloud提供日历,联系人,文件服务并配置webmail][15] +- [在云上同步你的设备][16] + +### 这篇文章是受之前工作的启发并以之为基础 ### + +本文很大程度参考了两篇文章,由[Xavier Claude][17]和[Drew Crawford][18]写的关于架设私有邮件服务器的介绍。 + +本文覆盖了Xavier和Drew的文章里所描述的所有功能,除了3个地方Drew有而我没有:邮件推送支持(我喜欢由我主动检查邮件,而其他时候都不会被打扰),邮件全文检索(我一直都没用过),以及使用加密方式存储邮件(我的邮件和数据还没那么重要到要把它们加密后再存到本地服务器上)。如果你需要这些功能,只需要按照Drew的文章里相应部分的说明做就好了,和本文的内容兼容。 + +和Xavier和Drew的成果比起来,本文有下面几个主要改进: + +- 根据我自己按Drew文章操作的经验以及原文的大量回复,修改了一些问题和文字错误。我也把本文所介绍的内容仔细检查了几遍,从头开始设定了几次服务器做重复验证以确保能正常工作。 +- 低维护:和Xavier的方式比起来,本文增加了在服务器上支持多个邮件域名。这样做是为了尽可能地减少服务器维护工作:基本上,要添加一个域名或用户,只需要往mysql数据库表里增加一行就好了(不需要增加过滤脚本,等等)。 +- 我增加了webmail。 +- 我增加了设定云服务器的部分,不仅能收发邮件还能管理文件,地址本/联系人(邮件地址,电话号码,生日,等等等),日程表和图片,供所有设备访问使用。 + +### 申请一个虚拟私人服务器,一个域名,并把它们配置好 ### + +让我们从设置基础设施开始:我们的虚拟私人主机和我们的域名。 + +我用过[1984.is][19]和[Linode][20]提供的虚拟私人主机(VPS),体验非常好。在本文中,我们将使用**Debian Wheezy**,这个在1984和Linode都提供了已经做好的映像文件可以直接布置到你的VPS上。我喜欢1984是因为它的服务器在冰岛,也是唯一使用可再生能源(地热和水力发电)的地方,目前还没有影响过气候变化,不像[大多数美国数据中心目前大多数依赖于烧煤的火力发电站][21]。而且,他们注重[民权,透明,自由][22]以及[免费软件][23]。 + +最好是在服务器上创建一个文件用来保存后面要用到的各种密码(用户账号,邮件账号,云帐号,数据库帐号)。当然最好是加密一下(可以用[GnuPG][24]),这样就算用来设定服务器的电脑被偷了或被入侵了,你的服务器就不会那么容易被攻击。 + +关于注册域名,我已经使用[grandi][25]的服务超过10年了,也很满意。在本文中,我们将开辟一个叫**jhausse.net**的域名。然后在上面增加一个叫**cloud.jhausse.net**的二级域名,并绑定MX纪录。在完成之后,设置比较短的纪录生存时间(TTL)比如300秒,这样你在设置服务器的时候,可以修改你的域并很快测试到结果。 + +最后,设置PTR纪录(反向DNS),这样IP地址可以反向映射回它的域名。如果你不理解前面这句话,看下[这篇文章][26]来获得相关背景知识。如果你使用Linode的服务,你可以在远程访问这一栏的控制面板里设置PTR纪录。如果是1984,联系一下技术支持来帮你搞定。 + +在服务器上,我们从添加一个普通用户开始,这样我们不用从头到尾一直用root账号。另外,用root登陆也需要额外多一层安全措施。 + + adduser roudy + +然后,在文件**/etc/ssh/sshd_config**中设置 + + PermitRootLogin no + +然后重启ssh服务 + + service ssh reload + +然后,我们要修改服务器的主机名。编辑文件**/etc/hostname**,只有一行就是自己的主机名,我们这个例子中是 + + cloud + +然后,编辑ssh服务的公钥文件**/etc/ssh/ssh_host_rsa_key.pub, /etc/ssh/ssh_host_dsa_key.pub, /etc/ssh/ssh_host_ecdsa_key.pub**,这样文件末尾可以反映你的主机名,比如**root@cloud**。然后重启系统保证主机名在系统的每个需要它的角落都生效了。 + + reboot + +我们将更新系统并移除不必要的服务以降低远程攻击的风险。 + + apt-get update + apt-get dist-upgrade + service exim4 stop + apt-get remove exim4 rpcbind + apt-get autoremove + apt-get install vim + +我喜欢使用vim远程编辑配置文件。打开自动语法高亮会很有帮助。添加下面这一行到**~/.vimrc**文件中。 + + syn on + +### 设置postfix和dovecot来收发电子邮件 ### + + apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-mysql mysql-server dovecot-lmtpd postgrey + +在[Postfix][27]的配置菜单里,选择**因特网站点**,把系统邮件名设为**jhausse.net**。 + +现在开始添加一个数据库用于保存主机上管理的域名列表,和每个域名下的用户列表(同时也包括他们各自的密码),以及邮件别名列表(用于从一个地址往另一个地址转发邮件)。 + + mysqladmin -p create mailserver + mysql -p mailserver + mysql> GRANT SELECT ON mailserver.* TO 'mailuser'@'localhost' IDENTIFIED BY 'mailuserpass'; + mysql> FLUSH PRIVILEGES; + mysql> CREATE TABLE `virtual_domains` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(50) NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + mysql> CREATE TABLE `virtual_users` ( + `id` int(11) NOT NULL auto_increment, + `domain_id` int(11) NOT NULL, + `password` varchar(106) NOT NULL, + `email` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `email` (`email`), + FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + mysql> CREATE TABLE `virtual_aliases` ( + `id` int(11) NOT NULL auto_increment, + `domain_id` int(11) NOT NULL, + `source` varchar(100) NOT NULL, + `destination` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +我们将承载**jhausse.net**域名。如果还需要加入其他域名,也没问题。我们也会为每个域名设置一个邮件管理地址,转寄给**roudy@jhausse.net**。 + + mysql> INSERT INTO virtual_domains (`name`) VALUES ('jhausse.net'); + mysql> INSERT INTO virtual_domains (`name`) VALUES ('otherdomain.net'); + mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('1', 'postmaster', 'roudy@jhausse.net'); + mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('2', 'postmaster', 'roudy@jhausse.net'); + +现在已经添加了一个本地邮件账号**roudy@jhausse.net**。首先,为它生成一个哈希密码: + + doveadm pw -s SHA512-CRYPT + +然后把哈希值加入到数据库中 + + mysql> INSERT INTO `mailserver`.`virtual_users` (`domain_id`, `password`, `email`) VALUES ('1', '$6$YOURPASSWORDHASH', 'roudy@jhausse.net'); + +现在我们的域名,别名和用户列表都设置好了,然后开始设置postfix(SMTP服务器,用来发送邮件)。把文件**/etc/postfix/main.cf**替换为下面的内容: + + myhostname = cloud.jhausse.net + myorigin = /etc/mailname + mydestination = localhost.localdomain, localhost + mynetworks_style = host + + # We disable relaying in the general case + smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination + # Requirements on servers that contact us: we verify the client is not a + # known spammer (reject_rbl_client) and use a graylist mechanism + # (postgrey) to help reducing spam (check_policy_service) + smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, check_policy_service inet:127.0.0.1:10023 + disable_vrfy_command = yes + inet_interfaces = all + smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) + biff = no + append_dot_mydomain = no + readme_directory = no + + # TLS parameters + smtpd_tls_cert_file=/etc/ssl/certs/cloud.crt + smtpd_tls_key_file=/etc/ssl/private/cloud.key + smtpd_use_tls=yes + smtpd_tls_auth_only = yes + smtp_tls_security_level=may + smtp_tls_loglevel = 1 + smtpd_tls_loglevel = 1 + smtpd_tls_received_header = yes + smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache + smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache + + # Delivery + alias_maps = hash:/etc/aliases + alias_database = hash:/etc/aliases + message_size_limit = 50000000 + recipient_delimiter = + + + # The next lines are useful to set up a backup MX for myfriendsdomain.org + # relay_domains = myfriendsdomain.org + # relay_recipient_maps = + + # Virtual domains + virtual_transport = lmtp:unix:private/dovecot-lmtp + virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf + virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf + virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf + local_recipient_maps = $virtual_mailbox_maps + +现在我们要让postfix知道如何从我们设定的数据库里找出需要接收邮件的域名。建立一个新文件**/etc/postfix/mysql-virtual-mailbox-domains.cf**并添加以下内容: + + user = mailuser + password = mailuserpass + hosts = 127.0.0.1 + dbname = mailserver + query = SELECT 1 FROM virtual_domains WHERE name='%s' + +我们可以让postfix判断给定的电子邮件账号是否存在,创建文件**/etc/postfix/mysql-virtual-mailbox-maps.cf**并写入以下内容: + + user = mailuser + password = mailuserpass + hosts = 127.0.0.1 + dbname = mailserver + query = SELECT 1 FROM virtual_users WHERE email='%s' + +最后,postfix会根据文件**/etc/postfix/mysql-virtual-alias-maps.cf**的内容来查找邮件别名 + + user = mailuser + password = mailuserpass + hosts = 127.0.0.1 + dbname = mailserver + query = SELECT virtual_aliases.destination as destination FROM virtual_aliases, virtual_domains WHERE virtual_aliases.source='%u' AND virtual_aliases.domain_id = virtual_domains.id AND virtual_domains.name='%d' + +在配置好这些后,现在要测试一下postfix是否能正常查询数据库。我们可以用**postmap**命令测试: + + postmap -q jhausse.net mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf + postmap -q roudy@jhausse.net mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf + postmap -q postmaster@jhausse.net mysql:/etc/postfix/mysql-virtual-alias-maps.cf + postmap -q bob@jhausse.net mysql:/etc/postfix/mysql-virtual-alias-maps.cf + +如果一切都正常配置了的话,头两个查询应该输出1,第3个查询应该输出**roudy@jhausse.net**,而最后一个应该什么都不输出。 + +现在,让我们设置一下dovecot(一个IMAP服务程序,用来在我们的设备上从服务器获取收件箱里的邮件)。编辑文件**/etc/dovecot/dovecot.conf**设置以下参数: + + # Enable installed protocol + # !include_try /usr/share/dovecot/protocols.d/*.protocol + protocols = imap lmtp + +这样将只打开imap(让我们可以获取邮件)和lmtp(postfix用来将收件箱里的邮件转给dovecot)。编辑**/etc/dovecot/conf.d/10-mail.conf**并设置以下参数: + + mail_location = maildir:/var/mail/%d/%n + [...] + mail_privileged_group = mail + [...] + first_valid_uid = 0 + +这样邮件将被保存到目录/var/mail/domainname/username下。注意下这几个选项散布在配置文件的不同位置,有时已经在那里写好了:我们只需要取消注释。文件里的其他设定选项,可以维持原样。在本文后面还有很多文件需要用同样的方式更新设置。在文件**/etc/dovecot/conf.d/10-auth.conf**里,设置以下参数: + + disable_plaintext_auth = yes + auth_mechanisms = plain + #!include auth-system.conf.ext + !include auth-sql.conf.ext + +在文件**/etc/dovecot/conf.d/auth-sql.conf.ext**里,设置以下参数: + + passdb { + driver = sql + args = /etc/dovecot/dovecot-sql.conf.ext + } + userdb { + driver = static + args = uid=mail gid=mail home=/var/mail/%d/%n + } + +这是告诉dovecot用户的邮件保存在目录/var/mail/domainname/username下,以及如何从我们刚建立的数据库里查找密码。现在我们还需要告诉dovecot具体如何使用数据库。这样需要把下面的内容加入**/etc/dovecot/dovecot-sql.conf.ext**文件: + + driver = mysql + connect = host=localhost dbname=mailserver user=mailuser password=mailuserpass + default_pass_scheme = SHA512-CRYPT + password_query = SELECT email as user, password FROM virtual_users WHERE email='%u'; + +我们现在修改一下配置文件的权限 + + chown -R mail:dovecot /etc/dovecot + chmod -R o-rwx /etc/dovecot + +基本差不多了!只是还需要再多编辑几个文件。在文件**/etc/dovecot/conf.d/10-master.conf**里,设置以下参数: + + service imap-login { + inet_listener imap { + #port = 143 + port = 0 + } + inet_listener imaps { + port = 993 + ssl = yes + } + } + + service pop3-login { + inet_listener pop3 { + #port = 110 + port = 0 + } + inet_listener pop3s { + #port = 995 + #ssl = yes + port = 0 + } + } + + service lmtp { + unix_listener /var/spool/postfix/private/dovecot-lmtp { + mode = 0666 + group = postfix + user = postfix + } + user = mail + } + + service auth { + unix_listener auth-userdb { + mode = 0600 + user = mail + #group = + } + + # Postfix smtp-auth + unix_listener /var/spool/postfix/private/auth { + mode = 0666 + user = postfix + group = postfix + } + + # Auth process is run as this user. + #user = $default_internal_user + user = dovecot + } + + service auth-worker { + user = mail + } + +注意下我们把除了imaps之外所有服务的端口都设置成了0,这样可以有效地禁止这些服务。然后,在文件**/etc/dovecot/conf.d/15-lda.conf**里,指定一个邮箱管理地址: + + postmaster_address = postmaster@jhausse.net + +最后但很重要的一点,我们为服务器需要生成一对公钥和私钥,可以同时用于dovecot和postfix: + + openssl req -new -newkey rsa:4096 -x509 -days 365 -nodes -out "/etc/ssl/certs/cloud.crt" -keyout "/etc/ssl/private/cloud.key" + +请确保你指定了服务器的完全限定域名(FQDN),在本文的例子里: + + Common Name (e.g. server FQDN or YOUR name) []:cloud.jhausse.net + +如果没有的话,我们的客户端会抱怨在SSL证书里的服务器名字和所连接的服务器名字不一致。我们将通过修改配置文件**/etc/dovecot/conf.d/10-ssl.conf**里的如下选项来告诉dovecot使用刚生成的密钥: + + ssl = required + ssl_cert = : Relay access denied + +这个没问题:如果服务器能接受这封邮件,那意味着我们架设的postfix是一个对全世界所有垃圾邮件都开放的中继,将完全没法使用。除了'Relay access denied'消息,你也可能会收到这样的响应: + + 554 5.7.1 Service unavailable; Client host [87.68.61.119] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=87.68.61.119 + +意思是你正尝试从一个被标记成垃圾邮件发送者的IP地址连接服务器。我在通过普通的因特网服务提供商(ISP)连接服务器时曾收到过这样的消息。要解决这个问题,可以试着从另一个主机发起连接,比如另外一个你可以SSH登录的主机。另外一种方式是,你可以修改postfix的**main.cf**配置文件,不要使用Spamhous的RBL,重启postfix服务,然后再检查上面的测试是否正常。不管用哪种方式,最重要的是你要确定一个能工作的,因为我们后面马上要测试其他功能。如果你选择了重新配置postfix不使用RBL,别忘了在完成本文后重新开启RBL并重启postfix,以避免收到一些不必要的垃圾邮件。 + +现在,我们试一下往SMTP端口25发送一封有效的邮件,这是一般正常的邮件服务器用来彼此对话的方式: + + openssl s_client -connect cloud.jhausse.net:25 -starttls smtp + EHLO cloud.jhausse.net + MAIL FROM:youremail@domain.com + rcpt to:roudy@jhausse.net + +服务器应该有这样的响应 + + Client host rejected: Greylisted, see http://postgrey.schweikert.ch/help/jhausse.net.html + +这意味着[postgrey][28]工作正常。postgrey做的是用临时错误拒绝未知发送者的邮件。邮件的技术规则是要求邮件服务器尝试重新发送邮件。在5分钟后,postgrey就会接收这封邮件。一般世界范围内遵守规则的邮件服务器都会尝试为我们重复投递邮件,但大多数垃圾邮件发送者不会这样做。所以,等上5分钟,再次通过上面的命令发送一次,然后检查postfix应该正常接收了邮件。 + +之后,我们检查一下我们可以通过IMAP和dovecot对话获取刚才发送的两封邮件。 + + openssl s_client -crlf -connect cloud.jhausse.net:993 + 1 login roudy@jhausse.net "mypassword" + 2 LIST "" "*" + 3 SELECT INBOX + 4 UID fetch 1:1 (UID RFC822.SIZE FLAGS BODY.PEEK[]) + 5 LOGOUT + +这里,你应该把mypassword替换为你自己为这个邮件账号设定的密码。如果能正常工作,基本上我们已经拥有一个能接收邮件的邮件服务器了,通过它我们可以在各种设备(PC/笔记本,平板,手机,...)上收取邮件了。但是我们不能把邮件给它发送出去,除非我们自己从服务器发送。现在我们将让postfix为我们转发邮件,但是这个只有成功登录才可以,这是为了保证邮件是由服务器上的某个有效帐号发出来的。要做到这个,我们要打开一个特殊的,全程SSL连接的,SASL鉴权的邮件提交服务。在文件**/etc/postfix/master.cf**里设置下面的参数: + + submission inet n - - - - smtpd + -o syslog_name=postfix/submission + -o smtpd_tls_security_level=encrypt + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o smtpd_sasl_type=dovecot + -o smtpd_sasl_path=private/auth + -o smtpd_sasl_security_options=noanonymous + -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject_non_fqdn_recipient,reject_unauth_destination + +然后重启postfix服务 + + service postfix reload + +现在,让我们试试从一台不同的机器连接这个服务,确定一下postfix现在能够正常中继我们自己的而不是其他任何人的邮件: + + openssl s_client -connect cloud.jhausse.net:587 -starttls smtp + EHLO cloud.jhausse.net + +注意一下服务器建议的'250-AUTH PLAIN'功能,在从端口25连接的时候不会生效。 + + MAIL FROM:asdf@jkl.net + rcpt to:bob@gmail.com + 554 5.7.1 : Relay access denied + QUIT + +这个没问题,postfix在不认识我们的时候是不会中继邮件的。所以,首先让我们先鉴定一下自己的身份。要这样做,我们首先需要生成一个鉴权字符串: + + echo -ne '\000roudy@jhausse.net\000mypassword'|base64 + +然后让我们尝试再次通过服务器发送邮件: + + openssl s_client -connect cloud.jhausse.net:587 -starttls smtp + EHLO cloud.jhausse.net + AUTH PLAIN DGplYW5AMTk4NGNsb3VQLm5ldAA4bmFmNGNvNG5jOA== + MAIL FROM:asdf@jkl.net + rcpt to:bob@gmail.com + +现在postfix应该能正常接收。最后完成这个测试,来检查一下我们的虚拟别名能正常工作,给postmaster@jhausse.net发送一封邮件然后确认一下它会被送到roudy@jhausse.net: + + telnet cloud.jhausse.net 25 + EHLO cloud.jhausse.net + MAIL FROM:youremail@domain.com + rcpt to:postmaster@jhausse.net + data + Subject: Virtual alias test + + Dear postmaster, + Long time no hear! I hope your MX is working smoothly and securely. + Yours sincerely, Roudy + . + QUIT + +让我们检查一下邮件是否被正常送到正确的收件箱了: + + openssl s_client -crlf -connect cloud.jhausse.net:993 + 1 login roudy@jhausse.net "mypassword" + 2 LIST "" "*" + 3 SELECT INBOX + * 2 EXISTS + * 2 RECENT + 4 LOGOUT + +到这里,我们已经拥有一个能正常工作的邮箱服务器了,能收发邮件。我们可以配置自己的设备来使用它。 + +PS:不要忘记再次[试试通过端口25往自己架设的服务器上的帐号发送邮件][29],来验证你已经没有被postgrey阻挡了。 + +### 阻止垃圾邮件进入你的收件箱 ### + +为了过滤垃圾邮件,我们已经使用了实时黑名单(RBLs)和灰名单(postgrey)。现在我们将增加自适应垃圾邮件过滤来让我们的垃圾邮件过滤能力提高一个等级。这意味着我们将为我们的邮件服务器增加人工智能,这样它就能从经验中学习哪些有件是垃圾哪些不是。我们将使用[dspam][30]来实现这个功能。 + + apt-get install dspam dovecot-antispam postfix-pcre dovecot-sieve + +dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误分类了之后让dovecot重新更新垃圾邮件过滤器。基本上,我们所需要做的就只是把邮件放进或拿出垃圾箱。dovecot-antispam将负责调用dspam来更新过滤器。至于postfix-pcre和dovecot-sieve,我们将分别用它们来把接收的邮件递给垃圾邮件过滤器以及自动把垃圾邮件放入用户的垃圾箱。 + +在配置文件**/etc/dspam/dspam.conf**里,为以下参数设置相应的值: + + TrustedDeliveryAgent "/usr/sbin/sendmail" + UntrustedDeliveryAgent "/usr/lib/dovecot/deliver -d %u" + Tokenizer osb + IgnoreHeader X-Spam-Status + IgnoreHeader X-Spam-Scanned + IgnoreHeader X-Virus-Scanner-Result + IgnoreHeader X-Virus-Scanned + IgnoreHeader X-DKIM + IgnoreHeader DKIM-Signature + IgnoreHeader DomainKey-Signature + IgnoreHeader X-Google-Dkim-Signature + ParseToHeaders on + ChangeModeOnParse off + ChangeUserOnParse full + ServerPID /var/run/dspam/dspam.pid + ServerDomainSocketPath "/var/run/dspam/dspam.sock" + ClientHost /var/run/dspam/dspam.sock + +然后,在配置文件**/etc/dspam/default.prefs**里,把以下参数改为: + + spamAction=deliver # { quarantine | tag | deliver } -> default:quarantine + signatureLocation=headers # { message | headers } -> default:message + showFactors=on + +现在我们需要把dspam连接到postfix和dovecot上,在配置文件**/etc/postfix/master.cf**最后添加这样两行: + + dspam unix - n n - 10 pipe + flags=Ru user=dspam argv=/usr/bin/dspam --deliver=innocent,spam --user $recipient -i -f $sender -- $recipient + dovecot unix - n n - - pipe + flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} + +现在我们将告诉postfix通过dspam来过滤所有提交给服务器端口25(一般的SMTP通信)的新邮件,除非该邮件是从服务器本身发出(permit_mynetworks)。注意下我们通过SASL鉴权提交给postfix的邮件不会通过dspam过滤,因为我们在前面部分里为这种方式设定了独立的提交服务。编辑文件**/etc/postfix/main.cf**将选项**smtpd_client_restrictions**改为如下内容: + + smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, check_policy_service inet:127.0.0.1:10023, check_client_access pcre:/etc/postfix/dspam_filter_access + +在文件末尾,还需要增加: + + # For DSPAM, only scan one mail at a time + dspam_destination_recipient_limit = 1 + +现在我们需要指定我们定义的过滤器。基本上,我们将告诉postfix把所有邮件(/./)通过unix套接字发给dspam。创建一个新文件**/etc/postfix/dspam_filter_access**并把下面一行写进去: + + /./ FILTER dspam:unix:/run/dspam/dspam.sock + +这是postfix部分的配置。现在让我们为dovecot设置垃圾过滤。在文件**/etc/dovecot/conf.d/20-imap.conf**里,修改**imap mail_plugin**插件参数为下面的方式: + + mail_plugins = $mail_plugins antispam + +并为lmtp增加一个部分: + + protocol lmtp { + # Space separated list of plugins to load (default is global mail_plugins). + mail_plugins = $mail_plugins sieve + } + +我们现在设置dovecot-antispam插件。编辑文件**/etc/dovecot/conf.d/90-plugin.conf**并把以下内容添加到插件部分: + + plugin { + ... + # Antispam (DSPAM) + antispam_backend = dspam + antispam_allow_append_to_spam = YES + antispam_spam = Junk;Spam + antispam_trash = Trash;trash + antispam_signature = X-DSPAM-Signature + antispam_signature_missing = error + antispam_dspam_binary = /usr/bin/dspam + antispam_dspam_args = --user;%u;--deliver=;--source=error + antispam_dspam_spam = --class=spam + antispam_dspam_notspam = --class=innocent + antispam_dspam_result_header = X-DSPAM-Result + } + +然后在文件**/etc/dovecot/conf.d/90-sieve.conf**里指定默认的sieve脚本,这个将对服务器上所有用户有效: + + sieve_default = /etc/dovecot/default.sieve + +什么是sieve以及为什么我们需要为所有用户设置一个默认脚本?sieve可以在IMAP服务器上为我们自动处理任务。在我们的例子里,我们想让所有被确定为垃圾的邮件会被移到垃圾箱而不是收件箱里。我们希望这是服务器上所有用户的默认行为;这是为什么我们把这个脚本设为默认脚本。现在让我们来创建这个脚本,建立一个新文件**/etc/dovecot/default.sieve**并写入以下内容: + + require ["regex", "fileinto", "imap4flags"]; + # Catch mail tagged as Spam, except Spam retrained and delivered to the mailbox + if allof (header :regex "X-DSPAM-Result" "^(Spam|Virus|Bl[ao]cklisted)$", + not header :contains "X-DSPAM-Reclassified" "Innocent") { + # Mark as read + # setflag "\\Seen"; + # Move into the Junk folder + fileinto "Junk"; + # Stop processing here + stop; + } + +现在我们需要编译这个脚本好让dovecot能运行它。我们也需要给它合适的权限。 + + cd /etc/dovecot + sievec . + chown mail.dovecot default.siev* + chmod 0640 default.sieve + chmod 0750 default.svbin + +最后,我们需要修改dspam要读取的两个postfix配置文件的权限: + + chmod 0644 /etc/postfix/dynamicmaps.cf /etc/postfix/main.cf + +就这些!让我们重启dovecot和postfix服务 + + service dovecot restart + service postfix restart + +然后通过从远程主机(比如我们用来设定服务器的电脑)连接服务器来测试一下反垃圾邮件: + + openssl s_client -connect cloud.jhausse.net:25 -starttls smtp + EHLO cloud.jhausse.net + MAIL FROM:youremail@domain.com + rcpt to:roudy@jhausse.net + DATA + Subject: DSPAM test + + Hi Roudy, how'd you like to eat some ham tonight? Yours, J + . + QUIT + +让我们检查一下邮件是否已经送到: + + openssl s_client -crlf -connect cloud.jhausse.net:993 + 1 login roudy@jhausse.net "mypassword" + 2 LIST "" "*" + 3 SELECT INBOX + 4 UID fetch 3:3 (UID RFC822.SIZE FLAGS BODY.PEEK[]) + +这个应该返回SPAM为邮件增加了一组标记的数据,看上去像这样: + + X-DSPAM-Result: Innocent + X-DSPAM-Processed: Sun Oct 5 16:25:48 2014 + X-DSPAM-Confidence: 1.0000 + X-DSPAM-Probability: 0.0023 + X-DSPAM-Signature: 5431710c178911166011737 + X-DSPAM-Factors: 27, + Received*Postfix+with, 0.40000, + Received*with+#+id, 0.40000, + like+#+#+#+ham, 0.40000, + some+#+tonight, 0.40000, + Received*certificate+requested, 0.40000, + Received*client+certificate, 0.40000, + Received*for+roudy, 0.40000, + Received*Sun+#+#+#+16, 0.40000, + Received*Sun+#+Oct, 0.40000, + Received*roudy+#+#+#+Oct, 0.40000, + eat+some, 0.40000, + Received*5+#+#+16, 0.40000, + Received*cloud.jhausse.net+#+#+#+id, 0.40000, + Roudy+#+#+#+to, 0.40000, + Received*Oct+#+16, 0.40000, + to+#+#+ham, 0.40000, + Received*No+#+#+requested, 0.40000, + Received*jhausse.net+#+#+Oct, 0.40000, + Received*256+256, 0.40000, + like+#+#+some, 0.40000, + Received*ESMTPS+id, 0.40000, + how'd+#+#+to, 0.40000, + tonight+Yours, 0.40000, + Received*with+cipher, 0.40000 + 5 LOGOUT + +很好!你现在已经为你服务器上的用户配置好自适应垃圾邮件过滤。当然,每个用户将需要在开始的几周里培训过滤器。要标记一则信息为垃圾,只需要在你的任意设备(电脑,平板,手机)上将它移动到叫“垃圾箱”或“废纸篓”的目录里。否则它将被标记为有用。 + +### 确保你发出的邮件能通过垃圾邮件过滤器 ### + +这个部分我们的目标是让我们的邮件服务器能尽量干净地出现在世界上,并让垃圾邮件发送者们更难以我们的名义发邮件。作为附加效果,这也有助于让我们的邮件能通过其他邮件服务器的垃圾邮件过滤器。 + +#### 发送者策略框架 #### + +发送者策略框架(SPF)是你添加到自己服务器区域里的一份记录,声明了整个因特网上哪些邮件服务器能以你的域名发邮件。设置非常简单,使用[microsoft.com][31]上的SPF向导来生成你的SPF记录,然后作为一个TXT记录添加到自己的服务器区域里。看上去像这样: + + jhausse.net. 300 IN TXT v=spf1 mx mx:cloud.jhausse.net -all + +#### 反向PTR #### + +我们[之前][32]在本文里讨论过这个问题,建议你为自己的服务器正确地设置反向DNS,这样对服务器IP地址的反向查询能返回你服务器的实际名字。 + +#### OpenDKIM #### + +当我们激活[OpenDKIM][33]后,postfix会用密钥为每封发出去的邮件签名。然后我们将把这个密钥存储在DNS域中。这样的话,世界上任意一个邮件服务器都能够检验邮件是否真的是我们发出的,或是由垃圾邮件发送者伪造的。让我们先安装opendkim: + + apt-get install opendkim opendkim-tools + +然后按如下方式编辑**/etc/opendkim.conf**文件的配置: + + ## + ## opendkim.conf -- configuration file for OpenDKIM filter + ## + Canonicalization relaxed/relaxed + ExternalIgnoreList refile:/etc/opendkim/TrustedHosts + InternalHosts refile:/etc/opendkim/TrustedHosts + KeyTable refile:/etc/opendkim/KeyTable + LogWhy Yes + MinimumKeyBits 1024 + Mode sv + PidFile /var/run/opendkim/opendkim.pid + SigningTable refile:/etc/opendkim/SigningTable + Socket inet:8891@localhost + Syslog Yes + SyslogSuccess Yes + TemporaryDirectory /var/tmp + UMask 022 + UserID opendkim:opendkim + +我们还需要几个额外的文件,将保存在目录**/etc/opendkim**里: + + mkdir -pv /etc/opendkim/ + cd /etc/opendkim/ + +让我们建立新文件**/etc/opendkim/TrustedHosts**并写入以下内容 + + 127.0.0.1 + +建立新文件**/etc/opendkim/KeyTable**并写入以下内容 + + cloudkey jhausse.net:mail:/etc/opendkim/mail.private + +这会告诉OpenDKIM我们希望使用一个名叫'cloudkey'的加密密钥,它的内容在文件/etc/opendkim/mail.private里。我们建立另一个名叫**/etc/opendkim/SigningTable**的文件然后写入下面这一行: + + *@jhausse.net cloudkey + +这会告诉OpenDKIM每封从jhausse.net域发出的邮件都应该用'cloudkey'密钥签名。如果我们还有其他域希望也能签名,我们也可以在这里添加。 + +下一步是生成密钥并修改OpenDKIM配置文件的权限。 + + opendkim-genkey -r -s mail [-t] + chown -Rv opendkim:opendkim /etc/opendkim + chmod 0600 /etc/opendkim/* + chmod 0700 /etc/opendkim + +一开始,最好使用-t开关,这样会通知其他邮件服务器你只是在测试模式下,这样他们就不会丢弃基于你的OpenDKIM签名的邮件(目前来说)。你可以从mail.txt文件里看到OpenDKIM密钥: + + cat mail.txt + +然后把它作为一个TXT记录添加到区域文件里,应该是这样的 + + mail._domainkey.cloud1984.net. 300 IN TXT v=DKIM1; k=rsa; p=MIGfMA0GCSqG... + +最后,我们需要告诉postfix来为发出的邮件签名。在文件/etc/postfix/main.cf末尾,添加: + + # Now for OpenDKIM: we'll sign all outgoing emails + smtpd_milters = inet:127.0.0.1:8891 + non_smtpd_milters = $smtpd_milters + milter_default_action = accept + +然后重启相关服务 + + service postfix reload + service opendkim restart + +现在让我们测试一下能找到我们的OpenDKIM公钥并和私钥匹配: + + opendkim-testkey -d jhausse.net -s mail -k mail.private -vvv + +这个应该返回 + + opendkim-testkey: key OK + +这个你可能需要等一会直到域名服务器重新加载该区域(对于Linode,每15分钟会更新一次)。你可以用**dig**来检查区域是否已经重新加载。 + +如果这个没问题,让我们测试一下其他服务器能验证我们的OpenDKIM签名和SPF记录。要做这个,我们可以用[Brandon Checkett的邮件测试][34]。发送一封邮件到[Brandon的网页][34]上提供的测试地址,我们可以在服务器上运行下面的命令 + + mail -s CloudCheck ihAdmTBmUH@www.brandonchecketts.com + +在Brandon的网页上,我们应该可以在'DKIM Signature'部分里看到**result = pass**的文字,以及在'SPF Information'部分看到**Result: pass**的文字。如果我们的邮件通过这个测试,只要不加-t开关重新生成OpenDKIM密钥,上传新的密钥到区域文件里,然后重新测试检查是否仍然可以通过这些测试。如果可以的话,恭喜!你已经在你的服务器上成功配置好OpenDKIM和SPF了! + +### 使用Owncloud提供日历,联系人,文件服务并通过Roundcube配置网页邮件 ### + +既然我们已经拥有了一流的邮件服务器,让我们再为它增加在云上保存通讯录,日程表和文件的能力。这些是[Owncloud][35]所提供的非常赞的服务。在这个弄好后,我们还会设置一个网页邮件,这样就算你没带任何电子设备出去旅行时,或者说在你的手机或笔记本没电的情况下,也可以检查邮件。 + +安装Owncloud非常直观,而且在[这里][36]有非常好的介绍。在Debian系统里,归根结底就是把owncloud的仓库添加到apt源里,下载Owncloud的发行密钥并安装到apt钥匙链中,然后通过apt-get安装Owncloud: + + echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list + wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/Release.key + apt-key add - < Release.key + apt-get update + apt-get install apache2 owncloud roundcube + +在有提示的时候,选择**dbconfig**然后说你希望**roundcube**使用**mysql**。然后,提供一下mysql的root密码并为roundcube的mysql用户设置一个漂亮的密码。然后,按如下方式编辑roundcube的配置文件**/etc/roundcube/main.inc.php**,这样登录roundcube默认会使用你的IMAP服务器: + + $rcmail_config['default_host'] = 'ssl://localhost'; + $rcmail_config['default_port'] = 993; + +现在我们来配置一下apache2网页服务器增加SSL支持,这样我们可以和Owncloud和Roundcube对话时使用加密的方式传输我们的密码和数据。让我们打开Apache的ssl模块: + + a2enmod ssl + +然后编辑文件**/etc/apache2/ports.conf**并设定以下参数: + +NameVirtualHost *:80 +Listen 80 +ServerName www.jhausse.net + + + # If you add NameVirtualHost *:443 here, you will also have to change + # the VirtualHost statement in /etc/apache2/sites-available/default-ssl + # to + # Server Name Indication for SSL named virtual hosts is currently not + # supported by MSIE on Windows XP. + NameVirtualHost *:443 + Listen 443 + + + + Listen 443 + + +我们将在目录**/var/www**下为服务器加密连接**https://www.jhausse.net**设定一个默认网站。编辑文件**/etc/apache2/sites-available/default-ssl**: + + + ServerAdmin webmaster@localhost + + DocumentRoot /var/www + ServerName www.jhausse.net + [...] + + Deny from all + + [...] + SSLCertificateFile /etc/ssl/certs/cloud.crt + SSLCertificateKeyFile /etc/ssl/private/cloud.key + [...] + + +然后让我们同时也在目录**/var/www**下设定一个非加密连接**http://www.jhausse.net**的默认网站。编辑文件**/etc/apache2/sites-available/default**: + + + DocumentRoot /var/www + ServerName www.jhausse.net + [...] + + Deny from all + + + +这样的话,我们通过把文件放到/var/www目录下让www.jhausse.net使用它们提供网站服务。名叫'Deny from all'的指令可以阻止通过www.jhausse.net访问Owncloud:我们将设定通过**https://cloud.jhausse.net**来正常访问。 + +现在我们将设定网页邮件(roundcube),让它可以通过网址**https://webmail.jhausse.net**来访问。编辑文件**/etc/apache2/sites-available/roundcube**并写入以下内容: + + + + ServerAdmin webmaster@localhost + + DocumentRoot /var/lib/roundcube + # The host name under which you'd like to access the webmail + ServerName webmail.jhausse.net + + Options FollowSymLinks + AllowOverride None + + + ErrorLog ${APACHE_LOG_DIR}/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined + + # SSL Engine Switch: + # Enable/Disable SSL for this virtual host. + SSLEngine on + + # do not allow unsecured connections + # SSLRequireSSL + SSLCipherSuite HIGH:MEDIUM + + # A self-signed (snakeoil) certificate can be created by installing + # the ssl-cert package. See + # /usr/share/doc/apache2.2-common/README.Debian.gz for more info. + # If both key and certificate are stored in the same file, only the + # SSLCertificateFile directive is needed. + SSLCertificateFile /etc/ssl/certs/cloud.crt + SSLCertificateKeyFile /etc/ssl/private/cloud.key + + # Those aliases do not work properly with several hosts on your apache server + # Uncomment them to use it or adapt them to your configuration + Alias /program/js/tiny_mce/ /usr/share/tinymce/www/ + + # Access to tinymce files + + Options Indexes MultiViews FollowSymLinks + AllowOverride None + Order allow,deny + allow from all + + + + Options +FollowSymLinks + # This is needed to parse /var/lib/roundcube/.htaccess. See its + # content before setting AllowOverride to None. + AllowOverride All + order allow,deny + allow from all + + + # Protecting basic directories: + + Options -FollowSymLinks + AllowOverride None + + + + Options -FollowSymLinks + AllowOverride None + Order allow,deny + Deny from all + + + + Options -FollowSymLinks + AllowOverride None + Order allow,deny + Deny from all + + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + # SSL Protocol Adjustments: + # The safe and default but still SSL/TLS standard compliant shutdown + # approach is that mod_ssl sends the close notify alert but doesn't wait for + # the close notify alert from client. When you need a different shutdown + # approach you can use one of the following variables: + # o ssl-unclean-shutdown: + # This forces an unclean shutdown when the connection is closed, i.e. no + # SSL close notify alert is send or allowed to received. This violates + # the SSL/TLS standard but is needed for some brain-dead browsers. Use + # this when you receive I/O errors because of the standard approach where + # mod_ssl sends the close notify alert. + # o ssl-accurate-shutdown: + # This forces an accurate shutdown when the connection is closed, i.e. a + # SSL close notify alert is send and mod_ssl waits for the close notify + # alert of the client. This is 100% SSL/TLS standard compliant, but in + # practice often causes hanging connections with brain-dead browsers. Use + # this only for browsers where you know that their SSL implementation + # works correctly. + # Notice: Most problems of broken clients are also related to the HTTP + # keep-alive facility, so you usually additionally want to disable + # keep-alive for those clients, too. Use variable "nokeepalive" for this. + # Similarly, one has to force some clients to use HTTP/1.0 to workaround + # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and + # "force-response-1.0" for this. + BrowserMatch "MSIE [2-6]" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + # MSIE 7 and newer should be able to use keepalive + BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown + + + +然后在你的DNS服务商那里声明一下服务器,例如: + + webmail.jhausse.net. 300 IN CNAME cloud.jhausse.net. + +现在让我激活这三个网站 + + a2ensite default default-ssl roundcube + service apache2 restart + +关于网页邮件,可以通过网址**https://webmail.jhausse.net**来访问,基本上能工作。之后使用邮箱全名(例如roudy@jhausse.net)和在本文一开始在邮件服务器数据库里设定的密码登录。第一次连接成功,浏览器会警告说证书没有可靠机构的签名。这个没什么关系,只要添加一个例外。 + +最后但很重要的是,我们将通过把以下内容你哦个写入**/etc/apache2/sites-available/owncloud**来为Owncloud创建一个虚拟主机。 + + + + ServerAdmin webmaster@localhost + + DocumentRoot /var/www/owncloud + ServerName cloud.jhausse.net + + Options FollowSymLinks + AllowOverride None + + + Options Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + + + ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ + + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + Order allow,deny + Allow from all + + + ErrorLog ${APACHE_LOG_DIR}/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined + + # SSL Engine Switch: + # Enable/Disable SSL for this virtual host. + SSLEngine on + + # do not allow unsecured connections + # SSLRequireSSL + SSLCipherSuite HIGH:MEDIUM + SSLCertificateFile /etc/ssl/certs/cloud.crt + SSLCertificateKeyFile /etc/ssl/private/cloud.key + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + + BrowserMatch "MSIE [2-6]" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + # MSIE 7 and newer should be able to use keepalive + BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown + + + +然后通过执行以下命令激活Owncloud + + a2ensite owncloud + service apache2 reload + +之后通过在浏览器里打开链接**https://cloud.jhausse.net/**配置一下Owncloud。 + +就这些了!现在你已经拥有自己的Google Drive,日程表,联系人,Dropbox,以及Gmail!好好享受下新鲜恢复保护的隐私吧!:-) + +### 在云上同步你的设备 ### + +要同步你的邮件,你可以只是用你喜欢的邮件客户端:Android或iOS自带的默认邮件应用,[k9mail][37],或者电脑上的Thunderbird。或者你也可以使用我们设置好的网页邮件。 + +在Owncloud的文档里描述了如何与云端同步你的日程表和联系人。在Android系统中,我用的是CalDAV-Sync,CardDAV-Sync应用桥接了手机上Android自带日历以及联系人应用和Owncloud服务器。 + +对于文件,有一个叫Owncloud的Android应用可以访问你手机上的文件,然后自动把你拍的图片和视频上传到云中。在你的Mac/PC上访问云端文件也很容易,在[Owncloud文档里有很好的描述][38]。 + +### 最后一点提示 ### + +在上线后的前几个星期里,最好每天检查一下日志**/var/log/syslog**和**/var/log/mail.log**以保证一切都在顺利运行。在你邀请其他人(朋友,家人,等等)加入你的服务器之前这很重要。他们信任你能很好地架设个人服务器维护他们的数据,但是如果服务器突然崩溃会让他们很失望。 + +要添加另一个邮件用户,只要在数据库**mailserver**的**virtual_users**表中增加一行。 + +要添加一个域名,只要在**virtual_domains**表中增加一行。然后更新**/etc/opendkim/SigningTable**为发出的邮件签名,上传OpenDKIM密钥到服务器区域,然后吃哦更年期OpenDKIM服务。 + +Owncloud有自己的用户数据库,在用管理员帐号登录后可以修改。 + +最后,万一在服务器临时崩溃的时候想办法找解决方案很重要。比如说,在服务器恢复之前你的邮件应该送往哪儿?一种方式是找个能帮你做备份MX的朋友,同时你也可以当他的备份MX(看下postfix的配置文件**main.cf**里**relay_domains**和**relay_recipient_maps**里的设定)。与此类似,如果你的服务器被破解然后一个坏蛋把你所有文件删了怎么办?对于这个,考虑增加一个常规备份系统就很重要了。Linode提供了备份选项。在1984.is里,我用crontabs和scp做了一个基本但管用的自动备份系统。 + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/ + +作者:[Roudy Jhausse ][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:aboutlinux@free.fr +[1]:https://history.google.com/history/ +[2]:http://research.google.com/workatgoogle.html +[3]:http://www.attac.org/ +[4]:http://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewanted=all +[5]:http://vimeo.com/ondemand/termsandconditions +[6]:http://www.techtimes.com/articles/21670/20141208/sony-pictures-hack-nightmare-week-celebs-data-leak-and-threatening-emails-to-employees.htm +[7]:http://blog.backupify.com/2012/07/25/what-is-my-gmail-account-really-worth/ +[8]:http://adage.com/article/digital/worth-facebook-google/293042/ +[9]:http://vimeo.com/ondemand/termsandconditions +[10]:https://prism-break.org/en/ +[11]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#VPS +[12]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#mail +[13]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#dspam +[14]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#SPF +[15]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#owncloud +[16]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#sync +[17]:http://linuxfr.org/news/heberger-son-courriel +[18]:http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/ +[19]:http://www.1984.is/ +[20]:http://www.linode.com/ +[21]:http://www.greenpeace.org/international/Global/international/publications/climate/2012/iCoal/HowCleanisYourCloud.pdf +[22]:http://www.1984.is/about/ +[23]:http://www.fsf.org/ +[24]:https://www.gnupg.org/ +[25]:http://www.gandi.net/ +[26]:http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html +[27]:http://www.postfix.org/ +[28]:http://postgrey.schweikert.ch/ +[29]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#testPort25 +[30]:http://dspam.sourceforge.net/ +[31]:http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/ +[32]:https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/#PTR +[33]:http://opendkim.org/opendkim-README +[34]:http://www.brandonchecketts.com/emailtest.php +[35]:http://owncloud.org/ +[36]:http://owncloud.org/install/ +[37]:https://code.google.com/p/k9mail/ +[38]:http://doc.owncloud.org/server/7.0/user_manual/files/files.html diff --git a/translated/tech/20150121 How to Monitor Network Usage with nload in Linux.md b/translated/tech/20150121 How to Monitor Network Usage with nload in Linux.md new file mode 100644 index 0000000000..9b70fa4d8e --- /dev/null +++ b/translated/tech/20150121 How to Monitor Network Usage with nload in Linux.md @@ -0,0 +1,196 @@ +在linux中如何通过nload来监控网络使用情况 +================================================================================ +nload 是一个免费的linux工具,通过提供两个简单的图形化界面来帮助linux用户和系统管理员来实时监控网络流量以及宽带使用情况:一个作为进入流量,一个作为流出流量. + +我是真的很喜欢用**nload**来在屏幕上显示当前的下载速度,总的流入量和平均下载速度等信息。nload工具的报告图非常容易理解,最重要的是这些信息真的非常有用。 + + + +在使用手册上说到,在默认情况下会监控所有网络设备。但是你可以轻松地指定你想要监控的设备,而且可以可以通过方向键头在不同的网络设备之间进行转换。另外还有很多的选项可用,例如 ‘-r’选项确定以毫秒来刷新显示时间间隔(默认时间间隔值是500毫秒),‘-m’选项用来实时显示多个设备(流量图在使用该选项时不会显示), ‘-u’选项用来设置显示流量数字的单元类型,另外还有许多其他的选项将会在该教程中探索和练习。 + +### 如何将 nload安装到你的linux机器上 ### + +**Ubuntu** 和 **Fedora** 用户可以从默认的软件仓库中容易地安装。 + +在Ubuntu上使用以下命令进行安装。 + + sudo apt-get install nload + +在Fedora上使用以下命令进行安装。 + + sudo yum install nload + +**CentOS**用户该怎么办呢? 只需要在你的机器上输入以下命令,通用能够达到相同的结果--殊途同归。 + + sudo yum install nload + +以下的命令会帮助你在OpenBSD系统中安装nload. + + sudo pkg_add -i nload + +linux机器上的另外一个非常有效的安装软件的方式就是编译源代码,通过下载并安装最新的版本意味着能够获得更好地性能,更酷的特性以及越少的bug数。 + +### 如何通过源代码安装nload ### + +在从源代码安装nload之前,你需要首先下载源代码。 我通常使用wget工具来进行下载--该工具在许多linux机器上默认可用。该免费工具帮助用户以非交互式的方式从网络上下载文件,并支持以下协议: + +- HTTP +- HTTPS +- FTP + +通过以下命令来进入到**/tmp**目录中。 + + cd /tmp + +然后在你的终端中输入以下命令就可以将最新版本的nload下载到你的linux机器上了。 + + wget http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz + +如果你不喜欢使用wget工具,也可以通过简单的一个鼠标点击轻松地从[官网][1]上下载源代码。 + +由于该软件非常轻巧,其下载过程几乎在瞬间就会完成。接下来的步骤就是通过**tar**工具来将下载的源代码包进行解压。 + +tar归档工具可以用来从磁带或硬盘文档中存储或解压文件,该工具具有许多可用的选项,但是我们只需要下面的几个选项来执行我们的操作。 + +1. **-x** to extract files from an archive +1. **-x** 从文档中解压文件 +1. **-v** to run in verbose mode +1. **-v** 使用繁琐模式运行--用来输入详细信息 +1. **-f** to specify the files +1. **-f** 用来指定文件 + +例如: + + tar xvf example.tar + +现在你学会了如何使用tar工具,我可以非常肯定你会知道如何从命令行中解压.tar文档。 + + tar xvf nload-0.7.4.tar.gz + +之后使用cd命令来进入到nload*目录中 + + cd nload* + +在我的系统上看起来是这样的 + + oltjano@baby:/tmp/nload-0.7.4$ + +然后运行下面这个命令来为你的系统配置包 + + ./configure + +此时会有一大波僵尸会在你的屏幕上显示出来,下面的一个屏幕截图描述了它的样子。 + +![configuring packages for nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload1.png) + +在上述命令完成之后,通过下面的命令来编译nload。 + + make + +![compiling nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload2.png) + +好了,终于....,下载通过以下命令可以将nload安装在你的机器上了。 + + sudo make install + +![installing nload from source](http://blog.linoxide.com/wp-content/uploads/2015/01/nload3.png) + +安装好nload之后就是时间来让你学习如何使用它了。 + +###如何使用nload### + +我喜欢探索,所以在你的终端输入以下命令. + + nload + +看到了什么? + +我得到了下面的结果。 + +![running nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.png) + +如上述截图可以看到,我得到了以下信息: +### 流入量### + +#### 当前下载速度#### +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.1.png) + +#### 平均下载速度#### +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.2.png) + +#### 最小下载速度#### +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.3.png) + +#### 最大下载速度#### +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.4.png) + +#### 总的流入量按字节进行显示#### +![](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.5.png) + +### 流出量 ### + +类似的同样适用于流出量 +#### 一些nload有用的选项#### + +使用选项 + -u + +用来设置显示流量单元的类型. + +下面的命令会帮助你使用MBit/s显示单元 + nload -u m + +下面的屏幕截图显示了上述命令的结果. +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload5.png) + +尝试以下命令然后看看有什么结果. + + nload -u g + +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload6.png) + +同时还有一个**-U**选项.根据手册描述,该选项基本上与-u选项类似,只是用在合计数据. 我测试了这个命令,老实说,当你需要检查总的流入与流出量时非常有用. + + nload -U G + +![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload7.png) + +从上面的截图中可以看到,**nload -U G** 使用Gbyte来显示数据总量. + +另外一个我喜欢使用的有用选项是 **-t**. 该选项用来设置刷新显示事件间隔为毫秒,默认值为500毫秒. + +我会通过下面的命令做一些小的实验. + nload -t 130 + +那么上述命令做了什么呢,它讲刷新显示时间间隔设置为130毫秒. 通常推荐不要讲该时间间隔值设置为小于100毫秒,因为nload在计算过程中可能会生成带错的报告. + +另外的一个选项为 **-a**. 在你想要设置计算平均值的时间窗口秒数长度时使用,默认该值为300秒. + +那么当你想要监控指定的网络设备该如何呢? 非常容易, 想下面这样简单地指定设备或者列出想要监控的设备列表. + + nload wlan0 + +![nload monitoring wlan0 on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png) + +下面的语法可帮助你监控指定的多个设备. + + nload [options] device1 device2 devicen + +例如,使用下面的命令来监控eth0和eth1. + + nload wlan0 eth0 + +如果不带选项来运行nload,那么它会监控监控所有自动检测到的设备,你可以通过左右方向键来显示其中的任何一个设备的信息. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/monitoring-2/monitor-network-usage-nload/ + +作者:[Oltjano Terpollari][a] +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/oltjano/ +[1]:http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz diff --git a/translated/tech/20150121 How to apply image effects to pictures on Raspberry Pi.md b/translated/tech/20150121 How to apply image effects to pictures on Raspberry Pi.md new file mode 100644 index 0000000000..f767522855 --- /dev/null +++ b/translated/tech/20150121 How to apply image effects to pictures on Raspberry Pi.md @@ -0,0 +1,71 @@ +如何在树莓派上使用图片特效 +================================================================================ +现在使用[树莓派摄像头模组][1]("raspi cam"),也可以像使用卡片相机那样,给拍摄的照片增加各种各样的图片特效。 raspistill命令行工具,为您的树莓派提供了丰富的图片特效选项,来美化处理你的图片。 + +你可以用[这3个命令行工具][2]来[抓取raspicam拍摄的照片或者视频][3],在这文章中将重点介绍其中的raspstill工具。raspstill工具提供了丰富的控制选项来处理图片,比如说:锐度(sharpness)、对比度(contrast)、亮度(brightness)、饱和度(saturation)、ISO、自动白平衡(AWB)、以及图片特效(image effect)等。 + +在这篇文章中,将介绍如何使用raspstill工具以及raspicam摄像头模组来控制照片的曝光、AWB以及其他的图片效果。我写了一个简单的python脚本来自动拍摄照片并在这些照片上自动应用各种图片特效。raspicam的帮助文档中介绍了该摄像头模组所支持的曝光模式、AWB和图片特效。总的来说,raspicam一共支持16种图片特效、12种曝光模式以及10种AWB选项。 + +Python脚本很简单,如下所示 。 + + #!/usb/bin/python + import os + import time + import subprocess + list_ex=['auto','night'] + list_awb=['auto','cloud',flash'] + list_ifx=['blur','cartoon','colourswap','emboss','film','gpen','hatch','negative','oilpaint','posterise','sketch','solarise','watercolour'] + x=0 + for ex in list_ex: + for awb in list_awb: + for ifx in list_ifx: + x=x+1 + filename='img_'+ex+'_'+awb+'_'+ifx+'.jpg' + cmd='raspistill -o '+filename+' -n -t 1000 -ex '+ex+' -awb '+awb+' -ifx '+ifx+' -w 640 -h 480' + pid=subprocess.call(cmd,shell=True) + print "["+str(x)+"]-"+ex+"_"+awb+"_"+ifx+".jpg" + time.sleep(0.25) + print "End of image capture" + +The Python script operates as follows. First, create three array/list variable for the exposure, AWB and image effects. In the example, we use 2 types of exposure, 3 types of AWB, and 13 types of image effects values. Then make nested loops for applying the value of the three variables that we have. Inside the nested loop, execute the raspistill application. We specify (1) the output filename; (2) exposure value; (3) AWB value; (4) image effect value; (5) the time to take a photo, which is set to 1 second; and (6) the size of the photo, which is set to 640x480px. This Python script will create 78 different versions of a captured photo with a combination of 2 types of exposure, 3 types of AWB, and 13 types of image effects. + +这个脚本完成了以下几个工作。首先,脚本中定义了3个列表,分别用于枚举曝光模式、AWB模式以及图片特效。在这个实例中,我们将使用到2种曝光模式、3种AWB模式以及13种图片特效。脚本会遍历上述3种选项的各种组合,并使用这些参数组合来运行raspistill工具。传入的参数共6个,分别为:(1)输出文件名;(2)曝光模式;(3)AWB模式;(4)图片特效模式;(5)拍照时间,设为1秒;(6)图片尺寸,设为640x480。脚本会自动拍摄78张照片,每张照片会应用不同的特效参数。 + +执行这个脚本也很简单,只需键入下面的命令行: + + $ python name_of_this_script.py + +下面是抓取到一些样张。 + +![](https://farm8.staticflickr.com/7483/16134215939_c93291158a_c.jpg) + +### 小福利 ### + +除了使用raspistill命令行工具来操控raspicam摄像模组以外,还有其他的方法可以用哦。[Picamera][4]是一个python库,它提供了操控raspicam摄像模组的的API接口,这样就可以便捷地构建更加复杂的应用程序。如果你精通python,那么picamera一定是你项目的好伙伴。picamera已经被默认集成到Raspbian最新版本的的镜像中。当然,如果你用的不是最新的Raspbian或者是使用其他的操作系统版本,你可以通过下面的方法来进行手动安装。 + +首先,先在你的系统上安装pip,详见[指导][6]。 + +然后,就可以按下面的方法安装picamera。 + + $ sudo pip install picamera + +picamera的使用说明可以查阅[官方文档][7]。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/apply-image-effects-pictures-raspberrypi.html + +作者:[Kristophorus Hadiono][a] +译者:[coloka](https://github.com/coloka) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/kristophorus +[1]:http://xmodulo.com/go/picam +[2]:http://www.raspberrypi.org/documentation/usage/camera/raspicam/ +[3]:http://xmodulo.com/install-raspberry-pi-camera-board.html +[4]:https://pypi.python.org/pypi/picamera +[5]:http://xmodulo.com/go/raspberrypi +[6]:http://ask.xmodulo.com/install-pip-linux.html +[7]:http://picamera.readthedocs.org/ \ No newline at end of file diff --git a/translated/tech/20150122 Linux FAQs with Answers--How to use yum to download a RPM package without installing it.md b/translated/tech/20150122 Linux FAQs with Answers--How to use yum to download a RPM package without installing it.md new file mode 100644 index 0000000000..a9f1019c19 --- /dev/null +++ b/translated/tech/20150122 Linux FAQs with Answers--How to use yum to download a RPM package without installing it.md @@ -0,0 +1,55 @@ +Linux 常见问题解答--如何使用yum来下载RPM包而不进行安装. +================================================================================ +> **问题**:我想从Red Hat's的标准仓库中下载一个RPM包,我能使用yum命令来下载一个RPM包但是不进行安装吗? + +yum是基于Red Hat的系统(如CentOS,Fedora,RHEl)上的默认包管理器.使用yum,你可以安装或者更新一个RPM包,并且他会自动解决包依赖关系.但是如果你只想将一个RPM包下载到你的系统上该怎么办呢? 例如,你可能想要获取一些RPM包在以后使用,或者将他们安装在另外的机器上. + +这里说明了如何从yum仓库上下载一个RPM包. + +### 方法一:yum### + +yum命令本身就可以用来下载一个RPM包,标准的yum命令提供了`--downloadonly(只下载)`的选项来达到这个目的. + + $ sudo yum install --downloadonly + +默认情况下,一个下载的RPM包会保存在下面的目录中: + + /var/cache/yum/x86_64/[centos/fedora-version]/[repository]/packages + +以上的[repository]表示下载包的来源仓库的名称(例如,base,fedora,updates) + +如果你想要讲一个包下载到一个指定的目录(如/tmp): + + $ sudo yum install --downloadonly --downloaddir=/tmp + +注意,如果下载的包包含了任意没有满足的依赖关系,yum将会把所有的依赖关系包下载,但是都不会被安装. + +另外一个重要的事情时,在CentOS/RHEL 6或更早期的版本中,你需要安装一个单独yum插件(名称为 yum-plugin-downloadonly)才能使用`--downloadonly`命令选项: + + $ sudo yum install yum-plugin-downloadonly + +如果没有该插件,你会在使用yum时得到以下错误: + + Command line error: no such option: --downloadonly + +![](https://farm9.staticflickr.com/8627/15571201803_38390aae75_c.jpg) + +### 方法二: Yumdownloader### +另外一个下载RPM包的方法就是通过一个专门的包下载工具--yumdownloader. 这个工具时yum工具包(包含了用来进行yum包管理的帮助工具套件)的子集. + + $ sudo yum install yum-utils + +下载一个RPM包: + + $ sudo yumdownloader + +下载的包会被保存在当前目录中.你需要使用root权限,因为yumdownloader会在下载过程中更新包索引文件.与yum命令不同的是,任何依赖包不会被下载. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/yum-download-rpm-package.html + +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150126 Improve system performance by moving your log files to RAM Using Ramlog.md b/translated/tech/20150126 Improve system performance by moving your log files to RAM Using Ramlog.md new file mode 100644 index 0000000000..66f5d72f87 --- /dev/null +++ b/translated/tech/20150126 Improve system performance by moving your log files to RAM Using Ramlog.md @@ -0,0 +1,111 @@ +系统性能优化支招:使用Ramlog将日志文件转移到RAM +================================================================================ +Ramlog以系统守护进程的形式存在。它系统启动的时候创建了虚拟磁盘(ramdisk),将文件从目录/var/log复制到虚拟磁盘中,同时把虚拟磁盘挂载为/var/log。接着更新虚拟磁盘上所有的日志。硬盘上的日志会保留在目录/var/log中,直到ramlog重启或停止时被更新。而关机的时候,(ramdisk上的)日志文件会重新保存到硬盘上,以确保日志一致性。Ramlog 2.x默认使用tmpfs文件系统,同时也可以支持ramfs和内核ramdisk。使用rsync(译注:Linux数据镜像备份工具)这个工具来同步日志。 + +注意:没有保存进硬盘的日志将在断电或者内核混乱(kernel panic)的情况下丢失。 + +如果你拥有空间足够的可用内存,而又想把日志放进虚拟磁盘,就安装ramlog吧。它是笔记本用户、UPS系统或是直接在flash中运行的系统节省写周期的优良选择。 + +Ramlog的运行机制以及步骤: + +1.Ramlog在第一个守护进程(这取决于你所安装过的其它守护进程)的基础上启动。 + +2.然后创建目录/var/log.hdd并将其硬链至/var/log。 + +3.如果使用的是tmpfs(默认)或者ramfs之一的文件系统,将其挂载到/var/log上。 + +而如果使用的是内核ramdisk,ramdisk将在/dev/ram9中创建,并将挂载至/var/log。默认情况下ramlog会占用所有ramdisk的内存,其大小由内核参数"ramdisk_size"指定。 + +5.接着其它的守护进程被启动,并在ramdisk中更新日志。Logrotate(译注:Linux日志轮替工具)也是在ramdiks之上运行。 + +6.重启(默认一天一次)ramlog时,目录/var/log.hdd将借助rsync与/var/log保持同步。日志自动保存的频率可以通过cron(译注:Linux例行性工作调度)来控制。默认情况下,ramlog文件放置在目录/etc/cron.daily下。 + +7.系统关机时,ramlog在最后一个守护进程关闭之前关闭。 + +在ramlog关闭期间,/var/log.hdd中的文件将被同步至/var/log,接着/var/log和/var/log.hdd都被卸载,然后删除空目录/var/log.hdd。 + +**注意:- 此文仅面向高级用户** + +### 在Ubuntu中安装Ramlog ### + +首先需要用以下命令,从[这里][1]下载.deb安装包: + + wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb + +下载ramlog_2.0.0_all.deb安装包完毕,使用以下命令进行安装: + + sudo dpkg -i ramlog_2.0.0_all.deb + +这一步会完成整个安装,现在你需要运行以下命令: + + sudo update-rc.d ramlog start 2 2 3 4 5 . stop 99 0 1 6 . + +#现在,在初始状态下升级sysklogd,使之能在ramlog停止运行前正确关闭: + + sudo update-rc.d -f sysklogd remove + + sudo update-rc.d sysklogd start 10 2 3 4 5 . stop 90 0 1 6 . + +然后重启系统: + + sudo reboot + +系统重启完毕,运行'ramlog getlogsize'获取/var/log的空间大小。在此基础之上多分配40%的空间,确保ramdisk有足够的空间(这整个都将作为ramdisk的空间大小)。 + +编辑引导配置文件,如/etc/grub.conf,、/boot/grub/menu.lst 或/etc/lilo.conf(译注:具体哪个配置文件视不同引导加载程序而定),kernel参数新增项'ramdisk_size=xxx'以更新当前内核,其中xxx是ramdisk的空间大小。 + +### 配置Ramlog ### + +基于deb的系统中,Ramlog的配置文件位于/etc/default/ramlog,你可以在该目录下设置以下变量: + +Variable (with default value): + +Description: + + RAMDISKTYPE=0 + # Values: + # 0 -- tmpfs (can be swapped) -- default + # 1 -- ramfs (no max size in older kernels, + # cannot be swapped, not SELinux friendly) + # 2 -- old kernel ramdisk + TMPFS_RAMFS_SIZE= + #Maximum size of memory to be used by tmpfs or ramfs. + # The value can be percentage of total RAM or size in megabytes -- for example: + # TMPFS_RAMFS_SIZE=40% + # TMPFS_RAMFS_SIZE=100m + # Empty value means default tmpfs/ramfs size which is 50% of total RAM. + # For more options please check ‘man mount', section ‘Mount options for tmpfs' + # (btw -- ramfs supports size limit in newer kernels + # as well despite man says there are no mount options) + # It has only effect if RAMDISKTYPE=0 or 1 + KERNEL_RAMDISK_SIZE=MAX + #Kernel ramdisk size in kilobytes or MAX to use entire ramdisk. + #It has only effect if RAMDISKTYPE=2 + LOGGING=1 + # 0=off, 1=on Logs can be found in /var/log/ramdisk + LOGNAME=ramlog + # name of the ramlog log file (makes sense if LOGGING=1) + VERBOSE=1 + # 0=off, 1=on (if 1, teststartstop puts detials + # to the logs and it is called after start or stop fails) + +### 在Ubuntu中卸载ramlog ### + +打开终端运行以下命令: + + sudo dpkg -P ramlog + +注意:如果ramlog卸载之前仍在运行,需要重启系统完成整个卸载工作。 + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/improve-system-performance-by-moving-your-log-files-to-ram-using-ramlog.html + +作者:[ruchi][a] +译者:[soooogreen](https://github.com/soooogreen) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix +[1]:http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb diff --git a/translated/tech/20150128 Docker-1 Moving to Docker.md b/translated/tech/20150128 Docker-1 Moving to Docker.md new file mode 100644 index 0000000000..36c8f16506 --- /dev/null +++ b/translated/tech/20150128 Docker-1 Moving to Docker.md @@ -0,0 +1,81 @@ +Moving to Docker +================================================================================ +![](http://cocoahunter.com/content/images/2015/01/docker1.jpeg) + +[TL;DR] 这是系列的第一篇文章,这系列讲述了我的公司如何把基础服务从PaaS迁移到Docker上。如果你愿意,你可以直接跳过介绍(这篇文章)直接看技术相关的话题(链接在页面的底部)。 + +---------- + +上个月,我一直在折腾开发环境。这是我个人故事和经验,关于尝试用Docker简化Rails应用的部署过程。 + +当我在2012年创建我的公司 – [Touchware][1]时,我还是一个独立开发者。很多事情很小,不复杂,不他们需要很多维护,他们也不需要不部署到很多机器上。经过过去一年的发展,我们成长了很多(我们现在是是拥有10个人团队)而且我们的服务端的程序和API无论在范围和规模方面都有增长。 + +### 第1步 - Heroku ### + +我们还是个小公司,我们需要让事情运行地尽可能平稳。当我们寻找可行的解决方案时,我们打算坚持用那些可以帮助我们减轻对硬件依赖负担的工具。由于我们主要开发Rails应用,而Heroku对RoR,常用的数据库和缓存(Postgres/Mongo/Redis等)有很好的支持,最明智的选择就是用[Heroku][2] 。我们就是这样做的。 + +Heroku有很好的技术支持和文档,使得部署非常轻松。唯一的问题是,当你处于起步阶段,你需要很多开销。这不是最好的选择,真的。 + +### 第2步 - Dokku ### + +为了尝试并降低成本,我们决定试试Dokku。[Dokku][3],引用GitHub上的一句话 + +> Docker powered mini-Heroku in around 100 lines of Bash + +我们启用的[DigitalOcean][4]上的很多台机器,都预装了Dokku。Dokku非常像Heroku,但是当你有复杂的项目需要调整配置参数或者是需要特殊的依赖时,它就不能胜任了。我们有一个应用,它需要对图片进行多次转换,我们无法安装一个适合版本的imagemagick到托管我们Rails应用的基于Dokku的Docker容器内。尽管我们还有很多应用运行在Dokku上,但我们还是不得不把一些迁移回Heroku。 + +### 第3步 - Docker ### + +几个月前,由于开发环境和生产环境的问题重新出现,我决定试试Docker。简单来说,Docker让开发者容器化应用,简化部署。由于一个Docker容器本质上已经包含项目运行所需要的所有依赖,只要它能在你的笔记本上运行地很好,你就能确保它将也能在任何一个别的远程服务器的生产环境上运行,包括Amazon的EC2和DigitalOcean上的VPS。 + +Docker IMHO特别有意思的原因是: + +- 它促进了模块化和分离关注点:你只需要去考虑应用的逻辑部分(负载均衡:1个容器;数据库:1个容器;web服务器:1个容器); +- 在部署的配置上非常灵活:容器可以被部署在大量的HW上,也可以容易地重新部署在不同的服务器或者提供商那; +- 它允许非常细粒度地优化应用的运行环境:你可以利用你的容器来创建镜像,所以你有很多选择来配置环境。 + +它也有一些缺点: + +- 它的学习曲线非常的陡峭(这是从一个软件开发者的角度来看,而不是经验丰富的运维人员); +- 搭建环境不简单,尤其是还需要自己搭建一个私有的registry/repository (后面有关于它的详细内容)。 + +下面是一些提示。这个系列的最后一周,我将把他们和一些新的放在一起。 + +---------- + +在下面的文章中,我们将看到如何建立一个半自动化的基于Docker的部署系统。 + +- [建立私有的Docker registry][6] +- [配置Rails应用的半自动化话部署][7] + +-------------------------------------------------------------------------------- + +via: http://cocoahunter.com/2015/01/23/docker-1/ + +作者:[Michelangelo Chasseur][a] +译者:[mtunique](https://github.com/mtunique) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://cocoahunter.com/author/michelangelo/ +[1]:http://www.touchwa.re/ +[2]:http://cocoahunter.com/2015/01/23/docker-1/www.heroku.com +[3]:https://github.com/progrium/dokku +[4]:http://cocoahunter.com/2015/01/23/docker-1/www.digitalocean.com +[5]:http://www.docker.com/ +[6]:http://cocoahunter.com/2015/01/23/docker-2/ +[7]:http://cocoahunter.com/2015/01/23/docker-3/ +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: diff --git a/translated/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md b/translated/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md new file mode 100644 index 0000000000..9a131bee9d --- /dev/null +++ b/translated/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md @@ -0,0 +1,388 @@ +Linux Shell脚本 入门25问 +================================================================================ +### Q:1 Shell脚本是什么、为什么它是必需的吗? ### + +答:一个Shell脚本是一个文本文件,包含一个或多个命令。作为系统管理员,我们经常需要发出多个命令来完成一项任务,我们可以添加这些所有命令在一个文本文件(Shell脚本)来完成日常工作任务。 + +### Q:2 什么是默认登录shell,如何改变指定用户的登录shell ### + +答:在Linux操作系统,“/ bin / bash”是默认登录shell,在用户创建时被分配的。使用chsh命令可以改变默认的shell。示例如下所示: + + # chsh -s + # chsh linuxtechi -s /bin/sh + +### Q:3 有什么不同的类型在shell脚本中使用? ### + +答:在shell脚本,我们可以使用两个类型变量: + +- 系统定义变量 +- 用户定义变量 + + +系统变量是由系统系统自己创建的。这些变量由大写字母组成,可以通过“**set**”命令查看。 + +用户变量由系统用户来生成,变量的值可以通过命令“`echo $<变量名>`”查看 + +### Q:4 如何同时重定向标准输出和错误输出到同一位置? ### + +答:这里有两个方法来实现: + +方法1:2>&1 (# ls /usr/share/doc > out.txt 2>&1 ) + +方法二:&> (# ls /usr/share/doc &> out.txt ) + +### Q:5 shell脚本中“if”的语法 ? ### + +答:基础语法: + + if [ 条件 ] + then + 命令1 + 命令2 + ….. + else + if [ 条件 ] + then + 命令1 + 命令2 + …. + else + 命令1 + 命令2 + ….. + fi + fi + +### Q:6 shell脚本中“$?”标记的用途是什么? ? ### + +答:在写一个shell脚本时,如果你想要检查前一命令是否执行成功,在if条件中使用“$?”可以来检查前一命令的结束状态。简单的例子如下: + + root@localhost:~# ls /usr/bin/shar + /usr/bin/shar + root@localhost:~# echo $? + 0 + +如果结束状态是0,说明前一个命令执行成功。 + + root@localhost:~# ls /usr/bin/share + + ls: cannot access /usr/bin/share: No such file or directory + root@localhost:~# echo $? + 2 + +如果结束状态不是0,说明命令执行失败。 + +### Q:7 在shell脚本中如何比较两个数 ? ### + +答:测试用例使用if-then来比较两个数,例子如下: + + #!/bin/bash + x=10 + y=20 + + if [ $x -gt $y ] + then + echo “x is greater than y” + else + echo “y is greater than x” + fi + +### Q:8 shell脚本中break命令的作用 ? ### + +答:break命令一个简单的用途是退出执行中的循环。我们可以在while 和until循环中使用break命令跳出循环。 + +### Q:9 shell脚本中continue命令的作用 ? ### + +答:continue命令不同于break命令,它只跳出当前循环的迭代,而不是整个循环。continue命令很多时候是很有用的,例如错误发生,但我们依然希望循环继续的时候。 + +### Q:10 告诉我shell脚本中Case语句的语法 ? ### + +答:基础语法如下: + + case 变量 in + 值1) + 命令1 + 命令2 + ….. + 最后命令 + !! + 值2) + 命令1 + 命令2 + …… + 最后命令 + ;; + esac + +### Q:11 shell脚本中while循环语法 ? ### + +答:如同for循环,while循环重复自己所有命令只要条件成立,不同于for循环。基础语法: + + while [ 条件 ] + do + 命令… + done + +### Q:12 如何使脚本成为可执行状态 ? ### + +答:使用chmod命令来使脚本可执行。例子如下: + + # chmod a+x myscript.sh + +### Q:13 “#!/bin/bash”的作用 ? ### + +答:#!/bin/bash是shell脚本的第一行,总所周知,#符号调用hash而!调用bang。它的意思是命令使用 /bin/bash来执行命令 + +### Q:14 shell脚本中for循环语法 ? ### + +答:for循环基础语法: + + for 变量 in 循环列表 + do + 命令1 + 命令2 + …. + 最后命令 + done + +### Q:15 如何调试shell脚本 ? ### + +答:使用'-x'参数(sh -x myscript.sh)可以调试shell脚本。另一个种方法是使用‘-nv’参数( sh -nv myscript.sh) + +### Q:16 shell脚本如何比较字符串? ### + +答:test命令可以用来比较字符串。Test命令比较字符串通过比较每一个字符来比较。 + +### Q:17 Bourne shell(bash) 中有哪些特别变量 ? ### + +答:下面的表列出了Bourne shell为命令行设置的特殊变量。 + + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

内建变量

+
+

解释

+
+

$0

+
+

来自命令行脚本的名字

+
+

$1

+
+

第一个命令行参数

+
+

$2

+
+

第二个命令行参数

+
+

…..

+
+

…….

+
+

$9

+
+

第九个命令行参数

+
+

$#

+
+

命令行参数的数量

+
+

$*

+
+

所有命令行参数,以空格隔开

+
+ +### Q:18 How to test files in a shell script ? ### +### Q:18 在shell脚本中,如何测试文件 ? ### + +答:test命令可以用来测试文件。基础用法如下表格: + + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Test

+
+

用法

+
+

-d 文件名

+
+

返回true,如果文件存在并且是一个目录

+
+

-e 文件名

+
+

返回true,如果文件存在

+
+

-f 文件名

+
+

返回true,如果文件存在并且是普通文件

+
+

-r 文件名

+
+

返回true,如果文件存在并拥有读权限

+
+

-s 文件名

+
+

返回true,如果文件存在并且不为空

+
+

-w 文件名

+
+

返回true,如果文件存在并拥有写权限

+
+

-x 文件名

+
+

返回true,如果文件存在并拥有执行权限

+
+ +### Q:19 在shell脚本中,如何写入注释 ? ### + +答:注释可以用来描述一个脚本可以做什么和它是如何工作的。每一个注释以#开头。例子如下: + + #!/bin/bash + # This is a command + echo “I am logged in as $USER” + +### Q:20 如何得到来自终端的命令输入到shell脚本? ### + +答:read命令可以读取来自终端(使用键盘)的数据。read命令接入用户的输入并置于变量中。例子如下: + + # vi /tmp/test.sh + + #!/bin/bash + echo ‘Please enter your name’ + read name + echo “My Name is $name” + + # ./test.sh + Please enter your name + LinuxTechi + My Name is LinuxTechi + +### Q:21 如何取消设置或取消变量 ? ### + +答:“unset”命令用于去取消或取消设置一个变量。语法如下所示: + + # unset <变量名> + +### Q:22 如何执行算术运算 ? ### + +答:有两种方法来执行算术运算: + +1.使用`expr`命令(# expr 5 + 2) +2.用一个美元符号和方括号(`$[ 表达式 ]`)例如:test=$[16 + 4] ; test=$[16 + 4] + +### Q:23 do-while语句的基本格式 ? ### + +答:do-while语句类似于while语句,但检查条件语句之前先执行命令。下面是用do-while语句的语法 + + do + { + 命令 + } while (条件) + +### Q:24 在shell脚本如何定义函数呢 ? ### + +答:函数是拥有名字的代码块。当我们定义代码块,我们就可以在我们的脚本调用名字,该块就会被执行。示例如下所示: + + $ diskusage () { df -h ; } + + 译注:下面是我给的shell函数语法,原文没有 + + [ function ] 函数名 [()] + { + + 命令; + [return int;] + + } + + +### Q:25 如何在shell脚本中使用BC(bash计算器) ? ### + +答:使用下列格式,在shell脚本中使用bc + + variable=`echo “options; expression” | bc` + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/linux-shell-scripting-interview-questions-answers/ + +作者:[Pradeep Kumar][a] +译者:[VicYu/Vic020](http://vicyu.net) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxtechi.com/author/pradeep/ diff --git a/translated/tech/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md b/translated/tech/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md new file mode 100644 index 0000000000..17349f2330 --- /dev/null +++ b/translated/tech/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md @@ -0,0 +1,37 @@ +在Ubuntu 14.04 中修复无法修复回收站[快速提示] +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/empty-the-trash.jpg) + +### 问题 ### + +**无法在Ubuntu 14.04中清空回收站的问题**。我右键回收站图标并选择清空回收站,就像我一直做的那样。我看到进度条显示删除文件中过了一段时间。但是它停止了,并且Nautilus文件管理也停止了。我不得不在终端中停止了它。 + +但是这很痛苦因为文件还在垃圾箱中。并且我反复尝试清空后窗口都冻结了。 + +### 方案 ### + +老实说,我不知道什么导致了这个问题。但是我有一个解决方案如果你在Ubuntu 14.04或者14.10遇到这个问题的话。 + +打开终端并使用下面的命令: + + sudo rm -rf ~/.local/share/Trash/* + +这里注意你的输入。你使用超级管理员权限来运行删除命令。我相信你不会删除其他文件或者目录。 + +上面的命令会删除回收站目录下的所有文件。换句话说,这是用命令清空垃圾箱。使用玩上面的命令后,你会看到垃圾箱已经清空了。如果你删除了所有文件,你不应该在看到Nautilus崩溃的问题了。 + +### 对你有用么? ### + +我希望这篇贴士对你有用,今后你也不会在Ubuntu或者其他发行版中再遇到相同的问题。如果你遇到任何问题请让我知道。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-empty-trash-ubuntu/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ diff --git a/translated/tech/20150209 How to back up a Debian system using backupninja.md b/translated/tech/20150209 How to back up a Debian system using backupninja.md new file mode 100644 index 0000000000..b58baa3bdc --- /dev/null +++ b/translated/tech/20150209 How to back up a Debian system using backupninja.md @@ -0,0 +1,110 @@ +如何使用 backupninja 来备份一个 Debian 系统 +================================================================================ +面临灾难时的小心谨慎或体验可以教会每一个系统管理采取频繁的系统备份的重要性。你可以通过编写存在已久的管用的 shell 脚本,或使用一个(或多个) 适合这项工作的备份工具来完成备份任务。因此,当你要实施一个备份解决方案时,你了解的备份工具越多,你做出的决策就会越明智。 + +在这篇文章中,我们将为你介绍 [backupninja][2] ,一个轻量且易于配置的系统备份工具。在诸如 **rdiff-backup**, **duplicity**, **mysqlhotcopy** 和 **mysqldump** 等程序的帮助下, Backupninja 可以提供常用的备份功能,如执行远程的、安全的和增量式的文件系统备份,加密备份以及 MySQL/MariaDB 数据库备份。你可以选择性地开启使用 email 进行状态报告功能,也可以对一般的硬件和系统的信息进行备份。 backupninja 的一个关键功能是它拥有一个内建的基于控制台的向导程序(被称为 **ninjahelper**),而后者允许你为不同的备份情景轻松地创建配置文件。 + +如果非要说的话,backupninja 的缺点是:为了充分使用其所有的功能,它要求一些其他“助手”程序已经被安装在了计算机中。尽管 backupninja 有针对基于 Red Hat(红帽) 的发行版本的 RPM 安装包,但 backupninja 针对 Debian 和它的衍生发行版本的依赖进行了优化。所以不建议在基于 Red Hat 的系统上尝试 backupninja 。 + +在这篇教程中,我们将介绍如何在基于 Debian 的发行版本上安装 backupninja 。 + +### 安装 Backupninja ### + +以 root 账户来运行下面的命令: + + # aptitude install backupninja + +在安装的过程中,有几个文件和目录将被创建: + +- **/usr/sbin/backupninja** 是 bash shell 主脚本; +- **/etc/cron.d/backupninja**, 默认情况下,构建 cron 任务来每隔一个小时运行上面的主脚本; +- **/etc/logrotate.d/backupninja** 处理由 backupninja 程序产生的日志;(注:我不知道这里的 rotate 该如何翻译) +- **/etc/backup.d/** 是备份操作的配置文件驻留的目录; +- **/etc/backupninja.conf** 是包含一般选项的主配置文件。这个文件带有良好的注释且详细解释了每个选项的含义; +- **/usr/share/backupninja** 是那些被 backupninja 使用的脚本所处的目录。这些脚本文件负责执行实际的工作。在这个目录中,你还可以找到 `.helper` 文件,它们可以被用来配置和设定 ninjahelper 的菜单; +- **/usr/share/doc/backupninja/examples** 含有操作配置文件(即通过 ninjahelper 产生的文件)的模板。 + +### 首次运行 Ninjahelper ### + +当我们尝试启动 ninjahelper 时,我们可以看到一个内部依赖可能会被需要。假如系统进行了提示,请输入 “yes” 并敲下回车键来安装 dialog(一个用于从 shell 脚本中显示友好对话框的工具)。 + +![](https://farm8.staticflickr.com/7537/15700597667_6618fbc142_z.jpg) + +当你在键入 yes 后再敲回车键时,backupninja 将会安装 dialog,一旦安装完成,将呈现出下面的截屏: + +![](https://farm8.staticflickr.com/7469/15884374871_29f1c9acf1_z.jpg) + +#### 案例 1: 备份硬件和系统信息 #### + +在启动了 ninjahelper 之后,我们将创建一个新的备份操作: + +![](https://farm9.staticflickr.com/8637/15885715132_eb3156678e_z.jpg) + +如果必要的助手程序没有被安装,下面的截屏将会呈现在我们眼前。假如这些软件包已经在你的系统上安装了,请跳过这一步。 + +![](https://farm8.staticflickr.com/7508/15700315139_4c6117ef32_z.jpg) + +接下来的一步需要你选取相关条目来作为此次备份任务的一部分。前四个条目已经默认被选上了,但你可以通过按空格键来撤消选择。 + +![](https://farm8.staticflickr.com/7507/15699051870_65abaf52e5_z.jpg) + +一旦你完成了上面的步骤,按 OK 选项来继续。接着你将能够选择 是愿意使用默认的配置文件(/etc/backup.d/10.sys)来完成这次备份操作,还是创建一个新的配置文件。若为后者,一个含有与默认配置文件内容相同的文件将会在相同的目录下被创建,但它被命名为 11.sys,后续的备份操作将会创建类似的文件(注:只不过命名的序号不同)。需要说明的是一旦这个新的配置文件被创建,你便可以使用你喜爱的文本编辑器来编辑该文件。 + +![](https://farm9.staticflickr.com/8654/15885715072_1e6126e929_o.png) + +#### 案例 2: 一个远程目录的增量式 Rsync 拉取备份 #### + +正如你最有可能知道的那样, rsync 被广泛地用于通过网络同步文件或文件夹。在接下来的例子中,我们将讨论一个使用硬链接来为一个远程目录做增量式拉取备份的方法,它被用来保存历史数据以及在我们本地的文件服务器中恢复这些历史数据。这个方法将帮助我们节省空间并增强位于服务器端的安全性。 + +**步骤 1**:编写一个位于 `/etc/backup.d`的带有如下内容的自定义脚本,并将它的权限设置为 600 。需要说明的是,除了一般的配置文件,这个目录可能还包含当 backupninja 被执行时你想运行的一些脚本文件,它们可以发挥出位于主配置文件中的变量的优势。 + + # REMOTE USER + user=root + # REMOTE HOST + host=dev1 + # REMOTE DIRECTORY + remotedir=/home/gacanepa/ + # LOCAL DIRECTORY + localdir=/home/gacanepa/backup.0 + # LOCAL DIRECTORY WHERE PREVIOUS BACKUP WAS STORED + localdirold=/home/gacanepa/backup.1 + mv $localdir $localdirold + # RSYNC + rsync -av --delete --recursive --link-dest=$localdirold $user@$host:$remotedir $localdir + +在上面的配置中, rsync 的 ‘--link-dest’ 选项的作用是为位于 $localdir-old 目录中那些没有改变的文件(包含所有属性) 硬链接到目标目录 ($localdir)。 + +**步骤 2**:在 backupninja 第一次运行之前,上层目录(这个例子中指的是 /home/gacanepa) 是空的。第一次我们执行下面的命令: + + # backupninja -n + +backup.0 目录就被创建了,并在接下来的过程中,它的名称将会被更改为 backup.1。 + +当我们第二次运行 backupninja 时, backup.0 将会被重新创建,而 backup.1 被保留。 + +![](https://farm8.staticflickr.com/7581/15700597497_0e0cd89ab9.jpg) + +**步骤 3**: 确保 backup.1 里面的文件硬链接到 backup.0 里的文件,我们可以通过比较文件的 inode( i 节点) 数和目录的大小来达到此目的。 + +![](https://farm9.staticflickr.com/8636/15700315029_e922ce771b.jpg) + +### 总结 ### + +Backupninja 不仅是一个经典的备份工具,它也是一个易于配置的实用程序。你可以通过编写你自己的 handler(注:我不知道该如何翻译 handler 这个单词) 来运行 backupninja 并将它们作为位于 `/etc.backup.d` 的个人配置文件。甚至你还可以为 ninjahelper 编写助手程序,以达到将它们包括在 ninjahelper 的主界面上。 + +例如,假如你在 `/usr/share/backupninja`目录中创建了一个名为 modulo 的 handler,它将自动运行那些位于 `/etc/backup.d` 目录中以 .xmodulo 为后缀的每个文件。如果你决定添加你的 xmodulo handler 到 ninjahelper 中, 你可以编写相应的助手程序,即 xmodulo.helper 。另外,假如你想 让 backupninja 运行任意一个脚本,只需把它添加到 `/etc/backup.d` 目录中,这样你的目的便可以达到了。 + +欢迎使用下面的评论框来留下你的评论、问题或建议。听到你的回应将会使我们很高兴。 +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/backup-debian-system-backupninja.html + +作者:[Gabriel Cánepa][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/gabriel +[1]:http://xmodulo.com/recommend/sysadminbook +[2]:https://labs.riseup.net/code/projects/backupninja diff --git a/translated/tech/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md b/translated/tech/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md new file mode 100644 index 0000000000..ae7968afd0 --- /dev/null +++ b/translated/tech/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md @@ -0,0 +1,101 @@ +在Ubuntu14.10/Mint7上安装Gnome Flashback classical桌面 +================================================================================ +如果你不喜欢现在的Unity桌面,[Gnome Flashback][1]桌面环境是一个简单的并且很棒的选择,让你能找回曾经经典的桌面。 + +Gnome Flashback基于GTK3并提供与原先gnome桌面视觉上相似的界面。 + +gnome flashback的另一个改变是采用了源自mint和xface的MATE桌面,但无论mint还是xface都是基于gtk2的。 + +### 安装 Gnome Flashback ### + +在你的ubuntu上安装以下包即可: + + $ sudo apt-get install gnome-session-flashback + +然后注销到达登录界面,单击密码输入框右上角的徽标型按钮,即可选择桌面环境。可供选择的有Gnome Flashback (Metacity) 会话模式和Gnome Flashback (Compiz)会话模式。 + +Metacity更轻更快,而Compiz则能带给你更棒的桌面效果。下面是我使用gnome flashback桌面的截图。 + +桌面采用了elementary OS的壁纸和Plank dock并且移除了底部面板。这些都会在这篇教程中涉及到。 + +![ubuntu gnome flashback](http://www.binarytides.com/blog/wp-content/uploads/2015/02/ubuntu-gnome-flashback.png) + +在安装好gnome flashback桌面以后也许你对效果还不满意,这样你可能需要执行接下来的一系列操作来对它进行微调。 + +### 1. 安装 Gnome Tweak Tool ### + +Gnome Tweak Tool能够帮助你定制比如字体、主题等,那些在Unity桌面的控制中心十分困难或是不可能完成的任务。 + + $ sudo apt-get install gnome-tweak-tool + +启动按步骤 应用程序 > 系统工具 > 首选项 > Tweak Tool + +### 2. 在面板上添加小应用 ### + +默认的右键点击面板是没有效果的。你可以尝试在右键点击面板的同时按住键盘上的Alt+Super (win)键,这样定制面板的相关选项将会出现。 + +你可以修改或删除面板并在上面添加些小应用。在这个例子中我们移除了底部面板,并用Plank dock来代替它的位置。 + +在顶部面板的中间添加一个显示时间的小应用。通过配置使它显示时间和天气。 + +同样的添加一个工作空间切换器到顶部面板,并创建合适个数的工作空间。 + +### 3. 将窗口标题栏的按钮右置 ### + +在ubuntu中,最小化、最大化和关闭按钮默认实在标题栏的左侧的。需要稍作手脚才能让他们乖乖回到右边去。 + +想让窗口的按钮到右边可以使用下面的命令,这是我在askubuntu上找到的。 + + $ gsettings set org.gnome.desktop.wm.preferences button-layout 'menu:minimize,maximize,close' + +### 4.安装 Plank dock ### + +plank dock位于屏幕底部用于启动应用和切换打开的窗口。会在必要的时间隐藏自己,并在需要的时候出现。elementary OS使用的dock就是plank dock。 + +运行以下命令安装: + + $ sudo add-apt-repository ppa:ricotz/docky -y + $ sudo apt-get update + $ sudo apt-get install plank -y + +现在启动 应用程序 > 附件 > Plank。若想让它开机自动启动,找到 应用程序 > 系统工具 > 首选项 > 启动应用程序 并将“plank”的命令加到列表中。 + +### 5. 安装 Conky 系统监视器 ### + +Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰桌面。它不太占资源并且运行的大部分时间都不惹麻烦。 + +运行如下命令安装: + + $ sudo apt-add-repository -y ppa:teejee2008/ppa + $ sudo apt-get update + $ sudo apt-get install conky-manager + +现在启动 应用程序 > 附件 > Conky Manager 选择你想在桌面上显示的部件。Conky Manager同样可以配置到启动项中。 + +### 6. 安装CCSM ### + +如果你更愿意使用Gnome Flashback (Compiz),那么CCSM将是你配置桌面特效的得力助手。 + +运行以下命令安装: + + $ sudo apt-get install compizconfig-settings-manager + +启动按步骤 应用程序 > 系统工具 > 首选项 > CompizConfig Settings Manager. + + +>在虚拟机中经常会发生compiz会话中装饰窗口消失。可以通过启动Compiz设置,在打开"Copy to texture",注销后重新登录即可。 + +不过值得一提的是Compiz 会话会比Metacity慢。 + +-------------------------------------------------------------------------------- + +via: http://www.binarytides.com/install-gnome-flashback-ubuntu/ + +作者:[Silver Moon][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/117145272367995638274/posts +[1]:https://wiki.gnome.org/action/show/Projects/GnomeFlashback?action=show&redirect=GnomeFlashback diff --git a/translated/tech/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md b/translated/tech/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md new file mode 100644 index 0000000000..2ecacac6b1 --- /dev/null +++ b/translated/tech/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md @@ -0,0 +1,91 @@ +Linux 有问必答:如何在Linux 中修复“fatal error: x264.h: No such file or directory”的错误 +================================================================================ +> **提问**: 我想在Linux中从源码编译视频编码程序。到那时,在编译时,我遇到了一个错误“fatal error: x264.h: No such file or directory”,我该如何修复? + +下面的编译错误错明你系统中没有x264开发库文件。 + + fatal error: x264.h: No such file or directory + +[x264][1]是GNU GPL授权的H.264/MPEG-4 AVC编码库。x264库被广泛用于视频编码/转码程序比如Avidemux、[FFmpeg][2]、 [HandBrake][3]、 OpenShot、 MEncode等等。 + +要解决这个问题,你需要安装x264的开发库文件。你可以这么做。 + +###在 Debian、 Ubuntu 或者 Linux Mint 中安装像x264库和开发文件 ### + +在基于Debian的系统中,x264库已经包含在基础仓库中。可以直接用apt-get来安装。 + + $ sudo apt-get install libx264-dev + +### 在 Fedora、 CentOS/RHEL中安装像x264库和开发文件 ### + +在基于Red Hat的发行版比如Fedora或者CentOS,x264库在免费的RPM Fusion仓库中有。那么,你需要首先安装[RPM Fusion (免费)][4] 。 + +RPM Fusion设置完成后,你可以使用下面的命令安装x264开发文件。 + + $ sudo yum --enablerepo=rpmfusion-free install x264-devel + +注意RPM Fusion仓库在CentOS 7中还没有,因此上面的方法在CentOS 7中还不可行。万一是CentOS 7 ,你可以从源码编译并安装x264,下面会解释的。 + +### 在Debian、 Ubuntu 或者 Linux Mint中源码编译x264库 ### + +如果libx264包在你的发行版中并没有,那么你可以按照下面的方法编译最新的x264库。 + + $ sudo apt-get install g++ automake autoconf libtool yasm nasm git + $ git clone git://git.videolan.org/x264.git + $ cd x264 + $ ./configure --enable-static --enable-shared + $ make + $ sudo make install + +x264库将会安装在/usr/local/lib。要让其他程序可以使用这个库,你需要完成最后一步。 + +打开/etc/ld.so.conf,并添加下面的行。 + + $ sudo vi /etc/ld.so.conf + +---------- + + /usr/local/lib + +最后运行下面的命令重新加载共享库: + + $ sudo ldconfig + +### 在 Fedora, CentOS/RHEL 中源码编译x264库 ### + +如果你Linux的发行版中没有x264库(比如:CentOS 7)或者x264库并不是最新的,你可以如下编译最新的x264库。 + + $ sudo yum install gcc gcc-c++ automake autoconf libtool yasm nasm git + $ git clone git://git.videolan.org/x264.git + $ cd x264 + $ ./configure --enable-static --enable-shared + $ make + $ sudo make install + +最后,要让其他的程序可以访问到位于 /usr/local/lib的x264库,在 /etc/ld.so.conf加入下面的行。 + + $ sudo vi /etc/ld.so.conf + +---------- + + /usr/local/lib + +最后运行下面的命令重新加载共享库: + + $ sudo ldconfig + +![](https://farm8.staticflickr.com/7350/16453197512_7c18c5c09e_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fatal-error-x264-h-no-such-file-or-directory.html + +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.videolan.org/developers/x264.html +[2]:http://ask.xmodulo.com/compile-ffmpeg-centos-fedora-rhel.html +[3]:http://xmodulo.com/how-to-install-handbrake-on-linux.html +[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html diff --git a/translated/tech/20150209 Linux FAQs with Answers--How to get the process ID (PID) of a shell script.md b/translated/tech/20150209 Linux FAQs with Answers--How to get the process ID (PID) of a shell script.md new file mode 100644 index 0000000000..760757a712 --- /dev/null +++ b/translated/tech/20150209 Linux FAQs with Answers--How to get the process ID (PID) of a shell script.md @@ -0,0 +1,48 @@ +Linux有问必答:如何在脚本中获取进程ID(PID) +================================================================================ +> **提问**: 我想要知道运行中脚本subshell的进程id。我该如何在shell脚本中得到PID。 + +当我在执行shell脚本时,它会启动一个叫subshell的进程。作为主shell的子进程,subshell将shell脚本中的命令作为批处理运行(因此称为“批处理进程”)。 + +在某些情况下,你也许想要知道运行中的subshell的PID。这个PID信息可以在不同的情况下使用。比如,你可以使用shell脚本的PID在/tmp下创建一个唯一的临时文件。有时侯脚本需要检测所有运行的进程,它可以从进程列表中排除自身的subshell。 + +在bash中,**subshell进程的PID**存储在一个特殊的变量‘$$’中。这个变量只读,你不可以在脚本中修改它。比如: + + #!/bin/bash + + echo "PID of this script: $$" + +上面的脚本会得到下面的输出: + + PID of this script: 6583 + +除了$$, bash shell还会导出其他的只读变量。比如,PPID存储subshell父进程的ID(也就是主shell)。UID存储了执行这个脚本的当前用户ID。比如: + + #!/bin/bash + + echo "PID of this script: $$" + echo "PPID of this script: $PPID" + echo "UID of this script: $UID" + +输出是: + + PID of this script: 6686 + PPID of this script: 4656 + UID of this script: 1000 + +上面输出中,PID每次执行都会变化。这个因为每次运行都会创建一个新的shell。另一方面,PPID每次都会一样只要你在同一个shell中运行。 + +![](https://farm8.staticflickr.com/7437/16274890369_e78ce16d42_b.jpg) + +对于所有bash内置变量列表,参考man页。 + + $ man bash + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/process-id-pid-shell-script.html + +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150211 Best Known Linux Archive or Compress Tools.md b/translated/tech/20150211 Best Known Linux Archive or Compress Tools.md new file mode 100644 index 0000000000..9938efd5a5 --- /dev/null +++ b/translated/tech/20150211 Best Known Linux Archive or Compress Tools.md @@ -0,0 +1,229 @@ +Linux 下最为人熟知的归档/压缩工具 +================================================================================ +很多时候,通过互联网发送或接收大文件和图片是一件令人头疼的事。压缩及解压缩工具正好可以应对这个问题。下面让我们快速浏览一些可以使得我们的工作更加轻松的开源工具。 + +Tar +gzip, gunzip +bzip2, bunzip2 +7-Zip + +### Tar ### + +Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存储文件。Tar 是一个 GNU 软件,它可以压缩一组文件(归档),或提取它们以及对已经存在的压缩文件进行相关操作。在存储、备份以及转移文件方面,它是很有帮助的。在创建归档文件时,Tar 可以保持原有文件和目录结构不变。通过 Tar 归档的文件的后缀名为 ‘.tar’。 + +基本用法 + +#### a) 创建归档 (c / --create) #### + + tar --create --verbose --file=archive.tar file1 file2 file3 + +或 + + tar cvf archive.tar file1 file2 file3 + +![tar cvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-cvf.png) + +创建一个归档 + +#### b) 列出归档文件内容 ( t / --list) #### + + tar --list archive.tar + +![tar tvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-tvf.png) + +列出归档中包含的文件 + +#### c) 提取归档 (x / --extract) #### + + tar xvf archive.tar + + tar xvf archive.tar --wildcards '*.c' - 从归档中提取后缀名为 *.c 的文件。 + +![tar xvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-xvf.png) + +提取文件 + +![tar xvf --wildcards](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-wildcard.png) + +只提取需要的文件 + +#### d) 对归档进行更新 ( u / --update) #### + + tar uvf archive.tar newfile.c - 假如归档的版本比先前存在的版本新,通过添加文件 newfile.c 来更新归档. + +![tar uvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-uvf.png) + +更新一个归档 + +#### e) 从归档中删除文件 (--delete) #### + + tar--delete -f archive.tar file1.c - 从压缩包'archive.tar' 中删除文件'file1.c' + +![tar --delete](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-delete.png) + +删除文件 + +更加具体的使用方法请参考[tar 主页][1]。 + +### Gzip / Gunzip ### + +Gzip 代表 GNU zip,它是一个被广泛用于 Linux 操作系统中的压缩应用,被其压缩的文件的后缀名为'*.gz' 。 + +** 基本用法 ** + +#### a) 压缩文件 #### + + gzip file(s) + +每个文件将被单独压缩。 + +![gzip](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip.png) + +压缩文件 + +通常在压缩完成后,它会将原来的文件删除。我们可以使用 `-c` 选项来保留原来的文件。 + + gzip -c file > file.gz + +![gzip-c](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-c.png) + +压缩后保留原有文件 + +我们也可以将一组文件压缩到一个单独的文件中 + + cat file1 file2 file3 | gzip > archieve.gz + +![gz group](http://blog.linoxide.com/wp-content/uploads/2015/01/gz-group.png) + +压缩一组文件 + +#### b) 检查压缩比 #### + +被压缩文件的压缩比可以使用 ‘-l’ 选项来进行检验。 + + gzip -l archieve.gz + +![gzip -l](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-l.png) + +检查压缩率 + +#### c) 解压文件 #### + +Gunzip 被用来解压文件,在这里,原有文件在被解压后同样会被删除。使用 `-c`选项来保留原始文件。 + + gunzip -c archieve.gz + +![gunzip -c](http://blog.linoxide.com/wp-content/uploads/2015/01/gunzip-c.png) + +解压文件 + +gzip 加上'-d'选项 和 gunzip 对压缩文件有同样的效果。 + +更多细节可以从 [gzip 主页][2] 得到。 + +### Bzip2 / Bunzip2 ### + +同 gzip 一样,[Bzip2][3] 也是一个压缩工具,与其他传统的工具相比,它可以将文件压缩到更小,但其缺点为:运行速度比 gzip 慢。 + +** 基本用法 ** + +#### a) 压缩文件 #### + +一般情况下,针对压缩而言,Bzip2 没有选项可供选择,将被压缩的文件被传递为它的参数。每个文件被单独压缩,且压缩文件以 'bz2' 为后缀名。 + + bzip2 file1 file2 file3 + +![bzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2.png) + +文件压缩 + +使用 '-k' 选项可以使得 在压缩或解压缩之后保留原有的文件。 + +![bzip2 -k](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-k.png) + +在压缩后保留原有文件。 + +'-d' 选项被用来强制解压缩。 + +![bzip2 -d](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-d.png) + +使用 -d 选项删除文件 (!! 注:我(FSSlc)认为 这里的图片说明有误,可以参考 manpage或bzip 的官网来校对一下。) + +#### b) 解压 #### + + bunzip2 filename + +![bunzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bunzip2.png) + +解压文件 + +bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2 和 tbz 的文件在压缩后,后缀名将变为'.tar' 。 + + bzip2 -dc 执行解压文件到标准输出的功能。 + +### 7-zip ### + +[7-zip][4] 是另一个开源压缩软件。它使用 7z 这种新的压缩格式,并支持高压缩比。因此,它被认为是比先前提及的压缩工具更好的软件。在 Linux 下,可以通过 p7zip 软件包得到,该软件包里包含 3 个二进制文件 – 7z, 7za 和 7zr,读者可以参考 [p7zip wiki][5] 来了解这三个二进制文件之间的不同。在本篇中,我们将使用 7zr 来解释 7-zip 的用法。归档文件以 '.7z' 为后缀名。 + +** 基本用法 ** + +#### a) 创建归档 #### + + 7zr a archive-name.7z file-name(s) / directory-name(s) + +![7zr a](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-a.png) + +创建一个归档文件 + +#### b) 列出归档包含文件 #### + + 7zr l archive-name.7z + +![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-l.png) + +列出归档中包含的文件 + +#### c) 提取归档文件 #### + + 7zr e archive-name.7z + +![7zr e](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-e.png) + +提取归档 + +#### d) 更新归档文件 #### + + 7zr u archive-name.7z new-file + +![7zr u](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-u.png) + +更新一个归档文件 + +#### e) 从归档文件中删除文件 #### + + 7zr d archive-name.7z file-to-be-deleted + +![7zr d](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d.png) + +删除文件 + +![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d-l.png) + +确认文件删除 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/tools/linux-compress-decompress-tools/ + +作者:[B N Poornima][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/bnpoornima/ +[1]:http://www.gnu.org/software/tar/ +[2]:http://www.gzip.org/ +[3]:http://www.bzip.org/ +[4]:http://www.7-zip.org/ +[5]:https://wiki.archlinux.org/index.php/p7zip \ No newline at end of file diff --git a/translated/tech/20150211 How To Protect Ubuntu Server Against the GHOST Vulnerability.md b/translated/tech/20150211 How To Protect Ubuntu Server Against the GHOST Vulnerability.md new file mode 100644 index 0000000000..38b7c955d3 --- /dev/null +++ b/translated/tech/20150211 How To Protect Ubuntu Server Against the GHOST Vulnerability.md @@ -0,0 +1,44 @@ +如何让Ubuntu服务器远离鬼影漏洞影响 +================================================================================ +2015年1月27日,GNU C库(glibc)的一个漏洞也称鬼影漏洞被公诸于众。总的来说,这个漏洞允许远程攻击者利用glibc中的GetHOST函数的缓冲区溢出漏洞来获得系统的完全控制。点击[这里][1]获得更多细节。 + +鬼影漏洞可在版本在glibc-2.18之前的Linux系统上被利用。也就是说没有打过补丁的版本2.2到2.17都是有风险的。 + +### 检查系统漏洞 ### + +你可以使用下面的命令来检查glib的版本 + + ldd --version + +### 输出 ### + +ldd (Ubuntu GLIBC 2.19-10ubuntu2) **2.19** +Copyright (C) 2014 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Roland McGrath and Ulrich Drepper. + +glib的版本应该高于2.17,我们的输出是2.19。如果你看到glib的版本在2.2到2.17之间。你应该运行下面的命令。 + + sudo apt-get update + + sudo apt-get dist-upgrade + +安装完之后,你应该用下面的命令重启系统。 + + sudo reboot + +重启完成之后,你可以用同样的命令来检查glib的版本。 + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/how-to-protect-ubuntu-server-against-the-ghost-vulnerability.html + +作者:[ruchi][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix +[1]:http://chargen.matasano.com/chargen/2015/1/27/vulnerability-overview-ghost-cve-2015-0235.html diff --git a/translated/tech/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md b/translated/tech/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md new file mode 100644 index 0000000000..762e363beb --- /dev/null +++ b/translated/tech/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md @@ -0,0 +1,78 @@ +Ubuntu上的一个开源VoIP应用——Mumble +================================================================================ +Mumble是一个自由开源的VoIP应用,遵守New BSD License,主要面向的用户群体是玩家。运行起来类似于TeamSpeak和Ventrilo,用户通过连接到同一个服务器来实现相互通讯。 + +Mumble提供了如下的一些特性: + +- 低延迟,这点对游戏相当重要 +- 提供游戏中的可视插件,通过它你可以知道是谁正在和你通话并定位他们的位置 +- 交谈内容经过加密的,能够保护你的隐私和安全 +- 界面简单易于上手 +- 稳定高效的使用你的服务器资源 + +### 安装 Mumble ### + +[Mumble][1]已经流行开来,进入了许多linux主流发行版的软件仓库,这使它安装起来更加的方便。若你使用的是Ubuntu那么使用apt-get就能安装,详细命令如下: + + $ sudo apt-get install mumble-server + +![mumble install](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-install.jpg) + +这条命令将会在你的服务器上安装服务端(亦称Murmur)。 + +### 配置 Mumble ### + +运行以下命令启动Mumble: + + $ sudo dpkg-reconfigure mumble-server + +会弹出以下一些问题: + +![mumble q1](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-q1.jpg) + +选择“是”开机自动启动mumble,接着它会询问你是否运行高性能模式以保持低延迟,为了让它保持最佳性能这是个不错的主意。 + +![mumble q2](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-q2.jpg) + +接着为你刚安装好的mumble服务端设置最高权限用户的密码,记住密码它会在登录时用到。 + +![mumble q3](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-q3.jpg) + +### 安装 Mumble 客户端 ### + +客户端可以安装到许多的主流操作系统中,例如windows,mac和linux。我们将教你在Ubuntu linux上安装和配置,你可以使用软件中心也可以用命令安装客户端: + + $ sudo apt-get install mumble + +第一次运行mumble时,导向将会帮助你配置音频的输入输出,使其能在客户端上保持最好的效果。第一次同样也会询问你要使用的是什么声音设备和麦克风: + +![mumble client 1](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-client-1.jpg) + +然后它将帮你校准设备: + +![mumble client 2](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-client-2.jpg) + +因为mumble帮你加密所有的通讯内容所以它会征询你创建证书: + +![mumble client 3](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-client-3.jpg) + +完成导向后你就能添加第一个服务器,连接对话框如下图所示: + +![mumble add server](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-add-server.jpg) + +首先输入一个标签,名字任意因为那只不过是为了记住服务器的,然后输入服务器的地址和端口,最后使用“SuperUser”作为用户名而密码则是你配置mumble服务器端时输入的密码。 + +现在你可以连接到服务器了,在联网玩游戏或与你好友、队友聊天开黑时享受这些功能给你带来的乐趣吧! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/install-mumble-ubuntu/ + +作者:[Adrian Dinu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/adriand/ +[1]:http://wiki.mumble.info/wiki/Main_Page diff --git a/translated/tech/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md b/translated/tech/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md new file mode 100644 index 0000000000..e21084faeb --- /dev/null +++ b/translated/tech/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md @@ -0,0 +1,169 @@ +Linux上从MySQL迁移到MariaDB的简单步骤 +================================================================================ +大家好!这是一篇介绍如何在服务器或个人电脑上从MySQL迁移到MariaDB的教程。也许你会问为什么我们要将数据库管理从MySQL迁移到MariaDB。往下看我们告诉你为什么这样做。 + +### 为什么要用MariaDB来代替MySQL ### + +MariaDB是MySQL社区开发的分支,也是一个增强型的替代品。它由MySQL前开发者们带头组织的基金会开发,使用起来和MySQL完全一样。自从Oracle买下了MySQL,它就不再自由开源了,但是 **MariaDB仍然自由开源**。一些如谷歌、维基、LinkedIn、Mozilla等的顶级的网站已经迁移到MariaDB了。它的优势在哪里: + +- 向后兼容MySQL +- 永远开源 +- 由MySQL缔造者的维护 +- 更尖端的功能 +- 更多的存储引擎 +- 大型的网站已经转向MariaDB + +现在,让我们迁移到MariaDB吧! + +**以测试为目的**让我们创建一个叫**linoxidedb**的示例数据库。 + +使用以下命令用root账户登陆MySQL: + + $ mysql -u root -p + +输入mysql root用户的密码后,你将进入**mysql的命令行** + +**创建测试数据库:** + +在mysql命令行输入以下命令以创建测试数据库。 + + mysql> create database linoxidedb; + +查看可用的数据库,输入以下命令: + + mysql> show databases; + +![creating test databases](http://blog.linoxide.com/wp-content/uploads/2015/01/creating-test-databases.png) + +如你所见,算上刚刚新建的linoxidedb我们一共有5个数据库。 + + mysql> quit + +现在,我们就将刚创建的数据库从MySQL迁移到MariaDB。 + +注:使用CentOS这类基于fedora的linux发行版没有必要参考这篇教程,因为它们在安装MariaDB时会自动代替MySQL,无需备份现有的数据库,你只需要更新mysql就可以得到mariadb。 + +### 1. 备份现有的数据库 ### + +我们第一个重要的步骤就是备份现有的数据库。我们在**终端(不是MySQL命令行)**里输入如下命令来完成备份。 + + $ mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql + +哇哦!我们遇到了点麻烦。别担心我们可以搞定。 + + $ mysqldump: Error: Binlogging on server not active + +![](http://blog.linoxide.com/wp-content/uploads/2015/01/mysqldump-error.png) +mysqldump error + +为了修复这个错误,我们需要对**my.cnf**文件做一些小改动。 + +编辑my.cnf文件: + + $ sudo nano /etc/mysql/my.cnf + +在[mysqld]部分添加如下参数。 + +**log-bin=mysql-bin** + +![configuring my.cnf](http://blog.linoxide.com/wp-content/uploads/2015/01/configuring-my.cnf_.png) + +好了在保存并关闭文件后,我们需要重启一下mysql服务。运行以下命令重启: + + $ sudo /etc/init.d/mysql restart + +现在,重新运行mysqldump命令来备份所有的数据库。 + + $ mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql + +![](http://blog.linoxide.com/wp-content/uploads/2015/01/crearing-bakup-file.png) +dumping databases + +上面的命令将会备份所有的数据库,把它们存储在当前目录下的**backupdatabase.sql**文件中。 + +### 2. 卸载MySQL ### + +首先,我们得把**my.cnt文件挪到安全的地方去**。 + +**注**:my.cnf文件将不会在你卸载MySQL包的时候被删除,我们这样做只是以防万一。在MariaDB安装时,它会询问我们是保持现存的my.cnf文件,还是使用包中自带的版本(即新my.cnf文件)。 + +在shell或终端中输入如下命令来备份my.cnt文件: + + $ sudo cp /etc/mysql/my.cnf my.cnf.bak + +运行命令来终止mysql服务: + + $ sudo /etc/init.d/mysql stop + +然后移除mysql包: + + $ sudo apt-get remove mysql-server mysql-client + +![uninstalling mysql](http://blog.linoxide.com/wp-content/uploads/2015/01/uninstalling-mysql.png) + +### 3. 安装MariaDB ### + +这是在Ubuntu系统中安装MariaDB的命令: + + $ sudo apt-get install software-properties-common + $ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db + # sudo add-apt-repository 'deb http://mirror.mephi.ru/mariadb/repo/5.5/ubuntu trusty main' + +![adding mariadb repo](http://blog.linoxide.com/wp-content/uploads/2015/01/adding-repo-mariadb.png) + +键值导入并且添加完仓库后你就可以用以下命令安装MariaDB了: + + $ sudo apt-get update + $ sudo apt-get install mariadb-server + +![installing mariadb](http://blog.linoxide.com/wp-content/uploads/2015/01/installing-mariadb.png) + +![my.conf configuration prompt](http://blog.linoxide.com/wp-content/uploads/2015/01/my.conf-configuration-prompt.png) + +我们应该还没忘记在MariaDB安装时,它会问你是使用现有的my.cnf文件,还是包中自带的版本。你可以使用以前的my.cnf也可以用包中自带的。即使你想直接使用新的my.cnf文件,你依然可以晚点将以前的备份内容还原进去(别忘了我们已经将它复制到安全的地方那个去了)。所以,我们直接选择了默认的选项“N”。如果需要安装其他版本,请参考[MariaDB官方仓库][2]。 + +### 4. 恢复配置文件 ### + +想要将my.cnf.bak中的内容恢复到my.cnf,在终端中输入以下命令。由于my.cnf.bak文件在当前目录下,所以我们只要简单的执行以下命令即可: + + $ sudo cp my.cnf.bak /etc/mysql/my.cnf + +### 5. 导入数据库 ### + +最后,让我们把我们之前创建的数据库导入吧!运行一下命令即可完成导入。 + + $ mysql -u root -p < backupdatabase.sql + +就这样,我们已成功将之前的数据库导入了进来。 + +来,让我们登陆一下mysql命令行,检查一下数据库是否真的已经导入了: + + $ mysql -u root -p + +![importing database](http://blog.linoxide.com/wp-content/uploads/2015/01/importing-database.png) + +为了检查数据库是否被迁移到MariaDB,请在MariaDB命令行中输入“**show databases**;”不用输入(“”),如下: + + mariaDB> show databases; + +![mysql to mariadb database migrated](http://blog.linoxide.com/wp-content/uploads/2015/01/maria-database-migrated.png) + +如你所见,linoxidedb及所有的数据库都已经成功的被迁移了。 + +### 总结 ### + +最后,我们已经成功地从MySQL迁移到了MariaDB数据库管理系统。MariaDB比MySQL好,虽然在性能方面MySQL还是比它更快,但是MariaDB的优点在于它额外的特性与支持的许可证。这能够确保它自由开源(FOSS),并永久自由开源,相比之下MySQL还有许多额外的插件,有些不能自由使用代码、有些没有公开的开发进程、有些在不久的将来会变的不再自由开源。如果你有任何的问题、评论、反馈给我们,不要犹豫直接在评论区留下你的看法。谢谢观看本教程,希望那你能喜欢MariaDB。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/migrate-mysql-mariadb-linux/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://mariadb.org/ +[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=mephi diff --git a/translated/tech/20150215 How to share files between computers over network with btsync.md b/translated/tech/20150215 How to share files between computers over network with btsync.md new file mode 100644 index 0000000000..c6cd7051c4 --- /dev/null +++ b/translated/tech/20150215 How to share files between computers over network with btsync.md @@ -0,0 +1,135 @@ +如何使用btsync通过网络实现电脑间文件共享 +================================================================================ +如果你是使用各式设备在网上工作的这类人,我相信你肯定需要一个在不同设备间同步文件及目录的方法,至少是非常渴望有这种功能。 + +BitTorrent Sync简称btsync,是一个基于BitTorrent(著名P2P文件分享协议)的免费跨平台同步工具。与传统BitTorrent客户端不同的是btsync用于传输加密和访问授权的是不同操作系统及设备中自动生成的键。 + +更具体点,当你想要通过btsync共享一些文件或文件夹,相应的读/写键(所谓的秘密编码)已经创建。这些键将会通过不同的途径例如HTTPS链接,电子邮件,二维码等被分享。一旦两台设备通过一个键配对成功,链接内容将会直接在其间同步。如果没有事先设置,传输将不会有文件大小和速度的限制。你可以在btsync中创建账号,以此来创建和管理通过网络分享的键和文件。 + +BitTorrent Sync可以在许多的操作系统上运行,包括Linux,MacOS X,Windows,在 [Android][1]和[iOS][2]上也可以使用。在这里,我们将教你在Linux环境(一台家用服务器)与Windows环境(一台笔记本电脑)之间如何使用BitTorrent Sync来同步文件。 + +### Linux下安装btsync ### + +BitTorrent Sync可以在[项目主页][3]直接下载。由于Windows版本的BitTorrent Syn安装起来十分简单,所以我们假设笔记本上已经安装了。我们把焦点放到Linux服务器上的安装和配置。 + +在下载页面中选择你的系统架构,右键相应链接,选择复制连接地址(或者简单的依靠浏览器判断),将链接粘贴到在终端中用wget下载,如下: + +**64位Linux:** + + # wget http://download.getsyncapp.com/endpoint/btsync/os/linux-x64/track/stable + +**32位Linux:** + + # wget http://download.getsyncapp.com/endpoint/btsync/os/linux-i386/track/stable + +![](https://farm9.staticflickr.com/8635/15895277773_8acf317e3c_c.jpg) + +下载完成后,把包中内容解压到你专门创建的目录中,为了完成这些: + + # cd /usr/local/bin + # mkdir btsync + # tar xzf stable -C btsync + +![](https://farm8.staticflickr.com/7306/16329173869_7dc8b64a39_b.jpg) + +现在你可以选择将/usr/local/bin/btsync添加到环境变量PATH中去。 + + export PATH=$PATH:/usr/local/bin/btsync + +或者在在该文件夹中运行btsync的二进制文件。我们推荐使用第一种方式,虽需要少量的输入但更容易记忆。 + +### 配置Btsync ### + +Btsync带有一个内置的网络服务器被用作其管理接口。想要使用这个接口你需要创建一个配置文件。你可以使用以下命令来创建: + + # btsync --dump-sample-config > btsync.config + +然后使用你最常用的编辑器对btsync.config文件的(webui部分)作以下修改 + + "listen" : "0.0.0.0:8888", + "login" : "yourusername", + "password" : "yourpassword" + +你可以选择任何用户名和密码。 + +![](https://farm9.staticflickr.com/8599/15895277793_da63841433_b.jpg) + +### 第一次运行btsync ### + +作为一个系统的最高执行者我们需要依赖日志文件!所以在我们启动btsync之前,我们将先为btsync创建一个日志文件。 + + # touch /var/log/btsync.log + +最后,让我们开启btsync: + + # btsync --config /usr/local/bin/btsync/btsync.config --log /var/log/btsync.log + +![](https://farm8.staticflickr.com/7288/16327720298_ccf2cbedea_c.jpg) + +现在在你的浏览器中输入正在运行btsync监听的服务器IP地址和端口(我这是192.168.0.15:8888),同意隐私政策,条款和最终用户许可协议: + +![](https://farm9.staticflickr.com/8597/16327720318_d52551fc44_b.jpg) + +这样页面就会转到你安装的btsync主页: + +![](https://farm8.staticflickr.com/7412/16329544687_9a174527d8_c.jpg) + +点击添加文件夹并在你的文件系统中选择一个你想要分享的目录,在我们的例子中,我们使用的是/btsync: + +![](https://farm8.staticflickr.com/7407/16515452485_e25ded559f_b.jpg) + +现在这样就够了。在运行接下来的步骤之前,请先在Windows主机(或你想使用的其他Linux设备)上安装BitTorrent Sync。 + +### Btsync分享文件 ### + +下方的视频将会展示如何在安装Windows8的电脑[192.168.0.106]上分享现有的文件夹。在添加好想要同步的文件夹后,你会得到它的键,通过“Enter a key or link”菜单(上面的图已经展示过了)添加到你安装到的Linux机器上,并开始同步: + +注释:youtube视频 + + +现在用别的设备试试吧;找一个想要分享的文件夹或是一些文件,并通过Linux服务器的网络接口将键导入到你安装的“核心”btsync中。 + +### 使用常规用户开机自动运行btsync ### + +你们可能注意到了,视频中在同步文件时是使用'root'组的用户创建/btsync目录的。那是因为我们使用超级用户手动启动BitTorrent Sync的原因。在通常情况下,你会希望它开机自动使用无权限用户(www_data或是专门为此创建的账户,例如btsync)启动。 + +所以,我们创建了一个叫做btsync的用户,并在/etc/rc.local文件(exit 0行前)添加如下字段: + + sudo -u btsync /usr/local/bin/btsync/btsync --config /usr/local/bin/btsync/btsync.config --log /var/log/btsync.log + +最后,创建pid文件: + + # touch /usr/local/bin/btsync/.sync//sync.pid + +并递归更改/usr/local/bin/btsync的所属用户: + + # chown -R btsync:root /usr/local/bin/btsync + +现在重启试试,看看btsync是否正在由预期中的用户运行: +Now reboot and verify that btsync is running as the intended user: + +![](https://farm9.staticflickr.com/8647/16327988660_644f6d4505_c.jpg) + +基于你选择的发行版不同,你可能找到不同的方式来开机自启动btsync。在本教程中,我选择rc.local的方式是因为它在不同发行版中都可使用。 + +### 尾注 ### + +如你所见,BitTorrent Sync对你几乎就像一个无服务器的Dropbox。我说“几乎”的原因是:当你在局域网内同步数据时,同步在两个设备之间直接进行。然而如果你想要跨网段同步数据,并且你的设备可能要穿过防火墙的限制来配对,那就只能通过一个提供BitTorrent的第三方中继服务器来完成同步传输。虽然声称传输经过 [AES加密][4],你还是可能遇到不想放生的状况。为了你的隐私着想,务必在你共享的每个文件夹中关掉中继/跟踪选项。 + +希望这些对你有用!分享愉快! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/share-files-between-computers-over-network.html + +作者:[Gabriel Cánepa][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/gabriel +[1]:https://play.google.com/store/apps/details?id=com.bittorrent.sync +[2]:https://itunes.apple.com/us/app/bittorrent-sync/id665156116 +[3]:http://www.getsync.com/ +[4]:http://www.getsync.com/tech-specs diff --git a/translated/tech/20150225 10 quick tar command examples to create or extract archives in Linux.md b/translated/tech/20150225 10 quick tar command examples to create or extract archives in Linux.md new file mode 100644 index 0000000000..75865f7713 --- /dev/null +++ b/translated/tech/20150225 10 quick tar command examples to create or extract archives in Linux.md @@ -0,0 +1,191 @@ +linux中创建和解压文档的10个快速tar命令样例 +================================================================================ +### linux中的tar命令### + +tar(磁带归档)命令是linux系统中被经常用来将文件存入到一个归档文件中的命令。 + +常见的文件扩展包括:.tar.gz 和 .tar.bz2, 分别表示通过gzip或bzip算法进一步压缩的磁带归档文件扩展。 + + +在该教程中我们会窥探一下在linux桌面或服务器版本中使用tar命令来处理一些日常创建和解压归档文件的工作样例。 +### 使用tar命令### + +tar命令在大部分linux系统默认情况下都是可用的,所以你不用单独安装该软件。 + +> tar命令具有两个压缩格式,gzip和bzip,该命令的“z”选项用来指定gzip,“j”选项用来指定bzip。同时也可哟用来创建非压缩归档文件。 + +#### 1.解压一个tar.gz归档 #### + +一般常见的用法是用来解压归档文件,下面的命令将会把文件从一个tar.gz归档文件中解压出来。 + + + $ tar -xvzf tarfile.tar.gz + +这里对这些参数做一个简单解释- + +> x - 解压文件 + +> v - 繁琐,在解压每个文件时打印出文件的名称。 + +> z - 该文件是一个使用 gzip压缩的文件。 + +> f - 使用接下来的tar归档来进行操作。 + +这些就是一些需要记住的重要选项。 + +**解压 tar.bz2/bzip 归档文件 ** + +具有bz2扩展名的文件是使用bzip算法进行压缩的,但是tar命令也可以对其进行处理,但是是通过使用“j”选项来替换“z”选项。 + + $ tar -xvjf archivefile.tar.bz2 + +#### 2.将文件解压到一个指定的目录或路径 #### + +为了将文件解压到一个指定的目录中,使用“-C”选项来指定路径,此处的“C”是大写“C”。 + + $ tar -xvzf abc.tar.gz -C /opt/folder/ + +然后,首先需要确认目标目录是否存在,毕竟tar命令并不会为你创建目录,所以如果目标目录不存在的情况下该命令会失败。 + +####3. 解压出单个文件 #### + +为了从一个归档文件中解压出单个文件,只需要将文件名按照以下方式将其放置在命令后面。 + + $ tar -xz -f abc.tar.gz "./new/abc.txt" + +在上述命令中,可以按照以下方式来指定多个文件。 + + $ tar -xv -f abc.tar.gz "./new/cde.txt" "./new/abc.txt" + +#### 4.使用通配符来解压多个文件 #### + +通配符可以用来解压于给定通配符匹配的一批文件,例如所有以".txt"作为扩展名的文件。 + + $ tar -xv -f abc.tar.gz --wildcards "*.txt" + +#### 5. 列出并检索tar归档文件中的内容 #### + +如果你仅仅想要列出而不是解压tar归档文件的中的内容,使用“-t”选项, 下面的命令用来打印一个使用gzip压缩过的tar归档文件中的内容。 + + $ tar -tz -f abc.tar.gz + ./new/ + ./new/cde.txt + ./new/subdir/ + ./new/subdir/in.txt + ./new/abc.txt + ... + +将输出通过管道定向到grep来搜索一个文件或者定向到less命令来浏览内容列表。 使用"v"繁琐选项将会打印出每个文件的额外详细信息。 + +对于 tar.bz2/bzip文件,需要使用"j"选项。 + +结合上述的命令和grep命令来检索归档文件,如下所示。简单吧! + + $ tar -tvz -f abc.tar.gz | grep abc.txt + -rw-rw-r-- enlightened/enlightened 0 2015-01-13 11:40 ./new/abc.txt + +#### 6.创建一个tar/tar.gz归档文件 #### + +现在我们已经学过了如何解压一个tar归档文件,是时候开始创建一个新的tar归档文件了。tar命令可以用来将所选的文件或整个目录放入到一个归档文件中,以下是相应的样例。 + + +下面的命令使用一个目录来创建一个tar归档文件,它会将该目录中所有的文件和子目录都加入到归档文件中。 + + $ tar -cvf abc.tar ./new/ + ./new/ + ./new/cde.txt + ./new/abc.txt + +上述命令不会创建一个压缩的的归档文件,只是一个普通的归档文件,只是将多个文件放入到一个归档文件中并没有真正地压缩每个文件。 + +为了使用压缩,可以分别使用“z”或“j”选项进行gzip或bzip压缩算法。 + + $ tar -cvzf abc.tar.gz ./new/ + +> 文件的扩展名其实并不真正有什么影响。“tar.gz” 和tgz是gzip压缩算法压缩文件的常见扩展名。 “tar.bz2”和“tbz”是bzip压缩算法压缩文件的常见扩展名。 + + +#### 7. 在添加文件之前进行确认 #### + +一个有用的选项是“w”,该选项使得tar命令在添加每个文件到归档文件之前来让用户进行确认,有时候这会很有用。 + +使用该选项时,只有用户输入yes时的文件才会被加入到归档文件中,如果你输入任何东西,默认的回答是一个“No”。 + + # 添加指定文件 + + $ tar -czw -f abc.tar.gz ./new/* + add ‘./new/abc.txt’?y + add ‘./new/cde.txt’?y + add ‘./new/newfile.txt’?n + add ‘./new/subdir’?y + add ‘./new/subdir/in.txt’?n + + #现在列出所有被加入的文件 + + $ tar -t -f abc.tar.gz + ./new/abc.txt + ./new/cde.txt + ./new/subdir/ + +#### 8. 加入文件到存在的归档文件中 #### + +“r”选项可以被用来将文件加入到已存在的归档文件中,而不用创建一个新的归档文件,下面是一个简单的样例: + + $ tar -rv -f abc.tar abc.txt + +> 文件并不能加入到已压缩的归档文件中(gz 或 bzip)。文件只能被加入到普通的归档文件中。 + +#### 9. 将文件加入到压缩的归档文件中(tar.gz/tar.bz2) #### + +之前已经提到了不可能将文件加入到已压缩的归档文件中,然和依然可以通过简单的一些把戏来完成。使用gunzip命令来解压缩归档文件,然后将文件加入到归档文件中后重新进行压缩。 + + $ gunzip archive.tar.gz + $ tar -rf archive.tar ./path/to/file + $ gzip archive.tar + +对于bzip文件分别使用bzip2和bunzip2。 + +#### 10.通过tar来进行备份 #### + +一个真实的场景是在规则的间隔内来备份目录,tar命令可以通过cron调度来实现这样的一个备份,以下是一个样例 - + + $ tar -cvz -f archive-$(date +%Y%m%d).tar.gz ./new/ + +使用cron来运行上述的命令会保持创建类似以下名称的备份文件 - +'archive-20150218.tar.gz'. + +当然,需要确保日益增长的归档文件不会导致磁盘空间的溢出。 + +#### 11. 在创建归档文件是进行验证 #### + +"W"选项可以用来在创建归档文件之后进行验证,以下是一个简单例子。 + + $ tar -cvW -f abc.tar ./new/ + ./new/ + ./new/cde.txt + ./new/subdir/ + ./new/subdir/in.txt + ./new/newfile.txt + ./new/abc.txt + Verify ./new/ + Verify ./new/cde.txt + Verify ./new/subdir/ + Verify ./new/subdir/in.txt + Verify ./new/newfile.txt + Verify ./new/abc.txt + +需要注意的是验证动作不能呢该在压缩过的归档文件上进行,只能在非压缩的tar归档文件上执行。 + +现在就先到此为止,可以通过“man tar”命令来查看tar命令的的手册。 + +-------------------------------------------------------------------------------- + +via: http://www.binarytides.com/linux-tar-command/ + +作者:[Silver Moon][a] +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117145272367995638274/posts diff --git a/translated/tech/20150225 How to Hide PHP Version in Linux.md b/translated/tech/20150225 How to Hide PHP Version in Linux.md new file mode 100644 index 0000000000..1634ff2af2 --- /dev/null +++ b/translated/tech/20150225 How to Hide PHP Version in Linux.md @@ -0,0 +1,56 @@ +如何在Linux中隐藏PHP版本 +================================================================================ +通常上,大多数默认设置安装的web服务器存在信息泄露。这其中之一是PHP。PHP(超文本预处理器)是如今流行的服务端html嵌入式语言。在如今这个充满挑战的时代,有许多攻击者会尝试发现你服务端的漏洞。因此,我会简单描述如何在Linux服务器中隐藏PHP信息。 + +默认上**exposr_php**默认是开的。关闭“expose_php”参数可以使php隐藏它的版本信息。 + + [root@centos66 ~]# vi /etc/php.ini + +在你的php.ini, 定位到含有expose_php的那行把On设成Off: + + expose_php = Off + +在此之前,web服务器头看上去就像这样: + + [root@centos66 ~]# curl -I http://www.ehowstuff.com/ + +---------- + + HTTP/1.1 200 OK + Server: nginx + Content-Type: text/html; charset=UTF-8 + Vary: Accept-Encoding + X-Powered-By: PHP/5.3.3 + X-Pingback: http://www.ehowstuff.com/xmlrpc.php + Date: Wed, 11 Feb 2015 14:10:43 GMT + X-Page-Speed: 1.9.32.2-4321 + Cache-Control: max-age=0, no-cache + +更改之后,php就不会在web服务头中显示版本了: + +[root@centos66 ~]# curl -I http://www.ehowstuff.com/ + +HTTP/1.1 200 OK +Server: nginx +Date: Wed, 11 Feb 2015 15:38:14 GMT +Content-Type: text/html; charset=UTF-8 +Vary: Accept-Encoding +X-Pingback: http://www.ehowstuff.com/xmlrpc.php +Date: Wed, 11 Feb 2015 14:10:43 GMT +X-Page-Speed: 1.9.32.2-4321 +Cache-Control: max-age=0, no-cache + +有任何需要帮助的请到twiiter @ehowstuff,或在下面留下你的评论。[点此获取更多历史文章][1] + +-------------------------------------------------------------------------------- + +via: http://www.ehowstuff.com/how-to-hide-php-version-in-linux/ + +作者:[skytech][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/mhstar/ +[1]:http://www.ehowstuff.com/archives/ diff --git a/translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md b/translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md new file mode 100644 index 0000000000..685e637072 --- /dev/null +++ b/translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md @@ -0,0 +1,98 @@ +Linux 有问必答:如何在Linux中修复“fatal error: lame/lame.h: No such file or directory” +================================================================================ +> **提问**: 我尝试着在Linux中编译视频编码器,但是编译提示出错:“fatal error: lame/lame.h: No such file or directory”, 我该如何修复这个错误? + +下面的编译错误说明你的系统没有安装LAME库和它的开发文件。 + + fatal error: lame/lame.h: No such file or directory + +[LAME][1]("LAME Ain't an MP3 Encoder")是一个流行的LPGL授权的MP3编码器。许多视频编码工具使用或者支持LAME。这其中有[FFmpeg][2]、 VLC、 [Audacity][3]、 K3b、 RipperX等。 + +要修复这个编译错误,你需要安装LAME库和开发文件,按照下面的来。 + +### 在Debian、Ubuntu或者Linux Mint上安装LAME库和安装文件 ### + +Debian和它的衍生版在基础库中已经提供了LAME库,因此可以用apt-get直接安装。 + + $ sudo apt-get install libmp3lame-dev + +### 在Fedora、CentOS/RHEL上安装LAME库和安装文件 ### + +在基于RED HAT的版本中,LAME在RPM Fusion的免费仓库中就有,那么你需要先设置[RPM Fusion (免费)仓库][4]。 + +RPM Fusion设置完成后,如下安装LAME开发文件。 + + $ sudo yum --enablerepo=rpmfusion-free-updates install lame-devel + +在2015年1月,RPM Fusion仓库已经不可以在CentOS/RHEL 7中可用了。因此,这个方法不能用在CentOS/RHEL 7 中。这时你就要从源码安装LAME库了(下面会描述)。 + +### 在Debian、Ubuntu或者Linux Mint中从源码编译LAME库 ### + +如果你希望用不同的编译选项安装自定义的LAME库,你需要自己编译。下面是怎样在基于Debian的系统中编译和安装LAME库(和它的头文件)。 + + $ sudo apt-get install gcc git + $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz + $ tar -xzf lame-3.99.5.tar.gz + $ cd lame-3.99.5 + $ ./configure --enable-static --enable-shared + $ make + $ sudo make install + +注意当你运行上面的配置步骤时,你可以根据你的需求启用会禁止不同的选项。运行下面的命令查看不同的编译选项。 + + $ ./configure --help + +共享/静态LAME默认安装在 /usr/local/lib。要让共享库可以被其他程序使用,完成最后一步: + +用编辑器打开 /etc/ld.so.conf,加入下面这行。 + + /usr/local/lib + +接着运行下面的命令,这会将/usr/local/lib中的共享库添加到动态加载缓存中,因此LAME库就可以被其他程序调用了。 + + $ sudo ldconfig + +### 在Fedora或者CentOS/RHEL中从源码编译LAME库 ### + +如果你的发行版(比如 CentOS 7)没有提供预编译的LAME库,或者你想要自定义LAME库,你需要从源码自己编译。下面是在基于Red Hat的系统中编译安装LAME库的方法。 + + + $ sudo yum install gcc git + $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz + $ tar -xzf lame-3.99.5.tar.gz + $ cd lame-3.99.5 + $ ./configure --enable-static --enable-shared + $ make + $ sudo make install + +运行make之前,你可以在configure中带上合适的选项自定义编译选项。你可以用下面的命令检查可用的选项: + + $ ./configure --help + +最后你需要完成最后一步,因为安装在/usr/local/lib的LAME共享库可能在其他程序中不可用。 + +在/etc/ld.so.conf中添加下面这行: + + /usr/local/lib + +接着运行下面的命令。这会添加 /usr/local/lib中的共享库(包括LAME)到动态加载缓存中,让其他程序可以访问到。 + + $ sudo ldconfig + +![](https://farm8.staticflickr.com/7340/16534478445_abc97cb65a_c.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fatal-error-lame-no-such-file-or-directory.html + +作者:[Dan Nanni][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://lame.sourceforge.net/ +[2]:http://ask.xmodulo.com/compile-ffmpeg-ubuntu-debian.html +[3]:http://xmodulo.com/how-to-cut-split-or-edit-mp3-file-on-linux.html +[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html diff --git a/translated/tech/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md b/translated/tech/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md new file mode 100644 index 0000000000..805a0aaca4 --- /dev/null +++ b/translated/tech/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md @@ -0,0 +1,63 @@ +Linux有问必答 -- 如何在树莓派上安装USB网络摄像头 +================================================================================ +> **Question**: 我可以在树莓派上使用标准的USB网络摄像头么?我该如何检查USB网络摄像头与树莓派是否兼容?另外我该如何在树莓派上安装它? + +如果你想在树莓上拍照或者录影,你可以安装[树莓派的摄像头板][1]。如果你不想要为摄像头模块花费额外的金钱,那有另外一个方法,就是你常见的[USB 摄像头][2]。你可能已经在PC上安装了。 + +本教程中,我会展示如何在树莓派上设置摄像头。我们假设你使用的系统是Raspbian。 + +在此之前,你最好检查一下你的摄像头是否在[这些][3]已知与树莓派兼容的摄像头之中。如果你的摄像头不在这个兼容列表中,不要丧气,仍然有可能你的摄像头被树莓派检测到。 + +### 检查USB摄像头是否雨树莓派兼容 ### + +要检查你的摄像头是否可以被树莓派检测到,将它插入到树莓派的USB口中,然后输入下面的命令。 + + $ lsusb + +如果输出中没有你的摄像头,那么有可能你的树莓派的电源无法供应足够的电力给你的摄像头。这时你可以给你的摄像头用独立的电源线,比如[有源USB hub][4],并重新输入lsusb命令。如果摄像头还是不能被识别,我们只有建议你购买其他树莓派支持的摄像头了。 + +![](https://farm8.staticflickr.com/7408/16576646025_898f17f36e_o.png) + +在上面的截屏中,USB摄像头被识别为“1e4e:0102”,但是没有显示摄像头的制造商。当你在笔记本的Fedora 20中使用它时,它可以成功的检测到“1e4e:0102 Cubeternet GL-UPC822 UVC WebCam”。 + +另外一个可以检查摄像头是否被树莓派支持的方法是检查/dev目录。如果有/dev/video0,那么这暗示树莓派支持你的摄像头。 + +### 用USB Webcam拍照片 ### + +当USB摄像头成功挂载到树莓派上之后,下一步就是拍一些照片来验证它的功能了。 + +要想拍摄照片,你要安装fswebcam,这是一款小型摄像头程序。你可以直接通过Raspbian的仓库来安装fswebcam。 + + $ sudo apt-get install fswebcam + +fswebcam安装完成后,在终端中运行下面的命令来抓去一张来自摄像头的照片: + + $ fswebcam --no-banner -r 640x480 image.jpg + +这条命令可以抓取一张640x480分辨率的照片,并且用jpg格式保存。它不会在照片的地步留下任何标志. + +![](https://farm8.staticflickr.com/7417/16576645965_302046d230_o.png) + +这就是fswebcam下640x480分辨率的结果。 + +![](https://farm8.staticflickr.com/7345/16575497512_8d77f1b34c_o.jpg) + +下面的例子是没有定义分辨率的照片。图片是偏蓝的,并且默认的分辨率是358x288。 + +![](https://farm8.staticflickr.com/7390/15954067124_760fbcdd9c_o.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-usb-webcam-raspberry-pi.html + +作者:[Kristophorus Hadiono][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/kristophorus +[1]:http://xmodulo.com/install-raspberry-pi-camera-board.html +[2]:http://xmodulo.com/go/usb_webcam +[3]:http://elinux.org/RPi_USB_Webcams +[4]:http://xmodulo.com/go/usb_powerhub diff --git a/translated/tech/20150227 Bringing a Bunch of Best Known Linux Network Tools.md b/translated/tech/20150227 Bringing a Bunch of Best Known Linux Network Tools.md new file mode 100644 index 0000000000..112147414a --- /dev/null +++ b/translated/tech/20150227 Bringing a Bunch of Best Known Linux Network Tools.md @@ -0,0 +1,443 @@ +领略一些最著名的 Linux 网络工具 +================================================================================ +在你的系统上使用命令行工具来监控你的网络是非常实用的,并且对于 Linux 用户来说,有着许许多多现成的工具可以使用,如 nethogs, ntopng, nload, iftop, iptraf, bmon, slurm, tcptrack, cbm, netwatch, collectl, trafshow, cacti, etherape, ipband, jnettop, netspeed 以及 speedometer。 + +鉴于世上有着许多的 Linux 专家和开发者,显然还存在其他的网络监控工具,但在这篇教程中,我不打算将它们所有包括在内。 + +上面列出的工具都有着自己的独特之处,但归根结底,它们都做着监控网络流量的工作,且并不是只有一种方法来完成这件事。例如 nethogs 可以被用来展示每个进程的带宽使用情况,以防你想知道究竟是哪个应用在消耗了你的整个网络资源; iftop 可以被用来展示每个套接字连接的带宽使用情况,而 像 nload 这类的工具可以帮助你得到有关整个带宽的信息。 + +### 1) nethogs ### + +nethogs 是一个免费的工具,当要查找哪个 PID (注:即 process identifier,进程 ID) 给你的网络流量带来了麻烦时,它是非常方便的。它按每个进程来组织带宽,而不是像大多数的工具那样按照每个协议或每个子网来划分流量。它功能丰富,同时支持 IPv4 和 IPv6,并且我认为,若你想在你的 Linux 主机上确定哪个程序正消耗着你的全部带宽,它是来做这件事的最佳的程序。 + +一个 Linux 用户可以使用 **nethogs** 来显示每个进程的 TCP 下载和上传速率,使用命令 **nethogs eth0** 来监控一个特定的设备,上面的 eth0 是那个你想获取信息的设备的名称,你还可以得到有关正在被传输的数据的传输速率的信息。 + +对我而言, nethogs 是非常容易使用的,或许是因为我非常喜欢它以至于我总是在我的 Ubuntu 12.04 LTS 机器中使用它来监控我的网络带宽。 + +例如要想使用混杂模式来嗅探,可以像下面展示的命令那样使用选项 -p: + + nethogs -p wlan0 + +假如你想更多地了解 nethogs 并深入探索它,那么请毫不犹豫地阅读我们做的关于这个网络带宽监控工具的整个教程。 + +### 2) nload ### + +nload 是一个控制台应用,可以被用来实时地监控网络流量和带宽使用情况,它还通过提供两个简单易懂的图表来对流量进行可视化。这个绝妙的网络监控工具还可以在监控过程中切换被监控的设备,而这可以通过按左右箭头来完成。 + +![network monitoring tools in linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png) + +正如你在上面的截图中所看到的那样,由 nload 提供的图表是非常容易理解的。nload 提供了有用的信息,也展示了诸如被传输数据的总量和最小/最大网络速率等信息。 + +而更酷的是你可以在下面的命令的帮助下运行 nload 这个工具,这个命令是非常的短小且易记的: + + nload + +我很确信的是:我们关于如何使用 nload 的详细教程将帮助到新的 Linux 用户,甚至可以帮助那些正寻找关于 nload 信息的老手。 + +### 3) slurm ### + +slurm 是另一个 Linux 网络负载监控工具,它以一个不错的 ASCII 图来显示结果,它还支持许多键值用以交互,例如 **c** 用来切换到经典模式, **s** 切换到分图模式, **r** 用来重绘屏幕, **L** 用来启用 TX/RX(注:TX,发送流量;RX,接收流量) LED,**m** 用来在经典分图模式和大图模式之间进行切换, **q** 退出 slurm。 + +![linux network load monitoring tools](http://blog.linoxide.com/wp-content/uploads/2013/12/slurm2.png) + +在网络负载监控工具 slurm 中,还有许多其它的键值可用,你可以很容易地使用下面的命令在 man 手册中学习它们。 + + man slurm + +slurm 在 Ubuntu 和 Debian 的官方软件仓库中可以找到,所以使用这些发行版本的用户可以像下面展示的那样,使用 apt-get 安装命令来轻松地下载它: + + sudo apt-get install slurm + +我们已经在一个教程中对 slurm 的使用做了介绍,所以请访问相关网页( 注:应该指的是[这篇文章](http://linoxide.com/ubuntu-how-to/monitor-network-load-slurm-tool/) ),并不要忘记和其它使用 Linux 的朋友分享这些知识。 + +### 4) iftop ### + +当你想在一个接口上按照主机来展示带宽使用情况时,iftop 是一个非常有用的工具。根据 man 手册,**iftop** 在一个已命名的接口或在它可以找到的第一个接口(假如没有任何特殊情况,它就像一个外部的接口)上监听网络流量,并且展示出一个表格来显示当前一对主机间的带宽使用情况。 + +通过在虚拟终端中使用下面的命令,Ubuntu 和 Debian 用户可以在他们的机器中轻易地安装 iftop: + + sudo apt-get install iftop + +在你的机器上,可以使用下面的命令通过 yum 来安装 iftop: + + yum -y install iftop + +### 5) collectl ### + +collectl 可以被用来收集描述当前系统状态的数据,并且它支持如下两种模式: + +- 记录模式 +- 回放模式 + +**记录模式** 允许从一个正在运行的系统中读取数据,然后将这些数据要么显示在终端中,要么写入一个或多个文件或套接字中。 + +**回放模式** + +根据 man 手册,在这种模式下,数据从一个或多个由记录模式生成的数据文件中读取。 + +Ubuntu 和 Debian 用户可以在他们的机器上使用他们默认的包管理器来安装 colletcl。下面的命令将为他们做这个工作: + + sudo apt-get install collectl + +还可以使用下面的命令来安装 collectl, 因为对于这些发行版本(注:这里指的是用 yum 作为包管理器的发行版本),在它们官方的软件仓库中也含有 collectl: + + yum install collectl + +### 6) Netstat ### + +Netstat 是一个用来监控**传入和传出的网络数据包统计数据**和接口统计数据的命令行工具。它为传输控制协议 TCP (包括上传和下行),路由表,及一系列的网络接口(网络接口控制器或者软件定义的网络接口) 和网络协议统计数据展示网络连接情况。 + +Ubuntu 和 Debian 用户可以在他们的机器上使用默认的包管理器来安装 netstat。Netsta 软件被包括在 net-tools 软件包中,并可以在 shell 或虚拟终端中运行下面的命令来安装它: + + sudo apt-get install net-tools + +CentOS, Fedora, RHEL 用户可以在他们的机器上使用默认的包管理器来安装 netstat。Netstat 软件被包括在 net-tools 软件包中,并可以在 shell 或虚拟终端中运行下面的命令来安装它: + + yum install net-tools + +运行下面的命令使用 Netstat 来轻松地监控网络数据包统计数据: + + netstat + +![Netstat](http://blog.linoxide.com/wp-content/uploads/2015/02/netstat.png) + +更多的关于 netstat 的信息,我们可以简单地在 shell 或终端中键入 man netstat 来了解: + + man netstat + +![man netstat](http://blog.linoxide.com/wp-content/uploads/2015/02/man-netstat.png) + +### 7) Netload ### + +netload 命令只展示一个关于当前网络荷载和自从程序运行之后传输数据总的字节数目的简要报告,它没有更多的功能。它是 netdiag 软件的一部分。 + +我们可以在 fedora 中使用 yum 来安装 Netload,因为它在 fedora 的默认软件仓库中。但假如你运行的是 CentOS 或 RHEL,则我们需要安装 [rpmforge 软件仓库][1]。 + + # yum install netdiag + +Netload 在默认仓库中作为 netdiag 的一部分可以被找到,我们可以轻易地使用下面的命令来利用 **apt** 包管理器安装 **netdiag**: + + $ sudo apt-get install netdiag (注:这里原文为 sudo install netdiag,应该加上 apt-get) + +为了运行 netload,我们需要确保选择了一个正在工作的网络接口的名称,如 eth0, eh1, wlan0, mon0等,然后在 shell 或虚拟终端中运行下面的命令: + + $ netload wlan2 + +注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。 + +### 8) Nagios ### + +Nagios 是一个领先且功能强大的开源监控系统,它使得网络或系统管理员在服务器相关的问题影响到服务器的主要事务之前,鉴定并解决这些问题。 有了 Nagios 系统,管理员便可以在一个单一的窗口中监控远程的 Linux 、Windows 系统、交换机、路由器和打印机等。它显示出重要的警告并指示出在你的网络或服务器中是否出现某些故障,这间接地帮助你在问题发生之前,着手执行补救行动。 + +Nagios 有一个 web 界面,其中有一个图形化的活动监视器。通过浏览网页 http://localhost/nagios/ 或 http://localhost/nagios3/ 便可以登录到这个 web 界面。假如你在远程的机器上进行操作,请使用你的 IP 地址来替换 localhost,然后键入用户名和密码,我们便会看到如下图所展示的信息: + +![在 Chromium 浏览器中的 Nagios3](http://blog.linoxide.com/wp-content/uploads/2015/02/nagios3-ubuntu.png) + +### 9) EtherApe ### + +EtherApe 是一个针对 Unix 的图形化网络监控工具,它仿照了 etherman 软件。它具有链路层,IP 和 TCP 模式并支持 Ethernet, FDDI, Token Ring, ISDN, PPP, SLIP 及 WLAN 设备等接口,再加上支持一些封装的格式。主机和链接随着流量大小和被着色的协议名称展示而变化。它可以过滤要展示的流量,并可从一个文件或运行的网络中读取数据报。 + +在 CentOS、Fedora、RHEL 等 Linux 发行版本中安装 etherape 是一件容易的事,因为在它们的官方软件仓库中就可以找到 etherape。我们可以像下面展示的命令那样使用 yum 包管理器来安装它: + + yum install etherape + +我们可以使用下面的命令在 Ubuntu、Debian 及它们的衍生发行版本中使用 **apt** 包管理器来安装 EtherApe : + + sudo apt-get install etherape + +在 EtherApe 安装到你的系统之后,我们需要像下面那样以 root 权限来运行 etherape: + + sudo etherape + +然后, **etherape** 的 **图形用户界面** 便会被执行。接着,在菜单上面的 **捕捉** 选项下,我们可以选择 **模式**(IP,链路层,TCP) 和 **接口**。一切设定完毕后,我们需要点击 **开始** 按钮。接着我们便会看到类似下面截图的东西: + +![EtherApe](http://blog.linoxide.com/wp-content/uploads/2015/02/etherape.png) + +### 10) tcpflow ### + +tcpflow 是一个命令行工具,它可以捕捉作为 TCP 连接(流)的一部分的传输数据,并以一种方便协议分析或除错的方式来存储数据。它重建了实际的数据流并将每个流存储在不同的文件中,以备日后的分析。它理解 TCP 序列号并可以正确地重建数据流,不管是在重发或乱序发送状态下。 + +通过 **apt** 包管理器在 Ubuntu 、Debian 系统中安装 tcpflow 是很容易的,因为默认情况下在官方软件仓库中可以找到它。 + + $ sudo apt-get install tcpflow + +我们可以使用下面的命令通过 **yum** 包管理器在 Fedora 、CentOS 、RHEL 及它们的衍生发行版本中安装 tcpflow: + + # yum install tcpflow + +假如在软件仓库中没有找到它或不能通过 yum 包管理器来安装它,则我们需要像下面展示的那样从 **http://pkgs.repoforge.org/tcpflow/** 上手动安装它: + +假如你运行 64 位的 PC: + + # yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.x86_64.rpm + +假如你运行 32 位的 PC: + + # yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.i686.rpm + +我们可以使用 tcpflow 来捕捉全部或部分 tcp 流量并以一种简单的方式把它们写到一个可读文件中。下面的命令执行着我们想要做的事情,但我们需要在一个空目录中运行下面的命令,因为它将创建诸如 x.x.x.x.y-a.a.a.a.z 格式的文件,做完这些之后,只需按 Ctrl-C 便可停止这个命令。 + + $ sudo tcpflow -i eth0 port 8000 + +注意:请将上面的 eth0 替换为你想捕捉的网卡接口名称。 + +### 11) IPTraf ### + +[IPTraf][2] 是一个针对 Linux 平台的基于控制台的网络统计应用。它生成一系列的图形,如 TCP 连接包和字节的数目、接口信息和活动指示器、 TCP/UDP 流量故障以及 LAN 状态包和字节的数目。 + +在默认的软件仓库中可以找到 IPTraf,所以我们可以使用下面的命令通过 **apt** 包管理器轻松地安装 IPTraf: + + $ sudo apt-get install iptraf + +在默认的软件仓库中可以找到 IPTraf,所以我们可以使用下面的命令通过 **yum** 包管理器轻松地安装 IPTraf: + + # yum install iptraf + +我们需要以管理员权限来运行 IPTraf(注:这里原文写错为 TPTraf),并带有一个可用的网络接口名。这里,我们的网络接口名为 wlan2,所以我们使用 wlan2 来作为接口的名称: + + $ sudo iptraf wlan2 (注:这里原文为 sudo iptraf,应该加上 wlan2) + +![IPTraf](http://blog.linoxide.com/wp-content/uploads/2015/02/iptraf.png) + +开始一般的网络接口统计,键入: + + # iptraf -g + +为了在一个名为 eth0 的接口设备上看详细的统计信息,使用: + + # iptraf -d wlan2 (注:这里的 wlan2 和 上面的 eth0 不一致,下面的几句也是这种情况,请相应地改正) + +为了看一个名为 eth0 的接口的 TCP 和 UDP 监控,使用: + + # iptraf -z wlan2 + +为了展示在一个名为 eth0 的接口上的包的大小和数目,使用: + + # iptraf -z wlan2 + +注意:请将上面的 wlan2 替换为你的接口名称。你可以通过运行`ip link show`命令来检查你的接口。 + +### 12) Speedometer ### + +Speedometer 是一个小巧且简单的工具,它只绘出一幅包含有通过某个给定端口的上行、下行流量的好看的图。 + +在默认的软件仓库中可以找到 Speedometer ,所以我们可以使用下面的命令通过 **yum** 包管理器轻松地安装 Speedometer: + + # yum install speedometer + +在默认的软件仓库中可以找到 Speedometer ,所以我们可以使用下面的命令通过 **apt** 包管理器轻松地安装 Speedometer: + + $ sudo apt-get install speedometer + +Speedometer 可以简单地通过在 shell 或虚拟终端中执行下面的命令来运行: + + $ speedometer -r wlan2 -t wlan2 + +![Speedometer](http://blog.linoxide.com/wp-content/uploads/2015/02/Speedometer.png) + +注:请将上面的 wlan2 替换为你想要使用的网络接口名称。 + +### 13) Netwatch ### + +Netwatch 是 netdiag 工具集里的一部分,并且它也显示出当前主机和其他远程主机的连接情况,以及在每个连接中数据传输的速率。 + +我们可以使用 yum 在 fedora 中安装 Netwatch,因为它在 fedora 的默认软件仓库中。但若你运行着 CentOS 或 RHEL , 我们需要安装 [rpmforge 软件仓库][3]。 + + # yum install netwatch + +Netwatch 作为 netdiag 的一部分可以在默认的软件仓库中找到,所以我们可以轻松地使用下面的命令来利用 **apt** 包管理器安装 **netdiag**: + + $ sudo apt-get install netdiag(注:这里应该加上 apt-get + +为了运行 netwatch, 我们需要在虚拟终端或 shell 中执行下面的命令: + + $ sudo netwatch -e wlan2 -nt + +![Netwatch](http://blog.linoxide.com/wp-content/uploads/2015/02/netwatch.png) + +注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。 + +### 14) Trafshow ### + +Trafshow 同 netwatch 和 pktstat(注:这里原文中多了一个 trafshow)一样,可以报告当前激活的连接里使用的协议和每个连接中数据传输的速率。它可以使用 pcap 类型的滤波器来筛选出特定的连接。 + +我们可以使用 yum 在 fedora 中安装 trafshow(注:这里原文为 Netwatch,应该为 trafshow),因为它在 fedora 的默认软件仓库中。但若你正运行着 CentOS 或 RHEL , 我们需要安装 [rpmforge 软件仓库][4]。 + + # yum install trafshow + +Trafshow 在默认仓库中可以找到,所以我们可以轻松地使用下面的命令来利用 **apt** 包管理器安装它: + + $ sudo apt-get install trafshow(注:原文少了 apt-get) + +为了使用 trafshow 来执行监控任务,我们需要在虚拟终端或 shell 中执行下面的命令: + + $ sudo trafshow -i wlan2 + +![Trafshow](http://blog.linoxide.com/wp-content/uploads/2015/02/trafshow-all.png) + +为了特别地监控 tcp 连接,如下面一样添加上 tcp 参数: + + $ sudo trafshow -i wlan2 tcp + +![Trafshow tcp](http://blog.linoxide.com/wp-content/uploads/2015/02/trafshow-tcp.png) + +注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。 + +### 15) Vnstat ### + +与大多数的其他工具相比,Vnstat 有一点不同。实际上它运行一个后台服务或守护进程,并时刻记录着传输数据的大小。另外,它可以被用来生成一个带有网络使用历史记录的报告。 + +我们需要开启 EPEL 软件仓库,然后运行 **yum** 包管理器来安装 vnstat。 + + # yum install vnstat + +Vnstat 在默认软件仓库中可以找到,所以我们可以使用下面的命令运行 **apt** 包管理器来安装它: + + $ sudo apt-get install vnstat + +不带有任何选项运行 vnstat 将简单地展示出从该守护进程运行后数据传输的总量。 + + $ vnstat + +![vnstat](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat.png) + +为了实时地监控带宽使用情况,使用 ‘-l’ 选项(实时模式)。然后它将以一种非常精确的方式来展示被上行和下行数据所使用的带宽总量,但不会显示任何有关主机连接或进程的内部细节。 + + $ vnstat -l + +![Vnstat 实时模式](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat-live.png) + +完成了上面的步骤后,按 Ctrl-C 来停止,这将会得到如下类型的输出: + +![Vnstat 实时结果](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat-live-result.png) + +### 16) tcptrack ### + +[tcptrack][5] 可以展示 TCP 连接的状态,它在一个给定的网络端口上进行监听。tcptrack 监控它们的状态并展示出一个经过排列且不断更新的有关来源/目标地址、带宽使用情况等信息的列表,这与 **top** 命令的输出非常类似 。 + +鉴于 tcptrack 在软件仓库中,我们可以轻松地在 Debian、Ubuntu 系统中从软件仓库使用 **apt** 包管理器来安装 tcptrack。为此,我们需要在 shell 或虚拟终端中执行下面的命令: + + $ sudo apt-get install tcptrack + +我们可以通过 yum 在 fedora 中安装它,因为它在 fedora 的默认软件仓库中。但若你运行着 CentOS 或 RHEL 系统,我们需要安装 [rpmforge 软件仓库][6]。为此,我们需要运行下面的命令: + + # wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm + + # rpm -Uvh rpmforge-release*rpm + + # yum install tcptrack + +注:这里我们下载了 rpmforge-release 的当前最新版本,即 0.5.3-1,你总是可以从 rpmforge 软件仓库中下载其最新版本,并请在上面的命令中替换为你下载的版本。 + +**tcptrack** 需要以 root 权限或超级用户身份来运行。执行 tcptrack 时,我们需要带上那个我们想监视的网络接口 TCP 连接状况的接口名称。这里我们的接口名称为 wlan2,所以如下面这样使用: + + sudo tcptrack -i wlan2 + +![tcptrack](http://blog.linoxide.com/wp-content/uploads/2015/02/tcptrack.png) + +假如你想监控特定的端口,则使用: + + # tcptrack -i wlan2 port 80 + +![tcptrack port 80](http://blog.linoxide.com/wp-content/uploads/2015/02/tcptrack-port-80.png) + +请替换上面的 80 为你想要监控的端口号。注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。 + +### 17) CBM ### + +CBM 或 Color Bandwidth Meter 可以展示出当前所有网络设备的流量使用情况。这个程序是如此的简单,以至于应该可以从它的名称中看出其功能。CBM 的源代码和新版本可以在 [http://www.isotton.com/utils/cbm/][7] 上找到。 + +鉴于 CBM 已经包含在软件仓库中,我们可以简单地使用 **apt** 包管理器从 Debian、Ubuntu 的软件仓库中安装 CBM。为此,我们需要在一个 shell 窗口或虚拟终端中运行下面的命令: + + $ sudo apt-get install cbm + +我们只需使用下面展示的命令来在 shell 窗口或虚拟终端中运行 cbm: + + $ cbm + +![Color Bandwidth Meter](http://blog.linoxide.com/wp-content/uploads/2015/02/cbm.png) + +### 18) bmon ### + +[Bmon][8] 或 Bandwidth Monitoring ,是一个用于调试和实时监控带宽的工具。这个工具能够检索各种输入模块的统计数据。它提供了多种输出方式,包括一个基于 curses 库的界面,轻量级的HTML输出,以及 ASCII 输出格式。 + +bmon 可以在软件仓库中找到,所以我们可以通过使用 apt 包管理器来在 Debian、Ubuntu 中安装它。为此,我们需要在一个 shell 窗口或虚拟终端中运行下面的命令: + + $ sudo apt-get install bmon + +我们可以使用下面的命令来运行 bmon 以监视我们的网络状态: + + $ bmon + +![bmon](http://blog.linoxide.com/wp-content/uploads/2015/02/bmon.png) + +### 19) tcpdump ### + +[TCPDump][9] 是一个用于网络监控和数据获取的工具。它可以为我们节省很多的时间,并可用来调试网络或服务器 的相关问题。它打印出在某个网络接口上与布尔表达式匹配的数据包所包含的内容的一个描述。 + +tcpdump 可以在 Debian、Ubuntu 的默认软件仓库中找到,我们可以简单地以 sudo 权限使用 apt 包管理器来安装它。为此,我们需要在一个 shell 窗口或虚拟终端中运行下面的命令: + + $ sudo apt -get install tcpdump + +tcpdump 也可以在 Fedora、CentOS、RHEL 的软件仓库中找到。我们可以像下面一样通过 yum 包管理器来安装它: + + # yum install tcpdump + +tcpdump 需要以 root 权限或超级用户来运行,我们需要带上我们想要监控的 TCP 连接的网络接口名称来执行 tcpdump 。在这里,我们有 wlan2 这个网络接口,所以可以像下面这样使用: + + $ sudo tcpdump -i wlan2 + +![tcpdump](http://blog.linoxide.com/wp-content/uploads/2015/02/tcpdump.png) + + +假如你只想监视一个特定的端口,则可以运行下面的命令。下面是一个针对 80 端口(网络服务器)的例子: + + $ sudo tcpdump -i wlan2 'port 80' + +![tcpdump port](http://blog.linoxide.com/wp-content/uploads/2015/02/tcpdump-port.png) + +### 20) ntopng ### + +[ntopng][20] 是 ntop 的下一代版本。它是一个用于展示网络使用情况的网络探头,在一定程度上它与 top 针对进程所做的工作类似。ntopng 基于 libpcap 并且它以可移植的方式被重写,以达到可以在每一个 Unix 平台 、 MacOSX 以及 Win32 上运行的目的。 + +为了在 Debian,Ubuntu 系统上安装 ntopng,首先我们需要安装 **编译 ntopng 所需的依赖软件包**。你可以通过在一个 shell 窗口或一个虚拟终端中运行下面的命令来安装它们: + + $ sudo apt-get install libpcap-dev libglib2.0-dev libgeoip-dev redis-server wget libxml2-dev build-essential checkinstall + +现在,我们需要像下面一样针对我们的系统手动编译 ntopng : + + $ sudo wget http://sourceforge.net/projects/ntop/files/ntopng/ntopng-1.1_6932.tgz/download + $ sudo tar zxfv ntopng-1.1_6932.tgz + $ sudo cd ntopng-1.1_6932 + $ sudo ./configure + $ sudo make + $ sudo make install + +这样,在你的 Debian 或 Ubuntu 系统上应该已经安装上了你编译的 ntopng 。 + +我们已经有了有关 ntopng 的使用方法的[教程](linoxide.com/monitoring-2/ntopng-network-monitoring-tool/),它既可以在命令行也可以在 Web 界面中使用,我们可以前往这些教程来获得有关 ntopng 的知识。 + +### 结论 ### + +在第一部分中(注:我认为原文多了 first 这个单词,总之是前后文的内容有些不连贯),我们介绍了一些在 Linux 下的网络负载监控工具,这对于系统管理员甚至是新手来说,都是很有帮助的。在这篇文章中介绍的每一个工具都有其特点,不同的选项等,但最终它们都可以帮助你来监控你的网络流量。 +-------------------------------------------------------------------------------- + +via: http://linoxide.com/monitoring-2/network-monitoring-tools-linux/ + +作者:[Bobbin Zachariah][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/bobbin/ +[1]:http://pkgs.org/centos-7/repoforge-x86_64/netwatch-1.0c-1.el7.rf.x86_64.rpm.html +[2]:http://iptraf.seul.org/ +[3]:http://pkgs.org/centos-7/repoforge-x86_64/netwatch-1.0c-1.el7.rf.x86_64.rpm.html +[4]:http://pkgs.org/centos-6/epel-x86_64/trafshow-5.2.3-6.el6.x86_64.rpm.html +[5]:http://linux.die.net/man/1/tcptrack +[6]:http://pkgs.org/centos-6/repoforge-x86_64/tcptrack-1.4.0-1.el6.rf.x86_64.rpm.html +[7]:http://www.isotton.com/utils/cbm/ +[8]:https://github.com/tgraf/bmon/ +[9]:http://www.tcpdump.org/ +[10]:http://www.ntop.org/ \ No newline at end of file diff --git a/translated/tech/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md b/translated/tech/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md new file mode 100644 index 0000000000..77c4c05d63 --- /dev/null +++ b/translated/tech/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md @@ -0,0 +1,72 @@ +如何修复:apt-get update无法添加新的CD-ROM +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/elementary_OS_Freya.jpg) + +这些天我正在体验Elementary OS Freya,在这期间,我遇到了一个非常常见的更新错误:**Failed to fetch cdrom Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs**。完整的错误在运行apt-get update后看上去像这样: + +> W: Failed to fetch cdrom://elementary OS 0.3 _Freya_ – Daily amd64 (20150208)/dists/trusty/main/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs +> +> W: Failed to fetch cdrom://elementary OS 0.3 _Freya_ – Daily amd64 (20150208)/dists/trusty/restricted/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs +> +> E: Some index files failed to download. They have been ignored, or old ones used instead. + +本篇中,我们会了解如何修复这个错误。 + +### 修复apt-get update无法添加新的CD-ROM的错误 ### + +这个错误的原因是cdrom已经被包含在源之中。要修复这个问题,我们需要将它从软件源中移除。 + +在Ubuntu中,找到“软件与更新”: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Software_Update_Ubuntu.jpeg) + +在Ubuntu Software的第一个标签中,找到cdrom,如果它是勾选的,那么取消勾选。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Error_Update_Software_Sources.jpeg) + +关闭软件源并再次运行更新。现在应该可以用了。 + +### 进一步故障排除: ### + +上面描述的方法已经修复了这个**apt-get update cannot be used to add new CD-ROMs**错误。但是这个方法对我无效,因为cdrom的选项这时是灰色的,因为我使用的live版本。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Update_Error.png) + +现在要修复我们的问题了,我们是要采用命令行路线。打开终端并查看软件源中包含了哪些源: + + cat /etc/apt/sources.list + +我的输出是下面这样: + + deb cdrom:[elementary OS 0.3 _Freya_ – Daily amd64 (20150208)]/ trusty main restricted + deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse + deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse + deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse + deb-src http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse + deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse + deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse + +在上面的第一行中。它包含了cdrom。我们需要用‘#’来注释掉这行: + + #deb cdrom:[elementary OS 0.3 _Freya_ – Daily amd64 (20150208)]/ trusty main restricted + +要用下面的命令来: + + sudo gedit /etc/apt/sources.list + +在你编辑完软件源后,再次运行apt-get update。“apt-get update cannot be used to add new CD-ROMs”这个错误应该已经修复了。如果你还遇到其他的问题,看一下这篇收集了大部分[Ubuntu常见更新错误修复][1]的文章。 + +我希望这篇教程对你有用。如果你还有其他的问题和建议,请在下面留言。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/fix-update-errors-ubuntu-1404/ diff --git a/translated/tech/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md b/translated/tech/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md new file mode 100644 index 0000000000..a3020446ee --- /dev/null +++ b/translated/tech/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md @@ -0,0 +1,85 @@ +设置Ubuntu14.04无密码登录SSH +================================================================================ +大家好,今天我来向大家介绍如何在可信的Ubuntu12.04上设置无密码登录SSH功能。仅在工作站有正确的(公私)密钥以供匹配时SSH服务端才会允许你登录,反之访问将不会被允许。 + +正常情况下,我们需要连上SSH的控制台输入用户名和密码,两者结合使用。如果两者全部正确,我们就可以访问,反之访问被服务端拒绝。不过相比而言还有一种比用密码更安全的登录方式,我们用的不是密码在登录SSH我们用的是密钥。 + +如果你想使用这个安全的方式,我们只需简单的禁用密码登录并只允许密钥即可。使用这种方式时,客户端计算机上会产生公私一对密钥。接着客户端得把公钥上传到SSH服务端的密要验证文件中去。在访问被授予前,服务器及客户端电脑互验密钥对。如果服务器上的公钥与客服端提交的私钥匹配访问开始,否则访问被拒绝。 + +这是获取SSH服务器认证中非常安全的一种做法,如果你想为SSH用户登录实施安全的认证,这也是备受推崇的方式。这里快速的过一遍允许无密码登录SSH的配置过程。 + +### 1.安装Openssh服务端 ### + +首先,我们需要更新我们的本地库索引。所以如下所见,我们需要先输入“apt-get update” + + $ sudo apt-get update + +![Updating Repo Index](http://blog.linoxide.com/wp-content/uploads/2015/02/updating-repo-list.png) + +现在我们可以通过以下命令安装openssh-server: + + $ sudo apt-get install openssh-server + +![Installing openssh server](http://blog.linoxide.com/wp-content/uploads/2015/02/installing-openssh-server.png) + +### 2. 开启openssh服务 ### + +在OpenSSH已经成功安装在Ubuntu14.04操作系统上了之后,我们要启动OpenSSH的服务。以下命令让你启动/开启服务。 + + $ sudo service ssh start + +OR + + $ sudo /etc/init.d/ssh start + +### 3. 配置密钥对 ### + +在我们安装并启动了OpenSSH服务以后。现在终于到了要我们搞定公私钥对的时候了,在终端中运行以下命令: + + $ ssh-keygen -t rsa + +在运行完以上命令了以后,我们完成一系列的提示的任务。首先选择保存密钥路径,按回车将会选择默认路径即家目录的一个隐藏的.ssh文件夹。下一个提示是请输入提醒。我个人将此留白(回车过)。之后密钥对就会创建,大功告成。 + +![Generating Key Pair](http://blog.linoxide.com/wp-content/uploads/2015/02/generating-key-pair.png) + +在密钥对生成以后,我们需要将**客户端的上的公钥复制到SSH服务端**或者宿主来创建对客户端的信任关系。运行以下命令复制客户端的公钥到服务端。 + + $ ssh-copy-id user@ip_address + +在公钥上传之后,我们现在可以不用通过密码登陆SSH了。为此,我们需要通过以下命令用文本编辑器打开**etc/ssh/ssh_config**。 + + $ sudo nano /etc/ssh/sshd_config + +现在,我们需要按照下图所示去到几行注释并进行一些赋值。 + +![Configuring sshd Config](http://blog.linoxide.com/wp-content/uploads/2015/02/configuring-sshd_config.png) + +### 4. 重启SSH服务 ### + +最后,在我们配置完SSH服务端后,为了使改动生效我们需要重启SSH服务。在终端或控制台运行以下命令重启。 + + $ sudo service ssh restart + +OR + + $ sudo /etc/init.d/ssh restart + +![Restarting ssh](http://blog.linoxide.com/wp-content/uploads/2015/02/restarting-ssh.png) + +现在,我们可以试试不用密码仅用密钥配对的方式登录ssh服务端了。 + +### 总结 ### + +太好了!我们成功的配置了无密码登录SSH。这是获取SSH服务器认证中非常安全的一种做法,如果你想为SSH但用户登录实施安全的认证这也是备受推崇的方式。所以,如果你还有什么问题或建议,请在意见框中向我们反馈。很欣慰你能读完,祝你SSH登录愉快 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/setup-passwordless-ssh-logon-ubuntu-14-04/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ diff --git a/translated/tech/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md b/translated/tech/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md new file mode 100644 index 0000000000..41318dd5fc --- /dev/null +++ b/translated/tech/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md @@ -0,0 +1,64 @@ +如何在Ubuntu上修复“Not Enough Free Disk Space On /boot” +================================================================================ +### 提问:如何在Ubuntu上修复“Not Enough Free Disk Space On /boot”错误?### + +今天,当我在升级Lubuntu 14.04的时候遇到了下面这个错误,但是很简单。 + +> “Not Enough Free Disk Space On /boot” + +![](https://www.unixmen.com/wp-content/uploads/2015/02/Software-Updater_002.png) + +这是因为我的启动分区超出了不再要的旧内核与包等。 + +### 回答: ### + +我听说**Computer Janitor**这个特性可以在Ubuntu Tweak中删除不想要的垃圾文件。使用Computer Janitor,你可以将你的系统清理成像新安装的那样。Janitor会删除: + +- 程序缓存(Firefox/Chrome 缓存、软件中心缓存); +- 略缩图缓存; +- apt缓存; +- 旧内核; +- 包的配置; +- 不再需要的包。 + +If you haven’t install this tool, look at the following link. +如果你还没有安装这个工具,参考下面的链接 + +- **[如何安装和使用Ubuntu Tweak][1]** + +要删除不需要的垃圾文件,打开Ubuntu Tweak,点击 **Janitor** 选项。 + +![](https://www.unixmen.com/wp-content/uploads/2015/02/Ubuntu-Tweak_006.png) + +选择你想要删除的文件的选框,并点击 **Clean** 按钮。 + +![](https://www.unixmen.com/wp-content/uploads/2015/02/Ubuntu-Tweak_007.png) + +Janitor现在就开始清理你的系统了。 + +![](https://www.unixmen.com/wp-content/uploads/2015/02/Ubuntu-Tweak_003.png) + +真酷!系统清理完成了。 + +![](https://www.unixmen.com/wp-content/uploads/2015/02/Ubuntu-Tweak_008.png) + +我重启启动了软件更新。这个没再遇到问题了。 + +![](https://www.unixmen.com/wp-content/uploads/2015/02/Software-Updater_009.png) + +就是这样。当然也有其他的方法可以清理系统。但是,这个方法很容易学。我们可以只点击几次鼠标就可以清理系统。 + +干杯! + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/how-to-fix-not-enough-free-disk-space-on-boot-in-ubuntu/ + +作者:[SK][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.unixmen.com/author/sk/ +[1]:http://www.unixmen.com/after-a-fresh-install-of-ubuntu-1010-maverick-meerkat-configuration-made-easy-with-ubuntu-tweak/ diff --git a/translated/tech/20150304 How To Fix Windows Updates Stuck At 0%.md b/translated/tech/20150304 How To Fix Windows Updates Stuck At 0%.md new file mode 100644 index 0000000000..ca09f61d1c --- /dev/null +++ b/translated/tech/20150304 How To Fix Windows Updates Stuck At 0%.md @@ -0,0 +1,54 @@ +如何修复Windows更新在0%卡住 +================================================================================ +当你在一个月后登录Windows,发现有一些更新需要安装, 你选择安装这些更新但是**Windows更新卡在0%**时你感觉怎么样? + +为什么我在Linux和开源专属的博客上谈论Windows更新呢?因为我喜欢[双启动Windows和Linux][1]。当我使用Linux作为我的主桌面时,过了一段时间我登录到Windows中。登录Windows后最烦人的事情是Windows更新。我偶尔遇到了几次**Windows更新不能工作**的情况。我选择安装更新而且Windows更新卡在了0%和0KB上,就像这样: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_Updates_stuck_at_zero.jpeg) + +本教程中,我们会让Windows更新再次可用。这个教程应该同样适用于Windows 7、Windows 8和Windows 8.1。 + +### 修复Windows更新卡在0% ### + +请注意Windows更新可能卡在任何地方,我们将会使用的这个技巧需要你重新安装这些更新。我希望你不要觉得太麻烦。如果你准备好了,就让我们开始修复这个Windows更新问题。 + +#### 步骤 1: #### + +按下Windows+R。这时会弹出运行窗口。在这里我们输入services.msc: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Updates_3.png) + +#### 步骤 2: #### + +这里会显示Windows上安装的所有服务。这些服务以字母排序。向下拉到**Windows Update Service**。右击并停止服务。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_Updates_stuck_1.jpeg) + +#### 步骤 3: #### + +现在进入**C:\Windows\SoftwareDistribution并删除这里所有的内容**。实际上,这个文件夹是下载和保存安装文件的地方。但是由于Windows更新卡住了,所以这里的某个安装文件存在一些问题。 + +#### 步骤 4: #### + +回到前面的服务(第一步中提到的)并右击重新启动Windows更新服务。再重新试一下Windows更新,这次应该可以用了。 + +当系统更新可以工作时,你或许会发现在下次启动时会有很多更新要安装。这时打个电话: + + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_update_suck.jpg) + +玩笑之余,我希望这个贴士能够帮助你拜托Windows更新卡在0%的情况。我希望Linux中的更新也能够含在[Windows 10从Linux复制的特性][2]列表中。这只是我的希望。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-windows-updates-stuck-0/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[2]:http://itsfoss.com/windows-10-inspired-linux/ diff --git a/translated/tech/20150304 Linux Basics--How To Find Maximum Supported RAM By Your System.md b/translated/tech/20150304 Linux Basics--How To Find Maximum Supported RAM By Your System.md new file mode 100644 index 0000000000..52b978dbc8 --- /dev/null +++ b/translated/tech/20150304 Linux Basics--How To Find Maximum Supported RAM By Your System.md @@ -0,0 +1,696 @@ +Linux基础:如何找出你的系统所支持的最大内存 +================================================================================ +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/02/RAM-790x527.jpg) + +大多数情况下你可以从BIOS、产品目录或者干脆手动找出你的系统所持的最大内存。这里,我们介绍一种简单有用的技巧——使用Dmidecode来找出系统支持的最大内存,这样你就无需打开机箱或者参照BIOS和产品目录了。 + +### 什么是 Dmidecode? ### + +就像你可能知道的一样, **Dmidecode**是一个将计算机DMI(又名SMBIOS)表的内容转换为可读格式的工具。这个表包含了系统硬件组件的介绍以及其他一些如序列号和IOS版本等有用的信息。使用Dmidecode你能够获取此项信息,而无需去探测真实的硬件。 + +### 找出你的系统所支持的最大内存 ### + +请确定你已经在系统中安装了dmidecode,我觉得你的操作系统应该已经自动安装过了,不过并不非常确定。 + +**在基于Deb的系统中安装** + + sudo apt-get install dmidecode + +**在基于RPM的系统中安装** + + sudo yum install dmidecode + +**在SUSE/openSUSE中安装** + + sudo zypper in dmidecode + +好了,我们已经安装了dmidecode,接下来让我们找出支持的最大内存。输入以下命令: + + sudo dmidecode -t 16 + +**输出样本** + + # dmidecode 2.12 + SMBIOS 2.6 present. + + Handle 0x0014, DMI type 16, 15 bytes + Physical Memory Array + Location: System Board Or Motherboard + Use: System Memory + Error Correction Type: None + Maximum Capacity: 16 GB + Error Information Handle: Not Provided + Number Of Devices: 2 + +就像你看到的,我的系统支持最大内存到16G,并且有两个内存插槽,简单吧? + +接下来,让我们找出现在已经安装的内存的详细信息。 + + sudo dmidecode -t 17 + +**输出样本** + + # dmidecode 2.12 + SMBIOS 2.6 present. + + Handle 0x0017, DMI type 17, 28 bytes + Memory Device + Array Handle: 0x0014 + Error Information Handle: 0x0000 + Total Width: Unknown + Data Width: Unknown + Size: No Module Installed + Form Factor: DIMM + Set: None + Locator: DIMM_B + Bank Locator: BANK 2 + Type: Unknown + Type Detail: None + Speed: Unknown + Manufacturer: Not Specified + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Rank: Unknown + + Handle 0x0015, DMI type 17, 28 bytes + Memory Device + Array Handle: 0x0014 + Error Information Handle: 0x0000 + Total Width: 64 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: SODIMM + Set: None + Locator: DIMM_A + Bank Locator: BANK 0 + Type: DDR3 + Type Detail: Synchronous + Speed: 1067 MHz + Manufacturer: 014F + Serial Number: 00092AF2 + Asset Tag: 54114000 + Part Number: JM1066KSN-4G + Rank: Unknown + +就像上边输出的一样,我在插槽1里边安装了一个内存条。内存大小为**4G**,类型为**DDR3**,速度为**1067 MHz**。 + +同样的,我们可以通过下边命令得到完整的内存信息。 + + sudo dmidecode -t memory + sudo dmidecode -t memory | less + sudo dmidecode -t memory | more + +**输出样本** + + # dmidecode 2.12 + SMBIOS 2.6 present. + + Handle 0x0014, DMI type 16, 15 bytes + Physical Memory Array + Location: System Board Or Motherboard + Use: System Memory + Error Correction Type: None + Maximum Capacity: 16 GB + Error Information Handle: Not Provided + Number Of Devices: 2 + + Handle 0x0017, DMI type 17, 28 bytes + Memory Device + Array Handle: 0x0014 + Error Information Handle: 0x0000 + Total Width: Unknown + Data Width: Unknown + Size: No Module Installed + Form Factor: DIMM + Set: None + Locator: DIMM_B + Bank Locator: BANK 2 + Type: Unknown + Type Detail: None + Speed: Unknown + Manufacturer: Not Specified + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Rank: Unknown + + Handle 0x0015, DMI type 17, 28 bytes + Memory Device + Array Handle: 0x0014 + Error Information Handle: 0x0000 + Total Width: 64 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: SODIMM + Set: None + Locator: DIMM_A + Bank Locator: BANK 0 + Type: DDR3 + Type Detail: Synchronous + Speed: 1067 MHz + Manufacturer: 014F + Serial Number: 00092AF2 + Asset Tag: 54114000 + Part Number: JM1066KSN-4G + Rank: Unknown + +如果你好奇想要知道整个系统的详细信息,例如主板、内存、BIOS等,那么可以输入以下命令来获取。 + + sudo dmidecode + +**输出样本** + + # dmidecode 2.12 + SMBIOS 2.6 present. + 48 structures occupying 2173 bytes. + Table at 0x000EB840. + + Handle 0xDA00, DMI type 218, 251 bytes + OEM-specific Type + Header and Data: + DA FB 00 DA B2 00 0D 5F 0F 37 40 7D 00 00 00 00 + 00 7E 00 01 00 00 00 DC 01 00 80 02 00 DD 01 00 + 80 03 00 75 01 01 80 01 00 76 01 02 80 01 00 2D + 01 03 80 01 00 2E 01 03 80 00 00 81 01 07 80 00 + 00 82 01 07 80 01 00 83 01 08 80 00 00 84 01 08 + 80 01 00 85 01 06 80 00 00 86 01 06 80 01 00 58 + 02 05 80 00 00 57 02 05 80 01 00 9C 00 02 00 01 + 00 9B 00 02 00 00 00 8A 01 03 00 01 00 89 01 03 + 00 00 00 7F 01 04 00 00 00 80 01 04 00 01 00 53 + 01 05 00 00 00 52 01 05 00 01 00 7B 01 06 00 00 + 00 7C 01 06 00 01 00 94 01 07 00 00 00 93 01 07 + 00 01 00 7D 00 08 00 00 00 2D 00 09 00 01 00 2E + 00 09 00 00 00 6E 00 0A 00 00 00 95 00 0B 00 01 + 00 96 00 0B 00 00 00 2F 02 0C 00 01 00 30 02 0C + 00 00 00 50 02 0D 00 00 00 51 02 0D 00 01 00 52 + 02 0D 00 02 00 FF FF 00 00 00 00 + + Handle 0xDA01, DMI type 218, 59 bytes + OEM-specific Type + Header and Data: + DA 3B 01 DA B2 00 0D 5F 0F 37 40 53 02 0D 00 03 + 00 54 02 0D 00 04 00 56 02 0D 00 05 00 4B 01 0E + 00 01 00 4A 01 0E 00 00 00 EA 00 0F 00 01 00 EB + 00 0F 00 00 00 FF FF 00 00 00 00 + + Handle 0x0004, DMI type 4, 42 bytes + Processor Information + Socket Designation: CPU 1 + Type: Central Processor + Family: Core i3 + Manufacturer: Intel + ID: A7 06 03 01 FF FB AB BE + Signature: Type 0, Family 6, Model 42, Stepping 7 + Flags: + FPU (Floating-point unit on-chip) + VME (Virtual mode extension) + DE (Debugging extension) + PSE (Page size extension) + TSC (Time stamp counter) + MSR (Model specific registers) + PAE (Physical address extension) + MCE (Machine check exception) + CX8 (CMPXCHG8 instruction supported) + APIC (On-chip APIC hardware supported) + SEP (Fast system call) + MTRR (Memory type range registers) + PGE (Page global enable) + MCA (Machine check architecture) + CMOV (Conditional move instruction supported) + PAT (Page attribute table) + PSE-36 (36-bit page size extension) + CLFSH (CLFLUSH instruction supported) + DS (Debug store) + ACPI (ACPI supported) + MMX (MMX technology supported) + FXSR (FXSAVE and FXSTOR instructions supported) + SSE (Streaming SIMD extensions) + SSE2 (Streaming SIMD extensions 2) + SS (Self-snoop) + HTT (Multi-threading) + TM (Thermal monitor supported) + PBE (Pending break enabled) + Version: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz + Voltage: 1.1 V + External Clock: 100 MHz + Max Speed: 2300 MHz + Current Speed: 2300 MHz + Status: Populated, Enabled + Upgrade: Other + L1 Cache Handle: 0x0005 + L2 Cache Handle: 0x0006 + L3 Cache Handle: 0x0007 + Serial Number: To Be Filled By O.E.M. + Asset Tag: To Be Filled By O.E.M. + Part Number: To Be Filled By O.E.M. + Core Count: 2 + Core Enabled: 1 + Thread Count: 2 + Characteristics: + 64-bit capable + + Handle 0x0005, DMI type 7, 19 bytes + Cache Information + Socket Designation: L1-Cache + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 64 kB + Maximum Size: 64 kB + Supported SRAM Types: + Other + Installed SRAM Type: Other + Speed: Unknown + Error Correction Type: None + System Type: Unified + Associativity: 8-way Set-associative + + Handle 0x0006, DMI type 7, 19 bytes + Cache Information + Socket Designation: L2-Cache + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Varies With Memory Address + Location: Internal + Installed Size: 512 kB + Maximum Size: 512 kB + Supported SRAM Types: + Other + Installed SRAM Type: Other + Speed: Unknown + Error Correction Type: None + System Type: Unified + Associativity: 8-way Set-associative + + Handle 0x0007, DMI type 7, 19 bytes + Cache Information + Socket Designation: L3-Cache + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Varies With Memory Address + Location: Internal + Installed Size: 3072 kB + Maximum Size: 3072 kB + Supported SRAM Types: + Other + Installed SRAM Type: Other + Speed: Unknown + Error Correction Type: None + System Type: Unified + Associativity: Other + + Handle 0x0008, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J1A1 + Internal Connector Type: None + External Reference Designator: PS2Mouse + External Connector Type: PS/2 + Port Type: Mouse Port + + Handle 0x0009, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J1A1 + Internal Connector Type: None + External Reference Designator: Keyboard + External Connector Type: PS/2 + Port Type: Keyboard Port + + Handle 0x000A, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J2A2B + Internal Connector Type: None + External Reference Designator: Video + External Connector Type: DB-15 female + Port Type: Video Port + + Handle 0x000B, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J3A1 + Internal Connector Type: None + External Reference Designator: USB1 + External Connector Type: Access Bus (USB) + Port Type: USB + + Handle 0x000C, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J3A1 + Internal Connector Type: None + External Reference Designator: USB2 + External Connector Type: Access Bus (USB) + Port Type: USB + + Handle 0x000D, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J3A1 + Internal Connector Type: None + External Reference Designator: USB3 + External Connector Type: Access Bus (USB) + Port Type: USB + + Handle 0x000E, DMI type 8, 9 bytes + Port Connector Information + Internal Reference Designator: J5A1 + Internal Connector Type: None + External Reference Designator: LAN + External Connector Type: RJ-45 + Port Type: Network Port + + Handle 0x000F, DMI type 9, 17 bytes + System Slot Information + Designation: J6B2 + Type: x16 PCI Express + Current Usage: In Use + Length: Long + ID: 0 + Characteristics: + 3.3 V is provided + Opening is shared + PME signal is supported + Bus Address: 0000:00:01.0 + + Handle 0x0010, DMI type 9, 17 bytes + System Slot Information + Designation: J6B1 + Type: x1 PCI Express + Current Usage: In Use + Length: Short + ID: 1 + Characteristics: + 3.3 V is provided + Opening is shared + PME signal is supported + Bus Address: 0000:00:1c.3 + + Handle 0x0012, DMI type 11, 5 bytes + OEM Strings + String 1: Dell System + String 2: 5[0003] + String 3: 13[P18F] + + Handle 0x0013, DMI type 12, 5 bytes + System Configuration Options + Option 1: To Be Filled By O.E.M. + + Handle 0x001C, DMI type 21, 7 bytes + Built-in Pointing Device + Type: Touch Pad + Interface: Bus Mouse + Buttons: 2 + + Handle 0x001D, DMI type 22, 26 bytes + Portable Battery + Location: Sys. Battery Bay + Manufacturer: Sanyo + Serial Number: 5390 + Name: DELL 4YRJH22 + Chemistry: Lithium Ion + Design Capacity: 45000 mWh + Design Voltage: 10800 mV + SBDS Version: 1.0 + Maximum Error: 2% + SBDS Manufacture Date: 2012-02-28 + OEM-specific Information: 0x00000001 + + Handle 0x001E, DMI type 32, 20 bytes + System Boot Information + Status: No errors detected + + Handle 0x0020, DMI type 27, 12 bytes + Cooling Device + Type: Fan + Status: OK + OEM-specific Information: 0x00000000 + + Handle 0x0021, DMI type 28, 20 bytes + Temperature Probe + Description: CPU Internal Temperature + Location: Processor + Status: OK + Maximum Value: 127.0 deg C + Minimum Value: 0.0 deg C + Resolution: 1.000 deg C + Tolerance: 0.5 deg C + Accuracy: Unknown + OEM-specific Information: 0x00000000 + + Handle 0xB000, DMI type 176, 5 bytes + OEM-specific Type + Header and Data: + B0 05 00 B0 00 + + Handle 0xB100, DMI type 177, 12 bytes + OEM-specific Type + Header and Data: + B1 0C 00 B1 1A 0E 00 00 00 00 00 00 + + Handle 0x0025, DMI type 209, 12 bytes + OEM-specific Type + Header and Data: + D1 0C 25 00 00 00 00 03 05 01 00 03 + + Handle 0x0026, DMI type 210, 12 bytes + OEM-specific Type + Header and Data: + D2 0C 26 00 00 00 00 03 05 20 01 03 + + Handle 0x0027, DMI type 211, 13 bytes + OEM-specific Type + Header and Data: + D3 0D 27 00 01 00 00 00 00 02 03 04 04 + Strings: + Front + + Handle 0x0028, DMI type 212, 57 bytes + OEM-specific Type + Header and Data: + D4 39 28 00 70 00 71 00 01 49 50 48 9C 00 49 FC + 01 9B 00 49 FC 00 7F 01 4A FB 04 80 01 4A FB 00 + 53 01 4A F7 08 52 01 4A F7 08 7B 01 4A EF 10 7C + 01 4A EF 10 FF FF 00 00 00 + + Handle 0x002A, DMI type 217, 8 bytes + OEM-specific Type + Header and Data: + D9 08 2A 00 01 02 00 00 + Strings: + + Handle 0x002B, DMI type 219, 11 bytes + OEM-specific Type + Header and Data: + DB 0B 2B 00 00 01 02 03 00 04 05 + Strings: + + Handle 0x002C, DMI type 220, 22 bytes + OEM-specific Type + Header and Data: + DC 16 2C 00 01 F0 00 00 02 F0 00 00 00 00 03 F0 + 04 F0 00 00 00 00 + + Handle 0x002D, DMI type 221, 19 bytes + OEM-specific Type + Header and Data: + DD 13 2D 00 00 00 00 00 00 03 00 00 00 00 00 00 + 00 00 00 + + Handle 0x002E, DMI type 222, 16 bytes + OEM-specific Type + Header and Data: + DE 10 2E 00 01 08 FF FF 00 00 00 00 00 00 00 00 + + Handle 0x0014, DMI type 16, 15 bytes + Physical Memory Array + Location: System Board Or Motherboard + Use: System Memory + Error Correction Type: None + Maximum Capacity: 16 GB + Error Information Handle: Not Provided + Number Of Devices: 2 + + Handle 0x0016, DMI type 20, 19 bytes + Memory Device Mapped Address + Starting Address: 0x00000000000 + Ending Address: 0x000FFFFFFFF + Range Size: 4 GB + Physical Device Handle: 0x0015 + Memory Array Mapped Address Handle: 0x0018 + Partition Row Position: 1 + Interleave Position: 1 + Interleaved Data Depth: 1 + + Handle 0x0017, DMI type 17, 28 bytes + Memory Device + Array Handle: 0x0014 + Error Information Handle: 0x0000 + Total Width: Unknown + Data Width: Unknown + Size: No Module Installed + Form Factor: DIMM + Set: None + Locator: DIMM_B + Bank Locator: BANK 2 + Type: Unknown + Type Detail: None + Speed: Unknown + Manufacturer: Not Specified + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Rank: Unknown + + Handle 0x0018, DMI type 19, 15 bytes + Memory Array Mapped Address + Starting Address: 0x00000000000 + Ending Address: 0x000FFFFFFFF + Range Size: 4 GB + Physical Array Handle: 0x0014 + Partition Width: 2 + + Handle 0x002F, DMI type 13, 22 bytes + BIOS Language Information + Language Description Format: Abbreviated + Installable Languages: 1 + eng + Currently Installed Language: eng + + Handle 0x0030, DMI type 131, 64 bytes + OEM-specific Type + Header and Data: + 83 40 30 00 31 00 00 00 00 00 00 00 00 00 00 00 + F8 00 4B 1C FF FF FF FF 01 00 00 00 00 00 07 00 + AD 04 04 00 00 00 00 00 C8 00 FF FF 00 00 00 00 + 00 00 00 00 32 00 00 00 76 50 72 6F 00 00 00 00 + + Handle 0x0029, DMI type 216, 9 bytes + OEM-specific Type + Header and Data: + D8 09 29 00 01 02 01 00 00 + Strings: + INTEL + 0000 + + Handle 0x0000, DMI type 0, 24 bytes + BIOS Information + Vendor: Dell Inc. + Version: A05 + Release Date: 08/03/2012 + Address: 0xF0000 + Runtime Size: 64 kB + ROM Size: 2048 kB + Characteristics: + MCA is supported + PCI is supported + BIOS is upgradeable + BIOS shadowing is allowed + ESCD support is available + Boot from CD is supported + Selectable boot is supported + BIOS ROM is socketed + EDD is supported + 5.25"/1.2 MB floppy services are supported (int 13h) + 3.5"/720 kB floppy services are supported (int 13h) + 3.5"/2.88 MB floppy services are supported (int 13h) + Print screen service is supported (int 5h) + 8042 keyboard services are supported (int 9h) + Serial services are supported (int 14h) + Printer services are supported (int 17h) + CGA/mono video services are supported (int 10h) + ACPI is supported + USB legacy is supported + ATAPI Zip drive boot is supported + BIOS boot specification is supported + Targeted content distribution is supported + BIOS Revision: 0.5 + Firmware Revision: 0.5 + + Handle 0x0002, DMI type 2, 15 bytes + Base Board Information + Manufacturer: Dell Inc. + Product Name: 01HXXJ + Version: A05 + Serial Number: .JSQ7PA1.CN7117623M00J2. + Asset Tag: Not Specified + Features: + Board is a hosting board + Board is replaceable + Location In Chassis: To Be Filled By O.E.M. + Chassis Handle: 0x0003 + Type: Motherboard + Contained Object Handles: 0 + + Handle 0x0003, DMI type 3, 21 bytes + Chassis Information + Manufacturer: Dell Inc. + Type: Portable + Lock: Not Present + Version: Not Specified + Serial Number: JSR1 + Asset Tag: Not Specified + Boot-up State: Safe + Power Supply State: Safe + Thermal State: Safe + Security Status: None + OEM Information: 0x00000000 + Height: Unspecified + Number Of Power Cords: 1 + Contained Elements: 0 + + Handle 0x0001, DMI type 1, 27 bytes + System Information + Manufacturer: Dell Inc. + Product Name: Inspiron N5050 + Version: Not Specified + Serial Number: JSR1 + UUID: 4C4C4544-0053-5110-8029-CAC05241 + Wake-up Type: Power Switch + SKU Number: To be filled by O.E.M. + Family: + + Handle 0x0024, DMI type 208, 12 bytes + OEM-specific Type + Header and Data: + D0 0C 24 00 02 05 FE 00 04 05 01 02 + Strings: + 20120323 + 20120323 + + Handle 0x0011, DMI type 10, 6 bytes + On Board Device Information + Type: Video + Status: Enabled + Description: Mobile Intel SandyBridge HD Graphics + + Handle 0x0015, DMI type 17, 28 bytes + Memory Device + Array Handle: 0x0014 + Error Information Handle: 0x0000 + Total Width: 64 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: SODIMM + Set: None + Locator: DIMM_A + Bank Locator: BANK 0 + Type: DDR3 + Type Detail: Synchronous + Speed: 1067 MHz + Manufacturer: 014F + Serial Number: 0009F2 + Asset Tag: 54114000 + Part Number: JM1066-4G + Rank: Unknown + + Handle 0x0031, DMI type 127, 4 bytes + End Of Table + +好了,就是这样。周末愉快! + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/linux-basics-how-to-find-maximum-supported-ram-by-your-system/ + +作者:[SK][0] +译者:[mr-ping](https://github.com/mr-ping) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[0]:https://www.unixmen.com/author/sk/ diff --git a/translated/tech/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md b/translated/tech/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md new file mode 100644 index 0000000000..b086684614 --- /dev/null +++ b/translated/tech/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md @@ -0,0 +1,45 @@ +Linux 基础:如何修复Ubuntu上“E: /var/cache/apt/archives/ subprocess new pre-removal script returned error exit status 1 ”的错误 +================================================================================ +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/04/ubuntu-790x558.png) + +今天,我在更新VirtualBox新版本的时候遇到了一个问题。 + +> E: /var/cache/apt/archives/ subprocess new pre-removal script returned error exit status 1 + +![](https://www.unixmen.com/wp-content/uploads/2015/03/Update-Manager_0011.png) + +### 解决: ### + +我google了以下并找到了方法。下面是我解决的方法。 + + sudo apt-get clean + sudo apt-get update && sudo apt-get upgrade + +这样几乎可以修复这个问题了。 + +如果你仍然有问题,那就试试下面的命令: + + sudo dpkg --configure -a + sudo apt-get -f install + +或者你可以按照下面的方法从[Oracle VirtualBox][1]官网下载最新版本并安装。 + + sudo apt-get update + sudo dpkg -i virtualbox-4.3_4.3.24-98716~Ubuntu~raring_amd64.deb + sudo apt-get -f install + sudo apt-get autoclean && sudo apt-get autoremove + +干杯! + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/linux-basics-how-to-fix-e-varcacheaptarchives-subprocess-new-pre-removal-script-returned-error-exit-status-1-in-ubuntu/ + +作者:[SK][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.unixmen.com/author/sk/ +[1]:https://www.virtualbox.org/wiki/Downloads diff --git a/translated/tech/20150304 Monitoring Your Network And Servers With Observium.md b/translated/tech/20150304 Monitoring Your Network And Servers With Observium.md new file mode 100644 index 0000000000..9c78793904 --- /dev/null +++ b/translated/tech/20150304 Monitoring Your Network And Servers With Observium.md @@ -0,0 +1,172 @@ + +使用Observium来监控你的网络和服务器 +================================================================================ +### 简介### + +在监控你的服务器,交换机或者物理机器时有过问题吗?, **Observium**可以满足你的需求.作为一个免费的监控系统,可以帮助你远程监控你的服务器.它是一个由PHP编写的基于自动发现SNMP的网络监控平台,支持非常广泛的网络硬件和操作系统,包括 Cisco,Windows,Linux,HP,NetApp等.在此我会通过在Ubuntu12.04上设置一个**Observium**服务器的同时提供相应的步骤. + +![](https://www.unixmen.com/wp-content/uploads/2015/03/Capture1.png) + +目前存在两种不同的**observium**版本. + +- Observium 社区版本是一个在QPL开源许可证下的免费工具,这个版本时对于较小部署的最好解决方案. 该版本每6个月得到一次安全性更新. +- 第2个版本是Observium Professional, 该版本在基于SVN的发布机制下的发行版. 会得到每日安全性更新. 该工具适用于服务提供商和企业级部署. + +更多信息可以通过其官网获得[website of Observium][1]. + +### 系统需求### + +为了安装 **Observium**, 需要具有一个最新安装的服务器。**Observium**是在Ubuntu LTS和Debian系统上进行开发的,所以推荐在Ubuntu或Debian上安装**Observium**,因为可能在别的平台上会有一些小问题。 + +该文章会知道你如何在Ubuntu12.04上进行安装**Observium**。对于小型的**Observium**安装,推荐的基础配置要有256MB内存和双核处理器。 + +### 安装需求 ### + +在安装**Observuim**之前,你需要确认安装所有的依赖关系包。 + +首先,使用下面的命令更新的服务器: + + sudo apt-get update + +然后你需要安装运行Observuim 所需的全部包。 + +Observium需要使用下面所列出的软件才能正确的运行: + +- LAMP server +- fping +- Net-SNMP 5.4+ +- RRDtool 1.3+ +- Graphviz + +对于可选特性的要求: + +- Ipmitool - 只有当你想要探寻IPMI(Intelligent Platform Management Interface智能平台管理接口)基板控制器。 +- Libvirt-bin - 只有当你想要使用libvirt进行远程VM主机监控时。 + + sudo apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-json php-pear snmp fping mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick libvirt ipmitool + +### 为Observium创建MySQL 数据库和用户。 + +现在你需要登录到MySQL中并为**Observium**创建数据库: + mysql -u root -p + +在用户验证成功之后,你需要按照下面的命令创建该数据库。 + + CREATE DATABASE observium; + +数据库名为**Observium**,稍后你会需要这个信息。 + +现在你需要创建数据库管理员用户。 + + CREATE USER observiumadmin@localhost IDENTIFIED BY 'observiumpassword'; + +接下来,你需要给该管理员用户相应的权限来管理创建的数据库。 + + GRANT ALL PRIVILEGES ON observium.* TO observiumadmin@localhost; + +你需要将权限信息写回到磁盘中来激活新的MySQL用户: + + FLUSH PRIVILEGES; + exit + +### 下载并安装 Observium### + +现在我们的系统已经准备好了, 可以开始Observium的安装了。 + +第一步,创建Observium将要使用的文件目录: + mkdir -p /opt/observium && cd /opt + +为了达到本教程的目的,我们将会使用Observium的社区/开源版本。使用下面的命令下载并解压: + + wget http://www.observium.org/observium-community-latest.tar.gz + tar zxvf observium-community-latest.tar.gz + +现在进入到Observium目录。 + + cd observium + +将默认的配置文件'**config.php.default**'复制到'**config.php**',并将数据库配置选项填充到配置文件中: + + cp config.php.default config.php + nano config.php + +---------- + + / Database config + $config['db_host'] = 'localhost'; + $config['db_user'] = 'observiumadmin'; + $config['db_pass'] = 'observiumpassword'; + $config['db_name'] = 'observium'; + +现在为MySQL数据库设置默认的数据库模式: + php includes/update/update.php + +现在你需要创建一个文件目录来存储rrd文件,并修改其权限以便让apache能将写入到文件中。 + + mkdir rrd + chown apache:apache rrd + +为了在出现问题时进行问题修理,你需要创建日志文件。 + + mkdir -p /var/log/observium + chown apache:apache /var/log/observium + +现在你需要为Observium创建虚拟主机配置。 + + + DocumentRoot /opt/observium/html/ + ServerName observium.domain.com + CustomLog /var/log/observium/access_log combined + ErrorLog /var/log/observium/error_log + + AllowOverride All + Options FollowSymLinks MultiViews + + + +下一步你需要让你的Apache服务器的rewrite(重写)功能生效。 + +为了让'mod_rewrite'生效,输入以下命令: + + sudo a2enmod rewrite + +该模块在下一次Apache服务重启之后就会生效。 + + sudo service apache2 restart + +###配置Observium### + +在登入网络接口之前,你需要为Observium创建一个管理员账户(级别10)。 + + # cd /opt/observium + # ./adduser.php admin adminpassword 10 + User admin added successfully. + +下一步为发现和探寻工作设置一个cron任务,创建一个新的文件‘**/etc/cron.d/observium**’ 并在其中添加以下的内容。 + + 33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1 + */5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1 + */5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1 + +重载cron进程来获取系的人物实体。 + + # /etc/init.d/cron reload + +好啦,你已经完成了Observium服务器的安装拉! 使用你的浏览器登录到**http://**,然后上路巴。 + +![](https://www.unixmen.com/wp-content/uploads/2015/03/Capture.png) + +尽情享受吧! + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/monitoring-network-servers-observium/ + +作者:[anismaj][a] +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.unixmen.com/author/anis/ +[1]:http://www.observium.org/ diff --git a/translated/tech/20150306 Nmap--Not Just for Evil.md b/translated/tech/20150306 Nmap--Not Just for Evil.md new file mode 100644 index 0000000000..ba923d178d --- /dev/null +++ b/translated/tech/20150306 Nmap--Not Just for Evil.md @@ -0,0 +1,41 @@ +Nmap--不只是邪恶. +================================================================================ +如果SSH是系统管理员世界的"瑞士军刀"的话,那么Nmap就是一盒炸药. 炸药很容易被误用然后将你的双脚崩掉,但是也是一个很有威力的工具,能够胜任一些看似无法完成的任务. + +大多数人想到Nmap时,他们想到的是扫描服务器,查找开放端口来实施工具. 然而,在过去的这些年中,同样的超能力在当你管理服务器或计算机遇到问题时变得难以置信的有用.无论是你试图找出在你的网络上有哪些类型的服务器使用了指定的IP地址,或者尝试锁定一个新的NAS设备,以及扫描网络等,都会非常有用. + +图1显示了我的QNAP NAS的网络扫描.我使用该单元的唯一目的是为了NFS和SMB文件共享,但是你可以看到,它包含了一大堆大开大敞的端口.如果没有Nmap,很难发现机器到底在运行着什么玩意儿. + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11825nmapf1.jpg) + +### 图1 网络扫描 ### + +另外一个无法想象的用处是用它来扫描一个网络.你甚至根本不需要root的访问权限,而且你也可以非常容易地来指定你想要扫描的网络块,例如,输入: + + nmap 192.168.1.0/24 + +上述命令会扫描我局部网络中全部的254个可用的IP地址,让我可以知道那个使可以Ping的,以及那些端口时开放的.如果你刚刚插入一片新的硬件,但是不知道它通过DHCP获取的IP地址,那么此时Nmap就是无价之宝. 例如,上述命令在我的网络中揭示了这个问题. + + Nmap scan report for TIVO-8480001903CCDDB.brainofshawn.com (192.168.1.220) + Host is up (0.0083s latency). + Not shown: 995 filtered ports + PORT STATE SERVICE + 80/tcp open http + 443/tcp open https + 2190/tcp open tivoconnect + 2191/tcp open tvbus + 9080/tcp closed glrpc + +它不仅显示了新的Tivo单元,而且还告诉我那些端口是开放的. 由于它的可靠性,可用性以及黑色边框帽子的能力,Nmap获得了本月的 <<编辑推荐>>奖. 这不是一个新的程序,但是如果你是一个linux用户的话,你应该玩玩它. + +-------------------------------------------------------------------------------- + +via: http://www.linuxjournal.com/content/nmap%E2%80%94not-just-evil + +作者:[Shawn Powers][a] +译者:[theo-l](https://github.com/theo-l) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxjournal.com/users/shawn-powers