Merge pull request #1 from LCTT/master

更新 20150328
This commit is contained in:
Chang Liu 2015-03-28 21:55:52 +08:00
commit 32dd4baae0
113 changed files with 7005 additions and 3109 deletions

View File

@ -0,0 +1,170 @@
如何使用 fail2ban 防御 SSH 服务器的暴力破解攻击
================
对于SSH服务的常见的攻击就是暴力破解攻击——远程攻击者通过不同的密码来无限次地进行登录尝试。当然SSH可以设置使用非密码验证验证方式来对抗这种攻击例如[公钥验证][1]或者[双重验证][2]。将不同的验证方法的优劣处先放在一边,如果我们必须使用密码验证方式怎么办?你是如何保护你的 SSH 服务器免遭暴力破解攻击的呢?
[fail2ban][3] 是 Linux 上的一个著名的入侵保护的开源框架,它会监控多个系统的日志文件(例如:/var/log/auth.log 或者 /var/log/secure并根据检测到的任何可疑的行为自动触发不同的防御动作。事实上fail2ban 在防御对SSH服务器的暴力密码破解上非常有用。
在这篇指导教程中,我会演示**如何安装并配置 fail2ban 来保护 SSH 服务器以避免来自远程IP地址的暴力攻击**。
###在linux上安装Fail2ban
为了在CentOS 或 RHEL上安装fail2ban,首先[设置EPEL仓库][4],然后运行以下命令。
$ sudo yum install fail2ban
在Fedora上安装fail2ban简单地运行以下命令
$ sudo yum install fail2ban
在ubuntuDebian 或 Linux Mint上安装fail2ban
$ sudo apt-get install fail2ban
### 为SSH服务器配置Fail2ban
现在你已经准备好了通过配置 fail2ban 来加强你的SSH服务器。你需要编辑其配置文件 /etc/fail2ban/jail.conf。 在配置文件的“[DEFAULT]”区你可以在此定义所有受监控的服务的默认参数另外在特定服务的配置部分你可以为每个服务例如SSHApache等设置特定的配置来覆盖默认的参数配置。
在针对服务的监狱区(在[DEFAULT]区后面的地方),你需要定义一个[ssh-iptables]区这里用来定义SSH相关的监狱配置。真正的禁止IP地址的操作是通过iptables完成的。
下面是一个包含“ssh-iptables”监狱配置的/etc/fail2ban/jail.conf的文件样例。当然根据你的需要你也可以指定其他的应用监狱。
$ sudo vi /etc/fail2ban/jail.local
```
[DEFAULT]
# 以空格分隔的列表,可以是 IP 地址、CIDR 前缀或者 DNS 主机名
# 用于指定哪些地址可以忽略 fail2ban 防御
ignoreip = 127.0.0.1 172.31.0.0/24 10.10.0.0/24 192.168.0.0/24
# 客户端主机被禁止的时长(秒)
bantime = 86400
# 客户端主机被禁止前允许失败的次数
maxretry = 5
# 查找失败次数的时长(秒)
findtime = 600
mta = sendmail
[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
sendmail-whois[name=SSH, dest=your@email.com, sender=fail2ban@email.com]
# Debian 系的发行版
logpath = /var/log/auth.log
# Red Hat 系的发行版
logpath = /var/log/secure
# ssh 服务的最大尝试次数
maxretry = 3
```
根据上述配置fail2ban会自动禁止在最近10分钟内有超过3次访问尝试失败的任意IP地址。一旦被禁这个IP地址将会在24小时内一直被禁止访问 SSH 服务。这个事件也会通过sendemail发送邮件通知。
一旦配置文件准备就绪按照以下方式重启fail2ban服务。
在 Debian, Ubuntu 或 CentOS/RHEL 6:
$ sudo service fail2ban restart
在 Fedora 或 CentOS/RHEL 7:
$ sudo systemctl restart fail2ban
为了验证fail2ban成功运行使用参数'ping'来运行fail2ban-client 命令。 如果fail2ban服务正常运行你可以看到“pong”作为响应。
$ sudo fail2ban-client ping
Server replied: pong
### 测试 fail2ban 保护SSH免遭暴力破解攻击
为了测试fail2ban是否能正常工作尝试通过使用错误的密码来用SSH连接到服务器模拟一个暴力破解攻击。与此同时监控 /var/log/fail2ban.log该文件记录在fail2ban中发生的任何敏感事件。
$ sudo tail -f /var/log/fail2ban.log
![](https://farm8.staticflickr.com/7550/15882084127_fccf9ca7b7_c.jpg)
根据上述的日志文件Fail2ban通过检测IP地址的多次失败登录尝试禁止了一个IP地址192.168.1.8。
###检查fail2ban状态并解禁被锁住的IP地址
由于fail2ban的“ssh-iptables”监狱使用iptables来阻塞问题IP地址你可以通过以下方式来检测当前iptables来验证禁止规则。
$ sudo iptables --list -n
```
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-SSH tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain fail2ban-SSH (1 references)
target prot opt source destination
DROP all -- 192.168.1.8 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
```
如果你想要从fail2ban中解锁某个IP地址你可以使用iptables命令
$ sudo iptables -D fail2ban-SSH -s 192.168.1.8 -j DROP
当然你可以使用上述的iptables命令手动地检验和管理fail2ban的IP阻塞列表但实际上有一个适当的方法就是使用fail2ban-client命令行工具。这个命令不仅允许你对"ssh-iptables"监狱进行管理同时也是一个标准的命令行接口可以管理其他类型的fail2ban监狱。
为了检验fail2ban状态会显示出当前活动的监狱列表
$ sudo fail2ban-client status
为了检验一个特定监狱的状态例如ssh-iptables):
$ sudo fail2ban-client status ssh-iptables
上面的命令会显示出被禁止IP地址列表。
![](https://farm8.staticflickr.com/7497/16067847655_021d23e320_b.jpg)
为了解锁特定的IP地址
$ sudo fail2ban-client set ssh-iptables unbanip 192.168.1.8
![](https://farm8.staticflickr.com/7465/16065915571_b215a8b344_b.jpg)
注意如果你停止了Fail2ban 服务那么所有的IP地址都会被解锁。当你重启 Fail2ban它会从/etc/log/secure(或 /var/log/auth.log)中找到异常的IP地址列表如果这些异常地址的发生时间仍然在禁止时间内那么Fail2ban会重新将这些IP地址禁止。
### 设置 Fail2ban 自动启动
一旦你成功地测试了fail2ban之后最后一个步骤就是在你的服务器上让其在开机时自动启动。在基于Debian的发行版中fail2ban已经默认让自动启动生效。在基于Red-Hat的发行版中按照下面的方式让自动启动生效。
在 CentOS/RHEL 6中:
$ sudo chkconfig fail2ban on
在 Fedora 或 CentOS/RHEL 7:
$ sudo systemctl enable fail2ban
### 总结
在该教程中我演示了如何安装并配置fail2ban来保护一个SSH服务器。当然fail2ban可以缓解暴力密码攻击但是请注意这并不能保护SSH服务器避免来自复杂的分布式暴力破解组织这些攻击者通过使用成千上万个机器控制的IP地址来绕过fail2ban的防御机制。
-----------
via: http://xmodulo.com/how-to-protect-ssh-server-from-brute-force-attacks-using-fail2ban.html
作者:[Dan Nanni][a]
译者:[theo-l](https://github.com/theo-l)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html
[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html
[3]:http://www.fail2ban.org/
[4]:http://linux.cn/article-2324-1.html

View File

@ -1,5 +1,4 @@
Tomahawk音乐播放器带着新形象、新功能回来了
新面孔、新功能的 Tomahawk 音乐播放器
================================================================================
**在悄无声息得过了一年之后Tomahawk——音乐播放器中的瑞士军刀——带着值得歌颂的全新发行版回归了。 **
@ -9,35 +8,35 @@ Tomahawk音乐播放器带着新形象、新功能回来了
### Tomahawk——两个世界的极品 ###
Tomahawk嫁给了一个带有我们的“即时”现代文化的传统应用结构。它可以浏览和播放本地的音乐和Spotify、Grooveshark以及SoundCloud这类的线上音乐。在最新的发行版中它把Google Play Music和Beats Music列入了它的名册。
Tomahawk 将一个传统的应用结构与我们的“即时”现代文化相结合。它可以浏览和播放本地的音乐和Spotify、Grooveshark以及SoundCloud这类的线上音乐。在最新的发行版中它把Google Play Music和Beats Music列入了它的名册。
这可能听着很繁复或令人困惑,但实际上它表现得出奇的好。
若你想要播放一首歌而且不介意它是从哪里来的你只需告诉Tomahawk音乐的标题和作者它就会自动从可获取的源里找出高品质版本的音乐——你不需要做任何事。
若你想要播放一首歌而且不介意它是从哪里来的你只需告诉Tomahawk这个音乐的标题和作者,它就会自动从可获取的源里找出高品质版本的音乐——你不需要做任何事。
![](http://i.imgur.com/nk5oixy.jpg)
这个应用还弄了一些附加的功能比如EchoNest剖析Last.fm建议还有对Jabber的支持这样你就能‘播放’朋友的音乐。它还有一个内置的信息服务,以便于你能和其他人快速的分享播放列表和音乐。
这个应用还弄了一些附加的功能比如EchoNest剖析Last.fm建议还有对Jabber的支持这样你就能“播放”朋友的音乐。它还有一个内置的信息服务,以便于你能和其他人快速的分享播放列表和音乐。
>“这种从根本上就与众不同的听音乐的方式,开启了前所未有的音乐的消费和分享体验”,项目的网站上这样写道。而且即便它如此独特,这也没有错。
>“这种从根本上就与众不同的听音乐的方式,开启了前所未有的音乐的消费和分享体验”,项目的网站上这样写道。而且即便它如此独特,这也没有错。
![Tomahawk supports the Sound Menu](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/tomahawk-controllers.jpg)
支持声音菜单
*支持声音菜单*
### Tomahawk0.8发行版的亮点 ###
- 新的交互界面
- 对Beats Music的支持
- 对Google Play Music的支持保存的和播放全部链接
- 对拖拽iTunesSpotify这类网站的链接的支持
- 支持拖拽iTunesSpotify这类网站的链接
- 正在播放的提示
- Android应用测试版
- 收件箱的改进
### 在Ubuntu上安装Tomahawk0.8 ###
作为一个流媒体音乐的大用户,我会在接下来的几天里体验一下这个应用软件,然后提供一个关于他的改变的更全面的赏析。与此同时,你也可以尝尝鲜。
作为一个流媒体音乐的粉丝,我会在接下来的几天里体验一下这个应用软件,然后提供一个关于他的改变的更全面的赏析。与此同时,你也可以尝尝鲜。
在Ubuntu 14.04 LTS和Ubuntu 14.10上可以通过官方PPA获得Tomahawk。
@ -47,7 +46,7 @@ Tomahawk嫁给了一个带有我们的“即时”现代文化的传统应用结
在官方项目网站上可以找的独立安装程序和更详细的信息。
- [Visit the Official Tomahawk Website][1]
- [访问 Tomahawk 官网][1]
--------------------------------------------------------------------------------
@ -55,7 +54,7 @@ via: http://www.omgubuntu.co.uk/2014/11/tomahawk-media-player-returns-new-look-f
作者:[Joey-Elijah Sneddon][a]
译者:[H-mudcup](https://github.com/H-mudcup)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -2,29 +2,28 @@
================================================================================
![](http://techarena51.com/wp-content/uploads/2014/12/python-logo.png)
无论你在linux上娱乐还是工作这对你而言都是一个很好的机会使用python来编程。回到大学我希望他们教我的是Python而不是Java这学起来很有趣且在实际的应用如yum包管理器中很有用。
无论你在linux上娱乐还是工作这对你而言都是一个使用python来编程的很好的机会。回到大学我希望他们教我的是Python而不是Java这学起来很有趣且在实际的应用如yum包管理器中很有用。
本篇教程中我会带你使用python和一个称为flask的微型框架来构建一个简单的应用来显示诸如[每个进程的内存使用][1]CPU百分比之类有用的信息。
本篇教程中我会带你使用python和一个称为flask的微型框架来构建一个简单的应用来显示诸如[每个进程的内存使用][1]CPU百分比之类有用的信息。
### 前 ###
### 前置需求 ###
Python基础、列表、类、函数、模块。
HTML/CSS (基础)
Python基础、列表、类、函数、模块。HTML/CSS (基础)。
学习这篇教程你不必是一个python高级开发者但是首先我建议你阅读https://wiki.python.org/moin/BeginnersGuide/NonProgrammers。
学习这篇教程你不必是一个python高级开发者但是首先我建议你阅读 https://wiki.python.org/moin/BeginnersGuide/NonProgrammers
### I在Linux上安装Python 3 ###
### 在Linux上安装Python 3 ###
在大多数Linux发行版上Python是默认安装的。下面的你命令可以让你看到安装的版本。
[root@linux-vps ~]# python -V
Python 2.7.5
我们会使用3.x的版本来构建我们的app。根据[Python.org][2]所说,这版本上面所有的改进都不向后兼容Python 2。
我们会使用3.x的版本来构建我们的app。根据[Python.org][2]所说,现在只对这个版本进行改进,而且不向后兼容Python 2。
**注意**: 在开始之前我强烈建议你在虚拟机中尝试这个教程因为Python许多Linux发行版的核心组建,任何意外都可能会损坏你的系统。
**注意**: 在开始之前我强烈建议你在虚拟机中尝试这个教程因为Python是许多Linux发行版的核心组件,任何意外都可能会损坏你的系统。
这步是基于红帽的版本如CentOS6和7基于Debian的版本如UbuntuMint和Resbian可以跳过这步Pythonn 3应该默认已经安装了。如果没有安装请用apt-get而不是yum来安装下面相应的包。
以下步骤是基于红帽的版本如CentOS6和7基于Debian的版本如UbuntuMint和Resbian可以跳过这步Pythonn 3应该默认已经安装了。如果没有安装请用apt-get而不是yum来安装下面相应的包。
[leo@linux-vps] yum groupinstall 'Development Tools'
[leo@linux-vps] yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
@ -33,7 +32,7 @@ HTML/CSS (基础)
[leo@linux-vps] cd Python-3.4.2
[leo@linux-vps] ./configure
[leo@linux-vps] make
# make altinstall is recommended as make install can overwrite the current python binary,
# 推荐使用 make altinstall 以覆盖当前的 python 库
[leo@linux-vps] make altinstall
成功安装后你应该可以用下面的命令进入Python3.4的shell了。
@ -48,21 +47,19 @@ HTML/CSS (基础)
Python有它自己的包管理去与yum和apt-get相似。你将需要它来下载、安装和卸载包。
[leo@linux-vps] pip3.4 install "packagename"
[leo@linux-vps] pip3.4 install "packagename"
[leo@linux-vps] pip3.4 list
[leo@linux-vps] pip3.4 uninstall "packagename"
### Python虚拟环境 ###
在Python中虚拟环境是一个你项目依赖的目录。隔离项目的一个好主意是使用不同的依赖。这可以让你不用sudo命令就能安装包。
在Python中虚拟环境是一个放置你的项目的依赖环境的目录。这是一个将带有不同的依赖环境的项目隔离的好办法。它可以让你不用sudo命令就能安装包。
[leo@linux-vps] mkdir python3.4-flask
[leo@linux-vps] cd python3.4-flask
[leo@linux-vps python3.4-flask] pyvenv-3.4 venv
要创建虚拟环境你需要使用“pyvenv-3.4”命令。会在venv文件夹的内部创建一个名为lib的目录这里会安装项目所依赖的包。这里同样会创建一个bin文件夹容纳该环境下的pip和python可执行文件。
要创建虚拟环境你需要使用“pyvenv-3.4”命令。上述命令会在venv文件夹的内部创建一个名为lib的目录这里会安装项目所依赖的包。这里同样会创建一个bin文件夹容纳该环境下的pip和python可执行文件。
### 为我们的Linux系统信息项目激活虚拟环境 ###
@ -74,21 +71,21 @@ Python有它自己的包管理去与yum和apt-get相似。你将需要它来
### 使用pip安装flask ###
让我们继续安装第一个模块flask框架它可以处理路由和渲染我们app的模板。
让我们继续安装第一个模块flask框架它可以处理访问路由和渲染显示我们app的模板。
[leo@linux-vps python3.4-flask]pip3.4 install flask
### 在flask中创建第一个应用 ###
第一步创建你app的目录
####第一步创建你app的目录
[leo@linux-vps python3.4-flask] mkdir app
[leo@linux-vps python3.4-flask]mkdir app/static
[leo@linux-vps python3.4-flask]mkdir app/templates
[leo@linux-vps python3.4-flask] mkdir app
[leo@linux-vps python3.4-flask] mkdir app/static
[leo@linux-vps python3.4-flask] mkdir app/templates
在python3.4-flask文件家中创建一个一个名为app的文件夹它包含了两个子文件夹“static”和“templates”。我们的Python脚本会在app文件夹像css/js这类文件会在static文件夹template文件夹会包含我们的html模板。
在python3.4-flask文件夹中创建一个名为app的文件夹它包含了两个子文件夹“static”和“templates”。我们的Python脚本会在app文件夹像css/js这类文件会在static文件夹template文件夹会包含我们的html模板。
第二步在app文件夹内部创建一个初始化文件
####第二步在app文件夹内部创建一个初始化文件
[leo@linux-vps python3.4-flask] vim app/_init_.py
from flask import Flask
@ -96,7 +93,7 @@ Python有它自己的包管理去与yum和apt-get相似。你将需要它来
app = Flask(__name__)
from app import index
这个文件创建一个Flask的新的实例并加载我们存储在index.py文件中的python程序这个文件我们之后会创建。
这个文件创建一个Flask的新的实例并加载我们存储在index.py文件中的python程序——这个文件我们之后会创建。
[leo@linux-vps python3.4-flask]vim app/index.py
from app import app
@ -110,7 +107,7 @@ Python有它自己的包管理去与yum和apt-get相似。你将需要它来
return
flask中的路由由路由装饰器处理。这用于给函数绑定URL
flask中的访问路由通过“路由装饰器”处理。它用于将一个 URL 绑定到函数
@app.route('/')
@app.route('/index')
@ -123,7 +120,7 @@ flask中的路由由路由装饰器处理。这用于给函数绑定URL。
subprocess.Popen(['ls', -l],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen的communicate方法来访问输出
stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen的communicate方法来访问输出。
out,error = cmd.communicate()
@ -133,7 +130,7 @@ stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen
关于subprocess模块更多的信息会在教程的最后给出。
第三步创建一个html模板来显示我们命令的输出。
####第三步创建一个html模板来显示我们命令的输出。
要做到这个我们使用flask中的Jinja2模板引擎来为我们渲染。
@ -162,31 +159,31 @@ stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen
{% endfor %}
Jinja2模板引擎允许你使用“{{ … }}”分隔符来打印结果,{% … %}来做循环和赋值。我使用“decode()”方法来格式化。
Jinja2模板引擎允许你使用“{{ … }}”分隔符来输出结果,{% … %}来做循环和赋值。我使用“decode()”方法来格式化。
第四步运行app
####第四步运行app
[leo@linux-vps python3.4-flask]vim run.py
from app import app
app.debug = True
app.run(host='174.140.165.231', port=80)
上面的代码会在debug模式下运行app。如果你不写IP地址和端口默认则是localhost:5000。
上面的代码会在debug模式下运行app。如果你不指定 IP 地址和端口默认则是localhost:5000。
[leo@linux-vps python3.4-flask] chmod +x run.py
[leo@linux-vps python3.4-flask] python3.4 run.py
![](http://techarena51.com/wp-content/uploads/2014/12/install-python3-flask.png)
我已经加了更多的带来来显示CPU、I/O和平均负载。
我已经加了更多的代码来显示CPU、I/O和平均负载。
![](http://techarena51.com/wp-content/uploads/2014/12/install-python3-flask-on-linux.png)
你可以在[这里][3]浏览代码。
你可以在[这里][3]浏览完整的代码。
这是一个对flask的简短教程我建议你阅读下面的教程和文档来更深入地了解。
http://flask.pocoo.org/docs/0.10/quickstart/#
http://flask.pocoo.org/docs/0.10/quickstart/
https://docs.python.org/3.4/library/subprocess.html#popen-constructor
@ -198,7 +195,7 @@ via: http://techarena51.com/index.php/how-to-install-python-3-and-flask-on-linux
作者:[Leo G][a]
译者:[geekpi](https://github.com/gekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,37 @@
Google云服务为Docker应用提供简化版Ubuntu
================================================================================
> Ubuntu Core为运行容器提供了最小的轻量级Linux环境
Google为自己的云服务采用了一个简化版的Canonical Ubuntu Linux发行版以优化运行Docker和其他容器。
Ubuntu Core被设计成仅提供在云上运行Linux所必需的组件。它发布了一个[早期预览版][1]Canonical命名其为“Snappy”。这个新版本裁减了大量在普通Linux发行版中常见而在云应用中不实用的库和应用程序。
Google计算引擎(GCE)和Microsoft Azure[加入了][4]支持这个新的发行版的行列。
从Canonical了解到Ubuntu Core将为用户提供一个部署Docker的简单方式一个[日益精简的虚拟容器][4]允许用户快速启动工作负载并轻松地转移,甚至可以跨越不同的云服务提供商。
Google是Docker和基于容器的虚拟化的热心支持者。在去年六月份这家公司[用开源的方式发布了一个容器管理软件][5]Kubernetes。
Ubuntu Core在设计上类似于另一个[发布于一年前][7]的 Linux发行版 CoreOS。CoreOS 主要由两名前Rackspace工程师开发[CoreOS][8]是一个轻量级Linux发行版设计运行在集群中被那些在网页上完成他们大部分或所有业务的公司所喜好的大规模环境。CoreOS很快被许多云服务提供商采用包括Microsoft AzureAmazon网站服务DigitalOcean以及Google计算引擎。
如同CoreOS一样Ubuntu Core提供了一个快速引擎来更新组件减少系统管理员去手动处理的时间。
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2860401/cloud-computing/google-cloud-offers-streamlined-ubuntu-for-docker-use.html
作者:[Joab Jackson][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Joab-Jackson/
[1]:http://www.ubuntu.com/cloud/tools/snappy
[2]:http://www.infoworld.com/article/2607941/linux/how-to--get-started-with-docker.html
[3]:http://www.infoworld.com/blog/infoworld-tech-watch/
[4]:http://www.ubuntu.com/cloud/tools/snappy
[5]:http://www.itworld.com/article/2695383/open-source-tools/docker-all-geared-up-for-the-enterprise.html
[6]:http://www.itworld.com/article/2695501/cloud-computing/google-unleashes-docker-management-tools.html
[7]:http://www.itworld.com/article/2696116/open-source-tools/coreos-linux-does-away-with-the-upgrade-cycle.html
[8]:https://coreos.com/using-coreos/

View File

@ -1,9 +1,11 @@
5 Linux下用户空间调试工具
五个 Linux 下用户空间的调试工具
================================================================================
根据定义,调试工具是那些那些使我们能够监测、控制和纠正其他程序的程序。我们为什么应该用调试工具呢? 在有些情况下,运行一些程序的时候我们会被卡住,我们需要明白究竟发生了什么。 例如, 我们正在运行应用程序,它产生了一些错误消息。要修复这些错误,我们应该先找出为什么产生这些错误的消息和这些错误消息从哪里产生的。 一个应用程序可能突然挂起,我们必须了解其他什么进程同时在运行。我们可能还必须弄清楚进程'x'挂起的时候在做什么。为了剖析这些细节, 我们需要调试工具的帮助。有几个Linux下的用户空间调试工具和技术他们用来分析用户空间问题相当有用。他们是:
根据定义,调试工具是那些那些使我们能够监测、控制和纠正其他程序的程序。我们为什么应该用调试工具呢? 在有些情况下,运行一些程序的时候我们会被卡住,我们需要明白究竟发生了什么。 例如,我们正在运行应用程序,它产生了一些错误消息。要修复这些错误,我们应该先找出为什么产生这些错误的消息和这些错误消息从哪里产生的。 一个应用程序可能突然挂起,我们必须了解其他什么进程同时在运行。我们可能还必须弄清楚某个进程挂起的时候在做什么。为了剖析这些细节, 我们需要调试工具的帮助。
有几个Linux下的用户空间调试工具和技术它们用来分析用户空间的问题相当有用。它们是:
- **'print' 语句**
- **查询 (/proc, /sys etc)**
- **查询 (/proc, /sys )**
- **跟踪 (strace/ltrace)**
- **Valgrind (memwatch)**
- **GDB**
@ -12,42 +14,44 @@
### 1.'print' 语句 ###
这是一个基本的原始的调试问题的方法。 我们可以在程序中插入print语句来了解控制流和变量值。 虽然这是一个简单的技术, 但它有一些缺点的。 程序需要进行编辑以添加'print'语句,然后不得不重新编译,重新运行来获得输出。 如果要调试的程序相当大,这是一个耗时的方法。
这是一个基本的原始的调试问题的方法。 我们可以在程序中插入print语句来了解控制流和变量值。 虽然这是一个简单的技术 但它有一些缺点。 程序需要进行编辑以添加'print'语句,然后必须重新编译,重新运行来获得输出。 如果要调试的程序相当大,这是一个耗时的方法。
### 2. 查询 ###
在某些情况下,我们需要弄清楚在一个运行在内核中的进程的状态和内存映射。为了获得这些信息,我们不需要在内核中插入任何代码。 相反,可以用 /proc 文件系统。
/proc 是一个伪文件系统,系统一启动运行就收集着运行时系统的信息 (cpu信息, 内存容量 等)。
/proc 是一个伪文件系统,系统一启动运行就收集着运行时系统的信息 (cpu信息, 内存容量等)。
![output of 'ls /proc'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-output.png)
'ls /proc'的输出
*'ls /proc'的输出*
正如你看到的, 系统中运行的每一个进程在/proc文件系统中有一个以进程id命名的项。每个进程的细节信息可以在进程id对应的目录下的文件中获得。
![output of 'ls /proc/pid'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-pid.png)
'ls /proc/pid'的输出
*'ls /proc/pid'的输出*
解释/proc文件系统内的所有条目超出了本文的范围。一些有用的列举如下
- /proc/cmdline -> 内核命令行
- /proc/cpuinfo -> 关于处理器的品牌,型号信息等
- /proc/filesystems -> 文件系统的内核支持的信息
- /proc//cmdline -> 命令行参数传递到当前进程
- /proc//mem -> 当前进程持有的内存
- /proc//status -> 当前进程的状态
- /proc/\<pid>/cmdline -> 命令行参数传递到当前进程
- /proc/\<pid>/mem -> 当前进程持有的内存
- /proc/\<pid>/status -> 当前进程的状态
### 3. 跟踪 ###
strace的和ltrace是两个在Linux中用来追踪程序的执行细节的跟踪工具
strace的和ltrace是两个在Linux中用来追踪程序的执行细节的跟踪工具
#### strace: ####
strace拦截和记录系统调用并且由它来接收的信号。对于用户,它显示了系统调用,传递给它们的参数和返回值。 strace的可以附着到已在运行的进程中或到一个新的进程。它作为一个针对开发者和系统管理员的诊断调试工具是很有用的。它也可以用来当为一个通过跟踪不同的程序调用来了解系统的工具。这个工具的好处是不需要源代码和程序不需要重新编译。
strace拦截和记录系统调用及其接收的信号。对于用户它显示了系统调用、传递给它们的参数和返回值。strace的可以附着到已在运行的进程或一个新的进程。它作为一个针对开发者和系统管理员的诊断、调试工具是很有用的。它也可以用来当做一个通过跟踪不同的程序调用来了解系统的工具。这个工具的好处是不需要源代码,程序也不需要重新编译。
使用strace的基本语法是
**strace command**
**strace 命令**
strace有各种各样的参数。可以检查看strace的手册页来获得更多的细节。
@ -58,11 +62,12 @@ strace的输出非常长我们通常不会对显示的每一行都感兴趣
用'-o'选项,命令的输出可以被重定向到文件。
![output of strace filtering only the open system call](http://blog.linoxide.com/wp-content/uploads/2014/12/strace-output.png)
strace过滤成只有系统调用的输出
*strace过滤成只有系统调用的输出*
#### ltrace: ####
ltrace跟踪和记录一个进程的动态运行时库的调用收到的信号。它也可以跟踪一个进程所作的系统调用。它的用法是类似与strace。
ltrace跟踪和记录一个进程的动态运行时库的调用及其收到的信号。它也可以跟踪一个进程所作的系统调用。它的用法是类似与strace。
**ltrace command**
@ -73,25 +78,26 @@ ltrace跟踪和记录一个进程的动态运行时库的调用和收到
所有可用的选项请参阅ltrace手册。
![output of ltrace capturing 'strcmp' library call](http://blog.linoxide.com/wp-content/uploads/2014/12/ltrace-output.png)
ltrace捕捉'STRCMP'库调用的输出
*ltrace捕捉'STRCMP'库调用的输出*
### 4. Valgrind ###
Valgrind是一套调试和分析工具。一个被广泛使用的工具,默认的工具被称为'Memcheck'的拦截malloc()new()free()和delete()调用的内存检测工具。换句话说,它在检测下面这些问题非常有用:
Valgrind是一套调试和分析工具。它的一个被广泛使用的默认工具——'Memcheck'——可以拦截malloc()new()free()和delete()调用。换句话说,它在检测下面这些问题非常有用:
- 内存泄露
- 重释放
- 访问越界
- 使用未初始化的内存
- 使用的内存已经被释放 等。
- 使用已经被释放的内存等。
它直接通过可执行文件运行。
Valgrind带有一些缺点。因为它增加了内存占用,可以减慢你的程序。它有时会造成误报和漏报。它不能检测出静态分配的数组的访问越界问题。
Valgrind也有一些缺点,因为它增加了内存占用,会减慢你的程序。它有时会造成误报和漏报。它不能检测出静态分配的数组的访问越界问题。
为了用他, 首先下载并安装在你的系统上。 ([Valgrind下载页面][1]). 可以使用操作系统上的包管理起来安装。
为了使用它,首先请[下载][1]并安装在你的系统上。可以使用操作系统上的包管理器来安装。
使用命令行安装涉及解压缩,解包下载的文件。
使用命令行安装需要解压缩和解包下载的文件。
tar -xjvf valgring-x.y.z.tar.bz2 (where x.y.z is the version number you are trying to install)
@ -130,9 +136,10 @@ Valgrind带有一些缺点。因为它增加了内存占用可以减慢你的
这是valgrind呈现错误的输出
![output of valgrind showing heap block overrun and memory leak](http://blog.linoxide.com/wp-content/uploads/2014/12/Valgrind.png)
valgrind显示堆溢出和内存泄漏的输出
正如我们在上面看到的消息我们正在试图访问超出函数f分配的内存和分配的内存没有释放。
*valgrind显示堆溢出和内存泄漏的输出*
正如我们在上面看到的消息我们正在试图访问函数f未分配的内存以及分配尚未释放的内存。
### 5. GDB ###
@ -144,15 +151,15 @@ GDB是来自自由软件基金会的调试器。它对定位和修复代码中
- 检查所需信息
- 改变程序中的数据 等。
你也可以附加一个崩溃的程序coredump到GDB并分析故障的原因。
你也可以将一个崩溃的程序coredump附着到GDB并分析故障的原因。
GDB提供很多选项来调试程序。 然而我们将介绍一些重要的选择来感受如何开始使用GDB。
如果你还没有安装GDB可以在这里下载 [GDB官方网站][2].
如果你还没有安装GDB可以在这里下载[GDB官方网站][2]。
#### 编译程序: ####
为了用GDB调试程序必须使用gcc的'-g'选项进行编译。将以操作系统的本地格式产生调试信息GDB利用这些信息来工作。
为了用GDB调试程序必须使用gcc的'-g'选项进行编译。将以操作系统的本地格式产生调试信息GDB利用这些信息来工作。
下面是一个简单的程序example1.c执行被零除用来显示GDB的用法:
@ -169,18 +176,20 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
}
![An example showing usage of gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-example.png)
展示GDB用法的例子
*展示GDB用法的例子*
#### 调用 GDB: ####
通过在命令行中执行'gdb'来启动gdb:
![invoking gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb.png)
调用 gdb
一旦调用, 它将等待终端命令并执行,直到退出。
*调用 gdb*
如果一个进程已经在运行你需要将GDB连接到它上面可以通过指定进程ID来实现。假设程序已经崩溃要分析问题的原因则连接GDB到core文件。
调用后, 它将等待终端命令并执行,直到退出。
如果一个进程已经在运行你需要将GDB连接到它上面可以通过指定进程ID来实现。假设程序已经崩溃要分析问题的原因则用GDB分析core文件。
#### 启动程序: ####
@ -188,7 +197,7 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
#### 给程序传参数: ####
使用'set args'给你的程序传参数,当程序下次运行时将获得参数。'show args'将显示传递给程序的参数。
使用'set args'给你的程序传参数,当程序下次运行时将获得参数。'show args'将显示传递给程序的参数。
#### 检查堆栈: ####
@ -202,13 +211,13 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
#### 检查数据: ####
程序的数据可以在里面GDB使用'print'命令进行检查。例如,如果'X'是调试程序内的变量,'print x'会打印x的值。
程序的数据可以在里面GDB使用'print'命令进行检查。例如,如果'x'是调试程序内的变量,'print x'会打印x的值。
#### 检查源码: ####
源码可以在GDB中打印。默认情况下'list'命令会打印10行代码。
- **list <linenum>**: 列出'linenum'行周的源码
- **list <linenum>**: 列出'linenum'行周的源码
- **list <function>**: 从'function'开始列出源码
- **disas <function>**: 显示该函数机器代码
@ -217,11 +226,11 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
使用GDB我们可以在必要的地方设置断点观察点等来停止程序。
- **break <location>**: 在'location'设置一个断点。当在程序执行到这里时断点将被击中,控制权被交给用户。
- **watch <expr>**: 当'expr'被程序写而且它的值发生变化时GDB将停止
- **catch <event>**: 当'event'发生时GDB停止
- **watch <expr>**: 当'expr'被程序写而且它的值发生变化时GDB将停止
- **catch <event>**: 当'event'发生时GDB停止
- **disable <breakpoint>**: 禁用指定断点
- **enable <breakpoint>**: 启用指定断点
- **delete <breakpoint>**: 删除 断点/观察点/捕获点。 如果没有传递参数默认操作是在所有的断点
- **delete <breakpoint>**: 删除 断点/观察点/捕获点。 如果没有传递参数默认操作是在所有的断点
- **step**: 一步一步执行程序
- **continue**: 继续执行程序,直到执行完毕
@ -232,21 +241,18 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
GDB还有更多的可用选项。里面GDB使用help选项了解更多详情。
![getting help within gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-help.png)
在GDB种获得帮助
*在GDB中获得帮助*
### 总结 ###
在这篇文章中我们已经看到不同类型的Linux用户空间的调试工具。总结以上所有内容这是些什么时候使用该什么的快速指南:
在这篇文章中我们已经看到不同类型的Linux用户空间的调试工具。总结以上所有内容如下是什么时候使用该什么的快速指南:
基本调试,获得关键变量 - print 语句
获取有关文件系统支持可用内存CPU运行程序的内核状态等信息 - 查询 /proc 文件系统
最初的问题诊断,系统调用或库调用的相关问题,了解程序流程 strace / ltrace
应用程序内存空间的问题 valgrind
检查应用程序运行时的行为,分析应用程序崩溃 gdb。
- 基本调试,获得关键变量 - print 语句
- 获取有关文件系统支持可用内存CPU运行程序的内核状态等信息 - 查询 /proc 文件系统
- 最初的问题诊断,系统调用或库调用的相关问题,了解程序流程 strace / ltrace
- 应用程序内存空间的问题 valgrind
- 检查应用程序运行时的行为,分析应用程序崩溃 gdb
--------------------------------------------------------------------------------
@ -254,7 +260,7 @@ via: http://linoxide.com/linux-how-to/user-space-debugging-tools-linux/
作者:[B N Poornima][a]
译者:[mtunique](https://github.com/mtunique)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,16 +1,16 @@
如何配置fail2ban来保护Apache服务器
如何配置 fail2ban 来保护 Apache 服务器
================================================================================
生产环境中的Apache服务器可能会受到不同的攻击。攻击者或许试图通过暴力攻击或者执行恶意脚本来获取未经授权或者禁止访问的目录。一些恶意爬虫或许会扫描你网站下的任意安全漏洞或者手机email地址或者web表格来发送垃圾邮件。
生产环境中的 Apache 服务器可能会受到不同的攻击。攻击者或许试图通过暴力攻击或者执行恶意脚本来获取未经授权或者禁止访问的目录。一些恶意爬虫或许会扫描你网站下的各种安全漏洞或者通过收集email地址和web表单来发送垃圾邮件。
Apache服务器具有综合的日志功能来捕捉不同表明是攻击的异常事件。然而它还不能系统地解析具体的apache日志并迅速地反应到潜在的攻击(比如,禁止/解禁IP地址。这时候`fail2ban`可以解救这一切,解放了系统管理员的工作。
Apache服务器具有全面的日志功能可以捕捉到各种攻击所反映的异常事件。然而它还不能系统地解析具体的apache 日志并迅速地对潜在的攻击进行反应(比如,禁止/解禁IP地址。这时候`fail2ban`可以解救这一切,解放了系统管理员的工作。
`fail2ban`是一款入侵防御工具,可以基于系统日志检测不同的工具并且可以自动采取保护措施比如:通过`iptables`禁止ip、阻止/etc/hosts.deny中的连接、或者通过邮件通知事件。fail2ban具有一系列预定义的“监狱”它使用特定程序日志过滤器来检测通常的攻击。你也可以编写自定义的规则来检测来自任意程序的攻击。
`fail2ban`是一款入侵防御工具,可以基于系统日志检测不同的工具并且可以自动采取保护措施比如:通过`iptables`禁止ip、通过 /etc/hosts.deny 阻止连接、或者通过邮件发送通知。fail2ban具有一系列预定义的“监狱”它使用特定程序日志过滤器来检测通常的攻击。你也可以编写自定义的规则来检测来自任意程序的攻击。
在本教程中我会演示如何配置fail2ban来保护你的apache服务器。我假设你已经安装了apache和fail2ban。对于安装请参考[另外一篇教程][1]。
### 什么是 Fail2ban 监狱 ###
让我们更深入地了解fail2ban监狱。监狱定义了具体的应用策略它会为指定的程序触发一个保护措施。fail2ban在/etc/fail2ban/jail.conf 下为一些流行程序如Apache、Dovecot、Lighttpd、MySQL、Postfix、[SSH][2]等预定义了一些监狱。每个依赖于特定的程序日志过滤器(在/etc/fail2ban/fileter.d 下面来检测通常的攻击。让我看一个例子监狱SSH监狱。
让我们更深入地了解 fail2ban 监狱。监狱定义了具体的应用策略它会为指定的程序触发一个保护措施。fail2ban在 /etc/fail2ban/jail.conf 下为一些流行程序如Apache、Dovecot、Lighttpd、MySQL、Postfix、[SSH][2] 等预定义了一些监狱。每个监狱都通过特定的程序日志过滤器(在/etc/fail2ban/fileter.d 下面来检测通常的攻击。让我看一个例子监狱SSH监狱。
[ssh]
enabled = true
@ -24,15 +24,15 @@ SSH监狱的配置定义了这些参数
- **[ssh]** 方括号内是监狱的名字。
- **enabled**:是否启用监狱
- **port** 端口的数字 (或者数字对应的名称).
- **filter** 检测攻击的检测规则
- **logpath** 检测的日志文件
- **maxretry** 禁止前失败的最大数
- **banaction** 禁止操作
- **port** 端口号(或者对应的服务名称)
- **filter** 检测攻击的日志解析规则
- **logpath** 检测的日志文件
- **maxretry** 最大失败次
- **banaction** 所进行的禁止操作
定义配置文件中的任意参数都会覆盖相应的默认配置`fail2ban-wide` 中的参数。相反,任意缺少的参数都会使用定义在[DEFAULT]字段的值。
定义在监狱配置中的任意参数都会覆盖`fail2ban-wide` 中相应的默认配置参数。相反,任何缺少的参数都会使用定义在[DEFAULT] 字段的默认值。
预定义日志过滤器都必须在/etc/fail2ban/filter.d可以采取的操作在/etc/fail2ban/action.d。
预定义的日志过滤器都放在/etc/fail2ban/filter.d而可以采取的禁止操作放在 /etc/fail2ban/action.d。
![](https://farm8.staticflickr.com/7538/16076581722_cbca3c1307_b.jpg)
@ -40,7 +40,7 @@ SSH监狱的配置定义了这些参数
### 启用预定义的apache监狱 ###
`fail2ban`的默认安装为Apache服务提供了一些预定义监狱以及过滤器。我要启用这些内建的Apache监狱。由于Debian和红买配置的稍微不同我会分别它们的配置文件。
`fail2ban`的默认安装为Apache服务提供了一些预定义监狱和过滤器。我要启用这些内建的Apache监狱。由于Debian和RedHat配置的稍微不同我会分别提供它们的配置文件。
#### 在Debian 或者 Ubuntu启用Apache监狱 ####
@ -50,7 +50,7 @@ SSH监狱的配置定义了这些参数
----------
# detect password authentication failures
# 检测密码认证失败
[apache]
enabled = true
port = http,https
@ -58,7 +58,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/apache*/*error.log
maxretry = 6
# detect potential search for exploits and php vulnerabilities
# 检测漏洞和 PHP 脆弱性扫描
[apache-noscript]
enabled = true
port = http,https
@ -66,7 +66,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/apache*/*error.log
maxretry = 6
# detect Apache overflow attempts
# 检测 Apache 溢出攻击
[apache-overflows]
enabled = true
port = http,https
@ -74,7 +74,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/apache*/*error.log
maxretry = 2
# detect failures to find a home directory on a server
# 检测在服务器寻找主目录的尝试
[apache-nohome]
enabled = true
port = http,https
@ -100,7 +100,7 @@ SSH监狱的配置定义了这些参数
----------
# detect password authentication failures
# 检测密码认证失败
[apache]
enabled = true
port = http,https
@ -108,7 +108,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log
maxretry = 6
# detect spammer robots crawling email addresses
# 检测抓取邮件地址的爬虫
[apache-badbots]
enabled = true
port = http,https
@ -117,7 +117,7 @@ SSH监狱的配置定义了这些参数
bantime = 172800
maxretry = 1
# detect potential search for exploits and php <a href="http://xmodulo.com/recommend/penetrationbook" style="" target="_blank" rel="nofollow" >vulnerabilities</a>
# 检测漏洞和 PHP 脆弱性扫描
[apache-noscript]
enabled = true
port = http,https
@ -125,7 +125,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log
maxretry = 6
# detect Apache overflow attempts
# 检测 Apache 溢出攻击
[apache-overflows]
enabled = true
port = http,https
@ -133,7 +133,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log
maxretry = 2
# detect failures to find a home directory on a server
# 检测在服务器寻找主目录的尝试
[apache-nohome]
enabled = true
port = http,https
@ -141,9 +141,9 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log
maxretry = 2
# detect failures to execute non-existing scripts that
# are associated with several popular web services
# e.g. webmail, phpMyAdmin, WordPress
# 检测执行不存在的脚本的企图
# 这些都是流行的网站服务程序
# webmail phpMyAdminWordPress
port = http,https
filter = apache-botsearch
logpath = /var/log/httpd/*error_log
@ -175,7 +175,7 @@ SSH监狱的配置定义了这些参数
![](https://farm8.staticflickr.com/7572/15891521967_5c6cbc5f8f_c.jpg)
你也可以手动禁止或者解禁IP地址
你也可以手动禁止或者解禁IP地址
要用制定监狱禁止IP
@ -187,7 +187,7 @@ SSH监狱的配置定义了这些参数
### 总结 ###
本篇教程解释了fail2ban监狱如何工作以及如何使用内置的监狱来保护Apache服务器。依赖于你的环境以及要保护的web服务器类型你或许要适配已存在的监狱或者编写自定义监狱和日志过滤器。查看outfail2ban的[官方Github页面][3]来获取最新的监狱和过滤器示例。
本篇教程解释了fail2ban监狱如何工作以及如何使用内置的监狱来保护Apache服务器。依赖于你的环境以及要保护的web服务器类型你或许要调整已有的监狱或者编写自定义监狱和日志过滤器。查看outfail2ban的[官方Github页面][3]来获取最新的监狱和过滤器示例。
你有在生产环境中使用fail2ban么分享一下你的经验吧。
@ -197,11 +197,11 @@ via: http://xmodulo.com/configure-fail2ban-apache-http-server.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/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:http://xmodulo.com/how-to-protect-ssh-server-from-brute-force-attacks-using-fail2ban.html
[2]:http://xmodulo.com/how-to-protect-ssh-server-from-brute-force-attacks-using-fail2ban.html
[1]:http://linux.cn/article-5067-1.html
[2]:http://linux.cn/article-5067-1.html
[3]:https://github.com/fail2ban/fail2ban

View File

@ -0,0 +1,110 @@
使用Nemiver调试器来调试 C/C++ 程序
================================================================================
如果你读过我写的[使用GDB命令行调试器调试C/C++程序][1]你就会明白一个调试器对一段C/C++程序来说有多么的重要和有用。然而如果一个像GDB这样的命令行对你而言听起来更像一个问题而不是一个解决方案的话那么你也许会对Nemiver更感兴趣。[Nemiver][2] 是一款基于 GTK+ 的用于C/C++程序的图形化的独立调试器它以GDB作为其后端。最令人赞赏的是其速度和稳定性Nemiver是一个非常可靠具备许多优点的调试工具。
### Nemiver的安装 ###
基于Debian发行版它的安装时非常直接简单如下
$ sudo apt-get install nemiver
在Arch Linux中安装如下
$ sudo pacman -S nemiver
在Fedora中安装如下
$ sudo yum install nemiver
如果你选择自己编译,[GNOME 网站][3]上有最新源码包。
最令人欣慰的是它能够很好地与GNOME环境像结合。
### Nemiver的基本用法 ###
启动Nemiver的命令
$ nemiver
你也可以通过执行一下命令来启动:
$ nemiver [需要调试的可执行程序的路径]
注意,如果在调试模式下编译程序(在 GCC 中使用 -g 选项)将会对 nemiver 更有帮助。
还有一个优点是Nemiver的加载很快所以你马上就可以看到主屏幕的默认布局。
![](https://farm9.staticflickr.com/8679/15535277554_d320f6692c_c.jpg)
默认情况下,断点通常位于主函数的第一行。这样就可以空出时间让你去认识调试器的基本功能:
![](https://farm9.staticflickr.com/8669/16131832596_bc68ae18a8_o.jpg)
- 执行到下一行 按键是F6
- 执行到函数内部即停止F7
- 执行到函数外部即停止Shift+F7
不过我个人喜欢“Run to cursor运行至光标所在行该选项使你的程序准确的运行至你光标所在行它的默认按键是F11。
断点是很容易使用的。最快捷的方式是在一行代码上按下F8来设置一个断点。但是Nemiver在“Debug”菜单下也有一个更复杂的菜单它允许你在一个特定的函数某一行二进制文件中的位置或者类似异常、分支或者exec的事件上设置断点。
![](https://farm8.staticflickr.com/7579/16157622315_d680a63896_z.jpg)
你也可以通过追踪来查看一个变量。在“Debug”中你可以用一个表达式的名字来检查它的值然后也可以通过将其添加到列表中以方便访问。这可能是最有用的一个功能虽然我从未有兴趣将鼠标悬停在一个变量来获取它的值。值得注意的是虽然鼠标悬停可以取到值如果想要让它更好地工作Nemiver是可以看到结构并给出所有成员的变量的赋值。
![](https://farm8.staticflickr.com/7465/15970310470_7ed020c613.jpg)
谈到方便地访问信息我也非常欣赏这个程序的布局。默认情况下代码在上半部分功能区标签在下半部分。这可以让你访问终端的输出、上下文追踪器、断点列表、注册器地址、内存映射和变量控制。但是请注意在“Edit”-“Preferences”-“Layout”下你可以选择不同的布局包括一个可以修改的动态布局。
![](https://farm9.staticflickr.com/8606/15971551549_00e4cdd32e_c.jpg)
![](https://farm8.staticflickr.com/7525/15535277594_026fef17c1_z.jpg)
自然当你设置了全部断点观察点和布局您可以在“File”菜单下很方便地保存该会话以便你下次打开时恢复。
### Nemiver的高级用法 ###
到目前为止我们讨论的都是Nemiver的基本特征例如你马上开始调试一个简单的程序需要了解什么。如果你有更高的需求特别是对于一些更加复杂的程序你应该会对接下来提到的这些特征更感兴趣。
#### 调试一个正在运行的进程 ####
Nemiver允许你驳接到一个正在运行的进程进行调试。在“File”菜单你可以筛选出正在运行的进程并驳接到某个进程。
![](https://farm9.staticflickr.com/8593/16155720571_00e4cdd32e_z.jpg)
#### 通过TCP连接远程调试一个程序 ####
Nemiver支持远程调试你可以在一台远程机器上设置一个轻量级调试服务器然后你在另外一台机器上启动 nemiver 去调试运行在调试服务器上的程序。如果出于某些原因,你不能在远程机器上很好地驾驭 Nemiver或者GDB那么远程调试对于你来说将非常有用。在“File”菜单下指定二进制文件、共享库位置、远程地址和端口。
![](https://farm8.staticflickr.com/7469/16131832746_c47dee4ef1.jpg)
#### 使用你的GDB二进制程序进行调试 ####
如果你的Nemiver是自行编译的你可以在“Edit编辑”-“Preferences首选项”-“Debug调试”下给GDB指定一个新的位置。如果你想在Nemiver下使用定制版本的GDB那么这个选项对你来说是非常实用的。
#### 跟随一个子进程或者父进程 ####
当你的程序分支时Nemiver是可以设置为跟随子进程或者父进程的。想激活这个功能请到“Debugger”下面的“Preferences首选项”。
![](https://farm8.staticflickr.com/7512/16131832716_5724ff434c_z.jpg)
总而言之Nemiver大概是我最喜欢的不在IDE里面的调试程序。在我看来它甚至可以击败GDB它和命令行程序一样深深吸引了我。所以如果你从未使用过的话我会强烈推荐你使用。我十分感谢它背后的开发团队给了我这么一个可靠、稳定的程序。
你对Nemiver有什么见解你是否也考虑它作为独立的调试工具或者仍然坚持使用IDE让我们在评论中探讨吧。
--------------------------------------------------------------------------------
via: http://xmodulo.com/debug-program-nemiver-debugger.html
作者:[Adrien Brochard][a]
译者:[disylee](https://github.com/disylee)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:http://linux.cn/article-4302-1.html
[2]:https://wiki.gnome.org/Apps/Nemiver
[3]:https://download.gnome.org/sources/nemiver/0.9/
[4]:http://xmodulo.com/recommend/linuxclibook

View File

@ -1,12 +1,12 @@
如何在 Linux 上使用 BackupPC 来设置一个跨平台的备份服务器
如何在 Linux 上使用 BackupPC 来设跨平台的备份服务器
================================================================================
为了防止你不能分辨这篇教程和我先前关于[backupninja][1] 和 [backup-manager][2] 的帖子,=== 我是一个积极的备份迷。当提到备份,我宁愿备份的太多而不希望备份不足,因为如果我们有需要的话,你将会感激你花费了时间和精力来你的重要数据生成额外的拷贝。
也许你没有从我先前关于 [backupninja][1] 和 [backup-manager][2] 的两篇文章中发现,我是一个超级备“粉”。当提到备份,我宁愿备份的太多而不希望备份不足,因为如果我们有需要的话,你将会感激你为重要数据生成额外的拷贝所付出的时间和精力
在这篇帖子中,我将向你介绍 [BackupPC][3],一个跨平台的备份服务器软件,它可以通过网络为 LinuxWindows 和 MacOS 等系统上的客户端主机拉取备份。BackupPC 添加了一系列的特点使得管理备份变为一件快乐的事。
在这篇文章中,我将向你介绍 [BackupPC][3],一个跨平台的备份服务器软件,它可以通过网络为 LinuxWindows 和 MacOS 等系统上的客户端主机拉取备份。BackupPC 添加了一系列的特点使得管理备份变为一件快乐的事。
### BackupPC 的特点 ###
BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收集和管理其他远程客户端主机上的备份。通过使用它的 Web 界面,你可以检查日志和配置文件、为其他远程主机启动/取消/安排备份任务以及可视化备份任务的当前状态。你也可以非常容易地浏览归档的文件以及从备份的归档中恢复个人文件或整个作业。为了恢复单一的个人文件,你可以直接通过 Web 界面来下载任何先前备份的文件。若如这还不够,针对客户端主机,没有特别的客户端软件需要安装。在 Windows 客户端上, 本机 SMB 协议将被使用,而对于 *nix 客户端,你将使用 `rsync` 或 通过 SSH, RSH 或 NFS 来使用 `tar`
BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收集和管理其他远程客户端主机上的备份。通过使用它的 Web 界面,你可以检查日志和配置文件、为其他远程主机启动/取消/安排备份任务以及可视化备份任务的当前状态。你也可以非常容易地浏览归档的文件以及从备份的归档中恢复单个文件或整个备份。要恢复单个文件,你可以直接通过 Web 界面来下载任何先前备份的文件。不仅如此,客户端主机并不需要安装特别的客户端软件。在 Windows 客户端上, 使用的是原生的 SMB 协议,而对于 *nix 客户端,你将使用 `rsync` 或 通过 SSH, RSH 或 NFS 来使用 `tar`
### 安装 BackupPC ###
@ -20,13 +20,13 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
# yum install BackupPC
同往常一样,这两种包管理系统都会自动地对依赖问题进行解决。另外,作为安装过程中的一部分,你可能会被要求去配置或重新配置用于图形用户界面的 Web 服务器。下面的截图来自于 Debian 系统:
同往常一样,这两种包管理系统都会自动解决依赖问题。另外,作为安装过程中的一部分,你可能需要新配置或修改配置用于图形用户界面的 Web 服务器。下面的截图来自于 Debian 系统:
![](https://farm8.staticflickr.com/7573/16163781711_6218b620ef_c.jpg)
通过空格键来确定你的选择,然后使用 tab 键移动到 Ok 选项并敲回车键。
接着类似于下面的截屏将会呈现在你眼前,通知你一个用来管理 BackupPC 的名为 backuppc的管理员用户以及相应的密码(这个密码可以在以后被更改,如果你希望的话)已经被创建。这里需要注意的是:同样名为 backuppc的一个 HTTP 账户和一个常规的 Linux 账户将会被创建,它们使用同一个密码。需要前者的目的是来访问受保护的 BackupPC 的 Web 界面,而后者则是为了通过 SSH 来使用 `rsync` 来执行备份任务。
接着类似于下面的截屏将会呈现在你眼前,通知你创建了一个用来管理 BackupPC 的名为 backuppc的管理员用户以及相应的密码(如果你需要,这个密码以后可以更改)。这里需要注意的是:这里创建了同样名为 backuppc的 HTTP 账户和常规的 Linux 账户,它们使用相同的密码。需要前者的目的是来访问受保护的 BackupPC 的 Web 界面,而后者则是为了通过 SSH 来使用 `rsync` 来执行备份任务。
![](https://farm8.staticflickr.com/7579/15979622809_25e734658d_c.jpg)
@ -42,7 +42,7 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
### 启动 BackupPC 并设置备份 ###
首先,打开一个浏览器窗口并指向 http://<server's FQDN or IP address>/backuppc/ 。当弹出提示框时,输入先前向你提供的默认 HTTP 用户凭据(注:即用户名 backuppc 和相应的默认密码)。假如认证成功,你就会被带入到 Web 界面的主页:
首先,打开一个浏览器窗口并指向 http://\<服务器名称或 IP 地址>/backuppc/ 。当弹出提示框时,输入先前向你创建的默认 HTTP 用户凭据(注:即用户名 backuppc 和相应的默认密码)。假如认证成功,你就会被带入到 Web 界面的主页:
![](https://farm9.staticflickr.com/8601/15543330314_f6fdaa235e_z.jpg)
@ -51,9 +51,9 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
- Host #1: CentOS 7 [IP 192.168.0.17]
- Host #2: Windows 7 [IP 192.168.0.103]
我们将通过 SSH 使用 `rsync`来备份 CentOS 主机,使用 SMB 来备份 Windows 主机。在执行备份之前,我们需要向我们的 CentOS 主机设置 [基于密码认证][7](注:这里我不知如何翻译,根据链接,感觉是无需密码来连接主机)以及在我们的 Windows 主机中设置一个共享目录。
我们将通过 SSH 使用 `rsync`来备份 CentOS 主机,使用 SMB 来备份 Windows 主机。在执行备份之前,我们需要向我们的 CentOS 主机设置 [基于密钥认证][7] 以及在我们的 Windows 主机中设置一个共享目录。
下面是关于如何为一个远程 CentOS 主机设置 key-based authentication 的指导。我们创建 backuppc 用户的 RSA 密钥对,并向 CentOS 主机上的 root 账户传递它的公共密钥
下面是关于如何为一个远程 CentOS 主机设置基于密钥认证的指导。我们创建 backuppc 用户的 RSA 密钥对,并将其公钥传输给 CentOS 主机上的 root 账户
# usermod -s /bin/bash backuppc
# su - backuppc
@ -64,13 +64,13 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
![](https://farm8.staticflickr.com/7496/16164929932_8fc817125d_b.jpg)
你需要一个远程的 CentOS 主机的 root 权限来在该主机中的文件系统中发放写权限,以防要恢复的备份文件或目录的所有者为 root 账户。
你需要一个远程的 CentOS 主机的 root 权限,以获得在该主机中的文件系统中写权限,以防要恢复的备份文件或目录的所有者为 root 账户。
一旦 CentOS 和 Windows 主机都准备完毕,使用 Web 界面将它们添加到 BackupPC
![](https://farm9.staticflickr.com/8586/15979622709_76c2dcf68c_z.jpg)
下一步的内容由更改每个主机的备份设置组成
下一步更改每个主机的备份设置:
![](https://farm8.staticflickr.com/7461/16163781611_765c147f9f_z.jpg)
@ -88,7 +88,7 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
![](https://farm8.staticflickr.com/7536/15978247428_458c023f4c.jpg)
在任何时候,你都可以通过点击如上图展示的每个主机的备份主页来查看备份任务的状态。假如因为某些原因备份失败,在主机菜单中将会出现一个指向包含错误信息的网页的链接。当一个备份任务被成功地完成,一个被命名为主机名或 IP 地址的目录将会在服务器的 /var/lib/backuppc/pc 目录下被创建
在任何时候,你都可以通过点击如上图展示的每个主机的备份主页来查看备份任务的状态。假如因为某些原因备份失败,在主机菜单中将会出现一个指向包含错误信息的网页的链接。当一个备份任务成功完成后,在服务器的 /var/lib/backuppc/pc 目录下会创建一个命名为主机名或 IP 地址的目录
![](https://farm8.staticflickr.com/7549/16165680115_196ee42a49_z.jpg)
@ -96,7 +96,7 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
### 恢复备份 ###
为了浏览已经保存过的文件。进入每个主机的主菜单下的 “浏览备份”选项,你可以一目了然地看到目录和文件,并选择那些你想恢复的文件。另外,你还可以通过点击文件来使用默认程序打开文件或右击文件并选择“另存为”来下载该文件到你正在工作的机器上:
要浏览这些保存的文件,进入每个主机的主菜单下的 “浏览备份”选项,你可以一目了然地看到目录和文件,并选择那些你想恢复的文件。另外,你还可以通过点击文件来使用默认程序打开文件或右击文件并选择“另存为”来下载该文件到你当前的机器上:
![](https://farm8.staticflickr.com/7506/16165680105_bd5883e0da_c.jpg)
@ -113,21 +113,22 @@ BackupPC 自带有一个健壮的 Web 界面,允许你以集中的方式来收
有句俗话说,"越简单,越好",而这正是 BackupPC 所提供的东西。在 BackupPC 中,你将不仅找到了一个备份工具,而且还找到了一个无需任何客户端应用来在几个不同的操作系统中管理你的备份的方法。我相信这就有足够的理由让你去尝试一下。
欢迎使用下面的评论框来留下你的评论和问题,假如你有的话。我总是乐于听取读者想说的话!
--------------------------------------------------------------------------------
via: http://xmodulo.com/backuppc-cross-platform-backup-server-linux.html
作者:[Gabriel Cánepa][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/gabriel
[1]:http://xmodulo.com/backup-debian-system-backupninja.html
[2]:http://xmodulo.com/linux-backup-manager.html
[1]:http://linux.cn/article-5096-1.html
[2]:http://linux.cn/article-4586-1.html
[3]:http://backuppc.sourceforge.net/
[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[5]:http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html
[4]:http://linux.cn/article-2324-1.html
[5]:http://linux.cn/article-3889-1.html
[6]:http://xmodulo.com/recommend/linuxguide
[7]:http://xmodulo.com/how-to-enable-ssh-login-without.html

View File

@ -1,20 +1,20 @@
支持同时把单个 ISO 文件写入 20 个 USB 驱动盘的应用程序
MultiWriter同时将 ISO 镜像并发写入 20 个 USB 启动盘
================================================================================
**我的问题是如何把一个Linux ISO 文件烧录到 17 个 USB 拇指驱动盘?**
**我的问题是如何把一个Linux ISO 文件烧录到 17 个 USB 启动盘?**
精通代码的会写一个 bash 脚本来自动化处理,而大部分的人会使用像 USB 启动盘创建器这样的图形用户界面工具来把 ISO 文件一个一个的烧录到驱动盘中。但剩下的还有一些人会很快得出结论,两种方法都不太理想。
精通代码的会写一个 bash 脚本来自动化处理,而大部分的人会使用像 USB 启动盘创建器这样的图形用户界面工具来把 ISO 文件一个一个的烧录到驱动盘中。但剩下的还有一些人也许会很快得出结论,两种方法都不太理想。
### 问题 > 解决 ###
![GNOME MultiWriter in action](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/gnome-multi-writer.jpg)
GNOME MultiWriter 在运行当中
*GNOME MultiWriter 在运行当中*
Richard Hughes一个 GNOME 开发者,也面临着类似的困境。他要创建一批预装操作系统的 USB 动盘,需要一个足够简单的工具,使得像他父亲这样的用户也能使用。
Richard Hughes一个 GNOME 开发者,也面临着类似的困境。他要创建一批预装操作系统的 USB 动盘,需要一个足够简单的工具,使得像他父亲这样的用户也能使用。
他的反应是开发**品牌性的新应用程序**,使上面的两种方法合二为一,创造出易用的一款工具。
它的名字就叫 “[GNOME MultiWriter][1]”。同时可以把单个的 ISO 或 IMG 文件写入多个 USB 驱动盘。
它的名字就叫 “[GNOME MultiWriter][1]”,可以同时把单个的 ISO 或 IMG 文件写入多个 USB 驱动盘。
它不支持个性化自定义或命令行执行的功能,使用它就可以省掉浪费一下午的时间来对相同的操作的重复动作。
@ -24,25 +24,25 @@ Richard Hughes一个 GNOME 开发者,也面临着类似的困境。他要
![The app can be installed on Ubuntu](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/mutli-writer-on-ubuntu.jpg)
该应用程序可以在 Ubuntu 上安装
*该应用程序可以在 Ubuntu 上安装*
这款应用程序的定义使用场景很不错,正适合使用于预装正要发布的操作系统或 live 映像的 USB 上。
这款应用程序的定义使用场景很不错,正适合使用于预装正要发布的操作系统或 live 映像的 USB 启动盘上。
那就是说,任何人想要创建一个单独可启动的 USB 的话,也是一样的适用 - 因我用 Ubuntu 的内置磁盘创建工具来创建可引导的映像从来没有一次成功过的,所以这方案对我来说是个好消息!
那就是说,任何人想要创建一个单独可启动的 USB 启动盘的话,也是一样的适用 - 因我用 Ubuntu 的内置磁盘创建工具来创建可引导的映像从来没有一次成功过的,所以这方案对我来说是个好消息!
它的开发者 Hughes 说它**最高能支持20个 USB动盘**,每个盘的大小在 1GB 到 32GB之间。
它的开发者 Hughes 说它**最高能支持20个 USB动盘**,每个盘的大小在 1GB 到 32GB之间。
GNOME MultiWriter 不好的地方(到现在为止)就是它还没有一个完结、稳定的成品。它是能工作,但在早期的时候,还没有可安装的二进制版本或可添加到你庞大软件源的 PPA。
GNOME MultiWriter 也有不好的地方(到现在为止)就是它还没有一个完结、稳定的成品。它是能工作,但在早期的时候,还没有可安装的二进制版本或可添加到你庞大软件源的 PPA。
如果您知道通常的 configure/make 的操作流程的话,可以获取其源码并随时都可以编译运行。在 Ubuntu14.10 系统上,你可能还需要首先安装以下软件包:
sudo apt-get install gnome-common yelp-tools libcanberra-gtk3-dev libudisks2-dev gobject-introspection
如果您得到并运行起来,已经玩转的话,给我们分享下您的感受!
如果您可以运行起来,已经玩转的话,给我们分享下您的感受!
此项目托管在 GitHub 上,盼望对其提出问题缺陷和发起 pull 请求,在上面也可以找到压缩包下载,进行手动安装。
- [Github 上的 GNOME MultiWriter][2]
- [Github 上的 GNOME MultiWriter][1]
--------------------------------------------------------------------------------
@ -50,10 +50,9 @@ via: http://www.omgubuntu.co.uk/2015/01/gnome-multiwriter-iso-usb-utility
作者:[Joey-Elijah Sneddon][a]
译者:[runningwater](https://github.com/runningwater)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:https://github.com/hughsie/gnome-multi-writer/
[2]:https://github.com/hughsie/gnome-multi-writer/

View File

@ -1,4 +1,4 @@
如何在Ubuntu 14.04 LTS安装网络爬虫工具
如何在Ubuntu 14.04 LTS安装网络爬虫工具Scrapy
================================================================================
这是一款提取网站数据的开源工具。Scrapy框架用Python开发而成它使抓取工作又快又简单且可扩展。我们已经在virtual box中创建一台虚拟机VM并且在上面安装了Ubuntu 14.04 LTS。
@ -6,13 +6,13 @@
Scrapy依赖于Python、开发库和pip。Python最新的版本已经在Ubuntu上预装了。因此我们在安装Scrapy之前只需安装pip和python开发库就可以了。
pip是作为python包索引器easy_install的替代品用于安装和管理Python包。pip包的安装可见图 1。
pip是作为python包索引器easy_install的替代品用于安装和管理Python包。pip包的安装可见图 1。
sudo apt-get install python-pip
![Fig:1 Pip installation](http://blog.linoxide.com/wp-content/uploads/2014/11/f1.png)
图:1 pip安装
*图:1 pip安装*
我们必须要用下面的命令安装python开发库。如果包没有安装那么就会在安装scrapy框架的时候报关于python.h头文件的错误。
@ -20,42 +20,41 @@ pip是作为python包索引器easy_install的替代品。用于安装和管理Py
![Fig:2 Python Developer Libraries](http://blog.linoxide.com/wp-content/uploads/2014/11/f2.png)
图:2 Python 开发库
*图:2 Python 开发库*
scrapy框架即可从deb包安装也可以从源码安装。然而在图3中我们已经用pipPython 包管理器安装了deb包了。
scrapy框架既可从deb包安装也可以从源码安装。在图3中我们用pipPython 包管理器安装了deb包了。
sudo pip install scrapy
![Fig:3 Scrapy Installation](http://blog.linoxide.com/wp-content/uploads/2014/11/f3.png)
图:3 Scrapy 安装
*图:3 Scrapy 安装*
图4中scrapy的成功安装需要一些时间。
![Fig:4 Successful installation of Scrapy Framework](http://blog.linoxide.com/wp-content/uploads/2014/11/f4.png)
图:4 成功安装Scrapy框架
*图:4 成功安装Scrapy框架*
### 使用scrapy框架提取数据 ###
**(基础教程)**
####基础教程####
我们将用scrapy从fatwallet.com上提取店名(提供卡的店。首先我们使用下面的命令新建一个scrapy项目“store name” 见图5。
我们将用scrapy从fatwallet.com上提取商店名称(卖卡的店。首先我们使用下面的命令新建一个scrapy项目“store name” 见图5。
$sudo scrapy startproject store_name
![Fig:5 Creation of new project in Scrapy Framework](http://blog.linoxide.com/wp-content/uploads/2014/11/f5.png)
图:5 Scrapy框架新建项目
*图:5 Scrapy框架新建项目*
Above command creates a directory with title “store_name” at current path. This main directory of the project contains files/folders which are shown in the following Figure 6.
上面的命令在当前路径创建了一个“store_name”的目录。项目主目录下包含的文件/文件夹见图6。
$sudo ls lR store_name
![Fig:6 Contents of store_name project.](http://blog.linoxide.com/wp-content/uploads/2014/11/f6.png)
图:6 store_name项目的内容
*图:6 store_name项目的内容*
每个文件/文件夹的概要如下:
@ -66,13 +65,13 @@ Above command creates a directory with title “store_name” at current path. T
- store_name/settings.py 是项目的配置文件
- store_name/spiders/ 包含了用于爬取的蜘蛛
由于我们要从fatwallet.com上如提取店名因此我们如下修改文件。
由于我们要从fatwallet.com上如提取店名因此我们如下修改文件LCTT 译注:这里没说明是哪个文件,译者认为应该是 items.py
import scrapy
class StoreNameItem(scrapy.Item):
name = scrapy.Field() # extract the names of Cards store
name = scrapy.Field() # 取出卡片商店的名称
之后我们要在项目的store_name/spiders/文件夹下写一个新的蜘蛛。蜘蛛是一个python类它包含了下面几个必须的属性
@ -80,7 +79,7 @@ Above command creates a directory with title “store_name” at current path. T
2. 爬取起点url (start_urls)
3. 包含了从响应中提取需要内容相应的正则表达式的解析方法。解析方法对爬虫而言很重要。
我们在store_name/spiders/目录下创建了“store_name.py”爬虫并添加如下的代码来从fatwallet.com上提取点名。爬虫的输出到文件(**StoreName.txt**见图7。
我们在store_name/spiders/目录下创建了“store_name.py”爬虫并添加如下的代码来从fatwallet.com上提取店名。爬虫的输出写到文件(**StoreName.txt**见图7。
from scrapy.selector import Selector
from scrapy.spider import BaseSpider
@ -113,7 +112,7 @@ Above command creates a directory with title “store_name” at current path. T
![Fig:7 Output of the Spider code .](http://blog.linoxide.com/wp-content/uploads/2014/11/f7.png)
图:7 爬虫的输出
*图:7 爬虫的输出*
*注意: 本教程的目的仅用于理解scrapy框架*
@ -123,7 +122,7 @@ via: http://linoxide.com/ubuntu-how-to/scrapy-install-ubuntu/
作者:[nido][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -2,13 +2,13 @@
================================================================================
**Git**是一款注重速度、数据完整性、分布式支持和非线性工作流的分布式版本控制工具。Git最初由Linus Torvalds在2005年为Linux内核开发而设计如今已经成为被广泛接受的版本控制系统。
和其他大多数分布式版本控制系统比起来,不像大多数客户端-服务端的系统每个Git工作目录是一个完整的仓库带有完整的历史记录和完整的版本跟踪能力不需要依赖网络或者中心服务器。像Linux内核一样Git意识在GPLv2许可证下的免费软件。
和其他大多数分布式版本控制系统比起来,不像大多数客户端-服务端的系统每个Git工作目录是一个完整的仓库带有完整的历史记录和完整的版本跟踪能力不需要依赖网络或者中心服务器。像Linux内核一样Git也是在GPLv2许可证下分发的自由软件。
本篇教程我会演示如何安装gitlit服务器。gitlit的最新稳定版是1.6.2。[Gitblit][1]是一款开源、纯Java开发的用于管理浏览和服务的[Git][2]仓库。它被设计成一款为希望托管中心仓库的小工作组服务的工具。
本篇教程我会演示如何安装 gitlit 服务器。gitlit的最新稳定版是1.6.2。[Gitblit][1]是一款开源、纯Java开发的用于管理、浏览和提供[Git][2]仓库服务的软件。它被设计成一款为希望托管中心仓库的小工作组服务的工具。
mkdir -p /opt/gitblit; cd /opt/gitblit; wget http://dl.bintray.com/gitblit/releases/gitblit-1.6.2.tar.gz
### 列出目录: ###
### 列出解压后目录内容 ###
root@vps124229 [/opt/gitblit]# ls
./ docs/ gitblit-stop.sh* LICENSE service-ubuntu.sh*
@ -21,7 +21,7 @@
### 启动gitlit服务 ###
### 通过service命令 ###
**通过service命令**
root@vps124229 [/opt/gitblit]# cp service-centos.sh /etc/init.d/gitblit
root@vps124229 [/opt/gitblit]# chkconfig --add gitblit
@ -29,7 +29,7 @@
Starting gitblit server
.
### 手动启动: ###
**手动启动:**
root@vps124229 [/opt/gitblit]# java -jar gitblit.jar --baseFolder data
2015-01-10 09:16:53 [INFO ] *****************************************************************
@ -108,15 +108,15 @@
打开浏览器,依据你的配置进入**http://localhost:8080** 或者 **https://localhost:8443**。 输入默认的管理员授权:**admin / admin** 并点击**Login** 按钮
![snapshot2](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/snapshot2.png)
![snapshot2](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/snapshot2.png)
### 添加用户: ###
![snapshot1](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/snapshot1.png)
![snapshot1](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/snapshot1.png)
添加仓库:
###添加仓库:###
![snapshot3](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/snapshot3.png)
![snapshot3](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/snapshot3.png)
### 用命令行创建新的仓库: ###
@ -140,7 +140,7 @@ via: http://www.unixmen.com/install-gitblit-ubuntu-fedora-centos/
作者:[M.el Khamlichi][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,24 +1,24 @@
Linux上有哪些比较好的C/C++ IDE
Linux 上的最佳 C/C++ IDE
================================================================================
"一个真正的程序员是不用IDE译者注集成开发环境他们都是用带着某某插件的文本编辑器来写代码。"我们总能在某些地方听到此类观点。然而尽管越来越多的人同意这样的观点但是一个IDE仍然非常有用它设置简单使用起来也很方便因此没有更好办法能像这样来编写一个项目了。所以鉴于这点在这里我想给大家列一份在linux平台上比较好的C/C++ IDE清单。为什么特地说C/C++呢因为C语言是我最喜欢的编程语言而且我们总要找个切入点来开始。另外要注意的是通常有很多种编写C代码的方法所以为了消减清单的篇幅我只选择了"真正好用的IDE"而不是诸如Gedit或Vim这种注入[插件][1]的文本编辑器。并不是说这些编辑器在任何情况下都不好,只是如果我将文本编辑器包含进去那这份清单就将永无止境了。
"一个真正的程序员是不用IDE译者注集成开发环境他们都是用带着某某插件的文本编辑器来写代码。"我们总能在某些地方听到此类观点。然而尽管越来越多的人同意这样的观点但是一个IDE仍然非常有用它设置简单使用起来也很方便因此不能比这样更合适编写一个项目了。所以鉴于这点在这里我想给大家列一份在Linux平台上比较好的C/C++ IDE清单。为什么特地说C/C++呢因为C语言是我最喜欢的编程语言而且我们总要找个切入点来开始。另外要注意的是通常有很多种编写C代码的方法所以为了消减清单的篇幅我只选择了"真正好用的IDE"而不是诸如Gedit或Vim这种注入[插件][1]的文本编辑器。并不是说这些编辑器不好,只是如果我将文本编辑器包含进去那这份清单就将永无止境了。
### 1. Code::Blocks ###
![](https://farm8.staticflickr.com/7520/16089880989_10173db27b_c.jpg)
用我个人的最爱来开篇,[Code::Blocks][2]是一款简单快速的专有C/C++ IDE。就像任何一款强大的IDE一样, 它集成了语法高亮、书签功能、自动补全功能、项目管理和一个调试器。它闪耀的地方在于它简单的插件系统里面添加了不可缺少的工具像Valgrind和CppCheck还有不太重要的比如像俄罗斯方块这样的小游戏。但是我特别喜欢它的理由是它连贯方便的快捷键设定和大量的却感受不到受压迫的选项设置。
用我个人的最爱来开篇,[Code::Blocks][2]是一款简单快速的专有C/C++ IDE。就像任何一款强大的IDE一样, 它集成了语法高亮、书签功能、自动补全功能、项目管理和一个调试器。它最闪亮的地方在于它简单的插件系统里面添加了不可缺少的工具像Valgrind和CppCheck还有不太重要的比如像俄罗斯方块这样的小游戏。但是我特别喜欢它的理由是它连贯方便的快捷键设定和大量的却感受不到拥挤的选项设置。
### 2. Eclipse ###
![](https://farm8.staticflickr.com/7522/16276001255_66235a0a69_c.jpg)
我知道我只说"真正好用的IDE"而不是带着插件的文本编辑器,但是,[Eclipse][3]的确是一款"真正好用的IDE"只是Eclipse需要一些[plugin][4]或经过一些改装来编写C程序所以严格来说我无法反驳我自己。而且做一份IDE清单不提到Eclipse这个“巨人”是不可能的事情。无论喜欢它与否Eclipse仍然是一款强大的Java编程工具。这里要感谢[CDT 项目][5]让Eclipse编写C程序变得可能。你同样可以体验到Eclipse的强大功能包括它的一些传统功能特点比如自动补全、代码大纲、代码生成器和先进的重构功能。照我话说它的不足之处在于它不如Code::Blocks那么轻量级它仍然很臃肿要花费很多时间去载入。但是如果你的电脑可以驾驭它或者你是个忠实的Eclipse粉那么它一定是你的不二选择。
我知道我只说"真正好用的IDE"而不是带着插件的文本编辑器,但是,[Eclipse][3]的确是一款"真正好用的IDE"只是Eclipse需要一些[插件][4]或经过一些改装来编写C程序所以严格来说我无法反驳我自己。而且做一份IDE清单不提到Eclipse这个“巨人”是不可能的事情。无论喜欢它与否Eclipse仍然是一款强大的Java编程工具。这里要感谢[CDT 项目][5]让Eclipse编写C程序变得可能。你同样可以体验到Eclipse的强大功能包括它的一些传统功能特点比如自动补全、代码大纲、代码生成器和先进的重构功能。照我话说它的不足之处在于它不如Code::Blocks那么轻量级它仍然很臃肿要花费很多时间去载入。但是如果你的电脑可以驾驭它或者你是个忠实的Eclipse粉那么它一定是你的不二选择。
### 3. Geany ###
![](https://farm9.staticflickr.com/8573/16088461968_c6a6c9e49a_c.jpg)
牺牲了很多特色功能但是增加了很多灵活性,[Geany][6]就是这样一款与Eclipse对立的软件。但是对于它所缺乏的地方比如说没有调试器, Geany用一些漂亮小巧的特色功能弥补了它们:一个可以做笔记的区域、基于模板创作、代码大纲、自定义快捷键和插件管理。相比于现在的IDEGeany仍然是一款作用广泛的文本编辑器然而因为它的功能亮点和它的界面设计所以我把它放在这份列表里。
牺牲了很多特色功能但是增加了很多灵活性,[Geany][6]就是这样一款与Eclipse对立的软件。但是对于它所缺乏的地方比如说没有调试器, Geany用一些漂亮小巧的特色功能弥补了它们一个可以做笔记的区域、基于模板创作、代码大纲、自定义快捷键和插件管理。相比于现在的IDEGeany仍然是一款作用广泛的文本编辑器然而因为它的功能亮点和它的界面设计所以我把它放在这份列表里。
### 4. MonoDevelop ###
@ -30,19 +30,19 @@ Linux上有哪些比较好的C/C++ IDE
![](https://farm8.staticflickr.com/7514/16088462018_7ee6e5b433_c.jpg)
它身上有着强烈的“GNOME感”[Anjuta][8]的外观很具争议。我倾向于把它看作是带着调试器的Geany升级版但是它的界面实际上要复杂得多。我确实很享受能在项目、文件夹和代码大纲视图之间来回切换的标签系统我本想用诸如更多的快捷方法来移动文件然而这是一个很好的提供了显著编译功能和构建选项的工具它能够支持哪些很有特点的需求。
它身上有着强烈的“GNOME即视感”,[Anjuta][8]的外观很具争议。我倾向于把它看作是带着调试器的Geany升级版但是它的界面实际上要复杂得多。我确实很享受能在项目、文件夹和代码大纲视图之间来回切换的标签系统我本想用诸如更多的快捷方法来移动文件然而这是一个很好的提供了显著编译功能和构建选项的工具它能够支持哪些很有特点的需求。
### 6. Komodo Edit ###
![](https://farm8.staticflickr.com/7502/16088462028_81d1114c84_c.jpg)
我不是非常熟悉[Komodo Edit][9],但是在试用了一段时间之后,我被它很多很多的优点给惊喜到了。首先,基于标签的导航功能有很强的可预见性。其次它奇特的代码大纲让我想到了Sublime Text。此外它的宏系统和文件比较器使得Komodo Edit非常实用。它的插件库让它几乎是完美的说“几乎”是因为在其它IDE里我的确找不到能与之相媲美的快捷方法了。而且我们能享受到更多特别的C/C++工具这往往是普通IDE的不足之处。然而Komodo Edit就能做到。
我不是非常熟悉[Komodo Edit][9]但是在试用了一段时间之后我被它很多很多的优点给惊喜到了。首先基于标签的导航功能有很强的可预见性。其次它奇特的代码大纲让我想到了Sublime Text。此外它的宏系统和文件比较器使得Komodo Edit非常实用。它的插件库让它几乎是完美的说“几乎”是因为在其它IDE里我的确找不到能与之相媲美的快捷方法了。而且我们能享受到更多特别的C/C++工具这往往是普通IDE的不足之处。然而Komodo Edit就能做到。
### 7. NetBeans ###
![](https://farm8.staticflickr.com/7569/16089881229_98beb0fce3_c.jpg)
就好像Eclipse一样这又是一款不得不提的“巨人级”软件。拥有的功能包括通过标签进行导航、项目管理、代码大纲、更改历史追踪和大量工具[NetBeans][10]可能是最完整的IDE了我能用半页来列出它所有让人震惊的特色功能。但是这同时也很容易地向你透露了它的主要缺点它太臃肿了。比起它的强大我更喜欢基于插件的软件因为我觉得不太会有人为了一个同样的项目同时需要Git和Mercurial相结合来工作我是不是很疯狂但是如果你有耐心去掌握它所有的选项那你差不多无论到哪里都是IDE大师了。
就好像Eclipse一样这又是一款不得不提的“巨人级”软件。拥有的功能包括通过标签进行导航、项目管理、代码大纲、更改历史追踪和大量工具[NetBeans][10]可能是最完整的IDE了我能用半页来列出它所有让人震惊的特色功能。但是这同时也很容易地向你透露了它的主要缺点它太臃肿了。比起它的强大我更喜欢基于插件的软件因为我觉得不太会有人为了一个同样的项目同时需要Git和Mercurial相结合来工作我是不是很疯狂但是如果你有耐心去掌握它所有的选项那你差不多无论到哪里都是IDE大师了。
### 8. KDevelop ###
@ -56,7 +56,7 @@ Linux上有哪些比较好的C/C++ IDE
留在最后的不代表是最差的,[CodeLite][12]展现给你一种传统的编程规则却仍然能让你从它身上那特有的感觉上有所收获即使它的界面一开始的确让我想到了Code::Blocks和Anjuta只是不包括大量的插件库。无论你想要比较文件、插入一条版权块、定义缩略语或者用Git来工作总有一款插件适合你。如果我不得不挑点毛病我想说它缺乏一些符合我口味的导航快捷键但这是真的。
最后我希望这份清单能让你给自己最喜欢的语言探索到更多新的IDE。虽然Code::Blocks仍然是我的最爱不过它有一些很强大的对手。当然我们也可以远离Linux上的IDE用文本编辑器去编写C/C++代码。所以如果你有什么其它的建议想法在评论中让我们获悉。或者如果你想要我再说说关于一些其它语言的IDE也可以评论里提出。
最后我希望这份清单能让你给自己最喜欢的语言探索到更多新的IDE。虽然Code::Blocks仍然是我的最爱不过它有一些很强大的对手。当然我们也可以远离Linux上的IDE,而用文本编辑器去编写C/C++代码。所以如果你有什么其它的建议想法在评论中让我们获悉。或者如果你想要我再说说关于一些其它语言的IDE也可以评论里提出。
--------------------------------------------------------------------------------
@ -64,7 +64,7 @@ via: http://xmodulo.com/good-ide-for-c-cpp-linux.html
作者:[Adrien Brochard][a]
译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,6 +1,6 @@
20个Unix命令技巧 - 第一部分
20个 Unix/Linux 命令技巧(一)
================================================================================
让我们用**这些Unix命令技巧**开启新的一年,提高在终端下的生产力。我已经找了很久了,现在就与你们分享。
让我们用**这些Unix/Linux命令技巧**开启新的一年,提高在终端下的生产力。我已经找了很久了,现在就与你们分享。
![](http://s0.cyberciti.org/uploads/cms/2015/01/unix-command-line-tricks.001.jpg)
@ -9,16 +9,15 @@
我在生产服务器上有一个很大的200GB的日志文件需要删除。我的rm和ls命令已经崩溃我担心这是由于巨大的磁盘IO造成的要删除这个大文件输入
> /path/to/file.log
# or use the following syntax
# 或使用如下格式
: > /path/to/file.log
# finally delete it
# 然后删除它
rm /path/to/file.log
### 如何缓存终端输出? ###
尝试使用script命令行工具来为你的终端输出创建typescript。
### 如何记录终端输出? ###
试试使用script命令行工具来为你的终端输出创建输出记录。
script my.terminal.sessio
@ -28,7 +27,7 @@
date
sudo service foo stop
要退出结束script绘画),输入*exit* 或者 *logout* 或者按下 *control-D*
要退出结束script会话),输入 *exit* 或者 *logout* 或者按下 *control-D*
exit
@ -38,11 +37,10 @@
less my.terminal.session
cat my.terminal.session
### 还原删除的 /tmp 文件夹 ###
### 还原删除的 /tmp 文件夹 ###
我在文章[Linux和Unix shell我犯了一些错误][1]。我意外地删除了/tmp文件夹。要还原它我需要这么做
mkdir /tmp
chmod 1777 /tmp
chown root:root /tmp
@ -50,11 +48,11 @@
### 锁定一个文件夹 ###
为了我的数据隐私,我想要锁定我文件服务器下的/downloads文件夹。因此我运行
为了我的数据隐私,我想要锁定我文件服务器下的/downloads文件夹。因此我运行
chmod 0000 /downloads
root用户仍旧可以访问但是ls和cd命令还不可用。要还原它用:
root用户仍旧可以访问而ls和cd命令则不工作。要还原它用:
chmod 0755 /downloads
@ -66,40 +64,40 @@ root用户仍旧可以访问但是ls和cd命令还不可用。要还原它用
或者在退出vim之前使用:X 命令来加密你的文件vim会提示你输入一个密码。
### 清除屏幕上的输出 ###
### 清除屏幕上的乱码 ###
只要输入:
reset
### 成为人类 ###
### 易读格式 ###
传递*-h*或者*-H*和其他选项选项给GNU或者BSD工具来获取像ls、df、du等命令以人类可读的格式输出:
传递*-h*或者*-H*和其他选项选项给GNU或者BSD工具来获取像ls、df、du等命令以读的格式输出:
ls -lh
# 以人类可读的格式 (比如: 1K 234M 2G)
# 以读的格式 (比如: 1K 234M 2G)
df -h
df -k
# 已字节输出如: KB, MB, or GB
# 以字节、KB、MB 或 GB 输出:
free -b
free -k
free -m
free -g
# 以人类可读的格式打印 (比如 1K 234M 2G)
# 以易读的格式输出 (比如 1K 234M 2G)
du -h
# 以人类可读的格式获取系统perms
# 以易读的格式显示文件系统权限
stat -c %A /boot
# 比较人类可读的数字
# 比较读的数字
sort -h -a file
# 在Linux上以人类可读的形式显示cpu信息
# 在Linux上以读的形式显示cpu信息
lscpu
lscpu -e
lscpu -e=cpu,node
# 以人类可读的形式显示每个文件的大小
# 以读的形式显示每个文件的大小
tree -h
tree -h /boot
### 在Linux系统中显示已知用户信息 ###
### 在Linux系统中显示已知用户信息 ###
只要输入:
@ -143,7 +141,7 @@ root用户仍旧可以访问但是ls和cd命令还不可用。要还原它用
### 我如何删除意外在当前文件夹下解压的文件? ###
我意外在/var/www/html/而不是/home/projects/www/current下解压了一个tarball。它混乱了/var/www/html下的文件。最简单修复这个问题的方法是:
我意外在/var/www/html/而不是/home/projects/www/current下解压了一个tarball。它搞乱了/var/www/html下的文件你甚至不知道哪些是误解压出来的。最简单修复这个问题的方法是:
cd /var/www/html/
/bin/rm -f "$(tar ztf /path/to/file.tar.gz)"
@ -166,7 +164,7 @@ root用户仍旧可以访问但是ls和cd命令还不可用。要还原它用
## 以root用户运行最后运行的命令
sudo !!
!!会运行最近使用的命令。要运行最近运行的“foo”命令
!!会运行最近使用的命令。要运行最近运行的“foo”开头命令:
!foo
# 以root用户运行上一次以“service”开头的命令
@ -180,12 +178,11 @@ root用户仍旧可以访问但是ls和cd命令还不可用。要还原它用
# 测试 nginx.conf
/sbin/nginx -t -c /etc/nginx/nginx.conf
# 测试完 "/sbin/nginx -t -c /etc/nginx/nginx.conf"你可以用vi编辑了
# 测试完 "/sbin/nginx -t -c /etc/nginx/nginx.conf"你可以用vi再次编辑这个文件
sudo vi !$
### 在你要离开的时候留下一个提醒 ###
### 在终端上提醒你必须得走了 ###
If you need a reminder to leave your terminal, type the following command:
如果你需要提醒离开你的终端,输入下面的命令:
leave +hhmm
@ -200,26 +197,26 @@ If you need a reminder to leave your terminal, type the following command:
cd -
需要快速地回到家目录?输入:
需要快速地回到你的家目录?输入:
cd
变量*CDPATH*定义了含有这个目录的搜索目录路径:
变量*CDPATH*定义了目录的搜索路径:
export CDPATH=/var/www:/nas10
现在不用输入cd */var/www/html/ ,我可以直接输入下面的命令进入/var/www/html
现在不用输入cd */var/www/html/ 这样长了,我可以直接输入下面的命令进入 /var/www/html
cd html
### 编辑一个用less浏览的文件 ###
### 在less浏览时编辑文件 ###
要编辑一个用less浏览的文件按下v。你就可以用变量$EDITOR下的编辑器来编辑了:
要编辑一个正在用less浏览的文件可以按下v。你就可以用变量$EDITOR所指定的编辑器来编辑了:
less *.c
less foo.html
## 下v编辑文件 ##
## 退出编辑器你可以继续用less浏览了 ##
## 下v键来编辑文件 ##
## 退出编辑器你可以继续用less浏览了 ##
### 列出你系统中的所有文件和目录 ###
@ -237,14 +234,14 @@ If you need a reminder to leave your terminal, type the following command:
# 列出 $HOME 中所有的文件
find $HOME -type f -ls | less
### 用一条命令构造命令树 ###
### 用一条命令构造目录树 ###
你可以用mkdir加上-p选项一次创建目录树
你可以用mkdir加上-p选项一次创建一颗目录树:
mkdir -p /jail/{dev,bin,sbin,etc,usr,lib,lib64}
ls -l /jail/
### 复制文件到多个目录中 ###
### 将文件复制到多个目录中 ###
不必运行:
@ -260,16 +257,16 @@ If you need a reminder to leave your terminal, type the following command:
### 快速找出两个目录的不同 ###
diff命令会按行比较文件。它也可以比较两个目录
diff命令会按行比较文件。但是它也可以比较两个目录:
ls -l /tmp/r
ls -l /tmp/s
# Compare two folders using diff ##
# 使用 diff 比较两个文件夹
diff /tmp/r/ /tmp/s/
[![Fig. : Finding differences between folders](http://s0.cyberciti.org/uploads/cms/2015/01/differences-between-folders.jpg)][3]
图片: 找出目录之间的不同
*图片: 找出目录之间的不同*
### 文本格式化 ###
@ -281,13 +278,13 @@ diff命令会按行比较文件。它也可以比较两个目录
fmt -s file.txt
### 看见输出并写入到一个文件中 ###
### 可以看见输出并将其写入到一个文件中 ###
如下使用tee命令在屏幕上看见输出并同样写入到日志文件my.log中
mycoolapp arg1 arg2 input.file | tee my.log
tee可以保证你同时在屏幕上看到mycoolapp的输出和写入文件
tee可以保证你同时在屏幕上看到mycoolapp的输出并写入文件  my.log
--------------------------------------------------------------------------------
@ -295,7 +292,7 @@ via: http://www.cyberciti.biz/open-source/command-line-hacks/20-unix-command-lin
作者:[nixCraft][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,42 +1,42 @@
在短短几个小时里拿回自己数据的隐私和控制权:为自己和朋友们搭建私有云
权威指南:构建个人私有云,拿回你的数据隐私的控制权!
================================================================================
8年里40'000多次搜索这是我的Google搜索历史。你的呢可以在[这里][1]自己找一下有经过这么长时间积累下来的这么多数据点Google已经能非常精确的推测你对什么感兴趣曾经的想法担忧过的事情以及从你第一次获得Google帐号后这些年里所有这些的变化。
8年里40000多次搜索这是我的Google搜索历史。你的呢可以在[这里][1]自己找一下有经过这么长时间积累下来的这么多数据点Google已经能非常精确的推测你对什么感兴趣、曾经的想法、担忧过的事情以及从你第一次获得Google帐号后这些年里所有这些的变化
### 很多非常私人的信息不受自己控制地存储在世界范围内的服务器上 ###
## 很多非常私人的信息不受自己控制地存储在世界范围内的服务器上 ##
比如说你也像我一样从2006年到2013年都是Gmail用户意味着你收到了30'000+的电子邮件以及在这7年里写了差不多5000封电子邮件。这些发送或收到的电子邮件里有很多是非常私人的私人到你甚至不希望自己的家人或好友系统地查看。也许你还写过一些草稿邮件因为最后一分钟改变主意而从没发出去。但是尽管你从未发出去这些邮件仍然保存在服务器上的某个地方。结论是说Google服务器比你最亲密的朋友或家人都更了解你的个人生活一点也不过分。
比如说你也像我一样从2006年到2013年都是Gmail用户意味着你收到了30000封以上的电子邮件以及在这7年里写了差不多5000封电子邮件。这些发送或收到的电子邮件里有很多是非常私人的私人到你甚至不希望自己的家人或好友可以系统地查看。也许你还写过一些草稿邮件因为最后一分钟改变主意而从没发出去。但是尽管你从未发出去这些邮件仍然保存在服务器上的某个地方。结论是说Google服务器比你最亲密的朋友或家人都更了解你的个人生活一点也不过分。
从统计数据来看,可以很安全地赌你拥有一部智能手机。如果不使用联系人应用的话手机将基本没法用而它默认会将你的联系人信息保存到Google服务器上的Google联系人里。所以现在Google不仅知道了你的电子邮件还有了你的离线联系人你喜欢打给谁,谁来过电话,你发过短信给谁以及发了些什么。你也不需要听我的片面之词可以自己检查一下看看你开放给类似Google Play服务的一些应用的权限用来读取来电信息以及收到的短信。你是否还会用到手机里自带的日历应用除非你在设置日程的时候明确地去掉那么Google将精确地知道你将要做什么一天里的每个时段,每一天,每一年。用iPhone代替Android手机也是一样的只是Apple会代替Google来掌握你的往来邮件联系人和日程计划。
从统计数据来看,我可以很保险地打赌你拥有一部智能手机。如果不使用联系人应用的话手机将基本没法用而它默认会将你的联系人信息保存到Google服务器上的Google联系人里。所以现在Google不仅知道了你的电子邮件还有了你的离线联系人你喜欢打给谁、谁来过电话、你发过短信给谁以及发了些什么。你也不需要听我的片面之词可以自己检查一下看看你开放给类似Google Play服务的一些应用的权限用来读取来电信息以及收到的短信。你是否还会用到手机里自带的日历应用除非你在设置日程的时候明确地去掉同步那么Google将精确地知道你将要做什么一天里的每个时段、每一天、每一年。用iPhone代替Android手机也是一样的只是Apple会代替Google来掌握你的往来邮件联系人和日程计划。
你是否还会非常小心地同步自己的联系人信息在你朋友同事或家人换工作或换服务商的时候更新他们的电子邮件地址和手机号这给Google提供了一副你社交网络的非常精确的,最新的图片。还有你非常喜欢手机的GPS功能经常配合Google地图使用。这意味着Google不仅能从日程里知道你在干什么还知道你在哪儿住在哪儿在哪儿工作。然后再关联用户之间的GPS位置信息GOogle还能知道你现在可能正在和哪些人来往。
你是否还会非常小心地同步自己的联系人信息在你朋友同事或家人换工作或换服务商的时候更新他们的电子邮件地址和手机号这给Google提供了一副你的社交网络的非常精确的、最新的描绘。还有你非常喜欢手机的GPS功能经常配合Google地图使用。这意味着Google不仅能从日程里知道你在干什么还知道你在哪儿、住在哪儿、在哪儿工作。然后再关联用户之间的GPS位置信息Google还能知道你现在可能正在和哪些人来往。
### 这种泄漏自己私人信息的日常爱好会以一种甚至没人能够预测的方式影响你的生活 ###
## 这种泄漏自己私人信息的日常爱好会以一种甚至没人能够预测的方式影响你的生活 ##
总结一下如果你是一个普通的因特网用户Google拥有过去差不多10年里你最新的,深度的信息,关于你的兴趣,忧虑,热情,疑问。它还收集了一些你很私人的信息(电子邮件,短信),精确到小时的你的日常活动和位置,一副你社交网络的高品质图片。关于你的如此私密的数据,很可能已经超越了你最亲密的朋友,家人或爱人对你的了解。
总结一下如果你是一个普通的因特网用户Google拥有过去差不多10年里你最新的、深度的信息,关于你的兴趣、忧虑、热情、疑问。它还收集了一些你很私人的信息(电子邮件、短信),精确到小时的你的日常活动和位置,一副你社交网络的高精度的描绘。关于你的如此私密的数据,很可能已经超越了你最亲密的朋友,家人或爱人对你的了解。
不敢想象把这些深度的个人信息交给完全陌生的人就好像把这些信息拷到一个U盘里然后随便放到某个咖啡厅的桌上留张纸条说“Olivier Martin的个人数据请随便”。谁知道什么人会拿到它以及用来干嘛然而我们毫不犹豫地把自己的主要信息交给那些对我们的数据很感兴趣的IT公司的陌生人这是他们制造面包的材料以及[世界级的数据分析专家][2]手里,也许只是因为我们在点击那个绿色的'接受'按钮时根本没有想这么多。
有这么多的高质量信息这么多年里Google可能会比你希望自我了解的更了解你自己尼玛回想我过去的数字生活我已经不记得5年前发出的邮件里的一半了。我很高兴能重新发现早在2005年对马克思主义的兴趣以及第二年加入了[ATTAC][3]一个致力于通过征收金融交易税来限制投机和改善社会公平的组织。天知道为什么我竟然在2007年这么喜欢跳舞。这些都是无关紧要的信息你不要指望我能爆出什么猛料,不会吧?;-)。但是,连接起这些高质量数据点,关于你生活的方方面面(做什么,什么时候,和谁一起,在哪里,...并跨越这么长时间间隔应该能推测出你的未来状态。比如说根据一个17岁女孩的购物习惯超市甚至可以在他父亲听说之前断定这个女孩怀孕了[真实故事][4]。谁知道通过像Google所掌握的这些远远超出购物习惯的高质量数据能做些什么连接起这些点也许有人能预测你未来几年里口味或政治观点的变化。如今,[你从未听过的公司声称拥有你500项数据点][5],包括宗教信仰性取向和政治观点。提到政治如果说你决定今后10年内进入政坛会怎么样你的生活会改变你的观点也一样甚至你有时候会有所遗忘但是Google不会。那你会不会担心你的对手会接触一些可以从Google访问你数据的人并会从你过去这些年里积累的个人数据深渊里挖出一些猛料呢[就像最近Sony被黑][6]一样多久以后会轮到Google或Facebook以致让你的个人信息最终永远暴露
有这么多的高质量信息这么多年里Google可能会比你希望自我了解的更了解你自己尼玛回想我过去的数字生活5年前发出的邮件里有一半我已经不记得了。我很高兴能重新发现早在2005年对xxx主义的兴趣以及第二年加入了[ATTAC][3]一个致力于通过征收金融交易税来限制投机和改善社会公平的组织。天知道为什么我竟然在2007年这么喜欢跳舞。这些都是无关紧要的信息你不指望我能爆出什么猛料,是吧?;-)。但是,连接起这些高质量数据点,关于你生活的方方面面(做什么、什么时候、和谁一起、在哪里,...并跨越这么长时间间隔应该能推测出你的未来状态。比如说根据一个17岁女孩的购物习惯超市甚至可以在他父亲听说之前断定这个女孩怀孕了这是一个[真实故事][4]。谁知道通过像Google所掌握的这些远远超出购物习惯的高质量数据能做些什么连接起这些点也许有人能预测你未来几年里口味或观点的变化。如今[你从未听过的公司声称拥有你500项数据点][5],包括宗教信仰性取向和政治观点。提到政治如果说你决定今后10年内进入政坛会怎么样你的生活会改变你的观点也一样甚至你有时候会有所遗忘但是Google不会。那你会不会担心你的对手会接触一些可以从Google访问你数据的人并会从你过去这些年里积累的个人数据深渊里挖出一些猛料呢[就像最近Sony被黑][6]一样多久以后会轮到Google或Facebook以致让你的个人信息最终永远暴露
我们大多数人把自己的个人数据托付给这些公司的一个原因就是它们提供免费服务。但是真的免费吗一般的Google帐号的价值根据评估方式不同会有些差别你花在写邮件上的时间占到[1000美元/年][7],你的帐号对于广告产业的价值差不多在[220美元/年][8]到[500美元/年][9]之间。所以这些服务并不是真的免费:会通过广告和我们的数据在未来的一些未知使用来间接付费。
我写的最多的是Google这是因为这是我托付个人数字信息的以及目前我所知道做的最好的公司。但是我也提到过Apple或Facebook。这些公司通过它们在设计工程和我们(曾经)喜欢每天使用的服务方面的神奇进步实实在在地改变了世界。但是这并不是说我们应该把所有我们最私人的个人数据堆积到它们的服务器上并把我们的数字生活托付给它们:潜在的危害实在太大了。
我写的最多的是Google这是因为这是我托付个人数字信息的以及目前我所知道做的最好的公司。但是我也提到过Apple或Facebook。这些公司通过它们在设计工程和我们(曾经)喜欢每天使用的服务方面的神奇进步实实在在地改变了世界。但是这并不是说我们应该把所有我们最私人的个人数据堆积到它们的服务器上并把我们的数字生活托付给它们:潜在的危害实在太大了。
### 只要5小时拿回自己以及关心的人的隐私权 ###
## 只要5小时拿回自己以及关心的人的隐私权 ##
并不是一定要这样做。你可以生活在21世纪拿着智能手机每天都用电子邮件和GPS却仍然可以保留自己的隐私。你所需要的就是拿回自己个人数据的控制权邮件、日程、联系人、文件等等。[Prism-Break.org][10]网站上列出了一些能帮你掌握个人数据命运的软件。除此以外,控制自己个人数据的最安全和最有效的方式是架设自己的服务器并搭建自己的云。不过你也许只是没有时间或精力去研究具体该怎么做以及如何让它能流畅工作。
但是事实并不是一定必须这样的。你可以生活在21世纪拿着智能手机每天都用电子邮件和GPS却仍然可以保留自己的隐私。你所需要的就是拿回自己个人数据的控制权邮件、日程、联系人、文件等等。[Prism-Break.org][10]网站上列出了一些能帮你掌握个人数据命运的软件。除此以外,控制自己个人数据的最安全和最有效的方式是架设自己的服务器并搭建自己的云。不过你也许只是没有时间或精力去研究具体该怎么做以及如何让它能流畅工作。
这也是这篇文章的意义所在。仅仅5个小时内我们将配置出一台服务器来支撑你的邮件、联系人、日程表和各种文件为你、你的朋友和你的家人。这个服务器将设计成一个个人数据中心或云所以你能时刻保留它的完整控制。数据将自动在你的台式机/笔记本、手机和平板之间同步。从根本上来说,**我们将建立一个系统来代替Gmail、Google文件/Dropbox、Google联系人、Google日历和Picasa**。
为自己做这件事情已经是迈出很大一步了。但是你个人信息的很大一部分将仍然泄漏出去并保存到硅谷的一些主机上只是因为和你日常来往的太多人在用Gmail和使用智能手机所以最好是带上你一些比较亲近的人加入这次探险。
为自己做这件事情已经是迈出很大一步了。但是你个人信息的很大一部分将仍然泄漏出去并保存到硅谷的一些主机上只是因为和你日常来往的太多人在用Gmail和使用智能手机所以最好是带上你一些比较亲近的人加入这次探险。
我们将构建的系统能够
我们将构建的系统能够
- **支持任意数目的域名和用户**。这样就能轻易地和你的家人朋友共享这台服务器,所以他们也能掌控自己的个人数据,并且还能和你一起分摊服务费用。和你一起共享服务器的人可以使用他们自己的域名或者共享你的。
- **允许你从任意网络发送和接收电子邮件**,需要成功登录服务器之后。这样,你可以通过任意的邮件地址,任意设备(台式机、手机、平板),任意网络(家里、公司、公共网络、...)来发送电子邮件。
- **允许你从任意网络发送和接收电子邮件**,需要成功登录服务器之后。这样,你可以通过任意的邮件地址、任意设备(台式机、手机、平板)、任意网络(家里、公司、公共网络、...)来发送电子邮件。
- **在发送和接收邮件的时候加密网络数据**,这样,你不信任的人不能钓出你的密码,也不能看到你的私人邮件。
- **提供最先进的反垃圾邮件技术**,结合了已知垃圾邮件黑名单,自动灰名单,和自适应垃圾邮件过滤。如果邮件被误判了只需要简单地把它拖入或拖出垃圾目录就可以重新配置垃圾邮件过滤器。而且,服务器还会为基于社区的反垃圾邮件努力做出贡献。
- **一段时间里只需要几分钟的维护**基本上只是安装安全更新和简单地检查一下服务器日志。添加一个新的邮件地址只需要在数据库中插入一条记录。除此之外你可以忘记它的存在过自己的生活。我在14个月之前搭建了本文描述的这个系统从那以后就一直顺利运行。所以我完全把它给忘了直到我最近觉得随便按下手机上的检查邮件会导致电子一路跑到冰岛我放置服务器的地方再回来的想法有点好笑才想起来。
- **提供最先进的反垃圾邮件技术**,结合了已知垃圾邮件黑名单、自动灰名单、和自适应垃圾邮件过滤。如果邮件被误判了只需要简单地把它拖入或拖出垃圾目录就可以重新调校垃圾邮件过滤器。而且,服务器还会为基于社区的反垃圾邮件努力做出贡献。
- **一段时间里只需要几分钟的维护**基本上只是安装安全更新和简单地检查一下服务器日志。添加一个新的邮件地址只需要在数据库中插入一条记录。除此之外你可以忘记它的存在过自己的生活。我在14个月之前搭建了本文描述的这个系统从那以后就一直顺利运行。所以我完全把它给忘了直到我最近觉得随便按下手机上的检查邮件会导致电子信号一路跑到冰岛(我放置服务器的地方)再回来的想法有点好笑才想起来。
要完成这篇文章里的工作你需要一点基本的技术能力。如果你知道SMTP和IMAP的区别什么是DNS以及对TCP/IP有基本了解的话就够了。你还将需要一点基本的Unix知识在命令行下和文件一起工作基本的系统管理。然后你需要花总共5小时时间来搭建。
@ -49,7 +49,7 @@
- [使用Owncloud提供日历联系人文件服务并配置webmail][15]
- [在云上同步你的设备][16]
### 这篇文章是受之前工作的启发并以之为基础 ###
## 这篇文章是受之前工作的启发并以之为基础 ##
本文很大程度参考了两篇文章,由[Xavier Claude][17]和[Drew Crawford][18]写的关于架设私有邮件服务器的介绍。
@ -62,13 +62,13 @@
- 我增加了webmail。
- 我增加了设定云服务器的部分,不仅能收发邮件还能管理文件,地址本/联系人(邮件地址,电话号码,生日,等等等),日程表和图片,供所有设备访问使用。
### 申请一个虚拟私人服务器,一个域名,并把它们配置好 ###
## 申请一个虚拟私人服务器,一个域名,并把它们配置好 ##
让我们从设置基础设施开始:我们的虚拟私人主机和我们的域名。
我用过[1984.is][19]和[Linode][20]提供的虚拟私人主机VPS体验非常好。在本文中我们将使用**Debian Wheezy**这个在1984和Linode都提供了已经做好的映像文件可以直接布置到你的VPS上。我喜欢1984是因为它的服务器在冰岛也是唯一使用可再生能源地热和水力发电的地方目前还没有影响过气候变化不像[大多数美国数据中心目前大多数依赖于烧煤的火力发电站][21]。而且,他们注重[民权,透明,自由][22]以及[免费软件][23]。
最好是在服务器上创建一个文件用来保存后面要用到的各种密码(用户账号,邮件账号,云帐号,数据库帐号)。当然最好是加密一下(可以用[GnuPG][24]),这样就算用来设定服务器的电脑被偷了或被入侵了,你的服务器就不会那么容易被攻击。
最好是在服务器上创建一个文件用来保存后面要用到的各种密码(用户账号、邮件账号、云帐号、数据库帐号)。当然最好是加密一下(可以用[GnuPG][24]),这样就算用来设定服务器的电脑被偷了或被入侵了,你的服务器就不会那么容易被攻击。
关于注册域名,我已经使用[grandi][25]的服务超过10年了也很满意。在本文中我们将开辟一个叫**jhausse.net**的域名。然后在上面增加一个叫**cloud.jhausse.net**的二级域名并绑定MX纪录。在完成之后设置比较短的纪录生存时间TTL比如300秒这样你在设置服务器的时候可以修改你的域并很快测试到结果。
@ -78,7 +78,7 @@
adduser roudy
然后,在文件**/etc/ssh/sshd_config**中设置
然后,在文件**/etc/ssh/sshd\_config**中设置
PermitRootLogin no
@ -90,7 +90,7 @@
cloud
然后编辑ssh服务的公钥文件**/etc/ssh/ssh_host_rsa_key.pub, /etc/ssh/ssh_host_dsa_key.pub, /etc/ssh/ssh_host_ecdsa_key.pub**,这样文件末尾可以反映你的主机名,比如**root@cloud**。然后重启系统保证主机名在系统的每个需要它的角落都生效了。
然后编辑ssh服务的公钥文件**/etc/ssh/ssh\_host\_rsa\_key.pub, /etc/ssh/ssh\_host\_dsa\_key.pub, /etc/ssh/ssh\_host\_ecdsa\_key.pub**,这样文件末尾可以反映你的主机名,比如**root@cloud**。然后重启系统保证主机名在系统的每个需要它的角落都生效了。
reboot
@ -103,15 +103,15 @@
apt-get autoremove
apt-get install vim
我喜欢使用vim远程编辑配置文件。打开自动语法高亮会很有帮助。添加下面这一行到**~/.vimrc**文件中。
我喜欢使用vim远程编辑配置文件。打开vim 的自动语法高亮会很有帮助。添加下面这一行到**~/.vimrc**文件中。
syn on
### 设置postfix和dovecot来收发电子邮件 ###
## 设置postfix和dovecot来收发电子邮件 ##
apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-mysql mysql-server dovecot-lmtpd postgrey
在[Postfix][27]的配置菜单里,选择**因特网站点**,把系统邮件名设为**jhausse.net**。
在[Postfix][27]的配置菜单里,选择`Internet Site`,设置这个系统的邮件名称为**jhausse.net**。
现在开始添加一个数据库用于保存主机上管理的域名列表,和每个域名下的用户列表(同时也包括他们各自的密码),以及邮件别名列表(用于从一个地址往另一个地址转发邮件)。
@ -142,14 +142,14 @@
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
我们将承载**jhausse.net**域名。如果还需要加入其他域名,也没问题。我们也会为每个域名设置一个邮件管理地址,转寄给**roudy@jhausse.net**。
这里我们为**jhausse.net**域名提供邮件服务。如果还需要加入其他域名,也没问题。我们也会为每个域名设置一个邮件管理地址postmaster,转寄给**roudy@jhausse.net**。
mysql> INSERT INTO virtual_domains (`name`) VALUES ('jhausse.net');
mysql> INSERT INTO virtual_domains (`name`) VALUES ('otherdomain.net');
mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('1', 'postmaster', 'roudy@jhausse.net');
mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('2', 'postmaster', 'roudy@jhausse.net');
现在已经添加了一个本地邮件账号**roudy@jhausse.net**。首先,为它生成一个哈希密码:
现在已经添加了一个本地邮件账号**roudy@jhausse.net**。首先,为它生成一个密码的哈希串
doveadm pw -s SHA512-CRYPT
@ -157,7 +157,7 @@
mysql> INSERT INTO `mailserver`.`virtual_users` (`domain_id`, `password`, `email`) VALUES ('1', '$6$YOURPASSWORDHASH', 'roudy@jhausse.net');
现在我们的域名别名和用户列表都设置好了然后开始设置postfixSMTP服务器用来发送邮件。把文件**/etc/postfix/main.cf**替换为下面的内容:
现在我们的域名别名和用户列表都设置好了然后开始设置postfix这是一个SMTP服务器用来发送邮件。把文件**/etc/postfix/main.cf**替换为下面的内容:
myhostname = cloud.jhausse.net
myorigin = /etc/mailname
@ -239,7 +239,7 @@
如果一切都正常配置了的话头两个查询应该输出1第3个查询应该输出**roudy@jhausse.net**,而最后一个应该什么都不输出。
现在让我们设置一下dovecot一个IMAP服务程序用来在我们的设备上从服务器获取收件箱里的邮件)。编辑文件**/etc/dovecot/dovecot.conf**设置以下参数:
现在让我们设置一下dovecot一个IMAP服务程序用来在我们的设备上从服务器获取收的邮件)。编辑文件**/etc/dovecot/dovecot.conf**设置以下参数:
# Enable installed protocol
# !include_try /usr/share/dovecot/protocols.d/*.protocol
@ -253,7 +253,7 @@
[...]
first_valid_uid = 0
这样邮件将被保存到目录/var/mail/domainname/username下。注意下这几个选项散布在配置文件的不同位置有时已经在那里写好了我们只需要取消注释。文件里的其他设定选项可以维持原样。在本文后面还有很多文件需要用同样的方式更新设置。在文件**/etc/dovecot/conf.d/10-auth.conf**里,设置以下参数:
这样邮件将被保存到目录 /var/mail/domainname/username 下。注意下这几个选项散布在配置文件的不同位置,有时已经在那里写好了:我们只需要取消注释即可。文件里的其他设定选项,可以维持原样。在本文后面还有很多文件需要用同样的方式更新设置。在文件**/etc/dovecot/conf.d/10-auth.conf**里,设置以下参数:
disable_plaintext_auth = yes
auth_mechanisms = plain
@ -366,9 +366,10 @@
在服务器上,尝试发送邮件给本地用户:
telnet localhost 25
EHLO cloud.jhausse.net
MAIL FROM:youremail@domain.com
rcpt to:roudy@jhausse.net
RCPT TO:roudy@jhausse.net
data
Subject: Hallo!
@ -397,18 +398,18 @@
554 5.7.1 <bob@gmail.com>: Relay access denied
这个没问题如果服务器能接受这封邮件那意味着我们架设的postfix是一个对全世界所有垃圾邮件都开放的中继将完全没法使用。除了'Relay access denied'消息,你也可能会收到这样的响应:
这个没问题:如果服务器能接受这封邮件而不是返回如上的拒绝消息那意味着我们架设的postfix是一个对全世界所有垃圾邮件都开放的中继将完全没法使用。除了'Relay access denied'消息,你也可能会收到这样的响应:
554 5.7.1 Service unavailable; Client host [87.68.61.119] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=87.68.61.119
意思是你正尝试从一个被标记成垃圾邮件发送者的IP地址连接服务器。我在通过普通的因特网服务提供商ISP连接服务器时曾收到过这样的消息。要解决这个问题可以试着从另一个主机发起连接比如另外一个你可以SSH登录的主机。另外一种方式是你可以修改postfix的**main.cf**配置文件不要使用Spamhous的RBL重启postfix服务然后再检查上面的测试是否正常。不管用哪种方式最重要的是你要确定一个能工作的因为我们后面马上要测试其他功能。如果你选择了重新配置postfix不使用RBL别忘了在完成本文后重新开启RBL并重启postfix以避免收到一些不必要的垃圾邮件。
意思是你正尝试从一个被标记成垃圾邮件发送者的IP地址连接服务器。我在通过普通的因特网服务提供商ISP连接服务器时曾收到过这样的消息。要解决这个问题可以试着从另一个主机发起连接比如另外一个你可以SSH登录的主机。另外一种方式是你可以修改postfix的**main.cf**配置文件不要使用Spamhous的RBL重启postfix服务然后再检查上面的测试是否正常。不管用哪种方式最重要的是你要确定一个能工作的因为我们后面马上要测试其他功能。如果你选择了重新配置postfix不使用RBL别忘了在完成本文后重新开启RBL并重启postfix以避免收到一些不必要的垃圾邮件。LCTT 译者注:在国内可以使用 CASA 的 RBLcblplus.anti-spam.org.cn参见http://www.anti-spam.org.cn/ 。)
现在我们试一下往SMTP端口25发送一封有效的邮件这是一般正常的邮件服务器用来彼此对话的方式
openssl s_client -connect cloud.jhausse.net:25 -starttls smtp
EHLO cloud.jhausse.net
MAIL FROM:youremail@domain.com
rcpt to:roudy@jhausse.net
RCPT TO:roudy@jhausse.net
服务器应该有这样的响应
@ -425,7 +426,7 @@
4 UID fetch 1:1 (UID RFC822.SIZE FLAGS BODY.PEEK[])
5 LOGOUT
这里你应该把mypassword替换为你自己为这个邮件账号设定的密码。如果能正常工作基本上我们已经拥有一个能接收邮件的邮件服务器了通过它我们可以在各种设备PC/笔记本,平板,手机,...上收取邮件了。但是我们不能把邮件给它发送出去除非我们自己从服务器发送。现在我们将让postfix为我们转发邮件但是这个只有成功登录才可以这是为了保证邮件是由服务器上的某个有效帐号发出来的。要做到这个我们要打开一个特殊的全程SSL连接的SASL鉴权的邮件提交服务。在文件**/etc/postfix/master.cf**里设置下面的参数:
这里,你应该把*mypassword*替换为你自己为这个邮件账号设定的密码。如果能正常工作基本上我们已经拥有一个能接收邮件的邮件服务器了通过它我们可以在各种设备PC/笔记本、平板、手机...上收取邮件了。但是我们不能把邮件给它发送出去除非我们自己从服务器发送。现在我们将让postfix为我们转发邮件但是这个只有成功登录才可以这是为了保证邮件是由服务器上的某个有效帐号发出来的。要做到这个我们要打开一个特殊的全程SSL连接的SASL鉴权的邮件提交服务。在文件**/etc/postfix/master.cf**里设置下面的参数:
submission inet n - - - - smtpd
-o syslog_name=postfix/submission
@ -437,7 +438,7 @@
-o smtpd_sasl_security_options=noanonymous
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject_non_fqdn_recipient,reject_unauth_destination
然后重启postfix服务
然后重启postfix服务
service postfix reload
@ -446,7 +447,7 @@
openssl s_client -connect cloud.jhausse.net:587 -starttls smtp
EHLO cloud.jhausse.net
注意一下服务器建议的'250-AUTH PLAIN'功能在从端口25连接的时候不会生效
注意一下服务器建议的'250-AUTH PLAIN'功能在从端口25连接的时候不会出现
MAIL FROM:asdf@jkl.net
rcpt to:bob@gmail.com
@ -494,13 +495,13 @@
PS不要忘记再次[试试通过端口25往自己架设的服务器上的帐号发送邮件][29]来验证你已经没有被postgrey阻挡了。
### 阻止垃圾邮件进入你的收件箱 ###
## 阻止垃圾邮件进入你的收件箱 ##
为了过滤垃圾邮件我们已经使用了实时黑名单RBLs和灰名单postgrey。现在我们将增加自适应垃圾邮件过滤来让我们的垃圾邮件过滤能力提高一个等级。这意味着我们将为我们的邮件服务器增加人工智能这样它就能从经验中学习哪些件是垃圾哪些不是。我们将使用[dspam][30]来实现这个功能。
为了过滤垃圾邮件我们已经使用了实时黑名单RBL和灰名单postgrey。现在我们将增加自适应垃圾邮件过滤来让我们的垃圾邮件过滤能力提高一个等级。这意味着我们将为我们的邮件服务器增加人工智能这样它就能从经验中学习哪些件是垃圾哪些不是。我们将使用[dspam][30]来实现这个功能。
apt-get install dspam dovecot-antispam postfix-pcre dovecot-sieve
dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误分类了之后让dovecot重新更新垃圾邮件过滤器。基本上我们所需要做的就只是把邮件放进或拿出垃圾箱。dovecot-antispam将负责调用dspam来更新过滤器。至于postfix-pcre和dovecot-sieve我们将分别用它们来把接收的邮件递给垃圾邮件过滤器以及自动把垃圾邮件放入用户的垃圾箱。
dovecot-antispam是一个安装包可以在我们发现有邮件被dspam误分类了之后让dovecot重新更新垃圾邮件过滤器。基本上我们所需要做的就只是把邮件放进或拿出垃圾箱。dovecot-antispam将负责调用dspam来更新过滤器。至于postfix-pcre和dovecot-sieve我们将分别用它们来把接收的邮件递给垃圾邮件过滤器以及自动把垃圾邮件放入用户的垃圾箱。
在配置文件**/etc/dspam/dspam.conf**里,为以下参数设置相应的值:
@ -535,7 +536,7 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
dovecot unix - n n - - pipe
flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
现在我们将告诉postfix通过dspam来过滤所有提交给服务器端口25一般的SMTP通信的新邮件除非该邮件是从服务器本身发出permit_mynetworks。注意下我们通过SASL鉴权提交给postfix的邮件不会通过dspam过滤因为我们在前面部分里为这种方式设定了独立的提交服务。编辑文件**/etc/postfix/main.cf**将选项**smtpd_client_restrictions**改为如下内容:
现在我们将告诉postfix通过dspam来过滤所有提交给服务器端口25一般的SMTP通信的新邮件除非该邮件是从服务器本身发出permit\_mynetworks。注意下我们通过SASL鉴权提交给postfix的邮件不会通过dspam过滤因为我们在前面部分里为这种方式设定了独立的提交服务。编辑文件**/etc/postfix/main.cf**将选项**smtpd\_client\_restrictions**改为如下内容:
smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, check_policy_service inet:127.0.0.1:10023, check_client_access pcre:/etc/postfix/dspam_filter_access
@ -544,11 +545,11 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
# For DSPAM, only scan one mail at a time
dspam_destination_recipient_limit = 1
现在我们需要指定我们定义的过滤器。基本上我们将告诉postfix把所有邮件/./通过unix套接字发给dspam。创建一个新文件**/etc/postfix/dspam_filter_access**并把下面一行写进去:
现在我们需要指定我们定义的过滤器。基本上我们将告诉postfix把所有邮件如下用 /./ 代表通过unix套接字发给dspam。创建一个新文件**/etc/postfix/dspam\_filter\_access**并把下面一行写进去:
/./ FILTER dspam:unix:/run/dspam/dspam.sock
这是postfix部分的配置。现在让我们为dovecot设置垃圾过滤。在文件**/etc/dovecot/conf.d/20-imap.conf**里,修改**imap mail_plugin**插件参数为下面的方式:
这是postfix部分的配置。现在让我们为dovecot设置垃圾过滤。在文件**/etc/dovecot/conf.d/20-imap.conf**里,修改**imap mail\_plugin**插件参数为下面的方式:
mail_plugins = $mail_plugins antispam
@ -581,7 +582,7 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
sieve_default = /etc/dovecot/default.sieve
什么是sieve以及为什么我们需要为所有用户设置一个默认脚本sieve可以在IMAP服务器上为我们自动处理任务。在我们的例子里我们想让所有被确定为垃圾的邮件会被移到垃圾箱而不是收件箱里。我们希望这是服务器上所有用户的默认行为;这是为什么我们把这个脚本设为默认脚本。现在让我们来创建这个脚本,建立一个新文件**/etc/dovecot/default.sieve**并写入以下内容:
什么是sieve以及为什么我们需要为所有用户设置一个默认脚本sieve可以在IMAP服务器上为我们自动处理任务。在我们的例子里我们想让所有被确定为垃圾的邮件移到垃圾箱而不是收件箱里。我们希望这是服务器上所有用户的默认行为这是为什么我们把这个脚本设为默认脚本。现在让我们来创建这个脚本建立一个新文件**/etc/dovecot/default.sieve**并写入以下内容:
require ["regex", "fileinto", "imap4flags"];
# Catch mail tagged as Spam, except Spam retrained and delivered to the mailbox
@ -603,7 +604,7 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
chmod 0640 default.sieve
chmod 0750 default.svbin
最后我们需要修改dspam要读取的两个postfix配置文件的权限
最后我们需要修改dspam要读取的两个postfix配置文件的权限
chmod 0644 /etc/postfix/dynamicmaps.cf /etc/postfix/main.cf
@ -669,21 +670,21 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
很好!你现在已经为你服务器上的用户配置好自适应垃圾邮件过滤。当然,每个用户将需要在开始的几周里培训过滤器。要标记一则信息为垃圾,只需要在你的任意设备(电脑,平板,手机)上将它移动到叫“垃圾箱”或“废纸篓”的目录里。否则它将被标记为有用。
### 确保你发出的邮件能通过垃圾邮件过滤器 ###
## 确保你发出的邮件能通过垃圾邮件过滤器 ##
这个部分我们的目标是让我们的邮件服务器能尽量干净地出现在世界上,并让垃圾邮件发送者们更难以我们的名义发邮件。作为附加效果,这也有助于让我们的邮件能通过其他邮件服务器的垃圾邮件过滤器。
#### 发送者策略框架 ####
### 发送者策略框架SPF ###
发送者策略框架SPF是你添加到自己服务器区域里的一份记录声明了整个因特网上哪些邮件服务器能以你的域名发邮件。设置非常简单使用[microsoft.com][31]上的SPF向导来生成你的SPF记录然后作为一个TXT记录添加到自己的服务器区域里。看上去像这样
jhausse.net. 300 IN TXT v=spf1 mx mx:cloud.jhausse.net -all
#### 反向PTR ####
### 反向PTR ###
我们[之前][32]在本文里讨论过这个问题建议你为自己的服务器正确地设置反向DNS这样对服务器IP地址的反向查询能返回你服务器的实际名字。
#### OpenDKIM ####
### OpenDKIM ###
当我们激活[OpenDKIM][33]后postfix会用密钥为每封发出去的邮件签名。然后我们将把这个密钥存储在DNS域中。这样的话世界上任意一个邮件服务器都能够检验邮件是否真的是我们发出的或是由垃圾邮件发送者伪造的。让我们先安装opendkim
@ -710,7 +711,7 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
UMask 022
UserID opendkim:opendkim
我们还需要几个额外的文件,保存在目录**/etc/opendkim**里:
我们还需要几个额外的文件,保存在目录**/etc/opendkim**里:
mkdir -pv /etc/opendkim/
cd /etc/opendkim/
@ -740,7 +741,7 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
cat mail.txt
然后把它作为一个TXT记录添加到区域文件里应该是这样的
然后把它作为一个TXT记录添加到区域文件里应该是类似这样的
mail._domainkey.cloud1984.net. 300 IN TXT v=DKIM1; k=rsa; p=MIGfMA0GCSqG...
@ -751,30 +752,30 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
然后重启相关服务
然后重启相关服务
service postfix reload
service opendkim restart
现在让我们测试一下能找到我们的OpenDKIM公钥并和私钥匹配
现在让我们测试一下是否能找到我们的OpenDKIM公钥并和私钥匹配
opendkim-testkey -d jhausse.net -s mail -k mail.private -vvv
这个应该返回
这个应该返回
opendkim-testkey: key OK
这个你可能需要等一会直到域名服务器重新加载该区域对于Linode每15分钟会更新一次。你可以用**dig**来检查区域是否已经重新加载。
如果这个没问题让我们测试一下其他服务器能验证我们的OpenDKIM签名和SPF记录。要做这个我们可以用[Brandon Checkett的邮件测试][34]。发送一封邮件到[Brandon的网页][34]上提供的测试地址,我们可以在服务器上运行下面的命令
如果这个没问题让我们测试一下其他服务器能验证我们的OpenDKIM签名和SPF记录。要做这个我们可以用[Brandon Checkett的邮件测试系统][34]。发送一封邮件到[Brandon的网页][34]上提供的测试地址,我们可以在服务器上运行下面的命令
mail -s CloudCheck ihAdmTBmUH@www.brandonchecketts.com
在Brandon的网页上我们应该可以在'DKIM Signature'部分里看到**result = pass**的文字,以及在'SPF Information'部分看到**Result: pass**的文字。如果我们的邮件通过这个测试,只要不加-t开关重新生成OpenDKIM密钥上传新的密钥到区域文件里然后重新测试检查是否仍然可以通过这些测试。如果可以的话恭喜你已经在你的服务器上成功配置好OpenDKIM和SPF了
### 使用Owncloud提供日历联系人文件服务并通过Roundcube配置网页邮件 ###
## 使用Owncloud提供日历联系人文件服务并通过Roundcube配置网页邮件 ##
既然我们已经拥有了一流的邮件服务器,让我们再为它增加在云上保存通讯录,日程表和文件的能力。这些是[Owncloud][35]所提供的非常赞的服务。在这个弄好后,我们还会设置一个网页邮件,这样就算你没带任何电子设备出去旅行时,或者说在你的手机或笔记本没电的情况下,也可以检查邮件。
既然我们已经拥有了一流的邮件服务器,让我们再为它增加在云上保存通讯录,日程表和文件的能力。这些是[Owncloud][35]所提供的非常赞的服务。在这个弄好后,我们还会设置一个网页邮件,这样就算你没带任何电子设备出去旅行时,或者说在你的手机或笔记本没电的情况下,也可以通过网吧来检查邮件。
安装Owncloud非常直观而且在[这里][36]有非常好的介绍。在Debian系统里归根结底就是把owncloud的仓库添加到apt源里下载Owncloud的发行密钥并安装到apt钥匙链中然后通过apt-get安装Owncloud
@ -784,20 +785,20 @@ dovecot-antispam是一个安装包可以在我们发现有邮件被dspan误
apt-get update
apt-get install apache2 owncloud roundcube
在有提示的时候,选择**dbconfig**然后说你希望**roundcube**使用**mysql**。然后提供一下mysql的root密码并为roundcube的mysql用户设置一个漂亮的密码。然后按如下方式编辑roundcube的配置文件**/etc/roundcube/main.inc.php**这样登录roundcube默认会使用你的IMAP服务器
在有提示的时候,选择**dbconfig**并设置**roundcube**使用**mysql**。然后提供一下mysql的root密码并为roundcube的mysql用户设置一个漂亮的密码。然后按如下方式编辑roundcube的配置文件**/etc/roundcube/main.inc.php**这样登录roundcube默认会使用你的IMAP服务器
$rcmail_config['default_host'] = 'ssl://localhost';
$rcmail_config['default_port'] = 993;
现在我们来配置一下apache2网页服务器增加SSL支持这样我们可以和Owncloud和Roundcube对话时使用加密的方式传输我们的密码和数据。让我们打开Apache的ssl模块:
现在我们来配置一下apache2网页服务器增加SSL支持这样我们可以和Owncloud和Roundcube对话时使用加密的方式传输我们的密码和数据。让我们打开Apache的SSL模块:
a2enmod ssl
然后编辑文件**/etc/apache2/ports.conf**并设定以下参数:
NameVirtualHost *:80
Listen 80
ServerName www.jhausse.net
NameVirtualHost *:80
Listen 80
ServerName www.jhausse.net
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
@ -969,9 +970,9 @@ ServerName www.jhausse.net
a2ensite default default-ssl roundcube
service apache2 restart
关于网页邮件,可以通过网址**https://webmail.jhausse.net**来访问基本上能工作。之后使用邮箱全名例如roudy@jhausse.net和在本文一开始在邮件服务器数据库里设定的密码登录。第一次连接成功浏览器会警告说证书没有可靠机构的签名。这个没什么关系只要添加一个例外。
关于网页邮件,可以通过网址**https://webmail.jhausse.net**来访问基本上能工作。之后使用邮箱全名例如roudy@jhausse.net和在本文一开始在邮件服务器数据库里设定的密码登录。第一次连接成功浏览器会警告说证书没有可靠机构的签名。这个没什么关系只要添加一个例外即可
最后但很重要的是,我们将通过把以下内容你哦个写入**/etc/apache2/sites-available/owncloud**来为Owncloud创建一个虚拟主机。
最后但很重要的是,我们将通过把以下内容写入**/etc/apache2/sites-available/owncloud**来为Owncloud创建一个虚拟主机。
<IfModule mod_ssl.c>
<VirtualHost *:443>
@ -1040,33 +1041,33 @@ ServerName www.jhausse.net
就这些了现在你已经拥有自己的Google Drive日程表联系人Dropbox以及Gmail好好享受下新鲜恢复保护的隐私吧:-)
### 在云上同步你的设备 ###
## 在云上同步你的设备 ##
要同步你的邮件,你可以只是用你喜欢的邮件客户端Android或iOS自带的默认邮件应用[k9mail][37]或者电脑上的Thunderbird。或者你也可以使用我们设置好的网页邮件。
要同步你的邮件,你只需用你喜欢的邮件客户端即可Android或iOS自带的默认邮件应用[k9mail][37]或者电脑上的Thunderbird。或者你也可以使用我们设置好的网页邮件。
在Owncloud的文档里描述了如何与云端同步你的日程表和联系人。在Android系统中我用的是CalDAV-SyncCardDAV-Sync应用桥接了手机上Android自带日历以及联系人应用和Owncloud服务器。
对于文件有一个叫Owncloud的Android应用可以访问你手机上的文件然后自动把你拍的图片和视频上传到云中。在你的Mac/PC上访问云端文件也很容易在[Owncloud文档里有很好的描述][38]。
### 最后一点提示 ###
## 最后一点提示 ##
在上线后的前几个星期里,最好每天检查一下日志**/var/log/syslog**和**/var/log/mail.log**以保证一切都在顺利运行。在你邀请其他人(朋友,家人,等等)加入你的服务器之前这很重要。他们信任你能很好地架设个人服务器维护他们的数据,但是如果服务器突然崩溃会让他们很失望。
要添加另一个邮件用户,只要在数据库**mailserver**的**virtual_users**表中增加一行。
要添加另一个邮件用户,只要在数据库**mailserver**的**virtual\_users**表中增加一行。
要添加一个域名,只要在**virtual_domains**表中增加一行。然后更新**/etc/opendkim/SigningTable**为发出的邮件签名上传OpenDKIM密钥到服务器区域然后吃哦更年期OpenDKIM服务。
要添加一个域名,只要在**virtual_domains**表中增加一行。然后更新**/etc/opendkim/SigningTable**为发出的邮件签名上传OpenDKIM密钥到服务器区域然后重启OpenDKIM服务。
Owncloud有自己的用户数据库在用管理员帐号登录后可以修改。
最后万一在服务器临时崩溃的时候想办法找解决方案很重要。比如说在服务器恢复之前你的邮件应该送往哪儿一种方式是找个能帮你做备份MX的朋友同时你也可以当他的备份MX看下postfix的配置文件**main.cf**里**relay_domains**和**relay_recipient_maps**里的设定。与此类似如果你的服务器被破解然后一个坏蛋把你所有文件删了怎么办对于这个考虑增加一个常规备份系统就很重要了。Linode提供了备份选项。在1984.is里我用crontabs和scp做了一个基本但管用的自动备份系统。
最后万一在服务器临时崩溃的时候想办法找解决方案很重要。比如说在服务器恢复之前你的邮件应该送往哪儿一种方式是找个能帮你做备份MX的朋友同时你也可以当他的备份MX看下postfix的配置文件**main.cf**里**relay\_domains**和**relay\_recipient\_maps**里的设定。与此类似如果你的服务器被破解然后一个坏蛋把你所有文件删了怎么办对于这个考虑增加一个常规备份系统就很重要了。Linode提供了备份选项。在1984.is里我用crontabs和scp做了一个基本但管用的自动备份系统。
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/
作者:[Roudy Jhausse ][a]
作者:[Roudy Jhausse][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,41 @@
Ubuntu 15.04 终于可以让你将菜单设置为 ‘始终可见’
================================================================================
**如果你不喜欢 Unity 的全局菜单在你的鼠标离开后就淡出你的视野,在 Ubuntu 15.04 稍微做点工作就可以留住菜单。**
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/locally-integrated-menus-in-ubuntu.png)
最新的Ubuntu 15.04的Unity界面通过在“提议Proposed”通道提供了一个选项**使应用程序菜单在Ubuntu中始终可见**。
这是个不会淡出,也不会过段时间就消失的菜单。
最大的缺点是它目前只能通过`dconf`来控制,而不是常规的面向用户的选项设置。
我希望如果预计没有的话在之后的开发中能有一个设置这个特性的选项被加入到Ubuntu的【系统设置】>【外观】部分。
现在,如果你使用的是 Ubuntu 15.04并启用了“提议Proposed”的更新通道后你可以在dconf 的com>canonical>Unity>always show menus 中找到这个开关。
### 迟到总比没有要好? ###
开发者们计划在Ubuntu 14.04 LTS的下一个SRU中反向移植这个选项假设在测试阶段没有任何意外发生
本地集成菜单LIM在Ubuntu 14.04 LTS 中的首次亮相就赢得了赞誉,其被广泛认为在那些喜欢隐藏方式的与那些不喜欢必须使用鼠标和触摸板的人之间的最佳的折衷方案。
虽然在Unity方面本地集成菜单减少了不少批评不过默认的“淡入/淡出”行为总是还让人不爽。
在Ubuntu 过去的几个版本中已经能够看到他们在积极解决早期的用户体验中的几个痛点。经过了几年在TODO列表中[我们去年终于看到了本地集成菜单][1],以及通过[点击应用图标来实现Unity 启动器中应用的最小化及恢复的选项][2]。
一年以来我们终于看到了一个使应用程序菜单始终显示的选项,无论我们的鼠标在哪里。迟来总比没有好,对不对?
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2015/01/ubuntu-15-04-always-show-menu-bar-option
作者:[Joey-Elijah Sneddon][a]
译者:[JeffDing](https://github.com/JeffDing)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2014/02/locally-integrated-menus-ubuntu-14-04
[2]:http://www.omgubuntu.co.uk/2014/03/minimize-click-launcher-option-ubuntu-14-04

View File

@ -1,7 +1,8 @@
Ubuntu With XFCE vs Xubuntu Linux
Ubuntu & XFCE vs Xubuntu
=========================================================
Ubuntu vs Xubuntu。Ubuntu拥有漂亮的桌面体验以及强大的应用程序。Xubuntu轻量、快速并且可定制哪个更适合你
Ubuntu拥有漂亮的桌面体验以及强大的应用程序。Xubuntu轻量、快速并且可定制哪个更适合你
---------------------------------------------------------
![](http://f.tqn.com/y/linux/1/W/T/J/1/ubuntudesktop.png)
@ -10,11 +11,11 @@ Ubuntu vs Xubuntu。Ubuntu拥有漂亮的桌面体验以及强大的应用程序
并且我同时也会在这篇文章中介绍Ubuntu用户如何获取基本的XFCE桌面以及如何安装完整的Xubuntu桌面。
[Ubuntu][1]以及[Xubuntu][2]是针对不同目的开发的操作系统为什么我会强调这一点是为了说明什么时候或者为什么你应该使用Ubuntu以及什么时候应该使用Xubuntu。
[Ubuntu][1]以及[Xubuntu][2]是针对不同目的开发的操作系统为什么我会强调这一点是为了说明什么时候或者为什么你应该使用UbuntuXubuntu。
比较这两个操作系统就像比较[劳斯莱斯][3]与[保时捷][4]。这两个都是很棒的车,但是如果把劳斯莱斯给一个赛车迷,他们也许会卖掉它买个其他的车,同样,如果把保时捷给舒格勋爵或者休·海夫纳这类人可能也不那么合适。
Ubuntu拥有一个适用性很强的桌面环境叫做Unity并且默认会安装一些很棒的Linux应用程序包括Rhythmbox以及[LibreOffic][5]。Ubuntu就像是劳斯莱斯。它为舒适而生并且尽可能的提供从A到B的最时髦的方法
Ubuntu拥有一个适用性很强的桌面环境叫做Unity并且默认会安装一些很棒的Linux应用程序包括Rhythmbox以及[LibreOffic][5]。Ubuntu就像是劳斯莱斯。它为舒适而生并且尽可能的提供满足需要的漂亮的解决方案
作为一个Ubuntu用户就像汽车里面的乘客。你在到达目的地的过程中就可以同时把事情搞定并且所有的事看起来都很漂亮并且很简单。
@ -92,7 +93,7 @@ Xubuntu就像一个改装过的跑车。你可以把它改装成任何你想要
接下来,我会使用命令行工具[apt-get][7]介绍在Ubuntu安装XFCE桌面的方法。
打开一个终端窗口在Unity环境你可以在[Dash][8]中搜索“TERM”或者使用组合键 CTRL+ALT+T。
打开一个终端窗口在Unity环境你可以在[Dash][8]中搜索“TERM”或者使用组合键 `CTRL+ALT+T`
安装XFCE桌面十分简单输入下列命令就可以了
@ -105,7 +106,7 @@ Xubuntu就像一个改装过的跑车。你可以把它改装成任何你想要
系统会显示一个消息,提示你是否使用默认的面板布局或者使用单独的面板。
[最新版本的Xubuntu][10]在顶部包含一个单独的面板,不过我更喜欢两个面板,顶部一个标准面板,底部一个常用程序的停靠面板。
[最新版本的Xubuntu][10]在顶部包含一个单独的面板,不过我更喜欢面板,顶部一个标准面板,底部一个常用程序的停靠面板。
需要注意的是XFCE桌面菜单系统和Xubuntu的菜单有些差异除非你安装[一个更好的菜单系统][11],设置两个面板或许是个更好的选择。
@ -117,7 +118,7 @@ Xubuntu就像一个改装过的跑车。你可以把它改装成任何你想要
如果你想全都使用Xubuntu的东西但是又不想按照那些介绍重新安装系统的话看看下面的东西。
通过搜索“TERM”或者组合键CTRL+ALT+T打开一个终端窗口。
通过搜索“TERM”或者组合键`CTRL+ALT+T`,打开一个终端窗口。
在终端输入如下命令:
@ -132,16 +133,17 @@ Xubuntu就像一个改装过的跑车。你可以把它改装成任何你想要
Xubuntu桌面就会显示出来啦。
这里会有一些差异。菜单仍然是XFCE菜单而不是Xubuntu菜单。某些图标也不会出现在顶部面板中。但是这些问题都不足以让我们花时间卸载Ubuntu然后重装Xubuntu。
这里会有一些差异。菜单仍然是XFCE菜单而不是Xubuntu菜单。某些图标也不会出现在顶部面板中。但是这些问题都不足以让我们花时间卸载Ubuntu然后重装Xubuntu。
下一篇文章中我会介绍如何自定义Xubuntu以及XFCE桌面。
-----
via : http://linux.about.com/od/dist/fl/Ubuntu-With-XFCE-vs-Xubuntu-Linux.htm
作者:[Gary Newell][a]
译者:[zhouj-sh](https://github.com/Zhouj-sh)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,202 @@
在linux中如何通过nload来监控网络使用情况
================================================================================
nload 是一个 linux 自由软件工具通过提供两个简单的图形来帮助linux用户和系统管理员来实时监控网络流量以及宽带使用情况一个是进入流量一个是流出流量。
我真的很喜欢用**nload**来在屏幕上显示当前的下载速度、总的流入量和平均下载速度等信息。nload工具的报告图非常容易理解最重要的是这些信息真的非常有用。
在其使用手册上说到,在默认情况下它会监控所有网络设备。但是你可以轻松地指定你想要监控的设备,而且可以通过方向键在不同的网络设备之间进行转换。另外还有很多的选项可用,例如 -t选项以毫秒来设定刷新显示时间间隔默认时间间隔值是500毫秒-m选项用来同时显示多个设备在使用该选项时不会显示流量图-u选项用来设置显示流量数字的单位另外还有许多其他的选项将会在本教程中探索和练习。
### 如何将 nload安装到你的linux机器上 ###
**Ubuntu** 和 **Fedora** 用户可以从默认的软件仓库中容易地安装。
在Ubuntu上使用以下命令进行安装。
sudo apt-get install nload
在Fedora上使用以下命令进行安装。
sudo yum install nload
**CentOS**用户该怎么办呢? 只需要在你的机器上输入以下命令就可以安装成功。
sudo yum install nload
以下的命令会帮助你在OpenBSD系统中安装nload。
sudo pkg_add -i nload
在 linux 机器上的另外一个非常有效的安装软件的方式就是编译源代码下载并安装最新的版本意味着能够获得更好地性能、更酷的特性以及更少的bug。
### 如何通过源代码安装nload ###
在从源代码安装nload之前你需要首先下载源代码。 我通常使用wget工具来进行下载--该工具在许多linux机器上默认可用。该免费工具帮助用户以非交互式的方式从网络上下载文件并支持以下协议
- HTTP
- HTTPS
- FTP
通过以下命令来进入到**/tmp**目录中。
cd /tmp
然后在你的终端中输入以下命令就可以将最新版本的nload下载到你的linux机器上了。
wget http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz
如果你不喜欢使用wget工具也可以通过简单的一个鼠标点击轻松地从[官网][1]上下载其源代码。
由于该软件非常轻巧,其下载过程几乎在瞬间就会完成。接下来的步骤就是通过**tar**工具来将下载的源代码包进行解压。
tar归档工具可以用来从磁带或硬盘文档中存储或解压文件该工具有许多可用的选项但是我们只需要下面的几个选项来执行我们的操作。
1. **-x** 从归档中解压文件
1. **-v** 使用繁琐模式运行--用来显示详细信息
1. **-f** 用来指定归档文件
例如LCTT 译注tar 命令的参数前的“-”可以省略):
tar xvf example.tar
现在你学会了如何使用tar工具我可以非常肯定你知道了如何从命令行中解压这个.tar文档。
tar xvf nload-0.7.4.tar.gz
之后使用cd命令来进入到nload*目录中:
cd nload*
在我的系统上看起来是这样的:
oltjano@baby:/tmp/nload-0.7.4$
然后运行下面这个命令来为你的系统配置该软件包:
./configure
此时会有“一大波僵尸”会在你的屏幕上显示出来,下面的一个屏幕截图描述了它的样子。
![configuring packages for nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload1.png)
在上述命令完成之后通过下面的命令来编译nload。
make
![compiling nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload2.png)
好了,终于....通过以下命令可以将nload安装在你的机器上了。
sudo make install
![installing nload from source](http://blog.linoxide.com/wp-content/uploads/2015/01/nload3.png)
安装好nload之后就是让你学习如何使用它的时间了。
###如何使用nload###
我喜欢探索,所以在你的终端输入以下命令.
nload
看到了什么?
我得到了下面的结果。
![running nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.png)
如上述截图可以看到,我得到了以下信息:
#### 流入量####
**当前下载速度**
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.1.png)
**平均下载速度**
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.2.png)
**最小下载速度**
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.3.png)
**最大下载速度**
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.4.png)
**总的流入量按字节进行显示**
![](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.5.png)
#### 流出量 ####
类似的同样适用于流出量
#### 一些nload有用的选项####
使用选项
-u
用来设置显示流量单位。
下面的命令会帮助你使用MBit/s显示单元
nload -u m
下面的屏幕截图显示了上述命令的结果。
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload5.png)
尝试以下命令然后看看有什么结果。
nload -u g
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload6.png)
同时还有一个**-U**选项。根据手册描述,该选项基本上与-u选项类似只是用在合计数据。 我测试了这个命令,老实说,当你需要检查总的流入与流出量时非常有用。
nload -U G
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload7.png)
从上面的截图中可以看到,**nload -U G** 使用Gbyte来显示数据总量。
另外一个我喜欢使用的有用选项是 **-t**。 该选项用来设置刷新显示事件间隔单位为毫秒默认值为500毫秒。
我会通过下面的命令做一些小的实验。
nload -t 130
那么上述命令做了什么呢它将刷新显示时间间隔设置为130毫秒。 通常推荐不要将该时间间隔值设置为小于100毫秒因为nload在生成报告时计算错误。
另外的一个选项为 **-a** 在你想要设置计算平均值的时间窗口的秒数时使用默认该值为300秒。
那么当你想要监控指定的网络设备该如何呢? 非常容易, 像下面这样简单地指定设备或者列出想要监控的设备列表即可。
nload wlan0
![nload monitoring wlan0 on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png)
下面的语法可帮助你监控指定的多个设备。
nload [options] device1 device2 devicen
例如使用下面的命令来监控eth0和eth1。
nload wlan0 eth0
如果不带选项来运行nload那么它会监控所有自动检测到的设备你可以通过左右方向键来显示其中的任何一个设备的信息。
--------------------------------------------------------------------------------
via: http://linoxide.com/monitoring-2/monitor-network-usage-nload/
作者:[Oltjano Terpollari][a]
译者:[theo-l](https://github.com/theo-l)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/oltjano/
[1]:http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz

View File

@ -1,8 +1,8 @@
Linux有问必答时间--如何查看Linux系统的CPU信息
Linux有问必答如何查看Linux系统的CPU信息
================================================================================
> **问题**: 我想要了解我的电脑关于CPU处理器的详细信息查看CPU信息比较有效地方法是什么
根据你的需要有各种各样的关于你的CPU处理器信息你需要了解比如CPU供应商名、模型名、时钟频率、套接字/内核的数量, L1/L2/L3缓存配置、可用的处理器能力(比如硬件虚拟化、AES, MMX, SSE)等等。在Linux中有许多命令行或基于GUI的工具就能来展示你的CPU硬件的相关具体信息。
根据你的需要有各种各样的关于你的CPU处理器信息你需要了解比如CPU供应商名、模型名、时钟频率、插槽/内核的数量, L1/L2/L3缓存配置、可用的处理器能力(比如硬件虚拟化、AES, MMX, SSE)等等。在Linux中有许多命令行或基于GUI的工具就能来展示你的CPU硬件的相关具体信息。
### 1. /proc/cpuinfo ###
@ -12,7 +12,7 @@ Linux有问必答时间--如何查看Linux系统的CPU信息
![](https://farm8.staticflickr.com/7572/15934711577_4136a8e0b9_c.jpg)
通过查看这个文件,你能[识别出][1]物理处理器数、每个CPU核心数、可用的CPU标志寄存器以及其它东西的数量。
通过查看这个文件,你能[识别出][1]物理处理器数(插槽)、每个CPU核心数、可用的CPU标志寄存器以及其它东西的数量。
### 2. cpufreq-info ###
@ -32,7 +32,7 @@ cpuid命令的功能就相当于一个专用的CPU信息工具它能通过使
### 4. dmidecode ###
dmidecode命令直接从BIOS的DMI译者注:桌面管理接口数据收集关于系统硬件的具体信息。CPU信息报告包括CPU供应商、版本、CPU标志寄存器、最大/最近的时钟速度、(所允许的)核心总数、L1/L2/L3缓存配置等等。
dmidecode命令直接从BIOS的DMI桌面管理接口数据收集关于系统硬件的具体信息。CPU信息报告包括CPU供应商、版本、CPU标志寄存器、最大/当前的时钟速度、(启用的)核心总数、L1/L2/L3缓存配置等等。
$ sudo dmidecode
@ -54,7 +54,7 @@ i7z是一个专供英特尔酷睿i3、i5和i7 CPU的实时CPU报告工具。它
![](https://farm8.staticflickr.com/7546/15534687744_1968dc2b18_c.jpg)
### 8. likwid-topology ###
### 8. likwid拓扑 ###
[likwid][3] (Like I Knew What I'm Doing) 是一个用来测量、配置并显示硬件相关特性的命令行收集工具。其中的likwid拓扑结构能显示CPU硬件(线程/缓存/NUMA)的拓扑结构信息,还能识别处理器家族(比如Intel Core 2, AMD Shanghai)。
@ -70,7 +70,7 @@ lscpu命令用一个更加用户友好的格式统计了 /etc/cpuinfo 的内容
### 10. lshw ###
**lshw**命令是一个综合性硬件查询工具。不同于其它工具lshw需要root特权才能运行因为它是在BIOS系统里查询DMI译者注:桌面管理接口信息。它能报告总核心数和可用核心数但是会遗漏掉一些信息比如L1/L2/L3缓存配置。GTK版本的lshw-gtk也是可用的。
**lshw**命令是一个综合性硬件查询工具。不同于其它工具lshw需要root特权才能运行因为它是在BIOS系统里查询DMI桌面管理接口信息。它能报告总核心数和可用核心数但是会遗漏掉一些信息比如L1/L2/L3缓存配置。GTK版本的lshw-gtk也是可用的。
$ sudo lshw -class processor
@ -78,7 +78,7 @@ lscpu命令用一个更加用户友好的格式统计了 /etc/cpuinfo 的内容
### 11. lstopo ###
lstopo命令 (包括 [hwloc][4] 包) 使由CPU、缓存、内存和I/O设备组成的拓扑结构可见。这个命令用来识别处理器结构和系统的NUMA拓扑结构。
lstopo命令 (包括在 [hwloc][4] 包中) 以可视化的方式组成 CPU、缓存、内存和I/O设备的拓扑结构。这个命令用来识别处理器结构和系统的NUMA拓扑结构。
$ lstopo
@ -86,7 +86,7 @@ lstopo命令 (包括 [hwloc][4] 包) 使由CPU、缓存、内存和I/O设备组
### 12. numactl ###
其被开发的起初是为了设置NUMA的时序安排和Linux处理器的内存布局策略numactl命令也能通过命令行来展示关于CPU硬件的NUMA拓扑结构信息。
最初其被开发的目的是为了设置NUMA的时序安排和Linux处理器的内存布局策略numactl命令也能通过命令行来展示关于CPU硬件的NUMA拓扑结构信息。
$ numactl --hardware
@ -94,7 +94,7 @@ lstopo命令 (包括 [hwloc][4] 包) 使由CPU、缓存、内存和I/O设备组
### 13. x86info ###
x86info是一个为了展示基于x86架构的CPU信息的命令行工具。信息报告包括CPU型号、线程/核心数、时钟速度、TLB译者注:传输后备缓冲器)缓存配置、支持的特征标志寄存器等等。
x86info是一个为了展示基于x86架构的CPU信息的命令行工具。信息报告包括CPU型号、线程/核心数、时钟速度、TLB传输后备缓冲器缓存配置、支持的特征标志寄存器等等。
$ x86info --all
@ -105,7 +105,7 @@ x86info是一个为了展示基于x86架构的CPU信息的命令行工具。信
via: http://ask.xmodulo.com/check-cpu-info-linux.html
译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,4 +1,4 @@
如何通过简单的3步恢复Windows7同时删除Ubuntu
如何通过简单的3步恢复Windows 7同时删除Ubuntu
================================================================================
### 说明 ###
@ -8,11 +8,11 @@
那么为什么我现在要写这篇文章呢?
到目前为止我曾经在很多场合被问到如何从一个装有Windows7或Windows8的双系统中删除Unbuntu系统因此写这篇文章就变得有意义了。
到目前为止我曾经在很多场合被问到如何从一个装有Windows7或Windows8的双系统中删除Ubuntu系统因此写这篇文章就变得有意义了。
我在圣诞节期间浏览了人们在我文章中的留言,感觉是时候把缺失的文章写完同时更新一下那些比较老的又需要关注的文章了。
我打算把一月份剩下的时间都用在这上面。这是第一步。如果你的电脑上安装了Windown7和Ubuntu双系统同时你不想通过恢复出厂设置的方式恢复Windows7系统那么请参考该教程。(注意对于Windows8系统有一个独立的教程)
我打算把一月份剩下的时间都用在这上面。这是第一步。如果你的电脑上安装了Windows7和Ubuntu双系统同时你不想通过恢复出厂设置的方式恢复Windows7系统那么请参考该教程。(注意对于Windows8系统有一个独立的教程)
### 删除Ubuntu系统需要的步骤 ###
@ -24,11 +24,10 @@
在你开始之前,我建议为你的系统保留一个备份。
也建议不要放弃这样的机会也不要使用微软自带的工具。
建议你不要放弃备份的机会,但也不要使用微软自带的工具。
[点击查看如何使用Macrinum Reflect备份你的驱动][1]
如果Ubuntu中有你希望保存的数据现在就登录进去然后将数据保存到外部硬盘驱动器USB驱动器或者DVD中。
### 步骤1 - 删除Grub启动菜单 ###
@ -57,7 +56,7 @@
点击“创建光盘”。
将光盘留在电脑中重启电脑当出现从CD中启动的消息的时候按下键盘上的“回车”键。
将光盘留在电脑中重启电脑当出现从CD中启动的消息的时候按下键盘上的“回车”键。
![](http://2.bp.blogspot.com/-VPSD50bmk2E/VLWftBg7HxI/AAAAAAAAHnM/APVzvPg4rC0/s1600/recoveryoptionschooselanguage.jpg)
@ -111,13 +110,13 @@
对于Windows系统来说我们真正需要的只有驱动器C所以剩下的是可以删掉的。
**注意: 注意一下.你的磁盘上可能有恢复分区。 不要删除恢复分区.。它们应该会被标记,将文件系统设置为NTFS或FAT32**
**注意: 注意一下.你的磁盘上可能有恢复分区。 不要删除恢复分区。它们应该有专门的卷标,文件系统也许是NTFS或FAT32**
![](http://3.bp.blogspot.com/-8YUE2p5Fj8Q/VLWlHXst6JI/AAAAAAAAHoQ/BJC57d9Nilg/s1600/deletevolume.png)
在你希望删除的分区上单击右键(例如root,home和swap分区),然后从弹出的菜单中点击“删除卷”。
**(不要删除任何NTFS或者FAT32文件系统的分区)**
**(不要删除任何NTFS或者FAT32文件系统的分区)**
对于剩下的两个分区重复执行上面的操作。
@ -134,11 +133,12 @@
![](http://4.bp.blogspot.com/-pLV5L3CvQ1Y/VLWmh-5SKTI/AAAAAAAAHoc/7sJzITyvduo/s1600/diskmanagement4.png)
最后一步是扩展Windows以便于将它再变成一个大的分区。
右键点击Windows分区(C盘),然后选择“扩展卷”。
![](http://1.bp.blogspot.com/-vgmw_N2WZWw/VLWm7i5oSxI/AAAAAAAAHok/k0q_gnIik9A/s1600/extendvolume1.PNG)
当出现左面的窗口的时候点击“下一步”,
当出现左面的窗口的时候点击“下一步”
![](http://3.bp.blogspot.com/-WLA86V-Au8g/VLWnTq5RpAI/AAAAAAAAHos/6vzjLNkrwRQ/s1600/extendvolume2.PNG)
@ -165,13 +165,14 @@
这就是全部内容。一个致力于Linux的网站刚刚向你展示了如何移除Linux然后用Windows7取而代之。
有任何疑问可以在下面评论区留言。
--------------------------------------------------------------------------------
via: http://www.everydaylinuxuser.com/2015/01/how-to-recover-windows-7-and-delete.html
作者Gary Newell
译者:[Medusar](https://github.com/Medusar)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,56 @@
Linux 有问必答如何使用yum来下载RPM包而不进行安装
================================================================================
> **问题**:我想从Red Hat 的标准仓库中下载一个RPM包我能使用yum命令来下载一个RPM包但是不进行安装吗
yum是基于Red Hat的系统(如CentOS、Fedora、RHEl)上的默认包管理器。使用yum你可以安装或者更新一个RPM包并且他会自动解决包依赖关系。但是如果你只想将一个RPM包下载到你的系统上该怎么办呢? 例如你可能想要获取一些RPM包在以后使用或者将他们安装在另外的机器上。
这里说明了如何从yum仓库上下载一个RPM包。
### 方法一:yum###
yum命令本身就可以用来下载一个RPM包标准的yum命令提供了`--downloadonly(只下载)`的选项来达到这个目的。
$ sudo yum install --downloadonly <package-name>
默认情况下一个下载的RPM包会保存在下面的目录中:
/var/cache/yum/x86_64/[centos/fedora-version]/[repository]/packages
以上的[repository]表示下载包的来源仓库的名称(例如base、fedora、updates)
如果你想要将一个包下载到一个指定的目录(如/tmp)
$ sudo yum install --downloadonly --downloaddir=/tmp <package-name>
注意如果下载的包包含了任何没有满足的依赖关系yum将会把所有的依赖关系包下载但是都不会被安装。
另外一个重要的事情是在CentOS/RHEL 6或更早期的版本中你需要安装一个单独yum插件(名称为 yum-plugin-downloadonly)才能使用`--downloadonly`命令选项:
$ sudo yum install yum-plugin-downloadonly
如果没有该插件你会在使用yum时得到以下错误
Command line error: no such option: --downloadonly
![](https://farm9.staticflickr.com/8627/15571201803_38390aae75_c.jpg)
### 方法二: Yumdownloader###
另外一个下载RPM包的方法就是通过一个专门的包下载工具--yumdownloader。 这个工具是yum工具包(包含了用来进行yum包管理的帮助工具套件)的子集。
$ sudo yum install yum-utils
下载一个RPM包
$ sudo yumdownloader <package-name>
下载的包会被保存在当前目录中。你需要使用root权限因为yumdownloader会在下载过程中更新包索引文件。与yum命令不同的是任何依赖包不会被下载。
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/yum-download-rpm-package.html
译者:[theo-l](https://github.com/theo-l)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,39 +1,38 @@
在linux中4个lvcreate命令例
4 lvcreate 常用命令
================================================================================
逻辑卷管理LVM是广泛使用的技术并拥有极其灵活磁盘管理方案。主要包含3个基础命令
a. 创建物理卷使用**pvcreate**
b. 创建卷组并给卷组增加分区**vgcreate**
c. 创建新的逻辑卷使用**lvcreate**
1. 创建物理卷使用**pvcreate**
2. 创建卷组并给卷组增加分区**vgcreate**
3. 创建新的逻辑卷使用**lvcreate**
![](http://www.ehowstuff.com/wp-content/uploads/2015/01/lvm-diagram1.jpg)
随后的例子着重在已经存在的卷组上使用**lvcreate**创建逻辑卷。**lvcreate**命令可以在来自自由物理扩展池的卷组分配逻辑扩展。通常,逻辑卷可以随意使用底层逻辑卷上的任意空间。修改逻辑卷将释放或重新分配物理卷空间。这些例子已经在CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6 和 RHEL 7 版本中测试通过。
下列例子主要讲述在已经存在的卷组上使用**lvcreate**创建逻辑卷。**lvcreate**命令可以在卷组的可用物理扩展池中分配逻辑扩展。通常,逻辑卷可以随意使用底层逻辑卷上的任意空间。修改逻辑卷将释放或重新分配物理卷空间。这些例子已经在CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6 和 RHEL 7 版本中测试通过。
### 4个lvcreate命令例子 ###
1. 在名为vg_newlvm卷组中创建15G大小的逻辑卷
1. 在名为vg_newlvm卷组中创建15G大小的逻辑卷
[root@centos7 ~]# lvcreate -L 15G vg_newlvm
[root@centos7 ~]# lvcreate -L 15G vg_newlvm
2. 在名为vg_newlvm中创建大小为2500MB的逻辑卷并命名centos7_newvol创建块设备/dev/vg_newlvm/centos7_newvol
2. 在名为vg_newlvm的卷组中创建大小为2500MB的逻辑卷并命名centos7_newvol这样就创建块设备/dev/vg_newlvm/centos7_newvol
[root@centos7 ~]# lvcreate -L 2500 -n centos7_newvol vg_newlvm
[root@centos7 ~]# lvcreate -L 2500 -n centos7_newvol vg_newlvm
3.可以使用**lvcreate**命令的参数-l能指定一些特别的逻辑卷扩展大小。也可以使用这个参数以卷组的大小百分比来扩展逻辑卷。这下列的命令创建了centos7_newvol卷组的50%大小的逻辑卷vg_newlvm:
3. 可以使用**lvcreate**命令的参数-l来指定逻辑卷扩展的大小。也可以使用这个参数以卷组的大小百分比来扩展逻辑卷。这下列的命令创建了centos7_newvol卷组的50%大小的逻辑卷vg_newlvm:
[root@centos7 ~]# lvcreate -l 50%VG -n centos7_newvol vg_newlvm
[root@centos7 ~]# lvcreate -l 50%VG -n centos7_newvol vg_newlvm
4. 使用卷组剩下的所有空间创建逻辑卷
[root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm
[root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm
更多帮助,使用**lvcreate**命令--help选项来查看
[root@centos7 ~]# lvcreate --help
----------
以下空号中是帮助字面翻译
lvcreate: Create a logical volume创建逻辑卷
@ -46,8 +45,8 @@ c. 创建新的逻辑卷使用**lvcreate**
[-C|--contiguous {y|n}]
[-d|--debug]
[-h|-?|--help]
[--ignoremonitoring](忽略监
[--monitor {y|n}](监
[--ignoremonitoring](忽略监
[--monitor {y|n}](监
[-i|--stripes Stripes [-I|--stripesize StripeSize]]
[-k|--setactivationskip {y|n}]
[-K|--ignoreactivationskip]
@ -66,7 +65,7 @@ c. 创建新的逻辑卷使用**lvcreate**
[--discards {ignore|nopassdown|passdown}]
[--poolmetadatasize MetadataSize[bBsSkKmMgG]]]
[--poolmetadataspare {y|n}]
[--thinpool ThinPoolLogicalVolume{Name|Path}]精简池逻辑卷
[--thinpool ThinPoolLogicalVolume{Name|Path}] 精简池逻辑卷
[-t|--test]
[--type VolumeType](卷类型)
[-v|--verbose]
@ -75,18 +74,14 @@ c. 创建新的逻辑卷使用**lvcreate**
[--version]
VolumeGroupName [PhysicalVolumePath...]
lvcreate
{ {-s|--snapshot} OriginalLogicalVolume[Path] |
[-s|--snapshot] VolumeGroupName[Path] -V|--virtualsize VirtualSize}
{-T|--thin} VolumeGroupName[Path][/PoolLogicalVolume]
-V|--virtualsize VirtualSize}
--------------------------------------------------------------------------------
via: http://www.ehowstuff.com/4-lvcreate-command-examples-on-linux/
作者:[skytech][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[Vic020](https://github.com/Vic020)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,121 @@
4 个图形界面的 CD 音频抓取器
================================================================================
CD音频抓取器设计用来从光盘中提取“RIP”原始数字音频通常被称为 CDDA 格式)并把它保存成文件或以其他形式输出。这类软件使用户能把数字音频编码成各种格式,并可以从在线光盘数据库 freedb 中下载或上传光盘信息。
复制CD合法吗在美国版权法中把一个原始CD转换成数字文件用于个人使用等同于合理使用。然而美国版权法并没有明确的允许或禁止拷贝私人音频CD而且判例法还没有确立出在具体的哪种情况下可以视为合理使用。而在英国其版权的定位则更清晰一些。从2014年开始英国公民制造CDMP3DVD蓝光和电子书的行为成为合法行为。当然这仅适用于这个人拥有被采集的媒体的实体并且复制品仅用于他们个人使用。对于欧盟的其他国家成员国也允许私人复制这种特例。
如果你不确定在你生活的国家里这种版权是如何界定的,在你使用这篇文章中所列举的软件前请查询本地的版权法以确定你处在合法的一边。
在某种程度上提取CD音轨看起来有点多余。如[Spotify][5]和Google Play Music这类流媒体服务提供了一个巨大的以通用格式的音乐的库无需采集你的CD集。但是如果你已将收藏了一个数量巨大的CD集。能把你的CD转换成可以在便携设备如智能手机、平板和便携式MP3播放器上播放的格式仍然是个诱人的选择。
这篇文章推荐了我最喜欢的音频CD抓取器。我挑了四个最好的图形界面的音频抓取器。所有这些应用程序都是在开源许可下发行的。
###fre:ac
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-freac.png)
fre:ac是个开源的音频转换器和CD提取器支持很多种流行格式和编码器。目前这个应用可以在MA3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式间转换。这来源于几种不同形式的LAME编码器。
#### 功能包括: ####
- 易学易用
- MP3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式转换器
- 集成了CDDB/freedb标题数据库支持的CD提取器
- 多核优化的编码器加速了现代PC上的转换速度
- 对于标签和文件名称的全Unicode支持
- 易学易用,而当你需要时还提供专家级选项
- 任务列表
- 可以使用Winamp 2输入插件
- 多语言用户界面支持41种语言
- 网址: [freac.org][1]
- 开发人员Robert Kausch
- 许可证: GNU GPL v2
- 版本号: 20141005
###Audex
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Audex.png)
Audex是个简单易用的开源的音频CD提取应用。虽然它还处于早期开发阶段但这个KDE桌面工具足够稳定、智能和简单易用。
它的助手可以为LAME、OGG Vorbisoggenc、FLAC、FAACAAC/MP4和RIFF WAVE等格式创建配置文件。除了这个助手你也可以定义你自己的配置文件这意味着Audex适用于大部分的命令行编码器。
#### 功能包括: ####
- 可提取CDDA Paranoia
- 提取和编码同时进行
- 文件名采用本地和远程的CDDB/FreeDB数据库
- 可以提交到CDDB/FreeDB数据库
- 类似capitalize的元数据纠正工具
- 多配置文件提取(每个配置文件文件有一个命令行编码器)
- 从互联网上抓取封面并将他们存在数据库中
- 在目标目录中创建播放列表、封面和基于模板的信息文件
- 创建提取和编码协议
- 将文件传送到FTP服务器
- 支持国际化
- 网址: [kde.maniatek.com/audex][2]
- 开发人员: Marco Nelles
- 许可证: GNU GPL v3
- 版本号: 0.79
###Sound Juicer
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-SoundJuicer.png)
Sound Juicer是个使用GTK+和GStreamer开发的轻量级CD提取器。它从CD中提取音频并把它转换成音频文件。Sound Juicer还可以直接播放CD中的音轨在提取前提供预览。
它支持任何GStreamer插件所支持的音频编码包括 MP3、Ogg Vorbis、FLAC和未压缩的PCM格式。
它是GNOME桌面环境内建的一部分。
#### 功能包括: ####
- 自动通过CDDB给音轨加标签
- 可编码成ogg/vorbis、FLAC和原始WAV
- 编码路径的设置很简单
- 多种风格流派
- 国际化支持
- 网址:[burtonini.com][3]
- 开发人员: Ross Burton
- 许可证GNU GPL v2
- 版本号3.14
###ripperX
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-ripperX.png)
ripperX是个开源的图形界面的程序用于提取CD音轨并把他们编码成Ogg、MP2、MP3或FLAC格式。它的目的是容易使用只需要点几下鼠标就能转换整张专辑。它支持在CDDB寻找专辑和音轨信息。
他使用cdparanoia把CD音轨转换也就是“提取”成WAV文件然后调用Vorbis/Ogg编码器oggenc把WAV文件转换成OGG文件。它还可以调用flac让WAV文件生成无损压缩的FLAC文件。
#### 功能包括: ####
- 非常简单易用
- 可以把CD音轨提取成WAV、MP3、OGG或FLAC文件
- 支持CDDB查找
- 支持ID3v2标签
- 可暂停提取进程
- 网址:[sourceforge.net/projects/ripperx][4]
- 开发人员Marc André Tanner
- 许可证MIT/X Consortium License
- 版本号2.8.0
--------------------------------------------------------------------------------
转自http://www.linuxlinks.com/article/20150125043738417/AudioGrabbersGraphical.html
作者Frazer Kline
译者:[H-mudcup](https://github.com/H-mudcup)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.freac.org/
[2]:http://kde.maniatek.com/audex/
[3]:http://burtonini.com/blog/computers/sound-juicer
[4]:http://sourceforge.net/projects/ripperx/
[5]:http://linux.cn/article-3130-1.html

View File

@ -1,10 +1,10 @@
清理 Ubuntu 14.10,14.04,13.10 系统
如何清理你的 Ubuntu 14.10/14.04/13.10 系统
================================================================================
前面我们已经讨论了[如何清理 Ubuntu GNU/Linux 系统][1],这篇教程将在原有教程的基础上,增加对新的 Ubuntu 发行版本的支持,并介绍更多的工具。
假如你想清理你的 Ubuntu 主机,你可以按照以下的一些简单步骤来移除所有不需要的垃圾文件。
### 移除多余软件包 ###
## 移除多余软件包 ##
这又是一个内置功能,但这次我们不必使用新得立包管理软件(Synaptic Package Manager),而是在终端中达到目的。
@ -14,7 +14,7 @@
sudo apt-get autoclean
```
这便激活了包清除命令。这个命令所做的工作是: 自动清除那些当你安装或升级程序时系统所缓存的 `.deb` 包(即清除 `/var/cache/apt/archives` 目录,不过只清理过时的包)。如果需要使用 清除命令,只需在终端窗口中键入以下命令:
这便激活了包清除命令。这个命令所做的工作是: 自动清除那些当你安装或升级程序时系统所缓存的 `.deb` 包(即清除 `/var/cache/apt/archives` 目录,不过只清理过时的包)。如果需要使用清除命令,只需在终端窗口中键入以下命令:
```
sudo apt-get clean
@ -26,9 +26,9 @@ sudo apt-get clean
sudo apt-get autoremove
```
### 移除不需要的本地数据 ###
## 移除不需要的本地数据 ##
为达到此目的,我们需要安装 `localepurge` 软件,它将自动移除一些不需要的本地数据。这个软件是一个简单的脚本,它将从那些 不再需要的本地文件和本地联机手册( man pages ) 所占用的空间中回收磁盘空间。这个软件将在任何 apt 安装命令运行时 被自动激活。
为达到此目的,我们需要安装 `localepurge` 软件它将自动移除一些不需要的本地化数据LCTT 译注:即各种语言翻译)。这个软件是一个简单的脚本,它将从那些不再需要的本地文件和本地联机手册( man pages ) 所占用的空间中回收磁盘空间。这个软件将在任何 apt 安装命令运行时 被自动激活。
在 Ubuntu 中安装 `localepurge`
@ -36,7 +36,7 @@ sudo apt-get autoremove
sudo apt-get install localepurge
```
在通过 `apt-get install` 安装任意软件后, localepurge 将移除所有 不是使用你系统中所设定语言的 翻译文件和翻译的联机手册。
在通过 `apt-get install` 安装任意软件后, localepurge 将移除所有不是使用你系统中所设定语言的翻译文件和翻译的联机手册。
假如你想设置 `localepurge`,你需要编辑 `/ect/locale.nopurge` 文件。
@ -54,9 +54,9 @@ sudo apt-get install discus
> localepurge: Disk space freed in /usr/share/locale: 41860K
### 移除 孤包 ###
## 移除孤包 ##
假如你想移除孤包,你需要安装 `deborphan` 软件:
假如你想移除孤包,你需要安装 `deborphan` 软件:
在 Ubuntu 中安装 `deborphan` :
@ -72,11 +72,11 @@ sudo apt-get install deborphan
sudo deborphan | xargs sudo apt-get -y remove --purge
```
### 使用 GtkOrphan 来移除 孤包 ###
### 使用 GtkOrphan 来移除孤包 ###
`GtkOrphan` (一个针对 debian 系发行版本的 Perl/Gtk2 应用) 是一个分析 用户安装过程状态并查找孤立库文件的图形化工具, 它为 `deborphan` 提供了一个 GUI 前端,并具备移除软件包的功能。
`GtkOrphan` (一个针对 debian 系发行版本的 Perl/Gtk2 应用) 是一个分析用户安装过程状态并查找孤立库文件的图形化工具,它为 `deborphan` 提供了一个 GUI 前端,并具备移除软件包的功能。
### 在 Ubuntu 中安装 GtkOrphan ###
#### 在 Ubuntu 中安装 GtkOrphan ####
打开终端并运行如下命令:
@ -90,11 +90,11 @@ sudo apt-get install gtkorphan
### 使用 Wajig 移除孤包 ###
`Wajig`是 Debian 包管理系统中一个简单的软件包管理前端。它将 apt、apt-cache、 dpkg、 /etc/init.d 中的脚本等 通过一个单一命令集成在一起,它的设计初衷是 使用简单 和 为它所包含的函数提供丰富的文档。
`Wajig`是 Debian 包管理系统中一个简单的软件包管理前端。它将 apt、apt-cache、 dpkg、 /etc/init.d 中的脚本等 通过一个单一命令集成在一起,它的设计初衷是使用简单和为它的所有功能提供丰富的文档。
通过适当的 `sudo`配置,大多数(如果不是全部)的软件包安装和创建等任务可以通过 一个用户 shell 来完成。`Wajig` 也适用于一般的系统管理。另外,一个 Gnome GUI 命令 `gjig`也被囊括在这个软件包之中。
通过适当的 `sudo`配置,大多数(如果不是全部)的软件包安装和创建等任务可以通过一个用户 shell 来完成。`Wajig` 也适用于一般的系统管理。另外,一个 Gnome GUI 命令 `gjig`也被囊括在这个软件包之中。
### 在 Ubuntu 中安装 Wajig ###
#### 在 Ubuntu 中安装 Wajig ####
打开终端并运行如下命令:
@ -102,13 +102,13 @@ sudo apt-get install gtkorphan
sudo apt-get install wajig
```
### Debfoster --- 跟踪你在安装过程中的操作 ###
## Debfoster --- 跟踪你在安装过程中的操作 ##
debfoster 将会维护一个列有 被明确要安装的软件包的列表,但不包括那些作为某个软件的依赖而被安装的软件包。参数是完全可选的,你甚至可以使得 在 dpkg 和/或 apt-get 每次运行之后的每一秒内 激活 debfoster 。
debfoster 将会维护一个列有被明确要安装的软件包的列表,但不包括那些作为某个软件的依赖而被安装的软件包。参数是完全可选的,你甚至可以使得在 dpkg 和/或 apt-get 每次运行之后马上激活 debfoster 。
另外,你还可以在命令行中使用 debfoster 来安装或移除某些特定的软件包。那些后缀为 `---` 的软件包将会被移除,而没有后缀的软件包将会被安装。
假如一个新的软件包或 debfoster 注意到 作为某个软件包的依赖的软件包 是一个孤包,则 debfoster 将会询问你下一步如何操作。若你决定保留这个孤包, debfoster 将只会进行记录并继续安装过程;若你觉得这个软件包不足以引起你的兴趣,在 debfoster 询问这个问题后,它将移除这个软件包。进一步的,如果你的决定使得其他的软件包变为孤包,更多的提问将会接踵而来。
假如一个新的软件包或 debfoster 注意到作为某个软件包的依赖的软件包是一个孤包,则 debfoster 将会询问你下一步如何操作。若你决定保留这个孤包, debfoster 将只会进行记录并继续安装过程;若你觉得这个软件包不足以引起你的兴趣,在 debfoster 询问这个问题后,它将移除这个软件包。进一步的,如果你的决定使得其他的软件包变为孤包,更多的提问将会接踵而来。
### 在 Ubuntu 中安装 debfoster ###
@ -120,13 +120,13 @@ sudo apt-get install debfoster
### 使用 debfoster ###
为了创建一个 初始跟踪文件,可以使用如下命令:
为了创建一个初始跟踪文件,可以使用如下命令:
```
sudo debfoster -q
```
你总可以编辑 `/var/lib/debfoster/keepers` 文件,来定义那些 你想留在系统中的软件包。
你总可以编辑 `/var/lib/debfoster/keepers` 文件,来定义那些你想留在系统中的软件包。
为了编辑这个文件,可以键入:
@ -134,7 +134,7 @@ sudo debfoster -q
sudo vi /var/lib/debfoster/keepers
```
强制使 debfoster 去移除 所有没有被列在上面这个文件的软件包安装作为某些列在这个文件中的软件包的依赖, 它也会添加所有在这个列表中没有被安装的软件包。若要根据这个列表来执行相关操作,只需执行
强制使 debfoster 去移除所有没有被列在上面这个文件的软件包,或安装作为某些列在这个文件中的软件包的依赖,它也同时会添加所有在这个列表中没有被安装的软件包。若要根据这个列表来执行相关操作,只需执行
```
sudo debfoster -f
@ -146,9 +146,9 @@ sudo debfoster -f
sudo debfoster
```
### xdiskusage -- 查看你的硬盘空间都去哪儿了 ###
## xdiskusage -- 查看你的硬盘空间都去哪儿了 ##
图形化地展示磁盘使用情况的 du.xdiskusage 是一个用户友好型程序,它将为你展示你所有磁盘的使用情况。 它是在 Phillip C. Dykstra 所写的 “xdu” 程序的基础上设计的。一些改变使得它可以为你运行 “du”命令并显示磁盘的剩余空间并且假如你想清晰地了解你的磁盘空间都去哪儿了它还可以生成一个 PostScript 格式的名为 display.xdiskusage 的文件。
图形化地展示磁盘使用情况的 du。xdiskusage 是一个用户友好型的程序,它将为你展示你所有磁盘的使用情况。 它是在 Phillip C. Dykstra 所写的 “xdu” 程序的基础上设计的。做了一些修改以使得它可以为你运行 “du”命令并显示磁盘的剩余空间并且假如你想清晰地了解你的磁盘空间都去哪儿了它还可以生成一个 PostScript 格式的名为 display.xdiskusage 的文件。
### 在 Ubuntu 中安装 xdiskusage ###
@ -169,9 +169,9 @@ sudo xdiskusage
![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/5.png)
### Bleachbit ###
## Bleachbit ##
BleachBit 能快速地释放磁盘空间并不知疲倦地保护你的隐私。它可以 释放缓存,删除 cookie清除 Internet 上网历史,粉碎临时文件,删除日志,丢弃你所不知道存在何处的垃圾。为 Linux 和 Windows 系统设计,它支持擦除清理数以千计的应用程序,如 Firefox, Internet Explorer, Adobe Flash, Google Chrome, Opera, Safari 等等。除了简单地删除文件BleachBit 还包括许多高级功能,诸如 粉碎文件以防止恢复,擦除磁盘空间 来隐藏被其他应用程序所删除文件的痕迹为火狐“除尘”使其速度更快等。比免费更好BleachBit 是一个开源软件。
BleachBit 能快速地释放磁盘空间并不知疲倦地保护你的隐私。它可以释放缓存,删除 cookie清除 Internet 上网历史,粉碎临时文件,删除日志,丢弃你所不知道存在何处的垃圾。为 Linux 和 Windows 系统设计,它支持擦除清理数以千计的应用程序,如 Firefox, Internet Explorer, Adobe Flash, Google Chrome, Opera, Safari 等等。除了简单地删除文件BleachBit 还包括许多高级功能诸如粉碎文件以防止恢复擦除磁盘空间来隐藏被其他应用程序所删除文件的痕迹为火狐“除尘”使其速度更快等。比免费更好BleachBit 是一个开源软件。
### 在 Ubuntu 中安装 Bleachbit ###
@ -195,10 +195,10 @@ via: http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with
作者:[ruchi][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.ubuntugeek.com/author/ubuntufix
[1]:http://www.ubuntugeek.com/cleaning-up-all-unnecessary-junk-files-in-ubuntu.html
[2]:http://www.ubuntugeek.com/www.ubuntugeek.com/install-ubuntu-tweak-on-ubuntu-14-10.html
[2]:http://linux.cn/article-3335-1.html

View File

@ -1,4 +1,4 @@
如何用slay杀掉指定用户的所有进程
slay干掉某个用户的所有进程
================================================================================
**slay** 是**Chris Ausbrooks**写的一款用于杀掉指定用户所有运行进程的命令行工具。slay对系统管理员而言在找出那些不应该运行进程的用户是很有用的。
@ -31,19 +31,19 @@ slay在大多数发行版中都有官方仓库。
~ sudo slay amitooo
slay: Done.
![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/slay-amitoo-kpenee.png)
![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/slay-amitoo-kpenee.png)
当slay运行完成后你应该就可以看到反馈了。
享受吧。
爽吧?!
--------------------------------------------------------------------------------
via: http://www.unixmen.com/kill-processes-specific-user-slay/
作者:[ Enock Seth Nyamador][a]
作者:[Enock Seth Nyamador][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,107 @@
性能优化使用ramlog将日志文件转移到内存中
================================================================================
Ramlog 以系统守护进程的形式运行。在系统启动时它创建虚拟磁盘ramdisk将 /var/log 下的文件复制到虚拟磁盘中,同时把虚拟磁盘挂载为/var/log。然后所有的日志就会更新到虚拟磁盘上。而当 ramlog 重启或停止时,需要记录到硬盘上的日志就会保留在目录/var/log.hdd中。而关机的时候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上。
4. 而如果使用的是内核ramdiskramdisk会在/dev/ram9中创建并将其挂载至/var/log。默认情况下ramlog会占用所有ramdisk的内存其大小由内核参数"ramdisk_size"指定。
5. 接着其它的守护进程被启动并在ramdisk中更新日志。Logrotate译注Linux日志轮替工具和 ramdisk 配合的也很好。
6. 重启默认一天一次ramlog时目录/var/log.hdd将借助rsync与/var/log保持同步。日志自动保存的频率可以通过cron译注Linux例行性工作调度来控制。默认情况下ramlog 的调度任务放置在目录/etc/cron.daily下。
7. 系统关机时ramlog在最后一个守护进程关闭之前关闭。
8. 在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译注具体哪个配置文件视不同引导加载程序而定给你的当前内核的新增选项 'ramdisk_size=xxx' 其中xxx是ramdisk的空间大小。
### 配置Ramlog ###
基于deb的系统中Ramlog的配置文件位于/etc/default/ramlog你可以在该配置文件中设置以下变量
RAMDISKTYPE=0
# 取值:
# 0 -- tmpfs (可被交换到交换分区) -- 默认
# 1 -- ramfs (旧内核不能设置最大空间大小,
# 不能被交换到交换分区,和 SELinux 不兼容)
# 2 -- 老式的内核 ramdisk
TMPFS_RAMFS_SIZE=
# 可以用于 tmpfs 或 ramfs 的最大内存大小
# 这个值可以是百分比或数值(单位是 Mb例如
# TMPFS_RAMFS_SIZE=40%
# TMPFS_RAMFS_SIZE=100m
# 该值为空表示 tmpfs/ramfs 的大小是全部内存的 50%
# 更多选项可以参考 man mount' 中的Mount options for tmpfs' 一节
# 补充在较新的内核中ramfs 支持大小限制,
# 虽然 man 中说没有这个挂载选项)
# 该选项仅用于 RAMDISKTYPE=0 或 1 时
KERNEL_RAMDISK_SIZE=MAX
#以 kb 为单位指定的内核 ramdisk 大小,或者使用 MAX 来使用整个 ramdisk。
#该选项仅用于 RAMDISKTYPE=2 时
LOGGING=1
# 0=关闭, 1=打开 。记录自身的日志到 /var/log/ramdisk
LOGNAME=ramlog
# 自身的日志文件名 (用于 LOGGING=1时
VERBOSE=1
# 0=关闭, 1=打开 (设置为 1时启动或停止失败时会调用 teststartstop 将细节
# 写到日志中)
### 在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)
校对:[wxy](https://github.com/wxy)
本文由 [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

View File

@ -1,12 +1,12 @@
怎样在 Linux 中限制网络带宽
怎样在 Linux 中限制网络带宽使用
================================================================================
假如你经常在 Linux 桌面上运行多个网络应用,或在家中让多台电脑共享带宽;(这时,)你可能想更好地控制带宽的使用。否则,当你使用下载器下载一个大文件时,交互式 SSH 会话可能会变得缓慢以至不可用;或者当你通过 Dropbox 来同步一个大文件夹时,你的室友可能会抱怨在她的电脑上,视频流变得断断续续。
假如你经常在 Linux 桌面上运行多个网络应用,或在家中让多台电脑共享带宽;那么你可能想更好地控制带宽的使用。否则,当你使用下载器下载一个大文件时,交互式 SSH 会话可能会变得缓慢以至不可用;或者当你通过 Dropbox 来同步一个大文件夹时,你的室友可能会抱怨在她的电脑上,视频流变得断断续续。
在本教程中,我将为你描述两种 在 Linux 中限制网络流量速率的不同方法。
在本教程中,我将为你描述两种在 Linux 中限制网络流量速率的不同方法。
### 在 Linux 中限制一个应用的速率 ###
限制网络流量速率的一种方法是通过一个名为[trickle][1]的命令行工具。通过在程序运行时,预先加载一个 速率限制 socket 库 的方法trickle 命令允许你改变任意一个特定程序的流量。 关于 trickle 命令的一个很好的特征是 它仅在用户空间中运行,这意味着,你不必需要 root 权限来达到限制一个程序的带宽使用的目的。为了与 trickle 程序兼容,这个特定程序必须使用没有静态链接库的套接字接口。当你想对一个不具有内置带宽控制功能的程序进行速率限制时trickle 可以帮得上忙。
限制网络流量速率的一种方法是通过一个名为[trickle][1]的命令行工具。通过在程序运行时,预先加载一个速率限制 socket 库 的方法trickle 命令允许你改变任意一个特定程序的流量。 trickle 命令有一个很好的特性是它仅在用户空间中运行,这意味着,你不必需要 root 权限就可以限制一个程序的带宽使用。要能使用 trickle 程序控制程序的带宽,这个程序就必须使用非静态链接库的套接字接口。当你想对一个不具有内置带宽控制功能的程序进行速率限制时trickle 可以帮得上忙。
在 UbuntuDebian 及其衍生发行版中安装 trickle
@ -20,10 +20,10 @@ $ sudo apt-get install trickle
$ sudo yum install trickle
```
trickle 的基本使用方法如下。仅需简单地把 trickle 命令(带有速率参数)放在你想运行的命令之前。
trickle 的基本使用方法如下。仅需简单地把 trickle 命令(及速率参数)放在你想运行的命令之前。
```
$ trickle -d <download-rate> -u <upload-rate> <command>
$ trickle -d <download-rate> -u <upload-rate> <command>
```
这就可以将 `<command>` 的下载和上传速率限定为特定值(单位 KBytes/s
@ -34,27 +34,27 @@ $ trickle -d <download-rate> -u <upload-rate> <command>
$ trickle -u 100 scp backup.tgz alice@remote_host.com:
```
如若你想,你可以使用下面的命令为你的 Firefox 浏览器设定最大下载速率e.g. , 300 KB/s通过产生一个[自定义启动器][3]的方式
如若你想,你可以通过创建一个[自定义启动器][3]的方式,使用下面的命令为你的 Firefox 浏览器设定最大下载速率(例如, 300 KB/s
```
trickle -d 300 firefox %u
```
最后, trickle 也可以 以守护进程模式运行,在该模式下,它将会限制所有通过 trickle 启动且正在运行的程序的总带宽和。 启动 trickle 使其作为一个守护进程(i.e., trickled):
最后, trickle 也可以以守护进程模式运行,在该模式下,它将会限制所有通过 trickle 启动且正在运行的程序的总带宽和。 启动 trickle 使其作为一个守护进程(例如, trickled
```
$ sudo trickled -d 1000
```
一旦 trickled 守护进程在后台运行,你便可以通过 trickle 命令来启动其他程序。假如你通过 trickle 启动一个程序,那么这个程序的最大下载速率将是 1000 KB/s 假如你再通过 trickle 启动了另一个程序,则每个程序的(下载)速率极限将会被限制为 500 KB/s, 等等。
一旦 trickled 守护进程在后台运行,你便可以通过 trickle 命令来启动其他程序。假如你通过 trickle 启动一个程序,那么这个程序的最大下载速率将是 1000 KB/s 假如你再通过 trickle 启动了另一个程序,则每个程序的(下载)速率极限将会被限制为 500 KB/s等等。
### 在 Linux 中限制一个网络接口的速率 ###
另一种控制你的带宽资源的方式是在每一个接口上限制带宽。这在你与其他人分享你的网络连接的上行带宽时尤为实用。同其他一样Linux 有一个工具来为你做这件事。[wondershaper][4]恰好执行限制网络接口速率的任务
另一种控制你的带宽资源的方式是在每一个接口上限制带宽。这在你与其他人分享你的网络连接的上行带宽时尤为实用。同其他一样Linux 有一个工具来为你做这件事。[wondershaper][4]就是干这个的
wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量调整命令,使用 QoS 来处理特定的网络接口。通过放置被赋予不同的优先级的传出流量在一个队列中,达到限制传出流量速率的目的, 而传入流量通过丢包的方式来达到速率限制的目的。
wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量调整命令,使用 QoS 来处理特定的网络接口。外发流量通过放在不同优先级的队列中,达到限制传出流量速率的目的;而传入流量通过丢包的方式来达到速率限制的目的。
事实上, wondershaper 的既定目标不仅仅是对一个接口增加其带宽上限当批量下载或上传正在进行时wondershaper 还试图去保持互动性会话如SSH 的低延迟。同样的,它还确保批量上传(e.g. , Dropbox 的同步)不会使得下载“窒息”,反之亦然。
事实上, wondershaper 的既定目标不仅仅是对一个接口增加其带宽上限当批量下载或上传正在进行时wondershaper 还试图去保持互动性会话如 SSH 的低延迟。同样的,它还会控制批量上传(例如, Dropbox 的同步)不会使得下载“窒息”,反之亦然。
在 Ubuntu Debian 及其衍生发行版本 中安装 wondershaper
@ -62,9 +62,9 @@ wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量
$ sudo apt-get install wondershaper
```
在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2]) 中安装 wondershaper(注:这里 链接 2 和 6 一样,可以删除其中之一)
在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2]) 中安装 wondershaper
``
```
$ sudo yum install wondershaper
```
@ -90,7 +90,7 @@ $ sudo wondershaper clear eth0
### 总结 ###
在本教程中,我介绍了两种不同的方法,来达到如何在 Linux 桌面环境中,控制每个应用或每个接口的带宽使用的目的。 这些工具对用户都及其友好,都为用户提供了一个快速且容易的方式来调整或限制流量。 对于那些想更多地了解如何在 Linux 中进行速率控制的读者,请参考 [the Linux bible][7].
在本教程中,我介绍了两种不同的方法,来达到如何在 Linux 桌面环境中,控制每个应用或每个接口的带宽使用的目的。 这些工具的使用都很简单,都为用户提供了一个快速且容易的方式来调整或限制流量。 对于那些想更多地了解如何在 Linux 中进行速率控制的读者,请参考 [the Linux bible][7].
--------------------------------------------------------------------------------
@ -98,15 +98,15 @@ via: http://xmodulo.com/limit-network-bandwidth-linux.html
作者:[Dan Nanni][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:http://monkey.org/~marius/trickle
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[2]:http://linux.cn/article-2324-1.html
[3]:http://xmodulo.com/create-desktop-shortcut-launcher-linux.html
[4]:http://lartc.org/wondershaper/
[5]:http://lartc.org/manpages/tc.txt
[6]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[6]:http://linux.cn/article-2324-1.html
[7]:http://www.lartc.org/lartc.html

View File

@ -1,14 +1,14 @@
LinSSID - 一款Linux下的图形化Wi-Fi扫描器
LinSSID一款Linux下的图形化Wi-Fi扫描器
================================================================================
### 介绍 ###
如你所知**LinSSID** 是一款可以用于寻找可用无线网络的图形化软件。它完全开源用C++写成使用了Linux无线工具、Qt5、Qwt6.1,它在外观和功能上与**Inssider** MS Windows相近。
你可能知道**LinSSID** 是一款可以用于寻找可用无线网络的图形化软件。它完全开源用C++写成使用了Linux wireless tools、Qt5、Qwt6.1,它在外观和功能上与**Inssider** MS Windows 下的)相近。
### 安装 ###
你可以使用源码安装如果你使用的是基于DEB的系统比如Ubuntu和LinuxMint等等你也可以使用PPA安装。
你可用从[this link][1]这个链接下载并安装LinSSID。
你可用从[这个][1]下载并安装LinSSID。
这里我门将使用PPA来安装并测试这个软件。
@ -22,22 +22,21 @@ LinSSID - 一款Linux下的图形化Wi-Fi扫描器
安装完成之后你可以从菜单或者unity中启动。
将被要求输入管理员密码。
需要输入管理员密码。
![Password required for iwlist scan_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Password-required-for-iwlist-scan_001.png)
![Password required for iwlist scan_001](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Password-required-for-iwlist-scan_001.png)
这就是LinSSID的界面。
![LinSSID_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/LinSSID_002.png)
![LinSSID_002](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/LinSSID_002.png)
现在选择你想要连接无线网络的网卡比如这里是wlan0.点击Play按钮来搜寻wi-fi网络列表。
现在选择你想要连接无线网络的网卡比如这里是wlan0点击Play按钮来搜寻wi-fi网络列表。
几秒钟之后LinSSID就会显示wi-fi网络了。
![LinSSID_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/LinSSID_003.png)
如你在上面的截屏中所见LinSSID显示SSID名、MAC ID、通道、隐私、加密方式、信号和协议等等信息。当然你可以让LinSSID显示更多的选项比如安全、带宽等等。要显示这些进入**View**菜单并选择需要的选项。同样它显示了不同通道中的信号随着时间信号强度的变化。最后它可以工作在2.4Ghz和5Ghz通道上。
![LinSSID_003](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/LinSSID_003.png)
如你在上面的截屏中所见LinSSID显示SSID名、MAC ID、通道、隐私、加密方式、信号和协议等等信息。当然你可以让LinSSID显示更多的选项比如安全设置、带宽等等。要显示这些进入**View**菜单并选择需要的选项。同样它显示了不同的通道中的信号随着时间信号强度的变化。最后它可以工作在2.4Ghz和5Ghz通道上。
就是这样。希望这个工具对你有用。
@ -53,7 +52,7 @@ via: http://www.unixmen.com/linssid-graphical-wi-fi-scanner-linux/
作者:[SK][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,31 @@
Windows 10 VS Linux
================================================================================
![](https://farm4.staticflickr.com/3852/14863156322_e4edbae70e_t.jpg)
前阵子 Windows 10 好像占据了绝大部分头条甚至在一些Linux圈里也是一样。最具代表性的是 betanews.com 的 Brian Fagioli 说 Windows 10 已经为 Linux 桌面系统敲响了丧钟Microsoft 如今宣布将为忠实的 Windows 用户免费提供 Windows 10Steven J. Vaughan-Nichols 说这是一个最新的开源公司,然后 Matt Hartley 比较了 Windows 10 和 UbuntuJesse Smith 从 Linux 用户的视角对 Windows 10 做出评估。
**Windows 10**,在 Microsoft [声明][1]说将免费提供给 Windows 7 及以上用户,这件事成为如今大家闲聊的热门话题。在 Linuxland 这里也没有被忽视。betanews.com 的 Brian Fagioli一个自封的 Linux 粉丝,如今这样说,“ Windows 10 把门彻底关上了。Linux 桌面元年将永远不会到来,歇歇吧。”[Fagioli解释][2]说 Microsoft 倾听了用户的抱怨而且并不只是记录一下,还更好地解决了这些问题。他说 Linux 错失了由 Windows 8 不受欢迎以及巨大失败带来的机会。然后他总结,拜 Windows 10 所赐,处于边缘地带的我们只能接受一个“破碎的梦”。
不过,来自闻名的 Distrowatch.com 的 Jesse Smith 说 Microsoft 并没有提供一个很明显的下载方式,不过确实可行而且它也升级了。安装程序非常简单,除了分区功能很有限甚至有点吓人。在最终启动进入 Windows 10 后Smith说界面布局很“松散”没有 Win7 里被很多人讨厌的大量分散注意的元素开始菜单又回来了取消了欢迎屏幕。据Smith所说还有一个很类似 Ubuntu 和 Android 的新的包管理程序,不过需要 Microsoft 在线账户才可以使用。[Smith的总结][3]里有这样一条,“感觉 Windows 10 像是 Android 的早期 beta 版本,一个设计成时刻保持在线的消费者操作系统。而不像是一个我能用来完成工作的操作系统。”
**S**mith的[完整文章][4]里比较了 Windows 10 和 Linux 的大量细节,不过 Matt Hartley 发表了一份实在的 Windows 10 vs Linux 的报告。[他说][5]两者的安装程序都很直观和简单Windows 的双启动仍然没那么容易Windows 默认提供了加密而 Ubuntu 只提供了配置选项。在桌面方面 Hartley 说 Windows 10 “纠结地丢弃了它 Windows 8 的根。”他觉得 Windows 10 的 Windows 商店比 Ubuntu 的漂亮很多但是实在不喜欢通过“一切都是卡片”的方式来查看新安装的应用。Hartley这样总结“首先是它将为大量 Windows 用户提供免费升级。这意味着大大降低了进入和升级门槛。第二,看起来 Microsoft 这次真的在全力以赴地倾听他们的用户需求了。”
**S**teven J. Vaughan-Nichols 如今声称 Microsoft 是最新的开源公司;不仅因为它将发布 Windows 10 的免费升级,而且 Microsoft 正在从一个软件公司转型为一个软件服务公司。然后,据 Vaughan-Nichols 所说Microsoft 需要开源来完成这次转型。从Novell/SUSE开始他们已经致力于这一块儿好多年了。不仅如此他们也发布过开源软件不管什么目的。[Vaughan-Nichols总结][6]“很多人不这么认为但是Microsoft——就是Microsoft——已经成为一家开源公司。”
--------------------------------------------------------------------------------
via: http://ostatic.com/blog/windows-10-versus-linux
作者:[Susan Linton][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://ostatic.com/member/susan-linton
[1]:https://news.google.com/news/section?q=microsoft+windows+10+free&ie=UTF-8&oe=UTF-8
[2]:http://betanews.com/2015/01/25/windows-10-is-the-final-nail-in-the-coffin-for-the-linux-desktop/
[3]:http://blowingupbits.com/2015/01/an-outsiders-perspective-on-windows-10-preview/
[4]:http://blowingupbits.com/2015/01/an-outsiders-perspective-on-windows-10-preview/
[5]:http://www.datamation.com/open-source/windows-vs-linux-the-2015-version-1.html
[6]:http://www.zdnet.com/article/microsoft-the-open-source-company/

View File

@ -1,14 +1,14 @@
如何用wifi-linux检测AP信号强度
================================================================================
作为一名python极客我喜欢在github上发现新的针对linux用户的python工具。今天我发现了一款用python写成的用于检测AP信号强度的工具。
作为一名python极客我喜欢在github上挖掘新的用于linux用户的python工具。今天我发现了一款用python写成的用于检测AP信号强度的工具wifi-linux
我已经在**wifi-linux**上实验了大约两个小时,并且它工作的很好但是我希望在不久的将来在作者那里看到一些单元测试,因为命令**plot**无法在我的电脑上工作,并且会导致一些问题。
### 什么是wifi-linux ###
根据github作者账号的官方的offical readme.md文件 wifi-linux是一个简单的收集你周围AP的RSSI信息的python脚本它还会画出RSSI活动图形。
根据github作者账号的官方的 readme.md文件 wifi-linux是一个简单的收集你周围AP的RSSI信息的python脚本它还会画出RSSI活动图形。
这同样可以用命令plot生成但是不幸的是这对我不可行。wifi-linux支持其他的命令比如**bp** 来加入一个断点,**print**会打印一些统计和**启动开关**。
作者说可以在该程序中可以使用plot命令绘制RSSI 活动图形但是不幸的是这对我不可行。wifi-linux支持其他的命令,比如**bp** 来加入一个断点,**print**会打印一些统计和**启动开关**。
wifi-linux程序有下面这些依赖
@ -19,15 +19,15 @@ wifi-linux程序有下面这些依赖
### 安装wifi-linux需要的包 ###
尝试使用python包管理工具pip安装python-dbus但是失败了因为pip会查找setup.py但是python-dbus中没有。因此下面的命令不工作。
我尝试使用python包管理工具pip安装python-dbus但是失败了因为pip会查找setup.py但是python-dbus中没有。因此下面的命令不工作。
pip install dbus-python
你可以试一下但是很有可能会在终端中下面的错误。
你可以试一下但是很有可能会在终端中出现下面的错误。
IOError: [Errno 2] No such file or directory: '/tmp/pip_build_oltjano/dbus-python/setup.py'
我该怎么解决这个问题呢很简单用下面命令中的系统包管理工具安装Python DBUS。
我该怎么解决这个问题呢?很简单,用下面命令中的系统包管理工具安装Python DBUS。
sudo apt-get install python-dbus
@ -69,7 +69,7 @@ wifi-linux程序有下面这些依赖
![the bp command in wifi-linux](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux2.png)
命令**print**可以用于显示你机器的状态。下面就是一个例子。
命令**print**可以用于在终端上显示你机器的状态。下面就是一个例子。
![the print command](http://blog.linoxide.com/wp-content/uploads/2015/01/wifi-linux3.png)
@ -79,7 +79,7 @@ via: http://linoxide.com/linux-how-to/monitor-access-point-signal-strength-wifi-
作者:[Oltjano Terpollari][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,47 @@
WordPress 可以触发 Linux 上的 Ghost 缺陷
-----
*建议用户马上更新可用的补丁*
![WordPress validating pingbacks post URL](http://i1-news.softpedia-static.com/images/news2/WordPress-Can-Be-Used-to-Leverage-Critical-Ghost-Flaw-in-Linux-471730-2.jpg)
**这个漏洞之前由Qualys的安全研究员发现并取了绰号叫[Ghost](1)可以利用WordPress或其他PHP应用来攻击网站服务器。**
这个瑕疵是一个缓冲区溢出问题可以被攻击者触发用来获取Linux主机的命令行执行权限。发生在glibc的“`__nss_hostname_digits_dots()`”函数中它会被“gethostbyname()”函数用到。
###PHP应用可以用来利用这个瑕疵
Sucuri的Marc-Alexandre Montpas说之所以这个问题很重要是因为这些函数在大量软件和服务器系统使用。
“说这是个严重问题的一个例子是WordPress本身它使用一个叫`wp_http_validate_url()`的函数来验证每个pingback的发送URL它是通过PHP应用的“gethostbyname()”函数替代来执行的”,他在周三的一篇博客文章里写到。
攻击者可以用这种方式来引入一个设计用来触发服务器端漏洞的恶意URL从而获得系统访问权限。
实际上Trustwave的安全研究人员提供了[验证][2]代码可以使用WordPress的pingback功能引起缓冲区溢出。
###多个Linux发行版受到影响
ghost漏洞存在于glibc 2.17以上版本中发布于2013年5月21日。glibc当前版本是2.20发布于2014年9月。
不过当时并没有升级为一个安全补丁许多发行版并没有包含进去特别是提供长期支持LTS的发行版。
受影响的系统包括Debian 7wheezyRed Hat企业版Linux 6和7CentOS 6和7Ubuntu 12.04。幸运的是Linux供应商已经开始发布可以减轻风险的升级补丁。建议用户马上下载并更新。
为了展示这个漏洞Qualys建立了一个利用它通过Exim邮件服务器运行远程代码的试验页面。这家安全公司声称在这个漏洞丢掉半条命之前不会关闭这个页面意思是受影响的系统的数量降到50%的水平。
Linux上存在漏洞的应用包括clockdiffping和arping在某些特定情况下procmailpppd和Exim邮件服务器。
--------------------------------------------------------------------------------
via: http://news.softpedia.com/news/WordPress-Can-Be-Used-to-Leverage-Critical-Ghost-Flaw-in-Linux-471730.shtml
本文发布时间:30 Jan 2015, 17:36 GMT
作者:[Ionut Ilascu][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://news.softpedia.com/editors/browse/ionut-ilascu
[1]:http://news.softpedia.com/news/Linux-Systems-Affected-by-14-year-old-Vulnerability-in-Core-Component-471428.shtml
[2]:http://blog.spiderlabs.com/2015/01/ghost-gethostbyname-heap-overflow-in-glibc-cve-2015-0235.html

View File

@ -2,11 +2,11 @@
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Plasma_Ubuntu_1410.jpg)
[KDE][1] Plasma 5.2已经[发布][2]在本篇中我们将看到如何在Ubuntu 14.10 上安装KDE Plasma 5.2。
[KDE][1] Plasma 5.2已经[发布][2]一段时间了在本篇中我们将看到如何在Ubuntu 14.10 上安装KDE Plasma 5.2。
Ubuntu的默认桌面环境Unity很漂亮还有很多特性。但是如果你问任何有经验的Linux用户关于桌面自定义他的回答将是KDE。KDE在定制上是王者并且它得到流行大概是由于Ubuntu有官方的KDE版本也就是Kubuntu[3]。
Ubuntu的默认桌面环境Unity很漂亮还有很多特性但是如果你问任何有经验的Linux用户关于桌面定制能力他的回答将是KDE。KDE在定制上是王者并且它得到流行大概是由于Ubuntu有官方的KDE版本也就是Kubuntu[3]。
对于Ubuntu或者任何其他的Linux系统而言)的一个好消息是它没有绑定任何特定的桌面环境。你可以安装额外的桌面环境并且可以在不同的桌面环境间切换。早先我们已经了解了桌面环境的安装。
对于Ubuntu或者任何其他的Linux系统)而言的一个好消息是它们没有绑定在任何特定的桌面环境上,你可以安装额外的桌面环境并在不同的桌面环境间切换。早先我们已经了解如下的桌面环境的安装。
- [如何在Ubuntu 14.04中安装Mate桌面][4]
- [如何在Ubuntu 14.04中安装Cinnamon桌面][5]
@ -17,25 +17,24 @@ Ubuntu的默认桌面环境Unity很漂亮还有很多特性。但是如果你问
### 如何在Ubuntu 14.10 上安装KDE Plasma 5.2 ###
在Ubuntu 14.10上安装Plasma之前你要知道这会下载大概1GB的内容。因此在安装KDE之前要考虑速度和数据包。我们下载所使用的PPA是KDEs社区官方提供的。在终端中使用下面的命令:
在Ubuntu 14.10上安装Plasma之前你要知道这会下载大概1GB的内容。因此在安装KDE之前要考虑速度和数据存放空间。我们下载所使用的PPA是KDE社区官方提供的。在终端中使用下面的命令:
sudo apt-add-repository ppa:kubuntu-ppa/next-backports
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install kubuntu-plasma5-desktop plasma-workspace-wallpapers
During the installation, it will as you to choose the default display manager. I chose the default LightDM. Once installed, restart the system. At the login, click on the Ubuntu symbol beside the login field. In here, select Plasma.
在安装中我们要选择默认的显示管理器。我选择的是默认的LightDM。安装完成后重启系统。在登录时点击登录区域旁边的Ubuntu图标。这里选择Plasma。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Select_Plasma_KDE_Ubuntu.jpeg)
你现在就登录到KDE Plasma了。这里有一个KDE Plasma 5.2在Ubuntu 14.10下的截图
你现在就登录到KDE Plasma了。这里有一个KDE Plasma 5.2在Ubuntu 14.10下的截图
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/KDE_Plasma_Desktop.jpeg)
### 从Ubuntu卸载KDE Plasma ###
### 从Ubuntu卸载KDE Plasma ###
如果你想要还原更改使用下面的命令从Ubuntu 14.10中卸载KDE Plasma。
如果你想要卸载它使用下面的命令从Ubuntu 14.10中卸载KDE Plasma。
sudo apt-get install ppa-purge
sudo apt-get remove kubuntu-plasma5-desktop
@ -47,7 +46,7 @@ via: http://itsfoss.com/install-kde-plasma-ubuntu-1410/
作者:[Abhishek][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -2,7 +2,7 @@
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Use_Weather_Conky_Linux.jpeg)
智能手机都拥有一些平滑融入手机外观的天气小插件,幸亏有了 Flair Weather Conky你便可以**在你的 Linux 桌面中拥有像智能手机一样的天气外观**。我们将使用一个 GUI 工具[Conky Manager 在 Linux 中轻松地管理 Conky][1]。那就先让我们看看如何在 Ubuntu 14.1014.04、Linux Mint 17 及其他 Linux 发行版本中安装 Conky Manager 吧。
智能手机都拥有一些平滑融入手机外观的天气小插件,现在幸亏有了 Flair Weather Conky你便可以**在你的 Linux 桌面中拥有像智能手机一样的天气外观**。我们将使用一个 GUI 工具[Conky Manager 在 Linux 中轻松地管理 Conky][1]。那就先让我们看看如何在 Ubuntu 14.1014.04、Linux Mint 17 及其他 Linux 发行版本中安装 Conky Manager 吧。
### 安装 Conky Manager ###
@ -16,7 +16,7 @@
### 确保 `curl` 已被安装 ###
请确保 [curl][2] 已被安装。(如果没有安装它,)可以使用下面的命令来安装:
请确保 [curl][2] 已被安装。如果没有安装它,可以使用下面的命令来安装:
sudo apt-get install curl
@ -30,15 +30,15 @@
#### 步骤 1: ####
同你在 Ubuntu 14.04 中安装主题一样,在你的家目录中应该有一个 `.conky` 目录。假如你使用命令行,则不需要让我来告诉你如何找到这个目录。对于新手,请用文件管理器切换到你的家目录下,并按 `Ctrl+H` 来 [在 Ubuntu 中显示隐藏文件][4]。在这里查找 `.conky` 文件夹,假如没有这个文件夹,则创建一个。
同你在 Ubuntu 14.04 中安装主题一样,在你的家目录中应该有一个 `.conky` 目录。假如你使用命令行,我想我不需要告诉你如何找到这个目录。对于新手,请用文件管理器切换到你的家目录下,并按 `Ctrl+H` 来 [在 Ubuntu 中显示隐藏文件][4]。在这里查找 `.conky` 文件夹,假如没有这个文件夹,则创建一个。
#### 步骤 2: ####
`.conky` 目录中,解压下载到的 Flair Weather 文件。请注意在默认情况下它会自动解压到一个名为 `.conky` 目录。所以请进入这个目录,将 Flair Weather 文件夹从中取出,然后将它粘贴到真正的 `.conky` 目录下。
`.conky` 目录中,解压下载到的 Flair Weather 文件。请注意在默认情况下它会自动解压到一个名为 `.conky` 目录。所以请进入这个目录,将其中的 Flair Weather 文件夹从中取出,然后将它粘贴到真正的 `.conky` 目录下。
#### 步骤 3: ####
Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的位置。你需要手动地编辑它。到[Yahoo 天气][5] 网页,然后通过键入你的城市/Pin 码来得到你所在城市的 位置 ID号。你可以从网页地址栏中取得位置 ID 号。
Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的位置。你需要手动地编辑它。到[Yahoo 天气][5] 网页,然后通过键入你的城市/Pin 码来得到你所在城市的位置 ID号。你可以从网页地址栏中取得位置 ID 号。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Yahoo_Weather_Location_Code.jpeg)
@ -46,7 +46,7 @@ Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的
打开 Conky Manager它应该能够读取新安装的 Conky 脚本。这里有两款样式可用,黑色主题或亮丽主题。你可以选择你偏爱的那一款。当你选择后,你就可以在桌面上看到 conky 的显示了。
在 Flair Weather 中,默认位置被设定为 Melbourne。你必须手动编辑 conky 文件。
在 Flair Weather 中,默认位置被设定为 Melbourne。你必须手动编辑 conky 文件来修改
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Using_Weather_Conky_Ubuntu.jpeg)
@ -56,44 +56,49 @@ Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Edit_Conky.jpeg)
在上面查找的相同位置,假如你将 C 替换为 F,则温度的单位将从摄氏温标改为华氏温标 。不要忘了重启 Conky 来查看已经做出的修改。
在上面查找的相同位置,假如你将`u=c` 替换为`u=f`,则温度的单位将从摄氏温标改为华氏温标 。不要忘了重启 Conky 来查看已经做出的修改。
#### 可能的故障排除 ####
(注:这一小节在 md 文件中没有,原文新添加的。)
在 Ubuntu 14.04 和 Ubuntu 14.10 中,假如你发现 Conky 展示的时间有重叠现象,则请编辑 conky 脚本。查找下面的这些行:
```
## cairo-compmgr
own_window_type override
own_window_argb_visual no
```
然后将内容更换为下面的这些行:
```
## cairo-compmgr
own_window_type dock
own_window_argb_visual no
```
保存更改并重启 conky。这就应该解决了这个问题。感谢 Jesse(这个 Conky 脚本的开发者)给我们提供了这个解决方法和为其他相关问题给予的支持。
#### 尝试尝试 ####
### 尝试一下 ###
在这篇文章中,我们实际上学到了不少东西。我们见证了如何轻松地使用任何 Conky 脚本,如何编辑脚本以及如何使用 Conky Manager 来达到不同的目的。我希望这些对你有用。
需要留心的是Ubuntu 14.10 用户可能会看到重叠的时间数字。请在开发者 Jesse 绝妙的[Google + 主页][6] 中报告任何相关的问题。(注:这句在 md 文件中的内容与原文有差异,我按照原文翻译,并加上了 链接)
需要留心的是Ubuntu 14.10 用户可能会看到重叠的时间数字。请在开发者 Jesse 绝妙的[Google + 主页][6] 中报告任何相关的问题。
我已经向你展示了在我的系统上 Flair Weather conky 外观的截图。现在是该你尝试它并炫耀你的桌面的时间了。
我已经向你展示了在我的系统上 Flair Weather conky 外观的截图。现在该你尝试它并炫耀你的桌面的时间了。
--------------------------------------------------------------------------------
via: http://itsfoss.com/weather-conky-linux/
作者:[Abhishek][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:http://itsfoss.com/conky-gui-ubuntu-1304/
[1]:http://www.linux.cn/article-3434-1.html
[2]:http://www.computerhope.com/unix/curl.htm
[3]:http://speedracker.deviantart.com/art/Flair-Weather-Conky-Made-for-Conky-Manager-510130311
[4]:http://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/

View File

@ -1,6 +1,6 @@
Linux 基础:在CentOS 7上给一个网卡分配多个IP地址
在CentOS 7上给一个网卡分配多个IP地址
================================================================================
有时你也许想要给一个网卡多个地址。你该怎么做呢?另外买一个网卡来分配地址?不用这么做(只要在小型网络中)。我们现在可以再CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么好的跟随我这并不难。
有时你也许想要给一个网卡多个地址。你该怎么做呢?另外买一个网卡来分配地址?在小型网络中其实不用这么做。我们现在可以在CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么好的跟随我这并不难。
首先让我们找到网卡的IP地址。在我的CentOS 7服务器中我只使用了一个网卡。
@ -83,7 +83,6 @@ Linux 基础在CentOS 7上给一个网卡分配多个IP地址
类似地你可以加入更多的ip地址。
Finally, save and close the file. Restart network service to take effect the changes.
最后,保存并退出文件。重启网络服务来使更改生效。
systemctl restart network
@ -172,11 +171,9 @@ Finally, save and close the file. Restart network service to take effect the cha
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
你可以看到我已经添加一个A类地址(10.0.0.1)并且前缀是16
你可以看到我已经添加一个A类地址(10.0.0.1)并且前缀是16
保存并退出文件。重启网络服务,
接着ping新增的地址
保存并退出文件。重启网络服务接着ping新增的地址
ping -c 4 10.0.0.1
@ -202,7 +199,7 @@ via: http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-net
作者:[SK][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,10 +1,10 @@
如何使用 backupninja 来备份一个 Debian 系统
如何使用 backupninja 来备份 Debian 系统
================================================================================
面临灾难时的小心谨慎或体验可以教会每一个系统管理采取频繁的系统备份的重要性。你可以通过编写存在已久的管用的 shell 脚本,或使用一个(或多个) 适合这项工作的备份工具来完成备份任务。因此,当你要实施一个备份解决方案时,你了解的备份工具越多,你做出的决策就会越明智。
小心谨慎或灾难体验会让每一个系统管理都认识到频繁的系统备份的重要性。你可以通过编写管用的旧式 shell 脚本,或使用一个(或几个)适合这项工作的备份工具来完成备份任务。因此,当你要实施一个备份解决方案时,你了解的备份工具越多,你做出的决策就会越明智。
在这篇文章中,我们将为你介绍 [backupninja][2] ,一个轻量且易于配置的系统备份工具。在诸如 **rdiff-backup**, **duplicity**, **mysqlhotcopy****mysqldump** 等程序的帮助下, Backupninja 可以提供常用的备份功能,如执行远程的、安全的和增量式的文件系统备份,加密备份以及 MySQL/MariaDB 数据库备份。你可以选择性地开启使用 email 进行状态报告功能,也可以对一般的硬件和系统的信息进行备份。 backupninja 的一个关键功能是它拥有一个内建的基于控制台的向导程序(被称为 **ninjahelper**),而后者允许你为不同的备份情景轻松地创建配置文件。
在这篇文章中,我们将为你介绍 [backupninja][2] 这是一个轻量且易于配置的系统备份工具。在诸如 **rdiff-backup**, **duplicity**, **mysqlhotcopy****mysqldump** 等程序的帮助下, Backupninja 可以提供常用的备份功能,如执行远程的、安全的和增量式的文件系统备份,加密备份以及 MySQL/MariaDB 数据库备份。你可以选择性地开启使用 Email 状态报告功能,也可以对一般的硬件和系统的信息进行备份。 backupninja 的一个关键功能是它拥有一个内建的基于控制台的向导程序(被称为 **ninjahelper**,而后者允许你为不同的备份情景轻松地创建配置文件。
如果非要说的话backupninja 的缺点是:为了充分使用其所有的功能,它要求一些其他“助手”程序已经被安装在了计算机中。尽管 backupninja 有针对基于 Red Hat(红帽) 的发行版本的 RPM 安装包,但 backupninja 针对 Debian 和它的衍生发行版本的依赖进行了优化。所以不建议在基于 Red Hat 的系统上尝试 backupninja 。
如果非要说的话backupninja 的缺点是:为了充分使用其所有的功能,它要求安装一些其他“助手”程序。尽管 backupninja 有针对基于 Red Hat红帽的发行版本的 RPM 安装包,但 backupninja 针对 Debian 及其衍生发行版本的依赖进行了优化。所以不建议在基于 Red Hat 的系统上尝试 backupninja 。
在这篇教程中,我们将介绍如何在基于 Debian 的发行版本上安装 backupninja 。
@ -16,17 +16,17 @@
在安装的过程中,有几个文件和目录将被创建:
- **/usr/sbin/backupninja** 是 bash shell 主脚本;
- **/etc/cron.d/backupninja** 默认情况下,构建 cron 任务来每隔一个小时运行上面的主脚本;
- **/etc/logrotate.d/backupninja** 处理由 backupninja 程序产生的日志;(注:我不知道这里的 rotate 该如何翻译)
- **/usr/sbin/backupninja** 是 bash shell 主脚本;
- **/etc/cron.d/backupninja** 默认情况下,设置 cron 任务来每隔一个小时运行上面的主脚本;
- **/etc/logrotate.d/backupninja** 截断由 backupninja 程序产生的日志;
- **/etc/backup.d/** 是备份操作的配置文件驻留的目录;
- **/etc/backupninja.conf** 是包含一般选项的主配置文件。这个文件带有良好的注释且详细解释了每个选项的含义;
- **/usr/share/backupninja** 是那些 backupninja 使用的脚本所处的目录。这些脚本文件负责执行实际的工作。在这个目录中,你还可以找到 `.helper` 文件,它们可以被用来配置和设定 ninjahelper 的菜单;
- **/usr/share/doc/backupninja/examples** 含有操作配置文件(即通过 ninjahelper 产生的文件)的模板。
- **/usr/share/backupninja** 是那些 backupninja 使用的脚本所处的目录。这些脚本文件负责执行实际的工作。在这个目录中,你还可以找到 `.helper` 文件,它们可以被用来配置和设定 ninjahelper 的菜单;
- **/usr/share/doc/backupninja/examples** 含有操作配置文件(即通过 ninjahelper 产生的文件)的模板。
### 首次运行 Ninjahelper ###
当我们尝试启动 ninjahelper 时,我们可以看到一个内部依赖可能会被需要。假如系统进行了提示,请输入 “yes” 并敲下回车键来安装 dialog(一个用于从 shell 脚本中显示友好对话框的工具)
当我们尝试启动 ninjahelper 时,我们可以看到可能需要一个内部依赖程序。假如系统进行了提示,请输入 “yes” 并敲下回车键来安装 dialog一个用于从 shell 脚本中显示友好对话框的工具)
![](https://farm8.staticflickr.com/7537/15700597667_6618fbc142_z.jpg)
@ -44,11 +44,11 @@
![](https://farm8.staticflickr.com/7508/15700315139_4c6117ef32_z.jpg)
接下来的一步需要你选取相关条目来作为此次备份任务的一部分。前四个条目已经默认被选上了,但你可以通过按空格键来撤消选择。
接下来的一步需要你选取相关条目来作为此次备份任务的一部分。前四个条目已经默认被选上了,但你可以通过在条目上按空格键来撤消选择。
![](https://farm8.staticflickr.com/7507/15699051870_65abaf52e5_z.jpg)
一旦你完成了上面的步骤,按 OK 选项来继续。接着你将能够选择 是愿意使用默认的配置文件(/etc/backup.d/10.sys)来完成这次备份操作,还是创建一个新的配置文件。若为后者,一个含有与默认配置文件内容相同的文件将会在相同的目录下被创建,但它被命名为 11.sys后续的备份操作将会创建类似的文件(注:只不过命名的序号不同)。需要说明的是一旦这个新的配置文件被创建,你便可以使用你喜爱的文本编辑器来编辑该文件。
一旦你完成了上面的步骤,按 OK 选项来继续。接着你将能够选择是愿意使用默认的配置文件(/etc/backup.d/10.sys)来完成这次备份操作,还是创建一个新的配置文件。若为后者,一个含有与默认配置文件内容相同的文件将会在相同的目录下被创建,但它被命名为 11.sys后续的备份操作将会创建类似的文件(注:只不过命名的序号不同)。需要说明的是一旦这个新的配置文件被创建,你便可以使用你喜爱的文本编辑器来编辑该文件。
![](https://farm9.staticflickr.com/8654/15885715072_1e6126e929_o.png)
@ -56,7 +56,7 @@
正如你最有可能知道的那样, rsync 被广泛地用于通过网络同步文件或文件夹。在接下来的例子中,我们将讨论一个使用硬链接来为一个远程目录做增量式拉取备份的方法,它被用来保存历史数据以及在我们本地的文件服务器中恢复这些历史数据。这个方法将帮助我们节省空间并增强位于服务器端的安全性。
**步骤 1**:编写一个位于 `/etc/backup.d`的带有如下内容的自定义脚本,并将它的权限设置为 600 。需要说明的是,除了一般的配置文件,这个目录可能还包含当 backupninja 执行时你想运行的一些脚本文件,它们可以发挥出位于主配置文件中的变量的优势。
**步骤 1**:编写一个带有如下内容的自定义脚本,放在 `/etc/backup.d`,并将它的权限设置为 600 。需要说明的是,除了一般的配置文件,这个目录可能还包含当 backupninja 执行时你想运行的一些脚本文件,它们可以发挥出位于主配置文件中的变量的优势。
# REMOTE USER
user=root
@ -72,36 +72,37 @@
# RSYNC
rsync -av --delete --recursive --link-dest=$localdirold $user@$host:$remotedir $localdir
在上面的配置中, rsync 的 --link-dest 选项的作用是为位于 $localdir-old 目录中那些没有改变的文件(包含所有属性) 硬链接到目标目录 ($localdir)
在上面的配置中, rsync 的 --link-dest 选项的作用是为位于 $localdir-old 目录中那些没有改变的文件(包含所有属性) 硬链接到目标目录$localdir
**步骤 2**:在 backupninja 第一次运行之前,上层目录(这个例子中指的是 /home/gacanepa) 是空的。第一次我们执行下面的命令:
**步骤 2**:在 backupninja 第一次运行之前,上层目录(这个例子中指的是 /home/gacanepa 是空的。第一次我们执行下面的命令:
# backupninja -n
backup.0 目录就被创建了,并在接下来的过程中,它的名称将会被更改为 backup.1。
当我们第二次运行 backupninja 时, backup.0 将会被重新创建,而 backup.1 被保留
当我们第二次运行 backupninja 时, backup.0 将会被重新创建,而 backup.1 保持不动
![](https://farm8.staticflickr.com/7581/15700597497_0e0cd89ab9.jpg)
**步骤 3** 确保 backup.1 里面的文件硬链接到 backup.0 里的文件,我们可以通过比较文件的 inode( i 节点) 数和目录的大小来达到此目的。
**步骤 3** 确保 backup.1 里面的文件硬链接到 backup.0 里的文件,我们可以通过比较文件的 inodei 节点)数和目录的大小来达到此目的。
![](https://farm9.staticflickr.com/8636/15700315029_e922ce771b.jpg)
### 总结 ###
Backupninja 不仅是一个经典的备份工具,它也是一个易于配置的实用程序。你可以通过编写你自己的 handler(注:我不知道该如何翻译 handler 这个单词) 来运行 backupninja 并将它们作为位于 `/etc.backup.d` 的个人配置文件。甚至你还可以为 ninjahelper 编写助手程序,以达到将它们包括在 ninjahelper 的主界面上。
Backupninja 不仅是一个经典的备份工具,它也是一个易于配置的实用程序。你可以通过编写你自己的控制脚本,用放在 `/etc.backup.d` 中的不同的配置文件来运行 backupninja 。甚至你还可以为 ninjahelper 编写助手程序,并将其包括在 ninjahelper 的主界面上。
例如,假如你在 `/usr/share/backupninja`目录中创建了一个名为 modulo 的 handler,它将自动运行那些位于 `/etc/backup.d` 目录中以 .xmodulo 为后缀的每个文件。如果你决定添加你的 xmodulo handler 到 ninjahelper 中, 你可以编写相应的助手程序,即 xmodulo.helper 。另外,假如你想 让 backupninja 运行任意一个脚本,只需把它添加到 `/etc/backup.d` 目录中,这样你的目的便可以达到了。
例如,假如你在 `/usr/share/backupninja`目录中创建了一个名为 xmodulo 的控制脚本,它将自动运行那些位于 `/etc/backup.d` 目录中以 .xmodulo 为后缀的每个文件。如果你决定添加你的 xmodulo 控制脚本到 ninjahelper 中, 你可以编写相应的助手程序,即 xmodulo.helper 。另外,假如你想 让 backupninja 运行其它的脚本,只需把它添加到 `/etc/backup.d` 目录中就可以了。
欢迎使用下面的评论框来留下你的评论、问题或建议。听到你的回应将会使我们很高兴。
--------------------------------------------------------------------------------
via: http://xmodulo.com/backup-debian-system-backupninja.html
作者:[Gabriel Cánepa][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,12 +1,12 @@
Linux有问必答:如何在脚本中获取进程IDPID
Linux有问必答如何在脚本中获取进程IDPID
================================================================================
> **提问**: 我想要知道运行中脚本subshell的进程id。我该如何在shell脚本中得到PID。
> **提问**: 我想要知道运行中脚本shell的进程id。我该如何在shell脚本中得到PID。
当我在执行shell脚本时它会启动一个叫subshell的进程。作为主shell的子进程subshell将shell脚本中的命令作为批处理运行因此称为“批处理进程”
当我在执行shell脚本时它会启动一个叫子shell的进程。作为主shell的子进程shell将shell脚本中的命令作为批处理运行因此称为“批处理进程”
在某些情况下,你也许想要知道运行中的subshell的PID。这个PID信息可以在不同的情况下使用。比如你可以使用shell脚本的PID在/tmp下创建一个唯一的临时文件。有时侯脚本需要检测所有运行的进程它可以从进程列表中排除自身的subshell。
在某些情况下,你也许想要知道运行中的shell的PID。这个PID信息可以在不同的情况下使用。比如你可以使用shell脚本的PID在/tmp下创建一个唯一的临时文件。有时侯脚本需要检测所有运行的进程它可以从进程列表中排除自身的shell。
在bash中**subshell进程的PID**存储在一个特殊的变量‘$$’中。这个变量只读,你不可以在脚本中修改它。比如:
在bash中**shell进程的PID**存储在一个特殊的变量‘$$’中。这个变量只读,你不可以在脚本中修改它。比如:
#!/bin/bash
@ -16,7 +16,7 @@ Linux有问必答:如何在脚本中获取进程IDPID
PID of this script: 6583
除了$$, bash shell还会导出其他的只读变量。比如PPID存储subshell父进程的ID也就是主shell。UID存储了执行这个脚本的当前用户ID。比如
除了$$, bash shell还会导出其他的只读变量。比如PPID存储shell父进程的ID也就是主shell。UID存储了执行这个脚本的当前用户ID。比如
#!/bin/bash
@ -43,6 +43,6 @@ Linux有问必答:如何在脚本中获取进程IDPID
via: http://ask.xmodulo.com/process-id-pid-shell-script.html
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -2,16 +2,11 @@ Linux 下最为人熟知的归档/压缩工具
================================================================================
很多时候,通过互联网发送或接收大文件和图片是一件令人头疼的事。压缩及解压缩工具正好可以应对这个问题。下面让我们快速浏览一些可以使得我们的工作更加轻松的开源工具。
Tar
gzip, gunzip
bzip2, bunzip2
7-Zip
### Tar ###
Tar 由 'Tape archiver' 衍生而来最初被用来在磁带上归档和存储文件。Tar 是一个 GNU 软件,它可以压缩一组文件(归档),或提取它们以及对已经存在的压缩文件进行相关操作。在存储、备份以及转移文件方面,它是很有帮助的。在创建归档文件时Tar 可以保持原有文件和目录结构不变。通过 Tar 归档的文件的后缀名为 .tar
Tar 由 'Tape archiver磁带归档器' 衍生而来最初被用来在磁带上归档和存储文件。Tar 是一个 GNU 软件它可以压缩一组文件归档或提取它们以及对已有的归档文件进行相关操作。在存储、备份以及传输文件方面它是很有用的。在创建归档文件时Tar 可以保持原有文件和目录结构不变。通过 Tar 归档的文件的后缀名为 .tar
基本用法
**基本用法如下:**
#### a) 创建归档 (c / --create) ####
@ -23,7 +18,7 @@ Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存
![tar cvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-cvf.png)
创建一个归档
*创建一个归档*
#### b) 列出归档文件内容 ( t / --list) ####
@ -31,7 +26,7 @@ Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存
![tar tvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-tvf.png)
列出归档中包含的文件
*列出归档中包含的文件*
#### c) 提取归档 (x / --extract) ####
@ -41,45 +36,45 @@ Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存
![tar xvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-xvf.png)
提取文件
*提取文件*
![tar xvf --wildcards](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-wildcard.png)
只提取需要的文件
*只提取需要的文件*
#### d) 对归档进行更新 ( u / --update) ####
#### d) 对归档文件进行更新 ( u / --update) ####
tar uvf archive.tar newfile.c - 假如归档的版本比先前存在的版本新,通过添加文件 newfile.c 来更新归档.
tar uvf archive.tar newfile.c - 假如归档的newfile.c 要比先前已经归档的新,则添加更新的 newfile.c 到归档里面.
![tar uvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-uvf.png)
更新一个归档
*更新一个归档*
#### e) 从归档中删除文件 (--delete) ####
tar--delete -f archive.tar file1.c - 从压缩包'archive.tar' 中删除文件'file1.c'
tar --delete -f archive.tar file1.c - 从压缩包'archive.tar' 中删除文件'file1.c'
![tar --delete](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-delete.png)
删除文件
*删除文件*
更加具体的使用方法请参考[tar 主页][1]。
### Gzip / Gunzip ###
Gzip 代表 GNU zip它是一个被广泛用于 Linux 操作系统中的压缩应用,被其压缩的文件的后缀名为'*.gz' 。
Gzip GNU zip它是一个被广泛用于 Linux 操作系统中的压缩应用,被其压缩的文件的后缀名为'*.gz' 。
** 基本用法 **
**基本用法如下:**
#### a) 压缩文件 ####
gzip file(s)
每个文件将被单独压缩。
每个文件将被**单独压缩**
![gzip](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip.png)
压缩文件
*压缩文件*
通常在压缩完成后,它会将原来的文件删除。我们可以使用 `-c` 选项来保留原来的文件。
@ -87,7 +82,7 @@ Gzip 代表 GNU zip它是一个被广泛用于 Linux 操作系统中的压缩
![gzip-c](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-c.png)
压缩后保留原有文件
*压缩后保留原有文件*
我们也可以将一组文件压缩到一个单独的文件中
@ -95,7 +90,7 @@ Gzip 代表 GNU zip它是一个被广泛用于 Linux 操作系统中的压缩
![gz group](http://blog.linoxide.com/wp-content/uploads/2015/01/gz-group.png)
压缩一组文件
*压缩一组文件*
#### b) 检查压缩比 ####
@ -105,17 +100,17 @@ Gzip 代表 GNU zip它是一个被广泛用于 Linux 操作系统中的压缩
![gzip -l](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-l.png)
检查压缩率
*检查压缩率*
#### c) 解压文件 ####
Gunzip 用来解压文件,在这里,原有文件在被解压后同样会被删除。使用 `-c`选项来保留原始文件。
Gunzip 用来解压文件,在这里,原有的(压缩)文件在被解压后同样会被删除。使用 `-c`选项来保留原始文件。
gunzip -c archieve.gz
![gunzip -c](http://blog.linoxide.com/wp-content/uploads/2015/01/gunzip-c.png)
解压文件
*解压文件*
gzip 加上'-d'选项 和 gunzip 对压缩文件有同样的效果。
@ -125,47 +120,50 @@ gzip 加上'-d'选项 和 gunzip 对压缩文件有同样的效果。
同 gzip 一样,[Bzip2][3] 也是一个压缩工具,与其他传统的工具相比,它可以将文件压缩到更小,但其缺点为:运行速度比 gzip 慢。
** 基本用法 **
**基本用法如下:**
#### a) 压缩文件 ####
一般情况下针对压缩而言Bzip2 没有选项可供选择,将被压缩的文件被传递为它的参数。每个文件被单独压缩,且压缩文件以 'bz2' 为后缀名。
一般情况下针对压缩而言Bzip2 不用什么选项,将被压缩的文件被传递为它的参数。每个文件被单独压缩,且压缩文件以 'bz2' 为后缀名。
bzip2 file1 file2 file3
![bzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2.png)
文件压缩
*文件压缩*
使用 '-k' 选项可以使得 在压缩或解压缩之后保留原有的文件。
使用 '-k' 选项可以使得在压缩或解压缩之后保留原有的文件。
![bzip2 -k](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-k.png)
在压缩后保留原有文件。
*在压缩后保留原有文件*
'-d' 选项被用来强制解压缩。
#### b) 解压 ####
'-d' 选项被用来解压缩。
![bzip2 -d](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-d.png)
使用 -d 选项删除文件 注:我(FSSlc)认为 这里的图片说明有误,可以参考 manpage或bzip 的官网来校对一下。)
*使用 -d 选项解压缩文件*
#### b) 解压 ####
也可以使用 bunzip2 来解压缩。
bunzip2 filename
![bunzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bunzip2.png)
解压文件
*解压文件*
bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2 和 tbz 的文件在压缩后,后缀名将变为'.tar' 。
bzip2 -dc 执行解压文件到标准输出的功能。
bzip2 -dc - 执行解压文件到标准输出的功能。
### 7-zip ###
[7-zip][4] 是另一个开源压缩软件。它使用 7z 这种新的压缩格式,并支持高压缩比。因此,它被认为是比先前提及的压缩工具更好的软件。在 Linux 下,可以通过 p7zip 软件包得到,该软件包里包含 3 个二进制文件 7z, 7za 和 7zr读者可以参考 [p7zip wiki][5] 来了解这三个二进制文件之间的不同。在本篇中,我们将使用 7zr 来解释 7-zip 的用法。归档文件以 '.7z' 为后缀名。
[7-zip][4] 是另一个开源压缩软件。它使用 7z 这种新的压缩格式,并支持高压缩比。因此,它被认为是比先前提及的压缩工具更好的软件。在 Linux 下,可以通过 p7zip 软件包得到,该软件包里包含 3 个二进制文件 7z, 7za 和 7zr读者可以参考 [p7zip wiki][5] 来了解这三个二进制文件之间的不同。在本篇中,我们将使用 7zr 来解释 7-zip 的用法。归档文件以 '.7z' 为后缀名。
** 基本用法 **
**基本用法如下:**
#### a) 创建归档 ####
@ -173,7 +171,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
![7zr a](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-a.png)
创建一个归档文件
*创建一个归档文件*
#### b) 列出归档包含文件 ####
@ -181,7 +179,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-l.png)
列出归档中包含的文件
*列出归档中包含的文件*
#### c) 提取归档文件 ####
@ -189,7 +187,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
![7zr e](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-e.png)
提取归档
*提取归档*
#### d) 更新归档文件 ####
@ -197,7 +195,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
![7zr u](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-u.png)
更新一个归档文件
*更新一个归档文件*
#### e) 从归档文件中删除文件 ####
@ -205,11 +203,11 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
![7zr d](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d.png)
删除文件
*删除文件*
![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d-l.png)
确认文件删除
*确认文件删除*
--------------------------------------------------------------------------------
@ -217,7 +215,7 @@ via: http://linoxide.com/tools/linux-compress-decompress-tools/
作者:[B N Poornima][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -36,7 +36,7 @@ via: http://www.ubuntugeek.com/how-to-protect-ubuntu-server-against-the-ghost-vu
作者:[ruchi][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,158 @@
Linux 游戏之 2015 动向
================================================================================
他们说Linux游戏开发已经死了已经变得毫无意义…… 随他们说去吧。一起看看2015甚至以后会为我们带来什么Linux游戏。
真的很难跟得上扑面而来的各种形形色色的新事物,但是可以快速浏览一下我们将会看到的变化。
### 已确认的游戏 ###
#### 冒险游戏 ####
- [看火人Firewatch][1]
- [失落的天堂初探Paradise Lost: First Contact][2]
- [时空英豪 1.1Outcast 1.1][42]
- [蒸汽世界:浩劫SteamWorld Heist][3]
#### 动作游戏 ####
- [暗黑血统Darksiders][4]
- [暗黑血统 2Darksiders 2][5]
- [尸人的世界Ray's The Dead][6]
- [骷髅女孩Skullgirls][7]
#### 第一人称游戏 ####
- [生化奇兵永恒Bioshock Infinite][8]
- 半条命 3 /troll Half Life 3 /troll   
- [烽火家园:革命Homefront: The Revolution][9]
- [叛变Insurgency][43]
- [杀戮空间 2Killing Floor 2][10]
- 英雄萨姆 4Serious Sam 4目前无官方站点
- [联合风暴Storm United][11]
- [烈火击杀SUPERHOT][12]
#### 平台游戏 ####
- [武装原型Broforce][13]
- [峡谷Chasm][14] #此处游戏中文名尚不确定
- [吉安娜姐妹Giana Sisters][15]
- [心之所向AliciaHeart Forth, Alicia][16]
- [热铁皮屋顶Hot Tin Roof][17]
- [无限工厂Infinifactory][18]
- [无敌Mighty No. 9][19]
- [林中之夜Night in the Woods][20]
- [夜Noct][21]
- [奇异的世界新鲜可口Oddworld: New 'N' Tasty][22]
- [真红女神Red Goddess][23]
#### 赛车游戏 ####
- [赛车计划Project Cars][44]
- [死亡赛车再生Carmageddon: Reincarnation][45]
#### 角色扮演游戏 ####
- [神界:原罪Divinity: Original Sin][24]
- [永恒之柱Pillars Of Eternity][25]
- [暗影狂奔香港Shadowrun: Hong Kong][26]
- [旗帜的传说The Banner Saga][27]
- [镇魂曲:遗器之潮Torment: Tides of Numenera][46]
#### 策略游戏 ####
- [奇迹时代Age of Wonders III][28]
- [At The Gates][47] # 尚无中文名
- [放逐之城Banished][29]
- [城天际Cities: Skylines][30]
- [发条帝国Clockwork Empires][31]
- [Parkitect][32] # 尚无中文名
- [卷轴Scrolls][33]
- [太空海盗和僵尸 2Space Pirates And Zombies 2][34]
#### 沙盒游戏 ####
- [泰拉瑞亚Terraria][35]
- [X 重生X Rebirth][36]
#### 体育游戏 ####
- [惊爆美国棒球16Out of the Park Baseball 16][48]
### 不太确认,不过可能性高 ###
- [英雄连 2Company of Heroes 2][37]
- [逃生Outlast][38]
- [影子武士Shadow Warrior][39]
- 无光之海 - 其开发商试验性地构建 Linux 版本,不过这要取决于他们的 Windows 版本的销售情况(据邮件沟通信息)
- [火炬之光 2Torchlight II][40]
然而有[两个来自Feral Interactive的移植大作][49],由于不知道他们是什么,所以没有列举出来。
我们猜测Aspyr也在准备新的大制作但是他们仅仅发布了他们最新的游戏所以可能要等上几个月我们才能看到些什么。
当然,** 这不是完整的列表 **,我们会轻易忘记如此多的游戏正在走向我们,哇,如此丰富的列表。
我们也期待 GDC 2015 上有一些改变然而我们没有什么确切的东西对于Valve与Steam Machines的合作我们期待至少会增加一些Linux游戏否则如我们担心炫耀一些过时的游戏会让Valve脸上无光。
希望我们没有错过那些 Linux 中让你感到兴奋的东西!
--------------------------------------------------------------------------------
via: http://www.gamingonlinux.com/articles/a-look-at-what-linux-games-we-will-see-in-2015-and-beyond.4963
作者:[liamdawe][a]
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.gamingonlinux.com/profiles/1
[1]:https://www.gamingonlinux.com/articles/category/17/articles/firewatch-a-first-person-mystery-game-finally-reveals-itself-in-a-trailer.4231
[2]:http://www.asthreeworks.com/games/
[3]:https://www.gamingonlinux.com/articles/category/17/articles/image-form-announces-steamworld-heist.4304
[4]:https://www.gamingonlinux.com/articles/darksiders-linux-port-looks-like-it-is-still-happening.4893
[5]:https://www.gamingonlinux.com/articles/darksiders-2-confirmed-for-linux.4154
[6]:http://ragtagstudio.com/?page_id=457
[7]:https://www.gamingonlinux.com/articles/editorial-skullgirls-on-linux-finally-shows-some-progress.4789
[8]:https://www.gamingonlinux.com/articles/bioshock-infinite-looks-set-for-a-linux-release-confirmed.4668
[9]:http://www.homefront-game.com/
[10]:https://www.gamingonlinux.com/articles/category/17/articles/killing-floor-2-fps-has-a-new-trailer.4676
[11]:https://www.gamingonlinux.com/articles/storm-united-online-fps-shows-first-real-gameplay-video-first-alpha-due-soon.4872
[12]:http://superhotgame.com/
[13]:http://steamcommunity.com/app/274190/discussions/0/540738051503306548/#c540738051518330743
[14]:https://www.gamingonlinux.com/articles/category/17/articles/chasm-rpg-platformer-will-have-a-same-day-linux-release.4266
[15]:https://www.gamingonlinux.com/articles/linux-port-of-platformer-giana-sisters-brought-inhouse-sequel-might-get-sameday-release.4913
[16]:http://www.alonsomartin.mx/hfa/
[17]:http://www.hottinroofgame.com/
[18]:https://twitter.com/zachtronics/status/566016742825005057
[19]:http://www.mightyno9.com/
[20]:http://www.nightinthewoods.com/
[21]:https://www.gamingonlinux.com/articles/category/17/articles/noct-a-fantastic-top-down-thermal-image-survival-horror-game.4783
[22]:https://www.gamingonlinux.com/articles/puzzle-platformer-oddworld-new-n-tasty-will-release-for-linux-next-month.4836
[23]:https://www.gamingonlinux.com/articles/new-trailer-for-platformer-red-goddesss-looks-really-good.4939
[24]:https://www.gamingonlinux.com/articles/divinity-original-sin-is-pushing-ahead-for-the-linux-release.4938
[25]:https://www.gamingonlinux.com/articles/pillars-of-eternity-the-rpg-aims-for-a-sameday-linux-release-on-march-26th.4834
[26]:https://www.kickstarter.com/projects/webeharebrained/shadowrun-hong-kong
[27]:https://www.gamingonlinux.com/articles/the-banner-saga-rpg-looks-close-to-a-linux-version.4862
[28]:https://www.gamingonlinux.com/articles/the-linux-port-of-age-of-wonders-iii-is-progressing-a-bit-too-explosive-right-now.4857
[29]:https://www.gamingonlinux.com/articles/banished-survival-city-building-sim-is-being-ported-to-linux.4813
[30]:https://www.gamingonlinux.com/articles/city-builder-game-cities-skylines-now-has-a-release-date.4954
[31]:https://www.gamingonlinux.com/articles/clockwork-empires-still-pushing-towards-a-linux-version-suffering-delays.4734
[32]:https://www.gamingonlinux.com/articles/category/17/articles/parkitect-what-roller-coaster-tycoon-should-have-grown-into.4528
[33]:https://www.gamingonlinux.com/articles/mojangs-scrolls-now-has-an-experimental-linux-build.4450
[34]:https://www.gamingonlinux.com/articles/space-pirates-and-zombies-2-reveals-the-zombies-in-a-brand-new-video.4759
[35]:https://www.gamingonlinux.com/articles/terraria-officially-confirmed-to-be-in-development-for-linux-finally.4299
[36]:https://www.gamingonlinux.com/articles/egosofts-x-rebirth-actively-being-ported-to-linux.4822
[37]:https://www.gamingonlinux.com/articles/company-of-heroes-2-looks-like-it-is-heading-to-linux.4199
[38]:https://www.gamingonlinux.com/articles/outlast-that-really-scary-game-looks-like-its-still-heading-to-linux.4896
[39]:https://www.gamingonlinux.com/articles/shadow-warrior-looks-like-it-will-come-to-linux.4859
[40]:https://www.gamingonlinux.com/articles/torchlight-ii-has-even-more-positive-signs-for-linux.4817
[41]:https://www.gamingonlinux.com/articles/feralinteractive.com/en/upcoming/
[42]:https://www.gamingonlinux.com/articles/outcast-a-real-classic-has-been-revamped-and-linux-is-planned.4736
[43]:https://www.gamingonlinux.com/articles/insurgency-fps-is-waiting-on-valve-so-it-can-come-to-linux-updated.4564
[44]:http://projectcarsgame.com/
[45]:https://www.gamingonlinux.com/articles/carmageddon-reincarnations-jason-garber-answers-our-questions-on-their-linux-support.3380
[46]:https://www.gamingonlinux.com/articles/torment-tides-of-numenera-new-video-looks-absolutely-stunning.4320
[47]:http://www.atthegatesgame.com/info
[48]:http://www.ootpdevelopments.com/newsletters/nl0154/
[49]:http://feralinteractive.com/en/upcoming/

View File

@ -0,0 +1,39 @@
意大利艾米利亚-罗马涅大区正在切换到OpenOffice
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Turin_Open_Source.jpg)
在拥抱开源的道路上,意大利似乎走在了最前面。我们已经知道,很多意大利的城市如[乌迪内][1][都灵][2][Todi和都灵][3]过去已经选择了[开源办公套件以取代微软的Office][4]。现在,位于意大利北部的[艾米利亚-罗马涅大区][5]位于意大利北部是意大利20个大区之一也将在下个月完成向[Apache OpenOffice][6]的过渡。
### 切换到 OpenOffice ###
这次向OpenOffice的迁移将会在下个月完成而且将会覆盖4200个计算机工作站涉及到10个部门和5个代理机构。 而且开源文档格式ODF也将成为默认的文档格式。向OpenOffice的过渡最初在2013年底被提出来原本打算在2014年底完成。这次从商业办公产品改用OpenOffice从授权费用来说据信会[节约大概2 000 000欧元][7]。
为了使这次顺利搬家和方便内部操作,负责这次搬家的团队正在开发许多定制工具和插件。
本次项目的负责人Giovanni Grazia对本次“搬家”充满激情但同时他也做好了应对批评的准备
> “改用新的办公套件并不是一件容易完成的工作我们借这次机会来拥护免费和开源的软件。一些地区的公务员表示高度支持而另一些则感到厌烦因为他们已经使用商业产品二十年了。为了处理任何在迁移中发生的问题一个有着三个IT专家的五人支持团队正在一个部门接一个部门逐渐地完成这次迁移。”
### 祝愿 ###
我希望其他的国家也能使用OpenOffice套件祝愿所有迁移到开源软件的人或国家都顺利完成。
--------------------------------------------------------------------------------
via: http://itsfoss.com/emiliaromagna-completes-switch-openoffice/
作者:[Abhishek][a]
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://linux.cn/article-3853-1.html
[2]:http://linux.cn/article-3602-1.html
[3]:http://itsfoss.com/italian-cities-switch-libreoffice/
[4]:http://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
[5]:http://en.wikipedia.org/wiki/Emilia-Romagna
[6]:https://www.openoffice.org/
[7]:http://www.slwoods.co.uk/?p=2886
[8]:http://itsfoss.com/french-city-toulouse-saved-1-million-euro-libreoffice/

View File

@ -0,0 +1,50 @@
Pinta 1.6发布了!在 Ubuntu 和 Linux Mint 上安装Pinta
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Pinta_Ubuntu_Linux.jpeg)
[Pinta][1] 是一款免费的开源绘图应用软件它在Linux用户中很受欢迎。你也可以把它看作是**微软画图软件的开源替代品**。Pinta 可以在很多平台上使用,如 Linux、Windows 以及 Mac OS X。
Gimp 作为一款功能齐全的图像编辑软件而流行相比Pinta则单纯是一种绘图工具。我常用它在我的截图上画箭头和曲线而且我可以说这是我在 Linux 上最喜欢的绘图应用软件。
### Pinta 1.6 的新功能###
经过一年多的时间Pinta发布了1.6版本修复了50多个漏洞并且增加了一些新功能。增加的新功能如下
- 线条工具现在支持绘制曲线和箭头
- 绘制好的图形可以编辑形状
- 所有的图形工具现在支持绘制虚线
- 所有的选择工具现在支持并集、排除,异或和交集模式
- 插件可通过插件管理器安装
- 命令行中加入新选项
新版本同时也修复了一个很烦人的漏洞——右键菜单选项,[在打开方式中使用Pinta不能打开文件][2]。你可以在[发布说明][3]阅读所有的改变。
### 在 Ubuntu 和 Linux Mint 中安装 Pinta 1.6###
Pinta 1.5 可以在 Ubuntu 14.0414.10Linux Mint 17 和 elementary OS 中使用。如果你想安装最新的 1.6 版本,你可以使用 Pinta 团队的官方PPA源。如果你已经安装了 Pinta 1.5 也不必担心。再安装一次将会使版本升级。
打开终端并使用以下命令:
sudo add-apt-repository ppa:pinta-maintainers/pinta-stable
sudo apt-get update
sudo apt-get install pinta
下载源代码或者获取 Windows 和 Mac OS X 的安装文件,请点击[Pinta下载页面][4]。在如下这篇相关文章中,你也可以选出[Linux中最好的照片应用软件][5]。
--------------------------------------------------------------------------------
via: http://itsfoss.com/pinta-1-6-ubuntu-linux-mint/
作者:[Abhishek][a]
译者:[linuhap](https://github.com/linuhap)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://pinta-project.com/
[2]:http://itsfoss.com/add-application-list-open-applications-ubuntu-1310/
[3]:http://pinta-project.com/releases/1-6
[4]:http://pinta-project.com/releases
[5]:http://itsfoss.com/image-applications-ubuntu-linux/

View File

@ -0,0 +1,85 @@
10种将开源用于商业的最佳途径
===============================================================================
> 开源为大大小小的商业带来了一些显著的效益 -- 但是你可能会对某些用途感到惊讶。
![](http://tr2.cbsistatic.com/hub/i/r/2015/03/05/54a9c323-4311-4455-b10b-5182548da424/resize/620x485/95164f01a19cbd7a3e4b843be78febae/foss.jpg)
技术上已经发生了一些必然性的改变。举个例子开源软件以它的方式进入到了你的工作之中。10 年前,这也许还能称为一个问题。现在呢?则已经无法避免开源技术的使用 -- 也没有理由要去避免。有如此多强大(和必需的)的方方面面技术,开源在许多方面已经成为了技术的救世主。但是你哪一块的工作最适合开源软件呢?当然,这个问题的答案会因公司而异。然而许多的应用几乎可以适用于每个场景中。
让我们来看看这10种可能是最佳的使用方法它们可以帮助你的公司成长带给你从未体验过的灵活性与可靠性或者仅仅是帮你节省一笔可观的预算。
### 1: 服务器软件 ###
如果你还在微软的 IIS 平台苦苦挣扎,那么你需要体验一下 Apache。这款旗舰级开源软件是这个星球上使用最广泛的网页服务器软件之一。Apache 免费、极其可靠、易于管理,而且不像 IIS 一样需要大量的资源。然而,开源并不局限于网页服务器。如果你需要在公司内使用 SMB 来共享资源,可以试试 Samba Samba 4甚至集成了活动目录AD所以你不需要担心在Samba服务器上建立单独的用户账号。
### 2: 开发 ###
用开源开发是很简单的事。PHPRailsPerl -- 开源上面的开发语言和开发的工具从集成开发环境到调试都很多。为开源或者开源工具做开发可以有很多种选择如同使用商业软件开发一样。开源软件与商业软件最大的不同之处在于开源可以接触到软件源代码。在自由开源软件FOSSfree open source software的世界里代码都是公开的。对许多开发者来说Linux操作系统有他们开发和构建所需要的一切特别那些没有一个成熟环境来写代码的人而言。如果你需要图形用户界面GUI的开发工具开源也能满足你。
### 3: 安全 ###
通往安全的道路是充满挑战的但还是很多途径可以达到。你可以选择“安全盒子”的解决方案跟随Cisco一个可靠的解决方案的节奏或者你可以借助iptables打造最适合你需求的安全。是的开源的安全之路会需要更多的时间去配置有很高的学习壁垒但是结果通常是不错的。这里甚至不强调一种观点就一般来说在桌面上使用开源比起大多数封闭的系统而言是一个更安全的平台。在桌面上部署Linux你的安全痛点会大大降低。
### 4: 桌面 ###
Linux 桌面是大多数人不认可的地方。尽管如此你必须考虑一个事实那就是你每天的工作流程已经经历了一个主要的思维模式的转换。我们现在做的大部分事情都是通过网络浏览器。那么为什么不将Linux部署到桌面上呢不但可以能做如今要做的许多工作而且不用遭受病毒恶意软件和能破坏系统的更新。它不完美 -- 但哪个平台敢说完美?但是它很强大,最后,还可以节省你的开支。这是一个双赢的结局。
### 5: 工作流程 ###
每一种工作都依赖于工作流程。对于某些工作来说一个流畅的工作流程又取决于所用的工具。开源已经登上这个舞台了。CRM客户关系管理HRM人力资源管理ERP企业资源计划BI商业智能BPM业务流程管理 …… 只要你叫得出名字,开源就可以做到几乎你能想到的每一种可能 -- 并且干得不错。借助于[Pentaho][1], [Collabtive][2]和[SugarCRM][3], 开源可以在任何时候与最新的源工具保持同步。
### 6: 协作 ###
没有一起合作项目的能力,你的员工就不能干好工作。所以你选择的协作工具是十分重要的。你会在开源的世界里发现大量的优质协作工具。[Cyn.in 社区版][4], [Zimbra 开源版][5]和[Kolab][6]都是不错的协作工具,但这仅仅是开源世界里的三个代表而已。
### 7: 大数据 ###
以前说到大数据的时候,往往不会想到开源。多亏了[SUSE][7]的努力,大数据和开源现在可以携手共进了。许多如内存数据和内核热补丁的发明创建,使得开源成为大数据一个理想的解决方案。它可以完美地满足大数据在平台上所需的大量要求,而封闭的软件则达不到如此灵活的水平。
### 8: 云 ###
云的主要玩家都是开源的。[Red Hat][8], [Ubuntu][9], [SUSE][10], [Amazon][11], [Rackspace][12] -- 他们都提供云服务,而且认为开源是云配置的最好解决方案。但是,如果你不想用大公司的服务,仍然有很多后起之秀如[OwnCloud][13]你可以选择OwnCloud的托管云方案或者建立自己的一套。
### 9: 多媒体 ###
如果你的公司做播客或为产品发布制作视频,开源可以为你提供服务。借助像[Audacity][14]和[OpenShot][15]这样的工具,你可以对音频和视频做你需要的任何处理 -- 而且十分的廉价。实际上你会感觉到很难再去找到比Audacity更好的播客工具或者比OpenShot更易用的视频编辑器。没有太大的学习壁垒或者闭源软件工具所要求的高额费用开源的软件在帮助你创造专业水准的作品方面已经做得很好了。
### 10: 电子商务 ###
如果你做在线销售,如果不尝试一下像[PrestaShop][16]之类的工具你就太懈怠了。PrestaShop是最强大的电子商务解决方案之一易于获取 -- 不需要许可证。 PrestaShop有你可能想要的所有功能而且有些你可能都没有想过这个开源平台已经在任何水平上超出了电子商务的范畴。
### FOSS 之于商业 ###
开源已经不再局限于商业交流的范围了。在许多情况下FOSS已经主导这种交流。如果你已经在寻找将开源解决方案运用的领域看上面的10条就行了。
### 该你了 ###
你已经将开源用到你的工作中了吗?如果是,属于哪一条方法呢?
-------------------------------------------------------------------------------
via: http://www.techrepublic.com/blog/10-things/10-best-uses-for-open-source-software-in-the-business-world/
作者:[Jack Wallen][a]
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.techrepublic.com/search/?a=jack+wallen
[1]:http://community.pentaho.com/
[2]:http://collabtive.o-dyn.de/
[3]:http://www.sugarcrm.com/
[4]:http://cynapse.com/cyn-in/
[5]:https://www.zimbra.com/open-source
[6]:http://kolab.org/
[7]:http://www.suse.org/
[8]:http://www.redhat.com/
[9]:http://www.ubuntu.com/
[10]:http://www.suse.com/
[11]:http://aws.amazon.com/ec2/
[12]:http://www.rackspace.com/cloud
[13]:https://owncloud.org/
[14]:http://audacity.sourceforge.net/
[15]:http://www.openshot.org/
[16]:https://www.prestashop.com/

View File

@ -1,23 +1,23 @@
Translating by ZTinoZ
15 Basic ls Command Examples in Linux
Linux中的15个基本ls命令示例
================================================================================
ls command is one of the most frequently used command in Linux. I believe ls command is the first command you may use when you get into the command prompt of Linux Box. We use ls command daily basis and frequently even though we may not aware and never use all the option available. In this article, well be discussing basic ls command where we have tried to cover as much parameters as possible.
ls命令是Linux系统中最被频繁使用的命令之一我相信ls命令一定是你进入一台Linux系统的电脑打开命令提示符后第一个使用的命令。我们每天都在频繁地使用ls命令,即使我们可能没有意识也从来用不到所有可用的选项。本文中我们将讨论下一些基本的ls命令并且覆盖尽可能多的有关参数来讲解。
![Linux ls Command](http://www.tecmint.com/wp-content/uploads/2012/08/Linux-ls-Commands.png)
Linux ls Command
### 1. List Files using ls with no option ###
*Linux的ls命令*
ls with no option list files and directories in bare format where we wont be able to view details like file types, size, modified date and time, permission and links etc.
### 1. 不带任何选项列出文件 ###
不带选项的ls命令来光秃秃地列出文件和目录我们是不能看到像文件类型、大小、修改日期和时间、权限以及链接这样具体的信息的。
# ls
0001.pcap Desktop Downloads index.html install.log.syslog Pictures Templates
anaconda-ks.cfg Documents fbcmd_update.php install.log Music Public Videos
### 2 List Files With option l ###
### 2 l 选项列出文件列表 ###
Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder name and owner of file and its permission.
你看ls -l-l是字母不是“1”就能展示出是文件还是目录它的大小、修改日期和时间、文件或目录的名字以及文件的属主和它的权限。
# ls -l
@ -37,9 +37,9 @@ Here, ls -l (-l is character not one) shows file or directory, size, modified da
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos
### 3. View Hidden Files ###
### 3. 浏览隐藏文件 ###
List all files including hidden file starting with ..
列出所有文件包括以‘.’开头的隐藏文件。
# ls -a
@ -51,9 +51,9 @@ List all files including hidden file starting with ..
.bash_logout Desktop fbcmd_update.php .ICEauthority .mozilla Public Videos
.bash_profile .digrc .gconf index.html Music .pulse .wireshark
### 4. List Files with Human Readable Format with option -lh ###
### 4. 用 -lh 选项来以易读方式列出文件 ###
With combination of -lh option, shows sizes in human readable format.
用-lh组合选项以易读方式来显示大小。
# ls -lh
@ -73,27 +73,27 @@ With combination of -lh option, shows sizes in human readable format.
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Templates
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Videos
### 5. List Files and Directories with / Character at the end ###
### 5. 以尾部以‘/’字符结尾的方式列出文件和目录 ###
Using -F option with ls command, will add the / Character at the end each directory.
使用 ls 命令的 -F 选项,会在每个目录的末尾添加“/”字符显示。
# ls -F
0001.pcap Desktop/ Downloads/ index.html install.log.syslog Pictures/ Templates/
anaconda-ks.cfg Documents/ fbcmd_update.php install.log Music/ Public/ Videos/
### 6. List Files in Reverse Order ###
### 6. 倒序列出文件 ###
The following command with ls -r option display files and directories in reverse order.
ls -r 选项能以倒序方式显示文件和目录。
# ls -r
Videos Public Music install.log fbcmd_update.php Documents anaconda-ks.cfg
Templates Pictures install.log.syslog index.html Downloads Desktop 0001.pcap
### 7. Recursively list Sub-Directories ###
### 7. 递归列出子目录 ###
ls -R option will list very long listing directory trees. See an example of output of the command.
ls -R 选项能列出非常长的目录树,来看看示例输出:
# ls -R
@ -116,9 +116,9 @@ ls -R option will list very long listing directory trees. See an example of outp
-rw-r--r--. 1 root root 0 Aug 12 03:17 access.log
-rw-r--r--. 1 root root 390 Aug 12 03:17 access.log-20120812.gz
### 8. Reverse Output Order ###
### 8. 以修改时间倒序列出 ###
With combination of -ltr will shows latest modification file or directory date as last.
带-ltr组合选项能以文件或目录的最新修改时间的次序来显示它们。
# ls -ltr
@ -138,9 +138,9 @@ With combination of -ltr will shows latest modification file or directory date a
drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap
### 9. Sort Files by File Size ###
### 9. 按文件大小排序 ###
With combination of -lS displays file size in order, will display big in size first.
带-lS组合选项能按文件从大到小的次序显示。
# ls -lS
@ -160,9 +160,9 @@ With combination of -lS displays file size in order, will display big in size fi
-rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap
### 10. Display Inode number of File or Directory ###
### 10. 显示文件或目录的索引节点号 ###
We can see some number printed before file / directory name. With -i options list file / directory with inode number.
我们有时候可以看到一些数字打印在文件或目录名之前,带-i选项就能列出文件或目录的索引节点号。
# ls -i
@ -170,9 +170,9 @@ We can see some number printed before file / directory name. With -i options lis
23564 anaconda-ks.cfg 23595 Downloads 22 install.log 23612 Pictures 23613 Videos
23594 Desktop 23585 fbcmd_update.php 35 install.log.syslog 23601 Public
### 11. Shows version of ls command ###
### 11. 显示ls命令的版本 ###
Check version of ls command.
查看ls命令的版本。
# ls --version
@ -183,17 +183,17 @@ Check version of ls command.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
### 12. Show Help Page ###
### 12. 显示帮助页面 ###
List help page of ls command with their option.
列出ls命令的选项帮助页面。
# ls --help
Usage: ls [OPTION]... [FILE]...
### 13. List Directory Information ###
### 13. 列出目录信息 ###
With ls -l command list files under directory /tmp. Wherein with -ld parameters displays information of /tmp directory.
用ls -l命令列出/tmp目录下的文件其中-ld参数可以只显示/tmp目录的信息。
# ls -l /tmp
total 408
@ -213,9 +213,9 @@ With ls -l command list files under directory /tmp. Wherein with -ld parameters
drwxrwxrwt. 13 root root 4096 Aug 21 12:48 /tmp/
### 14. Display UID and GID of Files ###
### 14. 显示文件的UID和GID ###
To display UID and GID of files and directories. use option -n with ls command.
用ls -n命令来显示文件和目录的UID译者注userid用户ID和GID译者注groupid组ID
# ls -n
@ -226,13 +226,13 @@ To display UID and GID of files and directories. use option -n with ls command.
-rw-rw-r--. 1 500 500 12 Aug 21 13:06 tmp.txt
drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Videos
### 15. ls command and its Aliases ###
### 15. ls命令和它的别名 ###
We have made alias for ls command, when we execute ls command itll take -l option by default and display long listing as mentioned earlier.
我们给ls命令设置如下别名之后当我们执行ls命令的时候它会默认执行-l选项并且像上文提到的那样显示长列表。
# alias ls="ls -l"
Note: We can see number of alias available in your system with below alias command and same can be unalias as shown below example.
注意我们可以通过不加任何参数的alias命令来看到目前系统中可用的所有alias设置当然它们同时也可以unalias来取消。
# alias
@ -244,19 +244,19 @@ Note: We can see number of alias available in your system with below alias comma
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
To remove an alias previously defined, just use the unalias command.
删除一项之前定义的alias设置只需用unalias命令即可。
# unalias ls
In our next article well cover up more or advanced ls command with their examples. If weve missed anything in the list, please update us via comment section.
下篇文章我们将讨论更多更高级的ls命令以及示例如果我们在本文有遗漏了任何东西请通过评论让我们获悉。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
作者:[Ravi Saive][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,43 +0,0 @@
Google Cloud offers streamlined Ubuntu for Docker use
================================================================================
> Ubuntu Core provides a minimal Lightweight Linux environment for running containers
Google has adopted for use in its cloud a streamlined version of the Canonical Ubuntu Linux distribution tweaked to run Docker and other containers.
Ubuntu Core was designed to provide only the essential components for running Linux workloads in the cloud. An [early preview edition][1] of it, which Canonical calls "Snappy," was released last week. The new edition jettisoned many of the libraries and programs usually found in general use Linux distributions that were unnecessary for cloud use.
[ [Get started with Docker][2] using this step-by-step guide to the red-hot open source framework. | Get the latest insight on the tech news that matters from [InfoWorld's Tech Watch blog][3]. ]
The Google Compute Engine (GCE) [joins Microsoft Azure][4] in supporting the fresh distribution.
According to Canonical, Ubuntu Core should provide users with an easy way to deploy Docker, an [increasingly lightweight virtualization container][4] that allows users to quickly spin up workloads and easily move them around, even across different cloud providers.
Google has been an ardent supporter of Docker and container-based virtualization itself. In June, the company [released as open source its software for managing containers][5], called Kubernetes.
The design of Ubuntu Core is similar to another Linux distribution, CoreOS, [first released a year ago][7].
Developed in part by two ex-Rackspace engineers, [CoreOS][8] is a lightweight Linux distribution designed to work in clustered, highly scalable environments favored by companies that do much or all of their business on the Web.
CoreOS was quickly adopted by many cloud providers, including Microsoft Azure, Amazon Web Services, DigitalOcean and Google Compute Engine.
Like CoreOS, Ubuntu Core offers an expedited process for updating components, reducing the amount of time that an administrator would need to manually manage them.
如同Coreos一样Ubuntu内核提供了一个快速引擎来更新组件
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2860401/cloud-computing/google-cloud-offers-streamlined-ubuntu-for-docker-use.html
作者:[Joab Jackson][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Joab-Jackson/
[1]:http://www.ubuntu.com/cloud/tools/snappy
[2]:http://www.infoworld.com/article/2607941/linux/how-to--get-started-with-docker.html
[3]:http://www.infoworld.com/blog/infoworld-tech-watch/
[4]:http://www.ubuntu.com/cloud/tools/snappy
[5]:http://www.itworld.com/article/2695383/open-source-tools/docker-all-geared-up-for-the-enterprise.html
[6]:http://www.itworld.com/article/2695501/cloud-computing/google-unleashes-docker-management-tools.html
[7]:http://www.itworld.com/article/2696116/open-source-tools/coreos-linux-does-away-with-the-upgrade-cycle.html
[8]:https://coreos.com/using-coreos/

View File

@ -1,49 +0,0 @@
WordPress Can Be Used to Leverage Critical Ghost Flaw in Linux
-----
*Users are advised to apply available patches immediately*
![WordPress validating pingbacks post URL](http://i1-news.softpedia-static.com/images/news2/WordPress-Can-Be-Used-to-Leverage-Critical-Ghost-Flaw-in-Linux-471730-2.jpg)
**The vulnerability revealed this week by security researchers at Qualys, who dubbed it [Ghost](1), could be taken advantage of through WordPress or other PHP applications to compromise web servers.**
The glitch is a buffer overflow that can be triggered by an attacker to gain command execution privileges on a Linux machine. It is present in the glibcs “__nss_hostname_digits_dots()” function that can be used by the “gethostbyname()” function.
##PHP applications can be used to exploit the glitch
Marc-Alexandre Montpas at Sucuri says that the problem is significant because these functions are used in plenty of software and server-level mechanism.
“An example of where this could be a big issue is within WordPress itself: it uses a function named wp_http_validate_url() to validate every pingbacks post URL,” which is carried out through the “gethostbyname()” function wrapper used by PHP applications, he writes in a blog post on Wednesday.
An attacker could use this method to introduce a malicious URL designed to trigger the vulnerability on the server side and thus obtain access to the machine.
In fact, security researchers at Trustwave created [proof-of-concept](2) code that would cause the buffer overflow using the pingback feature in WordPress.
##Multiple Linux distributions are affected
Ghost is present in glibc versions up to 2.17, which was made available in May 21, 2013. The latest version of glibc is 2.20, available since September 2014.
However, at that time it was not promoted as a security fix and was not included in many Linux distributions, those offering long-term support (LTS) in particular.
Among the impacted operating systems are Debian 7 (wheezy), Red Hat Enterprise Linux 6 and 7, CentOS 6 and 7, Ubuntu 12.04. Luckily, Linux vendors have started to distribute updates with the fix that mitigates the risk. Users are advised to waste no time downloading and applying them.
In order to demonstrate the flaw, Qualys has created an exploit that allowed them remote code execution through the Exim email server. The security company said that it would not release the exploit until the glitch reached its half-life, meaning that the number of the affected systems has been reduced by 50%.
Vulnerable application in Linux are clockdiff, ping and arping (under certain conditions), procmail, pppd, and Exim mail server.
--------------------------------------------------------------------------------
via:http://news.softpedia.com/news/WordPress-Can-Be-Used-to-Leverage-Critical-Ghost-Flaw-in-Linux-471730.shtml
本文发布时间:30 Jan 2015, 17:36 GMT
作者:[Ionut Ilascu][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://news.softpedia.com/editors/browse/ionut-ilascu
[1]:http://news.softpedia.com/news/Linux-Systems-Affected-by-14-year-old-Vulnerability-in-Core-Component-471428.shtml
[2]:http://blog.spiderlabs.com/2015/01/ghost-gethostbyname-heap-overflow-in-glibc-cve-2015-0235.html

View File

@ -1,49 +0,0 @@
Pinta 1.6 Released! Install It In Ubuntu And Linux Mint
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Pinta_Ubuntu_Linux.jpeg)
[Pinta][1] is a free and open source drawing application which is very popular among Linux users. It wont be incorrect to term it as an **open source alternative to Microsoft Paint**. Pinta is available for all major platforms such as Linux, Windows and Mac OS X.
While Gimp is popular as full featured image editing software, Pinta is more of a paint and drawing tool. I have used it extensively in my tutorials for drawing arrows and curves on the screenshots and I can say that its my favorite drawing app in Linux.
### New features in Pinta 1.6 ###
After over an year, Pinta has released version 1.6, fixing over 50 bugs and introducing some new features. New features are as following:
- Line tool now supports drawing curves and arrows
- Shapes can be edited even after being drawn
- All shape tools now support drawing dashed lines
- All selection tools now support the Union, Exclude, Xor, and Intersection modes
- Add-in manager now consists of add ins
- New options in command line usage
New version also fixes the annoying bug where you [cannot open a file with Pinta in right click menu option][2]. You can read all the changes in the [release note][3].
### Install Pinta 1.6 in Ubuntu and Linux Mint ###
Pinta 1.5 is available in Ubuntu 14.04, 14.10, Linux Mint 17, elementary OS. If you want to install the latest version 1.6, you can use the official PPA from Pinta team. Dont worry if you have Pinta 1.5 installed already. Installing it again will upgrade the version.
Open a terminal and use the following commands:
sudo add-apt-repository ppa:pinta-maintainers/pinta-stable
sudo apt-get update
sudo apt-get install pinta
To download the source code or to get the installation files for Windows and Mac OS X, check the [download page of Pinta][4]. In a related post, you can also check out [best photo applications for Linux][5].
--------------------------------------------------------------------------------
via: http://itsfoss.com/pinta-1-6-ubuntu-linux-mint/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://pinta-project.com/
[2]:http://itsfoss.com/add-application-list-open-applications-ubuntu-1310/
[3]:http://pinta-project.com/releases/1-6
[4]:http://pinta-project.com/releases
[5]:http://itsfoss.com/image-applications-ubuntu-linux/

View File

@ -1,38 +0,0 @@
New App Brings Android Notifications to The GNOME Desktop
================================================================================
![Fancy seeing your Android alerts here? You can.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/02/Screen-Shot-2015-02-24-at-17.47.48.png)
Fancy seeing your Android alerts here? You can.
**Youll shortly be able to view your Android notifications on the GNOME desktop thanks to a new application in development.**
The new project is called Nuntius and lets notifications received on an Android phone appear on the GNOME desktop. Its with GNOME 3.16 and its (wonderfully) [redesigned notification system][1] that the app and its features will be used by more.
The app, which developers are hoping will be ready in time for this months release of GNOME 3.16, will work over Bluetooth to ensure that nothing is passed to external servers or stored online. This does mean that your phone will need to be in a certain proximity to your GNOME desktop for the feature to work.
It also isnt yet possible to reply to a text message or act on a news alert.
The development team do caution that **this is an early release** and those planning on diving in to use it should expect minimum functionality for now.
The mobile app required to see Android notifications in GNOMEs new notification shade is already available [from the Google Play Store][2] and the GNOME application is already available in the Fedora repos.
The developers have open-sourced both the Android app and the GNOME application receiver and hosted them (where else) on GitHub.
A similar tool [has been available for KDE desktops][3] KDE Connect for a year or two, while the ever-gaining Pushbullet offers similar features on Windows, Mac and Linux desktops for iOS and Android platforms using Google Chrome.
- [Nuntius for Android & GNOME on GitHub][4]
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2015/03/new-app-brings-android-notifications-to-the-gnome-desktop
作者:[Joey-Elijah Sneddon][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2015/02/4-reason-why-gnome-3-16-might-be-the-best-version-yet-gallery
[2]:https://play.google.com/store/apps/details?id=org.holylobster.nuntius
[3]:http://www.omgubuntu.co.uk/2014/06/kde-connect-android-notifications-linux-desktop
[4]:https://github.com/holylobster

View File

@ -1,139 +0,0 @@
4 Linux Based Mini PC You Can Buy In 2015
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Linux_Based_Mini_PC.jpg)
Mini PCs, in my opinion, will takeover the traditional desktop computers in near future. Traditional desktop has a bulky CPU which takes a lot of space with its fan running like a blower. The mini PCs, on the other hand, are tiny and compact. With hardly 4″ or 5″ in size, they can be easily placed on a table.
Moreover, these mini PCs are fanless which is an added virtue. Of course, you can buy fanless regular desktops but the space consumption is still an issue. Personally, I find the mini PC cute in looks. If you are not a gamer and thinking of buying a new desktop PC, Ill highly recommend you to **buy a Linux based mini PC**.
If you go by my recommendation and consider buying it, you might wonder what options do you have. Worry not. In this post we shall see four **Linux based Mini PC that you can buy in 2015**.
### Linux based mini PCs ###
Please do note that some of these gadgets might not be available to order just yet. Some of these have been just announced and will be released to public in near future.
#### 1. Meerkat by System76 ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/system76-meerkat.jpg)
[System76][1] is a computer manufacturer exclusively dealing with only Ubuntu based desktop, laptops and servers. [System76 announced an Ubuntu based mini PC Meerkat][2] last week. Lets take a quick look at its specification:
**Specification**
- Intel 5th Generation processors, available options i3-5010U and i5-5250U
- up to 2 TB of storage (M.2 SATA SSD)
- 16 GB DDR3 RAM
- Graphics Intel HD 5500 and Intel HD 6000 for i3 and i5 respectively
- 4″ x 4″ in size
- WiFi
- 1 Gb NIC
- 2 USB 3.0 ports
**Price**
In the range of $500 (yet to be confirmed).
**Availability**
US release by the end of March 2015.
#### 2. Mintbox Mini by Compulab ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/mintbox-mini.jpeg)
[Compulab][3] shrunk its flagship Linux Mint based PC devices, Mintbox into [Mintbox Mini][4]. The compact version is around 4″ in size. More details are as following:
**Specifications**
- AMD A4-6400T processor
- Radeon R3 graphics processor
- 4 GB RAM
- 64 GB SSD
- 2 USB 3.0 ports, 3 USB 2.0 ports
- 2 HDMI out ports
- 802.11 b/g/n Wifi
- Gigabit Ethernet
- MicroSD reader
**Price**
Staring around $300
**Availability**
Second quarter of 2015
#### 3. Utilite2 by Compulab ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Utilite2-ARM-PC.jpg)
Its not that Compulab has stuck with Linux Mint only. It announced an ARM desktop PC running Ubuntu in last December. With a size of 3.4″x2.3″, [Utilite2][5] has modest feature and modest price.
**Specifications**
- Qualcomm Snapdragon 600 (APQ8064) quad-core CPU 1.7GHz
- 2GB RAM, eMMC with optional 32 GB mSATA storage
- Graphics with Qualcomm Adreno™ GPU
- 1080p video playback and capture
- Dual-antenna WiFi 802.11 and Bluetooth 4.0
- Gigabit Ethernet, 4x USB2, USB OTG
- Cellular modem support
**Price**
$192 for regular model, $229 with SSD storage. Shipping charges extra.
**Availability**
Available to purchase now. It will take four weeks in shipping.
#### Penguin Pocket Wee by Think Penguin ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Think_Penguin_Pocket_Wee.jpeg)
[Think Penguin][6] is a Open Source focused hardware manufacturer. In the mini PC category, it has [Penguin Pocket Wee][7] to offer. With 4.6″x 4.4″x 1.4″ in size, Penguin Pocket Wee provides a number of configuration to you. You can choose between the processors, storage, network adapters and what not. You can choose to buy it pre-installed with your favorite Linux distribution, default OS is Ubuntu.
The general configuration is as following:
- Intel Core i3 or i5 processor with support for up to 1080p HD video
- Expandable up to 16GB of DDR3 RAM
- Intel HD graphics
- Wireless N
- Up to 250GB of SSD
- 4 USB 3.0
- Intel 10/100/1000 Gigabit Ethernet Controller
**Price**
Basic model starts at $499 and it can go up to $1000 based on the configuration you select.
**Availability**
Available to order now. There are offices in UK and USA so it should be shipping to North America and Europe.
### Whats your pick? ###
I have deliberately not included [Raspberry Pi 2][8] or other Linux microcomputer such as [Intels Compute Stick][9]. The reason is that I do not think that micro-computers fall in the same categories as mini PCs.
What do you think? Are you tempted to replace your desktop with a mini PC? Is there another player which I missed in this list of **best Linux based mini PCs**? Do share your views.
--------------------------------------------------------------------------------
via: http://itsfoss.com/4-linux-based-mini-pc-buy-2015/
作者:[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]:https://system76.com/
[2]:http://itsfoss.com/system76-unveils-ubuntu-based-mini-pc-meerkat/
[3]:http://www.compulab.co.il/
[4]:http://itsfoss.com/mintbox-mini-compact-linux-mint-powered-pc-unveiled/
[5]:http://www.compulab.co.il/utilite-computer/web/utilite2-overview
[6]:https://www.thinkpenguin.com/
[7]:https://www.thinkpenguin.com/gnu-linux/penguin-pocket-wee-gnu-linux-desktop
[8]:http://itsfoss.com/raspberry-pi-2-specs/
[9]:http://itsfoss.com/intels-compute-stick/

View File

@ -0,0 +1,57 @@
Papyrus: An Open Source Note Manager
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux_4.jpeg)
In last post, we saw an [open source to-do app Go For It!][1]. In a similar article, today well see an **open source note taking application Papyrus**.
[Papyrus][2] is a fork of [Kaqaz note manager][3] and is built on QT5. It brings a clean, polished user interface and is security focused (as it claims). Emphasizing on simplicity, I find Papyrus similar to OneNote. You organize your notes in paper and add them a label for grouping those papers. Simple enough!
### Papyrus features: ###
Though Papyrus focuses on simplicity, it still has plenty of features up its sleeves. Some of the main features are:
- Note management with labels and categories
- Advanced search options
- Touch mode available
- Full screen option
- Back up to Dropbox/hard drive/external
- Password protection for selective papers
- Sharing papers with other applications
- Encrypted synchronization via Dropbox
- Available for Android, Windows and OS X apart from Linux
### Install Papyrus ###
Papyrus has APK available for Android users. There are installer files for Windows and OS X. Linux users can get source code of the application. Ubuntu and other Ubuntu based distributions can use the .deb packages. Based on your OS and preference, you can get the respective files from the Papyrus download page:
- [Download Papyrus][4]
### Screenshots ###
Here are some screenshots of the application:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux_3-700x450_c.jpeg)
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux_2-700x450_c.jpeg)
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux_1-700x450_c.jpeg)
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux-700x450_c.jpeg)
Give Papyrus a try and see if you like it. Do share your experience with it with the rest of us here.
--------------------------------------------------------------------------------
via: http://itsfoss.com/papyrus-open-source-note-manager/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://itsfoss.com/go-for-it-to-do-app-in-linux/
[2]:http://aseman.co/en/products/papyrus/
[3]:https://github.com/sialan-labs/kaqaz/
[4]:http://aseman.co/en/products/papyrus/

View File

@ -0,0 +1,52 @@
Red Hat Developer Toolset 3.1 beta arrives
================================================================================
> **Summary**:Want the newest developer tools for Red Hat Enterprise Linux 6 or 7? The beta's ready for you now.
It's one of those eternal problems between developers and operators that even [DevOps][1] can't entirely solve. System administrators want the most stable operating system possible, while programmers want the latest and greatest development tools. [Red Hat][2]'s solution for this dilemma has been to take those brand spanking-new tools, test them out on the latest stable [Red Hat Enterprise Linux (RHEL)][3], and then release them to developers.
![Red Hat Developer Toolset](http://zdnet4.cbsistatic.com/hub/i/2015/03/18/d92b1067-6b36-4ff0-ac9e-608fbe3e8c5d/ae80362df5401a37e3cbcd2598f33370/rhel-dev-tools.png)
Red Hat Developer Toolset
So it is that Red Hat has just announced its latest toys for developers, [Red Hat Developer Toolset 3.1][4]. This packaging of the hottest new tools is now available in beta.
This update includes:
[GNUCompiler Collection (GCC) 4.9][5]: the latest stable upstream version of GCC, which provides numerous improvements and bug fixes
[Eclipse 4.4.1][6]: with support for Java 8 and updated versions of Eclipse CDT (8.5), Eclipse Linux Tools (3.1), Eclipse Mylyn (3.14), and Eclipse Egit/Jgit (3.6.1)
Numerous additional updated packages: These include GDB 7.8.2, elfutils 0.161, memstomp 0.1.5, SystemTap 2.6, Valgrind 3.10.1, Dyninst 8.2.1, and ltrace 0.7.91.
With these development programs, you'll be able to create applications for RHEL 6 and 7.x. These apps will then run on RHEL regardless of whether you're running it on a physical, virtual or cloud environments. They will also run on Red Hat's [OpenShift][7], its Platform-as-a-Service (PaaS) offering.
This new set of developer programs includes packages for both RHEL 7 and 7 running on [AMD64 and Intel 64 architectures][8]. Although the tools are 64-bit you can use them to create and modify 32-bit binaries.
Before you try running any of these programs, you should patch RHEL with all the latest updates. To install the beta Toolset, your systems need to be subscribed to the Optional channel to access all the required Red Hat Developer Toolset tool-chain packages.
In addition, if you've installed earlier Toolkits you may run into some [problems while installing Toolkit 3.1][9]. While these difficulties are easy enough to fix, you should go over these possible hiccups before trying to install the new Toolkit.
Finally, you may notice that some of the most exciting of the new tools, such as Docker, Kubernetes, and other container tools aren't here. That's because they're in the newly released [RHEL 7.1][10] and [Red Hat Enterprise Linux 7 Atomic Host (RHELAH)][11]. [Red Hat has partnered with Docker][12], but you'll need to move to a Docker-friendly version of RHEL to get at these container-friendly programs.
--------------------------------------------------------------------------------
via: http://www.zdnet.com/article/red-hat-developer-toolset-3-1-beta-arrives/
作者:[Steven J. Vaughan-Nichols][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.zdnet.com/meet-the-team/us/sjvn/
[1]:http://blogs.csc.com/2015/02/03/devops-theory-for-beginners/
[2]:http://www.redhat.com/en
[3]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
[4]:http://www.redhat.com/en/about/blog/red-hat-developer-toolset-31-beta-now-available
[5]:https://gcc.gnu.org/gcc-4.9/
[6]:https://projects.eclipse.org/projects/eclipse/releases/4.4.1
[7]:https://www.openshift.com/
[8]:https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/3-Beta/html/3.1_Release_Notes/System_Requirements.html
[9]:https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/3-Beta/html/3.1_Release_Notes/DTS3.1_Release.html#Known_Issues
[10]:http://www.zdnet.com/article/red-hat-7-1-is-here-centos-7-1-is-coming-soon/
[11]:http://www.zdnet.com/article/red-hat-buys-into-docker-containers-with-atomic-host/
[12]:http://www.zdnet.com/article/red-hat-partners-with-docker-to-create-linuxdocker-software-stack/

View File

@ -0,0 +1,56 @@
Square 2.0 Icon Pack Is Twice More Beautiful
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg)
Elegant, modern looking [Square icon theme][1] has recently been upgraded to version 2.0, which makes it more beautiful than ever. Square icon packs are compatible with all major desktop environments such as **Unity, GNOME, KDE, MATE** etc. Which means that you can use them for all popular Linux distributions such as Ubuntu, Fedora, Linux Mint, elementary OS etc. The vastness of this icon pack can be estimated from the fact it contains over 15,000 icons.
### Install and use Square icon pack 2.0 in Linux ###
There are two variants of Square icons, dark and light. Based on your preference, you can choose either of the two. For experimentation sake, I would advise you to download both variants of the icon theme.
You can download the icon pack from the link below. The files are stored in Google Drive, so dont be suspicious if you dont see a standard website like [SourceForge][2].
- [Square Dark Icons][3]
- [Square Light Icons][4]
To use the icon theme, extract the downloaded files in ~/.icons directory. If this doesnt exist, create it. Once you have the files in the right place, based on your desktop environment, use a tool to change the icon theme. I have written some small tutorials in the past on this topic. Feel free to refer to them if you need further help:
- [How to change themes in Ubuntu Unity][5]
- [How to change themes in GNOME Shell][6]
- [How to change themes in Linux Mint][7]
- [How to change theme in Elementary OS Freya][8]
### Give it a try ###
Here is what my Ubuntu 14.04 looks like with Square icons. I am using [Ubuntu 15.04 default wallpaper][9] in the background.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_2.jpeg)
A quick look at several icons in the Square theme:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux.jpeg)
How do you find it? Do you think it can be considered as one of the [best icon themes for Ubuntu 14.04][10]? Do share your thoughts and stay tuned for more articles on customizing your Linux desktop.
--------------------------------------------------------------------------------
via: http://itsfoss.com/square-2-0-icon-pack-linux/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://gnome-look.org/content/show.php/Square?content=163513
[2]:http://sourceforge.net/
[3]:http://gnome-look.org/content/download.php?content=163513&id=1&tan=62806435
[4]:http://gnome-look.org/content/download.php?content=163513&id=2&tan=19789941
[5]:http://itsfoss.com/how-to-install-themes-in-ubuntu-13-10/
[6]:http://itsfoss.com/install-switch-themes-gnome-shell/
[7]:http://itsfoss.com/install-icon-linux-mint/
[8]:http://itsfoss.com/install-themes-icons-elementary-os-freya/
[9]:http://itsfoss.com/default-wallpapers-ubuntu-1504/
[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/

View File

@ -0,0 +1,132 @@
How to Install Telegram Messenger Application on Linux
================================================================================
Telegram is an Instant Messaging (IM) application similar to whatsapp. It has a very large user base. It has a lot of features that differentiate it from other messaging application.
![Install Telegram in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Install-Telegram-in-Linux.png)
Telegram Messenger for Linux
This article aims at making you aware of telegram application followed by detailed installation instructions on Linux Box.
#### Features of Telegram ####
- Implementation for mobile devices
- Available for Desktop.
- Application Program Interface (API) of Telegram can be Accessed by third party developers.
- Available for Android, iphone/ipad, Windows Phone, Web-Version, PC, Mac and Linux
- The above application provides Heavily Encrypted and self destruct messages.
- Lets you access your message from multiple devices and platform.
- The overall processing and message delivery is lightening fast.
- Distributed server across the globe for security and speed.
- Open API and Free Protocol
- NoAds, No Subscription charge. Free forever.
- Powerful No limit to media and chats
- Several security measures that make it safe from Hackers.
- Reply to Specific message in group. Mention @username to notify multiple users in group.
#### Why Telegram? ####
When Applications like whatsapp and other IM are providing almost same things in bag, why should someone opt for Telegram?
Well Availability of API to third party developer is enough to say. Moreover availability for PC which means you wont have to struggle typing message using your mobile, but you can use your PC and that is pretty more than sufficient.
Also The option to connect on remote locations, Co-ordinate Group of upto 200 Members, Sync all your devices, Send Documents of all kind, Encrypt message, Self destruction of message, Storage of Media in Cloud, Build own tool on freely available API and what not.
**Testing Environment**
We have used Debian GNU/Linux, x86_64 architecture to test it and the overall process went very smooth for us. Here what we did stepwise.
### Installation of Telegram Messenger in Linux ###
First go to the official Telegram site, and download Telegram source package ([tsetup.0.7.23.tar.xz][1]) for Linux system or you may use following wget command to download directly.
# wget https://updates.tdesktop.com/tlinux/tsetup.0.7.23.tar.xz
Once package has been downloaded, unpack the tarball and switch from current working directory to the extracted directory.
# tar -xf tsetup.0.7.23.tar.xz
# cd Telegram/
Next, execute the binary file Telegram from the command line as shown below.
# ./Telegram
1. The first Impression. Click “START MESSAGING”.
![Start Messaging](http://www.tecmint.com/wp-content/uploads/2015/03/Start-Messaging.jpeg)
Start Messaging
2. Enter Your phone Number. Click “NEXT”. If you have not registered for telegram before this, using the same number as entered above you will get a warning that you dont have a telegram account yet. Click “Register Here”.
![Signup for Telegram](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Register.png)
Signup for Telegram
3. After submitting your phone number, telegram will send you a verification code, shortly. You need to Enter it.
![Telegram Verification Code](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Verfication-Code.png)
Telegram Verification Code
4. Enter your First_Name, Last_name and pics and click “SIGNUP”.
![Enter Account Details](http://www.tecmint.com/wp-content/uploads/2015/03/Enter-Account-Details.jpeg)
Enter Account Details
5. After account creation, I got this interface. Everything seems at its place, even when I am new to telegram Application. The interface is really simple.
![Telegram Interface](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Interface.jpeg)
Telegram Interface
6. Click Add a contact and Enter Their first_name, last_name and Phone number. Click create when done!.
![Add New Telegram Contact](http://www.tecmint.com/wp-content/uploads/2015/03/Add-New-Telegram-Contact.png)
Add New Telegram Contact
7. If the contact you added is not on telegram already, You get a warning message and telegram will acknowledge you when your contact joins telegram.
![Telegram Contact Notification](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Contact-Notification.jpeg)
Telegram Contact Notification
8. As soon as the contact joins telegram you get a message (pop-out like) that reads [YOUR_CONTACT] joined telegram.
9. A formal chat window on Linux Machine. Nice experience…
![Telegram Contact Join Message](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Contact-Join-Message.jpeg)
Telegram Contact Join Message
10. At the same time, Ive tried messaging from my android mobile device, the interface looks similar on both.
![Telegram Mobile Interface](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Mobile-Interface.png)
Telegram Mobile Interface
11. Telegram settings page. You have a lot of options to configure.
![Telegram Settings](http://www.tecmint.com/wp-content/uploads/2015/03/Telegram-Settings.png)
Telegram Settings
12. About Telegram.
![About Telegram](http://www.tecmint.com/wp-content/uploads/2015/03/About-Telegram.jpeg)
About Telegram
#### Less Interesting Points ####
- Telegram usage protocol MTProto Mobile protocol.
- Released Initially for iPhone in the year 2013 (August 14)..
- People Behind this Amazing Project: Pavel and Nikolai Durov..
Thats all for now. Ill be here again with another interesting article you will love to read. I take the pleasure on behalf of Tecmint to thank all our valuable readers and critics who made us stand where we are now through continuous self evolving process. Keep Connected! Keep Commenting. Share if you care for us.
- [https://telegram.org/][2]
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-telegram-in-linux/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:https://tdesktop.com/linux
[2]:https://telegram.org/

View File

@ -0,0 +1,110 @@
Mydumper Mysql Database Backup tool
================================================================================
Mydumper is a tool used for backing up MySQL database servers much faster than the mysqldump tool distributed with MySQL. It also has the capability to retrieve the binary logs from the remote server at the same time as the dump itself.
### Mydumper advantages ###
o Parallelism (hence, speed) and performance (avoids expensive character set conversion routines, efficient code overall)
o Easier to manage output (separate files for tables, dump metadata,etc, easy to view/parse data)
o Consistency -- maintains snapshot across all threads, provides accurate master and slave log positions, etc
o Manageability -- supports PCRE for specifying database and tables inclusions and exclusions
### Install mydumper on ubuntu ###
Open the terminal and run the following command
sudo apt-get install mydumper
### Using Mydumper ###
#### Syntax ####
mydumper [options]
Application Options:
- -B, --database Database to dump
- -T, --tables-list Comma delimited table list to dump (does not exclude regex option)
- -o, --outputdir Directory to output files to
- -s, --statement-size Attempted size of INSERT statement in bytes, default 1000000
- -r, --rows Try to split tables into chunks of this many rows
- -c, --compress Compress output files
- -e, --build-empty-files Build dump files even if no data available from table
- -x, --regex Regular expression for db.table' matching
- -i, --ignore-engines Comma delimited list of storage engines to ignore
- -m, --no-schemas Do not dump table schemas with the data
- -k, --no-locks Do not execute the temporary shared read lock. WARNING: This will cause inconsistent backups
- -l, --long-query-guard Set long query timer in seconds, default 60
- --kill-long-queries Kill long running queries (instead of aborting)
- -b, --binlogs Get a snapshot of the binary logs as well as dump data
- -D, --daemon Enable daemon mode
- -I, --snapshot-interval Interval between each dump snapshot (in minutes), requires --daemon, default 60
- -L, --logfile Log file name to use, by default stdout is used
- -h, --host The host to connect to
- -u, --user Username with privileges to run the dump
- -p, --password User password
- -P, --port TCP/IP port to connect to
- -S, --socket UNIX domain socket file to use for connection
- -t, --threads Number of threads to use, default 4
- -C, --compress-protocol Use compression on the MySQL connection
- -V, --version Show the program version and exit
- -v, --verbose Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2
#### Mydumper Example ####
mydumper \
--database=$DB_NAME \
--host=$DB_HOST \
--user=$DB_USER \
--password=$DB_PASS \
--outputdir=$DB_DUMP \
--rows=500000 \
--compress \
--build-empty-files \
--threads=2 \
--compress-protocol
Description of Mydumper's output data
Mydumper does not output to files, but rather to files in a directory. The --outputdir option specifies the name of the directory to use.
The output is two parts
Schema
For each table in the database, a file containing the CREATE TABLE statement will be created. It will be named:
dbname.tablename-schema.sql.gz
Data
For each table with number of rows above the --rows parameter, you will have a file called:
dbname.tablename.0000n.sql.gz
Where "n" starts with 0 up to the number of.
If you want to restore these backup you can use Myloader
myloader \
--database=$DB_NAME \
--directory=$DB_DUMP \
--queries-per-transaction=50000 \
--threads=10 \
--compress-protocol \
--verbose=3
--------------------------------------------------------------------------------
via: http://www.ubuntugeek.com/mydumper-mysql-database-backup-tool.html
作者:[ruchi][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.ubuntugeek.com/author/ubuntufix

View File

@ -1,3 +1,4 @@
[raywang]
Open source all over the world
================================================================================
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png)

View File

@ -1,32 +0,0 @@
zpl1025
Windows 10 versus Linux
================================================================================
![](https://farm4.staticflickr.com/3852/14863156322_e4edbae70e_t.jpg)
Windows 10 seemed to dominate the headlines today, even in many Linux circles. Leading the pack is Brian Fagioli at betanews.com saying Windows 10 is ringing the death knell for Linux desktops. Microsoft announced today that Windows 10 will be free for loyal Windows users and Steven J. Vaughan-Nichols said it's the newest Open Source company. Then Matt Hartley compares Windows 10 to Ubuntu and Jesse Smith reviews Windows 10 from a Linux user's perspective.
**Windows 10** was the talk around water coolers today with Microsoft's [announcement][1] that it would be free for Windows 7 and up users. Here in Linuxland, that didn't go unnoticed. Brian Fagioli at betanews.com, a self-proclaimed Linux fan, said today, "Windows 10 closes the door entirely. The year of the Linux desktop will never happen. Rest in peace." [Fagioli explained][2] that Microsoft listened to user complaints and not only addressed them but improved way beyond that. He said Linux missed the boat by failing to capitalize on the Windows 8 unpopularity and ultimate failure. Then he concluded that we on the fringe must accept our "shattered dreams" thanks to Windows 10.
**H**owever, Jesse Smith, of Distrowatch.com fame, said Microsoft isn't making it easy to find the download, but it is possible and he did it. The installer was simple enough except for the partitioner, which was quite limited and almost scary. After finally getting into Windows 10, Smith said the layout was "sparce" without a lot of the distractions folks hated about 7. The menu is back and the start screen is gone. A new package manager looks a lot like Ubuntu's and Android's according to Smith, but requires an online Microsoft account to use. [Smith concludes][3] in part, "Windows 10 feels like a beta for an early version of Android, a consumer operating system that is designed to be on-line all the time. It does not feel like an operating system I would use to get work done."
**S**mith's [full article][4] compares Windows 10 to Linux quite a bit, but Matt Hartley today posted an actual Windows 10 vs Linux report. [He said][5] both installers were straightforward and easy Windows still doesn't dual boot easily and Windows provides encryption by default but Ubuntu offers it as an option. At the desktop Hartley said Windows 10 "is struggling to let go of its Windows 8 roots." He thought the Windows Store looks more polished than Ubuntu's but didn't really like the "tile everything" approach to newly installed apps. In conclusion, Hartley said, "The first issue is that it's going to be a free upgrade for a lot of Windows users. This means the barrier to entry and upgrade is largely removed. Second, it seems this time Microsoft has really buckled down on listening to what their users want."
**S**teven J. Vaughan-Nichols today said that Microsoft is the newest Open Source company; not because it's going to be releasing Windows 10 as a free upgrade but because Microsoft is changing itself from a software company to a software as a service company. And, according to Vaughan-Nichols, Microsoft needs Open Source to do it. They've been working on it for years beginning with Novell/SUSE. Not only that, they've been releasing software as Open Source as well (whatever the motives). [Vaughan-Nichols concluded][6], "Most people won't see it, but Microsoft -- yes Microsoft -- has become an open-source company."
--------------------------------------------------------------------------------
via: http://ostatic.com/blog/windows-10-versus-linux
作者:[Susan Linton][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://ostatic.com/member/susan-linton
[1]:https://news.google.com/news/section?q=microsoft+windows+10+free&ie=UTF-8&oe=UTF-8
[2]:http://betanews.com/2015/01/25/windows-10-is-the-final-nail-in-the-coffin-for-the-linux-desktop/
[3]:http://blowingupbits.com/2015/01/an-outsiders-perspective-on-windows-10-preview/
[4]:http://blowingupbits.com/2015/01/an-outsiders-perspective-on-windows-10-preview/
[5]:http://www.datamation.com/open-source/windows-vs-linux-the-2015-version-1.html
[6]:http://www.zdnet.com/article/microsoft-the-open-source-company/

View File

@ -1,136 +0,0 @@
A Look At What Linux Games We Will See In 2015 And Beyond
================================================================================
Linux Gaming is dead they said, Linux Gaming is pointless they said...ah whatever. Heres a look at whats to come for us in 2015 and beyond.
It's pretty hard to keep up with everything that's going on for us, but here's a quick look at what we could see soon.
### Confirmed Games ###
#### Adventure Games ####
- [Firewatch][1]
- [Paradise Lost: First Contact][2]
- [SteamWorld Heist][3]
#### Action Games ####
- [Darksiders][4]
- [Darksiders II][5]
- [Ray's The Dead][6]
- [Skullgirls][7]
#### FPS Games ####
- [Bioshock Infinite][8]
- Half Life 3 /troll
- [Homefront: The Revolution][9]
- [Killing Floor 2][10]
- Serious Sam 4 (No official site for it yet)
- [Storm United][11]
- [SUPERHOT][12]
#### Platformers ####
- [Broforce][13]
- [Chasm][14]
- [Giana Sisters][15]
- [Heart Forth, Alicia][16]
- [Hot Tin Roof][17]
- [Infinifactory][18]
- [Mighty No. 9][19]
- [Night in the Woods][20]
- [Noct][21]
- [Oddworld: New 'N' Tasty][22]
- [Red Goddess][23]
#### RPG Games ####
- [Divinity: Original Sin][24]
- [Pillars Of Eternity][25]
- [Shadowrun: Hong Kong][26]
- [The Banner Saga][27]
#### Strategy Games ####
- [Age of Wonders III][28]
- [Banished][29]
- [Cities: Skylines][30]
- [Clockwork Empires][31]
- [Parkitect][32]
- [Scrolls][33]
- [Space Pirates And Zombies 2][34]
#### Sandbox Games ####
- [Terraria][35]
- [X Rebirth][36]
#### Unconfirmed, but highly likely ####
- [Company of Heroes 2][37]
- [Outlast][38]
- [Shadow Warrior][39]
- [Torchlight II][40]
Then theres the [two ports teased from Feral Interactive][41], we cant let them be left out just because we dont know what they are.
We imagine Aspyr Media are also working on new bigger ports, but they have only just released their latest game, so it may be a few months until we see anything.
**This isn't a complete list** of course, as we can easily forget with the sheer amount of games heading our way, and wow what a list!
We have GDC next month, and we are expecting a few announcements too. While we don't have anything solid, with Valve's big presence with Steam Machines we are expecting at least some more Linux games, otherwise it we fear it may be a little lacklustre for Valve to only show off older existing games for Linux.
What did we miss that youre excited about for Linux?
--------------------------------------------------------------------------------
via: http://www.gamingonlinux.com/articles/a-look-at-what-linux-games-we-will-see-in-2015-and-beyond.4963
作者:[liamdawe][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.gamingonlinux.com/profiles/1
[1]:https://www.gamingonlinux.com/articles/category/17/articles/firewatch-a-first-person-mystery-game-finally-reveals-itself-in-a-trailer.4231
[2]:http://www.asthreeworks.com/games/
[3]:https://www.gamingonlinux.com/articles/category/17/articles/image-form-announces-steamworld-heist.4304
[4]:https://www.gamingonlinux.com/articles/darksiders-linux-port-looks-like-it-is-still-happening.4893
[5]:https://www.gamingonlinux.com/articles/darksiders-2-confirmed-for-linux.4154
[6]:http://ragtagstudio.com/?page_id=457
[7]:https://www.gamingonlinux.com/articles/editorial-skullgirls-on-linux-finally-shows-some-progress.4789
[8]:https://www.gamingonlinux.com/articles/bioshock-infinite-looks-set-for-a-linux-release-confirmed.4668
[9]:http://www.homefront-game.com/
[10]:https://www.gamingonlinux.com/articles/category/17/articles/killing-floor-2-fps-has-a-new-trailer.4676
[11]:https://www.gamingonlinux.com/articles/storm-united-online-fps-shows-first-real-gameplay-video-first-alpha-due-soon.4872
[12]:http://superhotgame.com/
[13]:http://steamcommunity.com/app/274190/discussions/0/540738051503306548/#c540738051518330743
[14]:https://www.gamingonlinux.com/articles/category/17/articles/chasm-rpg-platformer-will-have-a-same-day-linux-release.4266
[15]:https://www.gamingonlinux.com/articles/linux-port-of-platformer-giana-sisters-brought-inhouse-sequel-might-get-sameday-release.4913
[16]:http://www.alonsomartin.mx/hfa/
[17]:http://www.hottinroofgame.com/
[18]:https://twitter.com/zachtronics/status/566016742825005057
[19]:http://www.mightyno9.com/
[20]:http://www.nightinthewoods.com/
[21]:https://www.gamingonlinux.com/articles/category/17/articles/noct-a-fantastic-top-down-thermal-image-survival-horror-game.4783
[22]:https://www.gamingonlinux.com/articles/puzzle-platformer-oddworld-new-n-tasty-will-release-for-linux-next-month.4836
[23]:https://www.gamingonlinux.com/articles/new-trailer-for-platformer-red-goddesss-looks-really-good.4939
[24]:https://www.gamingonlinux.com/articles/divinity-original-sin-is-pushing-ahead-for-the-linux-release.4938
[25]:https://www.gamingonlinux.com/articles/pillars-of-eternity-the-rpg-aims-for-a-sameday-linux-release-on-march-26th.4834
[26]:https://www.kickstarter.com/projects/webeharebrained/shadowrun-hong-kong
[27]:https://www.gamingonlinux.com/articles/the-banner-saga-rpg-looks-close-to-a-linux-version.4862
[28]:https://www.gamingonlinux.com/articles/the-linux-port-of-age-of-wonders-iii-is-progressing-a-bit-too-explosive-right-now.4857
[29]:https://www.gamingonlinux.com/articles/banished-survival-city-building-sim-is-being-ported-to-linux.4813
[30]:https://www.gamingonlinux.com/articles/city-builder-game-cities-skylines-now-has-a-release-date.4954
[31]:https://www.gamingonlinux.com/articles/clockwork-empires-still-pushing-towards-a-linux-version-suffering-delays.4734
[32]:https://www.gamingonlinux.com/articles/category/17/articles/parkitect-what-roller-coaster-tycoon-should-have-grown-into.4528
[33]:https://www.gamingonlinux.com/articles/mojangs-scrolls-now-has-an-experimental-linux-build.4450
[34]:https://www.gamingonlinux.com/articles/space-pirates-and-zombies-2-reveals-the-zombies-in-a-brand-new-video.4759
[35]:https://www.gamingonlinux.com/articles/terraria-officially-confirmed-to-be-in-development-for-linux-finally.4299
[36]:https://www.gamingonlinux.com/articles/egosofts-x-rebirth-actively-being-ported-to-linux.4822
[37]:https://www.gamingonlinux.com/articles/company-of-heroes-2-looks-like-it-is-heading-to-linux.4199
[38]:https://www.gamingonlinux.com/articles/outlast-that-really-scary-game-looks-like-its-still-heading-to-linux.4896
[39]:https://www.gamingonlinux.com/articles/shadow-warrior-looks-like-it-will-come-to-linux.4859
[40]:https://www.gamingonlinux.com/articles/torchlight-ii-has-even-more-positive-signs-for-linux.4817
[41]:http://www.gamingonlinux.com/articles/feralinteractive.com/en/upcoming/

View File

@ -1,31 +0,0 @@
Torvalds: 'People who start writing kernel code get hired really quickly'
================================================================================
Now more than ever, the development of the Linux kernel is a matter for the professionals, as unpaid volunteer contributions to the project reached their lowest recorded levels in the latest "Who Writes Linux" report, which was released today.
According to the report, which is compiled by the Linux Foundation, just 11.8 percent of kernel development last year was done by unpaid volunteers -- a 19 percent downturn from the 2012 figure of 14.6 percent. The foundation says that the downward trend in volunteer contributions has been present for years.
![](http://images.techhive.com/images/article/2015/02/screen-shot-2015-02-17-at-5.25.43-pm-100568680-medium.idge.png)
Even so, unpaid contributors were still the single biggest source of commits in the latest Who Writes Linux, at 11,968 total changes -- good for 12.4 percent of the whole. However, corporate contributors collectively account for much, much more. The Linux Foundation said that more than 80 percent of all work on the kernel is done by paid professional developers.
According to Linus Torvalds, the shift towards paid developers hasn't changed much about kernel development on its own.
"I think one reason it hasn't changed things all that much is that it's not so much 'unpaid volunteers are going away' as 'people who start writing kernel code get hired really quickly,'" he told Network World.
Torvalds said that, while Linux development has changed for plenty of other reasons -- and that, naturally, new contributors pop up all the time -- many of the original developers, with decades of experience, have simply been snapped up by companies with an interest in Linux.
"We may have started as volunteers, but we're happily employed doing Linux these days," he said.
Torvalds' own role in development has become increasingly hands-off, according to the report -- he has personally signed off on 329 patches since version 3.10 of kernel was released, or 0.4 percent. Increasingly, subsystem maintainers do their own reviews and merges of code.
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2885339/application-development/torvalds-people-who-start-writing-kernel-code-get-hired-really-quickly.html
作者:[Jon Gold][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Jon-Gold/

View File

@ -1,85 +0,0 @@
10 best uses for open source software in the business world
================================================================================
> Open source offers some compelling benefits for businesses large and small -- but you might be surprised at some of the ways it's being used.
![](http://tr2.cbsistatic.com/hub/i/r/2015/03/05/54a9c323-4311-4455-b10b-5182548da424/resize/620x485/95164f01a19cbd7a3e4b843be78febae/foss.jpg)
Certain inevitabilities occur in technology. For instance, open source software will make its way into your business. Ten years ago, this could easily have been called into question. Now? There's no way to avoid it -- and there's no reason to. With so many powerful (and necessary) pieces of technology, open source has become, in various cases, the savior of tech. But what areas of your business are best suited for open source? The answer to that question is, of course, will be different from one company to the next. But some applications can apply in almost every circumstance.
Let's take a look at 10 possible best-case uses for open source software that can help make your business grow, bring you a level of flexibility and reliability you haven't experienced, or just save you a welcome percentage of your budget.
### 1: Server software ###
If you're still battling Microsoft's IIS platform, you need to experience Apache. The flagship open source web server software is one of the most widely used on the planet. It's free, incredibly reliable, easy to manage, and doesn't require the enormous overhead needed for IIS. But open source isn't limited to just web servers. If you need SMB sharing across your company, consider Samba. Samba 4 even integrates with Active Directory, so you don't have to worry about setting up separate user accounts on the Samba server.
### 2: Development ###
Developing with open source is a no-brainer. PHP, Rails, Perl -- there are as many languages to develop with as there are tools (from IDEs to bug tracking). There are a lot of options for developing for open source or with open source tools (as are there with proprietary development). The biggest difference between open source and proprietary is the access you have to the software code. Within the world of FOSS (free open source software) the code is readily available. For many developers, the Linux operating system has everything they need to develop, built right in (especially those who code without a full-blown IDE). If you do require GUI development tools, open source has you covered.
### 3: Security ###
The route to security is a challenging one, but there are many paths to success. You can opt for the "security in a box" solution and go with the likes of Cisco (a solid solution) or you can craft your security to perfectly fit your needs with the likes of iptables. Yes, the open source security route will take a bit more time to deploy (with a much higher learning curve), but the end results are generally incredible. This doesn't even address the idea that using open source on the desktop is, generally speaking, a more secure platform than most proprietary systems. Deploy Linux on the desktops and your security woes will drop dramatically.
### 4: Desktops ###
This area is where most of the pushback happens. However, you must take into consideration the fact that the daily workflow has undergone a major paradigm shift. Most of what we do now is done via a web browser. So why not deploy Linux on the desktop? Not only does it work with the majority of today's tasks, it will do so without suffering from viruses, malware, and updates that cripple a system. It's not perfect -- what platform is? But it's solid, and in the end, it can save you money. That's a win-win.
### 5: Workflow ###
Every business depends upon workflow. For some businesses, a smooth workflow depends upon tools. Open source has this arena covered. CRM, HRM, ERP, BI, BPM... you name it, open source handles just about every possible acronym you can think of -- and it does it very well. With the likes of [Pentaho][1], [Collabtive][2], and [SugarCRM][3], open source can keep up with closed source tools any day.
### 6: Collaboration ###
Without the ability to work together on projects, your staff wouldn't be able to get the job done. So the collaboration tools you choose are crucial. You'll find plenty of quality collaboration tools within the world of open source. [Cyn.in community edition][4], [Zimbra Open Source Edition][5], and [Kolab][6] are just three examples of the excellent collaboration tools that exist within the open source world.
### 7: Big data ###
When it comes to big data, open source can't be matched. Thanks to the likes of [SUSE][7], big data and open source now go hand in hand. Innovations like in-memory data and live kernel patching make open source an ideal solution for big data. It can be perfectly tuned to meet the massive demands big data places on the platform. Closed source software can't touch this level of flexibility.
### 8: Cloud ###
The major players in the cloud are open source. [Red Hat][8], [Ubuntu][9], [SUSE][10], [Amazon][11], [Rackspace][12] -- they all get it and know that open source is the best solution for cloud deployments. But if you don't want to go with the larger companies, there are always up and coming tools like [ownCloud][12], where you can either take advantage of its hosted cloud solutions or build your own.
### 9: Multimedia ###
If your company does podcasting or video for PR, open source has you covered. With tools like [Audacity][14] and [OpenShot][15], you can do just about anything with audio or video you need -- and do so on the cheap. In fact, you'll be hard-pressed to find a better podcasting tool than Audacity or an easier-to-use video editor than OpenShot. Both pieces of software do an outstanding job of creating professional-quality results without the steep learning curves or the high prices often associated with closed source tools
### 10: E-commerce ###
If your business sells products online, you'd be remiss not to give a tool like [PrestaShop][16] a try. PrestaShop is, hands down, one of the most powerful e-commerce solutions available -- regardless of license. With just about every feature you could possible want (and some you probably haven't even thought of), the open source platform excels at e-commerce on every level.
### FOSS for business ###
Open source is no longer hanging around the periphery of the business conversation. In many instances, FOSS leads and dominates that conversation. If you've been looking for areas to consider deploying open source solutions, look no further than these 10.
### Your turn ###
Have you added open source software to your business? If so, in what way?
--------------------------------------------------------------------------------
via: http://www.techrepublic.com/blog/10-things/10-best-uses-for-open-source-software-in-the-business-world/
作者:[Jack Wallen][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.techrepublic.com/search/?a=jack+wallen
[1]:http://community.pentaho.com/
[2]:http://collabtive.o-dyn.de/
[3]:http://www.sugarcrm.com/
[4]:http://cynapse.com/cyn-in/
[5]:https://www.zimbra.com/open-source
[6]:http://kolab.org/
[7]:http://www.suse.org/
[8]:http://www.redhat.com/
[9]:http://www.ubuntu.com/
[10]:http://www.suse.com/
[11]:http://aws.amazon.com/ec2/
[12]:http://www.rackspace.com/cloud
[13]:https://owncloud.org/
[14]:http://audacity.sourceforge.net/
[15]:http://www.openshot.org/
[16]:https://www.prestashop.com/

View File

@ -0,0 +1,66 @@
Revealed: The best and worst of Docker
================================================================================
![](http://images.techhive.com/images/article/2015/01/best_worst_places_to_work-100564193-primary.idge.jpg)
Credit: [Shutterstock][1]
> Docker experts talk about the good, the bad, and the ugly of the ubiquitous application container system
No question about it: Docker's app container system has made its mark and become a staple in many IT environments. With its accelerating adoption, it's bound to stick around for a good long time.
But there's no end to the debate about what Docker's best for, where it falls short, or how to most sensibly move it forward without alienating its existing users or damaging its utility. Here, we've turned to a few of the folks who have made Docker their business to get their takes on Docker's good, bad, and ugly sides.
### The good ###
One hardly expects Steve Francia, chief of operations of the Docker open source project, to speak of Docker in anything less than glowing terms. When asked by email about Docker's best attributes, he didn't disappoint: "I think the best thing about Docker is that it enables people, enables developers, enables users to very easily run an application anywhere," he said. "It's almost like the Holy Grail of development in that you can run an application on your desktop, and the exact same application without any changes can run on the server. That's never been done before."
Alexis Richardson of [Weaveworks][2], a virtual networking product, praised Docker for enabling simplicity. "Docker offers immense potential to radically simplify and speed up how software gets built," he replied in an email. "This is why it has delivered record-breaking initial mind share and traction."
Bob Quillin, CEO of [StackEngine][3], which makes Docker management and automation solutions, noted in an email that Docker (the company) has done a fine job of maintaining Docker's (the product) appeal to its audience. "Docker has been best at delivering strong developer support and focused investment in its product," he wrote. "Clearly, they know they have to keep the momentum, and they are doing that by putting intense effort into product functionality." He also mentioned that Docker's commitment to open source has accelerated adoption by "[allowing] people to build around their features as they are being built."
Though containerization itself isn't new, as Rob Markovich of IT monitoring-service makers [Moogsoft][4] pointed out, Docker's implementation makes it new. "Docker is considered a next-generation virtualization technology given its more modern, lightweight form [of containerization]," he wrote in an email. "[It] brings an opportunity for an order-of-magnitude leap forward for software development teams seeking to deploy code faster."
### The bad ###
What's less appealing about Docker boils down to two issues: the complexity of using the product, and the direction of the company behind it.
Samir Ghosh, CEO of enterprise PaaS outfit [WaveMaker][5], gave Docker a thumbs-up for simplifying the complex scripting typically needed for continuous delivery. That said, he added, "That doesn't mean Docker is simple. Implementing Docker is complicated. There are a lot of supporting technologies needed for things like container management, orchestration, app stack packaging, intercontainer networking, data snapshots, and so on."
Ghosh noted the ones who feel the most of that pain are enterprises that want to leverage Docker for continuous delivery, but "it's even more complicated for enterprises that have diverse workloads, various app stacks, heterogenous infrastructures, and limited resources, not to mention unique IT needs for visibility, control and security."
Complexity also becomes an issue in troubleshooting and analysis, and Markovich cited the fact that Docker provides application abstraction as the reason why. "It is nearly impossible to relate problems with application performance running on Docker to the performance of the underlying infrastructure domains," he said in an email. "IT teams are going to need visibility -- a new class of monitoring and analysis tools that can correlate across and relate how everything is working up and down the Docker stack, from the applications down to the private or public infrastructure."
Quillin is most concerned about Docker's direction vis-à-vis its partner community: "Where will Docker make money, and where will their partners? If [Docker] wants to be the next VMware, it will need to take a page out of VMware's playbook in how to build and support a thriving partner ecosystem.
"Additionally, to drive broader adoption, especially in the enterprise, Docker needs to start acting like a market leader by releasing more fully formed capabilities that organizations can count on, versus announcements of features with 'some assembly required,' that don't exist yet, or that require you to 'submit a pull request' to fix it yourself."
Francia pointed to Docker's rapid ascent for creating its own difficulties. "[Docker] caught on so quickly that there's definitely places that we're focused on to add some features that a lot of users are looking forward to."
One such feature, he noted, was having a GUI. "Right now to use Docker," he said, "you have to be comfortable with the command line. There's no visual interface to using Docker. Right now it's all command line-based. And we know if we want to really be as successful as we think we can be, we need to be more approachable and a lot of people when they see a command line, it's a bit intimidating for a lot of users."
### The future ###
In that last respect, Docker recently started to make advances. Last week it [bought the startup Kitematic][6], whose product gave Docker a convenient GUI on Mac OS X (and will eventually do the same for Windows). Another acqui-hire, [SocketPlane][7], is being spun in to work on Docker's networking.
What remains to be seen is whether Docker's proposed solutions to its problems will be adopted, or whether another party -- say, [Red Hat][8] -- will provide a more immediately useful solution for enterprise customers who can't wait around for the chips to stop falling.
"Good technology is hard and takes time to build," said Richardson. "The big risk is that expectations spin wildly out of control and customers are disappointed."
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2896895/application-virtualization/best-and-worst-about-docker.html
作者:[Serdar Yegulalp][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Serdar-Yegulalp/
[1]:http://shutterstock.com/
[2]:http://weave.works/
[3]:http://stackengine.com/
[4]:http://www.moogsoft.com/
[5]:http://www.wavemaker.com/
[6]:http://www.infoworld.com/article/2896099/application-virtualization/dockers-new-acquisition-does-containers-on-the-desktop.html
[7]:http://www.infoworld.com/article/2892916/application-virtualization/docker-snaps-up-socketplane-to-fix-networking-flaws.html
[8]:http://www.infoworld.com/article/2895804/application-virtualization/red-hat-wants-to-do-for-containers-what-its-done-for-linux.html

View File

@ -1,174 +0,0 @@
theo-l translating
How to protect SSH server from brute force attacks using fail2ban
如何使用fail2ban来保护SSH服务器避免暴力破解攻击。
================
One common attack on SSH service is brute force attacks where a remote attacker indefinitely attempts to log in with different passwords. Of course there are arguments against password authentication for SSH, and alternative authentication mechanisms such as [public key authentication][1] or [two-factor authentication][2] exist to obsolete such attacks. Putting aside pros and cons of different authentication methods, let's consider the situation where password authentication is required. How would you protect your SSH server against brute-force attacks?
对于SSH服务的常见的攻击就是暴力破解攻击--远程攻击者通过不同的密码来进行无限地登录尝试。当然SSH存在参数来防备密码验证以及可用的验证机制例如[公钥验证][1]或者[双重验证][2]
[fail2ban][3] is a well-known open-source intrusion prevention framework on Linux that monitors various system log files (e.g., /var/log/auth.log or /var/log/secure) and automatically triggers various defensive actions upon detecting any suspicious activities. In fact, fail2ban can be quite useful to defend against brute force password guessing attacks on an SSH server.
In this guide, I will demonstrate **how to install and configure fail2ban to protect an SSH server against brute force attacks from a remote IP address**.
### Install Fail2ban on Linux
To install fail2ban on CentOS or RHEL, first [set up EPEL repository][4], and then run the following command.
$ sudo yum install fail2ban
To install fail2ban on Fedora, simply run:
$ sudo yum install fail2ban
To install fail2ban on Ubuntu, Debian or Linux Mint:
$ sudo apt-get install fail2ban
### Configure Fail2ban for SSH Server
Now you are ready to configure fail2ban to harden your SSH server. You need to edit the configuration file at /etc/fail2ban/jail.conf. The configuration file contains "DEFAULT" section where you define default parameters for all monitored services, and service-specific sections where you define any service-specific jails (e.g., SSH, Apache, etc) to overwrite default parameters.
In the service-specific jail sections (somewhere after [DEFAULT] section), you need to define [ssh-iptables] section, where you define SSH-specific jail configurations. Actual IP address banning is done by iptables.
The following is an example of /etc/fail2ban/jail.conf which contains "ssh-iptables" jail configuration. Of course there could be other application-specific jails depending on your needs.
$ sudo vi /etc/fail2ban/jail.local
```
[DEFAULT]
# a space delimited list of IP addresses, CIDR prefixes, or DNS hostnames
# to bypass fail2ban protection
ignoreip = 127.0.0.1 172.31.0.0/24 10.10.0.0/24 192.168.0.0/24
# number of seconds during which a client host is blocked
bantime = 86400
# number of failures before a client host is blocked
maxretry = 5
# number of seconds within which "maxentry" failures result in banning
findtime = 600
mta = sendmail
[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
sendmail-whois[name=SSH, dest=your@email.com, sender=fail2ban@email.com]
# for Debian-based distros
logpath = /var/log/auth.log
# for Red Hat-based distros
logpath = /var/log/secure
# ssh-specific max-retry threshold
maxretry = 3
```
According to the above configuration, fail2ban will automatically ban any remote IP address from which there have been at least 3 failed login attempts within the last 10 minutes. Once banned, the offending IP address will remain blocked for 24 hours. Such an event will be notified by sendemail to a recipient email address.
Once the configuration file is ready, restart fail2ban service as follows.
On Debian, Ubuntu or CentOS/RHEL 6:
$ sudo service fail2ban restart
On Fedora or CentOS/RHEL 7:
$ sudo systemctl restart fail2ban
To verify fail2ban is running successfully, run fail2ban-client command with "ping" argument. If fail2ban service is running okay, you should see "pong" as a response.
$ sudo fail2ban-client ping
Server replied: pong
### Test Protection against SSH Brute-Force Attacks with Fail2ban
To test whether fail2ban works, try to SSH to the server using incorrect passwords to simulate a brute-force attack. In the mean time, monitor /var/log/fail2ban.log, which is logging any interesting events that are happening in fail2ban.
$ sudo tail -f /var/log/fail2ban.log
![](https://farm8.staticflickr.com/7550/15882084127_fccf9ca7b7_c.jpg)
According to the log file above, fail2ban has banned an IP address 192.168.1.8, upon detecting multiple failed SSH login attempts from the IP address.
### Check Fail2ban Status and Unban Blocked IP Addresses
As fail2ban's "ssh-iptables" jail uses iptables to block offending IP addresses, you can easily verify the ban by checking current iptables rules as follows.
$ sudo iptables --list -n
```
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-SSH tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain fail2ban-SSH (1 references)
target prot opt source destination
DROP all -- 192.168.1.8 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
```
If you want to unblock the IP address from fail2ban, you can also use iptables command:
$ sudo iptables -D fail2ban-SSH -s 192.168.1.8 -j DROP
While you can check and manage fail2ban's IP blocklist manually with iptables command like above, a proper way is in fact to use fail2ban-client command-line tool. This tool allows you to manage not only "ssh-iptables" jail, but also any other types of fail2ban jails in a unified command-line interface.
To check fail2ban status (which will show a list of currently active jails):
$ sudo fail2ban-client status
To check the status of a particular jail (e.g., ssh-iptables):
$ sudo fail2ban-client status ssh-iptables
The above command will show a list of banned IP addresses.
![](https://farm8.staticflickr.com/7497/16067847655_021d23e320_b.jpg)
To unban a particular IP address:
$ sudo fail2ban-client set ssh-iptables unbanip 192.168.1.8
![](https://farm8.staticflickr.com/7465/16065915571_b215a8b344_b.jpg)
Note that if you stop fail2ban, all blocked IP addresses will be unblocked. When you restart fail2ban, it will find a list of offending IP addresses from /var/log/secure (or /var/log/auth.log), and re-ban those IP addresses if the elapsed time of the offenses are still within ban time.
### Set Fail2ban to Auto-start on Boot
Once you haved tested fail2ban successfully, the last step is to enable fail2ban to launch automatically upon powering on your server. On Debian-based distributions, fail2ban auto-start is enabled by default. On Red Hat-based distributions, enable auto-start as follows.
On CentOS/RHEL 6:
$ sudo chkconfig fail2ban on
On Fedora or CentOS/RHEL 7:
$ sudo systemctl enable fail2ban
### Summary
In this tutorial, I demonstrated how to install and configure fail2ban to protect an SSH server. While fail2ban can mitigate brute-force password guessing attacks, please note that it cannot protect SSH servers against sophisticated distributed brute-force campaigns, where an attacker bypasses fail2ban by using many thousands of bot-controlled IP addresses.
-----------
via: http://linoxide.com/tools/linux-compress-decompress-tools/
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html
[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html
[3]:http://www.fail2ban.org/
[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html

View File

@ -1,3 +1,4 @@
disylee 来一篇~
How to analyze and view Apache web server logs interactively on Linux
================================================================================
Whether you are in the web hosting business, or run a few web sites on a VPS yourself, chances are you want to display visitor statistics such as top visitors, requested files (dynamic or static), used bandwidth, client browsers, and referring sites, and so forth.
@ -140,4 +141,4 @@ via: http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html
[3]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[4]:http://goaccess.io/download#dependencies
[5]:http://goaccess.io/download
[6]:http://httpd.apache.org/docs/2.4/logs.html
[6]:http://httpd.apache.org/docs/2.4/logs.html

View File

@ -1,99 +0,0 @@
johnhoow translating...
How to Install Lightweight Budgie ( v8) Desktop in Ubuntu 14.04
================================================================================
Budgie is the flagship desktop of the Evolve OS Linux Distribution, and is an Evolve OS project. Designed with the modern user in mind, it focuses on simplicity and elegance. A huge advantage for the Budgie desktop is that it is not a fork of another project, but rather one written from scratch with integration in mind.
The [Budgie Desktop][1] tightly integrates with the GNOME stack, employing underlying technologies to offer an alternative desktop experience. In the spirit of open source, the project is compatible with and available for other Linux distributions.
Also note that Budgie can now emulate the look and feel of the GNOME 2 desktop, optionally, via a setting in the panel preferences.
### Features in the 0.8 release ###
- IconTasklist: Add pinning support
- IconTasklist: Use .desktop files for quicklists
- IconTasklist: Use .desktop files for icon resolution
- IconTasklist: Support “attention” hint (blue blink)
- Panel: Support dark theme (used by default)
- Add Menubar applet
- Panel: Initial autohide support (manual, not automatic)
- Panel: Support shadow onall screen edges
- Panel: Dynamic support for gnome panel theming
- RunDialog: Complete visual refresh (bootiful)
- BudgieMenu: Add compact mode, use by default
- BudgieMenu: Sort items by usage
- BudgieMenu: Remove old power option
- Editor: Add all menu options to UI
- Support from GNOME 3.10 up to 3.16 (unreleased, git)
- wm: Kill workspace animation (resolve after v8)
- wm: Better animations for changing of wallpapers
### Important information ###
- Budgie [released version 0.8][2] so it is still in development and a beta.
- No nnative network management; can be fixed by using Ubuntu's applet.
- Budgie is intended for the Evolve OS so even with this PPA it might be buggy.
- GNOME themes work better than the native Ubuntu themes.
- Ubuntus overlay scrollbars are not working.
- If you want to read more visit the Evolve OS website.
### Installation ###
Now, we'll install our Lightweight Budgie Desktop in our Ubuntu 14.04 LTS "Trusty" distribution of Linux Operating System. First of all, we'll need to add ppa repository to our Ubuntu PC. To do so, we'll need to execute the below command in a shell or terminal.
$ sudo add-apt-repository ppa:evolve-os/ppa
![Add Budgie Desktop PPA Repo](http://blog.linoxide.com/wp-content/uploads/2015/01/budgie-desktop-ppa.png)
Now, after we finish adding PPA to our Ubuntu Computer, we'll need to update the local repository index in it. It can be done by running the following command in the same terminal or shell after above is done.
$ sudo apt-get update
Then, finally, we'll install the one and only Budgie Desktop Environment in our Ubuntu machine running the latest version 14.04 LTS.
$ sudo apt-get install budgie-desktop
![Install Budgie Desktop](http://blog.linoxide.com/wp-content/uploads/2015/02/install-budgie-desktop.png)
**Notes**
It is in active development and features remain missing, including, but not limited to: no network management support, no volume control applet (keyboard keys will work fine), no notification system and no way to pin apps to the task bar.
As a workaround you can disable overlay scrollbars, set a different default theme and quit a session from the terminal using the following command:
$ gnome-session-quit
![Quitting Gnome Session](http://blog.linoxide.com/wp-content/uploads/2015/02/gnome-seesion-quit.png)
### Log into the Budgie Session ###
After installation is completed, well be able to select Budgie from the session selector of the Unity Greeter. For that, we'll need to logout the current user and get back to the login screen. Then, we'll be able to switch to Budgie Desktop Environment.
![Select Desktop Session](http://blog.linoxide.com/wp-content/uploads/2015/02/session-select.png)
### Budgie Desktop Environment ###
![Budgie Desktop Environment](http://blog.linoxide.com/wp-content/uploads/2015/02/budgie-desktop.png)
### Logging Out ###
You can simply execute **budgie-session --logout** in a shell or terminal to logout it.
$ budgie-sessioon --logout
### Conclusion ###
Hurray! We have successfully installed our Lightweight Budgie Desktop Environment in our Ubuntu 14.04 LTS "Trusty" box. As we know, Budgie Desktop is still underdevelopment which makes it a lot of stuffs missing. Though its based on Gnomes GTK3, its not a fork. The desktop is written completely from scratch, and the design is elegant and well thought out. If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy Budgie Desktop 0.8 :-)
--------------------------------------------------------------------------------
via: http://linoxide.com/ubuntu-how-to/install-lightweight-budgie-v8-desktop-ubuntu/
作者:[Arun Pyasi][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/arunp/
[1]:https://evolve-os.com/budgie/
[2]:https://evolve-os.com/2014/11/16/courageous-budgie-v8-released/

View File

@ -1,3 +1,5 @@
theo-l translating
How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle
================================================================================
Have you ever encountered situations where one application dominated you all network bandwidth? If you have ever been in a situation where one application ate all your traffic, then you will value the role of the trickle bandwidth shaper application. Either you are a system admin or just a Linux user, you need to learn how to control the upload and download speeds for applications to make sure that your network bandwidth is not burned by a single application.
@ -109,17 +111,17 @@ We are using the freely-distributable Linux Fundamentals PDF file (available fro
You can initially download this file to your current working directory with the following command:
# wget http://linux-training.be/files/books/LinuxFun.pdf
# wget http://linux-training.be/files/books/LinuxFun.pdf
The syntax to upload a file to our FTP server without trickle is as follows:
# ncftpput -u username -p password 192.168.0.15 /remote_directory local-filename
# ncftpput -u username -p password 192.168.0.15 /remote_directory local-filename
Where /remote_directory is the path of the upload directory relative to usernames home, and local-filename is a file in your current working directory.
Specifically, without trickle we get a peak upload speed of 52.02 MB/s (please note that this is not the real average upload speed, but an instant starting peak), and the file gets uploaded almost instantly:
# ncftpput -u username -p password 192.168.0.15 /testdir LinuxFun.pdf
# ncftpput -u username -p password 192.168.0.15 /testdir LinuxFun.pdf
Output:
@ -127,11 +129,11 @@ Output:
With trickle, we will limit the upload transfer rate at 5 KB/s. Before uploading the file for the second time, we need to delete it from the destination directory; otherwise, ncftp will inform us that the file at the destination directory is the same that we are trying to upload, and will not perform the transfer:
# rm /absolute/path/to/destination/directory/LinuxFun.pdf
# rm /absolute/path/to/destination/directory/LinuxFun.pdf
Then:
# trickle -s -u 5 ncftpput -u username -p password 111.111.111.111 /testdir LinuxFun.pdf
# trickle -s -u 5 ncftpput -u username -p password 111.111.111.111 /testdir LinuxFun.pdf
Output:
@ -143,13 +145,13 @@ In the example above, we can see that the average upload speed dropped to ~5 KB/
First, remember to delete the PDF from the original source directory:
# rm /absolute/path/to/source/directory/LinuxFun.pdf
# rm /absolute/path/to/source/directory/LinuxFun.pdf
Please note that the following cases will download the remote file to the current directory in the client machine. This fact is indicated by the period (.) that appears after the IP address of the FTP server.
Without trickle:
# ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf
# ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf
Output:
@ -157,7 +159,7 @@ Output:
With trickle, limiting the download speed at 20 KB/s:
# trickle -s -d 30 ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf
# trickle -s -d 30 ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf
Output:
@ -189,7 +191,7 @@ In this example we will use the freely-distributable “He is the gift” video,
We will initially download this file to your current working directory with the following command:
# wget http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4
# wget http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4
First off, we will start the trickled daemon with the command listed above:
@ -197,7 +199,7 @@ First off, we will start the trickled daemon with the command listed above:
Without trickle:
# ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4
# ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4
Output:
@ -205,7 +207,7 @@ Output:
With trickle:
# trickle ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4
# trickle ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4
Output:
@ -219,7 +221,7 @@ As in Example 2, we will be downloading the file to the current working director
Without trickle:
# ncftpget -u username -p password 192.168.0.15 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4
# ncftpget -u username -p password 192.168.0.15 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4
Output:
@ -227,7 +229,7 @@ Output:
With trickle:
# trickle ncftpget -u username -p password 111.111.111.111 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4
# trickle ncftpget -u username -p password 111.111.111.111 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4
Output:
@ -259,7 +261,7 @@ The following is a trickled.conf sample file in the CentOS 7 client (192.168.0.1
Priority = 1
Time-Smoothing = 0.1
Length-Smoothing = 2
[ftp]
Priority = 2
Time-Smoothing = 1
@ -293,4 +295,4 @@ via: http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trick
[3]:http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4
[4]:http://www.tecmint.com/10-wget-command-examples-in-linux/
[5]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
[6]:http://www.tecmint.com/dpkg-command-examples/
[6]:http://www.tecmint.com/dpkg-command-examples/

View File

@ -1,152 +0,0 @@
How to Manage KVM Virtual Environment using Commandline Tools in Linux
================================================================================
In this 4th part of our [KVM series][1], we are discussing KVM environment management using CLI. We use virt-install CL tool to create and configure virtual machines, virsh CL tool to create and configure storage pools and qemu-img CL tool to create and manage disk images.
![KVM Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/KVM-Management-in-Linux.jpg)
KVM Management in Linux
There is nothing new concepts in this article, we just do the previous tasks using command line tools. There is no new prerequisite, just the same procedure, we have discussed in previous parts.
### Step 1: Configure Storage Pool ###
Virsh CLI tool is a management user interface for managing virsh guest domains. The virsh program can be used either to run one command by giving the command and its arguments on the shell command line.
In this section, we will use it to create storage pool for our KVM environment. For more information about the tool, use the following command.
# man virsh
**1. Using the command pool-define-as with virsh to define new storage pool, you need also to specify name, type and types arguments.**
In our case, name will be Spool1, type will be dir. By default you could provide five arguments for the type:
- source-host
- source-path
- source-dev
- source-name
- target
For (Dir) type, we need the last argumet “target” to specify the path of storage pool, for the other arguments we could use “-” to unspecific them.
# virsh pool-define-as Spool1 dir - - - - "/mnt/personal-data/SPool1/"
![Create New Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Storage-Pool.png)
Create New Storage Pool
**2. To check the all storage pools you have in the environment, use the following command.**
# virsh pool-list --all
![List All Storage Pools](http://www.tecmint.com/wp-content/uploads/2015/02/List-All-Storage-Pools.png)
List All Storage Pools
**3. Now its time to build the storage pool, which we have defined above with the following command.**
# virsh pool-build Spool1
![Build Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Build-Storage-Pool.png)
Build Storage Pool
**4. Using the virsh command pool-start to active/enable the storage pool we have just created/built above.**
# virsh pool-start Spool1
![Active Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Active-Storage-Pool.png)
Active Storage Pool
**5. Check the status of environment storage pools using the following command.**
# virsh pool-list --all
![Check Storage Pool Status](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Status.png)
Check Storage Pool Status
You will notice that the status of Spool1 converted to active.
**6. Configure Spool1 to start by libvirtd service every time automaticlly.**
# virsh pool-autostart Spool1
![Configure KVM Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Configure-Storage-Pool.png)
Configure KVM Storage Pool
**7. Finally lets display information about our new storage pool.**
# virsh pool-info Spool1
![Check KVM Storage Pool Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Information.png)
Check KVM Storage Pool Information
Congratulations, Spool1 is ready to be used lets try to create storage volumes using it.
### Step 2: Configure Storage Volumes/Disk Images ###
Now it is disk images turn, using qemu-img to create new disk image from Spool1. For more details about qemy-img, use the man page.
# man qemu-img
**8. We should specify the qemu-img command “create, check,….etc”, disk image format, the path of disk image you want to create and the size.**
# qemu-img create -f raw /mnt/personal-data/SPool1/SVol1.img 10G
![Create Storage Volume](http://www.tecmint.com/wp-content/uploads/2015/02/Create-Storage-Volumes.png)
Create Storage Volume
**9. By using qemu-img command info, you could get information about your new disk image.**
![Check Storage Volume Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Volume-Information.png)
Check Storage Volume Information
**Warning**: Never use qemu-img to modify images in use by a running virtual machine or any other process; this may destroy the image.
Now its time to create virtual machines in the next step.
### Step 3: Create Virtual Machines ###
10. Now with the last and latest part, we will create virtual machines using virt-istall. The virt-install is a command line tool for creating new KVM virtual machines using the “libvirt” hypervisor management library. For more details about it, use:
# man virt-install
To create new KVM virtual machine, you need to use the following command with all the details like shown in the below.
- Name: Virtual Machines name.
- Disk Location: Location of disk image.
- Graphics : How to connect to VM “Usually be SPICE”.
- vcpu : Number of virtual CPUs.
- ram : Amount of allocated memory in megabytes.
- Location : Specify the installation source path.
- Network : Specify the virtual network “Usually be vibr00 bridge”.
# virt-install --name=rhel7 --disk path=/mnt/personal-data/SPool1/SVol1.img --graphics spice --vcpu=1 --ram=1024 --location=/run/media/dos/9e6f605a-f502-4e98-826e-e6376caea288/rhel-server-7.0-x86_64-dvd.iso --network bridge=virbr0
![Create New Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Virtual-Machines.png)
Create New Virtual Machine
**11. You will find also a pop-up virt-vierwer window appears to communicate with virtual machine through it.**
![Booting Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Booting-Virtual-Machine.jpeg)
Booting Virtual Machine
![Installation of Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Installation-of-Virtual-Machine.jpeg)
Installation of Virtual Machine
### Conclusion ###
This is the latest part of our KVM tutorial, we havent covered everything of course. It a shot to scratch the KVM environment so its your turn to search and keep hands dirty using this nice resources.
- [KVM Getting Started Guide][2]
- [KVM Virtualization Deployment and Administration Guide][3]
--------------------------------------------------------------------------------
via: http://www.tecmint.com/kvm-management-tools-to-manage-virtual-machines/
作者:[Mohammad Dosoukey][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/dos2009/
[1]:http://www.tecmint.com/install-and-configure-kvm-in-linux/
[2]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html
[3]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html

View File

@ -1,177 +0,0 @@
Share Folders On Local Network Between Ubuntu And Windows
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_windows.jpeg)
This is a complete tutorial to show you **how to share folders over local network in Ubuntu**.
Do you have multiple devices in your home? Do you have to use Flash Drive or SD card to transfer data from Ubuntu to another computer? Do you find it annoying? We know you do. Because we dont want you to waste your precious time while you can transfer your files, documents and other large stuff quickly and easily, over the local network. Its one time setup and then with some clicks you will be able to **share files between Ubuntu and Windows** or any other Linux system. And dont worry its easy and takes only little time.
One more thing to add, while we performed this tutorial on Ubuntu, this tutorial should be valid for any other Linux OS.
#### Share folder on local network in Ubuntu ####
If you are using Ubuntu 14.04, 14.10 or 12.04, there are two ways you can share your local files over the local network to access it from Windows or other Linux computers.
- Share it for everyones access on local network, without password
- Password protect the folders for restricted access
Well see both methods in this post and will let you decide which one you would prefer to use.
### 1. Share folders on local network without password ###
#### Step 1: ####
To share a folder on local network in Ubuntu, right click on the desired folder and select Local Network Share:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Share_Folder_Ubuntu.jpeg)
**Possible troubleshoot**: If do not see the option of Local Network Share in right click menu, open a terminal and use the following command to install nautlius-share:
sudo apt-get install nautilus-share
Youll need to restart Nautilus. Either log out and log in back or use the command below:
nautilus -q
#### Step 2: ####
When you click on Local Network Share, you will see the option of sharing the folder. Just check the option of Share this folder:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_1.jpeg)
Possible troubleshoot: If you are prompted about Sharing service not being installed, like in the screenshot below, just click on Install service and follow the instructions.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_2.jpeg)
#### Step 3: ####
When you check the option of Share this folder, youll see option of Create Share available for you. You can also allow other users to edit the files in the shared folder. Option for guest access can be checked as well.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_folder_Ubuntu_3.png)
Youll see that the folder icon have been changed to show that it has been shared. To stop sharing a folder, just uncheck the Share this folder option.
Now this was the easy way out. This provides access to anyone on your local network to access these files. In normal condition, you should prefer this. I mean, devices on your home network should be generally know devices. But this could not be the case always. What if you want only certain people to access it? This is where Samba server comes in picture. Well see that in the second part of the tutorial.
### 2. Share the folders on local network in Ubuntu with password protection ###
To do this, we need to configure Samba server. Actually, we did use Samba in the previous part of this tutorial. We just did not emphasize on it. Before we go on seeing how to set up Samba server for local network sharing in Ubuntu, lets first have a quick look on what actually is [Samba][1].
#### What is Samba? ####
Samba is the software package that allows you to share files, documents and printers across a network, irrespective of whether you are using Linux, Windows and Mac. Its available for all major platforms and can work tremendously nice in all of them. Quoting from Wikipedia:
> Samba a free software re-implementation of the SMB/CIFS networking protocol, and was originally developed by Andrew Tridgell. As of version 3, Samba provides file and print services for various Windows Clients and can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a domain member. It can also be part an Active Directory domain.
#### Install Samba server on Ubuntu ####
You can easily install Samba on you Ubuntu box. Before installing update your system so that you can install any available updates.
sudo apt-get update && apt-get upgrade
Now install Samba serer and few other required stuffs with the following command:
sudo apt-get install samba samba-common system-config-samba python-glade2 gksu
Once youve installed Samba server, its time to configure Samba from the graphical interface window to share files.
#### Configure Samba server on Ubuntu ####
Open Samba Configuration tool from the dash:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Setup-Samba.png)
Go to **Preference->Server Settings**. Although the default settings are good and may be same you need. But you may need to make change to it in some cases.
Now in Server Settings youve two tabs, Basic and Security. Under Basic tab youve the following options that mean:
- Workgroup This is the name of the Workgroup of the computer you want to connect to. For example, if you want to connect to a Windows computer so you will enter the workgroup name of Windows computer, and in Windows you already have the same workgroup name as is set by default in Samba Server Settings. But if you have a different workgroup name on Windows then you will enter that workgroup name in this field. (In Windows 7 to get the workgroup name, right-click Computer icon and go to Properties, there youll see Windows Workgroup name.)
- Description This is the name of your computer as seen by others. Dont use spaces or non-internet friendly characters.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-server-settings.png)
setting up samba serverAllowing Guests is not advisable so there is no reason to change security settings. Keep as it is.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Samba-Security-Settings-compressed.jpg)
Samba Security security settingsIt is all done! Youve setup Samba Server. We are not far from sharing our first folder on network.
#### Create a system user for network file sharing ####
We will now create a system user for sharing file on network. This is how simple it is.
- Go to **System Settings**.
- Under Systems Settings Click **User Accounts**.
- Click **unlock** to Enable + (**plus**) icon.
- Click + (plus) icon to create a new system user.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/create-system-user1.jpg)
Now as you can see the above image, you can enter Full name. As you enter Full name Username will be taken as Full name automatically. Because we are creating this user to share files so we will assign Account Type to **Standard**.
Done above steps? Click add. You have created a system user. The user is not yet activated so we will activate it by setting up password for this account. Make sure Users accounts panel is unlocked. Click Account disabled and type a new password, then confirm password and click Change.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/activate-system-user.jpg)
Yipee… Upto now we have installed and configured Samba and We have created a System user to share files on network from the account and we have activated our newly created account, too. Now We will move to Samba for the last step of configuring everything, then we will share a folder.
#### Add new Samba user ####
Open Samba and click Samba Users under Preference. Fill up the the simple dialogue. Here are couple of details about the fields:
**Unix Username** In this case I am selecting the user that I just created.
**Windows Username** You will enter this username when you are accessing from Windows Machine.
**Samba Password** You will enter this password when you are accessing from Windows Machine.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-user-setting.jpg)
Once youve done click OK. Now take a deep breath. You have successfully created a network with the help of Samba. Now restart the network or Samba services and ready to share files with other machines.
sudo restart smbd && sudo restart nmbd
#### Share folders or files over the network ####
To share files with Samba its simple with graphical user interface. Click the Plus icon in Samba and you will get dialogue like this:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/share-files-and-folders.jpg)
share files and folders over network with sambaComplete the fields. In Directory browse the folder you want to share. Here are the details about the fields you will see here:
- **Share name** is the name of the folder that other would see.
- **Description** is simply about the content you are sharing on network.
- **Writable** You shared folders are read only by default. You can set them to writable if you want others on network to change them.
- **Visible** As the name suggests when you click Visible, the shared folder will be visible to the people on network.
Now you can set permissions for the folder you are sharing. To do this click Access tab and check the users you want to share the folder with. When you select Allow access to everyone, the folder will be accessible to everyone on the network.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Screenshot-from-2015-02-28-202031.png)
Finally click OK to complete the sharing. Now the folder is shared with the people you want. You have completed sharing file on network. Is there everything left? Yes! How to remove the folders from the network?
#### Remove shared folders ####
We will also need to remove some of the folders after sometime from network. It is very simple and here is how we can do that.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/remove-shared-folder-from-network.jpg)
This is all done! We can also share files over network using terminal but that would not be as easy as this one. If you request for command line sharing then I will write a tutorial on how to share files over network with command line in Linux.
So, how do you find this tutorial to share files on local network in Ubuntu? I hope with this tutorial you can **easily share files between Ubuntu and Windows**. If you have questions or suggestions, feel free to ask it in the comment box below.
This tutorial was requested by Kalc. If you would like, you can [request your own tutorial][2]. We would be happy to help you out along with other readers facing the same issue.
--------------------------------------------------------------------------------
via: http://itsfoss.com/share-folders-local-network-ubuntu-windows/
作者:[Mohd Sohail][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/sohail/
[1]:http://en.wikipedia.org/wiki/Samba_%28software%29
[2]:http://itsfoss.com/request-tutorial/

View File

@ -1,174 +0,0 @@
How to Setup lftp - A Simple Command line FTP Program
================================================================================
Hi everyone, this article is about Lftp and how we can install Lftp in our Linux Operating System. [Lftp][1] is a command line based File Transfer Software also known as FTP Client which was developed by Alexander Lukyanov and was distributed as GNU General Public License. Besides FTP, it also supports FTPS, HTTP, HTTPS, HFTP, FISH, and SFTP. The program also supports FXP, allowing for data transfers between two FTP servers bypassing the client machine.
It has some awesome advanced features such as recursively mirroring entire directory trees and resuming downloads. Transfers can be scheduled for execution at a later time, bandwidth can be throttled, transfer queues can be created, and Unix shell-like job control is supported. The client can also be used interactively or automated with scripts.
### Installing Lftp ###
Before we try to run lftp, we have make sure that it is properly installed in our Linux Distribution. Here are some commands mentioned for installing lftp in the list common distribution of Linux.
**On Ubuntu 14.04 LTS**
In Ubuntu 14.04 LTS and its derivatives, we can install lftp using apt manager. So, to install it, we'll need to run the following commands in a shell or a terminal under sudo privilege.
$ sudo apt-get install lftp
![ubuntu install lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/ubuntu-install-lftp.png)
**On CentOS/Fedora/RHEL**
As lftp is also available in the repository of Fedora, CentOS and RHEL, we can use **yum** manager to install it.
$ sudo yum install lftp
![fedora lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/fedora-lftp.png)
**On Arch Linux**
It is also available in Arch Linux Package Repository so, we can simply use pacman to install it.
$ sudo pacman -S lftp
![archlinux install lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/archlinux-install-lftp.png)
**On OpenSuse**
Zypper, package management software for OpenSuse can be used to install lftp. Here is the command with which one can install it on their OpenSuse machine.
$ sudo zypper install lftp
![opensuse lftp install](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp_install.png)
### Logging in ###
To login to a ftp server or sftp server, we'll first need to know about the required credential for the login like username, password, ports.
After that, we'll want to login using lftp client as basic usage.
$ lftp ftp://linoxide@localhost
![ftp login](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login.png)
If we need to point a port to the login then, we'll need to add port as shown below.
$ lftp ftp://linoxide@localhost:21
![ftp login with ports](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login-port.png)
### Navigation ###
We can use **ls** to list files and directories, **cd** to enter into a directory.
![ls and cd](http://blog.linoxide.com/wp-content/uploads/2015/03/ls-cd-lftp.png)
### Uploading and Download Files ###
We can use **pget** for downloading files from the remote server.
> pget linspeed.svg
![pget lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/pget-lftp.png)
We can use **put** for uploading files to the remote server.
> put linoxide.tar
![upload with put](http://blog.linoxide.com/wp-content/uploads/2015/03/put-upload.png)
To resume partially downloaded files/directories, we will use the -c switch:
> mirror -c Directory
>pget -c linoxide.tar
> put -c upload.tar
### Using Mirror ###
We can use mirror to download the whole directory pointed as the source.
> mirror remote local
![download with mirror](http://blog.linoxide.com/wp-content/uploads/2015/03/mirror.png)
There is also reverse mirror (mirror -R) which uploads or updates a directory tree on server.
> mirror -R local remote
![upload or update with mirror reverse](http://blog.linoxide.com/wp-content/uploads/2015/03/mirror-reverse.png)
To resume partially downloaded files/directories, we will use the -c switch:
> mirror -c Directory
### To Queue Items to Download ###
We can use queue option with lftp so that we can download selected files in a queue one by one as there is an option in GUI based clients to select and download in a queue. Here's an example on it.
To prevent queue from auto transferring while you add to it :
> queue stop
Now, we'll add them into queue.
> queue mirror "directory"
> queue pget "file.tar"
After the queue has been added, we should run queue start command.
> queue start
To remove the entire queue run the following command.
> queue -d
### Segmented Downloading ###
Here, in this example we are segmenting files into 3 segments, one can change it according to their own need.
A pget command using segmentation is **pget -n 3 file.tar**, where 3 is the number of segments.
> pget -n 3 file.tar
A mirror command using segmentation is **mirror --use-pget-n=3 directory**, where 3 is the number of segments.
> mirror --use-pget-n=3 linxoxide
We can use jobs -v to see the speeds of the individual segments as well as the total speed.
### To Stop, Resume or Kill a Transfer ###
To cancel a transfer we can press Ctrl+c . And to resume a download we can use the -c (--continue) switch as shown below.
> mirror -c directory
And to kill an active transfer we should run **kill** and to kill and delete all we'll need to run **kill all** as shown below.
> kill
> kill all
### Exiting ###
To quit from lftp, we should run exit command in the terminal or inside lftp interface.
> exit
### Conclusion ###
Hurray! We have successfully installed lftp and learned some basic major ways to use it. lftp is an awesome command line ftp client which supports a lot of additional functionality and cool features. It has a lot stuffs more than the other common ftp client. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy lftp :-)
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-how-to/setup-lftp-command-line-ftp/
作者:[Arun Pyasi][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/arunp/
[1]:http://lftp.yar.ru/

View File

@ -1,167 +0,0 @@
10 Useful ls Command Interview Questions Part 2
================================================================================
Continuing the legacy of ls command here is the second interview article on Listing command. The first article of the series was highly appreciated by the Tecmint Community. If youve missed the first part of this series you may like to visit at:
- [15 Interview Questions on “ls” Command Part 1][1]
This article is well presented in the manner that it gives deep insight of ls command with examples. We have taken extra care in the making of article so that it remains simple to understand yet serve the purpose to the fullest.
![10 Interview Questions on ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Interview-Questions.jpg)
10 Interview Questions on ls Command
### 1. You are supposed to list the content of a directory in long list format, but not print the name of the author and group the file belongs. Also show the difference in output. ###
a. ls command listing the name of the files in long listing format when used with switch (-l).
# ls -l
![List Files in- Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-inLong-List-Format.gif)
List Files in- Long List Format
b. ls command listing the name of the files in long listing format along with the name of the author file belongs, when used with switch (author) along with switch (-l).
# ls -l --author
![List Files By Author](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-By-Author.gif)
List Files By Author
c. ls command listing the name of the files without the name of its owner, when used with switch (-g).
# ls -g
![List Files Without Printing Owner Name](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Author.gif)
List Files Without Printing Owner Name
d. ls command listing the name of files in long listing format without the name of group it belongs, when used with switch (-G) along with switch (-l).
# ls -Gl
![List Files Without Printing Group](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Group.gif)
List Files Without Printing Group
### 2. Print the size of files and folders in the current directory, in human readable format. How will you do this? ###
Well we need to use switch -h (human-readable) along with switch (-l) and/or (-s) with the command ls to get the desired output.
# ls -hl
![List Files in Human Readable Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Size-of-Files-with-ls.gif)
List Files in Human Readable Format
# ls -hs
![List File Sizes in Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-File-Sizes-in-Readable-Format.gif)
List File Sizes in Long List Format
**Note**: The option -h uses the power of 1024 (standard in computation) and output the size of files and folders in the units of K, M and G.
### 3. Well if switch (-h) output size in power of 1024, that is standard, What else power values are supported in ls command? ###
There exist a switch -si which is similar to switch -h. The only difference is switch -si uses power of 1000 unlike switch -h which uses the power of 1024.
# ls -si
![Supported Power Values of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-supported-power-values.gif)
Supported Power Values of ls Command
It can also be used with switch -l to output the size of folder in the power of 1000, in long listing format.
# ls -si -l
![List Files by Power Values](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-by-Power-Values.gif)
List Files by Power Values
### 4. You are supposed to print the contents of a directory separated with comma. Is it possible? Can it be done in long listing format? ###
Yup! Linux ls command can output the contents of a directory separated by comma when used with the switch (-m). Since this comma separated entries are filled horizontally, ls command cant separate contents with comma when listing contents vertically.
# ls -m
![Print Contents of Directory by Comma](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Contents-of-Directory-by-Comma.gif)
Print Contents of Directory by Comma
When used in long listing format, switch -m gets useless.
# ls -ml
![Listing Content Horizontally](http://www.tecmint.com/wp-content/uploads/2015/03/Listing-Content-Horizentally.gif)
Listing Content Horizontally
### 5. If there any way to print the contents of a directory upside down? i.e., in reverse order. ###
Yeah! The above situation can easily be achieved using the switch -r. The switch -r reverse the order of output. It can also be used with switch -l (long listing format).
# ls -r
![List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-in-Reverse-Order.gif)
List Content in Reverse Order
# ls -rl
![Long List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Content-in-Reverse-Order.gif)
Long List Content in Reverse Order
### 6. You are given a situation to print the sub-directories recursively. How will you achieve this situation? Mind it only sub directories and no files. ###
Okay! That is pretty easy with the switch -R when used with command ls. It can further be grouped with other options like -l (long list) and -m (comma separated), etc.
# ls -R
![Print Sub Directories in Recursively](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Sub-Directories-in-Recursively.gif)
Print Sub Directories in Recursively
### 7. How to sort the files based upon the size? ###
The Linux command line option -S when used with ls gives the desired output. To sort the files based upon size in descending order with the largest file listed at first and smallest at last.
# ls -S
![Sort Files with ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Linux.gif)
Sort Files with ls Command
To sort the files based upon size in descending order with the smallest file listed at first and largest at last.
# ls -Sr
![Sort Files in Descending Order](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Descending-Order.gif)
Sort Files in Descending Order
### 8. List the contents of a directory with no additional information appearing one file per line. ###
The switch -1 comes to rescue here. ls command with switch -1 output the contents of the directory with one file per line and no additional information.
# ls -1
![List Files Without Information](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Information.gif)
List Files Without Information
### 9. You are given a situation in which you have to print the contents of a directory on standard output enclosed by double quotes. How will you do this? ###
There exist an option -Q (quote-name) which output the content of ls enclosed in double quotes.
# ls -Q
![Print Files with Double Quotes](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Files-with-Double-Quotes.gif)
Print Files with Double Quotes
### 10. You are working in a directory which contains lots of files and folders. You need to print the name of folders before directories. How will you get this? ###
# ls --group-directories-first
![Print Directories First](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Directories-First.gif)
Print Directories First
Thats all for now. We will be coming up with the next part of this article series very soon. Till then stay tuned and connected to Tecmint. Do not forget to provide us with valuable feedback in the comment section below. Like and share us and help us get spread!
--------------------------------------------------------------------------------
via: http://www.tecmint.com/ls-interview-questions/
作者:[Ravi Saive][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:http://www.tecmint.com/ls-command-interview-questions/

View File

@ -1,187 +0,0 @@
15 Interview Questions on Linux “ls” Command Part 1
================================================================================
The listing command in UNIX and UNIX like operating System ls is one of the most basic and widely used utility in command-line. It is POSIX compliant utility available for GNU coreutils and BSD variants. The ls command can be used with a variety of options to get desired results. This article aims at deep insight of file listing command in Linux with relevant examples.
![15 ls Command Questions](http://www.tecmint.com/wp-content/uploads/2014/09/ls-Command-Questions.png)
15 ls Command Questions
### 1. How will you List files from a directory? ###
Ans: The Linux file listing command ls comes to rescue here.
# ls
![List Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-files.gif)
List Files
Alternatively, we can use echo command to list files within a directory in association with wildcard (*).
# echo *
![List All Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-files.gif)
List All Files
### 2. How will you list all the directories only using echo command? ###
# echo */
![List All Directories](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-directories.gif)
List All Directories
### 3. How will you list all the files within a directory including hidden files aka (.) dot files? ###
Ans: We need to use option -a (list hidden files) with command ls.
# ls -a
![List All Hidden Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-hidden-files.gif)
List All Hidden Files
### 4. How do you list all the files within a directory including hidden files, but do not list implied . and ..? ###
Ans: We need to use option -A (do not list implied . and ..) with command ls.
# ls -A
![Do Not List Implied](http://www.tecmint.com/wp-content/uploads/2014/09/Do-not-list-Implied.gif)
Do Not List Implied
### 5. How will you print the content of a directory in long format listing? ###
Ans: We need to use option l (long format) with command ls.
# ls -l
![List Files Long](http://www.tecmint.com/wp-content/uploads/2014/09/list-files-long.gif)
List Files Long
In the above example, the output seems like.
drwxr-xr-x 5 avi tecmint 4096 Sep 30 11:31 Binary
Here, drwxr-xr-x is file permission for owner, group and world. Owner has Read(r), Write(w) and Execute(x) permission. The group to which this file belongs has Read(r) and Execute(x) permission but not Write(w) permission, same permission implies for the world that have access to this file.
- The Initial d means its a Directory.
- Number 5 represents Symbolic Link.
- The File Binary belongs to user avi and group tecmint.
- Sep 30 11:31 represents the date and time it was last modified.
### 6. You are supposed to print the content of directory in long format listing, showing hidden/dot files. How will you achieve this? ###
Ans: We need to use option -a (list hidden files) and -l (long listing) together with command ls.
# ls -la
![Print Content of Directory](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Content-of-Directory.gif)
Print Content of Directory
Alternatively We can use option -A and -l with ls command, if we do not want to list implied . and ...
# ls -lA
### 7. How will you figure out the author of each file? ###
Ans: We need to use option author along with option -l to print the author name of each file.
# ls --author -l
![List Author Files](http://www.tecmint.com/wp-content/uploads/2014/09/List-Author-Files.gif)
List Author Files
### 8. How will you print escape for non-graphic character? ###
Ans: We just need to use option -b to print escape for non-graphic character.
# ls -b
![Print Escape Character](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Escape-Character.gif)
### 9. List the size of files and folders in desired scale format. How will you achieve this? ###
Ans: Here option block-size=scale along with option -l needs to be used. We need to remove scale in the example with the desired scale viz M, K, etc.
# ls --block-size=M -l
# ls --block-size=K -l
![List File Scale Format](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Scale-Format.gif)
List File Scale Format
### 10. List the files within a directory, but dont show the backup files, i.e., those files that end with ~. ###
Ans: Here option -B (do not list implied entries ending with ~) comes to rescue.
# ls -B
![List File Without Backup](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Without-Backup.gif)
List File Without Backup
### 11. Sort all the files within a directory by name and show associated last modification information. ###
Ans: We need to use option -c and option -l with command ls to fulfil the need as suggested above.
# ls -cl
![Sort Files](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files.gif)
Sort Files
### 12. Sort all the files within a directory by modification time and show associated information. ###
Ans: We need to use three options together i.e., -l, -t and -c with command ls to sort files by modification time, newest first.
# ls -ltc
![Sort Files by Modification](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files-by-Modification.gif)
Sort Files by Modification
### 13. How will you control the output of ls command to be colorful or no-color? ###
Ans: We need to use option color=parameter. The parameter to be used with color option are auto, always and never which are self explanatory.
# ls --color=never
# ls --color=auto
# ls --color=always
![ls Colorful Output](http://www.tecmint.com/wp-content/uploads/2014/09/ls-colorful-output.gif)
ls Colorful Output
### 14. You are supposed to list directory entries themselves, not their contents. What will you do? ###
Ans: Here the option -d comes handy.
# ls -d
![List Directory Entries](http://www.tecmint.com/wp-content/uploads/2014/09/List-Directory-Entries.gif)
List Directory Entries
### 15. Create an alias for long format listing “ls -l” as “ll” and output the result to a file and not standard output. ###
Ans: Here in the above scenario, we need to add alias to .bashrc file and then use redirect operator to write the output to file and not standard output. We will be using editor nano.
# ls -a
# nano .bashrc
# ll >> ll.txt
# nano ll.txt
![Create Alias for ls command](http://www.tecmint.com/wp-content/uploads/2014/09/Create-ls-Alias.gif)
Create Alias for ls command
Thats all for now. Dont forget to provide us with your valuable feedback in the comments below. Ill be here again with another interesting article soon. Till then stay tuned and connected.
### Real Also: ###
- [10 ls Command Interview Questions Part 2][1]
- [15 Basic ls Commands in Linux][2]
--------------------------------------------------------------------------------
via: http://www.tecmint.com/ls-command-interview-questions/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/ls-interview-questions/
[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/

View File

@ -1,81 +0,0 @@
List Of Free Windows SSH Client Tools To Connect To Your Linux Server
================================================================================
You have Windows as operating system and you need to connect to Linux server to transfer files from Linux to Windows and inversely. So you need to have Secure Shell known as SSH. In fact, SSH is a network protocol which enables you to connect to Linux and Unix servers over the network. It uses public key cryptography to authenticate the remote computer. You can use SSH by several ways, either by using it automatically or by using a password authentication to log in.
This article provides a list of SSH clients let you to connect SSH to your Linux servers.
lets start.
### PuTTY ###
**PuTTY** is the most famous SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.
![](https://www.unixmen.com/wp-content/uploads/2015/03/putty.png)
Putty is very easy to install and to use.You dont usually need to change most of the configuration options. To start the simplest kind of session, all you need to do is to enter a few basic parameters.You can download PuTTY [here][1]
### Bitvise SSH Client ###
**Bitvise SSH** Client is an SSH and SFTP client for Windows. It is developed and supported professionally by Bitvise. The SSH Client is robust, easy to install, easy to use. Bitvise SSH Client is a feature-rich graphical SSH/SFTP client for windows and allow you dynamic port forwarding through an integrated proxy with auto-reconnecting capability.
![](https://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png)
Bitvise SSH Client is **free for personal use**, as well as for individual commercial use inside organizations. You can [download Bitvise SSH Client here][2].
### MobaXterm ###
**MobaXterm** is your **ultimate toolbox for remote computing**. In a single Windows application, it provides loads of functions that are tailored for programmers, webmasters, IT administrators and pretty much all users who need to handle their remote jobs in a more simple fashion.
![](https://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png)
MobaXterm provides all the important **remote network tools** (SSH, X11, RDP, VNC, FTP, MOSH, …) and **Unix commands** (bash, ls, cat, sed, grep, awk, rsync, …) to Windows desktop, in a **single portable exe file** which works out of the box. MobaXterm is **free for personal use**. You can download MobaXterm [from here][3].
### DameWare SSH ###
I think that **DameWare SSH** is the best free ssh client.
![](https://www.unixmen.com/wp-content/uploads/2015/03/ssh.png)
This free tool is a terminal emulator that lets you make multiple telnet and SSH connections from one easy-to-use console.
- Manage multiple sessions from one console with a tabbed interface
- Save favorite sessions within the Windows file system
- Access multiple sets of saved credentials for easy log-in to different devices
- Connect to computers and devices using telnet, SSH1, and SSH2 protocols
You can download **DameWare SSH** from [this link][4].
### SmarTTY ###
SmarTTY is a free multi-tabbed SSH client that supports copying files and directories with SCP on-the-fly.
![](https://www.unixmen.com/wp-content/uploads/2015/03/smart.png)
Most SSH servers support up to 10 sub-sessions per connection. SmarTTY makes the best of it: no annoying multiple windows, no need to relogin, just open a new tab and go!
### Cygwin ###
Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
![](https://www.unixmen.com/wp-content/uploads/2015/03/cyq.png)
**Cygwin** consists of a Unix system call emulation library, cygwin1.dll, together with a [vast set][5] of GNU and other free software applications organized into a large number of optional packages. Among these packages are high-quality compilers and other software development tools, an X11 server, a complete X11 development toolkit, GNU emacs, TeX and LaTeX, OpenSSH (client and server), and much more, including everything needed to compile and use PhysioToolkit software under MS-Windows.
After reading our article, which is your favorite SSH client? You can leave a comment describing your favorite system and the reasons of your choice. And of course if there is another SSH client doesnt appear in this article, you can help us to add it.
--------------------------------------------------------------------------------
via: https://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/
作者:[anismaj][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://www.unixmen.com/author/anis/
[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
[2]:http://www.bitvise.com/download-area
[3]:http://mobaxterm.mobatek.net/download.html
[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM
[5]:http://cygwin.com/packages/

View File

@ -0,0 +1,115 @@
5 Interesting Command Line Tips and Tricks in Linux Part 1
================================================================================
Are you making most out of the Linux? There are lots of helpful features which appears to be Tips and Tricks for many of Linux Users. Sometimes Tips and Tricks become the need. It helps you get productive with the same set of commands yet with enhanced functionality.
![5 Command Line Tips and Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/5-Command-Line-Tips.jpg)
5 Command Line Tips and Tricks
Here we are starting a new series, where we will be writing some tips and tricks and will try to yield as more as we can in small time.
### 1. To audit the commands wed run in past, we use [history command][1]. Here is a sample output of history command. ###
# history
![history command example](http://www.tecmint.com/wp-content/uploads/2015/03/history-command.gif)
history command example
Obvious from output, the history command do not output the time stamp with the log of last executed commands. Any solution for this? Yeah! Run the below command.
# HISTTIMEFORMAT="%d/%m/%y %T "
# history
If you want to permanently append this change, add the below line to `~/.bashrc`.
export HISTTIMEFORMAT="%d/%m/%y %T "
and then, from terminal run,
# source ~/.bashrc
Explanation of commands and switches.
- history GNU History Library
- HISTIMEFORMAT Environmental Variable
- %d Day
- %m Month
- %y Year
- %T Time Stamp
- source in short send the contents of file to shell
- .bashrc is a shell script that BASH runs whenever it is started interactively.
![history Command Logs](http://www.tecmint.com/wp-content/uploads/2015/03/History-Command-Logs.gif)
history Command Logs
### 2. The next gem in the list is how to check disk write speed? Well one liner dd command script serves the purpose. ###
# dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img
![dd Command Example](http://www.tecmint.com/wp-content/uploads/2015/03/dd-Command-Example.gif)
dd Command Example
Explanation of commands and switches.
- dd Convert and Copy a file
- if=/dev/zero Read the file and not stdin
- of=/tmp/output.img Write to file and not stdout
- bs Read and Write maximum upto M bytes, at one time
- count Copy N input block
- conv Convert the file as per comma separated symbol list.
- rm Removes files and folder
- -rf (-r) removes directories and contents recursively and (-f) Force the removal without prompt.
### 3. How will you check the top six files that are eating out your space? A simple one liner script made from [du command][2], which is primarily used as file space usages. ###
# du -hsx * | sort -rh | head -6
![Check Disk Space Usage](http://www.tecmint.com/wp-content/uploads/2015/03/check-disk-space-usage.gif)
Check Disk Space Usage
Explanation of commands and switches.
- du Estimate file space usages
- -hsx (-h) Human Readable Format, (-s) Summaries Output, (-x) One File Format, skip directories on other file format.
- sort Sort text file lines
- -rf (-r) Reverse the result of comparison, (-f) Ignore case
- head output first n lines of file.
### 4. The next step involves statistics in terminal of a file of every kind. We can output the statistics related to a file with the help of stat (output file/fileSystem status) command. ###
# stat filename_ext (viz., stat abc.pdf)
![Check File Statistics](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Statistics.gif)
Check File Statistics
### 5. The next and last but not the least, this one line script is for those, who are newbies. If you are an experienced user you probably dont need it, unless you want some fun out of it. Well newbies are Linux-command-line phobic and the below one liner will generate random man pages. The benefit is as a newbie you always get something to learn and never get bored. ###
# man $(ls /bin | shuf | head -1)
![Generate Random Man Pages](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif)
Generate Random Man Pages
Explanation of commands and switches.
- man Linux Man pages
- ls Linux Listing Commands
- /bin System Binary file Location
- shuf Generate Random Permutation
- head Output first n line of file.
Thats all for now. If you know any such tips and tricks you may share with us and we will post the same in your words on our reputed Tecmint.com website.
If you want to share any tips and tricks that you cannot make into article you may share it at tecmint[dot]com[at]gmail[dot]com and we will include it in our article. Dont forget to provide us with your valuable feedback in the comments below. Keep connected. Like and share us and help us get spread.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/5-linux-command-line-tricks/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/history-command-examples/
[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/

View File

@ -0,0 +1,132 @@
How to Test Your Internet Speed Bidirectionally from Command Line Using Speedtest-CLI Tool
================================================================================
We always need to check the speed of the Internet connection at home and office. What we do for this? Go to websites like Speedtest.net and begin test. It loads JavaScript in the web browser and then select best server based upon ping and output the result. It also uses a Flash player to produce graphical results.
What about headless server, where isnt any web based browser and the main point is, most of the servers are headless. The another bottleneck of such web browser based speed testing is that, you cant schedule the speed testing at regular interval. Here comes an application “Speedtest-cli” that removes such bottlenecks and let you test the speed of Internet connection from command line.
#### What is Speedtest-cli ####
The application is basically a script developed in Python programming Language. It measures Internet Bandwidth speed bidirectionally. It used speedtest.net infrastructure to measure the speed. Speedtest-cli is able to list server based upon physical distance, test against specific server, and gives you URL to share the result of your internet speed test.
To install latest speedtest-cli tool in Linux systems, you must have Python 2.4-3.4 or higher version installed on the system.
### Install speedtest-cli in Linux ###
There are two ways to install speedtest-cli tool. The first method involves the use of `python-pip` package while the second method is to download the Python script, make it executable and run, here I will cover both ways….
#### Install speedtest-cli Using pythin-pip ####
First you need to install `python-pip` package, then afterwards you can install the speedtest-cli tool using pip command as shown below.
$ sudo apt-get install python-pip
$ sudo pip install speedtest-cli
To upgrade speedtest-cli, at later stage, use.
$ sudo pip install speedtest-cli --upgrade
#### Install speedtest-cli Using Python Script ####
First download the python script from github using wget command, unpack the downloaded file (master.zip) and extract it..
$ wget https://github.com/sivel/speedtest-cli/archive/master.zip
$ unzip master.zip
After extracting the file, go to the extracted directory `speedtest-cli-master` and make the script file executable.
$ cd speedtest-cli-master/
$ chmod 755 speedtest_cli.py
Next, move the executable to `/usr/bin` folder, so that you dont need to type the full path everytime.
$ sudo mv speedtest_cli.py /usr/bin/
### Testing Internet Connection Speed with speedtest-cli ###
**1. To test Download and Upload speed of your internet connection, run the `speedtest-cli` command without any argument as shown below.**
$ speedtest_cli.py
![Test Download Upload Speed in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Download-Upload-Speed-in-Linux1.png)
Test Download Upload Speed in Linux
**2. To check the speed result in bytes in place of bits.**
$ speedtest_cli.py --bytes
![Test Internet Speed in Bytes](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Speed-in-Bytes.png)
Test Internet Speed in Bytes
**3. Share your bandwidth speed with your friends or family. You are provided with a link that can be used to download an image.**
![Share Internet Speed Results](http://www.tecmint.com/wp-content/uploads/2015/03/Share-Internet-Speed-Results.png)
Share Internet Speed Results
The following picture is a sample speed test result generated using above command.
![Speed Test Results](http://www.tecmint.com/wp-content/uploads/2015/03/Speed-Test-Results.png)
Speed Test Results
**4. Dont need any additional information other than Ping, Download and upload?**
$ speedtest_cli.py --simple
![Test Ping Download Upload Speed](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Ping-Download-Upload-Speed1.png)
Test Ping Download Upload Speed
**5. List the `speedtest.net` server based upon physical distance. The distance in km is mentioned.**
$ speedtest_cli.py --list
![Check Speedtest.net Servers](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Speedtest-Servers.png)
Check Speedtest.net Servers
**6. The last stage generated a huge list of servers sorted on the basis of distance. How to get desired output? Say I only want to see the speedtest.net server located in Mumbai (India).**
$ speedtest_cli.py --list | grep -i Mumbai
![Check Nearest Server](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Nearest-Server.png)
Check Nearest Server
**7. Test connection speed against a specific server. Use Server Id generated in example 5 and example 6 in above.**
$ speedtest_cli.py --server [server ID]
$ speedtest_cli.py --server [5060] ## Here server ID 5060 is used in the example.
![Test Connection Against Server](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Connection-Against-Server.png)
Test Connection Against Server
**8. To check the version number and help of `speedtest-cli` tool.**
$ speedtest_cli.py --version
![Check SpeedCli Version](http://www.tecmint.com/wp-content/uploads/2015/03/Check-SpeedCLi-Version.png)
Check SpeedCli Version
$ speedtest_cli.py --help
![SpeedCli Help](http://www.tecmint.com/wp-content/uploads/2015/03/SpeedCli-Help.png)
SpeedCli Help
**Note:** Latency reported by tool is not its goal and one should not rely on it. The relative latency values output is responsible for server selected to be tested against. CPU and Memory capacity will influence the result to certain extent.
### Conclusion ###
The tool is must for system administrators and developers. A simple script which runs without any issue. I must say that the application is wonderful, lightweight and do what it promises. I disliked Speedtest.net for the reason it was using flash, but speedtest-cli gave me a reason to love them.
speedtest_cli is a third party application and should not be used to automatically record the bandwidth speed. Speedtest.net is used by millions of users and it is a good idea to [Set Your Own Speedtest Mini Server][1].
Thats all for now, till then stay tuned and connected to Tecmint. Dont forget to give your valuable feedback in the comments below. Like and share us and help us get spread.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/speedtest-mini-server-to-test-bandwidth-speed/

View File

@ -0,0 +1,103 @@
How to access Gmail from the command line on Linux with Alpine
================================================================================
If you are a command-line lover, I am sure that you welcome with open arms any tool that allows you to perform at least one of your daily tasks using that powerful work environment, e.g., from [scheduling appointments][1] and [managing finances][2] to accessing [Facebook][3] and [Twitter][4].
In this post I will show you yet another pretty neat use case of Linux command-line: **accessing Google's Gmail service**. To do so, we are going to use Alpine, a versatile ncurses-based, command-line email client (not to be confused with Alpine Linux). We will configure Gmail's IMAP and SMTP settings in Alpine to receive and send email messages via Google mail servers in a terminal environment. At the end of this tutorial, you will realize that it will only take a few minimum steps to use any other mail servers in Alpine.
Granted there are already outstanding GUI-based email clients such as Thunderbird, Evolution or even web interface. So why would anyone be interested in using a command-line email client to access Gmail? The answer is simple. You need to get something done quickly and want to avoid using system resources unnecessarily. Or you are accessing a minimal headless server that does not have the X server installed. Or the X server on your desktop crashed, and you need to send emails urgently before fixing it. In all these situations Alpine can come in handy and get you going in no time.
Beyond simple editing, sending and receiving of text-based email messages, Alpine is able to encrypt, decrypt, and digitally sign email messages, and integrate seamlessly with TLS.
### Installing Alpine on Linux ###
In Red Hat-based distributions, install Alpine as follows. Note that on RHEL/CentOS, you need to enable [EPEL repository][5] first.
# yum install alpine
In Debian, Ubuntu or their derivatives, you will do:
# aptitude install alpine
After the installation is complete, you can launch the email client by running:
# alpine
The first time you run alpine, it will create a mail directory for the current user inside his/her home directory (~/mail), and bring up the main interface, as shown in the following screencast.
youtube视频发布的时候做个链接吧
<iframe width="615" height="346" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/kuKiv3uze4U?feature=oembed"></iframe>
The user interface has the following sections:
![](https://farm9.staticflickr.com/8724/16618079590_6c236ce2c2_c.jpg)
Feel free to browse around a bit in order to become acquainted with Alpine. You can always return to the command prompt by hitting the 'Q' key any time. Note that all screens have context-related help available at the bottom of the screen.
Before proceeding further, we will create a default configuration file for Alpine. In order to do so, quit Alpine, and execute the following command from the command line:
# alpine -conf > /etc/pine.conf
### Configuring Alpine to Use a Gmail Account ###
Once you have installed Alpine and spent at least a few minutes to feel comfortable with its interface and menus, it's time to actually configure it to use an existing Gmail account.
Before following these steps in Alpine, remember to enable IMAP in your Gmail settings from the webmail interface. Once IMAP access is enabled in your Gmail account, proceed to the following steps to enable reading Gmail messages on Alpine.
First, launch Alpine.
Press 'S' for Setup, and then 'L' for collection lists to define groups of folders to help you better organize your mail:
![](https://farm8.staticflickr.com/7614/16779579656_690eda419c_o.png)
Add a new folder by pressing 'A' and fill the required information:
- **Nickname**: whatever name of your choice.
- **Server**: imap.gmail.com/ssl/user=yourgmailusername@gmail.com
You may leave Path and View blank.
Then press Ctrl+X and enter your password when prompted:
![](https://farm9.staticflickr.com/8611/16618079640_6f7dca336a_b.jpg)
If everything goes as expected, there should be a new folder named after the nickname that you chose earlier. You should find your Gmail mailboxes there:
![](https://farm8.staticflickr.com/7598/16804355052_10c1a6c5bd_b.jpg)
For verification, you can compare the contents of your Alpine's "Gmail Sent" mailbox with those of the web client:
![](https://farm8.staticflickr.com/7602/16619323939_d2eab3e162_c.jpg)
By default new mail checking/notification occurs automatically every 150 seconds. You can change this value, along with many others, in the /etc/pine.conf file. This configuration file is heavily commented for clarity. To set the desired mail check interval to 10 seconds, for example, you will need to do:
# The approximate number of seconds between checks for new mail
mail-check-interval=10
Finally, we need to configure an SMTP server to send email messages via Alpine. Go back to the Alpine's setup screen as explained earlier, and press 'C' to set the address of a Google's SMTP server. You will need to edit the value of the SMTP Server (for sending) line as follows:
smtp.gmail.com:587/tls/user=yourgmailusername@gmail.com
You will be prompted to save changes when you press 'E' to exit setup. Once you save the changes, you are on your way to sending emails through Alpine! To do that, just go to Compose in the main menu, and start enjoying your Gmail account from the command line.
### Conclusion ###
In this post we have discussed how to access Gmail in a terminal environment via a lightweight and powerful command-line email client called Alpine. Alpine is free software released under the Apache Software License 2.0, which is a software license compatible with the GPL. Alpine takes pride in being friendly for new users, yet powerful for seasoned system administrators at the same time. I hope that after reading this article you have come to realize how true that last statement is.
Feel free to leave your comments or questions using the form below. I look forward to hearing from you!
--------------------------------------------------------------------------------
via: http://xmodulo.com/gmail-command-line-linux-alpine.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/schedule-appointments-todo-tasks-linux-terminal.html
[2]:http://xmodulo.com/manage-personal-expenses-command-line.html
[3]:http://xmodulo.com/access-facebook-command-line-linux.html
[4]:http://xmodulo.com/access-twitter-command-line-linux.html
[5]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html

View File

@ -0,0 +1,151 @@
zpl1025
Systemd Boot Process a Close Look in Linux
================================================================================
The way Linux system boots up is quite complex and there have always been need to optimize the way it works. The traditional boot up process of Linux system is mainly handled by the well know init process (also known as SysV init boot system), while there have been identified inefficiencies in the init based boot system, systemd on the other hand is another boot up manager for Linux based systems which claims to overcome the shortcomings of [traditional Linux SysV init][2] based system. We will be focusing our discussion on the features and controversies of systemd , but in order to understand it, lets see how Linux boot process is handled by traditional SysV init based system. Kindly note that Systemd is still in testing phase and future releases of Linux operating systems are preparing to replace their current boot process with Systemd Boot manager.
### Understanding Linux Boot Process ###
Init is the very first process that starts when we power on our Linux system. Init process is assigned the PID of 1. It is parent process for all other processes on the system. When a Linux computer is started, the processor searches for the BIOS on the system memory, BIOS then tests system resources and find the first boot device, usually set as hard disk, it looks for Master Boot Record (MBR) on the hard disk, loads its contents to memory and passes control to it, the further boot process is controlled by MBR.
Master Boot Record initiates the Boot loader (Linux has two well know boot loaders, GRUB and LILO, 80% of Linux systems are using GRUB loaders), this is the time when GRUB or LILO loads the kernel module. Kernel module immediately looks for the “init” in /sbin partition and executes it. Thats from where init becomes the parent process of Linux system. The very first file read by init is /etc/inittab , from here init decides the run level of our Linux operating system. It finds partition table information from /etc/fstab file and mounts partitions accordingly. Init then launches all the services/scripts specified in the /etc/init.d directory of the default run level. This is the step where all services are initialized by init one by one. In this process, one service at a time is started by init , all services/daemons run in the background and init keeps managing them.
The shutdown process works in pretty much the reverse function, first of all init stops all services and then filesystem is un-mounted at the last stage.
The above mentioned process has some shortcomings. The need to replace traditional init with something better have been felt from long time now. Some replacements have been developed and implemented as well. The well know replacements for this init based system as Upstart , Epoch , Mudar and Systemd. Systemd is the one which got most attention and is considered to be better of all available alternatives.
### Understanding Systemd ###
Reducing the boot time and computational overhead is the main objective of developing the Systemd. Systemd (System Manager Daemon) , originally developed under GNU General Public License, is now under GNU Lesser General Public License, it is most frequently discussed boot and services manager these days. If your Linux system is configured to use Systemd boot manager, then instead of traditional SysV init, startup process will be handled by systemd. One of the core feature of Systemd is that it supports post boot scripts of SysV Init as well .
Systemd introduces the parallelization boot concept, it creates a sockets for each daemon that needs to be started, these sockets are abstracted from the processes that use them so they allow daemons to interact with each other. Systemd creates news processes and assigns every process a control group. The processes in different control groups use kernel to communicate with each others. The way [systemd handles the start up process][2] is quite neat, and much optimized as compared to the traditional init based system. Lets review some of the core features of Systemd.
- The boot process is much simpler as compared to the init
- Systemd provides concurrent and parallel process of system boot so it ensures better boot speed
- Processes are tracked using control groups, not by PIDs
- Improved ways to handle boot and services dependencies.
- Capability of system snapshots and restore
- Monitoring of started services ; also capabale of restarting any crashed services
- Includes systemd-login module to control user logins.
- Ability to add and remove components
- Low memory foot prints and ability for job scheduling
- Journald module for event logging and syslogd module for system log.
Systemd handles system shutdown process in well organized way as well. It has three script located inside /usr/lib/systemd/ directory, named systemd-halt.service , systemd-poweroff.service , systemd-reboot.service . These scripts are executed when user choose to shutdown, reboot or halt Linux system. In the event of shutdown, systemd first un-mount all file systems and disabled all swap devices, detaches the storage devices and kills remaining processes.
![](http://images.linoxide.com/systemd-boot-process.jpg)
### Structural Overview of Systemd ###
Lets review Linux system boot process with some structural details when it is using systemd as boot and services manager. For the sake of simplicity, we are listing the process in steps below:
**1.** The very first steps when you power on your system is the BIOS initialization. BIOS reads the boot device settings, locates and hands over control to MBR (assuming hard disk is set as first boot device).
**2.** MBR reads information from Grub or LILO boot loader and initializes the kernel. Grub or LILO will specify how to handle further system boot up. If you have specified systemd as boot manager in grub configuration file, then the further boot process will be handled by systemd. Systemd handles boot and services management process using “targets”. The ”target" files in systemd are used for grouping different boot units and start up synchronization processes.
**3.** The very first target executed by systemd is **default.target**. But default.target is actually a symlink to **graphical.target**. Symlink in linux works just like shortcuts in Windows. Graphical.target file is located at /usr/lib/systemd/system/graphical.target path. We have shown the contents of graphical.target file in the following screenshot.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/graphical1.png)
**4.** At this stage, **multi-user.target** has been invoked and this target keeps its further sub-units inside “/etc/systemd/system/multi-user.target.wants” directory. This target sets the environment for multi user support. None root users are enabled at this stage of boot up process. Firewall related services are started on this stage of boot as well.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/multi-user-target1.png)
"multi-user.target" passes control to another layer “**basic.target**”.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/Basic-Target.png)
**5.** "basic.target" unit is the one that starts usual services specially graphical manager service. It uses /etc/systemd/system/basic.target.wants directory to decide which services need to be started, basic.target passes on control to **sysinit.target**.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/Sysint-Target.png)
**6.** "sysinit.target" starts important system services like file System mounting, swap spaces and devices, kernel additional options etc. sysinit.target passes on startup process to **local-fs.target**. The contents of this target unit are shown in the following screenshot.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/local-FS-Target.png)
**7.** local-fs.target , no user related services are started by this target unit, it handles core low level services only. This target is the one performing actions on the basis of /etc/fstab and /etc/inittab files.
### Analyzing System Boot Performancev ###
Systemd offers tool to identify and troubleshoot boot related issues or performance concerns. **Systemd-analyze** is a built-in command which lets you examine boot process. You can find out the units which are facing errors during boot up and can further trace and correct boot component issues. Some useful systemd-analyze commands are listed below.
**systemd-analyze time** shows the time spent in kernel, and normal user space.
$ systemd-analyze time
Startup finished in 1440ms (kernel) + 3444ms (userspace)
**systemd-analyze blame** prints a list of all running units, sorted by the time taken by then to initialize, in this way you can have idea of which services are taking long time to start during boot up.
$ systemd-analyze blame
2001ms mysqld.service
234ms httpd.service
191ms vmms.service
**systemd-analyze verify** shows if there are any syntax errors in the system units. **Systemd-analyze plot** can be used to write down whole startup process to a SVG formate file. Whole boot process is very lengthy to read, so using this command we can dump the output of whole boot processing into a file and then can read and analyze it further. The following command will take care of this.
systemd-analyze plot > boot.svg
### Systemd Controversies ###
Systemd has not been lucky to receive love from everyone, some professionals and administrators have different opinions on its working and developments. Per critics of Systemd, its “not Unix-like” because it tried to replace some system services. Some professionals dont like the idea of using binary configuration files as well. It is said that editing systemd configuration is not an easy tasks and there are no graphical tools available for this purpose.
### Test Systemd on Ubuntu 14.04 and 12.04 ###
Originally, Ubuntu decided to replace their current boot process with Systemd in Ubuntu 16.04 LTS. Ubuntu 16.04 is supposed to be released in April 2016, but considering the popularity and demand for Systemd, the upcoming **Ubuntu 15.04** will have it as its default boot manager. Good news is that the user of Ubuntu 14.04 Trusty Tahr And Ubuntu 12.04 Precise Pangolin can still test Systemd on their machines. The test process is not very complex, all you need to do is to include the related PPA to the system, update repository and perform system upgrade.
**Disclaimer** : Please note that its still in testing and development stages for Ubuntu. Testing packages might have any unknown issues and in worst case scenario, they might break your system configurations. Make sure you backup your important data before trying this upgrade.
Run following command on the terminal to add ppa to the your ubuntu system:
sudo add-apt-repository ppa:pitti/systemd
You will be seeing warning message here because we are trying to use temporary/testing PPA which is not recommended for production machines.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/PPA-Systemd1.png)
Now update the APT Package Manager repositories by running the following command.
sudo apt-get update
![](http://blog.linoxide.com/wp-content/uploads/2015/03/Update-APT1.png)
Perform system upgrade by running the following command.
sudo apt-get dist-upgrade
![](http://blog.linoxide.com/wp-content/uploads/2015/03/System-Upgrade.png)
Thats all, you should be able to see configuration files of systemd on your ubuntu system now, just browse to the /lib/systemd/ directory and see the files there.
Alright, its time we edit grub configuration file and specify systemd as default Boot Manager. Edit grub file using Gedit text editor.
sudo gedit /etc/default/grub
![](http://blog.linoxide.com/wp-content/uploads/2015/03/Edit-Grub.png)
Here edit GRUB_CMDLINE_LINUX_DEFAULT parameter in this file and specify the value of this parameter as: "**init=/lib/systemd/systemd**"
![](http://blog.linoxide.com/wp-content/uploads/2015/03/Grub-Systemd.png)
Thats all, your ubuntu system is no longer using its traditional boot manager, its using Systemd Manager now. Reboot your system and see the systemd boot up process.
![](http://blog.linoxide.com/wp-content/uploads/2015/03/Sytemd-Boot.png)
### Conclusion ###
Systemd is no doubt a step forward towards improving Linux Boot process; its an awesome suite of libraries and daemons that together improve the system boot and shutdown process. Many linux distributions are preparing to support it as their official boot manager. In future releases of Linux distros, we can hope to see systemd startup. But on the other hand, in order to succeed and to be adopted on the wide scale, systemd should address the concerns of critics as well.
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-how-to/systemd-boot-process/
作者:[Aun Raza][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/arunrz/
[1]:http://linoxide.com/booting/boot-process-of-linux-in-detail/
[2]:http://0pointer.de/blog/projects/self-documented-boot.html

View File

@ -0,0 +1,266 @@
11 Linux Terminal Commands That Will Rock Your World
================================================================================
I have been using Linux for about 10 years and what I am going to show you in this article is a list of Linux commands, tools and clever little tricks that I wish somebody had shown me from the outset instead of stumbling upon them as I went along.
![Linux Keyboard Shortcuts.](http://f.tqn.com/y/linux/1/L/m/J/1/keyboardshortcuts.png)
Linux Keyboard Shortcuts.
### 1. Useful Command Line Keyboard Shortcuts ###
The following keyboard shortcuts are incredibly useful and will save you loads of time:
- CTRL + U - Cuts text up until the cursor.
- CTRL + K - Cuts text from the cursor until the end of the line
- CTRL + Y - Pastes text
- CTRL + E - Move cursor to end of line
- CTRL + A - Move cursor to the beginning of the line
- ALT + F - Jump forward to next space
- ALT + B - Skip back to previous space
- ALT + Backspace - Delete previous word
- CTRL + W - Cut word behind cursor
- Shift + Insert - Pastes text into terminal
Just so that the commands above make sense look at the next line of text.
sudo apt-get intall programname
As you can see I have a spelling error and for the command to work I would need to change "intall" to "install".
Imagine the cursor is at the end of the line. There are various ways to get back to the word install to change it.
I could press ALT + B twice which would put the cursor in the following position (denoted by the ^ symbol):
sudo apt-get^intall programname
Now you could press the cursor key and insert the ''s' into install.
Another useful command is "shift + insert" especially If you need to copy text from a browser into the terminal.
![](http://f.tqn.com/y/linux/1/L/n/J/1/sudotricks2.png)
### 2. SUDO !! ###
You are going to really thank me for the next command if you don't already know it because until you know this exists you curse yourself every time you enter a command and the words "permission denied" appear.
- sudo !!
How do you use sudo !!? Simply. Imagine you have entered the following command:
apt-get install ranger
The words "Permission denied" will appear unless you are logged in with elevated privileges.
sudo !! runs the previous command as sudo. So the previous command now becomes:
sudo apt-get install ranger
If you don't know what sudo is [start here][1].
![Pause Terminal Applications.](http://f.tqn.com/y/linux/1/L/o/J/1/pauseapps.png)
Pause Terminal Applications.
### 3. Pausing Commands And Running Commands In The Background ###
I have already written a guide showing how to run terminal commands in the background.
- CTRL + Z - Pauses an application
- fg - Returns you to the application
So what is this tip about?
Imagine you have opened a file in nano as follows:
sudo nano abc.txt
Halfway through typing text into the file you realise that you quickly want to type another command into the terminal but you can't because you opened nano in foreground mode.
You may think your only option is to save the file, exit nano, run the command and then re-open nano.
All you have to do is press CTRL + Z and the foreground application will pause and you will be returned to the command line. You can then run any command you like and when you have finished return to your previously paused session by entering "fg" into the terminal window and pressing return.
An interesting thing to try out is to open a file in nano, enter some text and pause the session. Now open another file in nano, enter some text and pause the session. If you now enter "fg" you return to the second file you opened in nano. If you exit nano and enter "fg" again you return to the first file you opened within nano.
![nohup.](http://f.tqn.com/y/linux/1/L/p/J/1/nohup3.png)
nohup.
### 4. Use nohup To Run Commands After You Log Out Of An SSH Session ###
The [nohup command][2] is really useful if you use the ssh command to log onto other machines.
So what does nohup do?
Imagine you are logged on to another computer remotely using ssh and you want to run a command that takes a long time and then exit the ssh session but leave the command running even though you are no longer connected then nohup lets you do just that.
For instance I use my [Raspberry PI][3] to download distributions for review purposes.
I never have my Raspberry PI connected to a display nor do I have a keyboard and mouse connected to it.
I always connect to the Raspberry PI via [ssh][4] from a laptop. If I started downloading a large file on the Raspberry PI without using the nohup command then I would have to wait for the download to finish before logging off the ssh session and before shutting down the laptop. If I did this then I may as well have not used the Raspberry PI to download the file at all.
To use nohup all I have to type is nohup followed by the command as follows:
nohup wget http://mirror.is.co.za/mirrors/linuxmint.com/iso//stable/17.1/linuxmint-17.1-cinnamon-64bit.iso &
![Schedule tasks with at.](http://f.tqn.com/y/linux/1/L/q/J/1/at.png)
Schedule tasks with at.
### 5. Running A Linux Command 'AT' A Specific Time ###
The 'nohup' command is good if you are connected to an SSH server and you want the command to remain running after logging out of the SSH session.
Imagine you want to run that same command at a specific point in time.
The 'at' command allows you to do just that. 'at' can be used as follows.
at 10:38 PM Fri
at> cowsay 'hello'
at> CTRL + D
The above command will run the program [cowsay][5] at 10:38 PM on Friday evening.
The syntax is 'at' followed by the date and time to run.
When the at> prompt appears enter the command you want to run at the specified time.
The CTRL + D returns you to the cursor.
There are lots of different date and time formats and it is worth checking the man pages for more ways to use 'at'.
![](http://f.tqn.com/y/linux/1/L/l/J/1/manmost.png)
### 6. Man Pages ###
Man pages give you an outline of what commands are supposed to do and the switches that can be used with them.
The man pages are kind of dull on their own. (I guess they weren't designed to excite us).
You can however do things to make your usage of man more appealing.
export PAGER=most
You will need to install 'most; for this to work but when you do it makes your man pages more colourful.
You can limit the width of the man page to a certain number of columns using the following command:
export MANWIDTH=80
Finally, if you have a browser available you can open any man page in the default browser by using the -H switch as follows:
man -H <command>
Note this only works if you have a default browser set up within the $BROWSER environment variable.
![View Processes With htop.](http://f.tqn.com/y/linux/1/L/r/J/1/nohup2.png)
View Processes With htop.
### 7. Use htop To View And Manage Processes ###
Which command do you currently use to find out which processes are running on your computer? My bet is that you are using '[ps][6]' and that you are using various switches to get the output you desire.
Install '[htop][7]'. It is definitely a tool you will wish that you installed earlier.
htop provides a list of all running processes in the terminal much like the file manager in Windows.
You can use a mixture of function keys to change the sort order and the columns that are displayed. You can also kill processes from within htop.
To run htop simply type the following into the terminal window:
htop
![Command Line File Manager - Ranger.](http://f.tqn.com/y/linux/1/L/s/J/1/ranger.png)
Command Line File Manager - Ranger.
### 8. Navigate The File System Using ranger ###
If htop is immensely useful for controlling the processes running via the command line then [ranger][8] is immensely useful for navigating the file system using the command line.
You will probably need to install ranger to be able to use it but once installed you can run it simply by typing the following into the terminal:
ranger
The command line window will be much like any other file manager but it works left to right rather than top to bottom meaning that if you use the left arrow key you work your way up the folder structure and the right arrow key works down the folder structure.
It is worth reading the man pages before using ranger so that you can get used to all keyboard switches that are available.
![Cancel Linux Shutdown.](http://f.tqn.com/y/linux/1/L/t/J/1/shutdown.png)
Cancel Linux Shutdown.
### 9. Cancel A Shutdown ###
So you started the [shutdown][9] either via the command line or from the GUI and you realised that you really didn't want to do that.
shutdown -c
Note that if the shutdown has already started then it may be too late to stop the shutdown.
Another command to try is as follows:
- [pkill][10] shutdown
![Kill Hung Processes With XKill.](http://f.tqn.com/y/linux/1/L/u/J/1/killhungprocesses.png)
Kill Hung Processes With XKill.
### 10. Killing Hung Processes The Easy Way ###
Imagine you are running an application and for whatever reason it hangs.
You could use 'ps -ef' to find the process and then kill the process or you could use 'htop'.
There is a quicker and easier command that you will love called [xkill][11].
Simply type the following into a terminal and then click on the window of the application you want to kill.
xkill
What happens though if the whole system is hanging?
Hold down the 'alt' and 'sysrq' keys on your keyboard and whilst they are held down type the following slowly:
- [REISUB][12]
This will restart your computer without having to hold in the power button.
![youtube-dl.](http://f.tqn.com/y/linux/1/L/v/J/1/youtubedl2.png)
youtube-dl.
### 11. Download Youtube Videos ###
Generally speaking most of us are quite happy for Youtube to host the videos and we watch them by streaming them through our chosen media player.
If you know you are going to be offline for a while (i.e. due to a plane journey or travelling between the south of Scotland and the north of England) then you may wish to download a few videos onto a pen drive and watch them at your leisure.
All you have to do is install youtube-dl from your package manager.
You can use youtube-dl as follows:
youtube-dl url-to-video
You can get the url to any video on Youtube by clicking the share link on the video's page. Simply copy the link and paste it into the command line (using the shift + insert shortcut).
### Summary ###
I hope that you found this list useful and that you are thinking "i didn't know you could do that" for at least 1 of the 11 items listed.
--------------------------------------------------------------------------------
via: http://linux.about.com/od/commands/tp/11-Linux-Terminal-Commands-That-Will-Rock-Your-World.htm
作者:[Gary Newell][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linux.about.com/bio/Gary-Newell-132058.htm
[1]:http://linux.about.com/cs/linux101/g/sudo.htm
[2]:http://linux.about.com/library/cmd/blcmdl1_nohup.htm
[3]:http://linux.about.com/od/mobiledevicesother/a/Raspberry-Pi-Computer-Running-Linux.htm
[4]:http://linux.about.com/od/commands/l/blcmdl1_ssh.htm
[5]:http://linux.about.com/cs/linux101/g/cowsay.htm
[6]:http://linux.about.com/od/commands/l/blcmdl1_ps.htm
[7]:http://www.linux.com/community/blogs/133-general-linux/745323-5-commands-to-check-memory-usage-on-linux
[8]:http://ranger.nongnu.org/
[9]:http://linux.about.com/od/commands/l/blcmdl8_shutdow.htm
[10]:http://linux.about.com/library/cmd/blcmdl1_pkill.htm
[11]:http://linux.about.com/od/funnymanpages/a/funman_xkill.htm
[12]:http://blog.kember.net/articles/reisub-the-gentle-linux-restart/

View File

@ -0,0 +1,268 @@
How to Manage and Use LVM (Logical Volume Management) in Ubuntu
================================================================================
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png)
In our [previous article we told you what LVM is and what you may want to use it for][1], and today we are going to walk you through some of the key management tools of LVM so you will be confident when setting up or expanding your installation.
As stated before, LVM is a abstraction layer between your operating system and physical hard drives. What that means is your physical hard drives and partitions are no longer tied to the hard drives and partitions they reside on. Rather, the hard drives and partitions that your operating system sees can be any number of separate hard drives pooled together or in a software RAID.
To manage LVM there are GUI tools available but to really understand what is happening with your LVM configuration it is probably best to know what the command line tools are. This will be especially useful if you are managing LVM on a server or distribution that does not offer GUI tools.
Most of the commands in LVM are very similar to each other. Each valid command is preceded by one of the following:
- Physical Volume = pv
- Volume Group = vg
- Logical Volume = lv
The physical volume commands are for adding or removing hard drives in volume groups. Volume group commands are for changing what abstracted set of physical partitions are presented to your operating in logical volumes. Logical volume commands will present the volume groups as partitions so that your operating system can use the designated space.
### Downloadable LVM Cheat Sheet ###
To help you understand what commands are available for each prefix we made a LVM cheat sheet. We will cover some of the commands in this article, but there is still a lot you can do that wont be covered here.
All commands on this list will need to be run as root because you are changing system wide settings that will affect the entire machine.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png)
### How to View Current LVM Information ###
The first thing you may need to do is check how your LVM is set up. The s and display commands work with physical volumes (pv), volume groups (vg), and logical volumes (lv) so it is a good place to start when trying to figure out the current settings.
The display command will format the information so its easier to understand than the s command. For each command you will see the name and path of the pv/vg and it should also give information about free and used space.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png)
The most important information will be the PV name and VG name. With those two pieces of information we can continue working on the LVM setup.
### Creating a Logical Volume ###
Logical volumes are the partitions that your operating system uses in LVM. To create a logical volume we first need to have a physical volume and volume group. Here are all of the steps necessary to create a new logical volume.
#### Create physical volume ####
We will start from scratch with a brand new hard drive with no partitions or information on it. Start by finding which disk you will be working with. (/dev/sda, sdb, etc.)
> Note: Remember all of the commands will need to be run as root or by adding sudo to the beginning of the command.
fdisk -l
If your hard drive has never been formatted or partitioned before you will probably see something like this in the fdisk output. This is completely fine because we are going to create the needed partitions in the next steps.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png)
Our new disk is located at /dev/sdb so lets use fdisk to create a new partition on the drive.
There are a plethora of tools that can create a new partition with a GUI, [including Gparted][2], but since we have the terminal open already, we will use fdisk to create the needed partition.
From a terminal type the following commands:
fdisk /dev/sdb
This will put you in a special fdisk prompt.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png)
Enter the commands in the order given to create a new primary partition that uses 100% of the new hard drive and is ready for LVM. If you need to change the partition size or want multiple partions I suggest using GParted or reading about fdisk on your own.
**Warning: The following steps will format your hard drive. Make sure you dont have any information on this hard drive before following these steps.**
- n = create new partition
- p = creates primary partition
- 1 = makes partition the first on the disk
Push enter twice to accept the default first cylinder and last cylinder.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png)
To prepare the partition to be used by LVM use the following two commands.
- t = change partition type
- 8e = changes to LVM partition type
Verify and write the information to the hard drive.
- p = view partition setup so we can review before writing changes to disk
- w = write changes to disk
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png)
After those commands, the fdisk prompt should exit and you will be back to the bash prompt of your terminal.
Enter pvcreate /dev/sdb1 to create a LVM physical volume on the partition we just created.
You may be asking why we didnt format the partition with a file system but dont worry, that step comes later.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png)
#### Create volume Group ####
Now that we have a partition designated and physical volume created we need to create the volume group. Luckily this only takes one command.
vgcreate vgpool /dev/sdb1
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png)
Vgpool is the name of the new volume group we created. You can name it whatever youd like but it is recommended to put vg at the front of the label so if you reference it later you will know it is a volume group.
#### Create logical volume ####
To create the logical volume that LVM will use:
lvcreate -L 3G -n lvstuff vgpool
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png)
The -L command designates the size of the logical volume, in this case 3 GB, and the -n command names the volume. Vgpool is referenced so that the lvcreate command knows what volume to get the space from.
#### Format and Mount the Logical Volume ####
One final step is to format the new logical volume with a file system. If you want help choosing a Linux file system, read our [how to that can help you choose the best file system for your needs][3].
mkfs -t ext3 /dev/vgpool/lvstuff
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png)
Create a mount point and then mount the volume somewhere you can use it.
mkdir /mnt/stuff
mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png)
#### Resizing a Logical Volume ####
One of the benefits of logical volumes is you can make your shares physically bigger or smaller without having to move everything to a bigger hard drive. Instead, you can add a new hard drive and extend your volume group on the fly. Or if you have a hard drive that isnt used you can remove it from the volume group to shrink your logical volume.
There are three basic tools for making physical volumes, volume groups, and logical volumes bigger or smaller.
Note: Each of these commands will need to be preceded by pv, vg, or lv depending on what you are working with.
- resize can shrink or expand physical volumes and logical volumes but not volume groups
- extend can make volume groups and logical volumes bigger but not smaller
- reduce can make volume groups and logical volumes smaller but not bigger
Lets walk through an example of how to add a new hard drive to the logical volume “lvstuff” we just created.
#### Install and Format new Hard Drive ####
To install a new hard drive follow the steps above to create a new partition and add change its partition type to LVM (8e). Then use pvcreate to create a physical volume that LVM can recognize.
#### Add New Hard Drive to Volume Group ####
To add the new hard drive to a volume group you just need to know what your new partition is, /dev/sdc1 in our case, and the name of the volume group you want to add it to.
This will add the new physical volume to the existing volume group.
vgextend vgpool /dev/sdc1
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png)
#### Extend Logical Volume ####
To resize the logical volume we need to say how much we want to extend by size instead of by device. In our example we just added a 8 GB hard drive to our 3 GB vgpool. To make that space usable we can use lvextend or lvresize.
lvextend -L8G /dev/vgpool/lvstuff
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png)
While this command will work you will see that it will actually resize our logical volume to 8 GB instead of adding 8 GB to the existing volume like we wanted. To add the last 3 available gigabytes you need to use the following command.
lvextend -L+3G /dev/vgpool/lvstuff
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png)
Now our logical volume is 11 GB in size.
#### Extend File System ####
The logical volume is 11 GB but the file system on that volume is still only 3 GB. To make the file system use the entire 11 GB available you have to use the command resize2fs. Just point resize2fs to the 11 GB logical volume and it will do the magic for you.
resize2fs /dev/vgpool/lvstuff
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png)
**Note: If you are using a different file system besides ext3/4 please see your file systems resize tools.**
#### Shrink Logical Volume ####
If you wanted to remove a hard drive from a volume group you would need to follow the above steps in reverse order and use lvreduce and vgreduce instead.
1. resize file system (make sure to move files to a safe area of the hard drive before resizing)
1. reduce logical volume (instead of + to extend you can also use to reduce by size)
1. remove hard drive from volume group with vgreduce
#### Backing up a Logical Volume ####
Snapshots is a feature that some newer advanced file systems come with but ext3/4 lacks the ability to do snapshots on the fly. One of the coolest things about LVM snapshots is your file system is never taken offline and you can have as many as you want without taking up extra hard drive space.
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png)
When LVM takes a snapshot, a picture is taken of exactly how the logical volume looks and that picture can be used to make a copy on a different hard drive. While a copy is being made, any new information that needs to be added to the logical volume is written to the disk just like normal, but changes are tracked so that the original picture never gets destroyed.
To create a snapshot we need to create a new logical volume with enough free space to hold any new information that will be written to the logical volume while we make a backup. If the drive is not actively being written to you can use a very small amount of storage. Once we are done with our backup we just remove the temporary logical volume and the original logical volume will continue on as normal.
#### Create New Snapshot ####
To create a snapshot of lvstuff use the lvcreate command like before but use the -s flag.
lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png)
Here we created a logical volume with only 512 MB because the drive isnt being actively used. The 512 MB will store any new writes while we make our backup.
#### Mount New Snapshot ####
Just like before we need to create a mount point and mount the new snapshot so we can copy files from it.
mkdir /mnt/lvstuffbackup
mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png)
#### Copy Snapshot and Delete Logical Volume ####
All you have left to do is copy all of the files from /mnt/lvstuffbackup/ to an external hard drive or tar it up so it is all in one file.
**Note: tar -c will create an archive and -f will say the location and file name of the archive. For help with the tar command use man tar in the terminal.**
tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png)
Remember that while the backup is taking place all of the files that would be written to lvstuff are being tracked in the temporary logical volume we created earlier. Make sure you have enough free space while the backup is happening.
Once the backup finishes, unmount the volume and remove the temporary snapshot.
umount /mnt/lvstuffbackup
lvremove /dev/vgpool/lvstuffbackup/
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png)
#### Deleting a Logical Volume ####
To delete a logical volume you need to first make sure the volume is unmounted, and then you can use lvremove to delete it. You can also remove a volume group once the logical volumes have been deleted and a physical volume after the volume group is deleted.
Here are all the commands using the volumes and groups weve created.
umount /mnt/lvstuff
lvremove /dev/vgpool/lvstuff
vgremove vgpool
pvremove /dev/sdb1 /dev/sdc1
![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png)
That should cover most of what you need to know to use LVM. If youve got some experience on the topic, be sure to share your wisdom in the comments.
--------------------------------------------------------------------------------
via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/
[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/
[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/

View File

@ -0,0 +1,67 @@
How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots
================================================================================
![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035707bbd74.png.pagespeed.ic.9_yebxUF1C.png)
Ubuntus installer offers an easy “Use LVM” checkbox. The description says it enables Logical Volume Management so you can take snapshots and more easily resize your hard disk partitions — heres how to do that.
LVM is a technology thats similar to [RAID arrays][1] or [Storage Spaces on Windows][2] in some ways. While this technology is particularly useful on servers, it can be used on desktop PCs, too.
### Should You Use LVM With Your New Ubuntu Installation? ###
The first question is whether you even want to use LVM with your Ubuntu installation. Ubuntu makes this easy to enable with a quick click, but this option isnt enabled by default. As the installer says, this allows you to resize partitions, create snapshots, merge multiple disks into a single logical volume, and so on — all while the system is running. Unlike with typical partitions, you dont have to shut down your system, boot from a live CD or USB drive, and [resize your partitions while they arent in use][3].
To be perfectly honest, the average Ubuntu desktop user probably wont realize whether theyre using LVM or not. But, if you want to do more advanced things later, LVM can help. LVM is potentially more complex, which could cause problems if you need to recover your data later — especially if youre not that experienced with it. There shouldnt be a noticeable performance penalty here — LVM is implemented right down in the Linux kernel.
![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035cbada6ae.png.pagespeed.ic.cnqyiKfCvi.png)
### Logical Volume Management Explained ###
Were previously [explained what LVM is][4]. In a nutshell, it provides a layer of abstraction between your physical disks and the partitions presented to your operating system. For example, your computer might have two hard drives inside it, each 1 TB in size. Youd have to have at least two partitions on these disks, and each of these partitions would be 1 TB in size.
LVM provides a layer of abstraction over this. Instead of the traditional partition on a disk, LVM would treat the disks as two separate “physical volumes” after you initialize them. You could then create “logical volumes” based on these physical volumes. For example, you could combine those two 1 TB disks into a single 2 TB partition. Your operating system would just see a 2 TB volume, and LVM would deal with everything in the background. A group of physical volumes and logical volumes is known as a “volume group.” A typical system will just have a single volume group.
This layer of abstraction makes it possibly to easily resize partitions, combine multiple disks into a single volume, and even take “snapshots” of a partitions file system while its running, all without unmounting it.
Note that merging multiple disks into a single volume can be a bad idea if youre not creating backups. Its like with RAID 0 — if you combine two 1 TB volumes into a single 2 TB volume, you could lose important data on the volume if just one of your hard disks fails. Backups are crucial if you go this route.
### Graphical Utilities for Managing Your LVM Volumes ###
Traditionally, [LVM volumes are managed with Linux terminal commands][5].These will work for you on Ubuntu, but theres an easier, graphical method anyone can take advantage of. If youre a Linux user used to using GParted or a similar partition manager, dont bother — GParted doesnt have support for LVM disks.
Instead, you can use the Disks utility included along with Ubuntu for this. This utility is also known as GNOME Disk Utility, or Palimpsest. Launch it by clicking the icon on the dash, searching for Disks, and pressing Enter. Unlike GParted, the Disks utility will display your LVM partitions under “Other Devices,” so you can format them and adjust other options if you need to. This utility will also work from a live CD or USB drive, too.
![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550361b3772f7.png.pagespeed.ic.nZWwLJUywR.png)
Unfortunately, the Disks utility doesnt include support for taking advantage of LVMs most powerful features. Theres no options for managing your volume groups, extending partitions, or taking snapshots. You could do that from the terminal, but you dont have to. Instead, you can open the Ubuntu Software Center, search for LVM, and install the Logical Volume Management tool. You could also just run the **sudo apt-get install system-config-lvm** command in a terminal window. After its installed, you can open the Logical Volume Management utility from the dash.
This graphical configuration tool was made by Red Hat. Its a bit dated, but its the only graphical way to do this stuff without resorting to terminal commands.
Lets say you wanted to add a new physical volume to your volume group. Youd open the tool, select the new disk under Uninitialized Entries, and click the “Initialize Entry” button. Youd then find the new physical volume under Unallocated Volumes, and you could use the “Add to existing Volume Group” button to add it to the “ubuntu-vg” volume group Ubuntu created during the installation process.
![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550363106789c.png.pagespeed.ic.drVInt3Weq.png)
The volume group view shows you a visual overview of your physical volumes and logical volumes. Here, we have two physical partitions across two separate hard drives. We have a swap partition and a root partition, just as Ubuntu sets up its partitioning scheme by default. Because weve added a second physical partition from another drive, theres now a good chunk of unused space.
![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550363f631c19.png.pagespeed.ic.54E_Owcq8y.png)
To expand a logical partition into the physical space, you could select it under Logical View, click Edit Properties, and modify the size to grow the partition. You could also shrink it from here.
![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55036893712d3.png.pagespeed.ic.ce7y_Mt0uF.png)
The other options in system-config-lvm allow you to set up snapshots and mirroring. You probably wont need these features on a typical desktop, but theyre available graphically here. Remember, you can also [do all of this with terminal commands][6].
--------------------------------------------------------------------------------
via: http://www.howtogeek.com/211937/how-to-use-lvm-on-ubuntu-for-easy-partition-resizing-and-snapshots/
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.howtogeek.com/162676/how-to-use-multiple-disks-intelligently-an-introduction-to-raid/
[2]:http://www.howtogeek.com/109380/how-to-use-windows-8s-storage-spaces-to-mirror-combine-drives/
[3]:http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/
[4]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/
[5]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/
[6]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/

View File

@ -0,0 +1,144 @@
How to share a directory with Samba on Fedora or CentOS
================================================================================
Nowadays sharing data across different computers is not something new at home or many work places. Riding on this trend, modern operating systems make it easy to share and exchange data transparently across computers via network file systems. If your work environment involves a mix of Microsoft Windows and Linux computers, one way to share files and folders among them is via SMB/CIFS, a cross-platform network file sharing protocol. Windows Microsoft natively supports SMB/CIFS, while Linux offers free software implementation of SMB/CIFS network protocol in Samba.
In this article, we will demonstrate **how to share a directory using Samba**. The Linux platform we will use is **Fedora or CentOS**. This article is dividied into four parts. First, we will install Samba under Fedora/CentOS environment. Next, we discuss how to adjust SELinux and firewall configurations to allow file sharing with Samba. Finally, we cover how to enable Samba to share a directory.
### Step One: Install Samba on Fedora or CentOS ###
First thing first. Let's install Samba and configure basic settings.
Check whether Samba application is already installed on your system by running:
$ rpm -q samba samba-common samba-client
If the above command doesn't show anything at all, it means that Samba is not installed. In that case, install Samba using the command below.
$ sudo yum install samba samba-common samba-client
Next, creates a local directory which will share data over network. This directory will be exported to remote users as a Samba share. In this tutorial, we will create this directory in the top-level directory '/', so make sure that you have the privileges to do it.
$ sudo mkdir /shared
If you want to create a shared directory inside your home directory (e.g., ~/shared), you must activate Samba home directory sharing in the SELinux options, which will be described below in more detail.
After creating /shared directory, set the privileges of the directory so other users can access it.
$ sudo chmod o+rw /shared
If you don't want other users to be able to have write to the directory, just remove the 'w' option in chmod command as follows.
$ sudo chmod o+r /shared
Next, create one empty file as a test. This file will be used to verify that he Samba share is mounted properly.
$ sudo touch /shared/file1
### Step Two: Configure SELinux for Samba ###
Next, we need to re-configure SELinux which is enabled by default in Fedora and CentOS distributions. SELinux allows Samba to read and modify files or directories only when they have the right security context (e.g., labeled with the 'samba_share_t' attribute).
The following command adds the necessary label to file-context configuration:
$ sudo semanage fcontext -a -t samba_share_t "<directory>(/.*)?"
Replace the <directory> with the local directory we created earlier for Samba share (e.g., /shared):
$ sudo semanage fcontext -a -t samba_share_t "/shared(/.*)?"
To activate the label change, we then must run the restorecon command like below.
$ sudo restorecon -R -v /shared
![](https://farm9.staticflickr.com/8584/16652774078_2055f45f70_b.jpg)
To share a directory inside our home directory via Samba, we must enable sharing home directory option in SELinux because it is disabled by default. The following command achieves the desired effect. Skip this step if you are not sharing your home directory.
$ sudo setsebool -P samba_enable_home_dirs 1
### Step Three: Configure Firewall for Samba ###
The next step is to open necessary TCP/UDP ports in the firewall settings for Samba to operate.
If you are using firewalld (e.g., on Fedora or CentOS 7), the following command will take care of permanent firewall rule change for Samba service.
$ sudo firewall-cmd --permanent --add-service=samba
If you are using iptables for your firewall (e.g., CentOS 6 or earlier), use the following commands to open up necessary Samba ports to the world.
$ sudo vi /etc/sysconfig/iptables
----------
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
Then restart iptables service:
$ sudo service iptables restart
### Step Four: Change Samba Configuration ###
The last step is to configure Samba to export a created local directory as a Samba-share.
Open the Samba configuration file with a text editor, and add the following lines at the bottom of the file.
$ sudo nano /etc/samba/smb.conf
----------
[myshare]
comment=my shared files
path=/shared
public=yes
writeable=yes
In the above the text inside a pair of brackets (e.g., "myshare") is the name of the Samba-shared resource, which will be used to access the Samba share from a remote host.
Create a Samba user account which is required to mount and export the Samba file system. To create a Samba user, use the smbpasswd tool. Note that the Samba user account must be the same as any existing Linux user. If you try to add a non-existing user with smbpasswd, it will give an error message.
If you don't want to use any existing Linux user as a Samba user, you can create a new dedicated user in your system. For safety, set the new user's login shell to /sbin/nologin, and do not create its home directory.
In this example, we are creating a new user named "sambaguest" as follows.
$ sudo useradd -M -s /sbin/nologin sambaguest
$ sudo passwd sambaguest
![](https://farm9.staticflickr.com/8702/16814479366_53f540d3ba_b.jpg)
After creating a new user, add the user as a Samba user using smbpasswd command. When this command asks a password, you can type a different password than the user's password.
$ sudo smbpasswd -a sambaguest
4. Activate the Samba service, and check whether the Samba service is running or not.
$ sudo systemctl enable smb.service
$ sudo systemctl start smb.service
$ sudo systemctl is-active smb
![](https://farm8.staticflickr.com/7607/16652984770_622f24bccc_b.jpg)
To see the list of shared directories in Samba, type the following command.
$ smbclient -U sambaguest -L localhost
![](https://farm8.staticflickr.com/7281/16220411103_06bf585901_b.jpg)
The following is a screenshot of accessing the Samba-shared directory on Thunar file manager, and doing copy-paste of file1. Note that the Samba share is accessible via "smb://<samba-server-IP-address>/myshare" address on Thunar.
![](https://farm8.staticflickr.com/7644/16218011174_c8b34fcedc_b.jpg)
--------------------------------------------------------------------------------
via: http://xmodulo.com/share-directory-samba-fedora-centos.html
作者:[Kristophorus Hadiono][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/kristophorus

View File

@ -0,0 +1,162 @@
tranlating by haimingfg
Sleuth Kit - Open Source Forensic Tool to Analyze Disk Images and Recover Files
================================================================================
SIFT is a Ubuntu based forensics distribution provided by SANS Inc. It consist of many forensics tools such as Sleuth kit / Autopsy etc . However, Sleuth kit/Autopsy tools can be installed on Ubuntu/Fedora distribution instead of downloading complete distribution of SIFT.
Sleuth Kit /Autopsy is open source digital forensics investigation tool which is used for recovering the lost files from disk image and analysis of images for incident response. Autopsy tool is a web interface of sleuth kit which supports all features of sleuth kit. This tool is available for both Windows and Linux Platforms.
### Install Sleuth kit ###
First of all, download Sleuth kit software from [sleuthkit][1] website. Use wget command to download it in terminal which is shown in the figure.
# wget http://cznic.dl.sourceforge.net/project/sleuthkit/sleuthkit/4.1.3/sleuthkit-4.1.3.tar.gz
![Download Sleuth Kit](http://blog.linoxide.com/wp-content/uploads/2015/03/download-sleuthkeit.png)
Extract the sleuthkit-4.1.3.tar.gz using following command and go inside the extracted directory
# tar -xvzf sleuthkit-4.1.3.tar.gz
![Extraction Process](http://blog.linoxide.com/wp-content/uploads/2015/03/extract.png)
Run following command which perform the requirement check before sleuth kit installation
#./configure
![configure](http://blog.linoxide.com/wp-content/uploads/2015/03/configure.png)
Make command compile the sleuth kit code.
#make
![make](http://blog.linoxide.com/wp-content/uploads/2015/03/make.png)
Finally following command install it under **/usr/local** path.
#make install
![make install](http://blog.linoxide.com/wp-content/uploads/2015/03/make-install.png)
### Install Autopsy Tool ###
Sleuth kit installation is complete and now we will install autopsy interface. Download Autopsy software from [sleuthkit's autopsy page][2] . Use wget command to download it in terminal which is shown in the figure.
# wget http://kaz.dl.sourceforge.net/project/autopsy/autopsy/2.24/autopsy-2.24.tar.gz
![Autpsy download link](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy.png)
Extract the autopsy-2.24.tar.gz using following command and go inside the extracted directory
# tar -xvzf autopsy-2.24.tar.gz
![Autopsy Extraction](http://blog.linoxide.com/wp-content/uploads/2015/03/Autopsy-extraction.png)
Configuration script of autopsy asks for NSRL (National Software Reference Library) and path of **Evidence_Locker** folder.
Enter "n" for NSRL prompt and create Evidence_Locker folder under **/usr/local** directory. Autopsy stores the configuration files, audit logs and output under Evidence_Locker folder.
#mkdir /usr/local/Evidence_Locker
#cd autopsy-2.24
#./configure
![Autopsy Configuration Script](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-configuration.png)
After adding Evidence_Locker path in installation process , autopsy stores configuration files in it and shows a following message to run the autopsy program.
![Start Autopsy](http://blog.linoxide.com/wp-content/uploads/2015/03/start-autopsy.png)
Type **./autopsy** command in terminal to start the graphical interface of Sleuth kit tool.
![Autopsy Started](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-started.png)
Type following address in the web browser to access the interface of autopsy .
http://localhost:9999/autopsy
Main web page of autopsy plugin is shown int the following figure.
![Main Page](http://blog.linoxide.com/wp-content/uploads/2015/03/main-interface.png)
Click on the **New Case** button to start analysis in autopsy tool. Enter the case name, description about the investigation and name of agent which is shown in the following figure.
![create new case](http://blog.linoxide.com/wp-content/uploads/2015/03/create-new-case1.png)
Following web page will appear after entering the details in the above page. Click on **Add Host** button to add details for the analyst machine.
![add host](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host1.png)
Enter host name, description and time zone setting of analyst machine on the next page.
![add host-detial](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host-detial.png)
Click on the **Add Image** button to add image file for forensics analysis.
![add image](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image.png)
Click on the **Add Image File** button on the following web page. It opens new web page which require Path of image file and select type & importing method.
![Add image file](http://blog.linoxide.com/wp-content/uploads/2015/03/Add-image-file.png)
As shown in the following figure, we have entered path of Linux image file. In our case, image file is partition of disk.
![add image parition](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image-parition.png)
Click on the next button and select **Calculate hash** option in the next page which is shown in the following figure. It also detect the file system type of the given image.
![image and file system detail](http://blog.linoxide.com/wp-content/uploads/2015/03/image-and-file-system-detail.png)
Following window shows the MD5 hash of the image file before static analysis .
![hash](http://blog.linoxide.com/wp-content/uploads/2015/03/hash1.png)
On the next web page, autopsy shows following information about the image file.
- mount point for the image
- name of image
- file system type of given image
Click on the **details** button to get more information about the given image file. It also offer extraction of unallocated fragments and strings from the volume of image file which is shown in the following figure.
![Image detail](http://blog.linoxide.com/wp-content/uploads/2015/03/image-details.png)
Click on **Analyze** button which is shown in the below figure to start analysis on given image . It opens another page which shows the multiple options for image analysis.
![analysis](http://blog.linoxide.com/wp-content/uploads/2015/03/analysis1.png)
Autopsy offer following features during image analysis process.
- File Analysis
- Keyword Search
- File Type
- Image Details
- Data Unit
File Analysis on given image of Linux partition is shown in the following figure.
![Analysis of image](http://blog.linoxide.com/wp-content/uploads/2015/03/Analysis-of-image.png)
It extracts all files and folders from the given image . Extraction of deleted files are shown int he figure.
![Deleted Files](http://blog.linoxide.com/wp-content/uploads/2015/03/deleted.png)
### Conclusion ###
Hopefully this article will be useful for the beginner in static forensics analysis of disk image. Autopsy is web interface for sleuth kit which provides features such as extraction of strings , recovery of deleted files, timeline analysis, extraction of web surfing history, keyword search and email analysis on windows and linux disk images.
--------------------------------------------------------------------------------
via: http://linoxide.com/ubuntu-how-to/autopsy-sleuth-kit-installation-ubuntu/
作者:[nido][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/naveeda/
[1]:http://www.sleuthkit.org/sleuthkit/download.php
[2]:http://www.sleuthkit.org/autopsy/download.php

View File

@ -0,0 +1,42 @@
[translating by KayGuoWhu]
How to enable ssh login without entering password
================================================================================
Assume that you are a user "aliceA" on hostA, and wish to ssh to hostB as user "aliceB", without entering her password on hostB. You can follow this guide to **enable ssh login without entering a password**.
First of all, you need to be logged in as user "aliceA" on hostA.
Generate a public/private rsa key pair by using ssh-keygen. The generated key pair will be stored in ~/.ssh directory.
$ ssh-keygen -t rsa
Then, create ~/.ssh directory on aliceB account at the destination hostB by running the following command. This step can be omitted if there is already .ssh directory at aliceB@hostB.
$ ssh aliceB@hostB mkdir -p .ssh
Finally, copy the public key of user "aliceA" on hostA to aliceB@hostB to enable password-less ssh.
$ cat .ssh/id_rsa.pub | ssh aliceB@hostB 'cat >> .ssh/authorized_keys'
From this point on, you no longer need to type in password to ssh to aliceB@hostB from aliceA@hostA.
### Troubleshooting ###
1. You are still asked for an SSH password even after enabling key authentication. In this case, check for system logs (e.g., /var/log/secure) to see if you see something like the following.
Authentication refused: bad ownership or modes for file /home/aliceB/.ssh/authorized_keys
In this case, failure of key authentication is due to the fact that the permission or ownership ~/.ssh/authorized_keys file is not correct. Typically this error can happen if ~/.ssh/authorized_keys is read accessible to anyone but yourself. To fix this problem, change the file permission as follows.
$ chmod 700 ~/.ssh/authorized_keys
--------------------------------------------------------------------------------
via: http://xmodulo.com/how-to-enable-ssh-login-without.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

View File

@ -0,0 +1,160 @@
How to set up networking between Docker containers
================================================================================
As you may be aware, Docker container technology has emerged as a viable lightweight alternative to full-blown virtualization. There are a growing number of use cases of Docker that the industry adopted in different contexts, for example, enabling rapid build environment, simplifying configuration of your infrastructure, isolating applications in multi-tenant environment, and so on. While you can certainly deploy an application sandbox in a standalone Docker container, many real-world use cases of Docker in production environments may involve deploying a complex multi-tier application in an ensemble of multiple containers, where each container plays a specific role (e.g., load balancer, LAMP stack, database, UI).
There comes the problem of **Docker container networking**: How can we interconnect different Docker containers spawned potentially across different hosts when we do not know beforehand on which host each container will be created?
One pretty neat open-source solution for this is [weave][1]. This tool makes interconnecting multiple Docker containers pretty much hassle-free. When I say this, I really mean it.
In this tutorial, I am going to demonstrate **how to set up Docker networking across different hosts using weave**.
### How Weave Works ###
![](https://farm8.staticflickr.com/7288/16662287067_27888684a7_b.jpg)
Let's first see how weave works. Weave creates a network of "peers", where each peer is a virtual router container called "weave router" residing on a distinct host. The weave routers on different hosts maintain TCP connections among themselves to exchange topology information. They also establish UDP connections among themselves to carry inter-container traffic. A weave router on each host is then connected via a bridge to all other Docker containers created on the host. When two containers on different hosts want to exchange traffic, a weave router on each host captures their traffic via a bridge, encapsulates the traffic with UDP, and forwards it to the other router over a UDP connection.
Each weave router maintains up-to-date weave router topology information, as well as container's MAC address information (similar to switch's MAC learning), so that it can make forwarding decision on container traffic. Weave is able to route traffic between containers created on hosts which are not directly reachable, as long as two hosts are interconnected via an intermediate weave router on weave topology. Optionally, weave routers can be set to encrypt both TCP control data and UDP data traffic based on public key cryptography.
### Prerequisite ###
Before using weave on Linux, of course you need to set up Docker environment on each host where you want to run [Docker][2] containers. Check out [these][3] [tutorials][4] on how to create Docker containers on Ubuntu or CentOS/Fedora.
Once Docker environment is set up, install weave on Linux as follows.
$ wget https://github.com/zettio/weave/releases/download/latest_release/weave
$ chmod a+x weave
$ sudo cp weave /usr/local/bin
Make sure that /usr/local/bin is include in your PATH variable by appending the following in /etc/profile.
export PATH="$PATH:/usr/local/bin"
Repeat weave installation on every host where Docker containers will be deployed.
Weave uses TCP/UDP 6783 port. If you are using firewall, make sure that these port numbers are not blocked by the firewall.
### Launch Weave Router on Each Host ###
When you want to interconnect Docker containers across multiple hosts, the first step is to launch a weave router on every host.
On the first host, run the following command, which will create and start a weave router container.
$ sudo weave launch
The first time you run this command, it will take a couple of minutes to download a weave image before launching a router container. On successful launch, it will print the ID of a launched weave router.
To check the status of the router, use this command:
$ sudo weave status
![](https://farm9.staticflickr.com/8632/16249607573_4514790cf5_c.jpg)
Since this is the first weave router launched, there will be only one peer in the peer list.
You can also verify the launch of a weave router by using docker command.
$ docker ps
![](https://farm8.staticflickr.com/7655/16681964438_51d8b18809_c.jpg)
On the second host, run the following command, where we specify the IP address of the first host as a peer to join.
$ sudo weave launch <first-host-IP-address>
When you check the status of the router, you will see two peers: the current host and the first host.
![](https://farm8.staticflickr.com/7608/16868571891_e66d4b8841_c.jpg)
As you launch more routers on subsequent hosts, the peer list will grow accordingly. When launching a router, just make sure that you specify any previously launched peer's IP address.
At this point, you should have a weave network up and running, which consists of multiple weave routers across different hosts.
### Interconnect Docker Containers across Multiple Hosts ###
Now it is time to launch Docker containers on different hosts, and interconnect them on a virtual network.
Let's say we want to create a private network 10.0.0.0/24, to interconnect two Docker containers. We will assign random IP addressses from this subnet to the containers.
When you create a Docker container to deploy on a weave network, you need to use weave command, not docker command. Internally, the weave command uses docker command to create a container, and then sets up Docker networking on it.
Here is how to create a Ubuntu container on hostA, and attach the container to 10.0.0.0/24 subnet with an IP addresss 10.0.0.1.
hostA:~$ sudo weave run 10.0.0.1/24 -t -i ubuntu
On successful run, it will print the ID of a created container. You can use this ID to attach to the running container and access its console as follows.
hostA:~$ docker attach <container-id>
Move to hostB, and let's create another container. Attach it to the same subnet (10.0.0.0/24) with a different IP address 10.0.0.2.
hostB:~$ sudo weave run 10.0.0.2/24 -t -i ubuntu
Let's attach to the second container's console as well:
hostB:~$ docker attach <container-id>
At this point, those two containers should be able to ping each other via the other's IP address. Verify that from each container's console.
![](https://farm9.staticflickr.com/8566/16868571981_d73c8e401b_c.jpg)
If you check the interfaces of each container, you will see an interface named "ethwe" which is assigned an IP address (e.g., 10.0.0.1 and 10.0.0.2) you specified.
![](https://farm8.staticflickr.com/7286/16681964648_013f9594b1_b.jpg)
### Other Advanced Usages of Weave ###
Weave offers a number of pretty neat features. Let me briefly cover a few here.
#### Application Isolation ####
Using weave, you can create multiple virtual networks and dedicate each network to a distinct application. For example, create 10.0.0.0/24 for one group of containers, and 10.10.0.0/24 for another group of containers, and so on. Weave automatically takes care of provisioning these networks, and isolating container traffic on each network. Going further, you can flexibly detach a container from one network, and attach it to another network without restarting containers. For example:
First launch a container on 10.0.0.0/24:
$ sudo weave run 10.0.0.2/24 -t -i ubuntu
Detach the container from 10.0.0.0/24:
$ sudo weave detach 10.0.0.2/24 <container-id>
Re-attach the container to another network 10.10.0.0/24:
$ sudo weave attach 10.10.0.2/24 <container-id>
![](https://farm8.staticflickr.com/7639/16247212144_c31a49714d_c.jpg)
Now this container should be able to communicate with other containers on 10.10.0.0/24. This is a pretty useful feature when network information is not available at the time you create a container.
#### Integrate Weave Networks with Host Network ####
Sometimes you may need to allow containers on a virtual weave network to access physical host network. Conversely, hosts may want to access containers on a weave network. To support this requirement, weave allows weave networks to be integrated with host network.
For example, on hostA where a container is running on network 10.0.0.0/24, run the following command.
hostA:~$ sudo weave expose 10.0.0.100/24
This will assign IP address 10.0.0.100 to hostA, so that hostA itself is also connected to 10.0.0.0/24 network. Obviously, you need to choose an IP address which is not used by any other containers on the network.
At this point, hostA should be able to access any containers on 10.0.0.0/24, whether or not the containers are residing on hostA. Pretty neat!
### Conclusion ###
As you can see, weave is a pretty useful Docker networking tool. This tutorial only covers a glimpse of [its powerful features][5]. If you are more ambitious, you can try its multi-hop routing, which can be pretty useful in multi-cloud environment, dynamic re-routing, which is a neat fault-tolerance feature, or even its distributed DNS service which allows you to name containers on weave networks. If you decide to use this gem in your environment, feel free to share your use case!
--------------------------------------------------------------------------------
via: http://xmodulo.com/networking-between-docker-containers.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni
[1]:https://github.com/zettio/weave
[2]:http://xmodulo.com/recommend/dockerbook
[3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html
[4]:http://xmodulo.com/docker-containers-centos-fedora.html
[5]:http://zettio.github.io/weave/features.html

View File

@ -0,0 +1,121 @@
Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS
================================================================================
> **Question**: I want to install CentOS desktop on VPS, and be able to access the desktop GUI remotely from home. What is a recommended way to set up and access CentOS-based remote desktop on VPS?
Nowadays teleworking or remote working with flexible hours is increasingly popular in tech industry. One of the enabling technologies behind this trend is remote desktop. Your desktop environment is in the cloud, and you can access the remote desktop anywhere you go, either from home or at your workplace.
This tutorial describes how you can set up CentOS based remote desktop on VPS. Here we are going to demonstrate CentOS 7 based environment.
We assume that you already created a CentOS 7 VPS instance somewhere (e.g., using [DigitalOcean][1] or Amazon EC2). Make sure that the VPS instance has at least 1GB memory. Otherwise, CentOS desktop will crash when you try to access remote desktop.
### Step One: Install CentOS Desktop ###
If an available CentOS image is a minimal version of CentOS without desktop, you will need to install desktop (e.g., GNOME) on your CentOS VPS before proceeding. For example, DigitalOcean's CentOS image is such a minimal version, which requires [desktop GUI installation][2] as follows.
# yum groupinstall "GNOME Desktop"
Reboot a VPS after finishing installation.
### Step Two: Install and Configure VNC Server ###
The next step is to install and configure VNC server. We are going to use TigerVNC, an open-source VNC server implementation.
# yum install tigervnc-server
Now create a user account (e.g., xmodulo) which will be used to access remote desktop.
# useradd xmodulo
# passwd xmodulo
When a user tries to access remote desktop using VNC, a dedicated VNC server daemon will be launched to handle its requests. This means that you will need to create a separate VNC server configuration for each user.
CentOS 7 relies on systemd to manage and configure system services. So we are going to configure VNC server for xmodulo user using systemd.
Let's first check the status of VNC server by running either command below:
# systemctl status vncserver@:.service
# systemctl is-enabled vncserver@.service
By default, freshly installed VNC service is not active (disabled).
![](https://farm8.staticflickr.com/7613/16877514732_8ccffe7b6b_b.jpg)
Now create a VNC service configuration for xmodulo user by copying a generic VNC service unit file as follows.
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
Open the configuration file with a text editor, and replace <USER> with an actual user name (e.g., xmodulo) under [Service] section. Also, append "-geometry <resolution>" parameter in ExecStart. In the end, the following two lines with bold font will be modified.
# vi /etc/systemd/system/vncserver@:1.service
----------
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l xmodulo -c "/usr/bin/vncserver %i -geometry 1024x768"
PIDFile=/home/xmodulo/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
Now set up (optional) VNC password for xmodulo user for security. For this, switch to the user, and run vncserver command.
# su - xmodulo
# vncserver
You will be prompted to enter a VNC password for the user. Once the password is set, you will need to use this password to gain access to remote desktop.
![](https://farm9.staticflickr.com/8752/16692564599_9c4e5da1b6_b.jpg)
Finally, reload services to activate the new VNC configuration:
# systemctl daemon-reload
and enable VNC service to make it start automatically upon boot:
# systemctl enable vncserver@:1.service
Check the port number that a VNC server is listening on by running:
# netstat -tulpn | grep vnc
![](https://farm8.staticflickr.com/7625/16692646729_7bb16c4897_b.jpg)
Port 5901 is the default port number for VNC client to connect to a VNC server.
### Step Three: Connect to Remote Desktop over SSH ###
By design, Remote Frame Buffer (RFB) protocol used by VNC is not a secure protocol. Thus it is not a good idea to directly connect to a remote VNC server running on VPS using a VNC client. Any sensitive information such as password could easily be leaked from VNC traffic. So instead, I strongly recommend that you [tunnel VNC traffic][3] over a secure SSH tunnel, as described here.
On a local host where you want to run VNC client, create an SSH tunnel to a remote VPS using the following command. When prompted for SSH password, type the password of the user.
$ ssh xmodulo@<VPS-IP-address> -L 5901:127.0.0.1:5901
Replace "xmodulo" with your own VNC user, and fill in the IP address of your VPS instance.
Once an SSH tunnel is established, remote VNC traffic will be routed over the SSH tunnel, and be sent to 127.0.0.1:5901.
Now go ahead and launch your favorite VNC client (e.g., vinagre), and connect to 127.0.0.1:5901.
![](https://farm8.staticflickr.com/7639/16691289910_fae83510fb_o.png)
You will be asked to enter a VNC password. When you type a correct VNC password, you will finally be able to CentOS remote desktop on VPS securely.
![](https://farm8.staticflickr.com/7614/16877678411_aa8349f6b1_c.jpg)
![](https://farm9.staticflickr.com/8702/16256320434_81f9b5b70c_c.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/centos-remote-desktop-vps.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni
[1]:http://xmodulo.com/go/digitalocean
[2]:http://xmodulo.com/how-to-install-gnome-desktop-on-centos.html
[3]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html

View File

@ -0,0 +1,163 @@
7 Quirky ls Command Tricks Every Linux User Should Know
================================================================================
We have covered most of the things on ls command in last two articles of our Interview series. This article is the last part of the ls command series. If you have not gone through last two articles of this series you may visit the links below.
注:以下三篇都做过源文,看看翻译了没有,如果发布了可适当改链接地址
- [15 Basic ls Command Examples in Linux][]
- [15 Interview Questions on Linux “ls” Command Part 1][]
- [10 Useful ls Command Interview Questions Part 2][]
![7 Quirky ls Command Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-tricks.jpg)
7 Quirky ls Command Tricks
### 1. List the contents of a directory with time using various time styles. ###
To list the contents of a directory with times using style, we need to choose any of the below two methods.
# ls -l time-style=[STYLE] (Method A)
**Note** The above switch (`--time` style must be run with switch `-l`, else it wont serve the purpose).
# ls full-time (Method B)
Replace `[STYLE]` with any of the below option.
full-iso
long-iso
iso
locale
+%H:%M:%S:%D
**Note** In the above line H(Hour), M(Minute), S(Second), D(Date) can be used in any order.
Moreover you just choose those relevant and not all options. E.g., `ls -l --time-style=+%H` will show only hour.
`ls -l --time-style=+%H:%M:%D` will show Hour, Minute and date.
# ls -l --time-style=full-iso
![ls Command Full Time Style](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Full-Time-Style.gif)
ls Command Full Time Style
# ls -l --time-style=long-iso
![Long Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Long-Time-Listing-Format.gif)
Long Time Style Listing
# ls -l --time-style=iso
![Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Local-Time-Style-Listing.gif)
Time Style Listing
# ls -l --time-style=locale
![Locale Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Hour-Mintue-Time-Style-Listing.gif)
Locale Time Style Listing
# ls -l --time-style=+%H:%M:%S:%D
![Date and Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Time-Style-Listing.gif)
Date and Time Style Listing
# ls --full-time
![Full Style Time Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Style-Time-Listing.gif)
Full Style Time Listing
### 2. Output the contents of a directory in various formats such as separated by commas, horizontal, long, vertical, across, etc. ###
Contents of directory can be listed using ls command in various format as suggested below.
- across
- comma
- horizontal
- long
- single-column
- verbose
- vertical
# ls -format=across
# ls --format=comma
# ls --format=horizontal
# ls --format=long
# ls --format=single-column
# ls --format=verbose
# ls --format=vertical
![Listing Formats of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-Listing-Formats.gif)
Listing Formats of ls Command
### 3. Use ls command to append indicators like (/=@|) in output to the contents of the directory. ###
The option `-p` with ls command will server the purpose. It will append one of the above indicator, based upon the type of file.
# ls -p
![Append Indicators to Content](http://www.tecmint.com/wp-content/uploads/2015/03/Append-Indicators.gif)
Append Indicators to Content
### 4. Sort the contents of directory on the basis of extension, size, time and version. ###
We can use options like `--extension` to sort the output by extension, size by extension `--size`, time by using extension `-t` and version using extension `-v`.
Also we can use option `--none` which will output in general way without any sorting in actual.
# ls --sort=extension
# ls --sort=size
# ls --sort=time
# ls --sort=version
# ls --sort=none
![Sort Listing of Content by Options](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Content-by-Extensions.gif)
Sort Listing of Content by Options
### 5. Print numeric UID and GID for every contents of a directory using ls command. ###
The above scenario can be achieved using flag -n (Numeric-uid-gid) along with ls command.
# ls -n
![Print Listing of Content by UID and GID](http://www.tecmint.com/wp-content/uploads/2015/03/Print-UID-GID-of-Contents.gif)
Print Listing of Content by UID and GID
### 6. Print the contents of a directory on standard output in more columns than specified by default. ###
Well ls command output the contents of a directory according to the size of the screen automatically.
We can however manually assign the value of screen width and control number of columns appearing. It can be done using switch `--width`.
# ls --width 80
# ls --width 100
# ls --width 150
![List Content Based on Window Sizes](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-By-More-Column.gif)
List Content Based on Window Sizes
**Note**: You can experiment what value you should pass with width flag.
### 7. Include manual tab size at the contents of directory listed by ls command instead of default 8. ###
# ls --tabsize=[value]
![List Content by Table Size](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-by-Table-Size.gif)
List Content by Table Size
**Note**: Specify the `[Value]=` Numeric value.
Thats all for now. Stay tuned to Tecmint till we come up with next article. Do not forget to provide us with your valuable feedback in the comments below. Like and share us and help us get spread.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/linux-ls-command-tricks/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
[2]:http://www.tecmint.com/ls-command-interview-questions/
[3]:http://www.tecmint.com/ls-interview-questions/

View File

@ -0,0 +1,114 @@
Translating by ZTinoZ
How to Host Open Source Code Repository in github
================================================================================
Hi all, today we will be learning how to host Source Code of Open Source Software in the repository hosted by github.com . GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features. It provides a workplace to host powerful collaboration, code review, and code management for open source and private projects. Unlike Git, which is strictly a command-line tool, GitHub provides a web-based graphical interface and desktop as well as mobile integration. GitHub offers both paid plans for private repositories and free accounts, which are usually used to host open-source software projects.
![github universe logo](http://blog.linoxide.com/wp-content/uploads/2015/03/github-universe.jpg)
It is fast and more flexible web based hosting service which is easy to use and to manage distributed revision control. Anyone can host their software's source code in github's repository for the use, contribution, sharing, issue tracking and many more by millions of people across the globe. Here are some easy and quick steps to easily host software's source code.
### 1. Creating a new Github Account ###
First of all, open your favorite browser and go to Github's homepage url ie [github][1]. Then, the homepage will be opened as shown below.
![Github Homepage](http://blog.linoxide.com/wp-content/uploads/2015/03/github-homepage.png)
Now, after the homepage has been opened, please fill form shown to sign up for a new github account.
After the you entered the valid information required for sign up, you'll be redirected to the plan choosing step. We have 5 plans listed in this page. One can choose the plan according to their requirement. Here, we'll go for a free plan. So, click on Choose to the Free plan and click on Finish Sign up. If we are planning to create an organization then, we need to tick on Help me setup an organization next.
![choosing plan](http://blog.linoxide.com/wp-content/uploads/2015/03/choosing-plan.png)
### 2. Creating a New Repository ###
After we have successfully signed up a new account or logged in to Github, we'll now need to create a new Repository to get started.
Click on **(+)** button which is located at the top right near the account id. Then Click on New Repository .
![Add new repository](http://blog.linoxide.com/wp-content/uploads/2015/03/create-new-repository.png)
Now, after clicking on add a new repository, we'll now be directed to the page where we'll need to enter the required information.
![adding repository information](http://blog.linoxide.com/wp-content/uploads/2015/03/adding-information-repository.png)
Now, after entering the required information about the new repository, we'll need to click on green Create repository button.
After it is done, we'll get to see something similar like this image.
![repository github](http://blog.linoxide.com/wp-content/uploads/2015/03/repository-github.png)
### 3. Uploading an existing Project ###
If we want to share our existing project on Github, we'll surely need to push the codes to the repository we created. To do so, we'll first need to install git in our Linux machine. As I am running Ubuntu 14.04 LTS in my machine, I'll need to run **apt** manger to install it.
$ sudo apt-get install git
![installing git](http://blog.linoxide.com/wp-content/uploads/2015/03/install-git.png)
Now, as git is ready, we are now ready to upload the codes.
**Note**: To avoid errors, do not initialize the new repository with **README**, license, or gitignore files. You can add these files after your project has been pushed to GitHub.
In Terminal, we'll need to change the current working directory to your local project then initialize the local directory as a Git repository/
$ git init
We'll then add the files in our new local repository. This stages them for the first commit.
$ git add .
Now, we'll need to commit the files that we've staged in our local repository.
$ git commit -m 'First commit'
![git commit](http://blog.linoxide.com/wp-content/uploads/2015/03/git-commit.png)
In Terminal, we'll add the URL for the remote repository where our local repostory will be pushed.
$ git remote add origin remote Repository url
$ git remote -v
![adding remote url](http://blog.linoxide.com/wp-content/uploads/2015/03/adding-remote-url.png)
Note: Please do replace remote Repository url to the url of the remote repo.
Now, to push the changes in our local repository to GitHub's repo we'll need to run as below and enter the required credential for the repository.
$ git push origin master
![pushing repo](http://blog.linoxide.com/wp-content/uploads/2015/03/pushing-repo.png)
### Cloning a Repo ###
If we want to download a code repository from github straight to our local drives with a single command then, we can simply use git clone command which will clone the current directory to the remote repository.
$ git clone https://github.com/aruntechgeek/linspeed.git
![cloning repo](http://blog.linoxide.com/wp-content/uploads/2015/03/cloning-repo.png)
Please change the above url to the repository you want to clone from.
### Updating a Change ###
If we made changes to our code and want to push them to our remote repository then after changing the changes, we should run the following commands inside that directory.
$ git add .
$ git commit -m "Updating"
$ git push
### Conclusion ###
Hurray! We have successfully hosted our Project Source Code in Github repository. Github is fast and more flexible web based hosting service which is easy to use and to manage distributed revision control. Millions of awesome Open Source projects are hosted in github. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy Github :-)
--------------------------------------------------------------------------------
via: http://linoxide.com/usr-mgmt/host-open-source-code-repository-github/
作者:[Arun Pyasi][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/arunp/
[1]:http://github.com/

View File

@ -0,0 +1,100 @@
translating wi-cuckoo LLAP
How to Interactively Create a Docker Container
================================================================================
Hi everyone, today we'll learn how we can interactively create a docker container using a docker image. Once we start a process in Docker from an Image, Docker fetches the image and its Parent Image, and repeats the process until it reaches the Base Image. Then the Union File System adds a read-write layer on top. That read-write layer, the information about its Parent Image and some other information like its unique id, networking configuration, and resource limits is called a **Container**. Containers has states as they can change from **running** to **exited** state. A container with state as **running** includes a tree of processes running on the CPU, isolated from the other processes running on the host where as **exited** is the state of the file system and its exit value is preserved. You can start, stop, and restart a container with it.
Docker Technology has brought a remarkable change in the field of IT enabling cloud service for sharing applications and automating workflows, enabling apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. In this article, we'll build CentOS Instance in which we'll host a website running under Apache Web Server.
Here is quick and easy tutorial on how we can create a container in an interactive method using an interactive shell.
### 1. Running a Docker Instance ###
Docker initially tries to fetch and run the required image locally and if its not found in local host the it pulls from the [Docker Public Registry Hub][1] . Here. we'll fetch and create a fedora instance in a Docker Container and attach a bash shell to the tty.
# docker run -i -t fedora bash
![Downloading Fedora Base Image](http://blog.linoxide.com/wp-content/uploads/2015/03/downloading-fedora-base-image.png)
### 2. Installing Apache Web Server ###
Now, after our Fedora base image with instance is ready, we'll now gonna install Apache Web Server interactively without creating a Dockerfile for it. To do so, we'll need to run the following commands in a terminal or shell.
# yum update
![Updating Fedora Base Image](http://blog.linoxide.com/wp-content/uploads/2015/03/updating-fedora-base-image.png)
# yum install httpd
![Installing httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-httpd2.png)
# exit
### 3. Saving the Image ###
Now, we'll gonna save the changes we made into the Fedora Instance. To do that, we'll first gonna need to know the Container ID of the Instance. To get that we'll need to run the following command.
# docker ps -a
![Docker Running Container](http://blog.linoxide.com/wp-content/uploads/2015/03/docker-running-container.png)
Then, we'll save the changes as a new image by running the below command.
# docker commit c16378f943fe fedora-httpd
![committing fedora httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/committing-fedora-httpd.png)
Here, the changes are saved using the Container ID and image name fedora-httpd. To make sure that the new image is running or not, we'll run the following command.
# docker images
![view docker images](http://blog.linoxide.com/wp-content/uploads/2015/03/view-docker-images.png)
### 4. Adding the Contents to the new image ###
As we have our new Fedora Apache image running successfully, now we'll want to add the web contents which includes our website to Apache Web Server so that our website will run successfully out of the box. To do so, we'll need to create a new Dockerfile which will handle the operation from copying web contents to allowing port 80. To do so, we'll need to create a file Dockerfile using our favorite text editor as shown below.
# nano Dockerfile
Now, we'll need to add the following lines into that file.
FROM fedora-httpd
ADD mysite.tar /tmp/
RUN mv /tmp/mysite/* /var/www/html
EXPOSE 80
ENTRYPOINT [ "/usr/sbin/httpd" ]
CMD [ "-D", "FOREGROUND" ]
![configuring Dockerfile](http://blog.linoxide.com/wp-content/uploads/2015/03/configuring-Dockerfile.png)
Here, in above Dockerfile, the web content which we have in mysite.tar will get automatically extracted to /tmp/ folder. Then, the entire site will move to the Apache Web root ie /var/www/html/ and the expose 80 will open port 80 so that the website will be available normally. Then, the entrypoint is set to /usr/sbin/httpd so that the Apache Server will execute.
### 5. Building and running a Container ###
Now, we'll build our Container using the Dockerfile we just created in order to add our website on it. To do so, we'll need to run the following command.
# docker build -rm -t mysite .
![Building mysite Image](http://blog.linoxide.com/wp-content/uploads/2015/03/building-mysite-image.png)
After building our new container, we'll want to run the container using the command below.
# docker run -d -P mysite
![Running mysite Container](http://blog.linoxide.com/wp-content/uploads/2015/03/running-mysite-container.png)
### Conclusion ###
Finally, we've successfully built a Docker Container interactively. In this method, we build our containers and image directly via interactive shell commands. This method is quite easy and quick to build and deploy our images and containers. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-)
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-how-to/interactively-create-docker-container/
作者:[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://registry.hub.docker.com/

View File

@ -0,0 +1,191 @@
A Peep into Process Management Commands in Linux
================================================================================
A program in execution is called a process. While a program is an executable file present in storage and is passive, a process is a dynamic entity comprising of allocated system resources, memory, security attributes and has a state associated with it. There can be multiple processes associated with the same program and operating simultaneously without interfering with each other. The operating system efficiently manages and keeps track of all the processes running in the system.
In order to manage these processes, user should be able to
- See all the processes that are running
- View the system resources consumed by the processes
- Locate a particular process and take specific action on it
- Change the priority levels associated with processes
- Kill the required processes
- Restrict the system resources available to processes etc.
Linux offers many commands to the user to effectively handle the above mentioned scenarios. Let's understand them one by one.
### 1. ps ###
'ps' is one of the basic commands in Linux to view the processes on the system. It lists the running processes in a system along with other details such as process id, command, cpu usage, memory usage etc. Some of the following options come handy to get more useful information
ps -a - List all the running / active processes
![Output of "ps -a" command](http://blog.linoxide.com/wp-content/uploads/2015/02/ps-a2.png)
ps -ef |grep - List only the required process
ps -aux - Displays processes including those with no terminals(x) Output is user oriented (u) with fields like USER, PID, %CPU, %MEM etc
### 2. pstree ###
In Linux, every process gets spawned by its parent process. This command helps visualize the processes by displaying a tree diagram of the processes showing the relationship between them. If a pid is mentioned, the root of the tree will be the pid. Else it will be rooted at init.
![pstree](http://blog.linoxide.com/wp-content/uploads/2015/02/pstree.png)
### 3. top ###
'top' is a very useful command to monitor the system as it shows the system resources used by different processes. It gives a snapshot of the situation that the system is currently in. Its output includes data like process identification number(PID), user of the process, nice value, %CPU and %memory currently consumed by the process etc. One can use this output to figure out which process is hogging the CPU or memory.
![top](http://blog.linoxide.com/wp-content/uploads/2015/02/top.png)
### 4. htop ###
htop is similar to top, but is an interactive text mode process viewer. It displays the per CPU usage and memory, swap usage using a text graph. One can use the Up/Down arrow key to select processes, F7 and F8 to change the priority and F9 to kill a process. It is not present by default in the system and need to be installed explicitly.
![htop output](http://blog.linoxide.com/wp-content/uploads/2015/03/htop1.png)
### 5. nice ###
With the help of nice command, users can set or change the priorities of processes in Linux. Higher the priority of a process, more is the CPU time allocated by the kernel for it. By default, a process gets launched with priority 0. Process priority can be viewed using the top command output under the NI (nice value) column.
Values of process priority range from -20 to 19. Lower the nice value, higher the priority.
nice <priority value> <process name> - starts the process by setting its priority to the given value
![nice command](http://blog.linoxide.com/wp-content/uploads/2015/02/nice-cmd.png)
![changed nice value of 'top'](http://blog.linoxide.com/wp-content/uploads/2015/02/top-nice.png)
In the above example, 'top' gets launched with a priority -3.
### 6. renice ###
It is similar to nice command. Use this command to change the priority of an already running process. Please note that users can change the priority of only the processes that they own.
renice -n -p - change the priority of the given process
![renice command](http://blog.linoxide.com/wp-content/uploads/2015/02/renice2.png)
Priority of process with id 3806 which had an initial priority of 0 is now changed to priority 4.
renice -u -g - change the priority of processes owned by the given user and group
![output of renice for a user group](http://blog.linoxide.com/wp-content/uploads/2015/02/renice1.png)
In the above example, priority of all processes owned by user 'mint' get changed to '-3'
### 7. kill ###
This is a command used to terminate processes by sending signals. If a process is not responding to kill command, then it can be forcefully killed using the kill -9 command. But this needs to be used carefully as it does not give a chance for the process to clean up and might end up in corrupted files. If we are not aware of the PID of the process to be killed or want to mention the process name to be killed, then killall comes to rescue.
kill <pid>
kill -9 <pid>
killall -9 - kill all instances having the same process name
If you use kill, you need to know the process id of the process to be killed. pkill is a similar command but can be used to kill processes using a pattern, i.e. process name, process owner etc.
pkill <process name>
![kill initiated](http://blog.linoxide.com/wp-content/uploads/2015/02/kill-initiated.png)
![kill](http://blog.linoxide.com/wp-content/uploads/2015/02/kill.png)
### 8. ulimit ###
Command useful in controlling the system-wide resources available to the shells and processes. Mostly useful for system administrators to manage systems that are heavily used and have performance problems. Limiting the resources ensures that important processes continue to run while other processes do not consume more resources.
ulimit -a - Displays the current limits associated with the current user.
![ulimit -a](http://blog.linoxide.com/wp-content/uploads/2015/02/ulimit-a.png)
-f - maximum file size
-v - maximum virtual memory size (in KB)
-n - maximum file descriptor plus 1
-H : To change and report the hard limit
-S : To change and report the soft limit
Check out the ulimit man page for more options.
### 9. w ###
w gives us information about the users who have currently logged in and the processes that they are running. The header details displayed contain information like current time, how long the system has been running, total number of users logged in, load average of the system for the last 1, 5 and 15 minutes
Based on the user information, one can take care before terminating any processes that do not belong to them.
!['w' command](http://blog.linoxide.com/wp-content/uploads/2015/02/w.png)
**who** is a related command and gives a list of currently logged in users, time of last system boot, current run levels etc.
!['who' command](http://blog.linoxide.com/wp-content/uploads/2015/02/who.png)
**whoami** command prints the username of the current user ID
!['whoami' command](http://blog.linoxide.com/wp-content/uploads/2015/02/whoami.png)
### 10. pgrep ###
pgrep stands for "Process-ID Global Regular Expression Print". It scans the currently running processes and lists the process IDs that match the selection criteria mentioned on command line to stdout. Useful for retrieving the process id of a process by using its name.
pgrep -u mint sh
This command will display the process ID for the process named 'sh' and owned by user 'mint'
![output of pgrep](http://blog.linoxide.com/wp-content/uploads/2015/03/pgrep.png)
### 11. fg , bg ###
Sometimes, the commands that we execute take a long time to complete. In such situations, we can push the jobs to be executed in the background using 'bg' command and can be brought to the foreground with the 'fg' command.
We can start a program in background by using the '&' :
find . -name *iso > /tmp/res.txt &
A program that is already running can also be sent to the background using 'CTRL+Z' and 'bg' command:
find . -name *iso > /tmp/res.txt & - start the job in the background
ctrl+z - suspend the currently executing foreground job
bg - push the command execution to background
We can list all the background processes using 'jobs' command
jobs
We can bring back a background process to foreground using the 'fg' command.
fg %
![output of fg, bg and jobscommands](http://blog.linoxide.com/wp-content/uploads/2015/03/fg-bg-jobs.png)
### 12. ipcs ###
ipcs command is used for listing the inter-process communication facilities (shared memory, semaphores and message queues).
This command with -p option can be combined with options -m, -s or-q to display the process id which recently accessed the corresponding ipc facility.
ipcs -p -m
The screen shot below is listing the creator id and process id which accessed the shared memory recently.
![ipcs command](http://blog.linoxide.com/wp-content/uploads/2015/03/ipcs.png)
### Conclusion ###
Generally, it is considered the job of administrators to fix problems and tweak the system to improve the performance. But users also need to deal with processes in Linux quite often. Hence, it is essential to familiarise ourselves with the various commands available to manage them effectively.
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-command/process-management-commands-linux/
作者:[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/

View File

@ -0,0 +1,252 @@
How to set up server monitoring system with Monit
================================================================================
Many Linux admins rely on a centralized remote monitoring system (e.g., [Nagios][1] or [Cacti][2]) to check the health of their network infrastructure. While centralized monitoring makes an admin's life easy when dealing with many hosts and devices, a dedicated monitoring box obviously becomes a single point of failure; if the monitoring box goes down or becomes unreachable for whatever reason (e.g., bad hardware or network outage), you will lose visibility on your entire infrastructure.
One way to add redundancy to your monitoring system is to install standalone monitoring software (as a fallback) at least on any critical/core servers on your network. In case a centralized monitor is down, you will still be able to maintain visibility on your core servers from their backup monitor.
### What is Monit? ###
[Monit][3] is a cross-platform open-source tool for monitoring Unix/Linux systems (e.g., Linux, BSD, OSX, Solaris). Monit is extremely easy to install and reasonably lightweight (with only 500KB in size), and does not require any third-party programs, plugins or libraries. Yet, Monit lends itself to full-blown monitoring, capable of process status monitoring, filesystem change monitoring, email notification, customizable actions for core services, and so on. The combination of ease of setup, lightweight implementation and powerful features makes Monit an ideal candidate for a backup monitoring tool.
I have been using Monit for several years on multiple hosts, and I am very pleased how reliable it has been. Even as a full-blown monitoring system, Monit is very useful and powerful for any Linux admin. In this tutorial, let me demonstrate how to set up Monit on a local server (as a backup monitor) to monitor common services. With this setup, I will only scrach the surface of what Monit can do for us.
### Installation of Monit on Linux ###
Most Linux distributions already include Monit in their repositories.
Debian, Ubuntu or Linux Mint:
$ sudo aptitude install monit
Fedora or CentOS/RHEL:
On CentOS/RHEL, you must enable either [EPEL][4] or [Repoforge][5] repository first.
# yum install monit
Monit comes with a very well documented configuration file with a lots of examples. The main configuration file is located in /etc/monit.conf in Fedora/CentOS/RHEL, or /etc/monit/monitrc in Debian/Ubuntu/Mint. Monit configuration has two parts: "Global" and "Services" sections.
Gl### ###obal Configuration: Web Status Page
Monit can use several mail servers for notifications, and/or an HTTP/HTTPS status page. Let's start with the web status page with the following requirements.
- Monit listens on port 1966.
- Access to the web status page is encrypted with SSL.
- Login requires monituser/romania as user/password.
- Login is permitted from localhost, myhost.mydomain.ro, and internal LAN (192.168.0.0/16) only.
- Monit stores an SSL certificate in a pem format.
For subsequent steps, I will use a Red Hat based system. Similar steps will be applicable on a Debian based system.
First, generate and store a self-signed certificate (monit.pem) in /var/cert.
# mkdir /var/certs
# cd /etc/pki/tls/certs
# ./make-dummy-cert monit.pem
# cp monit.pem /var/certs
# chmod 0400 /var/certs/monit.pem
Now put the following snippet in the Monit's main configuration file. You can start with an empty configuration file or make a copy of the original file.
set httpd port 1966 and
SSL ENABLE
PEMFILE /var/certs/monit.pem
allow monituser:romania
allow localhost
allow 192.168.0.0/16
allow myhost.mydomain.ro
### Global Configuration: Email Notification ###
Next, let's set up email notification in Monit. We need at least one active [SMTP server][6] which can send mails from the Monit host. Something like the following will do (adjust it for your case):
- Mail server hostname: smtp.monit.ro
- Sender email address used by monit (from): monit@monit.ro
- Who will receive mail from monit daemon: guletz@monit.ro
- SMTP port used by mail server: 587 (default is 25)
With the above information, email notification would be configured like this:
set mailserver smtp.monit.ro port 587
set mail-format {
from: monit@monit.ro
subject: $SERVICE $EVENT at $DATE on $HOST
message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION.
Yours sincerely,
Monit
}
set alert guletz@monit.ro
As you can see, Monit offers several built-in variables ($DATE, $EVENT, $HOST, etc.), and you can customize your email message for your needs. If you want to send mails from the Monit host itself, you need a sendmail-compatible program (e.g., postfix or ssmtp) already installed.
### Global Configuration: Monit Daemon ###
The next part is setting up monit daemon. We will set it up as follows.
- Performs the first check after 120 seconds.
- Checks services once every 3 minutes.
- Use syslog for logging.
Place the following snippet to achieve the above setting.
set daemon 120
with start delay 240
set logfile syslog facility log_daemon
We must also define "idfile", a unique ID used by monit demon, and "eventqueue", a path where mails sent by monit but undelivered due to SMTP/network errors. Verifiy that path (/var/monit) already exists. The following configuration will do.
set idfile /var/monit/id
set eventqueue
basedir /var/monit
### Test Global Configuration ###
Now the "Global" section is finished. The Monit configuration file will look like this:
# Global Section
# status webpage and acl's
set httpd port 1966 and
SSL ENABLE
PEMFILE /var/certs/monit.pem
allow monituser:romania
allow localhost
allow 192.168.0.0/16
allow myhost.mydomain.ro
# mail-server
set mailserver smtp.monit.ro port 587
# email-format
set mail-format {
from: monit@monit.ro
subject: $SERVICE $EVENT at $DATE on $HOST
message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION.
Yours sincerely,
Monit
}
set alert guletz@monit.ro
# delay checks
set daemon 120
with start delay 240
set logfile syslog facility log_daemon
# idfile and mail queue path
set idfile /var/monit/id
set eventqueue
basedir /var/monit
Now it is time to check what we have done. You can test an existing configuration file (/etc/monit.conf) by running:
# monit -t
----------
Control file syntax OK
If Monit complains about any error, please review the configuration file again. Fortunately, error/warnings messages are informative. For example:
monit: Cannot stat the SSL server PEM file '/var/certs/monit.pem' -- No such file or directory
/etc/monit/monitrc:10: Warning: hostname did not resolve 'smtp.monit.ro'
Once you verify the syntax of configuration, start monit daemon, and wait 2 to 3 minutes:
# service monit start
If you are using systemd, run:
# systemctl start monit
Now open a browser window, and go to https://<monit_host>:1966. Replace &<monit_host> with your Monit hostname or IP address.
Note that if you have a self-signed SSL certificate, you will see a warning message in your browser.
![](https://farm8.staticflickr.com/7596/16737206479_96b9f7dfdb_c.jpg)
After you have completed login, you must see the following page.
![](https://farm8.staticflickr.com/7594/16303369973_6019482dea_c.jpg)
In the rest of the tutorial, let me show how we can monitor a local server and common services. You will see a lot of useful examples on the [official wiki page][7]. Most of them are copy-and-pastable!
### Service Configuration: CPU/Memory Monitoring ###
Let start with monitoring a local server's CPU/memory usage. Copy the following snippet in the configuration file.
check system localhost
if loadavg (1min) > 10 then alert
if loadavg (5min) > 6 then alert
if memory usage > 75% then alert
if cpu usage (user) > 70% then alert
if cpu usage (system) > 60% then alert
if cpu usage (wait) > 75% then alert
You can easily interpret the above configuration. The above checks are performed on local host for every monitoring cycle (which is set to 120 seconds in the Global section). If any condition is met, monit daemon will send an alert with an email.
If certain properties do not need to be monitored for every cycle, you can use the following format. For example, this will monitor average load every other cycle (i.e., every 240 seconds).
if loadavg (1min) > 10 for 2 cycles then alert
### Service Configuration: SSH Service Monitoring ###
Let's check if we have sshd binary installed in /usr/sbin/sshd:
check file sshd_bin with path /usr/sbin/sshd
We also want to check if the init script for sshd exist:
check file sshd_init with path /etc/init.d/sshd
Finally, we want to check if sshd daemon is up an running, and listens on port 22:
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
More specifically, we can interpret the above configuration as follows. We check if a process named sshd and a pidfile (/var/run/sshd.pid) exist. If either one does not exist, we restart sshd demon using init script. We check if a process listening on port 22 can speak SSH protocol. If not, we restart sshd daemon. If there are at least 5 restarts within the last 5 monitoring cycles (i.e., 5x120 seconds), sshd daemon is declared non-functional, and we do not try to check again.
![](https://farm9.staticflickr.com/8685/16735725998_62c26a24bc_c.jpg)
### Service Configuration: SMTP Service Monitoring ###
Now let's set up a check on a remote SMTP mail server (e.g., 192.168.111.102). Let's assume that the SMTP server is running SMTP, IMAP and SSH on its LAN interface.
check host MAIL with address 192.168.111.102
if failed icmp type echo within 10 cycles then alert
if failed port 25 protocol smtp then alert
else if recovered then exec "/scripts/mail-script"
if failed port 22 protocol ssh then alert
if failed port 143 protocol imap then alert
We check if the remote host responds to ICMP. If we haven't received ICMP response within 10 cycles, we send out an alert. If testing for SMTP protocol on port 25 fails, we send out an alert. If testing succeeds again after a failed test, we run a script (/scripts/mail-script). If testing for SSH and IMAP protocols fail on port 22 and 143, respectively, we send out an alert.
### Conclusion ###
In this tutorial, I demonstrate how to set up Monit on a local server. What I showed here is just the tip of the iceberg, as far as Monit's capabilities are concerned. Take your time and read the man page about Monit (a very good one). Monit can do a lot for any Linux admin with a very nice and easy to understand syntax. If you put together a centralized remote monitor and Monit to work for you, you will have a more reliable monitoring system. What is your thought on Monit?
--------------------------------------------------------------------------------
via: http://xmodulo.com/server-monitoring-system-monit.html
作者:[Iulian Murgulet][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/iulian
[1]:http://xmodulo.com/monitor-common-services-nagios.html
[2]:http://xmodulo.com/monitor-linux-servers-snmp-cacti.html
[3]:http://mmonit.com/monit/
[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html
[6]:http://xmodulo.com/mail-server-ubuntu-debian.html
[7]:http://mmonit.com/wiki/Monit/ConfigurationExamples

View File

@ -1,38 +0,0 @@
意大利Emilia-Romagna区正在切换到OpenOffice
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Turin_Open_Source.jpg)
在拥抱开源的道路上,意大利似乎走在了最前面.我们已经知道,很多意大利的城市如Udine,Turin,Todi和Turin过去已经选择了开源办公套件以取代微软的Office.现在,位于意大利北部的Emilia-Romagna区也将在下个月完成向Apache OpenOffice的过渡.
### Switching to OpenOffice ###
这次向OpenOffice的转变将会在下个月完成,而且将会覆盖4200个工作站,涉及到10个部门和5个代理部门. 而且,开源文档格式(ODF)也将成为默认的文档格式.向OpenOffice的过渡最初在2013年底被提出来,原本打算在2014年底完成.这次改用OpenOffice从专用办公产品认证费用来说,相信会节约大概2 000 000欧元.
为了使这次搬家顺利,提高内部可操作性,许多定制工具和插件也正在被负责这次搬家的团队开发出来.
本次项目的负责人,Giovanni Grazia对本次"搬家"充满激情,但同时他也会做好应对批评
> "改用新的办公套件不是容易完成的工作,我们借这次机会来拥护免费和开源的软件.一些地区的公务员表示深深的支持,而令一些则感到厌烦, 因为他们已经使用专业产品二十年了.为了处理任何在转变中发生的问题,一个有五个支持人员的团队已经得到了三个IT专家的支持.一个部门接一个部门,逐渐地,我们将完成这次过渡.一步步的,改变正在发生."
#### Best wishes ####
我希望祝Grazia好运,其他的意大利辖区也会使用OpenOffice套件.也希望像法国这样的邻国也会加速拥抱开源的进程.
--------------------------------------------------------------------------------
via: http://itsfoss.com/emiliaromagna-completes-switch-openoffice/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://itsfoss.com/udine-open-source/
[2]:http://itsfoss.com/italian-city-turin-open-source/
[3]:http://itsfoss.com/italian-cities-switch-libreoffice/
[4]:http://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
[5]:http://en.wikipedia.org/wiki/Emilia-Romagna
[6]:https://www.openoffice.org/
[7]:http://www.slwoods.co.uk/?p=2886
[8]:http://itsfoss.com/french-city-toulouse-saved-1-million-euro-libreoffice/

View File

@ -1,129 +0,0 @@
CD音频抓取器——基于图形界面
================================================================================
CD音频抓取器是为了从光盘中提取“剖出”原始数字音频它在一个通常被称为CDDA的格式中并把它保存成文件或以其他形式输出而设计的。这类软件使用户能把数字音频编码成各种格式并能下载和上传在线CD目录服务——一个在线的光盘数据库——中的光盘信息。
复制CD合法吗在美国版权法中把一个原始CD转换成数字文件用于个人使用在被引用时等同于合理使用。然而美国版权法并没有明确的允许或禁止拷贝私人音频CD而且判例法还没有确立出在具体的哪种情况下可以视为合理使用。在英国版权的位置更清晰一些。从2014年开始英国公民制造CDMP3DVD蓝光和电子书的行为成为合法行为。这仅适用于这个人拥有被采集的媒体的实体并且复制品仅用于他们个人使用。对于欧盟的其他国家成员国可以允许私人复制这种特例。
如果你不确定在你生活的国家里版权处于什么位置,在你使用这两页文章中所列举的软件前请查询本地的版权法以确定你处在合法的一边。
在某种程度上提取CD音轨看起来有点多余。如Spotify和Google Play Music这类流服务提供了一个巨大的以通用格式存在的音乐的库无需采集你的CD集。但是如果你已将收藏了一个数量巨大的CD集。能把你的CD转换成可以在便携设备如智能手机、平板和便携式MP3播放器上播放的格式仍然是个诱人的选择。
这两页文章推荐了我最喜欢的音频CD抓取器。我挑了四个最好的图形界面的音频抓取器四个最好的控制台音频抓取器。所有这些应用程序都是在开源许可下发行的。
----------
![](http://www.linuxlinks.com/portal/content2/png/freac.png)
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-freac.png)
fre:ac是个开源音频转换器和CD提取器支持很多种流行格式和编码器。目前这个应用可以在MA3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式间转换。这来源于几种不同形式的LAME编码器。
#### 功能包括: ####
- 易学易用
- MP3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式转换器
- 集成了CDDB/freedb标题数据库支持的CD提取器
- 多核优化的编码器加速了现代PC上的转换速度
- 对于标签和文件名称的全Unicode支持
- 易学易用,当你需要时还提供专家级选项
- 任务列表
- 可以使用Winamp 2加入附件
- 多语言用户界面可以使用41种语言
- 网址: [freac.org][1]
- 开发人员Robert Kausch
- 许可证: GNU GPL v2
- 版本号: 20141005
----------
![](http://www.linuxlinks.com/portal/content2/png/Audex.png)
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Audex.png)
Audex是个简单易用的开源音频CD提取应用。虽然它还处于早期开发阶段这个KDE桌面工具足够稳定、聪明和简单可以使用。
助手可以给LAME、OGG Vorbisoggenc、FLAC、FAACAAC/MP4和RIFF WAVE创建配置文件。除去这个助手你可以定义你自己的配置文件这意味着Audex适用于大部分的命令行编码器。
#### 功能包括: ####
- 可提取CDDA Paranoia
- 提取和编码同时进行
- 文件名采用本地和远程CDDB/FreeDB数据库
- 提供新的CDDB/FreeDB数据库入口
- 类似capitalize的元数据纠正工具
- 多配置文件提取(每个配置文件文件有一个命令行编码器)
- 从互联网上抓取封面并将他们存在数据库中
- 在目标目录中创建播放列表、封面和基于模板的信息文件
- 创建提取和编码协议
- 将文件传送到FTP服务器
- 支持国际化
- 网址: [kde.maniatek.com/audex][2]
- 开发人员: Marco Nelles
- 许可证: GNU GPL v3
- 版本号: 0.79
----------
![](http://www.linuxlinks.com/portal/content2/png/SoundJuicer.png)
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-SoundJuicer.png)
Sound Juicer是个使用GTK+和GStreamer的轻量级CD提取器。它从CD中提取音频并把它转换成音频文件。Sound Juicer还可以直接播放CD中的音轨在提取前提供预览。
由于GStreamer插件它支持任何音频编码包括 MP3、Ogg Vorbis、FLAC和未压缩的PCM格式。
它是GNOME桌面环境已建成的一部分。
#### 功能包括: ####
- 自动通过CDDB给音轨加标签
- 可编码成ogg/vorbis、FLAC和原始WAV
- 编码路径的设置很简单
- 多种流派
- 国际化支持
- 网址:[burtonini.com][3]
- 开发人员: Ross Burton
- 许可证GNU GPL v2
- 版本号3.14
----------
![](http://www.linuxlinks.com/portal/content2/png/ripperX.png)
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-ripperX.png)
ripperX是个开源的图形交互界面用于提取CD音轨并把他们编码成Ogg、MP2、MP3或FLAC格式。它的目的是容易使用只需要点几下鼠标就能转换整张专辑。它支持在CDDB寻找专辑和音轨信息。
他使用cdparanoia把CD音轨转换也就是“提取”成WAV文件然后访问Vorbis/Ogg编码器oggenc把WAV文件转换成OGG文件。它还可以访问flac让WAV文件有无损压缩的表现制成FLAC文件。
#### 功能包括: ####
- 非常简单易用
- 可以把CD音轨提取成WAV、MP3、OGG或FLAC文件
- 支持CDDB查找
- 支持ID3v2标签
- 可暂停提取进程
- 网址:[sourceforge.net/projects/ripperx][4]
- 开发人员Marc André Tanner
- 许可证MIT/X Consortium License
- 版本号2.8.0
--------------------------------------------------------------------------------
转自http://www.linuxlinks.com/article/20150125043738417/AudioGrabbersGraphical.html
作者Frazer Kline
译者:[H-mudcup](https://github.com/H-mudcup)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.freac.org/
[2]:http://kde.maniatek.com/audex/
[3]:http://burtonini.com/blog/computers/sound-juicer
[4]:http://sourceforge.net/projects/ripperx/

View File

@ -0,0 +1,39 @@
一款在Gnome桌面中显示Andorid通知的程序
================================================================================
![Fancy seeing your Android alerts here? You can.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/02/Screen-Shot-2015-02-24-at-17.47.48.png)
在这里看到Android通知很棒么你可以
**你很快就可以在GNOME桌面中看到Andorid通知了这都要归功于一个在开发中的新程序。**
这个新的项目叫“Numtius”这可以让在Andorid手机上收到的通知显示在GNOME桌面上。它会集成在GNOME 3.16中,并且它[重新设计了通知系统][1]这个app和特性会用在其他更多的地方。
这个app的开发者希望在这个月GNOME 3.16发布之前可以完成它将通过蓝牙工作来保证不会传给外部的系统或者使用在线存储。这意味着你的电话必须接近GNOME桌面来保证这个功能可用。
他现在还不能回复短消息或者对提醒采取操作。
开发团队警告说**这是一个早期发布版本**,那些打算重度使用的人们现在应该做好最少功能的准备。
在GNOME桌面上看Android通知的移动端app现在已经在[Google Play商店][2]了GNOME程序已经在Fedora的仓库中了。
开发者已经在Gituhb上开源了Android和GNOME接收端的程序
一个相似的工具[已经在KDE桌面上有了][3] - KDE Connect - 已经有一两年了通过Pushbullet来为使用Chrome的iOS和Android平台在Windows、MAC和Linux桌面上提供相似的功能。
- [Nuntius for Android & GNOME on GitHub][4]
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2015/03/new-app-brings-android-notifications-to-the-gnome-desktop
作者:[Joey-Elijah Sneddon][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2015/02/4-reason-why-gnome-3-16-might-be-the-best-version-yet-gallery
[2]:https://play.google.com/store/apps/details?id=org.holylobster.nuntius
[3]:http://www.omgubuntu.co.uk/2014/06/kde-connect-android-notifications-linux-desktop
[4]:https://github.com/holylobster

View File

@ -0,0 +1,140 @@
2015年你可以买的四款基于Linux的迷你PC
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Linux_Based_Mini_PC.jpg)
在我看来迷你PC将在不久的将来会替代传统桌面电脑。传统桌面的有一个像吹风机那样占据大量空间的风扇。迷你PC在另一方面说很小巧和紧凑。通常是4″或者5″大小可以轻易地放在桌子上。
不仅如此这些迷你PC的无风扇设计是一个优点。当然你可以购买无风扇的常规电脑但是空间占用仍然是一个问题。对我个人来说我觉得迷你PC外观上看着很可爱。如果你不是一个游戏玩家也不想买新的桌面PC我强烈建议你**购买一款基于Linux的迷你PC**。
如果你考虑我的建议,那么你或许想知道该买哪款。不要担心,这篇文章我们会介绍**2015年你可以购买的四款基于Linux的迷你PC**。
### 基于Linux的迷你PC ###
需要注意的是这其中的一些PC可能还不能下单。它们中有些还刚刚公布在不久的将来才会面向公众出售。
#### 1. System76出品的Meerkat ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/system76-meerkat.jpg)
[System76][1] 是一家仅出品基于Ubuntu电脑、笔记本、服务器的电脑生产商。[System76在上周公布了一款基于Ubuntu的迷你PC][2]。让我看一下它的规格:
**规格**
- Intel第五代处理器共有两种选择 i3-5010U 和 i5-5250U
- 最高2TB存储 (M.2 SATA SSD)
- 16 GB DDR3 内存
- i3和i5处理器下相应的Intel HD 5500 和 Intel HD 6000显卡
- 4″ x 4″ 大小
- WiFi
- 1 Gb 网卡
- 2个USB 3.0端口
**价格**
在$500之内还没确定
**发售日期**
美国地区在2015年3月底
#### 2.Compulab出品的Mintbox Mini ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/mintbox-mini.jpeg)
[Compulab][3]将它基于Linux Mint的期间PC设备压缩从Mintbox变为[Mintbox Mini][4]。这个紧凑的版本大小在4″左右。更多的细节如下
**规格**
- AMD A4-6400T 处理器
- Radeon R3 显卡
- 4 GB 内存
- 64 GB SSD
- 2个USB 3.0端口, 3个USB 2.0端口
- 2个HDMI输出端
- 802.11 b/g/n Wifi
- 千兆网卡
- MicroSD读卡器
**价格**
$300左右起售
**发售日期**
2015年第二季度
#### 3. Compulab出品的Utilite2 ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Utilite2-ARM-PC.jpg)
Compulab并不仅仅被Linux Mint所限制。它在去年12月公布了一款运行Ubuntu的ARM桌面PC。大小是3.4″x2.3″,[Utilite2][5]有最适合的性价比。
**规格**
- 高通Snapdragon 600 (APQ8064) 四核 CPU 1.7GHz
- 2GB 内存, 可选32 GB的eMMC mSATA 存储
- 高通 Adreno™ GPU显卡
- 1080p 视频回放和捕捉
- 双天线 WiFi 802.11 和 Bluetooth 4.0
- 千兆网卡, 4个USB2端口和USB OTG
- 蜂窝调制解调器支持
**价格**
常规版售价$192、带硬盘售价$229。运费另付。
**发售日期**
现在就可购买。运送将花费4周。
#### 4. Think Penguin出品的Penguin Pocket Wee ####
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Think_Penguin_Pocket_Wee.jpeg)
[Think Penguin][6]是一家开源硬件生产商。在迷你PC领域它提供了[Penguin Pocket Wee][7]。大小是4.6″x 4.4″x 1.4″ , Penguin Pocket Wee为你提供了大量的配置。你可以选择处理器、存储、网卡等。你可以选择购买预装你喜欢的Linux发行版默认系统是Ubuntu。
下面是默认的配置:
- Intel Core i3 或者 i5处理器最高支持1080p视频
- 最高扩展至 16GB 的 DDR3内存
- Intel HD 显卡
- Wireless N
- 最大250GB的SSD
- 4个USB 3.0接口
- Intel 10/100/1000 千兆网卡
**价格**
基础版本$499起售根据你选择的配置最高价格是$1000。
**发售日期**
现在就可下订单。该公司在美国和英国也有办公地点,所以应也可以运送到南美和欧洲。
### 你会选哪种? ###
我故意没有介绍[Raspberry Pi 2][8]或者其他Linux微电脑如[Intel的电脑棒][9]。原因是我不认为这些微电脑属于迷你PC的范畴。
你怎么看你想用迷你PC代替你的桌面PC么是不是还有我没有在**基于Linux的最好的迷你PC**列表里列出的PC在评论区分享你们的观点吧。
--------------------------------------------------------------------------------
via: http://itsfoss.com/4-linux-based-mini-pc-buy-2015/
作者:[Abhishek][a]
译者:[geekpi](https://github.com/geekpi)
校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:https://system76.com/
[2]:http://itsfoss.com/system76-unveils-ubuntu-based-mini-pc-meerkat/
[3]:http://www.compulab.co.il/
[4]:http://itsfoss.com/mintbox-mini-compact-linux-mint-powered-pc-unveiled/
[5]:http://www.compulab.co.il/utilite-computer/web/utilite2-overview
[6]:https://www.thinkpenguin.com/
[7]:https://www.thinkpenguin.com/gnu-linux/penguin-pocket-wee-gnu-linux-desktop
[8]:http://itsfoss.com/raspberry-pi-2-specs/
[9]:http://itsfoss.com/intels-compute-stick/

View File

@ -1,42 +0,0 @@
Ubuntu 15.04 最终实现你可以设置你的菜单 ‘始终可见’
================================================================================
**如果你不喜欢 Unity 的全局菜单在你的鼠标离开后就淡出你的视野, Ubuntu 15.04 有一些额外附加去实现这点.**
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/locally-integrated-menus-in-ubuntu.png)
最新的Ubuntu 15.04的Unity界面通过在提议通道提供了一个选项**使应用程序菜单在Ubuntu中可见**.
不时尚, 不过时, 没有丢失的菜单.
最大的缺点是它目前只能通过dconf来控制而不是常规的面向用户的选项设置。
我希望如果不是期望能有一个设置这个特性的选项被加入到Ubuntu的【系统设置】>【外观】部分的开发仍在继续。
现在如果你使用的是Ubuntu15.04并启用“建议”的更新通道后你会发现这个开关存在于在COM>规范>Unity>“始终显示菜单”。
### 迟到总比没有要好? ###
开发者计划在Ubuntu14.04 LTS的下一个SRU中反向移植这个选项假设在测试阶段没有任何意外发生
本地集成菜单LIM在Ubuntu 14.04 LTS 首次获得了欣赏,被广泛认为在那些喜欢隐藏方式的和那些不喜欢必须使用鼠标和触摸板的人之间的最佳的折衷方法
虽然本地集成菜单给我们带来了半路上沉默的批评在统一方面,默认的“淡入/淡出”行为给我们留下了令人发痒的伤痕
在Ubuntu 过去的几个版本中已经能够看到积极的去解决早期UX的经历过的关切的问题。在经过几年“打算去做”的列表[我们去年终于得到了本地集成菜单][1],以及不支持的通过点击图标实现[减少和恢复Unity启动程序中不支持的应用程序的选项]。
一年以来我们终于得到一个选项以使应用程序菜单始终显示,无论我们的鼠标在哪里。迟来总比没有好,对不对?
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2015/01/ubuntu-15-04-always-show-menu-bar-option
作者:[Joey-Elijah Sneddon][a]
译者:[JeffDing](https://github.com/JeffDing)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2014/02/locally-integrated-menus-ubuntu-14-04
[2]:http://www.omgubuntu.co.uk/2014/03/minimize-click-launcher-option-ubuntu-14-04

View File

@ -0,0 +1,39 @@
translated by haimingfg
Torvalds: 参加linux内核贡献更加容易找工作
========================================
相比起以往linux内核的发展变是一个专业性的问题作为一个无偿贡献者去贡献的项目今天在"谁写linux"被低调报道出来了。
这个报道由linux基金会编写基金会说自愿者有逐年下降的趋势上年有11.8%的内核开发是由无偿自愿者完成从2012年起由14.6%下滑了19%。
![](http://images.techhive.com/images/article/2015/02/screen-shot-2015-02-17-at-5.25.43-pm-100568680-medium.idge.png)
即使是这样在最新的谁写linux里面报道无偿贡献者还是主要的共享来源共有11,968改变整体来说有12.4%是好的企业贡献者共同占比越来越多有超过80%的内核贡献是有有尝的专业开发者来完成linux基金会说。
根据 linus Torvalds 说,这个有偿开发者趋势不会改变太多这个内核发展的本身。
他向全世界人说,我认为不会改变太多的一个原因是不会有更多的无偿自愿者因为编写内核就会更加快找到工作而离开。
Torvalds讲到linux发展改变有很多其他原因很自然的新的贡献者会经常冒出来有很多都是原来的开发者有着10年的经验被很多对linux感兴趣的公司抢着去做。
他说“开始我们是自愿者但我们这几天很开心被请去开发linux”
Torvalds 开始抽离了他的开发角色根据报道在3.10的内核版本里面他个人发布329补丁,占04% 逐渐地,子系统维护人员自己会检查与合并他们的代码。
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2885339/application-development/torvalds-people-who-start-writing-kernel-code-get-hired-really-quickly.html
作者:[Jon Gold][a]
译者:[haimingfg](https://github.com/haimingfg)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Jon-Gold/

View File

@ -0,0 +1,86 @@
Linux存储的未来
================================================================================
> **摘要**Linux系统的软件开发者们正致力于使Linux支持更多种类的文件和存储方案。
波士顿 - 在[Linux基金会][1]最近的[Vault][2]展示会上,全都是关于文件系统和存储方案的讨论。你可以会想关于这两个主题并没有什么展值得讨论的最新进展,但事实并非如此。
![](http://zdnet2.cbsistatic.com/hub/i/r/2015/03/12/c8f92cc2-b963-4238-80a0-d785ec93698c/resize/770x578/08d93a8a393d3f50b2a56e6b0e7a0ca9/btrfs-1.jpg)
对Linux文件系统比如Btrfs和存储方案的支持正在持续发展中。 -- Facebook
自从Linus提出“[讨厌的、生锈的机械磁盘]”的观点以来存储技术已经走过一段长路Linux也始终保持跟进。比如说近几年来[闪存已经逐渐成为企业服务器的主要存储器][4][持久化内存][5]也正给我们带来拥有DRAM一般快速的存储。与此同时大数据、云计算和容器化技术正给Linux引入新的应用场景。
为了应对挑战Linux开发者们一边继续扩展已有的文件系统和存储程序一边致力于开发新的方案。
### Btrfs ###
例如Chris Mason一位来自Facebook的软件工程师也是[Btrfs][6]对外宣称Butter FS的维护者之一说明了Facebook是如何使用这种文件系统。Btrfs拥有文件系统固有的许多优点比如既能处理大量的小文件也能处理大小可达16EB的单个文件支持RAID的baked烦请校正补充内置的文件系统压缩以及集成了对多种存储设备的支持。
当然Facebook的服务器也运行在Linux上。更准确地讲是运行在一个基于[CentOS][7]的内部发行版上它是基于3.10和3.18版的内核。对Facebook来说真正的收获是Btrfs在由Facebook持续的更新用户操作带来的巨大的IOPS每秒钟输入输出的操作数的负载下依旧保持稳定和快速。
这就是好消息但坏消息是对于像MySQL一样的传统DBMS数据库管理系统来说Btrfs还是太慢了。对此Facebook采用了[XFS][8]。为了协同这两种文件系统Facebook又用到了一种叫做[Gluster][9]的开源分布式文件系统。
Facebook一直与上游的负责Btrfs的Linux内核开发者保持密切联系致力于提高Btrfs在DBMS上的速度。Mason和他的同事在[RocksDB][10]数据库上使用Btrfs以达成目标RocksDB是一种为提供快速存储开发的持久化键值存储系统可以作为客户端服务器模式数据库的基础部分。
当然Btrfs也还存在一些问题比如如果有用户傻到用数据把硬盘几乎要撑爆时Btrfs会在硬盘被完全装满前阻止用户继续写入。对某些工程来说比如[CoreOS][12]一款依赖容器化的企业版Linux系统这种问题是致命的。[因此CoreOS已经切换到使用xt4和overlayfs了][11]。
Btrfs的开发人员正致力于数据去重。在这一点上当文件系统中拥有超过一个的相同文件时会自动删除多余文件。正如Mason所说“并非每个人都需要这个功能但如果有人需要那就是真的需要
在正在开展的重要性工作中Btrfs并非是唯一的文件系统。John Spary[Red Hat][13]的一位高级软件工程师,提到了另一款名为[Ceph][14]的分布式文件系统。
### Ceph FS ###
Ceph提供了一种分布式对象存储方案和文件系统反过来它依托于一种使用商用硬件集群的弹性的、可扩展的存储模型RADOS。配合RADOS块设备RBD和RADOS对象网关RGWCeph提供了一种[POSIX][15]接口的文件系统 -- Ceph FS。尽管RBD和RGW已经在生产环境中使用了一段时间但使Ceph FS适用于生产的工作还是进行中。
[Rad Hat在收购Ceph的母公司Inktank后][16]在2014年一直致力于使CephFS适用于生产环境。不管怎样Spray说“有些人已经在生产中使用了它我们对此表示担忧毕竟它还没有准备好。”然而Spray也补充说“这具有两面性因为一方面这是让人担心的另一方面我们又从用户获得了真正有用的反馈和测试。”
这是因为尽管Ceph对象存储很好地支持扩展但Ceph Fs作为一种兼容POSIX的文件系统却很难实现扩展。比如作为一种分布式文件系统Ceph FS必须解决来自多个客户端的多个写操作。这会导致全有或全无的情况即一个客户端可以写入但其它客户端必须等待也会产生文件加锁的情形即相比普通文件系统中更加复杂。
但是Ceph FS仍值得去做正如Spray所说“因为兼容POSIX的文件系统是操作系统通用的。”这并不是说Ceph FS就一无是处。“它并不是支离破碎的相反它奏效了。所缺的是修复和监控工具。”
Red Hat目前正致力于获得[fsck][17]和日志修复工具、快照强化、更好客户端访问控制以及云与容器的集成。尽管Ceph FS到目前为止只是一种有潜力或者没前景的文件系统但仍然值得用在生产环境中。
### 文件与存储的差别与目标 ###
至于文件系统和存储上的更大问题Jeff Layton[Primary Data][18]的一位高级软件工程师,解释说为了“在不断开电源的情况下给灾难性的电源故障提供测试”,大量的相关工作正在进行中。这些测试很快会被集成到[xftests][19]中它是Linux文件系统测试的黄金标准。
Rik van Riel一位Red Hat的主要软件工程师谈到了解决持久化内存产品的问题。你可以把它们作为存储器或者内存。但是如果你现在把它们作为内存来用是不能为备份创建快照。真正的问题是van Riel确信人们会尝试使用持久的内存作这两种用途这会导致出现和“如果不备份你会如何处理一个200GB大小的持久化内存数据库”类似的情形发生。更糟的是现在日志系统也无法和持久化的内存一起发挥作用。
正确的答案是什么呢Linux至今还没有一个但编程人员们正在努力寻找答案。
因此尽管Linux支持很多文件系统可以使用这里以外的任何一种存储器来存储数据但是仍然有很多工作要做。技术从来不会止步不前。Linux正运行在移动设备、桌面电脑、服务器、云端和超级计算机上等几乎所有的主流设备上必须跟紧存储的发展步伐不管它们以何种形式出现。
--------------------------------------------------------------------------------
via: http://www.zdnet.com/article/linux-storage-futures/
作者:[Steven J. Vaughan-Nichols][a]
译者:[KayGuoWhu](https://github.com/KayGuoWhu)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.zdnet.com/meet-the-team/us/sjvn/
[1]:http://www.linuxfoundation.org/
[2]:http://events.linuxfoundation.org/events/vault
[3]:http://www.wired.com/2012/10/linus-torvalds-hard-disks/
[4]:http://www.zdnet.com/article/sandisk-launches-infiniflash-aims-to-bring-flash-array-costs-down/
[5]:http://events.linuxfoundation.org/sites/events/files/eeus13_wheeler.pdf
[6]:https://btrfs.wiki.kernel.org/index.php/Main_Page
[7]:http://www.centos.org/
[8]:http://oss.sgi.com/projects/xfs/
[9]:http://www.gluster.org/
[10]:http://rocksdb.org/
[11]:http://lwn.net/Articles/627232/
[12]:https://coreos.com/
[13]:http://www.redhat.com/
[14]:http://ceph.com/
[15]:http://pubs.opengroup.org/onlinepubs/9699919799/
[16]:http://www.zdnet.com/article/red-hat-acquires-inktank-for-175m/
[17]:http://linux.die.net/man/8/fsck
[18]:http://primarydata.com/
[19]:http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfstests.git;a=summary

View File

@ -1,126 +0,0 @@
使用Nemiver调试器找出C/C++程序中的bug
================================================================================
如果你读过[my post on GDB][1],你就会明白我认为一个调试器对一段C/C++程序来说意味着多么的重要和有用。然而如果一个像GDB的命令行对你而言听起来更像一个问题而不是一个解决方案那么你也许会对Nemiver更感兴趣。[Nemiver][2] 是一款基于GTK的独立图形化用于C/C程序的调试器同时它以GDB作为其后端。最令人佩服的是其速度和稳定性Nemiver时一个非常可靠具备许多优点的调试工具。
### Nemiver的安装 ###
基于Debian发行版它的安装时非常直接简单如下
$ sudo apt-get install nemiver
在Arch Linux中安装如下
$ sudo pacman -S nemiver
在Fedora中安装如下
$ sudo yum install nemiver
如果你选择自己变异,[GNOME website][3]中最新源码包可用。
最令人欣慰的是它能够很好地与GNOME环境像结合。
### Nemiver的基本用法 ###
启动Nemiver的命令
$ nemiver
你也可以通过执行一下命令来启动:
$ nemiver [path to executable to debug]
你会注意到如果在调试模式下执行编译g标志表示GCC将会更有帮助。
还有一个优点是Nemiver的快速加载所以你应该可以马上看到主屏幕的默认布局。
![](https://farm9.staticflickr.com/8679/15535277554_d320f6692c_c.jpg)
默认情况下,断点通常位于主函数的第一行。这样就可以空出时间让你去认识调试器的基本功能:
![](https://farm9.staticflickr.com/8669/16131832596_bc68ae18a8_o.jpg)
- Next line (mapped to F6)
- Step inside a function (F7)
- Step out of a function (Shift+F7)
- 下一行 映射到F6
- 执行内部行数F7
- 执行外部函数Shift+F7 ## 我不确定这个保留哪个都翻译出来了 ##
但是由于我个人的喜好是“Run to cursor运行至光标该选项使你的程序运行精确至你光标下的行并且默认映射到F11.
下一步断点通常是容易使用的。最快捷的方式是使用F8设置一个断点在相应的行。但是Nemiver也有一个更富在的菜单在“Debug”项这允许你在一个特定的函数行数二进制位置文件的位置或者类似一个异常分支或者exec的事件。
![](https://farm8.staticflickr.com/7579/16157622315_d680a63896_z.jpg)
你也可以通过追踪来查看一个变量。在“Debug”选项你可以通过命名来匹配一个表达式来检查。然后也可以通过将其添加到列表中以方便访问。这可能是最有用的一个功能虽然我从未因为浓厚的兴趣将鼠标悬停在一个变量来获取它的值。值得注意的是将鼠标放置在相应位置时不生效的。如果想要让它更好地工作Nemiver是可以看到结构并给所有成员的变量赋值。
![](https://farm8.staticflickr.com/7465/15970310470_7ed020c613.jpg)
谈到方便地访问信息我也非常欣赏这个程序的平面布局。默认情况下代码在上个部分标签在下半部分。这授予你访问中断输出、文本追踪、断点列表、注册地址、内存映射和变量控制。但是注意到在“Edit”“Preferences”“Layout”下你可以选择不同的布局包括动态修改。
![](https://farm9.staticflickr.com/8606/15971551549_00e4cdd32e_c.jpg)
![](https://farm8.staticflickr.com/7525/15535277594_026fef17c1_z.jpg)
自然而然一旦你设置了所有短点观察点和布局您可以在“File”下很方便地保存以免你不小心关掉Nemiver。
### Nemiver的高级用法 ###
到目前为止我们讨论的都是Nemiver的基本特征例如你马上开始喝调试一个简单的程序需要什么。如果你有更高的药求特别是对于一些更佳复杂的程序你应该会对接下来提到的这些特征更感兴趣。
#### 调试一个正在运行的进程 ####
Nemiver允许你连接到一个正在运行的进程进行调试。在“File”菜单你可以过滤出正在运行的进程并连接到这个进程。
![](https://farm9.staticflickr.com/8593/16155720571_00e4cdd32e_z.jpg)
#### 通过TCP连接远程调试一个程序 ####
Nemiver支持远程调试当你在一台远程机器设置一个轻量级调试服务器你可以通过调试服务器启动Nemiver从另一台机器去调试承载远程服务器上的目标。如果出于某些原因你不能在远程机器上吗很好地驾驭Nemiver或者GDB那么远程调试对于你来说将非常有用。在“File”菜单下指定二进制文件、共享库的地址和端口。
![](https://farm8.staticflickr.com/7469/16131832746_c47dee4ef1.jpg)
#### 使用你的GDB二进制进行调试 ####
如果你想自行通过Nemiver进行编译你可以在“Edit编辑”“Preferences首选项”“Debug调试”下给GDB制定一个新的位置。如果你想在Nemiver使用GDB的定制版本那么这个选项对你来说是非常实用的。
#### 循序一个子进程或者父进程 ####
Nemiver是可以兼容一个子进程或者附近成的。想激活这个功能请到“Debugger”下面的“Preferences首选项”。
![](https://farm8.staticflickr.com/7512/16131832716_5724ff434c_z.jpg)
总而言之Nemiver大概是我最喜欢的没有IDE的调试程序。在我看来它甚至可以击败GDB并且[命令行][4]程序对我本身来说更接地气。所以,如果你从未使用过的话,我会强烈推荐你使用。我只能庆祝我们团队背后给了我这么一个可靠、稳定的程序。
你对Nemiver有什么见解你是否也考虑它作为独立的调试工具或者仍然坚持使用IDE让我们在评论中探讨吧。
--------------------------------------------------------------------------------
via: http://xmodulo.com/debug-program-nemiver-debugger.html
作者:[Adrien Brochard][a]
译者:[disylee](https://github.com/disylee)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:http://xmodulo.com/gdb-command-line-debugger.html
[2]:https://wiki.gnome.org/Apps/Nemiver
[3]:https://download.gnome.org/sources/nemiver/0.9/
[4]:http://xmodulo.com/recommend/linuxclibook

View File

@ -1,196 +0,0 @@
在linux中如何通过nload来监控网络使用情况
================================================================================
nload 是一个免费的linux工具,通过提供两个简单的图形化界面来帮助linux用户和系统管理员来实时监控网络流量以及宽带使用情况:一个作为进入流量,一个作为流出流量.
我是真的很喜欢用**nload**来在屏幕上显示当前的下载速度总的流入量和平均下载速度等信息。nload工具的报告图非常容易理解最重要的是这些信息真的非常有用。
在使用手册上说到,在默认情况下会监控所有网络设备。但是你可以轻松地指定你想要监控的设备,而且可以可以通过方向键头在不同的网络设备之间进行转换。另外还有很多的选项可用,例如 -r选项确定以毫秒来刷新显示时间间隔默认时间间隔值是500毫秒-m选项用来实时显示多个设备流量图在使用该选项时不会显示 -u选项用来设置显示流量数字的单元类型另外还有许多其他的选项将会在该教程中探索和练习。
### 如何将 nload安装到你的linux机器上 ###
**Ubuntu** 和 **Fedora** 用户可以从默认的软件仓库中容易地安装。
在Ubuntu上使用以下命令进行安装。
sudo apt-get install nload
在Fedora上使用以下命令进行安装。
sudo yum install nload
**CentOS**用户该怎么办呢? 只需要在你的机器上输入以下命令,通用能够达到相同的结果--殊途同归。
sudo yum install nload
以下的命令会帮助你在OpenBSD系统中安装nload.
sudo pkg_add -i nload
linux机器上的另外一个非常有效的安装软件的方式就是编译源代码通过下载并安装最新的版本意味着能够获得更好地性能更酷的特性以及越少的bug数。
### 如何通过源代码安装nload ###
在从源代码安装nload之前你需要首先下载源代码。 我通常使用wget工具来进行下载--该工具在许多linux机器上默认可用。该免费工具帮助用户以非交互式的方式从网络上下载文件并支持以下协议
- HTTP
- HTTPS
- FTP
通过以下命令来进入到**/tmp**目录中。
cd /tmp
然后在你的终端中输入以下命令就可以将最新版本的nload下载到你的linux机器上了。
wget http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz
如果你不喜欢使用wget工具也可以通过简单的一个鼠标点击轻松地从[官网][1]上下载源代码。
由于该软件非常轻巧,其下载过程几乎在瞬间就会完成。接下来的步骤就是通过**tar**工具来将下载的源代码包进行解压。
tar归档工具可以用来从磁带或硬盘文档中存储或解压文件该工具具有许多可用的选项但是我们只需要下面的几个选项来执行我们的操作。
1. **-x** to extract files from an archive
1. **-x** 从文档中解压文件
1. **-v** to run in verbose mode
1. **-v** 使用繁琐模式运行--用来输入详细信息
1. **-f** to specify the files
1. **-f** 用来指定文件
例如:
tar xvf example.tar
现在你学会了如何使用tar工具我可以非常肯定你会知道如何从命令行中解压.tar文档。
tar xvf nload-0.7.4.tar.gz
之后使用cd命令来进入到nload*目录中
cd nload*
在我的系统上看起来是这样的
oltjano@baby:/tmp/nload-0.7.4$
然后运行下面这个命令来为你的系统配置包
./configure
此时会有一大波僵尸会在你的屏幕上显示出来,下面的一个屏幕截图描述了它的样子。
![configuring packages for nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload1.png)
在上述命令完成之后通过下面的命令来编译nload。
make
![compiling nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload2.png)
好了,终于....下载通过以下命令可以将nload安装在你的机器上了。
sudo make install
![installing nload from source](http://blog.linoxide.com/wp-content/uploads/2015/01/nload3.png)
安装好nload之后就是时间来让你学习如何使用它了。
###如何使用nload###
我喜欢探索,所以在你的终端输入以下命令.
nload
看到了什么?
我得到了下面的结果。
![running nload](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.png)
如上述截图可以看到,我得到了以下信息:
### 流入量###
#### 当前下载速度####
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.1.png)
#### 平均下载速度####
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.2.png)
#### 最小下载速度####
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.3.png)
#### 最大下载速度####
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.4.png)
#### 总的流入量按字节进行显示####
![](http://blog.linoxide.com/wp-content/uploads/2015/01/nload4.5.png)
### 流出量 ###
类似的同样适用于流出量
#### 一些nload有用的选项####
使用选项
-u
用来设置显示流量单元的类型.
下面的命令会帮助你使用MBit/s显示单元
nload -u m
下面的屏幕截图显示了上述命令的结果.
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload5.png)
尝试以下命令然后看看有什么结果.
nload -u g
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload6.png)
同时还有一个**-U**选项.根据手册描述,该选项基本上与-u选项类似,只是用在合计数据. 我测试了这个命令,老实说,当你需要检查总的流入与流出量时非常有用.
nload -U G
![nload running on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload7.png)
从上面的截图中可以看到,**nload -U G** 使用Gbyte来显示数据总量.
另外一个我喜欢使用的有用选项是 **-t**. 该选项用来设置刷新显示事件间隔为毫秒,默认值为500毫秒.
我会通过下面的命令做一些小的实验.
nload -t 130
那么上述命令做了什么呢,它讲刷新显示时间间隔设置为130毫秒. 通常推荐不要讲该时间间隔值设置为小于100毫秒,因为nload在计算过程中可能会生成带错的报告.
另外的一个选项为 **-a**. 在你想要设置计算平均值的时间窗口秒数长度时使用,默认该值为300秒.
那么当你想要监控指定的网络设备该如何呢? 非常容易, 想下面这样简单地指定设备或者列出想要监控的设备列表.
nload wlan0
![nload monitoring wlan0 on linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png)
下面的语法可帮助你监控指定的多个设备.
nload [options] device1 device2 devicen
例如,使用下面的命令来监控eth0和eth1.
nload wlan0 eth0
如果不带选项来运行nload,那么它会监控监控所有自动检测到的设备,你可以通过左右方向键来显示其中的任何一个设备的信息.
--------------------------------------------------------------------------------
via: http://linoxide.com/monitoring-2/monitor-network-usage-nload/
作者:[Oltjano Terpollari][a]
译者:[theo-l](https://github.com/theo-l)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/oltjano/
[1]:http://www.roland-riegel.de/nload/nload-0.7.4.tar.gz

View File

@ -1,55 +0,0 @@
Linux 常见问题解答--如何使用yum来下载RPM包而不进行安装.
================================================================================
> **问题**:我想从Red Hat's的标准仓库中下载一个RPM包,我能使用yum命令来下载一个RPM包但是不进行安装吗?
yum是基于Red Hat的系统(如CentOS,Fedora,RHEl)上的默认包管理器.使用yum,你可以安装或者更新一个RPM包,并且他会自动解决包依赖关系.但是如果你只想将一个RPM包下载到你的系统上该怎么办呢? 例如,你可能想要获取一些RPM包在以后使用,或者将他们安装在另外的机器上.
这里说明了如何从yum仓库上下载一个RPM包.
### 方法一:yum###
yum命令本身就可以用来下载一个RPM包,标准的yum命令提供了`--downloadonly(只下载)`的选项来达到这个目的.
$ sudo yum install --downloadonly <package-name>
默认情况下,一个下载的RPM包会保存在下面的目录中:
/var/cache/yum/x86_64/[centos/fedora-version]/[repository]/packages
以上的[repository]表示下载包的来源仓库的名称(例如,base,fedora,updates)
如果你想要讲一个包下载到一个指定的目录(如/tmp):
$ sudo yum install --downloadonly --downloaddir=/tmp <package-name>
注意,如果下载的包包含了任意没有满足的依赖关系,yum将会把所有的依赖关系包下载,但是都不会被安装.
另外一个重要的事情时,在CentOS/RHEL 6或更早期的版本中,你需要安装一个单独yum插件(名称为 yum-plugin-downloadonly)才能使用`--downloadonly`命令选项:
$ sudo yum install yum-plugin-downloadonly
如果没有该插件,你会在使用yum时得到以下错误:
Command line error: no such option: --downloadonly
![](https://farm9.staticflickr.com/8627/15571201803_38390aae75_c.jpg)
### 方法二: Yumdownloader###
另外一个下载RPM包的方法就是通过一个专门的包下载工具--yumdownloader. 这个工具时yum工具包(包含了用来进行yum包管理的帮助工具套件)的子集.
$ sudo yum install yum-utils
下载一个RPM包:
$ sudo yumdownloader <package-name>
下载的包会被保存在当前目录中.你需要使用root权限,因为yumdownloader会在下载过程中更新包索引文件.与yum命令不同的是,任何依赖包不会被下载.
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/yum-download-rpm-package.html
译者:[theo-l](https://github.com/theo-l)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,111 +0,0 @@
系统性能优化支招使用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上。
而如果使用的是内核ramdiskramdisk将在/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

View File

@ -0,0 +1,97 @@
如何在ubuntu14.04上安装轻量级的Budgie桌面(v8)
================================================================================
Budgie是为Linux发行版定制的旗舰桌面也是一个定制工程。为思想前卫的用户设计致力于简单和简洁。它的一个巨大优势是它不是别的项目的fork版本是从都到尾都独立的。
[Budgie桌面][1]与GNOME栈紧密结合使用先进的技术从而提供一个可选择的桌面体验。出于开源理念这个桌面之后也能在别的Linux发行版中看到。
现在Budgie能够通过面板的设置达到和GNOME2桌面相似的使用体验。
### 0.8版的特点 ###
- 任务栏:支持应用锁定到任务栏
- 任务栏:使用.desktop文件来配置quicklists菜单
- 任务栏:使用.desktop文件来配置图标分辨率
- 任务栏:支持有通知时蓝色闪烁
- 面板:支持默认深色主体
- 添加菜单条的小组件
- 面板:自动隐藏菜单条和工具条(这配置为手动)
- 面板:支持屏幕边缘处阴影
- 面板动态支持gnome面板主题
- 运行对话框:虚拟刷新
- Budgie菜单: 增加紧凑模式,并默认采用
- Budgie菜单: 按照使用顺序排列菜单项
- Budgie菜单: 移除旧的电源选项
- 编辑器: 在UI中增加所有的菜单选项
- 支持从GNOME 3.10 升级到3.16
- wm: 关闭工作区的动画(v8之后)
- wm: 改变壁纸时更好的动画
### 重要信息 ###
- Budgie [0.8版发行版][2]目前只是beta
- 无本地网络管理可以通过使用ubuntu的小组件解决
- Budgie 是为Evolve OS设计的因此这个PPA可能会有bug
- GNOME 主题比Ubuntu本地的主题效果更好
- Ubuntu的滚动栏将不在工作
- 如果你想了解的更多可以访问Evolve OS网站
### 安装 ###
现在我们将在Ubuntu14.04 LTS中安装我们自己的轻量级Budgie桌面。首先我们要把PPA源添加到我们的Ubuntu中。执行以下命令
$ sudo add-apt-repository ppa:evolve-os/ppa
![添加Budgie的ppa源](http://blog.linoxide.com/wp-content/uploads/2015/01/budgie-desktop-ppa.png)
添加完ppa之后运行下面的命令更新本地软件仓库。
$ sudo apt-get update
然后只要执行下面的命令安装
$ sudo apt-get install budgie-desktop
![安装 Budgie Desktop](http://blog.linoxide.com/wp-content/uploads/2015/02/install-budgie-desktop.png)
**注意点**
这是一个活跃的开发版本,一些主要的特点可能还不是特别的完善,如:网络管理器为数不多的控制组件无通知系统斌并且无法将app锁定到任务栏。
作为工作区你能够禁用滚动栏,通过设置一个默认的主题并且通过下面的命令退出当前的会话
$ gnome-session-quit
![退出 Gnome 会话](http://blog.linoxide.com/wp-content/uploads/2015/02/gnome-seesion-quit.png)
### 登录Budgie会话 ###
安装完成之后我们能在登录时选择机进入budgie桌面。
![选择桌面会话](http://blog.linoxide.com/wp-content/uploads/2015/02/session-select.png)
### Budgie 桌面环境 ###
![Budgie 桌面环境](http://blog.linoxide.com/wp-content/uploads/2015/02/budgie-desktop.png)
### 注销当前用户 ###
$ budgie-sessioon --logout
### 结论 ###
Hurray! We have successfully installed our Lightweight Budgie Desktop Environment in our Ubuntu 14.04 LTS "Trusty" box. As we know, Budgie Desktop is still underdevelopment which makes it a lot of stuffs missing. Though its based on Gnomes GTK3, its not a fork. The desktop is written completely from scratch, and the design is elegant and well thought out. If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy Budgie Desktop 0.8 :-)
Budgie桌面当前正在开发过程中因此有目前有很多功能的缺失。虽然它是基于Gnome但不是完全的复制。Budgie是完全从零开始实现它的设计是优雅的并且正在不断的完善。
--------------------------------------------------------------------------------
via: http://linoxide.com/ubuntu-how-to/install-lightweight-budgie-v8-desktop-ubuntu/
作者:[Arun Pyasi][a]
译者:[johnhoow](https://github.com/johnhoow)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/arunp/
[1]:https://evolve-os.com/budgie/
[2]:https://evolve-os.com/2014/11/16/courageous-budgie-v8-released/

View File

@ -0,0 +1,153 @@
如何在Linux中用命令行工具管理KVM虚拟环境
================================================================================
在我们[KVM系列专题][1]的第四部分我们将会一起讨论下在命令行界面下来管理KVM环境。我们分别用virt-install和virsh命令行工具来创建并配置虚拟机和存储池用qemu-img命令行工具来创建并管理磁盘映像。
![KVM Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/KVM-Management-in-Linux.jpg)
Linux系统的KVM管理
在这篇文章里没有什么新的概念,我们只是用命令行工具重复之前所做过的事情,也没有什么前提条件,都是相同的过程,之前的文章我们都讨论过。
### 第一步: 配置存储池 ###
Virsh命令行工具是一款管理virsh客户域的用户界面。virsh程序能在命令行中运行所给的命令以及它的参数。
本节中我们要用它给我们的KVM环境创建存储池。想知道关于这个工具的更多信息用以下这条命令。
# man virsh
**1. 用virsh带pool-define-as的命令来定义新的存储池你需要指定名字、类型和类型参数。**
本例中我们将名字取为Spool1类型为目录。默认情况下你可以提供五个参数给该类型
- source-host
- source-path
- source-dev
- source-name
- target
对于目录类型我们需要用最后一个参数“target”来指定存储池的路径其它参数项我们可以用“-”来填充。
# virsh pool-define-as Spool1 dir - - - - "/mnt/personal-data/SPool1/"
![Create New Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Storage-Pool.png)
创建新存储池
**2. 查看环境中我们所有的存储池,用以下命令。**
# virsh pool-list --all
![List All Storage Pools](http://www.tecmint.com/wp-content/uploads/2015/02/List-All-Storage-Pools.png)
列出所有存储池
**3. 现在我们来构造存储池了,用以下命令来构造我们刚才定义的存储池。**
# virsh pool-build Spool1
![Build Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Build-Storage-Pool.png)
构造存储池
**4. 用virsh带pool-start的命令来激活并启动我们刚才创建并构造完成的存储池。**
# virsh pool-start Spool1
![Active Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Active-Storage-Pool.png)
激活存储池
**5. 查看环境中存储池的状态,用以下命令。**
# virsh pool-list --all
![Check Storage Pool Status](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Status.png)
查看存储池状态
你会发现Spool1的状态变成了已激活。
**6. 对Spool1进行配置让它每次都能被libvirtd服务自启动。**
# virsh pool-autostart Spool1
![Configure KVM Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Configure-Storage-Pool.png)
配置KVM存储池
**7. 最后来看看我们新的存储池的信息吧。**
# virsh pool-info Spool1
![Check KVM Storage Pool Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Information.png)
查看KVM存储池信息
恭喜你Spool1已经准备好待命接下来我们试着创建存储卷来使用它。
### 第二步: 配置存储卷/磁盘映像 ###
现在轮到磁盘映像了用qemu-img命令在Spool1中创建一个新磁盘映像。获取更多细节信息可以查看man手册。
# man qemu-img
**8. 我们应该在qemu-img命令之后指定“create, check,…”等等操作、磁盘映像格式、你想要创建的磁盘映像的路径和大小。**
# qemu-img create -f raw /mnt/personal-data/SPool1/SVol1.img 10G
![Create Storage Volume](http://www.tecmint.com/wp-content/uploads/2015/02/Create-Storage-Volumes.png)
创建存储卷
**9. 通过使用带info的qemu-img命令你可以获取到你的新磁盘映像的一些信息。**
![Check Storage Volume Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Volume-Information.png)
查看存储卷信息
**警告**: 不要用qemu-img命令来修改被运行中的虚拟机或任何其它进程所正在使用的映像那样映像会被破坏。
现在是时候来创建虚拟机了。
### 第三步: 创建虚拟机 ###
**10. 现在到最后一个环节了在最后一步中我们将用virt-install命令来创建虚拟机。virt-install是一个用来创建新的KVM虚拟机命令行工具它使用“libvirt”管理程序库。想获取更多细节同样可以查看man手册。**
# man virt-install
要创建新的KVM虚拟机你需要用到带以下所有信息的命令。
- Name: 虚拟机的名字。
- Disk Location: 磁盘映像的位置。
- Graphics : 怎样连接VM通常是SPICE。
- vcpu : 虚拟CPU的数量。
- ram : 以兆字节计算的已分配内存大小。
- Location : 指定安装源路径。
- Network : 指定虚拟网络通常是virbr0网桥。
# virt-install --name=rhel7 --disk path=/mnt/personal-data/SPool1/SVol1.img --graphics spice --vcpu=1 --ram=1024 --location=/run/media/dos/9e6f605a-f502-4e98-826e-e6376caea288/rhel-server-7.0-x86_64-dvd.iso --network bridge=virbr0
![Create New Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Virtual-Machines.png)
创建新的虚拟机
**11. 你会看到弹出一个virt-vierwer窗口像是在通过它在与虚拟机通信。**
![Booting Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Booting-Virtual-Machine.jpeg)
虚拟机启动程式
![Installation of Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Installation-of-Virtual-Machine.jpeg)
虚拟机安装过程
### 结论 ###
以上就是我们KVM教程的最后一部分了当然我们还没有完全覆盖到全部我们只是打了个擦边球所以现在该轮到你来好好地利用这些丰富的资源来做自己想做的事了。
- [KVM Getting Started Guide][2]
- [KVM Virtualization Deployment and Administration Guide][3]
--------------------------------------------------------------------------------
via: http://www.tecmint.com/kvm-management-tools-to-manage-virtual-machines/
作者:[Mohammad Dosoukey][a]
译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/dos2009/
[1]:http://www.tecmint.com/install-and-configure-kvm-in-linux/
[2]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html
[3]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html

View File

@ -0,0 +1,176 @@
局域网中实现Ubuntu和Windows共享文件夹
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_windows.jpeg)
本文全面详细地向你描述了**在Ubuntu中如何实现局域网内的文件夹共享**。
你的家中是不是有多台电脑当你需要从一台Ubuntu电脑向另一台电脑传输数据时是不是必须用到U盘或SD卡你是否也觉得这个方法很烦人我想肯定是。本文的目的就是使你在局域网内快速方便地传输文件、文档和其它较大的数据来节省你的宝贵时间。只需一次设置然后轻点鼠标你就可以自由地**在Ubuntu和Windows之间共享文件**当然这对其它Linux系统同样使用。不要担心这很容易操作不会花费太多时间。
除此之外尽管本文是在Ubuntu上进行实践但这个教程在其它Linux系统上同样有用。
#### 在Ubuntu上实现局域网共享文件夹 ####
如果你的系统是Ubuntu 14.04、14.10或12.04有两个方法可以使你通过局域网在搭载Windows或其他Linux的电脑上共享本地文件。
- 对局域网中的每个用户提供无密码共享
- 仅限特定访问,提供文件夹密码保护
这篇文章包括两种方法,你可以选择你想用的那种。
### 1. 局域网无密码共享文件夹 ###
#### 步骤一:####
为了在Ubuntu上实现局域网共享文件夹右键点击打算共享的文件夹并选择“Local Network Share”
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Share_Folder_Ubuntu.jpeg)
**可能有用的故障方案**如果在右键菜单中看不到“Local Network Share”的选项那就新建一个终端使用下面的命令去安装nautlius-share
sudo apt-get install nautilus-share
然后重启Nautilus。可以选择注销再登录或者使用这个命令:
nautilus -q
#### 步骤二:####
一旦点击“Local Network Share”就会出现共享文件夹的选项。只需选中“Share this folder”这一项
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_1.jpeg)
可能的故障方案:如果提示共享服务还未安装,就像下图所示,那就点击安装服务,按照提示操作。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_2.jpeg)
#### 步骤三:####
一旦选中“Share this folder”的选项就会看到按钮“Create Share”变成可用了。你也可以允许其他用户在共享文件夹中编辑文件。选项“Guest access”也是如此。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_folder_Ubuntu_3.png)
你会看到文件夹图标已经显示为共享的。如果要停止共享文件夹只需取消“Share this floder”这个选项。
这个方法就是这么简单使得局域网中的任何人都可以访问共享文件夹中的文件。在正常情况下你会选择这种方式。因为家用局域网中的电脑通常都是可信电脑。但情况也不总是这样。如果你只是想特定的用户才能访问怎么办这个时候就需要Samba服务器了。我们在本文的第二部分讨论这种方法。
### 2. 在Ubuntu上使用密码保护实现局域网共享文件夹###
为了达到目的首先需要配置Samba服务器。事实上在这篇教程的前一部分我们已经用到了Samba只是我们没有刻意强调。在介绍如何在Ubuntu上搭建Samba服务器实现局域网共享的方法之前先快速预览一下[Samba][1]到底是什么。
#### Samba是什么 ####
Samba是一个允许用户通过网络共享文件、文档和打印机的软件包无论是在Linux、Windows还是Mac上。它适用于所有的主流平台可以在所有支持系统上流畅运行。下面是维基百科的介绍
> Samba是一款重新实现SMB/CIFS网络协议的自由软件最初由安德鲁·垂鸠开发。在第三版中Smaba不仅支持通过不同的Windows客户端访问及分享SMB的文件夹及打印机还可以集成到Windows Server域名作为主要域名控制站PDC或者域名成员。它也可以作为Active Directory域名的一部分。
#### 在Ubuntu上安装Samba服务器 ####
你可以很方便地在Ubuntu电脑上安装Samba。安装前请先更新系统以便安装任何可用的更新。
sudo apt-get update && apt-get upgrade
然后按照这条命令安装samba和少量所需的软件包
sudo apt-get install samba samba-common system-config-samba python-glade2 gksu
一旦安装完成Samba服务器就可以从图形界面配置Samba来分享文件。
#### 在Ubuntu上配置Samba服务器 ####
从dash打开Samba配置工具
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Setup-Samba.png)
进入到**Preference->Server Settings**。尽管默认已经设置好,可能就是你需要的。但在某些情况下你可能需要做一些改动。
在Server Setting中可以看到两个选项卡BasicSecurity。在Basic选项卡下的选项含义如下
- 工作组 - 用户要连接的电脑所在工作组的名字。比如如果你想连接到一台Windows电脑你就要输入Windows电脑的工作组名字。在Windows的Samba服务器设置中已经默认设置好统一的工作组名字。但如果你有不同的工作组名字就在这个字段中输入自定义的工作组名字。在Windows 7中获取工作组名字右击计算机图标进到属性就能看到Windows工作组名字。
- 描述 - 其他用户看到的你的电脑名字。不要使用空格或计算机不支持(望更正!)的字符。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-server-settings.png)
设置samba服务器允许Guests可用是不明智的所以没必要修改安全设置保持原样即可。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Samba-Security-Settings-compressed.jpg)
这就搞定了你已经搭建好Samba服务器距离实现网络共享第一个文件夹的目标不远了
#### 为网络文件共享创建一个系统用户 ####
现在我们需要为网络共享文件创建一个系统用户。下面是非常简单的步骤:
- 在Systems Settings下点击**User Accounts**。
- 点击**unlock**使其可用,以及+**plus**)图标。
- 点击+plus图标创建一个新的系统用户。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/create-system-user1.jpg)
如上图所示需要输入Full name。当你输入Full nameUsername会自动填充为Full name。因为创建这个用户是为了共享文件所以还要指定Account Type为**Standard**’。
完成上述步骤点击添加你就创建好一个系统用户。这个用户还没有被激活所以需要为其设置密码来激活。确保Users accounts界面已经解锁。点击Account disabled。输入一个新密码然后确认密码点击Change。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/activate-system-user.jpg)
到目前为止我们已经安装并配置好Samba已经创建了一个系统用户以通过这个账户在网络上共享文件而且也已经激活了新用户。现在来到配置Samba的最后一步然后就可以共享文件夹了。
#### 添加Samba新用户 ####
打开Samba在Preference先点击Samba Users。填写弹出的对话框下面是其中几个字段的说明
**Unix Username** - 在这种情况下,我选择刚才创建的用户。
**Windows Username** - 输入你要访问的Windows电脑的用户名。
**Samba Password** - 输入你要访问的Windows电脑的密码。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-user-setting.jpg)
完成后点击OK。现在做个深呼吸。你已经在Samba的帮助下成功创建一个网络。然后重启网络或Samba服务准备好和其它电脑共享文件。
sudo restart smbd && sudo restart nmbd
#### 通过网络共享文件夹或文件 ####
在图形用户界面下通过Samba共享文件是很简单的。点击Plus图标会看到如图所示的对话框
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/share-files-and-folders.jpg)
填写完这些字段。在Directory浏览要共享的文件夹。你会看到的字段的含义如下
- **Share name** 是其它人会看到的文件夹名字。
- **Description** 是要共享内容的简单描述。
- **Writeable** 默认情况下共享的文件夹是read only。如果允许网络上的其他用户修改它们设置为writable。
- **Visiable** 当你点击Visiable时就像它的名字一样共享文件夹就对网络上的其他人可见。
现在你可以设置共享文件夹的权限。点击Access选项选择想要共享文件夹的用户。当你选择对所有人允许访问后这个文件夹就对网络上的所有人可见。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Screenshot-from-2015-02-28-202031.png)
最后点击OK完成共享。现在这个文件夹就与你想要共享的用户实现共享。你已经完成了网络共享文件。还有其它要做的吗还不知道如何从网络上移除文件夹
#### 移除共享文件夹 ####
在网络共享一段时间后,我们也需要移除其中的一些文件夹。操作很简答,下面就是我们要做的。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/remove-shared-folder-from-network.jpg)
全部搞定我们也可以使用终端进行网络文件共享但这样没有本文介绍的方法这么容易。如果你确实想知道命令行操作我会再写一篇关于在Linux上使用命令行实现网络文件共享的文章。
所以,你是怎么找到这篇教程的呢?我希望看了这篇教程你可以**很容易地在Ubuntu和Windows之间共享文件**。如果你有任何问题或建议,请再评论里说出来。
这篇教程是在Kalc的请求下写出的。如果你也想你可以[请求你自己的教程][2]。我们很乐意帮助你和面临同样问题的读者解决问题。
--------------------------------------------------------------------------------
via: http://itsfoss.com/share-folders-local-network-ubuntu-windows/
作者:[Mohd Sohail][a]
译者:[KayGuoWhu](https://github.com/KayGuoWhu)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/sohail/
[1]:http://en.wikipedia.org/wiki/Samba_%28software%29
[2]:http://itsfoss.com/request-tutorial/

Some files were not shown because too many files have changed in this diff Show More