mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
commit
821b969f85
@ -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/) 荣誉推出
|
||||
|
@ -1,18 +1,18 @@
|
||||
VPS上好的控制面板是什么
|
||||
推荐一款不错的 VPS 控制面板:Ajenti
|
||||
================================================================================
|
||||
任何有经验的Linux人员都认为没有一款控制面板可以打败纯命令行界面来管理[虚拟主机][1](VPS)。也有人争论有一款好的面板的一席之地,因为流线型的界面让常规管理操作可以通过点几下鼠标就可以完成。
|
||||
任何有经验的Linux人员都认为没有任何一款控制面板可以打败纯命令行界面来管理[虚拟主机][1](VPS)。也有人争辩说好的控制面板还是应该有一席之地,因为顺滑的操作界面让常规管理操作通过点几下鼠标就可以完成。
|
||||
|
||||
至于控制面板,有共恩那个强大的充满警铃和汽笛的商业控制面板,也有不同免费的但也强大多功能的免费开源面板替代。这之中杰出的代表是[Ajenti][2]控制面板。
|
||||
至于控制面板,有那种强大的充满警铃和汽笛的商业控制面板,也有不同免费的但也强大多功能的免费开源面板替代品。这之中杰出的代表是[Ajenti][2]控制面板。
|
||||
|
||||
Ajenti可以让你很简单地配置不同的通用服务程序,如Apache/nginx、Samba、BIND、Squid、MySQL、cron、防火墙等等,对管理通用VPS实例可以节省大量的时间。对于生产环境,Ajenti同样提供了插件和平台来支持虚拟web主机管理和自定义web UI开发。
|
||||
Ajenti可以让你很简单地配置不同的常规服务程序,如Apache/nginx、Samba、BIND、Squid、MySQL、cron、防火墙等等,对管理常规的 VPS 实例可以节省大量的时间。对于生产环境,Ajenti同样提供了插件和平台来支持虚拟 web 主机管理和自定义 web UI开发。
|
||||
|
||||
Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免费使用的AGPLv3。然而,如果你是一家托管企业或者硬件提供商,那么你需要购买商业授权来使用Ajenti作为商业供应。
|
||||
Ajenti有[双重授权][3];一个是针对个人、企业内部或者教育用途免费使用的AGPLv3。然而,如果你是一家托管企业或者硬件提供商,那么你需要购买商业授权来使用Ajenti作为商业服务。
|
||||
|
||||
### 在Linux上安装Ajenti ###
|
||||
|
||||
为了简化安装,Ajenti为主流Linux发行版提供了自己的仓库。安装Ajenti要做的就是配置目标仓库,并用默认包管理器来安装。
|
||||
|
||||
安装前,一个RSA密钥和证书会生成用于SSL,Ajenti会见在8000端口监听HTTPS的web请求。如果你正在使用防火墙,你需要在防火墙中允许8000端口。为了安全,最好默认禁止8000端口的访问,并添加少数IP地址到白名单中。
|
||||
安装前会生成用于SSL的一个RSA密钥和证书,Ajenti会在8000端口监听HTTPS的web请求。如果你正在使用防火墙,你需要在防火墙中允许8000端口访问。为了安全,最好默认禁止8000端口的公开访问,并添加你的少数IP地址到白名单中。
|
||||
|
||||
#### 在Debian上安装Ajenti ####
|
||||
|
||||
@ -54,7 +54,7 @@ Ajenti有[双重授权][3];一个是个人、企业内部或者教育用途免
|
||||
|
||||
$ sudo service ajenti restart
|
||||
|
||||
直接在浏览器中输入https://<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
|
@ -0,0 +1,164 @@
|
||||
在Linux中使用matplotlib进行科学画图
|
||||
================================================================================
|
||||
|
||||
如果你想要在Linxu中获得一个高效、自动化、高质量的科学画图的解决方案,应该考虑尝试下matplotlib库。Matplotlib是基于python的开源科学测绘包,基于python软件基金会许可证发布。大量的文档和例子、集成了Python和Numpy科学计算包、以及自动化能力,是作为Linux环境中进行科学画图的可靠选择的几个原因。这个教程将提供几个用matplotlib画图的例子。
|
||||
|
||||
###特性###
|
||||
|
||||
- 支持众多的图表类型,如:bar,box,contour,histogram,scatter,line plots....
|
||||
- 基于python的语法
|
||||
- 集成Numpy科学计算包
|
||||
- 数据源可以是 python 的列表、键值对和数组
|
||||
- 可定制的图表格式(坐标轴缩放、标签位置及标签内容等)
|
||||
- 可定制文本(字体,大小,位置...)
|
||||
- 支持TeX格式(等式,符号,希腊字体...)
|
||||
- 与IPython相兼容(允许在 python shell 中与图表交互)
|
||||
- 自动化(使用 Python 循环创建图表)
|
||||
- 用Python 的循环迭代生成图片
|
||||
- 保存所绘图片格式为图片文件,如:png,pdf,ps,eps,svg等
|
||||
|
||||
基于Python语法的matplotlib是其许多特性和高效工作流的基础。世面上有许多用于绘制高质量图的科学绘图包,但是这些包允许你直接在你的Python代码中去使用吗?除此以外,这些包允许你创建可以保存为图片文件的图片吗?Matplotlib允许你完成所有的这些任务。从而你可以节省时间,使用它你能够花更少的时间创建更多的图片。
|
||||
|
||||
###安装###
|
||||
安装Python和Numpy包是使用Matplotlib的前提,安装Numpy的指引请见[该链接][1]。
|
||||
|
||||
|
||||
可以通过如下命令在Debian或Ubuntu中安装Matplotlib:
|
||||
|
||||
$ sudo apt-get install python-matplotlib
|
||||
|
||||
在Fedora或CentOS/RHEL环境则可用如下命令:
|
||||
|
||||
$ sudo yum install python-matplotlib
|
||||
|
||||
|
||||
###Matplotlib 例子###
|
||||
|
||||
本教程会提供几个绘图例子演示如何使用matplotlib:
|
||||
|
||||
- 离散图和线性图
|
||||
- 柱状图
|
||||
- 饼状图
|
||||
|
||||
在这些例子中我们将用Python脚本来执行Mapplotlib命令。注意numpy和matplotlib模块需要通过import命令在脚本中进行导入。
|
||||
|
||||
np为nuupy模块的命名空间引用,plt为matplotlib.pyplot的命名空间引用:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
###例1:离散和线性图###
|
||||
|
||||
第一个脚本,script1.py 完成如下任务:
|
||||
|
||||
- 创建3个数据集(xData,yData1和yData2)
|
||||
- 创建一个宽8英寸、高6英寸的图(赋值1)
|
||||
- 设置图画的标题、x轴标签、y轴标签(字号均为14)
|
||||
- 绘制第一个数据集:yData1为xData数据集的函数,用圆点标识的离散蓝线,标识为"y1 data"
|
||||
- 绘制第二个数据集:yData2为xData数据集的函数,采用红实线,标识为"y2 data"
|
||||
- 把图例放置在图的左上角
|
||||
- 保存图片为PNG格式文件
|
||||
|
||||
script1.py的内容如下:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
xData = np.arange(0, 10, 1)
|
||||
yData1 = xData.__pow__(2.0)
|
||||
yData2 = np.arange(15, 61, 5)
|
||||
plt.figure(num=1, figsize=(8, 6))
|
||||
plt.title('Plot 1', size=14)
|
||||
plt.xlabel('x-axis', size=14)
|
||||
plt.ylabel('y-axis', size=14)
|
||||
plt.plot(xData, yData1, color='b', linestyle='--', marker='o', label='y1 data')
|
||||
plt.plot(xData, yData2, color='r', linestyle='-', label='y2 data')
|
||||
plt.legend(loc='upper left')
|
||||
plt.savefig('images/plot1.png', format='png')
|
||||
|
||||
|
||||
所画之图如下:
|
||||
|
||||
![](https://farm8.staticflickr.com/7529/15927002365_f5ae11cf02_z.jpg)
|
||||
|
||||
|
||||
###例2:柱状图###
|
||||
|
||||
第二个脚本,script2.py 完成如下任务:
|
||||
|
||||
- 创建一个包含1000个随机样本的正态分布数据集。
|
||||
- 创建一个宽8英寸、高6英寸的图(赋值1)
|
||||
- 设置图的标题、x轴标签、y轴标签(字号均为14)
|
||||
- 用samples这个数据集画一个40个柱状,边从-10到10的柱状图
|
||||
- 添加文本,用TeX格式显示希腊字母mu和sigma(字号为16)
|
||||
- 保存图片为PNG格式。
|
||||
|
||||
script2.py代码如下:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
mu = 0.0
|
||||
sigma = 2.0
|
||||
samples = np.random.normal(loc=mu, scale=sigma, size=1000)
|
||||
plt.figure(num=1, figsize=(8, 6))
|
||||
plt.title('Plot 2', size=14)
|
||||
plt.xlabel('value', size=14)
|
||||
plt.ylabel('counts', size=14)
|
||||
plt.hist(samples, bins=40, range=(-10, 10))
|
||||
plt.text(-9, 100, r'$\mu$ = 0.0, $\sigma$ = 2.0', size=16)
|
||||
plt.savefig('images/plot2.png', format='png')
|
||||
|
||||
|
||||
结果见如下链接:
|
||||
|
||||
![](https://farm8.staticflickr.com/7531/15304765024_1cc271b6e0_z.jpg)
|
||||
|
||||
|
||||
###例3:饼状图###
|
||||
|
||||
第三个脚本,script3.py 完成如下任务:
|
||||
|
||||
- 创建一个包含5个整数的列表
|
||||
- 创建一个宽6英寸、高6英寸的图(赋值1)
|
||||
- 添加一个长宽比为1的轴图
|
||||
- 设置图的标题(字号为14)
|
||||
- 用data列表画一个包含标签的饼状图
|
||||
- 保存图为PNG格式
|
||||
|
||||
脚本script3.py的代码如下:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
data = [33, 25, 20, 12, 10]
|
||||
plt.figure(num=1, figsize=(6, 6))
|
||||
plt.axes(aspect=1)
|
||||
plt.title('Plot 3', size=14)
|
||||
plt.pie(data, labels=('Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5'))
|
||||
plt.savefig('images/plot3.png', format='png')
|
||||
|
||||
|
||||
结果如下链接所示:
|
||||
|
||||
![](https://farm8.staticflickr.com/7504/15926356092_7c3e5217aa_z.jpg)
|
||||
|
||||
|
||||
###总结###
|
||||
|
||||
这个教程提供了几个用matplotlib科学画图包进行画图的例子,Matplotlib是在Linux环境中用于解决科学画图的绝佳方案,表现在其无缝地和Python、Numpy连接、自动化能力,和提供多种自定义的高质量的画图产品。matplotlib包的文档和例子详见[这里][2]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/matplotlib-scientific-plotting-linux.html
|
||||
|
||||
作者:[Joshua Reed][a]
|
||||
译者:[ideas4u](https://github.com/ideas4u)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/joshua
|
||||
[1]:http://xmodulo.com/numpy-scientific-computing-linux.html
|
||||
[2]:http://matplotlib.org/
|
@ -1,12 +1,12 @@
|
||||
如何在Linux终端下安排约会和待办事项
|
||||
在Linux终端下使用 calcurse 安排约会和待办事项
|
||||
================================================================================
|
||||
如果你是一个享受linux终端的系统管理员,但同样需要一中方法来安排每天最重要的任务、约会和会议,你会发现[calcurse][1]是一个很有用的工具。calcurse包含了日历、一个待办事项管理、一个调度程序和一个可配置的通知系统,这些都集成进了一个软件中,基于的都是ncurse的接口。同时,它不会限制你在终端中,你可以将你的日历和笔记导出成可以打印的格式。
|
||||
如果你是一个享受linux终端的系统管理员,但同样需要一种方法来安排每天最重要的任务、约会和会议,你会发现[calcurse][1]是一个很有用的工具。calcurse包含了日历、一个待办事项管理、一个调度程序和一个可配置的通知系统,这些都集成进了一个软件中,基于的都是ncurse的接口。同时,它不会限制你在终端中,你可以将你的日历和笔记导出成可以打印的格式。
|
||||
|
||||
本片文章我们会探索如何在Linux上安装calcurse,并且教你如何利用它的特性。
|
||||
本篇文章我们会探索如何在Linux上安装calcurse,并且教你如何利用它的特性。
|
||||
|
||||
### 在Linux上安装Culcurse ###
|
||||
|
||||
calcurse在大多数Linux发行版的标准仓库都有。万一在你的发行版上没有(比如CentOS/RHEL),一旦你安装了gcc和ncurse开发文件后就可以很简单地从源码安装。
|
||||
calcurse在大多数Linux发行版的标准仓库都有。万一在你的发行版上没有(比如CentOS/RHEL),只要你安装了gcc和ncurse开发文件后就可以很简单地从源码安装。
|
||||
|
||||
Debian、Ubuntu或者Linux Mint
|
||||
|
||||
@ -32,22 +32,22 @@ CentOS/RHEL
|
||||
|
||||
$ calcurse
|
||||
|
||||
你将会看到下面的空白界面。如果配色不吸引你,你可以以后改变它们。
|
||||
你将会看到下面的空白界面。如果这配色不吸引你,你可以以后换一个。
|
||||
|
||||
![](https://farm8.staticflickr.com/7567/15410270544_0af50a4eb6_c.jpg)
|
||||
|
||||
我们现在可以按下回车-‘q’- 再次按下回车- ‘y’来退出主界面。这个序列会告诉地不的菜单退出、保存当前的笔记并确认退出。
|
||||
我们现在可以按下回车-‘q’- 再次按下回车- ‘y’来退出主界面。这个按键序列激活界面底部的主菜单,并告诉它保存当前的笔记并确认退出。
|
||||
|
||||
When we run calcurse for the first time, the following directory structure is created in our home directory:
|
||||
我们第一次运行 calcurse 时,会在主目录创建如下子目录:
|
||||
|
||||
![](https://farm8.staticflickr.com/7482/15845194188_2ba15035e7_o.png)
|
||||
|
||||
这里是每一项的简要描述:
|
||||
这里是每一个子目录的简要描述:
|
||||
|
||||
- **apts** 文件包含了用户所有的约会和事项,todo文件包含了所有的**todo** 列表。
|
||||
- **apts**文件包含了用户所有的约会和事项,todo文件包含了所有的**待办事项** 列表。
|
||||
- **conf**文件,如你所想的那样,包含当前用户的独立设置。
|
||||
- **keys**文件包含了用户定义的按键绑定(比如:q或者Q推出,x或者X导出内容等等)。
|
||||
- 在**notes**子目录你会看到包含了笔记描述的文件,你可以附到任何一个安排事项中。
|
||||
- **keys**文件包含了用户定义的按键绑定(比如:q或者Q退出,x或者X导出内容等等)。
|
||||
- 在**notes**子目录你会看到包含了笔记描述的文件,这些笔记你可以附到任何一个安排事项中。
|
||||
|
||||
### 改变配色 ###
|
||||
|
||||
@ -55,13 +55,13 @@ When we run calcurse for the first time, the following directory structure is cr
|
||||
|
||||
![](https://farm9.staticflickr.com/8595/16006755476_5289384f81_z.jpg)
|
||||
|
||||
使用最后一幅图的按键绑定来选色前景色和背景色配置来更好地适应你的需求:
|
||||
使用最后一幅图的按键绑定来选择前景色和背景色配置,以更好地适应你的需求:
|
||||
|
||||
![](https://farm8.staticflickr.com/7499/15845274420_70bb95c221_b.jpg)
|
||||
|
||||
### A添加约会和待办任务 ###
|
||||
### 添加约会和待办任务 ###
|
||||
|
||||
在前面的选项卡中浏览命令菜单时,我们看到按下‘o’可以从一个菜单到下一个菜单。我们可以把第二个菜单作为**安排编辑菜单**。
|
||||
在前面的选项卡中浏览命令菜单时,我们看到按下‘o’可以从一个菜单跳到下一个菜单。我们可以把第二个菜单作为**安排编辑菜单**。
|
||||
|
||||
![](https://farm9.staticflickr.com/8634/16031851732_b947951f76_c.jpg)
|
||||
|
||||
@ -87,7 +87,7 @@ When we run calcurse for the first time, the following directory structure is cr
|
||||
|
||||
### 为事项设置通知 ###
|
||||
|
||||
你可以在通知菜单下配置通知。按照相同的步骤来以防改变了配色,但是选择**Notify**而不是**Colour**:
|
||||
你可以在通知菜单下配置通知。按照相同的步骤来改变配色方案,但是选择**Notify**而不是**Colour**:
|
||||
|
||||
![](https://farm8.staticflickr.com/7569/15412900863_eaf2767e19_z.jpg)
|
||||
|
||||
@ -103,7 +103,7 @@ When we run calcurse for the first time, the following directory structure is cr
|
||||
|
||||
### 总结 ###
|
||||
|
||||
本篇教程中我们展示了如何设置一个多样化的调度器和提醒器来帮助你组织每日的活动和提前安排重要的事项。你或许还要calcurse的[PDF 手册][2],还请随意在下面的评论中提出你的疑问。欢迎你的评论,我也很高兴看到这些。
|
||||
本篇教程中我们展示了如何设置一个多样化的调度器和提醒器来帮助你组织每日的活动和提前安排重要的事项。你或许还要看看calcurse的[PDF 手册][2],请随意在下面的评论中提出你的疑问。欢迎你的评论,我也很高兴看到这些。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -111,7 +111,7 @@ via: http://xmodulo.com/schedule-appointments-todo-tasks-linux-terminal.html
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,6 +1,6 @@
|
||||
CentOS 7中安装Websvn
|
||||
在 CentOS 7中安装Websvn
|
||||
================================================================================
|
||||
**WebSVN**为你的Subversion提供了一个试图,它设计用来反映Subversion的一整套方法。你可以检查任何文件或目录的日志,以及查看任何指定修改库中修改、添加或删除过的文件列表。你也可以检查同一文件两个版本的不同之处,以便确切地查看某个特性修订版中的修改。
|
||||
**WebSVN**为你的Subversion提供了一个视图,其设计用来对应Subversion的各种功能。你可以检查任何文件或目录的日志,以及查看任何指定版本中所修改、添加或删除过的文件列表。你也可以检查同一文件两个版本的不同之处,以便确切地查看某个特定的修订版本的变化。
|
||||
|
||||
### 特性 ###
|
||||
|
||||
@ -8,31 +8,25 @@ WebSVN提供了以下这些特性:
|
||||
|
||||
- 易于使用的界面;
|
||||
- 可自定义的模板系统;
|
||||
- 文件列表的着色;
|
||||
- 彩色文件列表;
|
||||
- 过错视图;
|
||||
- 日志信息搜索;
|
||||
- 支持RSS订阅;
|
||||
|
||||
### 安装 ###
|
||||
|
||||
我使用以下链接来将Subversion安装到CentOS 7。
|
||||
我按以下链接来将Subversion安装到CentOS 7。
|
||||
|
||||
- [CentOS 7上如何安装Subversion][1]
|
||||
|
||||
**1 – 下载websvn到/var/www/html。**
|
||||
|
||||
cd /var/www/html
|
||||
|
||||
----------
|
||||
|
||||
wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip
|
||||
|
||||
**2 – 解压zip包。**
|
||||
|
||||
unzip websvn-2.3.3.zip
|
||||
|
||||
----------
|
||||
|
||||
mv websvn-2.3.3 websvn
|
||||
|
||||
**3 – 安装php到你的系统。**
|
||||
@ -42,13 +36,7 @@ WebSVN提供了以下这些特性:
|
||||
**4 – 编辑web svn配置。**
|
||||
|
||||
cd /var/www/html/websvn/include
|
||||
|
||||
----------
|
||||
|
||||
cp distconfig.php config.php
|
||||
|
||||
----------
|
||||
|
||||
vi config.php
|
||||
|
||||
----------
|
||||
@ -96,7 +84,7 @@ via: http://www.unixmen.com/install-websvn-centos-7/
|
||||
|
||||
作者:[M.el Khamlichi][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -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
|
@ -1,6 +1,6 @@
|
||||
如何在Linux中安装Go语言
|
||||
================================================================================
|
||||
Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几个设计原则:简单、安全、速度。Go语言发行版拥有各种调试、测试、调优和代码审查工具。如今Go语言和它的工具链在大多数Linux发行版的基础仓库都有了,用默认的包管理器就可以安装。
|
||||
Go (也叫 "golang")是一款由Google最初开发的编程语言。它的诞生有几个设计原则:简单、安全、速度。Go语言发行版拥有各种调试、测试、调优和代码审查工具。如今Go语言和它的工具链在大多数Linux发行版的基础仓库都可用,用默认的包管理器就可以安装。
|
||||
|
||||
### 在Ubuntu、Debian 或者 Linux Mint上安装Go语言 ###
|
||||
|
||||
@ -16,7 +16,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几
|
||||
|
||||
go version go1.2.1 linux/amd64
|
||||
|
||||
按照你的需要,你或许想要使用apt-get安装额外的Go工具。
|
||||
根据你的需要,你或许想要使用apt-get安装额外的Go工具。
|
||||
|
||||
$ sudo apt-cache search golang
|
||||
|
||||
@ -36,7 +36,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几
|
||||
|
||||
go version go1.3.3 linux/amd64
|
||||
|
||||
按照你的需要,你或许想要使用yum安装额外的Go工具。
|
||||
根据你的需要,你或许想要使用yum安装额外的Go工具。
|
||||
|
||||
$ yum search golang
|
||||
|
||||
@ -44,7 +44,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几
|
||||
|
||||
### 从官网安装Go语言 ###
|
||||
|
||||
有时发行版中的版本并不是最新的。为防这样,你可以从官网安装最新的Go语言。下面是步骤。
|
||||
有时发行版中的go语言版本并不是最新的。为了避免这种情况,你可以从官网安装最新的Go语言。下面是步骤。
|
||||
|
||||
进入Go语言的[官方源码][1],并下载预编译二进制代码。
|
||||
|
||||
@ -68,7 +68,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几
|
||||
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
|
||||
如果你在/usr/local之外安装了了Go,你同样需要设置GOROOT环境变量来指向自定义的安装位置。
|
||||
如果你在/usr/local之外的自定义位置中安装了Go,你同样需要设置GOROOT环境变量来指向自定义的安装位置。
|
||||
|
||||
$ sudo vi /etc/profile
|
||||
|
||||
@ -89,7 +89,7 @@ Go (也叫 "golang")是一款由Google开发的编程语言。它的诞生有几
|
||||
via: http://ask.xmodulo.com/install-go-language-linux.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,45 @@
|
||||
BQ and Canonical Officially Launch Aquaris E4.5 Ubuntu Edition, the First Ubuntu Phone
|
||||
------
|
||||
*Everything you need to know about Aquaris E4.5*
|
||||
|
||||
##BQ and Canonical have officially announced the new Aquaris E4.5 Ubuntu Edition and the fact that the phone will be available in the coming weeks through a series of flash sales.
|
||||
|
||||
Information about the imminent launch of BQ Ubuntu phone has been around for some time and now it the two companies seem to have decided to make it official. This is the first device powered by Ubuntu Touch and a lot of people will be paying very close attention to what is happening in the mobile world.
|
||||
|
||||
Ubuntu Touch is the latest operating system from Canonical and it's a brand new experience that aims to be very different from what users can find right now on the market, and that includes systems like Jola or Firefox OS. The OS has been in the works for more than two years and it's a system designed to work on all kind of devices, across the hardware spectrum.
|
||||
|
||||
##Who is BQ and why has Canonical chosen them?
|
||||
|
||||
When Mark Shuttleworth announced the two partners for the launch of Ubuntu Touch, BQ and Meizu, most of the people watching asked the same question. Who? BQ is not a very big company, but it's a young company and it has already started to penetrate the European market with some interesting devices. In many ways, they are doing the same thing companies like Meizu or Xiaomi are trying and succeeded in China: to offer devices that are interesting and different from what everyone else is doing.
|
||||
|
||||
Many Ubuntu fans have questioned Canonical’s decision of choosing small companies and not big ones, but they are trying to do the same thing as the just-mentioned hardware makers. They want to offer an operating system radically different from what everyone else is doing. It's easy to understand why the goals of Canonical and BQ are actually one and the same.
|
||||
|
||||
##What is Ubuntu Touch?
|
||||
|
||||
The new operating system developed by Canonical embraces the fact that people are now swiping a lot more than they are tapping. Smartphones are no longer something new and everyone can understand how to swipe and get things done on a phone. Ubuntu devs have taken this to a whole new level. The operating system has no buttons, with the exception of the regular power and volume buttons. Everything is done with swiped gestures, from all sides of the screen.
|
||||
|
||||
Also, Ubuntu Touch brings a new concept to the market, that of scopes. There is no longer a home screen, just scopes defined by the user to expand the experience. For example, you can have a Music scope that aggregates all your music sources on a single screen. It's a different way of looking at your smartphone, but this is built for people who crave a new experience. Don't worry, regular apps still exist, but they are differently integrated.
|
||||
|
||||
![Aquaris E4.5 Ubuntu Edition start screen](http://i1-news.softpedia-static.com/images/news2/BQ-and-Canonical-Officially-Launch-Aquaris-E4-5-Ubuntu-Edition-472397-5.jpg)
|
||||
|
||||
"As any kind of content can be presented via Scopes - they provide developers an easy path for their creations to be integral to the device experience. It is simple to create new Scopes via an easy to use UI toolkit with much lower development and maintenance costs than traditional apps. Canonical and BQ have worked with a host of partners to ensure that there is a wealth of interesting, relevant and dynamic content available at launch, with more content partners to follow," said Cristian Parrino, VP Mobile at Canonical.
|
||||
|
||||
##BQ’s Aquaris E4.5 Ubuntu Edition hardware specs
|
||||
|
||||
First of all, it's important to know that Aquaris E4.5 Ubuntu Edition is a dual-sim phone and it comes unlocked so that everyone can use it with their network. It boasts a MediaTek Quad-Core Cortex A7 processor running at up to 1.3 GHz, a 4.5-inch screen, 1GB RAM, rear camera with high-quality BSI sensors, Largan lens, and autofocus with dual flash(8MP), and front camera with 5MP.
|
||||
|
||||
It's also worth mentioning that several operators in Europe, including 3 Sweden, amena.com, giffgaff, and Portugal Telecom have decided to provide SIM bundles at purchase. The price is €169.90 ($191).
|
||||
|
||||
So, are you ready to buy the Aquaris E4.5 Ubuntu Edition?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://news.softpedia.com/news/BQ-and-Canonical-Officially-Launch-Aquaris-E4-5-Ubuntu-Edition-472397.shtml
|
||||
|
||||
作者:[Silviu Stahie][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://news.softpedia.com/editors/browse/silviu-stahie
|
32
sources/news/20150209 CrunchBang Linux Is Dead.md
Normal file
32
sources/news/20150209 CrunchBang Linux Is Dead.md
Normal 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 doesn’t hold the same value.
|
||||
|
||||
> For anyone who has been involved with Linux for the past ten years or so, I’m sure they’ll agree that things have moved on. Whilst some things have stayed exactly the same, others have changed beyond all recognition. It’s 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. I’m 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 don’t 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/
|
@ -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.
|
||||
|
@ -1,60 +0,0 @@
|
||||
Meet Vivaldi — A New Web Browser Built for Power Users
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/Screen-Shot-2015-01-27-at-17.36.jpg)
|
||||
|
||||
**A brand new web browser has arrived this week that aims to meet the needs of power users — and it’s already available for Linux.**
|
||||
|
||||
Vivaldi is the name of this new browser and it has been launched as a tech preview (read: a beta without the responsibility) for 64-bit Linux machines, Windows and Mac. It is built — shock — on the tried-and-tested open-source frameworks of Chromium, Blink and Google’s open-source V8 JavaScript engine (among other projects).
|
||||
|
||||
Does the world really want another browser? Vivaldi, the brain child of former Opera Software CEO Jon von Tetzchner, is less concerned about want and more about need.
|
||||
|
||||
Vivaldi is being built with the sort of features that keyboard preferring tab addicts need. It is not being pitched at users who find Firefox perplexing or whose sole criticism of Chrome is that it moved the bookmarks button.
|
||||
|
||||
That’s not tacky marketing spiel either. Despite the ‘technical preview’ badge it comes with, Vivaldi is already packed with features that demonstrate its power user slant.
|
||||
|
||||
Plenty of folks feel left behind and underserved by the simplified, paired back offerings other software companies are producing. Vivaldi, even at this early juncture, looks well placed to succeed in winning them over.
|
||||
|
||||
### Vivaldi Features ###
|
||||
|
||||
A few of Vivaldi’s key features already present include:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/quick.jpg)
|
||||
|
||||
**Quick Commands** (Ctrl + Q) is an in-app HUD that lets you quickly filter through settings, options and features, be it opening a bookmark or hiding the status bar, using your keyboard. No clicks needed.
|
||||
|
||||
**Tab Stacks** let you clean up your workspace by grouping separate tabs into one, and then using a keyboard command or the tab preview picker to switch between them.
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/tab-stacks.jpg)
|
||||
|
||||
A collapsible **side panel** that houses extra features (just like old Opera) including a (not yet working) mail client, contacts, bookmarks browser and note taking section that lets you take and annotate screenshots.
|
||||
|
||||
A bunch of other features are on offer too, including customizable keyboard shortcuts, a tabs bar that can be set on any edge of the browser (or hidden entirely), privacy options and a speed dial with folders.
|
||||
|
||||
### Opera Mark II ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/vivaldi-settings-in-ubuntu-750x434.jpg)
|
||||
|
||||
It’s not a leap to see Vivaldi as the true successor to Opera post-Presto (Opera’s old, proprietary rendering engine). Opera (which also pushed out a minor new update today) has split out many of its “power user” features as it chases a lighter, more manageable set of features.
|
||||
|
||||
Vivaldi wants to pick up the baggage Opera has been so keen to offload. And while that might not help it grab marketshare it will see it grab the attention of power users, many of whom will no doubt already be using Linux.
|
||||
|
||||
### Download ###
|
||||
|
||||
Interested in taking it for a spin? You can. Vivaldi is available to download for Windows, Mac and 64-bit Linux distributions. On the latter you have a choice of Debian or RPM installer.
|
||||
|
||||
Bear in mind that it’s not finished and that more features (including extensions, sync and more) are planned for future builds.
|
||||
|
||||
- [Download Vivaldi Tech Preview for Linux][1]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/01/vivaldi-web-browser-linux-download-power-users
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://vivaldi.com/#Download
|
24
sources/share/20150209 Non-Linux FOSS--Homebrew.md
Normal file
24
sources/share/20150209 Non-Linux FOSS--Homebrew.md
Normal 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/
|
@ -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
|
@ -1,3 +1,4 @@
|
||||
translating by KayGuoWhu
|
||||
Why does C++ promote an int to a float when a float cannot represent all int values?
|
||||
---------
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,147 +0,0 @@
|
||||
[bazz2222222]
|
||||
How to Configure Chroot Environment in Ubuntu 14.04
|
||||
================================================================================
|
||||
There are many instances when you may wish to isolate certain applications, user, or environments within a Linux system. Different operating systems have different methods of achieving isolation, and in Linux, a classic way is through a `chroot` environment.
|
||||
|
||||
In this guide, we'll show you step wise on how to setup an isolated environment using chroot in order to create a barrier between your regular operating system and a contained environment. This is mainly useful for testing purposes. We will teach you the steps on an **Ubuntu 14.04** VPS instance.
|
||||
|
||||
Most system administrators will benefit from knowing how to accomplish a quick and easy chroot environment and it is a valuable skill to have.
|
||||
|
||||
### The chroot environment ###
|
||||
|
||||
A chroot environment is an operating system call that will change the root location temporarily to a new folder. Typically, the operating system's conception of the root directory is the actual root located at "/". However, with `chroot`, you can specify another directory to serve as the top-level directory for the duration of a chroot.
|
||||
|
||||
Any applications that are run from within the `chroot` will be unable to see the rest of the operating system in principle.
|
||||
|
||||
#### Advantages of Chroot Environment ####
|
||||
|
||||
> - Test applications without the risk of compromising the entire host system.
|
||||
>
|
||||
> - From the security point of view, whatever happens in the chroot environment won't affect the host system (not even under root user).
|
||||
>
|
||||
> - A different operating system running in the same hardware.
|
||||
|
||||
For instance, it allows you to build, install, and test software in an environment that is separated from your normal operating system. It could also be used as a method of **running 32-bit applications in a 64-bit environment**.
|
||||
|
||||
But while chroot environments will certainly make additional work for an unprivileged user, they should be considered a hardening feature instead of a security feature, meaning that they attempt to reduce the number of attack vectors instead of creating a full solution. If you need full isolation, consider a more complete solution, such as Linux containers, Docker, vservers, etc.
|
||||
|
||||
### Debootstrap and Schroot ###
|
||||
|
||||
The necessary packages to setup the chroot environment are **debootstrap** and **schroot**, which are available in the ubuntu repository. The schroot command is used to setup the chroot environment.
|
||||
|
||||
**Debootstrap** allows you to install a new fresh copy of any Debian (or debian-based) system from a repository in a directory with all the basic commands and binaries needed to run a basic instance of the operating system.
|
||||
|
||||
The **schroot** allows access to chroots for normal users using the same mechanism, but with permissions checking and allowing additional automated setup of the chroot environment, such as mounting additional filesystems and other configuration tasks.
|
||||
|
||||
These are the steps to implement this functionality in Ubuntu 14.04 LTS:
|
||||
|
||||
### 1. Installing the Packages ###
|
||||
|
||||
Firstly, We're gonna install debootstrap and schroot in our host Ubuntu 14.04 LTS.
|
||||
|
||||
$ sudo apt-get install debootstrap
|
||||
$ sudo apt-get install schroot
|
||||
|
||||
### 2. Configuring Schroot ###
|
||||
|
||||
Now that we have the appropriate tools, we just need to specify a directory that we want to use as our chroot environment. We will create a directory called linoxide in our root directory to setup chroot there:
|
||||
|
||||
sudo mkdir /linoxide
|
||||
|
||||
We have to configure schroot to suit our needs in the configuration file .we will modify the schroot configuration file with the information we require to get configured.
|
||||
|
||||
sudo nano /etc/schroot/schroot.conf
|
||||
|
||||
We are on an Ubuntu 14.04 LTS (Trusty Tahr) system currently, but let's say that we want to test out some packages available on Ubuntu 13.10, code named "Saucy Salamander". We can do that by creating an entry that looks like this:
|
||||
|
||||
[saucy]
|
||||
description=Ubuntu Saucy
|
||||
location=/linoxide
|
||||
priority=3
|
||||
users=arun
|
||||
root-groups=root
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/12/schroot-config.png)
|
||||
|
||||
Modify the values of the configuration parameters in the above example to fit your system:
|
||||
|
||||
### 3. Installing 32 bit Ubuntu with debootstrap ###
|
||||
|
||||
Debootstrap downloads and installs a minimal operating system inside your **chroot environment**. You can install any debian-based distro of your choice, as long as you have a repository available.
|
||||
|
||||
Above, we placed the chroot environment under the directory **/linoxide** and this is the root directory of the chroot environment. So we'll need to run debootstrap inside that directory which we have already created:
|
||||
|
||||
cd /linoxide
|
||||
sudo debootstrap --variant=buildd --arch amd64 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/
|
||||
sudo chroot /linoxide /debootstrap/debootstrap --second-stage
|
||||
|
||||
You can replace amd64 in --arch as i386 or other bit OS you wanna setup available in the repository. You can replace the mirror http://archive.ubuntu.com/ubuntu/ above as the one closest, you can get the closest one from the official [Ubuntu Mirror Page][1].
|
||||
|
||||
**Note: You will need to add --foreign above 3rd line command if you choose to setup i386 bit OS choot in your 64 bit Host Ubuntu as:**
|
||||
|
||||
sudo debootstrap --variant=buildd --foreign --arch i386 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/
|
||||
|
||||
It takes some time (depending on your bandwidth) to download, install and configure the complete system. It takes about 500 MBs for a minimal installation.
|
||||
|
||||
### 4. Finallizing the chroot environment ###
|
||||
|
||||
After the system is installed, we'll need to do some final configurations to make sure the system functions correctly. First, we'll want to make sure our host `fstab` is aware of some pseudo-systems in our guest.
|
||||
|
||||
sudo nano /etc/fstab
|
||||
|
||||
Add the below lines like these to the bottom of your fstab:
|
||||
|
||||
proc /linoxide/proc proc defaults 0 0
|
||||
sysfs /linoxide/sys sysfs defaults 0 0
|
||||
|
||||
Save and close the file.
|
||||
|
||||
Now, we're going to need to mount these filesystems within our guest:
|
||||
|
||||
$ sudo mount proc /linoxide/proc -t proc
|
||||
$sudo mount sysfs /linoxide/sys -t sysfs
|
||||
|
||||
We'll also want to copy our /etc/hosts file so that we will have access to the correct network information:
|
||||
|
||||
$ sudo cp /etc/hosts /linoxide/etc/hosts
|
||||
|
||||
Finally, You can list the available chroot environments using the schroot command.
|
||||
|
||||
$ schroot -l
|
||||
|
||||
We can enter the chroot environment through a command like this:
|
||||
|
||||
$ sudo chroot /linoxide/ /bin/bash
|
||||
|
||||
You can test the chroot environment by checking the version of distributions installed.
|
||||
|
||||
# lsb_release -a
|
||||
# uname -a
|
||||
|
||||
To finish this tutorial, in order to run a graphic application from the chroot, you have to export the DISPLAY environment variable.
|
||||
|
||||
$ DISPLAY=:0.0 ./apps
|
||||
|
||||
Here, we have successfully installed Chrooted Ubuntu 13.10(Saucy Salamander) in your host Ubuntu 14.04 LTS (Trusty Tahr).
|
||||
|
||||
You can exit chroot environment successfully by running the commands below:
|
||||
|
||||
# exit
|
||||
|
||||
Afterwards, we need to unmount our proc and sys filesystems:
|
||||
|
||||
$ sudo umount /test/proc
|
||||
$ sudo umount /test/sys
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/configure-chroot-environment-ubuntu-14-04/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://launchpad.net/ubuntu/+archivemirrors
|
@ -1,112 +0,0 @@
|
||||
Improve system performance by moving your log files to RAM Using Ramlog
|
||||
================================================================================
|
||||
Ramlog act as a system daemon. On startup it creates ramdisk, it copies files from /var/log into ramdisk and mounts ramdisk as /var/log. All logs after that will be updated on ramdisk. Logs on harddrive are kept in folder /var/log.hdd which is updated when ramlog is restarted or stopped. On shutdown it saves log files back to harddisk so logs are consistent. Ramlog 2.x is using tmpfs by default, ramfs and kernel ramdisk are suppored as well. Program rsync is used for log synchronization.
|
||||
|
||||
Note: Logs not saved to harddrive are lost in case of power outage or kernel panic.
|
||||
|
||||
Install ramlog if you have enough of free memory and you want to keep your logs on ramdisk. It is good for notebook users, for systems with UPS or for systems running from flash -- to save some write cycles.
|
||||
|
||||
How it works and what it does:
|
||||
|
||||
1.Ramlog starts among the first daemons (it depends on other daemons you have installed).
|
||||
|
||||
2.Directory /var/log.hdd is created and hardlinked to /var/log.
|
||||
|
||||
3.In case tmpfs (default) or ramfs is used, it is mounted over /var/log
|
||||
|
||||
If kernel ramdisk is used, ramdisk created in /dev/ram9 and it is mounted to /var/log, by default ramlog takes all ramdisk memory specified by kernel argument "ramdisk_size".
|
||||
|
||||
5.All other daemons are started and all logs are updated in ramdisk. Logrotate works on ramdisk as well.
|
||||
|
||||
6.In case ramlog is restarted (by default it is one time per day), directory /var/log.hdd is synchronized with /var/log using rsync. Frequency of the automatic log saves can be controller via cron, by default, the ramlog file is placed into /etc/cron.daily
|
||||
|
||||
7.On shutdown ramlog shuts among the last daemons.
|
||||
|
||||
8. During ramlog stop phase files from /var/log.hdd are synchronized with /var/log
|
||||
Then /var/log is unmounted, /var/log.hdd is unmounted as well and empty directory /var/log.hdd is deleted.
|
||||
|
||||
**Note:- This article is for advanced users only**
|
||||
|
||||
### Install Ramlog in Ubuntu ###
|
||||
|
||||
First you need to download the .deb package from [here][1] using the following command
|
||||
|
||||
wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
|
||||
|
||||
Now you should be having ramlog_2.0.0_all.deb package install this package using the following command
|
||||
|
||||
sudo dpkg -i ramlog_2.0.0_all.deb
|
||||
|
||||
This will complete the installation now you need to run the following commands
|
||||
|
||||
sudo update-rc.d ramlog start 2 2 3 4 5 . stop 99 0 1 6 .
|
||||
|
||||
#Now update sysklogd in init levels, so it is stopped properly before ramlog is stopped:
|
||||
|
||||
sudo update-rc.d -f sysklogd remove
|
||||
|
||||
sudo update-rc.d sysklogd start 10 2 3 4 5 . stop 90 0 1 6 .
|
||||
|
||||
Now you need to restart your system
|
||||
|
||||
sudo reboot
|
||||
|
||||
After rebooting you need to run ‘ramlog getlogsize' to determine the size of your actual /var/log.Add about 40% to that number to ensure your ramdisk has sufficient size -- this will be the ramdisk size
|
||||
|
||||
Edit your boot manager config file such as /etc/grub.conf, /boot/grub/menu.lst or /etc/lilo.conf and add update the actual kernel by adding kernel paramter ‘ramdisk_size=xxx' where xxx is calculated ramdisk size
|
||||
|
||||
### Configuring Ramlog ###
|
||||
|
||||
Ramlog configuration file is located in /etc/default/ramlog on deb based systems and you can set there below variables:
|
||||
|
||||
Variable (with default value):
|
||||
|
||||
Description:
|
||||
|
||||
RAMDISKTYPE=0
|
||||
# Values:
|
||||
# 0 -- tmpfs (can be swapped) -- default
|
||||
# 1 -- ramfs (no max size in older kernels,
|
||||
# cannot be swapped, not SELinux friendly)
|
||||
# 2 -- old kernel ramdisk
|
||||
TMPFS_RAMFS_SIZE=
|
||||
#Maximum size of memory to be used by tmpfs or ramfs.
|
||||
# The value can be percentage of total RAM or size in megabytes -- for example:
|
||||
# TMPFS_RAMFS_SIZE=40%
|
||||
# TMPFS_RAMFS_SIZE=100m
|
||||
# Empty value means default tmpfs/ramfs size which is 50% of total RAM.
|
||||
# For more options please check ‘man mount', section ‘Mount options for tmpfs'
|
||||
# (btw -- ramfs supports size limit in newer kernels
|
||||
# as well despite man says there are no mount options)
|
||||
# It has only effect if RAMDISKTYPE=0 or 1
|
||||
KERNEL_RAMDISK_SIZE=MAX
|
||||
#Kernel ramdisk size in kilobytes or MAX to use entire ramdisk.
|
||||
#It has only effect if RAMDISKTYPE=2
|
||||
LOGGING=1
|
||||
# 0=off, 1=on Logs can be found in /var/log/ramdisk
|
||||
LOGNAME=ramlog
|
||||
# name of the ramlog log file (makes sense if LOGGING=1)
|
||||
VERBOSE=1
|
||||
# 0=off, 1=on (if 1, teststartstop puts detials
|
||||
# to the logs and it is called after start or stop fails)
|
||||
|
||||
### How to uninstall Ubuntu ###
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo dpkg -P ramlog
|
||||
|
||||
Note: If ramlog was running before you uninstalled it, you should reboot your box to finish uninstallation procedure.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/improve-system-performance-by-moving-your-log-files-to-ram-using-ramlog.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
|
@ -1,82 +0,0 @@
|
||||
Translating by mtunique
|
||||
Moving to Docker
|
||||
================================================================================
|
||||
![](http://cocoahunter.com/content/images/2015/01/docker1.jpeg)
|
||||
|
||||
[TL;DR] This is the first post in a series of 3 on how my company moved its infrastructure from PaaS to Docker based deployment. If you want, you can skip the intro (this post) and head directly to the technical topics (links at the bottom of the page).
|
||||
|
||||
----------
|
||||
|
||||
In the last month I've been strggling with devops. This is my very personal story and experience in trying to streamline a deployment process of a Raila app with Docker.
|
||||
|
||||
When I started my company – [Touchware][1] – in 2012 I was a lone developer. Things were small, uncomplicated, they didn't require a lot of maintenance, nor they needed to scale all that much. During the course of last year though, we grew quite a lot (we are now a team of 10 people) and our server-side applications and API grew both in terms of scope and scale.
|
||||
|
||||
### Step 1 - Heroku ###
|
||||
|
||||
We still are a very small team and we need to make things going and run as smoothly as possible. When we looked for possible solutions, we decided to stick with something that would have removed from our shoulders the burden of managing hardware. Since we develop mainly Rails based applications and Heroku has a great support for RoR and various kind of DBs and cached (Postgres / Mongo / Redis etc.), the smartest choice seemed to be going with [Heroku][2]. And that's what we did.
|
||||
|
||||
Heroku has a great support and great documentation and deploying apps is just so snappy! Only problem is, when you start growing, you need to have piles of cash around to pay the bills. Not the best deal, really.
|
||||
|
||||
### Step 2 - Dokku ###
|
||||
|
||||
In a rush to try and cut the costs, we decided to try with Dokku. [Dokku][3], quoting the Github repo is a
|
||||
|
||||
> Docker powered mini-Heroku in around 100 lines of Bash
|
||||
|
||||
We launched some instances on [DigitalOcean][4] with Dokku pre-installed and we gave it spin. Dokku is very much like Heroku, but when you have complex applications for whom you need to twear params, or where you need certain dependencies, it's just not gonna work out. We had an app where we needed to apply multiple transformations on images and we couldn't find a way to install the correct version of imagemagick into the dokku-based Docker container that was hosting our Rails app. We still have a couple of very simple apps that are running on Dokku, but we had to move some of them back to Heroku.
|
||||
|
||||
### Step 3 - Docker ###
|
||||
|
||||
A couple of months ago, since the problem of devops and managing production apps was resurfacing, I decided to try out [Docker][5]. Docker, in simple terms, allows developers to containerize applications and to ease the deployment. Since a Docker container basically has all the dependencies it needs to run your app, if everything runs fine on your laptop, you can be sure it'll also run like a champ in production on a remote server, be it an AWS E2C instance or a VPS on DigitalOcean.
|
||||
|
||||
Docker IMHO is particularly interesting for the following reasons:
|
||||
|
||||
- it promotes modularization and separation of concerns: you need to start thinking about your apps in terms of logical components (load balancer: 1 container, DB: 1 container, webapp: 1 container etc.);
|
||||
- it's very flexible in terms of deployment options: containers can be deployed to a wide variety of HW and can be easily redeployed to different servers / providers;
|
||||
- it allows for a very fine grained tuning of your app environment: you build the images your containers runs from, so you have plenty of options for configuring your environment exactly as you would like to.
|
||||
|
||||
There are howerver some downsides:
|
||||
|
||||
- the learning curve is quite steep (this is probably a very personal problem, but I'm talking as a software dev and not as a skilled operations professional);
|
||||
- setup is not simple, especially if you want to have a private registry / repository (more about this later).
|
||||
|
||||
Following are some tips I put together during the course of the last week with the findings of someone that is new to the game.
|
||||
|
||||
----------
|
||||
|
||||
In the following articles we'll see how to setup a semi-automated Docker based deployment system.
|
||||
|
||||
- [Setting up a private Docker registry][6]
|
||||
- [Configuring a Rails app for semi-automated deployment][7]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://cocoahunter.com/2015/01/23/docker-1/
|
||||
|
||||
作者:[Michelangelo Chasseur][a]
|
||||
译者:[mtunique](https://github.com/mtunique)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://cocoahunter.com/author/michelangelo/
|
||||
[1]:http://www.touchwa.re/
|
||||
[2]:http://cocoahunter.com/2015/01/23/docker-1/www.heroku.com
|
||||
[3]:https://github.com/progrium/dokku
|
||||
[4]:http://cocoahunter.com/2015/01/23/docker-1/www.digitalocean.com
|
||||
[5]:http://www.docker.com/
|
||||
[6]:http://cocoahunter.com/2015/01/23/docker-2/
|
||||
[7]:http://cocoahunter.com/2015/01/23/docker-3/
|
||||
[8]:
|
||||
[9]:
|
||||
[10]:
|
||||
[11]:
|
||||
[12]:
|
||||
[13]:
|
||||
[14]:
|
||||
[15]:
|
||||
[16]:
|
||||
[17]:
|
||||
[18]:
|
||||
[19]:
|
||||
[20]:
|
@ -1,186 +0,0 @@
|
||||
How to create and show a presentation from the command line on Linux
|
||||
================================================================================
|
||||
When you prepare a talk for audience, the first thing that will probably come to your mind is shiny presentation charts filled with fancy diagrams, graphics and animation effects. Fine. No one can deny the power of visually charming presentation. However, not all presentations need to be Ted talk quality. Often times, the purpose of a presentation is to convey specific information, which can easily be done with textual messages. In such cases, your time can be better spent on gathering information and checking facts, rather than searching for good-looking graphics from Google Image.
|
||||
|
||||
In the world of Linux, you can do presentation in several different ways, e.g., Impress for multimedia-rich content, [Impress.js][1] for stunning visualization, Beamer for hardcore LaTex users, and so on. If you are looking for a simple means to create and show a textual presentation, look no further. [mdp][2] can get the job done for you.
|
||||
|
||||
### What is Mdp? ###
|
||||
|
||||
mdp is an ncurses-based command-line presentation tool for Linux. What I like about mdp is its [markdown][3] support, which makes it easy to create slides with familiar markdown format. Naturally, it becomes painless to publish the slides in HTML format as well. Another plus is its support for UTF-8 character encoding, which comes in handy when showing non-English characters (e.g., Greek or Cyrillic alphabets).
|
||||
|
||||
### Install Mdp on Linux ###
|
||||
|
||||
Installation of mdp is mostly painless due to its light dependency requirement (i.e., ncursesw).
|
||||
|
||||
#### Debian, Ubuntu or their derivatives ####
|
||||
|
||||
$ sudo apt-get install git gcc make libncursesw5-dev
|
||||
$ git clone https://github.com/visit1985/mdp.git
|
||||
$ cd mdp
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
#### Fedora or CentOS/RHEL ####
|
||||
|
||||
$ sudo yum install git gcc make ncurses-devel
|
||||
$ git clone https://github.com/visit1985/mdp.git
|
||||
$ cd mdp
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
#### Arch Linux ####
|
||||
|
||||
On Arch Linux, you can easily install mdp from [AUR][4].
|
||||
|
||||
### Create a Presentation from the Command Line ###
|
||||
|
||||
Once you installed mdp, you can easily create a presentation by using your favorite text editor. If you are familiar with markdown, it will take no time to master mdp. For those of you who are not familiar with markdown, starting with an example is the best way to learn mdp.
|
||||
|
||||
Here is a 6-page sample presentation for your reference.
|
||||
|
||||
%title: Sample Presentation made with mdp (Xmodulo.com)
|
||||
%author: Dan Nanni
|
||||
%date: 2015-01-28
|
||||
|
||||
-> This is a slide title <-
|
||||
=========
|
||||
|
||||
-> mdp is a command-line based presentation tool with markdown support. <-
|
||||
|
||||
*_Features_*
|
||||
|
||||
* Multi-level headers
|
||||
* Code block formatting
|
||||
* Nested quotes
|
||||
* Nested list
|
||||
* Text highlight and underline
|
||||
* Citation
|
||||
* UTF-8 special characters
|
||||
|
||||
-------------------------------------------------
|
||||
|
||||
-> # Example of nested list <-
|
||||
|
||||
This is an example of multi-level headers and a nested list.
|
||||
|
||||
# first-level title
|
||||
|
||||
second-level
|
||||
------------
|
||||
|
||||
- *item 1*
|
||||
- sub-item 1
|
||||
- sub-sub-item 1
|
||||
- sub-sub-item 2
|
||||
- sub-sub-item 3
|
||||
- sub-item 2
|
||||
|
||||
-------------------------------------------------
|
||||
|
||||
-> # Example of code block formatting <-
|
||||
|
||||
This example shows how to format a code snippet.
|
||||
|
||||
1 /* Hello World program */
|
||||
2
|
||||
3 #include <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?
|
||||
???????????
|
||||
|
||||
### Show a Presentation from the Command Line ###
|
||||
|
||||
Once you save the above code as slide.md text file, you can show the presentation by simply running:
|
||||
|
||||
$ mdp slide.md
|
||||
|
||||
You can navigate the presentation by pressing Enter/Space/Page-Down/Down-Arrow (next slide), Backspace/Page-Up/Up-Arrow (previous slide), Home (first slide), End (last slide), or numeric-N (N-th slide).
|
||||
|
||||
The title of the presentation appears on top of each slide, and your name and page number are shown at the bottom.
|
||||
|
||||
![](https://farm9.staticflickr.com/8637/16392457702_ec732d0094_c.jpg)
|
||||
|
||||
This is an example of a nested list and multi-level headers.
|
||||
|
||||
![](https://farm9.staticflickr.com/8567/16367397606_29be7df633_c.jpg)
|
||||
|
||||
This is an example of a code snippet and inline code.
|
||||
|
||||
![](https://farm9.staticflickr.com/8682/15770926144_0f982b0863_b.jpg)
|
||||
|
||||
This is an example of nested quotes.
|
||||
|
||||
![](https://farm9.staticflickr.com/8587/16393383115_0865c8b89b_c.jpg)
|
||||
|
||||
This is an example of placing citations.
|
||||
|
||||
![](https://farm8.staticflickr.com/7409/16392457712_ed36c14bc2_c.jpg)
|
||||
|
||||
This is an example of UTF-8 special characters.
|
||||
|
||||
![](https://farm9.staticflickr.com/8648/16205981560_7fa3debc75_c.jpg)
|
||||
|
||||
### Summary ###
|
||||
|
||||
In this tutorial, I showed you how to use mdp to create and show a presentation from the command line. Its markdown compatibility saves us the trouble and hassle of having to learn any new formatting, which is an advantage compared to [tpp][5], another command-line presentation tool. Due to its limitations, mdp may not qualify as your default presentation tool, but there should be definitely a use case for that. What do you think of mdp? Do you prefer something else?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/presentation-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://bartaz.github.io/impress.js/
|
||||
[2]:https://github.com/visit1985/mdp
|
||||
[3]:http://daringfireball.net/projects/markdown/
|
||||
[4]:https://aur.archlinux.org/packages/mdp-git/
|
||||
[5]:http://www.ngolde.de/tpp.html
|
@ -1,52 +0,0 @@
|
||||
> Vic
|
||||
|
||||
Linux FAQs with Answers--How to fix “Your profile could not be opened correctly” on Google Chrome
|
||||
================================================================================
|
||||
> **Question**: When I open Google Chrome web browser on my Linux box, I have several pop-up messages saying "Your profile could not be opened correctly." This error happens every time I open Google Chrome. How can I solve this error?
|
||||
|
||||
When you see an error message saying "Your profile could not be opened correctly" on your Google Chrome web browser," that is because somehow your profile data on Google Chrome got corrupted. This can happen while you upgrade your Google Chrome browser manually on Linux.
|
||||
|
||||
![](https://farm8.staticflickr.com/7428/16238502737_27bdda6685_o.png)
|
||||
|
||||
Depending on exactly which file got corrupted, you can try one of these methods.
|
||||
|
||||
### Method One ###
|
||||
|
||||
Close all your Chrome browser windows/tabs.
|
||||
|
||||
Go to ~/.config/google-chrome/Default, and remove/rename "Web Data" file as below.
|
||||
|
||||
$ cd ~/.config/google-chrome/Default
|
||||
$ rm "Web Data"
|
||||
|
||||
Re-open Google Chrome browser.
|
||||
|
||||
### Method Two ###
|
||||
|
||||
Close all your Chrome browser windows/tabs.
|
||||
|
||||
Go to ~/.config/google-chrome/"Profile 1", and rename "History" file as below.
|
||||
|
||||
$ cd ~/.config/google-chrome/"Profile 1"
|
||||
$ mv History History.bak
|
||||
|
||||
Re-open Google Chrome browser.
|
||||
|
||||
### Method Three ###
|
||||
|
||||
If the problem still persists, you can remove the Default profile folder (~/.config/google-chrome/Default) altogether. Note that by doing so, you will lose all previously opened Google tabs, imported bookmarks, browsing history, sign-in data, etc.
|
||||
|
||||
Before removing it, first close all your Chrome browser windows/tabs.
|
||||
|
||||
$ rm -rf ~/.config/google-chrome/Default
|
||||
|
||||
After restarting Google Chrome, the folder ~/.config/google-chrome/Default will automatically be re-generated.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/your-profile-could-not-be-opened-correctly-google-chrome.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -1,3 +1,4 @@
|
||||
Vic
|
||||
25 Linux Shell Scripting interview Questions & Answers
|
||||
================================================================================
|
||||
### Q:1 What is Shell Script and why it is required ? ###
|
||||
@ -374,4 +375,4 @@ via: http://www.linuxtechi.com/linux-shell-scripting-interview-questions-answers
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxtechi.com/author/pradeep/
|
||||
[a]:http://www.linuxtechi.com/author/pradeep/
|
||||
|
@ -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/
|
@ -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
|
@ -0,0 +1,149 @@
|
||||
Install OpenQRM Cloud Computing Platform In Debian
|
||||
================================================================================
|
||||
### Introduction ###
|
||||
|
||||
**openQRM** is a web-based open source Cloud computing and datacenter management platform that integrates flexibly with existing components in enterprise data centers.
|
||||
|
||||
It supports the following virtualization technologies:
|
||||
|
||||
- KVM,
|
||||
- XEN,
|
||||
- Citrix XenServer,
|
||||
- VMWare ESX,
|
||||
- LXC,
|
||||
- OpenVZ.
|
||||
|
||||
The Hybrid Cloud Connector in openQRM supports a range of private or public cloud providers to extend your infrastructure on demand via **Amazon AWS**, **Eucalyptus** or **OpenStack**. It, also, automates provisioning, virtualization, storage and configuration management, and it takes care of high-availability. A self-service cloud portal with integrated billing system enables end-users to request new servers and application stacks on-demand.
|
||||
|
||||
openQRM is available in two different flavours such as:
|
||||
|
||||
- Enterprise Edition
|
||||
- Community Edition
|
||||
|
||||
You can view the difference between both editions [here][1].
|
||||
|
||||
### Features ###
|
||||
|
||||
- Private/Hybrid Cloud Computing Platform;
|
||||
- Manages physical and virtualized server systems;
|
||||
- Integrates with all major open and commercial storage technologies;
|
||||
- Cross-platform: Linux, Windows, OpenSolaris, and *BSD;
|
||||
- Supports KVM, XEN, Citrix XenServer, VMWare ESX(i), lxc, OpenVZ and VirtualBox;
|
||||
- Support for Hybrid Cloud setups using additional Amazon AWS, Eucalyptus, Ubuntu UEC cloud resources;
|
||||
- Supports P2V, P2P, V2P, V2V Migrations and High-Availability;
|
||||
- Integrates with the best Open Source management tools – like puppet, nagios/Icinga or collectd;
|
||||
- Over 50 plugins for extended features and integration with your infrastructure;
|
||||
- Self-Service Portal for end-users;
|
||||
- Integrated billing system.
|
||||
|
||||
### Installation ###
|
||||
|
||||
Here, we will install openQRM in Ubuntu 14.04 LTS. Your server must atleast meet the following requirements.
|
||||
|
||||
- 1 GB RAM;
|
||||
- 100 GB Hdd;
|
||||
- Optional: Virtualization enabled (VT for Intel CPUs or AMD-V for AMD CPUs) in Bios.
|
||||
|
||||
First, install make package to compile openQRM source package.
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get install make
|
||||
|
||||
Then, run the following commands one by one to install openQRM.
|
||||
|
||||
Download the latest available version [from here][2].
|
||||
|
||||
wget http://sourceforge.net/projects/openqrm/files/openQRM-Community-5.1/openqrm-community-5.1.tgz
|
||||
|
||||
tar -xvzf openqrm-community-5.1.tgz
|
||||
|
||||
cd openqrm-community-5.1/src/
|
||||
|
||||
sudo make
|
||||
|
||||
sudo make install
|
||||
|
||||
sudo make start
|
||||
|
||||
During installation, you’ll be asked to update the php.ini file.
|
||||
|
||||
![~-openqrm-community-5.1-src_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_001.png)
|
||||
|
||||
Enter mysql root user password.
|
||||
|
||||
![~-openqrm-community-5.1-src_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_002.png)
|
||||
|
||||
Re-enter password:
|
||||
|
||||
![~-openqrm-community-5.1-src_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_003.png)
|
||||
|
||||
Select the mail server configuration type.
|
||||
|
||||
![~-openqrm-community-5.1-src_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_004.png)
|
||||
|
||||
If you’re not sure, select Local only. In our case, I go with **Local only** option.
|
||||
|
||||
![~-openqrm-community-5.1-src_005](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_005.png)
|
||||
|
||||
Enter your system mail name, and finally enter the Nagios administration password.
|
||||
|
||||
![~-openqrm-community-5.1-src_007](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_007.png)
|
||||
|
||||
The above commands will take long time depending upon your Internet connection to download all packages required to run openQRM. Be patient.
|
||||
|
||||
Finally, you’ll get the openQRM configuration URL along with username and password.
|
||||
|
||||
![~_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@debian-_002.png)
|
||||
|
||||
### Configuration ###
|
||||
|
||||
After installing openQRM, open up your web browser and navigate to the URL: **http://ip-address/openqrm**.
|
||||
|
||||
For example, in my case http://192.168.1.100/openqrm.
|
||||
|
||||
The default username and password is: **openqrm/openqrm**.
|
||||
|
||||
![Mozilla Firefox_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/Mozilla-Firefox_003.png)
|
||||
|
||||
Select a network card to use for the openQRM management network.
|
||||
|
||||
![openQRM Server - Mozilla Firefox_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_004.png)
|
||||
|
||||
Select a database type. In our case, I selected mysql.
|
||||
|
||||
![openQRM Server - Mozilla Firefox_006](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_006.png)
|
||||
|
||||
Now, configure the database connection and initialize openQRM. Here, I use **openQRM** as database name, and user as **root** and debian as password for the database. Be mindful that you should enter the mysql root user password that you have created while installing openQRM.
|
||||
|
||||
![openQRM Server - Mozilla Firefox_012](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_012.png)
|
||||
|
||||
Congratulations!! openQRM has been installed and configured.
|
||||
|
||||
![openQRM Server - Mozilla Firefox_013](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png)
|
||||
|
||||
### Update openQRM ###
|
||||
|
||||
To update openQRM at any time run the following command:
|
||||
|
||||
cd openqrm/src/
|
||||
make update
|
||||
|
||||
What we have done so far is just installed and configured openQRM in our Ubuntu server. For creating, running Virtual Machines, managing Storage, integrating additional systems and running your own private Cloud, I suggest you to read the [openQRM Administrator Guide][3].
|
||||
|
||||
That’s all now. Cheers! Happy weekend!!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.unixmen.com/install-openqrm-cloud-computing-platform-debian/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.unixmen.com/author/sk/
|
||||
[1]:http://www.openqrm-enterprise.com/products/edition-comparison.html
|
||||
[2]:http://sourceforge.net/projects/openqrm/files/?source=navbar
|
||||
[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf
|
@ -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/) 荣誉推出
|
469
sources/tech/20150211 25 Tips for Intermediate Git Users.md
Normal file
469
sources/tech/20150211 25 Tips for Intermediate Git Users.md
Normal file
@ -0,0 +1,469 @@
|
||||
25 Tips for Intermediate Git Users
|
||||
================================================================================
|
||||
I’ve been using git for about 18 months now and thought I knew it pretty well. Then we had [Scott Chacon][1] from GitHub over to do some training at [LVS, a supplier/developer of betting/gaming software][2] (where contracted until 2013) and I learnt a ton in the first day.
|
||||
|
||||
As someone who’s always felt fairly comfortable in Git, I thought sharing some of the nuggets I learnt with the community might help someone to find an answer without needing to do lots of research.
|
||||
|
||||
### Basic Tips ###
|
||||
|
||||
#### 1. First Steps After Install ####
|
||||
|
||||
After installing Git, the first thing you should do is configure your name and email, as every commit will have these details:
|
||||
|
||||
$ git config --global user.name "Some One"
|
||||
$ git config --global user.email "someone@gmail.com"
|
||||
|
||||
#### 2. Git is Pointer-Based ####
|
||||
|
||||
Everything stored in git is in a file. When you create a commit it creates a file containing your commit message and associated data (name, email, date/time, previous commit, etc) and links it to a tree file. The tree file contains a list of objects or other trees. The object or blob is the actual content associated with the commit (a file, if you will, although the filename isn’t stored in the object, but in the tree). All of these files are stored with a filename of a SHA-1 hash of the object.
|
||||
|
||||
From there branches and tags are simply files containing (basically) a SHA-1 hash which points to the commit. Using these references allows for a lot of flexibility and speed, as creating a new branch is as simple as creating a file with the name of the branch and the SHA-1 reference to the commit you’re branching from. Of course, you’d never do that as you’d use the Git command line tools (or a GUI), but it’s that simple.
|
||||
|
||||
You may have heard references to the HEAD. This is simply a file containing the SHA-1 reference of the commit you’re currently pointing to. If you’re resolving a merge conflict and see HEAD, that’s nothing to do with a particular branch or necessarily a particular point on the branch but where you currently are.
|
||||
|
||||
All the branch pointers are kept in .git/refs/heads, HEAD is in .git/HEAD and tags are in .git/refs/tags – feel free to have a look in there.
|
||||
|
||||
#### 3. Two Parents – of course! ####
|
||||
|
||||
When viewing a merge commit message in a log, you will see two parents (as opposed to the normal one for a work-based commit). The first parent is the branch you were on and the second is the one you merged in to it.
|
||||
|
||||
#### 4. Merge Conflicts ####
|
||||
|
||||
By now I’m sure you have had a merge conflict and had to resolve it. This is normally done by editing the file, removing the <<<<, ====, >>>> markers and the keeping the code you want to store. Sometimes it’s nice to see the code before either change, i.e. before you made the change in both branches that now conflicts. This is one command away:
|
||||
|
||||
$ git diff --merge
|
||||
diff --cc dummy.rb
|
||||
index 5175dde,0c65895..4a00477
|
||||
--- a/dummy.rb
|
||||
+++ b/dummy.rb
|
||||
@@@ -1,5 -1,5 +1,5 @@@
|
||||
class MyFoo
|
||||
def say
|
||||
- puts "Bonjour"
|
||||
- puts "Hello world"
|
||||
++ puts "Annyong Haseyo"
|
||||
end
|
||||
end
|
||||
|
||||
If the file is binary, diffing files isn’t so easy… What you’ll normally want to do is to try each version of the binary file and decide which one to use (or manually copy portions over in the binary file’s editor). To pull a copy of the file from a particular branch (say you’re merging master and feature132):
|
||||
|
||||
$ git checkout master flash/foo.fla # or...
|
||||
$ git checkout feature132 flash/foo.fla
|
||||
$ # Then...
|
||||
$ git add flash/foo.fla
|
||||
|
||||
Another way is to cat the file from git – you can do this to another filename then copy the correct file over (when you’ve decided which it is) to the normal filename:
|
||||
|
||||
$ git show master:flash/foo.fla > master-foo.fla
|
||||
$ git show feature132:flash/foo.fla > feature132-foo.fla
|
||||
$ # Check out master-foo.fla and feature132-foo.fla
|
||||
$ # Let's say we decide that feature132's is correct
|
||||
$ rm flash/foo.fla
|
||||
$ mv feature132-foo.fla flash/foo.fla
|
||||
$ rm master-foo.fla
|
||||
$ git add flash/foo.fla
|
||||
|
||||
UPDATE: Thanks to Carl in the comments on the original blog post for the reminder, you can actually use “git checkout —ours flash/foo.fla” and “git checkout —theirs flash/foo.fla” to checkout a particular version without remembering which branches you merge in. Personally I prefer to be more explicit, but the option is there…
|
||||
|
||||
Remember to add the file after resolving the merge conflict (as I do above).
|
||||
|
||||
### Servers, Branching and Tagging ###
|
||||
|
||||
#### 5. Remote Servers ####
|
||||
|
||||
One of the most powerful features of Git is the ability to have more than one remote server (as well as the fact that you’re running a local repository always). You don’t always need write access either, you may have multiple servers you read from (to merge work in) and then write to another. To add a new remote server is simple:
|
||||
|
||||
$ git remote add john git@github.com:johnsomeone/someproject.git
|
||||
|
||||
If you want to see information about your remote servers you can do:
|
||||
|
||||
# shows URLs of each remote server
|
||||
$ git remote -v
|
||||
|
||||
# gives more details about each
|
||||
$ git remote show name
|
||||
|
||||
You can always see the differences between a local branch and a remote branch:
|
||||
|
||||
$ git diff master..john/master
|
||||
|
||||
You can also see the changes on HEAD that aren’t on that remote branch:
|
||||
|
||||
$ git log remote/branch..
|
||||
# Note: no final refspec after ..
|
||||
|
||||
#### 6. Tagging ####
|
||||
|
||||
In Git there are two types of tag – a lightweight tag and an annotated tag. Bearing in mind Tip 2 about Git being pointer based, the difference between the two is simple. A lightweight tag is simply a named pointer to a commit. You can always change it to point to another commit. An annotated tag is a name pointer to a tag object, with it’s own message and history. As it has it’s own message it can be GPG signed if required.
|
||||
|
||||
Creating the two types of tag is easy (and one command line switch different)
|
||||
|
||||
$ git tag to-be-tested
|
||||
$ git tag -a v1.1.0 # Prompts for a tag message
|
||||
|
||||
#### 7. Creating Branches ####
|
||||
|
||||
Creating branches in git is very easy (and lightning quick due to it only needing to create a less than 100 byte file). The longhand way of creating a new branch and switching to it:
|
||||
|
||||
$ git branch feature132
|
||||
$ git checkout feature132
|
||||
|
||||
Of course, if you know you’re going to want to switch to it straight away you can do it in one command:
|
||||
|
||||
$ git checkout -b feature132
|
||||
|
||||
If you want to rename a local branch it’s as easy as (the long way to show what happens):
|
||||
|
||||
$ git checkout -b twitter-experiment feature132
|
||||
$ git branch -d feature132
|
||||
|
||||
Update: Or you can (as Brian Palmer points out in the comments on the original blog post) just use the -m switch to “git branch” to do it in one step (as Mike points out, if you only specify one branch it renames your current branch):
|
||||
|
||||
$ git branch -m twitter-experiment
|
||||
$ git branch -m feature132 twitter-experiment
|
||||
|
||||
#### 8. Merging Branches ####
|
||||
|
||||
At some point in the future, you’re going to want to merge your changes back in. There are two ways to do this:
|
||||
|
||||
$ git checkout master
|
||||
$ git merge feature83 # Or...
|
||||
$ git rebase feature83
|
||||
|
||||
The difference between merge and rebase is that merge tries to resolve the changes and create a new commit that blends them. Rebase tries to take your changes since you last diverged from the other branch and replay them from the HEAD of the other branch. However, don’t rebase after you’ve pushed a branch to a remote server – this can cause confusion/problems.
|
||||
|
||||
If you aren’t sure which branches still have unique work on them – so you know which you need to merge and which ones can be removed, there are two switches to git branch that help:
|
||||
|
||||
# Shows branches that are all merged in to your current branch
|
||||
$ git branch --merged
|
||||
|
||||
# Shows branches that are not merged in to your current branch
|
||||
$ git branch --no-merged
|
||||
|
||||
#### 9. Remote Branches ####
|
||||
|
||||
If you have a local branch that you’d like to appear on a remote server, you can push it up with one command:
|
||||
|
||||
$ git push origin twitter-experiment:refs/heads/twitter-experiment
|
||||
# Where origin is our server name and twitter-experiment is the branch
|
||||
|
||||
Update: Thanks to Erlend in the comments on the original blog post – this is actually the same as doing `git push origin twitter-experiment` but by using the full syntax you can see that you can actually use different names on both ends (so your local can be `add-ssl-support` while your remote name can be `issue-1723`).
|
||||
|
||||
If you want to delete a branch from the server (note the colon before the branch name):
|
||||
|
||||
$ git push origin :twitter-experiment
|
||||
|
||||
If you want to show the state of all remote branches you can view them like this:
|
||||
|
||||
$ git remote show origin
|
||||
|
||||
This may list some branches that used to exist on the server but now don’t exist. If this is the case you can easily remove them from your local checkout using:
|
||||
|
||||
$ git remote prune
|
||||
|
||||
Finally, if you have a remote branch that you want to track locally, the longhand way is:
|
||||
|
||||
$ git branch --track myfeature origin/myfeature
|
||||
$ git checkout myfeature
|
||||
|
||||
However, newer versions of Git automatically set up tracking if you use the -b flag to checkout:
|
||||
|
||||
$ git checkout -b myfeature origin/myfeature
|
||||
|
||||
### Storing Content in Stashes, Index and File System ###
|
||||
|
||||
#### 10. Stashing ####
|
||||
|
||||
In Git you can drop your current work state in to a temporary storage area stack and then re-apply it later. The simple case is as follows:
|
||||
|
||||
$ git stash
|
||||
# Do something...
|
||||
$ git stash pop
|
||||
|
||||
A lot of people recommend using `git stash apply` instead of pop, however if you do this you end up with a long list of stashes left hanging around. “pop” will only remove it from the stack if it applies cleanly. If you’ve used `git stash apply` you can remove the last item from the stack anyway using:
|
||||
|
||||
$ git stash drop
|
||||
|
||||
Git will automatically create a comment based on the current commit message. If you’d prefer to use a custom message (as it may have nothing to do with the previous commit):
|
||||
|
||||
$ git stash save "My stash message"
|
||||
|
||||
If you want to apply a particular stash from your list (not necessarily the last one) you can list them and apply it like this:
|
||||
|
||||
$ git stash list
|
||||
stash@{0}: On master: Changed to German
|
||||
stash@{1}: On master: Language is now Italian
|
||||
$ git stash apply stash@{1}
|
||||
|
||||
#### 11. Adding Interactively ####
|
||||
|
||||
In the subversion world you change files and then just commit everything that has changed. In Git you have a LOT more power to commit just certain files or even certain patches. To commit certain files or parts of files you need to go in to interactive mode.
|
||||
|
||||
$ git add -i
|
||||
staged unstaged path
|
||||
|
||||
|
||||
*** Commands ***
|
||||
1: status 2: update 3: revert 4: add untracked
|
||||
5: patch 6: diff 7: quit 8: help
|
||||
What now>
|
||||
|
||||
This drops you in to a menu based interactive prompt. You can use the numbers of the commands or the highlighted letters (if you have colour highlighting turned on) to go in to that mode. Then it’s normally a matter of typing the numbers of the files you want to apply that action to (you can use formats like 1 or 1-4 or 2,4,7).
|
||||
|
||||
If you want to go to patch mode (‘p’ or ‘5’ from interactive mode) you can also go straight in to that mode:
|
||||
|
||||
$ git add -p
|
||||
diff --git a/dummy.rb b/dummy.rb
|
||||
index 4a00477..f856fb0 100644
|
||||
--- a/dummy.rb
|
||||
+++ b/dummy.rb
|
||||
@@ -1,5 +1,5 @@
|
||||
class MyFoo
|
||||
def say
|
||||
- puts "Annyong Haseyo"
|
||||
+ puts "Guten Tag"
|
||||
end
|
||||
end
|
||||
Stage this hunk [y,n,q,a,d,/,e,?]?
|
||||
|
||||
As you can see you then get a set of options at the bottom for choosing to add this changed part of the file, all changes from this file, etc. Using the ‘?’ command will explain the options.
|
||||
|
||||
#### 12. Storing/Retrieving from the File System ####
|
||||
|
||||
Some projects (the Git project itself for example) store additional files directly in the Git file system without them necessarily being a checked in file.
|
||||
|
||||
Let’s start off by storing a random file in Git:
|
||||
|
||||
$ echo "Foo" | git hash-object -w --stdin
|
||||
51fc03a9bb365fae74fd2bf66517b30bf48020cb
|
||||
|
||||
At this point the object is in the database, but if you don’t set something up to point to that object it will be garbage collected. The easiest way is to tag it:
|
||||
|
||||
$ git tag myfile 51fc03a9bb365fae74fd2bf66517b30bf48020cb
|
||||
|
||||
Note that here we’ve used the tag myfile. When we need to retrieve the file we can do it with:
|
||||
|
||||
$ git cat-file blob myfile
|
||||
|
||||
This can be useful for utility files that developers may need (passwords, gpg keys, etc) but you don’t want to actually check out on to disk every time (particularly in production).
|
||||
|
||||
### Logging and What Changed? ###
|
||||
|
||||
#### 13. Viewing a Log ####
|
||||
|
||||
You can’t use Git for long without using ‘git log’ to view your recent commits. However, there are some tips on how to use it better. For example, you can view a patch of what changed in each commit with:
|
||||
|
||||
$ git log -p
|
||||
|
||||
Or you can just view a summary of which files changed with:
|
||||
|
||||
$ git log --stat
|
||||
|
||||
There’s a nice alias you can set up which shows abbreviated commits and a nice graph of branches with the messages on a single line (like gitk, but on the command line):
|
||||
|
||||
$ git config --global alias.lol "log --pretty=oneline --abbrev-commit --graph --decorate"
|
||||
$ git lol
|
||||
* 4d2409a (master) Oops, meant that to be in Korean
|
||||
* 169b845 Hello world
|
||||
|
||||
#### 14. Searching in the Log ####
|
||||
|
||||
If you want to search for a particular author you can specify that:
|
||||
|
||||
$ git log --author=Andy
|
||||
|
||||
Update: Thanks to Johannes in the comments, I’ve cleared up some of the confusion here.
|
||||
|
||||
Or if you have a search term that appears in the commit message:
|
||||
|
||||
$ git log --grep="Something in the message"
|
||||
|
||||
There’s also a more powerful command called the pickaxe command that look for the entry that removes or adds a particular piece of content (i.e. when it first appeared or was removed). This can tell you when a line was added (but not if a character on that line was later changed):
|
||||
|
||||
$ git log -S "TODO: Check for admin status"
|
||||
|
||||
What about if you changed a particular file, e.g. `lib/foo.rb`
|
||||
|
||||
$ git log lib/foo.rb
|
||||
|
||||
Let’s say you have a `feature/132` branch and a `feature/145` and you want to view the commits on those branches that aren’t on master (note the ^ meaning not):
|
||||
|
||||
$ git log feature/132 feature/145 ^master
|
||||
|
||||
You can also narrow it down to a date range using ActiveSupport style dates:
|
||||
|
||||
$ git log --since=2.months.ago --until=1.day.ago
|
||||
|
||||
By default it will use OR to combine the query, but you can easily change it to use AND (if you have more than one criteria)
|
||||
|
||||
$ git log --since=2.months.ago --until=1.day.ago --author=andy -S "something" --all-match
|
||||
|
||||
#### 15. Selecting Revisions to View/Change ####
|
||||
|
||||
There are a number of items you can specify when referring to a revision, depending on what you know about it:
|
||||
|
||||
$ git show 12a86bc38 # By revision
|
||||
$ git show v1.0.1 # By tag
|
||||
$ git show feature132 # By branch name
|
||||
$ git show 12a86bc38^ # Parent of a commit
|
||||
$ git show 12a86bc38~2 # Grandparent of a commit
|
||||
$ git show feature132@{yesterday} # Time relative
|
||||
$ git show feature132@{2.hours.ago} # Time relative
|
||||
|
||||
Note that unlike the previous section, a caret on the end means the parent of that commit – a caret at the start means not on this branch.
|
||||
|
||||
#### 16. Selecting a Range ####
|
||||
|
||||
The easiest way is to use:
|
||||
|
||||
$ git log origin/master..new
|
||||
# [old]..[new] - everything you haven't pushed yet
|
||||
|
||||
You can also omit the [new] and it will use your current HEAD.
|
||||
|
||||
### Rewinding Time & Fixing Mistakes ###
|
||||
|
||||
#### 17. Resetting changes ####
|
||||
|
||||
You can easily unstage a change if you haven’t committed it using:
|
||||
|
||||
$ git reset HEAD lib/foo.rb
|
||||
|
||||
Often this is aliased to ‘unstage’ as it’s a bit non-obvious.
|
||||
|
||||
$ git config --global alias.unstage "reset HEAD"
|
||||
$ git unstage lib/foo.rb
|
||||
|
||||
If you’ve committed the file already, you can do two things – if it’s the last commit you can just amend it:
|
||||
|
||||
$ git commit --amend
|
||||
|
||||
This undoes the last commit, puts your working copy back as it was with the changes staged and the commit message ready to edit/commit next time you commit.
|
||||
|
||||
If you’ve committed more than once and just want to completely undo them, you can reset the branch back to a previous point in time.
|
||||
|
||||
$ git checkout feature132
|
||||
$ git reset --hard HEAD~2
|
||||
|
||||
If you actually want to bring a branch to point to a completely different SHA1 (maybe you’re bringing the HEAD of a branch to another branch, or a further commit) you can do the following to do it the long way:
|
||||
|
||||
$ git checkout FOO
|
||||
$ git reset --hard SHA
|
||||
|
||||
There’s actually a quicker way (as it doesn’t change your working copy back to the state of FOO first then forward to SHA):
|
||||
|
||||
$ git update-ref refs/heads/FOO SHA
|
||||
|
||||
#### 18. Committing to the Wrong Branch ####
|
||||
|
||||
OK, let’s assume you committed to master but should have created a topic branch called experimental instead. To move those changes over, you can create a branch at your current point, rewind head and then checkout your new branch:
|
||||
|
||||
$ git branch experimental # Creates a pointer to the current master state
|
||||
$ git reset --hard master~3 # Moves the master branch pointer back to 3 revisions ago
|
||||
$ git checkout experimental
|
||||
|
||||
This can be more complex if you’ve made the changes on a branch of a branch of a branch etc. Then what you need to do is rebase the change on a branch on to somewhere else:
|
||||
|
||||
$ git branch newtopic STARTPOINT
|
||||
$ git rebase oldtopic --onto newtopic
|
||||
|
||||
#### 19. Interactive Rebasing ####
|
||||
|
||||
This is a cool feature I’ve seen demoed before but never actually understood, now it’s easy. Let’s say you’ve made 3 commits but you want to re-order them or edit them (or combine them):
|
||||
|
||||
$ git rebase -i master~3
|
||||
|
||||
Then you get your editor pop open with some instructions. All you have to do is amend the instructions to pick/squash/edit (or remove them) commits and save/exit. Then after editing you can `git rebase —continue` to keep stepping through each of your instructions.
|
||||
|
||||
If you choose to edit one, it will leave you in the state you were in at the time you committed that, so you need to use git commit —amend to edit it.
|
||||
|
||||
**Note: DO NOT COMMIT DURING REBASE – only add then use —continue, —skip or —abort.**
|
||||
|
||||
#### 20. Cleaning Up ####
|
||||
|
||||
If you’ve committed some content to your branch (maybe you’ve imported an old repo from SVN) and you want to remove all occurrences of a file from the history:
|
||||
|
||||
$ git filter-branch --tree-filter 'rm -f *.class' HEAD
|
||||
|
||||
If you’ve already pushed to origin, but have committed the rubbish since then, you can also do this for your local system before pushing:
|
||||
|
||||
$ git filter-branch --tree-filter 'rm -f *.class' origin/master..HEAD
|
||||
|
||||
### Miscellaneous Tips ###
|
||||
|
||||
#### 21. Previous References You’ve Viewed ####
|
||||
|
||||
If you know you’ve previously viewed a SHA-1, but you’ve done some resetting/rewinding you can use the reflog commands to view the SHA-1s you’ve recently viewed:
|
||||
|
||||
$ git reflog
|
||||
$ git log -g # Same as above, but shows in 'log' format
|
||||
|
||||
#### 22. Branch Naming ####
|
||||
|
||||
A lovely little tip – don’t forget that branch names aren’t limited to a-z and 0-9. It can be quite nice to use / and . in names for fake namespacing or versionin, for example:
|
||||
|
||||
$ # Generate a changelog of Release 132
|
||||
$ git shortlog release/132 ^release/131
|
||||
$ # Tag this as v1.0.1
|
||||
$ git tag v1.0.1 release/132
|
||||
|
||||
#### 23. Finding Who Dunnit ####
|
||||
|
||||
Often it can be useful to find out who changed a line of code in a file. The simple command to do this is:
|
||||
|
||||
$ git blame FILE
|
||||
|
||||
Sometimes the change has come from a previous file (if you’ve combined two files, or you’ve moved a function) so you can use:
|
||||
|
||||
$ # shows which file names the content came from
|
||||
$ git blame -C FILE
|
||||
|
||||
Sometimes it’s nice to track this down by clicking through changes and going further and further back. There’s a nice in-built gui for this:
|
||||
|
||||
$ git gui blame FILE
|
||||
|
||||
#### 24. Database Maintenance ####
|
||||
|
||||
Git doesn’t generally require a lot of maintenance, it pretty much takes care of itself. However, you can view the statistics of your database using:
|
||||
|
||||
$ git count-objects -v
|
||||
|
||||
If this is high you can choose to garbage collect your clone. This won’t affect pushes or other people but it can make some of your commands run much faster and take less space:
|
||||
|
||||
$ git gc
|
||||
|
||||
It also might be worth running a consistency check every so often:
|
||||
|
||||
$ git fsck --full
|
||||
|
||||
You can also add a `—auto` parameter on the end (if you’re running it frequently/daily from crontab on your server) and it will only fsck if the stats show it’s necessary.
|
||||
|
||||
When checking, getting “dangling” or “unreachable” is fine, this is often a result of rewinding heads or rebasing. Getting “missing” or “sha1 mismatch” is bad… Get professional help!
|
||||
|
||||
#### 25. Recovering a Lost Branch ####
|
||||
|
||||
If you delete a branch experimental with -D you can recreate it with:
|
||||
|
||||
$ git branch experimental SHA1_OF_HASH
|
||||
|
||||
You can often find the SHA1 hash using git reflog if you’ve accessed it recently.
|
||||
|
||||
Another way is to use `git fsck —lost-found`. A dangling commit here is the lost HEAD (it will only be the HEAD of the deleted branch as the HEAD^ is referred to by HEAD so it’s not dangling)
|
||||
|
||||
### Done! ###
|
||||
|
||||
Wow, the longest blog post I’ve ever written, I hope someone finds it useful. If you did, or if you have any questions let me know in the comments…
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.andyjeffries.co.uk/25-tips-for-intermediate-git-users/
|
||||
|
||||
作者:[Andy Jeffries][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.andyjeffries.co.uk/author/andy-jeffries/
|
||||
[1]:http://gitcasts.com/about
|
||||
[2]:http://www.lvs.co.uk/
|
@ -0,0 +1,229 @@
|
||||
Best Known Linux Archive / Compress Tools
|
||||
================================================================================
|
||||
Sending and receiving large files and pictures over the internet is a headache many times. Compression and decompression tools are meant to address this problem. Lets take a quick overview of a few open source tools that are available to make our jobs simpler.
|
||||
|
||||
Tar
|
||||
gzip, gunzip
|
||||
bzip2, bunzip2
|
||||
7-Zip
|
||||
|
||||
### Tar ###
|
||||
|
||||
Tar is derived from 'Tape archiver' as this was initially used for archiving and storing files on magnetic tapes. It is a GNU software. It can compress a set of files (archives), extract them and manipulate those which already exist. It is useful for storing, backing up and transporting files. Tar can preserve file and directory structure while creating the archives. Files archived using tar have '.tar' extensions.
|
||||
|
||||
Basic Usage
|
||||
|
||||
#### a) Creating an archive (c / --create) ####
|
||||
|
||||
tar --create --verbose --file=archive.tar file1 file2 file3
|
||||
|
||||
OR
|
||||
|
||||
tar cvf archive.tar file1 file2 file3
|
||||
|
||||
![tar cvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-cvf.png)
|
||||
|
||||
creating an archive
|
||||
|
||||
#### b) Listing an archive ( t / --list) ####
|
||||
|
||||
tar --list archive.tar
|
||||
|
||||
![tar tvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-tvf.png)
|
||||
|
||||
Listing the contents
|
||||
|
||||
#### c) Extracting an archive (x / --extract) ####
|
||||
|
||||
tar xvf archive.tar
|
||||
|
||||
tar xvf archive.tar --wildcards '*.c' - extracts files with only *.c extension from the archive.
|
||||
|
||||
![tar xvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-xvf.png)
|
||||
|
||||
Extracting files
|
||||
|
||||
![tar xvf --wildcards](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-wildcard.png)
|
||||
|
||||
Extract only the required files
|
||||
|
||||
#### d) Updating an archive ( u / --update) ####
|
||||
|
||||
tar uvf archive.tar newfile.c - updates the archive by adding newfile.c if its version is newer than the existing one.
|
||||
|
||||
![tar uvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-uvf.png)
|
||||
|
||||
Updating an archive
|
||||
|
||||
#### e) Delete from an archive (--delete) ####
|
||||
|
||||
tar--delete -f archive.tar file1.c - deletes 'file1.c' from the tar ball 'archive.tar'
|
||||
|
||||
![tar --delete](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-delete.png)
|
||||
|
||||
Deleting files
|
||||
|
||||
Refer to [tar home page][1] for its detailed usage
|
||||
|
||||
### Gzip / Gunzip ###
|
||||
|
||||
Gzip stands for GNU zip. It is a compression utility that is commonly available in Linux operating system. Compressed files have an extension of '*.gz'
|
||||
|
||||
**Basic Usage**
|
||||
|
||||
#### a) Compressing files ####
|
||||
|
||||
gzip file(s)
|
||||
|
||||
Each file gets compressed individually
|
||||
|
||||
![gzip](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip.png)
|
||||
|
||||
Compress files
|
||||
|
||||
This generally deletes the original files after compression. We can keep the original file by using the -c option.
|
||||
|
||||
gzip -c file > file.gz
|
||||
|
||||
![gzip-c](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-c.png)
|
||||
|
||||
Keep original files after compressing
|
||||
|
||||
We can also compress a group of files into a single file
|
||||
|
||||
cat file1 file2 file3 | gzip > archieve.gz
|
||||
|
||||
![gz group](http://blog.linoxide.com/wp-content/uploads/2015/01/gz-group.png)
|
||||
|
||||
Compressing a group of files
|
||||
|
||||
#### b) Checking compression ratio ####
|
||||
|
||||
Compression ratio of the compressed file(s) can be verified using the '-l' option.
|
||||
|
||||
gzip -l archieve.gz
|
||||
|
||||
![gzip -l](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-l.png)
|
||||
|
||||
Checking compression ratio
|
||||
|
||||
#### c) Unzipping files ####
|
||||
|
||||
Gunzip is used for unzipping files. Here also, original files are deleted after decompression. Use the -c option to retain original files.
|
||||
|
||||
gunzip -c archieve.gz
|
||||
|
||||
![gunzip -c](http://blog.linoxide.com/wp-content/uploads/2015/01/gunzip-c.png)
|
||||
|
||||
Unzipping files
|
||||
|
||||
Using '-d' option with gzip command has the same effect of gunzip on compressed files.
|
||||
|
||||
More details can be obtained from [gzip home page][2]
|
||||
|
||||
### Bzip2 / Bunzip2 ###
|
||||
|
||||
[Bzip2][3] is also a compression tool like gzip but can compress files to smaller sizes than that is possible with other traditional tools. But the drawback is that it is slower than gzip.
|
||||
|
||||
**Basic Usage**
|
||||
|
||||
#### a) File Compression ####
|
||||
|
||||
Generally, no options are used for compression and the files to be compressed are passed as arguments. Each file gets compressed individually and compressed files will have the extension 'bz2'.
|
||||
|
||||
bzip2 file1 file2 file3
|
||||
|
||||
![bzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2.png)
|
||||
|
||||
File Compression
|
||||
|
||||
Use '-k' option to keep the original files after compression / decompression.
|
||||
|
||||
![bzip2 -k](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-k.png)
|
||||
|
||||
Retaining original files after compression
|
||||
|
||||
'-d' option is used for forced decompression.
|
||||
|
||||
![bzip2 -d](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-d.png)
|
||||
|
||||
Delete files using -d option
|
||||
|
||||
#### b) Decompression ####
|
||||
|
||||
bunzip2 filename
|
||||
|
||||
![bunzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bunzip2.png)
|
||||
|
||||
Decompressing files
|
||||
|
||||
bunzip2 can decompress files with extensions bz2, bz, tbz2 and tbz. Files with tbz2 and tbz will end up with '.tar' extension after decompression.
|
||||
|
||||
bzip2 -dc performs the function of decompressing files to the stdout
|
||||
|
||||
### 7-zip ###
|
||||
|
||||
[7-zip][4] is another open source file archiver. It uses 7z format which is a new compression format and provides high-compression ratio. Hence, it is considered to be better than the previously mentioned compression tools. It is available under Linux as p7zip package. The package includes three binaries – 7z, 7za and 7zr. Refer to the [p7zip wiki][5] for differences between these binaries. In this article, we will be using 7zr to explain the usage. Archived files will have '.7z' extension.
|
||||
|
||||
**Basic usage**
|
||||
|
||||
#### a) Creating an archive ####
|
||||
|
||||
7zr a archive-name.7z file-name(s) / directory-name(s)
|
||||
|
||||
![7zr a](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-a.png)
|
||||
|
||||
Creating an archive
|
||||
|
||||
#### b) Listing an archive ####
|
||||
|
||||
7zr l archive-name.7z
|
||||
|
||||
![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-l.png)
|
||||
|
||||
Listing an archive
|
||||
|
||||
#### c) Extracting an archive ####
|
||||
|
||||
7zr e archive-name.7z
|
||||
|
||||
![7zr e](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-e.png)
|
||||
|
||||
Extracting an archive
|
||||
|
||||
#### d) Updating an archive ####
|
||||
|
||||
7zr u archive-name.7z new-file
|
||||
|
||||
![7zr u](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-u.png)
|
||||
|
||||
Updating an archive
|
||||
|
||||
#### e) Deleting files from an archive ####
|
||||
|
||||
7zr d archive-name.7z file-to-be-deleted
|
||||
|
||||
![7zr d](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d.png)
|
||||
|
||||
Deleting files
|
||||
|
||||
![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d-l.png)
|
||||
|
||||
Verifying file deletion
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/tools/linux-compress-decompress-tools/
|
||||
|
||||
作者:[B N Poornima][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/bnpoornima/
|
||||
[1]:http://www.gnu.org/software/tar/
|
||||
[2]:http://www.gzip.org/
|
||||
[3]:http://www.bzip.org/
|
||||
[4]:http://www.7-zip.org/
|
||||
[5]:https://wiki.archlinux.org/index.php/p7zip
|
@ -0,0 +1,70 @@
|
||||
Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10
|
||||
================================================================================
|
||||
A low-overhead monitoring web dashboard for a GNU/Linux machine. Simply drop-in the app and go!.Linux Dash's interface provides a detailed overview of all vital aspects of your server, including RAM and disk usage, network, installed software, users, and running processes. All information is organized into sections, and you can jump to a specific section using the buttons in the main toolbar. Linux Dash is not the most advanced monitoring tool out there, but it might be a good fit for users looking for a slick, lightweight, and easy to deploy application.
|
||||
|
||||
### Linux-Dash Features ###
|
||||
|
||||
A beautiful web-based dashboard for monitoring server info
|
||||
|
||||
Live, on-demand monitoring of RAM, Load, Uptime, Disk Allocation, Users and many more system stats
|
||||
|
||||
Drop-in install for servers with Apache2/nginx + PHP
|
||||
|
||||
Click and drag to re-arrange widgets
|
||||
|
||||
Support for wide range of linux server flavors
|
||||
|
||||
### List of Current Widgets ###
|
||||
|
||||
- General info
|
||||
- Load Average
|
||||
- RAM
|
||||
- Disk Usage
|
||||
- Users
|
||||
- Software
|
||||
- IP
|
||||
- Internet Speed
|
||||
- Online
|
||||
- Processes
|
||||
- Logs
|
||||
|
||||
### Install Linux-dash on ubuntu server 14.10 ###
|
||||
|
||||
First you need to make sure you have [Ubuntu LAMP server 14.10][1] installed and Now you have to install the following package
|
||||
|
||||
sudo apt-get install php5-json unzip
|
||||
|
||||
After the installation this module will enable for apache2 so you need to restart the apache2 server using the following command
|
||||
|
||||
sudo service apache2 restart
|
||||
|
||||
Now you need to download the linux-dash package and install
|
||||
|
||||
wget https://github.com/afaqurk/linux-dash/archive/master.zip
|
||||
|
||||
unzip master.zip
|
||||
|
||||
sudo mv linux-dash-master/ /var/www/html/linux-dash-master/
|
||||
|
||||
Now you need to change the permissions using the following command
|
||||
|
||||
sudo chmod 755 /var/www/html/linux-dash-master/
|
||||
|
||||
Now you need to go to http://serverip/linux-dash-master/ you should see similar to the following output
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/2.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/install-linux-dash-web-based-monitoring-tool-on-ubntu-14-10.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html
|
@ -0,0 +1,80 @@
|
||||
translating by martin.
|
||||
|
||||
Install Mumble in Ubuntu an Opensource VoIP Apps
|
||||
================================================================================
|
||||
Mumble is a free and open source voice over IP (VoIP) application, released under the new BSD license, primarily designed for use by gamers and it's similar to programs such as TeamSpeak and Ventrilo. It uses a server to witch people can connect with a client to talk to each other.
|
||||
|
||||
It offers the following great features:
|
||||
|
||||
- low latency, very important for gaming
|
||||
- offers in-game overlay so you can see who is talking and positional audio to hear the players from where they are located
|
||||
- has encrypted communications so you can stay private and secure
|
||||
- it also offers a few nice configuration interface that are easy to use
|
||||
- very stable and good on resource usage for your server
|
||||
|
||||
### Install Mumble ###
|
||||
|
||||
[Mumble][1] has become very popular and is now present in the software repositories of the major Linux distributions and this makes it easy to install and setup. In Ubuntu you can use the command line to install it with apt-get by running the following command:
|
||||
|
||||
$ sudo apt-get install mumble-server
|
||||
|
||||
![mumble install](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-install.jpg)
|
||||
|
||||
This will install the server (also called Murmur) on your server.
|
||||
|
||||
### Configuring Mumble ###
|
||||
|
||||
To setup Mumble you will need to run the following command:
|
||||
|
||||
$ sudo dpkg-reconfigure mumble-server
|
||||
|
||||
The following questions will pop-up:
|
||||
|
||||
![mumble q1](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-q1.jpg)
|
||||
|
||||
Pick Yes to have mumble start when your server boots, next it will ask if you wish to run it in a high-priority mode that will ensure lower latency, it's a good idea to have it run it like that for the best performance:
|
||||
|
||||
![mumble q2](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-q2.jpg)
|
||||
|
||||
It will then require you to introduce a password for the administrator user of the new mumble server, you will need to remember this password for when you will log-in.
|
||||
|
||||
![mumble q3](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-q3.jpg)
|
||||
|
||||
### Installing Mumble Client ###
|
||||
|
||||
The client can be installed on most major platforms like Windows, Mac OS X and Linux. We will cover the installation and configuration on Ubuntu Linux, to install it you can use the Software Center or run the following command:
|
||||
|
||||
$ sudo apt-get install mumble
|
||||
|
||||
When you first run Mumble it will present you with a wizard to help you configure your audio input and output to make the best of the client. It will first ask you what sound device and microphone to use:
|
||||
|
||||
![mumble client 1](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-client-1.jpg)
|
||||
|
||||
Then it will help you calibrate the devices:
|
||||
|
||||
![mumble client 2](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-client-2.jpg)
|
||||
|
||||
And since mumble encrypts all the communication it will ask you to also create a certificate:
|
||||
|
||||
![mumble client 3](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-client-3.jpg)
|
||||
|
||||
After you finish with the wizard you can add your first server and connect to it the dialog will look like this:
|
||||
|
||||
![mumble add server](http://blog.linoxide.com/wp-content/uploads/2015/01/mumble-add-server.jpg)
|
||||
|
||||
First enter a label, this can be anything you wish to remember the server by, next add the address and port of the server, and finally use "SuperUser" as user and the password you used when you configured the mumble server.
|
||||
|
||||
You can now connect to the server and enjoy all of the features while you play online or talk to your friends or partners.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/install-mumble-ubuntu/
|
||||
|
||||
作者:[Adrian Dinu][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/adriand/
|
||||
[1]:http://wiki.mumble.info/wiki/Main_Page
|
@ -0,0 +1,270 @@
|
||||
Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules
|
||||
================================================================================
|
||||
For those of you in the hosting business, or if you’re hosting your own servers and exposing them to the Internet, securing your systems against attackers must be a high priority.
|
||||
|
||||
mod_security (an open source intrusion detection and prevention engine for web applications that integrates seamlessly with the web server) and mod_evasive are two very important tools that can be used to protect a web server against brute force or (D)DoS attacks.
|
||||
|
||||
mod_evasive, as its name suggests, provides evasive capabilities while under attack, acting as an umbrella that shields web servers from such threats.
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg)
|
||||
Install Mod_Security and Mod_Evasive to Protect Apache
|
||||
|
||||
In this article we will discuss how to install, configure, and put them into play along with Apache on RHEL/CentOS 6 and 7 as well as Fedora 21-15. In addition, we will simulate attacks in order to verify that the server reacts accordingly.
|
||||
|
||||
This assumes that you have a LAMP server installed on your system. If not, please check this article before proceeding further.
|
||||
|
||||
- [Install LAMP stack in RHEL/CentOS 7][1]
|
||||
|
||||
You will also need to setup iptables as the default [firewall][2] front-end instead of firewalld if you’re running RHEL/CentOS 7 or Fedora 21. We do this in order to use the same tool in both RHEL/CentOS 7/6 and Fedora 21.
|
||||
|
||||
### Step 1: Installing Iptables Firewall on RHEL/CentOS 7 and Fedora 21 ###
|
||||
|
||||
To begin, stop and disable firewalld:
|
||||
|
||||
# systemctl stop firewalld
|
||||
# systemctl disable firewalld
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-Firewalld-Service.png)
|
||||
Disable Firewalld Service
|
||||
|
||||
Then install the iptables-services package before enabling iptables:
|
||||
|
||||
# yum update && yum install iptables-services
|
||||
# systemctl enable iptables
|
||||
# systemctl start iptables
|
||||
# systemctl status iptables
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Iptables-Firewall.png)
|
||||
Install Iptables Firewall
|
||||
|
||||
### Step 2: Installing Mod_Security and Mod_evasive ###
|
||||
|
||||
In addition to having a LAMP setup already in place, you will also have to [enable the EPEL repository][3] in RHEL/CentOS 7/6 in order to install both packages. Fedora users don’t need to enable any repo, because epel is a already part of Fedora project.
|
||||
|
||||
# yum update && yum install mod_security mod_evasive
|
||||
|
||||
When the installation is complete, you will find the configuration files for both tools in /etc/httpd/conf.d.
|
||||
|
||||
# ls -l /etc/httpd/conf.d
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png)
|
||||
mod_security + mod_evasive Configurations
|
||||
|
||||
Now, in order to integrate these two modules with Apache and have it load them when it starts, make sure the following lines appear in the top level section of mod_evasive.conf and mod_security.conf, respectively:
|
||||
|
||||
LoadModule evasive20_module modules/mod_evasive24.so
|
||||
LoadModule security2_module modules/mod_security2.so
|
||||
|
||||
Note that modules/mod_security2.so and modules/mod_evasive24.so are the relative paths, from the /etc/httpd directory to the source file of the module. You can verify this (and change it, if needed) by listing the contents of the /etc/httpd/modules directory:
|
||||
|
||||
# cd /etc/httpd/modules
|
||||
# pwd
|
||||
# ls -l | grep -Ei '(evasive|security)'
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png)
|
||||
Verify mod_security + mod_evasive Modules
|
||||
|
||||
Then restart Apache and verify that it loads mod_evasive and mod_security:
|
||||
|
||||
# service httpd restart [On RHEL/CentOS 6 and Fedora 20-18]
|
||||
# systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21]
|
||||
|
||||
----------
|
||||
|
||||
[Dump a list of loaded Static and Shared Modules]
|
||||
|
||||
# httpd -M | grep -Ei '(evasive|security)'
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png)
|
||||
Check mod_security + mod_evasive Modules Loaded
|
||||
|
||||
### Step 3: Installing A Core Rule Set and Configuring Mod_Security ###
|
||||
|
||||
In few words, a Core Rule Set (aka CRS) provides the web server with instructions on how to behave under certain conditions. The developer firm of mod_security provide a free CRS called OWASP ([Open Web Application Security Project][4]) ModSecurity CRS that can be downloaded and installed as follows.
|
||||
|
||||
1. Download the OWASP CRS to a directory created for that purpose.
|
||||
|
||||
# mkdir /etc/httpd/crs-tecmint
|
||||
# cd /etc/httpd/crs-tecmint
|
||||
# wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png)
|
||||
Download mod_security Core Rules
|
||||
|
||||
2. Untar the CRS file and change the name of the directory for one of our convenience.
|
||||
|
||||
# tar xzf master
|
||||
# mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png)
|
||||
Extract mod_security Core Rules
|
||||
|
||||
3. Now it’s time to configure mod_security. Copy the sample file with rules (owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example) into another file without the .example extension:
|
||||
|
||||
# cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf
|
||||
|
||||
and tell Apache to use this file along with the module by inserting the following lines in the web server’s main configuration file /etc/httpd/conf/httpd.conf file. If you chose to unpack the tarball in another directory you will need to edit the paths following the Include directives:
|
||||
|
||||
<IfModule security2_module>
|
||||
Include crs-tecmint/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf
|
||||
Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf
|
||||
</IfModule>
|
||||
|
||||
Finally, it is recommended that we create our own configuration file within the /etc/httpd/modsecurity.d directory where we will place our customized directives (we will name it tecmint.conf in the following example) instead of modifying the CRS files directly. Doing so will allow for easier upgrading the CRSs as new versions are released.
|
||||
|
||||
<IfModule mod_security2.c>
|
||||
SecRuleEngine On
|
||||
SecRequestBodyAccess On
|
||||
SecResponseBodyAccess On
|
||||
SecResponseBodyMimeType text/plain text/html text/xml application/octet-stream
|
||||
SecDataDir /tmp
|
||||
</IfModule>
|
||||
|
||||
You can refer to the [SpiderLabs’ ModSecurity GitHub][5] repository for a complete explanatory guide of mod_security configuration directives.
|
||||
|
||||
### Step 4: Configuring Mod_Evasive ###
|
||||
|
||||
mod_evasive is configured using directives in /etc/httpd/conf.d/mod_evasive.conf. Since there are no rules to update during a package upgrade, we don’t need a separate file to add customized directives, as opposed to mod_security.
|
||||
|
||||
The default mod_evasive.conf file has the following directives enabled (note that this file is heavily commented, so we have stripped out the comments to highlight the configuration directives below):
|
||||
|
||||
<IfModule mod_evasive24.c>
|
||||
DOSHashTableSize 3097
|
||||
DOSPageCount 2
|
||||
DOSSiteCount 50
|
||||
DOSPageInterval 1
|
||||
DOSSiteInterval 1
|
||||
DOSBlockingPeriod 10
|
||||
</IfModule>
|
||||
|
||||
Explanation of the directives:
|
||||
|
||||
- DOSHashTableSize: This directive specifies the size of the hash table that is used to keep track of activity on a per-IP address basis. Increasing this number will provide a faster look up of the sites that the client has visited in the past, but may impact overall performance if it is set too high.
|
||||
- DOSPageCount: Legitimate number of identical requests to a specific URI (for example, any file that is being served by Apache) that can be made by a visitor over the DOSPageInterval interval.
|
||||
- DOSSiteCount: Similar to DOSPageCount, but refers to how many overall requests can be made to the entire site over the DOSSiteInterval interval.
|
||||
- DOSBlockingPeriod: If a visitor exceeds the limits set by DOSSPageCount or DOSSiteCount, his source IP address will be blacklisted during the DOSBlockingPeriod amount of time. During DOSBlockingPeriod, any requests coming from that IP address will encounter a 403 Forbidden error.
|
||||
|
||||
Feel free to experiment with these values so that your web server will be able to handle the required amount and type of traffic.
|
||||
|
||||
**Only a small caveat**: if these values are not set properly, you run the risk of ending up blocking legitimate visitors.
|
||||
|
||||
You may also want to consider other useful directives:
|
||||
|
||||
#### DOSEmailNotify ####
|
||||
|
||||
If you have a mail server up and running, you can send out warning messages via Apache. Note that you will need to grant the apache user SELinux permission to send emails if SELinux is set to enforcing. You can do so by running
|
||||
|
||||
# setsebool -P httpd_can_sendmail 1
|
||||
|
||||
Next, add this directive in the mod_evasive.conf file with the rest of the other directives:
|
||||
|
||||
DOSEmailNotify you@yourdomain.com
|
||||
|
||||
If this value is set and your mail server is working properly, an email will be sent to the address specified whenever an IP address becomes blacklisted.
|
||||
|
||||
#### DOSSystemCommand ####
|
||||
|
||||
This needs a valid system command as argument,
|
||||
|
||||
DOSSystemCommand </command>
|
||||
|
||||
This directive specifies a command to be executed whenever an IP address becomes blacklisted. It is often used in conjunction with a shell script that adds a firewall rule to block further connections coming from that IP address.
|
||||
|
||||
**Write a shell script that handles IP blacklisting at the firewall level**
|
||||
|
||||
When an IP address becomes blacklisted, we need to block future connections coming from it. We will use the following shell script that performs this job. Create a directory named scripts-tecmint (or whatever name of your choice) in /usr/local/bin and a file called ban_ip.sh in that directory.
|
||||
|
||||
#!/bin/sh
|
||||
# IP that will be blocked, as detected by mod_evasive
|
||||
IP=$1
|
||||
# Full path to iptables
|
||||
IPTABLES="/sbin/iptables"
|
||||
# mod_evasive lock directory
|
||||
MOD_EVASIVE_LOGDIR=/var/log/mod_evasive
|
||||
# Add the following firewall rule (block all traffic coming from $IP)
|
||||
$IPTABLES -I INPUT -s $IP -j DROP
|
||||
# Remove lock file for future checks
|
||||
rm -f "$MOD_EVASIVE_LOGDIR"/dos-"$IP"
|
||||
|
||||
Our DOSSystemCommand directive should read as follows:
|
||||
|
||||
DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s"
|
||||
|
||||
In the line above, %s represents the offending IP as detected by mod_evasive.
|
||||
|
||||
**Add the apache user to the sudoers file**
|
||||
|
||||
Note that all of this just won’t work unless you to give permissions to user apache to run our script (and that script only!) without a terminal and password. As usual, you can just type visudo as root to access the /etc/sudoers file and then add the following 2 lines as shown in the image below:
|
||||
|
||||
apache ALL=NOPASSWD: /usr/local/bin/scripts-tecmint/ban_ip.sh
|
||||
Defaults:apache !requiretty
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png)
|
||||
Add Apache User to Sudoers
|
||||
|
||||
**IMPORTANT**: As a default security policy, you can only run sudo in a terminal. Since in this case we need to use sudo without a tty, we have to comment out the line that is highlighted in the following image:
|
||||
|
||||
#Defaults requiretty
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png)
|
||||
Disable tty for Sudo
|
||||
|
||||
Finally, restart the web server:
|
||||
|
||||
# service httpd restart [On RHEL/CentOS 6 and Fedora 20-18]
|
||||
# systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21]
|
||||
|
||||
### Step 4: Simulating an DDoS Attacks on Apache ###
|
||||
|
||||
There are several tools that you can use to simulate an external attack on your server. You can just google for “tools for simulating ddos attacks” to find several of them.
|
||||
|
||||
Note that you, and only you, will be held responsible for the results of your simulation. Do not even think of launching a simulated attack to a server that you’re not hosting within your own network.
|
||||
|
||||
Should you want to do the same with a VPS that is hosted by someone else, you need to appropriately warn your hosting provider or ask permission for such a traffic flood to go through their networks. Tecmint.com is not, by any means, responsible for your acts!
|
||||
|
||||
In addition, launching a simulated DoS attack from only one host does not represent a real life attack. To simulate such, you would need to target your server from several clients at the same time.
|
||||
|
||||
Our test environment is composed of a CentOS 7 server [IP 192.168.0.17] and a Windows host from which we will launch the attack [IP 192.168.0.103]:
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png)
|
||||
Confirm Host IPAddress
|
||||
|
||||
Please play the video below and follow the steps outlined in the indicated order to simulate a simple DoS attack:
|
||||
|
||||
注:youtube视频,发布的时候不行做个链接吧
|
||||
<iframe width="640" height="405" frameborder="0" allowfullscreen="allowfullscreen" src="https://www.youtube.com/embed/-U_mdet06Jk"></iframe>
|
||||
|
||||
Then the offending IP is blocked by iptables:
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png)
|
||||
Blocked Attacker IP
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
With mod_security and mod_evasive enabled, the simulated attack causes the CPU and RAM to experiment a temporary usage peak for only a couple of seconds before the source IPs are blacklisted and blocked by the firewall. Without these tools, the simulation will surely knock down the server very fast and render it unusable during the duration of the attack.
|
||||
|
||||
We would love to hear if you’re planning on using (or have used in the past) these tools. We always look forward to hearing from you, so don’t hesitate to leave your comments and questions, if any, using the form below.
|
||||
|
||||
### Reference Links ###
|
||||
|
||||
- [https://www.modsecurity.org/][6]
|
||||
- [http://www.zdziarski.com/blog/?page_id=442][7]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/gacanepa/
|
||||
[1]:http://www.tecmint.com/install-lamp-in-centos-7/
|
||||
[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/
|
||||
[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/
|
||||
[4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project
|
||||
[5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives
|
||||
[6]:https://www.modsecurity.org/
|
||||
[7]:http://www.zdziarski.com/blog/?page_id=442
|
@ -0,0 +1,169 @@
|
||||
Simple Steps Migration From MySQL To MariaDB On Linux
|
||||
================================================================================
|
||||
Hi all, this tutorial is all gonna be about how to migrate from MySQL to MariaDB on Linux Server or PC. So, you may ask why should we really migrate from MySQL to MariaDB for our database management. Here, below are the reasons why you should really need to migrate your database management system from MySQL to MariaDB.
|
||||
|
||||
### Why should I use MariaDB instead of MySQL? ###
|
||||
|
||||
MariaDB is an enhanced drop-in replacement and community-developed fork of the MySQL database system. It was developed by MariaDB foundation, and is being led by original developers of MySQL. Working with MariaDB is entirely same as MySQL. After Oracle bought MySQL, it is not free and open source anymore, but **MariaDB is still free and open source**. Top Websites like Google, Wikipedia, Linkedin, Mozilla and many more migrated to MariaDB. Its features are
|
||||
|
||||
- Backwards compatible with MySQL
|
||||
- Forever open source
|
||||
- Maintained by MySQL's creator
|
||||
- More cutting edge features
|
||||
- More storage engines
|
||||
- Large websites have switched
|
||||
|
||||
Now, lets migrate to MariaDB.
|
||||
|
||||
**For the testing purpose**, let us create a sample database called **linoxidedb** .
|
||||
|
||||
Log in to MySQL as root user using the following command:
|
||||
|
||||
$ mysql -u root -p
|
||||
|
||||
Enter the mysql root user password. You’ll be redirected to the **mysql prompt**.
|
||||
|
||||
**Create test databases:**
|
||||
|
||||
Enter the following commands from mysql prompt to create test databases.
|
||||
|
||||
mysql> create database linoxidedb;
|
||||
|
||||
To view the list of available databases, enter the following command:
|
||||
|
||||
mysql> show databases;
|
||||
|
||||
![creating test databases](http://blog.linoxide.com/wp-content/uploads/2015/01/creating-test-databases.png)
|
||||
|
||||
As see above, we have totally 5 databases including the newly created database linoxidedb .
|
||||
|
||||
mysql> quit
|
||||
|
||||
Now, we'll migrate the created databases from MySQL to MariaDB.
|
||||
|
||||
Note: This tutorial is not necessary for CentOS, fedora based distribution of Linux because MariaDB is automatically installed instead of MySQL which requires no need to backup the existing databases, you just need to update mysql which will give you mariadb.
|
||||
|
||||
### 1. Backup existing databases ###
|
||||
|
||||
Our first important step is to create a backup of existing databases. To do that, we'll enter the following command from the **Terminal (not from MySQL prompt)**.
|
||||
|
||||
$ mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql
|
||||
|
||||
Oops! We encountered an error. No worries, it can be fixed.
|
||||
|
||||
$ mysqldump: Error: Binlogging on server not active
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2015/01/mysqldump-error.png)
|
||||
mysqldump error
|
||||
|
||||
To fix this error, we have to do a small modification in **my.cnf** file.
|
||||
|
||||
Edit my.cnf file:
|
||||
|
||||
$ sudo nano /etc/mysql/my.cnf
|
||||
|
||||
Under [mysqld] section, add the following parameter.
|
||||
|
||||
**log-bin=mysql-bin**
|
||||
|
||||
![configuring my.cnf](http://blog.linoxide.com/wp-content/uploads/2015/01/configuring-my.cnf_.png)
|
||||
|
||||
Now, after done save and exit the file. Then, we'll need to restart mysql server. To do that please execute the below commands.
|
||||
|
||||
$ sudo /etc/init.d/mysql restart
|
||||
|
||||
Now, re-run the mysqldump command to backup all databases.
|
||||
|
||||
$ mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2015/01/crearing-bakup-file.png)
|
||||
dumping databases
|
||||
|
||||
The above command will backup all databases, and stores them in **backupdatabase.sql** in the current directory.
|
||||
|
||||
### 2. Uninstalling MySQL ###
|
||||
|
||||
First of all, we'll want to **backup the my.cnf file to a safe location**.
|
||||
|
||||
**Note**: The my.cnf file will not be deleted when uninstalling MySQL packages. We do it for the precaution. During MariaDB installation, the installer will ask us to keep the existing my.cnf(old backup) file or to use the package containers version (i.e new one).
|
||||
|
||||
To backup the my.cnf file, please enter the following commands in a shell or terminal.
|
||||
|
||||
$ sudo cp /etc/mysql/my.cnf my.cnf.bak
|
||||
|
||||
To stop mysql service, enter the following command from your Terminal.
|
||||
|
||||
$ sudo /etc/init.d/mysql stop
|
||||
|
||||
Then, remove mysql packages.
|
||||
|
||||
$ sudo apt-get remove mysql-server mysql-client
|
||||
|
||||
![uninstalling mysql](http://blog.linoxide.com/wp-content/uploads/2015/01/uninstalling-mysql.png)
|
||||
|
||||
### 3. Installing MariaDB ###
|
||||
|
||||
Here are the commands to run to install MariaDB on your Ubuntu system:
|
||||
|
||||
$ sudo apt-get install software-properties-common
|
||||
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
|
||||
# sudo add-apt-repository 'deb http://mirror.mephi.ru/mariadb/repo/5.5/ubuntu trusty main'
|
||||
|
||||
![adding mariadb repo](http://blog.linoxide.com/wp-content/uploads/2015/01/adding-repo-mariadb.png)
|
||||
|
||||
Once the key is imported and the repository added you can install MariaDB with:
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install mariadb-server
|
||||
|
||||
![installing mariadb](http://blog.linoxide.com/wp-content/uploads/2015/01/installing-mariadb.png)
|
||||
|
||||
![my.conf configuration prompt](http://blog.linoxide.com/wp-content/uploads/2015/01/my.conf-configuration-prompt.png)
|
||||
|
||||
We should remember that during MariaDB installation, the installer will ask you either to use the existing my.cnf(old backup) file, or use the package containers version (i.e new one). You can either use the old my.cnf file or the package containers version. If you want to use the new my.cnf version, you can restore the contents of older my.cnf (We already have copied this file to safe location before) later ie my.cnf.bak . So, I will go for default which is N, we'll press N then. For other versions, please refer the [MariaDB official repositories page][2].
|
||||
|
||||
### 4. Restoring Config File ###
|
||||
|
||||
To restore my.cnf from my.cnf.bak, enter the following command in Terminal. We have the old as my.cnf.bak file in our current directory, so we can simply copy the file using the following command:
|
||||
|
||||
$ sudo cp my.cnf.bak /etc/mysql/my.cnf
|
||||
|
||||
### 5. Importing Databases ###
|
||||
|
||||
Finally, lets import the old databases that we created before. To do that, we'll need to run the following command.
|
||||
|
||||
$ mysql -u root -p < backupdatabase.sql
|
||||
|
||||
That’s it. We have successfully imported the old databases.
|
||||
|
||||
Let us check if the databases are really imported. To do that, we'll wanna log in to mysql prompt using command:
|
||||
|
||||
$ mysql -u root -p
|
||||
|
||||
![importing database](http://blog.linoxide.com/wp-content/uploads/2015/01/importing-database.png)
|
||||
|
||||
Now, to check whether the databases are migrated to MariaDB please run "**show databases**;" command inside the MarianDB prompt without quotes("") as
|
||||
|
||||
mariaDB> show databases;
|
||||
|
||||
![mysql to mariadb database migrated](http://blog.linoxide.com/wp-content/uploads/2015/01/maria-database-migrated.png)
|
||||
|
||||
As you see in the above result all old databases including our very linoxidedb has been successfully migrated.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Finally, we have successfully migrated our databases from MySQL to MariaDB Database Management System. MariaDB is far more better than MySQL. Though MySQL is still faster than MariaDB in performance but MariaDB is far more better because of its additional features and license. MariaDB is a Free and Open Source Software (FOSS) and will be FOSS forever but MySQL has many additional plugins, etc non-free and there is no proper public roadmap and won't be FOSS in future. If you have any questions, comments, feedback to us, please don't hesitate to write on the comment box below. Thank You ! And Enjoy MariaDB.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/migrate-mysql-mariadb-linux/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://mariadb.org/
|
||||
[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=mephi
|
@ -0,0 +1,60 @@
|
||||
有请Vivaldi——全新网页浏览器,为高手级用户而生
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/Screen-Shot-2015-01-27-at-17.36.jpg)
|
||||
|
||||
**这一周一个为了满足高手级用户的需要而制造出来的全新网页浏览器已然来临——而且它已经可以在Linux上使用了。**
|
||||
|
||||
Vivaldi就是这个新浏览器的名字,而且它还面向64位Linux,Windows和Mac机的技术预览版(请读:无责任测试)发行。它是在 — 震惊 — 尝试且已测试过的Chromium开源框架,Blink和Google的开源V8 JavaScript引擎(以及其他项目)的基础上制造的。
|
||||
|
||||
这个世界真的想要再有一个浏览器吗?Vivaldi——出自Opera软件前首席执行官Jon S.von Tetzchner的想法——不怎么关注所要,更关注所需。
|
||||
|
||||
Vivaldi被制造成带有着偏向于键盘操作的tab键瘾君子所需的那种功能。并没有为那些认为Firefox复杂或是对Chrome的唯一批评是它改动了书签按钮的用户而进行修改。
|
||||
|
||||
这也不是什么俗气的营销噱头。不去看它所戴的‘技术预览版’标签,Vivaldi已经有了明显偏向于高手级用户们的功能。
|
||||
|
||||
相当多的人觉得自己被其他软件公司所生产的简化的,配对后发行的产品遗弃了、糊弄了。Vivaldi——即使在这个过渡期的早期——看起来适逢其会以至于打败了其他产品。
|
||||
|
||||
### Vivaldi功能###
|
||||
|
||||
以下是几个Vivaldi已展示过的关键功能:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/quick.jpg)
|
||||
|
||||
**快捷命令** (Ctrl + Q)是个内置的HUD应用,他可以让你快速的滤过设置,选项和功能,用它打开一个书签或是隐藏状态栏,只需用你的键盘。无需点击。
|
||||
|
||||
**标签堆** 让你可以通过把多个不同标签分到一组来清理你的工作区,然后可以通过键盘命令或者可预览标签选择器在标签组之间进行切换。
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/tab-stacks.jpg)
|
||||
|
||||
一个可折叠的**侧边栏**藏有额外功能(就像旧Opera)包括一个(目前还不能工作的)邮箱客户端,链接,书签浏览器和可以让你截屏并做注释的笔记专区
|
||||
|
||||
还提供了一大堆其他的功能,包括设置键盘快捷键,一个可以被设置在浏览器任何一个边(或完全隐藏)的标签栏,隐私选项和一个快速打开文件夹的功能。
|
||||
|
||||
### Opera二代的印记 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/vivaldi-settings-in-ubuntu-750x434.jpg)
|
||||
|
||||
把Vivaldi当作Opera post-Presto(Opera旧的拥有版权的引擎)的真正继承者并不是什么值得惊奇的事。当Opera(今天也推出了一个小更新)追求一个更轻、更好管理的一套功能时,已经剔除了它很多“高手级用户”功能。
|
||||
|
||||
Vivaldi想要捡起Opera曾急于脱手的负担。虽然这么做没有帮他抓到什么预期的市场份额,但是它抓住了高手级用户的眼球。他们大多数无疑已经在使用Linux了。
|
||||
|
||||
### 下载 ###
|
||||
|
||||
有兴趣尝尝鲜?完全可以。Vivaldi可以下载到Windows,Mac以及64位Linux版本。不久的将来你还能选择Debian或RPM安装器。
|
||||
|
||||
请记住,它还没有完成,而且更多的功能(包括扩展、同步等等)正计划着在将来加入。
|
||||
|
||||
- [Download Vivaldi Tech Preview for Linux][1]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/01/vivaldi-web-browser-linux-download-power-users
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[H-mudcup](https://github.com/H-mudcup)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://vivaldi.com/#Download
|
@ -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
|
@ -2,15 +2,16 @@ 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.
|
||||
在Linux用户社区中, 很多人每年都会期待来自 LinuxQuestions.org 细致并可靠的年度问卷调查结果. 如同[Susan在她的报告][1]中指出的那样, 今年的[结果][2]着重于调查网站读者心中最棒的开源项目. 这份报告目前已经完成. 在LinuxQuestions的大多数人都是"专家级"的用户, 他们经常在网站上在线回答Linux新手们的提问.
|
||||
|
||||
在Susan所作的报告的附加内容里, 你可以看到由"专家"们对开源世界的关注点分布.
|
||||
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:
|
||||
你也可以在[这里][3]找到一份较为精美的调查问卷总结图.这里呈现了网站投票得出的最佳Linux发行版, 可以看到Mint和Slackwaer平分了半壁江山:
|
||||
|
||||
![](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].
|
||||
而下图则是网站票选出的得出的最佳云项目. 值得注意的是, LinuxQuestions的用户群体给予了ownCloud项目极高的评价. 你一定得亲自去看看调查结果的详情, 也看看 [Susan关于各项目"赢家"][4]的总结 , 还有[一堆精美的图表][5].
|
||||
|
||||
![](http://i1311.photobucket.com/albums/s669/webworkerdaily/lin2_zps9nxf7yyi.png)
|
||||
|
||||
@ -19,7 +20,7 @@ And below is a snapshot of the site's determination of the best cloud projects.
|
||||
via: http://ostatic.com/blog/linuxquestions-survey-results-surface-top-open-source-projects
|
||||
|
||||
作者:[Sam Dean][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[jerryling315](https://github.com/jerryling315)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -1,158 +0,0 @@
|
||||
+在Linux中使用matplotlib进行科学画图
|
||||
+================================================================================
|
||||
+
|
||||
+如果你想要在Linxu中获得一个高效、自动化、高质量的科学画图的解决方案,那就要考虑一下使用matplotlib库了。Matplotlib是基于python的开源科学测绘包,版权基于python软件基金许可证。大量的文档和例子,整合在Python和Numpy科学计处包中,其自动化性能是少数几个为什么这个包是在Linux环境中进行科学画图的可靠选择。这个教程将提供几个用matplotlib画图的例子。
|
||||
+
|
||||
+###特性###
|
||||
+-
|
||||
+-众多的画图类型,如:bar,box,contour,histogram,scatter,line plots....
|
||||
+-基于python的语法
|
||||
+-集成Numpy科学计算包
|
||||
+-可定制的画图格式(axes scales,tick positions, tick labels...)
|
||||
+-可定制文本(字体,大小,位置...)
|
||||
+-TeX 格式化(等式,符号,希腊字体...)
|
||||
+-与IPython相兼容
|
||||
+-自动化 -用Python 的循环迭代生成图片
|
||||
+-保存所绘图片格式为图片文件,如:png,pdf,ps,eps,svg等
|
||||
+
|
||||
+
|
||||
+基于Python语法的matplotlib通过许多自身特性和高效工作流基础进行表现。
|
||||
+世面上有许多用于绘制高质量图的科学绘图包,但是这些包允许你直接在你的Python代码中去使用吗?
|
||||
+除那以外,这些包允许你创建可以保存为图片文件的图片吗?
|
||||
+Matplotlib允许你完成所有的这些任务。
|
||||
+你可以期望着节省你的时间,从于使用你能够花更多的时间在如何创建更多的图片。
|
||||
+
|
||||
+###安装###
|
||||
+ 安装Python和Numpy包是使用Matplotlib的前提,安装Numpy的指引请见该链接。[here][1].
|
||||
+
|
||||
+
|
||||
+可以通过如下命令在Debian或Ubuntu中安装Matplotlib:
|
||||
+
|
||||
+ $ sudo apt-get install python-matplotlib
|
||||
+
|
||||
+
|
||||
+在Fedora或CentOS/RHEL环境则可用如下命令:
|
||||
+ $ sudo yum install python-matplotlib
|
||||
+
|
||||
+
|
||||
+###Matplotlib 例子###
|
||||
+
|
||||
+该教程会提供几个绘图例子演示如何使用matplotlib:
|
||||
+-离散和线性画图
|
||||
+-柱状图画图
|
||||
+-饼状图
|
||||
+
|
||||
+在这些例子中我们将用Python脚本来执行Mapplotlib命令。注意numpy和matplotlib模块需要通过import命令在脚本中进行导入。
|
||||
+在命令空间中,np指定为nuupy模块的引用,plt指定为matplotlib.pyplot的引用:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+
|
||||
+###例1:离散和线性图###
|
||||
+
|
||||
+第一个脚本,script1.py 完成如下任务:
|
||||
+
|
||||
+-创建3个数据集(xData,yData1和yData2)
|
||||
+-创建一个宽8英寸、高6英寸的图(赋值1)
|
||||
+-设置图画的标题、x轴标签、y轴标签(字号均为14)
|
||||
+-绘制第一个数据集:yData1为xData数据集的函数,用圆点标识的离散蓝线,标识为"y1 data"
|
||||
+-绘制第二个数据集:yData2为xData数据集的函数,采用红实线,标识为"y2 data"
|
||||
+-把图例放置在图的左上角
|
||||
+-保存图片为PNG格式文件
|
||||
+
|
||||
+script1.py的内容如下:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+ xData = np.arange(0, 10, 1)
|
||||
+ yData1 = xData.__pow__(2.0)
|
||||
+ yData2 = np.arange(15, 61, 5)
|
||||
+ plt.figure(num=1, figsize=(8, 6))
|
||||
+ plt.title('Plot 1', size=14)
|
||||
+ plt.xlabel('x-axis', size=14)
|
||||
+ plt.ylabel('y-axis', size=14)
|
||||
+ plt.plot(xData, yData1, color='b', linestyle='--', marker='o', label='y1 data')
|
||||
+ plt.plot(xData, yData2, color='r', linestyle='-', label='y2 data')
|
||||
+ plt.legend(loc='upper left')
|
||||
+ plt.savefig('images/plot1.png', format='png')
|
||||
+
|
||||
+
|
||||
+所画之图如下:
|
||||
+![](https://farm8.staticflickr.com/7529/15927002365_f5ae11cf02_z.jpg)
|
||||
+
|
||||
+
|
||||
+###例2:柱状图###
|
||||
+
|
||||
+第二个脚本,script2.py 完成如下任务:
|
||||
+
|
||||
+-创建一个包含1000个随机样本的正态分布数据集。
|
||||
+-创建一个宽8英寸、高6英寸的图(赋值1)
|
||||
+-设置图的标题、x轴标签、y轴标签(字号均为14)
|
||||
+-用samples这个数据集画一个40个柱状,边从-10到10的柱状图
|
||||
+-添加文本,用TeX格式显示希腊字母mu和sigma(字号为16)
|
||||
+-保存图片为PNG格式。
|
||||
+
|
||||
+script2.py代码如下:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+ mu = 0.0
|
||||
+ sigma = 2.0
|
||||
+ samples = np.random.normal(loc=mu, scale=sigma, size=1000)
|
||||
+ plt.figure(num=1, figsize=(8, 6))
|
||||
+ plt.title('Plot 2', size=14)
|
||||
+ plt.xlabel('value', size=14)
|
||||
+ plt.ylabel('counts', size=14)
|
||||
+ plt.hist(samples, bins=40, range=(-10, 10))
|
||||
+ plt.text(-9, 100, r'$\mu$ = 0.0, $\sigma$ = 2.0', size=16)
|
||||
+ plt.savefig('images/plot2.png', format='png')
|
||||
+
|
||||
+
|
||||
+结果见如下链接:
|
||||
+![](https://farm8.staticflickr.com/7531/15304765024_1cc271b6e0_z.jpg)
|
||||
+
|
||||
+
|
||||
+###例3:饼状图###
|
||||
+
|
||||
+第三个脚本,script3.py 完成如下任务:
|
||||
+
|
||||
+-创建一个包含5个整数的列表
|
||||
+-创建一个宽6英寸、高6英寸的图(赋值1)
|
||||
+-添加一个长宽比为1的轴图
|
||||
+-设置图的标题(字号为14)
|
||||
+-用data列表画一个包含标签的饼状图
|
||||
+-保存图为PNG格式
|
||||
+
|
||||
+脚本script3.py的代码如下:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+ data = [33, 25, 20, 12, 10]
|
||||
+ plt.figure(num=1, figsize=(6, 6))
|
||||
+ plt.axes(aspect=1)
|
||||
+ plt.title('Plot 3', size=14)
|
||||
+ plt.pie(data, labels=('Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5'))
|
||||
+ plt.savefig('images/plot3.png', format='png')
|
||||
+
|
||||
+
|
||||
+结果如下链接所示:
|
||||
+![](https://farm8.staticflickr.com/7504/15926356092_7c3e5217aa_z.jpg)
|
||||
+
|
||||
+
|
||||
+###总结###
|
||||
+ 这个教程提供了几个用matplotlib科学画图包进行画图的例子,Matplotlib是在Linux环境中用于解决科学画图的绝佳方案,表现在其无缝地和Python、Numpy连接,自动化能力,和提供多种自定义的高质量的画图产品。[here][2].
|
||||
+
|
||||
+matplotlib包的文档和例子详见:
|
||||
+--------------------------------------------------------------------------------
|
||||
+
|
||||
+via: http://xmodulo.com/matplotlib-scientific-plotting-linux.html
|
||||
+
|
||||
+作者:[Joshua Reed][a]
|
||||
+译者:[ideas4u](https://github.com/ideas4u)
|
||||
+校对:[校对者ID](https://github.com/校对者ID)
|
||||
+
|
||||
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
+
|
||||
+[a]:http://xmodulo.com/author/joshua
|
||||
+[1]:http://xmodulo.com/numpy-scientific-computing-linux.html
|
||||
+[2]:http://matplotlib.org/
|
@ -0,0 +1,146 @@
|
||||
如何在 Ubuntu 14.04 里面配置 chroot 环境
|
||||
================================================================================
|
||||
你可能会有很多理由想要把一个应用、一个用户或者一个环境与你的 linux 系统隔离开来。不同的操作系统有不同的实现方式,而在 linux 中,一个典型的方式就是 chroot 环境。
|
||||
|
||||
在这份教程中,我会一步一步指导你怎么使用 chroot 命令去配置一个与真实系统分离出来的独立环境。这个功能主要可以用于测试项目,这些步骤都在 **Ubuntu 14.04** 虚拟专用服务器(VPS)上执行。
|
||||
|
||||
学会快速搭建一个简单的 chroot 环境是一项非常实用的技能,绝大多数系统管理员都能从中受益。
|
||||
|
||||
### Chroot 环境 ###
|
||||
|
||||
一个 chroot 环境就是通过系统调用,将一个本地目录临时变成根目录。一般所说的系统根目录就是挂载点"/",然而使用 chroot 命令后,你可以使用其它目录作为根目录。
|
||||
|
||||
原则上,任何运行在 chroot 环境内的应用都不能访问系统中其他信息(LCTT译注:使用 chroot 把一个目录变成根目录,在里面运行的应用只能访问本目录内的文件,无法访问到目录外的文件。然而,运行在 chroot 环境的应用可以通过 sysfs 文件系统访问到环境外的信息,所以,这里有个“原则上”的修饰语)。
|
||||
|
||||
### Chroot 环境的用处 ###
|
||||
|
||||
> - 测试一个不稳定的应用服务不会影响到整个主机系统。
|
||||
>
|
||||
> - 就算使用 root 权限做了些不当的操作,把 chroot 环境搞得一塌糊涂,也不会影响到主机系统。
|
||||
>
|
||||
> - 可以在你的系统中运行另外一个操作系统。
|
||||
|
||||
举个例子,你可以在 chroot 环境中编译、安装、测试软件,而不去动真实的系统。你也可以**在64位环境下使用 chroot 创建一个32位环境,然后运行一个32位的程序**(LCTT泽注:如果你的真实环境是32位的,那就不能 chroot 一个64位的环境了)。
|
||||
|
||||
但是 为了安全考虑,chroot 环境为非特权用户设立了非常严格的限制,而不是提供完整的安全策略。如果你需要的是有完善的安全策略的隔离方案,可以考虑下 LXC、Docker、vservers等等。
|
||||
|
||||
### Debootstrap 和 Schroot ###
|
||||
|
||||
使用 chroot 环境需要安装 **debootstrap** 和 **schroot**,这两个软件都在 Ubuntu 的镜像源中。其中 schroot 用于创建 chroot 环境。
|
||||
|
||||
**Debootstrap** 可以让你通过镜像源安装任何 Debian(或基于 Debian 的)系统,装好的系统会包含最基本的命令。
|
||||
|
||||
**Schroot** 命令允许用户使用相同的机制去创建 chroot 环境,但在访问 chroot 环境时会做些权限检查,并且会允许用户做些额外的自动设置,比如挂载一些文件系统。
|
||||
|
||||
在 Ubuntu 14.04 LTS 上,我们可以通过两步来实现这个功能:
|
||||
|
||||
### 1. 安装软件包 ###
|
||||
|
||||
第一步,在Ubuntu 14.04 LTS 主机系统上安装 debootstrap 和 schroot:
|
||||
|
||||
$ sudo apt-get install debootstrap
|
||||
$ sudo apt-get install schroot
|
||||
|
||||
### 2. 配置 Schroot ###
|
||||
|
||||
现在我们有工具在手,需要指定一个目录作为我们的 chroot 环境。这里创建一个目录先:
|
||||
|
||||
sudo mkdir /linoxide
|
||||
|
||||
编辑 schroot 的配置文件:
|
||||
|
||||
sudo nano /etc/schroot/schroot.conf
|
||||
|
||||
再提醒一下,我们现在是在 Ubuntu 14.04 LTS 系统上。如果我们想测试一个软件包能不能在 Ubuntu 13.10(代号是“Saucy Salamander”) 上运行,就可以在配置文件中添加下面的内容:
|
||||
|
||||
[saucy]
|
||||
description=Ubuntu Saucy
|
||||
location=/linoxide
|
||||
priority=3
|
||||
users=arun
|
||||
root-groups=root
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/12/schroot-config.png)
|
||||
|
||||
根据你的系统要求,调整上面的配置信息。
|
||||
|
||||
### 3. 使用 debootstrap 安装32位 Ubuntu 系统 ###
|
||||
|
||||
Debootstrap 命令会在你的 **chroot 环境**里面下载安装一个最小系统。只要你能访问镜像源,你就可以安装任何基于 Debian 的系统版本。
|
||||
|
||||
前面我们已经创建了 **/linoxide** 目录用于放置 chroot 环境,现在我们可以在这个目录里面运行 debootstrap 了:
|
||||
|
||||
cd /linoxide
|
||||
sudo debootstrap --variant=buildd --arch amd64 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/
|
||||
sudo chroot /linoxide /debootstrap/debootstrap --second-stage
|
||||
|
||||
你可以将 --arch 的参数换成 i386 或其他架构,只要存在这种架构的镜像源。你也可以把镜像源 http://archive.ubuntu.com/ubuntu/ 换成离你最近的镜像源,具体可参考 [Ubuntu 官方镜像主页][1]。
|
||||
|
||||
**注意:如果你是在64位系统中创建32位系统,你需要在上面第3行命令中加入 --foreign 选项,就像下面的命令:**
|
||||
|
||||
sudo debootstrap --variant=buildd --foreign --arch i386 saucy /linoxide/ http://archive.ubuntu.com/ubuntu/
|
||||
|
||||
下载需要一段时间,看你网络带宽性能。最小系统大概有500M。
|
||||
|
||||
### 4. 完成 chroot 环境 ###
|
||||
|
||||
安装完系统后,我们需要做一些收尾工作,确保系统运行正常。首先,保证主机的 fstab 程序能意识到 chroot 环境的存在:
|
||||
|
||||
sudo nano /etc/fstab
|
||||
|
||||
在文件最后面添加下面的配置:
|
||||
|
||||
proc /linoxide/proc proc defaults 0 0
|
||||
sysfs /linoxide/sys sysfs defaults 0 0
|
||||
|
||||
保存并关闭文件。
|
||||
|
||||
挂载一些文件系统到 chroot 环境:
|
||||
|
||||
$ sudo mount proc /linoxide/proc -t proc
|
||||
$ sudo mount sysfs /linoxide/sys -t sysfs
|
||||
|
||||
复制 /etc/hosts 文件到 chroot 环境,这样 chroot 环境就可以使用网络了:
|
||||
|
||||
$ sudo cp /etc/hosts /linoxide/etc/hosts
|
||||
|
||||
最后使用 schroot -l 命令列出系统上所有的 chroot 环境:
|
||||
|
||||
$ schroot -l
|
||||
|
||||
使用下面的命令进入 chroot 环境:
|
||||
|
||||
$ sudo chroot /linoxide/ /bin/bash
|
||||
|
||||
测试安装的版本:
|
||||
|
||||
# lsb_release -a
|
||||
# uname -a
|
||||
|
||||
为了在 chroot 环境中使用图形界面,你需要设置 DISPLAY 环境变量:
|
||||
|
||||
$ DISPLAY=:0.0 ./apps
|
||||
|
||||
目前为止,我已经成功地在 Ubuntu 14.04 LTS 上安装了 Ubuntu 13.10。
|
||||
|
||||
退出 chroot 环境:
|
||||
|
||||
# exit
|
||||
|
||||
清理一下,卸载文件系统:
|
||||
|
||||
$ sudo umount /test/proc
|
||||
$ sudo umount /test/sys
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/configure-chroot-environment-ubuntu-14-04/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[bazz2](https://github.com/bazz2)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://launchpad.net/ubuntu/+archivemirrors
|
@ -0,0 +1,111 @@
|
||||
系统性能优化支招:使用Ramlog将日志文件转移到RAM
|
||||
================================================================================
|
||||
Ramlog以系统守护进程的形式存在。它系统启动的时候创建了虚拟磁盘(ramdisk),将文件从目录/var/log复制到虚拟磁盘中,同时把虚拟磁盘挂载为/var/log。接着更新虚拟磁盘上所有的日志。硬盘上的日志会保留在目录/var/log中,直到ramlog重启或停止时被更新。而关机的时候,(ramdisk上的)日志文件会重新保存到硬盘上,以确保日志一致性。Ramlog 2.x默认使用tmpfs文件系统,同时也可以支持ramfs和内核ramdisk。使用rsync(译注:Linux数据镜像备份工具)这个工具来同步日志。
|
||||
|
||||
注意:没有保存进硬盘的日志将在断电或者内核混乱(kernel panic)的情况下丢失。
|
||||
|
||||
如果你拥有空间足够的可用内存,而又想把日志放进虚拟磁盘,就安装ramlog吧。它是笔记本用户、UPS系统或是直接在flash中运行的系统节省写周期的优良选择。
|
||||
|
||||
Ramlog的运行机制以及步骤:
|
||||
|
||||
1.Ramlog在第一个守护进程(这取决于你所安装过的其它守护进程)的基础上启动。
|
||||
|
||||
2.然后创建目录/var/log.hdd并将其硬链至/var/log。
|
||||
|
||||
3.如果使用的是tmpfs(默认)或者ramfs之一的文件系统,将其挂载到/var/log上。
|
||||
|
||||
而如果使用的是内核ramdisk,ramdisk将在/dev/ram9中创建,并将挂载至/var/log。默认情况下ramlog会占用所有ramdisk的内存,其大小由内核参数"ramdisk_size"指定。
|
||||
|
||||
5.接着其它的守护进程被启动,并在ramdisk中更新日志。Logrotate(译注:Linux日志轮替工具)也是在ramdiks之上运行。
|
||||
|
||||
6.重启(默认一天一次)ramlog时,目录/var/log.hdd将借助rsync与/var/log保持同步。日志自动保存的频率可以通过cron(译注:Linux例行性工作调度)来控制。默认情况下,ramlog文件放置在目录/etc/cron.daily下。
|
||||
|
||||
7.系统关机时,ramlog在最后一个守护进程关闭之前关闭。
|
||||
|
||||
在ramlog关闭期间,/var/log.hdd中的文件将被同步至/var/log,接着/var/log和/var/log.hdd都被卸载,然后删除空目录/var/log.hdd。
|
||||
|
||||
**注意:- 此文仅面向高级用户**
|
||||
|
||||
### 在Ubuntu中安装Ramlog ###
|
||||
|
||||
首先需要用以下命令,从[这里][1]下载.deb安装包:
|
||||
|
||||
wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
|
||||
|
||||
下载ramlog_2.0.0_all.deb安装包完毕,使用以下命令进行安装:
|
||||
|
||||
sudo dpkg -i ramlog_2.0.0_all.deb
|
||||
|
||||
这一步会完成整个安装,现在你需要运行以下命令:
|
||||
|
||||
sudo update-rc.d ramlog start 2 2 3 4 5 . stop 99 0 1 6 .
|
||||
|
||||
#现在,在初始状态下升级sysklogd,使之能在ramlog停止运行前正确关闭:
|
||||
|
||||
sudo update-rc.d -f sysklogd remove
|
||||
|
||||
sudo update-rc.d sysklogd start 10 2 3 4 5 . stop 90 0 1 6 .
|
||||
|
||||
然后重启系统:
|
||||
|
||||
sudo reboot
|
||||
|
||||
系统重启完毕,运行'ramlog getlogsize'获取/var/log的空间大小。在此基础之上多分配40%的空间,确保ramdisk有足够的空间(这整个都将作为ramdisk的空间大小)。
|
||||
|
||||
编辑引导配置文件,如/etc/grub.conf,、/boot/grub/menu.lst 或/etc/lilo.conf(译注:具体哪个配置文件视不同引导加载程序而定),kernel参数新增项'ramdisk_size=xxx'以更新当前内核,其中xxx是ramdisk的空间大小。
|
||||
|
||||
### 配置Ramlog ###
|
||||
|
||||
基于deb的系统中,Ramlog的配置文件位于/etc/default/ramlog,你可以在该目录下设置以下变量:
|
||||
|
||||
Variable (with default value):
|
||||
|
||||
Description:
|
||||
|
||||
RAMDISKTYPE=0
|
||||
# Values:
|
||||
# 0 -- tmpfs (can be swapped) -- default
|
||||
# 1 -- ramfs (no max size in older kernels,
|
||||
# cannot be swapped, not SELinux friendly)
|
||||
# 2 -- old kernel ramdisk
|
||||
TMPFS_RAMFS_SIZE=
|
||||
#Maximum size of memory to be used by tmpfs or ramfs.
|
||||
# The value can be percentage of total RAM or size in megabytes -- for example:
|
||||
# TMPFS_RAMFS_SIZE=40%
|
||||
# TMPFS_RAMFS_SIZE=100m
|
||||
# Empty value means default tmpfs/ramfs size which is 50% of total RAM.
|
||||
# For more options please check ‘man mount', section ‘Mount options for tmpfs'
|
||||
# (btw -- ramfs supports size limit in newer kernels
|
||||
# as well despite man says there are no mount options)
|
||||
# It has only effect if RAMDISKTYPE=0 or 1
|
||||
KERNEL_RAMDISK_SIZE=MAX
|
||||
#Kernel ramdisk size in kilobytes or MAX to use entire ramdisk.
|
||||
#It has only effect if RAMDISKTYPE=2
|
||||
LOGGING=1
|
||||
# 0=off, 1=on Logs can be found in /var/log/ramdisk
|
||||
LOGNAME=ramlog
|
||||
# name of the ramlog log file (makes sense if LOGGING=1)
|
||||
VERBOSE=1
|
||||
# 0=off, 1=on (if 1, teststartstop puts detials
|
||||
# to the logs and it is called after start or stop fails)
|
||||
|
||||
### 在Ubuntu中卸载ramlog ###
|
||||
|
||||
打开终端运行以下命令:
|
||||
|
||||
sudo dpkg -P ramlog
|
||||
|
||||
注意:如果ramlog卸载之前仍在运行,需要重启系统完成整个卸载工作。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/improve-system-performance-by-moving-your-log-files-to-ram-using-ramlog.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[soooogreen](https://github.com/soooogreen)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
|
81
translated/tech/20150128 Docker-1 Moving to Docker.md
Normal file
81
translated/tech/20150128 Docker-1 Moving to Docker.md
Normal file
@ -0,0 +1,81 @@
|
||||
Moving to Docker
|
||||
================================================================================
|
||||
![](http://cocoahunter.com/content/images/2015/01/docker1.jpeg)
|
||||
|
||||
[TL;DR] 这是系列的第一篇文章,这系列讲述了我的公司如何把基础服务从PaaS迁移到Docker上。如果你愿意,你可以直接跳过介绍(这篇文章)直接看技术相关的话题(链接在页面的底部)。
|
||||
|
||||
----------
|
||||
|
||||
上个月,我一直在折腾开发环境。这是我个人故事和经验,关于尝试用Docker简化Rails应用的部署过程。
|
||||
|
||||
当我在2012年创建我的公司 – [Touchware][1]时,我还是一个独立开发者。很多事情很小,不复杂,不他们需要很多维护,他们也不需要不部署到很多机器上。经过过去一年的发展,我们成长了很多(我们现在是是拥有10个人团队)而且我们的服务端的程序和API无论在范围和规模方面都有增长。
|
||||
|
||||
### 第1步 - Heroku ###
|
||||
|
||||
我们还是个小公司,我们需要让事情运行地尽可能平稳。当我们寻找可行的解决方案时,我们打算坚持用那些可以帮助我们减轻对硬件依赖负担的工具。由于我们主要开发Rails应用,而Heroku对RoR,常用的数据库和缓存(Postgres/Mongo/Redis等)有很好的支持,最明智的选择就是用[Heroku][2] 。我们就是这样做的。
|
||||
|
||||
Heroku有很好的技术支持和文档,使得部署非常轻松。唯一的问题是,当你处于起步阶段,你需要很多开销。这不是最好的选择,真的。
|
||||
|
||||
### 第2步 - Dokku ###
|
||||
|
||||
为了尝试并降低成本,我们决定试试Dokku。[Dokku][3],引用GitHub上的一句话
|
||||
|
||||
> Docker powered mini-Heroku in around 100 lines of Bash
|
||||
|
||||
我们启用的[DigitalOcean][4]上的很多台机器,都预装了Dokku。Dokku非常像Heroku,但是当你有复杂的项目需要调整配置参数或者是需要特殊的依赖时,它就不能胜任了。我们有一个应用,它需要对图片进行多次转换,我们无法安装一个适合版本的imagemagick到托管我们Rails应用的基于Dokku的Docker容器内。尽管我们还有很多应用运行在Dokku上,但我们还是不得不把一些迁移回Heroku。
|
||||
|
||||
### 第3步 - Docker ###
|
||||
|
||||
几个月前,由于开发环境和生产环境的问题重新出现,我决定试试Docker。简单来说,Docker让开发者容器化应用,简化部署。由于一个Docker容器本质上已经包含项目运行所需要的所有依赖,只要它能在你的笔记本上运行地很好,你就能确保它将也能在任何一个别的远程服务器的生产环境上运行,包括Amazon的EC2和DigitalOcean上的VPS。
|
||||
|
||||
Docker IMHO特别有意思的原因是:
|
||||
|
||||
- 它促进了模块化和分离关注点:你只需要去考虑应用的逻辑部分(负载均衡:1个容器;数据库:1个容器;web服务器:1个容器);
|
||||
- 在部署的配置上非常灵活:容器可以被部署在大量的HW上,也可以容易地重新部署在不同的服务器或者提供商那;
|
||||
- 它允许非常细粒度地优化应用的运行环境:你可以利用你的容器来创建镜像,所以你有很多选择来配置环境。
|
||||
|
||||
它也有一些缺点:
|
||||
|
||||
- 它的学习曲线非常的陡峭(这是从一个软件开发者的角度来看,而不是经验丰富的运维人员);
|
||||
- 搭建环境不简单,尤其是还需要自己搭建一个私有的registry/repository (后面有关于它的详细内容)。
|
||||
|
||||
下面是一些提示。这个系列的最后一周,我将把他们和一些新的放在一起。
|
||||
|
||||
----------
|
||||
|
||||
在下面的文章中,我们将看到如何建立一个半自动化的基于Docker的部署系统。
|
||||
|
||||
- [建立私有的Docker registry][6]
|
||||
- [配置Rails应用的半自动化话部署][7]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://cocoahunter.com/2015/01/23/docker-1/
|
||||
|
||||
作者:[Michelangelo Chasseur][a]
|
||||
译者:[mtunique](https://github.com/mtunique)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://cocoahunter.com/author/michelangelo/
|
||||
[1]:http://www.touchwa.re/
|
||||
[2]:http://cocoahunter.com/2015/01/23/docker-1/www.heroku.com
|
||||
[3]:https://github.com/progrium/dokku
|
||||
[4]:http://cocoahunter.com/2015/01/23/docker-1/www.digitalocean.com
|
||||
[5]:http://www.docker.com/
|
||||
[6]:http://cocoahunter.com/2015/01/23/docker-2/
|
||||
[7]:http://cocoahunter.com/2015/01/23/docker-3/
|
||||
[8]:
|
||||
[9]:
|
||||
[10]:
|
||||
[11]:
|
||||
[12]:
|
||||
[13]:
|
||||
[14]:
|
||||
[15]:
|
||||
[16]:
|
||||
[17]:
|
||||
[18]:
|
||||
[19]:
|
||||
[20]:
|
@ -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/) 荣誉推出
|
@ -1,14 +1,14 @@
|
||||
Linux Basics: Assign Multiple IP Addresses To Single Network Interface Card On CentOS 7
|
||||
Linux 基础:在CentOS 7上给一个网卡分配多个IP地址
|
||||
================================================================================
|
||||
Some times you might want to use more than one IP address for your network interface card. What are you going to do? Buy an extra network card and assign new IP? No, It’s not necessary(atleast in the small networks). We can now assign multiple ip addresses to single network interface card in CentOS / RHEL 7 systems. Curious to know how? Well, Follow me, It is not that difficult.
|
||||
有时你也许想要给一个网卡多个地址。你该怎么做呢?另外买一个网卡来分配地址?不用这么做(只要在小型网络中)。我们现在可以再CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么?好的,跟随我,这并不难。
|
||||
|
||||
First, let us find the IP address of the network card. In my CentOS 7 server, I use only one network card.
|
||||
首先,让我们找到网卡的IP地址。在我的CentOS 7服务器中,我只使用了一个网卡。
|
||||
|
||||
Run the following command with root user privileges:
|
||||
用root特权运行下面的命令:
|
||||
|
||||
ip addr
|
||||
|
||||
Sample output:
|
||||
示例输出:
|
||||
|
||||
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
|
||||
@ -21,15 +21,15 @@ Sample output:
|
||||
inet 192.168.1.150/24 brd 192.168.1.255 scope global enp0s3
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
As you see in the above output, my network card name is enp0s3, and its IP address is 192.168.1.150.
|
||||
如上所见,我的网卡名是enp0s3,ip地址是192.168.1.150。
|
||||
|
||||
Well, as you may know, the the network card configuration files of your system is stored under **/etc/sysconfig/network-scripts/** directory. Each cards details will be stored in different names, for example **ifcfg-enp0s3**.
|
||||
如你所知,网卡的配置文件存储在 **/etc/sysconfig/network-scripts/** 目录下。每个网卡的详细内容将会以不同的名字存储,比如**ifcfg-enp0s3**。
|
||||
|
||||
Let us see the details of **ifcfg-enp0s3**.
|
||||
让我们看下**ifcfg-enp0s3**的细节。
|
||||
|
||||
cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
||||
|
||||
Sample output:
|
||||
示例输出:
|
||||
|
||||
TYPE="Ethernet"
|
||||
BOOTPROTO="none"
|
||||
@ -50,13 +50,13 @@ Sample output:
|
||||
IPV6_PEERDNS="yes"
|
||||
IPV6_PEERROUTES="yes"
|
||||
|
||||
Okay, now we will assign multiple addresses in the same subnet.
|
||||
好的,现在我们将在相同的子网中分配多个地址了。
|
||||
|
||||
Edit file **/etc/sysconfig/network-scripts/ifcfg-enp0s3**:
|
||||
编辑文件 **/etc/sysconfig/network-scripts/ifcfg-enp0s3**:
|
||||
|
||||
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
||||
|
||||
Add extra IP addresses one by one as shown below.
|
||||
像下面那样加入额外的IP地址。
|
||||
|
||||
TYPE="Ethernet"
|
||||
BOOTPROTO="none"
|
||||
@ -79,19 +79,20 @@ Add extra IP addresses one by one as shown below.
|
||||
IPV6_PEERDNS="yes"
|
||||
IPV6_PEERROUTES="yes"
|
||||
|
||||
As you see above, I have added two more IP addresses: **IPADDR1=”192.168.1.151″ & IPADDR2=”192.168.1.152″**
|
||||
如你所见,我已经加了两个IP地址:**IPADDR1=”192.168.1.151″ & IPADDR2=”192.168.1.152″**
|
||||
|
||||
Like wise, you can add as many a IP addresses you want.
|
||||
类似地,你可以加入更多的ip地址。
|
||||
|
||||
Finally, save and close the file. Restart network service to take effect the changes.
|
||||
最后,保存并退出文件。重启网络服务来使更改生效。
|
||||
|
||||
systemctl restart network
|
||||
|
||||
Now, let us check the IP addresses have been added or not.
|
||||
现在,让我们检查是否已经加入了ip地址。
|
||||
|
||||
ip addr
|
||||
|
||||
Sample output:
|
||||
示例输出:
|
||||
|
||||
: 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
|
||||
@ -110,13 +111,13 @@ Sample output:
|
||||
inet6 fe80::a00:27ff:fe3f:ab68/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
As you see above, the single network interface card has three IP addresses.
|
||||
如你所见,单个网卡已经有3个ip地址了。
|
||||
|
||||
Let us ping the newly added IP addresses:
|
||||
让我们ping一下新增的IP地址:
|
||||
|
||||
ping -c 4 192.168.1.151
|
||||
|
||||
Sample output:
|
||||
示例输出:
|
||||
|
||||
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
|
||||
@ -132,7 +133,7 @@ Sample output:
|
||||
|
||||
ping -c 4 192.168.1.152
|
||||
|
||||
Sample output:
|
||||
示例输出:
|
||||
|
||||
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
|
||||
@ -144,9 +145,9 @@ Sample output:
|
||||
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
|
||||
rtt min/avg/max/mdev = 0.034/0.064/0.075/0.018 ms
|
||||
|
||||
If you want to use **different subnet**, then you can change the **PREFIX0=24** line to different subnet, such as **PREFIX1=16**.
|
||||
如果你想要使用**不同的子网**,你要改变**PREFIX0=24**成不同的子网,比如 **PREFIX1=16**。
|
||||
|
||||
For example, I am going to add Class A IP address(**ex.10.0.0.1**) to my network card.
|
||||
比如,我想要添加一个A类地址(**比如10.0.0.1*)到我的网卡中。
|
||||
|
||||
TYPE="Ethernet"
|
||||
BOOTPROTO="none"
|
||||
@ -171,15 +172,15 @@ For example, I am going to add Class A IP address(**ex.10.0.0.1**) to my network
|
||||
IPV6_PEERDNS="yes"
|
||||
IPV6_PEERROUTES="yes"
|
||||
|
||||
Do you notice that I have added a Class A type address(10.0.0.1) and prefix=16.
|
||||
你可以看到我已经添加一个A类地址(10.0.0.1)并且前缀是16
|
||||
|
||||
Save and close the file. Restart network service,
|
||||
保存并退出文件。重启网络服务,
|
||||
|
||||
Then, ping the new added IP:
|
||||
接着,ping新增的地址:
|
||||
|
||||
ping -c 4 10.0.0.1
|
||||
|
||||
Sample output:
|
||||
示例输出:
|
||||
|
||||
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
|
||||
@ -191,18 +192,18 @@ Sample output:
|
||||
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
|
||||
rtt min/avg/max/mdev = 0.073/0.079/0.097/0.014 ms
|
||||
|
||||
Similarly, you can add different Gateways too.
|
||||
相似地,你可以添加不同的网关。
|
||||
|
||||
That’s it.
|
||||
就是这样。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-network-interface-card-centos-7/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.unixmen.com/author/sk/
|
||||
[a]:http://www.unixmen.com/author/sk/
|
@ -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/
|
@ -0,0 +1,101 @@
|
||||
在Ubuntu14.10/Mint7上安装Gnome Flashback classical桌面
|
||||
================================================================================
|
||||
如果你不喜欢现在的Unity桌面,[Gnome Flashback][1]桌面环境是一个简单的并且很棒的选择,让你能找回曾经经典的桌面。
|
||||
|
||||
Gnome Flashback基于GTK3并提供与原先gnome桌面视觉上相似的界面。
|
||||
|
||||
gnome flashback的另一个改变是采用了源自mint和xface的MATE桌面,但无论mint还是xface都是基于gtk2的。
|
||||
|
||||
### 安装 Gnome Flashback ###
|
||||
|
||||
在你的ubuntu上安装以下包即可:
|
||||
|
||||
$ sudo apt-get install gnome-session-flashback
|
||||
|
||||
然后注销到达登录界面,单击密码输入框右上角的徽标型按钮,即可选择桌面环境。可供选择的有Gnome Flashback (Metacity) 会话模式和Gnome Flashback (Compiz)会话模式。
|
||||
|
||||
Metacity更轻更快,而Compiz则能带给你更棒的桌面效果。下面是我使用gnome flashback桌面的截图。
|
||||
|
||||
桌面采用了elementary OS的壁纸和Plank dock并且移除了底部面板。这些都会在这篇教程中涉及到。
|
||||
|
||||
![ubuntu gnome flashback](http://www.binarytides.com/blog/wp-content/uploads/2015/02/ubuntu-gnome-flashback.png)
|
||||
|
||||
在安装好gnome flashback桌面以后也许你对效果还不满意,这样你可能需要执行接下来的一系列操作来对它进行微调。
|
||||
|
||||
### 1. 安装 Gnome Tweak Tool ###
|
||||
|
||||
Gnome Tweak Tool能够帮助你定制比如字体、主题等,那些在Unity桌面的控制中心十分困难或是不可能完成的任务。
|
||||
|
||||
$ sudo apt-get install gnome-tweak-tool
|
||||
|
||||
启动按步骤 应用程序 > 系统工具 > 首选项 > Tweak Tool
|
||||
|
||||
### 2. 在面板上添加小应用 ###
|
||||
|
||||
默认的右键点击面板是没有效果的。你可以尝试在右键点击面板的同时按住键盘上的Alt+Super (win)键,这样定制面板的相关选项将会出现。
|
||||
|
||||
你可以修改或删除面板并在上面添加些小应用。在这个例子中我们移除了底部面板,并用Plank dock来代替它的位置。
|
||||
|
||||
在顶部面板的中间添加一个显示时间的小应用。通过配置使它显示时间和天气。
|
||||
|
||||
同样的添加一个工作空间切换器到顶部面板,并创建合适个数的工作空间。
|
||||
|
||||
### 3. 将窗口标题栏的按钮右置 ###
|
||||
|
||||
在ubuntu中,最小化、最大化和关闭按钮默认实在标题栏的左侧的。需要稍作手脚才能让他们乖乖回到右边去。
|
||||
|
||||
想让窗口的按钮到右边可以使用下面的命令,这是我在askubuntu上找到的。
|
||||
|
||||
$ gsettings set org.gnome.desktop.wm.preferences button-layout 'menu:minimize,maximize,close'
|
||||
|
||||
### 4.安装 Plank dock ###
|
||||
|
||||
plank dock位于屏幕底部用于启动应用和切换打开的窗口。会在必要的时间隐藏自己,并在需要的时候出现。elementary OS使用的dock就是plank dock。
|
||||
|
||||
运行以下命令安装:
|
||||
|
||||
$ sudo add-apt-repository ppa:ricotz/docky -y
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install plank -y
|
||||
|
||||
现在启动 应用程序 > 附件 > Plank。若想让它开机自动启动,找到 应用程序 > 系统工具 > 首选项 > 启动应用程序 并将“plank”的命令加到列表中。
|
||||
|
||||
### 5. 安装 Conky 系统监视器 ###
|
||||
|
||||
Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰桌面。它不太占资源并且运行的大部分时间都不惹麻烦。
|
||||
|
||||
运行如下命令安装:
|
||||
|
||||
$ sudo apt-add-repository -y ppa:teejee2008/ppa
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install conky-manager
|
||||
|
||||
现在启动 应用程序 > 附件 > Conky Manager 选择你想在桌面上显示的部件。Conky Manager同样可以配置到启动项中。
|
||||
|
||||
### 6. 安装CCSM ###
|
||||
|
||||
如果你更愿意使用Gnome Flashback (Compiz),那么CCSM将是你配置桌面特效的得力助手。
|
||||
|
||||
运行以下命令安装:
|
||||
|
||||
$ sudo apt-get install compizconfig-settings-manager
|
||||
|
||||
启动按步骤 应用程序 > 系统工具 > 首选项 > CompizConfig Settings Manager.
|
||||
|
||||
|
||||
>在虚拟机中经常会发生compiz会话中装饰窗口消失。可以通过启动Compiz设置,在打开"Copy to texture",注销后重新登录即可。
|
||||
|
||||
不过值得一提的是Compiz 会话会比Metacity慢。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.binarytides.com/install-gnome-flashback-ubuntu/
|
||||
|
||||
作者:[Silver Moon][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117145272367995638274/posts
|
||||
[1]:https://wiki.gnome.org/action/show/Projects/GnomeFlashback?action=show&redirect=GnomeFlashback
|
@ -0,0 +1,91 @@
|
||||
Linux 有问必答:如何在Linux 中修复“fatal error: x264.h: No such file or directory”的错误
|
||||
================================================================================
|
||||
> **提问**: 我想在Linux中从源码编译视频编码程序。到那时,在编译时,我遇到了一个错误“fatal error: x264.h: No such file or directory”,我该如何修复?
|
||||
|
||||
下面的编译错误错明你系统中没有x264开发库文件。
|
||||
|
||||
fatal error: x264.h: No such file or directory
|
||||
|
||||
[x264][1]是GNU GPL授权的H.264/MPEG-4 AVC编码库。x264库被广泛用于视频编码/转码程序比如Avidemux、[FFmpeg][2]、 [HandBrake][3]、 OpenShot、 MEncode等等。
|
||||
|
||||
要解决这个问题,你需要安装x264的开发库文件。你可以这么做。
|
||||
|
||||
###在 Debian、 Ubuntu 或者 Linux Mint 中安装像x264库和开发文件 ###
|
||||
|
||||
在基于Debian的系统中,x264库已经包含在基础仓库中。可以直接用apt-get来安装。
|
||||
|
||||
$ sudo apt-get install libx264-dev
|
||||
|
||||
### 在 Fedora、 CentOS/RHEL中安装像x264库和开发文件 ###
|
||||
|
||||
在基于Red Hat的发行版比如Fedora或者CentOS,x264库在免费的RPM Fusion仓库中有。那么,你需要首先安装[RPM Fusion (免费)][4] 。
|
||||
|
||||
RPM Fusion设置完成后,你可以使用下面的命令安装x264开发文件。
|
||||
|
||||
$ sudo yum --enablerepo=rpmfusion-free install x264-devel
|
||||
|
||||
注意RPM Fusion仓库在CentOS 7中还没有,因此上面的方法在CentOS 7中还不可行。万一是CentOS 7 ,你可以从源码编译并安装x264,下面会解释的。
|
||||
|
||||
### 在Debian、 Ubuntu 或者 Linux Mint中源码编译x264库 ###
|
||||
|
||||
如果libx264包在你的发行版中并没有,那么你可以按照下面的方法编译最新的x264库。
|
||||
|
||||
$ sudo apt-get install g++ automake autoconf libtool yasm nasm git
|
||||
$ git clone git://git.videolan.org/x264.git
|
||||
$ cd x264
|
||||
$ ./configure --enable-static --enable-shared
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
x264库将会安装在/usr/local/lib。要让其他程序可以使用这个库,你需要完成最后一步。
|
||||
|
||||
打开/etc/ld.so.conf,并添加下面的行。
|
||||
|
||||
$ sudo vi /etc/ld.so.conf
|
||||
|
||||
----------
|
||||
|
||||
/usr/local/lib
|
||||
|
||||
最后运行下面的命令重新加载共享库:
|
||||
|
||||
$ sudo ldconfig
|
||||
|
||||
### 在 Fedora, CentOS/RHEL 中源码编译x264库 ###
|
||||
|
||||
如果你Linux的发行版中没有x264库(比如:CentOS 7)或者x264库并不是最新的,你可以如下编译最新的x264库。
|
||||
|
||||
$ sudo yum install gcc gcc-c++ automake autoconf libtool yasm nasm git
|
||||
$ git clone git://git.videolan.org/x264.git
|
||||
$ cd x264
|
||||
$ ./configure --enable-static --enable-shared
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
最后,要让其他的程序可以访问到位于 /usr/local/lib的x264库,在 /etc/ld.so.conf加入下面的行。
|
||||
|
||||
$ sudo vi /etc/ld.so.conf
|
||||
|
||||
----------
|
||||
|
||||
/usr/local/lib
|
||||
|
||||
最后运行下面的命令重新加载共享库:
|
||||
|
||||
$ sudo ldconfig
|
||||
|
||||
![](https://farm8.staticflickr.com/7350/16453197512_7c18c5c09e_b.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/fatal-error-x264-h-no-such-file-or-directory.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.videolan.org/developers/x264.html
|
||||
[2]:http://ask.xmodulo.com/compile-ffmpeg-centos-fedora-rhel.html
|
||||
[3]:http://xmodulo.com/how-to-install-handbrake-on-linux.html
|
||||
[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html
|
@ -0,0 +1,44 @@
|
||||
如何让Ubuntu服务器远离鬼影漏洞影响
|
||||
================================================================================
|
||||
2015年1月27日,GNU C库(glibc)的一个漏洞也称鬼影漏洞被公诸于众。总的来说,这个漏洞允许远程攻击者利用glibc中的GetHOST函数的缓冲区溢出漏洞来获得系统的完全控制。点击[这里][1]获得更多细节。
|
||||
|
||||
鬼影漏洞可在版本在glibc-2.18之前的Linux系统上被利用。也就是说没有打过补丁的版本2.2到2.17都是有风险的。
|
||||
|
||||
### 检查系统漏洞 ###
|
||||
|
||||
你可以使用下面的命令来检查glib的版本
|
||||
|
||||
ldd --version
|
||||
|
||||
### 输出 ###
|
||||
|
||||
ldd (Ubuntu GLIBC 2.19-10ubuntu2) **2.19**
|
||||
Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
Written by Roland McGrath and Ulrich Drepper.
|
||||
|
||||
glib的版本应该高于2.17,我们的输出是2.19。如果你看到glib的版本在2.2到2.17之间。你应该运行下面的命令。
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get dist-upgrade
|
||||
|
||||
安装完之后,你应该用下面的命令重启系统。
|
||||
|
||||
sudo reboot
|
||||
|
||||
重启完成之后,你可以用同样的命令来检查glib的版本。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/how-to-protect-ubuntu-server-against-the-ghost-vulnerability.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://chargen.matasano.com/chargen/2015/1/27/vulnerability-overview-ghost-cve-2015-0235.html
|
Loading…
Reference in New Issue
Block a user