Merge pull request #9 from LCTT/master

Update 20150319
This commit is contained in:
martin qi 2015-03-19 19:47:20 +08:00
commit dedb64380e
57 changed files with 3468 additions and 1681 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——音乐播放器中的瑞士军刀——带着值得歌颂的全新发行版回归了。 ** **在悄无声息得过了一年之后Tomahawk——音乐播放器中的瑞士军刀——带着值得歌颂的全新发行版回归了。 **
@ -9,35 +8,35 @@ Tomahawk音乐播放器带着新形象、新功能回来了
### 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) ![](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) ![Tomahawk supports the Sound Menu](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/tomahawk-controllers.jpg)
支持声音菜单 *支持声音菜单*
### Tomahawk0.8发行版的亮点 ### ### Tomahawk0.8发行版的亮点 ###
- 新的交互界面 - 新的交互界面
- 对Beats Music的支持 - 对Beats Music的支持
- 对Google Play Music的支持保存的和播放全部链接 - 对Google Play Music的支持保存的和播放全部链接
- 对拖拽iTunesSpotify这类网站的链接的支持 - 支持拖拽iTunesSpotify这类网站的链接
- 正在播放的提示 - 正在播放的提示
- Android应用测试版 - Android应用测试版
- 收件箱的改进 - 收件箱的改进
### 在Ubuntu上安装Tomahawk0.8 ### ### 在Ubuntu上安装Tomahawk0.8 ###
作为一个流媒体音乐的大用户,我会在接下来的几天里体验一下这个应用软件,然后提供一个关于他的改变的更全面的赏析。与此同时,你也可以尝尝鲜。 作为一个流媒体音乐的粉丝,我会在接下来的几天里体验一下这个应用软件,然后提供一个关于他的改变的更全面的赏析。与此同时,你也可以尝尝鲜。
在Ubuntu 14.04 LTS和Ubuntu 14.10上可以通过官方PPA获得Tomahawk。 在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] 作者:[Joey-Elijah Sneddon][a]
译者:[H-mudcup](https://github.com/H-mudcup) 译者:[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/) 荣誉推出 本文由 [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) ![](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基础、列表、类、函数、模块。 Python基础、列表、类、函数、模块。HTML/CSS (基础)。
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是默认安装的。下面的你命令可以让你看到安装的版本。 在大多数Linux发行版上Python是默认安装的。下面的你命令可以让你看到安装的版本。
[root@linux-vps ~]# python -V [root@linux-vps ~]# python -V
Python 2.7.5 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 groupinstall 'Development Tools'
[leo@linux-vps] yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel [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] cd Python-3.4.2
[leo@linux-vps] ./configure [leo@linux-vps] ./configure
[leo@linux-vps] make [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 [leo@linux-vps] make altinstall
成功安装后你应该可以用下面的命令进入Python3.4的shell了。 成功安装后你应该可以用下面的命令进入Python3.4的shell了。
@ -49,20 +48,18 @@ HTML/CSS (基础)
Python有它自己的包管理去与yum和apt-get相似。你将需要它来下载、安装和卸载包。 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 list
[leo@linux-vps] pip3.4 uninstall "packagename" [leo@linux-vps] pip3.4 uninstall "packagename"
### Python虚拟环境 ### ### Python虚拟环境 ###
在Python中虚拟环境是一个你项目依赖的目录。隔离项目的一个好主意是使用不同的依赖。这可以让你不用sudo命令就能安装包。 在Python中虚拟环境是一个放置你的项目的依赖环境的目录。这是一个将带有不同的依赖环境的项目隔离的好办法。它可以让你不用sudo命令就能安装包。
[leo@linux-vps] mkdir python3.4-flask [leo@linux-vps] mkdir python3.4-flask
[leo@linux-vps] cd python3.4-flask [leo@linux-vps] cd python3.4-flask
[leo@linux-vps python3.4-flask] pyvenv-3.4 venv [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系统信息项目激活虚拟环境 ### ### 为我们的Linux系统信息项目激活虚拟环境 ###
@ -74,21 +71,21 @@ Python有它自己的包管理去与yum和apt-get相似。你将需要它来
### 使用pip安装flask ### ### 使用pip安装flask ###
让我们继续安装第一个模块flask框架它可以处理路由和渲染我们app的模板。 让我们继续安装第一个模块flask框架它可以处理访问路由和渲染显示我们app的模板。
[leo@linux-vps python3.4-flask]pip3.4 install flask [leo@linux-vps python3.4-flask]pip3.4 install flask
### 在flask中创建第一个应用 ### ### 在flask中创建第一个应用 ###
第一步创建你app的目录 ####第一步创建你app的目录
[leo@linux-vps python3.4-flask] mkdir 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/static
[leo@linux-vps python3.4-flask] mkdir app/templates [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 [leo@linux-vps python3.4-flask] vim app/_init_.py
from flask import Flask from flask import Flask
@ -96,7 +93,7 @@ Python有它自己的包管理去与yum和apt-get相似。你将需要它来
app = Flask(__name__) app = Flask(__name__)
from app import index from app import index
这个文件创建一个Flask的新的实例并加载我们存储在index.py文件中的python程序这个文件我们之后会创建。 这个文件创建一个Flask的新的实例并加载我们存储在index.py文件中的python程序——这个文件我们之后会创建。
[leo@linux-vps python3.4-flask]vim app/index.py [leo@linux-vps python3.4-flask]vim app/index.py
from app import app from app import app
@ -110,7 +107,7 @@ Python有它自己的包管理去与yum和apt-get相似。你将需要它来
return return
flask中的路由由路由装饰器处理。这用于给函数绑定URL flask中的访问路由通过“路由装饰器”处理。它用于将一个 URL 绑定到函数
@app.route('/') @app.route('/')
@app.route('/index') @app.route('/index')
@ -123,7 +120,7 @@ flask中的路由由路由装饰器处理。这用于给函数绑定URL。
subprocess.Popen(['ls', -l],stdout=subprocess.PIPE,stderr=subprocess.PIPE) subprocess.Popen(['ls', -l],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen的communicate方法来访问输出 stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen的communicate方法来访问输出。
out,error = cmd.communicate() out,error = cmd.communicate()
@ -133,7 +130,7 @@ stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen
关于subprocess模块更多的信息会在教程的最后给出。 关于subprocess模块更多的信息会在教程的最后给出。
第三步创建一个html模板来显示我们命令的输出。 ####第三步创建一个html模板来显示我们命令的输出。
要做到这个我们使用flask中的Jinja2模板引擎来为我们渲染。 要做到这个我们使用flask中的Jinja2模板引擎来为我们渲染。
@ -162,31 +159,31 @@ stdout和stderr会相应地存储命令的输出和错误。你可以使用Popen
{% endfor %} {% endfor %}
Jinja2模板引擎允许你使用“{{ … }}”分隔符来打印结果,{% … %}来做循环和赋值。我使用“decode()”方法来格式化。 Jinja2模板引擎允许你使用“{{ … }}”分隔符来输出结果,{% … %}来做循环和赋值。我使用“decode()”方法来格式化。
第四步运行app ####第四步运行app
[leo@linux-vps python3.4-flask]vim run.py [leo@linux-vps python3.4-flask]vim run.py
from app import app from app import app
app.debug = True app.debug = True
app.run(host='174.140.165.231', port=80) 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] chmod +x run.py
[leo@linux-vps python3.4-flask] python3.4 run.py [leo@linux-vps python3.4-flask] python3.4 run.py
![](http://techarena51.com/wp-content/uploads/2014/12/install-python3-flask.png) ![](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) ![](http://techarena51.com/wp-content/uploads/2014/12/install-python3-flask-on-linux.png)
你可以在[这里][3]浏览代码。 你可以在[这里][3]浏览完整的代码。
这是一个对flask的简短教程我建议你阅读下面的教程和文档来更深入地了解。 这是一个对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 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] 作者:[Leo G][a]
译者:[geekpi](https://github.com/gekpi) 译者:[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/) 荣誉推出 本文由 [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' 语句** - **'print' 语句**
- **查询 (/proc, /sys etc)** - **查询 (/proc, /sys )**
- **跟踪 (strace/ltrace)** - **跟踪 (strace/ltrace)**
- **Valgrind (memwatch)** - **Valgrind (memwatch)**
- **GDB** - **GDB**
@ -12,42 +14,44 @@
### 1.'print' 语句 ### ### 1.'print' 语句 ###
这是一个基本的原始的调试问题的方法。 我们可以在程序中插入print语句来了解控制流和变量值。 虽然这是一个简单的技术, 但它有一些缺点的。 程序需要进行编辑以添加'print'语句,然后不得不重新编译,重新运行来获得输出。 如果要调试的程序相当大,这是一个耗时的方法。 这是一个基本的原始的调试问题的方法。 我们可以在程序中插入print语句来了解控制流和变量值。 虽然这是一个简单的技术 但它有一些缺点。 程序需要进行编辑以添加'print'语句,然后必须重新编译,重新运行来获得输出。 如果要调试的程序相当大,这是一个耗时的方法。
### 2. 查询 ### ### 2. 查询 ###
在某些情况下,我们需要弄清楚在一个运行在内核中的进程的状态和内存映射。为了获得这些信息,我们不需要在内核中插入任何代码。 相反,可以用 /proc 文件系统。 在某些情况下,我们需要弄清楚在一个运行在内核中的进程的状态和内存映射。为了获得这些信息,我们不需要在内核中插入任何代码。 相反,可以用 /proc 文件系统。
/proc 是一个伪文件系统,系统一启动运行就收集着运行时系统的信息 (cpu信息, 内存容量 等)。 /proc 是一个伪文件系统,系统一启动运行就收集着运行时系统的信息 (cpu信息, 内存容量等)。
![output of 'ls /proc'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-output.png) ![output of 'ls /proc'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-output.png)
'ls /proc'的输出
*'ls /proc'的输出*
正如你看到的, 系统中运行的每一个进程在/proc文件系统中有一个以进程id命名的项。每个进程的细节信息可以在进程id对应的目录下的文件中获得。 正如你看到的, 系统中运行的每一个进程在/proc文件系统中有一个以进程id命名的项。每个进程的细节信息可以在进程id对应的目录下的文件中获得。
![output of 'ls /proc/pid'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-pid.png) ![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文件系统内的所有条目超出了本文的范围。一些有用的列举如下
- /proc/cmdline -> 内核命令行 - /proc/cmdline -> 内核命令行
- /proc/cpuinfo -> 关于处理器的品牌,型号信息等 - /proc/cpuinfo -> 关于处理器的品牌,型号信息等
- /proc/filesystems -> 文件系统的内核支持的信息 - /proc/filesystems -> 文件系统的内核支持的信息
- /proc//cmdline -> 命令行参数传递到当前进程 - /proc/\<pid>/cmdline -> 命令行参数传递到当前进程
- /proc//mem -> 当前进程持有的内存 - /proc/\<pid>/mem -> 当前进程持有的内存
- /proc//status -> 当前进程的状态 - /proc/\<pid>/status -> 当前进程的状态
### 3. 跟踪 ### ### 3. 跟踪 ###
strace的和ltrace是两个在Linux中用来追踪程序的执行细节的跟踪工具 strace的和ltrace是两个在Linux中用来追踪程序的执行细节的跟踪工具
#### strace: #### #### strace: ####
strace拦截和记录系统调用并且由它来接收的信号。对于用户,它显示了系统调用,传递给它们的参数和返回值。 strace的可以附着到已在运行的进程中或到一个新的进程。它作为一个针对开发者和系统管理员的诊断调试工具是很有用的。它也可以用来当为一个通过跟踪不同的程序调用来了解系统的工具。这个工具的好处是不需要源代码和程序不需要重新编译。 strace拦截和记录系统调用及其接收的信号。对于用户它显示了系统调用、传递给它们的参数和返回值。strace的可以附着到已在运行的进程或一个新的进程。它作为一个针对开发者和系统管理员的诊断、调试工具是很有用的。它也可以用来当做一个通过跟踪不同的程序调用来了解系统的工具。这个工具的好处是不需要源代码,程序也不需要重新编译。
使用strace的基本语法是 使用strace的基本语法是
**strace command** **strace 命令**
strace有各种各样的参数。可以检查看strace的手册页来获得更多的细节。 strace有各种各样的参数。可以检查看strace的手册页来获得更多的细节。
@ -58,11 +62,12 @@ strace的输出非常长我们通常不会对显示的每一行都感兴趣
用'-o'选项,命令的输出可以被重定向到文件。 用'-o'选项,命令的输出可以被重定向到文件。
![output of strace filtering only the open system call](http://blog.linoxide.com/wp-content/uploads/2014/12/strace-output.png) ![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: ####
ltrace跟踪和记录一个进程的动态运行时库的调用收到的信号。它也可以跟踪一个进程所作的系统调用。它的用法是类似与strace。 ltrace跟踪和记录一个进程的动态运行时库的调用及其收到的信号。它也可以跟踪一个进程所作的系统调用。它的用法是类似与strace。
**ltrace command** **ltrace command**
@ -73,25 +78,26 @@ ltrace跟踪和记录一个进程的动态运行时库的调用和收到
所有可用的选项请参阅ltrace手册。 所有可用的选项请参阅ltrace手册。
![output of ltrace capturing 'strcmp' library call](http://blog.linoxide.com/wp-content/uploads/2014/12/ltrace-output.png) ![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 ### ### 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) 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呈现错误的输出 这是valgrind呈现错误的输出
![output of valgrind showing heap block overrun and memory leak](http://blog.linoxide.com/wp-content/uploads/2014/12/Valgrind.png) ![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 ### ### 5. GDB ###
@ -144,15 +151,15 @@ GDB是来自自由软件基金会的调试器。它对定位和修复代码中
- 检查所需信息 - 检查所需信息
- 改变程序中的数据 等。 - 改变程序中的数据 等。
你也可以附加一个崩溃的程序coredump到GDB并分析故障的原因。 你也可以将一个崩溃的程序coredump附着到GDB并分析故障的原因。
GDB提供很多选项来调试程序。 然而我们将介绍一些重要的选择来感受如何开始使用GDB。 GDB提供很多选项来调试程序。 然而我们将介绍一些重要的选择来感受如何开始使用GDB。
如果你还没有安装GDB可以在这里下载 [GDB官方网站][2]. 如果你还没有安装GDB可以在这里下载[GDB官方网站][2]。
#### 编译程序: #### #### 编译程序: ####
为了用GDB调试程序必须使用gcc的'-g'选项进行编译。将以操作系统的本地格式产生调试信息GDB利用这些信息来工作。 为了用GDB调试程序必须使用gcc的'-g'选项进行编译。将以操作系统的本地格式产生调试信息GDB利用这些信息来工作。
下面是一个简单的程序example1.c执行被零除用来显示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) ![An example showing usage of gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-example.png)
展示GDB用法的例子
*展示GDB用法的例子*
#### 调用 GDB: #### #### 调用 GDB: ####
通过在命令行中执行'gdb'来启动gdb: 通过在命令行中执行'gdb'来启动gdb:
![invoking gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb.png) ![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行代码。 源码可以在GDB中打印。默认情况下'list'命令会打印10行代码。
- **list <linenum>**: 列出'linenum'行周的源码 - **list <linenum>**: 列出'linenum'行周的源码
- **list <function>**: 从'function'开始列出源码 - **list <function>**: 从'function'开始列出源码
- **disas <function>**: 显示该函数机器代码 - **disas <function>**: 显示该函数机器代码
@ -217,11 +226,11 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
使用GDB我们可以在必要的地方设置断点观察点等来停止程序。 使用GDB我们可以在必要的地方设置断点观察点等来停止程序。
- **break <location>**: 在'location'设置一个断点。当在程序执行到这里时断点将被击中,控制权被交给用户。 - **break <location>**: 在'location'设置一个断点。当在程序执行到这里时断点将被击中,控制权被交给用户。
- **watch <expr>**: 当'expr'被程序写而且它的值发生变化时GDB将停止 - **watch <expr>**: 当'expr'被程序写而且它的值发生变化时GDB将停止
- **catch <event>**: 当'event'发生时GDB停止 - **catch <event>**: 当'event'发生时GDB停止
- **disable <breakpoint>**: 禁用指定断点 - **disable <breakpoint>**: 禁用指定断点
- **enable <breakpoint>**: 启用指定断点 - **enable <breakpoint>**: 启用指定断点
- **delete <breakpoint>**: 删除 断点/观察点/捕获点。 如果没有传递参数默认操作是在所有的断点 - **delete <breakpoint>**: 删除 断点/观察点/捕获点。 如果没有传递参数默认操作是在所有的断点
- **step**: 一步一步执行程序 - **step**: 一步一步执行程序
- **continue**: 继续执行程序,直到执行完毕 - **continue**: 继续执行程序,直到执行完毕
@ -232,21 +241,18 @@ GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的
GDB还有更多的可用选项。里面GDB使用help选项了解更多详情。 GDB还有更多的可用选项。里面GDB使用help选项了解更多详情。
![getting help within gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-help.png) ![getting help within gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-help.png)
在GDB种获得帮助
*在GDB中获得帮助*
### 总结 ### ### 总结 ###
在这篇文章中我们已经看到不同类型的Linux用户空间的调试工具。总结以上所有内容这是些什么时候使用该什么的快速指南: 在这篇文章中我们已经看到不同类型的Linux用户空间的调试工具。总结以上所有内容如下是什么时候使用该什么的快速指南:
基本调试,获得关键变量 - print 语句 - 基本调试,获得关键变量 - print 语句
- 获取有关文件系统支持可用内存CPU运行程序的内核状态等信息 - 查询 /proc 文件系统
获取有关文件系统支持可用内存CPU运行程序的内核状态等信息 - 查询 /proc 文件系统 - 最初的问题诊断,系统调用或库调用的相关问题,了解程序流程 strace / ltrace
- 应用程序内存空间的问题 valgrind
最初的问题诊断,系统调用或库调用的相关问题,了解程序流程 strace / ltrace - 检查应用程序运行时的行为,分析应用程序崩溃 gdb
应用程序内存空间的问题 valgrind
检查应用程序运行时的行为,分析应用程序崩溃 gdb。
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -254,7 +260,7 @@ via: http://linoxide.com/linux-how-to/user-space-debugging-tools-linux/
作者:[B N Poornima][a] 作者:[B N Poornima][a]
译者:[mtunique](https://github.com/mtunique) 译者:[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/) 荣誉推出 本文由 [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来保护你的apache服务器。我假设你已经安装了apache和fail2ban。对于安装请参考[另外一篇教程][1]。
### 什么是 Fail2ban 监狱 ### ### 什么是 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] [ssh]
enabled = true enabled = true
@ -24,15 +24,15 @@ SSH监狱的配置定义了这些参数
- **[ssh]** 方括号内是监狱的名字。 - **[ssh]** 方括号内是监狱的名字。
- **enabled**:是否启用监狱 - **enabled**:是否启用监狱
- **port** 端口的数字 (或者数字对应的名称). - **port** 端口号(或者对应的服务名称)
- **filter** 检测攻击的检测规则 - **filter** 检测攻击的日志解析规则
- **logpath** 检测的日志文件 - **logpath** 检测的日志文件
- **maxretry** 禁止前失败的最大数 - **maxretry** 最大失败次
- **banaction** 禁止操作 - **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) ![](https://farm8.staticflickr.com/7538/16076581722_cbca3c1307_b.jpg)
@ -40,7 +40,7 @@ SSH监狱的配置定义了这些参数
### 启用预定义的apache监狱 ### ### 启用预定义的apache监狱 ###
`fail2ban`的默认安装为Apache服务提供了一些预定义监狱以及过滤器。我要启用这些内建的Apache监狱。由于Debian和红买配置的稍微不同我会分别它们的配置文件。 `fail2ban`的默认安装为Apache服务提供了一些预定义监狱和过滤器。我要启用这些内建的Apache监狱。由于Debian和RedHat配置的稍微不同我会分别提供它们的配置文件。
#### 在Debian 或者 Ubuntu启用Apache监狱 #### #### 在Debian 或者 Ubuntu启用Apache监狱 ####
@ -50,7 +50,7 @@ SSH监狱的配置定义了这些参数
---------- ----------
# detect password authentication failures # 检测密码认证失败
[apache] [apache]
enabled = true enabled = true
port = http,https port = http,https
@ -58,7 +58,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/apache*/*error.log logpath = /var/log/apache*/*error.log
maxretry = 6 maxretry = 6
# detect potential search for exploits and php vulnerabilities # 检测漏洞和 PHP 脆弱性扫描
[apache-noscript] [apache-noscript]
enabled = true enabled = true
port = http,https port = http,https
@ -66,7 +66,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/apache*/*error.log logpath = /var/log/apache*/*error.log
maxretry = 6 maxretry = 6
# detect Apache overflow attempts # 检测 Apache 溢出攻击
[apache-overflows] [apache-overflows]
enabled = true enabled = true
port = http,https port = http,https
@ -74,7 +74,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/apache*/*error.log logpath = /var/log/apache*/*error.log
maxretry = 2 maxretry = 2
# detect failures to find a home directory on a server # 检测在服务器寻找主目录的尝试
[apache-nohome] [apache-nohome]
enabled = true enabled = true
port = http,https port = http,https
@ -100,7 +100,7 @@ SSH监狱的配置定义了这些参数
---------- ----------
# detect password authentication failures # 检测密码认证失败
[apache] [apache]
enabled = true enabled = true
port = http,https port = http,https
@ -108,7 +108,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log logpath = /var/log/httpd/*error_log
maxretry = 6 maxretry = 6
# detect spammer robots crawling email addresses # 检测抓取邮件地址的爬虫
[apache-badbots] [apache-badbots]
enabled = true enabled = true
port = http,https port = http,https
@ -117,7 +117,7 @@ SSH监狱的配置定义了这些参数
bantime = 172800 bantime = 172800
maxretry = 1 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] [apache-noscript]
enabled = true enabled = true
port = http,https port = http,https
@ -125,7 +125,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log logpath = /var/log/httpd/*error_log
maxretry = 6 maxretry = 6
# detect Apache overflow attempts # 检测 Apache 溢出攻击
[apache-overflows] [apache-overflows]
enabled = true enabled = true
port = http,https port = http,https
@ -133,7 +133,7 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log logpath = /var/log/httpd/*error_log
maxretry = 2 maxretry = 2
# detect failures to find a home directory on a server # 检测在服务器寻找主目录的尝试
[apache-nohome] [apache-nohome]
enabled = true enabled = true
port = http,https port = http,https
@ -141,9 +141,9 @@ SSH监狱的配置定义了这些参数
logpath = /var/log/httpd/*error_log logpath = /var/log/httpd/*error_log
maxretry = 2 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 port = http,https
filter = apache-botsearch filter = apache-botsearch
logpath = /var/log/httpd/*error_log logpath = /var/log/httpd/*error_log
@ -175,7 +175,7 @@ SSH监狱的配置定义了这些参数
![](https://farm8.staticflickr.com/7572/15891521967_5c6cbc5f8f_c.jpg) ![](https://farm8.staticflickr.com/7572/15891521967_5c6cbc5f8f_c.jpg)
你也可以手动禁止或者解禁IP地址 你也可以手动禁止或者解禁IP地址
要用制定监狱禁止IP 要用制定监狱禁止IP
@ -187,7 +187,7 @@ SSH监狱的配置定义了这些参数
### 总结 ### ### 总结 ###
本篇教程解释了fail2ban监狱如何工作以及如何使用内置的监狱来保护Apache服务器。依赖于你的环境以及要保护的web服务器类型你或许要适配已存在的监狱或者编写自定义监狱和日志过滤器。查看outfail2ban的[官方Github页面][3]来获取最新的监狱和过滤器示例。 本篇教程解释了fail2ban监狱如何工作以及如何使用内置的监狱来保护Apache服务器。依赖于你的环境以及要保护的web服务器类型你或许要调整已有的监狱或者编写自定义监狱和日志过滤器。查看outfail2ban的[官方Github页面][3]来获取最新的监狱和过滤器示例。
你有在生产环境中使用fail2ban么分享一下你的经验吧。 你有在生产环境中使用fail2ban么分享一下你的经验吧。
@ -197,11 +197,11 @@ via: http://xmodulo.com/configure-fail2ban-apache-http-server.html
作者:[Dan Nanni][a] 作者:[Dan Nanni][a]
译者:[geekpi](https://github.com/geekpi) 译者:[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/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/nanni [a]:http://xmodulo.com/author/nanni
[1]: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://xmodulo.com/how-to-protect-ssh-server-from-brute-force-attacks-using-fail2ban.html [2]:http://linux.cn/article-5067-1.html
[3]:https://github.com/fail2ban/fail2ban [3]:https://github.com/fail2ban/fail2ban

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 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) ![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 系统上,你可能还需要首先安装以下软件包: 如果您知道通常的 configure/make 的操作流程的话,可以获取其源码并随时都可以编译运行。在 Ubuntu14.10 系统上,你可能还需要首先安装以下软件包:
sudo apt-get install gnome-common yelp-tools libcanberra-gtk3-dev libudisks2-dev gobject-introspection sudo apt-get install gnome-common yelp-tools libcanberra-gtk3-dev libudisks2-dev gobject-introspection
如果您得到并运行起来,已经玩转的话,给我们分享下您的感受! 如果您可以运行起来,已经玩转的话,给我们分享下您的感受!
此项目托管在 GitHub 上,盼望对其提出问题缺陷和发起 pull 请求,在上面也可以找到压缩包下载,进行手动安装。 此项目托管在 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] 作者:[Joey-Elijah Sneddon][a]
译者:[runningwater](https://github.com/runningwater) 译者:[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/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author [a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:https://github.com/hughsie/gnome-multi-writer/ [1]:https://github.com/hughsie/gnome-multi-writer/
[2]:https://github.com/hughsie/gnome-multi-writer/

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 ### ### 1. Code::Blocks ###
![](https://farm8.staticflickr.com/7520/16089880989_10173db27b_c.jpg) ![](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 ### ### 2. Eclipse ###
![](https://farm8.staticflickr.com/7522/16276001255_66235a0a69_c.jpg) ![](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 ### ### 3. Geany ###
![](https://farm9.staticflickr.com/8573/16088461968_c6a6c9e49a_c.jpg) ![](https://farm9.staticflickr.com/8573/16088461968_c6a6c9e49a_c.jpg)
牺牲了很多特色功能但是增加了很多灵活性,[Geany][6]就是这样一款与Eclipse对立的软件。但是对于它所缺乏的地方比如说没有调试器, Geany用一些漂亮小巧的特色功能弥补了它们:一个可以做笔记的区域、基于模板创作、代码大纲、自定义快捷键和插件管理。相比于现在的IDEGeany仍然是一款作用广泛的文本编辑器然而因为它的功能亮点和它的界面设计所以我把它放在这份列表里。 牺牲了很多特色功能但是增加了很多灵活性,[Geany][6]就是这样一款与Eclipse对立的软件。但是对于它所缺乏的地方比如说没有调试器, Geany用一些漂亮小巧的特色功能弥补了它们一个可以做笔记的区域、基于模板创作、代码大纲、自定义快捷键和插件管理。相比于现在的IDEGeany仍然是一款作用广泛的文本编辑器然而因为它的功能亮点和它的界面设计所以我把它放在这份列表里。
### 4. MonoDevelop ### ### 4. MonoDevelop ###
@ -30,19 +30,19 @@ Linux上有哪些比较好的C/C++ IDE
![](https://farm8.staticflickr.com/7514/16088462018_7ee6e5b433_c.jpg) ![](https://farm8.staticflickr.com/7514/16088462018_7ee6e5b433_c.jpg)
它身上有着强烈的“GNOME感”[Anjuta][8]的外观很具争议。我倾向于把它看作是带着调试器的Geany升级版但是它的界面实际上要复杂得多。我确实很享受能在项目、文件夹和代码大纲视图之间来回切换的标签系统我本想用诸如更多的快捷方法来移动文件然而这是一个很好的提供了显著编译功能和构建选项的工具它能够支持哪些很有特点的需求。 它身上有着强烈的“GNOME即视感”,[Anjuta][8]的外观很具争议。我倾向于把它看作是带着调试器的Geany升级版但是它的界面实际上要复杂得多。我确实很享受能在项目、文件夹和代码大纲视图之间来回切换的标签系统我本想用诸如更多的快捷方法来移动文件然而这是一个很好的提供了显著编译功能和构建选项的工具它能够支持哪些很有特点的需求。
### 6. Komodo Edit ### ### 6. Komodo Edit ###
![](https://farm8.staticflickr.com/7502/16088462028_81d1114c84_c.jpg) ![](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 ### ### 7. NetBeans ###
![](https://farm8.staticflickr.com/7569/16089881229_98beb0fce3_c.jpg) ![](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 ### ### 8. KDevelop ###
@ -56,7 +56,7 @@ Linux上有哪些比较好的C/C++ IDE
留在最后的不代表是最差的,[CodeLite][12]展现给你一种传统的编程规则却仍然能让你从它身上那特有的感觉上有所收获即使它的界面一开始的确让我想到了Code::Blocks和Anjuta只是不包括大量的插件库。无论你想要比较文件、插入一条版权块、定义缩略语或者用Git来工作总有一款插件适合你。如果我不得不挑点毛病我想说它缺乏一些符合我口味的导航快捷键但这是真的。 留在最后的不代表是最差的,[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] 作者:[Adrien Brochard][a]
译者:[ZTinoZ](https://github.com/ZTinoZ) 译者:[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/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

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 GNU/Linux 系统][1],这篇教程将在原有教程的基础上,增加对新的 Ubuntu 发行版本的支持,并介绍更多的工具。
假如你想清理你的 Ubuntu 主机,你可以按照以下的一些简单步骤来移除所有不需要的垃圾文件。 假如你想清理你的 Ubuntu 主机,你可以按照以下的一些简单步骤来移除所有不需要的垃圾文件。
### 移除多余软件包 ### ## 移除多余软件包 ##
这又是一个内置功能,但这次我们不必使用新得立包管理软件(Synaptic Package Manager),而是在终端中达到目的。 这又是一个内置功能,但这次我们不必使用新得立包管理软件(Synaptic Package Manager),而是在终端中达到目的。
@ -26,9 +26,9 @@ sudo apt-get clean
sudo apt-get autoremove sudo apt-get autoremove
``` ```
### 移除不需要的本地数据 ### ## 移除不需要的本地数据 ##
为达到此目的,我们需要安装 `localepurge` 软件,它将自动移除一些不需要的本地数据。这个软件是一个简单的脚本,它将从那些 不再需要的本地文件和本地联机手册( man pages ) 所占用的空间中回收磁盘空间。这个软件将在任何 apt 安装命令运行时 被自动激活。 为达到此目的,我们需要安装 `localepurge` 软件它将自动移除一些不需要的本地化数据LCTT 译注:即各种语言翻译)。这个软件是一个简单的脚本,它将从那些不再需要的本地文件和本地联机手册( man pages ) 所占用的空间中回收磁盘空间。这个软件将在任何 apt 安装命令运行时 被自动激活。
在 Ubuntu 中安装 `localepurge` 在 Ubuntu 中安装 `localepurge`
@ -54,9 +54,9 @@ sudo apt-get install discus
> localepurge: Disk space freed in /usr/share/locale: 41860K > localepurge: Disk space freed in /usr/share/locale: 41860K
### 移除 孤包 ### ## 移除孤包 ##
假如你想移除孤包,你需要安装 `deborphan` 软件: 假如你想移除孤包,你需要安装 `deborphan` 软件:
在 Ubuntu 中安装 `deborphan` : 在 Ubuntu 中安装 `deborphan` :
@ -74,9 +74,9 @@ 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 移除孤包 ###
`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,9 +102,9 @@ sudo apt-get install gtkorphan
sudo apt-get install wajig sudo apt-get install wajig
``` ```
### Debfoster --- 跟踪你在安装过程中的操作 ### ## Debfoster --- 跟踪你在安装过程中的操作 ##
debfoster 将会维护一个列有 被明确要安装的软件包的列表,但不包括那些作为某个软件的依赖而被安装的软件包。参数是完全可选的,你甚至可以使得 在 dpkg 和/或 apt-get 每次运行之后的每一秒内 激活 debfoster 。 debfoster 将会维护一个列有被明确要安装的软件包的列表,但不包括那些作为某个软件的依赖而被安装的软件包。参数是完全可选的,你甚至可以使得在 dpkg 和/或 apt-get 每次运行之后马上激活 debfoster 。
另外,你还可以在命令行中使用 debfoster 来安装或移除某些特定的软件包。那些后缀为 `---` 的软件包将会被移除,而没有后缀的软件包将会被安装。 另外,你还可以在命令行中使用 debfoster 来安装或移除某些特定的软件包。那些后缀为 `---` 的软件包将会被移除,而没有后缀的软件包将会被安装。
@ -134,7 +134,7 @@ sudo debfoster -q
sudo vi /var/lib/debfoster/keepers sudo vi /var/lib/debfoster/keepers
``` ```
强制使 debfoster 去移除 所有没有被列在上面这个文件的软件包安装作为某些列在这个文件中的软件包的依赖, 它也会添加所有在这个列表中没有被安装的软件包。若要根据这个列表来执行相关操作,只需执行 强制使 debfoster 去移除所有没有被列在上面这个文件的软件包,或安装作为某些列在这个文件中的软件包的依赖,它也同时会添加所有在这个列表中没有被安装的软件包。若要根据这个列表来执行相关操作,只需执行
``` ```
sudo debfoster -f sudo debfoster -f
@ -146,9 +146,9 @@ sudo debfoster -f
sudo debfoster 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 ### ### 在 Ubuntu 中安装 xdiskusage ###
@ -169,9 +169,9 @@ sudo xdiskusage
![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/5.png) ![](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 ### ### 在 Ubuntu 中安装 Bleachbit ###
@ -195,10 +195,10 @@ via: http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with
作者:[ruchi][a] 作者:[ruchi][a]
译者:[FSSlc](https://github.com/FSSlc) 译者:[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/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.ubuntugeek.com/author/ubuntufix [a]:http://www.ubuntugeek.com/author/ubuntufix
[1]:http://www.ubuntugeek.com/cleaning-up-all-unnecessary-junk-files-in-ubuntu.html [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

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

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

@ -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 #!/bin/bash
@ -16,7 +16,7 @@ Linux有问必答:如何在脚本中获取进程IDPID
PID of this script: 6583 PID of this script: 6583
除了$$, bash shell还会导出其他的只读变量。比如PPID存储subshell父进程的ID也就是主shell。UID存储了执行这个脚本的当前用户ID。比如 除了$$, bash shell还会导出其他的只读变量。比如PPID存储shell父进程的ID也就是主shell。UID存储了执行这个脚本的当前用户ID。比如
#!/bin/bash #!/bin/bash
@ -43,6 +43,6 @@ Linux有问必答:如何在脚本中获取进程IDPID
via: http://ask.xmodulo.com/process-id-pid-shell-script.html via: http://ask.xmodulo.com/process-id-pid-shell-script.html
译者:[geekpi](https://github.com/geekpi) 译者:[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/) 荣誉推出 本文由 [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

@ -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,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,3 +1,5 @@
translating by haimingfg
Torvalds: 'People who start writing kernel code get hired really quickly' 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. 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.

View File

@ -1,3 +1,4 @@
translating wi-cuckoo LLAP
10 best uses for open source software in the business world 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. > 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.

View File

@ -0,0 +1,81 @@
The future of Linux storage
================================================================================
> **Summary**:Linux software developers are working hard on expanding Linux's file and storage options.
BOSTON - At the [Linux Foundation's][1] new [Vault][2] show, it's all about file systems and storage. You might think that there's nothing new to say about either topic, but you'd be wrong.
![](http://zdnet2.cbsistatic.com/hub/i/r/2015/03/12/c8f92cc2-b963-4238-80a0-d785ec93698c/resize/770x578/08d93a8a393d3f50b2a56e6b0e7a0ca9/btrfs-1.jpg)
Linux file systems, such as Btrfs, and storage support options are constantly evolving. -- Facebook
Storage technology has come a long way from the days of, as Linus Torvalds put it, "[nasty platters of spinning rust][3]" and Linux has had to keep up. In recent years, for example, [flash memory has arrived as enterprise server primary storage][4] and [persistent memory][5] is bringing us storage that works at DRAM speeds. At the same time, Big Data, cloud computing, and containers are all bringing new use cases to Linux.
To deal with this, Linux developers are both expanding their existing file and storage programs and working on new ones.
### Btrfs ###
For instance, Chris Mason, a Facebook software engineer and one of the [Btrfs][6] (pronounced Butter FS) maintainers, explained how Facebook uses this file system. Btrfs has many advantages as a file system such as the ability to handle both numerous small files and single files as large as 16 exabytes; baked in RAID; built-in file-system compression; and integrated multi-storage device support.
Facebook, of course, runs on Linux. To be exact, Facebook runs the 3.10 and 3.18 Linux kernels on an internal distribution, which is based on [CentOS][7]. For Facebook, the real win is that Btrfs is stable and fast under the endless input/output operations per second (IOPS) pounding from Facebook's constantly updating users.
That's the good news. The bad news is that Btrfs is still much too slow for traditional DBMSs such as MySQL. For those, Facebook uses [XFS][8]. To co-ordinate the two file systems, Facebook uses [Gluster][9], the open-source distributed file system.
Facebook, which works hand-in-glove with the upstream Btrfs Linux kernel developers, is working on improving Btrfs's DBMS speed. Mason, and his companions, are doing this by using Btrfs with the [RocksDB][10] database. This is a persistent key-value store for fast storage, which can be used as the foundation for a client-server database.
Btrfs also still has some bugs. For example, if you're foolish enough to fill a disk almost to bursting, Btrfs will stop you from writing to storage before the disk is completely stuffed. For some projects, such as [CoreOS][12], the enterprise Linux that relies on containers, that's a showstopper. [CoreOS has since switched to using xt4 and overlayfs][11].
The Btrfs crew is also working on data deduplication. In this, when a file system has more than one identical file, you automatically delete the duplicate. As Mason said, "Not everyone needs this, but if you need it, you really need it!"
Btrfs isn't the only file system that's both very important and getting worked on. John Spray, a senior software engineer at [Red Hat][13], talked about the distributed [Ceph][14] file system.
### Ceph FS ###
Ceph provides a distributed object store and file system which, in turn, relies on a resilient and scalable storage model (RADOS) using clusters of commodity hardware. Along with the RADOS block device (RBD), and the RADOS object gateway (RGW), Ceph provides a [POSIX][15] file-system interface -- Ceph FS. While RBD and RGW have been in use for production workloads for some time, efforts to make Ceph FS ready for production are now underway.
[Red Hat, after acquiring Inktank][16], Ceph's parent company, in 2014 has been working hard on making CephFS production ready. For better or worse, Spray said, "Some people are already using it in production; we're terrified of this. It's really not ready yet." Still, Spray added, that this "is a mixed blessing because while it's a bit scary, we get really useful feedback and testing from those users."
That's because while Ceph object stores scale out well, Ceph FS, as a POSIX compliant file-system, are hard to scale out. For example, as a distributed file system, Ceph FS has to deal with multiple writes from multiple clients. This can lead to all or nothing situations where one client can write and others must wait. This can result in file-locking situations that are more complicated than those in ordinary file systems.
Still, Ceph FS is worth doing, Spray said, "since POSIX file-systems are an operating system lingua franca." That's not to say that Ceph FS doesn't work. "It's not horribly broken. It works. What's missing is the repair and monitoring tools."
Red Hat is currently hard at work on getting [fsck][17] and journal repair tools, snapshot hardening, better client access control, and cloud and container integration. For now, though, Ceph FS is a file system that only the very brave, or foolish, should use in production.
### File and storage odds and ends ###
As for larger issues of file-systems and storage, Jeff Layton, senior software engineer at [Primary Data][18], explained that there are efforts under way to to create "tests for catastrophic power failure, without actually pulling the plug." These tests will soon be integrated with [xfstests][19], the gold standard for Linux file-system testing.
Rik van Riel, a Red Hat principal software engineer, spoke about the problem of dealing with persistent memory products. You can treat them as storage or as memory. But, you can't currently take snapshots for backups if you use them as memory. The real problem: van Riel is certain that people will try to use persistent memory as both, which will lead to such as situations as "Without back up, how do you deal with a 200GB persistent memory database?" Adding insult to injury, logging systems don't currently work with persistent memory.
What's the right answer? Linux doesn't have one yet, but programmers are working on it.
So, while Linux has many file systems and can use any kind of storage out there that can hold a byte, there's still a lot of work to be done. Technology never stands still. Linux, which runs on everything from devices to desktops to servers to clouds to supercomputers, has to keep up with storage advances no matter where they appear.
--------------------------------------------------------------------------------
via: http://www.zdnet.com/article/linux-storage-futures/
作者:[Steven J. Vaughan-Nichols][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.zdnet.com/meet-the-team/us/sjvn/
[1]:http://www.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,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,86 +0,0 @@
FSSlc translating
How To Use Smartphones Like Weather Conky In Linux
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Use_Weather_Conky_Linux.jpeg)
Smartphones have those sleek weather widgets that blend in to the display. Thanks to Flair Weather Conky, you can get **smartphone like weather display on your Linux desktop**. We will be using a GUI tool [Conky Manager to easily manage Conky in Linux][1]. Lets first see how to install Conky Manager in Ubuntu 14.10, 14.04, Linux Mint 17 and other Linux distributions.
### Install Conky Manager ###
Open a terminal and use the following commands:
sudo add-apt-repository ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install conky-manager
You can read this article on [how to use Conky Manager in Linux][1].
### Make sure curl is installed ###
Do make sure that [curl][2] is installed. Use the following command:
sudo apt-get install curl
### Download Flair Weather Conky ###
Get the Flair Weather Conky script from the link below:
- [Download Flair Weather Conky Script][3]
### Using Flair Weather Conky script in Conky Manager ###
#### Step 1: ####
Same as you install themes in Ubuntu 14.04, you should have a .conky directory in your Home folder. If you use command line, I dont need to tell you how to find that. For beginners, go to your Home directory from File manager and press Ctrl+H to [show hidden files in Ubuntu][4]. Look for .conky folder here. If there is no such folder, make one.
#### Step 2: ####
In the .conky directory, extract the downloaded Flair Weather file. Do note that by default it is extracted to .conky directory itself. So go in this directory and get the Flair Weather folder out of it and paste it to actual .conky directory.
#### Step 3: ####
Flair Weather uses Yahoo and it doesnt recognize your location automatically. Youll need to manually edit it. Go to [Yahoo Weather][5] and get the location of id of your city by typing your city/pin code. You can get the location id from the URL.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Yahoo_Weather_Location_Code.jpeg)
#### Step 4: ####
Open Conky Manager. It should be able to read the newly installed Conky script. There are two variants, dark and light, available. You can choose whichever you prefer. You can should see the conky displayed on the desktop as soon as you select it.
Default location in Flair Weather is set to Melbourne. Youll have to manually edit the conky.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Using_Weather_Conky_Ubuntu.jpeg)
#### Step 5: ####
In the screenshot above, you can see the option to edit the selected conky. In the editor opened, look for location or WOEID. Change it with the location code you got in step 3. Now restart the Conky.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Edit_Conky.jpeg)
In the same place, if you replace C by F, the unit of temperature will be changed to Fahrenheit from Celsius. Dont forget to restart the Conky to see the changes made.
#### Give it a try ####
In this article we actually learned quite few things. We saw how we can use any Conky script easily, how to edit the scripts and how to use Conky Manager for various purposes. I hope you find it useful.
A word of caution, Ubuntu 14.10 users might see overlapped time numerals. Please make the developer ware of any such issues.
I have already shown you the screenshot of how the Flair Weather conky looked in my system. Time for you to try this and flaunt your desktop.
--------------------------------------------------------------------------------
via: http://itsfoss.com/weather-conky-linux/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:http://itsfoss.com/conky-gui-ubuntu-1304/
[2]:http://www.computerhope.com/unix/curl.htm
[3]:http://speedracker.deviantart.com/art/Flair-Weather-Conky-Made-for-Conky-Manager-510130311
[4]:http://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
[5]:https://weather.yahoo.com/

View File

@ -1,3 +1,4 @@
disylee 来一篇~
How to analyze and view Apache web server logs interactively on Linux 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. 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.

View File

@ -1,3 +1,5 @@
theo-l translating
How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle 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. 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.

View File

@ -1,3 +1,4 @@
Translating by ZTinoZ
How to Manage KVM Virtual Environment using Commandline Tools in Linux 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. 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.

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,61 @@
Install Mate desktop in FreeBSD 10.1
================================================================================
![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg)
FreeBSD is fully text mode system, however some times new users might want to use GUI desktop environment. This tutorial will help you to install Mate Desktop in Freebsd 10.1.
Here is my test system details:
root@Freebsd-unixmen:~ # uname -a
FreeBSD Freebsd-unixmen 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
root@Freebsd-unixmen:~
To start installing Mate desktop in FreeBSD 10.1, the following steps can be used.
pkg install xf86-video-fbdev mate-desktop mate xorg
### Add the following lines to /etc/rc.conf ###
moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
### Test the installation. ###
xinit mate-session
![](http://www.unixmen.com/wp-content/uploads/2015/03/snapshot2.png)
Mate doesnt have a display manager of its own. Hence we can use any other display managers like XDM, GDM, slim etc to use the login manager. Here lets see how to configure Slim DM with Mate desktop.
### Install Slim ###
pkg install slim
Add the following line to **/etc/rc.conf**:
slim_enable="YES"
Add the following line to .xinitrc file in the users home directory
exec mate-session
Reboot the machine. Now the machine will boot into Slim login where you can login to Mate session.
![](http://www.unixmen.com/wp-content/uploads/2015/03/snapshot3.png)
![](http://www.unixmen.com/wp-content/uploads/2015/03/snapshot4.png)
Thats it. Cheers!
--------------------------------------------------------------------------------
via: http://www.unixmen.com/install-mate-desktop-freebsd-10-1/
作者:[M.el Khamlichi][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.unixmen.com/author/pirat9/

View File

@ -0,0 +1,63 @@
Vic020
Linux FAQs with Answers--How to convert between local time and UNIX timestamp in Perl
================================================================================
> **Question**: I need to convert readable date and time to a corresponding UNIX timestamp (i.e., Epoch time), or vice versa in a Perl program. Can you show me Perl code examples of converting date/time to UNIX timestamp, or conversely, converting UNIX timestamp to human-readable date and time?
When your Perl script needs to deal with time information, there are two different ways to represent and manipulate date and time in the script. One way is a human-readable string representation of time (e.g., "Sat Mar 14 10:14:05 EDT 2015"), and the other is via UNIX timestamp (also known as "Epoch time") which is the number of elapsed seconds since 00:00:00 UTC, 1 Jaunary 1970. Either method has its own pros and cons, and depending on your requirements you may want to convert one format to the other.
### Convert Local Time to UNIX Timestamp in Perl ###
To obtain UNIX time from a date string, you can use str2time() in Date::Parse module. It can handle a variety of date formats, such as:
- Sat Mar 14 10:14:05 EDT 2015
- 3/14/2015 10:14:05 -0400
- 14/Mar/15 10:14:05
- 14 Mar 15 10:14:05
use Date::Parse;
my $local_time = "Sat Mar 14 10:14:05 EDT 2015";
# 1426342445 will be stored in $unix_time
my $unix_time = str2time($local_time);
Date:Parse module supports multiple languages (English, French, German and Italian) and timezones. For example:
use Date::Parse;
use Date::Language;
my $lang = Date::Language->new('French');
my $unix_time = $lang->str2time("12:14:05, Ago 16, 2014 (CEST)");
### Convert UNIX Timestmp to Human-Readable Date and Time in Perl ###
If you want to show a UNIX timestamp in a human-readable format, you can use localtime() function which converts a UNIX timestamp into a 9-element list. You can use the returned list to construct any kind of human-readable date/time string as you want. Here is a code snippet.
# $sec, $min, $hour: seconds, minutes and hours
# $mday: the day of the month (0-31)
# $mon: month in the range of 0 (Jaunary) and 11 (December)
# $year: the number of years that have elapsed since 1900
# $wday: the day of the week in the range of 0 (Sunday) and 6 (Saturday)
# $yday: the day of the year in the range of 0 and 364 (or 365 in leap years)
# $isdst: whether or not it's in daylight saving time
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($unix_timestamp);
# necessary conversion of $mon and $year
$mon += 1;
$year += 1900;
print "Current time: $year-$mon-$mday $hour:$min:$sec\n";
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/convert-local-time-unix-timestamp-perl.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

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,211 @@
Fedora GNOME Keyboard Shortcuts
================================================================================
To get the very best out of the [GNOME desktop environment][1], within Fedora, you need to learn and remember the keyboard shortcuts required to navigate the system.
This article lists the most useful keyboard shortcuts and how they are used.
![GNOME Keyboard Shortcuts - The Super Key. ](http://f.tqn.com/y/linux/1/L/o/K/1/gnomekeyboardshortcut1.png)
GNOME Keyboard Shortcuts - The Super Key.
#### 1. The Super Key ####
[The "super" key][2] is your best friend when navigating modern operating systems.
On a standard laptop the "super" key sits on the bottom row next to the "alt" key.
When you press the "super" key the "activities" overview will be displayed and you will be able to see all of the open applications zoomed out.
Pressing "ALT" and "F1" together will show the same display.
![GNOME Run Command.](http://f.tqn.com/y/linux/1/L/p/K/1/runcommand.png)
GNOME Run Command.
### 2. How To Run A Command Quickly ###
If you need to run a command quickly, you can press "ALT" and "F2" which displays a "Run Command" dialog.
You can now enter your command into that window and press return.
![TAB Through Applications.](http://f.tqn.com/y/linux/1/L/q/K/1/tabthroughwindows.png)
TAB Through Applications.
### 3. Quickly Switch To Other Open Applications ###
As with Microsoft Windows you can switch applications using the "ALT" and "TAB" keys.
On some keyboards the tab key looks like this: **|<- ->|** and on others it simply spells the word "TAB".
The GNOME application switcher simply shows the icons and names of the applications as you tab through them.
If you hold down the "shift" and "tab" keys, the application switcher rotates around the icons in reverse order.
![Switch Windows In The Same Application.](http://f.tqn.com/y/linux/1/L/r/K/1/switchwindowsinsameapplication.png)
Switch Windows In The Same Application.
### 4. Quickly Switch To Another Window In The Same Application ###
If you are anything like me then you will end up with half a dozen instances of Firefox open.
You now know that "Alt" and "Tab" switch between applications.
There are two ways to cycle through all of the open instances of the same application.
The first is to press "Alt" and "Tab" until the cursor sits over the icon of the application with many windows that you wish to cycle through. After a pause a dropdown will appear and you can select the Window with the mouse.
The second and preferred option is to press "Alt" and "Tab" until the cursor sits over the icon of the application you want to cycle through and then press the "super" and "`" keys to toggle through the open instances.
**Note that the "`" key is the one just above the tab key. The key for cycling through the open instances is always the key above the tab key regardless of your keyboard layout, therefore it isn't always guaranteed to be the "`" key.**
If you have nimble fingers (or as I like to call them ninja fingers) then you can hold the "shift", "`" and "super" key to cycle backwards through the open instances of an application.
![Switch Keyboard Focus.](http://f.tqn.com/y/linux/1/L/s/K/1/switchkeyboardfocus.png)
Switch Keyboard Focus.
### 5. Switch Keyboard Focus ###
This keyboard shortcut isn't essential but a nice to know.
If you want to switch the keyboard focus to the search bar or to an application window you can press "CTRL", "ALT" and "TAB". to show a list of possible areas to switch to.
You can then use the arrow keys to cycle through the possible options.
![Show All Applications.](http://f.tqn.com/y/linux/1/L/t/K/1/showapplications.png)
Show All Applications.
### 6. Show A List Of All The Applications ###
If the last one was a nice to have then this one is a real time saver.
To quickly navigate to a full list of all the applications on your system press the "super" key and "A".
![Switch Workspaces.](http://f.tqn.com/y/linux/1/L/u/K/1/switchworkspaces.png)
Switch Workspaces.
### 7. Switch Workspaces ###
If you have been using Linux for a while you will appreciate the fact that you [can use multiple workspaces][3].
For instance in one workspace you might have development environments open, in another web browsers and in a third your email client.
To toggle between workspaces press the "super" and the "Page Up" (PGUP) keys to toggle in one direction and the "super", "Page Down" (PGDN) keys to toggle in the other direction.
The alternative but more longwinded away to switch to another workspace is to press the "super" key to show a list of applications and then select the workspace you wish to switch to on the right side of the screen.
![Move Application To Another Workspace.](http://f.tqn.com/y/linux/1/L/v/K/1/movetoanewworkspace.png)
Move Application To Another Workspace.
### 8. Move Items To A New Workspace ###
If the workspace you are using is getting cluttered and you wish to move the current application to a new workspace press the "super", "shift" and "page up" button or "super", "shift" and "page down" key.
Alternatively press the "super" key to bring up the list of applications and drag the application you wish to move to one of the workspaces on the right of the screen.
![Show The Message Tray.](http://f.tqn.com/y/linux/1/L/w/K/1/showmessagetray.png)
Show The Message Tray.
### 9. Show The Message Tray ###
The message tray provides a list of notifications.
To bring up the message tray press the "super" and "M" key on the keyboard.
Alternatively move the mouse to the bottom right corner of the screen.
![Lock The Screen.](http://f.tqn.com/y/linux/1/L/x/K/1/lockscreen.png)
Lock The Screen.
### 10. Lock The Screen ###
Need to a comfort break or a cup of coffee? Don't want sticky paws all over your keyboard?
Whenever you leave your computer alone get in the habit of pressing "super" and L to lock the screen.
To unlock the screen drag up from the bottom and enter your password.
![Control Alt Delete Within Fedora.](http://f.tqn.com/y/linux/1/L/y/K/1/poweroff.png)
Control Alt Delete Within Fedora.
### 11. Power Off ###
If you used to be a Windows user then you will remember the three finger salute known as CTRL, ALT and DELETE.
If you press "CTRL", "ALT" and "DEL" on your keyboard within Fedora a message will appear telling you that your computer will shut down in 60 seconds.
### 12. Editing Shortcuts ###
The editing keyboard shortcuts are pretty much universal across every operating system.
- CTRL + A - Select All
- CTRL + X - Cut
- CTRL + C - Copy
- CTRL + V - Paste
- CTRL + Z - Undo
### 13. Screen Capturing ###
As with the editing shortcuts, the screencapturing keys are fairly standard
- PRTSC (Print Screen) - Take screenshot
- Alt + PRTSC - Take screenshot of current window
- Shift + PRTSC - Take screenshot of an area of the screen
Here is one that is fairly unique but great for people making tutorial videos.
- CTRL + ALT + SHIFT + R - Record Screencast
- CTRL + ALT + SHIFT + R again - Stop Screencast
The [screencasts][4] will be stored in the videos folder under your home directory in the [webm][5] format.
![Put Windows Side By Side.](http://f.tqn.com/y/linux/1/L/z/K/1/splitwindows.png)
Put Windows Side By Side.
### 14. Put Windows Side By Side ###
You can put windows side by side so that one uses up the left side of the screen and the other uses the right side of the screen.
Press the "Super" and "Left Arrow" key on the keyboard to shift the current application to the left.
Press the "Super" and "Right Arrow" key on the keyboard to shift the current application to the right.
### 15. Maximise, Minimise And Restore Windows ###
To maximise a window double click on the title bar.
To restore a window to its original size double click on the maximised window.
To minimise a window, right click and select "minimise" from the menu.
![GNOME Keyboard Shortcut Cheat Sheet. ](http://f.tqn.com/y/linux/1/L/-/L/1/gnomekeyboardshortcuts.png)
GNOME Keyboard Shortcut Cheat Sheet.
### 16. Summary ###
To help you learn these keyboard shortcuts I have created a cheat sheet which you can print out and stick to your wall.
When you have learned these shortcuts you will begin to appreciate how modern desktop environments work.
- [Click here to view the Fedora Linux GNOME Desktop Environment cheat sheet.][6]
- [Click here for the GNOME WIKI][7]
- [The other GNOME WIKI][8]
- [An alternative GNOME 3 Cheat Sheet][9]
--------------------------------------------------------------------------------
via: http://linux.about.com/od/howtos/tp/Fedora-GNOME-Keyboard-Shortcuts.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]:https://www.gnome.org/gnome-3/
[2]:http://en.wikipedia.org/wiki/Super_key_%28keyboard_button%29
[3]:http://linux.about.com/library/gnome/blgnome2n4.htm
[4]:http://en.wikipedia.org/wiki/Screencast
[5]:http://en.wikipedia.org/wiki/WebM
[6]:https://s-media-cache-ak0.pinimg.com/originals/d5/f4/a4/d5f4a42c0940fae6653ee9a17294d450.jpg
[7]:http://en.wikipedia.org/wiki/GNOME
[8]:https://wiki.gnome.org/
[9]:https://wiki.gnome.org/Gnome3CheatSheet

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,93 @@
Install And Use Go For It! To Do App In Linux
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go_For_It_TODO_Linux.jpeg)
How do you manage tasks and remember things in desktop Linux? I preferred [using sticky notes in Ubuntu][1] for a long time. But the problem I faced was syncing it with other devices, especially with my smartphone. This is the reason why went on with [Google Keep][2].
Now, Google Keep is feature rich app and I really like it, and like it to the extent of calling it [Linux alternative of Evernote][3]. But not everyone may like a feature rich todo list app. Minmalist is the current trend and liked by many. And if you are one of the minimalist lover, who is looking for an open source to do list app, you should give [Go For It!][4] a try.
### Go For It! productivity desktop app for Linux ###
Go For It! is a simple to do list app that comes with a timer to keep you focused on the work. So, you add a task to the list and can attach a timer to it. It will keep remind you to work on the task. You can watch the video by its developer, [Manuel Kehl][5]:
注释youtube视频发布的时候可做成一个链接
<iframe width="640" height="390" frameborder="0" allowfullscreen="true" src="http://www.youtube.com/embed/mnw556C9FZQ?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent" type="text/html" class="youtube-player"></iframe>
### Install Go For It! ###
To install Go For It! in Ubuntu 15.04, 14.10, 14.04 and other Ubuntu based Linux distributions such as Linux Mint, elementary OS Freya etc, use the official PPA of this app:
sudo add-apt-repository ppa:mank319/go-for-it
sudo apt-get update
sudo apt-get install go-for-it
You can download the .deb binaries, binaries for Windows and source code from the respective links below:
- [Download source code][6]
- [Download .deb binaries][7]
- [Download for Windows][8]
### Using Go For It! in desktop Linux ###
Using Go For It! is really simple. You add tasks in the list. The tasks are saved in todo.txt file.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go-for-it_todo_app_linux.png)
By default a timer of 25 minutes will be set on each task.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go-for-it_todo_app_linux_1.png)
Once done, task is automatically archived to done.txt. Based on preferences, it will send desktop notifications at regular time interval and few minutes before the task is supposed to be over:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go_for_it_Linux_notification.png)
You can change all these preferences from configuration.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go-for-it_todo_app_linux_2.png)
So far so good. But what about using it on a smartphone. A productivity app is not complete if you cannot keep it synced across various devices. Good thing is that Go For It! is based on [todo.txt][9], which means you can use it in smartphones using third party apps and a cloud service like Dropbox.
### Using Go For It! in Android smartphones and tablets ###
You need to do couple of things here. First thing first, install Dropbox in Linux as well as in your Android phone, if you havent installed it already. The next thing you need to do is to change the configuration of Go For It! and **change the todo.txt directory to Dropbox location**.
Next, you will have to download [Simpletask Android app][10]. Its a free app. Install this app. When you run Simpletask for the first time, you will ask to link your account with Dropbox:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go_for_it_Android_1.jpeg)
Once you have linked Simpletask with Dropbox, open the app. If you have change the configuration of Go For It! to save the files in Dropbox, you should be able to see it in Simpletask. If you do not see it, click on the settings from the bottom and use the option of Open Todo file:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Go_for_it_Android.jpeg)
Now you should be able to see your tasks synced with Simpletask.
### Conclusion ###
With Simpletask, you can use it in similar fashion as a [markup language tool][11]. For minimal and focused usage Go For It! is a nice to do app. A clean interface is another plus point. It could have been better to have its own smartphone app but we already saw the workarounds.
On the down side, Go For It! doesnt run in background. Which means, youll have to keep it running always. It doesnt even has a minimize button, a tiny annoyance. What I would like to see is an indicator applet for it. Running in the background and quick access in the panel will definitely improve its usability.
Do try Go For It! and share your experience with it. What other to-do app do you use on desktop Linux? How does Go For It! compare with your other favorite productivity app?
--------------------------------------------------------------------------------
via: http://itsfoss.com/go-for-it-to-do-app-in-linux/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/abhishek/
[1]:http://itsfoss.com/indicator-stickynotes-windows-like-sticky-note-app-for-ubuntu/
[2]:http://itsfoss.com/install-google-keep-ubuntu-1310/
[3]:http://itsfoss.com/5-evernote-alternatives-linux/
[4]:http://manuel-kehl.de/projects/go-for-it/
[5]:http://manuel-kehl.de/about-me/
[6]:https://github.com/mank319/Go-For-It
[7]:https://launchpad.net/~mank319/+archive/ubuntu/go-for-it
[8]:http://manuel-kehl.de/projects/go-for-it/download-windows-version/
[9]:http://todotxt.com/
[10]:https://play.google.com/store/apps/details?id=nl.mpcjanssen.todotxtholo&hl=en
[11]:http://itsfoss.com/install-latex-ubuntu-1404/

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

@ -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,101 @@
如何在 Linux 中使用类似智能手机外观的 Conky 天气插件
================================================================================
![](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 吧。
### 安装 Conky Manager ###
打开一个终端并使用下面的命令:
sudo add-apt-repository ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install conky-manager
你可以阅读这篇关于[如何在 Linux 中使用 Conky Manager][1] 的文章。
### 确保 `curl` 已被安装 ###
请确保 [curl][2] 已被安装。(如果没有安装它,)可以使用下面的命令来安装:
sudo apt-get install curl
### 下载 Flair Weather Conky ###
从下面的链接下载 Flair Weather Conky 的脚本:
- [下载 Flair Weather Conky 的脚本][3]
### 在 Conky Manager 中使用 Flair Weather Conky 脚本 ###
#### 步骤 1: ####
同你在 Ubuntu 14.04 中安装主题一样,在你的家目录中应该有一个 `.conky` 目录。假如你使用命令行,则不需要让我来告诉你如何找到这个目录。对于新手,请用文件管理器切换到你的家目录下,并按 `Ctrl+H` 来 [在 Ubuntu 中显示隐藏文件][4]。在这里查找 `.conky` 文件夹,假如没有这个文件夹,则创建一个。
#### 步骤 2: ####
`.conky` 目录中,解压下载到的 Flair Weather 文件。请注意在默认情况下它会自动解压到一个名为 `.conky` 目录。所以请进入这个目录,将 Flair Weather 文件夹从中取出,然后将它粘贴到真正的 `.conky` 目录下。
#### 步骤 3: ####
Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的位置。你需要手动地编辑它。到[Yahoo 天气][5] 网页,然后通过键入你的城市/Pin 码来得到你所在城市的 位置 ID号。你可以从网页地址栏中取得位置 ID 号。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Yahoo_Weather_Location_Code.jpeg)
#### 步骤 4: ####
打开 Conky Manager它应该能够读取新安装的 Conky 脚本。这里有两款样式可用,黑色主题或亮丽主题。你可以选择你偏爱的那一款。当你选择后,你就可以在桌面上看到 conky 的显示了。
在 Flair Weather 中,默认位置被设定为 Melbourne。你必须手动编辑 conky 文件。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Using_Weather_Conky_Ubuntu.jpeg)
#### 步骤 5: ####
在上面的截图中,你可以看到有一个编辑选定 conky 脚本的选项,在打开的编辑器中,查找 location 或 WOEID ,更换它为你在 `步骤 3` 中得到的位置 ID 号。然后重启 Conky。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Edit_Conky.jpeg)
在上面查找的相同位置,假如你将 C 替换为 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 文件中的内容与原文有差异,我按照原文翻译,并加上了 链接)
我已经向你展示了在我的系统上 Flair Weather conky 外观的截图。现在该你尝试它并炫耀你的桌面的时间了。
--------------------------------------------------------------------------------
via: http://itsfoss.com/weather-conky-linux/
作者:[Abhishek][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:http://itsfoss.com/conky-gui-ubuntu-1304/
[2]:http://www.computerhope.com/unix/curl.htm
[3]:http://speedracker.deviantart.com/art/Flair-Weather-Conky-Made-for-Conky-Manager-510130311
[4]:http://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
[5]:https://weather.yahoo.com/
[6]:https://plus.google.com/communities/104794997718869399105

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/

View File

@ -0,0 +1,174 @@
如何设置lftp - 一个简易的命令行FTP程序
================================================================================
大家好这篇文章是介绍Lftp以及如何在Linux操作系统下安装的。[Lftp][1]是一个基于命令行的文件传输软件也被称为FTP客户端由Alexander Lukyanov开发并以GNU GPL协议许可发行。除了FTP它还支持FTPSHTTPHTTPSHFTPFISH以及SFTP。这个程序还支持FXP允许数据绕过客户端直接在两个FTP服务器之间传输。
他有很多很棒的高级功能比如完整目录树递归镜像以及断点续传下载。传输任务可以安排在稍后的时间段执行可以限制带宽可以创建传输列表还支持类似Unix shell的任务控制。客户端还可以在交互式或自动脚本里使用。
### 安装Lftp ###
在运行lftp之前我们需要确定它已经正确安装在我们的Linux发行版中了。下面是在常见Linux发行版中安装lftp的一些命令。
**Ubuntu 14.04 LTS**
在Ubuntu 14.04 LTS以及它的衍生版中我们可以通过apt管理程序安装lftp。要安装它我们需要使用sudo权限在shell或终端里运行下面的命令。
$ sudo apt-get install lftp
![ubuntu install lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/ubuntu-install-lftp.png)
**CentOS/Fedora/RHEL**
因为在FedoraCentOS和RHEL的软件仓库里也能找到lftp我们可以用**yum**管理程序来安装它。
$ sudo yum install lftp
![fedora lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/fedora-lftp.png)
**Arch Linux**
在Arch Linux安装包仓库里也有我们可以简单地使用pacman来安装它。
$ sudo pacman -S lftp
![archlinux install lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/archlinux-install-lftp.png)
**OpenSuse**
OpenSuse系统里的包管理软件Zypper可以用来安装lftp。下面是在OpenSuse机器上用来安装的命令。
$ sudo zypper install lftp
![opensuse lftp install](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp_install.png)
### 登录 ###
要登录到ftp服务器或sftp服务器我们首先需要知道所要求的认证信息比如用户名密码端口。
之后我们想通过lftp来登录。
$ lftp ftp://linoxide@localhost
![ftp login](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login.png)
如果需要指定登录端口,我们可以按下面的方式加上去。
$ lftp ftp://linoxide@localhost:21
![ftp login with ports](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login-port.png)
### 浏览 ###
我们可以用**ls**命令来列出文件和目录,用**cd**命令打开目录。
![ls and cd](http://blog.linoxide.com/wp-content/uploads/2015/03/ls-cd-lftp.png)
### 上传和下载文件 ###
我们可以用**pget**命令来从远端服务器下载文件。
> pget linspeed.svg
![pget lftp](http://blog.linoxide.com/wp-content/uploads/2015/03/pget-lftp.png)
我们可以用**put**命令来上传文件到远端服务器。
> put linoxide.tar
![upload with put](http://blog.linoxide.com/wp-content/uploads/2015/03/put-upload.png)
要恢复之前只下载了一部分的文件/目录,我们可以用-c开关
> mirror -c Directory
>pget -c linoxide.tar
> put -c upload.tar
### 使用镜像命令 ###
我们可以用mirror命令来下载所指定的整个目录。
> mirror remote local
![download with mirror](http://blog.linoxide.com/wp-content/uploads/2015/03/mirror.png)
还可以做反向镜像(mirror -R),可以用来上传或更新本地目录树到服务器上。
> mirror -R local remote
![upload or update with mirror reverse](http://blog.linoxide.com/wp-content/uploads/2015/03/mirror-reverse.png)
要恢复之前下载了一部分的文件/目录,我们可以用-c开关
> mirror -c Directory
### 下载队列 ###
我们可以在lftp里使用queue的选项这样我们可以像基于GUI的客户端那样挨个下载队列里选择的文件。下面举个例子。
为了避免队列自动开始传输,我们可以这样做:
> queue stop
现在,我们添加任务到队列。
> queue mirror "directory"
> queue pget "file.tar"
在建立好队列后我们再运行queue start命令。
> queue start
可以运行下面的命令移除整个队列。
> queue -d
### 分块下载 ###
下面是一个把一个文件分成3块来下载的例子你可以根据自己的需要调整。
使用pget命令分块功能的方式是**pget -n 3 file.tar**里面的3是分块的数目。
> pget -n 3 file.tar
使用mirror命令分块功能的方式是**mirror --use-pget-n=3 directory**里面的3是分块的数目。
> mirror --use-pget-n=3 linxoxide
我们可以用jobs -v命令来查看每个独立分块的下载速度以及整体速度。
### 停止,继续或删除一次传输任务 ###
要取消传输我们可以按下Ctrl+C。而要恢复下载我们可以像下面那样使用-c (--continue)开关。
> mirror -c directory
要删除一次正在正在传输的任务我们可以用**kill**命令,而要删除所有任务我们可以使用下面那样的**kill all**命令。
> kill
> kill all
### 退出 ###
要从lftp退出我们需要在终端或lftp交互接口中运行exit命令。
> exit
### 总结 ###
我们已经成功地安装了lftp并学会了使用它的一些基础的主要方式。lftp是一个非常棒的命令行ftp客户端它支持许多额外的功能以及很酷的特性。它比其他普通ftp客户端多了很多东西。好吧你要是有任何问题建议反馈请在下面的评论区里留言。谢谢享用lftp吧 :-)
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-how-to/setup-lftp-command-line-ftp/
作者:[Arun Pyasi][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[校对者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

@ -0,0 +1,164 @@
10个有用的ls命令面试问题-第二部分
================================================================================
这是关于文件列表命令的第二篇文章继续探讨ls命令的其他方面。该系列的第一篇文章收到了Tecmint社区的高度关注如果你错过了该系列的第一部分你可能会访问以下地址
- [15 Interview Questions on “ls” Command Part 1][1]
这篇文章通过样例来很好地展现ls命令的深入应用我们加倍小心地来写这篇文章来保持其简洁可理解性同时又能提供最全面的服务。
![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. 假如你想要以长列表的形式列出目录中的内容,但是不打印文件创建者名称以及文件所属组。同时在输出中显示其不同之处。###
a. ls 命令在与‘-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 命令在与‘-l--author一起使用时会将文件以长列表格式输出并带有文件创建者的名称信息。
# 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 命令在与‘-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 命令在与'-G'和‘-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. 使用用户友好的格式打印出当前目录中的文件以及文件夹的大小,你会如何做?###
这里我们需要使用'-h'选项(人类可阅读的)同‘-l-s选项与ls命令一起使用来得到想要的输出。
# 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
**注意** -h选项使用1024计算机中的标准的幂文件或文件夹的大小分别以KM和G作为输出单位。
### 3. 既然‘-h选项是使用1024的幂作为标准来输出大小那么ls命令还支持其他的幂值呢###
存在一个选项 -si与选项-h相似不同之处在于前者以使用1000的幂后者使用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
所以'-si'也可以与‘-l选项一起使用来按照1000的幂来输出文件夹的大小并且以长列表格式显示。
# 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. 假如要你使用逗号‘,’作为分隔符来打印一个目录中的内容,可以吗? 对于长列表形式也可行吗?###
当然linux的ls命令当与其选项-m一起使用时可以在打印目录内容时以逗号分割。由于逗号分割的内容是水平填充的ls命令不能在垂直列出内容时使用逗号来分割内容。
# 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
当使用长列表格式时,‘-m选项就没有什么效果了。
# ls -ml
![Listing Content Horizontally](http://www.tecmint.com/wp-content/uploads/2015/03/Listing-Content-Horizentally.gif)
Listing Content Horizontally
### 5. 有办法将目录的内容逆序打印出来吗?###
可以!上面的情形可以轻松地通过'-r'选项搞定,该选项将输出顺序倒置。这个选项也可以与‘-l选项一起使用。
# 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. 如果你被分配一个任务,来递归地打印各个子目录,你会如何应付?注意哟,只针对子目录而不是文件哦。###
小意思!使用“-R”选项就可以轻轻松松拿下它也可以更进一步地与其他选项如-l-m选项等组合使用。
# 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. 如何按照文件大小对其进行排序?###
linux命令行选项'-S'赋予了ls命令这个超能力。按照文件大小从大到小的顺序排序
# 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
按照文件大小从小到大的顺序排序。
# 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. 列出目录中的内容按照一行一个文件并且不带额外信息的方式 ###
选项‘-l在此可以解决这个问题使用-l选项来使用ls命令可以将目录中的内容按照一行一个文件并且不带额外信息的方式进行输出。
# 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. 现在委派给你一个任务,你必须将目录中的内容输出到终端而且需要使用双引号引起来,你会如何做?###
存在一个选项‘-Q会将ls命令的输出内容用双引号引起来。
# 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. 想象一下你正在与一个包含有很多文件和文件夹的目录打交道,你需要使目录名显示在文件名之前,你如何做?###
# ls --group-directories-first
![Print Directories First](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Directories-First.gif)
Print Directories First
先点到为止我们会马上提供该系列文章的下一部分。别换频道关注Tecmint。 另外别忘了在下面的评论中提出你们宝贵的反馈信息,喜欢就分享,帮助我们得到更好的传播吧!
--------------------------------------------------------------------------------
via: http://www.tecmint.com/ls-interview-questions/
作者:[Ravi Saive][a]
译者:[theo-l](https://github.com/theo-l)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:http://www.tecmint.com/ls-command-interview-questions/

View File

@ -1,23 +1,22 @@
Translating by ZTinoZ Linux中的15个基本ls命令示例
15 Basic ls Command Examples in Linux
================================================================================ ================================================================================
ls command is one of the most frequently used command in Linux. I believe ls command is the first command you may use when you get into the command prompt of Linux Box. We use ls command daily basis and frequently even though we may not aware and never use all the option available. In this article, 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](http://www.tecmint.com/wp-content/uploads/2012/08/Linux-ls-Commands.png)
Linux ls Command Linux的ls命令
### 1. List Files using ls with no option ### ### 1. 不带任何选项列出文件 ###
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. 不带选项的ls命令来光秃秃地列出文件和目录我们是不能看到像文件类型、大小、修改日期和时间、权限以及链接这样具体的信息的。
# ls # ls
0001.pcap Desktop Downloads index.html install.log.syslog Pictures Templates 0001.pcap Desktop Downloads index.html install.log.syslog Pictures Templates
anaconda-ks.cfg Documents fbcmd_update.php install.log Music Public Videos 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 # ls -l
@ -37,9 +36,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 Templates
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos 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 # ls -a
@ -51,9 +50,9 @@ List all files including hidden file starting with ..
.bash_logout Desktop fbcmd_update.php .ICEauthority .mozilla Public Videos .bash_logout Desktop fbcmd_update.php .ICEauthority .mozilla Public Videos
.bash_profile .digrc .gconf index.html Music .pulse .wireshark .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 # ls -lh
@ -73,7 +72,7 @@ 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 Templates
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Videos 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. Using -F option with ls command, will add the / Character at the end each directory.
@ -82,18 +81,18 @@ Using -F option with ls command, will add the / Character at the end each
0001.pcap Desktop/ Downloads/ index.html install.log.syslog Pictures/ Templates/ 0001.pcap Desktop/ Downloads/ index.html install.log.syslog Pictures/ Templates/
anaconda-ks.cfg Documents/ fbcmd_update.php install.log Music/ Public/ Videos/ 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 # ls -r
Videos Public Music install.log fbcmd_update.php Documents anaconda-ks.cfg Videos Public Music install.log fbcmd_update.php Documents anaconda-ks.cfg
Templates Pictures install.log.syslog index.html Downloads Desktop 0001.pcap 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 # ls -R
@ -116,9 +115,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 0 Aug 12 03:17 access.log
-rw-r--r--. 1 root root 390 Aug 12 03:17 access.log-20120812.gz -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 # ls -ltr
@ -138,9 +137,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 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 -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 # ls -lS
@ -160,9 +159,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-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap -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 # ls -i
@ -170,9 +169,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 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 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 # ls --version
@ -183,17 +182,17 @@ Check version of ls command.
There is NO WARRANTY, to the extent permitted by law. There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie. 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 # ls --help
Usage: ls [OPTION]... [FILE]... 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 # ls -l /tmp
total 408 total 408
@ -213,9 +212,9 @@ With ls -l command list files under directory /tmp. Wherein with -ld parameters
drwxrwxrwt. 13 root root 4096 Aug 21 12:48 /tmp/ 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 # ls -n
@ -226,13 +225,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 -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 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" # 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 # alias
@ -244,18 +243,18 @@ Note: We can see number of alias available in your system with below alias comma
alias rm='rm -i' alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' 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 # 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/ via: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
作者:[Ravi Saive][a] 作者:[Ravi Saive][a]
译者:[译者ID](https://github.com/译者ID) 译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[校对者ID](https://github.com/校对者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,190 @@
关于linux中的“ls”命令的15个面试问题 - 第一部分
================================================================================
Unix或类Unix系统中的“文件列表”命令“ls”是最基础并且使用的最广泛的命令行中工具之一。
它是一个在GNU基本工具集以及BSD各种变体上可用的与POSIX兼容的工具。
“ls”命令可以通过与大量的选项一起使用来达到想要的结果。
这篇文章的目的在于通过相关的样例来深入讨论文件列表命令。
![15 ls Command Questions](http://www.tecmint.com/wp-content/uploads/2014/09/ls-Command-Questions.png)
15个“ls”命令问题。
### 1. 你会如何从目录中列出文件?###
使用linux文件列表命令“ls”驾到拯救。
# ls
![List Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-files.gif)
列出文件
同时我们也可以使用“echo(打印)”命令与一个通配符(*)相关联的方式在目录中列出其中的所有文件。
# echo *
![List All Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-files.gif)
列出所有的文件。
### 2. 你会如何只通过使用echo命令来列出目录中的所有文件###
# echo */
![List All Directories](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-directories.gif)
列出所有的目录
### 3. 你会怎样列出一个目录中的所有文件, 包括隐藏的dot文件###
答:我们需要将“-a”选项与“ls”命令一起使用。
# ls -a
![List All Hidden Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-hidden-files.gif)
列出所有的隐藏文件。
### 4. 如何列出目录中除了 “当前目录暗喻(.)”和“父目录暗喻(..)”之外的所有文件,包括隐藏文件?###
答: 我们需要将“-A”选项与“ls”命令一起使用
# ls -A
![Do Not List Implied](http://www.tecmint.com/wp-content/uploads/2014/09/Do-not-list-Implied.gif)
别列出暗喻文件。
### 5. 如何将当前目录中的内容使用长格式打印列表?###
答: 我们需要将“-l”选项与“ls”命令一起使用。
# ls -l
![List Files Long](http://www.tecmint.com/wp-content/uploads/2014/09/list-files-long.gif)
列出文件的长格式。
上面的样例中,其输出结果看起来向下面这样。
drwxr-xr-x 5 avi tecmint 4096 Sep 30 11:31 Binary
上面的drwxr-xr-x 是文件的权限,分别代表了文件所有者,组以及对整个世界。 所有者具有读(r),写(w)以及执行(x)等权限。 该文件所属组具有读(r)和执行(x)但是没有写的权限,相同的权限预示着
对于整个世界的其他可以访问该文件的用户。
- 开头的d意味着这是一个目录
- 数字'5'表示符号链接
- 文件 Binary归属于用户 “avi”以及用户组 "tecmint"
- Sep 30 11:31 表示文件最后一次的访问日期与时间。
### 6. 假如让你来将目录中的内容以长格式列表打印,并且显示出隐藏的“点文件”,你会如何实现?###
答: 我们需要同时将"-a"和"-l"选项与“ls”命令一起使用。
# ls -la
![Print Content of Directory](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Content-of-Directory.gif)
打印目录内容
同时,如果我们不想列出“当前目录暗喻”和"父目录暗喻",可以将“-A”和“-l”选项同“ls”命令一起使用。
# ls -lA
### 7. 如何找到每个文件的创建者?###
答: 我们需要结合 “--author”和 "-l"选项来打印出每个文件的创建者。
# ls --author -l
![List Author Files](http://www.tecmint.com/wp-content/uploads/2014/09/List-Author-Files.gif)
列出文件创建者。
### 8. 如何对非显示字符进行转义打印?###
答:我们只需要使用“-b”选项来对非显示字符进行转义打印
# ls -b
![Print Escape Character](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Escape-Character.gif)
### 9. 指定特定的单位格式来列出文件和目录的大小,你会如何实现?###
答: 在此可以同时使用选项“-block-size=scale”和“-l”但是我们需要用特定的单位如MK等来替换scale
# 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)
列出文件大小单位格式。
### 10. 列出目录中的非备份文件,也就是那些文件名以‘~’结尾的文件###
答: 选项‘-B赶来救驾。
# ls -B
![List File Without Backup](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Without-Backup.gif)
列出非备份文件
### 11. 将目录中的所有文件按照名称进行排序并与最后修改时间信息进行关联显示###
答: 为了实现这个需求,我们需要同时将“-c”和"-l"选项与命令一起使用。
# ls -cl
![Sort Files](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files.gif)
文件排序
### 12. 将目录中的文件按照修改时间进行排序,并显示相关联的信息。###
答: 我们需要同时使用3个选项--'-l','-t','-c'--与命令ls一起使用来对文件使用修改时间排序最新的修改时间排在最前。
# ls -ltc
![Sort Files by Modification](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files-by-Modification.gif)
按照修改时间对文件排序。
### 13. 如何控制ls命令的输出颜色的有无###
答: 需要使用选项‘--color=parameterparameter参数值具有三种不同值“auto(自动)”“always(一直)”“never(无色)”。
# 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的输出颜色
### 14. 假如只需要列出目录本身,而不是目录的内容,你会如何做?###
答:在此“-d”选项就会显得很顺手。
# ls -d
![List Directory Entries](http://www.tecmint.com/wp-content/uploads/2014/09/List-Directory-Entries.gif)
列出目录本身
### 15. 为长格式列表命令"ls -l"创建别名“ll”并将其结果输出到一个文件而不是标准输出中。###
答:在上述的这个场景中,我们需要将别名添加到.bashrc文件中然后使用重定向操作符将输出写入到文件而不是标准输出中。我们将会使用编辑器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)
为ls命令创建别名。
先到此为止,别忘了在下面的评论中提出你们的宝贵意见,我会再次带着另外的有趣的文章在此闪亮登场。
### 参考阅读:###
- [10 个ls命令的面试问题-第二部分][1]
- [Linux中15个基础的'ls'命令][2]
--------------------------------------------------------------------------------
via: http://www.tecmint.com/ls-command-interview-questions/
作者:[Avishek Kumar][a]
译者:[theo-l](https://github.com/theo-l)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.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

@ -0,0 +1,81 @@
在windows下,连接你的Linux服务器的ssh免费客户端工具列举\
================================================================================
你的操作系统是Windows,而你想要连接Linux服务器相互传送文件.于是你需要一个Secure Shell,简称SSH.实际上,SSH是一个网络协议,允许你通过网络连接到Linux和Unix服务器.SSH使用公钥加密来认证远程的计算机.你可以有多种途径使用SSH,要么自动地连接,或者使用密码认证登录.
本篇文章讲述了几种SSH客户端,供选择使用来连接你的Linux服务器.
我们开始.
### Putty ###
**Putty**是最有名的SSH和telnet客户端,最初由Simon Tatham为Windows平台开发.Putty是一款开源软件,有可用的源代码,和一群志愿者的发展和支持.
![](https://www.unixmen.com/wp-content/uploads/2015/03/putty.png)
Putty非常易于安装和使用,通常你不需要改大部分的配置选项.你只需要输入少量基本的参赛,就可以开始最简单的对话连接[here][1].
### Bitvise SSH Client ###
**Bitvise SSH **是一款支持SSH和SFTP的Windows客户端.由Bitvise专业地提供支持和发展.这款SSH客户端性能强悍,易于安装和使用.Bitvise SSH客户端功能丰富,拥有图形界面,通过一个有自动重连能力的内置代理允许用户动态端口运行.
![](https://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png)
Bitvise SSH客户端对个人用户使用**是**免费的,同时对于在组织内部的单独商业使用也一样.你可以[在这里下载Bitvise SSH客户端][2]
### MobaXterm ###
**M偶吧Xterm**是你的**终极工具箱,解决远程计算**.在单一的Windows应用里,它提供了许多裁剪过的的功能,针对程序员,网络管理者,IT管理员和相当一部分需要在更简单界面(此处原文为in a more simple fashion,有点费解)远程作业的用户.
![](https://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png)
MobaXterm提供了所有重要的**远程网络工具** (如SSH, X11, RDP, VNC, FTP, MOSH 等等),和**Unix 命令**bash, ls, cat, sed, grep, awk, rsync等等适用于Windows桌面在一个**单独便于携带的可执行文件里**其工作独立于工具箱MobaXterm对**个人使用免费**.你可以下载MobaXterm[在这里][3].
### DameWare SSH ###
我认为**DameWare SSH**是最好的免费SSH客户端
![](https://www.unixmen.com/wp-content/uploads/2015/03/ssh.png)
这个免费工具是一个终端模拟器可以让你实现从一个易用控制台的多种telnet和SSH连接
-用一个带标签的控制台界面管理多方会话
在Windows文件系统中保存喜欢的会话
-获取多个保存的证书集合,用于轻松登录不同的设备
使用telnet,SSH1和SSH2协议连接计算机和设备
你可以从[这个链接][4]下载 **DameWare SSH**
### SmarTTY ###
 
SmarTTY是一款免费的多标签SSH客户端支持使用SCP命令及时复制文件和目录
![](https://www.unixmen.com/wp-content/uploads/2015/03/smart.png)
大多数SSH服务器每次连接支持最多10个子会话SmarTTY在这方面做得很好没有烦人的多个窗口不需要重新登录仅仅打开一个新的标签页就可以开始了
### Cygwin ###
Cygwin是一款GNU和开源工具的大杂烩提供的功能近似一个Windows平台下的Linux.
![](https://www.unixmen.com/wp-content/uploads/2015/03/cyq.png)
**Cygwin**包括了一个Unix系统集模拟库cygwin.dll,GNU大量集合和其他被归类了的大量可选免费应用软件包在这些安装包中有高质量的编译器和其他软件开发工具一个X11服务器一套完整的X11开发套件GNU emacs编辑器Tex和LaTeX,openSSH(客户端和服务器),除此之外还有很多包括在微软Windows下需要编译和使用PhysioToolkit软件的每一样东西
读完我们的文章后不知你中意哪一款SSH客户端你可以留下你的评论描述你喜欢的系统和选择的原因当然如果有另外的SSH客户端没有被本文列举出来你可以帮助我们补充
--------------------------------------------------------------------------------
via: https://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/
作者:[anismaj][a]
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[校对者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

@ -1,28 +1,27 @@
How To Get Email Alerts for SSH Login on Linux Server 在Linux服务器上如何为SSH登陆获取Email警告
================================================================================ ================================================================================
![](http://www.ehowstuff.com/wp-content/uploads/2015/03/fail2ban-security.jpg) ![](http://www.ehowstuff.com/wp-content/uploads/2015/03/fail2ban-security.jpg)
Enable SSH server on a virtual private server (VPS) will expose the server to the internet and provide opportunities for hacking activities, especially when VPS still using root as a primary access. VPS should be configured with a email alert automatically to each successful login attempts via SSH server . VPS server owner shall be notified of any SSH server access log, such as who, when and which source IP address. This is an important security concern for server owners to protect the server from unknown login attempts. This is because if hackers use brute force to log into your VPS via ssh then it can be very dangerous. In this article, I will explain how to set up an email alert to all SSH login users on linux CentOS 6, CentOS 7, RHEL 6 and RHEL 7. 让SSH服务器在虚拟私有服务器(VPS)上生效会使得该服务器暴露到互联网中并为黑客活动提供了机会,尤其时当VPS还将root作为主要访问时. VPS应该为每次通过SSH服务器成功登陆尝试配置一个自动的email警告. VPS的服务器所有者应该在任何的SSH服务器访问时得到通知,例如登陆者,登陆时间以及IP地址等信息.这是一个对于服务器拥有者保护服务器避免未知登陆尝试的非常重要的安全关注点.因为如果黑客使用暴力破解方式通过SSH来登陆你的VPS,那么后果很严重.在本文中,我会解释如何在CentOS 6, CentOS 7, RHEL 6 和 RHEL 7上为所有的SSH用户登陆设置一个email警告.
1. Login to your server as root user : 1. 使用root用户登陆到你的服务器:
2. Configure at alert from source global definitions (/etc/bashrc). This will enabled for root and normal users :
2. 在全局源定义处配置警告(/etc/bashrc这样就会对跟用户以及普通用户都生效
[root@vps ~]# vi /etc/bashrc [root@vps ~]# vi /etc/bashrc
Add the following at the bottom of the files. 将下面的内容加入到上述文件的尾部。
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
3. Optionally you can enable alert for root only : 3.你也可以选择性地让警告只对跟用户生效:
[root@vps ~]# vi .bashrc [root@vps ~]# vi .bashrc
Add the following at the bottom of /root/.bashrc : 将下面的内容添加到/root/.bashrc的为尾部
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
Full Configuration file example : 整个配置文件样例:
# .bashrc # .bashrc
@ -38,11 +37,11 @@ Full Configuration file example :
fi fi
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
4. Optionally you can enable alert for specify normal user (e.g skytech ) : 4.你也可以选择性地让警告只对特定的普通用户生效(例如 skytech
[root@vps ~]# vi /home/skytech/.bashrc [root@vps ~]# vi /home/skytech/.bashrc
Add the following at the bottom of /home/skytech/.bashrc : 将下面的内容加入到/home/skytech/.bashrc文件尾部
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
@ -51,7 +50,7 @@ Add the following at the bottom of /home/skytech/.bashrc :
via: http://www.ehowstuff.com/how-to-get-email-alerts-for-ssh-login-on-linux-server/ via: http://www.ehowstuff.com/how-to-get-email-alerts-for-ssh-login-on-linux-server/
作者:[skytech][a] 作者:[skytech][a]
译者:[译者ID](https://github.com/译者ID) 译者:[theo-l](https://github.com/theo-l)
校对:[校对者ID](https://github.com/校对者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出