diff --git a/translated/tech/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md b/published/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md similarity index 78% rename from translated/tech/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md rename to published/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md index 273d949490..57ff68b6d2 100644 --- a/translated/tech/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md +++ b/published/20141204 The Easy Way to Keep Track of Multiple Time Zones in Ubuntu.md @@ -2,13 +2,13 @@ Ubuntu中跟踪多个时区的简捷方法 ================================================================================ ![date-time](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/date-time.jpg) -**我是否要确保在我醒来时或者安排与*山姆陈*,Ohso的半个开发商,进行Skype通话时,澳大利亚一个关于Chromebook销售的推特已经售罄,我大脑同时在多个时区下工作。** +**无论我是要在醒来时发个关于澳大利亚的 Chromebook 销售已经售罄的推特,还是要记着和Ohso的半个开发商山姆陈进行Skype通话,我大脑都需要同时工作在多个时区下。** 那里头有个问题,如果你认识我,你会知道我的脑容量也就那么丁点,跟金鱼差不多,里头却塞着像Windows Vista这样一个臃肿货(也就是,不是很好)。我几乎记不得昨天之前的事情,更记不得我的门和金门大桥脚之间的时间差! -作为臂助,我使用一些小部件和菜单项来让我保持同步。在我常规工作日的空间里,我在多个操作系统间游弋,涵盖移动系统和桌面系统,但只有一个让我最快速便捷地设置“世界时钟”。 +作为臂助,我使用一些小部件和菜单项来让我保持同步。在我常规工作日的空间里,我在多个操作系统间游弋,涵盖移动系统和桌面系统,但只有一个可以让我最快速便捷地设置“世界时钟”。 -**而它刚好是那个名字放在门上方的东西。** +**它的名字就是我们标题上提到的那个。** ![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/timezones-300x180.jpg) @@ -16,10 +16,10 @@ Ubuntu中跟踪多个时区的简捷方法 Unity中默认的日期-时间指示器提供了添加并查看多个时区的支持,不需要附加组件,不需要额外的包。 -1. 点击时钟小应用,然后uxuanze‘**时间和日期设置**’条目 +1. 点击时钟小应用,然后选择‘**时间和日期设置**’条目 1. 在‘**时钟**’标签中,选中‘**其它位置的时间**’选框 1. 点击‘**选择位置**’按钮 -1. 点击‘**+**’,然后输入位置名称那个 +1. 点击‘**+**’,然后输入位置名称 #### 其它桌面环境 #### @@ -34,13 +34,13 @@ Unity中默认的日期-时间指示器提供了添加并查看多个时区的 ![World Clock Calendar in Cinnamon 2.4](http://www.omgubuntu.co.uk/wp-content/uploads/2014/12/cinnamon-applet.jpg) -Cinnamon 2.4中的世界时钟日历 +*Cinnamon 2.4中的世界时钟日历* -**XFCE**和**LXDE**就不那么慷慨了,除了自带的“工作区”作为**多个时钟**添加到面板外,每个都需要手动配置以指定位置。两个都支持‘指示器小部件’,所以,如果你没有依赖于Unity,你可以安装/添加单独的日期/时间指示器。 +**XFCE**和**LXDE**就不那么慷慨了,除了自带的“工作区”作为**多个时钟**添加到面板外,每个都需要手动配置以指定位置。两个都支持‘指示器小部件’,所以,如果你不用Unity的话,你可以安装/添加单独的日期/时间指示器。 -**Budgie**还刚初出茅庐,不足以胜任角落里的需求,因为Pantheon我还没试过——希望你们通过评论来让我知道得更多。 +**Budgie**还刚初出茅庐,不足以胜任这种角落里的需求,因为Pantheon我还没试过——希望你们通过评论来让我知道得更多。 -#### Desktop Apps, Widgets & Conky Themes桌面应用、不见和Conky主题 #### +#### 桌面应用、部件和Conky主题 #### 当然,面板小部件只是收纳其它国家多个时区的一种方式。如果你不满意通过面板去访问,那里还有各种各样的**桌面应用**可供使用,其中许多都可以跨版本,甚至跨平台使用。 @@ -54,7 +54,7 @@ via: http://www.omgubuntu.co.uk/2014/12/add-time-zones-world-clock-ubuntu 作者:[Joey-Elijah Sneddon][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/20141210 How to configure rsyslog client for remote logging on CentOS.md b/published/20141210 How to configure rsyslog client for remote logging on CentOS.md similarity index 72% rename from translated/tech/20141210 How to configure rsyslog client for remote logging on CentOS.md rename to published/20141210 How to configure rsyslog client for remote logging on CentOS.md index 08f4c00822..08cda11f5e 100644 --- a/translated/tech/20141210 How to configure rsyslog client for remote logging on CentOS.md +++ b/published/20141210 How to configure rsyslog client for remote logging on CentOS.md @@ -1,8 +1,8 @@ CentOS上配置rsyslog客户端用以远程记录日志 ================================================================================ -**rsyslog**是一个开源工具,被广泛用于Linux系统以通过TCP/UDP协议转发或接收日志消息。rsyslog守护进程可以被配置称两种环境,一种是配置成日志收集服务器,rsyslog进程可以从网络中收集所有其它主机上的日志数据,这些主机已经将日志配置为发送到服务器。rsyslog的另外一个角色,就是可以配置为客户端,用来过滤和发送内部日志消息到本地文件夹(如/var/log)或一台可以路由到的远程rsyslog服务器上。 +**rsyslog**是一个开源工具,被广泛用于Linux系统以通过TCP/UDP协议转发或接收日志消息。rsyslog守护进程可以被配置成两种环境,一种是配置成日志收集服务器,rsyslog进程可以从网络中收集其它主机上的日志数据,这些主机会将日志配置为发送到另外的远程服务器。rsyslog的另外一个用法,就是可以配置为客户端,用来过滤和发送内部日志消息到本地文件夹(如/var/log)或一台可以路由到的远程rsyslog服务器上。 -假定你的网络中已经有一台rsyslog服务器[已经起来并且处于运行中][1],本指南将为你展示如何来设置CentOS系统将其内部日志消息路由到一台远程rsyslog服务器上。这将大大改善你的系统磁盘空间的使用,尤其是你还没有一个独立的用于/var目录的大分区。 +假定你的网络中已经有一台[已经配置好并启动的][1]rsyslog服务器,本指南将为你展示如何来设置CentOS系统将其内部日志消息路由到一台远程rsyslog服务器上。这将大大改善你的系统磁盘空间的使用,尤其是当你还没有一个用于/var目录的独立的大分区。 ### 步骤一: 安装Rsyslog守护进程 ### @@ -35,9 +35,9 @@ CentOS上配置rsyslog客户端用以远程记录日志 *.* @@192.168.1.25:514 -注意,你也可以将rsyslog服务器的IP地址替换成它的DNS名称(FQDN)。 +注意,你也可以将rsyslog服务器的IP地址替换成它的主机名(FQDN)。 -如果你只想要转发指定设备的日志消息,比如说内核设备,那么你可以在rsyslog配置文件中使用以下声明。 +如果你只想要转发服务器上的指定设备的日志消息,比如说内核设备,那么你可以在rsyslog配置文件中使用以下声明。 kern.* @192.168.1.25:514 @@ -51,9 +51,11 @@ CentOS上配置rsyslog客户端用以远程记录日志 # service rsyslog restart -在另外一种环境中,让我们假定你已经在机器上安装了一个名为“foobar”的应用程序,它会在/var/log下生成foobar.log日志文件。现在,你只想要将它的日志定向到rsyslog服务器,这可以通过像下面这样在rsyslog配置文件中加载imfile模块来实现。 +####非 syslog 日志的转发 -首先,加载imfile模块,这必须只做一次。 +在另外一种环境中,让我们假定你已经在机器上安装了一个名为“foobar”的应用程序,它会在/var/log下生成foobar.log日志文件。现在,你想要将它的日志定向到rsyslog服务器,这可以通过像下面这样在rsyslog配置文件中加载imfile模块来实现。 + +首先,加载imfile模块,这只需做一次。 module(load="imfile" PollingInterval="5") @@ -73,8 +75,7 @@ CentOS上配置rsyslog客户端用以远程记录日志 ### 步骤三: 让Rsyslog进程自动启动 ### -To automatically start rsyslog client after every system reboot, run the following command to enable it system-wide: -要让rsyslog客户端在每次系统重启后自动启动,请运行以下命令来在系统范围启用: +要让rsyslog客户端在每次系统重启后自动启动,请运行以下命令: **CentOS 7:** @@ -86,7 +87,7 @@ To automatically start rsyslog client after every system reboot, run the followi ### 小结 ### -在本教程中,我演示了如何将CentOS系统转变成rsyslog客户端以强制它发送日志消息到远程rsyslog服务器。这里我假定rsyslog客户端和服务器之间的连接是安全的(如,在有防火墙保护的公司网络中)。不管在任何情况下,都不要配置rsyslog客户端将日志消息通过不安全的网络转发,或者,特别是通过互联网转发,因为syslog协议是一个明文协议。要进行安全传输,可以考虑使用[TLS/SSL][2]来加密日志消息。 +在本教程中,我演示了如何将CentOS系统转变成rsyslog客户端以强制它发送日志消息到远程rsyslog服务器。这里我假定rsyslog客户端和服务器之间的连接是安全的(如,在有防火墙保护的公司网络中)。不管在任何情况下,都不要配置rsyslog客户端将日志消息通过不安全的网络转发,或者,特别是通过互联网转发,因为syslog协议是一个明文协议。要进行安全传输,可以考虑使用[TLS/SSL][2]来加密日志消息的传输。 -------------------------------------------------------------------------------- @@ -94,7 +95,7 @@ via: http://xmodulo.com/configure-rsyslog-client-centos.html 作者:[Caezsar M][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/talk/20141223 20 Linux Commands Interview Questions & Answers.md b/published/20141223 20 Linux Commands Interview Questions & Answers.md similarity index 71% rename from translated/talk/20141223 20 Linux Commands Interview Questions & Answers.md rename to published/20141223 20 Linux Commands Interview Questions & Answers.md index 40d5019c52..d7e20f6b24 100644 --- a/translated/talk/20141223 20 Linux Commands Interview Questions & Answers.md +++ b/published/20141223 20 Linux Commands Interview Questions & Answers.md @@ -8,7 +8,7 @@ 答: 用 “route -n” 和 “netstat -nr” 命令,我们可以查看默认网关。除了默认的网关信息,这两个命令还可以显示当前的路由表。 -**问:3 如何在Linux上重建初始化内存盘影响文件?** +**问:3 如何在Linux上重建初始化内存盘镜像文件?** 答: 在CentOS 5.X / RHEL 5.X中,可以用mkinitrd命令来创建初始化内存盘文件,举例如下: @@ -30,7 +30,7 @@ **问:5 patch命令是什么?如何使用?** -答: 顾名思义,patch命令就是用来将修改(或补丁)写进文本文件里。Patch命令通常是接收diff的输出并把文件的旧版本转换为新版本。举个例子,Linux内核源代码由百万行代码文件构成,所以无论何时,任何代码贡献者贡献出代码,只需发送改动的部分而不是整个源代码,然后接收者用patch命令将改动写进原始的源代码里。 +答: 顾名思义,patch命令就是用来将修改(或补丁)写进文本文件里。patch命令通常是接收diff的输出并把文件的旧版本转换为新版本。举个例子,Linux内核源代码由百万行代码文件构成,所以无论何时,任何代码贡献者贡献出代码,只需发送改动的部分而不是整个源代码,然后接收者用patch命令将改动写进原始的源代码里。 创建一个diff文件给patch使用, @@ -44,7 +44,7 @@ **问:6 aspell有什么用 ?** -答: 顾名思义,aspell就是Linux操作系统上的一款交互式拼写检查器。aspell命令继任了更早的一个名为ispell的程序,并且作为一款嵌入式替代品 ,最重要的是它非常好用。当aspell程序主要被其它一些需要拼写检查能力的程序所使用的时候,在命令行中作为一个独立运行的工具的它也能十分有效。 +答: 顾名思义,aspell就是Linux操作系统上的一款交互式拼写检查器。aspell命令继任了更早的一个名为ispell的程序,并且作为一款免费替代品 ,最重要的是它非常好用。当aspell程序主要被其它一些需要拼写检查能力的程序所使用的时候,在命令行中作为一个独立运行的工具的它也能十分有效。 **问:7 如何从命令行查看域SPF记录?** @@ -56,7 +56,7 @@ 答: # rpm -qf /etc/fstab -以上命令能列出供应给“/etc/fstab”文件的包。 +以上命令能列出提供“/etc/fstab”这个文件的包。 **问:9 哪条命令用来查看bond0的状态?** @@ -64,7 +64,7 @@ **问:10 Linux系统中的/proc文件系统有什么用?** -答: /proc文件系统是一个基于维护关于当前正在运行的内核状态信息的文件系统的随机存取存储器(RAM),其中包括CPU、内存、分区划分、I/O地址、直接内存访问通道和正在运行的进程。这个文件系统所代表的是各种不实际存储信息的文件,它们指向的是内存里的信息。/proc文件系统是由系统自动维护的。 +答: /proc文件系统是一个基于内存的文件系统,其维护着关于当前正在运行的内核状态信息,其中包括CPU、内存、分区划分、I/O地址、直接内存访问通道和正在运行的进程。这个文件系统所代表的并不是各种实际存储信息的文件,它们指向的是内存里的信息。/proc文件系统是由系统自动维护的。 **问:11 如何在/usr目录下找出大小超过10MB的文件?** @@ -78,21 +78,21 @@ 答: # find /var \\! -atime -90 -**问:14 在整个目录树下查找核心文件,如发现则删除它们且不提示确认信息。** +**问:14 在整个目录树下查找文件“core”,如发现则无需提示直接删除它们。** 答: # find / -name core -exec rm {} \; **问:15 strings命令有什么作用?** -答: strings命令用来提取和显示非文本文件的清晰内容。 +答: strings命令用来提取和显示非文本文件中的文本字符串。(LCTT 译注:当用来分析你系统上莫名其妙出现的二进制程序时,可以从中找到可疑的文件访问,对于追查入侵有用处) -**问:16 tee filter有什么作用 ?** +**问:16 tee 过滤器有什么作用 ?** -答: tee filter用来向多个目标发送输出内容。它可以向一个文件发送一份输出的拷贝并且如果使用管道的话可以在屏幕上(或一些其它程序)输出其它内容。 +答: tee 过滤器用来向多个目标发送输出内容。如果用于管道的话,它可以将输出复制一份到一个文件,并复制另外一份到屏幕上(或一些其它程序)。 linuxtechi@localhost:~$ ll /etc | nl | tee /tmp/ll.out -在以上例子中,从ll输出的是在 /tmp/ll.out 文件中被捕获的,输出同样在屏幕上显示了出来。 +在以上例子中,从ll输出可以捕获到 /tmp/ll.out 文件中,并且同样在屏幕上显示了出来。 **问:17 export PS1 = ”$LOGNAME@`hostname`:\$PWD: 这条命令是在做什么?** @@ -108,7 +108,7 @@ **问:20 linux中lspci命令的作用是什么?** -答: lspci命令用来显示你的系统上PCI总线和附加设备的信息。指定-v,-vv或-vvv来获取详细输出,加上-r参数的话,命令的输出则会更具有易读性。 +答: lspci命令用来显示你的系统上PCI总线和附加设备的信息。指定-v,-vv或-vvv来获取越来越详细的输出,加上-r参数的话,命令的输出则会更具有易读性。 -------------------------------------------------------------------------------- @@ -116,7 +116,7 @@ via: http://www.linuxtechi.com/20-linux-commands-interview-questions-answers/ 作者:[Pradeep Kumar][a] 译者:[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/tech/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md b/published/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md similarity index 79% rename from translated/tech/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md rename to published/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md index 0c7a0110b1..28cef519f8 100644 --- a/translated/tech/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md +++ b/published/20141224 Linux FAQs with Answers--How to install Kingsoft Office on Linux.md @@ -1,13 +1,11 @@ -Linux有问必答 - linux如何安装WPS +Linux有问必答 - 如何在linux上安装WPS ================================================================================ > **问题**: 我听说一个好东西Kingsoft Office(译注:就是WPS),所以我想在我的Linux上试试。我怎样才能安装Kingsoft Office呢? -Kingsoft Office 一套办公套件,支持多个平台,包括Windows, Linux, iOS 和 Android。它包含三个组件:Writer(WPS文字)用来文字处理,Presentation(WPS演示)支持幻灯片,Spereadsheets(WPS表格)为电子表格。使用免费增值模式,其中基础版本是免费使用。比较其他的linux办公套件,如LibreOffice、 OpenOffice,最大优势在于,Kingsoft Office能最好的兼容微软的Office(译注:版权问题?了解下wps和Office的历史问题,可以得到一些结论)。因此如果你需要在windowns和linux平台间交互,Kingsoft office是一个很好的选择。 - +Kingsoft Office 是一套办公套件,支持多个平台,包括Windows, Linux, iOS 和 Android。它包含三个组件:Writer(WPS文字)用来文字处理,Presentation(WPS演示)支持幻灯片,Spereadsheets(WPS表格)是电子表格。其使用免费增值模式,其中基础版本是免费使用。比较其他的linux办公套件,如LibreOffice、 OpenOffice,其最大优势在于,Kingsoft Office能最好的兼容微软的Office(译注:版权问题?了解下wps和Office的历史问题,可以得到一些结论)。因此如果你需要在windows和linux平台间交互,Kingsoft office是一个很好的选择。 ### CentOS, Fedora 或 RHEL中安装Kingsoft Office ### - 在[官方页面][1]下载RPM文件.官方RPM包只支持32位版本linux,但是你可以在64位中安装。 需要使用yum命令并用"localinstall"选项来本地安装这个RPM包 @@ -39,7 +37,7 @@ DEB包同样遇到一堆依赖。因此使用[gdebi][3]命令来代替dpkg来自 ### 启动 Kingsoft Office ### -安装完成后,你就可以在桌面管理器轻松启动Witer(WPS文字), Presentation(WPS演示), and Spreadsheets(WPS表格),如下图 +安装完成后,你就可以在桌面管理器轻松启动Witer(WPS文字), Presentation(WPS演示), and Spreadsheets(WPS表格),如下图。 Ubuntu Unity中: @@ -49,7 +47,7 @@ GNOME桌面中: ![](https://farm9.staticflickr.com/8617/16039583622_4e7c1d8545_b.jpg) -不但如此,你也可以在命令行中启动Kingsoft Office +不但如此,你也可以在命令行中启动Kingsoft Office。 启动Wirter(WPS文字),使用这个命令: @@ -74,7 +72,7 @@ GNOME桌面中: via: http://ask.xmodulo.com/install-kingsoft-office-linux.html 译者:[Vic020/VicYu](http://www.vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20100105 How to Backup and Restore Your Apps and PPAs in Ubuntu Using Aptik.md b/published/201501/20100105 How to Backup and Restore Your Apps and PPAs in Ubuntu Using Aptik.md similarity index 100% rename from published/20100105 How to Backup and Restore Your Apps and PPAs in Ubuntu Using Aptik.md rename to published/201501/20100105 How to Backup and Restore Your Apps and PPAs in Ubuntu Using Aptik.md diff --git a/published/20140701 Easy File Comparisons With These Great Free Diff Tools.md b/published/201501/20140701 Easy File Comparisons With These Great Free Diff Tools.md similarity index 100% rename from published/20140701 Easy File Comparisons With These Great Free Diff Tools.md rename to published/201501/20140701 Easy File Comparisons With These Great Free Diff Tools.md diff --git a/published/20140910 With Apple Watch Unveiled, Could an Ubuntu Smartwatch Be Next.md b/published/201501/20140910 With Apple Watch Unveiled, Could an Ubuntu Smartwatch Be Next.md similarity index 100% rename from published/20140910 With Apple Watch Unveiled, Could an Ubuntu Smartwatch Be Next.md rename to published/201501/20140910 With Apple Watch Unveiled, Could an Ubuntu Smartwatch Be Next.md diff --git a/published/20140912 What' s wrong with IPv4 and Why we are moving to IPv6.md b/published/201501/20140912 What' s wrong with IPv4 and Why we are moving to IPv6.md similarity index 100% rename from published/20140912 What' s wrong with IPv4 and Why we are moving to IPv6.md rename to published/201501/20140912 What' s wrong with IPv4 and Why we are moving to IPv6.md diff --git a/published/20140915 10 Open Source Cloning Software For Linux Users.md b/published/201501/20140915 10 Open Source Cloning Software For Linux Users.md similarity index 100% rename from published/20140915 10 Open Source Cloning Software For Linux Users.md rename to published/201501/20140915 10 Open Source Cloning Software For Linux Users.md diff --git a/published/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md b/published/201501/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md similarity index 100% rename from published/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md rename to published/201501/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md diff --git a/published/20140928 What is a good subtitle editor on Linux.md b/published/201501/20140928 What is a good subtitle editor on Linux.md similarity index 100% rename from published/20140928 What is a good subtitle editor on Linux.md rename to published/201501/20140928 What is a good subtitle editor on Linux.md diff --git a/published/20140929 What Linux Users Should Know About Open Hardware.md b/published/201501/20140929 What Linux Users Should Know About Open Hardware.md similarity index 100% rename from published/20140929 What Linux Users Should Know About Open Hardware.md rename to published/201501/20140929 What Linux Users Should Know About Open Hardware.md diff --git a/published/20141008 How to configure HTTP load balancer with HAProxy on Linux.md b/published/201501/20141008 How to configure HTTP load balancer with HAProxy on Linux.md similarity index 100% rename from published/20141008 How to configure HTTP load balancer with HAProxy on Linux.md rename to published/201501/20141008 How to configure HTTP load balancer with HAProxy on Linux.md diff --git a/published/20141009 How to convert image audio and video formats on Ubuntu.md b/published/201501/20141009 How to convert image audio and video formats on Ubuntu.md similarity index 100% rename from published/20141009 How to convert image audio and video formats on Ubuntu.md rename to published/201501/20141009 How to convert image audio and video formats on Ubuntu.md diff --git a/published/20141013 How to configure peer-to-peer VPN on Linux.md b/published/201501/20141013 How to configure peer-to-peer VPN on Linux.md similarity index 100% rename from published/20141013 How to configure peer-to-peer VPN on Linux.md rename to published/201501/20141013 How to configure peer-to-peer VPN on Linux.md diff --git a/published/20141023 How to turn your CentOS box into a BGP router using Quagga.md b/published/201501/20141023 How to turn your CentOS box into a BGP router using Quagga.md similarity index 100% rename from published/20141023 How to turn your CentOS box into a BGP router using Quagga.md rename to published/201501/20141023 How to turn your CentOS box into a BGP router using Quagga.md diff --git a/published/20141023 What are useful Bash aliases and functions.md b/published/201501/20141023 What are useful Bash aliases and functions.md similarity index 100% rename from published/20141023 What are useful Bash aliases and functions.md rename to published/201501/20141023 What are useful Bash aliases and functions.md diff --git a/published/20141027 ntpq -p output.md b/published/201501/20141027 ntpq -p output.md similarity index 100% rename from published/20141027 ntpq -p output.md rename to published/201501/20141027 ntpq -p output.md diff --git a/published/20141106 5 Awesome Open Source Backup Software For Linux and Unix-like Systems.md b/published/201501/20141106 5 Awesome Open Source Backup Software For Linux and Unix-like Systems.md similarity index 100% rename from published/20141106 5 Awesome Open Source Backup Software For Linux and Unix-like Systems.md rename to published/201501/20141106 5 Awesome Open Source Backup Software For Linux and Unix-like Systems.md diff --git a/published/20141108 When hackers grow old.md b/published/201501/20141108 When hackers grow old.md similarity index 100% rename from published/20141108 When hackers grow old.md rename to published/201501/20141108 When hackers grow old.md diff --git a/published/20141112 How to Debug CPU Regressions Using Flame Graphs.md b/published/201501/20141112 How to Debug CPU Regressions Using Flame Graphs.md similarity index 100% rename from published/20141112 How to Debug CPU Regressions Using Flame Graphs.md rename to published/201501/20141112 How to Debug CPU Regressions Using Flame Graphs.md diff --git a/published/20141115 How to perform system backup with backup-manager on Linux.md b/published/201501/20141115 How to perform system backup with backup-manager on Linux.md similarity index 100% rename from published/20141115 How to perform system backup with backup-manager on Linux.md rename to published/201501/20141115 How to perform system backup with backup-manager on Linux.md diff --git a/published/20141115 What are some obscure but useful Vim commands.md b/published/201501/20141115 What are some obscure but useful Vim commands.md similarity index 100% rename from published/20141115 What are some obscure but useful Vim commands.md rename to published/201501/20141115 What are some obscure but useful Vim commands.md diff --git a/published/20141117 Restricting process CPU usage using nice cpulimit and cgroups.md b/published/201501/20141117 Restricting process CPU usage using nice cpulimit and cgroups.md similarity index 100% rename from published/20141117 Restricting process CPU usage using nice cpulimit and cgroups.md rename to published/201501/20141117 Restricting process CPU usage using nice cpulimit and cgroups.md diff --git a/published/20141118 How to boot on an ISO image from Grub.md b/published/201501/20141118 How to boot on an ISO image from Grub.md similarity index 100% rename from published/20141118 How to boot on an ISO image from Grub.md rename to published/201501/20141118 How to boot on an ISO image from Grub.md diff --git a/published/20141119 Smartctl--Monitoring & Analysis tool for Hard drive.md b/published/201501/20141119 Smartctl--Monitoring & Analysis tool for Hard drive.md similarity index 100% rename from published/20141119 Smartctl--Monitoring & Analysis tool for Hard drive.md rename to published/201501/20141119 Smartctl--Monitoring & Analysis tool for Hard drive.md diff --git a/published/20141120 How to configure and secure your Postfix email server.md b/published/201501/20141120 How to configure and secure your Postfix email server.md similarity index 100% rename from published/20141120 How to configure and secure your Postfix email server.md rename to published/201501/20141120 How to configure and secure your Postfix email server.md diff --git a/published/20141120 How to install an Opensource VPN Server on Linux.md b/published/201501/20141120 How to install an Opensource VPN Server on Linux.md similarity index 100% rename from published/20141120 How to install an Opensource VPN Server on Linux.md rename to published/201501/20141120 How to install an Opensource VPN Server on Linux.md diff --git a/published/20141124 Important 10 Linux ps command Practical Examples.md b/published/201501/20141124 Important 10 Linux ps command Practical Examples.md similarity index 100% rename from published/20141124 Important 10 Linux ps command Practical Examples.md rename to published/201501/20141124 Important 10 Linux ps command Practical Examples.md diff --git a/published/20141124 Linux blkid Command to Find Block Devices Details.md b/published/201501/20141124 Linux blkid Command to Find Block Devices Details.md similarity index 100% rename from published/20141124 Linux blkid Command to Find Block Devices Details.md rename to published/201501/20141124 Linux blkid Command to Find Block Devices Details.md diff --git a/published/20141125 Four ways Linux is headed for no-downtime kernel patching.md b/published/201501/20141125 Four ways Linux is headed for no-downtime kernel patching.md similarity index 100% rename from published/20141125 Four ways Linux is headed for no-downtime kernel patching.md rename to published/201501/20141125 Four ways Linux is headed for no-downtime kernel patching.md diff --git a/published/20141125 How to install Cacti (Monitoring tool) on ubuntu 14.10 server.md b/published/201501/20141125 How to install Cacti (Monitoring tool) on ubuntu 14.10 server.md similarity index 100% rename from published/20141125 How to install Cacti (Monitoring tool) on ubuntu 14.10 server.md rename to published/201501/20141125 How to install Cacti (Monitoring tool) on ubuntu 14.10 server.md diff --git a/published/20141127 Five Magnificent Linux Music Streaming Clients.md b/published/201501/20141127 Five Magnificent Linux Music Streaming Clients.md similarity index 100% rename from published/20141127 Five Magnificent Linux Music Streaming Clients.md rename to published/201501/20141127 Five Magnificent Linux Music Streaming Clients.md diff --git a/published/20141127 How To Create A Multiboot USB From Ubuntu Using MultiSystem.md b/published/201501/20141127 How To Create A Multiboot USB From Ubuntu Using MultiSystem.md similarity index 100% rename from published/20141127 How To Create A Multiboot USB From Ubuntu Using MultiSystem.md rename to published/201501/20141127 How To Create A Multiboot USB From Ubuntu Using MultiSystem.md diff --git a/published/201501/20141203 Docker--Present and Future.md b/published/201501/20141203 Docker--Present and Future.md new file mode 100644 index 0000000000..bdec540363 --- /dev/null +++ b/published/201501/20141203 Docker--Present and Future.md @@ -0,0 +1,158 @@ +Docker 的现状与未来 +================================================================================ + +### Docker - 迄今为止发生的那些事情 ### + +Docker 是一个专为 Linux 容器而设计的工具集,用于‘构建、交付和运行’分布式应用。它最初是 DotCloud 的一个开源项目,于2013年3月发布。这个项目越来越受欢迎,以至于 DotCloud 公司都更名为 Docker 公司(并最终[出售了原有的 PaaS 业务][1])。[Docker 1.0][2]是在2014年6月发布的,而且延续了之前每月更新一个版本的传统。 + +Docker 1.0版本的发布标志着 Docker 公司认为该平台已经充分成熟,足以用于生产环境中(由该公司与合作伙伴提供付费支持选择)。每个月发布的更新表明该项目正在迅速发展,比如增添一些新特性、解决一些他们发现的问题。该项目已经成功地分离了‘运行’和‘交付’两件事,所以来自任何版本的 Docker 镜像源都可以与其它版本共同使用(具备向前和向后兼容的特性),这为 Docker 应对快速变化提供了稳定的保障。 + +Docker 之所以能够成为最受欢迎的开源项目之一可能会被很多人看做是炒作,但是也是由其坚实的基础所决定的。Docker 的影响力已经得到整个行业许多大企业的支持,包括亚马逊, Canonical 公司, CenturyLink, 谷歌, IBM, 微软, New Relic, Pivotal, 红帽和 VMware。这使得只要有 Linux 的地方,Docker 就可以无处不在。除了这些鼎鼎有名的大公司以外,许多初创公司也在围绕着 Docker 发展,或者改变他们的发展方向来与 Docker 更好地结合起来。这些合作伙伴们(无论大或小)都将帮助推动 Docker 核心项目及其周边生态环境的快速发展。 + +### Docker 技术简要综述 ### + +Docker 利用 Linux 的一些内核机制例如 [cGroups][3]、命名空间和 [SElinux][4] 来实现容器之间的隔离。起初 Docker 只是 [LXC][5] 容器管理器子系统的前端,但是在 0.9 版本中引入了 [libcontainer][6],这是一个原生的 go 语言库,提供了用户空间和内核之间的接口。 + +容器是基于 [AUFS][7] 这样的联合文件系统的,它允许跨多个容器共享组件,如操作系统镜像和已安装的相关库。这种文件系统的分层方法也被 [Dockerfile][8] 的 DevOps 工具所利用,这些工具能够缓存成功完成的操作。这就省下了安装操作系统和相关应用程序依赖包的时间,极大地加速测试周期。另外,在容器之间的共享库也能够减少内存的占用。 + +一个容器是从一个镜像开始运行的,它可以来自本地创建,本地缓存,或者从一个注册库(registry)下载。Docker 公司运营的 [Docker Hub 公有注册库][9],为各种操作系统、中间件和数据库提供了官方仓库存储。各个组织和个人都可以在 docker Hub 上发布的镜像的公有库,也可以注册成私有仓库。由于上传的镜像可以包含几乎任何内容,所以 Docker 提供了一种自动构建工具(以往称为“可信构建”),镜像可以从一种称之为 Dockerfile 的镜像内容清单构建而成。 + +### 容器 vs. 虚拟机 ### + +容器会比虚拟机更高效,因为它们能够分享一个内核和分享应用程序库。相比虚拟机系统,这也将使得 Docker 使用的内存更小,即便虚拟机利用了内存超量使用的技术。部署容器时共享底层的镜像层也可以减少存储占用。IBM 的 Boden Russel 已经做了一些[基准测试][10]来说明两者之间的不同。 + +相比虚拟机系统,容器具有较低系统开销的优势,所以在容器中,应用程序的运行效率将会等效于在同样的应用程序在虚拟机中运行,甚至效果更佳。IBM 的一个研究团队已经发表了一本名为[虚拟机与 Linux 容器的性能比较]的文章[11]。 + +容器只是在隔离特性上要比虚拟机逊色。虚拟机可以利用如 Intel 的 VT-d 和 VT-x 技术的 ring-1 [硬件隔离][12]技术。这种隔离可以防止虚拟机突破和彼此交互。而容器至今还没有任何形式的硬件隔离,这使它容易受到攻击。一个称为 [Shocker][13] 的概念攻击验证表明,在 Docker 1.0 之前的版本是存在这种脆弱性的。尽管 Docker 1.0 修复了许多由 Shocker 漏洞带来的较为严重的问题,Docker 的 CTO Solomon Hykes 仍然[说][14],“当我们可以放心宣称 Docker 的开箱即用是安全的,即便是不可信的 uid0 程序(超级用户权限程序),我们将会很明确地告诉大家。”Hykes 的声明承认,其漏洞及相关的风险依旧存在,所以在容器成为受信任的工具之前将有更多的工作要做。 + +对于许多用户案例而言,在容器和虚拟机之间二者选择其一是种错误的二分法。Docker 同样可以在虚拟机中工作的很好,这让它可以用在现有的虚拟基础措施、私有云或者公有云中。同样也可以在容器里跑虚拟机,这也类似于谷歌在其云平台的使用方式。像 IaaS 服务这样普遍可用的基础设施,能够即时提供所需的虚拟机,可以预期容器与虚拟机一起使用的情景将会在数年后出现。容器管理和虚拟机技术也有可能被集成到一起提供一个两全其美的方案;这样,一个硬件信任锚微虚拟化所支撑的 libcontainer 容器,可与前端 Docker 工具链和生态系统整合,而使用提供更好隔离性的不同后端。微虚拟化(例如 Bromium 的 [vSentry][15] 和 VMware 的 [Project Fargo][16])已经用于在桌面环境中以提供基于硬件的应用程序隔离,所以类似的方法也可以用于 libcontainer,作为 Linux内核中的容器机制的替代技术。 + +### ‘容器化’ 的应用程序 ### + +几乎所有 Linux 应用程序都可以在 Docker 容器中运行,并没有编程语言或框架的限制。唯一的实际限制是以操作系统的角度来允许容器做什么。即使如此,也可以在特权模式下运行容器,从而大大减少了限制(与之对应的是容器中的应用程序的风险增加,可能导致损坏主机操作系统)。 + +容器都是从镜像开始运行的,而镜像也可以从运行中的容器获取。本质上说,有两种方法可以将应用程序放到容器中,分别是手动构建和 Dockerfile。 + +#### 手动构建 #### + +手动构建从启动一个基础的操作系统镜像开始,然后在交互式终端中用你所选的 Linux 提供的包管理器安装应用程序及其依赖项。Zef Hemel 在‘[使用 Linux 容器来支持便携式应用程序部署][17]’的文章中讲述了他部署的过程。一旦应用程序被安装之后,容器就可以被推送至注册库(例如Docker Hub)或者导出为一个tar文件。 + +#### Dockerfile #### + +Dockerfile 是一个用于构建 Docker 容器的脚本化系统。每一个 Dockerfile 定义了开始的基础镜像,以及一系列在容器中运行的命令或者一些被添加到容器中的文件。Dockerfile 也可以指定对外的端口和当前工作目录,以及容器启动时默认执行的命令。用 Dockerfile 构建的容器可以像手工构建的镜像一样推送或导出。Dockerfile 也可以用于 Docker Hub 的自动构建系统,即在 Docker 公司的控制下从头构建,并且该镜像的源代码是任何需要使用它的人可见的。 + +#### 单进程? #### + +无论镜像是手动构建还是通过 Dockerfile 构建,有一个要考虑的关键因素是当容器启动时仅启动一个进程。对于一个单一用途的容器,例如运行一个应用服务器,运行一个单一的进程不是一个问题(有些关于容器应该只有一个单独的进程的争议)。对于一些容器需要启动多个进程的情况,必须先启动 [supervisor][18] 进程,才能生成其它内部所需的进程。由于容器内没有初始化系统,所以任何依赖于 systemd、upstart 或类似初始化系统的东西不修改是无法工作的。 + +### 容器和微服务 ### + +全面介绍使用微服务结构体系的原理和好处已经超出了这篇文章的范畴(在 [InfoQ eMag: Microservices][19] 有全面阐述)。然而容器是绑定和部署微服务实例的捷径。 + +大规模微服务部署的多数案例都是部署在虚拟机上,容器只是用于较小规模的部署上。容器具有共享操作系统和公用库的的内存和硬盘存储的能力,这也意味着它可以非常有效的并行部署多个版本的服务。 + +### 连接容器 ### + +一些小的应用程序适合放在单独的容器中,但在许多案例中应用程序需要分布在多个容器中。Docker 的成功包括催生了一连串新的应用程序组合工具、编制工具及平台作为服务(PaaS)的实现。在这些努力的背后,是希望简化从一组相互连接的容器来创建应用的过程。很多工具也在扩展、容错、性能管理以及对已部署资产进行版本控制方面提供了帮助。 + +#### 连通性 #### + +Docker 的网络功能是相当原始的。在同一主机,容器内的服务可以互相访问,而且 Docker 也可以通过端口映射到主机操作系统,使服务可以通过网络访问。官方支持的提供连接能力的库叫做 [libchan][20],这是一个提供给 Go 语言的网络服务库,类似于[channels][21]。在 libchan 找到进入应用的方法之前,第三方应用仍然有很大空间可提供配套的网络服务。例如,[Flocker][22] 已经采取了基于代理的方法使服务实现跨主机(以及底层存储)的移植。 + +#### 合成 #### + +Docker 本身拥有把容器连接在一起的机制,与元数据相关的依赖项可以被传递到相依赖的容器中,并用于环境变量和主机入口。如 [Fig][23] 和 [geard][24] 这样的应用合成工具可以在单一文件中展示出这种依赖关系图,这样多个容器就可以汇聚成一个连贯的系统。CenturyLink 公司的 [Panamax][25] 合成工具类似 Fig 和 geard 的底层实现方法,但新增了一些基于 web 的用户接口,并直接与 GitHub 相结合,以便于应用程序分享。 + +#### 编制 #### + +像 [Decking][26]、New Relic 公司的 [Centurion][27] 和谷歌公司的 [Kubernetes][28] 这样的编制系统都是旨在协助容器的部署和管理其生命周期系统。也有许多 [Apache Mesos][30] (特别是 [Marathon(马拉松式)持续运行很久的框架])的案例(例如[Mesosphere][29])已经被用于配合 Docker 一起使用。通过为应用程序与底层基础架构之间(例如传递 CPU 核数和内存的需求)提供一个抽象的模型,编制工具提供了两者的解耦,简化了应用程序开发和数据中心操作。有很多各种各样的编制系统,因为许多来自内部系统的以前开发的用于大规模容器部署的工具浮现出来了;如 Kubernetes 是基于谷歌的 [Omega][32] 系统的,[Omega][32] 是用于管理遍布谷歌云环境中容器的系统。 + +虽然从某种程度上来说合成工具和编制工具的功能存在重叠,但这也是它们之间互补的一种方式。例如 Fig 可以被用于描述容器间如何实现功能交互,而 Kubernetes pods(容器组)可用于提供监控和扩展。 + +#### 平台(即服务)#### + +有一些 Docker 原生的 PaaS 服务实现,例如 [Deis][33] 和 [Flynn][34] 已经显现出 Linux 容器在开发上的的灵活性(而不是那些“自以为是”的给出一套语言和框架)。其它平台,例如 CloudFoundry、OpenShift 和 Apcera Continuum 都已经采取将 Docker 基础功能融入其现有的系统的技术路线,这样基于 Docker 镜像(或者基于 Dockerfile)的应用程序也可以与之前用支持的语言和框架的开发的应用一同部署和管理。 + +### 所有的云 ### + +由于 Docker 能够运行在任何正常更新内核的 Linux 虚拟机中,它几乎可以用在所有提供 IaaS 服务的云上。大多数的主流云厂商已经宣布提供对 Docker 及其生态系统的支持。 + +亚马逊已经把 Docker 引入它们的 Elastic Beanstalk 系统(这是在底层 IaaS 上的一个编制系统)。谷歌使 Docker 成为了“可管理的 VM”,它提供了GAE PaaS 和GCE IaaS 之间的中转站。微软和 IBM 也都已经宣布了基于 Kubernetes 的服务,这样可以在它们的云上部署和管理多容器应用程序。 + +为了给现有种类繁多的后端提供可用的一致接口,Docker 团队已经引进 [libswarm][35], 它可以集成于众多的云和资源管理系统。Libswarm 所阐明的目标之一是“通过切换服务来源避免被特定供应商套牢”。这是通过呈现一组一致的服务(与API相关联的)来完成的,该服务会通过特定的后端服务所实现。例如 Docker 服务器将支持本地 Docker 命令行工具的 Docker 远程 API 调用,这样就可以管理一组服务供应商的容器了。 + +基于 Docker 的新服务类型仍在起步阶段。总部位于伦敦的 Orchard 实验室提供了 Docker 的托管服务,但是 Docker 公司表示,收购 Orchard 后,其相关服务不会置于优先位置。Docker 公司也出售了之前 DotCloud 的PaaS 业务给 cloudControl。基于更早的容器管理系统的服务例如 [OpenVZ][36] 已经司空见惯了,所以在一定程度上 Docker 需要向主机托管商们证明其价值。 + +### Docker 及其发行版 ### + +Docker 已经成为大多数 Linux 发行版例如 Ubuntu、Red Hat 企业版(RHEL)和 CentOS 的一个标准功能。遗憾的是这些发行版的步调和 Docker 项目并不一致,所以在发布版中找到的版本总是远远落后于最新版本。例如 Ubuntu 14.04 版本中的版本是 Docker 0.9.1,而当 Ubuntu 升级至 14.04.1 时 Docker 版本并没有随之升级(此时 Docker 已经升至 1.1.2 版本)。在发行版的软件仓库中还有一个名字空间的冲突,因为 “Docker” 也是 KDE 系统托盘的名字;所以在 Ubuntu 14.04 版本中相关安装包的名字和命令行工具都是使用“Docker.io”的名字。 + +在企业级 Linux 的世界中,情况也并没有因此而不同。CentOS 7 中的 Docker 版本是 0.11.1,这是 Docker 公司宣布准备发行 Docker 1.0 产品版本之前的开发版。Linux 发行版用户如果希望使用最新版本以保障其稳定、性能和安全,那么最好地按照 Docker 的[安装说明][37]进行,使用 Docker 公司的所提供的软件库而不是采用发行版的。 + +Docker 的到来也催生了新的 Linux 发行版,如 [CoreOS][38] 和红帽的 [Project Atomic][39],它们被设计为能运行容器的最小环境。这些发布版相比传统的发行版,带着更新的内核及 Docker 版本,对内存的使用和硬盘占用率也更低。新发行版也配备了用于大型部署的新工具,例如 [fleet][40](一个分布式初始化系统)和[etcd][41](用于元数据管理)。这些发行版也有新的自我更新机制,以便可以使用最新的内核和 Docker。这也意味着使用 Docker 的影响之一是它抛开了对发行版和相关的包管理解决方案的关注,而对 Linux 内核(及使用它的 Docker 子系统)更加关注。 + +这些新发行版也许是运行 Docker 的最好方式,但是传统的发行版和它们的包管理器对容器来说仍然是非常重要的。Docker Hub 托管的官方镜像有 Debian、Ubuntu 和 CentOS,以及一个‘半官方’的 Fedora 镜像库。RHEL 镜像在Docker Hub 中不可用,因为它是 Red Hat 直接发布的。这意味着在 Docker Hub 的自动构建机制仅仅用于那些纯开源发行版下(并愿意信任那些源于 Docker 公司团队提供的基础镜像)。 + +Docker Hub 集成了如 Git Hub 和 Bitbucket 这样源代码控制系统来自动构建包管理器,用于管理构建过程中创建的构建规范(在Dockerfile中)和生成的镜像之间的复杂关系。构建过程的不确定结果并非是 Docker 的特定问题——而与软件包管理器如何工作有关。今天构建完成的是一个版本,明天构建的可能就是更新的版本,这就是为什么软件包管理器需要升级的原因。容器抽象(较少关注容器中的内容)以及容器扩展(因为轻量级资源利用率)有可能让这种不确定性成为 Docker 的痛点。 + +### Docker 的未来 ### + +Docker 公司对核心功能(libcontainer),跨服务管理(libswarm) 和容器间的信息传递(libchan)的发展上提出了明确的路线。与此同时,该公司已经表明愿意收购 Orchard 实验室,将其纳入自身生态系统。然而 Docker 不仅仅是 Docker 公司的,这个项目的贡献者也来自许多大牌贡献者,其中不乏像谷歌、IBM 和 Red Hat 这样的大公司。在仁慈独裁者、CTO Solomon Hykes 掌舵的形势下,为公司和项目明确了技术领导关系。在前18个月的项目中通过成果输出展现了其快速行动的能力,而且这种趋势并没有减弱的迹象。 + +许多投资者正在寻找10年前 VMware 公司的 ESX/vSphere 平台的特征矩阵,并试图找出虚拟机的普及而带动的企业预期和当前 Docker 生态系统两者的距离(和机会)。目前 Docker 生态系统正缺乏类似网络、存储和(对于容器的内容的)细粒度版本管理,这些都为初创企业和创业者提供了机会。 + +随着时间的推移,在虚拟机和容器(Docker 的“运行”部分)之间的区别将变得没那么重要了,而关注点将会转移到“构建”和“交付”方面。这些变化将会使“Docker发生什么?”变得不如“Docker将会给IT产业带来什么?”那么重要了。 + + +-------------------------------------------------------------------------------- + +via: http://www.infoq.com/articles/docker-future + +作者:[Chris Swan][a] +译者:[disylee](https://github.com/disylee) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoq.com/author/Chris-Swan +[1]:http://blog.dotcloud.com/dotcloud-paas-joins-cloudcontrol +[2]:http://www.infoq.com/news/2014/06/docker_1.0 +[3]:https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt +[4]:http://selinuxproject.org/page/Main_Page +[5]:https://linuxcontainers.org/ +[6]:http://blog.docker.com/2014/03/docker-0-9-introducing-execution-drivers-and-libcontainer/ +[7]:http://aufs.sourceforge.net/aufs.html +[8]:https://docs.docker.com/reference/builder/ +[9]:https://registry.hub.docker.com/ +[10]:http://bodenr.blogspot.co.uk/2014/05/kvm-and-docker-lxc-benchmarking-with.html?m=1 +[11]:http://domino.research.ibm.com/library/cyberdig.nsf/papers/0929052195DD819C85257D2300681E7B/$File/rc25482.pdf +[12]:https://en.wikipedia.org/wiki/X86_virtualization#Hardware-assisted_virtualization +[13]:http://stealth.openwall.net/xSports/shocker.c +[14]:https://news.ycombinator.com/item?id=7910117 +[15]:http://www.bromium.com/products/vsentry.html +[16]:http://cto.vmware.com/vmware-docker-better-together/ +[17]:http://www.infoq.com/articles/docker-containers +[18]:http://docs.docker.com/articles/using_supervisord/ +[19]:http://www.infoq.com/minibooks/emag-microservices +[20]:https://github.com/docker/libchan +[21]:https://gobyexample.com/channels +[22]:http://www.infoq.com/news/2014/08/clusterhq-launch-flocker +[23]:http://www.fig.sh/ +[24]:http://openshift.github.io/geard/ +[25]:http://panamax.io/ +[26]:http://decking.io/ +[27]:https://github.com/newrelic/centurion +[28]:https://github.com/GoogleCloudPlatform/kubernetes +[29]:https://mesosphere.io/2013/09/26/docker-on-mesos/ +[30]:http://mesos.apache.org/ +[31]:https://github.com/mesosphere/marathon +[32]:http://static.googleusercontent.com/media/research.google.com/en/us/pubs/archive/41684.pdf +[33]:http://deis.io/ +[34]:https://flynn.io/ +[35]:https://github.com/docker/libswarm +[36]:http://openvz.org/Main_Page +[37]:https://docs.docker.com/installation/#installation +[38]:https://coreos.com/ +[39]:http://www.projectatomic.io/ +[40]:https://github.com/coreos/fleet +[41]:https://github.com/coreos/etcd diff --git a/published/20141204 How To Delete Oracle 11g Database Manually.md b/published/201501/20141204 How To Delete Oracle 11g Database Manually.md similarity index 100% rename from published/20141204 How To Delete Oracle 11g Database Manually.md rename to published/201501/20141204 How To Delete Oracle 11g Database Manually.md diff --git a/published/20141204 How To Run Linux Programs From The Terminal In Background Mode.md b/published/201501/20141204 How To Run Linux Programs From The Terminal In Background Mode.md similarity index 100% rename from published/20141204 How To Run Linux Programs From The Terminal In Background Mode.md rename to published/201501/20141204 How To Run Linux Programs From The Terminal In Background Mode.md diff --git a/published/20141205 10 free Commands to Check Memory Usage in Linux.md b/published/201501/20141205 10 free Commands to Check Memory Usage in Linux.md similarity index 100% rename from published/20141205 10 free Commands to Check Memory Usage in Linux.md rename to published/201501/20141205 10 free Commands to Check Memory Usage in Linux.md diff --git a/published/20141205 Find Out Network Adapters Available In Ubuntu Linux.md b/published/201501/20141205 Find Out Network Adapters Available In Ubuntu Linux.md similarity index 100% rename from published/20141205 Find Out Network Adapters Available In Ubuntu Linux.md rename to published/201501/20141205 Find Out Network Adapters Available In Ubuntu Linux.md diff --git a/published/20141205 How To Create A Bootable Ubuntu USB Drive For Mac In OS X.md b/published/201501/20141205 How To Create A Bootable Ubuntu USB Drive For Mac In OS X.md similarity index 100% rename from published/20141205 How To Create A Bootable Ubuntu USB Drive For Mac In OS X.md rename to published/201501/20141205 How To Create A Bootable Ubuntu USB Drive For Mac In OS X.md diff --git a/published/20141208 Install Jetty 9 (Java servlet engine and webserver) on Ubuntu 14.10 Server.md b/published/201501/20141208 Install Jetty 9 (Java servlet engine and webserver) on Ubuntu 14.10 Server.md similarity index 100% rename from published/20141208 Install Jetty 9 (Java servlet engine and webserver) on Ubuntu 14.10 Server.md rename to published/201501/20141208 Install Jetty 9 (Java servlet engine and webserver) on Ubuntu 14.10 Server.md diff --git a/published/20141208 Linux FAQs with Answers--How to disable Apport internal error reporting on Ubuntu.md b/published/201501/20141208 Linux FAQs with Answers--How to disable Apport internal error reporting on Ubuntu.md similarity index 100% rename from published/20141208 Linux FAQs with Answers--How to disable Apport internal error reporting on Ubuntu.md rename to published/201501/20141208 Linux FAQs with Answers--How to disable Apport internal error reporting on Ubuntu.md diff --git a/published/20141208 U.S. Marine Corps Wants to Change OS for Radar System from Windows XP to Linux.md b/published/201501/20141208 U.S. Marine Corps Wants to Change OS for Radar System from Windows XP to Linux.md similarity index 100% rename from published/20141208 U.S. Marine Corps Wants to Change OS for Radar System from Windows XP to Linux.md rename to published/201501/20141208 U.S. Marine Corps Wants to Change OS for Radar System from Windows XP to Linux.md diff --git a/published/20141210 How to use Evernote from the command line on Linux.md b/published/201501/20141210 How to use Evernote from the command line on Linux.md similarity index 100% rename from published/20141210 How to use Evernote from the command line on Linux.md rename to published/201501/20141210 How to use Evernote from the command line on Linux.md diff --git a/published/20141211 NetHack.md b/published/201501/20141211 NetHack.md similarity index 100% rename from published/20141211 NetHack.md rename to published/201501/20141211 NetHack.md diff --git a/published/20141211 Yes, This Trojan Infects Linux. No, It' s Not The Tuxpocalypse.md b/published/201501/20141211 Yes, This Trojan Infects Linux. No, It' s Not The Tuxpocalypse.md similarity index 100% rename from published/20141211 Yes, This Trojan Infects Linux. No, It' s Not The Tuxpocalypse.md rename to published/201501/20141211 Yes, This Trojan Infects Linux. No, It' s Not The Tuxpocalypse.md diff --git a/published/20141222 A Great Tool To Show Linux Command Progress Like ETA.md b/published/201501/20141222 A Great Tool To Show Linux Command Progress Like ETA.md similarity index 100% rename from published/20141222 A Great Tool To Show Linux Command Progress Like ETA.md rename to published/201501/20141222 A Great Tool To Show Linux Command Progress Like ETA.md diff --git a/published/20141222 How to Sync Time Properly with NTP Server in CentOS 7.x.md b/published/201501/20141222 How to Sync Time Properly with NTP Server in CentOS 7.x.md similarity index 100% rename from published/20141222 How to Sync Time Properly with NTP Server in CentOS 7.x.md rename to published/201501/20141222 How to Sync Time Properly with NTP Server in CentOS 7.x.md diff --git a/published/20141224 Calife--A lightweight alternative to sudo.md b/published/201501/20141224 Calife--A lightweight alternative to sudo.md similarity index 100% rename from published/20141224 Calife--A lightweight alternative to sudo.md rename to published/201501/20141224 Calife--A lightweight alternative to sudo.md diff --git a/published/20141224 Linux FAQs with Answers--How to check SSH protocol version on Linux.md b/published/201501/20141224 Linux FAQs with Answers--How to check SSH protocol version on Linux.md similarity index 100% rename from published/20141224 Linux FAQs with Answers--How to check SSH protocol version on Linux.md rename to published/201501/20141224 Linux FAQs with Answers--How to check SSH protocol version on Linux.md diff --git a/published/20141224 Linux FAQs with Answers--How to install 7zip on Linux.md b/published/201501/20141224 Linux FAQs with Answers--How to install 7zip on Linux.md similarity index 100% rename from published/20141224 Linux FAQs with Answers--How to install 7zip on Linux.md rename to published/201501/20141224 Linux FAQs with Answers--How to install 7zip on Linux.md diff --git a/published/20141224 Linux FAQs with Answers--How to install kernel headers on Linux.md b/published/201501/20141224 Linux FAQs with Answers--How to install kernel headers on Linux.md similarity index 100% rename from published/20141224 Linux FAQs with Answers--How to install kernel headers on Linux.md rename to published/201501/20141224 Linux FAQs with Answers--How to install kernel headers on Linux.md diff --git a/published/20141226 The Good The Bad And The Ugly Of Linux In 2014.md b/published/201501/20141226 The Good The Bad And The Ugly Of Linux In 2014.md similarity index 100% rename from published/20141226 The Good The Bad And The Ugly Of Linux In 2014.md rename to published/201501/20141226 The Good The Bad And The Ugly Of Linux In 2014.md diff --git a/published/20141229 2 Ways To Fix The UEFI Bootloader When Dual Booting Windows And Ubuntu.md b/published/201501/20141229 2 Ways To Fix The UEFI Bootloader When Dual Booting Windows And Ubuntu.md similarity index 100% rename from published/20141229 2 Ways To Fix The UEFI Bootloader When Dual Booting Windows And Ubuntu.md rename to published/201501/20141229 2 Ways To Fix The UEFI Bootloader When Dual Booting Windows And Ubuntu.md diff --git a/published/20141229 How to Install Bugzilla 4.4 on Ubuntu or CentOS 6.x.md b/published/201501/20141229 How to Install Bugzilla 4.4 on Ubuntu or CentOS 6.x.md similarity index 100% rename from published/20141229 How to Install Bugzilla 4.4 on Ubuntu or CentOS 6.x.md rename to published/201501/20141229 How to Install Bugzilla 4.4 on Ubuntu or CentOS 6.x.md diff --git a/published/20150104 Docker Image Insecurity.md b/published/201501/20150104 Docker Image Insecurity.md similarity index 100% rename from published/20150104 Docker Image Insecurity.md rename to published/201501/20150104 Docker Image Insecurity.md diff --git a/published/20150106 2015--Open Source Has Won, But It Isn't Finished.md b/published/201501/20150106 2015--Open Source Has Won, But It Isn't Finished.md similarity index 100% rename from published/20150106 2015--Open Source Has Won, But It Isn't Finished.md rename to published/201501/20150106 2015--Open Source Has Won, But It Isn't Finished.md diff --git a/published/20150106 How To Install New Fonts In Ubuntu 14.04 and 14.10.md b/published/201501/20150106 How To Install New Fonts In Ubuntu 14.04 and 14.10.md similarity index 100% rename from published/20150106 How To Install New Fonts In Ubuntu 14.04 and 14.10.md rename to published/201501/20150106 How To Install New Fonts In Ubuntu 14.04 and 14.10.md diff --git a/published/20150121 Linux FAQs with Answers--How to boot into command line on Ubuntu or Debian.md b/published/201501/20150121 Linux FAQs with Answers--How to boot into command line on Ubuntu or Debian.md similarity index 100% rename from published/20150121 Linux FAQs with Answers--How to boot into command line on Ubuntu or Debian.md rename to published/201501/20150121 Linux FAQs with Answers--How to boot into command line on Ubuntu or Debian.md diff --git a/published/20150126 Data of 20 Million Users Stolen from Dating Website.md b/published/201501/20150126 Data of 20 Million Users Stolen from Dating Website.md similarity index 100% rename from published/20150126 Data of 20 Million Users Stolen from Dating Website.md rename to published/201501/20150126 Data of 20 Million Users Stolen from Dating Website.md diff --git a/published/How to Setup Bind Chroot DNS Server on CentOS 7.0 VPS.md b/published/201501/How to Setup Bind Chroot DNS Server on CentOS 7.0 VPS.md similarity index 100% rename from published/How to Setup Bind Chroot DNS Server on CentOS 7.0 VPS.md rename to published/201501/How to Setup Bind Chroot DNS Server on CentOS 7.0 VPS.md diff --git a/published/How to filter, split or merge pcap files on Linux.md b/published/201501/How to filter, split or merge pcap files on Linux.md similarity index 100% rename from published/How to filter, split or merge pcap files on Linux.md rename to published/201501/How to filter, split or merge pcap files on Linux.md diff --git a/published/Quick systemd-nspawn guide.md b/published/201501/Quick systemd-nspawn guide.md similarity index 100% rename from published/Quick systemd-nspawn guide.md rename to published/201501/Quick systemd-nspawn guide.md diff --git a/translated/tech/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md b/published/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md similarity index 70% rename from translated/tech/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md rename to published/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md index 34923b5ec3..55866282e8 100644 --- a/translated/tech/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md +++ b/published/20150115 How To Extract a Tar Files To a Different Directory on a Linux or Unix-like Systems.md @@ -1,8 +1,9 @@ -如何在Linux/类Unix系统中解压tar文件到不同的目录中 +如何解压 tar 文件到不同的目录中 ================================================================================ -我想要解压一个tar文件到一个指定的目录叫/tmp/data。我该如何在Linux或者类Unix的系统中使用tar命令解压一个tar文件到不同的目录中? -你不必使用cd名切换到其他的目录并解压。可以使用下面的语法解压一个文件: +我想要解压一个tar文件到一个叫/tmp/data的指定目录。我该如何在Linux或者类Unix的系统中使用tar命令解压一个tar文件到不同的目录中? + +你不必使用cd命令切换到其他的目录并解压。可以使用下面的语法解压一个文件: ### 语法 ### @@ -16,9 +17,9 @@ GNU/tar 语法: tar xf file.tar --directory /path/to/directory -### 示例:解压文件到另一个文件夹中 ### +### 示例:解压文件到另一个目录中 ### -在本例中。我解压$HOME/etc.backup.tar到文件夹/tmp/data中。首先,你需要手动创建这个目录,输入: +在本例中。我解压$HOME/etc.backup.tar到/tmp/data目录中。首先,需要手动创建这个目录,输入: mkdir /tmp/data @@ -34,7 +35,7 @@ GNU/tar 语法: ![Gif 01: tar Command Extract Archive To Different Directory Command](http://s0.cyberciti.org/uploads/faq/2015/01/tar-extract-archive-to-dir.gif) -Gif 01: tar命令解压文件到不同的目录 +*Gif 01: tar命令解压文件到不同的目录* 你也可以指定解压的文件: @@ -56,8 +57,8 @@ via: http://www.cyberciti.biz/faq/howto-extract-tar-file-to-specific-directory-o 作者:[nixCraft][a] 译者:[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/) 荣誉推出 -[a]:http://www.cyberciti.biz/tips/about-us \ No newline at end of file +[a]:http://www.cyberciti.biz/tips/about-us diff --git a/published/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md b/published/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md new file mode 100644 index 0000000000..0ed031e342 --- /dev/null +++ b/published/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md @@ -0,0 +1,58 @@ +在 Ubuntu 14.04 中Apache从2.2迁移到2.4的问题 +================================================================================ +如果你将**Ubuntu**从12.04升级跨越到了14.04,那么这其中包括了一个重大的升级--**Apache**从2.2版本升级到2.4版本。**Apache**的这次升级带来了许多性能提升,**但是如果继续使用2.2的配置文件会导致很多错误**。 + +### 访问控制的改变 ### + +从**Apache 2.4**起,所启用的授权机制比起2.2的只是针对单一数据存储的单一检查更加灵活。过去很难确定哪个 order 授权怎样被使用的,但是授权容器指令的引入解决了这些问题,现在,配置可以控制什么时候授权方法被调用,什么条件决定何时授权访问。 + +这就是为什么大多数的升级失败是由于配置错误的原因。2.2的访问控制是基于IP地址、主机名和其他角色,通过使用指令Order,来设置Allow, Deny或 Satisfy;但是2.4,这些一切都通过新的授权方式进行检查。 + +为了弄清楚这些,可以来看一些虚拟主机的例子,这些可以在/etc/apache2/sites-enabled/default 或者 /etc/apache2/sites-enabled/*你的网站名称* 中找到: + +旧的2.2虚拟主机配置: + + Order allow,deny + Allow from all + +新的2.4虚拟主机配置: + + Require all granted + +![apache 2.4 config](http://blog.linoxide.com/wp-content/uploads/2014/12/apache-2.4-config.jpg) + +(LCTT 译注:Order、Allow和deny 这些将在之后的版本废弃,请尽量避免使用,Require 指令已可以提供比其更强大和灵活的功能。) + +### .htaccess 问题 ### + +升级后如果一些设置不工作,或者你得到重定向错误,请检查是否这些设置是放在.htaccess文件中。如果Apache 2.4没有使用 .htaccess 文件中的设置,那是因为在2.4中AllowOverride指令的默认是 none,因此忽略了.htaccess文件。你只需要做的就是修改或者添加AllowOverride All命令到你的网站配置文件中。 + +上面截图中,可以看见AllowOverride All指令。 + +### 丢失配置文件或者模块 ### + +根据我的经验,这次升级带来的另一个问题就是在2.4中,一些旧模块和配置文件不再需要或者不被支持了。你将会收到一条“Apache不能包含相应的文件”的明确警告,你需要做的是在配置文件中移除这些导致问题的配置行。之后你可以搜索和安装相似的模块来替代。 + +### 其他需要了解的小改变 ### + +这里还有一些其他的改变需要考虑,虽然这些通常只会发生警告,而不是错误。 + +- MaxClients重命名为MaxRequestWorkers,使之有更准确的描述。而异步MPM,如event,客户端最大连接数不等于工作线程数。旧的配置名依然支持。 +- DefaultType命令无效,使用它已经没有任何效果了。如果使用除了 none 之外的其它配置值,你会得到一个警告。需要使用其他配置设定来替代它。 +- EnableSendfile默认关闭 +- FileETag 现在默认为"MTime Size"(没有INode) +- KeepAlive 只接受“On”或“Off”值。之前的任何不是“Off”或者“0”的值都被认为是“On” +- 单一的 Mutex 已经替代了 Directives AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex 和 WatchdogMutexPath 等指令。你需要做的是估计一下这些被替代的指令在2.2中的使用情况,来决定是否删除或者使用Mutex来替代。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/apache-migration-2-2-to-2-4-ubuntu-14-04/ + +作者:[Adrian Dinu][a] +译者:[Vic020/VicYu](http://vicyu.net) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/adriand/ +[1]:http://httpd.apache.org/docs/2.4/ diff --git a/translated/tech/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md b/published/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md similarity index 88% rename from translated/tech/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md rename to published/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md index 6b1d65ca8b..adecdd2520 100644 --- a/translated/tech/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md +++ b/published/20150121 Linux FAQs with Answers--How to check disk space on Linux with df command.md @@ -1,4 +1,4 @@ -Linux有问必答:在Linux下如何用df命令检查磁盘空间? +在 Linux 下你所不知道的 df 命令的那些功能 ================================================================================ > **问题**: 我知道在Linux上我可以用df命令来查看磁盘使用空间。你能告诉我df命令的实际例子使我可以最大限度得利用它吗? @@ -10,7 +10,7 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 ### 用人们可读的方式展示 ### -默认情况下,df命令用1K为块来展示磁盘空间,这不容易解释。“-h”参数使df用更可读的方式打印磁盘空间(例如 100K,200M,3G)。 +默认情况下,df命令用1K为块来展示磁盘空间,这看起来不是很直观。“-h”参数使df用更可读的方式打印磁盘空间(例如 100K,200M,3G)。 $ df -h @@ -28,7 +28,7 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 ### 展示Inode使用情况 ### -当你监视磁盘使用情况时,你必须注意的不仅仅是磁盘空间还有“inode”的使用情况。在Linux中,inode是用来存储特定文件的元数据的一种数据结构,在创建一个文件系统时,inode的预先定义数量将被分配。这意味着,一个文件系统可能耗尽空间不只是因为大文件用完了所有可用空间,也可能是因为很多小文件用完了所有可能的inode。用“-i”选项展示inode使用情况。 +当你监视磁盘使用情况时,你必须注意的不仅仅是磁盘空间还有“inode”的使用情况。在Linux中,inode是用来存储特定文件的元数据的一种数据结构,在创建一个文件系统时,inode的预先定义数量将被分配。这意味着,**一个文件系统可能耗尽空间不只是因为大文件用完了所有可用空间,也可能是因为很多小文件用完了所有可能的inode**。用“-i”选项展示inode使用情况。 $ df -i @@ -46,7 +46,8 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 ### 展示磁盘总利用率 ### -默认情况下, df命令显示磁盘的单个文件系统的利用率。如果你想知道的所有文件系统的总磁盘使用量,增加“ --total ”选项。 +默认情况下, df命令显示磁盘的单个文件系统的利用率。如果你想知道的所有文件系统的总磁盘使用量,增加“ --total ”选项(见最下面的汇总行)。 + $ df -h --total ---------- @@ -64,7 +65,7 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 ### 展示文件系统类型 ### -默认情况下,df命令不现实文件系统类型信息。用“-T”选项来添加文件系统信息到输出中。 +默认情况下,df命令不显示文件系统类型信息。用“-T”选项来添加文件系统信息到输出中。 $ df -T @@ -92,13 +93,13 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 /dev/mapper/ubuntu-root 952893348 591583380 312882756 66% / /dev/sda1 233191 100025 120725 46% /boot -排除特定的文件系统类型,用“-x ”选项。同样,你可以用这个选项多次。 +排除特定的文件系统类型,用“-x ”选项。同样,你可以用这个选项多次来排除多种文件系统类型。 $ df -x tmpfs ### 显示一个具体的挂载点磁盘使用情况 ### -如果你用df指定一个挂载点,它将报告挂载在那个地方的文件系统的磁盘使用情况。如果你指定一个普通文件(或一个目录)而不是一个挂载点,df将现实包含这个文件(或目录)的文件系统的磁盘利用率。 +如果你用df指定一个挂载点,它将报告挂载在那个地方的文件系统的磁盘使用情况。如果你指定一个普通文件(或一个目录)而不是一个挂载点,df将显示包含这个文件(或目录)的文件系统的磁盘利用率。 $ df / @@ -116,9 +117,9 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/ubuntu-root 952893348 591583528 312882608 66% / -### 现实虚拟文件系统的信息 ### +### 显示虚拟文件系统的信息 ### -如果你想显示所有已经存在的文件系统(包括虚拟文件系统)的磁盘空间信息,用“-a”选项。这里,虚拟文件系统是指没有相对应的物理设备的假的文件系统,例如,tmpfs,cgroup虚拟文件系统或FUSE文件安系统。这些虚拟文件系统大小为0,不用“-a”选项将不会被报告出来。 +如果你想显示所有已经存在的文件系统(包括虚拟文件系统)的磁盘空间信息,用“-a”选项。这里,虚拟文件系统是指没有相对应的物理设备的假文件系统,例如,tmpfs,cgroup虚拟文件系统或FUSE文件安系统。这些虚拟文件系统大小为0,不用“-a”选项将不会被报告出来。 $ df -a @@ -149,7 +150,7 @@ df命令可以展示任何“mounted”文件系统的磁盘利用率。该命 via: http://ask.xmodulo.com/check-disk-space-linux-df-command.html 译者:[mtunique](https://github.com/mtunique) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md b/published/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md new file mode 100644 index 0000000000..876ee88404 --- /dev/null +++ b/published/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md @@ -0,0 +1,113 @@ +Linux有问必答:如何检查Linux的内存使用状况 +================================================================================ + +>**问题**:我想要监测Linux系统的内存使用状况。有哪些可用的图形界面或者命令行工具来检查当前内存使用情况? + +当涉及到Linux系统性能优化的时候,物理内存是一个最重要的因素。自然的,Linux提供了丰富的选择来监测珍贵的内存资源的使用情况。不同的工具,在监测粒度(例如:全系统范围,每个进程,每个用户),接口方式(例如:图形用户界面,命令行,ncurses)或者运行模式(交互模式,批量处理模式)上都不尽相同。 + +下面是一个可供选择的,但并不全面的图形或命令行工具列表,这些工具用来检查Linux平台中已用和可用的内存。 + +### 1. /proc/meminfo ### + +一种最简单的方法是通过“/proc/meminfo”来检查内存使用状况。这个动态更新的虚拟文件事实上是诸如free,top和ps这些与内存相关的工具的信息来源。从可用/闲置物理内存数量到等待被写入缓存的数量或者已写回磁盘的数量,只要是你想要的关于内存使用的信息,“/proc/meminfo”应有尽有。特定进程的内存信息也可以通过“/proc/\/statm”和“/proc/\/status”来获取。 + + $ cat /proc/meminfo + +![](https://farm8.staticflickr.com/7483/15989497899_bb6afede11_b.jpg) + +### 2. atop ### + +atop命令是用于终端环境的基于ncurses的交互式的系统和进程监测工具。它展示了动态更新的系统资源摘要(CPU, 内存, 网络, 输入/输出, 内核),并且用醒目的颜色把系统高负载的部分以警告信息标注出来。它同样提供了类似于top的线程(或用户)资源使用视图,因此系统管理员可以找到哪个进程或者用户导致的系统负载。内存统计报告包括了总计/闲置内存,缓存的/缓冲的内存和已提交的虚拟内存。 + + $ sudo atop + +![](https://farm8.staticflickr.com/7552/16149756146_893773b84c_b.jpg) + +### 3. free ### + +free命令是一个用来获得内存使用概况的快速简单的方法,这些信息从“/proc/meminfo”获取。它提供了一个快照,用于展示总计/闲置的物理内存和系统交换区,以及已使用/闲置的内核缓冲区。 + + $ free -h + +![](https://farm8.staticflickr.com/7531/15988117988_ba8c6b7b63_b.jpg) + +### 4. GNOME System Monitor ### + +GNOME System Monitor 是一个图形界面应用,它展示了包括CPU,内存,交换区和网络在内的系统资源使用率的较近历史信息。它同时也可以提供一个带有CPU和内存使用情况的进程视图。 + + $ gnome-system-monitor + +![](https://farm8.staticflickr.com/7539/15988118078_279f0da494_c.jpg) + +### 5. htop ### + +htop命令是一个基于ncurses的交互式的进程视图,它实时展示了每个进程的内存使用情况。它可以报告所有运行中进程的常驻内存大小(RSS)、内存中程序的总大小、库大小、共享页面大小和脏页面大小。你可以横向或者纵向滚动进程列表进行查看。 + + $ htop + +![](https://farm9.staticflickr.com/8236/8599814378_de071de408_c.jpg) + +### 6. KDE System Monitor ### + +就像GNOME桌面拥有GNOME System Monitor一样,KDE桌面也有它自己的对口应用:KDE System Monitor。这个工具的功能与GNOME版本极其相似,也就是说,它同样展示了一个关于系统资源使用情况,以及带有每个进程的CPU/内存消耗情况的实时历史记录。 + + $ ksysguard + +![](https://farm8.staticflickr.com/7479/15991397329_ec5d786ffd_c.jpg) + +### 7. memstat ### + +memstat工具对于识别正在消耗虚拟内存的可执行部分、进程和共享库非常有用。给出一个进程识别号,memstat即可识别出与之相关联的可执行部分、数据和共享库究竟使用了多少虚拟内存。 + + $ memstat -p + +![](https://farm8.staticflickr.com/7518/16175635905_1880e50055_b.jpg) + +### 8. nmon ### + +nmon工具是一个基于ncurses系统基准测试工具,它能够以交互方式监测CPU、内存、磁盘I/O、内核、文件系统以及网络资源。对于内存使用状况而言,它能够展示像总计/闲置内存、交换区、缓冲的/缓存的内存,虚拟内存页面换入换出的统计,所有这些都是实时的。 + + $ nmon + +![](https://farm9.staticflickr.com/8648/15989760117_30f62f4aba_b.jpg) + +### 9. ps ### + +ps命令能够实时展示每个进程的内存使用状况。内存使用报告里包括了 %MEM (物理内存使用百分比), VSZ (虚拟内存使用总量), 和 RSS (物理内存使用总量)。你可以使用“--sort”选项来对进程列表排序。例如,按照RSS降序排序: + + $ ps aux --sort -rss + +![](https://farm9.staticflickr.com/8602/15989881547_ca40839c19_c.jpg) + +### 10. smem ### + +[smem][1]命令允许你测定不同进程和用户的物理内存使用状况,这些信息来源于“/proc”目录。它利用“按比例分配大小(PSS)”指标来精确量化Linux进程的有效内存使用情况。内存使用分析结果能够输出为柱状图或者饼图类的图形化图表。 + + $ sudo smem --pie name -c "pss" + +![](https://farm8.staticflickr.com/7466/15614838428_eed7426cfe_c.jpg) + +### 11. top ### + +top命令提供了一个运行中进程的实时视图,以及特定进程的各种资源使用统计信息。与内存相关的信息包括 %MEM (内存使用率), VIRT (虚拟内存使用总量), SWAP (换出的虚拟内存使用量), CODE (分配给代码执行的物理内存数量), DATA (分配给非执行的数据的物理内存数量), RES (物理内存使用总量; CODE+DATA), 和 SHR (有可能与其他进程共享的内存数量)。你能够基于内存使用情况或者大小对进程列表进行排序。 + +![](https://farm8.staticflickr.com/7464/15989760047_eb8d51d9f2_c.jpg) + +### 12. vmstat ### + +vmstat命令行工具显示涵盖了CPU、内存、中断和磁盘I/O在内的各种系统活动的瞬时和平均统计数据。对于内存信息而言,命令不仅仅展示了物理内存使用情况(例如总计/已使用内存和缓冲的/缓存的内存),还同样展示了虚拟内存统计数据(例如,内存页的换入/换出,虚拟内存页的换入/换出) + + $ vmstat -s + +![](https://farm9.staticflickr.com/8582/15988236860_3f142008d2_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/check-memory-usage-linux.html + +译者:[Ping](https://github.com/mr-ping) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://xmodulo.com/visualize-memory-usage-linux.html \ No newline at end of file diff --git a/published/20150125 4 Best Modern Open Source Code Editors For Linux.md b/published/20150125 4 Best Modern Open Source Code Editors For Linux.md new file mode 100644 index 0000000000..6072c2b759 --- /dev/null +++ b/published/20150125 4 Best Modern Open Source Code Editors For Linux.md @@ -0,0 +1,87 @@ +4个最流行的Linux平台开源代码编辑器 +=== + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Best_Open_Source_Editors.jpeg) + +寻找**Linux平台最棒的代码编辑器**?如果你询问那些很早就玩Linux的人,他们会回答是Vi, Vim, Emacs, Nano等。但是,我今天不讨论那些。我将谈论一些新时代尖端、漂亮、时髦而且十分强大, 功能丰富的**最好的Linux平台开源代码编辑器**,它们将会提升你的编程经验。 + +### Linux平台最时髦的开源代码编辑器 ### + +我使用Ubuntu作为我的主桌面,所以我提供的安装说明是基于Ubuntu的发行版。但是这并不意味着本文列表就是**Ubuntu最好的文本编辑器**,因为本列表是适用于任何Linux发行版。而且,列表的介绍顺序并没有特定的优先级别。 + +#### Brackets #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/brackets_UI.jpeg) + +[Brackets][1]是出自[Adobe][2]的一个开源代码编辑器。它专门关注web设计者的需求,内置支持HTML, CSS和Java Script。它轻量级,但却十分强大,提供在线编辑和实时预览。而且,为了你能更好地体验Brackets,你可以使用许多可用的插件。 + +为了[在Ubuntu][3],以及其它基于Ubuntu的发行版,诸如Linux Minit上安装Brackets,你可以使用这个非官方的PPA源: + + sudo add-apt-repository ppa:webupd8team/brackets + sudo apt-get update + sudo apt-get install brackets + +其他的Linux发行版本,你可以通过下载源代码或相应Linux, OS X和Windows的二进制文件,进行安装。 + +- [下载Brackets源码和二进制文件][5] + +#### Atom #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Atom_Editor.jpeg) + +[Atom][5]是为程序员准备的另一个时尚开源代码编辑器。Atom由Github开发,被誉为“21世纪可破解的文本编辑器”。Atom的界面和Sublime Text编辑器十分相似。Sublime Text是一个十分流行但闭源的文本编辑器。 + +Atom最近已经发布了 .deb 和 .rpm包,所以在Debian和基于Fedora的Linux版本上安装很简单。当然,你也可以获取它的源代码。 + +- [下载Atom .deb][6] +- [下载Atom .rpm][7] +- [获取Atom源代码][8] + +#### Lime Text ### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/LimeTextEditor.jpeg) + +如果你喜欢Sublime Text,但是你对它的闭源十分反感。别担心,我们有一个[Sublime Text的开源克隆][9],叫做[Lime Text][10]。它基于Go, HTML和QT构造。说它是Sublime Text的克隆,背后原因是Sublime Text2仍有许多bug,而且Sublime Text3到目前为止仍处于测试版本。Sublime Text在开发过程中的bug是否修复,外界并不知情。 + +所以,开源爱好者们,你们可以很开心地通过下面的连接获得Lime Text的源码: + +- [获取Lime Text源码][11] + +#### Light Table #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Light_Table.jpeg) + +被誉为“下一代的代码编辑器”,[Light Table][12]是另一个时髦,功能丰富的开源编辑器,它更像是一个IDE,而非仅仅是一个文本编辑器。并且,有许多可以提高其性能的扩展方法。内联评价将是你会爱上它的原因。你一定要试用一下看,这样你才会体会它的实用之处。 + +- [获取Light Table的源码][13] + +### 你的选择是什么? ### + +在Linux平台,我们不能只局限于这四种代码编辑器。这份列表仅介绍了一些时髦的,可供程序员使用的编辑器。当然,你也有许多其他的选择,比如[Notepad++的替代品Notepadqq][14]或者[SciTE][15]等等。那么,文中这四个编辑器,你最喜欢哪个呢? + +--- + +via: http://itsfoss.com/best-modern-open-source-code-editors-for-linux/ + +作者:[Abhishek][a] +译者:[su-kaiyao](https://github.com/su-kaiyao) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/Abhishek/ +[1]:http://brackets.io/ +[2]:http://www.adobe.com/ +[3]:http://itsfoss.com/install-brackets-ubuntu/ +[4]:https://github.com/adobe/brackets/releases +[5]:https://atom.io/ +[6]:https://atom.io/download/deb +[7]:https://atom.io/download/rpm +[8]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md +[9]:http://itsfoss.com/lime-text-open-source-alternative/ +[10]:http://limetext.org/ +[11]:https://github.com/limetext/lime +[12]:http://lighttable.com/ +[13]:https://github.com/LightTable/LightTable +[14]:http://itsfoss.com/notepadqq-notepad-for-linux/ +[15]:http://itsfoss.com/scite-the-notepad-for-linux/ diff --git a/published/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md b/published/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md new file mode 100644 index 0000000000..7fff32e713 --- /dev/null +++ b/published/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md @@ -0,0 +1,33 @@ +Ubuntu 15.04即将整合Linux内核3.19分支 +---- +*Ubuntu已经开始整合一个新的内核分支* + +![Ubuntu 15.04 shortcuts](http://i1-news.softpedia-static.com/images/news2/Ubuntu-15-04-to-Integrate-Linux-Kernel-3-19-Branch-Soon-471121-2.jpg) + +Linux内核是一个发行版中最重要的组成部分,Ubuntu用户很想知道哪个版本将用于预计几个月后就会发布的15.04分支的稳定版中。 + +Ubuntu和Linux内核开发周期并不同步,所以很难预测最终哪个版本将应用在Ubuntu 15.04中。目前,Ubuntu 15.04(长尾黑颚猴)使用的是Linux内核3.18,但是开发者们已经准备应用3.19分支了。 + +“我们的Vivid的内核仍然基于v3.18.2的上游稳定内核,但是我们很快将重新基于v3.18.3内核开发。我们也将把我们的非稳定版分支的基础变更到v3.19-rc5,然后上传到我们的团队PPA。”Canonical的Joseph Salisbury[说](1)。 + +Linux内核3.19仍然处于开发阶段,预计还要几个星期才会出稳定版本,但是有充足的时间将它加入到Ubuntu中并测试。但是不可能等到3.20分支了,举个例子,即使它能在4月23日前发布。 + +你现在就可以从Softpedia[下载Ubuntu 15.04](2),试用一下。这是一个每日构建版本,会包含发行版中目前已经做出的所有改善。 + +-------------------------------------------------------------------------------- + +via:http://linux.softpedia.com/blog/Ubuntu-15-04-to-Integrate-Linux-Kernel-3-19-Branch-Soon-471121.shtml + +本文发布时间:25 Jan 2015, 20:39 GMT + +作者:[Silviu Stahie][a] + +译者:[zpl1025](https://github.com/zpl1025) + +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie +[1]:https://lists.ubuntu.com/archives/ubuntu-devel/2015-January/038644.html +[2]:http://linux.softpedia.com/get/Linux-Distributions/Ubuntu-Vivid-Vervet-103651.shtml diff --git a/published/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md b/published/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md new file mode 100644 index 0000000000..2b1b9d6631 --- /dev/null +++ b/published/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md @@ -0,0 +1,47 @@ +Android 中的 Wi-Fi 直连方式的 Bug 会导致拒绝服务 +---- + +*Google标记这个问题为低严重性,并不急着修复* + +![Wi-Fi Direct glitch crashes Android](http://i1-news.softpedia-static.com/images/news2/Bug-In-Wi-Fi-Direct-Android-Implementation-Causes-Denial-of-Service-471299-2.jpg) + +Android处理Wi-Fi直连连接的方式中的一个漏洞可以导致在搜索连接节点的时候所连接的设备重启,这个节点可能是其他手机,摄像头,游戏设备,电脑或是打印机等任何设备。 + +Wi-Fi直连技术允许无线设备之间直接建立通信,而不用加入到本地网络中。 + +###安全公司致力于协调修复这个问题 + +这个漏洞允许攻击者发送一个特定的修改过的802.11侦测响应帧给设备,从而因为WiFi监控类中的一个未处理的异常导致设备重启。 + +Core Security通过自己的CoreLabs团队发现了这个瑕疵(CVE-2014-0997),早在2014年9月就汇报给了Google。Google确认了这个问题,却把它列为低严重性,并不提供修复时间表。 + +每次Core Security联系Android安全组要求提供修复时间表的时候都会收到同样的答复。最后一次答复是1月20日,意味着这么长的时间中都没有补丁。在星期一的时候,这家安全公司公布了他们的发现。 + +这家安全公司建立了一个[概念攻击][1]来展示他们研究结果的有效性。 + +根据这个漏洞的技术细节,一些Android设备在收到一个错误的wpa_supplicant事件后可能会进入拒绝服务状态,这些事件让无线驱动和Android平台框架之间的接口有效。 + +###Google并不着急解决这个问题 + +Android安全组对于这个问题的放松态度可能是基于这个原因:这种拒绝服务状态只发生在扫描节点这一小段时间。 + +不仅如此,实际上结果也并不严重,因为它会导致设备重启。不存在数据泄漏的风险或是能引起这个问题的攻击,不会吸引攻击者。但另一方面,不管怎样都应该提供一个补丁,以减轻任何未来的潜在风险。 + +Core Security声称在Android 5.0.1及以上版本中没有测试到这个问题,他们发现的受影响的设备有Android系统4.4.4的Nexus 5和4,运行Android 4.2.2的LG D806和Samsung SM-T310,以及4.1.2版本系统的Motorola RAZR HD。 + +目前,减轻影响的方式是尽量不用Wi-Fi直连,或者升级到没有漏洞的Android版本。 + +-------------------------------------------------------------------------------- + +via:http://news.softpedia.com/news/Bug-In-Wi-Fi-Direct-Android-Implementation-Causes-Denial-of-Service-471299.shtml + +本文发布时间:27 Jan 2015, 09:11 GMT + +作者:[Ionut Ilascu][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/ionut-ilascu +[1]:http://www.coresecurity.com/advisories/android-wifi-direct-denial-service diff --git a/translated/tech/20150127 Install Jetty Web Server On CentOS 7.md b/published/20150127 Install Jetty Web Server On CentOS 7.md similarity index 79% rename from translated/tech/20150127 Install Jetty Web Server On CentOS 7.md rename to published/20150127 Install Jetty Web Server On CentOS 7.md index 3cdb89ca76..3de2c7d9fb 100644 --- a/translated/tech/20150127 Install Jetty Web Server On CentOS 7.md +++ b/published/20150127 Install Jetty Web Server On CentOS 7.md @@ -1,8 +1,8 @@ 在CentOS 7中安装Jetty服务器 ================================================================================ -[Jetty][1] 是一款纯Java的HTTP **(Web) 服务器**和Java Servlet容器。 通常在更大的网络框架中,Jetty经常用于设备间的通信。但是其他Web服务器通常给人类传递文件。Jetty是一个Eclipse基金中免费开源项目。这个Web服务器用于如Apache ActiveMQ、 Alfresco、 Apache Geronimo、 Apache Maven、 Apache Spark、Google App Engine、 Eclipse、 FUSE、 Twitter的 Streaming API 和 Zimbra中。 +[Jetty][1] 是一款纯Java的HTTP **(Web) 服务器**和Java Servlet容器。 通常在更大的网络框架中,Jetty经常用于设备间的通信,而其他Web服务器通常给“人类”传递文件 :D。Jetty是一个Eclipse基金会的免费开源项目。这个Web服务器用于如Apache ActiveMQ、 Alfresco、 Apache Geronimo、 Apache Maven、 Apache Spark、Google App Engine、 Eclipse、 FUSE、 Twitter的 Streaming API 和 Zimbra中。 -这篇文章会解释‘如何在CentOS服务器中安装Jetty服务器’。 +这篇文章会介绍‘如何在CentOS服务器中安装Jetty服务器’。 **首先我们要用下面的命令安装JDK:** @@ -58,7 +58,7 @@ 完成了! -现在你可以在 **http://:8080** 中访问了 +现在你可以在 **http://\<你的 IP 地址>:8080** 中访问了 就是这样。 @@ -70,7 +70,7 @@ via: http://www.unixmen.com/install-jetty-web-server-centos-7/ 作者:[Jijo][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/sources/news/20141219 Google Cloud offers streamlined Ubuntu for Docker use.md b/sources/news/20141219 Google Cloud offers streamlined Ubuntu for Docker use.md index 9af3b6665c..c63c4a78f2 100644 --- a/sources/news/20141219 Google Cloud offers streamlined Ubuntu for Docker use.md +++ b/sources/news/20141219 Google Cloud offers streamlined Ubuntu for Docker use.md @@ -21,7 +21,7 @@ Developed in part by two ex-Rackspace engineers, [CoreOS][8] is a lightweight Li CoreOS was quickly adopted by many cloud providers, including Microsoft Azure, Amazon Web Services, DigitalOcean and Google Compute Engine. Like CoreOS, Ubuntu Core offers an expedited process for updating components, reducing the amount of time that an administrator would need to manually manage them. - +如同Coreos一样,Ubuntu内核提供了一个快速引擎来更新组件 -------------------------------------------------------------------------------- via: http://www.infoworld.com/article/2860401/cloud-computing/google-cloud-offers-streamlined-ubuntu-for-docker-use.html @@ -40,4 +40,4 @@ via: http://www.infoworld.com/article/2860401/cloud-computing/google-cloud-offer [5]:http://www.itworld.com/article/2695383/open-source-tools/docker-all-geared-up-for-the-enterprise.html [6]:http://www.itworld.com/article/2695501/cloud-computing/google-unleashes-docker-management-tools.html [7]:http://www.itworld.com/article/2696116/open-source-tools/coreos-linux-does-away-with-the-upgrade-cycle.html -[8]:https://coreos.com/using-coreos/ \ No newline at end of file +[8]:https://coreos.com/using-coreos/ diff --git a/sources/news/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md b/sources/news/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md deleted file mode 100644 index 1fa678a6c1..0000000000 --- a/sources/news/20150126 Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon.md +++ /dev/null @@ -1,33 +0,0 @@ -Ubuntu 15.04 to Integrate Linux Kernel 3.19 Branch Soon ----- -*A new kernel branch is being tracked by Ubuntu* - -![Ubuntu 15.04 shortcuts](http://i1-news.softpedia-static.com/images/news2/Ubuntu-15-04-to-Integrate-Linux-Kernel-3-19-Branch-Soon-471121-2.jpg) - -#The Linux kernel is one of the most important components in a distribution and Ubuntu users are interested to know what will be used in the stable edition for the 15.04 branch, which is scheduled to arrive in a couple of months. - -The Ubuntu and the Linux kernel development cycles are not in sync and it's hard to anticipate what version will eventually land in Ubuntu 15.04. For now, Ubuntu 15.04 (Vivid Vervet) is using Linux kernel 3.18, but the developers are already looking to implement the 3.19 branch. - -"Our Vivid kernel remains based on the v3.18.2 upstream stable kernel, but we'll be rebasing to v3.18.3 shortly. We'll also be re-basing our unstable branch to v3.19-rc5 and get that uploaded to our team PPA soon," [said](1) Canonical's Joseph Salisbury. - -Linux kernel 3.19 is still under development and it will take a few weeks to see a stable version, but it's enough time to implement it in Ubuntu and test it properly. It won't be possible to get the 3.20 branch, for example, even if it launches before the April 23. - -You can [download Ubuntu 15.04](2) right now from Softpedia and give it a spin. It's a daily build and it contains all the improvements made so far to the distribution. - --------------------------------------------------------------------------------- - -via:http://news.softpedia.com/news/Data-of-20-Million-Users-Stolen-from-Dating-Website-471179.shtml - -本文发布时间:25 Jan 2015, 20:39 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]:https://lists.ubuntu.com/archives/ubuntu-devel/2015-January/038644.html -[2]:http://linux.softpedia.com/get/Linux-Distributions/Ubuntu-Vivid-Vervet-103651.shtml \ No newline at end of file diff --git a/sources/news/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md b/sources/news/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md deleted file mode 100644 index 8829296d18..0000000000 --- a/sources/news/20150127 Bug in Wi-Fi Direct Android Implementation Causes Denial of Service.md +++ /dev/null @@ -1,49 +0,0 @@ -Bug in Wi-Fi Direct Android Implementation Causes Denial of Service ----- -*Google marks the issue as having low severity, is not in a hurry to fix it* - -![Wi-Fi Direct glitch crashes Android](http://i1-news.softpedia-static.com/images/news2/Bug-In-Wi-Fi-Direct-Android-Implementation-Causes-Denial-of-Service-471299-2.jpg) - -#A vulnerability in the way Android handles Wi-Fi Direct connections leads to rebooting the device when searching for peers to connect to, which can be anything from other phones, cameras, gaming devices, computers, or printers. - -The Wi-Fi Direct technology allows devices capable of wireless connection to establish communication directly, without the need to join a local network. - -##Security company insisted on proper coordination for a fix - -The vulnerability allows an attacker to send a specially crafted 802.11 Probe Response frame to the device and crashes it due to an unhandled exception occurring on the WiFi monitoring class. - -Core Security discovered the flaw (CVE-2014-0997) through its CoreLabs team, and reported it to Google back in September 2014. The vendor acknowledged it but classified the glitch as having low severity, with no timeline for a fix being provided. - -The same answer was received by Core Security each time they contacted the Android security team to inform of a timeframe for rolling out a fix. The last reply of this kind was received on January 20, meaning that there is no patch for the time being. On Monday, the security company made their findings public. - -The security company created a (proof-of-concept)[1] to demonstrate the validity of the results obtained during their research. - -According to the technical details of the vulnerability, some Android devices can be induced a denial-of-service condition if they receive a malformed wpa_supplicant event, which makes available the interface between the wireless driver and the Android platform framework. - -##Google is not in a hurry to eliminate the problem - -The relaxed stance from the Android security team regarding the issue may be on account of the fact that denial-of-service condition occurs only for a short period of time, when scanning for peers. - -More than this, the result is not severe in nature as it consists in rebooting the device. There is no risk of data exfiltration or an attack that could lead to this, which would make it unappealing to a threat actor. On the other hand, a patch should be provided regardless, in order to mitigate any potential future risks. - -Core Security says that the issue was not detected on Android 5.0.1 and above, and among the devices affected they found Nexus 5 and 4 running version 4.4.4 of the mobile operating system, LG D806 and Samsung SM-T310 with Android 4.2.2, and Motorola RAZR HD with build 4.1.2 of the OS. - -For the time being, mitigation consists in refraining from using Wi-Fi Direct or updating to a non-vulnerable version of Android. - - --------------------------------------------------------------------------------- - -via:http://news.softpedia.com/news/Bug-In-Wi-Fi-Direct-Android-Implementation-Causes-Denial-of-Service-471299.shtml - -本文发布时间:27 Jan 2015, 09:11 GMT - -作者:[Ionut Ilascu][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/ionut-ilascu -[1]:http://www.coresecurity.com/advisories/android-wifi-direct-denial-service \ No newline at end of file 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 new file mode 100644 index 0000000000..3718ee58a6 --- /dev/null +++ b/sources/news/20150130 LibreOffice 4.4 Released as the Most Beautiful LibreOffice Ever.md @@ -0,0 +1,38 @@ +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 new file mode 100644 index 0000000000..552f98e3f2 --- /dev/null +++ b/sources/news/20150130 OpenJDK 7 Vulnerabilities Closed in Ubuntu 14.04 and Ubuntu 14.10.md @@ -0,0 +1,33 @@ +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/20150131 WordPress Can Be Used to Leverage Critical Ghost Flaw in Linux.md b/sources/news/20150131 WordPress Can Be Used to Leverage Critical Ghost Flaw in Linux.md new file mode 100644 index 0000000000..3d132079a4 --- /dev/null +++ b/sources/news/20150131 WordPress Can Be Used to Leverage Critical Ghost Flaw in Linux.md @@ -0,0 +1,49 @@ +WordPress Can Be Used to Leverage Critical Ghost Flaw in Linux +----- +*Users are advised to apply available patches immediately* + +![WordPress validating pingback’s post URL](http://i1-news.softpedia-static.com/images/news2/WordPress-Can-Be-Used-to-Leverage-Critical-Ghost-Flaw-in-Linux-471730-2.jpg) + +**The vulnerability revealed this week by security researchers at Qualys, who dubbed it [Ghost](1), could be taken advantage of through WordPress or other PHP applications to compromise web servers.** + +The glitch is a buffer overflow that can be triggered by an attacker to gain command execution privileges on a Linux machine. It is present in the glibc’s “__nss_hostname_digits_dots()” function that can be used by the “gethostbyname()” function. + +##PHP applications can be used to exploit the glitch + +Marc-Alexandre Montpas at Sucuri says that the problem is significant because these functions are used in plenty of software and server-level mechanism. + +“An example of where this could be a big issue is within WordPress itself: it uses a function named wp_http_validate_url() to validate every pingback’s post URL,” which is carried out through the “gethostbyname()” function wrapper used by PHP applications, he writes in a blog post on Wednesday. + +An attacker could use this method to introduce a malicious URL designed to trigger the vulnerability on the server side and thus obtain access to the machine. + +In fact, security researchers at Trustwave created [proof-of-concept](2) code that would cause the buffer overflow using the pingback feature in WordPress. + +##Multiple Linux distributions are affected + +Ghost is present in glibc versions up to 2.17, which was made available in May 21, 2013. The latest version of glibc is 2.20, available since September 2014. + +However, at that time it was not promoted as a security fix and was not included in many Linux distributions, those offering long-term support (LTS) in particular. + +Among the impacted operating systems are Debian 7 (wheezy), Red Hat Enterprise Linux 6 and 7, CentOS 6 and 7, Ubuntu 12.04. Luckily, Linux vendors have started to distribute updates with the fix that mitigates the risk. Users are advised to waste no time downloading and applying them. + +In order to demonstrate the flaw, Qualys has created an exploit that allowed them remote code execution through the Exim email server. The security company said that it would not release the exploit until the glitch reached its half-life, meaning that the number of the affected systems has been reduced by 50%. + +Vulnerable application in Linux are clockdiff, ping and arping (under certain conditions), procmail, pppd, and Exim mail server. + +-------------------------------------------------------------------------------- + +via:http://news.softpedia.com/news/WordPress-Can-Be-Used-to-Leverage-Critical-Ghost-Flaw-in-Linux-471730.shtml + +本文发布时间:30 Jan 2015, 17:36 GMT + +作者:[Ionut Ilascu][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/ionut-ilascu +[1]:http://news.softpedia.com/news/Linux-Systems-Affected-by-14-year-old-Vulnerability-in-Core-Component-471428.shtml +[2]:http://blog.spiderlabs.com/2015/01/ghost-gethostbyname-heap-overflow-in-glibc-cve-2015-0235.html 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 new file mode 100644 index 0000000000..acde800ad8 --- /dev/null +++ b/sources/news/20150202 The Pirate Bay Is Now Back Online.md @@ -0,0 +1,38 @@ +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 new file mode 100644 index 0000000000..89299a55d5 --- /dev/null +++ b/sources/news/20150205 Debian Forked over systemd--Birth of Devuan GNU or Linux Distribution.md @@ -0,0 +1,98 @@ +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 new file mode 100644 index 0000000000..02b147abd9 --- /dev/null +++ b/sources/news/20150207 BQ and Canonical Officially Launch Aquaris E4.5 Ubuntu Edition, the First Ubuntu Phone.md @@ -0,0 +1,45 @@ +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/share/20140821 What is a good EPUB reader on Linux.md b/sources/share/20140821 What is a good EPUB reader on Linux.md deleted file mode 100644 index 7e1958256b..0000000000 --- a/sources/share/20140821 What is a good EPUB reader on Linux.md +++ /dev/null @@ -1,66 +0,0 @@ -What is a good EPUB reader on Linux -================================================================================ -If the habit on reading books on electronic tablets is still on its way, reading books on a computer is even rarer. It is hard enough to focus on the classics of the 16th century literature, so who needs the Facebook chat pop up sound in the background in addition? But if for some reasons you wish to open an electronic book in your computer, chances are that you will need specific software. Indeed, most editors agreed with using the EPUB format for electronic books (for "Electronic PUBlication"). Hopefully, Linux is not deprived of good programs capable of dealing with such format. In short, here is a non-exhaustive list of good EPUB readers on Linux. - -### 1. Calibre ### - -![](https://farm6.staticflickr.com/5577/14975176155_0989766bb3_z.jpg) - -Let's dive in with maybe the biggest name of that list: [Calibre][1]. More than just an ebook reader, Calibre is a fully packaged e-library. It supports a plethora of formats (almost every I can think of), integrates a reader, a manager, a meta-data editor which can download covers from the Internet, an EPUB editor, a news reader, and a search engine to download additional books. To top it all, the interface is slick and has nothing to envy to other professional software. The only potential downside is that if you are looking for an EPUB reader, and are not interested in the whole library manager aspect, the program is too heavy for your needs. - -### 2. FBReader ### - -![](https://farm4.staticflickr.com/3900/14975176165_f2e4afd2fa_o.jpg) - -[FBReader][2] is also a library manager, but in a lighter way than Calibre. The interface is more sober, and is clearly cut in two: (1) the library aspect where you can add files, edit the meta-data, or download new books, and (2) the reader aspect. If you like simplicity, you might enjoy this program. I personally appreciate its straightforward tag and series system for classifying books. - -### 3. Cool Reader ### - -![](https://farm6.staticflickr.com/5594/14975176195_ac46952150.jpg) - -For all of you who are just looking for a way to visualize the content of an EPUB file, I recommend [Cool Reader][5]. In the spirit of Linux applications which do only one thing and do it well, Cool Reader is optimized to just open an EPUB file, and navigate through it via handy shortcuts. And since it is based on Qt, it also follows Qt's mentality by giving a ton of settings to mess around with. - -### 4. Okular ### - -![](https://farm6.staticflickr.com/5559/14788504729_5a2ec2c11b_z.jpg) - -Since we were talking about Qt applications, one of KDE's main document viewer, [Okular][3], also has the capacity to view EPUB files, once an EPUB library has been installed on the system. However, this is probably not a very good option if you are not a KDE user. - -### 5. pPub ### - -![](https://farm4.staticflickr.com/3835/14788504789_e7c742fa20_z.jpg) - -[pPub][4] is an old project that you can still find on Github. Its latest change seems to have been made two years ago. However, pPub is one of those programs that really deserve a second life. Written in Python and based on GTK3 and WebKit, pPub is lightweight and intuitive. The interface probably needs a little updating and is beyond sober, but the core is very good. It even supports JavaScript. So please, someone kick that up again. - -### 6. epub ### - -![](https://farm4.staticflickr.com/3871/14788844378_16fb51a1b9_z.jpg) - -If all you need is a quick and easy way to check the content of an EPUB file, without caring about any fancy GUI, maybe an EPUB reader with command line interface might just do. [epub][6] is a minimalistic EPUB reader written in Python, which allows you to read an EPUB file in a terminal environment. You can switch between chapter/TOC views, up/down a page, and nothing more. This is as simple as any EPUB reader can possibly get. - -### 7. Sigil ### - -![](https://farm4.staticflickr.com/3921/14788640417_7940627871_z.jpg) - -Finally, last of the list is not actually an EPUB reader, but more of a standalone editor. [Sigil][7] is able to extract the content of an EPUB file, and break it down for what it really is: xhtml text, images, styles, and sometimes audio. The interface is a lot more complex than the one for a basic reader, but remains clear and well thought, on par with the features it provides. I particularly appreciate the tab system. If you are familiar with editing web pages, you will be in know territory here. - -To conclude, there are a lot of open source EPUB readers out there. Some do nothing more, while others go way beyond that. As usual, I recommend using the one that makes the most sense for you to use. If you know more good EPUB readers on Linux that you like, please let us know in the comments. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/08/good-epub-reader-linux.html - -作者:[Adrien Brochard][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/adrien -[1]:http://calibre-ebook.com/ -[2]:http://fbreader.org/ -[3]:http://okular.kde.org/ -[4]:https://github.com/sakisds/pPub -[5]:http://crengine.sourceforge.net/ -[6]:https://github.com/rupa/epub -[7]:https://github.com/user-none/Sigil \ No newline at end of file diff --git a/sources/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md b/sources/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md deleted file mode 100644 index 8836812288..0000000000 --- a/sources/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md +++ /dev/null @@ -1,111 +0,0 @@ -Best GNOME Shell Themes For Ubuntu 14.04 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Best_Gnome_Shell_Themes.jpeg) - -Themes are the best way to customize your Linux desktop. If you [install GNOME on Ubuntu 14.04][1] or 14.10, you might want to change the default theme and give it a different look. To help you in this task, I have compiled here a **list of best GNOME shell themes for Ubuntu** or any other Linux OS that has GNOME shell installed on it. But before we see the list, let’s first see how to change install new themes in GNOME Shell. - -### Install themes in GNOME Shell ### - -To install new themes in GNOME with Ubuntu, you can use Gnome Tweak Tool which is available in software repository in Ubuntu. Open a terminal and use the following command: - - sudo apt-get install gnome-tweak-tool - -Alternatively, you can use themes by putting them in ~/.themes directory. I have written a detailed tutorial on [how to install and use themes in GNOME Shell][2], in case you need it. - -### Best GNOME Shell themes ### - -The themes listed here are tested on GNOME Shell 3.10.4 but it should work for all version of GNOME 3 and higher. For the sake of mentioning, the themes are not in any kind of priority order. Let’s have a look at the best GNOME themes: - -#### Numix #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/02/mockups_numix_5.jpeg) - -No list can be completed without the mention of [Numix themes][3]. These themes got so popular that it encouraged [Numix team to work on a new Linux OS, Ozon][4]. Considering their design work with Numix theme, it won’t be exaggeration to call it one of the [most beautiful Linux OS][5] releasing in near future. - -To install Numix theme in Ubuntu based distributions, use the following commands: - - sudo apt-add-repository ppa:numix/ppa - sudo apt-get update - sudo apt-get install numix-icon-theme-circle - -#### Elegance Colors #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Elegance_Colors_Theme_GNOME_Shell.jpeg) - -Another beautiful theme from Satyajit Sahoo, who is also a member of Numix team. [Elegance Colors][6] has its own PPA so that you can easily install it: - - sudo add-apt-repository ppa:satyajit-happy/themes - sudo apt-get update - sudo apt-get install gnome-shell-theme-elegance-colors - -#### Moka #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Moka_GNOME_Shell.jpeg) - -[Moka][7] is another mesmerizing theme that is always included in the list of beautiful themes. Designed by the same developer who gave us Unity Tweak Tool, Moka is a must try: - - sudo add-apt-repository ppa:moka/stable - sudo apt-get update - sudo apt-get install moka-gnome-shell-theme - -#### Viva #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Viva_GNOME_Theme.jpg) - -Based on Gnome’s default Adwaita theme, Viva is a nice theme with shades of black and oranges. You can download Viva from the link below. - -- [Download Viva GNOME Shell Theme][8] - -#### Ciliora-Prima #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Ciliora_Prima_Gnome_Shell.jpeg) - -Previously known as Zukitwo Dark, Ciliora-Prima has square icons theme. Theme is available in three versions that are slightly different from each other. You can download it from the link below. - -- [Download Ciliora-Prima GNOME Shell Theme][9] - -#### Faience #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Faience_GNOME_Shell_Theme.jpeg) - -Faience has been a popular theme for quite some time and rightly so. You can install Faience using the PPA below for GNOME 3.10 and higher. - - sudo add-apt-repository ppa:tiheum/equinox - sudo apt-get update - sudo apt-get install faience-theme - -#### Paper [Incomplete] #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Paper_GTK_Theme.jpeg) - -Ever since Google talked about Material Design, people have been going gaga over it. Paper GTK theme, by Sam Hewitt (of Moka Project), is inspired by Google Material design and currently under development. Which means you will not have the best experience with Paper at the moment. But if your a bit experimental, like me, you can definitely give it a try. - - sudo add-apt-repository ppa:snwh/pulp - sudo apt-get update - sudo apt-get install paper-gtk-theme - -That concludes my list. If you are trying to give a different look to your Ubuntu, you should also try the list of [best icon themes for Ubuntu 14.04][10]. - -How do you find this list of **best GNOME Shell themes**? Which one is your favorite among the one listed here? And if it’s not listed here, do let us know which theme you think is the best GNOME Shell theme. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/gnome-shell-themes-ubuntu-1404/ - -作者:[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/how-to-install-gnome-in-ubuntu-14-04/ -[2]:http://itsfoss.com/install-switch-themes-gnome-shell/ -[3]:https://numixproject.org/ -[4]:http://itsfoss.com/numix-linux-distribution/ -[5]:http://itsfoss.com/new-beautiful-linux-2015/ -[6]:http://satya164.deviantart.com/art/Gnome-Shell-Elegance-Colors-305966388 -[7]:http://mokaproject.com/ -[8]:https://github.com/vivaeltopo/gnome-shell-theme-viva -[9]:http://zagortenay333.deviantart.com/art/Ciliora-Prima-Shell-451947568 -[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ \ No newline at end of file diff --git a/sources/share/20150125 4 Best Modern Open Source Code Editors For Linux.md b/sources/share/20150125 4 Best Modern Open Source Code Editors For Linux.md deleted file mode 100644 index 43ff7e9877..0000000000 --- a/sources/share/20150125 4 Best Modern Open Source Code Editors For Linux.md +++ /dev/null @@ -1,88 +0,0 @@ -su-kaiyao translating - -4 Best Modern Open Source Code Editors For Linux -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Best_Open_Source_Editors.jpeg) - -Looking for **best programming editors in Linux**? If you ask the old school Linux users, their answer would be Vi, Vim, Emacs, Nano etc. But I am not talking about them. I am going to talk about new age, cutting edge, great looking, sleek and yet powerful, feature rich **best open source code editors for Linux** that would enhance your programming experience. - -### Best modern Open Source editors for Linux ### - -I use Ubuntu as my main desktop and hence I have provided installation instructions for Ubuntu based distributions. But this doesn’t make this list as **best text editors for Ubuntu** because the list is apt for any Linux distribution. Just to add, the list is not in any particular priority order. - -#### Brackets #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/brackets_UI.jpeg) - -[Brackets][1] is an open source code editor from [Adobe][2]. Brackets focuses exclusively on the needs of web designers with built in support for HTML, CSS and Java Script. It’s light weight and yet powerful. It provides you with inline editing and live preview. There are plenty of plugins available to further enhance your experience with Brackets. - -To [install Brackets in Ubuntu][3] and Ubuntu based distributions such as Linux Mint, you can use this unofficial PPA: - - sudo add-apt-repository ppa:webupd8team/brackets - sudo apt-get update - sudo apt-get install brackets - -For other Linux distributions, you can get the source code as well as binaries for Linux, OS X and Windows on its website. - -- [Download Brackets Source Code and Binaries][5] - -#### Atom #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Atom_Editor.jpeg) - -[Atom][5] is another modern and sleek looking open source editor for programmers. Atom is developed by Github and promoted as a “hackable text editor for the 21st century”. The looks of Atom resembles a lot like Sublime Text editor, a hugely popular but closed source text editors among programmers. - -Atom has recently released .deb and .rpm packages so that one can easily install Atom in Debian and Fedora based Linux distributions. Of course, its source code is available as well. - -- [Download Atom .deb][6] -- [Download Atom .rpm][7] -- [Get Atom source code][8] - -#### Lime Text #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/LimeTextEditor.jpeg) - -So you like Sublime Text editor but you are not comfortable with the fact that it is not open source. No worries. We have an [open source clone of Sublime Text][9], called [Lime Text][10]. It is built on Go, HTML and QT. The reason behind cloning of Sublime Text is that there are numerous bugs in Sublime Text 2 and Sublime Text 3 is in beta since forever. There are no transparency in its development, on whether the bugs are being fixed or not. - -So open source lovers, rejoice and get the source code of Lime Text from the link below: - -- [Get Lime Text Source Code][11] - -#### Light Table #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Light_Table.jpeg) - -Flaunted as “the next generation code editor”, [Light Table][12] is another modern looking, feature rich open source editor which is more of an IDE than a mere text editor. There are numerous extensions available to enhance its capabilities. Inline evaluation is what you would love in it. You have to use it to believe how useful Light Table actually is. - -- [Get Light Table Source Code][13] - -### What’s your pick? ### - -No, we are not limited to just four code editors in Linux. The list was about modern editors for programmers. Of course you have plenty of other options such as [Notepad++ alternative Notepadqq][14] or [SciTE][15] and many more. So, among these four, which one is your favorite code editor for Linux? - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/best-modern-open-source-code-editors-for-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://brackets.io/ -[2]:http://www.adobe.com/ -[3]:http://itsfoss.com/install-brackets-ubuntu/ -[4]:https://github.com/adobe/brackets/releases -[5]:https://atom.io/ -[6]:https://atom.io/download/deb -[7]:https://atom.io/download/rpm -[8]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md -[9]:http://itsfoss.com/lime-text-open-source-alternative/ -[10]:http://limetext.org/ -[11]:https://github.com/limetext/lime -[12]:http://lighttable.com/ -[13]:https://github.com/LightTable/LightTable -[14]:http://itsfoss.com/notepadqq-notepad-for-linux/ -[15]:http://itsfoss.com/scite-the-notepad-for-linux/ 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 index c55a5fabe7..d8df2ec586 100644 --- 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 @@ -1,3 +1,5 @@ +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) @@ -57,4 +59,4 @@ via: http://www.omgubuntu.co.uk/2015/01/vivaldi-web-browser-linux-download-power 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://vivaldi.com/#Download \ No newline at end of file +[1]:https://vivaldi.com/#Download diff --git a/sources/talk/20150114 Why Mac users don't switch to Linux.md b/sources/talk/20150114 Why Mac users don't switch to Linux.md deleted file mode 100644 index 6a72276819..0000000000 --- a/sources/talk/20150114 Why Mac users don't switch to Linux.md +++ /dev/null @@ -1,82 +0,0 @@ -[Translating by Stevearzh] -Why Mac users don’t switch to Linux -================================================================================ -Linux and Mac users share at least one common thing: they prefer not to use Windows. But after that the two groups part company and tend to go their separate ways. But why don’t more Mac users switch to Linux? Is there something that prevents Mac users from making the jump? - -[Datamation took a look at these questions][1] and tried to answer them. Datamation’s conclusion was that it’s really about the applications and workflow, not the operating system: - -> …there are some instances where replacing existing applications with new options isn’t terribly practical – both in workflow and in overall functionality. This is an area where, sadly, Apple has excelled in. So while it’s hardly “impossible” to get around these issues, they are definitely a large enough challenge that it will give the typical Mac enthusiast pause. -> -> But outside of Web developers, honestly, I don’t see Mac users “en masse,” seeking to disrupt their workflows for the mere idea of avoiding the upgrade to OS X Yosemite. Granted, having seen Yosemite up close – Mac users who are considered power users will absolutely find this change-up to be hideous. However, despite poor OS X UI changes, the core workflow for existing Mac users will remain largely unchanged and unchallenged. -> -> No, I believe Linux adoption will continue to be sporadic and random. Ever-growing, but not something that is easily measured or accurately calculated. - -I agree to a certain extent with Datamation’s take on the importance of applications and workflows, both things are important and matter in the choice of a desktop operating system. But I think there’s something more going on with Mac users than just that. I believe that there’s a different mentality that exists between Linux and Mac users, and I think that’s the real reason why many Mac users don’t switch to Linux. - -![](http://jimlynch.com/wp-content/uploads/2015/01/mac-users-switch-to-linux.jpeg) - -### It’s all about control for Linux users ### - -Linux users tend to want control over their computing experience, they want to be able to change things to make them the way that they want them. One simply cannot do that in the same way with OS X or any other Apple products. With Apple you get what they give you for the most part. - -For Mac (and iOS) users this is fine, they seem mostly content to stay within Apple’s walled garden and live according to whatever standards and options Apple gives them. But this is totally unacceptable to most Linux users. People who move to Linux usually come from Windows, and it’s there that they develop their loathing for someone else trying to define or control their computing experiences. - -And once someone like that has tasted the freedom that Linux offers, it’s almost impossible for them to want to go back to living under the thumb of Apple, Microsoft or anyone else. You’d have to pry Linux from their cold, dead fingers before they’d accept the computing experience created for them Apple or Microsoft. - -But you won’t find that same determination to have control among most Mac users. For them it’s mostly about getting the most out of whatever Apple has done with OS X in its latest update. They tend to adjust fairly quickly to new versions of OS X and even when unhappy with Apple’s changes they seem content to continue living within Apple’s walled garden. - -So the need for control is a huge difference between Mac and Linux users. I don’t see it as a problem though since it just reflects the reality of two very different attitudes toward using computers. - -### Mac users need Apple’s support mechanisms ### - -Linux users are also different in the sense that they don’t mind getting their hands dirty by getting “under the hood” of their computers. Along with control comes the personal responsibility of making sure that their Linux systems work well and efficiently, and digging into the operating system is something that many Linux users have no problem doing. - -When a Linux user needs to fix something, chances are they will attempt to do so immediately themselves. If that doesn’t work then they’ll seek additional information online from other Linux users and work through the problem until it has been resolved. - -But Mac users are most likely not going to do that to the same extent. That is probably one of the reasons why Apple stores are so popular and why so many Mac users opt to buy Apple Care when they get a new Mac. A Mac user can simply take his or her computer to the Apple store and ask someone to fix it for them. There they can belly up to the Genius Bar and have their computer looked at by someone Apple has paid to fix it. - -Most Linux users would blanche at the thought of doing such a thing. Who wants some guy you don’t even know to lay hands on your computer and start trying to fix it for you? Some Linux users would shudder at the very idea of such a thing happening. - -So it would be hard for a Mac user to switch to Linux and suddenly be bereft of the support from Apple that he or she was used to getting in the past. Some Mac users might feel very vulnerable and uncertain if they were cut off from the Apple mothership in terms of support. - -### Mac users love Apple’s hardware ### - -The Datamation article focused on software, but I believe that hardware also matters to Mac users. Most Apple customers tend to love Apple’s hardware. When they buy a Mac, they aren’t just buying it for OS X. They are also buying Apple’s industrial design expertise and that can be an important differentiator for Mac users. Mac users are willing to pay more because they perceive that the overall value they are getting from Apple for a Mac is worth it. - -Linux users, on the other hand, seem less concerned by such things. I think they tend to focus more on cost and less on the looks or design of their computer hardware. For them it’s probably about getting the most value from the hardware at the lowest cost. They aren’t in love with the way their computer hardware looks in the same way that some Mac users probably are, and so they don’t make buying decisions based on it. - -I think both points of view on hardware are equally valid. It ultimately gets down to the needs of the individual user and what matters to them when they choose to buy or, in the case of some Linux users, build their computer. Value is the key for both groups, and each has its own perceptions of what constitutes real value in a computer. - -Of course it is [possible to run Linux on a Mac][2], directly or indirectly via virtual machine. So a user that really liked Apple’s hardware does have the option of keeping their Mac but installing Linux on it. - -### Too many Linux distros to choose from? ### - -Another reason that might make it hard for a Mac user to move to Linux is the sheer number of distributions to choose from in the world of Linux. While most Linux users probably welcome the huge diversity of distros available, it could also be very confusing for a Mac user who hasn’t learned to navigate those choices. - -Over time I think a Mac user would learn and adjust by figuring out which distribution worked best for him or her. But in the short term it might be a very daunting hurdle to overcome after being used to OS X for a long period of time. I don’t think it’s insurmountable, but it’s definitely something that is worth mentioning here. - -Of course we do have helpful resources like [DistroWatch][3] and even my own [Desktop Linux Reviews][4] blog that can help people find the right Linux distribution. Plus there are many articles available about “the best Linux distro” and that sort of thing that Mac users can use as resources when trying to figure out the distribution they want to use. - -But one of the reasons why Apple customers buy Macs is the simplicity and all-in-one solution that they offer in terms of the hardware and software being unified by Apple. So I am not sure how many Mac users would really want to spend the time trying to find the right Linux distribution. It might be something that puts them off really considering the switch to Linux. - -### Mac users are apples and Linux users are oranges ### - -I see nothing wrong with Mac and Linux users going their separate ways. I think we’re just talking about two very different groups of people, and it’s a good thing that both groups can find and use the operating system and software that they prefer. Let Mac users enjoy OS X and let Linux users enjoy Linux, and hopefully both groups will be happy and content with their computers. - -Every once in a while a Mac user might stray over to Linux or vice versa, but for the most part I think the two groups live in different worlds and mostly prefer to stay separate and apart from one another. I generally don’t compare the two because when you get right down to it, it’s really just a case of apples and oranges. - --------------------------------------------------------------------------------- - -via: http://jimlynch.com/linux-articles/why-mac-users-dont-switch-to-linux/ - -作者:[Jim Lynch][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://jimlynch.com/author/Jim/ -[1]:http://www.datamation.com/open-source/why-linux-isnt-winning-over-mac-users-1.html -[2]:http://www.howtogeek.com/187410/how-to-install-and-dual-boot-linux-on-a-mac/ -[3]:http://distrowatch.com/ -[4]:http://desktoplinuxreviews.com/ \ No newline at end of file diff --git a/sources/talk/20150121 If a 32-bit integer overflows.md b/sources/talk/20150121 If a 32-bit integer overflows.md deleted file mode 100644 index fc8c375919..0000000000 --- a/sources/talk/20150121 If a 32-bit integer overflows.md +++ /dev/null @@ -1,96 +0,0 @@ -KayGuoWhu translating -If a 32-bit integer overflows, can we use a 40-bit structure instead of a 64-bit long one? ---------- - -#Q: - -If, say, a 32-bit integer is overflowing, instead of upgrading int to long, can we make use of some 40-bit type if we need a range only within 240, so that we save 24 (64-40) bits for every integer? - -If so, how? - -I have to deal with billions and space is a bigger constraint. - -#A: - -##Yes, but... - -It is certainly possible, but it is usually nonsensical (for any program that doesn't use billions of these numbers): - -```C -#include // don't want to rely on something like long long -struct bad_idea -{ - uint64_t var : 40; -}; -``` - -Here, var will indeed have a width of 40 bits at the expense of much less efficient code generated (it turns out that "much" is very much wrong -- the measured overhead is a mere 1-2%, see timings below), and usually to no avail. Unless you have need for another 24-bit value (or an 8 and 16 bit value) which you wish to pack into the same structure, alignment will forfeit anything that you may gain. - -In any case, unless you have billions of these, the effective difference in memory consumption will not be noticeable (but the extra code needed to manage the bit field will be noticeable!). - -###Note: - -The question has in the mean time been updated to reflect that indeed billions of numbers are needed, so this may be a viable thing to do, presumed that you take measures not to lose the gains due to structure alignment and padding, i.e. either by storing something else in the remaining 24 bits or by storing your 40-bit values in structures of 8 each or multiples thereof). -Saving three bytes a billion times is worthwhile as it will require noticeably fewer memory pages and thus cause fewer cache and TLB misses, and above all page faults (a single page fault weighting tens of millions instructions). - -While the above snippet does not make use of the remaining 24 bits (it merely demonstrates the "use 40 bits" part), something akin to the following will be necessary to really make the approach useful in a sense of preserving memory -- presumed that you indeed have other "useful" data to put in the holes: - -```C -struct using_gaps -{ - uint64_t var : 40; - uint64_t useful_uint16 : 16; - uint64_t char_or_bool : 8; -}; -``` - -Structure size and alignment will be equal to a 64 bit integer, so nothing is wasted if you make e.g. an array of a billion such structures (even without using compiler-specific extensions). If you don't have use for an 8-bit value, you could also use an 48-bit and a 16-bit value (giving a bigger overflow margin). -Alternatively you could, at the expense of usability, put 8 40-bit values into a structure (least common multiple of 40 and 64 being 320 = 8*40). Of course then your code which accesses elements in the array of structures will become much more complicated (though one could probably implement an operator[] that restores the linear array functionality and hides the structure complexity). - -Update: -Wrote a quick test suite, just to see what overhead the bitfields (and operator overloading with bitfield refs) would have. Posted code (due to length) at gcc.godbolt.org, test output from my Win7-64 machine is: - -```TXT -Running test for array size = 1048576 -what alloc seq(w) seq(r) rand(w) rand(r) free ------------------------------------------------------------ -uint32_t 0 2 1 35 35 1 -uint64_t 0 3 3 35 35 1 -bad40_t 0 5 3 35 35 1 -packed40_t 0 7 4 48 49 1 - - -Running test for array size = 16777216 -what alloc seq(w) seq(r) rand(w) rand(r) free ------------------------------------------------------------ -uint32_t 0 38 14 560 555 8 -uint64_t 0 81 22 565 554 17 -bad40_t 0 85 25 565 561 16 -packed40_t 0 151 75 765 774 16 - - -Running test for array size = 134217728 -what alloc seq(w) seq(r) rand(w) rand(r) free ------------------------------------------------------------ -uint32_t 0 312 100 4480 4441 65 -uint64_t 0 648 172 4482 4490 130 -bad40_t 0 682 193 4573 4492 130 -packed40_t 0 1164 552 6181 6176 130 -``` - -What one can see is that the extra overhead of bitfields is neglegible, but the operator overloading with bitfield reference as a convenience thing is rather drastic (about 3x increase) when accessing data linearly in a cache-friendly manner. On the other hand, on random access it barely even matters. - -These timings suggest that simply using 64-bit integers would be better since they are still faster overall than bitfields (despite touching more memory), but of course they do not take into account the cost of page faults with much bigger datasets. It might look very different once you run out of physical RAM (I didn't test that). - ------- - -via:[stackoverflow](http://stackoverflow.com/questions/27705409/if-a-32-bit-integer-overflows-can-we-use-a-40-bit-structure-instead-of-a-64-bit/27705562#27705562) - -作者:[Damon][a][Michael Kohne][b] -译者:[译者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/572743/damon -[b]:http://stackoverflow.com/users/5801/michael-kohne \ No newline at end of file diff --git a/sources/talk/20150122 How are C data types “supported directly by most computers”.md b/sources/talk/20150122 How are C data types “supported directly by most computers”.md deleted file mode 100644 index 0b57189252..0000000000 --- a/sources/talk/20150122 How are C data types “supported directly by most computers”.md +++ /dev/null @@ -1,53 +0,0 @@ -How are C data types “supported directly by most computers”? ---------- - -#Q: - -I am reading K&R's *The C Programming Language*” and came across this statement [Introduction, p. 3]: - ->Because the data types and control structures provided by C are supported directly by most computers, the run-time library required to implement self-contained programs is tiny. - -What does the bolded statement mean? Is there an example of a data type or a control structure that isn't supported directly by a computer? - -#A: - -Yes, there are data types not directly supported. - -On many embedded systems, there is no hardware floating point unit. So, when you write code like this: - -```C -float x = 1.0f, y = 2.0f; -return x + y; -``` - -It gets translated into something like this: - -```C -unsigned x = 0x3f800000, y = 0x40000000; -return _float_add(x, y); -``` - -Then the compiler or standard library has to supply an implementation of `_float_add()`, which takes up memory on your embedded system. If you're counting bytes on a really tiny system, this can add up. - -Another common example is 64-bit integers (`long long` in the C standard since 1999), which are not directly supported by 32-bit systems. Old SPARC systems didn't support integer multiplication, so multiplication had to be supplied by the runtime. There are other examples. - -##Other languages - -By comparison, other languages have more complicated primitives. - -For example, a Lisp symbol requires a lot of runtime support, just like tables in Lua, strings in Python, arrays in Fortran, et cetera. The equivalent types in C are usually either not part of the standard library at all (no standard symbols or tables) or they are much simpler and don't require much runtime support (arrays in C are basically just pointers, nul-terminated strings are almost as simple). - -##Control structures - -A notable control structure missing from C is exception handling. Nonlocal exit is limited to `setjmp()` and `longjmp()`, which just save and restore certain parts of processor state. By comparison, the C++ runtime has to walk the stack and call destructors and exception handlers. - ----- -via:[stackoverflow](http://stackoverflow.com/questions/27977522/how-are-c-data-types-supported-directly-by-most-computers/27977605#27977605) - -作者:[Dietrich Epp][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/82294/dietrich-epp \ No newline at end of file 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 index 25a2dc6daf..b2e6372a0b 100644 --- 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 @@ -1,3 +1,4 @@ +translating by KayGuoWhu Why does C++ promote an int to a float when a float cannot represent all int values? --------- diff --git a/sources/talk/20150128 7 communities driving open source development.md b/sources/talk/20150128 7 communities driving open source development.md new file mode 100644 index 0000000000..3b3c450cf8 --- /dev/null +++ b/sources/talk/20150128 7 communities driving open source development.md @@ -0,0 +1,86 @@ +7 communities driving open source development +================================================================================ +Not so long ago, the open source model was the rebellious kid on the block, viewed with suspicion by established industry players. Today, open initiatives and foundations are flourishing with long lists of vendor committers who see the model as a key to innovation. + +![](http://images.techhive.com/images/article/2015/01/0_opensource-title-100539095-orig.jpg) + +### Open Development of Tech Drives Innovation ### + +Over the past two decades, open development of technology has come to be seen as a key to driving innovation. Even companies that once saw open source as a threat have come around — Microsoft, for example, is now active in a number of open source initiatives. To date, most open development has focused on software. But even that is changing as communities have begun to coalesce around open hardware initiatives. Here are seven organizations that are successfully promoting and developing open technologies, both hardware and software. + +### OpenPOWER Foundation ### + +![](http://images.techhive.com/images/article/2015/01/1_openpower-100539100-orig.jpg) + +The [OpenPOWER Foundation][2] was founded by IBM, Google, Mellanox, Tyan and NVIDIA in 2013 to drive open collaboration hardware development in the same spirit as the open source software development which has found fertile ground in the past two decades. + +IBM seeded the foundation by opening up its Power-based hardware and software technologies, offering licenses to use Power IP in independent hardware products. More than 70 members now work together to create custom open servers, components and software for Linux-based data centers. + +In April, OpenPOWER unveiled a technology roadmap based on new POWER8 process-based servers capable of analyzing data 50 times faster than the latest x86-based systems. In July, IBM and Google released a firmware stack. October saw the availability of NVIDIA GPU accelerated POWER8 systems and the first OpenPOWER reference server from Tyan. + +### The Linux Foundation ### + +![](http://images.techhive.com/images/article/2015/01/2_the-linux-foundation-100539101-orig.jpg) + +Founded in 2000, [The Linux Foundation][2] is now the host for the largest open source, collaborative development effort in history, with more than 180 corporate members and many individual and student members. It sponsors the work of key Linux developers and promotes, protects and advances the Linux operating system and collaborative software development. + +Some of its most successful collaborative projects include Code Aurora Forum (a consortium of companies with projects serving the mobile wireless industry), MeeGo (a project to build a Linux kernel-based operating system for mobile devices and IVI) and the Open Virtualization Alliance (which fosters the adoption of free and open source software virtualization solutions). + +### Open Virtualization Alliance ### + +![](http://images.techhive.com/images/article/2015/01/3_open-virtualization-alliance-100539102-orig.jpg) + +The [Open Virtualization Alliance (OVA)][3] exists to foster the adoption of free and open source software virtualization solutions like Kernel-based Virtual Machine (KVM) through use cases and support for the development of interoperable common interfaces and APIs. KVM turns the Linux kernel into a hypervisor. + +Today, KVM is the most commonly used hypervisor with OpenStack. + +### The OpenStack Foundation ### + +![](http://images.techhive.com/images/article/2015/01/4_the-openstack-foundation-100539096-orig.jpg) + +Originally launched as an Infrastructure-as-a-Service (IaaS) product by NASA and Rackspace hosting in 2010, the [OpenStack Foundation][4] has become the home for one of the biggest open source projects around. It boasts more than 200 member companies, including AT&T, AMD, Avaya, Canonical, Cisco, Dell and HP. + +Organized around a six-month release cycle, the foundation's OpenStack projects are developed to control pools of processing, storage and networking resources through a data center — all managed or provisioned through a Web-based dashboard, command-line tools or a RESTful API. So far, the collaborative development supported by the foundation has resulted in the creation of OpenStack components including OpenStack Compute (a cloud computing fabric controller that is the main part of an IaaS system), OpenStack Networking (a system for managing networks and IP addresses) and OpenStack Object Storage (a scalable redundant storage system). + +### OpenDaylight ### + +![](http://images.techhive.com/images/article/2015/01/5_opendaylight-100539097-orig.jpg) + +Another collaborative project to come out of the Linux Foundation, [OpenDaylight][5] is a joint initiative of industry vendors, like Dell, HP, Oracle and Avaya founded in April 2013. Its mandate is the creation of a community-led, open, industry-supported framework consisting of code and blueprints for Software-Defined Networking (SDN). The idea is to provide a fully functional SDN platform that can be deployed directly, without requiring other components, though vendors can offer add-ons and enhancements. + +### Apache Software Foundation ### + +![](http://images.techhive.com/images/article/2015/01/6_apache-software-foundation-100539098-orig.jpg) + +The [Apache Software Foundation (ASF)][7] is home to nearly 150 top level projects ranging from open source enterprise automation software to a whole ecosystem of distributed computing projects related to Apache Hadoop. These projects deliver enterprise-grade, freely available software products, while the Apache License is intended to make it easy for users, whether commercial or individual, to deploy Apache products. + +ASF was incorporated in 1999 as a membership-based, not-for-profit corporation with meritocracy at its heart — to become a member you must first be actively contributing to one or more of the foundation's collaborative projects. + +### Open Compute Project ### + +![](http://images.techhive.com/images/article/2015/01/7_open-compute-project-100539099-orig.jpg) + +An outgrowth of Facebook's redesign of its Oregon data center, the [Open Compute Project (OCP)][7] aims to develop open hardware solutions for data centers. The OCP is an initiative made up of cheap, vanity-free servers, modular I/O storage for Open Rack (a rack standard designed for data centers to integrate the rack into the data center infrastructure) and a relatively "green" data center design. + +OCP board members include representatives from Facebook, Intel, Goldman Sachs, Rackspace and Microsoft. + +OCP recently announced two options for licensing: an Apache 2.0-like license that allows for derivative works and a more prescriptive license that encourages changes to be rolled back into the original software. + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/2866074/opensource-subnet/7-communities-driving-open-source-development.html + +作者:[Thor Olavsrud][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.networkworld.com/author/Thor-Olavsrud/ +[1]:http://openpowerfoundation.org/ +[2]:http://www.linuxfoundation.org/ +[3]:https://openvirtualizationalliance.org/ +[4]:http://www.openstack.org/foundation/ +[5]:http://www.opendaylight.org/ +[6]:http://www.apache.org/ +[7]:http://www.opencompute.org/ \ 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 new file mode 100644 index 0000000000..83f5f11293 --- /dev/null +++ b/sources/talk/20150203 9 Best IDEs and Code Editors for JavaScript Users.md @@ -0,0 +1,82 @@ +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 GHOST--Another Security Bug Hits Linux, But is it That Bad.md b/sources/talk/20150205 GHOST--Another Security Bug Hits Linux, But is it That Bad.md new file mode 100644 index 0000000000..90923c1aae --- /dev/null +++ b/sources/talk/20150205 GHOST--Another Security Bug Hits Linux, But is it That Bad.md @@ -0,0 +1,34 @@ +GHOST: Another Security Bug Hits Linux, But is it That Bad? +================================================================================ +> GHOST, a newly announced security vulnerability that affects Linux servers and other systems that use the open source glibc library, is not as dangerous to data privacy as the Shellshock or Heartbleed bugs. + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/01/ghost-costume.jpg) + +Heartbleed is not even a year behind us, and the open source world has been hit with another major security vulnerability in the form of [GHOST][1], which involves holes in the Linux glibc library. This time, though, the actual danger may not live up to the hype. + +The GHOST vulnerability, which was announced last week by security researchers at [Qualys][2], resides in the gethostbyname*() functions of the glibc library. glibc is one of the core building blocks of most Linux systems, and gethostbyname*(), which resolves domain names into IP addresses, is widely used in open source applications. + +Attackers can exploit the GHOST security hole to create a buffer overflow, making it possible to execute any kind of code they want and do all sorts of nasty things. + +All of the above suggests that GHOST is bad news indeed. Fortunately for the open source community, however, the actual risk appears small. As TrendMicro [points out][3], the bug that makes the exploit possible has been fixed in glibc since May 2013, meaning that any Linux servers or PCs running more recent versions of the software are safe from attack. + +In addition, gethostbyname*() has been superseded by newer glibc functions that can better handle modern networking environments. Those include ones that use the IPv6 protocol, which gethostbyname*() doesn't support. As a result, newer applications often don't use the gethostbyname*() functions, and are not at risk. + +And perhaps most importantly, there's currently no known way of executing GHOST attacks through the Web. That greatly reduces opportunities for using this vulnerability to steal the data of unsuspecting users or otherwise wreak havoc. + +All in all, then, GHOST doesn't seem like a vulnerability that will prove as serious as Heartbleed or Shellshock, two other recent security problems that affected widely used open source software. + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/020415/ghost-another-security-bug-hits-linux-it-bad + +作者:[Christopher Tozzi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:https://community.qualys.com/blogs/laws-of-vulnerabilities/2015/01/27/the-ghost-vulnerability +[2]:http://qualys.com/ +[3]:http://blog.trendmicro.com/trendlabs-security-intelligence/not-so-spooky-linux-ghost-vulnerability/ \ 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 new file mode 100644 index 0000000000..c591faafcd --- /dev/null +++ b/sources/talk/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md @@ -0,0 +1,32 @@ +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/The history of Android/14 - The history of Android.md b/sources/talk/The history of Android/14 - The history of Android.md index 2825d7eee8..3377527026 100644 --- a/sources/talk/The history of Android/14 - The history of Android.md +++ b/sources/talk/The history of Android/14 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ### Voice Actions—a supercomputer in your pocket ### @@ -79,4 +81,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [5]:http://arstechnica.com/gadgets/2013/12/google-robots-former-android-chief-will-lead-google-robotics-division/ [6]:http://arstechnica.com/gadgets/2013/12/lg-g-flex-review-form-over-even-basic-function/ [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo diff --git a/sources/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md b/sources/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md deleted file mode 100644 index 6e8ee86ad6..0000000000 --- a/sources/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md +++ /dev/null @@ -1,223 +0,0 @@ -How to create a software RAID-1 array with mdadm on Linux -================================================================================ -Redundant Array of Independent Disks (RAID) is a storage technology that combines multiple hard disks into a single logical unit to provide fault-tolerance and/or improve disk I/O performance. Depending on how data is stored in an array of disks (e.g., with striping, mirroring, parity, or any combination thereof), different RAID levels are defined (e.g., RAID-0, RAID-1, RAID-5, etc). RAID can be implemented either in software or with a hardware RAID card. On modern Linux, basic software RAID functionality is available by default. - -In this post, we'll discuss the software setup of a RAID-1 array (also known as a "mirroring" array), where identical data is written to the two devices that form the array. While it is possible to implement RAID-1 with partitions on a single physical hard drive (as with other RAID levels), it won't be of much use if that single hard drive fails. In fact, that's why most RAID levels normally use multiple physical drives to provide redundancy. In the event of any single drive failure, the virtual RAID block device should continue functioning without issues, and allow us to replace the faulty drive without significant production downtime and, more importantly, with no data loss. However, it does not replace the need to save periodic system backups in external storage. - -Since the actual storage capacity (size) of a RAID-1 array is the size of the smallest drive, normally (if not always) you will find two identical physical drives in RAID-1 setup. - -### Installing mdadm on Linux ### - -The tool that we are going to use to create, assemble, manage, and monitor our software RAID-1 is called mdadm (short for **m**ultiple **d**isks **adm**in). On Linux distros such as Fedora, CentOS, RHEL or Arch Linux, mdadm is available by default. On Debian-based distros, mdadm can be installed with aptitude or apt-get. - -#### Fedora, CentOS or RHEL #### - -As mdadm comes pre-installed, all you have to do is to start RAID monitoring service, and configure it to auto-start upon boot: - - # systemctl start mdmonitor - # systemctl enable mdmonitor - -For CentOS/RHEL 6, use these commands instead: - - # service mdmonitor start - # chkconfig mdmonitor on - -#### Debian, Ubuntu or Linux Mint #### - -On Debian and its derivatives, mdadm can be installed with **aptitude or apt-get**: - - # aptitude install mdadm - -On Ubuntu, you will be asked to configure postfix MTA for sending out email notifications (as part of RAID monitoring). You can skip it for now. - -On Debian, the installation will start with the following explanatory message to help us decide whether or not we are going to install the root filesystem on a RAID array. What we need to enter on the next screen will depend on this decision. Read it carefully: - -![](https://farm4.staticflickr.com/3918/15220883382_c14eb95914_z.jpg) - -Since we will not use our RAID-1 for the root filesystem, we will leave the answer blank: - -![](https://farm6.staticflickr.com/5555/15198241896_29e08b977f.jpg) - -When asked whether we want to start (reassemble) our array automatically during each boot, choose "Yes". Note that we will need to add an entry to the /etc/fstab file later in order for the array to be properly mounted during the boot process as well. - -![](https://farm4.staticflickr.com/3875/15220883342_2b1d689a0a_z.jpg) - -### Partitioning Hard Drives ### - -Now it's time to prepare the physical devices that will be used in our array. For this setup, I have plugged in two 8 GB USB drives that have been identified as /dev/sdb and /dev/sdc from dmesg output: - - # dmesg | less - ----------- - -[ 60.014863] sd 3:0:0:0: [sdb] 15826944 512-byte logical blocks: (8.10 GB/7.54 GiB) -[ 75.066466] sd 4:0:0:0: [sdc] 15826944 512-byte logical blocks: (8.10 GB/7.54 GiB) - -We will use fdisk to create a primary partition on each disk that will occupy its entire size. The following steps show how to perform this task on /dev/sdb, and assume that this drive hasn't been partitioned yet (otherwise, we can delete the existing partition(s) to start off with a clean disk): - - # fdisk /dev/sdb - -Press 'p' to print the current partition table: - -![](https://farm4.staticflickr.com/3883/15198241836_24625edcf3_z.jpg) - -(if one or more partitions are found, they can be deleted with 'd' option. Then 'w' option is used to apply the changes). - -Since no partitions are found, we will create a new primary partition ['n'] as a primary partition ['p'], assign the partition number = ['1'] to it, and then indicate its size. You can press Enter key to accept the proposed default values, or enter a value of your choosing, as shown in the image below. - -![](https://farm4.staticflickr.com/3875/15034475369_7e72fb9f2e_z.jpg) - -Now repeat the same process for /dev/sdc. - -If we have two drives of different sizes, say 750 GB and 1 TB for example, we should create a primary partition of 750 GB on each of them, and use the remaining space on the bigger drive for another purpose, independent of the RAID array. - -### Create a RAID-1 Array ### - -Once you are done with creating the primary partition on each drive, use the following command to create a RAID-1 array: - - # mdadm -Cv /dev/md0 -l1 -n2 /dev/sdb1 /dev/sdc1 - -Where: - -- **-Cv**: creates an array and produce verbose output. -- **/dev/md0**: is the name of the array. -- **-l1** (l as in "level"): indicates that this will be a RAID-1 array. -- **-n2**: indicates that we will add two partitions to the array, namely /dev/sdb1 and /dev/sdc1. - -The above command is equivalent to: - - # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 - -If alternatively you want to add a spare device in order to replace a faulty disk in the future, you can add '--spare-devices=1 /dev/sdd1' to the above command. - -Answer "y" when prompted if you want to continue creating an array, then press Enter: - -![](https://farm4.staticflickr.com/3894/15034569970_709bd51718.jpg) - -You can check the progress with the following command: - - # cat /proc/mdstat - -![](https://farm6.staticflickr.com/5565/15221267975_701b819e6d_z.jpg) - -Another way to obtain more information about a RAID array (both while it's being assembled and after the process is finished) is: - - # mdadm --query /dev/md0 - # mdadm --detail /dev/md0 (or mdadm -D /dev/md0) - -![](https://farm6.staticflickr.com/5583/15034683868_6c28564e5a_z.jpg) - -Of the information provided by 'mdadm -D', perhaps the most useful is that which shows the state of the array. The active state means that there is currently I/O activity happening. Other possible states are clean (all I/O activity has been completed), degraded (one of the devices is faulty or missing), resyncing (the system is recovering from an unclean shutdown such as a power outage), or recovering (a new drive has been added to the array, and data is being copied from the other drive onto it), to name the most common states. - -### Formatting and Mounting a RAID Array ### - -The next step is formatting (with ext4 in this example) the array: - - # mkfs.ext4 /dev/md0 - -![](https://farm4.staticflickr.com/3849/15034683838_01e34e7196_z.jpg) - -Now let's mount the array, and verify that it was mounted correctly: - - # mount /dev/md0 /mnt - # mount - -![](https://farm6.staticflickr.com/5554/15034696167_c4fc907c8e_z.jpg) - -### Monitor a RAID Array ### - -The mdadm tool comes with RAID monitoring capability built in. When mdadm is set to run as a daemon (which is the case with our RAID setup), it periodically polls existing RAID arrays, and reports on any detected events via email notification or syslog logging. Optionally, it can also be configured to invoke contingency commands (e.g., retrying or removing a disk) upon detecting any critical errors. - -By default, mdadm scans all existing partitions and MD arrays, and logs any detected event to /var/log/syslog. Alternatively, you can specify devices and RAID arrays to scan in mdadm.conf located in /etc/mdadm/mdadm.conf (Debian-based) or /etc/mdadm.conf (Red Hat-based), in the following format. If mdadm.conf does not exist, create one. - - DEVICE /dev/sd[bcde]1 /dev/sd[ab]1 - - ARRAY /dev/md0 devices=/dev/sdb1,/dev/sdc1 - ARRAY /dev/md1 devices=/dev/sdd1,/dev/sde1 - ..... - - # optional email address to notify events - MAILADDR your@email.com - -After modifying mdadm configuration, restart mdadm daemon: - -On Debian, Ubuntu or Linux Mint: - - # service mdadm restart - -On Fedora, CentOS/RHEL 7: - - # systemctl restart mdmonitor - -On CentOS/RHEL 6: - - # service mdmonitor restart - -### Auto-mount a RAID Array ### - -Now we will add an entry in the /etc/fstab to mount the array in /mnt automatically during boot (you can specify any other mount point): - - # echo "/dev/md0 /mnt ext4 defaults 0 2" << /etc/fstab - -To verify that mount works okay, we now unmount the array, restart mdadm, and remount. We can see that /dev/md0 has been mounted as per the entry we just added to /etc/fstab: - - # umount /mnt - # service mdadm restart (on Debian, Ubuntu or Linux Mint) - or systemctl restart mdmonitor (on Fedora, CentOS/RHEL7) - or service mdmonitor restart (on CentOS/RHEL6) - # mount -a - -![](https://farm6.staticflickr.com/5563/15218183681_63a10da704_z.jpg) - -Now we are ready to access the RAID array via /mnt mount point. To test the array, we'll copy the /etc/passwd file (any other file will do) into /mnt: - -![](https://farm6.staticflickr.com/5593/15034475219_a3476aec0a_o.png) - -On Debian, we need to tell the mdadm daemon to automatically start the RAID array during boot by setting the AUTOSTART variable to true in the /etc/default/mdadm file: - - AUTOSTART=true - -### Simulating Drive Failures ### - -We will simulate a faulty drive and remove it with the following commands. Note that in a real life scenario, it is not necessary to mark a device as faulty first, as it will already be in that state in case of a failure. - -First, unmount the array: - - # umount /mnt - -Now, notice how the output of 'mdadm -D /dev/md0' indicates the changes after performing each command below. - - # mdadm /dev/md0 --fail /dev/sdb1 #Marks /dev/sdb1 as faulty - # mdadm --remove /dev/md0 /dev/sdb1 #Removes /dev/sdb1 from the array - -Afterwards, when you have a new drive for replacement, re-add the drive again: - - # mdadm /dev/md0 --add /dev/sdb1 - -The data is then immediately started to be rebuilt onto /dev/sdb1: - -![](https://farm4.staticflickr.com/3855/15221267875_dfc6af8804_z.jpg) - -Note that the steps detailed above apply for systems with hot-swappable disks. If you do not have such technology, you will also have to stop a current array, and shutdown your system first in order to replace the part: - - # mdadm --stop /dev/md0 - # shutdown -h now - -Then add the new drive and re-assemble the array: - - # mdadm /dev/md0 --add /dev/sdb1 - # mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/09/create-software-raid1-array-mdadm-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 diff --git a/sources/tech/20141030 Test drive Linux with nothing but a flash drive.md b/sources/tech/20141030 Test drive Linux with nothing but a flash drive.md deleted file mode 100644 index 84d5b7a9d4..0000000000 --- a/sources/tech/20141030 Test drive Linux with nothing but a flash drive.md +++ /dev/null @@ -1,75 +0,0 @@ -Test drive Linux with nothing but a flash drive -================================================================================ -![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) -Image by : Opensource.com - -Maybe you’ve heard about Linux and are intrigued by it. So intrigued that you want to give it a try. But you might not know where to begin. - -You’ve probably done a bit of research online and have run across terms like dual booting and virtualization. Those terms might mean nothing to you, and you’re definitely not ready to sacrifice the operating system that you’re currently using to give Linux a try. So what can you do? - -If you have a USB flash drive lying around, you can test drive Linux by creating a live USB. It’s a USB flash drive that contains an operating system that can start from the flash drive. It doesn’t take much technical ability to create one. Let’s take a look at how to do that and how to run Linux using a live USB. - -### What you’ll need ### - -Aside from a desktop or laptop computer, you’ll need: - -- A blank USB flash drive—preferably one that has a capacity of 4 GB or more. -- An [ISO image][1] (an archive of the contents of a hard disk) of the Linux distribution that you want to try. More about this in a moment. -- An application called [Unetbootin][2], an open source tool, cross platform tool that creates a live USB. You don’t need to be running Linux to use it. In the instructions that below, I’m running Unetbootin on a MacBook. - -### Getting to work ### - -Plug your flash drive into a USB port on your computer and then fire up Unetbootin. You’ll be asked for the password that you use to log into your computer. - -![Unetbootin main window](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-main.png) - -Remember the ISO image that was mentioned a few moments ago? There are two ways you can get one: either by downloading it from the website of the Linux distribution that you want to try, or by having Unetbootin download it for you. To do that latter, click **Select Distribution** at the top of the window, choose the distribution that you want to download, and then click **Select Version** to select the version of the distribution that you want to try. - -![Downloading a Linux distribution](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-download-distro.png) - -Or, you can download the distribution yourself. Usually, the Linux distributions that I want to try aren’t in the list. If you go the second route, click **Disk image** and then click the button to search for the .iso file that you downloaded. - -Notice the **Space used to preserve files across reboots (Ubuntu only)** option? If you’re testing Ubuntu or one of its derivatives (like Lubuntu or Xubuntu), you can set aside a few megabytes of space on your flash drive to save files like web browser bookmarks or documents that you create. When you load Ubuntu from the flash drive again, you can reuse those files. - -![Ready to create a live USB](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-ready-to-go.png) - -Once the ISO image is loaded, click **OK**. It takes anywhere from a couple of minutes to 10 minutes for Unetbootin to create the live USB. - -![Creating the live USB](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-creating-disk.png) - -### Testing out the live USB ### - -This is the point where you have to embrace your inner geek a bit. Not too much, but you will be taking a peek into the innards of your computer by going into the [BIOS][3]. Your computer’s BIOS starts various bits of hardware and controls where the computer’s operating system starts, or boots, from. - -The BIOS usually looks for the operating system in this order (or something like it): hard drive, then CD-ROM or DVD drive, and then an external drive. You’ll want to change that order so that the external drive (in this case, your live USB) is the one that the BIOS checks first. - -To do that, restart your computer with the flash drive plugged into a USB port. When you see the message **Press F2 to enter setup**, do just that. On some computers, the key might be F10. - -In the BIOS, use the right arrow key on your keyboard to navigate to the **Boot** menu. You’ll see a list of drives on your computer. Use the down arrow key on your keyboard to navigate to the item labeled **USB HDD** and then press **F6** to move that item to the top of the list. - -Once you’ve done that, press **F10** to save the changes. You’ll be kicked out of the BIOS and your computer will start up. After a short amount of time, you’ll be presented with a menu listing the options for starting the Linux distribution you’re trying out. Select **Run without installing** (or the menu item closest to it). - -Once the desktop loads, you can connect to a wireless or wired network, browse the web, and give the pre-installed software a whirl. You can also check to see if, for example, your printer or scanner works with the Linux distribution you’re testing. If you really, really want to you can also fiddle at the command line. - -### What to expect ### - -Depending on the Linux distribution you’re testing and the speed of the flash drive you’re using, the operating system might take longer to load and it might run a bit slower than it would if it was installed on your hard drive. - -As well, you’ll only have the basic software that the Linux distribution packs out of the box. You generally get a web browser, a word processor, a text editor, a media player, an image viewer, and a set of utilities. That should be enough to give you a feel for what it’s like to use Linux. - -If you decide that you like using Linux, you can install it from the flash drive by double clicking on the installer. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive - -作者:[Scott Nesbitt][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/scottnesbitt -[1]:http://en.wikipedia.org/wiki/ISO_image -[2]:http://unetbootin.sourceforge.net/ -[3]:http://en.wikipedia.org/wiki/BIOS \ No newline at end of file diff --git a/sources/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md b/sources/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md deleted file mode 100644 index e043210cf6..0000000000 --- a/sources/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md +++ /dev/null @@ -1,91 +0,0 @@ -How To Use Emoji Anywhere With Twitter's Open Source Library -================================================================================ -> Embed them in webpages and other projects via GitHub. - -![](http://a3.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2OTIyNTI3MjcxNTU1.png) - -Emoji, tiny characters from Japan that convey emotions through images, have already conquered the world of cellphone text messaging. - -Now, you can post them everywhere else in the virtual world, too. Twitter has just [open-sourced][1] its emoji library so you can use them for your own websites, apps, and projects. - -This will require a little bit of heavy lifting. Unicode has recognized and even standardized the emoji alphabet, but emoji still [aren’t fully compliant with all Web browsers][2], meaning they'll show up as “tofu,” or blank boxes, most of the time. When Twitter wanted to make emoji available, the social network teamed up with a company called [Icon Factory][3] to render browser imitations of the text message symbols. As a result, Twitter says there’s been lots of demand for access to its emoji. - -Now, you can clone Twitter’s entire library on [GitHub][4] to use in your development projects. Here’s how to do that, and how to make emoji easier to use after you do. - -### Obtain Unicode Support For Emoji ### - -Unicode is an international encoding standard that assigns a string of characters to any symbol, letter, or digit people want to use online. In other words, it’s the missing link between how you read text on a computer, and how the computer reads text. For example, while you are looking at an empty space between these words, the computer sees “&mbsp.” - -Unicode even has its own [primitive emoji][5] that can be read in the browser without any effort on your part. For example while you see a ♥, your computer is decoding the string “2665.” - -To use Twitter’s emoji library in most cases, you simply need to add a script inside the section of your HTML page: - - - -This grants your project access to the JavaScript library that contains the hundreds of emoji that work on Twitter. However, creating a document with simply this script isn’t going to make emoji appear on your site. You also need to actually insert some emoji! - -In the section, paste a few of the emoji strings you can find in Twitter’s [preview.html source code][6]. I used 🎹 and 🏁 without really knowing how they'd appear in the browser window. Yeah, you’ll have to just paste and guess. You can already see the problem we're going to fix in section two. - -However, through some trial and error, you can turn a raw HTML file that looks like this— - -![](http://a4.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODQyNTMzNTQ1OTk0.png) - -—into a webpage that looks something like this: - -![](http://a1.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODExNjYzNDU1NTA2.png) - -### Convert Emoji Into Readable Language ### - -Twitter’s solution is all well and good for making a site or app emoji compliant. But if you want to be able to easily insert your favorite emoji at will via HTML, you’re going to need an easier solution than memorizing all those Unicode strings. - -That’s where programmer Elle Kasai’s [Twemoji Awesome][7] styles come in. - -By adding Elle’s open-source stylesheet to any webpage, you can use English words to understand which emoji you’re inserting. So if you want a heart emoji to show up, you can simply type this : - - - -In order to do this, let’s download Elle’s project with the “Download ZIP” button on GitHub. - -Next, let’s make a new folder on the desktop. Inside this folder, we’ll put emoji.html—the raw HTML file I showed you before, and also Elle’s [twemoji-awesome.css][8]. - -We’ll need the HTML file to acknowledge the CSS file, so in the section of the html page you’ll want to add a link from the css file: - - - -Once you put this in, you can delete Twitter's script from before. Elle's styles each link to the Unicode string for the relevant emoji, so you no longer have to. - -Now, go down to the body section and add a few emoji. I used , , and . - -You'll end up with something like this: - -![](http://a2.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODcyMDYxNDU2MzU0.png) - -Save and view your creation in the browser: - -![](http://a1.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODExOTMxODkwOTYy.png) - -Ta-da! Not only have you gotten a basic webpage to support emoji in the browser, you’ve also made it easy to do. Feel free to check out this tutorial on [my GitHub][9] for actual files you can clone instead of screenshots. - -Lead image via [Get Emoji][10]; screenshots by Lauren Orsini - --------------------------------------------------------------------------------- - -via: http://readwrite.com/2014/11/12/how-to-use-emoji-in-the-browser-window - -作者:[Lauren Orsini][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://readwrite.com/author/lauren-orsini -[1]:https://blog.twitter.com/2014/open-sourcing-twitter-emoji-for-everyone -[2]:http://www.unicode.org/reports/tr51/full-emoji-list.html -[3]:https://twitter.com/iconfactory -[4]:https://github.com/twitter/twemoji -[5]:http://www.unicode.org/reports/tr51/full-emoji-list.html -[6]:https://github.com/twitter/twemoji/blob/gh-pages/preview.html -[7]:http://ellekasai.github.io/twemoji-awesome/ -[8]:https://github.com/ellekasai/twemoji-awesome/blob/gh-pages/twemoji-awesome.css -[9]:https://github.com/laurenorsini/Emoji-Everywhere -[10]:http://getemoji.com/ diff --git a/sources/tech/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md b/sources/tech/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md deleted file mode 100644 index d81a33de40..0000000000 --- a/sources/tech/20141127 dupeGuru--Find And Remove Duplicate Files Instantly From Hard Drive.md +++ /dev/null @@ -1,98 +0,0 @@ -dupeGuru – Find And Remove Duplicate Files Instantly From Hard Drive -================================================================================ -### Introduction ### - -Disk full is one of the big trouble for us. No matter how we’re careful, sometimes we might copy the same file to multiple locations, or download the same file twice unknowingly. Therefore, sooner or later we will end up with disk full error message, which is worst when we really need some space to store important data. If you believe your system has multiple duplicate files, then **dupeGuru** might help you. - -dupeGuru team have also developed applications called **dupeGuru Music Edition** to remove duplicate music files, and **dupeGuru Picture Edition** to remove duplicate pictures. - -### 1. dupeGuru (Standard Edition) ### - -For those who don’t know about [dupeGuru][1], It is a free, open source, cross-platform application that can used to find and remove the duplicate files in your system. It will run under Linux, Windows, and Mac OS X platforms. It uses a quick fuzzy matching algorithm to find the duplicate files in minutes. Also, you can tweak dupeGuru to find exactly what kind of duplicate files you want to, and eliminate what kind of files from deletion. It supports English, French, German, Chinese (Simplified), Czech, Italian, Armenian, Russian, Ukrainian, Brazilian, and Vietnamese. - -#### Install dupeGuru On Ubuntu 14.10/14.04/13.10/13.04/12.04 #### - -dupeGuru developers have created a Ubuntu PPA to ease the installation. To install dupeGuru, enter the following commands one by one in your Terminal. - - sudo apt-add-repository ppa:hsoft/ppa - sudo apt-get update - sudo apt-get install dupeguru-se - -#### Usage #### - -Usage is very simple. Launch dupeGuru either from Unity Dash or Menu. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru_007.png) - -Click + button on the bottom, and add the folder you want to scan. Click Scan button to start finding the duplicate files. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru_008.png) - -If the selected folder contains any duplicate files, it will display them. As you in the below screen shot, I have a duplicate file in the Downloads directory. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Results_009.png) - -Now, you can decide what to do. You can either delete the duplicate file, or rename it, or copy/move it to another location. To do that select the duplicate files, or check the box that says “**Dupes only**” on the Menu bar. If you selected the Dupes only option, the duplicates files will only visible. So you can select and delete them easily. Click on the **Actions** drop-down box. Finally, select the action you want to perform. Here, I just want to delete the duplicate file, so I selected the option: **Send marked to Recycle bin**. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Menu_010.png) - -Then, click **Proceed** to delete the duplicate files. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Deletion-Options_011.png) - -### 2. dupeGuru Music Edition ### - -[dupeGuru Music Edition][2] or dupeGuru ME in short, is just like dupeGuru. It does everything dupeGuru does, but it has more information columns (such as bitrate, duration, tags, etc..) and more scan types (filename with fields, tags and audio content). Like dupeGuru, dupeGuru ME also runs on Linux, Windows, and Mac OS X. - -It supports variety of formats such as MP3, WMA, AAC (iTunes format), OGG, FLAC, loss-less AAC and loss-less WMA etc, - -#### Install dupeGuru ME On Ubuntu 14.10/14.04/13.10/13.04/12.04 #### - -Now, we don’t have to add any PPA, because already the added in the previous steps. So, enter the following command to install from your Terminal. - - sudo apt-get install dupeguru-me - -#### Usage #### - -Launch it either from Unity dash or Menu. The usage, interface, and look of dupeGuru ME is similar to normal dupeGuru. Add the folder you to scan and select the action you want to perform. The duplicate music files will be deleted. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Music-Edition-Results_012.png) - -### 3. dupeGuru Picture Edition ### - -[dupeGuru Picture Edition][3], or duepGuru PE in short, is a tool to find duplicate pictures on your computer. It is as like as dupeGuru, but is specialized for duplicate pictures matching. dupeGuru PE runs on Linux, Windows, and Mac OS X. - -dupeGuru PE supports JPG, PNG, TIFF, GIF and BMP formats. All these formats can be compared together. The Mac OS X version of dupeGuru PE also supports PSD and RAW (CR2 and NEF) formats. - -#### Install dupeGuru PE On Ubuntu 14.10/14.04/13.10/13.04/12.04 #### - -As we have already added the PPA, We don’t need to add PPA for dupeGuru either. Just, run the following command to install it. - - sudo apt-get install dupeguru-pe - -#### Usage #### - -It’s also look like dupeGuru, and dupeGuru ME in terms of usage, interface, and look.I wonder why the developer have created there separate versions for each category. It would be better, a single application has all of the above three features combined. - -Launch it, add the folder you want to scan, and select the action you want to perform. That’s it. you duplicated files will be gone. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Picture-Edition-Results_014.png) - -If you can’t remove them in case of any security problems, note down the location of the files, and manually delete them either from Terminal or File manager. - -Cheers! - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/dupeguru-find-remove-duplicate-files-instantly-hard-drive/ - -作者:[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.hardcoded.net/dupeguru/ -[2]:http://www.hardcoded.net/dupeguru_me/ -[3]:http://www.hardcoded.net/dupeguru_pe/ \ No newline at end of file diff --git a/sources/tech/20141203 Undelete Files on Linux Systems.md b/sources/tech/20141203 Undelete Files on Linux Systems.md index d0fa7f6a98..126501e225 100644 --- a/sources/tech/20141203 Undelete Files on Linux Systems.md +++ b/sources/tech/20141203 Undelete Files on Linux Systems.md @@ -1,3 +1,5 @@ +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. @@ -115,4 +117,4 @@ via: http://www.linux.org/threads/undelete-files-on-linux-systems.4316/ 本文由 [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 \ No newline at end of file +[1]:http://www.cgsecurity.org/wiki/TestDisk diff --git a/sources/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md b/sources/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md deleted file mode 100644 index e5b148a4df..0000000000 --- a/sources/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md +++ /dev/null @@ -1,206 +0,0 @@ -Translating by shipsw - - -Auditd - Tool for Security Auditing on Linux Server -================================================================================ -First of all , we wish all our readers **Happy & Prosperous New YEAR 2015** from our Linoxide team. So lets start this new year explaining about Auditd tool. - -Security is one of the main factor that we need to consider. We must maintain it because we don't want someone steal our data. Security includes many things. Audit, is one of it. - -On Linux system, we know that we have a tool named **auditd**. This tool is by default exist in most of Linux operating system. What is auditd tool and how to use it? We will cover it below. - -### What is auditd? ### - -Auditd or audit daemon, is a userspace component to the Linux Auditing System. It’s responsible for writing audit records to the disk. - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/what_is_auditd.png) - -### Installing auditd ### - -On Ubuntu based system , we can use [wajig][1] tool or **apt-get tool** to install auditd. - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/install_auditd.png) - -Just follow the instruction to get it done. Once it finish it will install some tools related to auditd tool. Here are the tools : - -- **auditctl ;** is a tool to control the behaviour of the daemon on the fly, adding rules, etc -- **/etc/audit/audit.rules ;** is the file that contains audit rules -- **aureport ;** is tool to generate and view the audit report -- **ausearch ;** is a tool to search various events -- **auditspd ;** is a tool which can be used to relay event notifications to other applications instead of writing them to disk in the audit log -- **autrace ;** is a command that can be used to trace a process -- **/etc/audit/auditd.conf ;** is the configuration file of auditd tool -- When the first time we install **auditd**, there will be no rules available yet. - -We can check it using this command : - - $ sudo auditctl -l - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_no_rules.png) - -To add rules on auditd, let’s continue to the section below. - -### How to use it ### - -#### Audit files and directories access #### - -One of the basic need for us to use an audit tool are, how can we know if someone change a file(s) or directories? Using auditd tool, we can do with those commands (please remember, we will need root privileges to configure auditd tool): - -**Audit files** - - $ sudo auditctl -w /etc/passwd -p rwxa - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_w_etc_passwd.png) - -**With :** - -- **-w path ;** this parameter will insert a watch for the file system object at path. On the example above, auditd will wacth /etc/passwd file -- **-p ; **this parameter describes the permission access type that a file system watch will trigger on -- **rwxa ;** are the attributes which bind to -p parameter above. r is read, w is write, x is execute and a is attribute - -#### Audit directories #### - -To audit directories, we will use a similar command. Let’s take a look at the command below : - - $ sudo auditctl -w /production/ - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_w_production.png) - -The above command will watch any access to the **/production folder**. - -Now, if we run **auditctl -l** command again, we will see that new rules are added. - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_rules.png) - -Now let’s see the audit log says. - -### Viewing the audit log ### - -After rules are added, now we can see how auditd in action. To view audit log, we can use **ausearch** tool. - -We already add rule to watch /etc/passwd file. Now we will try to use **ausearch** tool to view the audit log. - - $ sudo ausearch -f /etc/passwd - -- **-f** parameter told ausearch to investigate /etc/passwd file -- The result is shown below : -> **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) - - Now let’s we understand the result. - -- **time ;** is when the audit is done -- **name ;** is the object name to be audited -- **cwd ;** is the current directory -- **syscall ;** is related syscall -- **auid ;** is the audit user ID -- **uid and gid ;** are User ID and Group ID of the user who access the file -- **comm ;** is the command that the user is used to access the file -- **exe ;** is the location of the command of comm parameter above -- The above audit log is the original file. - - Next, we are going to add a new user, to see how the auditd record the activity to /etc/passwd file. - -> **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) - -As we can see above, that on that particular time, **/etc/passwd was accessed** by user root (uid = 0 and gid = 0) **from** directory /root (cwd = /root). The /etc/passwd file was accessed using **chfn** command which located in **/usr/bin/chfn** - -If we type **man chfn** on the console, we will see more detail about what is chfn. - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/chfn.png) - -Now we take a look at another example. - -We already told auditd to watch directory /production/ . That is a new directory. So when we try to use ausearch tool at the first time, it found nothing. - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/ausearch_production_empty.png) - -Next, root account try to list the /production directory using ls command. The second time we use ausearch tool, it will show us some information. - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/ausearch_production_ls.png) - -> **time->**Mon Dec 22 14:18:28 2014 -> type=PATH msg=audit(1419232708.344:527): item=0 **name="/production/"** inode=797104 dev=08:01 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL -> type=CWD msg=audit(1419232708.344:527): cwd="/root" -> type=SYSCALL msg=audit(1419232708.344:527): arch=40000003 syscall=295 success=yes exit=3 a0=ffffff9c a1=95761e8 a2=98800 a3=0 items=1 ppid=3033 pid=3444 **auid=4294967295 uid=0 gid=0** euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=4294967295 **comm="ls" exe="/bin/ls"** key=(null) - -Similar with the previous one, we can determine that **/production folder was looked** by root account (uid=0 gid=0) **using ls command** (comm = ls) and the ls command is **located in /bin/ls folder**. - -### Viewing the audit reports ### - -Once we put the audit rules, it will run automatically. And after a period of time, we want to see how auditd can help us to track them. - -Auditd comes with another tool called **aureport**. As we can guess from its name, **aureport** is a tool that produces summary reports of the audit system log. - -We already told auditd to track /etc/passwd before. And a moment after the auditd parameter is developed, the audit.log file is created. - -To generate the report of audit, we can use aureport tool. Without any parameters, aureport will generate a summary report of audit activity. - - $ sudo aureport - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/aureport_2.png) - -As we can see, there are some information available which cover most important area. - -On the picture above we see there are **3 times failed authentication**. Using aureport, we can drill down to that information. - -We can use this command to look deeper on failed authentication : - - $ sudo aureport -au - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/aureport_authentication.png) - -As we can see on the picture above, there are two users which at the particular time are failed to authenticated - -If we want to see all events related to account modification, we can use -m parameter. - - $ sudo aureport -m - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/aureport_m.png) - -### Auditd configuration file ### - -Previously we already added : - -- $ sudo auditctl -w /etc/passwd -p rwxa -- $ sudo auditctl -w /production/ -- Now, if we sure the rules are OK, we can add it into - -**/etc/audit/audit.rules** to make them permanently.Here’s how to put them into the /etc/audit/audit.rules fileSample of audit rule file - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/audit_rules_file.png) - -**Then don’t forget to restart auditd daemon.** - - # /etc/init.d/auditd restart - -OR - - # service auditd restart - -![](http://blog.linoxide.com/wp-content/uploads/2014/12/audit_restart.png) - -### Conclusion ### - -Auditd is one of the audit tool that available on Linux system. You can explore more detail about auditd and its related tools by reading its manual page. For example, just type **man auditd** to see more detail about auditd. Or type **man ausearch** to see more detail about ausearch tool. - -**Please be careful before creating rules**. It will increase your log file size significantly if too much information to record. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/how-tos/auditd-tool-security-auditing/ - -作者:[Pungki Arianto][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/pungki/ -[1]:http://linoxide.com/tools/wajig-package-management-debian/ 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 index 63acd23a67..540789d367 100644 --- 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 @@ -1,3 +1,4 @@ +[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. @@ -143,4 +144,4 @@ via: http://linoxide.com/ubuntu-how-to/configure-chroot-environment-ubuntu-14-04 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunp/ -[1]:https://launchpad.net/ubuntu/+archivemirrors \ No newline at end of file +[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 index 348a159fc8..915e3b073e 100644 --- a/sources/tech/20150115 Get back your privacy and control.md +++ b/sources/tech/20150115 Get back your privacy and control.md @@ -1,3 +1,4 @@ +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. @@ -1110,4 +1111,4 @@ via: https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/ [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 \ No newline at end of file +[38]:http://doc.owncloud.org/server/7.0/user_manual/files/files.html diff --git a/sources/tech/20150123 How to Boot Linux ISO Images Directly From Your Hard Drive.md b/sources/tech/20150123 How to Boot Linux ISO Images Directly From Your Hard Drive.md deleted file mode 100644 index b7ccf253f9..0000000000 --- a/sources/tech/20150123 How to Boot Linux ISO Images Directly From Your Hard Drive.md +++ /dev/null @@ -1,78 +0,0 @@ -[xieborui translating]How to Boot Linux ISO Images Directly From Your Hard Drive -================================================================================ -Hi all, today we'll teach you an awesome interesting stuff related with the Operating System Disk Image and Booting. Now, try many OS you like without installing them in your Physical Hard Drive and without burning DVDs or USBs. - -We can boot Linux ISO files directly from your hard drive with Linux’s GRUB2 boot loader. We can boot any Linux Distribution's using this method without creating bootable USBs, Burn DVDs, etc but the changes made will be temporary. - -![boot iso files directly from hard drive in grub2](http://blog.linoxide.com/wp-content/uploads/2015/01/boot-iso-files-directly-from-hard-drive-in-grub2.png) - -### 1. Get the ISO of the Linux Distributions: ### - -Here, we're gonna create Menu of Ubuntu 14.04 LTS "Trusty" and Linux Mint 17.1 LTS "Rebecca" so, we downloaded them from their official site: - -Ubuntu from : [http://ubuntu.com/][1] And Linux Mint from: [http://linuxmint.com/][2] - -You can download ISO files of required linux distributions from their respective websites. If you have mirror of the iso files hosted near your area or country, it is recommended if you have no sufficient internet download speed. - -### 2. Determine the Hard Drive Partition’s Path ### - -GRUB uses a different “device name” scheme than Linux does. On a Linux system, /dev/sda0 is the first partition on the first hard disk — **a** means the first hard disk and **0** means its first partition. In GRUB, (hd0,1) is equivalent to /dev/sda0. The **0** means the first hard disk, while **1** means the first partition on it. In other words, in a GRUB device name, the disk numbers start counting at 0 and the partition numbers start counting at 1. For example, (hd3,6) refers to the sixth partition on the fourth hard disk. - -You can use the **fdisk -l** command to view this information. On Ubuntu, open a Terminal and run the following command: - - $ sudo fdisk -l - -![fdisk-l view the list of the hard disk and its partitions](http://blog.linoxide.com/wp-content/uploads/2015/01/fdisk-l.png) - -You’ll see a list of Linux device paths, which you can convert to GRUB device names on your own. For example, below we can see the system partition is /dev/sda1 — so that’s (hd0,1) for GRUB. - -### 3. Adding boot menu to Grub2 ### - -The easiest way to add a custom boot entry is to edit the /etc/grub.d/40_custom script. This file is designed for user-added custom boot entries. After editing the file, the contents of your /etc/defaults/grub file and the /etc/grub.d/ scripts will be combined to create a /boot/grub/grub.cfg file. You shouldn't edit this file by hand. It’s designed to be automatically generated from settings you specify in other files. - -So we’ll need to open the /etc/grub.d/40_custom file for editing with root privileges. On Ubuntu, you can do this by opening a Terminal window and running the following command: - - $ sudo nano /etc/grub.d/40_custom - -Unless we’ve added other custom boot entries, we should see a mostly empty file. We'll need to add one or more ISO-booting sections to the file below the commented lines. - - ===== - menuentry “Ubuntu 14.04 ISO” { - set isofile=”/home/linoxide/Downloads/ubuntu-14.04.1-desktop-amd64.iso” - loopback loop (hd0,1)$isofile - linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash - initrd (loop)/casper/initrd.lz - } - menuentry "Linux Mint 17.1 Cinnamon ISO" { - set isofile=”/home/linoxide/Downloads/mint-17.1-desktop-amd64.iso” - loopback loop (hd0,1)$isofile - linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash - initrd (loop)/casper/initrd.lz - } - -![Grub2 Menu configuration for adding the ISOs](http://blog.linoxide.com/wp-content/uploads/2015/01/grub-added-iso.png) - -**Important Note**: Different Linux distributions require different boot entries with different boot options. The GRUB Live ISO Multiboot project offers a variety of [menu entries for different Linux distributions][3]. You should be able to adapt these example menu entries for the ISO file you want to boot. You can also just perform a web search for the name and release number of the Linux distribution you want to boot along with “boot from ISO in GRUB” to find more information. - -### 4. Updating Grub2 ### - -To make the custom menu entries active, we'll run "sudo update-grub" - - sudo update-grub - -Hurray, we have successfully added our brand new linux distribution's ISO to our GRUB Menu. Now, we'll be able to boot them and enjoy trying them. You can add many distributions and try them all. Note that the changes made in those OS will don't be kept preserved, which means you'll loose changes made in that distros after the restart. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/boot-linux-iso-images-directly-hard-drive/ - -作者:[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://ubuntu.com/ -[2]:http://linuxmint.com/ -[3]:http://git.marmotte.net/git/glim/tree/grub2 diff --git a/sources/tech/20150126 4 lvcreate Command Examples on Linux.md b/sources/tech/20150126 4 lvcreate Command Examples on Linux.md deleted file mode 100644 index ae7e177116..0000000000 --- a/sources/tech/20150126 4 lvcreate Command Examples on Linux.md +++ /dev/null @@ -1,120 +0,0 @@ -4 lvcreate Command Examples on Linux -================================================================================ -Logical volume management (LVM) is a widely-used technique and extremely flexible disk management scheme. It basically contain three basic command : - -a. Creates the physical volumes using **pvcreate** -b. Create the volume group and add partition into volume group using **vgcreate** -c. Create a new logical volume using **lvcreate** - -![](http://www.ehowstuff.com/wp-content/uploads/2015/01/lvm-diagram1.jpg) - -The following examples focus on the command to create a logical volume in an existing volume group, **lvcreate**. **lvcreate** is the command do allocating logical extents from the free physical extent pool of that volume group. Normally logical volumes use up any space available on the underlying physical volumes on a next-free basis. Modifying the logical volume will frees and reallocates space in the physical volumes. The following **lvcreate** command has been tested on linux CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6 and RHEL 7 version. - -### 4 lvcreate Command Examples on Linux : ### - -1. The following command creates a logical volume 15 gigabytes in size in the volume group vg_newlvm : - - [root@centos7 ~]# lvcreate -L 15G vg_newlvm - -2. The following command creates a 2500 MB linear logical volume named centos7_newvol in the volume group -vg_newlvm, creating the block device /dev/vg_newlvm/centos7_newvol : - - [root@centos7 ~]# lvcreate -L 2500 -n centos7_newvol vg_newlvm - -3. You can use the -l argument of the **lvcreate** command to specify the size of the logical volume in extents. You can also use this argument to specify the percentage of the volume group to use for the logical volume. The following command creates a logical volume called centos7_newvol that uses 50% of the total space in volume group vg_newlvm : - - [root@centos7 ~]# lvcreate -l 50%VG -n centos7_newvol vg_newlvm - -4. The following command creates a logical volume called centos7_newvol that uses all of the unallocated space in the volume group vg_newlvm : - - [root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm - -To see more **lvcreate** command options, issue the following command : - - [root@centos7 ~]# lvcreate --help - ----------- - - lvcreate: Create a logical volume - - lvcreate - [-A|--autobackup {y|n}] - [-a|--activate [a|e|l]{y|n}] - [--addtag Tag] - [--alloc AllocationPolicy] - [--cachemode CacheMode] - [-C|--contiguous {y|n}] - [-d|--debug] - [-h|-?|--help] - [--ignoremonitoring] - [--monitor {y|n}] - [-i|--stripes Stripes [-I|--stripesize StripeSize]] - [-k|--setactivationskip {y|n}] - [-K|--ignoreactivationskip] - {-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] | - -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]} - [-M|--persistent {y|n}] [--major major] [--minor minor] - [-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core|mirrored}|--corelog}]] - [-n|--name LogicalVolumeName] - [--noudevsync] - [-p|--permission {r|rw}] - [--[raid]minrecoveryrate Rate] - [--[raid]maxrecoveryrate Rate] - [-r|--readahead ReadAheadSectors|auto|none] - [-R|--regionsize MirrorLogRegionSize] - [-T|--thin [-c|--chunksize ChunkSize] - [--discards {ignore|nopassdown|passdown}] - [--poolmetadatasize MetadataSize[bBsSkKmMgG]]] - [--poolmetadataspare {y|n}] - [--thinpool ThinPoolLogicalVolume{Name|Path}] - [-t|--test] - [--type VolumeType] - [-v|--verbose] - [-W|--wipesignatures {y|n}] - [-Z|--zero {y|n}] - [--version] - VolumeGroupName [PhysicalVolumePath...] - - lvcreate - { {-s|--snapshot} OriginalLogicalVolume[Path] | - [-s|--snapshot] VolumeGroupName[Path] -V|--virtualsize VirtualSize} - {-T|--thin} VolumeGroupName[Path][/PoolLogicalVolume] - -V|--virtualsize VirtualSize} - [-c|--chunksize] - [-A|--autobackup {y|n}] - [--addtag Tag] - [--alloc AllocationPolicy] - [-C|--contiguous {y|n}] - [-d|--debug] - [--discards {ignore|nopassdown|passdown}] - [-h|-?|--help] - [--ignoremonitoring] - [--monitor {y|n}] - [-i|--stripes Stripes [-I|--stripesize StripeSize]] - [-k|--setactivationskip {y|n}] - [-K|--ignoreactivationskip] - {-l|--extents LogicalExtentsNumber[%{VG|FREE|ORIGIN}] | - -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]} - [--poolmetadatasize MetadataVolumeSize[bBsSkKmMgG]] - [-M|--persistent {y|n}] [--major major] [--minor minor] - [-n|--name LogicalVolumeName] - [--noudevsync] - [-p|--permission {r|rw}] - [-r|--readahead ReadAheadSectors|auto|none] - [-t|--test] - [--thinpool ThinPoolLogicalVolume[Path]] - [-v|--verbose] - [--version] - [PhysicalVolumePath...] - --------------------------------------------------------------------------------- - -via: http://www.ehowstuff.com/4-lvcreate-command-examples-on-linux/ - -作者:[skytech][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.ehowstuff.com/author/mhstar/ \ No newline at end of file diff --git a/sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md b/sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md deleted file mode 100644 index 2c4ee5b2d6..0000000000 --- a/sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md +++ /dev/null @@ -1,165 +0,0 @@ -FSSLC Translating ! - -Cleaning up Ubuntu 14.10,14.04,13.10 system -================================================================================ -We have already discussed [Cleaning up a Ubuntu GNU/Linux system][1] and this tutorial is updated with new ubuntu versions and more tools added. - -If you want to clean your ubuntu machine you need to follow these simple steps to remove all unnecessary junk files. - -### Remove partial packages ### - -This is yet another built-in feature, but this time it is not used in Synaptic Package Manager. It is used in the Terminal. Now, in the Terminal, key in the following command - - sudo apt-get autoclean - -Then enact the package clean command. What this commnad does is to clean remove .deb packages that apt caches when you install/update programs. To use the clean command type the following in a terminal window: - - sudo apt-get clean - -You can then use the autoremove command. What the autoremove command does is to remove packages installed as dependencies after the original package is removed from the system. To use autoremove tye the following in a terminal window: - - sudo apt-get autoremove - -### Remove unnecessary locale data ### - -For this we need to install localepurge.Automagically remove unnecessary locale data.This is just a simple script to recover diskspace wasted for unneeded locale files and localized man pages. It will automagically be invoked upon completion of any apt installation run. - -Install localepurge in Ubuntu - - sudo apt-get install localepurge - -After installing anything with apt-get install, localepurge will remove all translation files and translated man pages in languages you cannot read. - -If you want to configure localepurge you need to edit /etc/locale.nopurge - -This can save you several megabytes of disk space, depending on the packages you have installed. - -Example:- - -I am trying to install dicus using apt-get - -sudo apt-get install discus - -after end of this installation you can see something like below - -localepurge: Disk space freed in /usr/share/locale: 41860K - -### Remove "orphaned" packages ### - -If you want to remove orphaned packages you need to install deborphan package. - -Install deborphan in Ubuntu - - sudo apt-get install deborphan - -### Using deborphan ### - -Open Your terminal and enter the following command - - sudo deborphan | xargs sudo apt-get -y remove --purge - -### Remove "orphaned" packages Using GtkOrphan ### - -GtkOrphan (a Perl/Gtk2 application for debian systems) is a graphical tool which analyzes the status of your installations, looking for orphaned libraries. It implements a GUI front-end for deborphan, adding the package-removal capability. - -### Install GtkOrphan in Ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install gtkorphan - -#### Screenshot #### - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/41.png) - -### Remove Orphan packages using Wajig ### - -simplified Debian package management front end.Wajig is a single commandline wrapper around apt, apt-cache, dpkg,/etc/init.d scripts and more, intended to be easy to use and providing extensive documentation for all of its functions. - -With a suitable sudo configuration, most (if not all) package installation as well as creation tasks can be done from a user shell. Wajig is also suitable for general system administration.A Gnome GUI command ‘gjig' is also included in the package. - -### Install Wajig in Ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install wajig - -### Debfoster --- Keep track of what you did install ### - -debfoster maintains a list of installed packages that were explicitly requested rather than installed as a dependency. Arguments are entirely optional, debfoster can be invoked per se after each run of dpkg and/or apt-get. - -Alternatively you can use debfoster to install and remove packages by specifying the packages on the command line. Packages suffixed with a --- are removed while packages without a suffix are installed. - -If a new package is encountered or if debfoster notices that a package that used to be a dependency is now an orphan, it will ask you what to do with it. If you decide to keep it, debfoster will just take note and continue. If you decide that this package is not interesting enough it will be removed as soon as debfoster is done asking questions. If your choices cause other packages to become orphaned more questions will ensue. - -### Install debfoster in Ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install debfoster - -### Using debfoster ### - -to create the initial keepers file use the following command - - sudo debfoster -q - -you can always edit the file /var/lib/debfosterkeepers which defines the packages you want to remain on your system. - -to edit the keepers file type - - sudo vi /var/lib/debfoster/keepers - -To force debfoster to remove all packages that aren't listed in this list or dependencies of packages that are listed in this list.It will also add all packages in this list that aren't installed. So it makes your system comply with this list. Do this - - sudo debfoster -f - -To keep track of what you installed additionally do once in a while : - - sudo debfoster - -### xdiskusage -- Check where the space on your hard drive goes ### - -Displays a graphic of your disk usage with du.xdiskusage is a user-friendly program to show you what is using up all your disk space. It is based on the design of the "xdu" program written by Phillip C. Dykstra. Changes have been made so it runs "du" for you, and can display the free space left on the disk, and produce a PostScript version of the display.xdiskusage is nice if you want to easily see where the space on your hard drive goes. - -### Install xdiskusage in Ubuntu ### - - sudo apt-get install xdiskusage - -If you want to open this application you need to use the following command - - sudo xdiskusage - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/5.png) - -Once it opens you should see similar to the following screen - -### Bleachbit ### - -BleachBit quickly frees disk space and tirelessly guards your privacy. Free cache, delete cookies, clear Internet history, shred temporary files, delete logs, and discard junk you didn't know was there. Designed for Linux and Windows systems, it wipes clean a thousand applications including Firefox, Internet Explorer, Adobe Flash, Google Chrome, Opera, Safari,and more. Beyond simply deleting files, BleachBit includes advanced features such as shredding files to prevent recovery, wiping free disk space to hide traces of files deleted by other applications, and vacuuming Firefox to make it faster. Better than free, BleachBit is open source. - -### Install Bleachbit in ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install bleachbit - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/6.png) - -### Using Ubuntu-Tweak ### - -You can also Use [Ubuntu-Tweak][2] To clean up your system - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with-ubuntu-14-10-and-more-tools-added.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/cleaning-up-all-unnecessary-junk-files-in-ubuntu.html -[2]:http://www.ubuntugeek.com/www.ubuntugeek.com/install-ubuntu-tweak-on-ubuntu-14-10.html diff --git a/sources/tech/20150127 How to limit network bandwidth on Linux.md b/sources/tech/20150127 How to limit network bandwidth on Linux.md deleted file mode 100644 index 1deaa38b49..0000000000 --- a/sources/tech/20150127 How to limit network bandwidth on Linux.md +++ /dev/null @@ -1,90 +0,0 @@ -How to limit network bandwidth on Linux -================================================================================ -If you often run multiple networking applications on your Linux desktop, or share bandwidth among multiple computers at home, you will want to have a better control over bandwidth usage. Otherwise, when you are downloading a big file with a downloader, your interactive SSH session may become sluggish to the point where it's unusable. Or when you sync a big folder over Dropbox, your roommate may complain that video streaming at her computer gets choppy. - -In this tutorial, I am going to describe two different ways to rate limit network traffic on Linux. - -### Rate Limit an Application on Linux ### - -One way to rate limit network traffic is via a command-line tool called [trickle][1]. The trickle command allows you to shape the traffic of any particular program by "pre-loading" a rate-limited socket library at run-time. A nice thing about trickle is that it runs purely in user-space, meaning you don't need root privilege to restrict the bandwidth usage of a program. To be compatible with trickle, the program must use socket interface with no statically linked library. trickle can be handy when you want to rate limit a program which does not have a built-in bandwidth control functionality. - -To install trickle on Ubuntu, Debian and their derivatives: - - $ sudo apt-get install trickle - -To install trickle on Fedora or CentOS/RHEL (with [EPEL repository][2]): - - $ sudo yum install trickle - -Basic usage of trickle is as follows. Simply put, you prepend trickle (with rate) in front of the command you are trying to run. - - $ trickle -d -u - -This will limit the download and upload rate of to specified values (in KBytes/s). - -For example, set the maximum upload bandwidth of your scp session to 100 KB/s: - - $ trickle -u 100 scp backup.tgz alice@remote_host.com: - -If you want, you can set the maximum download speed (e.g., 300 KB/s) of your Firefox browser by creating a [custom launcher][3] with the following command. - - trickle -d 300 firefox %u - -Finally, trickle can run in a daemon mode, where it can restrict the "aggregate" bandwidth usage of all running programs launched via trickle. To launch trickle as a daemon (i.e., trickled): - - $ sudo trickled -d 1000 - -Once the trickled daemon is running in the background, you can launch other programs via trickle. If you launch one program with trickle, its maximum download rate is 1000 KB/s. If you launch another program with trickle, each of them will be rate limited to 500 KB/s, etc. - -### Rate Limit a Network Interface on Linux ### - -Another way to control your bandwidth resource is to enforce bandwidth limit on a per-interface basis. This is useful when you are sharing your upstream Internet connection with someone else. Like anything else, Linux has a tool for you. [wondershaper][4] exactly does that: rate-limit a network interface. - -wondershaper is in fact a shell script which uses [tc][5] to define traffic shaping and QoS for a specific network interface. Outgoing traffic is shaped by being placed in queues with different priorities, while incoming traffic is rate-limited by packet dropping. - -In fact, the stated goal of wondershaper is much more than just adding bandwidth cap to an interface. wondershaper tries to maintain low latency for interactive sessions such as SSH while bulk download or upload is going on. Also, it makes sure that bulk upload (e.g., Dropbox sync) does not suffocate download, and vice versa. - -To install wondershaper on Ubuntu, Debian and their derivatives: - - $ sudo apt-get install wondershaper - -To install wondershaper on Fedora or CentOS/RHEL (with [EPEL repository][6]): - - $ sudo yum install wondershaper - -Basic usage of wondershaper is as follows. - - $ sudo wondershaper - -For example, to set the maximum download/upload bandwidth for eth0 to 1000Kbit/s and 500Kbit/s, respectively: - - $ sudo wondershaper eth0 1000 500 - -You can remove the rate limit by running: - - $ sudo wondershaper clear eth0 - -If you are interested in how wondershaper works, you can read its shell script (/sbin/wondershaper). - -### Conclusion ### - -In this tutorial, I introduced two different ways to control your bandwidth usages on Linux desktop, on per-application or per-interface basis. Both tools are extremely user-friendly, offering you a quick and easy way to shape otherwise unconstrained traffic. For those of you who want to know more about rate control on Linux, refer to [the Linux bible][7]. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/limit-network-bandwidth-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://monkey.org/~marius/trickle -[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[3]:http://xmodulo.com/create-desktop-shortcut-launcher-linux.html -[4]:http://lartc.org/wondershaper/ -[5]:http://lartc.org/manpages/tc.txt -[6]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[7]:http://www.lartc.org/lartc.html \ No newline at end of file diff --git a/sources/tech/20150127 LinSSID--A Graphical Wi-Fi Scanner for Linux.md b/sources/tech/20150127 LinSSID--A Graphical Wi-Fi Scanner for Linux.md deleted file mode 100644 index 2a004ed174..0000000000 --- a/sources/tech/20150127 LinSSID--A Graphical Wi-Fi Scanner for Linux.md +++ /dev/null @@ -1,61 +0,0 @@ -LinSSID – A Graphical Wi-Fi Scanner for Linux -================================================================================ -### Introduction ### - -As you may know, **LinSSID** is a simple graphical software that can be used to find the wireless networks available.It is completely open source, written in C++ using Linux wireless tools, Qt5, and Qwt 6.1., and is similar to **Inssider** (MS Windows) in terms of look and functionality. - -### Installation ### - -You can install it either using source, or using a PPA if you use DEB based systems such as Ubuntu, and LinuxMint etc. - -You can download and install LinSSID using source packages from [this link][1]. - -Here, we will install and test this software on Ubuntu 14.04 LTS using PPA. - -Add the LinSSID PPA, and install it by typing. - - sudo add-apt-repository ppa:wseverin/ppa - sudo apt-get update - sudo apt-get install linssid - -### Usage ### - -Once you installed, launch it either from menu or unity. - -You”ll be asked to enter the administrative user password of your system. - -![Password required for iwlist scan_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Password-required-for-iwlist-scan_001.png) - -This is how LinSSID interface looks. - -![LinSSID_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/LinSSID_002.png) - -Now, select the network interface you used to connect to the Wireless networks, for example wlan0 in my case. Click the Play button to search the list of available wi-fi networks. - -After a new seconds, LinSSID will display the wi-fi networks. - -![LinSSID_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/LinSSID_003.png) - -As you see in the above screenshot, LinSSID displays the details of SSID names, MAC Id, Channel, Privacy, Cipher, Signal, and Protocol etc. Ofcourse, you can make LinSSID to display more options such as Security, bandwidth details etc. To do that, go to **View** menu, and select the desired option. Also, it displays the graphs of signal strength by channel and over time. Additionally, It works both on 2.4Ghz, and 5Ghz channels. - -That’s it. Hope this tool will useful for you. - -Cheers!! - -Reference Links: - -- [LinSSID Homepage][2] - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/linssid-graphical-wi-fi-scanner-linux/ - -作者:[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://sourceforge.net/projects/linssid/files/ -[2]:http://sourceforge.net/projects/linssid/ \ 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 new file mode 100644 index 0000000000..1c1d4b78cc --- /dev/null +++ b/sources/tech/20150128 Docker-1 Moving to Docker.md @@ -0,0 +1,82 @@ +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/20150128 Docker-2 Setting up a private Docker registry.md b/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md new file mode 100644 index 0000000000..9a9341b4b7 --- /dev/null +++ b/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md @@ -0,0 +1,241 @@ +Setting up a private Docker registry +================================================================================ +![](http://cocoahunter.com/content/images/2015/01/docker2.jpg) + +[TL;DR] This is the second post in a series of 3 on how my company moved its infrastructure from PaaS to Docker based deployment. + +- [First part][1]: where I talk about the process we went thru before approaching Docker; +- [Third pard][2]: where I show how to automate the entire process of building images and deploying a Rails app with Docker. + +---------- + +Why would ouy want ot set up a provate registry? Well, for starters, Docker Hub only allows you to have one free private repo. Other companies are beginning to offer similar services, but they are all not very cheap. In addition, if you need to deploy production ready applications built with Docker, you might not want to publish those images on the public Docker Hub. + +This is a very pragmatic approach to dealing with the intricacies of setting up a private Docker registry. For the tutorial we will be using a small 512MB instance on DigitalOcean (from now on DO). I also assume you already know the basics of Docker since I will be concentrating on some more complicated stuff. + +### Local set up ### + +First of all you need to install **boot2docker** and docker CLI. If you already have your basic Docker environment up and running, you can just skip to the next section. + +From the terminal run the following command[1][3]: + + brew install boot2docker docker + +If everything is ok[2][4], you will now be able to start the VM inside which Docker will run with the following command: + + boot2docker up + +Follow the instructions, copy and paste the export commands that boot2docker will print in the terminal. If you now run `docker ps` you should be greeted by the following line + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + +Ok, Docker is ready to go. This will be enough for the moment. Let's go back to setting up the registry. + +### Creating the server ### + +Log into you DO account and create a new Droplet by selecting an image with Docker pre-installed[^n]. + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-18-26-14.png) + +You should receive your root credentials via email. Log into your instance and run `docker ps` to see if eveything is ok. + +### Setting up AWS S3 ### + +We are going to use Amazon Simple Storage Service (S3) as the storage layer for our registry / repository. We will need to create a bucket and user credentials to allow our docker container accessoing it. + +Login into your AWS account (if you don't have one you can set one up at [http://aws.amazon.com/][5]) and from the console select S3 (Simple Storage Service). + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-21.png) + +Click on **Create Bucket**, enter a unique name for your bucket (and write it down, we're gonna need it later), then click on **Create**. + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-22-50.png) + +That's it! We're done setting up the storage part. + +### Setup AWS access credentials ### + +We are now going to create a new user. Go back to your AWS console and select IAM (Identity & Access Management). + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-08.png) + +In the dashboard, on the left side of the webpage, you should click on Users. Then select **Create New Users**. + +You should be presented with the following screen: + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-31-42.png) + +Enter a name for your user (e.g. docker-registry) and click on Create. Write down (or download the csv file with) your Access Key and Secret Access Key that we'll need when running the Docker container. Go back to your users list and select the one you just created. + +Under the Permission section, click on Attach User Policy. In the next screen, you will be presented with multiple choices: select Custom Policy. + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-41-21.png) + +Here's the content of the custom policy: + + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "SomeStatement", + "Effect": "Allow", + "Action": [ + "s3:*" + ], + "Resource": [ + "arn:aws:s3:::docker-registry-bucket-name/*", + "arn:aws:s3:::docker-registry-bucket-name" + ] + } + ] + } + +This will allow the user (i.e. the registry) to manage (read/write) content on the bucket (make sure to use the bucket name you previously defined when setting up AWS S3). To sum it up: when you'll be pushing Docker images from your local machine to your repository, the server will be able to upload them to S3. + +### Installing the registry ### + +Now let's head back to our DO server and SSH into it. We are going to use[^n] one of the [official Docker registry images][6]. + +Let's start our registry with the following command: + + docker run \ + -e SETTINGS_FLAVOR=s3 \ + -e AWS_BUCKET=bucket-name \ + -e STORAGE_PATH=/registry \ + -e AWS_KEY=your_aws_key \ + -e AWS_SECRET=your_aws_secret \ + -e SEARCH_BACKEND=sqlalchemy \ + -p 5000:5000 \ + --name registry \ + -d \ + registry + +Docker should pull the required fs layers from the Docker Hub and eventually start the daemonised container. + +### Testing the registry ### + +If everything worked out, you should now be able to test the registry by pinging it and by searching its content (though for the time being it's still empty). + +Our registry is very basic and it does not provide any means of authentication. Since there are no easy ways of adding authentication (at least none that I'm aware of that are easy enough to implment in order to justify the effort), I've decided that the easiest way of querying / pulling / pushing the registry is an unsecure (over HTTP) connection tunneled thru SSH. + +Opening an SSH tunnel from your local machine is straightforward: + + ssh -N -L 5000:localhost:5000 root@your_registry.com + +The command is tunnelling connections over SSH from port 5000 of the registry server (which is the one we exposed with the `docker run` command in the previous paragraph) to port 5000 on the localhost. + +If you now browse to the following address [http://localhost:5000/v1/_ping][7] you should get the following very simple response + + {} + +This just means that the registry is working correctly. You can also list the whole content of the registry by browsing to [http://localhost:5000/v1/search][8] that will get you a similar response: + + { + "num_results": 2, + "query": "", + "results": [ + { + "description": "", + "name": "username/first-repo" + }, + { + "description": "", + "name": "username/second-repo" + } + ] + } + +### Building an image ### + +Let's now try and build a very simple Docker image to test our newly installed registry. On your local machine, create a Dockerfile with the following content[^n]: + + # Base image with ruby 2.2.0 + FROM ruby:2.2.0 + + MAINTAINER Michelangelo Chasseur + +...and build it: + + docker build -t localhost:5000/username/repo-name . + +The `localhost:5000` part is especially important: the first part of the name of a Docker image will tell the `docker push` command the endpoint towards which we are trying to push our image. In our case, since we are connecting to our remote private registry via an SSH tunnel, `localhost:5000` represents exactly the reference to our registry. + +If everything works as expected, when the command returns, you should be able to list your newly created image with the `docker images` command. Run it and see it for yourself. + +### Pushing to the registry ### + +Now comes the trickier part. It took a me a while to realize what I'm about to describe, so just be patient if you don't get it the first time you read and try to follow along. I know that all this stuff will seem pretty complicated (and it would be if you didn't automate the process), but I promise in the end it will all make sense. In the next post I will show a couple of shell scripts and Rake tasks that will automate the whole process and will let you deploy a Rails to your registry app with a single easy command. + +The docker command you are running from your terminal is actually using the boot2docker VM to run the containers and do all the magic stuff. So when we run a command like `docker push some_repo` what is actually happening is that it's the boot2docker VM that is reacing out for the registry, not our localhost. + +This is an extremely important point to understand: in order to push the Docker image to the remote private registry, the SSH tunnel needs to be established from the boot2docker VM and not from your local machine. + +There are a couple of ways to go with it. I will show you the shortest one (which is not probably the easiest to understand, but it's the one that will let us automate the process with shell scripts). + +First of all though we need to sort one last thing with SSH. + +### Setting up SSH ### + +Let's add our boot2docker SSH key to our remote server (registry) known hosts. We can do so using the ssh-copy-id utility that you can install with the following command shouldn't you already have it: + + brew install ssh-copy-id + +Then run: + + ssh-copy-id -i /Users/username/.ssh/id_boot2docker root@your-registry.com + +Make sure to substitute `/Users/username/.ssh/id_boot2docker` with the correct path of your ssh key. + +This will allow us to connect via SSH to our remote registry without being prompted for the password. + +Finally let's test it out: + + boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &" & + +To break things out a little bit: + +- `boot2docker ssh` lets you pass a command as a parameter that will be executed by the boot2docker VM; +- the final `&` indicates that we want our command to be executed in the background; +- `ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &` is the actual command our boot2docker VM will run; + - the `-o 'StrictHostKeyChecking no'` will make sure that we are not prompted with security questions; + - the `-i /Users/michelangelo/.ssh/id_boot2docker` indicates which SSH key we want our VM to use for authentication purposes (note that this should be the key you added to your remote registry in the previous step); + - finally we are opening a tunnel on mapping port 5000 to localhost:5000. + +### Pulling from another server ### + +You should now be able to push your image to the remote registry by simply issuing the following command: + + docker push localhost:5000/username/repo_name + +In the [next post][9] we'll se how to automate some of this stuff and we'll containerize a real Rails application. Stay tuned! + +P.S. Please use the comments to let me know of any inconsistencies or fallacies in my tutorial. Hope you enjoyed it! + +1. I'm also assuming you are running on OS X. +1. For a complete list of instructions to set up your docker environment and requirements, please visit [http://boot2docker.io/][10] +1. Select Image > Applications > Docker 1.4.1 on 14.04 at the time of this writing. +1. [https://github.com/docker/docker-registry/][11] +1. This is just a stub, in the next post I will show you how to bundle a Rails application into a Docker container. + +-------------------------------------------------------------------------------- + +via: http://cocoahunter.com/2015/01/23/docker-2/ + +作者:[Michelangelo Chasseur][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://cocoahunter.com/author/michelangelo/ +[1]:http://cocoahunter.com/2015/01/23/docker-1/ +[2]:http://cocoahunter.com/2015/01/23/docker-3/ +[3]:http://cocoahunter.com/2015/01/23/docker-2/#fn:1 +[4]:http://cocoahunter.com/2015/01/23/docker-2/#fn:2 +[5]:http://aws.amazon.com/ +[6]:https://registry.hub.docker.com/_/registry/ +[7]:http://localhost:5000/v1/_ping +[8]:http://localhost:5000/v1/search +[9]:http://cocoahunter.com/2015/01/23/docker-3/ +[10]:http://boot2docker.io/ +[11]:https://github.com/docker/docker-registry/ \ No newline at end of file diff --git a/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md b/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md new file mode 100644 index 0000000000..f450361a68 --- /dev/null +++ b/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md @@ -0,0 +1,253 @@ +Automated Docker-based Rails deployments +================================================================================ +![](http://cocoahunter.com/content/images/2015/01/docker3.jpeg) + +[TL;DR] This is the third post in a series of 3 on how my company moved its infrastructure from PaaS to Docker based deployment. + +- [First part][1]: where I talk about the process we went thru before approaching Docker; +- [Second part][2]: where I explain how setting up a private registry for in house secure deployments. + +---------- + +In this final part we will see how to automate the whole deployment process with a real world (though very basic) example. + +### Basic Rails app ### + +Let's dive into the topic right away and bootstrap a basic Rails app. For the purpose of this demonstration I'm going to use Ruby 2.2.0 and Rails 4.1.1 + +From the terminal run: + + $ rvm use 2.2.0 + $ rails new && cd docker-test + +Let's create a basic controller: + + $ rails g controller welcome index + +...and edit `routes.rb` so that the root of the project will point to our newly created welcome#index method: + + root 'welcome#index' + +Running `rails s` from the terminal and browsing to [http://localhost:3000][3] should bring you to the index page. We're not going to make anything fancier to the app, it's just a basic example to prove that when we'll build and deploy the container everything is working. + +### Setup the webserver ### + +We are going to use Unicorn as our webserver. Add `gem 'unicorn'` and `gem 'foreman'` to the Gemfile and bundle it up (run `bundle install` from the command line). + +Unicorn needs to be configured when the Rails app launches, so let's put a **unicorn.rb** file inside the **config** directory. [Here is an example][4] of a Unicorn configuration file. You can just copy & paste the content of the Gist. + +Let's also add a Procfile with the following content inside the root of the project so that we will be able to start the app with foreman: + + web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb + +If you now try to run the app with **foreman start** everything should work as expected and you should have a running app on [http://localhost:5000][5] + +### Building a Docker image ### + +Now let's build the image inside which our app is going to live. In the root of our Rails project, create a file named **Dockerfile** and paste in it the following: + + # Base image with ruby 2.2.0 + FROM ruby:2.2.0 + + # Install required libraries and dependencies + RUN apt-get update && apt-get install -qy nodejs postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* + + # Set Rails version + ENV RAILS_VERSION 4.1.1 + + # Install Rails + RUN gem install rails --version "$RAILS_VERSION" + + # Create directory from where the code will run + RUN mkdir -p /usr/src/app + WORKDIR /usr/src/app + + # Make webserver reachable to the outside world + EXPOSE 3000 + + # Set ENV variables + ENV PORT=3000 + + # Start the web app + CMD ["foreman","start"] + + # Install the necessary gems + ADD Gemfile /usr/src/app/Gemfile + ADD Gemfile.lock /usr/src/app/Gemfile.lock + RUN bundle install --without development test + + # Add rails project (from same dir as Dockerfile) to project directory + ADD ./ /usr/src/app + + # Run rake tasks + RUN RAILS_ENV=production rake db:create db:migrate + +Using the provided Dockerfile, let's try and build an image with the following command[1][7]: + + $ docker build -t localhost:5000/your_username/docker-test . + +And again, if everything worked out correctly, the last line of the long log output should read something like: + + Successfully built 82e48769506c + $ docker images + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + localhost:5000/your_username/docker-test latest 82e48769506c About a minute ago 884.2 MB + +Let's try and run the container! + + $ docker run -d -p 3000:3000 --name docker-test localhost:5000/your_username/docker-test + +You should be able to reach your Rails app running inside the Docker container at port 3000 of your boot2docker VM[2][8] (in my case [http://192.168.59.103:3000][6]). + +### Automating with shell scripts ### + +Since you should already know from the previous post3 how to push your newly created image to a private regisitry and deploy it on a server, let's skip this part and go straight to automating the process. + +We are going to define 3 shell scripts and finally tie it all together with rake. + +### Clean ### + +Every time we build our image and deploy we are better off always clean everything. That means the following: + +- stop (if running) and restart boot2docker; +- remove orphaned Docker images (images that are without tags and that are no longer used by your containers). + +Put the following into a **clean.sh** file in the root of your project. + + echo Restarting boot2docker... + boot2docker down + boot2docker up + + echo Exporting Docker variables... + sleep 1 + export DOCKER_HOST=tcp://192.168.59.103:2376 + export DOCKER_CERT_PATH=/Users/user/.boot2docker/certs/boot2docker-vm + export DOCKER_TLS_VERIFY=1 + + sleep 1 + echo Removing orphaned images without tags... + docker images | grep "" | awk '{print $3}' | xargs docker rmi + +Also make sure to make the script executable: + + $ chmod +x clean.sh + +### Build ### + +The build process basically consists in reproducing what we just did before (docker build). Create a **build.sh** script at the root of your project with the following content: + + docker build -t localhost:5000/your_username/docker-test . + +Make the script executable. + +### Deploy ### + +Finally, create a **deploy.sh** script with this content: + + # Open SSH connection from boot2docker to private registry + boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/username/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@your-registry.com &" & + + # Wait to make sure the SSH tunnel is open before pushing... + echo Waiting 5 seconds before pushing image. + + echo 5... + sleep 1 + echo 4... + sleep 1 + echo 3... + sleep 1 + echo 2... + sleep 1 + echo 1... + sleep 1 + + # Push image onto remote registry / repo + echo Starting push! + docker push localhost:5000/username/docker-test + +If you don't understand what's going on here, please make sure you've read thoroughfully [part 2][9] of this series of posts. + +Make the script executable. + +### Tying it all together with rake ### + +Having 3 scripts would now require you to run them individually each time you decide to deploy your app: + +1. clean +1. build +1. deploy / push + +That wouldn't be much of an effort, if it weren't for the fact that developers are lazy! And lazy be it, then! + +The final step to wrap things up, is tying the 3 parts together with rake. + +To make things even simpler you can just append a bunch of lines of code to the end of the already present Rakefile in the root of your project. Open the Rakefile file - pun intended :) - and paste the following: + + namespace :docker do + desc "Remove docker container" + task :clean do + sh './clean.sh' + end + + desc "Build Docker image" + task :build => [:clean] do + sh './build.sh' + end + + desc "Deploy Docker image" + task :deploy => [:build] do + sh './deploy.sh' + end + end + +Even if you don't know rake syntax (which you should, because it's pretty awesome!), it's pretty obvious what we are doing. We have declared 3 tasks inside a namespace (docker). + +This will create the following 3 tasks: + +- rake docker:clean +- rake docker:build +- rake docker:deploy + +Deploy is dependent on build, build is dependent on clean. So every time we run from the command line + + $ rake docker:deploy + +All the script will be executed in the required order. + +### Test it ### + +To see if everything is working, you just need to make a small change in the code of your app and run + + $ rake docker:deploy + +and see the magic happening. Once the image has been uploaded (and the first time it could take quite a while), you can ssh into your production server and pull (thru an SSH tunnel) the docker image onto the server and run. It's that easy! + +Well, maybe it takes a while to get accustomed to how everything works, but once it does, it's almost (almost) as easy as deploying with Heroku. + +P.S. As always, please let me have your ideas. I'm not sure this is the best, or the fastest, or the safest way of doing devops with Docker, but it certainly worked out for us. + +- make sure to have **boot2docker** up and running. +- If you don't know your boot2docker VM address, just run `$ boot2docker ip` +- if you don't, you can read it [here][10] + +-------------------------------------------------------------------------------- + +via: http://cocoahunter.com/2015/01/23/docker-3/ + +作者:[Michelangelo Chasseur][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://cocoahunter.com/author/michelangelo/ +[1]:http://cocoahunter.com/docker-1 +[2]:http://cocoahunter.com/2015/01/23/docker-2/ +[3]:http://localhost:3000/ +[4]:https://gist.github.com/chasseurmic/0dad4d692ff499761b20 +[5]:http://localhost:5000/ +[6]:http://192.168.59.103:3000/ +[7]:http://cocoahunter.com/2015/01/23/docker-3/#fn:1 +[8]:http://cocoahunter.com/2015/01/23/docker-3/#fn:2 +[9]:http://cocoahunter.com/2015/01/23/docker-2/ +[10]:http://cocoahunter.com/2015/01/23/docker-2/ \ No newline at end of file diff --git a/sources/tech/20150128 How To Monitor Access Point Signal Strength With wifi-linux.md b/sources/tech/20150128 How To Monitor Access Point Signal Strength With wifi-linux.md deleted file mode 100644 index d652b15d8c..0000000000 --- a/sources/tech/20150128 How To Monitor Access Point Signal Strength With wifi-linux.md +++ /dev/null @@ -1,86 +0,0 @@ -How To Monitor Access Point Signal Strength With wifi-linux -================================================================================ -As a python geek I love exploring new python tools on github that target the linux users. Today I discovered a simple application written in python programming language that can be used to monitor access point signal strength. - -I have been experimenting for about two hours with **wifi-linux** and it works great but I would like to see some unittests in the near future from the author as the command **plot** is not working on my machine and is also causing some errors. - -### What is wifi-linux ### - -According to the official readme.md file on author's github account wifi-linux is a very simple python script which collects RSSI information about wifi access points around you and draws graphics showing RSSI activity. - -The author states that the program also draws RSSI activity graphic and this can be generated with the command plot but unfortunetly it is not working for me. wifi-linux supports other commands such as **bp** to add a breakpoint, **print** to print some statistics and **start changer**. - -The wifi-linux application has the folowing dependencies: - -- dbus-python -- gnuplot-py - -So first we have to install all the package dependencies for our project in order to run it in our linux machine. - -### Install pakages required by wifi-linux ### - -I tried to install python-dbus by using the pip tool which is used to manage python packages but it did not work and the reason for this is that pip looks for setup.py, which dbus-python doesn't have. So the following command is not going to work. - - pip install dbus-python - -And to make sure it does not work give it a try. It is a very high probability that you will get the following error displayed on your console. - - IOError: [Errno 2] No such file or directory: '/tmp/pip_build_oltjano/dbus-python/setup.py' - -How did I manage to solve this problem? It is very simple. I installed the the system package for the Python DBUS bindings using the following command. - - sudo apt-get install python-dbus - -The above command will work only in machines that make use of the apt-get package manager such as Debian and Ubuntu. - -Then the second dependency we have to take care is the gnuplot-py. Download it, extract using the tar utility and then run setup.py install to install the python package. - -First step is to download gnuplot-py. - - wget http://prdownloads.sourceforge.net/gnuplot-py/gnuplot-py-1.8.tar.gz - -Then use the tar utility to extract it. - - tar xvf gnuplot-py-1.8.tar.gz - -Then use the cd command to change directory. - - cd gnuplot-py-1.8 - -Once there then run the following command to install the package gunplot-py on your system. - - sudo setup.py install - -Once the installation is finished you are ready to run the wifi-linux on your machine. Just download it and use the following command to run the script. - -Download wifi-linux on your local machine by using the following command. - - wget https://github.com/dixel/wifi-linux/archive/master.zip - -Extract the master.zip archive and then use the following command to run the python script list_rsssi.py - - python list_rssi.py - -The following screenshot shows wifi-linux in action. - -![wifi-linux to monitor wifi signal strength](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux.png) - -Then the command **bp** is executed to add a breakpoint like shown below. - -![the bp command in wifi-linux](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux2.png) - -The command **print** can be used to display stats on the console of your machine. An example of its usage is shown below. - -![the print command](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux3.png) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/monitor-access-point-signal-strength-wifi-linux/ - -作者:[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/ \ No newline at end of file diff --git a/sources/tech/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md b/sources/tech/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md new file mode 100644 index 0000000000..92ac657b5a --- /dev/null +++ b/sources/tech/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md @@ -0,0 +1,79 @@ +How to Bind Apache Tomcat to IPv4 in Centos / Redhat +================================================================================ +Hi all, today we'll learn how to bind tomcat to ipv4 in CentOS 7 Linux Distribution. + +**Apache Tomcat** is an open source web server and servlet container developed by the [Apache Software Foundation][1]. It implements the Java Servlet, JavaServer Pages (JSP), Java Unified Expression Language and Java WebSocket specifications from Sun Microsystems and provides a web server environment for Java code to run in. + +Binding Tomcat to IPv4 is necessary if we have our server not working due to the default binding of our tomcat server to IPv6. As we know IPv6 is the modern way of assigning IP address to a device and is not in complete practice these days but may come into practice in soon future. So, currently we don't need to switch our tomcat server to IPv6 due to no use and we should bind it to IPv4. + +Before thinking to bind to IPv4, we should make sure that we've got tomcat installed in our CentOS 7. Here's is a quick tutorial on [how to install tomcat 8 in CentOS 7.0 Server][2]. + +### 1. Switching to user tomcat ### + +First of all, we'll gonna switch user to **tomcat** user. We can do that by running **su - tomcat** in a shell or terminal. + + # su - tomcat + +![Switch user to tomcat](http://blog.linoxide.com/wp-content/uploads/2015/01/switch-user-tomcat.png) + +### 2. Finding Catalina.sh ### + +Now, we'll First Go to bin directory inside the directory of Apache Tomcat installation which is usually under **/usr/share/apache-tomcat-8.0.x/bin/** where x is sub version of the Apache Tomcat Release. In my case, its **/usr/share/apache-tomcat-8.0.18/bin/** as I have version 8.0.18 installed in my CentOS 7 Server. + + $ cd /usr/share/apache-tomcat-8.0.18/bin + +**Note: Please replace 8.0.18 to the version of Apache Tomcat installed in your system. ** + +Inside the bin folder, there is a script file named catalina.sh . Thats the script file which we'll gonna edit and add a line of configuration which will bind tomcat to IPv4 . You can see that file by running **ls** into a terminal or shell. + + $ ls + +![finding catalina.sh](http://blog.linoxide.com/wp-content/uploads/2015/01/finding-catalina.sh_.png) + +### 3. Configuring Catalina.sh ### + +Now, we'll add **JAVA_OPTS= "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"** to that scripting file catalina.sh at the end of the file as shown in the figure below. We can edit the file using our favorite text editing software like nano, vim, etc. Here, we'll gonna use nano. + + $ nano catalina.sh + +![Catalina script](http://blog.linoxide.com/wp-content/uploads/2015/01/catalina-script.png) + +Then, add to the file as shown below: + +**JAVA_OPTS= "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"** + +![configured catalina](http://blog.linoxide.com/wp-content/uploads/2015/01/configured-catalina.png) + +Now, as we've added the configuration to the file, we'll now save and exit nano. + +### 4. Restarting ### + +Now, we'll restart our tomcat server to get our configuration working. We'll need to first execute shutdown.sh and then startup.sh . + + $ ./shutdown.sh + +Now, well run execute startup.sh as: + + $ ./startup.sh + +![restarting apache tomcat server](http://blog.linoxide.com/wp-content/uploads/2015/01/restarting-tomcat-server.png) + +This will restart our tomcat server and the configuration will be loaded which will ultimately bind the server to IPv4. + +### Conclusion ### + +Hurray, finally we'have got our tomcat server bind to IPv4 running in our CentOS 7 Linux Distribution. Binding to IPv4 is easy and is necessary if your Tomcat server is bind to IPv6 which will infact will make your tomcat server not working as IPv6 is not used these days and may come into practice in coming future. 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 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/bind-apache-tomcat-ipv4-centos/ + +作者:[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://www.apache.org/ +[2]:http://linoxide.com/linux-how-to/install-tomcat-8-centos-7/ \ No newline at end of file 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 new file mode 100644 index 0000000000..e871d29e42 --- /dev/null +++ b/sources/tech/20150202 How to create and show a presentation from the command line on Linux.md @@ -0,0 +1,187 @@ +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/20150202 How to filter BGP routes in Quagga BGP router.md b/sources/tech/20150202 How to filter BGP routes in Quagga BGP router.md new file mode 100644 index 0000000000..d92c47c774 --- /dev/null +++ b/sources/tech/20150202 How to filter BGP routes in Quagga BGP router.md @@ -0,0 +1,201 @@ +How to filter BGP routes in Quagga BGP router +================================================================================ +In the [previous tutorial][1], we demonstrated how to turn a CentOS box into a BGP router using Quagga. We also covered basic BGP peering and prefix exchange setup. In this tutorial, we will focus on how we can control incoming and outgoing BGP prefixes by using **prefix-list** and **route-map**. + +As described in earlier tutorials, BGP routing decisions are made based on the prefixes received/advertised. To ensure error-free routing, it is recommended that you use some sort of filtering mechanism to control these incoming and outgoing prefixes. For example, if one of your BGP neighbors starts advertising prefixes which do not belong to them, and you accept such bogus prefixes by mistake, your traffic can be sent to that wrong neighbor, and end up going nowhere (so-called "getting blackholed"). To make sure that such prefixes are not received or advertised to any neighbor, you can use prefix-list and route-map. The former is a prefix-based filtering mechanism, while the latter is a more general prefix-based policy mechanism used to fine-tune actions. + +We will show you how to use prefix-list and route-map in Quagga. + +### Topology and Requirement ### + +In this tutorial, we assume the following topology. + +![](https://farm8.staticflickr.com/7394/16407625405_4f7d24d1f6_c.jpg) + +Service provider A has already established an eBGP peering with service provider B, and they are exchanging routing information between them. The AS and prefix details are as stated below. + +- **Peering block**: 192.168.1.0/24 +- **Service provider A**: AS 100, prefix 10.10.0.0/16 +- **Service provider B**: AS 200, prefix 10.20.0.0/16 + +In this scenario, service provider B wants to receive only prefixes 10.10.10.0/23, 10.10.10.0/24 and 10.10.11.0/24 from provider A. + +### Quagga Installation and BGP Peering ### + +In the [previous tutorial][1], we have already covered the method of installing Quagga and setting up BGP peering. So we will not go through the details here. Nonetheless, I am providing a summary of BGP configuration and prefix advertisements: + +![](https://farm8.staticflickr.com/7428/16219986668_97cb193b15_c.jpg) + +The above output indicates that the BGP peering is up. Router-A is advertising multiple prefixes towards router-B. Router-B, on the other hand, is advertising a single prefix 10.20.0.0/16 to router-A. Both routers are receiving the prefixes without any problems. + +### Creating Prefix-List ### + +In a router, a prefix can be blocked with either an ACL or prefix-list. Using prefix-list is often preferred to ACLs since prefix-list is less processor intensive than ACLs. Also, prefix-list is easier to create and maintain. + + ip prefix-list DEMO-PRFX permit 192.168.0.0/23 + +The above command creates prefix-list called 'DEMO-FRFX' that allows only 192.168.0.0/23. + +Another great feature of prefix-list is that we can specify a range of subnet mask(s). Take a look at the following example: + + ip prefix-list DEMO-PRFX permit 192.168.0.0/23 le 24 + +The above command creates prefix-list called 'DEMO-PRFX' that permits prefixes between 192.168.0.0/23 and /24, which are 192.168.0.0/23, 192.168.0.0/24 and 192.168.1.0/24. The 'le' operator means less than or equal to. You can also use 'ge' operator for greater than or equal to. + +A single prefix-list statement can have multiple permit/deny actions. Each statement is assigned a sequence number which can be determined automatically or specified manually. + +Multiple prefix-list statements are parsed one by one in the increasing order of sequence numbers. When configuring prefix-list, we should keep in mind that there is always an **implicit deny** at the end of all prefix-list statements. This means that anything that is not explicitly allowed will be denied. + +To allow everything, we can use the following prefix-list statement which allows any prefix starting from 0.0.0.0/0 up to anything with subnet mask /32. + + ip prefix-list DEMO-PRFX permit 0.0.0.0/0 le 32 + +Now that we know how to create prefix-list statements, we will create prefix-list called 'PRFX-LST' that will allow prefixes required in our scenario. + + router-b# conf t + router-b(config)# ip prefix-list PRFX-LST permit 10.10.10.0/23 le 24 + +### Creating Route-Map ### + +Besides prefix-list and ACLs, there is yet another mechanism called route-map, which can control prefixes in a BGP router. In fact, route-map can fine-tune possible actions more flexibly on the prefixes matched with an ACL or prefix-list. + +Similar to prefix-list, a route-map statement specifies permit or deny action, followed by a sequence number. Each route-map statement can have multiple permit/deny actions with it. For example: + + route-map DEMO-RMAP permit 10 + +The above statement creates route-map called 'DEMO-RMAP', and adds permit action with sequence 10. Now we will use match command under sequence 10. + + router-a(config-route-map)# match (press ? in the keyboard) + +---------- + + as-path Match BGP AS path list + community Match BGP community list + extcommunity Match BGP/VPN extended community list + interface match first hop interface of route + ip IP information + ipv6 IPv6 information + metric Match metric of route + origin BGP origin code + peer Match peer address + probability Match portion of routes defined by percentage value + tag Match tag of route + +As we can see, route-map can match many attributes. We will match a prefix in this tutorial. + + route-map DEMO-RMAP permit 10 + match ip address prefix-list DEMO-PRFX + +The match command will match the IP addresses permitted by the prefix-list 'DEMO-PRFX' created earlier (i.e., prefixes 192.168.0.0/23, 192.168.0.0/24 and 192.168.1.0/24). + +Next, we can modify the attributes by using the set command. The following example shows possible use cases of set. + + route-map DEMO-RMAP permit 10 + match ip address prefix-list DEMO-PRFX + set (press ? in keyboard) + +---------- + + aggregator BGP aggregator attribute + as-path Transform BGP AS-path attribute + atomic-aggregate BGP atomic aggregate attribute + comm-list set BGP community list (for deletion) + community BGP community attribute + extcommunity BGP extended community attribute + forwarding-address Forwarding Address + ip IP information + ipv6 IPv6 information + local-preference BGP local preference path attribute + metric Metric value for destination routing protocol + metric-type Type of metric + origin BGP origin code + originator-id BGP originator ID attribute + src src address for route + tag Tag value for routing protocol + vpnv4 VPNv4 information + weight BGP weight for routing table + +As we can see, the set command can be used to change many attributes. For a demonstration purpose, we will set BGP local preference. + + route-map DEMO-RMAP permit 10 + match ip address prefix-list DEMO-PRFX + set local-preference 500 + +Just like prefix-list, there is an implicit deny at the end of all route-map statements. So we will add another permit statement in sequence number 20 to permit everything. + + route-map DEMO-RMAP permit 10 + match ip address prefix-list DEMO-PRFX + set local-preference 500 + ! + route-map DEMO-RMAP permit 20 + +The sequence number 20 does not have a specific match command, so it will, by default, match everything. Since the decision is permit, everything will be permitted by this route-map statement. + +If you recall, our requirement is to only allow/deny some prefixes. So in our scenario, the set command is not necessary. We will just use one permit statement as follows. + + router-b# conf t + router-b(config)# route-map RMAP permit 10 + router-b(config-route-map)# match ip address prefix-list PRFX-LST + +This route-map statement should do the trick. + +### Applying Route-Map ### + +Keep in mind that ACLs, prefix-list and route-map are not effective unless they are applied to an interface or a BGP neighbor. Just like ACLs or prefix-list, a single route-map statement can be used with any number of interfaces or neighbors. However, any one interface or a neighbor can support only one route-map statement for inbound, and one for outbound traffic. + +We will apply the created route-map to the BGP configuration of router-B for neighbor 192.168.1.1 with incoming prefix advertisement. + + router-b# conf terminal + router-b(config)# router bgp 200 + router-b(config-router)# neighbor 192.168.1.1 route-map RMAP in + +Now, we check the routes advertised and received by using the following commands. + +For advertised routes: + + show ip bgp neighbor-IP advertised-routes + +For received routes: + + show ip bgp neighbor-IP routes + +![](https://farm8.staticflickr.com/7424/16221405429_4d86119548_c.jpg) + +You can see that while router-A is advertising four prefixes towards router-B, router-B is accepting only three prefixes. If we check the range, we can see that only the prefixes that are allowed by route-map are visible on router-B. All other prefixes are discarded. + +**Tip**: If there is no change in the received prefixes, try resetting the BGP session using the command: "clear ip bgp neighbor-IP". In our case: + + clear ip bgp 192.168.1.1 + +As we can see, the requirement has been met. We can create similar prefix-list and route-map statements in routers A and B to further control inbound and outbound prefixes. + +I am summarizing the configuration in one place so you can see it all at a glance. + + router bgp 200 + network 10.20.0.0/16 + neighbor 192.168.1.1 remote-as 100 + neighbor 192.168.1.1 route-map RMAP in + ! + ip prefix-list PRFX-LST seq 5 permit 10.10.10.0/23 le 24 + ! + route-map RMAP permit 10 + match ip address prefix-list PRFX-LST + +### Summary ### + +In this tutorial, we showed how we can filter BGP routes in Quagga by defining prefix-list and route-map. We also demonstrated how we can combine prefix-list with route-map to fine-control incoming prefixes. You can create your own prefix-list and route-map in a similar way to match your network requirements. These tools are one of the most effective ways to protect the production network from route poisoning and advertisement of bogon routes. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/filter-bgp-routes-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 \ No newline at end of file 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 new file mode 100644 index 0000000000..11d5e6645a --- /dev/null +++ b/sources/tech/20150205 25 Linux Shell Scripting interview Questions & Answers.md @@ -0,0 +1,378 @@ + 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 Install or Configure VNC Server On CentOS 7.0.md b/sources/tech/20150205 How To Install or Configure VNC Server On CentOS 7.0.md new file mode 100644 index 0000000000..3eaba972f8 --- /dev/null +++ b/sources/tech/20150205 How To Install or Configure VNC Server On CentOS 7.0.md @@ -0,0 +1,161 @@ +How To Install / Configure VNC Server On CentOS 7.0 +================================================================================ +Hi there, this tutorial is all about how to install or setup [VNC][1] Server on your very CentOS 7. This tutorial also works fine in RHEL 7. In this tutorial, we'll learn what is VNC and how to install or setup [VNC Server][1] on CentOS 7 + +As we know, most of the time as a system administrator we are managing our servers over the network. It is very rare that we will need to have a physical access to any of our managed servers. In most cases all we need is to SSH remotely to do our administration tasks. In this article we will configure a GUI alternative to a remote access to our CentOS 7 server, which is VNC. VNC allows us to open a remote GUI session to our server and thus providing us with a full graphical interface accessible from any remote location. + +VNC server is a Free and Open Source Software which is designed for allowing remote access to the Desktop Environment of the server to the VNC Client whereas VNC viewer is used on remote computer to connect to the server . + +**Some Benefits of VNC server are listed below:** + + Remote GUI administration makes work easy & convenient. + Clipboard sharing between host CentOS server & VNC-client machine. + GUI tools can be installed on the host CentOS server to make the administration more powerful + Host CentOS server can be administered through any OS having the VNC-client installed. + More reliable over ssh graphics and RDP connections. + +So, now lets start our journey towards the installation of VNC Server. We need to follow the steps below to setup and to get a working VNC. + +First of all we'll need a working Desktop Environment (X-Windows), if we don't have a working GUI Desktop Environment (X Windows) running, we'll need to install it first. + +**Note: The commands below must be running under root privilege. To switch to root please execute "sudo -s" under a shell or terminal without quotes("")** + +### 1. Installing X-Windows ### + +First of all to install [X-Windows][2] we'll need to execute the below commands in a shell or terminal. It will take few minutes to install its packages. + + # yum check-update + # yum groupinstall "X Window System" + +![installing x windows](http://blog.linoxide.com/wp-content/uploads/2015/01/installing-x-windows.png) + + #yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts + +![install gnome classic session](http://blog.linoxide.com/wp-content/uploads/2015/01/gnome-classic-session-install.png) + + # unlink /etc/systemd/system/default.target + # ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target + +![configuring graphics](http://blog.linoxide.com/wp-content/uploads/2015/01/configuring-graphics.png) + + # reboot + +After our machine restarts, we'll get a working CentOS 7 Desktop. + +Now, we'll install VNC Server on our machine. + +### 2. Installing VNC Server Package ### + +Now, we'll install VNC Server package in our CentOS 7 machine. To install VNC Server, we'll need to execute the following command. + + # yum install tigervnc-server -y + +![vnc server](http://blog.linoxide.com/wp-content/uploads/2015/01/install-tigervnc.png) + +### 3. Configuring VNC ### + +Then, we'll need to create a configuration file under **/etc/systemd/system/** directory. We can copy the **vncserver@:1.service** file from example file from **/lib/systemd/system/vncserver@.service** + + # cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service + +![copying vnc server configuration](http://blog.linoxide.com/wp-content/uploads/2015/01/copying-configuration.png) + +Now we'll open **/etc/systemd/system/vncserver@:1.service** in our favorite text editor (here, we're gonna use **nano**). Then find the below lines of text in that file and replace with your username. Here, in my case its linoxide so I am replacing with linoxide and finally looks like below. + + ExecStart=/sbin/runuser -l -c "/usr/bin/vncserver %i" + PIDFile=/home//.vnc/%H%i.pid + +TO + + ExecStart=/sbin/runuser -l linoxide -c "/usr/bin/vncserver %i" + PIDFile=/home/linoxide/.vnc/%H%i.pid + +If you are creating for root user then + + ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i" + PIDFile=/root/.vnc/%H%i.pid + +![configuring user](http://blog.linoxide.com/wp-content/uploads/2015/01/configuring-user.png) + +Now, we'll need to reload our systemd. + + # systemctl daemon-reload + +Finally, we'll create VNC password for the user . To do so, first you'll need to be sure that you have sudo access to the user, here I will login to user "linoxide" then, execute the following. To login to linoxide we'll run "**su linoxide" without quotes** . + + # su linoxide + $ sudo vncpasswd + +![setting vnc password](http://blog.linoxide.com/wp-content/uploads/2015/01/vncpassword.png) + +**Make sure that you enter passwords more than 6 characters.** + +### 4. Enabling and Starting the service ### + +To enable service at startup ( Permanent ) execute the commands shown below. + + $ sudo systemctl enable vncserver@:1.service + +Then, start the service. + + $ sudo systemctl start vncserver@:1.service + +### 5. Allowing Firewalls ### + +We'll need to allow VNC services in Firewall now. + + $ sudo firewall-cmd --permanent --add-service vnc-server + $ sudo systemctl restart firewalld.service + +![allowing firewalld](http://blog.linoxide.com/wp-content/uploads/2015/01/allowing-firewalld.png) + +Now you can able to connect VNC server using IP and Port ( Eg : ip-address:1 ) + +### 6. Connecting the machine with VNC Client ### + +Finally, we are done installing VNC Server. No, we'll wanna connect the server machine and remotely access it. For that we'll need a VNC Client installed in our computer which will only enable us to remote access the server machine. + +![remote access vncserver from vncviewer](http://blog.linoxide.com/wp-content/uploads/2015/01/vncviewer.png) + +You can use VNC client like [Tightvnc viewer][3] and [Realvnc viewer][4] to connect Server. +To connect with additional users create files with different ports, please go to step 3 to configure and add a new user and port, You'll need to create **vncserver@:2.service** and replace the username in config file and continue the steps by replacing service name for different ports. **Please make sure you logged in as that particular user for creating vnc password**. + +VNC by itself runs on port 5900. Since each user will run their own VNC server, each user will have to connect via a separate port. The addition of a number in the file name tells VNC to run that service as a sub-port of 5900. So in our case, arun's VNC service will run on port 5901 (5900 + 1) and further will run on 5900 + x. Where, x denotes the port specified when creating config file **vncserver@:x.service for the further users**. + +We'll need to know the IP Address and Port of the server to connect with the client. IP addresses are the unique identity number of the machine. Here, my IP address is 96.126.120.92 and port for this user is 1. We can get the public IP address by executing the below command in a shell or terminal of the machine where VNC Server is installed. + + # curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//' + +### Conclusion ### + +Finally, we installed and configured VNC Server in the machine running CentOS 7 / RHEL 7 (Red Hat Enterprises Linux) . VNC is the most easy FOSS tool for the remote access and also a good alternative to Teamviewer Remote Access. VNC allows a user with VNC client installed to control the machine with VNC Server installed. Here are some commands listed below that are highly useful in VNC . Enjoy !! + +#### Additional Commands : #### + +- To stop VNC service . + + # systemctl stop vncserver@:1.service + +- To disable VNC service from startup. + + # systemctl disable vncserver@:1.service + +- To stop firewall. + + # systemctl stop firewalld.service + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-configure-vnc-server-centos-7-0/ + +作者:[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://en.wikipedia.org/wiki/Virtual_Network_Computing +[2]:http://en.wikipedia.org/wiki/X_Window_System +[3]:http://www.tightvnc.com/ +[4]:https://www.realvnc.com/ \ No newline at end of file diff --git a/sources/tech/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md b/sources/tech/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md new file mode 100644 index 0000000000..4af1fc99cb --- /dev/null +++ b/sources/tech/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md @@ -0,0 +1,424 @@ +How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto +================================================================================ +### Introduction ### + +Millions of websites are powered by WordPress software and there’s a reason for that. WordPress is the most developer-friendly content management system out there, so you can essentially do anything you want with it. Unfortunately, every day some scary report about a major site being hacked or a sensitive database being compromised hits the web … and freaks everyone out. + +If you haven’t installed WordPress yet, check the following article. +On Debian based systems: + +- [How to install WordPress On Ubuntu][1] + +On RPM based systems: + +- [How to install wordpress On CentOS][2] + +Following on from my previous article [How To Secure WordPress Website][3] show you **checklist** allows you to secure your WordPress site with as little effort as possible. + +In this article, will describe to you through the installation of **wpscan** and serve as a guide on how to use wpscan to locate any known vulnerable plugins and themes that may make your site vulnerable to attack. Also, how to install and use **nmap** the free Security Scanner For Network Exploration & Hacking . And at the end we will show you the steps to use **nikto**. + +### WPScan to Test for Vulnerable Plugins and Themes in WordPress ### + +**WPScan** is a black box WordPress Security Scanner written in Ruby which attempts to find known security weaknesses within WordPress installations. Its intended use it to be for security professionals or WordPress administrators to asses the security posture of their WordPress installations. The code base is Open Source and licensed under the GPLv3. + +### Download and Install WPScan ### + +Before we get started with the installation, it is important to note that wpscan will not work on Windows systems, so you will need access to a Linux or OSX installation to proceed. If you only have access to a Windows system you can download Virtualbox and install any Linux distro you like as a Virtual Machine. + +WPScan is hosted on Github, so if it is not already installed we will need to install the git packages before we can continue. + + sudo apt-get install git + +Once git is installed, we need to install the dependencies for wpscan. + + sudo apt-get install libcurl4-gnutls-dev libopenssl-ruby libxml2 libxml2-dev libxslt1-dev ruby-dev ruby1.9.3 + +Now we need to clone the wpscan package from github. + + git clone https://github.com/wpscanteam/wpscan.git + +Now we can move to the newly created wpscan directory and install the necessary ruby gems through bundler. + + cd wpscan + sudo gem install bundler && bundle install --without test development + +Now that we have wpscan installed, we will walk through using the tool to search for potentially vulnerable files on our WordPress installation. Some of the most important aspects of wpscan are its ability to enumerate not only plugins and themes, but users and timthumb installations as well. WPScan can also perform bruteforce attacks against WordPress– but that is outside of the scope of this article. + +#### Update wpscan #### + + ruby wpscan.rb --update + +#### Enumerate Plugins #### + +To enumerate plugins, all we need to do is launch wpscan with the `--enumerate p` arguments like so. + + ruby wpscan.rb --url http(s)://www.yoursiteurl.com --enumerate p + +or to only display vulnerable plugins: + + ruby wpscan.rb --url http(s)://www.yoursiteurl.com --enumerate vp + +Some example output is posted below: + + | Name: akismet + | Location: http://********.com/wp-content/plugins/akismet/ + + | Name: audio-player + | Location: http://********.com/wp-content/plugins/audio-player/ + | + | * Title: Audio Player - player.swf playerID Parameter XSS + | * Reference: http://seclists.org/bugtraq/2013/Feb/35 + | * Reference: http://secunia.com/advisories/52083 + | * Reference: http://osvdb.org/89963 + | * Fixed in: 2.0.4.6 + + | Name: bbpress - v2.3.2 + | Location: http://********.com/wp-content/plugins/bbpress/ + | Readme: http://********.com/wp-content/plugins/bbpress/readme.txt + | + | * Title: BBPress - Multiple Script Malformed Input Path Disclosure + | * Reference: http://xforce.iss.net/xforce/xfdb/78244 + | * Reference: http://packetstormsecurity.com/files/116123/ + | * Reference: http://osvdb.org/86399 + | * Reference: http://www.exploit-db.com/exploits/22396/ + | + | * Title: BBPress - forum.php page Parameter SQL Injection + | * Reference: http://xforce.iss.net/xforce/xfdb/78244 + | * Reference: http://packetstormsecurity.com/files/116123/ + | * Reference: http://osvdb.org/86400 + | * Reference: http://www.exploit-db.com/exploits/22396/ + + | Name: contact + | Location: http://********.com/wp-content/plugins/contact/ + +#### Enumerate Themes #### + +Enumeration of themes works the same as enumeration of plugins, just with the `--enumerate t` argument. + + ruby wpscan.rb --url http(s)://www.host-name.com --enumerate t + +Or to only display vulnerable themes: + + ruby wpscan.rb --url http(s)://www.host-name.com --enumerate vt + +Sample output: + + | Name: path + | Location: http://********.com/wp-content/themes/path/ + | Style URL: http://********.com/wp-content/themes/path/style.css + | Description: + + | Name: pub + | Location: http://********.com/wp-content/themes/pub/ + | Style URL: http://********.com/wp-content/themes/pub/style.css + | Description: + + | Name: rockstar + | Location: http://********.com/wp-content/themes/rockstar/ + | Style URL: http://********.com/wp-content/themes/rockstar/style.css + | Description: + | + | * Title: WooThemes WooFramework Remote Unauthenticated Shortcode Execution + | * Reference: https://gist.github.com/2523147 + + | Name: twentyten + | Location: http://********.com/wp-content/themes/twentyten/ + | Style URL: http://********.com/wp-content/themes/twentyten/style.css + | Description: + +#### Enumerate Users #### + +WPScan can also be used to enumerate users with valid logins to the WordPress installation. This is usually performed by attackers in order to get a list of users in preparation for a bruteforce attack. + + ruby wpscan.rb --url http(s)://www.host-name.com --enumerate u + +#### Enumerate Timthumb Files #### + +The last function of wpscan we’ll discuss in this article is the ability to enumerate timthumb installations. In recent years, timthumb has become a very common target of attackers due to the numerous vulnerabilities found and posted to online forums, message lists, and advisory boards. Using wpscan to find vulnerable timthumb files is done with the following command. + + ruby wpscan.rb --url http(s)://www.host-name.com --enumerate tt + +### Nmap to Scan for Open Ports on your VPS ### + +**Nmap** is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics + +### Download and install nmap on Debian and Ubuntu ### + +To install nmap for Debian and Ubuntu Linux based server systems type the following apt-get command: + + sudo apt-get install nmap + +**Sample outputs:** + + Reading package lists... Done + Building dependency tree + Reading state information... Done + The following NEW packages will be installed: + nmap + 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. + Need to get 1,643 kB of archives. + After this operation, 6,913 kB of additional disk space will be used. + Get:1 http://mirrors.service.networklayer.com/ubuntu/ precise/main nmap amd64 5.21-1.1ubuntu1 [1,643 kB] + Fetched 1,643 kB in 0s (16.4 MB/s) + Selecting previously unselected package nmap. + (Reading database ... 56834 files and directories currently installed.) + Unpacking nmap (from .../nmap_5.21-1.1ubuntu1_amd64.deb) ... + Processing triggers for man-db ... + Setting up nmap (5.21-1.1ubuntu1) ... + +#### Examples #### + +To find the nmap version, enter: + + nmap -V + +OR + + nmap --version + +**Sample outputs:** + + Nmap version 5.21 ( http://nmap.org ) + +### Dowonlad and install nmap on Centos ### + +To install nmap on RHEL based Linux distributions, type the following yum command: + + yum install nmap + +**Sample outputs:** + + Loaded plugins: protectbase, rhnplugin, security + 0 packages excluded due to repository protections + Setting up Install Process + Resolving Dependencies + --> Running transaction check + ---> Package nmap.x86_64 2:5.51-2.el6 will be installed + --> Finished Dependency Resolution + + Dependencies Resolved + + ================================================================================ + Package Arch Version Repository Size + ================================================================================ + Installing: + nmap x86_64 2:5.51-2.el6 rhel-x86_64-server-6 2.8 M + + Transaction Summary + ================================================================================ + Install 1 Package(s) + + Total download size: 2.8 M + Installed size: 0 + Is this ok [y/N]: y + Downloading Packages: + nmap-5.51-2.el6.x86_64.rpm | 2.8 MB 00:00 + Running rpm_check_debug + Running Transaction Test + Transaction Test Succeeded + Running Transaction + Installing : 2:nmap-5.51-2.el6.x86_64 1/1 + Verifying : 2:nmap-5.51-2.el6.x86_64 1/1 + + Installed: + nmap.x86_64 2:5.51-2.el6 + + Complete! + +#### Examples #### + +To find the nmap version, enter: + + nmap --version + +**Sample outputs:** + + Nmap version 5.51 ( http://nmap.org ) + +#### Scan Ports with Nmap #### + +You can got a lot of information about your server or host using nmap and it let you to think like someone has malicious intent. + +For this reason, only test it on servers that you own or in situations where you’ve notified the owners. + +The nmap creators actually provide a test server located at: + + scanme.nmap.org + +Some commands may take a long while to complete: + +To scan an IP address or a host name (FQDN), run: + + nmap 192.168.1.1 + +Sample outputs: + +![Fig.01: nmap in action](http://s0.cyberciti.org/uploads/faq/2012/11/redhat-nmap-command-output.png) + +Scan for the host operating system: + + sudo nmap -O 192.168.1.1 + +pecify a range with “-” or “/24″ to scan a number of hosts at once: + + sudo nmap -PN xxx.xxx.xxx.xxx-yyy + +Scan a network range for available services: + + sudo nmap -sP network_address_range + +Scan without preforming a reverse DNS lookup on the IP address specified. This should speed up your results in most cases: + + sudo nmap -n remote_host + +Scan a specific port instead of all common ports: + + sudo nmap -p port_number remote_host + +Scan a network and find out which servers and devices are up and running + +This is known as host discovery or ping scan: + + nmap -sP 192.168.1.0/24 + +Sample outputs: + + Host 192.168.1.1 is up (0.00035s latency). + MAC Address: BC:AE:C5:C3:16:93 (Unknown) + Host 192.168.1.2 is up (0.0038s latency). + MAC Address: 74:44:01:40:57:FB (Unknown) + Host 192.168.1.5 is up. + Host nas03 (192.168.1.12) is up (0.0091s latency). + MAC Address: 00:11:32:11:15:FC (Synology Incorporated) + Nmap done: 256 IP addresses (4 hosts up) scanned in 2.80 second + +Understanding port configuration and how to discover what the attack vectors are on your server is only one step to securing your information and your VPS. + +### Nikto to Scan for vulnerabilities in your website ### + +[Nikto][4] Web-scanner is a open source web-server scanner which can be used to scan the web-servers for malicious programs and files. Nikto can be used to scan the outdated versions of programs too. Nikto will provide us a quick and easy scan to find out the dangerous files and programs in server, At the end of scan result with a log file. + +### Download and install Nikto on Linux server ### + +Perl is pre-installed in linux so all you need to do is download nikto from the [project page][5], unpack it into a directory and start your testing. + + wget https://cirt.net/nikto/nikto-2.1.4.tar.gz + +You can unpack it with an archive manager tool or use tar and gzip together with this command. + + tar zxvf nikto-2.1.4.tar.gz + cd nikto-2.1.4 + perl nikto.pl + +This should be your results from a working installation: + + - ***** SSL support not available (see docs for SSL install) ***** + - Nikto v2.1.4 + --------------------------------------------------------------------------- + + ERROR: No host specified + + -config+ Use this config file + -Cgidirs+ scan these CGI dirs: 'none', 'all', or values like "/cgi/ /cgi-a/" + -dbcheck check database and other key files for syntax errors + -Display+ Turn on/off display outputs + -evasion+ ids evasion technique + -Format+ save file (-o) format + -host+ target host + -Help Extended help information + -id+ Host authentication to use, format is id:pass or id:pass:realm + -list-plugins List all available plugins + -mutate+ Guess additional file names + -mutate-options+ Provide extra information for mutations + -output+ Write output to this file + -nocache Disables the URI cache + -nossl Disables using SSL + -no404 Disables 404 checks + -port+ Port to use (default 80) + -Plugins+ List of plugins to run (default: ALL) + -root+ Prepend root value to all requests, format is /directory + -ssl Force ssl mode on port + -Single Single request mode + -timeout+ Timeout (default 2 seconds) + -Tuning+ Scan tuning + -update Update databases and plugins from CIRT.net + -vhost+ Virtual host (for Host header) + -Version Print plugin and database versions + + requires a value + + Note: This is the short help output. Use -H for full help. + +The error is merely telling us we did not fill in the necessary parameters for a test to run. The SSL support can be enabled by installing the necessary perl ssl module (sudo apt-get install libnet-ssleay-perl). + +#### Update the nikto Database #### + +Before performing any scan we need to update the nikto database packages using. + + /usr/local/bin/nikto.pl -update + +To list the available Plugins for nikto we can use the below command. + + nikto.pl -list-plugins // To list the installed plugins // + +#### Scan for vulnerabilities #### + +For a simple test for we will use test a single url. + + perl nikto.pl -h http://www.host-name.com + +**Sample outputs:** + +This will produce fairly verbose output that may be somewhat confusing at first. Take the time to read through the output to understand what each advisory means. Many of the alerts in Nikto will refer to OSVDB numbers. These are Open Source Vulnerability Database ([http://osvdb.org/][6]) designations. You can search on OSVDB for further information about any vulnerabilities identified. + + $ nikto -h http://www.host-name.com + - Nikto v2.1.4 + --------------------------------------------------------------------------- + + Target IP: 1.2.3.4 + + Target Hostname: host-name.com + + Target Port: 80 + + Start Time: 2012-08-11 14:27:31 + --------------------------------------------------------------------------- + + Server: Apache/2.2.22 (FreeBSD) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 + + robots.txt contains 4 entries which should be manually viewed. + + mod_ssl/2.2.22 appears to be outdated (current is at least 2.8.31) (may depend on server version) + + ETag header found on server, inode: 5918348, size: 121, mtime: 0x48fc943691040 + + mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 - mod_ssl 2.8.7 and lower are vulnerable to a remote buffer overflow which may allow a remote shell (difficult to exploit). CVE-2002-0082, OSVDB-756. + + Allowed HTTP Methods: GET, HEAD, POST, OPTIONS, TRACE + + OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST + + /lists/admin/: PHPList pre 2.6.4 contains a number of vulnerabilities including remote administrative access, harvesting user info and more. Default login to admin interface is admin/phplist + + OSVDB-2322: /gallery/search.php?searchstring=: Gallery 1.3.4 and below is vulnerable to Cross Site Scripting (XSS). Upgrade to the latest version. http://www.securityfocus.com/bid/8288. + + OSVDB-7022: /calendar.php?year=&month=03&day=05: DCP-Portal v5.3.1 is vulnerable to Cross Site Scripting (XSS). http://www.cert.org/advisories/CA-2000-02.html. + + OSVDB-3233: /phpinfo.php: Contains PHP configuration information + + OSVDB-3092: /system/: This might be interesting... + + OSVDB-3092: /template/: This may be interesting as the directory may hold sensitive files or reveal system information. + + OSVDB-3092: /updates/: This might be interesting... + + OSVDB-3092: /README: README file found. + + 6448 items checked: 1 error(s) and 14 item(s) reported on remote host + + End Time: 2012-08-11 15:52:57 (5126 seconds) + --------------------------------------------------------------------------- + + 1 host(s) tested + $ + +**Nikto** is an extremely lightweight, and versatile tool. Because of the fact that Nikto is written in Perl it can be run on almost any host operating system. + +Hope this will will bring you a good idea to scan vulnerbalites for your wordpress website. Following on from my previous article [How To Secure WordPress Website][7] show you **checklist** allows you to secure your WordPress site with as little effort as possible. + +If you have any feedback or comments, feel free to post them in the comment section below. + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/scan-check-wordpress-website-security-using-wpscan-nmap-nikto/ + +作者:[anismaj][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/anis/ +[1]:http://www.unixmen.com/install-wordpress-ubuntu-14-10/ +[2]:http://www.unixmen.com/install-configure-wordpress-4-0-benny-centos-7/ +[3]:http://www.unixmen.com/secure-wordpress-website/ +[4]:http://www.unixmen.com/install-nikto-web-scanner-check-vulnerabilities +[5]:https://cirt.net/nikto/ +[6]:http://osvdb.org/ +[7]:http://www.unixmen.com/secure-wordpress-website/ \ No newline at end of file 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 new file mode 100644 index 0000000000..b5bbc69a3b --- /dev/null +++ b/sources/tech/20150205 How To Use Smartphones Like Weather Conky In Linux.md @@ -0,0 +1,84 @@ +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) + +Smartphones have those sleek weather widgets that blend in to the display. Thanks to Flair Weather Conky, you can get **smartphone like weather display on your Linux desktop**. We will be using a GUI tool [Conky Manager to easily manage Conky in Linux][1]. Let’s first see how to install Conky Manager in Ubuntu 14.10, 14.04, Linux Mint 17 and other Linux distributions. + +### Install Conky Manager ### + +Open a terminal and use the following commands: + + sudo add-apt-repository ppa:teejee2008/ppa + sudo apt-get update + sudo apt-get install conky-manager + +You can read this article on [how to use Conky Manager in Linux][1]. + +### Make sure curl is installed ### + +Do make sure that [curl][2] is installed. Use the following command: + + sudo apt-get install curl + +### Download Flair Weather Conky ### + +Get the Flair Weather Conky script from the link below: + +- [Download Flair Weather Conky Script][3] + +### Using Flair Weather Conky script in Conky Manager ### + +#### Step 1: #### + +Same as you install themes in Ubuntu 14.04, you should have a .conky directory in your Home folder. If you use command line, I don’t need to tell you how to find that. For beginners, go to your Home directory from File manager and press Ctrl+H to [show hidden files in Ubuntu][4]. Look for .conky folder here. If there is no such folder, make one. + +#### Step 2: #### + +In the .conky directory, extract the downloaded Flair Weather file. Do note that by default it is extracted to .conky directory itself. So go in this directory and get the Flair Weather folder out of it and paste it to actual .conky directory. + +#### Step 3: #### + +Flair Weather uses Yahoo and it doesn’t recognize your location automatically. You’ll need to manually edit it. Go to [Yahoo Weather][5] and get the location of id of your city by typing your city/pin code. You can get the location id from the URL. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Yahoo_Weather_Location_Code.jpeg) + +#### Step 4: #### + +Open Conky Manager. It should be able to read the newly installed Conky script. There are two variants, dark and light, available. You can choose whichever you prefer. You can should see the conky displayed on the desktop as soon as you select it. + +Default location in Flair Weather is set to Melbourne. You’ll have to manually edit the conky. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Using_Weather_Conky_Ubuntu.jpeg) + +#### Step 5: #### + +In the screenshot above, you can see the option to edit the selected conky. In the editor opened, look for location or WOEID. Change it with the location code you got in step 3. Now restart the Conky. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Edit_Conky.jpeg) + +In the same place, if you replace C by F, the unit of temperature will be changed to Fahrenheit from Celsius. Don’t forget to restart the Conky to see the changes made. + +#### Give it a try #### + +In this article we actually learned quite few things. We saw how we can use any Conky script easily, how to edit the scripts and how to use Conky Manager for various purposes. I hope you find it useful. + +A word of caution, Ubuntu 14.10 users might see overlapped time numerals. Please make the developer ware of any such issues. + +I have already shown you the screenshot of how the Flair Weather conky looked in my system. Time for you to try this and flaunt your desktop. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/weather-conky-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/conky-gui-ubuntu-1304/ +[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 diff --git a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md new file mode 100644 index 0000000000..ca909934fa --- /dev/null +++ b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md @@ -0,0 +1,113 @@ +Install Strongswan - A Tool to Setup IPsec Based VPN in Linux +================================================================================ +IPsec is a standard which provides the security at network layer. It consist of authentication header (AH) and encapsulating security payload (ESP) components. AH provides the packet Integrity and confidentiality is provided by ESP component . IPsec ensures the following security features at network layer. + +- Confidentiality +- Integrity of packet +- Source Non. Repudiation +- Replay attack protection + +[Strongswan][1] is an open source implementation of IPsec protocol and Strongswan stands for Strong Secure WAN (StrongS/WAN). It supports the both version of automatic keying exchange in IPsec VPN (Internet keying Exchange (IKE) V1 & V2). + +Strongswan basically provides the automatic keying sharing between two nodes/gateway of the VPN and after that it uses the Linux Kernel implementation of IPsec (AH & ESP). Key shared using IKE mechanism is further used in the ESP for the encryption of data. In IKE phase, strongswan uses the encryption algorithms (AES,SHA etc) of OpenSSL and other crypto libraries. However, ESP component of IPsec uses the security algorithm which are implemented in the Linux Kernel. The main features of Strongswan are given below. + +- 509 certificates or pre-shared keys based Authentication +- Support of IKEv1 and IKEv2 key exchange protocols +- Optional built-in integrity and crypto tests for plugins and libraries +- Support of elliptic curve DH groups and ECDSA certificates +- Storage of RSA private keys and certificates on a smartcard. + +It can be used in the client / server (road warrior) and gateway to gateway scenarios. + +### How to Install ### + +Almost all Linux distro’s, supports the binary package of Strongswan. In this tutorial, we will install the strongswan from binary package and also the compilation of strongswan source code with desirable features. + +### Using binary package ### + +Strongswan can be installed using following command on Ubuntu 14.04 LTS . + + $sudo aptitude install strongswan + +![Installation of strongswan](http://blog.linoxide.com/wp-content/uploads/2014/12/strongswan-binary.png) + +The global configuration (strongswan.conf) file and ipsec configuration (ipsec.conf/ipsec.secrets) files of strongswan are under /etc/ directory. + +### Pre-requisite for strongswan source compilation & installation ### + +- GMP (Mathematical/Precision Library used by strongswan) +- OpenSSL (Crypto Algorithms from this library) +- PKCS (1,7,8,11,12)(Certificate encoding and smart card integration with Strongswan ) + +#### Procedure #### + +**1)** Go to /usr/src/ directory using following command in the terminal. + + $cd /usr/src + +**2)** Download the source code from strongswan site suing following command + + $sudo wget http://download.strongswan.org/strongswan-5.2.1.tar.gz + +(strongswan-5.2.1.tar.gz is the latest version.) + +![Downloading software](http://blog.linoxide.com/wp-content/uploads/2014/12/download_strongswan.png) + +**3)** Extract the downloaded software and go inside it using following command. + + $sudo tar –xvzf strongswan-5.2.1.tar.gz; cd strongswan-5.2.1 + +**4)** Configure the strongswan as per desired options using configure command. + + ./configure --prefix=/usr/local -–enable-pkcs11 -–enable-openssl + +![checking packages for strongswan](http://blog.linoxide.com/wp-content/uploads/2014/12/strongswan-configure.png) + +If GMP library is not installed, then configure script will generate following error. + +![GMP library error](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-error.png) + +Therefore, first of all, install the GMP library using following command and then run the configure script. + +![gmp installation](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-installation1.png) + +However, if GMP is already installed and still above error exists then create soft link of libgmp.so library at /usr/lib , /lib/, /usr/lib/x86_64-linux-gnu/ paths in Ubuntu using following command. + + $ sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10.1.3 /usr/lib/x86_64-linux-gnu/libgmp.so + +![softlink of libgmp.so library](http://blog.linoxide.com/wp-content/uploads/2014/12/softlink.png) + +After the creation of libgmp.so softlink, again run the ./configure script and it may find the gmp library. However, it may generate another error of gmp header file which is shown the following figure. + +![GMP header file issu](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-header.png) + +Install the libgmp-dev package using following command for the solution of above error. + + $sudo aptitude install libgmp-dev + +![Installation of Development library of GMP](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-dev.png) + +After installation of development package of gmp library, again run the configure script and if it does not produce any error, then the following output will be displayed. + +![Output of Configure scirpt](http://blog.linoxide.com/wp-content/uploads/2014/12/successful-run.png) + +Type the following commands for the compilation and installation of strongswan. + + $ sudo make ; sudo make install + +After the installation of strongswan , the Global configuration (strongswan.conf) and ipsec policy/secret configuration files (ipsec.conf/ipsec.secretes) are placed in **/usr/local/etc** directory. + +Strongswan can be used as tunnel or transport mode depends on our security need. It provides well known site-2-site and road warrior VPNs. It can be use easily with Cisco,Juniper devices. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/security/install-strongswan/ + +作者:[nido][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/naveeda/ +[1]:https://www.strongswan.org/ \ No newline at end of file diff --git a/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md b/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md new file mode 100644 index 0000000000..efdc243fc6 --- /dev/null +++ b/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md @@ -0,0 +1,171 @@ +Inxi: Find System And Hardware Information On Linux +================================================================================ +We already have shown different [applications][1] and ways to find the system and hardware information on Linux. In that series, today we will see how to find such details using **inxi**. It can be used for forum technical support, as a debugging tool, to quickly ascertain user system configuration and hardware. + +**Inxi** is a command line tool that can be used to find the complete system and hardware details such as; + +- Hardware, +- CPU, +- Drivers, +- Xorg, +- Desktop, +- Kernel, +- GCC version, +- Processes, +- RAM usage, +- and other useful information. + +### Installation ### + +Inxi is available in the default repositories of most modern GNU/Linux operating systems. So, we can simply install it by running the following commands. + +**On Debian based system:** + + sudo apt-get install inxi + +**On Fedora:** + + sudo yum install inxi + +**On RHEL based systems:** + +Install EPEL repository: + + sudo yum install epel-release + +Then, install inxi using command: + + sudo yum install inxi + +### Usage ### + +To find the quick view of the system information, run the following command from Terminal. + + inxi + +**Sample output:** + + CPU~Dual core Intel Core i3-2350M CPU (-HT-MCP-) clocked at Min:800.000Mhz Max:1200.000Mhz Kernel~3.13.0-45-generic x86_64 Up~6:41 Mem~1537.7/3861.3MB HDD~500.1GB(52.5% used) Procs~183 Client~Shell inxi~1.9.17 + +Ofcourse, we can retrieve a particular hardware details. For example to retrieve the **Audio/Sound hardware details**, run the following command: + + inxi -A + +**Sample output:** + + Audio: Card: Intel 6 Series/C200 Series Family High Definition Audio Controller driver: snd_hda_intel + Sound: Advanced Linux Sound Architecture ver: k3.13.0-45-generic + +Cool, isn’t it? + +Likewise, you can retrieve the details of **Graphic card** information. + + inxi -G + +**Sample output:** + + Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller + X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz + GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 10.3.0 + +What about harddisk information? That’s also possible. To view the full **harddisk** information, run the following command. + + inxi -D + +**Sample Output:** + + Drives: HDD Total Size: 500.1GB (52.5% used) 1: id: /dev/sda model: ST9601325BD size: 500.1GB + +To display the Bios and Motherboard details: + + inxi -M + +**Sample output:** + + Machine: System: Dell (portable) product: Inspiron N5050 + Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 + +Not only hardware details, it can also displays the **list of available repositories** in our system. + + inxi -r + +**Sample output:** + + Repos: Active apt sources in file: /etc/apt/sources.list + deb http://ubuntu.excellmedia.net/archive/ trusty main restricted + deb-src http://ubuntu.excellmedia.net/archive/ trusty main restricted + deb http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted + deb-src http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted + deb http://ubuntu.excellmedia.net/archive/ trusty universe + . + . + Active apt sources in file: /etc/apt/sources.list.d/intellinuxgraphics.list + deb https://download.01.org/gfx/ubuntu/14.04/main trusty main #Intel Graphics drivers + Active apt sources in file: /etc/apt/sources.list.d/linrunner-tlp-trusty.list + Active apt sources in file: /etc/apt/sources.list.d/wseverin-ppa-trusty.list + deb http://ppa.launchpad.net/wseverin/ppa/ubuntu trusty main + +Inxi will also display the Weather details of your location. Surprised? Yes, It should. + + inxi -W Erode,Tamilnadu + +Here **Erode** is the District and **Tamilnadu** is a state in India. + +Sample output: + + Weather: Conditions: 79 F (26 C) - Clear Time: February 4, 6:00 PM IST + +### Viewing Complete Hardware details ### + +Tired of finding each hardware details? Well, you can list all details at once using command: + + inxi -F + +**Sample output:** + + System: Host: sk Kernel: 3.13.0-45-generic x86_64 (64 bit) Desktop: LXDE (Openbox 3.5.2) Distro: Ubuntu 14.04 trusty + Machine: System: Dell (portable) product: Inspiron N5050 + Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 + CPU: Dual core Intel Core i3-2350M CPU (-HT-MCP-) cache: 3072 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) + Clock Speeds: 1: 800.00 MHz 2: 1000.00 MHz 3: 800.00 MHz 4: 800.00 MHz + Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller + X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz + GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 10.3.0 + Audio: Card: Intel 6 Series/C200 Series Family High Definition Audio Controller driver: snd_hda_intel + Sound: Advanced Linux Sound Architecture ver: k3.13.0-45-generic + Network: Card-1: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) driver: ath9k + IF: wlan0 state: up mac: + Card-2: Realtek RTL8101E/RTL8102E PCI Express Fast Ethernet controller driver: r8169 + IF: eth0 state: down mac: + Drives: HDD Total Size: 500.1GB (52.5% used) 1: id: /dev/sda model: ST9500325AS size: 500.1GB + Partition: ID: / size: 455G used: 245G (57%) fs: ext4 ID: /boot size: 236M used: 159M (72%) fs: ext2 + ID: swap-1 size: 4.19GB used: 0.00GB (0%) fs: swap + RAID: No RAID devices detected - /proc/mdstat and md_mod kernel raid module present + Sensors: System Temperatures: cpu: 64.5C mobo: N/A + Fan Speeds (in rpm): cpu: N/A + Info: Processes: 186 Uptime: 6:52 Memory: 1547.2/3861.3MB Client: Shell (bash) inxi: 1.9.17 + +As you see in the above, inxi displays the complete hardware details. + +For more details, refer the man pages. + + man inxi + +### Conclusion ### + +Are you searching for a simple tool which displays your complete system and hardware details? Then, don’t look anywhere, inxi will give you what actually want. And, it is light weight tool available in your default repositories. What else you want more? Give it a try, you won’t be disappointed. + +Cheers! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/inxi-find-system-hardware-information-linux/ + +作者:[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/screenfetch-bash-screenshot-information-tool/ \ No newline at end of file diff --git a/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md b/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md new file mode 100644 index 0000000000..62eee8521c --- /dev/null +++ b/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md @@ -0,0 +1,63 @@ +zBackup – A versatile deduplicating backup tool +================================================================================ +zbackup is a globally-deduplicating backup tool, based on the ideas found in rsync. Feed a large .tar into it, and it will store duplicate regions of it only once, then compress and optionally encrypt the result. Feed another .tar file, and it will also re-use any data found in any previous backups. This way only new changes are stored, and as long as the files are not very different, the amount of storage required is very low. Any of the backup files stored previously can be read back in full at any time. + +### zBackup Features ### + +Parallel LZMA or LZO compression of the stored data +Built-in AES encryption of the stored data +Possibility to delete old backup data +Use of a 64-bit rolling hash, keeping the amount of soft collisions to zero +Repository consists of immutable files. No existing files are ever modified +Written in C++ only with only modest library dependencies +Safe to use in production +Possibility to exchange data between repos without recompression + +### Install zBackup in ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install zbackup + +### Using zBackup ### + +zbackup init initializes a backup repository for the backup files to be stored. + + zbackup init [--non-encrypted] [--password-file ~/.my_backup_password ] /my/backup/repo + +zbackup backup backups a tar file generated by tar c to the repository initialized using zbackup init + + zbackup [--password-file ~/.my_backup_password ] [--threads number_of_threads ] backup /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` + +zbackup restore restores the backup file to a tar file. + + zbackup [--password-file ~/.my_backup_password [--cache-size cache_size_in_mb restore /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` > /my/precious/backup-restored.tar + +### Available Options ### + +- -non-encrypted -- Do not encrypt the backup repository. +- --password-file ~/.my_backup_password -- Use the password file specified at ~/.my_backup_password to encrypt the repository and backup file, or to decrypt the backup file. +- --threads number_of_threads -- Limit the partial LZMA compression to number_of_threads needed. Recommended for 32-bit architectures. +- --cache-size cache_size_in_mb -- Use the cache size provided by cache_size_in_mb to speed up the restoration process. + +### zBackup files ### + +~/.my_backup_password Used to encrypt the repository and backup file, or to decrypt the backup file. See zbackup for further details. + +/my/backup/repo The directory used to hold the backup repository. + +/my/precious/restored-tar The tar used for restoring the backup. + +/my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` Specifies the backup file. + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/zbackup-a-versatile-deduplicating-backup-tool.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 \ No newline at end of file diff --git a/translated/share/20140821 What is a good EPUB reader on Linux.md b/translated/share/20140821 What is a good EPUB reader on Linux.md new file mode 100644 index 0000000000..2b919ee6bb --- /dev/null +++ b/translated/share/20140821 What is a good EPUB reader on Linux.md @@ -0,0 +1,67 @@ +Linux版EPUB阅读器 +================================================================================ + +如果说用平板电脑看书尚属主流的话,那么在电脑上读书就非常少见了。专注阅读16世纪的书是非常困难的了,没人希望后台蹦出Facebook聊天窗口。但是如果你非要在电脑上打开电子书的话,那么你需要一个电子书阅读软件。大多数编辑支持使用EPUB格式来存放电子书(电子出版物)。幸运的书,linux上从不缺乏此类软件。以下书一些Linux上比较好的EPUB阅读软件。 + +### 1. Calibre ### + +![](https://farm6.staticflickr.com/5577/14975176155_0989766bb3_z.jpg) + +先从列表中最有名的软件开始: [Calibre][1]。Calibre 不仅仅是个阅读器,他还是个电子图书馆。软件支持几乎所有的格式,集成了阅读器,管理器,一个可以从互联网下载书籍封面的元数据编辑器,一个EPUB编辑器,新闻阅读器和一个用来下载电子书的搜索引擎。可喜的是,界面丝毫不逊色专业的阅读软件。唯一的缺点书如果你只想要一个EPUB阅读器的话,这个软件还是太大了。 + +### 2. FBReader ### + +![](https://farm4.staticflickr.com/3900/14975176165_f2e4afd2fa_o.jpg) + +[FBReader][2] 也是一个图书馆管理软件,但是比Calibre小。界面简洁分为两个部分:左边书文件管理、元数据编辑、和下载新书等功能;右边书阅读区。如果你喜欢简洁,这个软件挺不错。我个人非常喜欢这类直观标记书籍和分类的做法。 + +### 3. Cool Reader ### + +![](https://farm6.staticflickr.com/5594/14975176195_ac46952150.jpg) + +对于那些只想想看EPUB书内容的用户,我推荐 [Cool Reader][5]。遵循Linux应用程序的规则,Cool Reader 做了优化,每次只打开一个EPUB文件,可以使用简单的快捷键进行阅读和导航。由于程序书基于Qt开发的,所以他也遵循Qt的规则,需要大量的设置项。 + +### 4. Okular ### + +![](https://farm6.staticflickr.com/5559/14788504729_5a2ec2c11b_z.jpg) + +除了Qt应用程序,如果安装了EPUB库的话,KDE的文档阅读器[Okular][3] 也能打开EPUB文件。尽管如此,如果你不是个KDE用户的话,不推荐这个软件。 + +### 5. pPub ### + +![](https://farm4.staticflickr.com/3835/14788504789_e7c742fa20_z.jpg) + +[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阅读器了。 + +### 7. Sigil ### + +![](https://farm4.staticflickr.com/3921/14788640417_7940627871_z.jpg) + +最后介绍的这个实际上不是个EPUB阅读器,应该是个独立的编辑器。[Sigil][7] 可以提取EPUB文件的内容并转换成其他格式:xhtml文本,图像,格式,还有其他的内容,比如音频等。界面比基本的阅读器复杂,但是功能还是比较丰富的。我很喜欢他的标签体系,如果你对网页比较熟悉的话,这个软件书很好使用的。 + +总结,有很多的开源的EPUB阅读器,有一些只有最基本的功能, 另外一些功能却太多了。一般来说,我建议你选择一个最合适的使用。如果你有更好的EPUB阅读器,请在评论里告诉我们! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/08/good-epub-reader-linux.html + +作者:[Adrien Brochard][a] +译者:[shipsw](https://github.com/shipsw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://calibre-ebook.com/ +[2]:http://fbreader.org/ +[3]:http://okular.kde.org/ +[4]:https://github.com/sakisds/pPub +[5]:http://crengine.sourceforge.net/ +[6]:https://github.com/rupa/epub +[7]:https://github.com/user-none/Sigil diff --git a/translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md b/translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md index ccd9a474d5..9cb0a3765d 100644 --- a/translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md +++ b/translated/share/20141106 Flow' N Play Movie Player Has a Stylish Interface Ubuntu Installation.md @@ -1,12 +1,10 @@ -Translated by H-mudcup - -Flow 'N Play视频播放器有着独具风格的界面【Ubuntu上的安装】 +Flow 'N Play视频播放器有着独具风格的界面[在Ubuntu上安装] ================================================================================ -**Flow ‘N Play**是个用Qt编写的新视频播放器。它有着漂亮又简洁的只提供基本播放功能的界面。 +**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]是个比较新的视频播放器,它有着漂亮的界面和简单的操作(今年三月份第一次发行)。其中一个功能就是能通过拖动鼠标滑动视频列表。播放器带有基本功能,一个搜索功能,支持彩色主题。 打开一个新的视频——你还可以在同一个对话框下自定义一个封面: @@ -18,7 +16,7 @@ Flow 'N Play视频播放器有着独具风格的界面【Ubuntu上的安装】 Flow ‘N Play仍然处在早起开发中,因此相对于更高级的播放器它有一些瑕疵。可以设置的选项少,不支持加载字幕或视频和声音的过滤器。目前,在打开一个新的视频时偶尔会出错或是表现异常。 -我相信在它变得能替代其他播放器之前,会先添加几个功能。但从长远来看,Flow ‘N Play很有前途。 +我相信在它变成一款相当不错的播放器来替代其他播放器之前,还需要再添加几个功能。但从长远来看,Flow ‘N Play很有前途。 ### 在Ubuntu 14.04上安装Flow ‘N Play 0.922 ### @@ -28,11 +26,11 @@ Flow ‘N Play仍然处在早起开发中,因此相对于更高级的播放器 sudo apt-get install libqt5multimediaquick-p5 qtdeclarative5-controls-plugin qtdeclarative5 qtmultimedia-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-quicklayouts-plugin -Then download the DEB package and either double click it or change the working directory to the one where you saved it and type the following in a terminal (for 64-bit, replace the DEB file for 32-bit)然后下载DEB安装包,可以双击或在终端里把正操作的目录换到你保存安装包的目录下并输入以下命令(这个是64位的命令,对于32位的系统请将DEB文件换成32位的): +然后下载DEB安装包,可以双击或在终端里把正操作的目录换到你保存安装包的目录下并输入以下命令(这个是64位的命令,对于32位的系统请将DEB文件换成32位的): sudo dpkg -i flow-n-play_v0.926_qt-5.3.2_x64.deb -然后在终端里输入**flow-n-play**来运行它。注意:为防止产生依赖项错误,当你试图安装DEB问件事你可以运行**sudo apt-get -f install**,这样可以自动获取丢失的依赖项并安装Flow ‘N Play。 +然后在终端里输入**flow-n-play**来运行它。注意:为防止产生依赖项错误,当你试图安装DEB文件时,你可以运行**sudo apt-get -f install**,这样可以自动获取丢失的依赖项并安装Flow ‘N Play。 若用RUN脚本安装,先安装上边提到的依赖项,然后运行这个脚本: @@ -49,7 +47,7 @@ via: http://www.tuxarena.com/2014/11/flow-n-play-movie-player-has-a-stylish-inte 作者:Craciun Dan 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [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/translated/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md new file mode 100644 index 0000000000..339ef5f836 --- /dev/null +++ b/translated/share/20150112 Best GNOME Shell Themes For Ubuntu 14.04.md @@ -0,0 +1,123 @@ +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 中安装和应用新的主题。 + +### 在 GNOME Shell 中安装主题 ### + +要在带有 GNOME 桌面的 Ubuntu 中安装新的主题,你可以使用 Gnome Tweak Tool,它可以在 Ubuntu 软件库中得到。打开一个终端窗口并使用如下命令: + +``` +sudo apt-get install gnome-tweak-tool +``` + +或者,你可以使用新主题通过把它们放置到 `~/.themes` 目录中。如果你需要,我已经写了一个关于 [如何安装和使用 GNOME shell][2]的具体教程。 + +### 最好的 GNOME Shell 主题 ### + +下面列举的主题都已经在 GNOME Shell 3.10.4 上进行了测试,但对于任何版本的 GNOME 3 或更高的版本,它们应该同样适用。需要指出的是,这些主题并没有按照任何优先顺序排列。下面就让我们看看这些最好的 GNOME 主题: + +#### Numix #### + +![](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] 也不为过。 + +使用下面的命令,在基于 Ubuntu 的发行版本中安装 Numix 主题: + +``` +sudo apt-add-repository ppa:numix/ppa +sudo apt-get update +sudo apt-get install numix-icon-theme-circle +``` + +#### Elegance Colors #### + +![](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 的缩写) 使得你可以轻易地安装它: + +``` +sudo add-apt-repository ppa:satyajit-happy/themes +sudo apt-get update +sudo apt-get install gnome-shell-theme-elegance-colors +``` + +#### Moka #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Moka_GNOME_Shell.jpeg) + +[Moka][7] 是另一个迷人的主题,它总是位于美丽的主题的清单之中。它是由给我们带来 Unity Tweak Tool 的开发者所设计。 Moka 是你绝对要尝试的主题之一: + +``` +sudo add-apt-repository ppa:moka/stable +sudo apt-get update +sudo apt-get install moka-gnome-shell-theme +``` + +#### Viva #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Viva_GNOME_Theme.jpg) + +基于 GNOME 的默认主题 Adwaita, Viva 是一个带有黑色和橙色阴影的美丽主题。你可以从下面的链接中下载 Viva: + +- [Download Viva GNOME Shell Theme][8] + +#### Ciliora-Prima #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Ciliora_Prima_Gnome_Shell.jpeg) + +以前它以 Zukitwo Dark 的名字为人们熟知, Ciliora-Prima 是一个拥有方块图标的主题,可得到的三种版本之间相互略有不同。你可以从下面的链接中下载它们: + +- [Download Ciliora-Prima GNOME Shell Theme][9] + +#### Faience #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Faience_GNOME_Shell_Theme.jpeg) + +Faience 作为一个受欢迎的主题已经有一段时间了。你可以通过下面的 PPA 为 GNOME 3.10 及更高版本 安装 Faience: + +``` +sudo add-apt-repository ppa:tiheum/equinox +sudo apt-get update +sudo apt-get install faience-theme +``` + +#### Paper [不完善] #### + +![](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 拥有最好的体验。假如你和我一样,具有一点实验精神,你绝对可以试一试。 + +``` +sudo add-apt-repository ppa:snwh/pulp +sudo apt-get update +sudo apt-get install paper-gtk-theme +``` + +以上就是我的清单。假如你正试着给你的 Ubuntu 换一个不同的模样,你也应该试试这个清单: [Ubuntu 14.04 中最好的图标主题][10]。 + +你是怎样找到这份 **最好的 GNOME shell 主题** 清单的呢?在上面列举的主题中,哪个是你最中意的呢? 如果它没有在这里列出,请一定让我们知道那个你心目中最好的 GNOME shell 主题 。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/gnome-shell-themes-ubuntu-1404/ + +作者:[Abhishek][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者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/how-to-install-gnome-in-ubuntu-14-04/ +[2]:http://itsfoss.com/install-switch-themes-gnome-shell/ +[3]:https://numixproject.org/ +[4]:http://itsfoss.com/numix-linux-distribution/ +[5]:http://itsfoss.com/new-beautiful-linux-2015/ +[6]:http://satya164.deviantart.com/art/Gnome-Shell-Elegance-Colors-305966388 +[7]:http://mokaproject.com/ +[8]:https://github.com/vivaeltopo/gnome-shell-theme-viva +[9]:http://zagortenay333.deviantart.com/art/Ciliora-Prima-Shell-451947568 +[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ diff --git a/translated/share/20150115 How To Run Linux Applications From The Terminal In Background Mode.md b/translated/share/20150115 How To Run Linux Applications From The Terminal In Background Mode.md index b0f4731e18..9c6f853a30 100644 --- a/translated/share/20150115 How To Run Linux Applications From The Terminal In Background Mode.md +++ b/translated/share/20150115 How To Run Linux Applications From The Terminal In Background Mode.md @@ -5,7 +5,7 @@ 这是一个篇幅不长但是十分有用的教程,可以帮助你在终端启动一个Linux应用程序,并且使终端窗口不会丢失焦点。 -我们有很多方法可以在Linux系统中打开一个终端窗口,这取决与你的选择以及你的桌面环境。 +我们有很多可以在Linux系统中打开一个终端窗口的方法,这取决于你的选择以及你的桌面环境。 如果是使用Ubuntu的话,你可以利用CTRL+ALT+T组合键打开终端。当然你也可以使用超级键(Windows键)[打开Dash][1],搜索“TERM”,然后点击“Term”图标来打开终端窗口。 @@ -19,13 +19,13 @@ firefox -search "linux.cn" -你可能会注意到,当你启动Firefox的时候,如果程序打开以后,焦点重新会到终端窗口的话,你就可以继续在终端进行工作。 +你可能会注意到,如果你启动Firefox,程序打开以后,回到了终端窗口控制,这就意味着你可以继续在终端进行工作。 -通常情况下,如果你在终端启动了应用程序,焦点会切换到新启动的应用程序,只有程序被关闭以后焦点才会重新切换到终端。这是因为你在前台启动了这个程序。 +通常情况下,如果你在终端启动了应用程序,控制会切换到新启动的应用程序,只有程序被关闭以后才会重新切换到终端控制。这是因为你在前台启动了这个程序。 -如果要实现焦点仍然保持在终端窗口的目的,那么你需要将应用程序启动为后台进程。 +如果要在Linux终端打开应用程序并且返回终端控制,那么你需要将应用程序启动为后台进程。 -向下面所列的命令一样,我们可以通过增加一个(&)符号,将应用程序在后台启动。 +和下面所列的命令一样,我们可以通过增加一个(&)符号,将应用程序在后台启动。 libreoffice & @@ -61,15 +61,15 @@ sudo find / -name firefox | more -如果你知道你要查找的文件在你的当前目录及其子目录中,那么你可以使用点来代替斜杠: +如果你知道你要查找的文件在你的当前目录结构中,那么你可以使用点来代替斜杠: sudo find . -name firefox | more -你可能需要sudo来提升权限,也可能根本就不需要,如果这个文件在你的跟目录里面,那么就不需要使用sudo。 +你可能需要sudo来提升权限,也可能根本就不需要,如果这个文件在你的主目录里面,那么就不需要使用sudo。 -有些应用程序则必须要提升权限才能运行,否则你就会得到一大堆拒绝访问错误,除非你使用一个具有权限的用户,或者使用sudo提升权限。 +有些应用程序则必须要提升权限才能运行,否则你就会得到一大堆拒绝访问错误,除非你使用一个具有权限的用户或者使用sudo提升权限。 -这里有个小窍门。如果你运行了一个程序,但是它报了权限错误以后,输入下面命令试试: +这里有个小窍门。如果你运行了一个程序,但是它需要提升权限来操作,输入下面命令试试: sudo !! @@ -77,7 +77,7 @@ via : http://linux.about.com/od/commands/fl/How-To-Run-Linux-Programs-From-The-T 作者:[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/) 荣誉推出 @@ -87,4 +87,4 @@ via : http://linux.about.com/od/commands/fl/How-To-Run-Linux-Programs-From-The-T [3]:http://linux.about.com/od/commands/l/blcmdl1_locate.htm [4]:http://linux.about.com/library/cmd/blcmdl1_less.htm [5]:http://linux.about.com/library/cmd/blcmdl1_more.htm -[6]:http://linux.about.com/od/commands/l/blcmdl8_sudo.htm \ No newline at end of file +[6]:http://linux.about.com/od/commands/l/blcmdl8_sudo.htm diff --git a/translated/talk/20141203 Docker--Present and Future.md b/translated/talk/20141203 Docker--Present and Future.md deleted file mode 100644 index da2b1b7b48..0000000000 --- a/translated/talk/20141203 Docker--Present and Future.md +++ /dev/null @@ -1,168 +0,0 @@ -Docker的现状与未来 -================================================================================ - -### Docker - 故事渊源流长 ### - -Docker是一个专为Linux容器而设计的工具集,用于‘构建,交付和运行’分布式应用。它最初是通过DotCloud作为一个开源项目在2013年3月的时候发布的。这个项目越来越受欢迎,这使得DotCloud更名为Docker公司(并最终 [出售了原有的PaaS业务][1]).[Docker 1.0][2]是在2014年6月发布的,而且延续了之前每月更新一个版本的习惯。 - - -1.0版本的发布标志着Docker公司认为这个平台的充分成熟已经足以用于生产环境中(由本公司与合作伙伴提供付费支持选项).每个月发布的更新显示,该项目正在迅速发展,增添一些新特性、解决一些他们发现的问题。然而该项目已经成功地从‘运行’和‘交付’实现分离,所以任何版本的Docker镜像源都可以与其它版本共同使用(具备向前和向后兼容的特性),这为Docker使用的快速变化提供了稳定的保障。 - -Docker之所以能够成为最受欢迎的开源项目之一除了很多人会认为是的炒作成分,也是由坚实的物质基础奠定的。Docker的影响力已经得到整个行业许多品牌的支持,包括亚马逊, Canonical公司, 世纪互联, 谷歌, IBM, 微软, New Relic, Pivotal, 红帽和VMware. 这使只要Linux可使用的地方,Docker的使用便无处不在。除了这些鼎鼎有名的大公司以外,许多初创公司也在围绕着Docker在成长,或者改变他们的发展方向来与Docker更好地结合起来。这些合作关系(无论大于小)都将帮助推动Docker核心项目及其周边生态环境的快速发展。 - - -### Docker技术的简要综述 ### - -Docker利用Linux的一些内核工具例如[cGroups][3],命名空间和[SElinux][4]来实现容器之间的隔离。起初Docker只是[LXC][5]容器管理器子系统的前端,但是在0.9版本中引入了[libcontainer][6],这是原生go语言库用于提供用户空间和内核之间的接口。 - -容器位于联合文件系统的顶部,例如[AUFS][7],它允许跨多个容器共享例如操作系统镜和安装相关库的组件。在文件系统中的分层方法也利用[ Dockerfile ] [8]中的DevOps工具,这些工具能够成功地完成高速缓存的操作。利用等待时间来安装操作系统和相关应用程序依赖包将会极大地加速测试周期。容器之间的共享库也能够减少内存的占用。 - -一个容器是从一个镜像开始运行的,它可以本地创建,本地缓存,或者通过注册表来下载。Docker公司经营的 [Docker 公有注册库][9],这为各种操作系统、中间件和数据库提供了主机官方仓库。组织和个人可以在docker公司的为镜像创建公有库,并且也有举办私人仓库的订阅服务。由于上传的镜像会包含几乎所有Docker提供的自动化构建工具(以往称为“受信任的构建”),它的镜像是从Dockerfile创建的,而Dockerfile是镜像内容的清单。 - -### 容器 vs 虚拟机 ### - -容器会比虚拟机更高效,因为它们能够分享一个内核和分享共享应用程序库。相比虚拟机系统,这也将使得Docker使用的内存空间很小,即使虚拟机利用了内存超量使用的技术。部署容器时共享底层的镜像层也可以减少内存的占用。IBM的Boden Russel已经做了一些[基准测试][10]说明两者的不同。 - -相比虚拟机系统,容器呈现出较低系统开销的优势,所以在容器中,应用程序的运行效率将会等效于在同样的应用程序在虚拟机中运行甚至效果更佳。IBM的一个研究团队已经发表了一本名为[虚拟机与Linux容器的性能比较]的文章[11]. - - -容器在隔离特性上要比虚拟机逊色。虚拟机可以利用ring-1[硬件隔离][12]例如Intel的VT-d和VT-x技术。这种隔离可以防止虚拟机爆发和彼此交互。而容器至今还没有任何形式的硬件隔离,这使它容易受到攻击。一个命名为[Shocker][13]的概念攻击验证表明,在之前的1.0版本中Docker是存在这种脆弱性的。尽管Docker1.0修复了许多由于Shocker漏洞引发较为的严重问题,Docker的CTO Solomon Hykes仍然[表态][14],“当我们自然而然地说Docker的开箱即用是安全的,即便包含了不收信任的uid0程序,我们将会很明确地这样表述。”Hykes的声明承认,其它的漏洞及相关的风险依旧存在,所以在容器成为受信任的工具之前将有更多的工作需要被完成。 - -对于许多用户案例而言,在容器和虚拟机两者之间选择一种是一种错误的二分法。Docker同样可以在虚拟机中很好工作,它可以被用于现有的虚拟基础措施、私有云或者公有云。同样也可以在容器里跑虚拟机,这也是谷歌使用云平台的一部分。给予一个广泛可利用的基础设施例如IaaS服务,可以为虚拟机提供合理的预期需求,这个合理的预期即容器与虚拟机一起使用的情景将会在数年后出现。容器管理和虚拟机技术有可能被集成到一起提供一个两全其美的方案;所以,位于libcontainer 容器后面的硬件信任锚微虚拟化实施例,可与前端 Docker 工具链和生态系统整合,而不同于后端使用的是能够提供更好绝缘性。微虚拟化(例如Bromium的[vSentry][15]和VMware的 [Project Fargo][16])已经在桌面环境中使用以提供应用程序之间基于硬件的隔离,所以类似的方法可以用于连接libcontainer代替Linux内核中的容器机制。 - -### ‘Dockerizing’ 应用程序 ### - -几乎所有Linux应用程序都可以在Docker容器中运行。它们不受任何语言的选择或框架的限制。唯一在实践中受限的是从操作系统的角度来允许容器做什么。即使如此,bar可以在特权模式下通过运行容器,从而大大减少了控制(并相应地增加了容器中的应用程序,这将会导致损坏主机操作系统存在的风险)。 - - -容器都是从镜像开始运行的,而镜像也可以从运行中的容器获取。通常使用2中方法从容器中获取应用程序,分别是手动获取和Dockerfile.. - -#### 手动构建 #### - -手动构建首先通过基础操作系统镜像启动一个基本操作。交互式的终端可以安装应用程序和用于包管理的依赖项来选择所需要的Linux风格。Zef Hemel在‘[使用Linux容器来支持便携式应用程序部署][17]’的文章中讲述了他部署的过程。一旦应用程序被安装之后,容器可以被推送至注册中心(例如Docker Hub)或者导出一个tar文件。 - -#### Dockerfile #### - -Dockerfile是一个用于构建Docker容器的脚本化系统。每一个Dockerfile定义了开始的基础镜像,从一系列的命令在容器中运行或者一些列的文件被添加到容器中。当容器启动时默认命令会在启动时被执行,Dockerfile也可以指定对外的端口和当前工作目录。容器类似手工构建一样可以通过可推送或导出的Dockerfiles来构建。Dockerfiles也可以被用于Docker Hub的自动构建系统,使用的镜像受Docker公司的控制并且该镜像源代码是任何人可视的。 - - -####仅仅一个进程? #### - -无论镜像是手动构建还是通过Dockerfile构建,有一个关键的考虑因素是当容器启动时,只有一个进程进程被启动。对于一个容器一对一服务的目的,例如运行一个应用服务器,运行一个单一的进程不是一个问题(有些关于容器应该只有一个单独的进程的争议)。对于一些容器需要启动多个进程的情况,必须先启动 [supervisor][18]进程,才能生成其它内部所需的进程。 - -### 容器和微服务 ### - -一个完整的关于使用微服务结构体系的原理和好处已经远远超出了这篇文章(并已经覆盖了[InfoQ eMag: Microservices][19])的范围).然而容器是微服务捆绑和部署实例的捷径。 - -尽管大多数实际案例表明大量的微服务目前还是大多数部署在虚拟机,容器相对拥有较小的部署机会。容器具备位操作系统共享内存和硬盘占用量的能力,库常见的应用程序代码也意味着并排部署多个办法的服务是非常高效的。 - -### 连接容器 ### - -一些小的应用程序适合放在单独的容器中,但在许多案例中应用程序将遍布多个容器。Docker的成功包括催生了一连串的新应用程序组合工具、业务流程工具和实现平台作为服务(PaaS)过程。许多工具还帮助实现缩放、容错、业务管理以及对已部署资产进行版本控制。 - - -#### 连接 #### - -Docker的网络功能是相当原始的。在同一主机,容器内的服务和一互相访问,而且Docker也可以通过端口映射到主机操作系统使服务可以通过网络服务被调用。官方的赞助方式是连接到[libchan][20],这是一个提供给Go语言的网络服务库,类似于[channels][21]。直至libcan找到方法进入应用程序,第三方应用仍然有很大空间可提供配套的网络服务。例如,[Flocker][22]已经采取了基于代理的方法使服务实现跨主机(以及底层存储)移植。 - -#### 合成 #### - -Docker本身拥有把容器连接在一起的机制,与元数据相关的依赖项可以被传递到相依赖的容器并用于环境变量和主机入口的消耗。应用合成工具例如[Fig][23]和[geard][24]展示出其依赖关系图在一个独立的文件中,于是多个容器可以汇聚成一个连贯的系统。世纪互联公司的[Panamax][25]合成工具类似底层Fig和 geard的方法,但新增了一些基于web的用户接口,并直接与GitHub相结合,以便于应用程序可以直接被共享。 - -#### 业务流程 #### - -业务流程系统例如[Decking][26],New Relic公司的[Centurion][27]和谷歌公司的[Kubernetes][28]都是旨在帮助部署容器和管理其生命周期系统。也有无数的例子(例如[Apache Mesos][30](特别是[Marathon(马拉松式)持续运行很久的框架] 的 [Mesosphere][29]正在与Docker一起使用。通过为应用程序(例如传递CPU核数和内存的需求)与底层基础架构之间提供一个抽象的模型,业务流程工具提供了解耦,旨在简化应用程序开发和数据中心操作。还有各种各样的业务流程系统,因为人们已经淘汰了以前开发的内部系统,取而代之的是大量容器部署的管理系统;例如Kubernetes是基于谷歌的[Omega][32]系统,这个系统用于管理谷歌区域内的容器。 - -虽然从某种程度上来说合成工具和业务流程工具的功能存在重叠,另外这也是它们之间互补的一种方式。例如Fig可以被用于描述容器间如何实现功能交互,而Kubernetes pods可能用于提供监控和缩放。 - - -#### 平台 (类似一个服务) #### - -大量的Docker已经实现本地PaaS安装部署,例如[Deis][33] 和 [Flynn][34]的出现并在现实中得到利用,Linux容器在很大程度上为开发人员提供了灵活性(而不是“固执己见”地给出一组语言和框架)。其它平台例如CloudFoundry, OpenShift 和 Apcera Continuum都已经采取Docker基础功能融入其现有的系统,这样基于Docker镜像(或者基于Dockerfile)的应用程序也可以用之前支持的语言和框架一起部署和管理。 - -### 支持所有的云 ### - -由于Docker能够在任何的Linux虚拟机中运行并合理地更新内核,它几乎可以为所有云提供IaaS服务。大多数的云厂商已经宣布对码头及其生态系统提供附加支持。 - -亚马逊已经把Docker引入它们的Elastic Beanstalk系统(这是在底层IaaS的一个业务流程系统)。谷歌已经启用‘managed VMs'’,这是提供 -程序引擎PaaS和计算引擎IaaS之间的中转站。微软和IBM都已经宣布基于Kubernetes的服务,所以多容器应用程序可以在它们的云上被部署和管理。 - -为了给现有种类繁多的后端提供可用的一致接口,Docker团队已经引进[libswarm][35], 它能用于集成众多云和资源管理系统。Libswarm所阐明的目标之一是‘避免供应商通过交换任何服务锁定另一个’。这是通过呈现一组一致服务(与API相关联的)来完成的,该服务会附加执行特定的后端服务。例如装有Docker服务的服务器将对Docker命令行工具展示Docker远程API,这样容器就可以被托管在一些列的服务供应商。 - -基于Docker的新服务类型仍在起步阶段。总部位于伦敦的Orchard实验室提供了Docker的托管服务,但是Docker公司表示,收购后,Orchard的服务将不会是一个有优先事项。Docker公司也出售之前DotCloud的PaaS业务给cloudControl。基于就更早前的容器管理系统的服务例如[OpenVZ][36]已经司空见惯了,所以在一定程度上Docker需要向托管供应商证明其价值。 - -### Docker 及其发行版 ### - -Docker已经成为大多数Linux发行版例如Ubuntu,Red Hat企业版(RHEL)和CentOS的一个标准功能。遗憾的是发布是以不同的移动速度到Docker项目,所以在发布版中找到的版本总是远远落后于可用版本。例如Ubuntu 14.04版本是对应Docker 0.9.1版本发布的,但是并没有相应的版本更改点当Ubuntu升级至14.04.1(这个时候Docker已经升至1.1.2版本)。由于Docker也是一个KDE系统托盘,所以在官方库同样存在命名问题;所以在Ubuntu14.04版本中相关安装包的名字和命令行工具都是使用‘Docker.io’命名。 - -在企业版的Linux世界中,情况也并没有因此而不同。CentOS7伴随着Docker 0.11.1的到来,该发行版本即是之前Docker公司宣布准备发行Docker 1.0版本的准备版。Linux发行版用户希望最新版本可以承诺其稳定性,性能和安全性能够更完善,并且更好地结合[安装说明][37]和使用Docker公司的库托管而不是采取包括其分布的版本库。 - -Docker的到来催生了新的Linux发行版本例如[CoreOS][38]和红帽被用于设计为运行容器最小环境的[Project Atomic][39]。这些发布版相比传统的发布版伴随着更多新内核和Docker版本的特性。它们对内存的使用和硬盘占用率更小。新的发行也配备了新的工具用于大型部署例如[fleet][40],这是‘一个分布式init系统’和[etcd][41]是用于元数据管理。也有新机制用于更新发布版本身来使得内核和Docker可以被使用。这也意味着使用Docker的影响之一是它抛开分布版和相关的包管理解决方案的关注,使Linux内核(即Docker子系统正在使用)更加重要。 - -新的发布版将是运行Docker的最好方式,但是传统的发布版本和它们的包管理对容器来说仍然是非常重要的。Docker Hub托管的官方镜像有Debian,Ubuntu和CentOS。当然也有一个‘半官方’的库用于Fedora镜像。RHEL镜像在Docker Hub中不可用,因为是从Red Hat直接发布的。这意味着在Docker Hub的自动构建机制仅仅用于那些纯粹的开源发布版不(并愿意信任基于Docker公司团队所策划镜像的出处)。 - - -虽然Docker Hub与源代码控制系统相结合,例如Git Hub和Bitbucket在构建过程中用于自动创建包管理及生成规范之间的复杂关系(在Dockerfile中),并在构建过程中建立镜像。在构建过程中的非确定性结果并非是Docker具体的问题——这个是由于软件包如何管理工作的结果。在构建完成的当天将会给出一个版本,这个构建完成的另外一次将会得到最新版本,这就是为什么软件包管理需要升级措施。容器的抽象(较少关注一个容器的内容)以及容器的分散(因为轻量级资源利用率)是更有可能与Docker获取关联的痛点。 - -### Docker的未来 ### - -Docker公司对核心功能(libcontainer),跨服务管理(libswarm) 和容器间的信息传递(libchan)的发展提出了明确的路线。与此同时公司已经表明愿意利用自身生态系统和收购Orchard实验室。然而Docker相比Docker公司意味着更多,随着项目的壮大,越来越多对这个项目的 -大牌贡献者,其中不乏像谷歌、IBM和Red Hat这样的大公司。在仁慈独裁者CTO Solomon Hykes 掌舵的形势下,为公司和项目明确了技术领导的关系。在前18个月的项目中通过成果输出展现了快速行动的能力,而且这种趋势并没有减弱的迹象。 - -许多投资者正在寻找10年前VMware公司的ESX/vSphere平台的特征矩阵,并找出虚拟机的普及而驱动的企业预期和当前Docker生态系统两者的距离(和机会)。目前Docker生态系统正缺乏类似网络、存储和版本细粒度的管理(对容器的内容),这些都为初创企业和在职人员提供机会。 - -随着时间的推移,在虚拟机和容器(Docker的运行部分)之间的区别将变得不重要了,而关注点将会转移到‘构建’和‘交付’缓解。这些变化将会使‘Docker发生什么?’这个问题变得比‘Docker将会给IT产业带来什么?’更不重要了。 - - --------------------------------------------------------------------------------- - -via: http://www.infoq.com/articles/docker-future - -作者:[Chris Swan][a] -译者:[disylee](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.infoq.com/author/Chris-Swan -[1]:http://blog.dotcloud.com/dotcloud-paas-joins-cloudcontrol -[2]:http://www.infoq.com/news/2014/06/docker_1.0 -[3]:https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt -[4]:http://selinuxproject.org/page/Main_Page -[5]:https://linuxcontainers.org/ -[6]:http://blog.docker.com/2014/03/docker-0-9-introducing-execution-drivers-and-libcontainer/ -[7]:http://aufs.sourceforge.net/aufs.html -[8]:https://docs.docker.com/reference/builder/ -[9]:https://registry.hub.docker.com/ -[10]:http://bodenr.blogspot.co.uk/2014/05/kvm-and-docker-lxc-benchmarking-with.html?m=1 -[11]:http://domino.research.ibm.com/library/cyberdig.nsf/papers/0929052195DD819C85257D2300681E7B/$File/rc25482.pdf -[12]:https://en.wikipedia.org/wiki/X86_virtualization#Hardware-assisted_virtualization -[13]:http://stealth.openwall.net/xSports/shocker.c -[14]:https://news.ycombinator.com/item?id=7910117 -[15]:http://www.bromium.com/products/vsentry.html -[16]:http://cto.vmware.com/vmware-docker-better-together/ -[17]:http://www.infoq.com/articles/docker-containers -[18]:http://docs.docker.com/articles/using_supervisord/ -[19]:http://www.infoq.com/minibooks/emag-microservices -[20]:https://github.com/docker/libchan -[21]:https://gobyexample.com/channels -[22]:http://www.infoq.com/news/2014/08/clusterhq-launch-flocker -[23]:http://www.fig.sh/ -[24]:http://openshift.github.io/geard/ -[25]:http://panamax.io/ -[26]:http://decking.io/ -[27]:https://github.com/newrelic/centurion -[28]:https://github.com/GoogleCloudPlatform/kubernetes -[29]:https://mesosphere.io/2013/09/26/docker-on-mesos/ -[30]:http://mesos.apache.org/ -[31]:https://github.com/mesosphere/marathon -[32]:http://static.googleusercontent.com/media/research.google.com/en/us/pubs/archive/41684.pdf -[33]:http://deis.io/ -[34]:https://flynn.io/ -[35]:https://github.com/docker/libswarm -[36]:http://openvz.org/Main_Page -[37]:https://docs.docker.com/installation/#installation -[38]:https://coreos.com/ -[39]:http://www.projectatomic.io/ -[40]:https://github.com/coreos/fleet -[41]:https://github.com/coreos/etcd diff --git a/translated/talk/20150114 Why Mac users don't switch to Linux.md b/translated/talk/20150114 Why Mac users don't switch to Linux.md new file mode 100644 index 0000000000..6125a676a4 --- /dev/null +++ b/translated/talk/20150114 Why Mac users don't switch to Linux.md @@ -0,0 +1,81 @@ +为什么 Mac 用户不选择 Linux +================================================================================ +Linux 与 Mac 用户至少有一个共同点:他们都不太喜欢用 Windows。但除了这点外,二者再也无法达成其他共识,只得分道扬镳。为什么 Mac 用户不选择 Linux 呢?是什么因素致使 Mac 用户做出了这种选择的? + +[Datamation 就此问题做了一番调查][1],并试图进行解答。Datamation 的结论是,所有原因都只归结于众多应用及工作流程,而非操作系统的关系: + +> …某些事例表明,尝试用新应用代替现有应用,并不是很实际 - 对工作流程和整体实用性来说都是如此。但不幸的是,苹果在这些方面做得非常好。因此,在几乎不可能改变这些事实的情况下,想要拉拢那些 Mac忠实用户实在是很大的挑战。 + +> 不过老实来说,除了 Web 开发者,我还没见过 Mac 用户仅仅为了避免升级到 OS X Yosemite 而 “ +en masse”(法语:共同,一起) 尝试变更他们的工作流程。诚然,经历过 Yosemite 更新后 - 考虑过权限的用户应该会发现这方面已经变得非常令人讨厌。并且,OS X 除了在 UI 方面的微小变化,几乎没有改变,针对现有 Mac 用户的核心工作流程也在最大程度上保持了原样。 + +> 但,我相信 Linux 在未来将会继续保持多样化特点。Linux 会继续成长,但绝不是经过精确计量般得一成不变。 + +我大体上同意 Datamation 关于应用和工作流程重要性的结论,在选择操作系统时这两方面是必须要考虑顾及的。但我认为对 Mac 用户来说,选择 Mac 有比这两方面更重要的因素。我相信是不同的心态造就了 Linux 和 Mac 用户,并且我认为这才是为什么 Mac 用户不选择 Linux 的真实原因。 + +![](http://jimlynch.com/wp-content/uploads/2015/01/mac-users-switch-to-linux.jpeg) + +### 控制权才是 Linux 用户最看重的地方 ### +Linux 用户倾向于控制电脑上的所有细节,他们试图作出一切能做的努力使操作系统变成他们想要的样子。但这种方式并不适用于 OS X 以及其他任何苹果的产品。如果你使用了苹果的产品,就意味着绝大多数情况下,你只能按照苹果预先设定的模式来使用它们。 + +对 Mac(以及 iOS)用户来说这没什么,因为他们似乎并不在乎生活在苹果那围墙高筑的花园里,仅仅使用那些苹果给予他们的标准和选择。但这对绝大多数 Linux 用户来说是完全不能接受的。Linux 的新用户通常来自 Windows,正是从那里,他们开始厌恶那些告诉他们什么才叫操作系统,并试图限制操作系统权限的东西。 + +自从他们尝到使用自由的 Linux 系统所带来的甜头之后,他们就再也不会回到苹果或者微软的监牢里去了。即使在他们死后,把 Linux 从他们那冰冷僵硬的手指中撬出来,他们也不会接受苹果和微软为他们定制的操作系统。 + +但绝大部分 Mac 用户不会有这样的意志和决心。对他们来说当苹果升级 OS X 时放弃他们现有的习惯方式是非常容易的。在苹果那围墙高筑的花园里,即使他们不满意苹果的变化,他们也会迅速地接受。 + +因此,对控制权的渴望是 Mac 用户与 Linux 用户的最大不同。但我并未把它视为一个问题,尽管这反映出使用电脑的两类用户截然不同的态度。 + +### Mac 用户离不开苹果的技术支持 ### + +Linux 用户与 Mac 用户的区别也体现在 Linux 用户并不介意亲自维护自己的电脑。虽然维护电脑及控制操作系统都是很大的责任,但 Linux 用户还是愿意独自承担,愿意通过自己的力量使他们的系统工作得更棒更有效率,并且深入了解操作系统是每一位 Linux 用户都乐衷的事情。 + +当 Linux 用户遇到问题时,他们会迅速地尝试自己来解决问题。如果这不奏效的话,他们会在网上搜索其他Linux用户的解决方案,并不断进行尝试,直到问题解决。 + +但 Mac 用户却不大会这样。这也许是为什么苹果零售店如此火爆、为什么如此多的 Mac 用户在拿到新 Mac 的时候会选择购买苹果维护服务的原因。Mac 用户会很轻易得带着 TA 的电脑去苹果零售店,走进天才吧并要求苹果的工作人员为其查看和修复电脑。 + +绝大多数 Linux 用户连想都不会想这种事情。谁会愿意让一个你都不认识的家伙碰你的电脑并维修它呢? + +因此对 Mac 用户来说,很难抛弃过去可以从苹果那里得到的技术支持,转而使用 Linux。这种选择会令某些 Mac 用户觉得自己的电脑将变得非常脆弱、容易被攻击,他们如同离开母亲怀抱的婴儿般充满了无助感。 + +### Mac 用户喜爱苹果的硬件 ### + +Datamation 发表的文章中主要研究了软件方面的原因,但我认为硬件因素同样对 Mac 用户有很大影响。绝大部分 Mac 用户非常喜爱苹果的硬件。TA 们购买 Mac 并不仅仅是为了 OS X。苹果那精美的工艺设计也是 Mac 用户购买时着重考虑的一点。Mac 用户愿意支付高价购买电脑,因为他们认为这样绝对是物有所值的。 + +另一方面,Linux 用户似乎并不会考虑这些东西。我认为他们更关注电脑的花费,而不太在意电脑的外观和设计。对他们来说,花费最少的金钱来获取尽可能好的硬件才是最重要的。他们并不像 Mac 用户一样热衷于电脑的外观,因此这一点并不是他们在购买电脑时考虑的地方。 + +我认为对于硬件的两种不同观点是没有高低之分的。这仅仅和用户的不同需求有关,仅仅会在他们购买电脑时影响他们,或者对某些 Linux 用户来说只是因为他们想要自己组装电脑而已。两种观点只是因为出发点不同、对于电脑的真正价值体现所在之处的理解不同罢了。 + +当然[在 Mac 上运行 Linux 是可能的][2],直接运行或者间接地通过虚拟机运行。因此真心喜欢苹果硬件的 Mac 用户是可以选择在 Mac 上安装 Linux 的。 + +### Linux 发行版太多了不知道选哪个? ### + +另一个让 Mac 用户无法选择 Linux 的原因是:要从众多 Linux 发行版当中选择一个实在是太困难了。在大多数 Linuxer 并不抗拒的多元化发行版时代,没有相关知识的 Mac 用户会对如何选择感到十分困惑。 + +我认为,随着时间的推移,Mac 用户可以学习并找出最适合自己的发行版。但在短时间内,尤其是长时期得使用 OS X 之后,这是一个艰巨的任务。我不认为这个问题是无法克服的,但却有必要在这里提一下。 + +当然我们可以给大家提供资源,推荐参考 [DistroWatch][3] 还有我们的博客 [Desktop Linux Reviews][4],这都有助于 Mac 用户找到适合的 Linux 发行版。再说一条,网上有很多诸如“最好的 Linux 发行版”等类似的文章,当 Mac 用户想要寻找适合自己使用的发行版时可以参考一下。 + +但有苹果顾客购买 Mac 的其中一个原因是苹果硬件软件协调统一起来的简便性和易用性。所以我不确定有多少 Mac 用户愿意花费时间找出适合自己的 Linux 发行版。也许是否要使用 Linux 确实会令TA们考虑一阵子了。 + +### Mac 用户是苹果,Linux 用户是橘子 ### + +Mac 用户与 Linux 用户分道扬镳我认为并没有什么不妥。我认为我们只是在谈论两类完全不同的人群,这是一件好事,因为两类人群都在按自己喜欢的方式去使用操作系统和软件。让 Mac 用户和 Linux 用户各自沉浸在 OS X 和 Linux 中吧,希望他们都能高兴,都能对自己的电脑满意。 + +也许 Mac 用户会偶然走入 Linux 的世界并开始转向 Linux,但我认为绝大多数时候,两类人都愿意呆在不同的世界并不与对方接触。通常来说我并不会随意比较二者,尤其是你已经自己拿定主意的时候,况且这只不过是选苹果还是选橘子的问题罢了。 + +-------------------------------------------------------------------------------- + +via: http://jimlynch.com/linux-articles/why-mac-users-dont-switch-to-linux/ + +作者:[Jim Lynch][a] +译者:[Stevearzh](https://github.com/Stevearzh) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://jimlynch.com/author/Jim/ +[1]:http://www.datamation.com/open-source/why-linux-isnt-winning-over-mac-users-1.html +[2]:http://www.howtogeek.com/187410/how-to-install-and-dual-boot-linux-on-a-mac/ +[3]:http://distrowatch.com/ +[4]:http://desktoplinuxreviews.com/ diff --git a/translated/talk/20150121 If a 32-bit integer overflows.md b/translated/talk/20150121 If a 32-bit integer overflows.md new file mode 100644 index 0000000000..651e829189 --- /dev/null +++ b/translated/talk/20150121 If a 32-bit integer overflows.md @@ -0,0 +1,93 @@ +如果使用32位整型会溢出,那么是否可以使用一个40位结构体代替64位长整型? +--------- + +#问题: +假如说,使用32位的整型会溢出,在不考虑使用长整型的情况下,如果我们只需要表示2的40次方范围内的数,是否可以利用某些40位长的数据类型来表示呢?这样的话,每个整型数就可以节省24位的空间。 + +如果可以,该怎么做? + +需求是:我现在必须处理数以亿计的数字,所以在存储空间上受到了很大的限制。 + +#回答: + +##可以是可以,但是…… + +这种方法的确可行,但这么做通常没什么意义(因为几乎没有程序需要处理多达十亿的数字): + +```C +#include // 不要考虑使用long long类型 +struct bad_idea +{ + uint64_t var : 40; +}; +``` + +在这里,变量var占据40位大小,但是以生成代码时拥有非常低的运行效率来换取的(事实证明“非常”二字言过其实了——测试中程序开销仅仅增加了1%到2%,正如下面的测试时间所示),而且这么做通常没什么用。除非你还需要保存一个24位的值(或者是8位、16位的值),这样你皆可以它们放到同一个结构中。不然的话,因为对齐内存地址产生的开销会抵消这么做带来的好处。 + +在任何情况下,除非你是真的需要保存数以亿计的数字,否则这样做给内存消耗带来的好处是可以忽略不计的(但是为了处理这些位字段的额外代码量是不可忽略的!)。 + +###说明: + +在此期间,这个问题已经被更新了,是为了说明实际上确实有需要处理数以亿计数字的情况。假设,采取某些措施来防止因为结构体对齐和填充抵消好处(比如在后24位中存储其它的内容,或者使用多个8位来存储40位),那么这么做就变得有意义了。 +如果有十亿个数,每个数都节省三个字节的空间,那么这么做就非常有用了。因为使用更小的空间存储要求更少的内存页,也就会产生更少的cache和TLB不命中和内存缺页(单个缺页会产生数以千万计的指令(译者注:直译是这样,但语义说不通!))。 + +尽管上面提到的情况不足以充分利用到剩余的24位(它仅仅使用了40位部分),如果确实在剩余位中放入了有用的数据,那么使用类似下面的方法会使得这种思路就管理内存而言显得非常有用。 + +```C +struct using_gaps +{ + uint64_t var : 40; + uint64_t useful_uint16 : 16; + uint64_t char_or_bool : 8; +}; +``` + +结构体大小和对齐长度等于64位整型的大小,所以只要使用得当就不会浪费空间,比如对一个保存10亿个数的数组使用这个结构(不考虑使用指定编译器的扩展)。如果你不会用到一个8位的值,那么你可以使用一个48位和16位的值(giving a bigger overflow margin)。 +或者以牺牲可用性为代价,把8个64位的值放入这样的结构体中(或者使用40和64的组合使得其和满足320)。当然,在这种情况下,通过代码去访问数组结构体中的元素会变得非常麻烦(尽管一种方法是实现一个operator[]在功能上还原线性数组,隐藏结构体的复杂性)。 + +更新: + +我写了一个快速测试工具,只是为了获得位字段的开销(以及伴随位字段引用的重载操作)。由于长度限制将代码发布在gcc.godbolt.org上,在本人64位Win7上的测试结果如下: + +```TXT +运行测试的数组大小为1048576 +what alloc seq(w) seq(r) rand(w) rand(r) free +----------------------------------------------------------- +uint32_t 0 2 1 35 35 1 +uint64_t 0 3 3 35 35 1 +bad40_t 0 5 3 35 35 1 +packed40_t 0 7 4 48 49 1 + +运行测试的数组大小为16777216 +what alloc seq(w) seq(r) rand(w) rand(r) free +----------------------------------------------------------- +uint32_t 0 38 14 560 555 8 +uint64_t 0 81 22 565 554 17 +bad40_t 0 85 25 565 561 16 +packed40_t 0 151 75 765 774 16 + +运行测试的数组大小为134177228 +what alloc seq(w) seq(r) rand(w) rand(r) free +----------------------------------------------------------- +uint32_t 0 312 100 4480 4441 65 +uint64_t 0 648 172 4482 4490 130 +bad40_t 0 682 193 4573 4492 130 +packed40_t 0 1164 552 6181 6176 130 +``` + +我们看到,位字段的额外开销是微不足道的,但是当以友好的方式线性访问数据时伴随位字段引用的操作符重载产生的开销则相当显著(大概有3倍)。在另一方面,随机访问产生的开销则无足轻重。 + +这些时间表明简单的使用64位整型会更好,因为它们在整体性能上要比位字段好(尽管占用更多的内存),但是显然它们并没有考虑随着数据集增大带来的缺页开销。一旦程序内存超过RAM大小,结果可能就不一样了(未亲自考证)。 + +------ + +via:[stackoverflow](http://stackoverflow.com/questions/27705409/if-a-32-bit-integer-overflows-can-we-use-a-40-bit-structure-instead-of-a-64-bit/27705562#27705562) + +作者:[Damon][a][Michael Kohne][b] +译者:[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/572743/damon +[b]:http://stackoverflow.com/users/5801/michael-kohne \ No newline at end of file diff --git a/translated/talk/20150122 How are C data types “supported directly by most computers”.md b/translated/talk/20150122 How are C data types “supported directly by most computers”.md new file mode 100644 index 0000000000..d204928ad6 --- /dev/null +++ b/translated/talk/20150122 How are C data types “supported directly by most computers”.md @@ -0,0 +1,53 @@ +C语言数据类型是如何被大多数计算机系统所支持? +--------- + +#问题: + +在读K&R版的*The C Programming Language*一书时,我在[介绍,第3页]看到这样一条说明: + +>因为C语言提供的数据类型和控制结构可以直接被大部分计算机系统所支持,所以在实现自包含程序时所需要的运行库文件一般很小。 + +这段黑体说明了什么?能找到一个例子来说明C语言中的某种数据类型或控制结构并不能被一种计算机系统所支持呢? + +#回答: + +事实上,C语言中确实有不被直接支持的数据类型。 + +在许多嵌入式系统中,硬件上并没有浮点运算单元。因此,如果你写出下面的代码: + +```C +float x = 1.0f, y = 2.0f; +return x + y; +``` + +可能会被转化成下面这种形式: + +```C +unsigned x = 0x3f800000, y = 0x40000000; +return _float_add(x, y); +``` + +然后编译器或标准库必须提供'_float_add()'的具体实现,这会占用嵌入式系统的内存空间。依此去计算代码在某个微型系统(译者注:也就是指微型嵌入式系统)的实际字节数,也会发现有所增加。 + +另一个常见的例子是64位整型数(C语言标准中'long long'类型是1999年之后才出现的),这种类型在32位系统上也不能直接使用。古董级的SPARC系统则不支持整型乘法,所以在运行时必须提供乘法的实现。当然,还有一些其它例子。 + +##其它语言 + +相比起来,其它编程语言有更加复杂的基本类型。 + +比如,Lisp中的symbol需要大量的运行时实现支持,就像Lua中的tables、Python中的strings、Fortran中的arrays,等等。在C语言中等价的类型通常要么不属于标准库(C语言没有标准symbols或tables),要么更加简单,而且并不需要那么多的运行时支持(C语言中的array基本上就是指针,以NULL结尾的字符串实现起来也很简单)。 + +##控制结构 + +异常处理是C语言中没有的一种控制结构。非局部的退出只有'setjmp()'和'longjmp()'两种,只能提供保存和恢复某些部分的处理器状态。相比之下,C++运行时环境必须先遍历函数调用栈,然后调用析构函数和异常处理函数。 + +---- +via:[stackoverflow](http://stackoverflow.com/questions/27977522/how-are-c-data-types-supported-directly-by-most-computers/27977605#27977605) + +作者:[Dietrich Epp][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/82294/dietrich-epp \ No newline at end of file diff --git a/translated/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md b/translated/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md new file mode 100644 index 0000000000..ddbdfc8689 --- /dev/null +++ b/translated/tech/20140917 How to create a software RAID-1 array with mdadm on Linux.md @@ -0,0 +1,223 @@ +如何使用linux程序mdadm创建软件RAID1软阵列 +================================================================================ +磁盘冗余阵列(RAID)是将多个物理磁盘结合成一个逻辑磁盘的技术,该技术可以提高磁盘容错性能,提高磁盘的读写速度。根据数据存储的排列(如 条带存储,镜像存储,奇偶或者他们的组合),定义了几个不同级别的RAID(RAID-0,RAID-1,RAID-5 等等)。磁盘阵列可以使用软件或者硬件方式实现。现代Linux操作系统中,基本的软件RAID功能是默认安装的。 + +本文中,我们将介绍软件方式构建RAID-1阵列(镜像阵列),RAID-1将相同的数据写到不同的设备中。虽然可以使用同一个磁盘的两个分区实现RAID-1,但是如果磁盘坏了的话数据就都丢了,所以没什么意义。实际上,这也是为什么大多数RAID级别都使用多个物理磁盘提供冗余。当单盘失效后不影响整个阵列的运行,并且可以在线更换磁盘,最重要的是数据不会丢失。尽管如此,阵列不能取代外部存储的定期备份。 + +由于RAID-1阵列的大小是最小磁盘的大小,一般来说应该使用两个大小相同的磁盘来组建RAID-1。 + +### 安装mdadm ### + +我们将使用mdadm(简称多盘管理)工具创建、组装、管理和监控软件RAID-1。在诸如Fedora、CentOS、RHEL或者Arch Linux 的发行版中,mdadm是默认安装的。在基于Debian的发行版中,可以使用aptitude 或者 apt-get 安装mdadm。 + +#### Fedora, CentOS 或 RHEL #### + +由于adadm是预装的,所以我们只需要开启RAID守护服务,并将其配置成开机启动即可: + + # systemctl start mdmonitor + # systemctl enable mdmonitor + +对于CentOS/RHEL 6系统,使用以下命令: + + # service mdmonitor start + # chkconfig mdmonitor on + +#### Debian, Ubuntu 或 Linux Mint #### + +在Debian或类Debian系统中,mdadm可以使用 **aptitude 或者 apt-get** 安装: + + # aptitude install mdadm + +Ubuntu系统中,会要求为电子邮件通知配置后缀MTA。你可以跳过去。 + +Debian系统中,安装程序会显示以下解释信息,用来帮助我们去判断是否将根目录安装到RAID阵列中。下面的所有操作都有赖于这一步,所以应该仔细阅读他。 + +![](https://farm4.staticflickr.com/3918/15220883382_c14eb95914_z.jpg) + +我们不在根目录使用RAID-1,所以留空。 + +![](https://farm6.staticflickr.com/5555/15198241896_29e08b977f.jpg) + +提示是否开机启动阵列的时候,选择是。注意,这里需要往/etc/fstab 文件中添加一个条目使得系统启动的时候正确挂载阵列。 + +![](https://farm4.staticflickr.com/3875/15220883342_2b1d689a0a_z.jpg) + +### 硬盘分区 ### + +现在开始准备建立阵列需要的硬盘。这里往插入两个8GB的usb磁盘,使用dmesg命令设备显示设备 /dev/sdb 和 /dev/sdc + + # dmesg | less + +---------- + +[ 60.014863] sd 3:0:0:0: [sdb] 15826944 512-byte logical blocks: (8.10 GB/7.54 GiB) +[ 75.066466] sd 4:0:0:0: [sdc] 15826944 512-byte logical blocks: (8.10 GB/7.54 GiB) + +我们使用fdisk为每个磁盘建立一个大小为8G的主分区。以下步骤是如何在/dev/sdb上建立分区,假设次磁盘从未被分区(如果有其他分区的话,可以删掉): + + # fdisk /dev/sdb + +按p键输出现在的分区表: + +![](https://farm4.staticflickr.com/3883/15198241836_24625edcf3_z.jpg) + +(如果有分区的话,可以使用 d 选项删除,w 选项应用更改)。 + +磁盘上没有分区,所以我们使用命令 ['n'] 创建一个主分区['p'], 分配分区号为['1'] 并且指定大小。你可以按回车使用默认值,或者输入一个你想设置的值。如下图: + +![](https://farm4.staticflickr.com/3875/15034475369_7e72fb9f2e_z.jpg) + +用同样的方法为/dev/sdc 分区。 + +如果我们有两个不同容量的硬盘,比如 750GB 和 1TB的话,我们需要在每个磁盘上分出一个750GB的主分区,大盘剩下的空间可以用作他用,不加入磁盘阵列。 + +### 创建 RAID-1 阵列 ### + +磁盘分区完成后,我们可以使用以下命令创建 RAID-1 阵列: + + # mdadm -Cv /dev/md0 -l1 -n2 /dev/sdb1 /dev/sdc1 + +说明: + +- **-Cv**: 创建一个阵列并打印出详细信息。 +- **/dev/md0**: 阵列名称。 +- **-l1** (l as in "level"): 指定阵列类型为 RAID-1 。 +- **-n2**: 指定我们将两个分区加入到阵列中去,分别为/dev/sdb1 和 /dev/sdc1 + +以上命令和下面的等价: + + # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 + +如果你想在在磁盘失效时添加另外一个磁盘到阵列中,可以指定 '--spare-devices=1 /dev/sdd1' 到以上命令。 + +输入 “y” 继续创建阵列,回车: + +![](https://farm4.staticflickr.com/3894/15034569970_709bd51718.jpg) + +可以使用以下命令查看进度: + + # cat /proc/mdstat + +![](https://farm6.staticflickr.com/5565/15221267975_701b819e6d_z.jpg) + +另外一个获取阵列信息的方法是: + + # mdadm --query /dev/md0 + # mdadm --detail /dev/md0 (or mdadm -D /dev/md0) + +![](https://farm6.staticflickr.com/5583/15034683868_6c28564e5a_z.jpg) + +'mdadm -D'命令提供的信息中,最重要就是阵列状态类。激活状态说明阵列正在进行读写操作。其他几个状态分别为 完成(读写完成)、降级(有一块磁盘失效或丢失)或者恢复中(一张新盘已插入,系统正在写入数据)。这几个状态涵盖类大多数情况。 + +### 格式化或加载磁盘阵列 ### + +下一步就是格式化阵列了,本例中使用ext4格式: + + # mkfs.ext4 /dev/md0 + +![](https://farm4.staticflickr.com/3849/15034683838_01e34e7196_z.jpg) + +现在可以加载阵列并验证其正常加载: + + # mount /dev/md0 /mnt + # mount + +![](https://farm6.staticflickr.com/5554/15034696167_c4fc907c8e_z.jpg) + +### 监控磁盘阵列 ### + +mdadm工具内置有磁盘阵列监控功能。当mdadm作为守护程序运行的时候(就像我们上文那样),会周期性的检测阵列运行状态,将检测到的信息通过电子邮件或者系统日志报告上来。当然,也可以配置其在发生致命性错误的时候调用紧急命令。 + +mdadm默认会记录所有已知分区和阵列的事件,并将他们记录到 /var/log/syslog中。或者你可以在配置文件中(/etc/mdadm/mdadm.conf debian系统 /etc/mdadm.conf 红帽子系统)以以下格式指定监控设备或者阵列。如果mdadm.conf文件不存在,你可以创建一个。 + + DEVICE /dev/sd[bcde]1 /dev/sd[ab]1 + + ARRAY /dev/md0 devices=/dev/sdb1,/dev/sdc1 + ARRAY /dev/md1 devices=/dev/sdd1,/dev/sde1 + ..... + + # optional email address to notify events + MAILADDR your@email.com + +编辑完毕mdadm配置文件后,重启mdadm服务: + +Debian系统,Ubuntu或者Linux Mint: + + # service mdadm restart + +Fedora, CentOS 或 RHEL 7: + + # systemctl restart mdmonitor + +CentOS或者RHEL 6: + + # service mdmonitor restart + +### 自动加载阵列 ### + +现在我们在/etc/fstab中加入条目使得系统启动的时候将阵列挂载到/mnt目录下: + + # echo "/dev/md0 /mnt ext4 defaults 0 2" << /etc/fstab + +为了验证挂载脚本工作正常,我们首先卸载阵列,重启mdadm,然后重新加载。可以看到/dev/md0已经安装我们添加到/etc/fstab中的条目加载了: + + # umount /mnt + # service mdadm restart (on Debian, Ubuntu or Linux Mint) + or systemctl restart mdmonitor (on Fedora, CentOS/RHEL7) + or service mdmonitor restart (on CentOS/RHEL6) + # mount -a + +![](https://farm6.staticflickr.com/5563/15218183681_63a10da704_z.jpg) + +现在我们的阵列已经可以访问类,拷贝文件/etc/passwd到/mnt中测试一下: + +![](https://farm6.staticflickr.com/5593/15034475219_a3476aec0a_o.png) + +Debian系统中,需要在/etc/default/mdadm 设置 AUTOSTART 变量为 true 才能使mdadm守护程序在开机时自动加载阵列: + + AUTOSTART=true + +### 模拟磁盘丢失故障 ### + +我们将使用以下命令卸载磁盘来模拟磁盘故障。注意,在实际应用中,磁盘已经上故障状态了,不需要卸载。 + +首先,卸载阵列: + + # umount /mnt + +现在注意每次执行命令后 'mdadm -D /dev/md0' 的输出。 + + # 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 + +数据会被自动添加到备用盘 /dev/sdb1 上: + +![](https://farm4.staticflickr.com/3855/15221267875_dfc6af8804_z.jpg) + +注意以上所述步骤只适合支持磁盘热拔插的系统,在不支持热拔插的系统中,还是得停止阵列并关机后更换备用盘: + + # mdadm --stop /dev/md0 + # shutdown -h now + +最后将新驱动器重新添加到阵列中: + + # mdadm /dev/md0 --add /dev/sdb1 + # mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 + +希望本文对你有所帮助 + +-------------------------------------------------------------------------------- + +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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/gabriel diff --git a/translated/tech/20141030 Test drive Linux with nothing but a flash drive.md b/translated/tech/20141030 Test drive Linux with nothing but a flash drive.md new file mode 100644 index 0000000000..9c1c8684d6 --- /dev/null +++ b/translated/tech/20141030 Test drive Linux with nothing but a flash drive.md @@ -0,0 +1,75 @@ +试试只用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并对它有点好奇,终于想要实际体验一下,但可能不知道从哪儿开始。 + +很可能你已经在网上搜索过一些信息,然后遇到一些像双系统和虚拟机这样的词汇。它们对你来说也许太专业了,所以你肯定不会仅仅为了尝试一下Linux而牺牲正在使用的操作系统。那我们该怎么办? + +如果你手上正好有个U盘的话,那就可以试试做一个USB Linux启动盘。它是一个包含了整个操作系统并可以直接引导开机的U盘。创建它并不需要什么专业技术能力,让我们来看看怎么做,以及如何从USB引导进入Linux系统。 + +### 你需要准备的 ### + +除了一台台式机或笔记本电脑外,你还需要: + +- 一个空白的U盘-最好容量能有4GB或更多。 +- 一个你想尝试的Linux发行版[ISO镜像][1](一种把所有磁盘内容打包起来的档案文件)。待会再详细介绍。 +- 一个叫[Unetbootin][2]的应用程序,它是一个开源的,跨平台的工具,用来创建USB启动盘。运行它并不需要启动Linux。在下面的教程中,我是在MacBook上运行的Unetbootiin。 + +### 开始干活 ### + +把U盘插到你电脑的USB端口上,然后启动Unetbootin。然后会要求你输入电脑的登录密码。 + +![Unetbootin main window](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-main.png) + +还记得之前提到的ISO镜像文件吗?有两种方式可以获得:要么自己从你想尝试的Linux发行版网站上下载,或者让Unetbootin帮你下载。还是选后者,在窗口顶部点击**选择发行版**,选择你想下载的发行版,然后点击**选择版本**来选择你希望尝试的发行版版本。 + +![Downloading a Linux distribution](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-download-distro.png) + +或者,你也可以自己下载发行版。通常,我想尝试的Linux发行版都没有在列表中。如果选择另一个方向,点击**磁盘镜像**,然后点击按钮来选择你下载好的.iso文件。 + +注意到下面的选项**预留每次重新启动后保存文件的空间(仅Ubuntu有效)**吗?如果你尝试的是Ubuntu或它的任一个衍生版(比如Lubuntu或Xubuntu),你可以在U盘上留出几M空间用来保存文件,比如网页书签或你自己创建的文档。当用这个U盘下次启动Ubuntu的时候,你可以继续使用这些文件。 + +![Ready to create a live USB](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-ready-to-go.png) + +在加载好ISO镜像后,点击**确定**。Unetbootin大概需要不到10分钟来创建USB启动盘。 + +![Creating the live USB](http://opensource.com/sites/default/files/images/life-uploads/unetbootin-creating-disk.png) + +### 检验USB启动盘 ### + +这个时候,你需要拥抱一下自己内在的极客精神。不会太难,不过你将需要进入[BIOS][3]去偷看一下你电脑内部空间。你的电脑的BIOS会加载各种硬件,并控制电脑操作系统的引导或启动。 + +BIOS通常会按这个顺序搜索操作系统(或者类似的顺序):硬盘,然后是CD/DVD光驱,然后是外部存储设备。你需要调整这个顺序,让外部存储设备(在这里,意味着你的U盘启动盘)成为BIOS第一个搜索的设备。 + +要做到这个,把U盘插到电脑上再重启电脑。在看到提示信息**Press F2 to enter setup**之后,按它要求的做。在有的电脑上,这个键可能是F10。 + +在BIOS里,用键盘上的向右方向键切换到**Boot**菜单。然后你将看到你电脑上的驱动器列表。使用键盘上的向下方向键选中名字为**USB HDD**的选项,然后按下**F6**移动这个选项到列表的顶部。 + +完成后,按下**F10**来保存改动。然后你会从BIOS里被踢出来,然后电脑会自己启动。等一小会,你就会看到一个你正在尝试的Linux发行版的启动菜单。选择**Run without installing**(或者最接近的选项)。 + +在进入桌面后,你可以连接上无线或有线网络,看看网页,试一试预装的软件。你还可以看看,比如说,你的打印机或扫描仪是否能在你试的这个发行版下正常工作。你要是真的想不开,也可以去摸一下命令行。 + +### 能干什么 ### + +根据你尝试的Linux发行版和你使用的U盘的速度,操作系统可能会需要更长的时间来加载,而且很可能比直接装到硬盘上会慢一点。 + +还有,你也只能运行Linux发行版里预装好的基本软件。通常会有网页浏览器,一个文字处理软件,一个文本编辑器,一个媒体播放器,一个相片浏览器,以及一套实用工具。这些应该足够给你使用Linux的感觉了。 + +如果你决定使用Linux,你可以双击安装器从U盘安装到硬盘。 + +-------------------------------------------------------------------------------- + +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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/scottnesbitt +[1]:http://en.wikipedia.org/wiki/ISO_image +[2]:http://unetbootin.sourceforge.net/ +[3]:http://en.wikipedia.org/wiki/BIOS diff --git a/translated/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md b/translated/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md new file mode 100644 index 0000000000..6f1e2b5b56 --- /dev/null +++ b/translated/tech/20141114 How To Use Emoji Anywhere With Twitter's Open Source Library.md @@ -0,0 +1,91 @@ + 怎样通过 Twitter 的开源库来随处使用 Emoji 表情符号 +================================================================================ +> 通过 GitHub 将它们嵌入到网页和其他项目中。 + +![](http://a3.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2OTIyNTI3MjcxNTU1.png) + +Emoji, 来自日本的小巧符号,通过图像表达感情,已经征服了手机文字信息的世界。 + +现在,你可以在虚拟世界中随处使用它们了。 Twitter 最近[开源了][1]他们的 emoji 符号库,使得你可以在你自己的网站,应用,和项目中使用它们。 + +但这需要一点体力活。 Unicode 已经识别甚至标准化了 emoji 字母表, 然而 emoji 仍然[不能完全与所有的网络浏览器相兼容][2],这意味着大多数情况下,它们将呈现为 “豆腐块”或 空白盒子。当 Twitter 想使得 emoji 可用时,社交网络联合一家名为[Icon Factory][3]的公司共同渲染浏览器以模仿 文本信息符号的效果。结果,Twiter 说道 人们对他们的 emoji 库有很大的需求。 + +现在, 你可以从 [GitHub][4] 上克隆 Twitter 的整个库,从而在你的开发项目中使用它们。 下面将为你介绍如何达到上面的目的以及如何使得 emoji 更容易被使用。 + +### 为 Emoji 得到 Unicode 支持 ### + +Unicode 是国际编码标准,它为任意的符号,字母或人们想在网络上使用的数字配置了一串符号。换句话说,它是 你如何在计算机上阅读文本 与 计算机如何读取文本 之间的缺失环节。例如,对于你正看到的位于这些句子中的`空白`,计算机读取为 “&mbsp”。 + +Unicode 甚至拥有其自己的 [原始 emoji][5],它们可以 在没有你的任何努力的情况下在浏览器中被阅读。例如,当你看到了 一个 ❤ 符号,你的计算机正在解码字符串 “2665” 。 + +要在大多数情况下使用 Twitter 的 emoji 库,你只需在你的 HTML 网页中的 ``块中添加如下脚本: + + + +这样就使得你的项目可以访问 包含有已经在 Twitter 中可使用的数以百计的 Emoji 符号的 JavaScript 库。然而,创建一个仅仅包含这个脚本的文档并不能使得在你的网站中呈现出 emoji 符号,实际上,你仍需要嵌入一些 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) + +### 将 Emoji 转换为可阅读的语言 ### + +对于一个网站或应用,Twitter 的解决方案是非常适用的。但如果你想通过 HTML 轻易地插入你喜爱的 emoji 符号,你需要一个更易实现的解决方案,而不是记住所有代表 emoji 的 Unicode 字符串。 + +那正是程序员 Elle Kasai 的 [Twemoji Awesome][7] 样式大展身手的地方。 + +通过向任意网页中添加 Elle 的开源样式表,你可以适用 英语单词来理解你正插入的 emoji 符号的意义。所以如若你想展示一个 心形 emoji 符号,你可以简单地输入: + + + +为了实现上面的目的,让我们下载 Elle 的项目,通过点击在 GitHub 上 “Download ZIP” 按钮。 + +接着,我们在桌面上新建一个文件夹,然后进入该文件夹,并将 emoji.html---我先前向你展示的 HTML 源文件--- 和 Elle 的 [twemoji-awesome.css][8] 一同放进去。 + +我们还需要 HTML 文件识别这个 CSS 文件,所以在 html 网页中的 `` 块中,为 CSS 文件添加一个链接: + + + + 一旦你将上面的代码添加了进去,你便可以删除先前添加的 Twitter 的脚本链接。 + + 现在,找到 `body` 块部分的代码,然后添加一些 emoji 符号。我使用了 ``, ``, `` 和 ``。 + + 最终,你将得到如下的代码: + +![](http://a2.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODcyMDYxNDU2MzU0.png) + +保存并在浏览器中查看上面的文件: + +![](http://a1.files.readwrite.com/image/upload/c_fit,w_620/MTI1OTA2ODExOTMxODkwOTYy.png) + +当当!这样你不仅得到了一个可以在浏览器中支持 emoji 符号的基本网页,而且还知道了如何简单地实现它。你可以随意的在[我的 GitHub][9] 中查看这个教程,并且可以克隆这些实际的文件而不只是看看这些截图。 + +来自于[得到 Emoji][10]的引导图像; Lauren Orsini 截图。 + +-------------------------------------------------------------------------------- + +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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://readwrite.com/author/lauren-orsini +[1]:https://blog.twitter.com/2014/open-sourcing-twitter-emoji-for-everyone +[2]:http://www.unicode.org/reports/tr51/full-emoji-list.html +[3]:https://twitter.com/iconfactory +[4]:https://github.com/twitter/twemoji +[5]:http://www.unicode.org/reports/tr51/full-emoji-list.html +[6]:https://github.com/twitter/twemoji/blob/gh-pages/preview.html +[7]:http://ellekasai.github.io/twemoji-awesome/ +[8]:https://github.com/ellekasai/twemoji-awesome/blob/gh-pages/twemoji-awesome.css +[9]:https://github.com/laurenorsini/Emoji-Everywhere +[10]:http://getemoji.com/ 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 new file mode 100644 index 0000000000..17da6a9508 --- /dev/null +++ b/translated/tech/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 。 + +![](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/20150104 Auditd--Tool for Security Auditing on Linux Server.md b/translated/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md new file mode 100644 index 0000000000..1071e1521b --- /dev/null +++ b/translated/tech/20150104 Auditd--Tool for Security Auditing on Linux Server.md @@ -0,0 +1,200 @@ +Auditd - Linux 服务器安全审计工具 +================================================================================ +首先,Linoxide组祝读者 **2015新年快乐万事如意!** 。下面开始这个新年版审计工具的介绍。 + +安全防护是首先要考虑的问题。为了避免别人盗取我们的数据,我们需要维护它。安全防护包括很多东西,审计是其中一个。 + +我们知道Linux系统上有一个叫 **auditd** 的审计工具。这个工具在大多数Linux操作系统中是默认安装的。审计工具是什么?如何使用?下面我们开始介绍。 + +### 什么是审计? ### + +审计(或审计监控)是Linux审计系统中用户部分的一个组件,负责将审计记录写入磁盘。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/what_is_auditd.png) + +### 安装 auditd ### + +Ubuntu系统中,我们可以使用 [wajig][1] 工具或者 **apt-get 工具** 安装auditd。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/install_auditd.png) + +按照下面的说明安装auditd,安装完毕后将自动安装以下auditd和相关的工具: + +- **auditctl ;** 运行过程中控制守护进程的工具,比如如添加规则等等。 +- **/etc/audit/audit.rules ;** 记录审计规则的文件。 +- **aureport ;** 查看和生成审计报告的工具。 +- **ausearch ;** 查找审计事件的工具 +- **auditspd ;** 转发事件通知给其他应用程序,不写审计日志文件。 +- **autrace ;** 跟踪处理过程的命令。 +- **/etc/audit/auditd.conf ;** auditd工具的配置文件。 +- 首次安装 **auditd** 后, 审计规则是空的。 + +可以使用以下命令查看 + + $ sudo auditctl -l + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_no_rules.png) + +以下我们介绍如何给auditd添加审计规则。 + +### 如何使用auditd ### + +#### Audit 文件和目录访问审计 #### + +我们使用审计工具的一个目的是监控文件和目录的更改。对于auditd工具,我们可使用命令来配置(注意,以下命令需要root权限)。 + +**文件审计** + + $ sudo auditctl -w /etc/passwd -p rwxa + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_w_etc_passwd.png) + +**选项 :** + +- **-w path ;** 监控指定的路径,上面的命令指定监控路径 /etc/passwd +- **-p ; ** 指定触发审计的文件和目录的访问权限 +- **rwxa ;** 指定的触发条件,r 读取权限,w 写入权限,x 执行权限 + +#### 目录审计 #### + +使用类似的命令来对目录进行审计,如下: + + $ sudo auditctl -w /production/ + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_w_production.png) + +以上命令将监控对 **/production 目录** 的所有访问。 + +现在,运行 **auditctl -l** 命令即可查看所有已配置的规则。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/auditctl_rules.png) + +下面开始介绍审计日志。 + +### 查看审计日志 ### + +添加规则后,我们可以查看 auditd 的日志。使用 **ausearch** 工具可以查看auditd日志。 + +我们已经添加规则监控 /etc/passwd 文件。现在可以使用 **ausearch** 工具的以下命令来查看审计日志了。 + + $ sudo ausearch -f /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 ;** 上面命令的可执行文件路径 +- 以上审计日志显示文件未被改动。 + + 以下我们将要添加一个用户,看看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** 访问的。 + +键入 **man chfn** 可以查看有关chfn更多的信息。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/chfn.png) + +下面我们看另外一个例子。 + +我们已经配置auditd去监控目录 /production/ 了。这是个新目录。所以我们用ausearch去查看日志的时候会发现什么都没有。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/ausearch_production_empty.png) + +下一步,使用root账户的ls命令列出 /production/ 下的文件信息。再次使用ausearch后,将会显示一些信息。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/ausearch_production_ls.png) + +> **time->**Mon Dec 22 14:18:28 2014 +> type=PATH msg=audit(1419232708.344:527): item=0 **name="/production/"** inode=797104 dev=08:01 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL +> type=CWD msg=audit(1419232708.344:527): cwd="/root" +> type=SYSCALL msg=audit(1419232708.344:527): arch=40000003 syscall=295 success=yes exit=3 a0=ffffff9c a1=95761e8 a2=98800 a3=0 items=1 ppid=3033 pid=3444 **auid=4294967295 uid=0 gid=0** euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=4294967295 **comm="ls" exe="/bin/ls"** key=(null) + +和上一个一样,可以得出root账户使用ls命令访问了/production/目录,ls命令的文件目录是 /bin/ls + +### 查看审计报告 ### + +一旦定义审计规则后,它会自动运行。过一段时间后,我们可以看看auditd是如何帮我们跟踪审计的。 + +Auditd提供了另一个工具叫 **aureport** 。从名字上可以猜到, **aureport** 是使用系统日志生成简要报告的工具。 + +我们已经配置auditd去跟踪/etc/passwd文件。auditd参数设置后一段时间后,audit.log 文件就创建出来了。 + +生成审计报告,我们可以使用aureport工具。不带参数运行的话,可以生成审计活动的概述。 + + $ sudo aureport + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/aureport_2.png) + +如上,报告包含了大多数重要区域的信息。 + +上图可以看出有 **3 次授权失败**。 使用aureport,我们可以深入查看这些信息。 + +使用以下命令查看授权失败的详细信息: + + $ sudo aureport -au + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/aureport_authentication.png) + +从上图可以看出,由两个用户在特定的时间授权失败。 + +如果我们想看所有相关账户修改的事件,可以使用-m参数。 + + $ sudo aureport -m + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/aureport_m.png) + +### Auditd 配置文件 ### + +我们已经添加如下规则: + +- $ sudo auditctl -w /production/ +- 现在,如果确信这些规则正常,我们可以将其添加到**/etc/audit/audit.rules**中使得规则永久有效。以下介绍如何将他们添加到/etc/audit/audit.rules中去。 + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/audit_rules_file.png) + +**最后,别忘了重启auditd守护程序** + + # /etc/init.d/auditd restart + +或 + + # service auditd restart + +![](http://blog.linoxide.com/wp-content/uploads/2014/12/audit_restart.png) + +### 总结 ### + +Auditd是Linux上的一个审计工具。你可以阅读auidtd文档获取更多使用auditd和工具的细节。例如,输入 **man auditd** 去看auditd的详细说明,或者键入 **man ausearch** 去看有关 ausearch 工具的详细说明。 + +**请谨慎创建规则**。太多规则会使得日志文件急剧增大! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/auditd-tool-security-auditing/ + +作者:[Pungki Arianto][a] +译者:[shipsw](https://github.com/shipsw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/pungki/ +[1]:http://linoxide.com/tools/wajig-package-management-debian/ diff --git a/translated/tech/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md b/translated/tech/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md deleted file mode 100644 index f4edd9e627..0000000000 --- a/translated/tech/20150115 Tips for Apache Migration From 2.2 to 2.4 on Ubuntu 14.04.md +++ /dev/null @@ -1,56 +0,0 @@ -Ubuntu 14.04 Apache2.2迁移2.4问题解决 -================================================================================ -如果你进行了一次**Ubuntu**从12.04到14.04的升级,那么这次升级还包括了一个重大的升级--**Apache**从2.2版本到2.4版本。**Apache**的这次升级带来了许多性能提升,但是如果继续使用2.2的配置会导致很多错误。 - -### 访问控制的改变 ### - -从**Apache 2.4**起,授权(authorization)开始启用,比起2.2的一个检查一个数据存储,授权更加灵活。过去很难确定那些命令授权应用了,但是授权(authorization)的引入解决了这些问题,现在,配置可以控制什么时候授权方法被调用,什么条件决定何时授权访问。 - -这就是为什么大多数的升级失败是由于错误配置,2.2的访问控制基于IP地址,主机名和其他字符通过使用指令Order,来设置Allow, Deny或 Satisfy,但是2.4,这些一切被新模板授权(authorization)来替代检查。 - -为了弄清楚这些,可以来看一些虚拟主机的例子,这些可以在/etc/apache2/sites-enabled/default 或者 /etc/apache2/sites-enabled/网页名称 中找到: - -老2.2虚拟主机配置: - - Order allow,deny - Allow from all - -新2.4虚拟主机配置: - - Require all granted - -![apache 2.4 config](http://blog.linoxide.com/wp-content/uploads/2014/12/apache-2.4-config.jpg) - -### .htaccess 问题 ### - -升级后如果一些设置不执行或者得到重定向错误,检查是否这些设置是在.htaccess文件中。如果是,2.4已经不再使用.htaccess文件,在2.4中默认使用AllowOverride指令来设置,因此忽略了.htaccess文件。你需要做的就是改变和增加AllowOverride All命令到你的页面配置文件中。 - -上面截图中,可以看见AllowOverride All指令。 - -### 丢失配置文件或者模块 ### - -根据我的经验,这次升级带了其他问题就是老模块和配置文件不再需要或者不被支持了。所以你必须十分清楚Apache不再支持的各种文件,并且在老配置中移除这些老模块来解决问题。之后你可以搜索和安装相似的模块来替代。 - -### 其他需要的知道的小改变 ### - -这里还有一些其他改变的需要考虑,虽然这些通常只会发生警告,而不是错误。 - -- MaxClients重命名为MaxRequestWorkers,使之有更准确的描述。而异步MPM,如event,客服端最大连接数不量比与工作线程数。老名字依然支持。 -- DefaultType命令无效,使用它已经没有任何效果了。需要使用其他配置设定来替代它 -- EnableSendfile默认关闭 -- FileETag 默认"MTime Size"(没有INode) -- KeepAlive 只接受On或Off值。之前的任何值不是Off或者0都认为是On -- Mutex 替代 Directives AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex, 和 WatchdogMutexPath 。需要删除或者替代所有2.2老配置的设置。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/apache-migration-2-2-to-2-4-ubuntu-14-04/ - -作者:[Adrian Dinu][a] -译者:[Vic020/VicYu](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/adriand/ -[1]:http://httpd.apache.org/docs/2.4/ diff --git a/translated/tech/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md b/translated/tech/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md deleted file mode 100644 index a04fdb1f52..0000000000 --- a/translated/tech/20150122 Linux FAQs with Answers--How to check memory usage on Linux.md +++ /dev/null @@ -1,113 +0,0 @@ -Linux有问必答:如何检查Linux的内存使用状况 -================================================================================ - ->**问题**:我想要监测Linux系统的内存使用状况。有哪些可用的图形界面或者命令行工具来检查当前内存使用情况? - -当涉及到Linux系统性能优化的时候,物理内存是一个最重要的因素。自然的,Linux提供了丰富的选择来监测对于珍贵的内存资源的使用。不同的工具,在监测粒度(例如:全系统范围, 每个进程, 每个用户),接口(例如:图形用户界面, 命令行, ncurses)或者运行模式(交互模式, 批量处理模式)上都不尽相同。 - -下面是一个可供选择的但并不全面的图形或命令行工具列表,这些工具用来检查并且释放Linux平台中内存。 - -### 1. /proc/meminfo ### - -一种最简单的方法是通过“/proc/meminfo”来检查内存使用状况。这个动态更新的虚拟文件事实上是许多信息资源的集中展示,这些资源来自于诸如free,top和ps这些与内存相关的工具。从可用/闲置物理内存数量到等待被写入缓存的数量或者已写回磁盘的数量,只要是你想要的关于内存使用的信息,“/proc/meminfo”应有尽有。特定进程的内存信息也可以通过“/proc//statm”和“/proc//status”来获取。 - - $ cat /proc/meminfo - -![](https://farm8.staticflickr.com/7483/15989497899_bb6afede11_b.jpg) - -### 2. atop ### - -atop命令是用于终端环境的基于ncurses的交互系统和进程监测工具。它展示了动态更新的系统资源(中央处理器, 内存, 网络, 输入/输出, 内核)摘要,并且用醒目的颜色将高系统负载的警告信息标注出来。它同样提供了类似于top的线程(或用户)资源使用视图,因此系统管理员可以指出哪个进程或者用户对系统负载负责。内存统计报告包括了总计/闲置内存,缓存的/缓冲的内存 和 提交的虚拟内存。 - - $ sudo atop - -![](https://farm8.staticflickr.com/7552/16149756146_893773b84c_b.jpg) - -### 3. free ### - -free命令是一个用来获得内存使用概况的快速简单的方法,这些信息从“/proc/meminfo”获取。它提供了一个快照用于展示总计/闲置的物理内存和系统交换区,以及已使用/闲置的内核缓冲区。 - - $ free -h - -![](https://farm8.staticflickr.com/7531/15988117988_ba8c6b7b63_b.jpg) - -### 4. GNOME System Monitor ### - -GNOME System Monitor 是一个图形界面应用,它展示了包括中央处理器,内存,交换区和网络在内的系统资源使用率的短暂历史记录。它同时也可以提供一个带有中央处理器和内存使用情况的进程视图。 - - $ gnome-system-monitor - -![](https://farm8.staticflickr.com/7539/15988118078_279f0da494_c.jpg) - -### 5. htop ### - -htop命令是一个基于ncurses的交互处理视图,它实时展示了每个进程的内存使用情况。它可以报告所有运行中进程的常驻内存大小(RSS)、内存中程序的总大小、库大小、共享文件大小、和脏页面大小。你可以横向或者纵向滚动进程列表进行查看。 - - $ htop - -![](https://farm9.staticflickr.com/8236/8599814378_de071de408_c.jpg) - -### 6. KDE System Monitor ### - -就像GNOME桌面拥有GNOME System Monitor一样,KDE桌面也有它自己的对口应用:KDE System Monitor。这个工具的功能与GNOME版本极其相似,也就是说,它同样展示了一个关于系统资源使用情况,以及带有每个进程的中央处理器/内存消耗情况的实时历史记录。 - - $ ksysguard - -![](https://farm8.staticflickr.com/7479/15991397329_ec5d786ffd_c.jpg) - -### 7. memstat ### - -memstat工具对于识别正在消耗虚拟内存的可执行文件、进程和共享库非常有用。给出一个进程识别号,memstat即可识别出与之相关联的可执行文件、数据和共享库究竟使用了多少虚拟内存。 - - $ memstat -p - -![](https://farm8.staticflickr.com/7518/16175635905_1880e50055_b.jpg) - -### 8. nmon ### - -nmon工具是一个基于ncurses系统基准测试工具,它能够以交互方式监测中央处理器、内存、磁盘输入/输出、内核、文件系统以及网络资源。对于内存使用状况而言,它能够展示像总计/闲置内存、交换区、缓冲的/缓存的内存,虚拟内存页面输入输出统计,所有这些都是实时的。 - - $ nmon - -![](https://farm9.staticflickr.com/8648/15989760117_30f62f4aba_b.jpg) - -### 9. ps ### - -ps命令能够实时展示每个进程的内存使用状况。内存使用报告里包括了 %MEM (物理内存使用百分比), VSZ (虚拟内存使用总量), and RSS (物理内存使用总量)。你可以使用“--sort”选项来对进程列表排序。例如,按照RSS降序排序: - - $ ps aux --sort -rss - -![](https://farm9.staticflickr.com/8602/15989881547_ca40839c19_c.jpg) - -### 10. smem ### - -[smem][1]命令允许你测定不同进程和用户的物理内存使用状况,这些信息来源于“/proc”目录。它利用比例设置大小(PSS)指标来精确量化Linux进程的有效内存使用情况。内存使用分析能够扩展成为柱状图或者饼图类的图形化图表。 - - $ sudo smem --pie name -c "pss" - -![](https://farm8.staticflickr.com/7466/15614838428_eed7426cfe_c.jpg) - -### 11. top ### - -top命令提供了一个运行中进程的实时视图,以及特定进程的各种资源使用统计信息。与内存相关的信息包括 %MEM (内存使用率), VIRT (虚拟内存使用总量), SWAP (交换出的虚拟内存使用量), CODE (分配给代码执行的物理内存数量), DATA (分配给无需执行的数据的物理内存数量), RES (物理内存使用总量; CODE+DATA), and SHR (有可能与其他进程共享的内存数量).你能够基于内存使用情况或者大小对进程列表进行排序。 - -![](https://farm8.staticflickr.com/7464/15989760047_eb8d51d9f2_c.jpg) - -### 12. vmstat ### - -vmstat命令行工具显示涵盖了中央处理器、内存、中断和磁盘输入/输出在内的各种系统活动的瞬时和平均统计数据。对于内存信息而言,命令不仅仅展示了物理内存使用情况(例如总计/已使用内存和缓冲的/缓存的内存),还同样展示了虚拟内存统计数据(例如,内存的页输入/输出,交换输入/输出) - - $ vmstat -s - -![](https://farm9.staticflickr.com/8582/15988236860_3f142008d2_b.jpg) - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/check-memory-usage-linux.html - -译者:[Ping](https://github.com/mr-ping) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://xmodulo.com/visualize-memory-usage-linux.html \ No newline at end of file diff --git a/sources/tech/20150125 A Shell Primer--Master Your Linux OS X Unix Shell Environment.md b/translated/tech/20150125 A Shell Primer--Master Your Linux OS X Unix Shell Environment.md similarity index 55% rename from sources/tech/20150125 A Shell Primer--Master Your Linux OS X Unix Shell Environment.md rename to translated/tech/20150125 A Shell Primer--Master Your Linux OS X Unix Shell Environment.md index eafc6d21e5..2709602c87 100644 --- a/sources/tech/20150125 A Shell Primer--Master Your Linux OS X Unix Shell Environment.md +++ b/translated/tech/20150125 A Shell Primer--Master Your Linux OS X Unix Shell Environment.md @@ -1,44 +1,44 @@ -A Shell Primer: Master Your Linux, OS X, Unix Shell Environment +Shell入门:掌握Linux,OS X,Unix的Shell环境 ================================================================================ -On a Linux or Unix-like systems each user and process runs in a specific environment. An environment includes variables, settings, aliases, functions and more. Following is a very brief introduction to some useful shell environment commands, including examples of how to use each command and setup your own environment to increase productivity in the command prompt. +在Linux或类Unix系统中,每个用户和进程都运行在一个特定环境中。这个环境包含了变量,设置,别名,函数以及更多的。下面是对Shell环境下一些常用命令的简单介绍,包括每个命令如何使用的例子,以及在命令行下设定你自己的环境来提高效率。 ![](http://s0.cyberciti.org/uploads/cms/2015/01/bash-shell-welcome-image.jpg) -### Finding out your current shell ### +### 找出你当前的shell ### -Type any one of the following command at the Terminal app: +在终端应用中输入下面命令中的任意一个: ps $$ ps -p $$ -OR +或者 echo "$0" -Sample outputs: +输出范例: -[![Fig.01: Finding out your shell name](http://s0.cyberciti.org/uploads/cms/2015/01/finding-your-shell-like-a-pro.jpg)][1] -Fig.01: Finding out your shell name +[![图1: Finding out your shell name](http://s0.cyberciti.org/uploads/cms/2015/01/finding-your-shell-like-a-pro.jpg)][1] +图1:找出当前的shell -### Finding out installed shells ### +### 找出所有已安装的shell ### -To find out the full path for installed shell type: +找到已安装shell的完整路径: type -a zsh type -a ksh type -a sh type -a bash -Sample outputs: +输出范例: [![Fig.02: Finding out your shell path](http://s0.cyberciti.org/uploads/cms/2015/01/finding-and-verifying-shell-path.jpg)][2] -Fig.02: Finding out your shell path +图2:找出shell的路径 -The /etc/shells file contains a list of the shells on the system. For each shell a single line should be present, consisting of the shell's path, relative to root. Type the following [cat command][3] to see shell database: +文件/etc/shells里包含了系统支持的shell列表。每一行代表一个shell,是相对根目录的完整路径。用这个[cat命令][3]来查看这些数据: cat /etc/shells -Sample outputs: +输出范例: # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using @@ -52,47 +52,47 @@ Sample outputs: /bin/zsh /usr/local/bin/fish -### Changing your current shell temporarily ### +### 临时改变当前shell ### -Just type the shell name. In this example, I'm changing from bash to zsh: +只需要输入shell的名字。在下面的例子里,我从bash切换到了zsh: zsh -You just changed your shell temporarily to zsh. Also known as subshell. To exit from subshell/temporary shell, type the following command or hit CTRL-d: +这只是临时改变了系统shell。也叫做子shell。要从子/临时shell退出,输入下面的命令或者按下CTRL-D: exit -### Finding out subshell level/temporary shell nesting level ### +### 找出子shell的层级或临时shell的嵌套层级 ### -The $SHLVL incremented by one each time an instance of bash is started. Type the following command: +每个bash实例启动后,变量$SHLVL的值都会加一。输入下面的命令: echo "$SHLVL" -Sample outputs: +示例输出: [![Fig. 03: Bash shell nesting level (subshell numbers)](http://s0.cyberciti.org/uploads/cms/2015/01/a-nested-shell-level-command.jpg)][4] -Fig. 03: Bash shell nesting level (subshell numbers) +图3:Bash shell嵌套层级(子shell数目) -### Changing your current shell permanently with chsh command ### +### 通过chsh命令永久变更系统shell ### -Want to change your own shell from bash to zsh permanently? Try: +想要把当前系统shell从bash永久换成zsh?试试这个: chsh -s /bin/zsh -Want to change the other user's shell from bash to ksh permanently? Try: +想把其他用户的shell从bash永久换成ksh?试试这个: sudo chsh -s /bin/ksh userNameHere -### Finding out your current environment ### +### 查看当前的环境 ### -You need to use the +你需要用到 env env | more env | less env | grep 'NAME' -Sample outputs: +示例输出: TERM_PROGRAM=Apple_Terminal SHELL=/bin/bash @@ -115,12 +115,12 @@ Sample outputs: _=/usr/bin/env OLDPWD=/Users/vivek -Here is a table of commonly used bash shell variables: +下面是bash shell里一些常见变量的列表: ![Fig.04: Common bash environment variables](http://s0.cyberciti.org/uploads/cms/2015/01/common-shell-vars.jpg) -Fig.04: Common bash environment variables +图4:常见bash环境变量 -> **Warning**: It is always a good idea not to change the following environment variables. Some can be changed and may results into unstable session for you: +> **注意**:下面这些环境变量没事不要乱改。很可能会造成不稳定的shell会话: > > SHELL > @@ -140,163 +140,162 @@ Fig.04: Common bash environment variables > > LINENO -### Displays the values of environment variables ### +### 显示环境变量的值 ### -Use any one of the following command to show the values of environment variable called HOME: +使用下面任意一条命令显示环境变量HOME的值: - ## Use printenv ## + ## 使用printenv ## printenv HOME - ## or use echo ## + ## 或者用echo ## echo "$HOME" - # or use printf for portability ## + # 考虑到可移植性,也可以用printf ## printf "%s\n" "$HOME" -Sample outputs: +示例输出: /home/vivek -### Adding or setting a new variables ### +### 增加或设定一个新变量 ### -The syntax is as follows in bash or zsh or sh or ksh shell: +下面是bash,zsh,sh和ksh的语法: - ## The syntax is ## + ## 语法 ## VAR=value FOO=bar - ## Set the default editor to vim ## + ## 设定vim为默认文本编辑器 ## EDITOR=vim export $EDITOR - ## Set default shell timeout for security ## + ## 考虑安全性,设定默认shell连接超时时间 ## TMOUT=300 export TMOUT - ## You can directly use export command to set the search path for commands ## + ## 你可以直接使用export命令设定命令的搜素路径 ## export PATH=$PATH:$HOME/bin:/usr/local/bin:/path/to/mycoolapps -Again, use the printenv or echo or printf command to see the values of environment variables called PATH, EDITOR, and TMOUT: +然后,使用printenv或者echo或printf命令查看环境变量PATH,EDITOR,和TMOUT的值: printenv PATH echo "$EDITOR" printf "%s\n" $TMOUT -### How do I change an existing environment variables? ### +### 怎么修改一个现有的环境变量? ### -The syntax is as follows: +下面是语法: export VAR=value - ## OR ## + ## 或者 ## VAR=value export $VAR - ## Change the default editor from vim to emacs ## - echo "$EDITOR" ## <--- print vim - EDITOR=emacs ## <--- change it - export $EDITOR ## <--- export it for next session too - echo "$EDITOR" ## <--- print emacs + ## 把默认文本编辑器从vim改为emacs ## + echo "$EDITOR" ## <--- 屏幕输出vim + EDITOR=emacs ## <--- 修改 + export $EDITOR ## <--- 让修改在其他会话生效 + echo "$EDITOR" ## <--- 屏幕输出emacs -The syntax is as follows for the **tcsh shell for adding or changing a variables**: +**tcsh shell下增加和修改变量**的语法是下面这样的: - ## Syntax + ## 语法 setenv var value printenv var - ## Set foo variable with bar as a value ## + ## 设置变量foo的值为bar ## setenv foo bar echo "$foo" printenv foo - ## Set PATH variable ## + ## 设置变量PATH ## setenv PATH $PATH\:$HOME/bin echo "$PATH" - ## set PAGER variable ## + ## 设置变量PAGER ## setenv PAGER most printf "%s\n" $PAGER -### Finding your bash shell configuration files ### +### 找出bash shell的配置文件 ### -Type the following command to list your bash shell files, enter: +用下面的命令列出bash shell的文件: ls -l ~/.bash* ~/.profile /etc/bash* /etc/profile -Sample output: +示例输出: [![Fig.05: List all bash environment configuration files](http://s0.cyberciti.org/uploads/cms/2015/01/list-bash-enviroment-variables.jpg)][5] -Fig.05: List all bash environment configuration files +图5:列出bash的所有配置文件 -To look at all your bash config files, enter: +要查看所有的bash配置文件,输入: less ~/.bash* ~/.profile /etc/bash* /etc/profile -You can edit bash config files one by one using the text editor such as vim or emacs: +可以使用文字编辑器比如vim或emacs来一个一个编辑bash配置文件: vim ~/.bashrc -To edit files located in /etc/, type: +编辑/etc/目录下的文件,输入: - ## first make a backup.. just in case + ## 首先是备份,以防万一 sudo cp -v /etc/bashrc /etc/bashrc.bak.22_jan_15 ######################################################################## - ## Alright, edit it to your hearts content and by all means, have fun ## - ## with your environment or just increase the productivity :) ## + ## 然后,随心所欲随便改吧,好好玩玩shell环境或者提高一下效率:) ## ######################################################################## sudo vim /etc/bashrc -### Confused by Bash shell Initialization files? ### +### 被Bash shell初始化过程中应用的文件搞糊涂了吗? ### -The following "bash file initialization" graph will help you: +下面的"bash初始化文件"流程图应该有些帮助: ![](http://s0.cyberciti.org/uploads/cms/2015/01/BashStartupfiles.jpg) -Depending on which shell is set up as your default, your user profile or system profile can be one of the following: +根据账户设定的默认shell,你的用户配置或系统配置可能是下面其中一种: -### Finding your zsh shell configuration files ### +### 找出zsh shell配置文件 ### -The zsh [wiki][6] recommend the following command: +zsh的[wiki][6]中建议用下面的命令: strings =zsh | grep zshrc -Sample outputs: +示例输出: /etc/zshrc .zshrc -Type the following command to list your zsh shell files, enter: +输入下面的命令列出你的zsh shell文件: ls -l /etc/zsh/* /etc/profile ~/.z* -To look at all your zsh config files, enter: +查看所有zsh配置文件: less /etc/zsh/* /etc/profile ~/.z* -### Finding your ksh shell configuration files ### +### 找出ksh shell配置文件 ### -1. See ~/.profile or /etc/profile file. +1. 查看~/.profile或者/etc/profile文件。 -### Finding your tcsh shell configuration files ### +### 找出tcsh shell配置文件 ### -1. See ~/.login, ~/.cshrc for the C shell. -2. See ~/.tcshrc and ~/.cshrc for the TC shell. +1. C shell查看~/.login,~/.cshrc文件。 +2. TC shell查看~/.tcshrc和~/.cshrc文件。 -### Can I have a script like this execute automatically every time I login? ### +### 我可以写个类似这样每次登录时都自动执行的脚本吗? ### -Yes, add your commands or aliases or other settings to ~/.bashrc (bash shell) or ~/.profile (sh/ksh/bash) or ~/.login (csh/tcsh) file. +是的,把你的命令或别名或其他设定添加到~/.bashrc(bash shell)或者~/.profile(sh/ksh/bash)或者~/.login(csh/tcsh)文件中。 -### Can I have a script like this execute automatically every time I logout? ### +### 我可以写个类似这样每次登出都自动执行的脚本吗? ### -Yes, add your commands or aliases or other settings to ~/.bash_logout (bash) or ~/.logout (csh/tcsh) file. +是的,把你的命令或别名或其他设定添加到~/.bash_logout(bash)或者~/.logout(csh/tcsh)文件。 -### History: Getting more info about your shell session ### +### history:获取关于shell会话的更多信息 ### -Just type the history command to see session history: +输入history命令来查看本次会话的历史: history -Sample outputs: +示例输出: 9 ls 10 vi advanced-cache.php @@ -320,56 +319,56 @@ Sample outputs: 98 smartctl -A /dev/sg1 | grep -i temperature 99 sensors -Type history 20 to see the last 20 commands from your history: +输入history 20来查看命令历史的后20条: history 20 -Sample outputs: +示例输出: [![Fig.06: View session history in the bash shell using history command](http://s0.cyberciti.org/uploads/cms/2015/01/history-outputs.jpg)][7] -Fig.06: View session history in the bash shell using history command +图6:在bash shell中使用history命令查看会话历史 -You can reuses commands. Simply hit [Up] and [Down] arrow keys to see previous commands. Press [CTRL-r] from the shell prompt to search backwards through history buffer or file for a command. To repeat last command just type !! at a shell prompt: +你可以重复使用命令。简单地按下[上]或[下]方向键就可以查看之前的命令。在shell提示符下按下[CTRL-R]可以向后搜索历史缓存或文件来查找命令。重复最后一次命令,只需要在shell提示符下输入!!就好了: ls -l /foo/bar !! -To see command #93 (hddtemp /dev/sda)from above history session, type: +在以上的历史记录中查看命令#93 (hddtemp /dev/sda),输入: !93 -### Changing your identity with sudo or su ### +### 使用sudo或su改变用户 ### -The syntax is as follows: +下面是语法: su userName - ## To log in as a tom user ## + ## 登录为tom用户 ## su tom - ## To start a new login shell for tom user ## + ## 为用户tom打开一个新的shell会话 ## su tom - ## To login as root user ## + ## 登录为root用户 ## su - - ## The sudo command syntax (must be configured on your system) ## + ## sudo命令语法(必须在系统中配置有这个命令) ## sudo -s sudo tom -See "[Linux Run Command As Another User][8]" post for more on sudo, su and runuser commands. +看看帖子"[Linux下使用其他用户身份运行命令][8]"更多地了解sudo,su和runuser命令。 -### Shell aliases ### +### shell别名 ### -An alias is nothing but shortcut to commands. +别名仅仅是命令的一个快捷方式。 -### Listing aliases ### +### 列出所有的别名 ### -Type the following command: +输入下面的命令: alias -Sample outputs: +示例输出: alias ..='cd ..' alias ...='cd ../../../' @@ -387,31 +386,31 @@ Sample outputs: alias egrep='egrep --color=auto' alias ethtool='ethtool eth1' -### Create an alias ### +### 设定一个别名 ### -The bash/zsh syntax is: +bash/zsh语法: alias c='clear' alias down='sudo /sbin/shutdown -h now' -Type c alias for the system command clear, so we can type c instead of clear command to clear the screen: +对于命令clear可以输入c别名,这样我们就可以输入c代替clear命令来清空屏幕: c -Or type down to shutdown the Linux based server: +或者输入down来关闭基于Linux的服务器: down -You can create as many aliases you want. See "[30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X][9]" for practical usage of aliases on Unix-like system. +你可以设定任意多的别名。看下"[Linux/Unix/Mac OS X系统中的30个方便的bash shell别名][9]"了解在类Unix系统中别名的实际应用。 -### Shell functions ### +### shell函数 ### -Bash/ksh/zsh functions allows you further customization of your environment. In this example, I'm creating a simple bash function called memcpu() to display top 10 cpu and memory eating process: +Bash/ksh/zsh函数允许你更进一步地配置shell环境。在这个例子中,我写了一个简单的名叫memcpu()的bash函数,用来显示前10个最占用CPU和内存的进程: memcpu() { echo "*** Top 10 cpu eating process ***"; ps auxf | sort -nr -k 3 | head -10; echo "*** Top 10 memory eating process ***"; ps auxf | sort -nr -k 4 | head -10; } -Just type memcpu to see the info on screen: +输入memcpu就可以在屏幕上看到下面的信息: memcpu @@ -439,95 +438,95 @@ Just type memcpu to see the info on screen: squid 9995 0.0 0.5 175152 72396 ? S 2014 27:00 \_ (squid) -f /etc/squid/squid.conf cybercit 3922 0.0 0.4 303380 56304 ? S Jan10 0:13 | \_ /usr/bin/php-cgi -See "[how to write and use shell functions][10]" for more information. +看下"[如何编写和应用shell函数][10]"了解更多信息。 -### Putting it all together: Customizing your Linux or Unix bash shell working environment ### +### 综合一下:定制你自己的Linux或Unix bash shell工作环境 ### -Now, you are ready to configure your environment using bash shell. I'm only covering bash. But the theory remains same from zsh, ksh and other common shells. Let us see how to adopt shell to my need as a sysadmin. Edit your ~/.bashrc file and append settings. Here are some useful configuration options for you. +现在,你将使用bash shell配置自己的环境。我只介绍bash。但是理论上zsh,ksh和其他常用shell都差不多。让我们看看如何调整shell来适合我作为系统管理员的需求。编辑你的~/.bashrc文件来附加设定。下面是一些常用的配置选项。 -#### #1: Setting up bash path and environment variables #### +#### #1: 设定bash路径和环境变量 #### - # Set path ## + # 设定路径 ## export PATH=$PATH:/usr/local/bin:/home/vivek/bin:/opt/firefox/bin:/opt/oraapp/bin - # Also set path for cd command + # 为cd命令设定路径 export CDPATH=.:$HOME:/var/www -Use less or most command as a pager: +使用less或more命令作为翻页器: export PAGER=less -Set vim as default text editor for us: +设定vim作为默认文本编辑器: export EDITOR=vim export VISUAL=vim export SVN_EDITOR="$VISUAL" -Set Oracle database specific stuff: +设定Oracle数据库特别要求的参数: export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server export ORACLE_SID=XE export NLS_LANG=$($ORACLE_HOME/bin/nls_lang.sh) -Set JAVA_HOME and other paths for java as per java version: +设定JAVA_HOME和其他java路径,比如java版本: export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre - # Add ORACLE, JAVA to PATH + # 把ORACLE和JAVA加入到PATH里 export PATH=$PATH:$ORACLE_HOME/bin:$JAVA_HOME/bin -Secure my remote [SSH login using keychain for password less login][11]: +[使用密钥实现免密码登录][11]让ssh远程登录更安全: - # No need to input password again ever + # 再也不用输密码了 /usr/bin/keychain $HOME/.ssh/id_rsa source $HOME/.keychain/$HOSTNAME-sh -Finally, [turn on bash command completion][12] +最后,[打开bash命令补齐][12] source /etc/bash_completio -#### #2: Setting up bash command prompt #### +#### #2: 设定bash命令提示符 #### -Set [custom bash prompt (PS1)][13]: +设定[定制的bash提示符(PS1)][13]: PS1='{\u@\h:\w }\$ ' -#### #3: Setting default file permissions #### +#### #3: 设定默认文件权限 #### - ## Set default to 644 ## + ## 设定默认权限为644 ## umask 022 -#### #4: Control your shell history settings #### +#### #4: 调整shell命令历史设定 #### - # Dont put duplicate lines in the history + # 不往命令历史里写入相同的行 HISTCONTROL=ignoreboth - # Ignore these commands + # 忽略这些命令 HISTIGNORE="reboot:shutdown *:ls:pwd:exit:mount:man *:history" - # Set history length via HISTSIZE and HISTFILESIZE + # 通过HISTSIZE和HISTFILESIZE设定命令历史的长度 export HISTSIZE=10000 export HISTFILESIZE=10000 - # Add timestamp to history file. + # 为命令历史文件增加时间戳 export HISTTIMEFORMAT="%F %T " - #Append to history, don't overwrite + # 附加到命令历史文件,俄不是覆盖 shopt -s histappend -#### #5: Set the time zone for your session #### +#### #5: 设定shell会话的时区 #### - ## set to IST for my own session ## + ## 为我自己的shell会话设定IST(印度标准时间) ## TZ=Asia/Kolkata -#### #6: Setting up shell line editing interface #### +#### #6: 设定shell行编辑接口 #### - ## use a vi-style line editing interface for bash from default emacs mode ## + ## 使用vi风格的行编辑接口,替代bash默认的emacs模式 ## set -o vi -#### #7: Setting up your favorite aliases #### +#### #7: 设定自己喜好的别名 #### - ## add protection ## + ## 增加一些保护 ## alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' @@ -537,7 +536,7 @@ Set [custom bash prompt (PS1)][13]: alias mcdshow='/usr/bin/memcached-tool 10.10.29.68:11211 display' alias mcdflush='echo "flush_all" | nc 10.10.29.68 11211' - ## Default command options ## + ## 默认命令参数 ## alias vi='vim' alias grep='grep --color=auto' alias egrep='egrep --color=auto' @@ -550,41 +549,41 @@ Set [custom bash prompt (PS1)][13]: alias rm='rm -I --preserve-root' alias ln='ln -i' -Here are some additional OS X Unix bash shell aliases: +下面是一些额外的OS X Unix bash shell别名: - # Open desktop apps from bash + # 从bash打开桌面应用 alias preview="open -a '$PREVIEW'" alias safari="open -a safari" alias firefox="open -a firefox" alias chrome="open -a google\ chrome" alias f='open -a Finder ' - # Get rid of those .DS_Store files + # 清理那些.DS_Store文件 alias dsclean='find . -type f -name .DS_Store -delete' -#### #8: Colour my world #### +#### #8: 让世界充满色彩 #### - # Get colored grep output + # 彩色的grep输出 alias grep='grep --color=auto' export GREP_COLOR='1;33' - # colored ls too + # 彩色的ls export LSCOLORS='Gxfxcxdxdxegedabagacad' - # Gnu/linux ls + # Gnu/linux的ls ls='ls --color=auto' - # BSD/os x ls command + # BSD/os x的ls命令 # alias ls='ls -G' -#### #9: Setting up your favorite bash functions #### +#### #9: 设定自己喜好的bash函数 #### - # Show top 10 history command on screen + # 在屏幕上显示10个最近的历史命令 function ht { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head } - # Wrapper for host and ping command - # Accept http:// or https:// or ftps:// names for domain and hostnames + # host和ping命令的替代 + # 接受http:// 或 https:// 或 ftps:// 名称用作域或主机名 _getdomainnameonly(){ local h="$1" local f="${h,,}" @@ -628,48 +627,48 @@ Here are some additional OS X Unix bash shell aliases: $_host $args $c } -#### #10: Configure bash shell behavior via shell shopt options command #### +#### #10: 通过shell shopt命令设定bash shell行为 #### -Finally, you can [make changes to your bash shell environment using set and shopt][14] commands: +最后,你可以[使用set和shopt命令调整bash shell环境][14]: - # Correct dir spellings + # 目录拼写纠正 shopt -q -s cdspell - # Make sure display get updated when terminal window get resized + # 保证每次终端窗口改变大小后会更新显示 shopt -q -s checkwinsize - # Turn on the extended pattern matching features + # 打开高级模式匹配功能 shopt -q -s extglob - # Append rather than overwrite history on exit + # 退出时附加命令历史而不是覆盖 shopt -s histappend - # Make multi-line commandsline in history + # 在命令历史使用多行 shopt -q -s cmdhist - # Get immediate notification of background job termination + # 在后台任务结束时立刻通知 set -o notify - # Disable [CTRL-D] which is used to exit the shell + # 禁用[CTRL-D]来结束shell set -o ignoreeof -### Conclusion ### +### 总结 ### -This post is by no means comprehensive. It provided a short walkthrough of how to customize your enviorment. For a thorough look at bash/ksh/zsh/csh/tcsh capabilities, I suggest you read the man page by typing the following command: +这个帖子不难理解。它简短地将如何定制用户环境从头介绍了一下。要深入了解bash/ksh/zsh/csh/tcsh/的能力,我建议你用下面的命令阅读man文档: man bash man zsh man tcsh man ksh -> This article was contributed by Aadrika T. J.; Editing and additional content added by admin. You can too [contribute to nixCraft][15]. +> 这篇文章由Aadrika T. J.贡献;由admin编辑并增加了额外内容。你也可以[为nixCraft做出贡献][15]。 -------------------------------------------------------------------------------- via: http://www.cyberciti.biz/howto/shell-primer-configuring-your-linux-unix-osx-environment/ 作者:[nixCraft][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zpl1025](https://github.com/zpl1025) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -689,4 +688,4 @@ via: http://www.cyberciti.biz/howto/shell-primer-configuring-your-linux-unix-osx [12]:http://www.cyberciti.biz/faq/fedora-redhat-scientific-linuxenable-bash-completion/ [13]:http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html [14]:http://bash.cyberciti.biz/guide/Setting_shell_options -[15]:http://www.cyberciti.biz/write-for-nixcraft/ \ No newline at end of file +[15]:http://www.cyberciti.biz/write-for-nixcraft/ diff --git a/translated/tech/20150126 4 lvcreate Command Examples on Linux.md b/translated/tech/20150126 4 lvcreate Command Examples on Linux.md new file mode 100644 index 0000000000..145f2c52ee --- /dev/null +++ b/translated/tech/20150126 4 lvcreate Command Examples on Linux.md @@ -0,0 +1,93 @@ +在linux中4个lvcreate命令例子 +================================================================================ +逻辑卷管理(LVM)是广泛使用的技术,并拥有极其灵活磁盘管理方案。主要包含3个基础命令: + +a. 创建物理卷使用**pvcreate** +b. 创建卷组并给卷组增加分区**vgcreate** +c. 创建新的逻辑卷使用**lvcreate** + +![](http://www.ehowstuff.com/wp-content/uploads/2015/01/lvm-diagram1.jpg) + +随后的例子着重在已经存在的卷组上使用**lvcreate**创建逻辑卷。**lvcreate**命令可以在来自自由物理扩展池的卷组分配逻辑扩展。通常,逻辑卷可以随意使用底层逻辑卷上的任意空间。修改逻辑卷将释放或重新分配在物理卷空间。这些例子已经在CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6 和 RHEL 7 版本中测试通过。 + +### 4个lvcreate命令例子 ### + +1. 在名为vg_newlvm卷组中创建15G大小的逻辑卷: + + [root@centos7 ~]# lvcreate -L 15G vg_newlvm + +2. 在名为vg_newlvm中创建大小为2500MB的逻辑卷并命名centos7_newvol,创建块设备/dev/vg_newlvm/centos7_newvol: + + [root@centos7 ~]# lvcreate -L 2500 -n centos7_newvol vg_newlvm + +3.可以使用**lvcreate**命令的参数-l,能指定一些特别的逻辑卷扩展大小。也可以使用这个参数以卷组的大小百分比来扩展逻辑卷。这下列的命令创建了centos7_newvol卷组的50%大小的逻辑卷vg_newlvm: + + [root@centos7 ~]# lvcreate -l 50%VG -n centos7_newvol vg_newlvm + +4. 使用卷组剩下的所有空间创建逻辑卷 + + [root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm + +更多帮助,使用**lvcreate**命令--help选项来查看: + + [root@centos7 ~]# lvcreate --help + +---------- +以下空号中是帮助字面翻译 + + lvcreate: Create a logical volume(创建逻辑卷) + + lvcreate + [-A|--autobackup {y|n}](自动备份) + [-a|--activate [a|e|l]{y|n}] + [--addtag Tag](增加标签) + [--alloc AllocationPolicy](分配策略) + [--cachemode CacheMode](Cache模式) + [-C|--contiguous {y|n}] + [-d|--debug] + [-h|-?|--help] + [--ignoremonitoring](忽略监听) + [--monitor {y|n}](监听) + [-i|--stripes Stripes [-I|--stripesize StripeSize]] + [-k|--setactivationskip {y|n}] + [-K|--ignoreactivationskip] + {-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] |(逻辑扩展数) + -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}(逻辑卷大小) + [-M|--persistent {y|n}] [--major major] [--minor minor] + [-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core|mirrored}|--corelog}]](镜像) + [-n|--name LogicalVolumeName](逻辑卷名字) + [--noudevsync] + [-p|--permission {r|rw}] + [--[raid]minrecoveryrate Rate] + [--[raid]maxrecoveryrate Rate] + [-r|--readahead ReadAheadSectors|auto|none](读取头扇区) + [-R|--regionsize MirrorLogRegionSize](镜像逻辑区域尺寸) + [-T|--thin [-c|--chunksize ChunkSize](块大小) + [--discards {ignore|nopassdown|passdown}] + [--poolmetadatasize MetadataSize[bBsSkKmMgG]]] + [--poolmetadataspare {y|n}] + [--thinpool ThinPoolLogicalVolume{Name|Path}]精简池逻辑卷 + [-t|--test] + [--type VolumeType](卷类型) + [-v|--verbose] + [-W|--wipesignatures {y|n}] + [-Z|--zero {y|n}] + [--version] + VolumeGroupName [PhysicalVolumePath...] + + lvcreate + { {-s|--snapshot} OriginalLogicalVolume[Path] | + [-s|--snapshot] VolumeGroupName[Path] -V|--virtualsize VirtualSize} + {-T|--thin} VolumeGroupName[Path][/PoolLogicalVolume] + -V|--virtualsize VirtualSize}( +-------------------------------------------------------------------------------- + +via: http://www.ehowstuff.com/4-lvcreate-command-examples-on-linux/ + +作者:[skytech][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/mhstar/ diff --git a/translated/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md b/translated/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md new file mode 100644 index 0000000000..a49467781e --- /dev/null +++ b/translated/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md @@ -0,0 +1,204 @@ +清理 Ubuntu 14.10,14.04,13.10 系统 +================================================================================ +前面我们已经讨论了[如何清理 Ubuntu GNU/Linux 系统][1],这篇教程将在原有教程的基础上,增加对新的 Ubuntu 发行版本的支持,并介绍更多的工具。 + +假如你想清理你的 Ubuntu 主机,你可以按照以下的一些简单步骤来移除所有不需要的垃圾文件。 + +### 移除多余软件包 ### + +这又是一个内置功能,但这次我们不必使用新得立包管理软件(Synaptic Package Manager),而是在终端中达到目的。 + +现在,在终端窗口中键入如下命令: + +``` +sudo apt-get autoclean +``` + +这便激活了包清除命令。这个命令所做的工作是: 自动清除那些当你安装或升级程序时系统所缓存的 `.deb` 包(即清除 `/var/cache/apt/archives` 目录,不过只清理过时的包)。如果需要使用 清除命令,只需在终端窗口中键入以下命令: + +``` +sudo apt-get clean +``` + +然后你就可以使用自动移除命令。这个命令所做的工作是:清除那些 在系统中被某个已经卸载的软件 作为依赖所安装的软件包。要使用自动移除命令,在终端窗口中键入以下命令: + +``` +sudo apt-get autoremove +``` + +### 移除不需要的本地数据 ### + +为达到此目的,我们需要安装 `localepurge` 软件,它将自动移除一些不需要的本地数据。这个软件是一个简单的脚本,它将从那些 不再需要的本地文件和本地联机手册( man pages ) 所占用的空间中回收磁盘空间。这个软件将在任何 apt 安装命令运行时 被自动激活。 + +在 Ubuntu 中安装 `localepurge` + +``` +sudo apt-get install localepurge +``` + +在通过 `apt-get install` 安装任意软件后, localepurge 将移除所有 不是使用你系统中所设定语言的 翻译文件和翻译的联机手册。 + +假如你想设置 `localepurge`,你需要编辑 `/ect/locale.nopurge` 文件。 + +根据你已经安装的软件,这将为你节省几兆的磁盘空间。 + +例子:- + +假如我试着使用 `apt-get` 来安装 `dicus`软件: + +``` +sudo apt-get install discus +``` + +在软件安装完毕之后,你将看到如下提示: + +> localepurge: Disk space freed in /usr/share/locale: 41860K + +### 移除 孤包 ### + +假如你想移除孤包,你需要安装 `deborphan` 软件: + +在 Ubuntu 中安装 `deborphan` : + +``` +sudo apt-get install deborphan +``` + +### 使用 deborphan ### + +打开终端并键入如下命令即可: + +``` +sudo deborphan | xargs sudo apt-get -y remove --purge +``` + +### 使用 GtkOrphan 来移除 孤包 ### + +`GtkOrphan` (一个针对 debian 系发行版本的 Perl/Gtk2 应用) 是一个分析 用户安装过程状态并查找孤立库文件的图形化工具, 它为 `deborphan` 提供了一个 GUI 前端,并具备移除软件包的功能。 + +### 在 Ubuntu 中安装 GtkOrphan ### + +打开终端并运行如下命令: + +``` +sudo apt-get install gtkorphan +``` + +#### 一张截图 #### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/41.png) + +### 使用 Wajig 移除孤包 ### + +`Wajig`是 Debian 包管理系统中一个简单的软件包管理前端。它将 apt、apt-cache、 dpkg、 /etc/init.d 中的脚本等 通过一个单一命令集成在一起,它的设计初衷是 使用简单 和 为它所包含的函数提供丰富的文档。 + +通过适当的 `sudo`配置,大多数(如果不是全部)的软件包安装和创建等任务可以通过 一个用户 shell 来完成。`Wajig` 也适用于一般的系统管理。另外,一个 Gnome GUI 命令 `gjig`也被囊括在这个软件包之中。 + +### 在 Ubuntu 中安装 Wajig ### + +打开终端并运行如下命令: + +``` +sudo apt-get install wajig +``` + +### Debfoster --- 跟踪你在安装过程中的操作 ### + +debfoster 将会维护一个列有 被明确要求安装的软件包的列表,但不包括那些作为某个软件的依赖而被安装的软件包。参数是完全可选的,你甚至可以使得 在 dpkg 和/或 apt-get 每次运行之后的每一秒内 激活 debfoster 。 + +另外,你还可以在命令行中使用 debfoster 来安装或移除某些特定的软件包。那些后缀为 `---` 的软件包将会被移除,而没有后缀的软件包将会被安装。 + +假如一个新的软件包或 debfoster 注意到 作为某个软件包的依赖的软件包 是一个孤包,则 debfoster 将会询问你下一步如何操作。若你决定保留这个孤包, debfoster 将只会进行记录并继续安装过程;若你觉得这个软件包不足以引起你的兴趣,在 debfoster 询问这个问题后,它将移除这个软件包。进一步的,如果你的决定使得其他的软件包变为孤包,更多的提问将会接踵而来。 + +### 在 Ubuntu 中安装 debfoster ### + +打开终端并运行如下命令: + +``` +sudo apt-get install debfoster +``` + +### 使用 debfoster ### + +为了创建一个 初始跟踪文件,可以使用如下命令: + +``` +sudo debfoster -q +``` + +你总可以编辑 `/var/lib/debfoster/keepers` 文件,来定义那些 你想留在系统中的软件包。 + +为了编辑这个文件,可以键入: + +``` +sudo vi /var/lib/debfoster/keepers +``` + +强制使 debfoster 去移除 所有没有被列在上面这个文件的软件包 或 安装作为某些列在这个文件中的软件包的依赖, 它也会添加所有在这个列表中没有被安装的软件包。若要根据这个列表来执行相关操作,只需执行 + +``` +sudo debfoster -f +``` + +若需要跟踪你新安装的软件包,你需要时不时地执行如下命令: + +``` +sudo debfoster +``` + +### xdiskusage -- 查看你的硬盘空间都去哪儿了 ### + +图形化地展示磁盘使用情况的 du.xdiskusage 是一个用户友好型程序,它将为你展示你所有磁盘的使用情况。 它是在 Phillip C. Dykstra 所写的 “xdu” 程序的基础上设计的。一些改变使得它可以为你运行 “du”命令,并显示磁盘的剩余空间,并且假如你想清晰地了解你的磁盘空间都去哪儿了,它还可以生成一个 PostScript 格式的名为 display.xdiskusage 的文件。 + +### 在 Ubuntu 中安装 xdiskusage ### + +只需使用如下命令: + +``` +sudo apt-get install xdiskusage +``` + +若你想打开这个应用,你需要使用如下命令: + +``` +sudo xdiskusage +``` + +一旦这个应用被打开,你将看到如下图所示的界面: + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/5.png) + + +### Bleachbit ### + +BleachBit 能快速地释放磁盘空间并不知疲倦地保护你的隐私。它可以 释放缓存,删除 cookie,清除 Internet 上网历史,粉碎临时文件,删除日志,丢弃你所不知道存在何处的垃圾。为 Linux 和 Windows 系统设计,它支持擦除清理数以千计的应用程序,如 Firefox, Internet Explorer, Adobe Flash, Google Chrome, Opera, Safari 等等。除了简单地删除文件,BleachBit 还包括许多高级功能,诸如 粉碎文件以防止恢复,擦除磁盘空间 来隐藏被其他应用程序所删除文件的痕迹,为火狐“除尘”,使其速度更快等。比免费更好,BleachBit 是一个开源软件。 + +### 在 Ubuntu 中安装 Bleachbit ### + +打开终端并运行如下命令: + +``` +sudo apt-get install bleachbit +``` + +### 一张截图 ### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/6.png) + +### 使用 Ubuntu-Tweak ### + +最后,你也可以使用 [Ubuntu-Tweak][2] 来清理你的系统。 + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with-ubuntu-14-10-and-more-tools-added.html + +作者:[ruchi][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者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/cleaning-up-all-unnecessary-junk-files-in-ubuntu.html +[2]:http://www.ubuntugeek.com/www.ubuntugeek.com/install-ubuntu-tweak-on-ubuntu-14-10.html diff --git a/translated/tech/20150127 How to limit network bandwidth on Linux.md b/translated/tech/20150127 How to limit network bandwidth on Linux.md new file mode 100644 index 0000000000..cc1efc2aef --- /dev/null +++ b/translated/tech/20150127 How to limit network bandwidth on Linux.md @@ -0,0 +1,112 @@ +怎样在 Linux 中限制网络带宽 +================================================================================ +假如你经常在 Linux 桌面上运行多个网络应用,或在家中让多台电脑共享带宽;(这时,)你可能想更好地控制带宽的使用。否则,当你使用下载器下载一个大文件时,交互式 SSH 会话可能会变得缓慢以至不可用;或者当你通过 Dropbox 来同步一个大文件夹时,你的室友可能会抱怨在她的电脑上,视频流变得断断续续。 + +在本教程中,我将为你描述两种 在 Linux 中限制网络流量速率的不同方法。 + +### 在 Linux 中限制一个应用的速率 ### + +限制网络流量速率的一种方法是通过一个名为[trickle][1]的命令行工具。通过在程序运行时,预先加载一个 速率限制 socket 库 的方法,trickle 命令允许你改变任意一个特定程序的流量。 关于 trickle 命令的一个很好的特征是 它仅在用户空间中运行,这意味着,你不必需要 root 权限来达到限制一个程序的带宽使用的目的。为了与 trickle 程序兼容,这个特定程序必须使用没有静态链接库的套接字接口。当你想对一个不具有内置带宽控制功能的程序进行速率限制时,trickle 可以帮得上忙。 + +在 Ubuntu,Debian 及其衍生发行版中安装 trickle : + +``` +$ sudo apt-get install trickle +``` + +在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2]): + +``` +$ sudo yum install trickle +``` + +trickle 的基本使用方法如下。仅需简单地把 trickle 命令(带有速率参数)放在你想运行的命令之前。 + +``` +$ trickle -d -u +``` + +这就可以将 `` 的下载和上传速率限定为特定值(单位 KBytes/s)。 + +例如,将你的 scp 会话的最大上传带宽设定为 100 KB/s: + +``` + $ trickle -u 100 scp backup.tgz alice@remote_host.com: +``` + +如若你想,你可以使用下面的命令为你的 Firefox 浏览器设定最大下载速率(e.g. , 300 KB/s),通过产生一个[自定义启动器][3]的方式。 + +``` +trickle -d 300 firefox %u +``` + +最后, trickle 也可以 以守护进程模式运行,在该模式下,它将会限制所有通过 trickle 启动且正在运行的程序的总的带宽和。 启动 trickle 使其作为一个守护进程(i.e., trickled): + +``` +$ sudo trickled -d 1000 +``` + +一旦 trickled 守护进程在后台运行,你便可以通过 trickle 命令来启动其他程序。假如你通过 trickle 启动一个程序,那么这个程序的最大下载速率将是 1000 KB/s, 假如你再通过 trickle 启动了另一个程序,则每个程序的(下载)速率极限将会被限制为 500 KB/s, 等等。 + +### 在 Linux 中限制一个网络接口的速率 ### + +另一种控制你的带宽资源的方式是在每一个接口上限制带宽。这在你与其他人分享你的网络连接的上行带宽时尤为实用。同其他一样,Linux 有一个工具来为你做这件事。[wondershaper][4]恰好执行限制网络接口速率的任务。 + +wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量调整命令,使用 QoS 来处理特定的网络接口。通过放置被赋予不同的优先级的传出流量在一个队列中,达到限制传出流量速率的目的, 而传入流量通过丢包的方式来达到速率限制的目的。 + +事实上, wondershaper 的既定目标不仅仅是对一个接口增加其带宽上限;当批量下载或上传正在进行时,wondershaper 还试图去保持互动性会话如SSH 的低延迟。同样的,它还确保批量上传(e.g. , Dropbox 的同步)不会使得下载“窒息”,反之亦然。 + +在 Ubuntu Debian 及其衍生发行版本 中安装 wondershaper: + +``` +$ sudo apt-get install wondershaper +``` + +在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2]) 中安装 wondershaper:(注:这里 链接 2 和 6 一样,可以删除其中之一) + +`` +$ sudo yum install wondershaper +``` + +wondershaper 的基本使用如下: + +``` + $ sudo wondershaper +``` + +举个例子, 将 `eth0` 的最大下载/上传带宽分别设定为 1000Kbit/s 和 500Kbit/s: + +``` +$ sudo wondershaper eth0 1000 500 +``` + +你也可以通过运行下面的命令将速率限制进行消除: + +``` +$ sudo wondershaper clear eth0 +``` + +假如你对 wondershaper 的运行原理感兴趣,你可以阅读其 shell 脚本源文件(/sbin/wondershaper)。 + +### 总结 ### + +在本教程中,我介绍了两种不同的方法,来达到如何在 Linux 桌面环境中,控制每个应用或每个接口的带宽使用的目的。 这些工具对用户都及其友好,都为用户提供了一个快速且容易的方式来调整或限制流量。 对于那些想更多地了解如何在 Linux 中进行速率控制的读者,请参考 [the Linux bible][7]. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/limit-network-bandwidth-linux.html + +作者:[Dan Nanni][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/nanni +[1]:http://monkey.org/~marius/trickle +[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[3]:http://xmodulo.com/create-desktop-shortcut-launcher-linux.html +[4]:http://lartc.org/wondershaper/ +[5]:http://lartc.org/manpages/tc.txt +[6]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[7]:http://www.lartc.org/lartc.html diff --git a/translated/tech/20150127 LinSSID--A Graphical Wi-Fi Scanner for Linux.md b/translated/tech/20150127 LinSSID--A Graphical Wi-Fi Scanner for Linux.md new file mode 100644 index 0000000000..5935a4545c --- /dev/null +++ b/translated/tech/20150127 LinSSID--A Graphical Wi-Fi Scanner for Linux.md @@ -0,0 +1,62 @@ +LinSSID - 一款Linux下的图形化Wi-Fi扫描器 +================================================================================ +### 介绍 ### + +如你所知,**LinSSID** 是一款可以用于寻找可用无线网络的图形化软件。它完全开源,用C++写成,使用了Linux无线工具、Qt5、Qwt6.1,它在外观和功能上与**Inssider** (MS Windows)相近。 + +### 安装 ### + +你可以使用源码安装,如果你使用的是基于DEB的系统比如Ubuntu和LinuxMint等等,你也可以使用PPA安装。 + +你可用从[this link][1]这个链接下载并安装LinSSID。 + +这里我门将使用PPA来安装并测试这个软件。 + +添加LinSSID的PPA并输入下面的命令安装。 + + sudo add-apt-repository ppa:wseverin/ppa + sudo apt-get update + sudo apt-get install linssid + +### 用法 ### + +安装完成之后,你可以从菜单或者unity中启动。 + +你将被要求输入管理员密码。 + +![Password required for iwlist scan_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Password-required-for-iwlist-scan_001.png) + +这就是LinSSID的界面。 + +![LinSSID_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/LinSSID_002.png) + +现在选择你想要连接无线网络的网卡,比如这里是wlan0.点击Play按钮来搜寻wi-fi网络列表。 + +几秒钟之后,LinSSID就会显示wi-fi网络了。 + +![LinSSID_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/LinSSID_003.png) + +如你在上面的截屏中所见,LinSSID显示SSID名、MAC ID、通道、隐私、加密方式、信号和协议等等信息。当然,你可以让LinSSID显示更多的选项,比如安全、带宽等等。要显示这些,进入**View**菜单并选择需要的选项。同样,它显示了不同通道中的信号随着时间信号强度的变化。最后,它可以工作在2.4Ghz和5Ghz通道上。 + + +就是这样。希望这个工具对你有用。 + +干杯!! + +参考链接: + +- [LinSSID 主页][2] + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/linssid-graphical-wi-fi-scanner-linux/ + +作者:[SK][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:http://sourceforge.net/projects/linssid/files/ +[2]:http://sourceforge.net/projects/linssid/ diff --git a/translated/tech/20150128 How To Monitor Access Point Signal Strength With wifi-linux.md b/translated/tech/20150128 How To Monitor Access Point Signal Strength With wifi-linux.md new file mode 100644 index 0000000000..db2ae3c05a --- /dev/null +++ b/translated/tech/20150128 How To Monitor Access Point Signal Strength With wifi-linux.md @@ -0,0 +1,86 @@ +如何用wifi-linux检测AP信号强度 +================================================================================ +作为一名python极客,我喜欢在github上发现新的针对linux用户的python工具。今天我发现了一款用python写成的用于检测AP信号强度的工具。 + +我已经在**wifi-linux**上实验了大约两个小时,并且它工作的很好但是我希望在不久的将来在作者那里看到一些单元测试,因为命令**plot**无法在我的电脑上工作,并且会导致一些问题。 + +### 什么是wifi-linux ### + +根据github作者账号的官方的offical readme.md文件, wifi-linux是一个简单的收集你周围AP的RSSI信息的python脚本,它还会画出RSSI活动图形。 + +,这同样可以用命令plot生成,但是不幸的是,这对我不可行。wifi-linux支持其他的命令,比如**bp** 来加入一个断点,**print**会打印一些统计和**启动开关**。 + +wifi-linux程序有下面这些依赖: + +- dbus-python +- gnuplot-py + +首先我们需要安装所有的包依赖以使它可以运行在我们的linux机器上。 + +### 安装wifi-linux需要的包 ### + +我怕尝试使用python包管理工具pip安装python-dbus但是失败了,因为pip会查找setup.py,但是python-dbus中没有。因此下面的命令不工作。 + + pip install dbus-python + +你可以试一下但是很有可能会在终端中下面的错误。 + + IOError: [Errno 2] No such file or directory: '/tmp/pip_build_oltjano/dbus-python/setup.py' + +我该怎么解决这个问题呢?很简单,用下面命令中的系统包管理工具安装Python DBUS。 + + sudo apt-get install python-dbus + +上面的命令只有在有apt-get包管理器的机器中才可以使用,比如Debian和Ubuntu。 + +我们要安装的第二个依赖是gnuplot-py。下载并用tar解压,接着运行setup.py来安装包。 + +第一步是下载gnuplot-py。 + + wget http://prdownloads.sourceforge.net/gnuplot-py/gnuplot-py-1.8.tar.gz + +接着使用tar工具解压。 + + tar xvf gnuplot-py-1.8.tar.gz + +接着使用cd命令改变目录。 + + cd gnuplot-py-1.8 + +接着运行下面的命令在你的系统中安装gnuplot-py。 + + sudo setup.py install + +安装完成后,你就可以在你的系统中运行wifi-linux了。只需下载并用下面的命令运行脚本。 + +用下面的命令下载wifi-linux到你的机器中。 + + wget https://github.com/dixel/wifi-linux/archive/master.zip + +解压master.zip接着使用下面的命令运行list_rsssi.py脚本。 + + python list_rssi.py + +下面的截图说明wifi-linux在工作了。 + +![wifi-linux to monitor wifi signal strength](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux.png) + +命令**bp**用于像下面那样添加一个断点。 + +![the bp command in wifi-linux](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux2.png) + +命令**print**可以用于显示你机器的状态。下面就是一个例子。 + +![the print command](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux3.png) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/monitor-access-point-signal-strength-wifi-linux/ + +作者:[Oltjano Terpollari][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/oltjano/ diff --git a/sources/tech/20150128 Linux Basics--How To Check If A Package Is Installed Or Not In Ubuntu.md b/translated/tech/20150128 Linux Basics--How To Check If A Package Is Installed Or Not In Ubuntu.md similarity index 77% rename from sources/tech/20150128 Linux Basics--How To Check If A Package Is Installed Or Not In Ubuntu.md rename to translated/tech/20150128 Linux Basics--How To Check If A Package Is Installed Or Not In Ubuntu.md index 6b68f02b1e..9139b8dd92 100644 --- a/sources/tech/20150128 Linux Basics--How To Check If A Package Is Installed Or Not In Ubuntu.md +++ b/translated/tech/20150128 Linux Basics--How To Check If A Package Is Installed Or Not In Ubuntu.md @@ -1,16 +1,16 @@ -Linux Basics: How To Check If A Package Is Installed Or Not In Ubuntu +Linux 基础:如何在Ubuntu上检查是否已经安装了一个包 ================================================================================ ![](http://180016988.r.cdn77.net/wp-content/uploads/2014/04/ubuntu-790x558.png) -If you’re managing Debian or Ubuntu servers, probably, you may use **dpkg** or **apt-get** commands often. These two commands are used to install, remove, update packages. +如果你正在管理Debian或者Ubuntu服务器,你也许会经常使用**dpkg** 或者 **apt-get**命令。这两个命令用来安装、卸载和更新包。 -In this brief tutorial, let us see how to check if a package is installed or not in DEB based systems. +在本篇中,让我们看下如何在基于DEB的系统下检查是否安装了一个包。 -To check whether a particular package for example firefox, is installed or not using command: +要检查特定的包,比如firefox是否安装了,使用这个命令: dpkg -s firefox -Sample output: +示例输出: Package: firefox Status: install ok installed @@ -36,13 +36,13 @@ Sample output: and integrated search let you get the most out of the web. Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384} -As you see in the above output, the firefox is installed. +如上所见,firefox已经安装了。 -Also, you can do the same using **dpkg-query** command. This command displays the decent output, and ofcourse, you can wild cards too. +同样,你可以使用**dpkg-query** 命令。这个命令会有一个更好的输出,当然,你可以用通配符。 dpkg-query -l firefox -Sample output: +示例输出: Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend @@ -51,11 +51,11 @@ Sample output: +++-====================================-=======================-=======================-============================================================================= ii firefox 35.0+build3-0ubuntu0.14 amd64 Safe and easy web browser from Mozilla -To list all installed package in your system, enter the following command +要列出你系统中安装的包,输入下面的命令: dpkg --get-selections -Sample output: +示例输出: abiword install abiword-common install @@ -79,13 +79,13 @@ Sample output: zlib1g:amd64 install zlib1g:i386 install -The above might be very long depending upon the number of packages you have installed on your system. +上面的输出可能会非常长,这依赖于你的系统已安装的包。 -You can also filter through **grep** to get results for the exact package you need. For example, I want to see which gcc packages are already installed on my system using **dpkg** command: +你同样可以通过**grep**来过滤割到更精确的包。比如,我想要使用**dpkg**命令查看系统中安装的gcc包: dpkg --get-selections | grep gcc -Sample output: +示例输出: gcc install gcc-4.8 install @@ -97,11 +97,11 @@ Sample output: libgcc1:amd64 install libgcc1:i386 install -Additionally, you can find location of the files within a package using the parameter “**-L**”. +额外的,你可以使用“**-L**”参数来找出包中文件的位置。 dpkg -L gcc-4.8 -Sample output: +示例输出: /. /usr @@ -120,18 +120,18 @@ Sample output: /usr/bin/x86_64-linux-gnu-gcc-ar-4.8 /usr/bin/x86_64-linux-gnu-gcov-4.8 -That’s all for now. Hope this short tutorial will useful for you. +就是这样了。希望这篇对你有用。 -Good day! +美好的一天! -------------------------------------------------------------------------------- via: http://www.unixmen.com/linux-basics-check-package-installed-not-ubuntu/ 作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://www.unixmen.com/author/sk/ \ No newline at end of file +[a]:http://www.unixmen.com/author/sk/ diff --git a/translated/tech/20150202 How To Install Websvn for Subversion in CentOS 7.0.md b/translated/tech/20150202 How To Install Websvn for Subversion in CentOS 7.0.md new file mode 100644 index 0000000000..35af70fc51 --- /dev/null +++ b/translated/tech/20150202 How To Install Websvn for Subversion in CentOS 7.0.md @@ -0,0 +1,124 @@ +如何在CentOS 7.0上为Subverison安装Websvn +================================================================================ +大家好,今天我们会在CentOS 7.0 上为subversion安装WebSVN。 + +WebSVN提供了Svbverion中的各种方法来查看你的仓库。我们可以看到任何给定版本的任何文件或者目录的日志并且看到所有文件改动、添加、删除的列表。我们同样可以看到两个版本间的不同来知道特定版本改动了什么。 + + +### 特性 ### + +WebSVN提供了下面这些特性: + +- 易于使用的用户界面 +- 可定制的模板系统 +- 色彩化的文件列表 +- blame 视图 +- 日志信息查询 +- RSS支持 +- [更多][1] + +由于使用PHP写成,WebSVN同样易于移植和安装。 + +现在我们将为Subverison(Apache SVN)安装WebSVN。请确保你的服务器上已经安装了Apache SVN。如果你还没有安装,你可以在本教程中安装。 + +After you installed Apache SVN(Subversion), you'll need to follow the easy steps below.安装完Apache SVN(Subversion)后,你需要以下几步。 + +### 1. 下载 WebSVN ### + +你可以从官方网站http://www.websvn.info/download/中下载WebSVN。我们首先进入/var/www/html/并在这里下载安装包。 + + $ sudo -s + +**请在shell或者终端中执行上面的命令,因为我们需要切换到root权限来对系统限制区域有访问权。** + + # cd /var/www/html + # wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip + +![downloading websvn package](http://blog.linoxide.com/wp-content/uploads/2015/01/downloading-websvn.png) + +这里,我下载的是最新的2.3.3版本的websvn。你可以从这个网站得到链接。你可以用你要安装的包的链接来替换上面的链接。 + +### 2. 解压下载的zip ### + + # unzip websvn-2.3.3.zip + + # mv websvn-2.3.3 websvn + +![extracting websvn](http://blog.linoxide.com/wp-content/uploads/2015/01/extracting-websvn.png) + +### 3. 安装php ### + + # yum install php + +![yum install php](http://blog.linoxide.com/wp-content/uploads/2015/01/yum-install-php.png) + +### 4. 编辑WebSVN配置 ### + +现在,我们需要拷贝位于/var/www/html/websvn/include的distconfig.php为config.php,并且接着编辑配置文件。 + + # cd /var/www/html/websvn/include + + # cp distconfig.php config.php + + # nano config.php + +现在我们需要按如下改变文件。这完成之后,请保存病退出。 + + // Configure these lines if your commands aren't on your path. + // + $config->setSVNCommandPath('/usr/bin'); // e.g. c:\\program files\\subversion\\bin + $config->setDiffPath('/usr/bin'); + + // For syntax colouring, if option enabled... + $config->setEnscriptPath('/usr/bin'); + $config->setSedPath('/bin'); + + // For delivered tarballs, if option enabled... + $config->setTarPath('/bin'); + + // For delivered GZIP'd files and tarballs, if option enabled... + $config->setGZipPath('/bin'); + + // + $config->parentPath('/svn/'); + + $extEnscript[".pl"] = "perl"; + $extEnscript[".py"] = "python"; + $extEnscript[".sql"] = "sql"; + $extEnscript[".java"] = "java"; + $extEnscript[".html"] = "html"; + $extEnscript[".xml"] = "html"; + $extEnscript[".thtml"] = "html"; + $extEnscript[".tpl"] = "html"; + $extEnscript[".sh"] = "bash"; + +![websvn config file](http://blog.linoxide.com/wp-content/uploads/2015/01/config-file-websvn.png) + +### 5. 启动 WebSVN ### + +现在,我们将近完成了。现在需要重启Apache服务。你可以用下面的命令。 + + # systemctl restart httpd.service + +接着我们在浏览器中打开WebSVN,输入http://Ip-address/websvn,或者你在本地的话,你可以输入http://localhost/websvn。 + +![websvn successfully installed](http://blog.linoxide.com/wp-content/uploads/2015/01/websvn-success.png) + +**注意**: 如果你遇到一个像"Unable to find "enscript" tool at location "/usr/bin/enscript"这样的问题,那么你需要使用“yum install enscript”安装enscript来修复这个问题。 + +### 总结 ### + +好了,我们已经在CentOS 7上哇安城WebSVN的安装了。这个教程同样适用于RHEL 7。WebSVN提供了Svbverion中的各种方法来查看你的仓库。你可以看到任何给定版本的任何文件或者目录的日志并且看到所有文件改动、添加、删除的列表。如果你有任何问题、评论、反馈请在下面的评论栏中留下,来让我们知道该添加什么和改进。谢谢!享受WebSVN吧。:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-websvn-subversion-centos-7/ + +作者:[Arun Pyasi][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://www.websvn.info/features/ diff --git a/translated/tech/20150202 tespeed - Python Tool To Test Your Internet Speed.md b/translated/tech/20150202 tespeed - Python Tool To Test Your Internet Speed.md new file mode 100644 index 0000000000..99bfab9842 --- /dev/null +++ b/translated/tech/20150202 tespeed - Python Tool To Test Your Internet Speed.md @@ -0,0 +1,76 @@ +tespeed - 测试网速的Python工具 +================================================================================ +许多电脑呆子知道可以用**speedtest.net**测试网速,但是这个不能在测试中给你足够的控制。Linux用户喜欢在终端中输入命令来完成任务,至少对我是这样的。 + +tespeed是一款有很多特性的python工具,可以在终端在测试网速。根据文档,它利用了speedtest.net的服务器,但是用户可以手动指定。 + +最初作者用php语言写了tespeed工具,并且证明了ISP提供的网络远低于它广告中所说的那样。但是事情并不是一直如它们想的那样,因此作者移植他的php脚本到python中并且他的工具在github中已经有180个star了。 + +这意味着**alot**。 + +### 如何在linux中测试tespeed ### + +在你电脑上运行这个python程序前先确保系统已经满足了这个工具的依赖。tespeed依赖下面两个包: + +- lxml +- SocksiPy + +你可以用pip包管理系统来安装lxml,只要用下面的命令就行。 + + pip install lxml + +现在我们需要输入下面的命令来下载安装SocksiPy。 + + wget http://sourceforge.net/projects/socksipy/files/socksipy/SocksiPy%201.00/SocksiPy.zip/ + +下载完成后 解压**SocksiPy.zip**病运行下面的命令来克隆tespeed仓库到你本地机器中。 + + git clone https://github.com/Janhouse/tespeed.git + +接着把SocksiPy文件夹放到你克隆下来的tespeed项目中。现在我们要像截图那样在SocksPy中的**__init__.py**下面创建一个空文件。 + +![simple trick to make tespeed work](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed1.png) + +现在我们已经解决了项目的依赖问题,我们可以用下面的命令运行了。 + + python tespeed.py + +接下来就会发生一些神奇的事了。程序会测试你的下载和上传速度并且在你的终端中用漂亮的颜色显示出来。 + +![testing download and upload speed with tespeed python application](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed2.png) + +在tespeed中有很多选项,如**-ls**来现实服务器,**-p**来指定代理服务器, **-s**来阻止调试(STDERR)输出, 还有很多我们会在本教程中探索。 + +如果你想要结果现实成MB,你可以在**python tespeed.py** 后面接上选项 **-mib**。 + + python tespeed.py -mib + +在你使用了-mib选项后你可以看到计量网速的单位改变了。 + +![testing internet speed with tespeed python application](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed3.png) + +我非常喜欢用的一个选项是-w,它可以把标准输出转化成CSV格式。 + + python tespeed.py -w + +使用下面的命令来列出服务器。 + + python tespeed -ls + +运行上面的命令后,你会看到可以用于测试上传和下载速度的服务器列表。我的列表非常长,所以我不会在教程中共享了。 + +### 总结 ### + +=tespeed的确是一款帮助用户在终端中测试上传和下载速度的高性能python脚本。它支持很多的选项并且你可以指定列表中你想使用的服务器。继续使用tespeed并在留言区写下你们的体验吧。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/tools/tespeed-python-tool-test-internet-speed/ + +作者:[Oltjano Terpollari][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/oltjano/ \ No newline at end of file diff --git a/translated/tech/20150203 How To Install KDE Plasma 5.2 In Ubuntu 14.10.md b/translated/tech/20150203 How To Install KDE Plasma 5.2 In Ubuntu 14.10.md new file mode 100644 index 0000000000..0e6a83f60f --- /dev/null +++ b/translated/tech/20150203 How To Install KDE Plasma 5.2 In Ubuntu 14.10.md @@ -0,0 +1,61 @@ +如何在Ubuntu 14.10 上安装KDE Plasma 5.2 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Plasma_Ubuntu_1410.jpg) + +[KDE][1] Plasma 5.2已经[发布][2],在本篇中我们将看到如何在Ubuntu 14.10 上安装KDE Plasma 5.2。 + +Ubuntu的默认桌面环境Unity很漂亮还有很多特性。但是如果你问任何有经验的Linux用户关于桌面自定义,他的回答将是KDE。KDE在定制上是王者并且它得到流行大概是由于Ubuntu有官方的KDE版本,也就是Kubuntu[3]。 + +对于Ubuntu(或者任何其他的Linux系统而言)的一个好消息是它没有绑定任何特定的桌面环境。你可以安装额外的桌面环境并且可以在不同的桌面环境间切换。早先我们已经了解了桌面环境的安装。 + +- [如何在Ubuntu 14.04中安装Mate桌面][4] +- [如何在Ubuntu 14.04中安装Cinnamon桌面][5] +- [如何在Ubuntu 14.04中安装Budgie桌面][6] +- [如何在Ubuntu 14.04中安装Gnome Shell][7] + +今天我们要展示如何在Ubuntu 14.10 中如何安装KDE Plasma。 + +### 如何在Ubuntu 14.10 上安装KDE Plasma 5.2 ### + +在Ubuntu 14.10上安装Plasma之前,你要知道这会下载大概1GB的内容。因此在安装KDE之前要考虑速度和数据包。我们下载所使用的PPA是KDEs社区官方提供的。在终端中使用下面的命令: + + sudo apt-add-repository ppa:kubuntu-ppa/next-backports + sudo apt-get update + sudo apt-get dist-upgrade + sudo apt-get install kubuntu-plasma5-desktop plasma-workspace-wallpapers + +During the installation, it will as you to choose the default display manager. I chose the default LightDM. Once installed, restart the system. At the login, click on the Ubuntu symbol beside the login field. In here, select Plasma. +在安装中,我们要选择默认的显示管理器。我选择的是默认的LightDM。安装完成后,重启系统。在登录时,点击登录区域旁边的Ubuntu图标。这里选择Plasma。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Select_Plasma_KDE_Ubuntu.jpeg) + +你现在就登录到KDE Plasma了。这里有一个KDE Plasma 5.2在Ubuntu 14.10下的截图 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/KDE_Plasma_Desktop.jpeg) + +### 从Ubuntu卸载KDE Plasma ### + +如果你想要还原更改,使用下面的命令从Ubuntu 14.10中卸载KDE Plasma。 + + sudo apt-get install ppa-purge + sudo apt-get remove kubuntu-plasma5-desktop + sudo ppa-purge ppa:kubuntu-ppa/next + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-kde-plasma-ubuntu-1410/ + +作者:[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]:https://www.kde.org/ +[2]:https://dot.kde.org/2015/01/27/plasma-52-beautiful-and-featureful +[3]:http://www.kubuntu.org/ +[4]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ +[5]:http://itsfoss.com/install-cinnamon-24-ubuntu-1404/ +[6]:http://itsfoss.com/install-budgie-desktop-ubuntu-1404/ +[7]:http://itsfoss.com/how-to-install-gnome-in-ubuntu-14-04/ diff --git a/translated/tech/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md b/translated/tech/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md new file mode 100644 index 0000000000..2c83a1b808 --- /dev/null +++ b/translated/tech/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md @@ -0,0 +1,112 @@ +如何在CentOS/RHEL中安装机遇Web监控的Linux-dash +================================================================================ +**Linux-dash**是一款为Linux设计的基于web的轻量级监控面板。这个程序会显示实时时间、不同的系统属性,比如CPU负载、RAM使用率、磁盘使用率、网速、网络连接、RX/TX带宽、登录用户、运行的进程等等。它不会存储长期的统计。因为它没有后端数据库。 + +本篇文章将会向你展示如何安装和设置Linux dash,这里的web服务器是**Nginx**. + +### 安装 ### + +首先我们要启用[EPEL 仓库][1]。 + +**接下来,我们需要用下面的命令安装nginx。** + + sudo yum install nginx + +**安装 php-fpm 组件** + + sudo yum install git php-common php-fpm + +现在我们要在nginx中配置Linux-dash。我们如下创建 /etc/nginx/conf.d/linuxdash.conf。 + + sudo vim /etc/nginx/conf.d/linuxdash.conf + +---------- + + server { + server_name $domain_name; + listen 8080; + root /var/www; + index index.html index.php; + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ { + try_files $uri =404; + expires max; + access_log off; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } + + location /linux-dash { + index index.html index.php; + } + + # PHP-FPM via sockets + location ~ \.php(/|$) { + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php-fpm.sock; + if (!-f $document_root$fastcgi_script_name) { + return 404; + } + try_files $uri $uri/ /index.php?$args; + include fastcgi_params; + } + } + +**下一步是配置php-fpm。用编辑器打开/etc/php-fpm.d/www.conf。** + + sudo vim /etc/php-fpm.d/www.conf + +**确保设置了“listn”,“user”和“group”字段。你可以保留下面的配置不变。** + + . . . + listen = /var/run/php-fpm.sock + user = nginx + group = nginx + . . . + +**现在,我们要在/var/www中下载并安装linux-dash。** + + git clone https://github.com/afaqurk/linux-dash.git + sudo cp -r linux-dash/ /var/www/ + sudo chown -R nginx:nginx /var/www + +**接下来,重启 Nginx和php-fpm** + + sudo service nginx restart + sudo service php-fpm restart + +**设置nginx和php-fpm开机自动启动** + + sudo chkconfig nginx on + sudo chkconfig php-fpm on + +在本例中,我们使用TCP端口8080配置linux-dash。因此确保防火墙没有阻止8080 TCP端口。 + +### 用linux-dash监控Linux服务器 ### + +你现在可以在浏览器中输入**http://:8080/linux-dash/**来访问Linux-dash。 + +web面板包含了不同的组件,每个都显示独特的系统属性。你可以自定义web面板的外观也可以关闭一些组件。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Lin-dash.png) + +美好的一天! + + +下篇文章中再见。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/install-linux-dash-web-based-monitoring-system-centosrhel/ + +作者:[Jijo][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/jijo/ +[1]:http://www.unixmen.com/install-epel-repository-centos-rhel-7/ 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/translated/tech/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md new file mode 100644 index 0000000000..0a10253031 --- /dev/null +++ b/translated/tech/20150203 Linux FAQs with Answers--How to fix 'Your profile could not be opened correctly' on Google Chrome.md @@ -0,0 +1,50 @@ +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时候。 + +![](https://farm8.staticflickr.com/7428/16238502737_27bdda6685_o.png) + +修复取决于到底哪个文件损坏,你可以试试下面的几个方法。 + +### 方法一 ### + +关掉所有Chrome窗口和子窗口。 + +进入~/.config/google-chrome/Default,移除或者重命名"Web Data"文件。 + + $ cd ~/.config/google-chrome/Default + $ rm "Web Data" + +再次开打Google Chrome浏览器。 + +### 方法二 ### + +关掉所有Chrome窗口和子窗口。 + +进入~/.config/google-chrome/"Profile 1", 并重命名"History"文件。 + + $ cd ~/.config/google-chrome/"Profile 1" + $ mv History History.bak + +再次开打Google Chrome浏览器。 + +### 方法三 ### + +如果依然没有解决,你可以试试移除所有默认档案文件夹(~/.config/google-chrome/Default)。注意:如果这样做,你将会遗失所有之前打开的Google子窗口,导入的书签,浏览记录和登录数据等。 + +在移除之前,先关掉所有Chrome窗口和子窗口 + + $ rm -rf ~/.config/google-chrome/Default + +之后重启Google Chrome,文件夹~/.config/google-chrome/Default会自动生成。 + +-------------------------------------------------------------------------------- + +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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150205 Linux Basics--Assign Multiple IP Addresses To Single Network Interface Card On CentOS 7.md b/translated/tech/20150205 Linux Basics--Assign Multiple IP Addresses To Single Network Interface Card On CentOS 7.md new file mode 100644 index 0000000000..3dec583608 --- /dev/null +++ b/translated/tech/20150205 Linux Basics--Assign Multiple IP Addresses To Single Network Interface Card On CentOS 7.md @@ -0,0 +1,209 @@ +Linux 基础:在CentOS 7上给一个网卡分配多个IP地址 +================================================================================ +有时你也许想要给一个网卡多个地址。你该怎么做呢?另外买一个网卡来分配地址?不用这么做(只要在小型网络中)。我们现在可以再CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么?好的,跟随我,这并不难。 + +首先,让我们找到网卡的IP地址。在我的CentOS 7服务器中,我只使用了一个网卡。 + +用root特权运行下面的命令: + + ip addr + +示例输出: + + 1: lo: mtu 65536 qdisc noqueue state UNKNOWN + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: enp0s3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 08:00:27:80:63:19 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.150/24 brd 192.168.1.255 scope global enp0s3 + valid_lft forever preferred_lft forever + +如上所见,我的网卡名是enp0s3,ip地址是192.168.1.150。 + +如你所知,网卡的配置文件存储在 **/etc/sysconfig/network-scripts/** 目录下。每个网卡的详细内容将会以不同的名字存储,比如**ifcfg-enp0s3**。 + +让我们看下**ifcfg-enp0s3**的细节。 + + cat /etc/sysconfig/network-scripts/ifcfg-enp0s3 + +示例输出: + + TYPE="Ethernet" + BOOTPROTO="none" + DEFROUTE="yes" + IPV4_FAILURE_FATAL="no" + IPV6INIT="yes" + IPV6_AUTOCONF="yes" + IPV6_DEFROUTE="yes" + IPV6_FAILURE_FATAL="no" + NAME="enp0s3" + UUID="e9f9caef-cb9e-4a19-aace-767c6ee6f849" + ONBOOT="yes" + HWADDR="08:00:27:80:63:19" + IPADDR0="192.168.1.150" + PREFIX0="24" + GATEWAY0="192.168.1.1" + DNS1="192.168.1.1" + IPV6_PEERDNS="yes" + IPV6_PEERROUTES="yes" + +好的,现在我们将在相同的子网中分配多个地址了。 + +编辑文件 **/etc/sysconfig/network-scripts/ifcfg-enp0s3**: + + vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 + +像下面那样加入额外的IP地址。 + + TYPE="Ethernet" + BOOTPROTO="none" + DEFROUTE="yes" + IPV4_FAILURE_FATAL="no" + IPV6INIT="yes" + IPV6_AUTOCONF="yes" + IPV6_DEFROUTE="yes" + IPV6_FAILURE_FATAL="no" + NAME="enp0s3" + UUID="933cdc9b-b383-4ddd-b219-5a72c69c9cf0" + ONBOOT="yes" + HWADDR="08:00:27:3F:AB:68" + IPADDR0="192.168.1.150" + IPADDR1="192.168.1.151" + IPADDR2="192.168.1.152" + PREFIX0="24" + GATEWAY0="192.168.1.1" + DNS1="192.168.1.1" + IPV6_PEERDNS="yes" + IPV6_PEERROUTES="yes" + +如你所见,我已经加了两个IP地址:**IPADDR1=”192.168.1.151″ & IPADDR2=”192.168.1.152″** + +类似地,你可以加入更多的ip地址。 + +Finally, save and close the file. Restart network service to take effect the changes. +最后,保存并退出文件。重启网络服务来使更改生效。 + + systemctl restart network + +现在,让我们检查是否已经加入了ip地址。 + + ip addr + +示例输出: + + : lo: mtu 65536 qdisc noqueue state UNKNOWN + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: enp0s3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 08:00:27:3f:ab:68 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.150/24 brd 192.168.1.255 scope global enp0s3 + valid_lft forever preferred_lft forever + inet 192.168.1.151/24 brd 192.168.1.255 scope global secondary enp0s3 + valid_lft forever preferred_lft forever + inet 192.168.1.152/24 brd 192.168.1.255 scope global secondary enp0s3 + valid_lft forever preferred_lft forever + inet6 fe80::a00:27ff:fe3f:ab68/64 scope link + valid_lft forever preferred_lft forever + +如你所见,单个网卡已经有3个ip地址了。 + +让我们ping一下新增的IP地址: + + ping -c 4 192.168.1.151 + +示例输出: + + PING 192.168.1.151 (192.168.1.151) 56(84) bytes of data. + 64 bytes from 192.168.1.151: icmp_seq=1 ttl=64 time=0.048 ms + 64 bytes from 192.168.1.151: icmp_seq=2 ttl=64 time=0.075 ms + 64 bytes from 192.168.1.151: icmp_seq=3 ttl=64 time=0.077 ms + 64 bytes from 192.168.1.151: icmp_seq=4 ttl=64 time=0.077 ms + + --- 192.168.1.151 ping statistics --- + 4 packets transmitted, 4 received, 0% packet loss, time 2999ms + rtt min/avg/max/mdev = 0.048/0.069/0.077/0.013 ms + +---------- + + ping -c 4 192.168.1.152 + +示例输出: + + PING 192.168.1.152 (192.168.1.152) 56(84) bytes of data. + 64 bytes from 192.168.1.152: icmp_seq=1 ttl=64 time=0.034 ms + 64 bytes from 192.168.1.152: icmp_seq=2 ttl=64 time=0.075 ms + 64 bytes from 192.168.1.152: icmp_seq=3 ttl=64 time=0.073 ms + 64 bytes from 192.168.1.152: icmp_seq=4 ttl=64 time=0.075 ms + + --- 192.168.1.152 ping statistics --- + 4 packets transmitted, 4 received, 0% packet loss, time 2999ms + rtt min/avg/max/mdev = 0.034/0.064/0.075/0.018 ms + +如果你想要使用**不同的子网**,你要改变**PREFIX0=24**成不同的子网,比如 **PREFIX1=16**。 + +比如,我想要添加一个A类地址(**比如10.0.0.1*)到我的网卡中。 + + TYPE="Ethernet" + BOOTPROTO="none" + DEFROUTE="yes" + IPV4_FAILURE_FATAL="no" + IPV6INIT="yes" + IPV6_AUTOCONF="yes" + IPV6_DEFROUTE="yes" + IPV6_FAILURE_FATAL="no" + NAME="enp0s3" + UUID="933cdc9b-b383-4ddd-b219-5a72c69c9cf0" + ONBOOT="yes" + HWADDR="08:00:27:3F:AB:68" + IPADDR0="192.168.1.150" + IPADDR1="192.168.1.151" + IPADDR2="192.168.1.152" + IPADDR3="10.0.0.1" + PREFIX0="24" + PREFIX1=16 + GATEWAY0="192.168.1.1" + DNS1="192.168.1.1" + IPV6_PEERDNS="yes" + IPV6_PEERROUTES="yes" + +你可以看到我已经添加一个A类地址(10.0.0.1)并且前缀是16 + +保存并退出文件。重启网络服务, + +接着,ping新增的地址: + + ping -c 4 10.0.0.1 + +示例输出: + + PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. + 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.097 ms + 64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.073 ms + 64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.074 ms + 64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=0.075 ms + + --- 10.0.0.1 ping statistics --- + 4 packets transmitted, 4 received, 0% packet loss, time 3000ms + rtt min/avg/max/mdev = 0.073/0.079/0.097/0.014 ms + +相似地,你可以添加不同的网关。 + +就是这样。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-network-interface-card-centos-7/ + +作者:[SK][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ diff --git a/translated/tech/20150205 Linux FAQs with Answers--How to install Go language on Linux.md b/translated/tech/20150205 Linux FAQs with Answers--How to install Go language on Linux.md new file mode 100644 index 0000000000..d7dd2bb1c6 --- /dev/null +++ b/translated/tech/20150205 Linux FAQs with Answers--How to install Go language on Linux.md @@ -0,0 +1,96 @@ +如何在Linux中安装Go语言 +================================================================================ +Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几个设计原则:简单、安全、速度。Go语言发行版拥有各种调试、测试、调优和代码审查工具。如今Go语言和它的工具链在大多数Linux发行版的基础仓库都有了,用默认的包管理器就可以安装。 + +### 在Ubuntu、Debian 或者 Linux Mint上安装Go语言 ### + +下面是在基于Debian的发行版上使用**apt-get**来安装Go语言和它的开发工具。 + + $ sudo apt-get install golang + +检查Go语言的版本来验证安装。 + + $ go version + +---------- + + go version go1.2.1 linux/amd64 + +按照你的需要,你或许想要使用apt-get安装额外的Go工具。 + + $ sudo apt-cache search golang + +![](https://farm8.staticflickr.com/7430/15812762183_f094e3bf92_c.jpg) + +### 在Fedora、CentOS/RHEL中安装Go语言 ### + +下面的命令会在基于Red Hat的发行版中安装Go语言和它的工具。 + + $ sudo yum install golang + +检查Go语言的版本来验证安装。 + + $ go version + +---------- + + go version go1.3.3 linux/amd64 + +按照你的需要,你或许想要使用yum安装额外的Go工具。 + + $ yum search golang + +![](https://farm8.staticflickr.com/7373/16432817805_775010dc18_c.jpg) + +### 从官网安装Go语言 ### + +有时发行版中的版本并不是最新的。为防这样,你可以从官网安装最新的Go语言。下面是步骤。 + +进入Go语言的[官方源码][1],并下载预编译二进制代码。 + +**对于64位Linux:** + + $ wget https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz + +**对于32位Linux:** + + $ wget https://storage.googleapis.com/golang/go1.4.1.linux-386.tar.gz + +**在/usr/local下安装程序** + + $ sudo tar -xzf go1.4.1.linux-xxx.tar.gz -C /usr/local + +在/etc/profile中添加系统范围的PATH环境变量。 + + $ sudo vi /etc/profile + +---------- + + export PATH=$PATH:/usr/local/go/bin + +如果你在/usr/local之外安装了了Go,你同样需要设置GOROOT环境变量来指向自定义的安装位置。 + + $ sudo vi /etc/profile + +---------- + + export GOROOT=/path/to/custom/location + +检查Go语言的版本 + + $ go version + +---------- + + go version go1.4.1 linux/amd64 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-go-language-linux.html + +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:https://golang.org/dl/