Merge branch 'master' of github.com:LCTT/TranslateProject

This commit is contained in:
mtunique 2015-02-10 10:20:43 +08:00
commit ec2d46c277
73 changed files with 5078 additions and 1460 deletions

View File

@ -1,10 +1,10 @@
在Ubuntu 14.10中如何安装和配置‘My Weather Indicator
在Ubuntu 14.10中如何安装和配置‘天气信息指示器
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/my-weather-indicator.jpg)
**在Ubuntu桌面中不缺乏若干应用同时提供天气信息的方法你可以使用Unity Dash和桌面应用比如[Typhoon][1],来获得天气信息。**
**在Ubuntu桌面中有各种提供天气信息的方法你可以使用Unity Dash和桌面应用来获得天气信息,比如[Typhoon][1]。**
但是可以提供快速查询天气状况和温度数据并且只需要一次鼠标点击而获得大量气象数据的面板插件是到目前为止Linux平台下最受欢迎的天气应用。
但是可以提供快速查询天气状况和温度数据,并且只需要一次鼠标点击而获得大量气象数据的面板插件,是到目前为止Linux平台下最受欢迎的天气应用。
Atareao开发的[My Weather Indicator][2]就是这类应用中的一个,也可以说是最好的一个。
@ -18,7 +18,7 @@ My Weather Indicator无法从Ubuntu软件商店中直接获取。不过开发者
- 下载My Weather Indicator (.deb安装包)
为了确保你的应用是最新版本,我建议将[Atareao PPA][3]添加到你的软件镜像源然后通过PPA来安装。
为了确保你的应用是最新版本,我建议将[Atareao PPA][3]添加到你的软件镜像源然后通过PPA来安装。
怎么做?**打开一个新的终端**窗口Unity Dash > 终端或者按Ctrl+Alt+T快捷键然后**输入下面的两行命令**,期间你需要在提示处输入你的系统密码:
@ -36,7 +36,7 @@ My Weather Indicator无法从Ubuntu软件商店中直接获取。不过开发者
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/Screen-Shot-2014-10-27-at-17.39.07.jpeg)
如果你正在旅行(或者是出于聊天需要),**你可以添加一个第二地区**。这个设置和第一地区的设置相同,只不过是在“第二地区”的标签栏罢了。
如果你正在旅行(或者是出于聊天需要),**你可以添加一个第二地区**。这个设置和第一地区的设置相同,只不过是出现在“第二地区”的标签栏罢了。
在“**小部件设置**”区域勾选“**显示桌面小部件**”选项就会在你的桌面上添加一个小的天气小部件。小部件提供许多不同的皮肤,所以你一定要精心挑选你最喜欢的一个(注释:点击“确定”后对小部件的更改才会保存)。
@ -55,7 +55,7 @@ My Weather Indicator使用[Open Weather Map][4]作为默认的天气数据提供
最后General Options标签页你可以设置数据更新间隔、设置开机自动运行选项以及从两个图标中选择一个作为面板图标。
如果你不喜欢该应用,你可以尝试[Linux下查看天气数据的方法][5]。
如果你是命令行控,你也可以尝试[Linux下查看天气数据的方法][5]。
--------------------------------------------------------------------------------
@ -63,7 +63,7 @@ via: http://www.omgubuntu.co.uk/2014/10/install-weather-indicator-ubuntu-14-10
作者:[Joey-Elijah Sneddon][a]
译者:[JonathanKang](https://github.com/JonathanKang)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,18 +1,18 @@
VPS上好的控制面板是什么
推荐一款不错的 VPS 控制面板Ajenti
================================================================================
任何有经验的Linux人员都认为没有一款控制面板可以打败纯命令行界面来管理[虚拟主机][1]VPS。也有人争论有一款好的面板的一席之地,因为流线型的界面让常规管理操作可以通过点几下鼠标就可以完成。
任何有经验的Linux人员都认为没有任何一款控制面板可以打败纯命令行界面来管理[虚拟主机][1]VPS。也有人争辩说好的控制面板还是应该有一席之地,因为顺滑的操作界面让常规管理操作通过点几下鼠标就可以完成。
至于控制面板,有共恩那个强大的充满警铃和汽笛的商业控制面板,也有不同免费的但也强大多功能的免费开源面板替代。这之中杰出的代表是[Ajenti][2]控制面板。
至于控制面板,有那种强大的充满警铃和汽笛的商业控制面板,也有不同免费的但也强大多功能的免费开源面板替代。这之中杰出的代表是[Ajenti][2]控制面板。
Ajenti可以让你很简单地配置不同的通用服务程序如Apache/nginx、Samba、BIND、Squid、MySQL、cron、防火墙等等对管理通用VPS实例可以节省大量的时间。对于生产环境Ajenti同样提供了插件和平台来支持虚拟web主机管理和自定义web UI开发。
Ajenti可以让你很简单地配置不同的常规服务程序如Apache/nginx、Samba、BIND、Squid、MySQL、cron、防火墙等等对管理常规的 VPS 实例可以节省大量的时间。对于生产环境Ajenti同样提供了插件和平台来支持虚拟 web 主机管理和自定义 web UI开发。
Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免费使用的AGPLv3。然而如果你是一家托管企业或者硬件提供商那么你需要购买商业授权来使用Ajenti作为商业供应
Ajenti有[双重授权][3];一个是针对个人、企业内部或者教育用途免费使用的AGPLv3。然而如果你是一家托管企业或者硬件提供商那么你需要购买商业授权来使用Ajenti作为商业服务
### 在Linux上安装Ajenti ###
为了简化安装Ajenti为主流Linux发行版提供了自己的仓库。安装Ajenti要做的就是配置目标仓库并用默认包管理器来安装。
安装前一个RSA密钥和证书会生成用于SSLAjenti会见在8000端口监听HTTPS的web请求。如果你正在使用防火墙你需要在防火墙中允许8000端口。为了安全最好默认禁止8000端口的访问并添加少数IP地址到白名单中。
安装前会生成用于SSL的一个RSA密钥和证书Ajenti会在8000端口监听HTTPS的web请求。如果你正在使用防火墙你需要在防火墙中允许8000端口访问。为了安全最好默认禁止8000端口的公开访问,并添加你的少数IP地址到白名单中。
#### 在Debian上安装Ajenti ####
@ -54,7 +54,7 @@ Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免
$ sudo service ajenti restart
直接在浏览器中输入https://<server-ip-address>:8000你就会看到下面的Ajenti的登录界面。
直接在浏览器中输入https://\<server-ip-address>:8000你就会看到下面的Ajenti的登录界面。
![](https://farm8.staticflickr.com/7512/15712738197_eeccd0f9dd_z.jpg)
@ -62,7 +62,7 @@ Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免
![](https://farm8.staticflickr.com/7498/15897850312_d2ca46fa4b_z.jpg)
在左边面板的"SOFTWARE"选项下,你会看接一列安装的服务。当你安装了任何Ajenti支持的服务端程序时软件会在重启ajenti服务后被自动加入列表。
在左边面板的"SOFTWARE"选项下,你会看带一些已安装的服务。当你安装了任何Ajenti支持的服务端程序时软件会在重启ajenti服务后被自动加入列表。
$ sudo service ajenti restart
@ -84,7 +84,7 @@ Ajenti提供了一个web界面来安装和升级VPS上的包。
#### 防火墙配置 ####
Ajenti允许你用两种方法管理防火墙规则iptables或者CSF。一种是使用用户友好的web面板另一种是直接编辑原的防火墙规则。
Ajenti允许你用两种方法管理防火墙规则使用iptables或者CSF。一种方法是使用用户友好的web面板另一种是直接编辑原的防火墙规则。
![](https://farm8.staticflickr.com/7490/15276234634_a220f2a555_z.jpg)
@ -98,25 +98,25 @@ Ajenti允许你用两种方法管理防火墙规则iptables或者CSF。一
#### 进程监控 ####
你可以u看见按照CPU和内存使用率排序的进程列表按需可以结束它们。
你可以看见按照CPU和内存使用率排序的进程列表如果需要的话,也可以干掉它们。
![](https://farm8.staticflickr.com/7556/15711008948_ed359c284d_z.jpg)
#### 终端访问 ####
对于底层VPS访问Ajenti提供了基于web的终端界面你在这可以输入Linux命令。你也可以像下面那样在一个面板中打开多个终端。
如果需要更低层面的VPS访问Ajenti提供了基于web的终端界面你在这可以输入Linux命令。你也可以像下面那样在一个面板中打开多个终端。
![](https://farm8.staticflickr.com/7568/15896505251_8271ac16dd_z.jpg)
#### Apache Web服务管理 ####
你可以编辑Apache配额文件并管理apche2服务。
你可以编辑Apache配置文件并管理apache2服务。
![](https://farm8.staticflickr.com/7572/15711009108_bb806d2dcd_z.jpg)
#### MySQL/MariaDB 管理 ####
你可以访问MySQL/MariaDB服务并直接在上面执行原SQL命令。
你可以访问MySQL/MariaDB服务并直接在上面执行原SQL命令。
![](https://farm8.staticflickr.com/7580/15276234754_02375fd17b_z.jpg)
@ -128,13 +128,13 @@ Ajenti允许你用两种方法管理防火墙规则iptables或者CSF。一
#### 启动服务管理 ####
你可以浏览、启动、停止、重启安装的服务。
你可以浏览、启动、停止、重启安装的服务。
![](https://farm8.staticflickr.com/7538/15898503935_1edf5c67ae_z.jpg)
### 总结 ###
Ajenti是一款易于使用的服务器管理控制面板可以加入你开发的[自定义插件][5]。然而,记住任何好的控制面板都不会排除你学习面板后[VPS][6]上发生的情况的需求。一款面板会在你完全了解你正在做的事情的时候成会一款真正节省时间的利器,并且不依赖于控制面版来处理你行动的结果
Ajenti是一款易于使用的服务器管理控制面板可以加入你开发的[自定义插件][5]。然而请记住,任何好的控制面板都不是阻止你学习在控制面板之后[VPS][6]里发生了什么的原因。一款好的面板会在你完全了解你正在做的事情时成会一款真正节省时间的利器,并且不依赖于控制面版来达成你所需要的目标
--------------------------------------------------------------------------------
@ -142,7 +142,7 @@ via: http://xmodulo.com/free-control-panel-for-vps.html
作者:[Dan Nanni][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
@ -150,6 +150,6 @@ via: http://xmodulo.com/free-control-panel-for-vps.html
[1]:http://xmodulo.com/go/digitalocean
[2]:http://ajenti.org/
[3]:http://ajenti.org/licensing
[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[4]:http://linux.cn/article-2324-1.html
[5]:http://docs.ajenti.org/en/latest/dev/intro.html
[6]:http://xmodulo.com/go/digitalocean

View File

@ -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/) 荣誉推出

View File

@ -1,12 +1,12 @@
如何在Linux终端下安排约会和待办事项
在Linux终端下使用 calcurse 安排约会和待办事项
================================================================================
如果你是一个享受linux终端的系统管理员但同样需要一方法来安排每天最重要的任务、约会和会议,你会发现[calcurse][1]是一个很有用的工具。calcurse包含了日历、一个待办事项管理、一个调度程序和一个可配置的通知系统这些都集成进了一个软件中基于的都是ncurse的接口。同时它不会限制你在终端中你可以将你的日历和笔记导出成可以打印的格式。
如果你是一个享受linux终端的系统管理员但同样需要一方法来安排每天最重要的任务、约会和会议,你会发现[calcurse][1]是一个很有用的工具。calcurse包含了日历、一个待办事项管理、一个调度程序和一个可配置的通知系统这些都集成进了一个软件中基于的都是ncurse的接口。同时它不会限制你在终端中你可以将你的日历和笔记导出成可以打印的格式。
文章我们会探索如何在Linux上安装calcurse并且教你如何利用它的特性。
文章我们会探索如何在Linux上安装calcurse并且教你如何利用它的特性。
### 在Linux上安装Culcurse ###
calcurse在大多数Linux发行版的标准仓库都有。万一在你的发行版上没有比如CentOS/RHEL一旦你安装了gcc和ncurse开发文件后就可以很简单地从源码安装。
calcurse在大多数Linux发行版的标准仓库都有。万一在你的发行版上没有比如CentOS/RHEL只要你安装了gcc和ncurse开发文件后就可以很简单地从源码安装。
Debian、Ubuntu或者Linux Mint
@ -32,22 +32,22 @@ CentOS/RHEL
$ calcurse
你将会看到下面的空白界面。如果配色不吸引你,你可以以后改变它们
你将会看到下面的空白界面。如果这配色不吸引你,你可以以后换一个
![](https://farm8.staticflickr.com/7567/15410270544_0af50a4eb6_c.jpg)
我们现在可以按下回车-q- 再次按下回车- y来退出主界面。这个序列会告诉地不的菜单退出、保存当前的笔记并确认退出。
我们现在可以按下回车-q- 再次按下回车- y来退出主界面。这个按键序列激活界面底部的主菜单,并告诉它保存当前的笔记并确认退出。
When we run calcurse for the first time, the following directory structure is created in our home directory:
我们第一次运行 calcurse 时,会在主目录创建如下子目录:
![](https://farm8.staticflickr.com/7482/15845194188_2ba15035e7_o.png)
这里是每一的简要描述:
这里是每一个子目录的简要描述:
- **apts** 文件包含了用户所有的约会和事项todo文件包含了所有的**todo** 列表。
- **apts**文件包含了用户所有的约会和事项todo文件包含了所有的**待办事项** 列表。
- **conf**文件,如你所想的那样,包含当前用户的独立设置。
- **keys**文件包含了用户定义的按键绑定比如q或者Qx或者X导出内容等等
- 在**notes**子目录你会看到包含了笔记描述的文件,你可以附到任何一个安排事项中。
- **keys**文件包含了用户定义的按键绑定比如q或者Q退x或者X导出内容等等
- 在**notes**子目录你会看到包含了笔记描述的文件,这些笔记你可以附到任何一个安排事项中。
### 改变配色 ###
@ -55,13 +55,13 @@ When we run calcurse for the first time, the following directory structure is cr
![](https://farm9.staticflickr.com/8595/16006755476_5289384f81_z.jpg)
使用最后一幅图的按键绑定来选色前景色和背景色配置来更好地适应你的需求:
使用最后一幅图的按键绑定来选择前景色和背景色配置,以更好地适应你的需求:
![](https://farm8.staticflickr.com/7499/15845274420_70bb95c221_b.jpg)
### A添加约会和待办任务 ###
### 添加约会和待办任务 ###
在前面的选项卡中浏览命令菜单时我们看到按下o可以从一个菜单到下一个菜单。我们可以把第二个菜单作为**安排编辑菜单**。
在前面的选项卡中浏览命令菜单时我们看到按下o可以从一个菜单到下一个菜单。我们可以把第二个菜单作为**安排编辑菜单**。
![](https://farm9.staticflickr.com/8634/16031851732_b947951f76_c.jpg)
@ -87,7 +87,7 @@ When we run calcurse for the first time, the following directory structure is cr
### 为事项设置通知 ###
你可以在通知菜单下配置通知。按照相同的步骤来以防改变配色,但是选择**Notify**而不是**Colour**
你可以在通知菜单下配置通知。按照相同的步骤来改变配色方案,但是选择**Notify**而不是**Colour**
![](https://farm8.staticflickr.com/7569/15412900863_eaf2767e19_z.jpg)
@ -103,7 +103,7 @@ When we run calcurse for the first time, the following directory structure is cr
### 总结 ###
本篇教程中我们展示了如何设置一个多样化的调度器和提醒器来帮助你组织每日的活动和提前安排重要的事项。你或许还要calcurse的[PDF 手册][2]请随意在下面的评论中提出你的疑问。欢迎你的评论,我也很高兴看到这些。
本篇教程中我们展示了如何设置一个多样化的调度器和提醒器来帮助你组织每日的活动和提前安排重要的事项。你或许还要看看calcurse的[PDF 手册][2],请随意在下面的评论中提出你的疑问。欢迎你的评论,我也很高兴看到这些。
--------------------------------------------------------------------------------
@ -111,7 +111,7 @@ via: http://xmodulo.com/schedule-appointments-todo-tasks-linux-terminal.html
作者:[Gabriel Cánepa][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -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
[a]:http://www.cyberciti.biz/tips/about-us

View File

@ -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/

View File

@ -0,0 +1,113 @@
Linux有问必答如何检查Linux的内存使用状况
================================================================================
>**问题**我想要监测Linux系统的内存使用状况。有哪些可用的图形界面或者命令行工具来检查当前内存使用情况
当涉及到Linux系统性能优化的时候物理内存是一个最重要的因素。自然的Linux提供了丰富的选择来监测珍贵的内存资源的使用情况。不同的工具在监测粒度例如全系统范围每个进程每个用户接口方式例如图形用户界面命令行ncurses或者运行模式交互模式批量处理模式上都不尽相同。
下面是一个可供选择的但并不全面的图形或命令行工具列表这些工具用来检查Linux平台中已用和可用的内存。
### 1. /proc/meminfo ###
一种最简单的方法是通过“/proc/meminfo”来检查内存使用状况。这个动态更新的虚拟文件事实上是诸如freetop和ps这些与内存相关的工具的信息来源。从可用/闲置物理内存数量到等待被写入缓存的数量或者已写回磁盘的数量,只要是你想要的关于内存使用的信息,“/proc/meminfo”应有尽有。特定进程的内存信息也可以通过“/proc/\<pid>/statm”和“/proc/\<pid>/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 <PID>
![](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

View File

@ -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/

View File

@ -1,22 +1,22 @@
Ubuntu 15.04即将整合Linux内核3.19分支
----
*Ubuntu已经开始跟踪一个新的内核分支*
*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分支的稳定版中,预计几个月后就会发布
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)。
“我们的Vivid的内核仍然基于v3.18.2的上游稳定内核但是我们很快将重新基于v3.18.3内核开发。我们也将把我们的非稳定版分支的基础变更到v3.19-rc5然后上传到我们的团队PPA。”Canonical的Joseph Salisbury[说](1)。
Linux内核3.19仍然处于开发阶段预计还要几个星期才会出稳定版本但是有充足的时间将它加入到Ubuntu中并测试。不可能等到3.20分支了举个例子即使它能在4月23日前发布。
Linux内核3.19仍然处于开发阶段预计还要几个星期才会出稳定版本但是有充足的时间将它加入到Ubuntu中并测试。但是不可能等到3.20分支了举个例子即使它能在4月23日前发布。
你现在就可以从Softpedia[下载Ubuntu 15.04](2),试用一下。这是一个每日构建版本,会包含发行版中目前已经做出的所有改善。
--------------------------------------------------------------------------------
via:http://news.softpedia.com/news/Data-of-20-Million-Users-Stolen-from-Dating-Website-471179.shtml
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
@ -24,7 +24,7 @@ via:http://news.softpedia.com/news/Data-of-20-Million-Users-Stolen-from-Dating-W
译者:[zpl1025](https://github.com/zpl1025)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,36 +1,36 @@
Wi-Fi直连的Android实现中的Bug导致拒绝服务
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直连连接的方式中的一个漏洞会导致在搜索连接节点的时候设备重启,这个节点可能是其他手机,摄像头,游戏设备,电脑或是打印机等任何设备。
Android处理Wi-Fi直连连接的方式中的一个漏洞可以导致在搜索连接节点的时候所连接的设备重启,这个节点可能是其他手机,摄像头,游戏设备,电脑或是打印机等任何设备。
Wi-Fi直连技术允许无线设备之间直接建立通信而不用加入到本地网络中。
##安全公司致力于协调修复这个问题
###安全公司致力于协调修复这个问题
这个漏洞允许攻击者发送一个特定的修改过的802.11侦测响应帧给设备从而因为WiFi监控类中的一个未处理的异常导致设备重启。
Core Security通过自己的CoreLabs团队发现了这个下次CVE-2014-0997早在2014年9月就汇报给了Google。这家供应商确认了这个问题,却把它列为低严重性,并不提供修复时间表。
Core Security通过自己的CoreLabs团队发现了这个瑕疵CVE-2014-0997早在2014年9月就汇报给了Google。Google确认了这个问题,却把它列为低严重性,并不提供修复时间表。
每次Core Security联系Android安全组要求提供修复时间表的时候都会收到同样的答复。最后一次答复是1月20日意味着这么时间中都没有补丁。在星期一的时候,这家安全公司公布了他们的发现。
每次Core Security联系Android安全组要求提供修复时间表的时候都会收到同样的答复。最后一次答复是1月20日意味着这么长的时间中都没有补丁。在星期一的时候,这家安全公司公布了他们的发现。
这家安全公司建立了一个(概念证明)[1]来展示他们研究结果的有效性。
这家安全公司建立了一个[概念攻击][1]来展示他们研究结果的有效性。
根据这个漏洞的技术细节一些Android设备在收到一个错误的wpa_supplicant事件后可能会进入拒绝服务状态这些事件让无线驱动和Android平台框架之间的接口有效。
##Google并不着急结束这个问题
###Google并不着急解决这个问题
Android安全组对于这个问题的放松态度可能是基于这个原因这种拒绝服务状态只发生在扫描节点这一小段时间。
Android安全组对于这个问题的放松态度可能是基于这个原因这种拒绝服务状态只发生在扫描节点这一小段时间。
不仅如此,实际上结果也并不严重,因为它会导致设备重启。不存在数据泄漏的风险或是能引起这个问题的攻击,不会吸引攻击者。另一方面,不管怎样都应该提供一个补丁,以减轻任何未来的潜在风险。
不仅如此,实际上结果也并不严重,因为它会导致设备重启。不存在数据泄漏的风险或是能引起这个问题的攻击,不会吸引攻击者。另一方面,不管怎样都应该提供一个补丁,以减轻任何未来的潜在风险。
Core Security声称在Android 5.0.1及以上版本中没有测试到这个问题,他们发现的受影响的设备有运行移动操作系统版本4.4.4的Nexus 5和4运行Android 4.2.2的LG D806和Samsung SM-T310以及4.1.2版本系统的Motorola RAZR HD。
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
@ -38,10 +38,8 @@ via:http://news.softpedia.com/news/Bug-In-Wi-Fi-Direct-Android-Implementation-Ca
本文发布时间:27 Jan 2015, 09:11 GMT
作者:[Ionut Ilascu][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,186 @@
如何在Linux命令行中创建以及展示演示稿
================================================================================
你在准备一场演讲的时候脑海可能会先被图文并茂、形象华丽的演示图稿所占据。诚然没有人会否认一份生动形象的演讲稿所带来的积极作用。然而并非所有的演讲都需要TED Talk的质量。更多时候演讲稿只为传达特定的信息。 而这个使用文本信息足以完成。在这种情况下你的时间可以更好的花在信息的搜集和核实上面而不是在谷歌图片搜索Google Image上寻找好看的图片。
在Linux的世界里有几个不同的方式供你选择来做演讲。比如带有大量多媒体展示、视觉冲击效果极佳的[Impress.js][1]专为LaTex用户提供的Beamer等等。而如果你苦于寻找一种简单的方式来创建并且展示文本演示稿[mdp][2] 就能帮你实现。
### 什么是Mdp ###
mdp是Linux下一款基于ncurses的命令行演示工具。我喜欢mdp在于它对[markdown][3]的支持使得我很容易以熟悉的markdown格式来创建幻灯片。自然它还可以很轻松地用HTML格式来发布幻灯片。另一个好处是它支持UTF-8字符编码这让非英语字符如希腊或西里尔字母的展示也变得很方便。
### 在Linux中安装Mdp ###
mdp的依赖需求很少如 ncursesw这使得安装非常简单。
#### Debian、Ubuntu或者它们的衍生版 ####
$ sudo apt-get install git gcc make libncursesw5-dev
$ git clone https://github.com/visit1985/mdp.git
$ cd mdp
$ make
$ sudo make install
#### Fedora或者CentOS/RHEL ####
$ sudo yum install git gcc make ncurses-devel
$ git clone https://github.com/visit1985/mdp.git
$ cd mdp
$ make
$ sudo make install
#### Arch Linux ####
Arch Linux可以通过[AUR][4]轻松安装mdp。
### 在命令行中创建演示稿 ###
安装mdp完毕你可以使用你喜欢的文本编辑器来轻松创建一个演示稿。如果你熟悉markdown的话很快就可以驾驭mdp。而对于那些不熟悉markdown的人来说学习mdp最好的方式就是从一个实例着手。
这里有一份6页的演示稿样本可供参考。
%title: Sample Presentation made with mdp (Xmodulo.com)
%author: Dan Nanni
%date: 2015-01-28
-> This is a slide title <-
=========
-> mdp is a command-line based presentation tool with markdown support. <-
*_Features_*
* Multi-level headers
* Code block formatting
* Nested quotes
* Nested list
* Text highlight and underline
* Citation
* UTF-8 special characters
-------------------------------------------------
-> # Example of nested list <-
This is an example of multi-level headers and a nested list.
# first-level title
second-level
------------
- *item 1*
- sub-item 1
- sub-sub-item 1
- sub-sub-item 2
- sub-sub-item 3
- sub-item 2
-------------------------------------------------
-> # Example of code block formatting <-
This example shows how to format a code snippet.
1 /* Hello World program */
2
3 #include <stdio.h>
4
5 int main()
6 {
7 printf("Hello World");
8 return 0;
9 }
This example shows inline code: `sudo reboot`
-------------------------------------------------
-> # Example of nested quotes <-
This is an example of nested quotes.
# three-level nested quotes
> This is the first-level quote.
>> This is the second-level quote
>> and continues.
>>> *This is the third-level quote, and so on.*
-------------------------------------------------
-> # Example of citations <-
This example shows how to place a citation inside a presentation.
This tutorial is published at [Xmodulo](http://xmodulo.com)
You are welcome to connect with me at [LinkedIn](http://www.linkedin.com/in/xmodulo)
Pretty cool, huh?
-------------------------------------------------
-> # Example of UTF-8 special characters <-
This example shows UTF-8 special characters.
ae = ä, oe = ö, ue = ü, ss = ß
alpha = ?, beta = ?, upsilon = ?, phi = ?
Omega = ?, Delta = ?, Sigma = ?
???????????
?rectangle?
???????????
### 在命令行中展示演示稿 ###
当你把以上代码保存为slide.md的文本文件后你可以运行以下命令来展示演示稿
$ mdp slide.md
你可以通过按键 回车/空格/下翻页/向下光标键 (下一张幻灯)、回退/上翻页/向上光标键 (上一张幻灯)、Home (幻灯首页)、 End (幻灯末页)或者 数字N (第N页幻灯)来操作你的演示稿。
演示稿的标题将在每页幻灯的顶部展示,而你的名字和页码则会出现在幻灯的底部。
![](https://farm9.staticflickr.com/8637/16392457702_ec732d0094_c.jpg)
这是嵌套列表和多层次标题的实例效果。
![](https://farm9.staticflickr.com/8567/16367397606_29be7df633_c.jpg)
这是代码片段和内联代码的实例效果。
![](https://farm9.staticflickr.com/8682/15770926144_0f982b0863_b.jpg)
这是嵌套引用的实例效果。
![](https://farm9.staticflickr.com/8587/16393383115_0865c8b89b_c.jpg)
这是放置引文的实例效果。
![](https://farm8.staticflickr.com/7409/16392457712_ed36c14bc2_c.jpg)
这是UTF-8编码特殊字符支持的实例效果。
![](https://farm9.staticflickr.com/8648/16205981560_7fa3debc75_c.jpg)
### 总结 ###
在本教程中我演示了在命令行中如何使用mdp来创建并且展示一个演示稿。mdp的markdown兼容性让我们省去了学习其它新格式的麻烦这相对于另一种名为[tpp][5]的演示工具来说是一个优势。拘于mdp的局限性它可能无法作为你的默认演示工具。但是值得肯定的是它一定能在某个场合下派上用场。你觉得mdp怎么样呢你还喜欢其它的什么东西吗
--------------------------------------------------------------------------------
via: http://xmodulo.com/presentation-command-line-linux.html
作者:[Dan Nanni][a]
译者:[soooogreen](https://github.com/soooogreen)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:http://bartaz.github.io/impress.js/
[2]:https://github.com/visit1985/mdp
[3]:http://daringfireball.net/projects/markdown/
[4]:https://aur.archlinux.org/packages/mdp-git/
[5]:http://www.ngolde.de/tpp.html

View File

@ -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语言。下面是步骤。
进入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)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://golang.org/dl/

View File

@ -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/
[8]:https://coreos.com/using-coreos/

View File

@ -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/

View File

@ -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 “Dont 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? Wont it hinder the progress of either distro and Linux in the long run?
Please give your [comments][2] about Devuan project.
如果可以在发布文章的时候发布一个调查就把下面这段发成一个调查如果不行就直接嵌入js代码
<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/8629256.js"></script>
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

View File

@ -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 Canonicals 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.
##BQs 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

View File

@ -0,0 +1,32 @@
CrunchBang Linux Is Dead!!!
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Crunchbang_Linux_Dead.jpeg)
Yes! You read it correct. The minimalist Linux distribution **CrunchBang Linux has been discontinued**.
CrunchBang Linux, popularly known for its abbreviated symbol #!, is based on Debian and comes with [Openbox][1] window manager. The dark themed Linux was/is a popular Linux choice for many experience Linux users.
### CrunchBang discontinued for “it no longer holds any value” ###
[Announcing][2] that CrunchBang will no longer be developed, head of the project Philip Newborough said that when he started the project, Linux world was different place. He mentioned that there was no competition in the same ilk at that time but with the advancement of Linux distros like Lubuntu, Crunchbang doesnt hold the same value.
> For anyone who has been involved with Linux for the past ten years or so, Im sure theyll agree that things have moved on. Whilst some things have stayed exactly the same, others have changed beyond all recognition. Its called progress, and for the most part, progress is a good thing. That said, when progress happens, some things get left behind, and for me, CrunchBang is something that I need to leave behind. Im leaving it behind because I honestly believe that it no longer holds any value, and whilst I could hold on to it for sentimental reasons, I dont believe that would be in the best interest of its users, who would benefit from using vanilla Debian.
### What after CrunchBang demise? ###
As happened in case of [Pear OS][3], CrunchBang forums will stay online. Downloads are available for now but will be removed in near future. Philip mentioned that he was excited about some of his incoming projects and his day job. I wish him luck in his future endeavors. It is sad to see the death of a nice Linux distribution like CrunchBang.
--------------------------------------------------------------------------------
via: http://itsfoss.com/crunchbang-linux-dead/
作者:[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://en.wikipedia.org/wiki/Openbox
[2]:http://crunchbang.org/forums/viewtopic.php?id=38916
[3]:http://itsfoss.com/pear-os-history/

View File

@ -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

View File

@ -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, lets 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. Lets 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 wont 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 Gnomes 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 its 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/

View File

@ -1,3 +1,4 @@
Translating by ZTinoZ
What is a good IDE for C/C++ on Linux
================================================================================
"A real coder doesn't use an IDE, a real coder uses [insert a text editor name here] with such and such plugins." We all heard that somewhere. Yet, as much as one can agree with that statement, an IDE remains quite useful. An IDE is easy to set up and use out of the box. Hence there is no better way to start coding a project from scratch. So for this post, let me present you with my list of good IDEs for C/C++ on Linux. Why is C/C++ specifically? Because C is my favorite language, and we need to start somewhere. Also note that there are in general a lot of ways to code in C, so in order to trim down the list, I only selected "real out-of-the-box IDE", not text editors like Gedit or Vim pumped with [plugins][1]. Not that this alternative is bad in any way, just that the list will go on forever if I include text editors.

View File

@ -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 doesnt 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. Its 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]
### Whats 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/

View File

@ -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
[1]:https://vivaldi.com/#Download

View File

@ -0,0 +1,24 @@
Non-Linux FOSS: Homebrew
================================================================================
I use OS X quite often during my day job. I'm able to tolerate it largely due to the terminal. If I couldn't do my work with green text on a black background, I think I'd go crazy (or crazier). Unfortunately, OS X doesn't come with all the command-line tools I need. That's where Homebrew comes in to save the day.
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11811fossf1.png)
Homebrew acts like the package management system OS X is lacking. Using commands very similar to apt-get, it allows the installation of hundreds of applications. A perfect example is the wget program. I was surprised to find that OS X doesn't include wget, but with Homebrew, it's a simple one-liner away.
The best part is that Homebrew installs everything in the /usr/local file space. There's no reason to worry about Homebrew corrupting your system, because it doesn't touch anything outside of /usr/local. OS X system updates won't overwrite your programs, and because /usr/local/bin is already in the PATH, installed Homebrew apps just work!
Homebrew uses Ruby to manage its packages and functions, but it doesn't require any programming knowledge to use. And the installation procedure is literally a copy/paste on the command line. If you use OS X, but you wish you could install packages as easily as in Linux, give Homebrew a try: [http://brew.sh][1].
--------------------------------------------------------------------------------
via: http://www.linuxjournal.com/content/non-linux-foss-homebrew
作者:[Shawn Powers][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.linuxjournal.com/users/shawn-powers
[1]:http://brew.sh/

View File

@ -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

View File

@ -1,3 +1,4 @@
translating by KayGuoWhu
Why does C++ promote an int to a float when a float cannot represent all int values?
---------

View File

@ -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 its 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/

View File

@ -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/

View File

@ -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

View File

@ -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
[t]:https://twitter.com/RonAmadeo

View File

@ -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

View File

@ -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 [arent 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 theres been lots of demand for access to its emoji.
Now, you can clone Twitters entire library on [GitHub][4] to use in your development projects. Heres 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, its 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 Twitters emoji library in most cases, you simply need to add a script inside the <head> section of your HTML page:
<script src="//twemoji.maxcdn.com/twemoji.min.js"></script>
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 isnt going to make emoji appear on your site. You also need to actually insert some emoji!
In the <body> section, paste a few of the emoji strings you can find in Twitters [preview.html source code][6]. I used &#x1F3B9; and &#x1F3C1; without really knowing how they'd appear in the browser window. Yeah, youll 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 ###
Twitters 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, youre going to need an easier solution than memorizing all those Unicode strings.
Thats where programmer Elle Kasais [Twemoji Awesome][7] styles come in.
By adding Elles open-source stylesheet to any webpage, you can use English words to understand which emoji youre inserting. So if you want a heart emoji to show up, you can simply type this :
<i class="twa twa-heart"></i>
In order to do this, lets download Elles project with the “Download ZIP” button on GitHub.
Next, lets make a new folder on the desktop. Inside this folder, well put emoji.html—the raw HTML file I showed you before, and also Elles [twemoji-awesome.css][8].
Well need the HTML file to acknowledge the CSS file, so in the <head> section of the html page youll want to add a link from the css file:
<link rel="stylesheet" href="twemoji-awesome.css">
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 <i class="twa twa-sparkling-heart"></i>, <i class="twa twa-exclamation"></i>, <i class="twa twa-lg twa-sparkles"></i> and <i class="twa twa-beer"></i>.
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, youve 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/

View File

@ -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
[1]:http://www.cgsecurity.org/wiki/TestDisk

View File

@ -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. Its 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, lets 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. Lets 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 lets 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 lets 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.Heres 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 dont 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/

View File

@ -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
[38]:http://doc.owncloud.org/server/7.0/user_manual/files/files.html

View File

@ -1,116 +0,0 @@
Translating by ZTinoZ
Linux FAQs with Answers--How to check CPU info on Linux
================================================================================
> **Question**: I would like to know detailed information about the CPU processor of my computer. What are the available methods to check CPU information on Linux?
Depending on your need, there are various pieces of information you may need to know about the CPU processor(s) of your computer, such as CPU vendor name, model name, clock speed, number of sockets/cores, L1/L2/L3 cache configuration, available processor capabilities (e.g., hardware virtualization, AES, MMX, SSE), and so on. In Linux, there are many command line or GUI-based tools that are used to show detailed information about your CPU hardware.
### 1. /proc/cpuinfo ###
The simpliest method is to check /proc/cpuinfo. This virtual file shows the configuration of available CPU hardware.
$ more /proc/cpuinfo
![](https://farm8.staticflickr.com/7572/15934711577_4136a8e0b9_c.jpg)
By inspecting this file, you can [identify][1] the number of physical processors, the number of cores per CPU, available CPU flags, and a number of other things.
### 2. cpufreq-info ###
The cpufreq-info command (which is part of **cpufrequtils** package) collects and reports CPU frequency information from the kernel/hardware. The command shows the hardware frequency that the CPU currently runs at, as well as the minimum/maximum CPU frequency allowed, CPUfreq policy/statistics, and so on. To check up on CPU #0:
$ cpufreq-info -c 0
![](https://farm8.staticflickr.com/7484/16094667926_d979240081_c.jpg)
### 3. cpuid ###
The cpuid command-line utility is a dedicated CPU information tool that displays verbose information about CPU hardware by using [CPUID functions][2]. Reported information includes processor type/family, CPU extensions, cache/TLB configuration, power management features, etc.
$ cpuid
![](https://farm9.staticflickr.com/8563/15500753923_6f1b25e8e9_c.jpg)
### 4. dmidecode ###
The dmidecode command collects detailed information about system hardware directly from DMI data of the BIOS. Reported CPU information includes CPU vendor, version, CPU flags, maximum/current clock speed, (enabled) core count, L1/L2/L3 cache configuration, and so on.
$ sudo dmidecode
![](https://farm8.staticflickr.com/7503/16094667836_825b61d0e5_b.jpg)
### 5. hardinfo ###
The hardinfo is a GUI-based system information tool which can give you an easy-to-understand summary of your CPU hardware, as well as other hardware components of your system.
$ hardinfo
![](https://farm8.staticflickr.com/7482/15933041268_40ccc17407_b.jpg)
### 6. i7z ###
i7z is a real-time CPU reporting tool dedicated to Intel Core i3, i5 and i7 CPUs. It can display various per-core information in real time, such as Turbo Boost states, CPU frequencies, CPU power states, temperature measurements, and so on. i7z runs in either ncurses-based console mode or QT based GUI.
$ sudo i7z
![](https://farm8.staticflickr.com/7546/15534687744_1968dc2b18_c.jpg)
### 8. likwid-topology ###
[likwid][3] (Like I Knew What I'm Doing) is a collection of command-line tools to measure, configure and display hardware related properties. Among them is likwid-topology which shows CPU hardware (thread/cache/NUMA) topology information. It can also identify processor families (e.g., Intel Core 2, AMD Shanghai).
![](https://farm8.staticflickr.com/7511/15934711707_5dc0793599_b.jpg)
### 9. lscpu ###
The lscpu command summarizes /etc/cpuinfo content in a more user-friendly format, e.g., the number of (online/offline) CPUs, cores, sockets, NUMA nodes.
$ lscpu
![](https://farm8.staticflickr.com/7501/15933173470_69e53b3021_b.jpg)
### 10. lshw ###
The **lshw** command is a comprehensive hardware query tool. Unlike other tools, lshw requires root privilege because it query DMI information in system BIOS. It can report the total number of cores and enabled cores, but miss out on information such as L1/L2/L3 cache configuration. The GTK version lshw-gtk is also available.
$ sudo lshw -class processor
![](https://farm9.staticflickr.com/8649/15498132484_a47c4e8cb3_c.jpg)
### 11. lstopo ###
The lstopo command (contained in [hwloc][4] package) visualizes the topology of the system which is composed of CPUs, cache, memory and I/O devices. This command is useful to identify the processor architecture and NUMA topology of the system.
$ lstopo
![](https://farm8.staticflickr.com/7490/15934399829_4012213734_z.jpg)
### 12. numactl ###
Originally developed to set the NUMA scheduling and memeory placement policy of Linux processes, the numactl command can also show information about NUMA topology of the CPU hardware from the command line.
$ numactl --hardware
![](https://farm8.staticflickr.com/7553/16094667876_9d7daa77a1_b.jpg)
### 13. x86info ###
x86info is a command-line tool for showing x86-based CPU information. Reported information includes CPU model, number of threads/cores, clock speed, TLB cache configuration, supported feature flags, etc.
$ x86info --all
![](https://farm8.staticflickr.com/7522/16131238626_d8a703c060_c.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/check-cpu-info-linux.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/how-to-find-number-of-cpu-cores-on.html
[2]:http://en.wikipedia.org/wiki/CPUID
[3]:http://xmodulo.com/identify-cpu-processor-architecture-linux.html
[4]:http://xmodulo.com/identify-cpu-processor-architecture-linux.html

View File

@ -1,122 +0,0 @@
Vic020
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/

View File

@ -1,92 +0,0 @@
[Translating] by FSSlc
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 <download-rate> -u <upload-rate> <command>
This will limit the download and upload rate of <command> 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 <interface> <download-rate> <upload-rate>
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

View File

@ -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/

View File

@ -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

View File

@ -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 <username> -s <new_default_shell>
# 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 $<Name_of_Variable>`”
### 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 .
注:表格部分
<table width="659" cellspacing="0" cellpadding="4">
<colgroup>
<col width="173">
<col width="453"> </colgroup>
<tbody>
<tr>
<td width="173" valign="top">
<p align="left" class="western">Special Variables</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">Holds</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">$0</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">Name of the Script from the command line</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">$1</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">First Command-line argument</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">$2</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">Second Command-line argument</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">…..</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">…….</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">$9</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">Ninth Command line argument</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">$#</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">Number of Command line arguments</p>
</td>
</tr>
<tr>
<td width="173" valign="top">
<p align="left" class="western">$*</p>
</td>
<td width="453" valign="top">
<p align="left" class="western">All Command-line arguments, separated with spaces</p>
</td>
</tr>
</tbody>
</table>
### 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 :
注:表格部分
<table width="644" cellspacing="0" cellpadding="4">
<colgroup>
<col width="173">
<col width="453"> </colgroup>
<tbody>
<tr valign="top">
<td width="173">
<p align="left" class="western">Test</p>
</td>
<td width="453">
<p align="left" class="western">Usage</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-d file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists and is a directory</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-e file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-f file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists and is a regular file</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-r file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists and have read permissions</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-s file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists and is not empty</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-w file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists and have write permissions</p>
</td>
</tr>
<tr valign="top">
<td width="173">
<p align="left" class="western">-x file_name</p>
</td>
<td width="453">
<p align="left" class="western">Returns true if the file exists and have execute permissions</p>
</td>
</tr>
</tbody>
</table>
### 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 <Name_of_Variable>
### 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/

View File

@ -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 <USER> with your username. Here, in my case its linoxide so I am replacing <USER> with linoxide and finally looks like below.
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.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/

View File

@ -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 theres 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 havent 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 well 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 youve 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=<script>alert(document.cookie)</script>: 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=<script>alert(document.cookie);</script>&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/

View File

@ -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]. Lets 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 dont 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 doesnt recognize your location automatically. Youll 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. Youll 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. Dont 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/

View File

@ -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 distros, 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/

View File

@ -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, isnt 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? Thats 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, dont 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 wont 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/

View File

@ -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

View File

@ -0,0 +1,106 @@
How to access Feedly RSS feed from the command line on Linux
================================================================================
In case you didn't know, [Feedly][1] is one of the most popular online news aggregation services. It offers seamlessly unified news reading experience across desktops, Android and iOS devices via browser extensions and mobile apps. Feedly took on the demise of Google Reader in 2013, quickly gaining a lot of then Google Reader users. I was one of them, and Feedly has remained my default RSS reader since then.
While I appreciate the sleek interface of Feedly's browser extensions and mobile apps, there is yet another way to access Feedly: Linux command-line. That's right. You can access Feedly's news feed from the command line. Sounds geeky? Well, at least for system admins who live on headless servers, this can be pretty useful.
Enter [Feednix][2]. This open-source software is a Feedly's unofficial command-line client written in C++. It allows you to browse Feedly's news feed in ncurses-based terminal interface. By default, Feednix is linked with a console-based browser called w3m to allow you to read articles within a terminal environment. You can choose to read from your favorite web browser though.
In this tutorial, I am going to demonstrate how to install and configure Feednix to access Feedly from the command line.
### Install Feednix on Linux ###
You can build Feednix from the source using the following instructions. At the moment, the "Ubuntu-stable" branch of the official Github repository has the most up-to-date code. So let's use this branch to build it.
As prerequisites, you will need to install a couple of development libraries, as well as w3m browser.
#### Debian, Ubuntu or Linux Mint ####
$ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m
$ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git
$ cd Feednix
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
#### Fedora ####
$ sudo yum groupinstall "C Development Tools and Libraries"
$ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m
$ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git
$ cd Feednix
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Arch Linux
On Arch Linux, you can easily install Feednix from [AUR][3].
### Configure Feednix for the First Time ###
After installing it, launch Feednix as follows.
$ feednix
The first time you run Feednix, it will pop up a web browser window, where you need to sign up to create a Feedly's user ID and its corresponding developer access token. If you are running Feednix in a desktop-less environment, open a web browser on another computer, and go to https://feedly.com/v3/auth/dev.
![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg)
Once you sign in, you will see your Feedly user ID generated.
![](https://www.flickr.com/photos/xmodulo/15827565143/)
To retrieve an access token, you need to follow the token link sent to your email address in your browser. Only then will you see the window showing your user ID, access token, and its expiration date. Be aware that access token is quite long (more than 200 characters). The token appears in a horizontally scrollable text box, so make sure to copy the whole access token string.
![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg)
Paste your user ID and access token into the Feednix' command-line prompt.
[Enter User ID] >> XXXXXX
[Enter token] >> YYYYY
After successful authentication, you will see an initial Feednix screen with two panes. The left-side "Categories" pane shows a list of news categories, while the right-side "Posts" pane displays a list of news articles in the current category.
![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg)
### Read News in Feednix ###
Here I am going to briefly describe how to access Feedly via Feednix.
#### Navigate Feednix ####
As I mentioned, the top screen of Feednix consists of two panes. To switch focus between the two panes, use TAB key. To move up and down the list within a pane, use 'j' and 'k' keys, respectively. These keyboard shorcuts are obviously inspired by Vim text editor.
#### Read an Article ####
To read a particular article, press 'o' key at the current article. It will invoke w2m browser, and load the article inside the browser. Once you are done reading, press 'q' to quit the browser, and come back to Feednix. If your environment can open a web browser, you can press 'O' to load an article on your default web browser such as Firefox.
![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg)
#### Subscribe to a News Feed ####
You can add any arbitrary RSS news feed to your Feedly account from Feednix interface. To do so, simply press 'a' key. This will show "[ENTER FEED]:" prompt at the bottom of the screen. After typing the RSS feed, go ahead and fill in the name of the feed and its preferred category.
![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg)
#### Summary ####
As you can see, Feednix is a quite convenient and easy-to-use command-line RSS reader. If you are a command-line junkie as well as a regular Feedly user, Feednix is definitely worth trying. I have been communicating with the creator of Feednix, Jarkore, to troubleshoot some issue. As far as I can tell, he is very active in responding to bug reports and fixing bugs. I encourage you to try out Feednix and let him know your feedback.
--------------------------------------------------------------------------------
via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:https://feedly.com/
[2]:https://github.com/Jarkore/Feednix
[3]:https://aur.archlinux.org/packages/feednix/

View File

@ -0,0 +1,111 @@
How to back up a Debian system using backupninja
================================================================================
Prudence or experience by disaster can teach every [sysadmin][1] the importance of taking frequent system backups. You can do so by writing good old shell scripts, or using one (or more) of the many backup tools available for the job. Thus the more tools you become acquainted with, the better informed decisions you will make when implementing a backup solution.
In this article we will present [backupninja][2], a lightweight and easy-to-configure system backup tool. With the help of programs like **rdiff-backup**, **duplicity**, **mysqlhotcopy** and **mysqldump**, Backupninja offers common backup features such as remote, secure and incremental file system backups, encrypted backup, and MySQL/MariaDB database backup. You can selectively enable status email reports, and can back up general hardware and system information as well. One key strength of backupninja is a built-in console-based wizard (called **ninjahelper**) that allows you to easily create configuration files for various backup scenarios.
The downside, so to speak, is that backupninja requires other "helper" programs to be installed in order to take full advantage of all its features. While backupninja's RPM package is available for Red Hat-based distributions, backupninja's dependencies are optimized for Debian and its derivatives. Thus it is not recommended to try backupninja for Red Hat based systems.
In this tutorial, we will cover the backupninja installation for Debian-based distributions.
### Installing Backupninja ###
Run the following command as root:
# aptitude install backupninja
During installation, several files and directories will be created:
- **/usr/sbin/backupninja** is the main bash shell script.
- **/etc/cron.d/backupninja**, by default, instructs cron to run the main script once per hour.
- **/etc/logrotate.d/backupninja** rotates the logs created by the program.
- **/etc/backup.d/** is the directory where the configuration files for backup actions reside.
- **/etc/backupninja.conf** is the main configuration file that includes general options. It is well commented and explains each option in detail.
- **/usr/share/backupninja** is the directory where the scripts used by backupninja are located (aka "handlers"). These are the scripts which are in charge of doing the actual work. In this directory you will also find .helper files, which are used to configure and set up ninjahelper menus.
- **/usr/share/doc/backupninja/examples** contains templates for action configuration files (the kind of files that are created through ninjahelper).
### Running Ninjahelper for the First Time ###
When we try to launch ninjahelper, we can see that an internal dependency may be required. If prompted, enter "yes" and press the ENTER key to install dialog (a tool that displays user-friendly dialog boxes from shell scripts).
![](https://farm8.staticflickr.com/7537/15700597667_6618fbc142_z.jpg)
When you press Enter after typing yes, backupninja will install dialog and present the following screen once it's done.
![](https://farm8.staticflickr.com/7469/15884374871_29f1c9acf1_z.jpg)
#### Example 1: Back up Hardware and System Info ####
After launching ninjahelper, we will create a new backup action:
![](https://farm9.staticflickr.com/8637/15885715132_eb3156678e_z.jpg)
If necessary helper programs are not installed, we will be presented with the following screens. Disregard this step if these packages have already been installed on your system.
![](https://farm8.staticflickr.com/7508/15700315139_4c6117ef32_z.jpg)
The next step consists of selecting the items that you want to be a part of this backup. The first four are selected by default, but you can deselect them by pressing the spacebar.
![](https://farm8.staticflickr.com/7507/15699051870_65abaf52e5_z.jpg)
Once you are done, press OK to continue. You will be able to choose whether you want to use the default configuration file for this backup action (/etc/backup.d/10.sys), or if you want to create a new one. In the latter case, a new file with the same contents as the default one will be created under the same directory but named 11.sys, and so on for future system backup actions. Note that you can edit the configuration file once it's created with your preferred text editor.
![](https://farm9.staticflickr.com/8654/15885715072_1e6126e929_o.png)
#### Example 2: Incremental Rsync Pull Backup of a Remote Directory ####
As you most likely know, rsync is widely used to synchronize files and folders over a network. In the following example we will discuss an approach to take incremental pull backups of a remote directory with hardlinking to save historical data and store them in our local file server. This approach will help us save space and increase security on the server side.
**Step 1**: Write a custom script in the /etc/backup.d directory with the following contents and chmod it to 600. Note that this directory may contain, besides plain configuration files, scripts that you want to run when backupninja is executed, with the advantage of using variables present in the main configuration file.
# REMOTE USER
user=root
# REMOTE HOST
host=dev1
# REMOTE DIRECTORY
remotedir=/home/gacanepa/
# LOCAL DIRECTORY
localdir=/home/gacanepa/backup.0
# LOCAL DIRECTORY WHERE PREVIOUS BACKUP WAS STORED
localdirold=/home/gacanepa/backup.1
mv $localdir $localdirold
# RSYNC
rsync -av --delete --recursive --link-dest=$localdirold $user@$host:$remotedir $localdir
In the above configuration, the '--link-dest' option of rsync is use to hardlink unchanged files (in all attributes) from $localdir-old to the destination directory ($localdir).
**Step 2**: Before backupninja is run for the first time, the parent directory (/home/gacanepa in this case) is empty. The first time we execute:
# backupninja -n
the backup.0 directory is created, and later in the process its name is changed to backup.1.
The second time we run backupninja, backup.0 is re-created and backup.1 is kept.
![](https://farm8.staticflickr.com/7581/15700597497_0e0cd89ab9.jpg)
**Step 3**: Verify that the contents of backup.1 are hard links to the files in backup.0 by comparing the respective inode numbers and directory sizes.
![](https://farm9.staticflickr.com/8636/15700315029_e922ce771b.jpg)
### Conclusion ###
Backupninja is not only a classic backup tool, but also an easy-to-configure utility. You can write your own handlers to run backupninja as per the individual configuration files located in /etc/backup.d, and you can even write helpers for ninjahelper in order to include them in its main interface.
For example, if you create a handler named xmodulo in /usr/share/backupninja, it will run by default every file with the .xmodulo extension in /etc/backup.d. If you decide you want to add your xmodulo handler to ninjahelper, you can write the corresponding helper as xmodulo.helper. In addition, if you want backupninja to run an arbitrary script, just add it to /etc/backup.d and you are good to go.
Feel free to leave your comments, questions, or suggestions, using the form below. we will be more than glad to hear from you.
--------------------------------------------------------------------------------
via: http://xmodulo.com/backup-debian-system-backupninja.html
作者:[Gabriel Cánepa][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/gabriel
[1]:http://xmodulo.com/recommend/sysadminbook
[2]:https://labs.riseup.net/code/projects/backupninja

View File

@ -0,0 +1,149 @@
Install OpenQRM Cloud Computing Platform In Debian
================================================================================
### Introduction ###
**openQRM** is a web-based open source Cloud computing and datacenter management platform that integrates flexibly with existing components in enterprise data centers.
It supports the following virtualization technologies:
- KVM,
- XEN,
- Citrix XenServer,
- VMWare ESX,
- LXC,
- OpenVZ.
The Hybrid Cloud Connector in openQRM supports a range of private or public cloud providers to extend your infrastructure on demand via **Amazon AWS**, **Eucalyptus** or **OpenStack**. It, also, automates provisioning, virtualization, storage and configuration management, and it takes care of high-availability. A self-service cloud portal with integrated billing system enables end-users to request new servers and application stacks on-demand.
openQRM is available in two different flavours such as:
- Enterprise Edition
- Community Edition
You can view the difference between both editions [here][1].
### Features ###
- Private/Hybrid Cloud Computing Platform;
- Manages physical and virtualized server systems;
- Integrates with all major open and commercial storage technologies;
- Cross-platform: Linux, Windows, OpenSolaris, and *BSD;
- Supports KVM, XEN, Citrix XenServer, VMWare ESX(i), lxc, OpenVZ and VirtualBox;
- Support for Hybrid Cloud setups using additional Amazon AWS, Eucalyptus, Ubuntu UEC cloud resources;
- Supports P2V, P2P, V2P, V2V Migrations and High-Availability;
- Integrates with the best Open Source management tools like puppet, nagios/Icinga or collectd;
- Over 50 plugins for extended features and integration with your infrastructure;
- Self-Service Portal for end-users;
- Integrated billing system.
### Installation ###
Here, we will install openQRM in Ubuntu 14.04 LTS. Your server must atleast meet the following requirements.
- 1 GB RAM;
- 100 GB Hdd;
- Optional: Virtualization enabled (VT for Intel CPUs or AMD-V for AMD CPUs) in Bios.
First, install make package to compile openQRM source package.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install make
Then, run the following commands one by one to install openQRM.
Download the latest available version [from here][2].
wget http://sourceforge.net/projects/openqrm/files/openQRM-Community-5.1/openqrm-community-5.1.tgz
tar -xvzf openqrm-community-5.1.tgz
cd openqrm-community-5.1/src/
sudo make
sudo make install
sudo make start
During installation, youll be asked to update the php.ini file.
![~-openqrm-community-5.1-src_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_001.png)
Enter mysql root user password.
![~-openqrm-community-5.1-src_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_002.png)
Re-enter password:
![~-openqrm-community-5.1-src_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_003.png)
Select the mail server configuration type.
![~-openqrm-community-5.1-src_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_004.png)
If youre not sure, select Local only. In our case, I go with **Local only** option.
![~-openqrm-community-5.1-src_005](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_005.png)
Enter your system mail name, and finally enter the Nagios administration password.
![~-openqrm-community-5.1-src_007](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_007.png)
The above commands will take long time depending upon your Internet connection to download all packages required to run openQRM. Be patient.
Finally, youll get the openQRM configuration URL along with username and password.
![~_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@debian-_002.png)
### Configuration ###
After installing openQRM, open up your web browser and navigate to the URL: **http://ip-address/openqrm**.
For example, in my case http://192.168.1.100/openqrm.
The default username and password is: **openqrm/openqrm**.
![Mozilla Firefox_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/Mozilla-Firefox_003.png)
Select a network card to use for the openQRM management network.
![openQRM Server - Mozilla Firefox_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_004.png)
Select a database type. In our case, I selected mysql.
![openQRM Server - Mozilla Firefox_006](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_006.png)
Now, configure the database connection and initialize openQRM. Here, I use **openQRM** as database name, and user as **root** and debian as password for the database. Be mindful that you should enter the mysql root user password that you have created while installing openQRM.
![openQRM Server - Mozilla Firefox_012](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_012.png)
Congratulations!! openQRM has been installed and configured.
![openQRM Server - Mozilla Firefox_013](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png)
### Update openQRM ###
To update openQRM at any time run the following command:
cd openqrm/src/
make update
What we have done so far is just installed and configured openQRM in our Ubuntu server. For creating, running Virtual Machines, managing Storage, integrating additional systems and running your own private Cloud, I suggest you to read the [openQRM Administrator Guide][3].
Thats all now. Cheers! Happy weekend!!
--------------------------------------------------------------------------------
via: http://www.unixmen.com/install-openqrm-cloud-computing-platform-debian/
作者:[SK][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.unixmen.com/author/sk/
[1]:http://www.openqrm-enterprise.com/products/edition-comparison.html
[2]:http://sourceforge.net/projects/openqrm/files/?source=navbar
[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf

View File

@ -0,0 +1,98 @@
Install the Gnome Flashback classical desktop on Ubuntu 14.10/Linux Mint 17
================================================================================
The [Gnome Flashback][1] desktop environment is a simple and great way to get back the old style classical desktop if you do not like Unity desktop, like many.
Gnome Flashback is based on GTK 3 and provides a desktop interface visually similar to the old gnome desktop.
Another alternative to gnome flashback is the MATE desktop from linux mint and XFCE desktop, but both of them are based on gtk 2.
### Install Gnome Flashback ###
Install the following package on your Ubuntu system and you are done.
$ sudo apt-get install gnome-session-flashback
Now logout and at the login screen press the settings button on the box that asks for password. There would be 2 options, Gnome Flashback (Metacity) and Gnome Flashback (Compiz).
Metacity is lighter and faster, whereas Compiz gets you the more fancy desktop effects. Here is a screenshot of my gnome flashback desktop.
It uses a wallpaper from elementary OS and also Plank dock with no bottom panel. This tutorial explains every bit of it.
![ubuntu gnome flashback](http://www.binarytides.com/blog/wp-content/uploads/2015/02/ubuntu-gnome-flashback.png)
After installing Gnome Flashback desktop you need to do a couple of more things to finetune it.
### 1. Install Gnome Tweak Tool ###
The Gnome Tweak Tool allows you to customize things like fonts, themes etc, that are otherwise difficult or impossible with the "unity-control-center" tool of Unity desktop.
$ sudo apt-get install gnome-tweak-tool
Find it in Applications > System Tools > Preferences > Tweak Tool
### 2. Add applets to panel ###
By default right clicking on the panels would not have any effect. Press the Alt+Super (windows) key on your keyboard while you right click on the panels and you would get the relevant options to customize the panel.
You can modify the panel, remove it and also add applets to it. In this example we shall remove the bottom panel and replace it with Plank dock.
Add a datetime applet on the top panel at the middle. Configure it to display the date time and weather conditions.
Also add a workspace switcher applet to the top panel and create as many workspaces as you need.
### 3. Take window title bar buttons to the right ###
On Ubuntu the minimise, maximise and close buttons on the window title bar are on the left by default. It needs a small hack to get them to the right.
To take the window buttons to the right use the following command, which I found at askubuntu.
$ gsettings set org.gnome.desktop.wm.preferences button-layout 'menu:minimize,maximize,close'
### 4. Install Plank dock ###
The plank dock sits at the bottom and holds launchers for applications and window launchers for running applications. It hides itself when not necessary and shows up again when needed. Its the same dock as used by elementary OS.
Run the following commands
$ sudo add-apt-repository ppa:ricotz/docky -y
$ sudo apt-get update
$ sudo apt-get install plank -y
Find it in Applications > Accessories > Plank. To configure it to start automatically with the system, go to System Tools > Preferences > Startup Applications and add the "plank" command to the list.
### 5. Install Conky system monitor ###
Conky is a nice way to decorate your desktop with system statistics like cpu and memory usage. It is lightweight and works most of the time without any hassles.
Run the following commands -
$ sudo apt-add-repository -y ppa:teejee2008/ppa
$ sudo apt-get update
$ sudo apt-get install conky-manager
Now launch Applications > Accessories > Conky Manager and select the widget you want to display on your desktop. Conky Manager also allows you to configure it to launch at system startup.
### 6. Install CompizConfig Settings Manager ###
If you wish to use Gnome Flashback (Compiz) session then it would be useful to use the compiz settings manager to configure desktop effects. Install it with the following command
$ sudo apt-get install compizconfig-settings-manager
Now launch it from System Tools > Preferences > CompizConfig Settings Manager.
> It so happened inside Virtualbox that, in the compiz session window decorations went missing. To fix it, launch Compiz settings and enable the "Copy to texture" plugin and then logout and login back. It should be fixed.
However the Compiz session is slower than the Metacity session.
--------------------------------------------------------------------------------
via: http://www.binarytides.com/install-gnome-flashback-ubuntu/
作者:[Silver Moon][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117145272367995638274/posts
[1]:https://wiki.gnome.org/action/show/Projects/GnomeFlashback?action=show&redirect=GnomeFlashback

View File

@ -0,0 +1,91 @@
Linux FAQs with Answers--How to fix “fatal error: x264.h: No such file or directory” on Linux
================================================================================
> **Question**: I am trying to build a video encoding application from the source on Linux. However, during compilation, I am encountering the error: "fatal error: x264.h: No such file or directory" How can I fix this error?
The following compilation error indicates that you do not have x264 library's development files installed on your Linux system.
fatal error: x264.h: No such file or directory
[x264][1] is an H.264/MPEG-4 AVC encoder library licensed with GNU GPL. The x264 library is popularly used by many video encoder/transcoder programs such as Avidemux, [FFmpeg][2], [HandBrake][3], OpenShot, MEncode and more.
To solve the above compilation error, you need to install development files for x264 library. Here is how you can do it.
### Install x264 Library and its Development Files on Debian, Ubuntu or Linux Mint ###
On Debian based systems, x264 library is already included in the base repositories. Thus its installation is straightforward with apt-get as follows.
$ sudo apt-get install libx264-dev
### Install x264 Library and its Development Files on Fedora, CentOS/RHEL ###
On Red Hat based distributions such as Fedora or CentOS, the x264 library is available via the free repository of RPM Fusion. Thus, you need to install [RPM Fusion (free)][4] first.
Once RPM Fusion is set up, you can install x264 development files as follows.
$ sudo yum --enablerepo=rpmfusion-free install x264-devel
Note that RPM Fusion repository is not available for CentOS 7 yet, so the above method does not work for CentOS 7. In case of CentOS 7, you can build and install x264 library from the source, which is explained below.
### Compile x264 Library from the Source on Debian, Ubuntu or Linux Mint ###
If the libx264 package that comes with your distribution is not up-to-date, you can compile the latest x264 library from the source as follows.
$ sudo apt-get install g++ automake autoconf libtool yasm nasm git
$ git clone git://git.videolan.org/x264.git
$ cd x264
$ ./configure --enable-static --enable-shared
$ make
$ sudo make install
The x264 library will be installed in /usr/local/lib. To allow the library to be used by other applications, you need to complete the last step:
Open /etc/ld.so.conf with a text editor, and append the following line.
$ sudo vi /etc/ld.so.conf
----------
/usr/local/lib
Finally reload all shared libraries by running:
$ sudo ldconfig
### Compile x264 Library from the Source on Fedora, CentOS/RHEL ###
If the x264 library is not available on your Linux distribution (e.g., CentOS 7) or the x264 library is not up-to-date, you can build the latest x264 library from the source as follows.
$ sudo yum install gcc gcc-c++ automake autoconf libtool yasm nasm git
$ git clone git://git.videolan.org/x264.git
$ cd x264
$ ./configure --enable-static --enable-shared
$ make
$ sudo make install
Finally, to allow other applications to use x264 library installed in /usr/local/lib, add the following line in /etc/ld.so.conf:
$ sudo vi /etc/ld.so.conf
----------
/usr/local/lib
and reload all shared libraries by running:
$ sudo ldconfig
![](https://farm8.staticflickr.com/7350/16453197512_7c18c5c09e_b.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/fatal-error-x264-h-no-such-file-or-directory.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.videolan.org/developers/x264.html
[2]:http://ask.xmodulo.com/compile-ffmpeg-centos-fedora-rhel.html
[3]:http://xmodulo.com/how-to-install-handbrake-on-linux.html
[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html

View File

@ -0,0 +1,48 @@
Linux FAQs with Answers--How to get the process ID (PID) of a shell script
================================================================================
> **Question**: I want to know the process ID (PID) of the subshell under which my shell script is running. How can I find a PID in a bash shell script?
When you execute a shell script, it will launch a process known as a subshell. As a child process of the main shell, a subshell executes a list of commands in a shell script as a batch (so-called "batch processing").
In some cases, you may want to know the process ID (PID) of the subshell where your shell script is running. This PID information can be used under different circumstances. For example, you can create a unique temporary file in /tmp by naming it with the shell script PID. In case a script needs to examine all running processes, it can exclude its own subshell from the process list.
In bash, the **PID of a shell script's subshell process** is stored in a special variable called '$$'. This variable is read-only, and you cannot modify it in a shell script. For example:
#!/bin/bash
echo "PID of this script: $$"
The above script will show the following output.
PID of this script: 6583
Besides $$, bash shell exports several other read-only variables. For example, PPID stores the process ID of the subshell's parent process (i.e., main shell). UID stores the user ID of the current user who is executing the script. For example:
#!/bin/bash
echo "PID of this script: $$"
echo "PPID of this script: $PPID"
echo "UID of this script: $UID"
Its output will be:
PID of this script: 6686
PPID of this script: 4656
UID of this script: 1000
In the above, PID will keep changing every time you invoke a script. That is because each invocation of a script will create a new subshell. On the other hand, PPID will remain the same as long as you run a script inside the same shell.
![](https://farm8.staticflickr.com/7437/16274890369_e78ce16d42_b.jpg)
For a complete list of built-in bash variables, refer to its man page.
$ man bash
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/process-id-pid-shell-script.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -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

View File

@ -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/) 荣誉推出

View File

@ -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/

View File

@ -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
[6]:http://linux.about.com/od/commands/l/blcmdl8_sudo.htm

View File

@ -2,39 +2,39 @@
================================================================================
Linux 与 Mac 用户至少有一个共同点:他们都不太喜欢用 Windows。但除了这点外二者再也无法达成其他共识只得分道扬镳。为什么 Mac 用户不选择 Linux 呢?是什么因素致使 Mac 用户做出了这种选择的?
[Datamation 就此问题做了一番调查][1]并试图进行解答。Datamation 的结论是,所有原因都只归结于众多应用及工作,而非操作系统的关系:
[Datamation 就此问题做了一番调查][1]并试图进行解答。Datamation 的结论是,所有原因都只归结于众多应用及工作流程,而非操作系统的关系:
> …某些事例表明,尝试用新应用接替现有应用,并非会是很糟糕的体验 - 对工作区和实用性来说都是如此。但不幸的是,苹果在这些方面做得非常好。因此,在几乎不可能改变这些事实的情况下,想要拉拢那些 Mac忠实用户实在是很大的挑战。
> …某些事例表明,尝试用新应用代替现有应用,并不是很实际 - 对工作流程和整体实用性来说都是如此。但不幸的是,苹果在这些方面做得非常好。因此,在几乎不可能改变这些事实的情况下,想要拉拢那些 Mac忠实用户实在是很大的挑战。
> 不过老实来说,除了 Web 开发者,我还没见过 Mac 用户仅仅为了避免升级到 OS X Yosemite 而 “
en masse”(法语:共同,一起) 尝试变更他们的工作。诚然,经历过 Yosemite 更新后 - 考虑过权限的用户应该会发现这方面已经变得非常令人讨厌。并且OS X 除了在 UI 方面几乎没有变化,针对现有 Mac 用户的核心工作区也在最大程度上保持了原样。
en masse”(法语:共同,一起) 尝试变更他们的工作流程。诚然,经历过 Yosemite 更新后 - 考虑过权限的用户应该会发现这方面已经变得非常令人讨厌。并且OS X 除了在 UI 方面的微小变化,几乎没有改变,针对现有 Mac 用户的核心工作流程也在最大程度上保持了原样。
> 但,我相信 Linux 在未来将会继续保持多样化特点。Linux 会继续成长,但绝不是经过精确计量般得一成不变。
我大体上同意 Datamation 关于应用和工作区的重要性的结论,在选择操作系统时这两方面是必须要考虑顾及的。但我认为对 Mac 用户来说,选择 Mac 有比这两方面更重要的因素。我相信是不同的心态造就了 Linux 和 Mac 用户,并且我认为这才是为什么 Mac 用户不选择 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正是从那里他们开始厌恶那些告诉他们什么才叫操作系统并试图限制操作系统权限的东西
对 Mac以及 iOS用户来说这没什么因为他们似乎并不在乎生活在苹果那围墙高筑的花园里仅仅使用那些苹果给予他们的标准和选择。但这对绝大多数 Linux 用户来说是完全不能接受的。Linux 的新用户通常来自 Windows正是从那里他们开始厌恶那些告诉他们什么才叫操作系统并试图限制操作系统权限的东西。
自从他们尝到使用自由的 Linux 系统所带来的甜头之后,他们就再也不会回到苹果或者微软的监牢里去了。即使在他们死后,把 Linux 从他们那冰冷僵硬的手指下撬出来,他们也不会接受苹果和微软那种糟糕的操作系统。
自从他们尝到使用自由的 Linux 系统所带来的甜头之后,他们就再也不会回到苹果或者微软的监牢里去了。即使在他们死后,把 Linux 从他们那冰冷僵硬的手指中撬出来,他们也不会接受苹果和微软为他们定制的操作系统。
但绝大部分 Mac 用户不会有这样的意志和决心。对他们来说当苹果升级 OS X 时放弃他们现有的习惯方式是非常容易的。在苹果那围墙高筑的花园里,即使他们不满意苹果的变化,他们也会迅速地接受。
因此,对控制权的渴望是 Mac 用户与 Linux 用户的最大不同。但我并未把它视为一个问题,尽管这反映出使用电脑的两类人的截然不同的态度。
因此,对控制权的渴望是 Mac 用户与 Linux 用户的最大不同。但我并未把它视为一个问题,尽管这反映出使用电脑的两类用户截然不同的态度。
### Mac 用户离不开苹果的技术支持 ###
Linux 用户与 Mac 用户的区别也体现在 Linux 用户并不介意亲自维护自己的电脑。虽然维护电脑及控制操作系统都是很大的责任,但 Linux 用户还是愿意独自承担,愿意通过自己的力量使他们的系统工作得更棒更有效率,并且深入了解操作系统是每一位 Linux 用户都乐衷的事情。
当 Linux 用户遇到问题时,他们会迅速地尝试自己来解决问题。如果这不奏效的话,他们会在网上寻找其他用户在遇到类似问题是怎么解决的,并不断进行尝试,直到问题解决。
当 Linux 用户遇到问题时,他们会迅速地尝试自己来解决问题。如果这不奏效的话,他们会在网上搜索其他Linux用户的解决方案,并不断进行尝试,直到问题解决。
但 Mac 用户却不大会这样。这也许是为什么苹果零售店如此火爆、为什么如此多的 Mac 用户在拿到新 Mac 的时候会选择购买苹果维护服务的原因。Mac 用户会很轻易得带着 TA 的电脑去苹果零售店,走进天才吧并要求苹果的工作人员为其查看和修复电脑。
绝大多数 Linux 用户连想都不会这种事情。谁会愿意让一个你都不认识的家伙碰你的电脑并维修它呢?
绝大多数 Linux 用户连想都不会这种事情。谁会愿意让一个你都不认识的家伙碰你的电脑并维修它呢?
因此对 Mac 用户来说,很难抛弃过去可以从苹果那里得到的技术支持,转而使用 Linux。这种选择会令某些 Mac 用户觉得自己的电脑将变得非常脆弱、容易被攻击,他们如同离开母亲怀抱的婴儿般充满了无助感。
@ -42,7 +42,7 @@ Linux 用户与 Mac 用户的区别也体现在 Linux 用户并不介意亲自
Datamation 发表的文章中主要研究了软件方面的原因,但我认为硬件因素同样对 Mac 用户有很大影响。绝大部分 Mac 用户非常喜爱苹果的硬件。TA 们购买 Mac 并不仅仅是为了 OS X。苹果那精美的工艺设计也是 Mac 用户购买时着重考虑的一点。Mac 用户愿意支付高价购买电脑,因为他们认为这样绝对是物有所值的。
另一方面Linux 用户似乎并不会考虑这些东西。我认为他们更偏向于在他们的电脑外观上花费较少的金钱。对他们来说,花费最少的金钱来获取尽可能好的硬件才是最重要的。他们并不像 Mac 用户一样热衷于电脑的外观,因此这一点并不是他们在购买电脑时考虑的地方。
另一方面Linux 用户似乎并不会考虑这些东西。我认为他们更关注电脑的花费,而不太在意电脑的外观和设计。对他们来说,花费最少的金钱来获取尽可能好的硬件才是最重要的。他们并不像 Mac 用户一样热衷于电脑的外观,因此这一点并不是他们在购买电脑时考虑的地方。
我认为对于硬件的两种不同观点是没有高低之分的。这仅仅和用户的不同需求有关,仅仅会在他们购买电脑时影响他们,或者对某些 Linux 用户来说只是因为他们想要自己组装电脑而已。两种观点只是因为出发点不同、对于电脑的真正价值体现所在之处的理解不同罢了。
@ -50,19 +50,19 @@ Datamation 发表的文章中主要研究了软件方面的原因,但我认为
### Linux 发行版太多了不知道选哪个? ###
另一个让 Mac 用户无法选择 Linux 的原因是:要从众多 Linux 发行版当中选择一个实在是太困难了。在大多数 Linux 并不抗拒的多元化发行版时代,没有任何相关知识的 Mac 用户感到十分困惑。
另一个让 Mac 用户无法选择 Linux 的原因是:要从众多 Linux 发行版当中选择一个实在是太困难了。在大多数 Linuxer 并不抗拒的多元化发行版时代,没有相关知识的 Mac 用户会对如何选择感到十分困惑。
我认为随着时间的推移Mac 用户可以找出不适应最适合自己的发行版。但在短时间内,尤其是长时期得使用 OS X 之后,这是一个艰巨的任务。我不认为这个问题是无法克服的,但却有必要在这里提一下。
我认为随着时间的推移Mac 用户可以学习并找出最适合自己的发行版。但在短时间内,尤其是长时期得使用 OS X 之后,这是一个艰巨的任务。我不认为这个问题是无法克服的,但却有必要在这里提一下。
当然我们可以给 Mac 用户指明道路,推荐参考 [DistroWatch][3] 还有我们人的博客 [Desktop Linux Reviews][4],这都有助于 Mac 用户找到正确的 Linux 发行版。再说一条,网上有很多诸如“最好的 Linux 发行版”等类似的文章,当 Mac 用户想要寻找适合自己使用的发行版时可以参考一下。
当然我们可以给大家提供资源,推荐参考 [DistroWatch][3] 还有我们的博客 [Desktop Linux Reviews][4],这都有助于 Mac 用户找到适合的 Linux 发行版。再说一条,网上有很多诸如“最好的 Linux 发行版”等类似的文章,当 Mac 用户想要寻找适合自己使用的发行版时可以参考一下。
但有苹果顾客购买 Mac 的其中一个原因是苹果硬件软件协调统一起来的简便性和易用性。所以我不确定有多少 Mac 用户愿意花费时间找出适合自己的 Linux 发行版。也许是否要使用 Linux 确实会令 TA 们考虑一阵子了。
但有苹果顾客购买 Mac 的其中一个原因是苹果硬件软件协调统一起来的简便性和易用性。所以我不确定有多少 Mac 用户愿意花费时间找出适合自己的 Linux 发行版。也许是否要使用 Linux 确实会令TA们考虑一阵子了。
### Mac 用户是苹果Linux 用户是橘子 ###
Mac 用户与 Linux 用户分道扬镳我认为并没有什么不妥。我认为我们只是在谈论两类完全不同的人群,这是一件好事,因为两类人群都在按自己四环的方式去使用操作系统和软件。让 Mac 用户和 Linux 用户各自沉浸在 OS X 和 Linux 中吧,希望他们都能高兴,都能对自己的电脑满意。
Mac 用户与 Linux 用户分道扬镳我认为并没有什么不妥。我认为我们只是在谈论两类完全不同的人群,这是一件好事,因为两类人群都在按自己喜欢的方式去使用操作系统和软件。让 Mac 用户和 Linux 用户各自沉浸在 OS X 和 Linux 中吧,希望他们都能高兴,都能对自己的电脑满意。
也许 Mac 用户会偶然走入 Linux 的世界并开始转向 Linux但我认为绝大多数时候两类人都愿意呆在不同的世界并不与对方接触。通常来说我并不会随意比较二者,尤其是你已经自己拿定主意的时候,况且这只不过是选苹果还是选橘子的问题罢了。
也许 Mac 用户会偶然走入 Linux 的世界并开始转向 Linux但我认为绝大多数时候两类人都愿意呆在不同的世界并不与对方接触。通常来说我并不会随意比较二者尤其是你已经自己拿定主意的时候况且这只不过是选苹果还是选橘子的问题罢了。
--------------------------------------------------------------------------------
@ -70,7 +70,7 @@ via: http://jimlynch.com/linux-articles/why-mac-users-dont-switch-to-linux/
作者:[Jim Lynch][a]
译者:[Stevearzh](https://github.com/Stevearzh)
校对:[校对者ID](https://github.com/校对者ID)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
@ -78,4 +78,4 @@ via: http://jimlynch.com/linux-articles/why-mac-users-dont-switch-to-linux/
[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/
[4]:http://desktoplinuxreviews.com/

View File

@ -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

View File

@ -0,0 +1,223 @@
如何使用linux程序mdadm创建软件RAID1软阵列
================================================================================
磁盘冗余阵列(RAID)是将多个物理磁盘结合成一个逻辑磁盘的技术,该技术可以提高磁盘容错性能,提高磁盘的读写速度。根据数据存储的排列(如 条带存储,镜像存储,奇偶或者他们的组合)定义了几个不同级别的RAID(RAID-0RAID-1RAID-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

View File

@ -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 网页中的 `<head>`块中添加如下脚本:
<script src="//twemoji.maxcdn.com/twemoji.min.js"></script>
这样就使得你的项目可以访问 包含有已经在 Twitter 中可使用的数以百计的 Emoji 符号的 JavaScript 库。然而,创建一个仅仅包含这个脚本的文档并不能使得在你的网站中呈现出 emoji 符号,实际上,你仍需要嵌入一些 emoji 符号!
`<body>`块中,粘贴一些可以在 Twitter 的[preview.html 文件源代码][6] 中找到的 emoji 字符串。我使用了 &#x1F3B9;&#x1F3C1当然我并不知道在浏览器窗口中它们的样子。是的你必须粘贴并猜测它们。你已经看出了问题我们将在 第二小节中予以解决。
无论如何,通过一些尝试,你可以将一个如下图的原始 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 符号,你可以简单地输入:
<i class="twa twa-heart"></i>
为了实现上面的目的,让我们下载 Elle 的项目,通过点击在 GitHub 上 “Download ZIP” 按钮。
接着,我们在桌面上新建一个文件夹,然后进入该文件夹,并将 emoji.html---我先前向你展示的 HTML 源文件--- 和 Elle 的 [twemoji-awesome.css][8] 一同放进去。
我们还需要 HTML 文件识别这个 CSS 文件,所以在 html 网页中的 `<head>` 块中,为 CSS 文件添加一个链接:
<link rel="stylesheet" href="twemoji-awesome.css">
一旦你将上面的代码添加了进去,你便可以删除先前添加的 Twitter 的脚本链接。
现在,找到 `body` 块部分的代码,然后添加一些 emoji 符号。我使用了 `<i class="twa twa-sparkling-heart"></i>`, `<i class="twa twa-exclamation"></i>`, `<i class="twa twa-lg twa-sparkles"></i>``<i class="twa twa-beer"></i>`
最终,你将得到如下的代码:
![](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/

View File

@ -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/

View File

@ -1,56 +0,0 @@
小贴士:在 Ubuntu 14.04 中Apache从2.2迁移到2.4的问题
================================================================================
如果你进行了一次**Ubuntu**从12.04到14.04的升级,那么它还包括了一个重大的升级--**Apache**从2.2版本升级到2.4版本。**Apache**的这次升级带来了许多性能提升但是如果继续使用2.2的配置文件会导致很多错误。
### 访问控制的改变 ###
从**Apache 2.4**起授权authorization开始启用比起2.2的一个检查一个数据存储,授权更加灵活。过去很难确定授权如何并且以什么样的顺序被应用,但是授权容器指令的介绍解决了这些问题,现在,配置可以控制什么时候授权方法被调用,什么条件决定何时授权访问。
这就是为什么大多数的升级失败是由于错误配置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指令。
### 丢失配置文件或者模块 ###
根据我的经验这次升级带来的另一个问题就是在2.4中旧模块和配置文件不再需要或者不被支持了。你将会收到一条“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中的使用情况来决定是否删除或者使用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/

View File

@ -0,0 +1,115 @@
Linux有问必答时间--如何查看Linux系统的CPU信息
================================================================================
> **问题**: 我想要了解我的电脑关于CPU处理器的详细信息查看CPU信息比较有效地方法是什么
根据你的需要有各种各样的关于你的CPU处理器信息你需要了解比如CPU供应商名、模型名、时钟频率、套接字/内核的数量, L1/L2/L3缓存配置、可用的处理器能力(比如硬件虚拟化、AES, MMX, SSE)等等。在Linux中有许多命令行或基于GUI的工具就能来展示你的CPU硬件的相关具体信息。
### 1. /proc/cpuinfo ###
最简单的方法就是查看 /proc/cpuinfo 这个虚拟文件展示的是可用CPU硬件的配置。
$ more /proc/cpuinfo
![](https://farm8.staticflickr.com/7572/15934711577_4136a8e0b9_c.jpg)
通过查看这个文件,你能[识别出][1]物理处理器数、每个CPU核心数、可用的CPU标志寄存器以及其它东西的数量。
### 2. cpufreq-info ###
cpufreq-info命令(**cpufrequtils**包的一部分)从内核/硬件中收集并报告CPU频率信息。这条命令展示了CPU当前运行的硬件频率包括CPU所允许的最小/最大频率、CPUfreq策略/统计数据等等。来看下CPU #0上的信息
$ cpufreq-info -c 0
![](https://farm8.staticflickr.com/7484/16094667926_d979240081_c.jpg)
### 3. cpuid ###
cpuid命令的功能就相当于一个专用的CPU信息工具它能通过使用[CPUID功能][2]来显示详细的关于CPU硬件的信息。信息报告包括处理器类型/家族、CPU扩展指令集、缓存/TLB译者注传输后备缓冲器配置、电源管理功能等等。
$ cpuid
![](https://farm9.staticflickr.com/8563/15500753923_6f1b25e8e9_c.jpg)
### 4. dmidecode ###
dmidecode命令直接从BIOS的DMI译者注桌面管理接口数据收集关于系统硬件的具体信息。CPU信息报告包括CPU供应商、版本、CPU标志寄存器、最大/最近的时钟速度、(所允许的)核心总数、L1/L2/L3缓存配置等等。
$ sudo dmidecode
![](https://farm8.staticflickr.com/7503/16094667836_825b61d0e5_b.jpg)
### 5. hardinfo ###
hardinfo是一个基于GUI的系统信息工具它能展示给你一个易于理解的CPU硬件信息的概况也包括你的系统其它的一些硬件组成部分。
$ hardinfo
![](https://farm8.staticflickr.com/7482/15933041268_40ccc17407_b.jpg)
### 6. i7z ###
i7z是一个专供英特尔酷睿i3、i5和i7 CPU的实时CPU报告工具。它能实时显示每个核心的各类信息比如睿频加速状态、CPU频率、CPU电源状态、温度检测等等。i7z运行在基于ncurses的控制台模式或基于QT的GUI的其中之一上。
$ sudo i7z
![](https://farm8.staticflickr.com/7546/15534687744_1968dc2b18_c.jpg)
### 8. likwid-topology ###
[likwid][3] (Like I Knew What I'm Doing) 是一个用来测量、配置并显示硬件相关特性的命令行收集工具。其中的likwid拓扑结构能显示CPU硬件(线程/缓存/NUMA)的拓扑结构信息,还能识别处理器家族(比如Intel Core 2, AMD Shanghai)。
![](https://farm8.staticflickr.com/7511/15934711707_5dc0793599_b.jpg)
### 9. lscpu ###
lscpu命令用一个更加用户友好的格式统计了 /etc/cpuinfo 的内容比如CPU、核心、套接字、NUMA节点的数量线上/线下)。
$ lscpu
![](https://farm8.staticflickr.com/7501/15933173470_69e53b3021_b.jpg)
### 10. lshw ###
**lshw**命令是一个综合性硬件查询工具。不同于其它工具lshw需要root特权才能运行因为它是在BIOS系统里查询DMI译者注桌面管理接口信息。它能报告总核心数和可用核心数但是会遗漏掉一些信息比如L1/L2/L3缓存配置。GTK版本的lshw-gtk也是可用的。
$ sudo lshw -class processor
![](https://farm9.staticflickr.com/8649/15498132484_a47c4e8cb3_c.jpg)
### 11. lstopo ###
lstopo命令 (包括 [hwloc][4] 包) 使由CPU、缓存、内存和I/O设备组成的拓扑结构可见。这个命令用来识别处理器结构和系统的NUMA拓扑结构。
$ lstopo
![](https://farm8.staticflickr.com/7490/15934399829_4012213734_z.jpg)
### 12. numactl ###
其被开发的起初是为了设置NUMA的时序安排和Linux处理器的内存布局策略numactl命令也能通过命令行来展示关于CPU硬件的NUMA拓扑结构信息。
$ numactl --hardware
![](https://farm8.staticflickr.com/7553/16094667876_9d7daa77a1_b.jpg)
### 13. x86info ###
x86info是一个为了展示基于x86架构的CPU信息的命令行工具。信息报告包括CPU型号、线程/核心数、时钟速度、TLB译者注传输后备缓冲器缓存配置、支持的特征标志寄存器等等。
$ x86info --all
![](https://farm8.staticflickr.com/7522/16131238626_d8a703c060_c.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/check-cpu-info-linux.html
译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/how-to-find-number-of-cpu-cores-on.html
[2]:http://en.wikipedia.org/wiki/CPUID
[3]:http://xmodulo.com/identify-cpu-processor-architecture-linux.html
[4]:http://xmodulo.com/identify-cpu-processor-architecture-linux.html

View File

@ -1,113 +0,0 @@
Linux有问必答如何检查Linux的内存使用状况
================================================================================
>**问题**我想要监测Linux系统的内存使用状况。有哪些可用的图形界面或者命令行工具来检查当前内存使用情况
当涉及到Linux系统性能优化的时候物理内存是一个最重要的因素。自然的Linux提供了丰富的选择来监测对于珍贵的内存资源的使用。不同的工具在监测粒度例如全系统范围, 每个进程, 每个用户),接口(例如:图形用户界面, 命令行, ncurses或者运行模式交互模式, 批量处理模式)上都不尽相同。
下面是一个可供选择的但并不全面的图形或命令行工具列表这些工具用来检查并且释放Linux平台中内存。
### 1. /proc/meminfo ###
一种最简单的方法是通过“/proc/meminfo”来检查内存使用状况。这个动态更新的虚拟文件事实上是许多信息资源的集中展示这些资源来自于诸如freetop和ps这些与内存相关的工具。从可用/闲置物理内存数量到等待被写入缓存的数量或者已写回磁盘的数量,只要是你想要的关于内存使用的信息,“/proc/meminfo”应有尽有。特定进程的内存信息也可以通过“/proc/<pid>/statm”和“/proc/<pid>/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 <PID>
![](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

View File

@ -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/

View File

@ -0,0 +1,112 @@
怎样在 Linux 中限制网络带宽
================================================================================
假如你经常在 Linux 桌面上运行多个网络应用,或在家中让多台电脑共享带宽;(这时,)你可能想更好地控制带宽的使用。否则,当你使用下载器下载一个大文件时,交互式 SSH 会话可能会变得缓慢以至不可用;或者当你通过 Dropbox 来同步一个大文件夹时,你的室友可能会抱怨在她的电脑上,视频流变得断断续续。
在本教程中,我将为你描述两种 在 Linux 中限制网络流量速率的不同方法。
### 在 Linux 中限制一个应用的速率 ###
限制网络流量速率的一种方法是通过一个名为[trickle][1]的命令行工具。通过在程序运行时,预先加载一个 速率限制 socket 库 的方法trickle 命令允许你改变任意一个特定程序的流量。 关于 trickle 命令的一个很好的特征是 它仅在用户空间中运行,这意味着,你不必需要 root 权限来达到限制一个程序的带宽使用的目的。为了与 trickle 程序兼容这个特定程序必须使用没有静态链接库的套接字接口。当你想对一个不具有内置带宽控制功能的程序进行速率限制时trickle 可以帮得上忙。
在 UbuntuDebian 及其衍生发行版中安装 trickle
```
$ sudo apt-get install trickle
```
在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2])
```
$ sudo yum install trickle
```
trickle 的基本使用方法如下。仅需简单地把 trickle 命令(带有速率参数)放在你想运行的命令之前。
```
$ trickle -d <download-rate> -u <upload-rate> <command>
```
这就可以将 `<command>` 的下载和上传速率限定为特定值(单位 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 <interface> <download-rate> <upload-rate>
```
举个例子, 将 `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

View File

@ -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 SVNSubversion你需要以下几步。
### 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/

View File

@ -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/

View File

@ -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/

View File

@ -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://<linux-IP-address>: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/

View File

@ -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/) 荣誉推出

View File

@ -0,0 +1,209 @@
Linux 基础在CentOS 7上给一个网卡分配多个IP地址
================================================================================
有时你也许想要给一个网卡多个地址。你该怎么做呢另外买一个网卡来分配地址不用这么做只要在小型网络中。我们现在可以再CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么好的跟随我这并不难。
首先让我们找到网卡的IP地址。在我的CentOS 7服务器中我只使用了一个网卡。
用root特权运行下面的命令
ip addr
示例输出:
1: lo: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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
如上所见我的网卡名是enp0s3ip地址是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: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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/

View File

@ -0,0 +1,37 @@
在Ubuntu 14.04 中修复无法修复回收站[快速提示]
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/empty-the-trash.jpg)
### 问题 ###
**无法在Ubuntu 14.04中清空回收站的问题**。我右键回收站图标并选择清空回收站就像我一直做的那样。我看到进度条显示删除文件中过了一段时间。但是它停止了并且Nautilus文件管理也停止了。我不得不在终端中停止了它。
但是这很痛苦因为文件还在垃圾箱中。并且我反复尝试清空后窗口都冻结了。
### 方案 ###
老实说我不知道什么导致了这个问题。但是我有一个解决方案如果你在Ubuntu 14.04或者14.10遇到这个问题的话。
打开终端并使用下面的命令:
sudo rm -rf ~/.local/share/Trash/*
这里注意你的输入。你使用超级管理员权限来运行删除命令。我相信你不会删除其他文件或者目录。
上面的命令会删除回收站目录下的所有文件。换句话说这是用命令清空垃圾箱。使用玩上面的命令后你会看到垃圾箱已经清空了。如果你删除了所有文件你不应该在看到Nautilus崩溃的问题了。
### 对你有用么? ###
我希望这篇贴士对你有用今后你也不会在Ubuntu或者其他发行版中再遇到相同的问题。如果你遇到任何问题请让我知道。
--------------------------------------------------------------------------------
via: http://itsfoss.com/fix-empty-trash-ubuntu/
作者:[Abhishek][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/