mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-04 22:00:34 +08:00
commit
94d10f1f1b
@ -1,12 +1,14 @@
|
||||
如何记住并在下一次登录时还原正在运行的应用
|
||||
如何在 Ubuntu 中再次登录时还原上次运行的应用
|
||||
================================================================================
|
||||
在你的 Ubuntu 里,你正运行着某些应用,但并不想停掉它们的进程,只想管理一下窗口,并打开那些工作需要的应用。接着,某些其他的事需要你转移注意力或你的机器电量低使得你必须马上关闭电脑。(幸运的是,)你可以让 Ubuntu 记住所有你正运行的应用并在你下一次登录时还原它们。
|
||||
在你的 Ubuntu 里,如果你需要处理一些工作,你并不需要关闭正运行着的那些应用,只需要管理一下窗口,并打开那些工作需要的应用就行。然而,如果你需要离开处理些别的事情或你的机器电量低使得你必须马上关闭电脑,这些程序可能就需要关闭终止了。不过幸运的是,你可以让 Ubuntu 记住所有你正运行的应用并在你下一次登录时还原它们。
|
||||
|
||||
现在,为了让我们的 Ubuntu 记住当前会话中正运行的应用并在我们下一次登录时还原它们,我们将会使用到 `dconf-editor`。这个工具代替了前一个 Ubuntu 版本里安装的 `gconf-editor`,但默认情况下并没有在现在这个 Ubuntu 版本(注:这里指的是 Ubuntu 14.04 LTS) 里安装。为了安装 `dconf-editor`, 你需要运行 `sudo apt-get install dconf-editor`命令:
|
||||
###自动保存会话
|
||||
|
||||
现在,为了让我们的 Ubuntu 记住当前会话中正运行的应用并在我们下一次登录时还原它们,我们将会使用到 `dconf-editor`。这个工具代替了前一个 Ubuntu 版本里安装的 `gconf-editor`,但默认情况下现在这个 Ubuntu 版本(注:这里指的是 Ubuntu 14.04 LTS) 并没有安装。为了安装 `dconf-editor`, 你需要运行 `sudo apt-get install dconf-editor`命令:
|
||||
|
||||
$ sudo apt-get install dconf-tools
|
||||
|
||||
一旦 `dconf-editor` 安装完毕,你就可以从应用菜单(注:这里指的是 Unity Dash)里打开它或者你可以通过直接在终端里或使用 `alt+f2` 运行下面的命令来启动它:
|
||||
一旦 `dconf-editor` 安装完毕,你就可以从应用菜单(注:这里指的是 Unity Dash)里打开它,或者你可以通过直接在终端里运行,或使用 `alt+f2` 运行下面的命令来启动它:
|
||||
|
||||
$ dconf-editor
|
||||
|
||||
@ -22,7 +24,7 @@
|
||||
|
||||
![dconf-editor selecting auto save session](http://blog.linoxide.com/wp-content/uploads/2015/01/dconf-editor_selecting_auto_save_session.png)
|
||||
|
||||
在你检查或对刚才的选项打钩之后,点击默认情况下位于窗口左上角的关闭按钮(X)来关闭 “Dconf Editor”。
|
||||
在你确认对刚才的选项打钩之后,点击默认情况下位于窗口左上角的关闭按钮(X)来关闭 “Dconf Editor”。
|
||||
|
||||
![dconf-editor closing dconf editor](http://blog.linoxide.com/wp-content/uploads/2015/01/dconf-editor_closing_dconf_editor.png)
|
||||
|
||||
@ -30,6 +32,10 @@
|
||||
|
||||
欢呼吧,我们已经成功地配置了我们的 Ubuntu 14.04 LTS "Trusty" 来自动记住我们上一次会话中正在运行的应用。
|
||||
|
||||
除了关机后恢复应用之外,还可以通过休眠来达成类似的功能。
|
||||
|
||||
###休眠功能
|
||||
|
||||
现在,在这个教程里,我们也将学会 **如何在 Ubuntu 14.04 LTS 里开启休眠功能** :
|
||||
|
||||
在开始之前,在键盘上按 `Ctrl+Alt+T` 来开启终端。在它开启以后,运行:
|
||||
@ -38,15 +44,15 @@
|
||||
|
||||
在你的电脑关闭后,再重新开启它。这时,你开启的应用被重新打开了吗?如果休眠功能没有发挥作用,请检查你的交换分区大小,它至少要和你可用 RAM 大小相当。
|
||||
|
||||
你可以在系统监视器里查看你的交换分区大小,而系统监视器可以通过在应用菜单或在终端里运行下面的命令来开启:
|
||||
你可以在系统监视器里查看你的交换分区大小,系统监视器可以通过在应用菜单或在终端里运行下面的命令来开启:
|
||||
|
||||
$ gnome-system-monitor
|
||||
|
||||
### 在系统托盘里启用休眠功能: ###
|
||||
#### 在系统托盘里启用休眠功能: ####
|
||||
|
||||
提示模块是通过使用 logind 而不是使用 upower 来更新的。默认情况下,在 upower 和 logind 中,休眠都被禁用了。
|
||||
系统托盘里面的会话指示器现在使用 logind 而不是 upower 了。默认情况下,在 upower 和 logind 中,休眠菜单都被禁用了。
|
||||
|
||||
为了开启休眠功能,依次运行下面的命令来编辑配置文件:
|
||||
为了开启它的休眠菜单,依次运行下面的命令来编辑配置文件:
|
||||
|
||||
sudo -i
|
||||
|
||||
@ -70,26 +76,27 @@
|
||||
|
||||
重启你的电脑就可以了。
|
||||
|
||||
### 当你盖上笔记本的后盖时,让它休眠: ###
|
||||
#### 当你盖上笔记本的后盖时,让它休眠: ####
|
||||
|
||||
1.通过下面的命令编辑文件 “/etc/systemd/logind.conf” :
|
||||
1. 通过下面的命令编辑文件 “/etc/systemd/logind.conf” :
|
||||
|
||||
$ sudo nano /etc/systemd/logind.conf
|
||||
|
||||
$ sudo nano /etc/systemd/logind.conf
|
||||
|
||||
2. 将 **#HandleLidSwitch=suspend** 这一行改为 **HandleLidSwitch=hibernate** 并保存文件;
|
||||
2. 将 **#HandleLidSwitch=suspend** (挂起)这一行改为 **HandleLidSwitch=hibernate** (休眠)并保存文件;
|
||||
|
||||
3. 运行下面的命令或重启你的电脑来应用更改:
|
||||
|
||||
$ sudo restart systemd-logind
|
||||
$ sudo restart systemd-logind
|
||||
|
||||
就是这样。 成功了吗?现在我们设置了 dconf 并开启了休眠功能 :) 这样,无论你是关机还是直接合上笔记本盖子,你的 Ubuntu 将能够完全记住你开启的应用和窗口了。
|
||||
|
||||
就是这样。享受吧!现在我们有了 dconf 并开启了休眠功能 :) 你的 Ubuntu 将能够完全记住你开启的应用和窗口了。
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/remember-running-applications-ubuntu/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,12 +1,12 @@
|
||||
在CentOS或者Redhat中如何为Apache Tomcat绑定IPv4
|
||||
如何在 CentOS/RHEL 中为 Apache Tomcat 绑定 IPv4 地址
|
||||
================================================================================
|
||||
今天我们来学习一下如何在CentOS 7 Linux分布式系统中为Tomcat绑定IPv4
|
||||
今天我们来学习一下如何在CentOS 7 Linux分布式系统中为Tomcat绑定IPv4。
|
||||
|
||||
**Apache Tomcat** 是由[Apache Software Foundation][1] 开发的开源web服务器和servlet容器。它实现了Java Servlet,JavaServer页面(JSP),Java的统一表达式语言,以及Sun Microsystems的Java的WebSocket规范,并提供了一个运行java代码的web服务器环境。
|
||||
**Apache Tomcat** 是由[Apache 软件基金会][1] 开发的开源web服务器和servlet容器。它实现了Java Servlet,JavaServer页面(JSP),Java的统一表达式语言,以及Sun Microsystems的Java的WebSocket规范,并提供了一个运行java代码的web服务器环境。
|
||||
|
||||
如果由于默认绑定tomcat到IPv6而导致我们的web服务器不能正常工作,就有必要将tomcat绑定到IPv4。众所周知,IPv6是为设备分配IP地址的现代方法,虽然在不久的将来也许会得到应用,但是现在并没有得到完全应用。由于没有用处,目前我们并不需要将我们的Tomcat服务器向IPv6转换,我们应该将其绑定到IPv4。
|
||||
如果由于tomcat默认绑定到IPv6而导致我们的web服务器不能正常工作,就有必要将tomcat绑定到IPv4。众所周知,IPv6是为设备分配IP地址的现代方法,虽然在不久的将来也许会得到应用,但是现在并没有得到完全应用。由于没有用处,目前我们并不需要将我们的Tomcat服务器向IPv6转换,我们应该将其绑定到IPv4。
|
||||
|
||||
在开始将tomcat绑定到IPv4之前,我们应该确保在我们的CentOS 7中已经安装了tomcat。这是一个[如何在CentOS 7.0服务器中安装tomcat 8][2]的指导。
|
||||
在开始将tomcat绑定到IPv4之前,我们应该确保在我们的CentOS 7中已经安装了tomcat。可以看这个[如何在CentOS 7.0服务器中安装tomcat 8][2]的指导。
|
||||
|
||||
### 1. 切换到tomcat用户 ###
|
||||
|
||||
@ -32,13 +32,13 @@
|
||||
|
||||
### 3. 配置 Catalina.sh ###
|
||||
|
||||
如图所示,我们将在catalina.sh脚本文件的最后增加一行 **JAVA_OPTS= "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"**。我们可以使用我们喜欢的文本编辑器来编辑这个文件,例如nano,vim等等。这里我们使用nano。
|
||||
如图所示,我们将在catalina.sh脚本文件的最后增加一行 `JAVA_OPTS= "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"`。我们可以使用我们喜欢的文本编辑器来编辑这个文件,例如nano、vim等等。这里我们使用nano。
|
||||
|
||||
$ nano catalina.sh
|
||||
|
||||
![Catalina script](http://blog.linoxide.com/wp-content/uploads/2015/01/catalina-script.png)
|
||||
|
||||
然后,如下图所示,将 **JAVA_OPTS= "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"** 增加到文件。
|
||||
然后,如下图所示,将该行增加到文件。
|
||||
|
||||
![配置 catalina](http://blog.linoxide.com/wp-content/uploads/2015/01/configured-catalina.png)
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
### 结尾 ###
|
||||
|
||||
好了,我们终于将我们运行在CentOS 7 Linux分布式系统上的tomcat服务器绑定到IPv4上了。尽管IPv6在不久的将来也许会得到应用,但由于现在还没有使用,如果因为将你的Tomcat服务器绑定到IPv6上而使得你的tomcat服务器不工作,就有必要将tomcat绑定到IPv4上,这也很简单。如果你有任何疑问,建议,反馈,请在下面的评论框中写下来,让我们知道有什么需要增加或者改进。非常感谢!
|
||||
好了,我们终于将我们运行在CentOS 7 Linux发行版上的tomcat服务器绑定到IPv4上了。尽管IPv6在不久的将来也许会得到应用,但由于现在还没有使用,如果因为将你的Tomcat服务器绑定到IPv6上而使得你的tomcat服务器不工作,就有必要将tomcat绑定到IPv4上,这也很简单。如果你有任何疑问,建议,反馈,请在下面的评论框中写下来,让我们知道有什么需要增加或者改进。非常感谢!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -68,7 +68,7 @@ via: http://linoxide.com/linux-how-to/bind-apache-tomcat-ipv4-centos/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,39 +1,42 @@
|
||||
Linux Shell脚本 入门25问
|
||||
Linux Shell脚本面试25问
|
||||
================================================================================
|
||||
### Q:1 Shell脚本是什么、为什么它是必需的吗? ###
|
||||
### Q:1 Shell脚本是什么、它是必需的吗? ###
|
||||
|
||||
答:一个Shell脚本是一个文本文件,包含一个或多个命令。作为系统管理员,我们经常需要发出多个命令来完成一项任务,我们可以添加这些所有命令在一个文本文件(Shell脚本)来完成日常工作任务。
|
||||
答:一个Shell脚本是一个文本文件,包含一个或多个命令。作为系统管理员,我们经常需要使用多个命令来完成一项任务,我们可以添加这些所有命令在一个文本文件(Shell脚本)来完成这些日常工作任务。
|
||||
|
||||
### Q:2 什么是默认登录shell,如何改变指定用户的登录shell ###
|
||||
|
||||
答:在Linux操作系统,“/ bin / bash”是默认登录shell,在用户创建时被分配的。使用chsh命令可以改变默认的shell。示例如下所示:
|
||||
答:在Linux操作系统,“/bin/bash”是默认登录shell,是在创建用户时分配的。使用chsh命令可以改变默认的shell。示例如下所示:
|
||||
|
||||
# chsh <username> -s <new_default_shell>
|
||||
# chsh <用户名> -s <新shell>
|
||||
# chsh linuxtechi -s /bin/sh
|
||||
|
||||
### Q:3 有什么不同的类型在shell脚本中使用? ###
|
||||
### Q:3 可以在shell脚本中使用哪些类型的变量? ###
|
||||
|
||||
答:在shell脚本,我们可以使用两个类型变量:
|
||||
答:在shell脚本,我们可以使用两种类型的变量:
|
||||
|
||||
- 系统定义变量
|
||||
- 用户定义变量
|
||||
|
||||
系统变量是由系统系统自己创建的。这些变量通常由大写字母组成,可以通过“**set**”命令查看。
|
||||
|
||||
系统变量是由系统系统自己创建的。这些变量由大写字母组成,可以通过“**set**”命令查看。
|
||||
用户变量由系统用户来生成和定义,变量的值可以通过命令“`echo $<变量名>`”查看。
|
||||
|
||||
用户变量由系统用户来生成,变量的值可以通过命令“`echo $<变量名>`”查看
|
||||
|
||||
### Q:4 如何同时重定向标准输出和错误输出到同一位置? ###
|
||||
### Q:4 如何将标准输出和错误输出同时重定向到同一位置? ###
|
||||
|
||||
答:这里有两个方法来实现:
|
||||
|
||||
方法1:2>&1 (# ls /usr/share/doc > out.txt 2>&1 )
|
||||
方法一:
|
||||
|
||||
方法二:&> (# ls /usr/share/doc &> out.txt )
|
||||
2>&1 (如# ls /usr/share/doc > out.txt 2>&1 )
|
||||
|
||||
### Q:5 shell脚本中“if”的语法 ? ###
|
||||
方法二:
|
||||
|
||||
答:基础语法:
|
||||
&> (如# ls /usr/share/doc &> out.txt )
|
||||
|
||||
### Q:5 shell脚本中“if”语法如何嵌套? ###
|
||||
|
||||
答:基础语法如下:
|
||||
|
||||
if [ 条件 ]
|
||||
then
|
||||
@ -72,9 +75,9 @@ Linux Shell脚本 入门25问
|
||||
|
||||
如果结束状态不是0,说明命令执行失败。
|
||||
|
||||
### Q:7 在shell脚本中如何比较两个数 ? ###
|
||||
### Q:7 在shell脚本中如何比较两个数字 ? ###
|
||||
|
||||
答:测试用例使用if-then来比较两个数,例子如下:
|
||||
答:在if-then中使用测试命令( -gt 等)来比较两个数字,例子如下:
|
||||
|
||||
#!/bin/bash
|
||||
x=10
|
||||
@ -89,11 +92,11 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:8 shell脚本中break命令的作用 ? ###
|
||||
|
||||
答:break命令一个简单的用途是退出执行中的循环。我们可以在while 和until循环中使用break命令跳出循环。
|
||||
答:break命令一个简单的用途是退出执行中的循环。我们可以在while和until循环中使用break命令跳出循环。
|
||||
|
||||
### Q:9 shell脚本中continue命令的作用 ? ###
|
||||
|
||||
答:continue命令不同于break命令,它只跳出当前循环的迭代,而不是整个循环。continue命令很多时候是很有用的,例如错误发生,但我们依然希望循环继续的时候。
|
||||
答:continue命令不同于break命令,它只跳出当前循环的迭代,而不是**整个**循环。continue命令很多时候是很有用的,例如错误发生,但我们依然希望继续执行大循环的时候。
|
||||
|
||||
### Q:10 告诉我shell脚本中Case语句的语法 ? ###
|
||||
|
||||
@ -116,14 +119,14 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:11 shell脚本中while循环语法 ? ###
|
||||
|
||||
答:如同for循环,while循环重复自己所有命令只要条件成立,不同于for循环。基础语法:
|
||||
答:如同for循环,while循环只要条件成立就重复它的命令块。不同于for循环,while循环会不断迭代,直到它的条件不为真。基础语法:
|
||||
|
||||
while [ 条件 ]
|
||||
do
|
||||
命令…
|
||||
done
|
||||
|
||||
### Q:12 如何使脚本成为可执行状态 ? ###
|
||||
### Q:12 如何使脚本可执行 ? ###
|
||||
|
||||
答:使用chmod命令来使脚本可执行。例子如下:
|
||||
|
||||
@ -131,11 +134,11 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:13 “#!/bin/bash”的作用 ? ###
|
||||
|
||||
答:#!/bin/bash是shell脚本的第一行,总所周知,#符号调用hash而!调用bang。它的意思是命令使用 /bin/bash来执行命令
|
||||
答:#!/bin/bash是shell脚本的第一行,称为释伴(shebang)行。这里#符号叫做hash,而! 叫做 bang。它的意思是命令通过 /bin/bash 来执行。
|
||||
|
||||
### Q:14 shell脚本中for循环语法 ? ###
|
||||
|
||||
答:for循环基础语法:
|
||||
答:for循环的基础语法:
|
||||
|
||||
for 变量 in 循环列表
|
||||
do
|
||||
@ -147,13 +150,13 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:15 如何调试shell脚本 ? ###
|
||||
|
||||
答:使用'-x'参数(sh -x myscript.sh)可以调试shell脚本。另一个种方法是使用‘-nv’参数( sh -nv myscript.sh)
|
||||
答:使用'-x'参数(sh -x myscript.sh)可以调试shell脚本。另一个种方法是使用‘-nv’参数( sh -nv myscript.sh)。
|
||||
|
||||
### Q:16 shell脚本如何比较字符串? ###
|
||||
|
||||
答:test命令可以用来比较字符串。Test命令比较字符串通过比较每一个字符来比较。
|
||||
答:test命令可以用来比较字符串。测试命令会通过比较字符串中的每一个字符来比较。
|
||||
|
||||
### Q:17 Bourne shell(bash) 中有哪些特别变量 ? ###
|
||||
### Q:17 Bourne shell(bash) 中有哪些特殊的变量 ? ###
|
||||
|
||||
答:下面的表列出了Bourne shell为命令行设置的特殊变量。
|
||||
|
||||
@ -175,7 +178,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">$0</p>
|
||||
</td>
|
||||
<td width="453" valign="top">
|
||||
<p align="left" class="western">来自命令行脚本的名字</p>
|
||||
<p align="left" class="western">命令行中的脚本名字</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -252,7 +255,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-d 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在并且是一个目录</p>
|
||||
<p align="left" class="western">如果文件存在并且是目录,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@ -260,7 +263,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-e 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在</p>
|
||||
<p align="left" class="western">如果文件存在,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@ -268,7 +271,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-f 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在并且是普通文件</p>
|
||||
<p align="left" class="western">如果文件存在并且是普通文件,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@ -276,7 +279,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-r 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在并拥有读权限</p>
|
||||
<p align="left" class="western">如果文件存在并可读,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@ -284,7 +287,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-s 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在并且不为空</p>
|
||||
<p align="left" class="western">如果文件存在并且不为空,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@ -292,7 +295,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-w 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在并拥有写权限</p>
|
||||
<p align="left" class="western">如果文件存在并可写,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
@ -300,7 +303,7 @@ Linux Shell脚本 入门25问
|
||||
<p align="left" class="western">-x 文件名</p>
|
||||
</td>
|
||||
<td width="453">
|
||||
<p align="left" class="western">返回true,如果文件存在并拥有执行权限</p>
|
||||
<p align="left" class="western">如果文件存在并可执行,返回true</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -308,15 +311,15 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:19 在shell脚本中,如何写入注释 ? ###
|
||||
|
||||
答:注释可以用来描述一个脚本可以做什么和它是如何工作的。每一个注释以#开头。例子如下:
|
||||
答:注释可以用来描述一个脚本可以做什么和它是如何工作的。每一行注释以#开头。例子如下:
|
||||
|
||||
#!/bin/bash
|
||||
# This is a command
|
||||
echo “I am logged in as $USER”
|
||||
|
||||
### Q:20 如何得到来自终端的命令输入到shell脚本? ###
|
||||
### Q:20 如何让 shell 就脚本得到来自终端的输入? ###
|
||||
|
||||
答:read命令可以读取来自终端(使用键盘)的数据。read命令接入用户的输入并置于变量中。例子如下:
|
||||
答:read命令可以读取来自终端(使用键盘)的数据。read命令得到用户的输入并置于你给出的变量中。例子如下:
|
||||
|
||||
# vi /tmp/test.sh
|
||||
|
||||
@ -330,9 +333,9 @@ Linux Shell脚本 入门25问
|
||||
LinuxTechi
|
||||
My Name is LinuxTechi
|
||||
|
||||
### Q:21 如何取消设置或取消变量 ? ###
|
||||
### Q:21 如何取消变量或取消变量赋值 ? ###
|
||||
|
||||
答:“unset”命令用于去取消或取消设置一个变量。语法如下所示:
|
||||
答:“unset”命令用于取消变量或取消变量赋值。语法如下所示:
|
||||
|
||||
# unset <变量名>
|
||||
|
||||
@ -345,7 +348,7 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:23 do-while语句的基本格式 ? ###
|
||||
|
||||
答:do-while语句类似于while语句,但检查条件语句之前先执行命令。下面是用do-while语句的语法
|
||||
答:do-while语句类似于while语句,但检查条件语句之前先执行命令(LCTT 译注:意即至少执行一次。)。下面是用do-while语句的语法
|
||||
|
||||
do
|
||||
{
|
||||
@ -354,7 +357,7 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:24 在shell脚本如何定义函数呢 ? ###
|
||||
|
||||
答:函数是拥有名字的代码块。当我们定义代码块,我们就可以在我们的脚本调用名字,该块就会被执行。示例如下所示:
|
||||
答:函数是拥有名字的代码块。当我们定义代码块,我们就可以在我们的脚本调用函数名字,该块就会被执行。示例如下所示:
|
||||
|
||||
$ diskusage () { df -h ; }
|
||||
|
||||
@ -371,7 +374,7 @@ Linux Shell脚本 入门25问
|
||||
|
||||
### Q:25 如何在shell脚本中使用BC(bash计算器) ? ###
|
||||
|
||||
答:使用下列格式,在shell脚本中使用bc
|
||||
答:使用下列格式,在shell脚本中使用bc:
|
||||
|
||||
variable=`echo “options; expression” | bc`
|
||||
|
||||
@ -381,7 +384,7 @@ via: http://www.linuxtechi.com/linux-shell-scripting-interview-questions-answers
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
译者:[VicYu/Vic020](http://vicyu.net)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,24 +1,22 @@
|
||||
===>> boredivan翻译中 <<===
|
||||
怎样在CentOS 7.0上安装/配置VNC服务器
|
||||
怎样在CentOS 7.0上安装和配置VNC服务器
|
||||
================================================================================
|
||||
这是一个关于怎样在你的 CentOS 7 上安装配置 [VNC][1] 服务的教程。当然这个教程也适合 RHEL 7 。在这个教程里,我们将学习什么是VNC以及怎样在 CentOS 7 上安装配置 [VNC 服务器][1]。
|
||||
这是一个关于怎样在你的 CentOS 7 上安装配置 [VNC][1] 服务的教程。当然这个教程也适合 RHEL 7 。在这个教程里,我们将学习什么是 VNC 以及怎样在 CentOS 7 上安装配置 [VNC 服务器][1]。
|
||||
|
||||
我们都知道,作为一个系统管理员,大多数时间是通过网络管理服务器的。在管理服务器的过程中很少会用到图形界面,多数情况下我们只是用 SSH 来完成我们的管理任务。在这篇文章里,我们将配置 VNC 来提供一个连接我们 CentOS 7 服务器的方法。VNC 允许我们开启一个远程图形会话来连接我们的服务器,这样我们就可以通过网络远程访问服务器的图形界面了。
|
||||
|
||||
VNC 服务器是一个自由且开源的软件,它可以让用户可以远程访问服务器的桌面环境。另外连接 VNC 服务器需要使用 VNC viewer 这个客户端。
|
||||
VNC 服务器是一个自由开源软件,它可以让用户可以远程访问服务器的桌面环境。另外连接 VNC 服务器需要使用 VNC viewer 这个客户端。
|
||||
|
||||
** 一些 VNC 服务器的优点:**
|
||||
|
||||
远程的图形管理方式让工作变得简单方便。
|
||||
剪贴板可以在 CentOS 服务器主机和 VNC 客户端机器之间共享。
|
||||
CentOS 服务器上也可以安装图形工具,让管理能力变得更强大。
|
||||
只要安装了 VNC 客户端,任何操作系统都可以管理 CentOS 服务器了。
|
||||
比 ssh 图形和 RDP 连接更可靠。
|
||||
- 远程的图形管理方式让工作变得简单方便。
|
||||
- 剪贴板可以在 CentOS 服务器主机和 VNC 客户端机器之间共享。
|
||||
- CentOS 服务器上也可以安装图形工具,让管理能力变得更强大。
|
||||
- 只要安装了 VNC 客户端,通过任何操作系统都可以管理 CentOS 服务器了。
|
||||
- 比 ssh 图形转发和 RDP 连接更可靠。
|
||||
|
||||
那么,让我们开始安装 VNC 服务器之旅吧。我们需要按照下面的步骤一步一步来搭建一个有效的 VNC。
|
||||
那么,让我们开始安装 VNC 服务器之旅吧。我们需要按照下面的步骤一步一步来搭建一个可用的 VNC。
|
||||
|
||||
|
||||
首先,我们需要一个有效的桌面环境(X-Window),如果没有的话要先安装一个。
|
||||
首先,我们需要一个可用的桌面环境(X-Window),如果没有的话要先安装一个。
|
||||
|
||||
**注意:以下命令必须以 root 权限运行。要切换到 root ,请在终端下运行“sudo -s”,当然不包括双引号(“”)**
|
||||
|
||||
@ -34,7 +32,8 @@ VNC 服务器是一个自由且开源的软件,它可以让用户可以远程
|
||||
#yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
|
||||
|
||||
![install gnome classic session](http://blog.linoxide.com/wp-content/uploads/2015/01/gnome-classic-session-install.png)
|
||||
|
||||
|
||||
### 设置默认启动图形界面
|
||||
# unlink /etc/systemd/system/default.target
|
||||
# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
|
||||
|
||||
@ -56,13 +55,13 @@ VNC 服务器是一个自由且开源的软件,它可以让用户可以远程
|
||||
|
||||
### 3. 配置 VNC ###
|
||||
|
||||
然后,我们需要在 **/etc/systemd/system/** 目录里创建一个配置文件。我们可以从 **/lib/systemd/sytem/vncserver@.service** 拷贝一份配置文件范例过来。
|
||||
然后,我们需要在 `/etc/systemd/system/` 目录里创建一个配置文件。我们可以将 `/lib/systemd/sytem/vncserver@.service` 拷贝一份配置文件范例过来。
|
||||
|
||||
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
|
||||
|
||||
![copying vnc server configuration](http://blog.linoxide.com/wp-content/uploads/2015/01/copying-configuration.png)
|
||||
|
||||
接着我们用自己最喜欢的编辑器(这儿我们用的 **nano** )打开 **/etc/systemd/system/vncserver@:1.service** ,找到下面这几行,用自己的用户名替换掉 <USER> 。举例来说,我的用户名是 linoxide 所以我用 linoxide 来替换掉 <USER> :
|
||||
接着我们用自己最喜欢的编辑器(这儿我们用的 **nano** )打开 `/etc/systemd/system/vncserver@:1.service` ,找到下面这几行,用自己的用户名替换掉 <USER> 。举例来说,我的用户名是 linoxide 所以我用 linoxide 来替换掉 <USER> :
|
||||
|
||||
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
|
||||
PIDFile=/home/<USER>/.vnc/%H%i.pid
|
||||
@ -83,8 +82,7 @@ VNC 服务器是一个自由且开源的软件,它可以让用户可以远程
|
||||
|
||||
# systemctl daemon-reload
|
||||
|
||||
Finally, we'll create VNC password for the user . To do so, first you'll need to be sure that you have sudo access to the user, here I will login to user "linoxide" then, execute the following. To login to linoxide we'll run "**su linoxide" without quotes** .
|
||||
最后还要设置一下用户的 VNC 密码。要设置某个用户的密码,必须要获得该用户的权限,这里我用 linoxide 的权限,执行“**su linoxide**”就可以了。
|
||||
最后还要设置一下用户的 VNC 密码。要设置某个用户的密码,必须要有能通过 sudo 切换到用户的权限,这里我用 linoxide 的权限,执行“`su linoxide`”就可以了。
|
||||
|
||||
# su linoxide
|
||||
$ sudo vncpasswd
|
||||
@ -112,7 +110,7 @@ Finally, we'll create VNC password for the user . To do so, first you'll need to
|
||||
|
||||
![allowing firewalld](http://blog.linoxide.com/wp-content/uploads/2015/01/allowing-firewalld.png)
|
||||
|
||||
现在就可以用 IP 和端口号(例如 192.168.1.1:1 ,这里的端口不是服务器的端口,而是视 VNC 连接数的多少从1开始排序——译注)来连接 VNC 服务器了。
|
||||
现在就可以用 IP 和端口号(LCTT 译注:例如 192.168.1.1:1 ,这里的端口不是服务器的端口,而是视 VNC 连接数的多少从1开始排序)来连接 VNC 服务器了。
|
||||
|
||||
### 6. 用 VNC 客户端连接服务器 ###
|
||||
|
||||
@ -122,33 +120,33 @@ Finally, we'll create VNC password for the user . To do so, first you'll need to
|
||||
|
||||
你可以用像 [Tightvnc viewer][3] 和 [Realvnc viewer][4] 的客户端来连接到服务器。
|
||||
|
||||
要用其他用户和端口连接 VNC 服务器,请回到第3步,添加一个新的用户和端口。你需要创建 **vncserver@:2.service** 并替换配置文件里的用户名和之后步骤里响应的文件名、端口号。**请确保你登录 VNC 服务器用的是你之前配置 VNC 密码的时候使用的那个用户名**
|
||||
要用更多的用户连接,需要创建配置文件和端口,请回到第3步,添加一个新的用户和端口。你需要创建 `vncserver@:2.service` 并替换配置文件里的用户名和之后步骤里相应的文件名、端口号。**请确保你登录 VNC 服务器用的是你之前配置 VNC 密码的时候使用的那个用户名**。
|
||||
|
||||
VNC 服务本身使用的是5900端口。鉴于有不同的用户使用 VNC ,每个人的连接都会获得不同的端口。配置文件名里面的数字告诉 VNC 服务器把服务运行在5900的子端口上。在我们这个例子里,第一个 VNC 服务会运行在5901(5900 + 1)端口上,之后的依次增加,运行在5900 + x 号端口上。其中 x 是指之后用户的配置文件名 `vncserver@:x.service` 里面的 x 。
|
||||
|
||||
在建立连接之前,我们需要知道服务器的 IP 地址和端口。IP 地址是一台计算机在网络中的独特的识别号码。我的服务器的 IP 地址是96.126.120.92,VNC 用户端口是1。
|
||||
|
||||
VNC 服务本身使用的是5900端口。鉴于有不同的用户使用 VNC ,每个人的连接都会获得不同的端口。配置文件名里面的数字告诉 VNC 服务器把服务运行在5900的子端口上。在我们这个例子里,第一个 VNC 服务会运行在5901(5900 + 1)端口上,之后的依次增加,运行在5900 + x 号端口上。其中 x 是指之后用户的配置文件名 **vncserver@:x.service** 里面的 x 。
|
||||
|
||||
在建立连接之前,我们需要知道服务器的 IP 地址和端口。IP 地址是一台计算机在网络中的独特的识别号码。我的服务器的 IP 地址是96.126.120.92,VNC 用户端口是1。执行下面的命令可以获得服务器的公网 IP 地址。
|
||||
执行下面的命令可以获得服务器的公网 IP 地址(LCTT 译注:如果你的服务器放在内网或使用动态地址的话,可以这样获得其公网 IP 地址)。
|
||||
|
||||
# curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
|
||||
|
||||
### 总结 ###
|
||||
|
||||
好了,现在我们已经在运行 CentOS 7 / RHEL 7 (Red Hat Enterprises Linux)的服务器上安装配置好了 VNC 服务器。VNC 是自由及开源的软件中最简单的一种能实现远程控制服务器的一种工具,也是 Teamviewer Remote Access 的一款优秀的替代品。VNC 允许一个安装了 VNC 客户端的用户远程控制一台安装了 VNC 服务的服务器。下面还有一些经常使用的相关命令。好好玩!
|
||||
好了,现在我们已经在运行 CentOS 7 / RHEL 7 的服务器上安装配置好了 VNC 服务器。VNC 是自由开源软件中最简单的一种能实现远程控制服务器的工具,也是一款优秀的 Teamviewer Remote Access 替代品。VNC 允许一个安装了 VNC 客户端的用户远程控制一台安装了 VNC 服务的服务器。下面还有一些经常使用的相关命令。好好玩!
|
||||
|
||||
#### 其他命令: ####
|
||||
|
||||
- 关闭 VNC 服务。
|
||||
|
||||
# systemctl stop vncserver@:1.service
|
||||
# systemctl stop vncserver@:1.service
|
||||
|
||||
- 禁止 VNC 服务开机启动。
|
||||
|
||||
# systemctl disable vncserver@:1.service
|
||||
# systemctl disable vncserver@:1.service
|
||||
|
||||
- 关闭防火墙。
|
||||
|
||||
# systemctl stop firewalld.service
|
||||
# systemctl stop firewalld.service
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -156,7 +154,7 @@ via: http://linoxide.com/linux-how-to/install-configure-vnc-server-centos-7-0/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[boredivan](https://github.com/boredivan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -5,27 +5,28 @@
|
||||
数百万个网站用着 WordPress ,这当然是有原因的。WordPress 是众多内容管理系统中对开发者最友好的,本质上说你可以用它做任何事情。不幸的是,每天都有些吓人的报告说某个主要的网站被黑了,或者某个重要的数据库被泄露了之类的,吓得人一愣一愣的。
|
||||
|
||||
如果你还没有安装 WordPress ,可以看下下面的文章。
|
||||
|
||||
在基于 Debian 的系统上:
|
||||
|
||||
- [How to install WordPress On Ubuntu][1]
|
||||
- [如何在 Ubuntu 上安装 WordPress][1]
|
||||
|
||||
在基于 RPM 的系统上:
|
||||
|
||||
- [How to install wordpress On CentOS][2]
|
||||
- [如何在 CentOS 上安装 WordPress][2]
|
||||
|
||||
我之前的文章 [How To Secure WordPress Website][3] 里面列出的**备忘录**为读者维护 WordPress 的安全提供了一点帮助。
|
||||
我之前的文章 [ 如何安全加固 WordPress 站点][3] 里面列出的**备忘录**为读者维护 WordPress 的安全提供了一点帮助。
|
||||
|
||||
在这篇文章里面,我将说明 **wpscan** 的安装过程,以及怎样使用 wpscan 来锁定任何已知的会让你的站点变得易受攻击的插件和主题。还有怎样安装和使用一款免费的网络探索和攻击的安全扫描软件 **nmap** 。最后展示的是使用 **nikto** 的步骤。
|
||||
在这篇文章里面,我将介绍 **wpscan** 的安装过程,以及怎样使用 wpscan 来定位那些已知的会让你的站点变得易受攻击的插件和主题。还有怎样安装和使用一款免费的网络探索和攻击的安全扫描软件 **nmap** 。最后展示的是使用 **nikto** 的步骤。
|
||||
|
||||
### 用 WPScan 测试 WordPress 中易受攻击的插件和主题 ###
|
||||
|
||||
**WPScan** 是一个 WordPress 黑盒安全扫描软件,用 Ruby 写成,它是专门用来寻找已知的 WordPress 的弱点的。它为安全专家和 WordPress 管理员提供了一条评估他们的 WordPress 站点的途径。它的基于开源代码,在 GPLv3 下发行。
|
||||
|
||||
### 下载和安装 WPScan ###
|
||||
#### 下载和安装 WPScan ####
|
||||
|
||||
在我们开始安装之前,很重要的一点是要注意 wpscan 不能在 Windows 下工作,所以你需要使用一台 Linux 或者 OS X 的机器来完成下面的事情。如果你只有 Windows 的系统,拿你可以下载一个 Virtualbox 然后在虚拟机里面安装任何你喜欢的 Linux 发行版本。
|
||||
|
||||
WPScan 的源代码被放在 Github 上,所以需要先安装 git。
|
||||
WPScan 的源代码放在 Github 上,所以需要先安装 git(LCTT 译注:其实你也可以直接从 Github 上下载打包的源代码,而不必非得装 git )。
|
||||
|
||||
sudo apt-get install git
|
||||
|
||||
@ -44,7 +45,7 @@ git 装好了,我们就要安装 wpscan 的依赖包了。
|
||||
|
||||
现在 wpscan 装好了,我们就可以用它来搜索我们 WordPress 站点潜在的易受攻击的文件。wpcan 最重要的方面是它能列出不仅是插件和主题,也能列出用户和缩略图的功能。WPScan 也可以用来暴力破解 WordPress —— 但这不是本文要讨论的内容。
|
||||
|
||||
#### 跟新 WPScan ####
|
||||
#### 更新 WPScan ####
|
||||
|
||||
ruby wpscan.rb --update
|
||||
|
||||
@ -95,7 +96,6 @@ git 装好了,我们就要安装 wpscan 的依赖包了。
|
||||
|
||||
列举主题和列举插件差不多,只要用"--enumerate t"就可以了。
|
||||
|
||||
|
||||
ruby wpscan.rb --url http(s)://www.host-name.com --enumerate t
|
||||
|
||||
或者只列出易受攻击的主题:
|
||||
@ -135,7 +135,7 @@ WPscan 也可以用来列举某个 WordPress 站点的用户和有效的登录
|
||||
|
||||
#### 列举 Timthumb 文件 ####
|
||||
|
||||
关于 WPscan ,我要说的最后一个功能是列举 timthub 相关的文件。近年来,timthumb 已经成为攻击者眼里的一个普通的目标,因为无数的漏洞被找出来并发到论坛上、邮件列表等等地方。用下面的命令可以通过 wpscan 找出易受攻击的 timthub 文件:
|
||||
关于 WPscan ,我要说的最后一个功能是列举 timthub (缩略图)相关的文件。近年来,timthumb 已经成为攻击者眼里的一个常见目标,因为无数的漏洞被找出来并发到论坛上、邮件列表等等地方。用下面的命令可以通过 wpscan 找出易受攻击的 timthub 文件:
|
||||
|
||||
ruby wpscan.rb --url http(s)://www.host-name.com --enumerate tt
|
||||
|
||||
@ -143,11 +143,10 @@ WPscan 也可以用来列举某个 WordPress 站点的用户和有效的登录
|
||||
|
||||
**Nmap** 是一个开源的用于网络探索和安全审查方面的工具。它可以迅速扫描巨大的网络,也可一单机使用。Nmap 用原始 IP 数据包通过不同寻常的方法判断网络里那些主机是正在工作的,那些主机上都提供了什么服务(应用名称和版本),是什么操作系统(以及版本),用的什么类型的防火墙,以及很多其他特征。
|
||||
|
||||
### 在 Debian 和 Ubuntu 上下载和安装 nmap ###
|
||||
#### 在 Debian 和 Ubuntu 上下载和安装 nmap ####
|
||||
|
||||
要在基于 Debian 和 Ubuntu 的操作系统上安装 nmap ,运行下面的命令:
|
||||
|
||||
|
||||
sudo apt-get install nmap
|
||||
|
||||
**输出样例**
|
||||
@ -168,7 +167,7 @@ WPscan 也可以用来列举某个 WordPress 站点的用户和有效的登录
|
||||
Processing triggers for man-db ...
|
||||
Setting up nmap (5.21-1.1ubuntu1) ...
|
||||
|
||||
#### 打个例子 ####
|
||||
#### 举个例子 ####
|
||||
|
||||
输出 nmap 的版本:
|
||||
|
||||
@ -182,7 +181,7 @@ WPscan 也可以用来列举某个 WordPress 站点的用户和有效的登录
|
||||
|
||||
Nmap version 5.21 ( http://nmap.org )
|
||||
|
||||
### 在 Centos 上下载和安装 nmap ###
|
||||
#### 在 Centos 上下载和安装 nmap ####
|
||||
|
||||
要在基于 RHEL 的 Linux 上面安装 nmap ,输入下面的命令:
|
||||
|
||||
@ -227,7 +226,7 @@ WPscan 也可以用来列举某个 WordPress 站点的用户和有效的登录
|
||||
|
||||
Complete!
|
||||
|
||||
#### 举个比方 ####
|
||||
#### 举个例子 ####
|
||||
|
||||
输出 nmap 版本号:
|
||||
|
||||
@ -239,7 +238,7 @@ WPscan 也可以用来列举某个 WordPress 站点的用户和有效的登录
|
||||
|
||||
#### 用 Nmap 扫描端口 ####
|
||||
|
||||
你可以用 nmap 来获得很多关于你的服务器的信息,它让你站在对你的网站不怀好意的人的角度看你自己的网站。
|
||||
你可以用 nmap 来获得很多关于你的服务器的信息,它可以让你站在对你的网站不怀好意的人的角度看你自己的网站。
|
||||
|
||||
因此,请仅用它测试你自己的服务器或者在行动之前通知服务器的所有者。
|
||||
|
||||
@ -277,7 +276,7 @@ nmap 的作者提供了一个测试服务器:
|
||||
|
||||
sudo nmap -p port_number remote_host
|
||||
|
||||
扫描一个网络,找出那些服务器在线,分别运行了什么服务
|
||||
扫描一个网络,找出哪些服务器在线,分别运行了什么服务。
|
||||
|
||||
这就是传说中的主机探索或者 ping 扫描:
|
||||
|
||||
@ -294,19 +293,19 @@ nmap 的作者提供了一个测试服务器:
|
||||
MAC Address: 00:11:32:11:15:FC (Synology Incorporated)
|
||||
Nmap done: 256 IP addresses (4 hosts up) scanned in 2.80 second
|
||||
|
||||
理解端口配置和如何发现你的服务器上的攻击的载体只是确保你的信息和你的 VPS 安全的第一步。
|
||||
理解端口配置和如何发现你的服务器上的攻击目标只是确保你的信息和你的 VPS 安全的第一步。
|
||||
|
||||
### 用 Nikto 扫描你网站的缺陷 ###
|
||||
|
||||
[Nikto][4] 网络扫描器是一个开源的 web 服务器的扫描软件,它可以用来扫描 web 服务器上的恶意的程序和文件。Nikto 也可一用来检查软件版本是否过期。Nikto 能进行简单而快速地扫描以发现服务器上危险的文件和程序。扫描结束后会给出一个日志文件。`
|
||||
[Nikto][4] 网络扫描器是一个开源的 web 服务器的扫描软件,它可以用来扫描 web 服务器上的恶意的程序和文件。Nikto 也可以用来检查软件版本是否过期。Nikto 能进行简单而快速地扫描以发现服务器上危险的文件和程序。扫描结束后会给出一个日志文件。`
|
||||
|
||||
### 在 Linux 服务器上下载和安装 Nikto ###
|
||||
#### 在 Linux 服务器上下载和安装 Nikto ####
|
||||
|
||||
Perl 在 Linux 上是预先安装好的,所以你只需要从[项目页面][5]下载 nikto ,解压到一个目录里面,然后开始测试。
|
||||
|
||||
wget https://cirt.net/nikto/nikto-2.1.4.tar.gz
|
||||
|
||||
你可以用某个归档管理工具或者用下面这个命令,同时使用 tar 和 gzip 。
|
||||
你可以用某个归档管理工具解包,或者如下同时使用 tar 和 gzip :
|
||||
|
||||
tar zxvf nikto-2.1.4.tar.gz
|
||||
cd nikto-2.1.4
|
||||
@ -369,7 +368,7 @@ Perl 在 Linux 上是预先安装好的,所以你只需要从[项目页面][5]
|
||||
|
||||
**输出样例**
|
||||
|
||||
会有十分冗长的输出,可能一开始会让人感到困惑。许多 Nikto 的警报会返回 OSVDB 序号。这是开源缺陷数据库([http://osvdb.org/][6])的意思。你可以在 OSVDB 上找出相关缺陷的深入说明。
|
||||
会有十分冗长的输出,可能一开始会让人感到困惑。许多 Nikto 的警报会返回 OSVDB 序号。这是由开源缺陷数据库([http://osvdb.org/][6])所指定。你可以在 OSVDB 上找出相关缺陷的深入说明。
|
||||
|
||||
$ nikto -h http://www.host-name.com
|
||||
- Nikto v2.1.4
|
||||
@ -402,7 +401,7 @@ Perl 在 Linux 上是预先安装好的,所以你只需要从[项目页面][5]
|
||||
|
||||
**Nikto** 是一个非常轻量级的通用工具。因为 Nikto 是用 Perl 写的,所以它可以在几乎任何服务器的操作系统上运行。
|
||||
|
||||
希望这篇文章能在你找你的 wordpress 站点的缺陷的时候给你一些提示。我之前的文章[怎样保护 WordPress 站点][7]记录了一个**清单**,可以让你保护你的 WordPress 站点的工作变得更简单。
|
||||
希望这篇文章能在你检查 wordpress 站点的缺陷的时候给你一些提示。我之前的文章[如何安全加固 WordPress 站点][7]记录了一个**清单**,可以让你保护你的 WordPress 站点的工作变得更简单。
|
||||
|
||||
有想说的,留下你的评论。
|
||||
|
||||
@ -412,7 +411,7 @@ via: http://www.unixmen.com/scan-check-wordpress-website-security-using-wpscan-n
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[boredivan](https://github.com/boredivan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,10 +1,10 @@
|
||||
在Ubuntu14.10/Mint7上安装Gnome Flashback classical桌面
|
||||
在Ubuntu14.10/Mint7上安装Gnome Flashback 经典桌面
|
||||
================================================================================
|
||||
如果你不喜欢现在的Unity桌面,[Gnome Flashback][1]桌面环境是一个简单的并且很棒的选择,让你能找回曾经经典的桌面。
|
||||
|
||||
Gnome Flashback基于GTK3并提供与原先gnome桌面视觉上相似的界面。
|
||||
|
||||
gnome flashback的另一个改变是采用了源自mint和xface的MATE桌面,但无论mint还是xface都是基于gtk2的。
|
||||
Gnome Flashback的另一个改变是采用了源自mint和xface的MATE桌面,但无论mint还是xface都是基于GTK2的。
|
||||
|
||||
### 安装 Gnome Flashback ###
|
||||
|
||||
@ -12,7 +12,7 @@ gnome flashback的另一个改变是采用了源自mint和xface的MATE桌面,
|
||||
|
||||
$ sudo apt-get install gnome-session-flashback
|
||||
|
||||
然后注销到达登录界面,单击密码输入框右上角的徽标型按钮,即可选择桌面环境。可供选择的有Gnome Flashback (Metacity) 会话模式和Gnome Flashback (Compiz)会话模式。
|
||||
然后注销返回到登录界面,单击密码输入框右上角的徽标型按钮,即可选择桌面环境。可供选择的有Gnome Flashback (Metacity) 会话模式和Gnome Flashback (Compiz)会话模式。
|
||||
|
||||
Metacity更轻更快,而Compiz则能带给你更棒的桌面效果。下面是我使用gnome flashback桌面的截图。
|
||||
|
||||
@ -24,17 +24,17 @@ Metacity更轻更快,而Compiz则能带给你更棒的桌面效果。下面是
|
||||
|
||||
### 1. 安装 Gnome Tweak Tool ###
|
||||
|
||||
Gnome Tweak Tool能够帮助你定制比如字体、主题等,那些在Unity桌面的控制中心十分困难或是不可能完成的任务。
|
||||
Gnome Tweak Tool能够帮助你定制比如字体、主题等,这些在Unity桌面的控制中心是十分困难,几乎不可能完成的任务。
|
||||
|
||||
$ sudo apt-get install gnome-tweak-tool
|
||||
|
||||
启动按步骤 应用程序 > 系统工具 > 首选项 > Tweak Tool
|
||||
启动按步骤: 应用程序 > 系统工具 > 首选项 > Tweak Tool
|
||||
|
||||
### 2. 在面板上添加小应用 ###
|
||||
|
||||
默认的右键点击面板是没有效果的。你可以尝试在右键点击面板的同时按住键盘上的Alt+Super (win)键,这样定制面板的相关选项将会出现。
|
||||
默认的右键点击面板是没有效果的。你可以尝试在右键点击面板的同时按住键盘上的Alt+Super (win)键,这样就会出现定制面板的相关选项。
|
||||
|
||||
你可以修改或删除面板并在上面添加些小应用。在这个例子中我们移除了底部面板,并用Plank dock来代替它的位置。
|
||||
你可以修改或删除面板,并在上面添加些小应用。在这个例子中我们移除了底部面板,并用Plank dock来代替它的位置。
|
||||
|
||||
在顶部面板的中间添加一个显示时间的小应用。通过配置使它显示时间和天气。
|
||||
|
||||
@ -42,7 +42,7 @@ Gnome Tweak Tool能够帮助你定制比如字体、主题等,那些在Unity
|
||||
|
||||
### 3. 将窗口标题栏的按钮右置 ###
|
||||
|
||||
在ubuntu中,最小化、最大化和关闭按钮默认实在标题栏的左侧的。需要稍作手脚才能让他们乖乖回到右边去。
|
||||
在ubuntu中,最小化、最大化和关闭按钮默认是在标题栏左侧的。需要稍作手脚才能让他们乖乖回到右边去。
|
||||
|
||||
想让窗口的按钮到右边可以使用下面的命令,这是我在askubuntu上找到的。
|
||||
|
||||
@ -50,7 +50,7 @@ Gnome Tweak Tool能够帮助你定制比如字体、主题等,那些在Unity
|
||||
|
||||
### 4.安装 Plank dock ###
|
||||
|
||||
plank dock位于屏幕底部用于启动应用和切换打开的窗口。会在必要的时间隐藏自己,并在需要的时候出现。elementary OS使用的dock就是plank dock。
|
||||
plank dock位于屏幕底部,用于启动应用和切换打开的窗口。它会在必要的时间隐藏自己,并在需要的时候出现。elementary OS使用的dock就是plank dock。
|
||||
|
||||
运行以下命令安装:
|
||||
|
||||
@ -58,11 +58,11 @@ plank dock位于屏幕底部用于启动应用和切换打开的窗口。会在
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install plank -y
|
||||
|
||||
现在启动 应用程序 > 附件 > Plank。若想让它开机自动启动,找到 应用程序 > 系统工具 > 首选项 > 启动应用程序 并将“plank”的命令加到列表中。
|
||||
现在启动:应用程序 > 附件 > Plank。若想让它开机自动启动,找到 应用程序 > 系统工具 > 首选项 > 启动应用程序 并将“plank”的命令加到列表中。
|
||||
|
||||
### 5. 安装 Conky 系统监视器 ###
|
||||
|
||||
Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰桌面。它不太占资源并且运行的大部分时间都不惹麻烦。
|
||||
Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰桌面。它不太占资源,并且绝大部分情况下运行都不会有什么问题。
|
||||
|
||||
运行如下命令安装:
|
||||
|
||||
@ -70,7 +70,7 @@ Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install conky-manager
|
||||
|
||||
现在启动 应用程序 > 附件 > Conky Manager 选择你想在桌面上显示的部件。Conky Manager同样可以配置到启动项中。
|
||||
现在启动:应用程序 > 附件 > Conky Manager ,选择你想在桌面上显示的部件。Conky Manager同样可以配置到启动项中。
|
||||
|
||||
### 6. 安装CCSM ###
|
||||
|
||||
@ -80,10 +80,10 @@ Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰
|
||||
|
||||
$ sudo apt-get install compizconfig-settings-manager
|
||||
|
||||
启动按步骤 应用程序 > 系统工具 > 首选项 > CompizConfig Settings Manager.
|
||||
启动按步骤: 应用程序 > 系统工具 > 首选项 > CompizConfig Settings Manager.
|
||||
|
||||
|
||||
>在虚拟机中经常会发生compiz会话中装饰窗口消失。可以通过启动Compiz设置,在打开"Copy to texture",注销后重新登录即可。
|
||||
> 在虚拟机中经常会发生compiz会话中装饰窗口消失。可以通过启动Compiz设置,并启用"Copy to texture"插件,注销后重新登录即可。
|
||||
|
||||
不过值得一提的是Compiz 会话会比Metacity慢。
|
||||
|
||||
@ -92,8 +92,8 @@ Conky非常酷,它用系统的中如CPU和内存使用率的统计值来装饰
|
||||
via: http://www.binarytides.com/install-gnome-flashback-ubuntu/
|
||||
|
||||
作者:[Silver Moon][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[martin2011qi](https://github.com/martin2011qi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -6,7 +6,7 @@ Linux 有问必答:如何在Linux中修复“fatal error: lame/lame.h: No such
|
||||
|
||||
fatal error: lame/lame.h: No such file or directory
|
||||
|
||||
[LAME][1]("LAME Ain't an MP3 Encoder")是一个流行的LPGL授权的MP3编码器。许多视频编码工具使用或者支持LAME。这其中有[FFmpeg][2]、 VLC、 [Audacity][3]、 K3b、 RipperX等。
|
||||
[LAME][1]("LAME Ain't an MP3 Encoder")是一个流行的LPGL授权的MP3编码器。许多视频编码工具使用或者支持LAME,如 [FFmpeg][2]、 VLC、 [Audacity][3]、 K3b、 RipperX等。
|
||||
|
||||
要修复这个编译错误,你需要安装LAME库和开发文件,按照下面的来。
|
||||
|
||||
@ -20,7 +20,7 @@ Debian和它的衍生版在基础库中已经提供了LAME库,因此可以用a
|
||||
|
||||
在基于RED HAT的版本中,LAME在RPM Fusion的免费仓库中就有,那么你需要先设置[RPM Fusion (免费)仓库][4]。
|
||||
|
||||
RPM Fusion设置完成后,如下安装LAME开发文件。
|
||||
RPM Fusion设置完成后,如下安装LAME开发包。
|
||||
|
||||
$ sudo yum --enablerepo=rpmfusion-free-updates install lame-devel
|
||||
|
||||
@ -42,7 +42,7 @@ RPM Fusion设置完成后,如下安装LAME开发文件。
|
||||
|
||||
$ ./configure --help
|
||||
|
||||
共享/静态LAME默认安装在 /usr/local/lib。要让共享库可以被其他程序使用,完成最后一步:
|
||||
共享/静态的LAME库默认安装在 /usr/local/lib。要让共享库可以被其他程序使用,完成最后一步:
|
||||
|
||||
用编辑器打开 /etc/ld.so.conf,加入下面这行。
|
||||
|
||||
@ -56,7 +56,6 @@ RPM Fusion设置完成后,如下安装LAME开发文件。
|
||||
|
||||
如果你的发行版(比如 CentOS 7)没有提供预编译的LAME库,或者你想要自定义LAME库,你需要从源码自己编译。下面是在基于Red Hat的系统中编译安装LAME库的方法。
|
||||
|
||||
|
||||
$ sudo yum install gcc git
|
||||
$ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
|
||||
$ tar -xzf lame-3.99.5.tar.gz
|
||||
@ -87,7 +86,7 @@ via: http://ask.xmodulo.com/fatal-error-lame-no-such-file-or-directory.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,12 +1,12 @@
|
||||
Linux有问必答 -- 如何在树莓派上安装USB网络摄像头
|
||||
Linux有问必答:如何在树莓派上安装USB网络摄像头
|
||||
================================================================================
|
||||
> **Question**: 我可以在树莓派上使用标准的USB网络摄像头么?我该如何检查USB网络摄像头与树莓派是否兼容?另外我该如何在树莓派上安装它?
|
||||
|
||||
如果你想在树莓上拍照或者录影,你可以安装[树莓派的摄像头板][1]。如果你不想要为摄像头模块花费额外的金钱,那有另外一个方法,就是你常见的[USB 摄像头][2]。你可能已经在PC上安装了。
|
||||
如果你想在树莓上拍照或者录影,你可以安装[树莓派的摄像头板][1]。如果你不想要为摄像头模块花费额外的金钱,那有另外一个方法,就是你常见的[USB 摄像头][2]。你可能已经在PC上安装过了。
|
||||
|
||||
本教程中,我会展示如何在树莓派上设置摄像头。我们假设你使用的系统是Raspbian。
|
||||
|
||||
在此之前,你最好检查一下你的摄像头是否在[这些][3]已知与树莓派兼容的摄像头之中。如果你的摄像头不在这个兼容列表中,不要丧气,仍然有可能你的摄像头被树莓派检测到。
|
||||
在此之前,你最好检查一下你的摄像头是否在[这些][3]已知与树莓派兼容的摄像头之中。如果你的摄像头不在这个兼容列表中,不要丧气,仍然有可能树莓派能检测到你的摄像头。
|
||||
|
||||
### 检查USB摄像头是否雨树莓派兼容 ###
|
||||
|
||||
@ -34,7 +34,7 @@ fswebcam安装完成后,在终端中运行下面的命令来抓去一张来自
|
||||
|
||||
$ fswebcam --no-banner -r 640x480 image.jpg
|
||||
|
||||
这条命令可以抓取一张640x480分辨率的照片,并且用jpg格式保存。它不会在照片的地步留下任何标志.
|
||||
这条命令可以抓取一张640x480分辨率的照片,并且用jpg格式保存。它不会在照片的底部留下任何水印.
|
||||
|
||||
![](https://farm8.staticflickr.com/7417/16576645965_302046d230_o.png)
|
||||
|
||||
@ -52,7 +52,7 @@ via: http://ask.xmodulo.com/install-usb-webcam-raspberry-pi.html
|
||||
|
||||
作者:[Kristophorus Hadiono][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,32 @@
|
||||
Torvalds: 写linux内核的人更加容易找工作
|
||||
========================================
|
||||
|
||||
相比起以往,linux内核开发这么专业的事情,在最近发布的《谁在编写 Linux》报告中,其无偿贡献者降到了历史最低水平。
|
||||
|
||||
这个报道由linux基金会撰写,上年有11.8%的内核开发是由无偿贡献者完成,相比2012年的14.6%下滑了19%。基金会说贡献者有逐年下降的趋势。
|
||||
|
||||
![](http://images.techhive.com/images/article/2015/02/screen-shot-2015-02-17-at-5.25.43-pm-100568680-medium.idge.png)
|
||||
|
||||
即使是这样,在最新的《谁在编写 Linux》报告里,无偿贡献者还是最大的单一贡献来源,共做了11968 处修改,占整体的12.4%。然而,linux基金会说,企业贡献者共同占比越来越多,超过80%的内核贡献是由有偿的专业开发者完成的。
|
||||
|
||||
根据 linus Torvalds 说,这个有偿开发者趋势不会对内核开发的本身有太多改变。
|
||||
|
||||
他向《Network World》说,“我认为不会改变太多的一个原因是,其实并不是‘无偿贡献者离开了’,而是‘编写内核的人很快就被雇走了’。”
|
||||
|
||||
Torvalds讲到,linux开发的改变有很多其他原因,很自然的,新的贡献者会经常冒出来;有很多原来的开发者,有的有着10年的经验,被很多对linux感兴趣的公司抢去了。
|
||||
|
||||
他说:“开始我们是自愿者,但我们后来也很高兴被请去开发linux。”
|
||||
|
||||
Torvalds 开始抽离了他的开发角色,根据报道在3.10的内核版本里面他个人发布了329个补丁,占04%。逐渐地,各个子系统的维护人员自己开始做代码检查与合并。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.infoworld.com/article/2885339/application-development/torvalds-people-who-start-writing-kernel-code-get-hired-really-quickly.html
|
||||
|
||||
作者:[Jon Gold][a]
|
||||
译者:[haimingfg](https://github.com/haimingfg)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.infoworld.com/author/Jon-Gold/
|
116
published/20150227 Chess in a Few Bytes.md
Normal file
116
published/20150227 Chess in a Few Bytes.md
Normal file
@ -0,0 +1,116 @@
|
||||
只有几百个字节大小的国际象棋程序
|
||||
================================================================================
|
||||
|
||||
当我在这里提到了 ZX81 电脑时,我已经暴露了我的年龄。ZX81 是一个由英国开发者(Sincilair 研究所)生产的家庭电脑,它拥有"高达" 1KB 的内存!上面的 1KB 并不是打印错误,这个家庭电脑确实只配置有 1KB 的板载内存。但这个内存大小上的限制并没有阻止爱好者制作种类繁多的软件。事实上,这个机器引发了一代编程奇才的出现,这让他们掌握了让程序在该机上运行起来的技能。这个机器可以通过一个 16 KB 的内存卡来进行升级,这就提供了更多的编程可能。但未经扩展的 1KB 机器仍然激励着编程者们发布卓越的软件。
|
||||
|
||||
![1K ZX Chess ](http://www.linuxlinks.com/portal/content2/reviews/Games2/1KZXChess.jpg)
|
||||
|
||||
我最喜爱的 ZX81 游戏有: 模拟飞行(Flight Simulation), 3D 版怪物迷宫(3D Monster Maze), 小蜜蜂(Galaxians), 以及最重要的 1K ZX Chess。 只有最后一个程序是为未扩展版的 ZX81 电脑设计的。事实上,David Horne 开发的 1K ZX Chess 只使用了仅仅 672 字节的 RAM(LCTT 译注:如果读者有兴趣,可以看看[这里](http://users.ox.ac.uk/~uzdm0006/scans/1kchess/)对该程序的代码及解释)。尽管如此,该游戏尽力去实现大多数的国际象棋规则,并提供了一个计算机虚拟对手。虽然一些重要的规则被忽略了(如:王车易位,兵的升变,和吃过路兵)
|
||||
(LCTT 译注:参考了[这里](http://zh.wikibooks.org/zh/%E5%9B%BD%E9%99%85%E8%B1%A1%E6%A3%8B/%E8%A7%84%E5%88%99)和[这里](http://en.wikipedia.org/wiki/Rules_of_chess)),但能够和人工智能相对抗,这仍然令人惊讶。这个游戏占据了我逝去的青春里的相当一部分。
|
||||
|
||||
1K ZX Chess 保持了在所有计算机上国际象棋的最小实现的地位长达 33 年之久,直到今年由 BootChess 打破了该记录,紧接着由 Toledo AtomChess 打破。这三个程序都没有实现所有的国际象棋规则,所以为了完整性,我介绍了我最喜爱的那些实现了所有国际象棋规则的极小的国际象棋。
|
||||
|
||||
Linux 有着一系列极其强大的国际象棋引擎,如 Stockfish, Critter, Togo II, Crafty, GNU Chess 和 Komodo 。 在这篇文章精选的国际象棋程序虽敌不过这些好的国际象棋程序,但它们展示了使用微不足道的代码库究竟可以实现多少东西。
|
||||
|
||||
----------
|
||||
|
||||
### Toledo Atomchess
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Toledo.png)
|
||||
|
||||
你可能已经看到了大量有关 BootChess 新闻报道,这个只用 487 字节写就的国际象棋程序,一举打破了先前最小的国际象棋程序 1K ZX Chess 的记录。所以,Óscar Toledo Gutiérrez 挽起袖子自己编写了一个更加紧凑的国际象棋游戏。Toledo Atomchess 是仅有 481 字节的 x86 汇编代码,都能放到引导扇区里。 在难以置信的代码大小下,这个引擎实现了一个可玩的国际象棋游戏。
|
||||
|
||||
特点包括:
|
||||
|
||||
- 基本的棋子移动
|
||||
- 用 ASCII 文本表现的棋盘
|
||||
- 以代数形式来输入移动(注:如 D2D4)
|
||||
- 3 层的搜索深度
|
||||
|
||||
显然,为了将这个国际象棋程序压缩到 481 字节中,作者必须做出某些牺牲,这些局限包括:
|
||||
|
||||
- 没有兵的升变
|
||||
- 没有王车易位
|
||||
- 没有吃过路兵
|
||||
- 没有移动确认
|
||||
|
||||
该作者也使用 C,JavaScript 和 Java 来写这个国际象棋程序,每种实现都非常小。
|
||||
|
||||
- 网站: [nanochess.org/chess6.html][1]
|
||||
- 开发者: Óscar Toledo Gutiérrez
|
||||
- 协议: 非商业用途可免费使用
|
||||
- 版本号: -
|
||||
|
||||
----------
|
||||
|
||||
### BootChess
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-BootChess.png)
|
||||
|
||||
BootChess 是一个国际象棋的极其小巧的计算机实现。这个程序被塞进到仅仅 487 字节里,并可运行在 Windows, Mac OS X 和 Linux 等操作系统。BootChess 的棋盘和棋子单独用文本表示,其中 P 代表兵, Q 用来代表王后,以及“点”代表空白格子。
|
||||
|
||||
特点包括:
|
||||
|
||||
- 象棋棋盘和用户输入的形象的文本表示
|
||||
- 引导扇区大小(512 字节)的可玩的象棋游戏
|
||||
- 只需 x86 bios 硬件引导程序(没有软件依赖)
|
||||
- 所有主要的正规移动包括双兵开局
|
||||
- 兵升变为王后(与 1k ZX Chess 相反)
|
||||
- 名为 taxiMax > minMax half-ply 的 CPU 人工智能
|
||||
- 硬编码的西班牙白子开局
|
||||
|
||||
同样,它也存在一些重要的限制。这些遗漏的功能包括:
|
||||
|
||||
- 兵的低升变(升变为非王后的棋子)
|
||||
- 吃过路兵
|
||||
- 没有王车易位
|
||||
- 3 次位置重复和局规则(注:下一步之前,同样的移动出现了两次;可以参考[这里](http://www.netplaces.com/chess-basics/ending-the-game/three-position-repetition.htm))
|
||||
- 50 步移动和局规则(注:在连续的50个回合内,双方既没有棋子被吃掉,也没有兵被移动过,则和局;可以参考[这里](http://www.chessvariants.org/d.chess/chess.html))
|
||||
- 没有开放式和封闭式布局
|
||||
- 一个或多个 minMAX/negaMax 全层人工智能
|
||||
|
||||
- 网站: [www.pouet.net/prod.php?which=64962][2]
|
||||
- 开发者: Olivier "Baudsurfer/RSi" Poudade
|
||||
- 协议: WTFPL v2
|
||||
- 版本号: .02
|
||||
|
||||
----------
|
||||
|
||||
###Micro-Max
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Micro-Max.png)
|
||||
|
||||
Micro-Max 是一个用 133 行 C 语言写就的象棋源程序。
|
||||
|
||||
作者实现了一个 hash 变换表,该引擎检查输入移动的合法性,以及支持 FIDE(注: World Chess Federation 缩写,参见其[官网](https://www.fide.com/)) 的全部规则,除了低升变。
|
||||
|
||||
特点包括:
|
||||
|
||||
- 递归的 negamax 搜索
|
||||
- 反夺的静态搜索
|
||||
- 反夺规则的扩展
|
||||
- 迭代深化
|
||||
- 最佳移动优先的 `排序`
|
||||
- 存储分数和最佳移动的 Hash 表
|
||||
- 完整的 FIDE 规则(除了低位升变)和移动合法性检查
|
||||
|
||||
还有一个 1433个字符的较大版本,但允许你使用完整的 FIDE 规则的低升变。
|
||||
|
||||
- 网站: [home.hccnet.nl/h.g.muller/max-src2.html][3]
|
||||
- 开发者: Harm Geert Muller
|
||||
- 协议: The MIT License
|
||||
- 版本号: 3.2
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxlinks.com/article/20150222033906262/ChessBytes.html
|
||||
|
||||
作者:Frazer Kline
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://nanochess.org/chess6.html
|
||||
[2]:http://www.pouet.net/prod.php?which=64962
|
||||
[3]:http://home.hccnet.nl/h.g.muller/max-src2.html
|
@ -0,0 +1,59 @@
|
||||
如何设置 Linux 上 SSH 登录的 Email 提醒
|
||||
================================================================================
|
||||
![](http://www.ehowstuff.com/wp-content/uploads/2015/03/fail2ban-security.jpg)
|
||||
|
||||
虚拟私有服务器 (VPS)上启用 SSH 服务使得该服务器暴露到互联网中,为黑客攻击提供了机会,尤其是当 VPS 还允许root 直接访问时。VPS 应该为每次 SSH 登录成功尝试配置一个自动的 email 警告。 VPS 服务器的所有者会得到各种 SSH 服务器访问日志的通知,例如登录者、登录时间以及来源 IP 地址等信息。这是一个对于服务器拥有者来说,保护服务器避免未知登录尝试的重要安全关注点。这是因为如果黑客使用暴力破解方式通过 SSH 来登录到你的 VPS 的话,后果很严重。在本文中,我会解释如何在 CentOS 6、 CentOS 7、 RHEL 6 和 RHEL 7上为所有的 SSH 用户登录设置一个 email 警告。
|
||||
|
||||
1. 使用root用户登录到你的服务器;
|
||||
|
||||
2. 在全局源定义处配置警告(/etc/bashrc),这样就会对 root 用户以及普通用户都生效:
|
||||
|
||||
[root@vps ~]# vi /etc/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
|
||||
|
||||
3. 你也可以选择性地让警告只对 root 用户生效:
|
||||
|
||||
[root@vps ~]# vi .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
|
||||
|
||||
整个配置文件样例:
|
||||
|
||||
# .bashrc
|
||||
|
||||
# User specific aliases and functions
|
||||
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
# Source global definitions
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc
|
||||
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
|
||||
|
||||
4. 你也可以选择性地让警告只对特定的普通用户生效(例如 skytech):
|
||||
|
||||
[root@vps ~]# vi /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
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ehowstuff.com/how-to-get-email-alerts-for-ssh-login-on-linux-server/
|
||||
|
||||
作者:[skytech][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://www.ehowstuff.com/author/mhstar/
|
@ -1,31 +1,32 @@
|
||||
红帽开发者工具集3.1测试版发布了
|
||||
================================================================================
|
||||
> **Summary**:想要最新的红帽企业版Linux6或者7开发者工具?测试版已经发布啦.
|
||||
> **摘要**:想要试试最新的红帽企业版Linux 6/7的开发者工具?测试版已经发布啦。
|
||||
|
||||
这是[DevOps][1]也不能完全解决的开发商和运营商之间永恒的问题之一。系统管理员想要最稳定的操作系统,而程序员想要最新最棒的开发工具。[红帽公司][2]对这个两难问题的解决方法就是用最新的稳定版[Red Hat Enterprise Linux (RHEL)][3]去测试这些新品牌工具,然后向开发者发布。
|
||||
这是[DevOps][1]也不能完全解决的程序员和系统管理员之间永恒的问题之一。系统管理员想要最稳定的操作系统,而程序员想要最新最棒的开发工具。[红帽公司][2]对这个两难问题的解决方法就是用最新的稳定版[Red Hat Enterprise Linux (RHEL)][3]去测试这些新品牌工具,然后向开发者发布。
|
||||
|
||||
![红帽开发者工具集](http://zdnet4.cbsistatic.com/hub/i/2015/03/18/d92b1067-6b36-4ff0-ac9e-608fbe3e8c5d/ae80362df5401a37e3cbcd2598f33370/rhel-dev-tools.png)
|
||||
红帽开发者工具集
|
||||
|
||||
基于此红帽刚刚公布了给开发者的最新玩具,[红帽开发者工具集 3.1][4]。现在可以获得这些最热门工具包的测试版了。
|
||||
*红帽开发者工具集*
|
||||
|
||||
红帽刚刚公布了给开发者的最新玩具:[红帽开发者工具集 3.1][4]。现在可以获得这些最热门工具包的测试版了。
|
||||
|
||||
这次更新包括:
|
||||
|
||||
[GNUCompiler Collection (GCC) 4.9][5]: 最新的GCC上游稳定版本,提供多处改进和bug修复
|
||||
[GNUCompiler Collection (GCC) 4.9][5]: 最新的GCC上游稳定版本,提供多处改进和bug修复。
|
||||
|
||||
[Eclipse 4.4.1][6]: 支持Java 8 以及更新了的Eclipse CDT(8.5)版本,Eclipse Linux Tools (3.1), Eclipse Mylyn (3.14), 和 Eclipse Egit/Jgit (3.6.1)
|
||||
[Eclipse 4.4.1][6]: 支持Java 8 以及更新的Eclipse CDT(8.5)版本,Eclipse Linux Tools (3.1), Eclipse Mylyn (3.14), 和 Eclipse Egit/Jgit (3.6.1)
|
||||
|
||||
众多额外的更新包: 包括 GDB 7.8.2, elfutils 0.161, memstomp 0.1.5, SystemTap 2.6, Valgrind 3.10.1, Dyninst 8.2.1, 以及 ltrace 0.7.91.
|
||||
|
||||
用这些开发工具,你可以给RHEL 6 和 7.x 开发应用程序。这些应用程序可以在RHEL上运行,不管是物理机,虚拟机还是云环境。它们也可以在红帽提供的Platform-as-a-Service (PaaS)服务[OpenShift][7]上运行。
|
||||
|
||||
这些新的开发者程序集有RHEL 7 以及 运行在[AMD64 和 Intel 64 架构][8]上的安装包。尽管这些工具都是64位的,你也可以用它们创建或者更改32位的二进制文件。
|
||||
这些新的开发者程序集包括可以运行在[AMD64 和 Intel 64 架构][8]上RHEL 7的包。尽管这些工具都是64位的,你也可以用它们创建或者修改32位的二进制文件。
|
||||
|
||||
在运行任何这些程序之前,你应该安装RHEL所有最近的更新。要安装这个测试工具集,你的系统需要选中可选渠道来获取所有红帽开发者工具集需要的工具链包。
|
||||
在运行任何这些程序之前,你应该安装RHEL所有最近的更新。要安装这个测试工具集,你的系统需要订阅“可选渠道”来获取所有红帽开发者工具集需要的工具链包。
|
||||
|
||||
另外,如果已经安装了早期版本的工具集,可能会遇到[安装Toolkit 3.1 时的一些问题][9]。尽管这些问题很容易解决,在安装新的工具集之前还是应该大概看一下这些可能出现的问题。
|
||||
|
||||
最后,你可能注意到一些最令人激动的工具,例如Docker,Kubernetes以及其它这里没有的容器工具。因为它们在最新的发行版[RHEL 7.1][10] 和 [Red Hat Enterprise Linux 7 Atomic Host (RHELAH)][11]中。[红帽和Docker已成为合作伙伴][12],要获取这些容器友好的程序,你需要转换到Docker友好的RHEL版本上来。
|
||||
最后,你可能注意到一些最令人激动的工具,例如 Docker,Kubernetes以及其它容器工具并没有提供。因为它们在最新的发行版[RHEL 7.1][10] 和 [Red Hat Enterprise Linux 7 Atomic Host (RHELAH)][11]中。[红帽和Docker已成为合作伙伴][12],要获取这些支持容器的程序,你需要转换到支持Docker的RHEL版本上来。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -33,7 +34,7 @@ via: http://www.zdnet.com/article/red-hat-developer-toolset-3-1-beta-arrives/
|
||||
|
||||
作者:[Steven J. Vaughan-Nichols][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -10,7 +10,7 @@ prips是一个可以打印出指定范围内所有ip地址的一个工具。它
|
||||
|
||||
### 使用prips ###
|
||||
|
||||
### prips语法 ###
|
||||
prips语法
|
||||
|
||||
prips [-c] [-d delim] [-e exclude] [-f format] [-i incr] start end
|
||||
prips [-c] [-d delim] [-e exclude] [-f format] [-i incr] CIDR-block
|
||||
@ -20,10 +20,10 @@ prips是一个可以打印出指定范围内所有ip地址的一个工具。它
|
||||
prips接受下面的命令行选项:
|
||||
|
||||
- -c -- 以CIDR形式打印范围。
|
||||
- -d delim -- 用ASCII码作为分隔符,0 <= delim <= 255。
|
||||
- -d 分隔符 -- 用ASCII码作为分隔符,0 <= 分隔符 <= 255。
|
||||
- -e -- 排除输出的范围。
|
||||
- -f format -- 设置地址格式 (16进制, 10进制, 或者dot).
|
||||
- -i incr -- 设置增长上限
|
||||
- -f 格式 -- 设置地址格式 (hex:16进制, dec:10进制, 或者dot:以点分隔).
|
||||
- -i 增长 -- 设置增长上限
|
||||
|
||||
### Prips示例 ###
|
||||
|
||||
@ -31,7 +31,7 @@ prips接受下面的命令行选项:
|
||||
|
||||
prips 192.168.32.0 192.168.32.255
|
||||
|
||||
同样使用CIDR标示:
|
||||
同上面一样,使用CIDR标示:
|
||||
|
||||
prips 192.168.32/24
|
||||
|
||||
@ -53,7 +53,7 @@ via: http://www.ubuntugeek.com/prips-print-ip-address-on-a-given-range.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,16 +1,13 @@
|
||||
Mydumper - MySQL数据库备份工具
|
||||
================================================================================
|
||||
Mydumper 是MySQL数据库服务器备份工具,它比MySQL自带的mysqldump快很多。它还有在转储本身的时候检索远程服务器二进制日志文件的能力。
|
||||
Mydumper 是 MySQL 数据库服务器备份工具,它比 MySQL 自带的 mysqldump 快很多。它还有在转储的同时获取远程服务器二进制日志文件的能力。
|
||||
|
||||
### Mydumper 的优势 ###
|
||||
|
||||
o 并行性 (因此有高速度) 和 性能 (避免了昂贵的字符集转换例程, 高效的代码)
|
||||
|
||||
o 更容易管理输出 (每个表独立的文件,转储元数据等,简单的查看/解析数据)
|
||||
|
||||
o 一致性 -- 在所有线程中维护快照, 提供准确的主从结点日志位置等。
|
||||
|
||||
o 可管理性 -- 支持对包含和排除指定的数据库和表的PCRE操作(译者注:PCRE,Perl Compatible Regular Expression,Perl兼容正则表达式)
|
||||
- 并行能力 (因此有高速度) 和性能 (高效的代码避免了耗费 CPU 处理能力的字符集转换过程)
|
||||
- 更容易管理输出 (每个表都对应独立的文件,转储元数据等,便于查看/解析数据)
|
||||
- 一致性 :跨线程维护快照, 提供精确的主从日志定位等。
|
||||
- 可管理性 : 支持用 PCRE 来包含/排除指定的数据库和表(LCTT译注:PCRE,Perl Compatible Regular Expression,Perl兼容正则表达式)
|
||||
|
||||
### 在Ubuntu上安装 mydumper ###
|
||||
|
||||
@ -26,20 +23,20 @@ o 可管理性 -- 支持对包含和排除指定的数据库和表的PCRE操作(
|
||||
|
||||
应用程序选项:
|
||||
|
||||
- -B, --database 转储的数据库
|
||||
- -T, --tables-list 逗号分隔的转储表列表(不排除正则表达式)
|
||||
- -B, --database 要转储的数据库
|
||||
- -T, --tables-list 逗号分隔的转储表列表(不会被正则表达式排除)
|
||||
- -o, --outputdir 保存输出文件的目录
|
||||
- -s, --statement-size 插入语句的字节大小, 默认是1000000个字节
|
||||
- -r, --rows 把表分为每个这么多行的块
|
||||
- -r, --rows 把表按行数切块
|
||||
- -c, --compress 压缩输出文件
|
||||
- -e, --build-empty-files 尽管表中没有数据也创建输出文件
|
||||
- -x, --regex 匹配‘db.table'的正则表达式
|
||||
- -i, --ignore-engines 逗号分隔的忽略存储引擎列表
|
||||
- -m, --no-schemas 不转储有数据的表架构
|
||||
- -k, --no-locks 不执行临时共享读锁. 警告: 这会导致备份的不一致性
|
||||
- -e, --build-empty-files 空表也输出文件
|
||||
- -x, --regex 匹配‘db.table’的正则表达式
|
||||
- -i, --ignore-engines 以逗号分隔的被忽略的存储引擎列表
|
||||
- -m, --no-schemas 不转储表架构
|
||||
- -k, --no-locks 不执行临时共享读锁。警告: 这会导致备份的不一致性
|
||||
- -l, --long-query-guard 设置长查询的计时器秒数,默认是60秒
|
||||
- --kill-long-queries 杀死长查询 (而不是退出)
|
||||
- -b, --binlogs 获取二进制日志文件和转储数据的快照
|
||||
- --kill-long-queries 杀死长查询 (而不是退出程序)
|
||||
- -b, --binlogs 获取二进制日志文件快照并转储数据
|
||||
- -D, --daemon 开启守护进程模式
|
||||
- -I, --snapshot-interval 每个转储快照之间的间隔时间(分钟), 需要开启 --daemon, 默认是60分钟
|
||||
- -L, --logfile 日志文件的名字,默认是stdout
|
||||
@ -67,21 +64,21 @@ o 可管理性 -- 支持对包含和排除指定的数据库和表的PCRE操作(
|
||||
--threads=2 \
|
||||
--compress-protocol
|
||||
|
||||
Mydumper输出数据的说明
|
||||
Mydumper 输出数据的说明
|
||||
|
||||
Mydumper不直接指定输出的文件,而是输出到文件夹的文件中。--outputdir 选项指定要使用的目录名称。
|
||||
Mydumper 不直接指定输出的文件,而是输出到文件夹的文件中。--outputdir 选项指定要使用的目录名称。
|
||||
|
||||
输出分为两部分
|
||||
|
||||
架构
|
||||
**表结构**
|
||||
|
||||
对数据库中的每个表,创建包含 CREATE TABLE 语句的文件。文件命名为:
|
||||
对数据库中的每个表,创建一个包含 CREATE TABLE 语句的文件。文件命名为:
|
||||
|
||||
dbname.tablename-schema.sql.gz
|
||||
|
||||
数据
|
||||
**数据**
|
||||
|
||||
对于每个行数多余--rows参数的表, 创建文件名字为:
|
||||
每个表名跟着按 --rows 参数所切块的数量, 创建文件名字为:
|
||||
|
||||
dbname.tablename.0000n.sql.gz
|
||||
|
||||
@ -103,7 +100,7 @@ via: http://www.ubuntugeek.com/mydumper-mysql-database-backup-tool.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,12 +1,12 @@
|
||||
如何在Docker容器中运行GUI程序
|
||||
================================================================================
|
||||
各位,今天我们将学习如何在[Docker][1]之中运行GUI程序。我们可以轻易地在Docker容器中运行大多数GUI程序且不出错。Docker是一个开源项目,提供了一个打包、分发和运行任意程序的轻量级容器的开放平台。它没有语言支持、框架或者打包系统的限制并可以在任何地方、任何时候,从小型的家用电脑到高端的服务器都可以运行。这让人们可以打包不同的包用于部署和扩展网络应用,数据库和后端服务而不必依赖于特定的栈或者提供商。
|
||||
各位,今天我们将学习如何在[Docker][1]之中运行GUI程序。我们可以轻易地在Docker容器中运行大多数GUI程序且不出错。Docker是一个开源项目,提供了一个打包、分发和运行任意程序的轻量级容器的开放平台。它没有语言支持、框架或者打包系统的限制,并可以运行在任何地方、任何时候,从小型的家用电脑到高端的服务器都可以运行。这让人们可以打包不同的包用于部署和扩展网络应用,数据库和后端服务而不必依赖于特定的栈或者提供商。
|
||||
|
||||
下面是我们该如何在Docker容器中运行GUI程序的简单步骤。本教程中,我们会用Firefox作为例子。
|
||||
|
||||
### 1. 安装 Docker ###
|
||||
|
||||
在开始事前,我们首先得确保在Linux主机中已经安装了Docker。这里,我运行的是CentOS 7 主机,我们将运行yum管理器和下面的命令来安装Docker。
|
||||
在开始前,我们首先得确保在Linux主机中已经安装了Docker。这里,我运行的是CentOS 7 主机,我们将运行yum管理器和下面的命令来安装Docker。
|
||||
|
||||
# yum install docker
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
### 2. 创建 Dockerfile ###
|
||||
|
||||
现在,Docker守护进程已经在运行中了,我们现在准备创建自己的Firefox Docker容器。我们要创建一个Dockerfile,这里我们要输入需要的配置来创建一个可以工作的Firefox容器。我们取下CentOS中最新的Docker镜像。至此,我们需要用文本编辑器创建一个名为Dockerfile的文件。
|
||||
现在,Docker守护进程已经在运行中了,我们现在准备创建自己的Firefox Docker容器。我们要创建一个Dockerfile,在其中我们要输入需要的配置来创建一个可以工作的Firefox容器。为了运行 Docker 镜像我们需要使用最新版本的CentOS。要创建 Docker 镜像,我们需要用文本编辑器创建一个名为Dockerfile的文件。
|
||||
|
||||
# nano Dockerfile
|
||||
|
||||
@ -25,12 +25,12 @@
|
||||
#!/bin/bash
|
||||
FROM centos:7
|
||||
RUN yum install -y firefox
|
||||
# Replace 0 with your user / group id
|
||||
# 用你自己的 uid /gid 替换下面的0
|
||||
RUN export uid=0 gid=0
|
||||
RUN mkdir -p /home/developer
|
||||
RUN echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd
|
||||
RUN echo "developer:x:${uid}:" >> /etc/group
|
||||
RUN echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
|
||||
RUN echo "developer ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
RUN chmod 0440 /etc/sudoers
|
||||
RUN chown ${uid}:${gid} -R /home/developer
|
||||
|
||||
@ -56,13 +56,13 @@
|
||||
|
||||
### 4. 运行Docker容器 ###
|
||||
|
||||
现在,如果一切顺利,我们现在可以在运行着CentOS 7镜像的Docker容器中运行我们的GUI程序也就是Firefox浏览器了。
|
||||
现在,如果一切顺利,我们现在可以在运行在CentOS 7镜像中的Docker容器里面运行我们的GUI程序也就是Firefox浏览器了。
|
||||
|
||||
# docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix firefox
|
||||
|
||||
### 总结 ###
|
||||
|
||||
在Dcoker容器中运行GUI程序是一次很棒的体验,它对你的主机文件系统没有任何的伤害。它完全依赖你的Docker容器。本教程中,我尝试了CentOS 7 Docker中的Firefox。我们可以用这个技术尝试更多的GUI程序。如果你有任何问题、建议、反馈请在下面的评论栏中写下来,这样我们可以提升或更新我们的内容。谢谢!
|
||||
在Docker容器中运行GUI程序是一次很棒的体验,它对你的主机文件系统没有任何的伤害。它完全依赖你的Docker容器。本教程中,我尝试了CentOS 7 Docker中的Firefox。我们可以用这个技术尝试更多的GUI程序。如果你有任何问题、建议、反馈请在下面的评论栏中写下来,这样我们可以提升或更新我们的内容。谢谢!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -70,7 +70,7 @@ via: http://linoxide.com/linux-how-to/run-gui-apps-docker-container/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,140 @@
|
||||
10个所需的IT技能,助你职场成功
|
||||
===========================================================================
|
||||
接我们上次的文章[[十大所需的操作系统][1]],这篇文章得到了Tecmint社区很高的评价,在本篇中,我们将指点顶尖的IT技能,这会帮助你找到理想的工作。
|
||||
|
||||
如第一篇文章提到的那样,这些资料和统计结果是会伴随市场和需求的变化而变化的。只要有任何主要的变化,我们会尽可能地更新列表。所有的统计数据基于最近的,全球一些IT公司的招聘信息和需求。
|
||||
|
||||
### 1. VMware ###
|
||||
|
||||
VMware公司设计的虚拟化和云计算软件高居榜首。VMware首次宣布商业支持x86架构的虚拟化。VMware的招聘需求在上个季度已经增长至16%。
|
||||
|
||||
最新稳定发行版: 11.0
|
||||
|
||||
### 2. MySQL ###
|
||||
|
||||
这款开源的关系型数据库管理系统憾居第二。直到2013年,MySQL都还是第二大使用广泛的RDBMS(注:Relational Database Management System)。上季度MySQL的招聘需求已经达到了11%。非常著名的MarialDB就是来自被甲骨文公司收购之后的MySQL的分支。值得掌握。
|
||||
|
||||
最新稳定发行版: 5.6.23
|
||||
|
||||
### 3. Apache ###
|
||||
|
||||
这个跨平台的开源网页(HTTP)服务器位居第三。截至上个季度,Apache的招聘需求已经超过了13%。
|
||||
|
||||
最新稳定发行版: 2.4.12
|
||||
|
||||
### 4. AWS ###
|
||||
|
||||
AWS是亚马逊网站提供的所有远程计算服务的集合,AWS排在第四位。上个季度,AWS的招聘需求已经呈现出将近14%的增长。
|
||||
|
||||
### 5. Puppet ###
|
||||
|
||||
Puppet作为配置管理系统被应用在设置IT基础架构,它排在第五位。它用Ruby语言编写,属于客户端-服务器型的结构。上个季度puppet的招聘需求已经增长超过9%。
|
||||
|
||||
最新稳定发行版: 3.7.3
|
||||
|
||||
### 6. Hadoop ###
|
||||
|
||||
Hadoop是用Java编写的一款开源软件框架,用于处理大数据。列表中Hadoop位列第六。对Hadoop的招聘需求在上个季度已经下降了0.2个百分点。
|
||||
|
||||
最新稳定发行版: 2.6.0
|
||||
|
||||
### 7. Git ###
|
||||
|
||||
Linux Torvalds最初编写的著名版本控制系统Git排在了第七。Git的招聘需求在上个季度已经超过了7%。
|
||||
|
||||
最新稳定发行版: 2.3.4
|
||||
|
||||
### 8. Oracle PL/SQL ###
|
||||
|
||||
Oracle公司开发的SQL扩展版,占据第八的位置。PL/SQL从Oracle 7后就包含在Oracle数据库中。它在上个季度已经呈现将近8%的衰退。
|
||||
|
||||
### 9. Tomcat ###
|
||||
|
||||
这个开源网页服务器和服务程序容器出现在了第九的位置。在上个季度,它已经表现出需求增长,将近15%。
|
||||
|
||||
最新稳定发行版: 8.0.15
|
||||
|
||||
### 10. SAP ###
|
||||
|
||||
这款最著名的企业资源规划软件排在了第十。上个季度SAP在需求市场表现出将近3.5%的增长。
|
||||
|
||||
具体数据表格如下:
|
||||
|
||||
<table cellspacing="0" cellpadding="5" style="width: 804px;">
|
||||
<colgroup>
|
||||
<col width="88">
|
||||
<col width="427">
|
||||
<col width="257">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;">1.
|
||||
</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;">VMware</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border: 1px solid #000000; padding: 0.1cm;"><span style="color: #006600;"><b>16% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">2.
|
||||
</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">MySQL</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>11% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">3.</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Apache</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>13% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">4.
|
||||
</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Amazon web services (AWS)</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>14% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">5.
|
||||
</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Puppet</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>9% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">6.</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Hadoop</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>0.2% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">7.</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Git</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>7% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">8.</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Oracle PL/SQL</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: red;"><b>8% -</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">9.</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Tomcat</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>15% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">10.</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">SAP</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>3.5% +</b></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
这篇文章就到这里,我会积极跟进这个系列的下一部分。敬请期待,保持联系,积极评论。不要忘了给我们提供你的反馈。喜欢的话就分享吧,让更多人认识我们。
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/famous-it-skills-in-demand-that-will-get-you-hired/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
[1]:http://www.tecmint.com/top-distributions-in-demand-to-get-your-dream-job/
|
@ -0,0 +1,144 @@
|
||||
直击 Elementart OS 0.3 Freya - 下载和安装指南
|
||||
===========================================================================
|
||||
Elementary OS是一个以Ubuntu为基础的轻量级操作系统,广受欢迎。目前已经发行了三个版本,而第四个版本将会以即将到来的Ubuntu16.04为基础开发。
|
||||
|
||||
- **Jupiter (0.1)**: 第一个Elementary OS稳定发行版基于Ubuntu 10.10,在2011年三月发布。
|
||||
- **Luna (0.2)**: Elementary OS第二个稳定发行版基于Ubuntu 12.04,于2012年11月发布。
|
||||
- **Freya (0.3)**: Elementary OS第三个稳定发行版基于Ubuntu 14.04的,2015年二月8号发布。
|
||||
- **Loki (0.4)**: 未来Elementary OS第四版,计划以Ubuntu16.04为基础,并且提供更新服务直到2021年。
|
||||
|
||||
Freya是目前最新的Elementary OS版本(0.3)。最初是被命名为ISIS,但是后来改了,是为了避免与同名的恐怖组织产生任何的联系。Freya有一些非常不错的预装应用。
|
||||
|
||||
### 突出的特性 ###
|
||||
|
||||
这里列举了一些特性,但并非Elementary OS 0.3的所有特性。
|
||||
|
||||
- 更好的交互性消息通知,可在通知设定面板设定系统级别的“Do Not Disturb(不要打扰)”模式。
|
||||
- 最新版Elementary OS提供更好的emoji表情支持,及内置替换了网页应用中的微软核心字体。
|
||||
- Privacy模式是一个新的防火墙工具,易于使用,可以帮助保护电脑免遭恶意脚本和应用的攻击。
|
||||
- 统一风格的登入和锁定界面。
|
||||
- 改进了界面效果和功能的应用中心菜单,包括快速操作列表,搜索拖放,支持快速数学计算。
|
||||
- 重新设计的多任务视图提供更多以应用为中心的功能。
|
||||
- 更新了软件栈(Linux 3.16, Gtk 3.14 和Vala 0.26),更好的支持和增强了最新开发的应用。
|
||||
- UEFI支持。
|
||||
- 通过新的联网助手,WiFi连接变得更容易。
|
||||
|
||||
### 下载64位&32位版本 ###
|
||||
|
||||
- [Elementary OS Freya 64 bit][1]
|
||||
- [Elementary OS Freya 32 bit][2]
|
||||
|
||||
### 安装Elementary OS 0.3 (Freya) ###
|
||||
|
||||
下载Elementary OS 0.3的ISO文件,并且写入到一个USB启动盘或者DVD/CD。支持32位和64位的架构。当计算机从Elementary OS ISO文件启动后,有两个选项可用,或不安装而仅试用,或直接安装到计算机里。这里选择第二项。Elmentary OS也可以与已有操作系统并存安装,构成双重启动。
|
||||
|
||||
![Install Freya](http://blog.linoxide.com/wp-content/uploads/2015/04/Install-Freya.png)
|
||||
|
||||
在进行下面的步骤之前会检查系统要求和资源有效性。如果你的系统有足够的资源,点击继续。
|
||||
|
||||
![Installation Requirements](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-Requirements.png)
|
||||
|
||||
安装向导提供许多安装形式。选取最适合你的选项,通常大多数都选用第一个选项:“擦除磁盘以安装Elementary”。选择该选项,必须保证你的原有数据都已经正确备份了,因为磁盘(分区)将会被擦除,其上所有的数据将会丢失。
|
||||
|
||||
![Installation Types](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-Types.png)
|
||||
|
||||
接下来的对话框显示了Elementary OS所使用和需要格式化的磁盘分区列表,确保数据完整后点击继续。
|
||||
|
||||
![Format Warning](http://blog.linoxide.com/wp-content/uploads/2015/04/Format-Warning.png)
|
||||
|
||||
选择你的地理位置,确定时区,点击继续。
|
||||
|
||||
![Location](http://blog.linoxide.com/wp-content/uploads/2015/04/Location.png)
|
||||
|
||||
选择你的语言,点击继续。
|
||||
|
||||
![Language](http://blog.linoxide.com/wp-content/uploads/2015/04/Language.png)
|
||||
|
||||
填入你的信息,选择一个高强度的超级用户/管理员密码,点击继续。
|
||||
|
||||
![whoareyou](http://blog.linoxide.com/wp-content/uploads/2015/04/whoareyou.png)
|
||||
|
||||
当你的信息提供后,核心安装进程就会启动,正在安装的组件的详细信息会在一个小对话框里随进度条一闪而过。
|
||||
|
||||
![Installation progress](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-progress.png)
|
||||
|
||||
恭喜你!最新的Elementary OS 0.3 (Freya)已经安装完成了。此时需要重启来更新和完整注册,恭喜。
|
||||
|
||||
![Installation Complet](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-Complet.png)
|
||||
|
||||
启动时,Elementary OS将显示它优雅的logo,然后会出现密码保护的管理员登入和游客访问选项。游客访问有相当多的限制功能,而且没有安装软件的权限。
|
||||
|
||||
![Login](http://blog.linoxide.com/wp-content/uploads/2015/04/Login.png)
|
||||
|
||||
下图是新安装的Elementary OS 0.3的画面。
|
||||
|
||||
![first look](http://blog.linoxide.com/wp-content/uploads/2015/04/first-look.png)
|
||||
|
||||
### 个性化桌面 ###
|
||||
|
||||
Elementary OS 0.3以其轻巧和美观而为我们熟知,每个人有自己独特的审美观和计算机使用习惯。桌面反映出每一个计算机使用者的个人偏好。如其他操作系统一样,Elementary OS 0.3也提供了许多选项来个性化配置桌面,包括壁纸,字体大小,主题等等。
|
||||
|
||||
基本的个性化配置,点击Applications > System Settings > Desktop
|
||||
|
||||
我们可以改变壁纸,泊板(dock)和启用桌面热角。
|
||||
|
||||
默认提供了很少的壁纸,更多的可以从网上下载或者从你的相机传输过来。
|
||||
|
||||
![Desktop Wallpaper](http://blog.linoxide.com/wp-content/uploads/2015/04/Desktop-Wallpaper4.png)
|
||||
|
||||
Elementary OS真正的美丽在于优雅的泊板。桌面上没有任何图标,泊板上的应用图标显示逼真,通过它可以快速访问常用应用。
|
||||
|
||||
![Desktop Dock](http://blog.linoxide.com/wp-content/uploads/2015/04/Desktop-Dock1.png)
|
||||
|
||||
用户可以定制桌面的四个角的功能。
|
||||
|
||||
![Hot Corners](http://blog.linoxide.com/wp-content/uploads/2015/04/Hot-Corners.png)
|
||||
|
||||
通过安装elementary tweaks工具来更深入的个性化定制。
|
||||
|
||||
可以使用如下命令,将稳定的个人软件包档案(PPA)添加到高级软件包管理工具(APT)仓库。
|
||||
|
||||
sudo add-apt-repository ppa:mpstark/elementary-tweaks-daily
|
||||
|
||||
![ppa](http://blog.linoxide.com/wp-content/uploads/2015/04/elementary-tweaks-ppa.png)
|
||||
|
||||
一旦软件包添加到仓库后,我们需要用以下命令更新仓库
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
![update repository](http://blog.linoxide.com/wp-content/uploads/2015/04/update-repository.png)
|
||||
|
||||
更新仓库后,我们就可以安装elementary-tweaks,用以下命令完成
|
||||
|
||||
sudo apt-get install elementary-tweaks
|
||||
|
||||
![install elementary tweaks](http://blog.linoxide.com/wp-content/uploads/2015/04/install-elementary-tweaks.png)
|
||||
|
||||
我们可以在Application > System Settings下的个人区域的看到增加了一个Tweaks项目。它现在可以给我们提供更多的个性化定制选项。
|
||||
|
||||
![tweaks](http://blog.linoxide.com/wp-content/uploads/2015/04/tweaks.png)
|
||||
|
||||
为了进一步定制,我们也安装了gnome桌面系统的tweak工具,演示解锁桌面。
|
||||
|
||||
sudo apt-get install gnome-tweak-tool
|
||||
|
||||
![gnome](http://blog.linoxide.com/wp-content/uploads/2015/04/gnome.png)
|
||||
|
||||
### 总结 ###
|
||||
|
||||
Elementary OS十分接近Linux发行版Ubuntu,它的优缺点两方面也都十分相似。Elementary OS在外观和体验上都十分轻巧和优雅,并且正在快速地走向成熟。它有潜力成为Windows和OS X操作系统之外的第三选择。最新的Elementary OS 0.3(Freya)以其良好的功能基础而迅速流行。想了解更多信息,最近的更新和下载,请访问其官方[网站][1]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/elementary-os-0-3-freya-install-guide/
|
||||
|
||||
作者:[Aun Raza][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://linoxide.com/author/arunrz/
|
||||
[1]:http://sourceforge.net/projects/elementaryos/files/stable/elementaryos-freya-amd64.20150411.iso/download
|
||||
[2]:http://sourceforge.net/projects/elementaryos/files/stable/elementaryos-freya-i386.20150411.iso/download
|
||||
[3]:http://elementary.io/
|
@ -1,48 +1,48 @@
|
||||
Linux内核4.0功能 实时内核补丁,支持PS3
|
||||
Linux内核4.0功能:实时内核补丁,支持PS3
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/10/tuxtuxtux.jpeg)
|
||||
|
||||
**Linux Torvalds 在Linux内核邮件列表里[发布][1]了Linux内核新的稳定版。**
|
||||
|
||||
Linux 4.0,代号为‘Hurr durr I’m a sheep’ - 不,真的 - 带来了一小系列新的硬件支持,驱动改进,性能调整,错误修复等。
|
||||
Linux 4.0,代号为‘Hurr durr I’m a sheep’,带来了一小系列新硬件支持,驱动改进,性能调整,错误修复等。
|
||||
|
||||
但对于微小更新的标注,Torvalds 写到:
|
||||
但是其实没有太多的更新的必要,Torvalds 写到:
|
||||
|
||||
>功能方面,4.0 并没有那么多特别的。虽然在内核补丁设施上做了很多工作,但事实上[...] 我们在其它版本中有更大的改变。所以这仅仅是一次“可靠代码进步”的发布。
|
||||
> 功能方面,4.0 并没有那么多特别的。虽然在内核补丁设施上做了很多工作,但事实上[...] 我们在其它版本中有更大的改变。所以这仅仅是一次“按部就班”的发布。
|
||||
|
||||
Linus 补充说Linux 4.1 可能是一个“大版本”。
|
||||
|
||||
### Linux内核4.0新功能 ###
|
||||
|
||||
无需重启安装内核更新
|
||||
**无需重启安装内核更新**
|
||||
|
||||
你肯定曾今因为要重启你的Linux系统以完成内核更新而被打断工作,这并不是你一个人遇到的问题。这对于桌面操作系统来说是个小小的不方便,对于服务器来说却是大问题。
|
||||
你肯定遇到过内核更新需要重启你的Linux系统而被打断工作,这并不是你一个人遇到的问题。这对于桌面操作系统来说是个小小的不便,对于服务器来说却是大问题。
|
||||
|
||||
![内核更新无需重启](http://www.omgubuntu.co.uk/wp-content/uploads/2012/10/update.jpg)
|
||||
内核更新无需重启
|
||||
|
||||
*内核更新无需重启*
|
||||
|
||||
实时给Linux内核安装/使用安全补丁而不需要重启,多年来一直是Linux爱好者希望实现的事情。
|
||||
|
||||
一些第三方项目,例如[Oracle 的 KSplice][2]和红帽的Kpatch,力求为一些特定的发行版提供实时补丁的功能。
|
||||
一些第三方项目,例如[Oracle 的 KSplice][2]和红帽的 Kpatch,已经为一些特定的发行版提供实时补丁的功能。
|
||||
|
||||
对于服务器,企业单位以及关键任务正常运行,实现实时内核补丁是一个相当大的问题。
|
||||
|
||||
好消息是Linux 4.0 使得重启系统以完成内核更新成为了过去。
|
||||
|
||||
或者,几乎。
|
||||
如果不是完全不需要重启,也是基本不需要。
|
||||
|
||||
在最新的发行版中,实现了支持免重启安装补丁的最初基础,随时为有经验的系统管理员利用Linux4.0的优势做好了准备。
|
||||
在最新的发行版中,实现了支持免重启安装补丁的最初基础,为有经验的系统管理员发挥 Linux 4.0的优势做好了准备。
|
||||
|
||||
桌面Linux发行版也应该能够利用这个功能的优势(但考虑到在最终用户端配置免重启功能会比较复杂而有一些路要走)。
|
||||
桌面Linux发行版也应该能够利用这个功能的优势(但考虑到在最终用户端配置免重启功能会比较复杂而有一些路要走)。
|
||||
|
||||
在以后的4.x系列中,这个基础功能会持续完善和改进。我希望我们能更多听到它正是如此的信息。
|
||||
在以后的4.x系列中,这个基础功能会持续完善和改进。我希望我们能更多听到它的一些信息。
|
||||
|
||||
#### 其它改进 ####
|
||||
|
||||
尽管被认为是一次小版本的发布,最新的Linux内核还是带来了一系列的硬件改进,新的驱动以及性能调整。
|
||||
它们包括:
|
||||
|
||||
|
||||
- 针对Intel ‘Skylake’ 平台的改进
|
||||
- 支持Intel Quark SoC
|
||||
- 改善Linux在Playstation 3上运行的系列补丁
|
||||
@ -53,11 +53,11 @@ Linus 补充说Linux 4.1 可能是一个“大版本”。
|
||||
|
||||
### 在Ubuntu上安装Linux内核4.0 ###
|
||||
|
||||
尽管被归为稳定版本,目前而言,**桌面用户和新用户没有必要去升级**。
|
||||
尽管被归为稳定版本,但目前而言,**桌面用户和新用户没有必要去升级**。
|
||||
|
||||
通过从[Canonical的主线内核文档][3]抓取合适的安装包或者冒第三方PPA库的风险在Ubuntu 15.04测试版安装Linux4.0,急躁或者不娴熟可能会带来问题。
|
||||
如果从[Canonical的主线内核文档][3]抓取合适的安装包或者冒着第三方PPA库的风险在Ubuntu 15.04测试版安装Linux4.0,那么这种急躁或者不娴熟可能会带来问题。
|
||||
|
||||
Ubuntu 15.04 Vivid Vervet 将在本月晚些时候发布并会附带Ubuntu内核 3.19(Ubuntu内核是由Linux内核以及一些上游还没有接受的特定Ubuntu补丁组成)。
|
||||
Ubuntu 15.04 Vivid Vervet 将在本月晚些时候发布并会附带Ubuntu内核 3.19(Ubuntu的内核是由Linux内核以及一些上游发行版还没有接受的 Ubuntu 特定的补丁组成)。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -65,11 +65,11 @@ via: http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://lkml.org/lkml/2015/4/12/178
|
||||
[1]:http://linux.cn/article-5259-1.html
|
||||
[2]:http://www.omgubuntu.co.uk/2009/10/how-to-install-kernel-updates-without-rebooting
|
||||
[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
|
||||
[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
|
@ -0,0 +1,161 @@
|
||||
在 Apache、NGINX 和 Lighttpd 上启用 HTTP 公钥固定扩展(HPKP)
|
||||
================================================================================
|
||||
|
||||
公钥固定(Public Key Pinning)是指一个证书链中必须包含一个白名单中的公钥,也就是说只有被列入白名单的证书签发机构(CA)才能为某个域名`*.example.com`签发证书,而不是你的浏览器中所存储的任何 CA 都可以为之签发。本文讲述了这种机制的背景知识,并提供了 Apache、 Lighttpd 和 NGINX 上的配置范例。
|
||||
|
||||
### HTTP 公钥固定扩展 ###
|
||||
|
||||
用你使用的银行做个例子,它一直使用 CA 公司 A 为其签发证书。但是在当前的证书体系下,CA 公司 B、CA 公司 C 和 NSA 的 CA 都能给你的银行创建证书,而你的浏览器会毫无疑虑的接受它们,因为这些公司都是你所信任的根 CA。
|
||||
|
||||
如果你的银行实现了 HPKP 并固定了它们的第一个中级证书(来自 CA 公司 A),那么浏览器将不会接受来自CA 公司 B 和 CA 公司 C 的证书,即便它们也有一个有效的信任链。HPKP 也允许你的浏览器将这种违例行为报告给该银行,以便银行知道被伪造证书攻击了。
|
||||
|
||||
HTTP 公钥固定扩展是一个从2011年开始开发的针对 HTTP 用户代理(即浏览器)的公钥固定标准。它由 Google 发起,甚至在 Chrome 中实现的固定机制可以使用一个人工维护的网站公钥固定列表,这个列表包含了固定的几个网站的公钥签名。(LCTT 译注:Chrome 和 FireFox 32 及以后版本都支持公钥固定机制,并使用内置的人工维护的公钥固定列表数据,这些数据随着浏览器软件的更新而更新,主要包括几个大型站点。目前还只有 Chrome 38+ 支持通过 HTTP 响应头传递公钥固定信息。)
|
||||
|
||||
以下是 HPKP 的几个功能简述:
|
||||
|
||||
- HPKP 是在 HTTP 层面设置的,使用 `Public-Key-Pins` (PKP)响应头。
|
||||
- 该规则的保留周期通过 max-age 参数设置,单位是秒。
|
||||
- PKP 响应头只能用于正确的安全加密通讯里面。
|
||||
- 如果出现了多个这样的响应头,则只处理第一个。
|
||||
- 固定机制可以使用`includeSubDomains`参数扩展到子域。
|
||||
- 当接收到一个新的 PKP 响应头时,它会覆盖之前存储的公钥固定和元数据。
|
||||
- 公钥固定是用哈希算法生成的,其实是一个“主题公钥信息(SKPI)”指纹。
|
||||
|
||||
本文首先会介绍一些 HPKP 工作的原理,接下来我们会展示给你如何得到需要的指纹并配置到 web 服务器中。
|
||||
|
||||
### SPKI 指纹 - 理论 ###
|
||||
|
||||
以下摘自 Adam Langley 的[帖子][1],我们哈希的是一个公钥,而不是证书:
|
||||
|
||||
> 通常来说,对证书进行哈希是一个显而易见的解决方案,但是其实这是错的。不能这样做的原因是 CA 证书可以不断重新签发:同一个公钥、主题名可以对应多个证书,而这些证书有不同的延展或失效时间。浏览器从下至上地在证书池中构建证书链时,另外一个版本的证书可能就替代匹配了你原本所期望的证书。
|
||||
>
|
||||
> 举个例子,StartSSL 有两个根证书:一个是以 SHA1 签名的,另外是一个是 SHA256。如果你希望固定住 StartSSL 作为你的 CA,那么你该使用哪个证书呢?你也许可以使用这两个,但是如果我不告诉你,你怎么会知道还有一个根证书呢?
|
||||
>
|
||||
> 相反地,对公钥进行哈希则不会有这个问题:
|
||||
>
|
||||
> 浏览器假定子证书是固定不动的:它总是证书链的起点。子证书所携带的签名一定是一个有效的签名,它来自其父证书给这个证书专门签发的。这就是说,父证书的公钥相对于子证书来说是固定的。所以可推论公钥链是固定的。
|
||||
>
|
||||
> 唯一的问题是你不能固定到一个交叉认证的根证书上。举个例子,GoDaddy 的根证书是 Valicert 签名的,这是为了让那些不能识别 GoDaddy 根证书的老客户可以信任其证书。然而,你不能固定到 Valicert 上,因为新的客户在证书链上发现了 GoDaddy 证书就会停止上溯(LCTT 译注:所以就找不到固定信息了)。
|
||||
>
|
||||
> 此外,我们是对 SubjectPublicKeyInfo(SPKI)进行哈希而不是对公钥位串。SPKI 包括了公钥类型、公钥自身及其相关参数。这很重要,因为如果对公钥进行哈希就有可能导致发生曲解攻击。对于一个 Diffie-Hellman 公钥而言:如果仅对公钥进行哈希,而不是对完整的 SPKI,那么攻击者可以使用同样的公钥而让客户端将其解释为其它组。同样地,这样也有可能强制将一个 RSA 密钥当成 DSA 密钥解释等等。
|
||||
|
||||
### 固定在哪里 ###
|
||||
|
||||
你应该固定在什么地方?固定你自己的公钥并不是一个最好的办法。你的密钥也许会改变或撤销。你也许会使用多个证书,经常轮换证书的话密钥就改变了。也许由于服务器被入侵而撤销证书。
|
||||
|
||||
最容易但是不是太安全的方法是固定第一个中级 CA 证书。该证书是签名在你的网站证书之上的,所以签发该证书的 CA 的公钥肯定是在证书链上的。
|
||||
|
||||
采用这种方法你可以从同一个 CA 更新你的证书而不用担心固定信息不对。如果该 CA 发行了一个不同的根证书,也许你会遇到一些问题,对此并没有太好的解决方案。不过你可以通过如下做法来减轻这种问题的影响:
|
||||
|
||||
- 从一个不同的 CA 申请一个备用的证书,并固定该备份。
|
||||
|
||||
RFC 里面说你至少需要做两个固定。一个是当前连接所使用的证书链上的,另外一个是备份的。
|
||||
|
||||
另外的固定是对备份公钥的,它可以是来自另外一个给你签发证书的不同 CA 的 SKPI 指纹。
|
||||
|
||||
在这个问题上还有一种**更安全**的方法,就是事先创建好至少三个独立的公钥(使用 OpenSSL,参见[此页][2] 了解 Javascript OpenSSL 命令生成器),并将其中两个备份到一个安全的地方,离线存储、不要放到网上。
|
||||
|
||||
为这三个证书创建 SPKI 指纹并固定它们,然后仅使用第一个作为当前的证书。当需要时,你可以使用备份密钥之一。不过你需要让 CA 给你做签名来生成证书对,这可能需要几天,依你的 CA 的工作情况而定。
|
||||
|
||||
对于 HPKP 来说这没有问题,因为我们使用的是公钥的 SPKI 哈希,而不是证书。失效或不同的 CA 签名链并不影响。
|
||||
|
||||
如果你按照上述方法生成并安全存储了至少三个独立的密钥,并固定它们,也可以防止你的 CA 撤销你的网站证书并签发一个假证书时出现问题。
|
||||
|
||||
### SPKI 指纹 ###
|
||||
|
||||
可以使用如下的 OpenSSL 命令来生成 SPKI 指纹,它出现在 [RFC 草案][3] 中:
|
||||
|
||||
openssl x509 -noout -in certificate.pem -pubkey | \
|
||||
openssl asn1parse -noout -inform pem -out public.key;
|
||||
openssl dgst -sha256 -binary public.key | openssl enc -base64
|
||||
|
||||
结果:
|
||||
|
||||
klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=
|
||||
|
||||
上面输入的 `certificate.pem` 文件是本站(https://raymii.org)的证书链中第一个证书。(在写本文时, `COMODO RSA Domain Validation Secure Server CA, 序列号 2B:2E:6E:EA:D9:75:36:6C:14:8A:6E:DB:A3:7C:8C:07 。`)。
|
||||
|
||||
你也需要同样对你的另外两个备份公钥生成指纹。
|
||||
|
||||
### 故障 ###
|
||||
|
||||
在写本文时(2015/1),唯一支持 HPKP 的浏览器(chrome)有一个严重的问题:Chrome 并不能够区分 HSTS 和 HPKP 响应头中的 max-age 和 includeSubdomains 参数。也就是说,如果你的 HSTS 和 HPKP 设置了不同的 max-age 和 includeSubdomains 参数,它们会互相搞乱。关于这个故障的更多信息参见:[https://code.google.com/p/chromium/issues/detail?id=444511][4]。感谢 Scott Helme([https://scotthelme.co.uk][5])发现并告诉我这个 Chromium 项目的问题。
|
||||
|
||||
### Web 服务器配置 ###
|
||||
|
||||
下面你可以看到三个主流 Web 服务器的配置方法。这只是一个 HTTP 响应头,绝大多数 Web 服务器都可以设置它。它只需要设置到 HTTPS 网站上。
|
||||
|
||||
下面的例子固定到 `COMODO RSA Domain Validation Secure Server CA` 及备份的 `Comodo PositiveSSL` CA 上,30天失效期,包括所有的子域。
|
||||
|
||||
|
||||
#### Apache ####
|
||||
|
||||
编辑你的 Apache 配置文件(如 `/etc/apache2/sites-enabled/website.conf 或 /etc/apache2/httpd.conf`),并添加下列行到你的 VirtualHost 中:
|
||||
|
||||
# 如需要,载入 headers 模块。
|
||||
LoadModule headers_module modules/mod_headers.so
|
||||
|
||||
Header set Public-Key-Pins "pin-sha256=\"klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=\"; pin-sha256=\"633lt352PKRXbOwf4xSEa1M517scpD3l5f79xMD9r9Q=\"; max-age=2592000; includeSubDomains"
|
||||
|
||||
#### Lighttpd ####
|
||||
|
||||
Lighttpd 更简单一些,将下列行添加到你的 Lighttpd 配置文件(如 `/etc/lighttpd/lighttpd.conf`):
|
||||
|
||||
server.modules += ( "mod_setenv" )
|
||||
$HTTP["scheme"] == "https" {
|
||||
setenv.add-response-header = ( "Public-Key-Pins" => "pin-sha256=\"klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=\"; pin-sha256=\"633lt352PKRXbOwf4xSEa1M517scpD3l5f79xMD9r9Q=\"; max-age=2592000; includeSubDomains")
|
||||
}
|
||||
|
||||
#### NGINX ####
|
||||
|
||||
NGINX 的配置更简短。添加以下行到你的 HTTPS 配置的 server 块中:
|
||||
|
||||
add_header Public-Key-Pins 'pin-sha256="klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY="; pin-sha256="633lt352PKRXbOwf4xSEa1M517scpD3l5f79xMD9r9Q="; max-age=2592000; includeSubDomains';
|
||||
|
||||
### 报告功能 ###
|
||||
|
||||
HPKP 报告功能允许浏览器报告任何违例给你。
|
||||
|
||||
如果你在响应头中添加了附加的 `report-uri="http://example.org/hpkp-report"` 参数,并用该 URI 处理接收到的数据的话,客户端会在发现违例时发送报告给你。这个报告是以 POST 方式发送到你指定的 report-uri 上,并以类似下面的 JSON 格式:
|
||||
|
||||
{
|
||||
"date-time": "2014-12-26T11:52:10Z",
|
||||
"hostname": "www.example.org",
|
||||
"port": 443,
|
||||
"effective-expiration-date": "2014-12-31T12:59:59",
|
||||
"include-subdomains": true,
|
||||
"served-certificate-chain": [
|
||||
"-----BEGINCERTIFICATE-----\nMIIAuyg[...]tqU0CkVDNx\n-----ENDCERTIFICATE-----"
|
||||
],
|
||||
"validated-certificate-chain": [
|
||||
"-----BEGINCERTIFICATE-----\nEBDCCygAwIBA[...]PX4WecNx\n-----ENDCERTIFICATE-----"
|
||||
],
|
||||
"known-pins": [
|
||||
"pin-sha256=\"dUezRu9zOECb901Md727xWltNsj0e6qzGk\"",
|
||||
"pin-sha256=\"E9CqVKB9+xZ9INDbd+2eRQozqbQ2yXLYc\""
|
||||
]
|
||||
}
|
||||
|
||||
### 非强制,只报告 ###
|
||||
|
||||
HPKP 也可以设置为非强制的,可以使用 `Public-Key-Pins-Report-Only` 来只发送违例报告给你。
|
||||
|
||||
这样可以让你在网站不可访问或 HPKP 配置不正确时不固定,之后你可以将这个响应头改为 `Public-Key-Pins` 来强制固定。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://raymii.org/s/articles/HTTP_Public_Key_Pinning_Extension_HPKP.html
|
||||
|
||||
作者:[Remy van Elst][a]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://raymii.org/
|
||||
[1]:http://www.imperialviolet.org/2011/05/04/pinning.html
|
||||
[2]:https://raymii.org/s/software/OpenSSL_Command_Generator.html
|
||||
[3]:https://tools.ietf.org/html/draft-ietf-websec-key-pinning-21#appendix-A
|
||||
[4]:https://code.google.com/p/chromium/issues/detail?id=444511
|
||||
[5]:https://scotthelme.co.uk/
|
@ -0,0 +1,148 @@
|
||||
如何在Ubuntu/CentOS上安装Linux内核4.0
|
||||
================================================================================
|
||||
大家好,今天我们学习一下如何从Elrepo或者源代码来安装最新的Linux内核4.0。代号为‘Hurr durr I'm a sheep’的Linux内核4.0是目前为止最新的主干内核。它是稳定版3.19.4之后发布的内核。4月12日是所有的开源运动爱好者的大日子,Linux Torvalds宣布了Linux内核4.0的发布,它现在就已经可用了。由于包括了一些很棒的功能,例如无重启补丁(实时补丁),新的升级驱动,最新的硬件支持以及很多有趣的功能都有新的版本,它原本被期望是一次重要版本。但是实际上内核4.0并不认为是期望中的重要版本,Linus 表示期望4.1会是一个更重要的版本。实时补丁功能已经集成到了SUSE企业版Linux操作系统上。你可以在[发布公告][1]上查看关于这次发布的更多详细内容。
|
||||
|
||||
> **警告**: 安装新的内核可能会导致你的系统不可用或不稳定。如果你仍然使用以下命令继续安装,请确保备份所有重要数据到外部硬盘。
|
||||
|
||||
### 在Ubuntu 15.04上安装Linux内核4.0 ###
|
||||
|
||||
如果你正在使用Linux的发行版Ubuntu 15.04,你可以直接通过Ubuntu内核网站安装。在你的Ubuntu15.04上安装最新的Linux内核4.0,你需要在shell或终端中在root访问权限下运行以下命令。
|
||||
|
||||
#### 在 64位 Ubuntu 15.04 ####
|
||||
|
||||
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb
|
||||
|
||||
$ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb
|
||||
|
||||
#### 在 32位 Ubuntu 15.04 ####
|
||||
|
||||
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb
|
||||
|
||||
$ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb
|
||||
|
||||
### 在CentOS 7上安装Linux内核4.0 ###
|
||||
|
||||
我们可以用两种简单的方式在CentOS 7上安装Linux内核4.0。
|
||||
|
||||
1. 从Elrepo软件仓库安装
|
||||
1. 从源代码编译安装
|
||||
|
||||
我们首先用ElRepo安装,这是最简单的方式:
|
||||
|
||||
#### 使用 Elrepo 安装 ####
|
||||
|
||||
**1. 下载和安装ELRepo**
|
||||
|
||||
我们首先下载ELRepo的GPG密钥并安装relrepo-release安装包。因为我们用的是CentOS 7,我们使用以下命令安装elrepo-release-7.0-2.el7.elrepo.noarch.rpm。
|
||||
|
||||
注: 如果你启用了secure boot,请查看[这个网页获取更多信息][2]。
|
||||
|
||||
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
|
||||
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
|
||||
|
||||
![添加 Elrepo 源](http://blog.linoxide.com/wp-content/uploads/2015/04/adding-elrepo.png)
|
||||
|
||||
**2. 升级Linux内核到4.0版本**
|
||||
|
||||
现在,我们准备从ELRepo软件仓库安装最新的稳定版内核4.0。安装它我们需要在CentOS 7的shell或者终端中输入以下命令。
|
||||
|
||||
# yum --enablerepo=elrepo-kernel install kernel-ml
|
||||
|
||||
![从ELRepo安装Linux内核4.0](http://blog.linoxide.com/wp-content/uploads/2015/04/installing-kernel-4-0-elrepo.png)
|
||||
|
||||
上面的命令会自动安装为CentOS 7构建的Linux内核4.0。
|
||||
|
||||
现在,下面的是另一种方式,通过编译源代码安装最新的内核4.0。
|
||||
|
||||
#### 从源代码编译安装 ####
|
||||
|
||||
**1. 安装依赖软件**
|
||||
|
||||
首先我们需要为编译linux内核安装依赖的软件。要完成这些,我们需要在一个终端或者shell中运行以下命令。
|
||||
|
||||
# yum groupinstall "Development Tools"
|
||||
|
||||
# yum install gcc ncurses ncurses-devel
|
||||
|
||||
![安装内核依赖](http://blog.linoxide.com/wp-content/uploads/2015/04/installing-dependencies.png)
|
||||
|
||||
然后,我们会升级我们的整个系统。
|
||||
|
||||
# yum update
|
||||
|
||||
**2. 下载源代码**
|
||||
|
||||
现在我们通过wget命令从Linux内核的官方仓库中下载最新发布的linux内核4.0的源代码。你也可以使用你的浏览器直接从[kernel.org][3]网站下载内核。
|
||||
|
||||
# cd /tmp/
|
||||
# wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.0.tar.xz
|
||||
|
||||
![下载内核源码](http://blog.linoxide.com/wp-content/uploads/2015/04/download-kernel-source.png)
|
||||
|
||||
**3. 解压tar压缩包**
|
||||
|
||||
文件下载好后我们在/usr/src/文件夹下用以下命令解压。
|
||||
|
||||
# tar -xf linux-4.0.tar.xz -C /usr/src/
|
||||
# cd /usr/src/linux-4.0/
|
||||
|
||||
![解压内核tar压缩包](http://blog.linoxide.com/wp-content/uploads/2015/04/extracting-kernel-tarball.png)
|
||||
|
||||
**4. 配置**
|
||||
|
||||
配置Linux内核有两种选择的。我们可以创建一个新的自定义配置文件或者使用已有的配置文件来构建和安装Linux内核。这都取决于你自己的需要。
|
||||
|
||||
**配置新的内核**
|
||||
|
||||
现在我们在shell或终端中运行make menuconfig命令来配置Linux内核。我们执行以下命令后会显示一个包含所有菜单的弹出窗口。在这里我们可以选择我们新的内核配置。如果你不熟悉这些菜单,那就敲击ESC键两次退出。
|
||||
|
||||
# make menuconfig
|
||||
|
||||
![配置新内核](http://blog.linoxide.com/wp-content/uploads/2015/04/configuring-new-kernel-config.png)
|
||||
|
||||
**已有的配置**
|
||||
|
||||
如果你想用已有的配置文件配置你最新的内核,那就输入下面的命令。如果你对配置有任何调整,你可以选择Y或者N,或者仅仅是按Enter键继续。
|
||||
|
||||
# make oldconfig
|
||||
|
||||
#### Step 5. 编译Linux内核 ####
|
||||
|
||||
下一步,我们会执行make命令来编译内核4.0。取决于你的系统配置,编译至少需要20-30分钟。
|
||||
|
||||
注:如果编译内核的时候出现`bc command not found`的错误,你可以用**yum install bc**命令安装bc修复这个错误。
|
||||
|
||||
# make
|
||||
|
||||
![Make 内核](http://blog.linoxide.com/wp-content/uploads/2015/04/make-kernel.png)
|
||||
|
||||
#### 6. 安装Linux内核4.0 ####
|
||||
|
||||
编译完成后,我们终于要在你的Linux系统上安装**内核**了。下面的命令会在/boot目录下创建文件并且在Grub 菜单中新建一个内核条目。
|
||||
|
||||
# make modules_install install
|
||||
|
||||
#### 7. 验证内核 ####
|
||||
|
||||
安装完最新的内核4.0后我们希望能验证它。做这些我们只需要在终端中输入以下命令。如果所有都进展顺利,我们会看到内核版本,例如4.0出现在输出列表中。
|
||||
|
||||
# uname -r
|
||||
|
||||
#### 结论 ####
|
||||
|
||||
好了,我们成功地在我们的CentOS 7操作系统上安装了最新的Linux内核版本4.0。通常并不需要升级linux内核,因为和之前版本运行良好的硬件可能并不适合新的版本。我们要确保它包括能使你的硬件正常工作的功能和配件。但大部分情况下,新的稳定版本内核能使你的硬件性能更好。因此,如果你有任何问题,评论,反馈,请在下面的评论框中注明,让我们知道需要增加或者删除什么问题。多谢!享受最新的稳定版Linux内核4.0吧 :-)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/how-tos/install-linux-kernel-4-0-elrepo-source/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:http://linux.cn/article-5259-1.html
|
||||
[2]:http://elrepo.org/tiki/SecureBootKey
|
||||
[3]:http://kernel.org/
|
@ -0,0 +1,32 @@
|
||||
GitHub 上最流行的编程语言
|
||||
================================================================================
|
||||
![](http://www.loggly.com/wp-content/uploads/2015/04/Infographic_Github_popular_languages_Blogheader.png)
|
||||
|
||||
编程语言不仅仅是开发者用来创建程序或表达算法的工具,它们也是对创造力进行编码和解码的仪器。通过观察编程语言的历史,我们在追求为解决问题找到一个更好的方法,促进协作,构建好的产品以及重用他人的工作上得到一个独特的观点。
|
||||
|
||||
我们有大约 70% 的客户向我们的服务发送应用日志,因此我们能追踪哪种语言是最流行的,以及哪种语言获得了开发人员的关注。
|
||||
|
||||
基于从2012年以来的历史的[GitHub 归档][1]和[GitHut][2]数据,我们分析了GitHub上大部分开发者的动作并绘制成你下面看到的信息图表。我们主要关注:
|
||||
|
||||
- 活跃库的数量,这是反应了人们正在研究的项目的有用度量。
|
||||
- 每种语言总的推送数量以及每个库的平均推送次数。这些指标是由某种语言编写的项目的创新效率的指示器。
|
||||
- 每个库新的fork数和发现的问题数目,这也显示了活跃度和创新性。
|
||||
- 每个库新的观察者,这是开发人员兴趣的指示器。
|
||||
|
||||
### 查看信息图表并告诉我们你的想法!在你的同龄人中是怎么选择你使用的语言的? ###
|
||||
|
||||
![](http://www.loggly.com/wp-content/uploads/2015/04/Most-Popular-Languages-According-to-GitHub-Since-2012-loggly-infographic_v3.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.loggly.com/blog/the-most-popular-programming-languages-in-to-github-since-2012/
|
||||
|
||||
作者:[Justin Mares][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.loggly.com/blog/author/guest/
|
||||
[1]:https://www.githubarchive.org/
|
||||
[2]:http://githut.info/
|
88
published/Debian 8 Jessie released.md
Normal file
88
published/Debian 8 Jessie released.md
Normal file
@ -0,0 +1,88 @@
|
||||
Debian 8 "Jessie" 发布
|
||||
=====================================================
|
||||
|
||||
**2015年4月25日** ,在经历了近24个月的持续开发之后,Debian 项目自豪地宣布最新的稳定版本8的发布(代号 “**Jessie**” ),归功于[Debian安全团队][1]和[Debian长期支持][2]团队的工作,该版本将在接下来的5年内获得支持。
|
||||
|
||||
![Debian](http://i1-news.softpedia-static.com/images/news2/Debian-GNU-Linux-8-Jessie-Has-Been-Officially-Released-Download-Now-479331-2.jpg)
|
||||
|
||||
“**Jessie**” 与新的默认 init 系统 `systemd` 一同到来。`systemd` 套件提供了许多激动人心的特性,如更快的启动速度、系统服务的 cgroups 支持、以及独立出部分服务的可能性。不过,`sysvinit` init系统在 “**Jessie**” 中依然可用。
|
||||
|
||||
在 “**Wheezy**” 中引入的 UEFI 支持(*“Unified Extensible Firmware Interface”*,统一的可扩展固件接口)同样在 “**Jessie**” 中得到了大幅改进。其中包含了许多已知固件 bug 的临时性解决方案,支持32位系统上的UEFI,也支持64位内核运行在32位 UEFI 固件上(后者仅被包含在我们的 `amd64/i386` “multi-arch” 安装介质中)。
|
||||
|
||||
自上个版本发布以来,Debian 项目的成员同样对我们的支持服务做出了重要改进。其中之一是[可浏览所有 Debian 的源码][3],该服务目前放在 [sources.debian.net][4]。当然,在超过20000个源码包里想要找到正确的文件确实令人望而生畏。因此,我们同样十分高兴地上线 [Debian 代码搜索][5],它放在 [codesearch.debian.net][6]。这两项服务都由一个完全重写并且更加反应敏捷的[包追踪系统][7]提供。
|
||||
|
||||
该版本包含大量的软件包更新,如:
|
||||
|
||||
* Apache 2.4.10
|
||||
* Asterisk 11.13.1
|
||||
* GIMP 2.8.14
|
||||
* 一个GNOME桌面环境 3.14 的升级版本
|
||||
* GCC 编译器 4.9.2
|
||||
* Icedove 31.6.0 (一个 Mozilla Thunderbird 的再发布版本)
|
||||
* Iceweasel 31.6.0esr (一个 Mozilla Firefox 的再发布版本)
|
||||
* KDE Plasma Workspaces 和 KDE Applications 4.11.13
|
||||
* LibreOffice 4.3.3
|
||||
* Linux 3.16.7-ctk9
|
||||
* MariaDB 10.0.16 和 MySQL 5.5.42
|
||||
* Nagios 3.5.1
|
||||
* OpenJDK 7u75
|
||||
* Perl 5.20.2
|
||||
* PHP 5.6.7
|
||||
* PostgreSQL 9.4.1
|
||||
* Python 2.7.9 和 3.4.2
|
||||
* Samba 4.1.17
|
||||
* Tomcat 7.0.56 和 8.0.14
|
||||
* Xen Hypervisor 4.4.1
|
||||
* Xfce 4.10桌面环境
|
||||
* 超过43000个其它可供使用的软件包,从将近20100个源码包编译而来
|
||||
|
||||
与如此之多的软件包选择和照例的广泛架构支持,Debian 再次向它的目标:成为通用操作系统迈出正确的一步。Debian 适用于各种不同情形:从桌面系统到上网本;从开发服务器到集群系统;以及数据库,web,或存储服务器。同时,在此基础之上的质量保证工作,如对 Debian 上所有包的自动安装和升级测试,让 “**Jessie**” 可以满足用户拥有一个稳定的 Debian 版本的高期望值。
|
||||
|
||||
总共支持十种架构:32位PC/Intel IA-32(`i386`),64位PC/Intel EM64T / x86-64 (`amd64`),Motorola/IBM PowerPC (旧硬件的`powerpc`和新的64位`ppc64el`(little-endian)),MIPS (`mips` 大端和 `mipsel`小端),IBM S/390 (64位 `s390x`)以及 ARM 新老32位硬件的`armel`和`armhf`,加上给新64位 *“AArch64”* 架构的`arm64`。
|
||||
|
||||
### 想尝试一下? ###
|
||||
|
||||
如果你仅仅是想在不安装的情况下体验 Debian 8 “**Jessie**”,你可以使用一个特殊的镜像,即 live 镜像,可以用在 CD,U 盘以及网络启动设置上。最先只有 `amd64` 和 `i386` 架构提供这些镜像。Live 镜像同样可以用来安装 Debian。更多信息请访问 [Debian Live 主页][8]。
|
||||
|
||||
但是如果你想安装 Debian 到你的计算机的话,有不少安装媒介可供你选择,如蓝光碟,DVD,CD 以及 U 盘,或者从网络安装。有几种桌面环境:GNOME,KDE Plasma 桌面及 Plasma 应用,Xfce 以及 LXDE,它们可以从CD镜像中安装,也可以从 CD/DVD 的启动菜单里选择想要的桌面环境。另外,同样提供了多架构 CD 和 DVD,可以从单一磁盘选择安装不同架构的系统。或者你还可以创建可启动 U 盘安装媒介(参看[安装指南][9]获得更多细节)。对云用户,Debian 还提供了[预构建 OpenStack 镜像][10]可供使用。
|
||||
|
||||
安装镜像现在同样可以通过 [bittorrent][11](推荐下载方式),[jigdo][12] 或 [HTTP][13] 下载,查看[Debian 光盘][14]获得更进一步的信息。“**Jessie**” 不久将提供实体 DVD,CD-ROM,以及无数[供应商][15]的蓝光碟。
|
||||
|
||||
### 升级 Debian ###
|
||||
|
||||
如果从前一个版本 Debian 7(代号 “**Wheezy**” )升级到 Debian 8,大部分配置情况 apt-get 包管理工具都能够自动解决。Debian 系统一如既往地能够就地无痛升级,无需强制停机。强烈推荐阅读[发行注记][16]和[安装指南][17]来了解可能存在的问题,并了解安装和升级建议。发行注记会在发布后的几周内进一步改进,并翻译成其他语言。
|
||||
|
||||
## 关于 Debian ##
|
||||
|
||||
Debian 是一个自由操作系统,由成千上万来自全世界的志愿者通过互联网协作开发。Debian 项目的关键力量是它的志愿者基础,它对 Debian 社群契约和自由软件的贡献,以及对提供最好的操作系统可能的承诺。Debian 8是其前进方向上又一重要一步。
|
||||
|
||||
## 联系信息 ##
|
||||
|
||||
获取更多信息,请访问 Debian 主页 [https://www.debian.org/][18] 或发送电子邮件至<press@debian.org>。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debian.org/News/2015/20150426
|
||||
|
||||
译者:[alim0x](https://github.com/alim0x) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://security-team.debian.org/
|
||||
[2]:https://wiki.debian.org/LTS
|
||||
[3]:https://www.debian.org/News/weekly/2013/14/#sources
|
||||
[4]:https://sources.debian.net/
|
||||
[5]:https://www.debian.org/News/weekly/2014/17/#DCS
|
||||
[6]:https://codesearch.debian.net/
|
||||
[7]:https://tracker.debian.org/
|
||||
[8]:http://live.debian.net/
|
||||
[9]:https://www.debian.org/releases/jessie/installmanual
|
||||
[10]:http://cdimage.debian.org/cdimage/openstack/current/
|
||||
[11]:https://www.debian.org/CD/torrent-cd/
|
||||
[12]:https://www.debian.org/CD/jigdo-cd/#which
|
||||
[13]:https://www.debian.org/CD/http-ftp/
|
||||
[14]:https://www.debian.org/CD/
|
||||
[15]:https://www.debian.org/CD/vendors
|
||||
[16]:https://www.debian.org/releases/jessie/releasenotes
|
||||
[17]:https://www.debian.org/releases/jessie/installmanual
|
||||
[18]:https://www.debian.org/
|
@ -1,319 +0,0 @@
|
||||
Love-xuan Translating
|
||||
Group Test: Linux Text Editors
|
||||
================================================================================
|
||||
> Mayank Sharma tests five supercharged text editors that can crunch more than just words.
|
||||
|
||||
If you’ve been using Linux long, you know that whether you want to edit an app’s configuration file, hack together a shell script, or write/review bits of code, the likes of LibreOffice just won’t cut it. Although the words mean almost the same thing, you don’t need a word processor for these tasks; you need a text editor.
|
||||
|
||||
In this group test we’ll be looking at five humble text editors that are more than capable of heavy-lifting texting duties. They can highlight syntax and auto-indent code just as effortlessly as they can spellcheck documents. You can use them to record macros and manage code snippets just as easily as you can copy/paste plain text.
|
||||
|
||||
Some simple text editors even exceed their design goals thanks to plugins that infuse them with capabilities to rival text-centric apps from other genres. They can take on the duties of a source code editor and even an Integrated Development Environment.
|
||||
|
||||
Two of most popular and powerful plain text editors are Emacs and Vim. However, we didn’t include them in this group test for a couple of reasons. Firstly, if you are using either, congratulations: you don’t need to switch. Secondly, both of these have a steep learning curve, especially to the GUI-oriented desktop generation who have access to alternatives that are much more inviting.
|
||||
|
||||
### The contenders: ###
|
||||
|
||||
#### Gedit ####
|
||||
|
||||
- URL:http://projects.gnome.org/gedit/
|
||||
- Version: 3.10
|
||||
- Licence: GPL
|
||||
- Is Gnome’s default text editor up to the challenge?
|
||||
|
||||
#### Kate ####
|
||||
|
||||
- URL: www.kate-editor.org
|
||||
- Version: 3.11
|
||||
- Licence: LGPL/GPL
|
||||
- Will Kate challenge fate?
|
||||
|
||||
#### Sublime Text ####
|
||||
|
||||
- URL: www.sublimetext.com
|
||||
- Version: 2.0.2
|
||||
- Licence: Proprietary
|
||||
- Proprietary software in the land of free with the heart of gold.
|
||||
|
||||
#### UltraEdit ####
|
||||
|
||||
- URL: www.ultraedit.com
|
||||
- Version: 4.1.0.4
|
||||
- Licence: Proprietary
|
||||
- Does it do enough to justify its price?
|
||||
|
||||
#### jEdit ####
|
||||
|
||||
- URL: www.jedit.org
|
||||
- Version: 5.1.0
|
||||
- Licence: GPL
|
||||
- Will the Java-based editor spoil the party for the rest?
|
||||
|
||||
![There’s a fine balance between stuffing an app with features and exposing all of them to the user. Geddit keeps most of its features hidden.](http://www.linuxvoice.com/wp-content/uploads/2014/07/gedit-web.png)
|
||||
There’s a fine balance between stuffing an app with features and exposing all of them to the user. Geddit keeps most of its features hidden.
|
||||
|
||||
### The crucial criteria ###
|
||||
|
||||
All the tools, except Gedit and jEdit, were installed on Fedora and Ubuntu via their recommended installation method. The former already shipped with the default Gnome desktop and the latter stubbornly refused to install on Fedora. Since these are relatively simple apps, they have no esoteric dependencies, the only exception being jEdit, which requires Oracle Java.
|
||||
|
||||
Thanks to the continued efforts of both Gnome and KDE, all editors look great and function properly irrespective of the desktop environment they are running on. That not only rules it out as an evaluation criterion, it also means that you are no longer bound by the tools that ship with your favourite desktop environment.
|
||||
|
||||
In addition to their geekier functionality, we also tested all our candidates for general-purpose text editing. However, they are not designed to mimic all the functionality of a modern-day word processor and weren’t evaluated as such.
|
||||
|
||||
![Kate can double up as a versatile can capable integrated development environment (IDE).](http://www.linuxvoice.com/wp-content/uploads/2014/08/kate-web.png)
|
||||
|
||||
Kate can double up as a versatile can capable integrated development environment (IDE).
|
||||
|
||||
### Programming language support ###
|
||||
|
||||
UltraEdit does syntax highlighting, can fold code and has project management capabilities. There’s also a function list, which is supposed to list all the functions in the source file, but it didn’t work for any of our test code files. UltraEdit also supports HTML5, and has a HTML toolbar with which you can add commonly-used HTML tags.
|
||||
|
||||
Even Gnome’s default text editor, Gedit, has several code-oriented features such as bracket matching, automatic indentation, and will also highlight syntax for various programming languages including C, C++, Java, HTML, XML, Python, Perl, and many others.
|
||||
|
||||
If you’re looking for more programming assistance, look at Sublime and Kate. Sublime supports several programming languages and (as well as the popular ones) is able to highlight syntax for C#, D, Dylan, Erlang, Groovy, Haskell, Lisp, Lua, MATLAB, OCaml, R, and even SQL. If that isn’t enough for you, you can download add-ons to support even more languages.
|
||||
|
||||
Furthermore, its syntax highlighting ability offers several customisable options. The app will also match braces, to ensure they are all properly rounded off, and the auto-complete function in Sublime works with variables created by the user.
|
||||
|
||||
Just like Komodo IDE, sublime also displays a scrollable preview of the full source code, which is really handy for navigating long code files and lets you jump between different parts of the file.
|
||||
|
||||
One of the best features of Sublime is its ability to run code for certain languages like C++, Python, Ruby, etc from within the editor itself, assuming of course you have the compiler and other build system tools installed on your computer. This helps save time and eliminates the need to switch out to the command line.
|
||||
|
||||
You can also enable the build system in Kate with plugins. Furthermore, you can add a simple front-end to the GDB debugger. Kate will work with Git, Subversion and Mercurial version control systems, and also provides some functionality for project management.
|
||||
|
||||
It does all this in addition to highlighting syntax for over 180 languages, along with other assistance like bracket matching, auto-completion and auto-indentation. It also supports code folding and can even collapse functions within a program.
|
||||
|
||||
The only disappointment is jEdit, which bills itself as a programmer’s text editor, but it struggled with other basic functions such as code folding and wouldn’t even suggest or complete functions.
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit:3/5
|
||||
- Kate:5/5
|
||||
- Sublime:5/5
|
||||
- UltraEdit3/5
|
||||
- jEdit:1/5
|
||||
|
||||
![If you don’t like Sublime’s Charcoal appearance, you can choose one of the other 22 themes included with ti.](http://www.linuxvoice.com/wp-content/uploads/2014/08/sublime-web.png)
|
||||
|
||||
If you don’t like Sublime’s Charcoal appearance, you can choose one of the other 22 themes included with ti.
|
||||
|
||||
### Keyboard control ###
|
||||
|
||||
Users of an advanced text editor expect to control and operate it exclusively via the keyboard. Furthermore, some apps even allow their users to further customise the key bindings for the shortcuts.
|
||||
|
||||
You can easily work with Gedit using its extensive keyboard shortcut keys. There are keys for working with and editing files as well as invoke tools for common tasks such as spellchecking a document. You can access a list of default shortcut keys from within the app, but there’s no graphical way to customise them. Similarly, to customise the keybindings in Sublime, you need to make modifications in its XML keymap files. Sublime has been criticised for its lack of a graphical interface to define keyboard shortcuts, but long-term users have defended the current file-based mechanism, which gives them more control.
|
||||
|
||||
UltraEdit is proud of its “everything is customisable” motto, which it extend to keyboard shortcuts. You can define custom hotkeys for navigating the menus and also define your own multi-key key-mappings for accessing its plethora of functions.
|
||||
|
||||
In addition to its fully customisable keyboard shortcuts, jEdit also has pre-defined keymaps for Emacs. Kate is equally impressive in this respect. It has an easily accessible window to customise the key bindings. You can change the default keys, as well as define alternate ones. Furthermore, Kate also has a Vi mode which will let users operate Kate using Vi keys.
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit:2/5
|
||||
- Kate:5/5
|
||||
- Sublime:3/5
|
||||
- UltraEdit:4/5
|
||||
- jEdit:5/5
|
||||
|
||||
### Snippets and macros ###
|
||||
|
||||
Macros help you cut down the time spent on editing and organising data by automating repetitive steps, while Snippets of code extend a similar functionality to programmers by creating reusable chunks of source code. Both have the ability to save you time.
|
||||
|
||||
The vanilla Gedit installation doesn’t have either of these functionalities, but you can enable them via separate plugins. While the Snippets plugin ships with Gedit, you’ll have to manually download and install the macro plugin (it’s called gedit-macropy and is hosted on GitHub) before you can enable it from within Gedit.
|
||||
|
||||
Kate takes the same plugins route to enable the snippets feature. Once added, the plugin also adds a repository of snippets for PHP, Bash and Java. You can display the list of snippets in the sidebar for easier access. Right-click on a snippet to edit its contents as well as its shortcut key combination. However, very surprisingly, it doesn’t support macros – despite repeated hails from users since 2002!
|
||||
|
||||
jEdit too has a plugin for enabling snippets. But it can record macros from user actions and you can also write them in the BeanShell scripting language (BeanShell supports scripted objects as simple method closures like those in Perl and JavaScript). jEdit also has a plugin that will download several macros from jEdit’s website.
|
||||
|
||||
Sublime ships with inbuilt ability to create both snippets and macros, and ships with several snippets of frequently used functions for most popular programming languages.
|
||||
|
||||
Snippets in UltraEdit are called Smart Templates and just like with Sublime you can insert them based upon the kind of source file you’re editing. To complement the Macro recording function, UltraEdit also has an integrated javascript-based scripting language to automate tasks. You can also download user-submitted macros and scripts from the editor’s website.
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit:3/5
|
||||
- Kate:1/5
|
||||
- Sublime:5/5
|
||||
- UltraEdit:5/5
|
||||
- jEdit:5/5
|
||||
|
||||
![UltraEdit’s UI is highly configurable — you can customise the layout of the toolbars and menus just as easily as you can change many other aspects.](http://www.linuxvoice.com/wp-content/uploads/2014/08/ultraedit-web.png)
|
||||
|
||||
UltraEdit’s UI is highly configurable — you can customise the layout of the toolbars and menus just as easily as you can change many other aspects.
|
||||
|
||||
### Ease of use ###
|
||||
|
||||
Unlike a bare-bones text editor, the text editors in this feature are brimming with features to accommodate a wide range of users — from document writers to programmers. Instead of stripping features from the apps, their developers are looking for avenues to add more functionality.
|
||||
|
||||
Although at first glance most apps in this group test have a very similar layout, upon closer inspection, you’ll notice several usability differences. We have a weak spot for apps that expose their functionality and features by making judicious use of the user interface, instead of just overwhelming the user.
|
||||
|
||||
### Gedit: 4/5 ###
|
||||
|
||||
Gedit wears a very vanilla look. It has an easy interface with minimal menus and buttons. This is a two-edged sword though, as some users might fail to realise its true potential.
|
||||
|
||||
The app can open multiple files in tabs that can be rearranged and moved between windows. Users can optionally enable panels on the side and bottom for displaying a file browser and the output of a tool enabled by a plugin. The app will detect when an open file is modified by another application and offers to reload that file.
|
||||
|
||||
The UI has been given a major overhaul in the latest version of the app yet to make its way into Gnome. However it isn’t yet stable, and while it maintains all features, several plugins that interact with the menu will need to be updated.
|
||||
|
||||
### Kate: 5/5 ###
|
||||
|
||||
Although a major part of its user interface resembles Gedit, Kate tucks in tabs at either side and its menus are much fuller. The app is approachable and invites users to explore other features.
|
||||
|
||||
Kate can transparently open and save files over all protocols supported by KDE’s KIO including HTTP, FTP, SSH, SMB and WebDAV. You can use the app to work with multiple files at the same time. But unlike the traditional horizontal tab switching bar in most app, Kate has tabs on either side of the screen. The left sidebar will display an index of open files. Programmers who need to see different parts of the same file at the same time will also appreciate its ability to split the interface horizontally as well as vertically.
|
||||
|
||||
### Sublime: 5/5 ###
|
||||
|
||||
Sublime lets you view up to four files at the same time in various arrangements. There’s also a full-screen distraction free mode that just displays the file and the menu, for when you’re in the zone.
|
||||
|
||||
The editor also has a minimap on the right, which is useful for navigating long files. The app ships with several snippets for popular functions in several programming languages, which makes it very usable for developers. Another neat editing feature, whether you are working with text documents or code, is the ability to swap and shuffle selections.
|
||||
|
||||
### UltraEdit: 3/5 ###
|
||||
|
||||
UltraEdit’s interface is loaded with several toolbars at the top and bottom of the interface. Along with the tabs to switch between documents, panes on either side and the gutter area, these leave little room for the editor window.
|
||||
|
||||
Web developers working with HTML files have lots of assistance at their fingertips. You can also access remote files via FTP and SFTP. Advanced features such as recording a macro and comparing files are also easily accessible.
|
||||
|
||||
Using the app’s Preferences window you can tweak various aspects of the app, including the colour scheme and other features like syntax highlighting.
|
||||
|
||||
### jEdit: 3/5 ###
|
||||
|
||||
In terms of usability, one of the first red-flags was jEdit’s inability to install on RPM-based distros. Navigating the editor takes some getting used to, since its menus aren’t in the same order as in other popular apps and some have names that won’t be familiar to the average desktop user. However, the app include detailed inbuilt help, which will help ease the learning curve.
|
||||
|
||||
jEdit highlights the current line you are on and enables you to split windows in multiple viewing modes. You can easily install and manage plugins from within the app, and in addition to full macros, jEdit also lets you record quick temporary ones.
|
||||
|
||||
![Thanks to its Java underpinnings, jEdit doesn’t really feel at home on any desktop environment](http://www.linuxvoice.com/wp-content/uploads/2014/08/jedit-web.png)
|
||||
|
||||
Thanks to its Java underpinnings, jEdit doesn’t really feel at home on any desktop environment
|
||||
|
||||
### Availability and support ###
|
||||
|
||||
There are several similarities between Gedit and Kate. Both apps take advantage of their respective parent project, Gnome and KDE, and are bundled with several mainstream distros. Yet both projects are cross-platform and have Windows and Mac OS X ports as well as native Linux versions.
|
||||
|
||||
Gedit is hosted on Gnome’s web infrastructure and has a brief user guide, information about the various plugins, and the usual channels of getting in touch including a mailing list and IRC channel. You’ll also find usage information on the websites of other Gnome-based distros such as Ubuntu. Similarly, Kate gets the benefit of KDE’s resources and hosts detailed user information as well as a mailing list and IRC channel. You can access their respective user guides offline from within the app as well.
|
||||
|
||||
UltraEdit is also available for Windows and Mac OS X besides Linux, and has detailed user guides on getting started, though there’s none included within the app. To assist users, UltraEdit hosts a database of frequently asked questions, a bunch of power tips that have detailed information about several specific features, and users can engage with one another other on forum boards. Additionally, paid users can also seek support from the developers via email.
|
||||
|
||||
Sublime supports the same number of platforms, however you don’t need to buy a separate licence for each platform. The developer keeps users abreast with ongoing development via a blog and also participates actively in the hosted forums. The highlight of the project’s support infrastructure is the freely available detailed tutorial and video course. Sublime is lovely.
|
||||
|
||||
Because it’s written in Java, jEdit is available on several platforms. On its website you’ll find a detailed user guide and links to documentation of some plugins. However, there are no avenues for users to engage with other users or the developer.
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit: 4/5
|
||||
- Kate: 4/5
|
||||
- Sublime: 5/5
|
||||
- UltraEdit: 3/5
|
||||
- jEdit: 2/5
|
||||
|
||||
### Add-on and plugins ###
|
||||
|
||||
Different users have different requirements, and a single lightweight app can only do as much. This is where plugins come into the picture. The apps rely on these small pluggable widgets to extend their feature set and be of use to even more number of users.
|
||||
|
||||
The one exception is UltraEdit. The app has no third-party plugins, but its developers do point out that third-party tools such as HtmlTidy are already installed with UltraEdit.
|
||||
|
||||
Gedit ships with a number of plugins installed, and you can download more with the gedit-plugins package. The project’s website also points to several third-party plugins based on their compatibility with the Gedit versions.
|
||||
|
||||
Three useful plugins for programmers are Code Comment, Terminal Plugin, which adds a terminal in the bottom panel, and the Session Saver. The Session Saver is really useful when you’re working on a project with multiple files. You can open all the files in tabs, save your session and when you restore it with a single click it’ll open all the files in the same tab order as you saved them.
|
||||
|
||||
Similarly, you can extend Kate by adding plugins using its built-in plugin manager. In addition to the impressive projects plugins, some others that will be of use to developers include an embedded terminal, ability to compile and debug code and execute SQL queries on databases.
|
||||
|
||||
Plugins for Sublime are written in Python, and the text editor includes a tool called Package Control, which is a little bit like apt-get in that it enables the user to find, install, upgrade and remove plugin packages. With plugins, you can bring the Git version control to Sublime, as well as the JSLint tool to improve JavaScript. The Sublime Linter plugin is a must have for coders and will point out any errors in your code.
|
||||
|
||||
jEdit boasts the most impressive plugin infrastructure. The app has over 200 plugins, which can be browsed in the dedicated site of their own. The website lists plugins under various categories such as File Management, Version Control, Text, etc. You’ll find lots of plugins housed under each category.
|
||||
|
||||
Some of the best plugins are the Android plugin, which provides utilities to work on Android projects; the TomcatSwitch plugin, using which you can create and control an external Jakarta Tomcat server process; and the Vimulator plugin, for Vi-like capabilities. You can install these plugins using jEdit’s using its plugin manager.
|
||||
|
||||
**Verdict**
|
||||
|
||||
- Gedit: 3/5
|
||||
- Kate: 4/5
|
||||
- Sublime: 4/5
|
||||
- UltraEdit: 1/5
|
||||
- jEdit: 5/5
|
||||
|
||||
### Plain ol’ text editing ###
|
||||
|
||||
Despite all their powerful extra-curricular activities that might even displace full-blown apps across several genres, there will be times when you just need to use these text editing behemoths to read, write, or edit plain and simple text. While you can use all of them to enter text, we are evaluating them for access to common text-editing conveniences.
|
||||
|
||||
Gedit which is Gnome’s default text editor, supports an undo and redo mechanism as well as search and replace. It can spellcheck documents in multiple languages and can also access and edit remote files using Gnome GVFS libraries.
|
||||
|
||||
You can spellcheck documents with Kate as well, which also lets you perform a Google search on any highlighted text. It’s also got a line modification system which visually alerts users of lines which have modified and unsaved changes in a file. In addition, it enables users to set bookmarks within a file to ease navigation of lengthy documents.
|
||||
|
||||
Sublime has a wide selection of editing commands, such as indenting text and formatting paragraphs. Its auto-save feature helps prevent users from losing their work. Advanced users will appreciate the regex-based recursive find and replace feature, as well as the ability to select multiple non-contiguous spans of text and act on them collectively.
|
||||
|
||||
UltraEdit also enables the use of regular expressions for its search and replace feature and can edit remote files via FTP. One unique feature of jEdit is its support for an unlimited number of clipboard which it calls registers. You can copy snippets of text to these registers which are available across editing sessions.
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit: 4/5
|
||||
- Kate: 5/5
|
||||
- Sublime: 5/5
|
||||
- UltraEdit: 4/5
|
||||
- jEdit: 4/5
|
||||
|
||||
### Our verdict ###
|
||||
|
||||
All the editors in this feature are good enough to replace your existing text editor for editing text files and tweaking configuration files. In fact, chances are they’ll even double up as your IDE. These apps are chock full of bells and whistles, and their developers aren’t thinking of stripping features, but adding more and more and more.
|
||||
|
||||
At the tail end of this test we have jEdit. Not only does it insist on using the proprietary Oracle Java Runtime Environment, it failed to install on our Fedora machine, and the developer doesn’t actively engage with its users.
|
||||
|
||||
UltraEdit does little better. This commercial proprietary tool focuses on web developers, and doesn’t offer anything to non-developer power users that makes it worth recommending over free software alternatives.
|
||||
|
||||
On the third podium position we have Gedit. There’s nothing inherently wrong with Gnome’s default editor, but despite all its positive aspects, it’s simply outclassed by Sublime and Kate. Out of the box, Kate is a more versatile editor than Gedit, and outscores Gnome’s default editor even after taking their respective plugin systems into consideration.
|
||||
|
||||
Both Sublime and Kate are equally good. They performed equally well in most of our tests. Whatever ground it lost to Sublime for not supporting macros, it gained for its keyboard friendliness and its ease of use in defining custom keybindings.
|
||||
|
||||
Kate’s success can be drawn from the fact that it offers the maximum number of features with minimal learning curve. Just fire it up and use it as a simple text editor, or easily edit configuration file with syntax highlighting, or even use it to collaborate and work on a complex programming project thanks to its project management capabilities.
|
||||
|
||||
We aren’t pitching Kate to replace a full-blown integrated development environment such as [insert your favourite specialised tool here]. But it’s an ideal all-rounder and a perfect stepping stone to a specialised tool.
|
||||
|
||||
Kate is designed for moments when you need something that’s quick to respond, doesn’t overwhelm you with its interface and is just as useful as something that might otherwise be overkill.
|
||||
|
||||
### 1st Kate ###
|
||||
|
||||
- Licence LGPL/GPL Version 3.11
|
||||
- www.kate-editor.org
|
||||
- The ultimate mild-mannered text editor with super powers.
|
||||
- Kate is one of the best apps to come out of the KDE project.
|
||||
|
||||
### 2nd Sublime Text ###
|
||||
|
||||
- Licence Proprietary Version 2.0.2
|
||||
- www.sublimetext.com
|
||||
- A professionally done text editor that’s worth every penny – easy to use, full of features and it looks great.
|
||||
|
||||
### 3rd Gedit ###
|
||||
|
||||
- Licence GPL Version 3.10
|
||||
- http://projects.gnome.org/gedit
|
||||
- Gets it done from Gnome. It’s a wonderful text editor and does an admirable job, but the competition here is too great.
|
||||
|
||||
### 4th UltraEdit ###
|
||||
|
||||
- Licence Proprietary Version 4.1.0.4
|
||||
- www.ultraedit.com
|
||||
- Focuses on bundling conveniences for web developers without offering anything special for general users.
|
||||
|
||||
### 5th jEdit ###
|
||||
|
||||
- Licence GPL Version 5.1.0
|
||||
- www.jedit.org
|
||||
- A lack of support, lack of working on Fedora and a lack of looking nice relegate jEdit to the bottom slot.
|
||||
|
||||
### You may also wish to try… ###
|
||||
|
||||
The default text editor that ships with your distro will also be able to assist you with some advanced tasks. There’s KDE’s KWrite and Raspbian’s Nano, for instance. KWrite inherits some of Kate’s features thanks to KDE’s katepart component, and Nano has sprung back into limelight thanks to its availability for Raspberry Pi.
|
||||
|
||||
If you wish to follow the steps of Linux gurus, you could always try the revered text editors Emacs and Vim. First time users who want to get a taste for the power of Vim might want to consider gVim, which exposes Vim’s power via a graphical interface.
|
||||
|
||||
Besides jEdit and Kate, there are other editors that mimic the usability of veteran advanced editors like Emacs and Vim, such as the JED editor and Joe’s Own Editor, both of which have an emulation mode for Emacs. On the other hand, if you are looking for lightweight code editors check out Bluefish and Geany. They exist to fill the niche between text editors and full-fledged integrated development platforms.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxvoice.com/text-editors/
|
||||
|
||||
作者:[Ben Everard][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxvoice.com/author/ben_everard/
|
@ -1,55 +0,0 @@
|
||||
Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative
|
||||
================================================================================
|
||||
![Rain is a soothing sound for some](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/raining-1600x900-wallpaper_www.wallpapermay.com_84-1.jpg)
|
||||
Rain is a soothing sound for some
|
||||
|
||||
**If I plan on being productive I can’t listen to ‘regular’ music. It distracts me. I start singing along or get reminded of a different track, so end up poking around my library and… Well, that’s that.**
|
||||
|
||||
But by the same token I can’t work in silence (living with 6 cats means that’s not a possibility, though) but the inconsistency jars and sudden clatters and meows interrupt.
|
||||
|
||||
My solution that is to **listen to ambient noise**.
|
||||
|
||||
I find it helps nullify the misdirection my brain craves, land provide a soundscape that wraps the noise of kitty play time.
|
||||
|
||||
Ambient noise is the noise that play out in the background of daily lives; the rain drumming on a window, the intelligible hum of coffee shop chatter, the gossiping of birds on the wind, and so on.
|
||||
|
||||
Listening to these sounds can force a racing mind to slow down, rebase and refocus on what matters.
|
||||
|
||||
### Ambient Noise App for Ubuntu ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/ambient-noise-player-750x365.jpg)
|
||||
|
||||
Google Play and Apple app stores are packed full of ambient and white noise apps. Now a similar tool is available natively on Ubuntu.
|
||||
|
||||
‘[Ambient Noise][1]‘ — as the name might suggest — is an audio player designed specifically for playing these sounds. It even integrates with the Ubuntu Sound Menu for a neat ‘pick, click and relax’ experience.
|
||||
|
||||
The app, which is also known as ‘ANoise Player’ and is made by Marcos Costales, comes with a set of **8 high-quality sounds**.
|
||||
|
||||
These 8 presets cover various ambient atmospheres, ranging from the rhythmic sound of rain, to the tranquil tones of nature at night, and back to the buzz of a bustling coffee shop in the afternoon.
|
||||
|
||||
### Install ANoise Player in Ubuntu ###
|
||||
|
||||
Ambient Noise player for Ubuntu is a free application and is available to install from its own dedicated PPA.
|
||||
|
||||
To do this open a new Terminal window and run:
|
||||
|
||||
sudo add-apt-repository ppa:costales/anoise
|
||||
|
||||
sudo apt-get update && sudo apt-get install anoise
|
||||
|
||||
Once installed simply open it from the Unity Dash (or your DE’s equivalent), pick your preferred noise using Sound Menu and then …relax! The app even remembers which sound you used last.
|
||||
|
||||
Even so, give it a try out and see if it suits your needs. I would say let me know what you think, but I will be too focused to hear — and so might you!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/04/ambient-noise-player-app-for-ubuntu-linux
|
||||
|
||||
作者:[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://anoise.tuxfamily.org/
|
@ -1,40 +0,0 @@
|
||||
This tool can alert you about evil twin access points in the area
|
||||
================================================================================
|
||||
**EvilAP_Defender can even attack rogue Wi-Fi access points for you, the developer says**
|
||||
|
||||
A new open-source tool can periodically scan an area for rogue Wi-Fi access points and can alert network administrators if any are found.
|
||||
|
||||
The tool, called EvilAP_Defender, was designed specifically to detect malicious access points that are configured by attackers to mimic legitimate ones in order to trick users to connect to them.
|
||||
|
||||
These access points are known as evil twins and allow hackers to intercept Internet traffic from devices connected to them. This can be used to steal credentials, spoof websites, and more.
|
||||
|
||||
Most users configure their computers and devices to automatically connect to some wireless networks, like those in their homes or at their workplace. However, when faced with two wireless networks that have the same name, or SSID, and sometimes even the same MAC address, or BSSID, most devices will automatically connect to the one that has the stronger signal.
|
||||
|
||||
This makes evil twin attacks easy to pull off because both SSIDs and BSSIDs can be spoofed.
|
||||
|
||||
[EvilAP_Defender][1] was written in Python by a developer named Mohamed Idris and was published on GitHub. It can use a computer's wireless network card to discover rogue access points that duplicate a real access point's SSID, BSSID, and even additional parameters like channel, cipher, privacy protocol, and authentication.
|
||||
|
||||
The tool will first run in learning mode, so that the legitimate access point [AP] can be discovered and whitelisted. It can then be switched to normal mode to start scanning for unauthorized access points.
|
||||
|
||||
If an evil AP is discovered, the tool can alert the network administrator by email, but the developer also plans to add SMS-based alerts in the future.
|
||||
|
||||
There is also a preventive mode in which the tool can launch a denial-of-service [DoS] attack against the evil AP to buy the administrator some time to take defensive measures.
|
||||
|
||||
"The DoS will only be performed for evil APs which have the same SSID but a different BSSID (AP's MAC address) or run on a different channel," Idris said in the tool's documentation. "This is to avoid attacking your legitimate network."
|
||||
|
||||
However, users should remember that attacking someone else's access point, even a likely malicious one operated by an attacker, is most likely illegal in many countries.
|
||||
|
||||
In order to run, the tool needs the Aircrack-ng wireless suite, a wireless card supported by Aircrack-ng, MySQL and the Python runtime.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.infoworld.com/article/2905725/security0/this-tool-can-alert-you-about-evil-twin-access-points-in-the-area.html
|
||||
|
||||
作者:[Lucian Constantin][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/Lucian-Constantin/
|
||||
[1] https://github.com/moha99sa/EvilAP_Defender/blob/master/README.TXT
|
@ -0,0 +1,37 @@
|
||||
uperTuxKart 0.9 Released — The Best Racing Game on Linux Just Got Even Better
|
||||
================================================================================
|
||||
**A brand new version of the hugely popular racing game SuperTuxKart has [zipped past the release line][1] to land on download servers. **
|
||||
|
||||
![Super Tux Kart 0.9 Release Poster](http://1.bp.blogspot.com/-eGXvJu3UVwc/VTVhICZVEtI/AAAAAAAAAf0/iP2bkWDNf_c/s1600/poster-cropped.jpg)
|
||||
Super Tux Kart 0.9 Release Poster
|
||||
|
||||
SuperTuxKart 0.9 is a huge update over earlier versions, running a hot new engine (awesomely named ‘Antarctica’) under the hood that aims to deliver richer graphical environments , shading and depth of field plus better kart physics.
|
||||
|
||||
The bump in graphics performance necessitates a bump in graphics card requirements, too. SuperTuxKart developers advise would-be racers to will need a device with graphics comparable to (or, ideally, better than) Intel HD Graphics 3000, NVIDIA GeForce 8600 or AMD Radeon HD 3650.
|
||||
|
||||
### Other Changes ###
|
||||
|
||||
Keeping pace alongside the headline visual improvements in SuperTuxKart 0.9 is pair **brand new tracks**, new Karts, new online accounts for keeping track of and sharing badges earned through the **newly introduced achievements system**, and oodles of fixes and artwork tweaks.
|
||||
|
||||
Check out STK 0.9 in all its shader-based glory by hitting play on the official release video below.
|
||||
|
||||
注:youtube 视频
|
||||
<iframe width="750" height="422" frameborder="0" allowfullscreen="" src="https://www.youtube.com/embed/0FEwDH7XU9Q?feature=oembed"></iframe>
|
||||
|
||||
Ubuntu users can grab pre-compiled binaries for the new release from the project website.
|
||||
|
||||
- [Download SuperTuxKart 0.9][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/04/supertuxkart-0-9-released
|
||||
|
||||
作者:[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://supertuxkart.blogspot.co.uk/2015/04/supertuxkart-09-released.html
|
||||
[2]:http://supertuxkart.sourceforge.net/Downloads
|
@ -1,141 +0,0 @@
|
||||
translating wi-cuckoo
|
||||
10 Famous IT Skills in Demand That Will Get You Hired
|
||||
================================================================================
|
||||
In continuation of our last article [[Top 10 Operating Systems in demand][1]] which was highly appreciated by the Tecmint community, we here in this article aims at throwing light on top IT skills that will help you land to your dream job.
|
||||
|
||||
As mentioned in the first article these data and statistics are supposed to be change with the change in demand and market. We will try our best to update the list whenever there is any major changes. All the statistics are produced on the basis of close study of Job boards, postings and requirements by several IT companies across the globe.
|
||||
|
||||
### 1. VMware ###
|
||||
|
||||
The visualization and cloud computing software designed by Vmware Inc. tops the List. Vmware claims to commercially virtualize x86 architecture for the first time. VMware demand has increased upto 16% in the last quarter.
|
||||
|
||||
Latest stable Release: 11.0
|
||||
|
||||
### 2. MySQL ###
|
||||
|
||||
The open source Relational Database Management System falls second in the list. Until 2013 it was the second most widely used RDBMS. MySQL demand has increased upto 11% in the last quarter. The very famous MariaDB has been forked out of MySQL after Oracle Corp. Owned it.
|
||||
|
||||
Latest Stable Release : 5.6.23
|
||||
|
||||
### 3. Apache ###
|
||||
|
||||
The open source cross platform web (HTTP) server stands third in the list. Apache demand has increased to more than 13% in the last quarter.
|
||||
|
||||
Latest Stable Release : 2.4.12
|
||||
|
||||
### 4. AWS ###
|
||||
|
||||
Amazon web services is a collection of remote computing services offered by Amazon.com. Aws made to the list at number four. AWS demand has shown a growth of nearly 14% in the last quarter.
|
||||
|
||||
### 5. Puppet ###
|
||||
|
||||
The configuration Management System used in setting up IT Infrastructure comes at number five. It is written in Ruby and follows Client-server architecture. The demand of puppet has grown above 9% in the last quarter.
|
||||
|
||||
Latest Stable Release : 3.7.3
|
||||
|
||||
### 6. Hadoop ###
|
||||
|
||||
Hadoop is a open source software framework written in Java to process big data. It stands at position six in the list. The demand of Hadoop has gone upto 0.2% in the last quarter.
|
||||
|
||||
Latest Stable Release : 2.6.0
|
||||
|
||||
### 7. Git ###
|
||||
|
||||
The famous distributed control system written initially by Linus Torvalds made to the list at number seven. The demand of Git has gone above 7% in the last quarter.
|
||||
|
||||
Latest Stable Release : 2.3.4
|
||||
|
||||
### 8. Oracle PL/SQL ###
|
||||
|
||||
The procedural extension for SQL by Oracle corp. stands at position eight. PL/SQL is included in Oracle Database since Oracle 7. It has shown a decline of nearly 8% in the last quarter.
|
||||
|
||||
### 9. Tomcat ###
|
||||
|
||||
Open source web server and servlet container comes at position number nine. It has shown a growth in demand of nearly 15% in the last quarter.
|
||||
|
||||
Latest Stable Release : 8.0.15
|
||||
|
||||
### 10. SAP ###
|
||||
|
||||
The most famous Enterprise Resource Planning Software stands at position ten. The demand of SAP has shown a growth of nearly 3.5% in last quarter.
|
||||
|
||||
注:表格数据,不需要翻译-开始
|
||||
<table cellspacing="0" cellpadding="5" style="width: 804px;">
|
||||
<colgroup>
|
||||
<col width="88">
|
||||
<col width="427">
|
||||
<col width="257">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;">1.
|
||||
</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;">VMware</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border: 1px solid #000000; padding: 0.1cm;"><span style="color: #006600;"><b>16% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">2.
|
||||
</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">MySQL</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>11% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">3.</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Apache</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>13% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">4.
|
||||
</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Amazon web services (AWS)</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>14% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">5.
|
||||
</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Puppet</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>9% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">6.</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Hadoop</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>0.2% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">7.</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Git</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>7% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">8.</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Oracle PL/SQL</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: red;"><b>8% -</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="88" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">9.</td>
|
||||
<td width="427" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">Tomcat</td>
|
||||
<td width="257" bgcolor="#eeeeee" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>15% +</b></span></td>
|
||||
</tr>
|
||||
<tr valign="top" class="alt">
|
||||
<td width="88" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">10.</td>
|
||||
<td width="427" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;">SAP</td>
|
||||
<td width="257" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;"><span style="color: #006600;"><b>3.5% +</b></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
注:表格数据,不需要翻译-结束
|
||||
|
||||
That’s all for now. I’ll be here with the next part of the series following. Till then stay tuned. Stay Connected. Stay Commenting. Don’t forget to provide us with your feedback. Like and share us and help us get spread.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/famous-it-skills-in-demand-that-will-get-you-hired/
|
||||
|
||||
作者:[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/top-distributions-in-demand-to-get-your-dream-job/
|
@ -1,104 +0,0 @@
|
||||
【translating】The history of Android
|
||||
================================================================================
|
||||
![](http://cdn.arstechnica.net/wp-content/uploads/2014/03/ready-fight.png)
|
||||
|
||||
### Android 2.1, update 1—the start of an endless war ###
|
||||
|
||||
Google was a major launch partner for the first iPhone—the company provided Google Maps, Search, and YouTube for Apple’s mobile operating system. At the time, Google CEO Eric Schmidt was a member of Apple’s board of directors. In fact, during the original iPhone presentation, [Schmidt was the first person on stage][] after Steve Jobs, and he joked that the two companies were so close they could merge into “AppleGoo."
|
||||
|
||||
While Google was developing Android, the relationship between the two companies slowly became contentious. Still, Google largely kept Apple happy by keeping key iPhone features, like pinch zoom, out of Android. The Nexus One, though, was the first slate-style Android flagship without a keyboard, which gave the device the same form factor as the iPhone. Combined with the newer software and Google branding, this was the last straw for Apple. According to Walter Isaacson’s biography on Steve Jobs, after seeing the Nexus One in January 2010, the Apple CEO was furious, saying "I will spend my last dying breath if I need to, and I will spend every penny of Apple's $40 billion in the bank, to right this wrong... I'm going to destroy Android, because it's a stolen product. I'm willing to go thermonuclear war on this."
|
||||
|
||||
All of this happened behind closed doors, only coming out years after the Nexus One was released. The public first caught wind of this growing rift between Google and Apple when, a month after the release of Android 2.1, an update shipped for the Nexus One called “[2.1 update 1.][2]" The updated added one feature, something iOS long held over the head of Android: pinch-zoom.
|
||||
|
||||
While Android supported multi-touch APIs since version 2.0, the default operating system apps stayed clear of this useful feature at the behest of Jobs. After reconciliation meetings over the Nexus One failed, there was no longer a reason to keep pinch zoom out of Android. Google pushed all their chips into the middle of the table, hit the update button, and was finally “all-in" with Android.
|
||||
|
||||
With pinch zoom enabled in Google Maps, the Browser, and the Gallery, the Google-Apple smartphone war was on. In the coming years, the two companies would become bitter enemies. A month after the pinch zoom update, Apple went on the warpath, suing everyone and everything that used Android. HTC, Motorola, and Samsung were all brought to court, and some of them are still in court. Schmidt resigned from Apple’s board of directors. Google Maps and YouTube were kicked off of the iPhone, and Apple even started a rival mapping service. Today, the two players that were almost "AppleGoo" compete in smartphones, tablets, laptops, movies, TV shows, music, books, apps, e-mail, productivity software, browsers, personal assistants, cloud storage, mobile advertising, instant messaging, mapping, and set-top-boxes... and soon the two will be competing in car computers, wearables, mobile payments, and living room gaming.
|
||||
|
||||
### Android 2.2 Froyo—faster and Flash-ier ###
|
||||
|
||||
[Android 2.2][3] came out four months after the release of 2.1, in May 2010. Froyo featured major under-the-hood improvements for Android, all made in the name of speed. The biggest addition was just-in-time (JIT) compilation. JIT automatically converted java bytecode into native code at runtime, which led to drastic performance improvements across the board.
|
||||
|
||||
The Browser got a performance boost, too, thanks to the integration of the V8 javascript engine from Chrome. This was the first of many features the Android browser would borrow from Chrome, and eventually the stock browser would be completely replaced by a mobile version of Chrome. Until that day came, though, the Android team needed to ship a browser. Pulling in Chrome parts was an easy way to upgrade.
|
||||
|
||||
While Google was focusing on making its platform faster, Apple was making its platform bigger. Google's rival released the 10-inch iPad a month earlier, ushering in the modern era of tablets. While some large Froyo and Gingerbread tablets were released, Google's official response—Android 3.0 Honeycomb and the Motorola Xoom—would not arrive for nine months.
|
||||
|
||||
![Froyo added a two-icon dock at the bottom and universal search.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/22-2.png)
|
||||
Froyo added a two-icon dock at the bottom and universal search.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The biggest change on the Froyo homescreen was the new dock at the bottom, which filled the previously empty space to the left and right of the app drawer with phone and browser icons. Both of these icons were custom-designed white versions of the stock icons, and they were not user-configurable.
|
||||
|
||||
The default layout removed all the icons, and it only stuck the new tips widget on the screen, which directed you to click on the launcher icon to access your apps. The Google Search widget gained a Google logo which doubled as a button. Tapping it would open the search interface and allow you to restrict a search by Web, apps, or contacts.
|
||||
|
||||
![The downloads page showing the “update all" button, the Flash app, a flash-powered site where anything is possible, and the “move to SD" button. ](http://cdn.arstechnica.net/wp-content/uploads/2014/03/small-market-2.jpg)
|
||||
The downloads page showing the “update all" button, the Flash app, a flash-powered site where anything is possible, and the “move to SD" button.
|
||||
Photo by [Ryan Paul][4]
|
||||
|
||||
Some of the best additions to Froyo were more download controls for the Android Market. There was now an “Update all" button pinned to the bottom of the Downloads page. Google also added an automatic updating feature, which would automatically install apps as long as the permissions hadn't changed; automatic updating was off by default, though.
|
||||
|
||||
The second picture shows Adobe Flash Player, which was exclusive to Froyo. The app plugged in to the browser and allowed for a “full Web" experience. In 2010, this meant pages heavy with Flash navigation and video. Flash was one of Android's big differentiators compared to the iPhone. Steve Jobs started a holy war against Flash, declaring it an obsolete, buggy piece of software, and Apple would not allow it on iOS. So Android picked up the Flash ball and ran with it, giving users the option of having a semi-workable implementation on Android.
|
||||
|
||||
At the time, Flash could bring even a desktop computer to its knees, so keeping it on all the time on a mobile phone delivered terrible performance. To fix this, Flash on Android's browser could be set to "on-demand"—Flash content would not load until users clicked on the Flash placeholder icon. Flash support would last on Android until 4.1, when Adobe gave up and killed the project. Ultimately Flash never really worked well on Android. The lack of Flash on the iPhone, the most popular mobile device, pushed the Internet to eventually dump the platform.
|
||||
|
||||
The last picture shows the newly added ability to move apps to the SD card, which, in an era when phones came with 512MB of internal storage, was sorely needed.
|
||||
|
||||
![The car app and camera app. The camera could now rotate.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/22carcam-2.png)
|
||||
The car app and camera app. The camera could now rotate.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The camera app was finally updated to support portrait mode. The camera settings were moved out of the drawer and into a semi-transparent strip of buttons next to the shutter button and other controls. This new design seemed to take a lot of inspiration from the Cooliris Gallery app, with transparent, springy speech bubble popups. It was quite strange to see the high-tech Cooliris-style UI design grafted on to the leather-bound camera app—the aesthetics didn't match at all.
|
||||
|
||||
![The semi-broken Facebook app is a good example of the common 2x3 navigation page. Google Goggles was included but also broken.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/facebook.png)
|
||||
The semi-broken Facebook app is a good example of the common 2x3 navigation page. Google Goggles was included but also broken.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
Unlike the Facebook client included in Android 2.0 and 2.1, the 2.2 version still sort of works and can sign in to Facebook's servers. The Facebook app is a good example of Google's design guidelines for apps at the time, which suggested having a navigational page consisting of a 3x2 grid of icons as the main page of an app.
|
||||
|
||||
This was Google's first standardized attempt at getting navigational elements out of the menu button and onto the screen, where users could find them. This design was usable, but it added an extra roadblock between launching an app and using an app. Google would later realize that when users launch an app, it was a better idea to show them content instead of an interstitial navigational screen. In Facebook for instance, opening to the news feed would be much more appropriate. And later app designs would relegate navigation to a second-tier location—first as tabs at the top of the screen, and later Google would settle on the "Navigation Drawer," a slide-out panel containing all the locations in an app.
|
||||
|
||||
Also packed in with Froyo was Google Goggles, a visual search app which would try to identify the subject of a picture. It was useful for identifying works of art, landmarks, and barcodes, but not much else. These first two setup screens, along with the camera interface, are all that work in the app anymore. Today, you can't actually complete a search with a client this old. There wasn't much to see anyway; it was a camera interface that returned a search results page.
|
||||
|
||||
![The Twitter app, which was an animation-filled collaboration between Google and Twitter.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/twitters-2.png)
|
||||
The Twitter app, which was an animation-filled collaboration between Google and Twitter.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
Froyo included the first Android Twitter app, which was actually a collaboration between Google and Twitter. At the time, a Twitter app was one of the big holes in Android's app lineup. Developers favored the iPhone, and with Apple's head start and stringent design requirements, the App Store's app selection was far superior to Android's. But Google needed a Twitter app, so it teamed up with the company to get the first version out the door.
|
||||
|
||||
This represented Google's newer design language, which meant it had an interstitial navigation page and a "tech-demo" approach to animations. The Twitter app was even more heavy-handed with animation effects than the Cooliris Gallery—everything moved all the time. The clouds at the top and bottom of every page continually scrolled at varying speeds, and the Twitter bird at the bottom flapped its wings and moved its head left and right.
|
||||
|
||||
The Twitter app actually featured an early precursor to the Action Bar, a persistent strip of top-aligned controls that was introduced in Android 3.0 . Along the top of every screen was a blue bar containing the Twitter logo and buttons like search, refresh, and compose tweet. The big difference between this and the later action bars was that the Twitter/Google design lacks an "Up" button in the top right corner, and it actually uses an entire second bar to show your current location within the app. In the second picture above, you can see a whole bar dedicated to the location label "Tweets" (and, of course, the continuously scrolling clouds). The Twitter logo in the second bar acted as another navigational element, sometimes showing additional drill down areas within the current section and sometimes showing the entire top-level shortcut group.
|
||||
|
||||
The 2.3 Tweet stream didn't look much different from what it does today, save for the hidden action buttons (reply, retweet, etc), which were all under the right-aligned arrow buttons. They popped up in a speech bubble menu that looked just like the navigational popup. The faux-action bar was doing serious work on the create tweet page. It housed the twitter logo, remaining character count, and buttons to attach a picture, take a picture, and a contact mention button.
|
||||
|
||||
The Twitter app even came with a pair of home screen widgets. The big one took up eight slots and gave you a compose bar, update button, one tweet, and left and right arrows to view more tweets. The little one showed a tweet and reply button. Tapping on the compose bar on the large widget immediately launched the main "Create Tweet," rendering the "update" button worthless.
|
||||
|
||||
![Google Talk and the new USB dialog.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/talkusb.png)
|
||||
Google Talk and the new USB dialog.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
Elsewhere, Google Talk (and the unpictured SMS app) changed from a dark theme to a light theme, which made both of them look a lot closer to the current, modern apps. The USB storage screen that popped up when you plugged into a computer changed from a simple dialog box to a full screen interface. Instead of a text-only design, the screen now had a mutant Android/USB-stick hybrid.
|
||||
|
||||
While Android 2.2 didn’t feature much in the way of user-facing features, a major UI overhaul was coming in the next two versions. Before all the UI work, though, Google wanted to revamp the core of Android. Android 2.2 accomplished that.
|
||||
|
||||
----------
|
||||
|
||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||
|
||||
[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.
|
||||
|
||||
[@RonAmadeo][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/13/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.youtube.com/watch?v=9hUIxyE2Ns8#t=3016
|
||||
[2]:http://arstechnica.com/gadgets/2010/02/googles-nexus-one-gets-multitouch/
|
||||
[3]:http://arstechnica.com/information-technology/2010/07/android-22-froyo/
|
||||
[4]:http://arstechnica.com/information-technology/2010/07/android-22-froyo/
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -1,106 +0,0 @@
|
||||
FSSlc translating
|
||||
|
||||
How to Generate/Encrypt/Decrypt Random Passwords in Linux
|
||||
================================================================================
|
||||
We have taken initiative to produce Linux tips and tricks series. If you’ve missed the last article of this series, you may like to visit the link below.
|
||||
|
||||
注:此篇文章做过原文
|
||||
- [5 Interesting Command Line Tips and Tricks in Linux][1]
|
||||
|
||||
In this article, we will share some interesting Linux tips and tricks to generate random passwords and also how to encrypt and decrypt passwords with or without slat method.
|
||||
|
||||
Security is one of the major concern of digital age. We put on password to computers, email, cloud, phone, documents and what not. We all know the basic to choose the password that is easy to remember and hard to guess. What about some sort of machine based password generation automatically? Believe me Linux is very good at this.
|
||||
|
||||
**1. Generate a random unique password of length equal to 10 characters using command ‘pwgen‘. If you have not installed pwgen yet, use Apt or YUM to get.**
|
||||
|
||||
$ pwgen 10 1
|
||||
|
||||
![Generate Random Unique Password](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Unique-Password-in-Linux.gif)
|
||||
Generate Random Unique Password
|
||||
|
||||
Generate several random unique passwords of character length 50 in one go!
|
||||
|
||||
$ pwgen 50
|
||||
|
||||
![Generate Multiple Random Passwords](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Multiple-Random-Passwords.gif)
|
||||
Generate Multiple Random Passwords
|
||||
|
||||
**2. You may use ‘makepasswd‘ to generate random, unique password of given length as per choice. Before you can fire makepasswd command, make sure you have installed it. If not! Try installing the package ‘makepasswd’ using Apt or YUM.**
|
||||
|
||||
Generate a random password of character length 10. Default Value is 10.
|
||||
|
||||
$ makepasswd
|
||||
|
||||
![makepasswd Generate Unique Password](http://www.tecmint.com/wp-content/uploads/2015/03/mkpasswd-generate-unique-password.gif)
|
||||
makepasswd Generate Unique Password
|
||||
|
||||
Generate a random password of character length 50.
|
||||
|
||||
$ makepasswd --char 50
|
||||
|
||||
![Generate Length 50 Password](http://www.tecmint.com/wp-content/uploads/2015/03/Random-Password-Generate.gif)
|
||||
Generate Length 50 Password
|
||||
|
||||
Generate 7 random password of 20 characters.
|
||||
|
||||
$ makepasswd --char 20 --count 7
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-20-Character-Password.gif)
|
||||
|
||||
**3. Encrypt a password using crypt along with salt. Provide salt manually as well as automatically.**
|
||||
|
||||
For those who may not be aware of salt,
|
||||
|
||||
Salt is a random data which servers as an additional input to one way function in order to protect password against dictionary attack.
|
||||
|
||||
Make sure you have installed mkpasswd installed before proceeding.
|
||||
|
||||
The below command will encrypt the password with salt. The salt value is taken randomly and automatically. Hence every time you run the below command it will generate different output because it is accepting random value for salt every-time.
|
||||
|
||||
$ mkpasswd tecmint
|
||||
|
||||
![Encrypt Password Using Crypt](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-Password-in-Linux.gif)
|
||||
Encrypt Password Using Crypt
|
||||
|
||||
Now lets define the salt. It will output the same result every-time. Note you can input anything of your choice as salt.
|
||||
|
||||
$ mkpasswd tecmint -s tt
|
||||
|
||||
![Encrypt Password Using Salt](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-Password-Using-Salt.gif)
|
||||
Encrypt Password Using Salt
|
||||
|
||||
Moreover, mkpasswd is interactive and if you don’t provide password along with the command, it will ask password interactively.
|
||||
|
||||
**4. Encrypt a string say “Tecmint-is-a-Linux-Community” using aes-256-cbc encryption using password say “tecmint” and salt.**
|
||||
|
||||
# echo Tecmint-is-a-Linux-Community | openssl enc -aes-256-cbc -a -salt -pass pass:tecmint
|
||||
|
||||
![Encrypt A String in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-A-String-in-Linux.gif)
|
||||
Encrypt A String in Linux
|
||||
|
||||
Here in the above example the output of 注:此篇原文也做过[echo command][2] is pipelined with openssl command that pass the input to be encrypted using Encoding with Cipher (enc) that uses aes-256-cbc encryption algorithm and finally with salt it is encrypted using password (tecmint).
|
||||
|
||||
**5. Decrypt the above string using openssl command using the -aes-256-cbc decryption.**
|
||||
|
||||
# echo U2FsdGVkX18Zgoc+dfAdpIK58JbcEYFdJBPMINU91DKPeVVrU2k9oXWsgpvpdO/Z | openssl enc -aes-256-cbc -a -d -salt -pass pass:tecmint
|
||||
|
||||
![Decrypt String in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Decrypt-String-in-Linux.gif)
|
||||
Decrypt String in Linux
|
||||
|
||||
That’s all for now. If you know any such tips and tricks you may send us your tips at admin@tecmint.com, your tip will be published under your name and also we will include it in our future article.
|
||||
|
||||
Keep connected. Keep Connecting. Stay Tuned. Don’t forget to provide us with your valuable feedback in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/generate-encrypt-decrypt-random-passwords-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/5-linux-command-line-tricks/
|
||||
[2]:http://www.tecmint.com/echo-command-in-linux/
|
@ -1,3 +1,5 @@
|
||||
translating by createyuan
|
||||
|
||||
How to set up remote desktop on Linux VPS using x2go
|
||||
================================================================================
|
||||
As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on.
|
||||
@ -134,4 +136,4 @@ via: http://xmodulo.com/x2go-remote-desktop-linux.html
|
||||
[5]:http://wiki.x2go.org/doku.php/doc:newtox2go
|
||||
[6]:http://wiki.x2go.org/doku.php/doc:de-compat
|
||||
[7]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[8]:http://xmodulo.com/go/digitalocean
|
||||
[8]:http://xmodulo.com/go/digitalocean
|
||||
|
@ -1,105 +0,0 @@
|
||||
A Walk Through Some Important Docker Commands
|
||||
================================================================================
|
||||
Hi everyone today we'll learn some important Docker Commands that you'll need to learn before you go with Docker. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider.
|
||||
|
||||
Docker commands are easy to learn and easy to implement or take into practice. Here are some easy Docker commands you'll need to know to run Docker and fully utilize it.
|
||||
|
||||
### 1. Pulling a Docker Image ###
|
||||
|
||||
First of all, we'll need to pull a docker image to get started cause containers are built using Docker Images. We can get the required docker image from the Docker Registry Hub. Before we pull any image using pull command, we'll need to protect our system as there is identified a malicious issue with pull command. To protect our system from this issue, we'll need to add **127.0.0.1 index.docker.io** into /etc/hosts entry. We can do using our favorite text editor.
|
||||
|
||||
# nano /etc/hosts
|
||||
|
||||
Now, add the following lines into it and then save and exit.
|
||||
|
||||
127.0.0.1 index.docker.io
|
||||
|
||||
![Docker Hosts](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-hosts.png)
|
||||
|
||||
To pull a docker image, we'll need to run the following command.
|
||||
|
||||
# docker pull registry.hub.docker.com/busybox
|
||||
|
||||
![Docker pull command](http://blog.linoxide.com/wp-content/uploads/2015/04/pulling-image.png)
|
||||
|
||||
We can check whether any Docker image is available in our local host for the use or not.
|
||||
|
||||
# docker images
|
||||
|
||||
![Docker Images](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-images.png)
|
||||
|
||||
### 2. Running a Docker Container ###
|
||||
|
||||
Now, after we have successfully pulled a required or desired Docker image. We'll surely want to run that Docker image. We can run a docker container out of the image using docker run command. We have several options and flags to run a docker container on the top of the Docker image. To run a docker image and to get into the container we'll use -t and -i flag as shown below.
|
||||
|
||||
# docker run -it busybox
|
||||
|
||||
![Docker Run Shell Command](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-run-shell.png)
|
||||
|
||||
From the above command, we'll get entered into the container and can access its content via the interactive shell. We can press **Ctrl-D** in order to exit from the shell access.
|
||||
|
||||
Now, to run the container in background, we'll detach the shell using -d flag as shown below.
|
||||
|
||||
# docker run -itd busybox
|
||||
|
||||
![Run Container Background](http://blog.linoxide.com/wp-content/uploads/2015/04/run-container-background.png)
|
||||
|
||||
If we want to attach into a running container, we can use attach command with the container id. The container id can be fetched using the command **docker ps** .
|
||||
|
||||
# docker attach <container id>
|
||||
|
||||
![Docker Attach](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-attach.png)
|
||||
|
||||
### 3. Checking Containers ###
|
||||
|
||||
It is very easy to check the log whether the container is running or not. We can use the following command to check whether there is any docker container running in the real time or not using the following command.
|
||||
|
||||
# docker ps
|
||||
|
||||
Now, to check logs about the running or past running containers we'll need to run the following command.
|
||||
|
||||
# docker ps -a
|
||||
|
||||
![View Docker Containers](http://blog.linoxide.com/wp-content/uploads/2015/04/view-docker-containers1.png)
|
||||
|
||||
### 4. Inspecting a Docker Container ###
|
||||
|
||||
We can check every information about a Docker Container using the inspect command.
|
||||
|
||||
# docker inspect <container id>
|
||||
|
||||
![Docker Inspect](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-inspect.png)
|
||||
|
||||
### 5. Killing and Deleting Command ###
|
||||
|
||||
We can kill or stop process or docker containers using its docker id as shown below.
|
||||
|
||||
# docker stop <container id>
|
||||
|
||||
To stop every containers running, we'll need to run the following command.
|
||||
|
||||
# docker kill $(docker ps -q)
|
||||
|
||||
Now, if we wanna remove a docker image, run the below command.
|
||||
|
||||
# docker rm <container id>
|
||||
|
||||
If we wanna remove all the docker images at once, we can run the below.
|
||||
|
||||
# docker rm $(docker ps -aq)
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
These docker commands are highly essential to learn to fully utilize and use Docker. Docker gets too simple with these commands providing end users an easy platform for computing. It is extremely easy for anyone to learn about Docker commands with this above tutorial. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve and update our contents. Thank you ! Enjoy :-)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/important-docker-commands/
|
||||
|
||||
作者:[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,144 +0,0 @@
|
||||
Elementary OS 0.3 Freya Screenshots - Download and Install Guide
|
||||
================================================================================
|
||||
Elementary OS is a light weight Ubuntu based operating system which is getting wide spread popularity. It has three versions released to date whereas fourth version is decided to be developed based on upcoming Ubuntu 16.04.
|
||||
|
||||
- **Jupiter (0.1)**: It was the first stable version of Elementary OS based on Ubuntu 10.10 and released on March 2011.
|
||||
- **Luna (0.2)**: Second stable version of Elementary OS based on Ubuntu 12.04 and released on November 2012.
|
||||
- **Freya (0.3)**: Third stable version of Elementary OS based on Ubuntu 14.04 and released on 8th February 2015.
|
||||
- **Loki (0.4)**: Fourth upcoming version of Elementary OS is planned to be based on Ubuntu 16.04 it will get updates till 2021.
|
||||
|
||||
Freya is the latest version (0.3) of Elementary OS available now, initially it was given the name ISIS but it was later changed to avoid any sort of association with a terrorist group named alike. Freya has some very nice preloaded applications.
|
||||
|
||||
### Salient Features ###
|
||||
|
||||
Here are some but not all of the features of Elementary OS 0.3.
|
||||
|
||||
- Better interactive notifications along with notification setting pane including a system-wide “Do Not Disturb” mode
|
||||
- Latest version of Elementary OS provides a better emoji support & drop-in replacements for Microsoft Core fonts for the web applications
|
||||
- Privacy Mode is a new firewall tool which is easy to use and helps protect the computer from harmful scripts and applications
|
||||
- Unified login and lock screens
|
||||
- Applications menu with and improved look and functionality including quicklist actions, drag-and-drop from search, and support for quick math calculations
|
||||
- Multitasking view is redesigned to provide more app-focused utility
|
||||
- Updated software stack (Linux 3.16, Gtk 3.14, and Vala 0.26) for better support and enhanced functionality of latest developed applications
|
||||
- Unified extensible firmware interface (UEFI) support
|
||||
- WiFi connectivity made easier through new captive portal assistant
|
||||
|
||||
### Download 64 bit & 32 bit Version ###
|
||||
|
||||
- [Elementary OS Freya 64 bit][1]
|
||||
- [Elementary OS Freya 32 bit][2]
|
||||
|
||||
### Installing Elementary OS 0.3 (Freya) ###
|
||||
|
||||
Download the ISO file of Elementary OS 0.3 and flash it on a bootable USB drive or to a DVD/CD. Source is available for both 32-bit and 64-bit architectures. Once the computer is booted with the Elementary OS ISO file, there are two options available, either to try without installing or install Elementary OS on the computer, choose the second option. Elementary OS can also be installed along with an already installed operating system, turning it into a dual boot machine.
|
||||
|
||||
![Install Freya](http://blog.linoxide.com/wp-content/uploads/2015/04/Install-Freya.png)
|
||||
|
||||
System requirements and available resources are checked before proceeding further. Click continue if your system has enough resources.
|
||||
|
||||
![Installation Requirements](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-Requirements.png)
|
||||
|
||||
Installation wizard then provides various installation types. Opt for the option best suits you, normally, first option is chosen by most i.e. “Erase disk and install Elementary”. With this option make sure that your data is backed up properly because the disk (partition) will be erased and all data will be lost.
|
||||
|
||||
![Installation Types](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-Types.png)
|
||||
|
||||
A dialog box shows the list of disk partitions being formatted and used by the Elementary OS, after ensuring data integrity click continue.
|
||||
|
||||
![Format Warning](http://blog.linoxide.com/wp-content/uploads/2015/04/Format-Warning.png)
|
||||
|
||||
Choose your location for time zone selection and click continue.
|
||||
|
||||
![Location](http://blog.linoxide.com/wp-content/uploads/2015/04/Location.png)
|
||||
|
||||
Choose your language and click continue.
|
||||
|
||||
![Language](http://blog.linoxide.com/wp-content/uploads/2015/04/Language.png)
|
||||
|
||||
Fill in your information and choose a strong root/administrator password and click continue.
|
||||
|
||||
![whoareyou](http://blog.linoxide.com/wp-content/uploads/2015/04/whoareyou.png)
|
||||
|
||||
Core installation process starts once the personal information is provided, details of components being installed will be flashing on a little dialogue box along with the progress bar.
|
||||
|
||||
![Installation progress](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-progress.png)
|
||||
|
||||
Congratulation! Installation is complete for your latest Elementary OS 0.3 (Freya). A restart is required to update and finalize registries and configurations.
|
||||
|
||||
![Installation Complet](http://blog.linoxide.com/wp-content/uploads/2015/04/Installation-Complet.png)
|
||||
|
||||
At start up the Elementary OS logo shows its elegance and then password protected administrator login and guest session options will appear. Guest section has pretty limited features and has no installation privileges.
|
||||
|
||||
![Login](http://blog.linoxide.com/wp-content/uploads/2015/04/Login.png)
|
||||
|
||||
Here is the first look of the newly installed Elementary OS 0.3.
|
||||
|
||||
![first look](http://blog.linoxide.com/wp-content/uploads/2015/04/first-look.png)
|
||||
|
||||
### Customizing Desktop ###
|
||||
|
||||
While Elementary OS 0.3 is best known for their light weight and better looks, everybody has a unique esthetic sense and computer usage habits. Desktop reflects a personalized view of any computer user. Like other operating systems Elementary OS 0.3 also provides various options to customize our desktop through wallpapers, font sizes, themes etc.
|
||||
|
||||
For basic customization, click on Applications > System Settings > Desktop
|
||||
|
||||
We can change wallpapers, dock and make use of hot corners of the desktop.
|
||||
|
||||
Very few wallpapers are provided by default, more can be downloaded from the internet or transferred to your own camera.
|
||||
|
||||
![Desktop Wallpaper](http://blog.linoxide.com/wp-content/uploads/2015/04/Desktop-Wallpaper4.png)
|
||||
|
||||
The real beauty of Elementary OS lies in its elegant Dock panel. With no icons allowed at desktop, a set of application icons at the dock panel enhance the look and provide a quick way to lunch frequently used applications.
|
||||
|
||||
![Desktop Dock](http://blog.linoxide.com/wp-content/uploads/2015/04/Desktop-Dock1.png)
|
||||
|
||||
Users can use the corners of the desktop for customary purposes.
|
||||
|
||||
![Hot Corners](http://blog.linoxide.com/wp-content/uploads/2015/04/Hot-Corners.png)
|
||||
|
||||
Advanced customization can be achieved through the installation of elementary tweaks.
|
||||
|
||||
Add stable Personal Package Archive (PPA) to Advanced Package Tool (APT) repository using the following command.
|
||||
|
||||
sudo add-apt-repository ppa:mpstark/elementary-tweaks-daily
|
||||
|
||||
![ppa](http://blog.linoxide.com/wp-content/uploads/2015/04/elementary-tweaks-ppa.png)
|
||||
|
||||
Once the package has been added to the repository we need to update the repository using following command
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
![update repository](http://blog.linoxide.com/wp-content/uploads/2015/04/update-repository.png)
|
||||
|
||||
After updating the repository we are ready to install inkscape which is accomplished using the following command
|
||||
|
||||
sudo apt-get install elementary-tweaks
|
||||
|
||||
![install elementary tweaks](http://blog.linoxide.com/wp-content/uploads/2015/04/install-elementary-tweaks.png)
|
||||
|
||||
We can see an addition of Tweaks option under Applications > System Settings under the Personal section. It now provides us more options to customize our desktop view.
|
||||
|
||||
![tweaks](http://blog.linoxide.com/wp-content/uploads/2015/04/tweaks.png)
|
||||
|
||||
For further customizations we also install gnome tweak tool for example unlocking the desktop.
|
||||
|
||||
sudo apt-get install gnome-tweak-tool
|
||||
|
||||
![gnome](http://blog.linoxide.com/wp-content/uploads/2015/04/gnome.png)
|
||||
|
||||
### Summary ###
|
||||
|
||||
Elementary OS is closely related to Ubuntu distro of Linux and its pros and cons are pretty much similar too. Elementary OS is lightweight, elegant in look and feel, rapidly maturing. It is potentially an alternative for both Windows and OS X operating systems. The latest available Elementary OS 0.3 (Freya) is getting very popular with a better feature base. For further reading, latest updates and downloads please visit the official [website][1].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/elementary-os-0-3-freya-install-guide/
|
||||
|
||||
作者:[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://sourceforge.net/projects/elementaryos/files/stable/elementaryos-freya-amd64.20150411.iso/download
|
||||
[2]:http://sourceforge.net/projects/elementaryos/files/stable/elementaryos-freya-i386.20150411.iso/download
|
||||
[3]:http://elementary.io/
|
@ -1,174 +0,0 @@
|
||||
How to Show Dialog Box from Bash Shell Script with Examples
|
||||
================================================================================
|
||||
This tutorial will give couple of examples on how to use utilities like zenity and whiptail in your Bash shell script to provide message / dialog box . With these utilities your script will be able to inform user about the current state of execution, or give an ability to interact. Difference between these two utilities is the way they are displaying message box or dialog. Zenity uses GTK toolkit for creating graphical user interfaces, while whiptail creates message boxes inside terminal window.
|
||||
|
||||
### Zenity Tool ###
|
||||
|
||||
To install zenity on Ubuntu run:
|
||||
|
||||
sudo apt-get install zenity
|
||||
|
||||
Since commands for creating message boxes or dialogs with zenity are pretty self explanatory, we will provide you with couple of examples.
|
||||
|
||||
### Creating information box ###
|
||||
|
||||
zenity --info --title "Information Box" --text "This should be information" --width=300 --height=200
|
||||
|
||||
![Screenshot-Information Box](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Information-Box.png)
|
||||
|
||||
Creating Yes/No dialog
|
||||
|
||||
zenity --question --text "Do you want this?" --ok-label "Yeah" --cancel-label="Nope"
|
||||
|
||||
![Screenshot-Question](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Question.png)
|
||||
|
||||
Creating entry box and storing value in variable
|
||||
|
||||
a=$(zenity --entry --title "Entry box" --text "Please enter the value" --width=300 --height=200)
|
||||
echo $a
|
||||
|
||||
![Screenshot-Entry box](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Entry-box.png)
|
||||
|
||||
After entering it, value will be stored in $a variable.
|
||||
|
||||
Here is the working example which takes user's first name, last name and age and displays it.
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script will ask for couple of parameters
|
||||
# and then continue to work depending on entered values
|
||||
#
|
||||
|
||||
# Giving the option to user
|
||||
zenity --question --text "Do you want to continue?"
|
||||
|
||||
# Checking if user wants to proceed
|
||||
[ $? -eq 0 ] || exit 1
|
||||
|
||||
# Letting user input some values
|
||||
FIRSTNAME=$(zenity --entry --title "Entry box" --text "Please, enter your first name." --width=300 --height=150)
|
||||
LASTNAME=$(zenity --entry --title "Entry box" --text "Please, enter your last name." --width=300 --height=150)
|
||||
AGE=$(zenity --entry --title "Entry box" --text "Please, enter your age." --width=300 --height=150)
|
||||
|
||||
# Displaying entered values in information box
|
||||
zenity --info --title "Information" --text "You are ${FIRSTNAME} ${LASTNAME} and you are ${AGE}(s) old." --width=300 --height=100
|
||||
|
||||
Here are the screenshots of previous script.
|
||||
|
||||
![Example1-Question-1](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Question-1.png)
|
||||
|
||||
First box
|
||||
|
||||
![Example1-Entry box-1](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Entry-box-1.png)
|
||||
|
||||
Entry box
|
||||
|
||||
![Example1-Entry box-2](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Entry-box-2.png)
|
||||
|
||||
Entry box
|
||||
|
||||
![Example1-Entry box-3](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Entry-box-3.png)
|
||||
|
||||
Entry box
|
||||
|
||||
![Example1-Information](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Information.png)
|
||||
|
||||
Information box
|
||||
|
||||
Don't forget refer some of the useful [zenity options][1] that might help you.
|
||||
|
||||
### Whiptail Tool ###
|
||||
|
||||
To install whiptail on Ubuntu run
|
||||
|
||||
sudo apt-get install whiptail
|
||||
|
||||
Commands for creating message box/dialog with whiptail are also self explanatory, so we will provide you with just couple of basic examples.
|
||||
|
||||
### Creating message box ###
|
||||
|
||||
whiptail --msgbox "This is a message" 10 40
|
||||
|
||||
![Screenshot-whiptail-msgbox](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-msgbox.png)
|
||||
|
||||
### Creating Yes/No dialog ###
|
||||
|
||||
whiptail --yes-button "Yeah" --no-button "Nope" --title "Choose the answer" --yesno "Will you choose yes?" 10 30
|
||||
|
||||
![Screenshot-whiptail-yesno](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-yesno.png)
|
||||
|
||||
### Creating entry box with default value ###
|
||||
|
||||
whiptail --inputbox "Enter your number please." 10 30 "10"
|
||||
|
||||
![Screenshot-whiptail-entry](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-entry.png)
|
||||
|
||||
One thing to be aware of when trying to use entered value is that whiptail uses stdout for displaying dialog, and stderr for value output. That way, if you use var=$(...) you wont see dialog box at all, and wont get the entered value. Solution is to switch stdout and stderr. To do that just add **3>&1 1>&2 2>&3** at the end of the whiptail command. Same would be with any whiptail command which you want to use to get some entered value.
|
||||
|
||||
### Creating menu dialog ###
|
||||
|
||||
whiptail --menu "This is a menu. Choose an option:" 20 50 10 1 "first" 2 "second" 3 "third"
|
||||
|
||||
![Screenshot-whiptail-menu](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-menu.png)
|
||||
|
||||
Here is a **shell script** that asks user to enter a path to a folder and then outputs it's size.
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
#
|
||||
|
||||
# Since whiptail has to use stdout to display dialog, entered value will
|
||||
# be stored in stderr. To switch them and get the value to stdout you must
|
||||
# use 3>&1 1>&2 2>&3
|
||||
FOLDER_PATH=$(whiptail --title "Get the size of folder" \
|
||||
--inputbox "Enter folder path:" \
|
||||
10 30 \
|
||||
"/home" \
|
||||
3>&1 1>&2 2>&3)
|
||||
|
||||
if [ -d $FOLDER_PATH ]
|
||||
then
|
||||
size=$(du -hs "$FOLDER_PATH" | awk '{print $1}')
|
||||
whiptail --title "Information" \
|
||||
--msgbox "Size of ${FOLDER_PATH} is ${size}" \
|
||||
10 40
|
||||
elif [ -f $FOLDER_PATH ]
|
||||
then
|
||||
whiptail --title "Warning!!!" \
|
||||
--msgbox "The path you entered is a path to a file not a folder!" \
|
||||
10 40
|
||||
else
|
||||
whiptail --title "Error!!!"
|
||||
--msgbox "Path you entered is not recognized. Please try again" \
|
||||
10 40
|
||||
fi
|
||||
|
||||
Here are the screenshots from previous example:
|
||||
|
||||
![Example2-Entry-box](http://blog.linoxide.com/wp-content/uploads/2015/03/Example2-Entry-box.png)
|
||||
|
||||
Entry box
|
||||
|
||||
![Example2-Information](http://blog.linoxide.com/wp-content/uploads/2015/03/Example2-Information.png\)
|
||||
|
||||
Information box
|
||||
|
||||
If you are working in terminal , [manual pages][2] are always available.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Choosing the right tool for displaying dialogs will depend on whether you expect your script to be run on desktop machine or server machine. Desktop machine users mostly use window environment and will possibly be able to run the script and interact with appearing windows. However, if you are expecting that the user is someone on server machine, you might want to play it safe and use whiptail or any other utility that will display dialogs in plain terminal window.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-shell-script/bash-shell-script-show-dialog-box/
|
||||
|
||||
作者:[Ilija Lazarevic][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/ilijala/
|
||||
[1]:https://help.gnome.org/users/zenity/stable/
|
||||
[2]:http://linux.die.net/man/1/whiptail
|
@ -1,178 +0,0 @@
|
||||
How to manage remote MySQL databases on Linux VPS using a GUI tool
|
||||
================================================================================
|
||||
If you need to run a MySQL server on a remote [VPS instance][1], how will you manage databases hosted by the server remotely? Perhaps web-based database administration tools such as [phpMyAdmin][2] or [Adminer][3] will first come to mind. These web-based management tools require a backend web server and PHP engine up and running. However, if your VPS instance is used as a standalone database server (e.g., for a multi-tier app), provisioning a whole LAMP stack for occasional database management is a waste of VPS resource. Worse, the LAMP stack with an additional HTTP port can be a source of security vulnerabilities of your VPS.
|
||||
|
||||
Alternatively, you can turn to a native MySQL client running on a client host. Of course a pure command-line MySQL client (mysql-client) can be your default choice if nothing else. But the capabilities of the command-line client are limited, so it is not suitable for production-level database administration such as visual SQL development, performance tuning, schema validation, etc. If you are looking for full-blown MySQL administration features, a MySQL GUI tool will meet your requirements better.
|
||||
|
||||
### What is MySQL Workbench? ###
|
||||
|
||||
Developed as an integrated database tool environment by Oracle, [MySQL Workbench][4] is more than a simple MySQL client. In a nutshell, Workbench is a cross-platform (e.g., Linux, MacOS X, Windows) GUI tool for database design, development and administration. The Community Edition of MySQL Workbench is available for free under the GPL. As a database administrator, you can use Workbench to configure MySQL server, manage MySQL users, perform database backup and recovery, and monitor database health, all in GUI-based user-frienly environment.
|
||||
|
||||
In this tutorial, let's review how to install and use MySQL Workbench on Linux.
|
||||
|
||||
### Install MySQL Workbench on Linux ###
|
||||
|
||||
To set up remote database administration environment, grab any desktop Linux machine where you will be running MySQL Workbench. While some Linux distributions (e.g., Debian/Ubuntu) carry MySQL Workbench in their repositories, it is a good idea to install it from the official repositories, as they offer the latest version. Here is how to set up the official Workbench repository and install Workbench from it.
|
||||
|
||||
#### Debian-based Desktop (Debia, Ubuntu, Mint): ####
|
||||
|
||||
Go to the [official website][5]. Download and install the DEB file for the repository. Choose one that matches with your environment.
|
||||
|
||||
For example, on Ubuntu 14.10:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-apt-config_0.3.4-2ubuntu14.10_all.deb
|
||||
$ sudo dpkg -i mysql-apt-config_0.3.4-2ubuntu14.10_all.deb
|
||||
|
||||
on Debian 7:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-apt-config_0.3.3-1debian7_all.deb
|
||||
$ sudo dpkg -i mysql-apt-config_0.3.3-1debian7_all.deb
|
||||
|
||||
When installing the DEB file, you will see the following package configuration menu, and be asked to choose MySQL product to configure.
|
||||
|
||||
![](https://farm8.staticflickr.com/7702/16928715218_b1fcbcdbf3_c.jpg)
|
||||
|
||||
Choose "Utilities". Once you are done with configuration, choose "Apply" to save it.
|
||||
|
||||
Finally, update package index, and install Workbench.
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install mysql-workbench
|
||||
|
||||
#### Red Hat-based Desktop (CentOS, Fedora, RHEL): ####
|
||||
|
||||
Go to the [official website][6]. Download and install the RPM repository package for your Linux evironment.
|
||||
|
||||
For example, on CentOS 7:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
|
||||
$ sudo yum localinstall mysql-community-release-el7-5.noarch.rpm
|
||||
|
||||
on Fedora 21:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm
|
||||
$ sudo yum localinstall mysql-community-release-fc21-6.noarch.rpm
|
||||
|
||||
Verify that "MySQL Tools Community" repository has been set up.
|
||||
|
||||
$ yum repolis enabled
|
||||
|
||||
![](https://farm9.staticflickr.com/8826/16494069254_15458ace52_c.jpg)
|
||||
|
||||
Go ahead and install Workbench.
|
||||
|
||||
$ sudo yum install mysql-workbench-community
|
||||
|
||||
### Set up a Secure Remote Database Connection ###
|
||||
|
||||
The next step is to set up a remote connection to your MySQL server running on a VPS. Of course you can connect directly to the remote MySQL server from Workbench GUI (after [enabling remote access][7] in the database server). However, it is a huge security risk to do so, as someone can easily eavesdrop on database access traffic, and a publicly-open MySQL port can be another attack vector.
|
||||
|
||||
A better approach is to disable remote access of MySQL server (i.e., only allow access from 127.0.0.1 of a VPS). Then set up an SSH tunnel between a local client machine and a remote VPS, so that MySQL traffic can be securely relayed via their loopback interfaces. Compared to setting up SSL-based encrypted connections, configuring SSH tunneling requires little effort as it only requires SSH server, which is already deployed on most VPS instances.
|
||||
|
||||
Let's see how we can set up an SSH tunnel for MySQL Workbench.
|
||||
|
||||
In this setup, you don't need to enable remote access of a MySQL server.
|
||||
|
||||
On a local client host where MySQL Workbench will be running, type the following command. Replace 'user' and 'remote_vps' with your own info.
|
||||
|
||||
$ ssh user@remote_vps -L 3306:127.0.0.1:3306 -N
|
||||
|
||||
You will be asked to type an SSH password for your VPS. Once you successfully log in to the VPS, an SSH tunnel will be established between port 3306 of local host and port 3306 of a remote VPS. Note that you won't see any message in the foreground.
|
||||
|
||||
Optionally, you can set the SSH tunnel running in the background. For that, press Ctrl+Z to stop the command, type bg and press ENTER.
|
||||
|
||||
![](https://farm8.staticflickr.com/7714/16928715438_bf0db49b3b_c.jpg)
|
||||
|
||||
The SSH tunnel will now be running in the background.
|
||||
|
||||
### Manage a Remote MySQL Server with MySQL Workbench ###
|
||||
|
||||
With an SSH tunnel established, you are ready to connect to a remote MySQL server from MySQL Workbench.
|
||||
|
||||
Launch Workbench by typing:
|
||||
|
||||
$ mysql-workbench
|
||||
|
||||
![](https://farm9.staticflickr.com/8768/16494069294_0fce571ddb_c.jpg)
|
||||
|
||||
Click on the plus icon at the top of the Workbench screen to create a new database connection. Fill in connection information as follows.
|
||||
|
||||
- **Connection Name**: any description (e.g., My remote VPS database)
|
||||
- **Hostname**: 127.0.0.1
|
||||
- **Port**: 3306
|
||||
- **Username**: MySQL username (e.g., root)
|
||||
|
||||
![](https://farm8.staticflickr.com/7727/16928715288_d9ac3bfc7a_c.jpg)
|
||||
|
||||
Note that since the tunnel's local endpoint is 127.0.0.1:3306, the hostname field must be 127.0.0.1, not the IP address/hostname of a remote VPS.
|
||||
|
||||
Once you set up a new database connection, you will see a new box for the connection appear on Workbench window. Click on the box to actually establish a connection to a remote MySQL server.
|
||||
|
||||
![](https://farm8.staticflickr.com/7650/17114969532_0252ffcd31_c.jpg)
|
||||
|
||||
Once you are logged in to the MySQL server, you will see various administrative tasks in the left-side panel. Let's review some of common administrative tasks.
|
||||
|
||||
#### MySQL Server Status ####
|
||||
|
||||
This menus shows real-time dashboard of database server resource usage (e.g., traffic, connections, read/write).
|
||||
|
||||
![](https://farm8.staticflickr.com/7627/16494069414_9d838d4138_c.jpg)
|
||||
|
||||
#### Client Connections ####
|
||||
|
||||
The total number of client connections is a critical resource to monitor. This menu shows detailed information of individual client connections.
|
||||
|
||||
![](https://farm9.staticflickr.com/8747/16909119337_a8d89772dd_c.jpg)
|
||||
|
||||
#### Users and Privileges ####
|
||||
|
||||
This menu allows you to manage MySQL users, including their resource limits and privileges.
|
||||
|
||||
![](https://farm9.staticflickr.com/8765/16494069384_760fc17c8f_c.jpg)
|
||||
|
||||
#### MySQL Server Administration ####
|
||||
|
||||
You can start or stop a MySQL server, and examine its server logs.
|
||||
|
||||
![](https://farm8.staticflickr.com/7588/17114969592_54526dfb32_c.jpg)
|
||||
|
||||
#### Database Schema Management ####
|
||||
|
||||
You can view, change or inspect database schema visually. For that, choose and right-click on any database or table under "Schemas" heading.
|
||||
|
||||
![](https://farm8.staticflickr.com/7665/16496363973_fd03a96198_c.jpg)
|
||||
|
||||
![](https://farm9.staticflickr.com/8744/16909119497_7c884617b8_c.jpg)
|
||||
|
||||
#### Database Query ####
|
||||
|
||||
You can execute any arbitrary query (as long as your login privilege allows), and inspect its result.
|
||||
|
||||
![](https://farm8.staticflickr.com/7716/17114969692_c0f02bb277_c.jpg)
|
||||
|
||||
Note that performance statistics and reports are available for MySQL server 5.6 and higher. For 5.5 and lower, the performance section will be grayed out.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
The clean and intuitive tabbed interface, comprehensive feature sets, and open-source licensing make MySQL Workbench one of the best visual database design and administration tools out there. One known downside of Workbench is its performance. I notice that Workbench sometimes gets sluggish while running queries on a busy server. Despite its less than stellar performance, I still consider MySQL Workbench an essential tool for any professional MySQL database administrator and designer.
|
||||
|
||||
Have you ever used Workbench in your work environment? Or do you recommend any other GUI tool? Feel free to share your experience.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/remote-mysql-databases-gui-tool.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://xmodulo.com/go/digitalocean
|
||||
[2]:http://ask.xmodulo.com/install-phpmyadmin-centos.html
|
||||
[3]:http://xmodulo.com/set-web-based-database-management-system-adminer.html
|
||||
[4]:http://mysqlworkbench.org/
|
||||
[5]:http://dev.mysql.com/downloads/repo/apt/
|
||||
[6]:http://dev.mysql.com/downloads/repo/yum/
|
||||
[7]:http://xmodulo.com/how-to-allow-remote-access-to-mysql.html
|
@ -1,3 +1,5 @@
|
||||
Vic020
|
||||
|
||||
Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora
|
||||
================================================================================
|
||||
> **Question**: I want to build and install the latest ixgbe 10G NIC driver. How can I compile ixgbe driver on CentOS, Fedora or RHEL?
|
||||
@ -193,4 +195,4 @@ via: http://ask.xmodulo.com/compile-ixgbe-driver-centos-rhel-fedora.html
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
||||
[1]:http://ask.xmodulo.com/download-install-ixgbe-driver-ubuntu-debian.html
|
||||
[2]:http://sourceforge.net/projects/e1000/files/ixgbe%20stable/
|
||||
[2]:http://sourceforge.net/projects/e1000/files/ixgbe%20stable/
|
||||
|
@ -1,158 +0,0 @@
|
||||
HTTP Public Key Pinning Extension HPKP for Apache, NGINX and Lighttpd
|
||||
================================================================================
|
||||
Public Key Pinning means that a certificate chain must include a whitelisted public key. It ensures only whitelisted Certificate Authorities (CA) can sign certificates for `*.example.com`, and not any CA in your browser store. This article has background theory and configuration examples for Apache, Lighttpd and NGINX.
|
||||
|
||||
### HTTP Public Key Pinning Extension ###
|
||||
|
||||
An example might be your bank, which always have their certificate from CA Company A. With the current certificate system, CA Company B, CA Company C and the NSA CA can all create a certificate for your bank, which your browser will hapily accept because those companies are also trusted root CA's.
|
||||
|
||||
If the bank implements HPKP and pin's their first intermidiate certificate (from CA Company A), browsers will not accept certificates from CA Company B and CA Company C, even if they have a valid trust path. HPKP also allows your browser to report back the failure to the bank, so that they know they are under attack.
|
||||
|
||||
Public Key Pinning Extension for HTTP (HPKP) is a standard for public key pinning for HTTP user agents that's been in development since 2011. It was started by Google, which, even though it had implemented pinning in Chrome, understood that manually maintaining a list of pinned sites can't scale.
|
||||
|
||||
Here is a quick feature overview of HPKP:
|
||||
|
||||
- HPKP is set at the HTTP level, using the `Public-Key-Pins` response header.
|
||||
- The policy retention period is set with the max-age parameter, it specifies duration in seconds.
|
||||
- The PKP header can only be used over an error-free secure encryption.
|
||||
- If multiple headers are seen, only the first one is processed.
|
||||
- Pinning can be extended to subdomains with the `includeSubDomains` parameter.
|
||||
- When a new PKP header is received, it overwrites previously stored pins and metadata.
|
||||
- A pin consists out of the hashing algorithm and an "Subject Public Key Info" fingerprint.
|
||||
|
||||
This article first has some theory about the workings of HPKP, down below you'll find the part which shows you how to get the required fingerprints and has web server configuration.
|
||||
|
||||
### SPKI Fingerprint - Theory ###
|
||||
|
||||
As explained by Adam Langley in [his post][1], we hash a public key, not a certificate:
|
||||
|
||||
> In general, hashing certificates is the obvious solution, but the wrong one. The problem is that CA certificates are often reissued: there are multiple certificates with the same public key, subject name etc but different extensions or expiry dates. Browsers build certificates chains from a pool of certificates, bottom up, and an alternative version of a certificate might be substituted for the one that you expect.
|
||||
>
|
||||
> For example, StartSSL has two root certificates: one signed with SHA1 and the other with SHA256. If you wished to pin to StartSSL as your CA, which certificate hash would you use? You would have to use both, but how would you know about the other root if I hadn't just told you?
|
||||
>
|
||||
> Conversely, public key hashes must be correct:
|
||||
>
|
||||
> Browsers assume that the leaf certificate is fixed: it's always the starting point of the chain. The leaf certificate contains a signature which must be a valid signature, from its parent, for that certificate. That implies that the public key of the parent is fixed by the leaf certificate. So, inductively, the chain of public keys is fixed, modulo truncation.
|
||||
>
|
||||
> The only sharp edge is that you mustn't pin to a cross-certifying root. For example, GoDaddy's root is signed by Valicert so that older clients, which don't recognise GoDaddy as a root, still trust those certificates. However, you wouldn't want to pin to Valicert because newer clients will stop their chain at GoDaddy.
|
||||
>
|
||||
> Also, we're hashing the SubjectPublicKeyInfo not the public key bit string. The SPKI includes the type of the public key and some parameters along with the public key itself. This is important because just hashing the public key leaves one open to misinterpretation attacks. Consider a Diffie-Hellman public key: if one only hashes the public key, not the full SPKI, then an attacker can use the same public key but make the client interpret it in a different group. Likewise one could force an RSA key to be interpreted as a DSA key etc.
|
||||
|
||||
### Where to Pin ###
|
||||
|
||||
Where should you pin? Pinning your own public key is not the best idea. The key might change or get compromised. You might have multiple certificates in use. The key might change because you rotate your certificates every so often. It might key compromised because the web server was hacked.
|
||||
|
||||
The easiest, but not most secure place to pin is the first intermediate CA certificate. The signature of that certificate is on your websites certificate so the issuing CA's public key must always be in the chain.
|
||||
|
||||
This way you can renew your end certificate from the same CA and have no pinning issues. If the CA issues a different root, then you have a problem, there is no clear solution for this yet. There is one thing you can do to mitigate this:
|
||||
|
||||
- Always have a backup pin and a spare certificate from a different CA.
|
||||
|
||||
The RFC states that you need to provide at least two pins. One of the pins must be present in the chain used in the connection over which the pins were received, the other pin must not be present.
|
||||
|
||||
This other pin is your backup public key. It can also be the SPKI fingerprint of a different CA where you have a certificate issued.
|
||||
|
||||
An alternative and **more secure** take on this issue is to create at least three seperate public keys beforehand (using OpenSSL, see [this page][2] for a Javascript OpenSSL command generator) and to keep two of those keys as a backup in a safe place, offline and off-site.
|
||||
|
||||
You create the SPKI hashes for the three certificates and pin those. You only use the first key as the active certificate. When it is needed, you can then use one of the alternative keys. You do however need to let that certificate sign by a CA to create a certificate pair and that process can take a few days depending on the certificate.
|
||||
|
||||
This is not a problem for the HPKP because we take the SPKI hash of the public key, and not of the certificate. Expiration or a different chain of CA signer do not matter in this case.
|
||||
|
||||
If you have the means and procedures to create and securely save at least three seperate keys as described above and pin those, it would also protect you from your CA provider getting compromised and giving out a fake certificate for your specific website.
|
||||
|
||||
### SPKI Fingerprint ###
|
||||
|
||||
To get the SPKI fingerprint from a certificate we can use the following OpenSSL command, as shown in [the RFC draft][3]:
|
||||
|
||||
openssl x509 -noout -in certificate.pem -pubkey | \
|
||||
openssl asn1parse -noout -inform pem -out public.key;
|
||||
openssl dgst -sha256 -binary public.key | openssl enc -base64
|
||||
|
||||
Result:
|
||||
|
||||
klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=
|
||||
|
||||
The input `certificate.pem` file is the first certificate in the chain for this website. (At the time of writing, `COMODO RSA Domain Validation Secure Server CA, Serial 2B:2E:6E:EA:D9:75:36:6C:14:8A:6E:DB:A3:7C:8C:07.`)
|
||||
|
||||
You need to also do this with your backup public key, ending up with two fingerprints.
|
||||
|
||||
### Bugs ###
|
||||
|
||||
At the time of writing this article (2015-Jan) the only browser supporting HPKP (Chrome) has a serious issue where Chrome doesn't treat the max-age and includeSubdomains directives from HSTS and HPKP headers as mutually exclusive. This means that if you have HSTS and HPKP with different policiesfor max-age or includeSubdomains they will be interchanged. See this bug for more info: [https://code.google.com/p/chromium/issues/detail?id=444511][4]. Thanks to Scott Helme from [https://scotthelme.co.uk][5] for finding and notifying me and the Chromium project about it.
|
||||
|
||||
### Webserver configuration ###
|
||||
|
||||
Below you'll find configuration instructions for the three most populair web servers. Since this is just a HTTP header, almost all web servers will allow you to set this. It needs to be set for the HTTPS website.
|
||||
|
||||
The example below pins the `COMODO RSA Domain Validation Secure Server CA` and the `Comodo PositiveSSL` CA 2 as a backup, with a 30 day expire time including all subdomains.
|
||||
|
||||
#### Apache ####
|
||||
|
||||
Edit your apache configuration file (`/etc/apache2/sites-enabled/website.conf or /etc/apache2/httpd.conf` for example) and add the following to your VirtualHost:
|
||||
|
||||
# Optionally load the headers module:
|
||||
LoadModule headers_module modules/mod_headers.so
|
||||
|
||||
Header set Public-Key-Pins "pin-sha256=\"klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=\"; pin-sha256=\"633lt352PKRXbOwf4xSEa1M517scpD3l5f79xMD9r9Q=\"; max-age=2592000; includeSubDomains"
|
||||
|
||||
#### Lighttpd ####
|
||||
|
||||
The lighttpd variant is just as simple. Add it to your Lighttpd configuration file (`/etc/lighttpd/lighttpd.conf` for example):
|
||||
|
||||
server.modules += ( "mod_setenv" )
|
||||
$HTTP["scheme"] == "https" {
|
||||
setenv.add-response-header = ( "Public-Key-Pins" => "pin-sha256=\"klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=\"; pin-sha256=\"633lt352PKRXbOwf4xSEa1M517scpD3l5f79xMD9r9Q=\"; max-age=2592000; includeSubDomains")
|
||||
}
|
||||
|
||||
#### NGINX ####
|
||||
|
||||
NGINX is even shorter with its config. Add this in the server block for your HTTPS configuration:
|
||||
|
||||
add_header Public-Key-Pins 'pin-sha256="klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY="; pin-sha256="633lt352PKRXbOwf4xSEa1M517scpD3l5f79xMD9r9Q="; max-age=2592000; includeSubDomains';
|
||||
|
||||
### Reporting ###
|
||||
|
||||
HPKP reporting allows the user-agent to report any failures back to you.
|
||||
|
||||
If you add an aditional `report-uri="http://example.org/hpkp-report`" parameter to the header and set up a listener there, clients will send reports if they encounter a failure. A report is sent as a POST request to the report-uri with a JSON body like this:
|
||||
|
||||
{
|
||||
"date-time": "2014-12-26T11:52:10Z",
|
||||
"hostname": "www.example.org",
|
||||
"port": 443,
|
||||
"effective-expiration-date": "2014-12-31T12:59:59",
|
||||
"include-subdomains": true,
|
||||
"served-certificate-chain": [
|
||||
"-----BEGINCERTIFICATE-----\nMIIAuyg[...]tqU0CkVDNx\n-----ENDCERTIFICATE-----"
|
||||
],
|
||||
"validated-certificate-chain": [
|
||||
"-----BEGINCERTIFICATE-----\nEBDCCygAwIBA[...]PX4WecNx\n-----ENDCERTIFICATE-----"
|
||||
],
|
||||
"known-pins": [
|
||||
"pin-sha256=\"dUezRu9zOECb901Md727xWltNsj0e6qzGk\"",
|
||||
"pin-sha256=\"E9CqVKB9+xZ9INDbd+2eRQozqbQ2yXLYc\""
|
||||
]
|
||||
}
|
||||
|
||||
### No Enforcment, report only ###
|
||||
|
||||
HPKP can be set up without enforcement, in reporting mode by using the `Public-Key-Pins-Report-Only` response header.
|
||||
|
||||
This approach allows you to set up pinning without your site being unreachable or HPKP being configured incorrectly. You can later move to enforcement by changing the header back to `Public-Key-Pins`.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://raymii.org/s/articles/HTTP_Public_Key_Pinning_Extension_HPKP.html
|
||||
|
||||
作者:[Remy van Elst][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://raymii.org/
|
||||
[1]:http://www.imperialviolet.org/2011/05/04/pinning.html
|
||||
[2]:https://raymii.org/s/software/OpenSSL_Command_Generator.html
|
||||
[3]:https://tools.ietf.org/html/draft-ietf-websec-key-pinning-21#appendix-A
|
||||
[4]:https://code.google.com/p/chromium/issues/detail?id=444511
|
||||
[5]:https://scotthelme.co.uk/
|
@ -1,33 +1,33 @@
|
||||
Strong SSL Security on nginx
|
||||
增强 nginx 的 SSL 安全性
|
||||
================================================================================
|
||||
[![](https://raymii.org/s/inc/img/ssl-labs-a.png)][1]
|
||||
|
||||
This tutorial shows you how to set up strong SSL security on the nginx webserver. We do this by disabling SSL Compression to mitigate the CRIME attack, disable SSLv3 and below because of vulnerabilities in the protocol and we will set up a strong ciphersuite that enables Forward Secrecy when possible. We also enable HSTS and HPKP. This way we have a strong and future proof ssl configuration and we get an A on the Qually Labs SSL Test.
|
||||
本文向你介绍如何在 nginx 服务器上设置高安全性的 SSL。我们通过取消 SSL 压缩降低 CRIME 攻击威胁;禁用协议上存在安全缺陷的 SSLv3 及更低版本,并设置更健壮的加密套件来尽可能启用正向保密(Forward Secrecy);我们也启用了 HSTS 和 HPKP。这样我们就拥有了一个健壮而可经受考验的 SSL 配置,并可以在 Qually Labs 的 SSL 测试中得到 A 级评分。
|
||||
|
||||
TL;DR: [Copy-pastable strong cipherssuites for NGINX, Apache and Lighttpd: https://cipherli.st][2]
|
||||
不求甚解的话,可以从 [https://cipherli.st][2] 上找到 nginx 、Apache 和 Lighttpd 的安全设置,复制粘帖即可。
|
||||
|
||||
This tutorial is tested on a Digital Ocean VPS. If you like this tutorial and want to support my website, use this link to order a Digital Ocean VPS: [https://www.digitalocean.com/?refcode=7435ae6b8212][2]
|
||||
本教程在 Digital Ocean 的 VPS 上测试通过。如果你喜欢这篇教程,想要支持作者的站点的话,购买 Digital Ocean 的 VPS 时请使用如下链接:[https://www.digitalocean.com/?refcode=7435ae6b8212][3] 。
|
||||
|
||||
This tutorial works with the stricter requirements of the SSL Labs test [announced on the 21st of January 2014][4] (It already did before that, if you follow(ed) it you get an A+)
|
||||
本教程可以通过[发布于 2014/1/21 的][4] SSL 实验室测试的严格要求(之前就通过了测试,如果你按照本文进行的话,可以得到一个 A+ 评分)。
|
||||
|
||||
- [This tutorial is also available for Apache][5]
|
||||
- [This tutorial is also available for Lighttpd][6]
|
||||
- [This tutorial is also available for FreeBSD, NetBSD and OpenBSD over at the BSD Now podcast][7]: [http://www.bsdnow.tv/tutorials/nginx][8]
|
||||
- [本教程也有对应 Apache 的][5]
|
||||
- [本教程也有对应 Lighttpd 的][6]
|
||||
- [本教程也有对应 FreeBSD, NetBSD 和 OpenBSD 上的 nginx 的,放在 BSD Now 播客][7]: [http://www.bsdnow.tv/tutorials/nginx][8]
|
||||
|
||||
You can find more info on the topics by following the links below:
|
||||
你可以从下列链接中找到这方面的进一步内容:
|
||||
|
||||
- [BEAST Attack][9]
|
||||
- [CRIME Attack][10]
|
||||
- [FREAK Attack][11]
|
||||
- [Heartbleed][12]
|
||||
- [Perfect Forward Secrecy][13]
|
||||
- [Dealing with RC4 and BEAST][14]
|
||||
- [BEAST 攻击][9]
|
||||
- [CRIME 攻击][10]
|
||||
- [FREAK 攻击][11]
|
||||
- [心血漏洞][12]
|
||||
- [完美正向保密][13]
|
||||
- [RC4 和 BEAST 的处理][14]
|
||||
|
||||
We are going to edit the nginx settings in the file `/etc/nginx/sited-enabled/yoursite.com` (On Ubuntu/Debian) or in `/etc/nginx/conf.d/nginx.conf` (On RHEL/CentOS).
|
||||
我们需要编辑 nginx 的配置,在 Ubuntu/Debian 上是 `/etc/nginx/sited-enabled/yoursite.com`,在 RHEL/CentOS 上是 `/etc/nginx/conf.d/nginx.conf`
|
||||
|
||||
For the entire tutorial, you need to edit the parts between the `server` block for the server config for port 443 (ssl config). At the end of the tutorial you can find the complete config example.
|
||||
本文中,我们需要编辑443端口(SSL)的 `server` 配置中的部分。在文末我们会给出完整的配置例子。
|
||||
|
||||
*Make sure you back up the files before editing them!*
|
||||
*在编辑之前切记备份一下配置文件!*
|
||||
|
||||
### The BEAST attack and RC4 ###
|
||||
|
||||
|
@ -0,0 +1,161 @@
|
||||
translating wi-cuckoo
|
||||
How to Install Discourse in a Docker Container
|
||||
================================================================================
|
||||
Hi all, today we'll learn how to install Discourse using Docker Platform. Discourse is the 100% open source discussion platform built for the next decade of the Internet featuring as a mailing list, a discussion forum and a long-form chat room. It is a smart way of attempt to reimagine what a modern, sustainable, fully open-source Internet discussion platform should be today, both from a technology standpoint and a sociology standpoint. Discourse is simple, clean, and straightforward way for discussion. It is really an awesome platform for any kinds of discussions on internet featuring such a cool services out of the box. Docker is an open source platform that provides an open platform to pack, ship and run any application as a lightweight container. Docker containers makes Discourse a lot handy and easy to setup app.
|
||||
|
||||
So, here are some quick and easy steps in order to install Discourse inside a Docker environment.
|
||||
|
||||
### 1. Installing Docker ###
|
||||
|
||||
First of all, we need to make sure that we have Docker installed in our host Operating System. To install, we'll need to the run the following command in a shell or terminal.
|
||||
|
||||
#### On Ubuntu ####
|
||||
|
||||
Package docker is available in Ubuntu's repository so, we'll be using apt manager to install it in sudo or root mode.
|
||||
|
||||
# apt-get install docker
|
||||
|
||||
#### On CentOS 7 ####
|
||||
|
||||
On CentOS 7 machine, we'll use yum manager to install docker as it is also available in CentOS's repository.
|
||||
|
||||
# yum install docker
|
||||
|
||||
![Installing Docker](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-docker.png)
|
||||
|
||||
### 2. Setting Swap Memory ###
|
||||
|
||||
If you have RAM size less than 1 GB then, make sure you upgrade your system to 1 GB or above cause Discourse doesn't get installed in 512 MB RAM. If you are now ready to install Discourse with 1 GB or above, follow the following steps to setup swap memory for you VPS or Server.
|
||||
|
||||
We'll create an empty swapfile by running the following command.
|
||||
|
||||
# install -o root -g root -m 0600 /dev/null /swapfile
|
||||
|
||||
If you want your swap memory to be 1 GB, then do the below step and skip the next step.
|
||||
|
||||
# dd if=/dev/zero of=/swapfile bs=1k count=1024k
|
||||
|
||||
if you want it to be 2 GB, follow the below. Make sure you skip the above step.
|
||||
|
||||
# dd if=/dev/zero of=/swapfile bs=1k count=2048k
|
||||
|
||||
Then, we'll point Swap Memory as swapfile .
|
||||
|
||||
#mkswap /swapfile
|
||||
|
||||
To activate it run the following command.
|
||||
|
||||
#swapon /swapfile
|
||||
|
||||
Now, we'll add it to the file system table so its there after reboot:
|
||||
|
||||
# echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab
|
||||
|
||||
Set the swappiness to 10 so its only uses as an emergency buffer.
|
||||
|
||||
# sudo sysctl -w vm.swappiness=10
|
||||
# echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
|
||||
|
||||
### 3. Installing Discourse ###
|
||||
|
||||
After installing Docker in our host machine, we'll now go further towards installing Discourse. We'll now clone Discourse from the official Discourse Github into /var/discourse directory. To do so, we'll need to run the following command.
|
||||
|
||||
# mkdir /var/discourse/
|
||||
|
||||
# cd /var/discourse/
|
||||
|
||||
# git clone https://github.com/discourse/discourse_docker.git /var/discourse/
|
||||
|
||||
After cloning the git repository, we'll copy the configuration file for our discourse server.
|
||||
|
||||
# cp samples/standalone.yml containers/app.yml
|
||||
|
||||
![Cloning Discourse Docker](http://blog.linoxide.com/wp-content/uploads/2015/04/cloning-discourse-docker.png)
|
||||
|
||||
### 4. Configuring Discourse ###
|
||||
|
||||
Next, we'll edit the discourse configuration ie app.yml located inside containers directory using our favorite text editor.
|
||||
|
||||
# nano containers/app.yml
|
||||
|
||||
Now, we need to set the developer's email address to DISCOURSE_DEVELOPER_EMAILS as follows.
|
||||
|
||||
DISCOURSE_DEVELOPER_EMAILS: 'arun@linoxide.com'
|
||||
|
||||
Then, we'll set the hostname as the domain name of our server.
|
||||
|
||||
DISCOURSE_HOSTNAME: 'discourse.linoxide.com'
|
||||
|
||||
Then, set the mail credentials per our SMTP Server hosted in the same discourse machine or vps. The SMTP settings are required to send mail from your Discourse instance
|
||||
|
||||
DISCOURSE_SMTP_ADDRESS: smtp.linoxide.com
|
||||
DISCOURSE_SMTP_PORT: 587 # (optional)
|
||||
DISCOURSE_SMTP_USER_NAME: admin@linoxide.com # (optional)
|
||||
DISCOURSE_SMTP_PASSWORD: test123 # (optional)
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2015/04/discourse-configuration.png)
|
||||
|
||||
Discourse Configuration
|
||||
|
||||
If you are using a 1 GB instance, set UNICORN_WORKERS to 2 and db_shared_buffers to 128MB so you have more memory room.
|
||||
|
||||
It is compulsory to create a mailing server to run Discourse. If you have a server then its cool, we can use its credentials. If you have no existing mail server, or you don't know what it is? No problem, create a free account on [Mandrill][1] ([Mailgun][2], or [Mailjet][3]), and use the credentials provided in the dashboard.
|
||||
|
||||
### 5. Starting Discourse App ###
|
||||
|
||||
After configuring the discourse configuration file, we'll surely wanna start our Discourse server. To do so, first we'll launch discourse bootstrap by running the following command under the current directory ie /var/discourse/ .
|
||||
|
||||
# ./launcher bootstrap app
|
||||
|
||||
![Starting Discourse Bootstrap](http://blog.linoxide.com/wp-content/uploads/2015/04/starting-discourse-bootstrap.png)
|
||||
|
||||
The above command may take some minutes which automatically configures our Discourse environment. Then, after the processes are finished, we'll need to run the following to start our Discourse App.
|
||||
|
||||
#./launcher start app
|
||||
|
||||
![Starting Discourse](http://blog.linoxide.com/wp-content/uploads/2015/04/starting-discourse.png)
|
||||
|
||||
If everything went as expected accordingly, we'll be able to access our fresh Discourse Web Interface using our favorite Web Browser by pointing the url to http://ip-address/ or http://discourse.linoxide.com/ . Then, we can create a new account and become admin.
|
||||
|
||||
![Discourse Web interface](http://blog.linoxide.com/wp-content/uploads/2015/04/Discourse-web-interface.png)
|
||||
|
||||
### Maintenance ###
|
||||
|
||||
Here below are the usages of the launcher command inside /var/discourse/ directory so that we can commit maintenance and control over the Discourse Docker Container.
|
||||
|
||||
Usage: launcher COMMAND CONFIG [--skip-prereqs]
|
||||
Commands:
|
||||
start: Start/initialize a container
|
||||
stop: Stop a running container
|
||||
restart: Restart a container
|
||||
destroy: Stop and remove a container
|
||||
enter: Use nsenter to enter a container
|
||||
ssh: Start a bash shell in a running container
|
||||
logs: Docker logs for container
|
||||
mailtest: Test the mail settings in a container
|
||||
bootstrap: Bootstrap a container for the config based on a template
|
||||
rebuild: Rebuild a container (destroy old, bootstrap, start new)
|
||||
cleanup: Remove all containers that have stopped for > 24 hours
|
||||
|
||||
Options:
|
||||
--skip-prereqs Don't check prerequisites
|
||||
--docker-args Extra arguments to pass when running docker
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Hurray! We have successfully installed Discourse with Docker Technology. Docker technology makes Discourse very much easy to install in any Platform with all the requirement fulfilled. We need our own mailing server or credentials of a mailing server to get started with it. It is a great platform for easy modern mailing list, discussion platform.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/how-tos/install-discourse-docker-container/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://mandrillapp.com/
|
||||
[2]:http://www.mailgun.com/
|
||||
[3]:https://www.mailjet.com/pricing
|
@ -0,0 +1,237 @@
|
||||
20 Awesome Docker Containers for a Desktop User
|
||||
================================================================================
|
||||
Greetings to everyone, today we'll list out some awesome Desktop Apps that we can run using Docker Containers in our very own Desktop running Docker. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. It is basically used by the developers, Ops and Engineers as it is easy, fast and handy tool for testing or deploying their products but we can also use Docker for our Desktop usage to run a desktop apps out of the box.
|
||||
|
||||
So here are some awesome 10 Desktop Application Docker images that we can run with Docker.
|
||||
|
||||
### 1. Lynx ###
|
||||
|
||||
Lynx is a all time favorite text-based web browser which is a lot familiar to most of the people running Linux. It is the oldest web browser currently in general use and development. To run Lynx, run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
--name lynx \
|
||||
jess/lynx
|
||||
|
||||
### 2. Irssi ###
|
||||
|
||||
Irssi is an awesome IRC Client which is based on Text Interface. To run Irssi using docker, we'll need to run the following commands in a docker installed desktop computer.
|
||||
|
||||
docker run -it --name my-irssi -e TERM -u $(id -u):$(id -g) \
|
||||
-v $HOME/.irssi:/home/user/.irssi:ro \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
irssi
|
||||
|
||||
### 3. Chrome ###
|
||||
|
||||
Chrome is an awesome GUI-based web browser developed by Google and is based on Open Source Project Chromium. Google Chrome is widely used, fast and secure web browser that are very much familiar to most of the people who surf internet. We can run Chrome using docker by running the following command.
|
||||
|
||||
$ docker run -it \
|
||||
--net host \
|
||||
--cpuset 0 \
|
||||
--memory 512mb \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e DISPLAY=unix$DISPLAY \
|
||||
-v $HOME/Downloads:/root/Downloads \
|
||||
-v $HOME/.config/google-chrome/:/data \
|
||||
-v /dev/snd:/dev/snd --privileged \
|
||||
--name chrome \
|
||||
jess/chrome
|
||||
|
||||
### 4. Tor Browser ###
|
||||
|
||||
Tor Browser is a web browser which support anonymous features. It enables us freedom to surf website or services blocked by a particular organization or ISPs. It prevents somebody watching our Internet connection from learning what we do on internet and our exact location. To run Tor Browser, run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e DISPLAY=unix$DISPLAY \
|
||||
-v /dev/snd:/dev/snd --privileged \
|
||||
--name tor-browser \
|
||||
jess/tor-browser
|
||||
|
||||
### 5. Firefox Browser ###
|
||||
|
||||
Firefox Browser is a free and open source web browser which is developed by Mozilla Foundation. It is run by Gecko and SpiderMonkey engines. Firefox Browser has a lot of new features and is specially known for its performance and security.
|
||||
|
||||
$ docker run -d \
|
||||
--name firefox \
|
||||
-e DISPLAY=$DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
kennethkl/firefox
|
||||
|
||||
### 6. Rainbow Stream ###
|
||||
|
||||
Rainbow Stream is a terminal based Twitter Client featuring real time tweetstream, compose, search , favorite and much more fun directly from terminal. To run Rainbow Stream, run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /etc/localtime:/etc/localtime \
|
||||
-v $HOME/.rainbow_oauth:/root/.rainbow_oauth \
|
||||
-v $HOME/.rainbow_config.json:/root/.rainbow_config.json \
|
||||
--name rainbowstream \
|
||||
jess/rainbowstream
|
||||
|
||||
### 7. Gparted ###
|
||||
|
||||
Gparted is an open source software which allows us to partition disks. Now enjoy partitioning from a docker container. To run gparted, we'll need to run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e DISPLAY=unix$DISPLAY \
|
||||
--device /dev/sda:/dev/sda \ # mount the device to partition
|
||||
--name gparted \
|
||||
jess/gparted
|
||||
|
||||
### 8. GIMP Editor ###
|
||||
|
||||
GIMP stands for Gnu Image Manipulation Program which is an awesome tool on Linux for graphics, image editing platform. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring.
|
||||
|
||||
$ docker run -it \
|
||||
--rm -e DISPLAY=$DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
jarfil/gimp-git
|
||||
|
||||
### 9. Thunderbird ###
|
||||
|
||||
Thunderbird is also a free and open source email application which is developed and maintained by Mozilla Foundation. It has tons of features that an email application software should have. Thunderbird is really easy to setup and customize. To run Thunderbird in a Docker environment, run the following command.
|
||||
|
||||
$ docker run -d \
|
||||
-e DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
|
||||
-u docker \
|
||||
-v $HOME/docker-data/thunderbird:/home/docker/.thunderbird/ \
|
||||
yantis/thunderbird thunderbird
|
||||
|
||||
### 10. Mutt ###
|
||||
|
||||
Mutt is a text based email client which has bunches of cool features including color support, IMAP, POP3, SMTP support, mail storing support and much more. To run Mutt out of the box using docker, we'll need to run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /etc/localtime:/etc/localtime \
|
||||
-e GMAIL -e GMAIL_NAME \
|
||||
-e GMAIL_PASS -e GMAIL_FROM \
|
||||
-v $HOME/.gnupg:/home/user/.gnupg \
|
||||
--name mutt \
|
||||
jess/mutt
|
||||
|
||||
### 11. Skype ###
|
||||
|
||||
Skype is an instant messaging, video calling software which is not open source but can be run awesome in linux. We can run Skype using Docker Containers too. To run Skype using a docker, run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
|
||||
-v /dev/snd:/dev/snd --privileged \
|
||||
-e DISPLAY="unix$DISPLAY" \
|
||||
tianon/skype
|
||||
|
||||
### 12. Cathode ###
|
||||
|
||||
Cathode is a beautiful fully customizable terminal app with a look inspired by classic computers. We can run Cathode by running the below command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e DISPLAY=unix$DISPLAY \
|
||||
--name cathode \
|
||||
jess/1995
|
||||
|
||||
### 13. LibreOffice ###
|
||||
|
||||
LibreOffice is a powerful office suite which is free and open source and is maintained by The Document Foundation. It has clean interface and is a powerful tools that lets us unleash our creativity and grow our productivity. LibreOffice embeds several applications that make it the most powerful Free & Open Source Office suite on the market.
|
||||
|
||||
$docker run \
|
||||
-v $HOME/Documents:/home/libreoffice/Documents:rw \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e uid=$(id -u) -e gid=$(id -g) \
|
||||
-e DISPLAY=unix$DISPLAY --name libreoffice \
|
||||
chrisdaish/libreoffice
|
||||
|
||||
### 14. Spotify ###
|
||||
|
||||
Spotify gives us instant access to millions of songs from old favorites to the latest hits. To listen our favorite songs using docker, run the following command.
|
||||
|
||||
$ docker run -it \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e DISPLAY=unix$DISPLAY \
|
||||
-v /dev/snd:/dev/snd --privileged \
|
||||
--name spotify \
|
||||
jess/spotify
|
||||
|
||||
### 15. Audacity ###
|
||||
|
||||
Audacity is free and open source cross-platform software for recording and editing sounds. Audacity can be used for post-processing of all types of audio, including podcasts by adding effects such as normalization, trimming, and fading in and out. To run Audacity, we'll need to run the following command in a terminal or shell.
|
||||
|
||||
$ docker run --rm \
|
||||
-u $(id -u):$(id -g) \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
|
||||
-v /dev/snd:/dev/snd \
|
||||
-v "$HOME:$HOME" \
|
||||
-w "$HOME" \
|
||||
-e DISPLAY="unix$DISPLAY" \
|
||||
-e HOME \
|
||||
$(find /dev/snd/ -type c | sed 's/^/--device /') \
|
||||
knickers/audacity
|
||||
|
||||
### 16. Eclipse ###
|
||||
|
||||
Eclipse is an integrated development environment (IDE). It contains a base workspace and an extensible plug-in system for customizing the environment. It is mostly used to develop Java Based Applications.
|
||||
|
||||
$ docker run -v ~/workspace/:/home/eclipse/workspace/ \
|
||||
-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
|
||||
-d leesah/eclipse
|
||||
|
||||
### 17. VLC Media Player ###
|
||||
|
||||
VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVDs, Audio CDs, VCDs, and various streaming protocols. VLC Media Player is developed and maintained by VideoLAN Organization. To run VLC in docker environment, run the following command.
|
||||
|
||||
$ docker run -v\
|
||||
$HOME/Documents:/home/vlc/Documents:rw \
|
||||
-v /dev/snd:/dev/snd --privileged \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e uid=$(id -u) -e gid=$(id -g) \
|
||||
-e DISPLAY=unix$DISPLAY --name vlc \
|
||||
chrisdaish/vlc
|
||||
|
||||
### 18. Vim Editor ###
|
||||
|
||||
Vim is a highly configurable text-based text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.
|
||||
|
||||
$ docker run -i -t --name my-vim -v ~/:/home/dev/src haron/vim
|
||||
|
||||
### 19. Inkscape ###
|
||||
|
||||
Inkscape is a free and open-source vector graphics editor. It can create, edit vector graphics such as illustrations, diagrams, line arts, charts, logos and even complex paintings. Inkscape's primary vector graphics format is Scalable Vector Graphics (SVG) version 1.1. It can import from or export to several other formats as well but all editing workflow must inevitably occur within the constraints of SVG format.
|
||||
|
||||
$docker build -t rasch/inkscape --rm .
|
||||
$ docker run --rm -e DISPLAY \
|
||||
-u inkscaper
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-v $HOME/.Xauthority:/home/inkscaper/.Xauthority \
|
||||
--net=host rasch/inkscape
|
||||
|
||||
### 20. Filezilla ###
|
||||
|
||||
Filezilla is a free FTP solution application software. It supports FTP, SFTP, FTPS protocols. It is a powerful file management tool for client side. It is an awesome open source FTP project which is highly reliable and easy to use.
|
||||
|
||||
$ xhost +si:localuser:$(whoami)
|
||||
$ docker run \
|
||||
-d \
|
||||
-e DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
|
||||
-u docker \
|
||||
-v /:/host \
|
||||
-v $HOME/docker-data/filezilla:/home/docker/.config/filezilla/ \
|
||||
yantis/filezilla filezilla
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Running desktop application software using Docker is really an awesome experience. Docker is really an awesome platform for fast and easy development, shipping and deployment of software and packages in any place from home to office to production areas. Running desktop apps with docker is a cool way to try out the apps without really installing it into the host filesystem. So, if you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy with Docker :-)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/how-tos/20-docker-containers-desktop-user/
|
||||
|
||||
作者:[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/
|
@ -0,0 +1,253 @@
|
||||
30 Things to Do After Minimal RHEL/CentOS 7 Installation--3
|
||||
================================================================================
|
||||
### 12. Install Apache Tomcat ###
|
||||
|
||||
Tomcat is a servlet container designed by Apache to run Java HTTP web server. Install tomcat as below but it is necessary to point out that you must have installed Java prior of installing tomcat.
|
||||
|
||||
# yum install tomcat
|
||||
|
||||
![Install Apache Tomcat](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-Tomcat.jpeg)
|
||||
Install Apache Tomcat
|
||||
|
||||
After tomcat has been installed, star the tomcat service.
|
||||
|
||||
# systemctl start tomcat
|
||||
|
||||
Check Version of tomcat.
|
||||
|
||||
# /usr/sbin/tomcat version
|
||||
|
||||
![Check Tomcat Version](http://www.tecmint.com/wp-content/uploads/2015/04/Check-tomcat-version.jpeg)
|
||||
Check Tomcat Version
|
||||
|
||||
Add service tomcat and default port (8080) through firewall and reload settings.
|
||||
|
||||
# firewall-cmd –zone=public –add-port=8080/tcp --permannet
|
||||
# firewall-cmd –reload
|
||||
|
||||
Now it’s time to secure tomcat server, create a user and a password to access and manage. We need to edit file ‘/etc/tomcat/tomcat-users.xml‘. See the section which looks like:
|
||||
|
||||
<tomcat-users>
|
||||
....
|
||||
</tomcat-users>
|
||||
|
||||
|
||||
<role rolename="manager-gui"/>
|
||||
<role rolename="manager-script"/>
|
||||
<role rolename="manager-jmx"/>
|
||||
<role rolename="manager-status"/>
|
||||
<role rolename="admin-gui"/>
|
||||
<role rolename="admin-script"/>
|
||||
<user username="tecmint" password="tecmint" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
|
||||
</tomcat-users>
|
||||
|
||||
![Secure Tomcat](http://www.tecmint.com/wp-content/uploads/2015/04/Secure-Tomcat.jpeg)
|
||||
Secure Tomcat
|
||||
|
||||
Here we added user “tecmint” to administer/manage tomcat using password “tecmint”. Stop and start the service tomcat so that the changes are taken into effect and enable tomcat service to start at system boot.
|
||||
|
||||
# systemctl stop tomcat
|
||||
# systemctl start tomcat
|
||||
# systemctl enable tomcat.service
|
||||
|
||||
Read Also: Installing and Configuring Apache Tomcat 8.0.9 in RHEL/CentOS 7.0/6.x
|
||||
|
||||
### 13. Install Nmap to Monitor Open Ports ###
|
||||
|
||||
Nmap for Network Mapper creates a map of the network by discovering host on which it is running as well as by analyzing network. nmap is not included in the default installation and you have to install it from repository.
|
||||
|
||||
# yum install nmap
|
||||
|
||||
![Install Nmap Monitoring Tool](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Nmap.jpeg)
|
||||
Install Nmap Monitoring Tool
|
||||
|
||||
List all open ports and corresponding services using them on host.
|
||||
|
||||
# namp 127.0.01
|
||||
|
||||
![Monitor Open Ports](http://www.tecmint.com/wp-content/uploads/2015/04/Monitor-Open-Ports.jpeg)
|
||||
Monitor Open Ports
|
||||
|
||||
You may also use firewall-cmd to list all the ports, however I find nmap more useful.
|
||||
|
||||
# firewall-cmd –list-ports
|
||||
|
||||
![Check Open Ports in Firewall](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Open-Ports-in-Firewall.jpeg)
|
||||
Check Open Ports in Firewall
|
||||
|
||||
Read Also: [29 Useful Nmap Command to Monitor Open Ports][1]
|
||||
|
||||
### 14. FirewallD Configuration ###
|
||||
|
||||
firewalld is a firewall service which manages the server dynamically. Firewalld removed iptables in CentOS 7. Firewalld is installed by default on RedHat Enterprise Linux and its derivatives by default. With iptables every change in order to be taken into effect needs to flush all the old rules and create new rules.
|
||||
|
||||
However with firewalld, no flushing and recreating of new rules required and only changes are applied on the fly.
|
||||
|
||||
Check if Firewalld is running or not.
|
||||
|
||||
# systemctl status firewalld
|
||||
OR
|
||||
# firewall-cmd –state
|
||||
|
||||
![Check Firewalld Status](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Firewalld-Status.jpeg)
|
||||
Check Firewalld Status
|
||||
|
||||
Get a list of all the zones.
|
||||
|
||||
# firewall-cmd --get-zones
|
||||
|
||||
![Check Firewalld Zones](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Firewalld-Zones.jpeg)
|
||||
Check Firewalld Zones
|
||||
|
||||
To get details on a zone before switching.
|
||||
|
||||
# firewall-cmd --zone=work --list-all
|
||||
|
||||
![Check Zone Details](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Zone-Details.jpeg)
|
||||
Check Zone Details
|
||||
|
||||
To get default zone.
|
||||
|
||||
# firewall-cmd --get-default-zone
|
||||
|
||||
![Firewalld Default Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Firewalld-Default-Zone.jpeg)
|
||||
Firewalld Default Zone
|
||||
|
||||
To switch to a different zone say ‘work‘.
|
||||
|
||||
# firewall-cmd --set-default-zone=work
|
||||
|
||||
![Swich Firewalld Zones](http://www.tecmint.com/wp-content/uploads/2015/04/Swich-Zones.jpeg)
|
||||
Swich Firewalld Zones
|
||||
|
||||
To list all the services in the zone.
|
||||
|
||||
# firewall-cmd --list-services
|
||||
|
||||
![List Firewalld Zone Services](http://www.tecmint.com/wp-content/uploads/2015/04/List-Firewalld-Service.jpeg)
|
||||
List Firewalld Zone Services
|
||||
|
||||
To add a service say http, temporarily and reload firewalld.
|
||||
|
||||
# firewall-cmd --add-service=http
|
||||
# firewall-cmd –reload
|
||||
|
||||
Add http Service Temporarily
|
||||
|
||||
Add http Service Temporarily
|
||||
|
||||
To add a service say http, permanently and reload firewalld.
|
||||
|
||||
# firewall-cmd --add-service=http --permanent
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Add http Service Permanent](http://www.tecmint.com/wp-content/uploads/2015/04/Add-http-Service-Temporarily.jpeg)
|
||||
Add http Service Permanent
|
||||
|
||||
To remove a service say http, temporarily.
|
||||
|
||||
# firewall-cmd --remove-service=http
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Remove Firewalld Service Temporarily](http://www.tecmint.com/wp-content/uploads/2015/04/Add-http-Service-Permanent.jpeg)
|
||||
Remove Firewalld Service Temporarily
|
||||
|
||||
To remove a service say http, permanently.
|
||||
|
||||
# firewall-cmd --zone=work --remove-service=http --permanent
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Remove Service Permanently](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Service-Parmanently.jpeg)
|
||||
Remove Service Permanently
|
||||
|
||||
To allow a port (say 331), temporarily.
|
||||
|
||||
# firewall-cmd --add-port=331/tcp
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Open Firewalld Port Temporarily](http://www.tecmint.com/wp-content/uploads/2015/04/Open-Port-Temporarily.jpeg)
|
||||
Open Port Temporarily
|
||||
|
||||
To allow a port (say 331), permanently.
|
||||
|
||||
# firewall-cmd --add-port=331/tcp --permanent
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Open Port in Firewalld Permanent](http://www.tecmint.com/wp-content/uploads/2015/04/Open-Port-Permanent.jpeg)
|
||||
Open Port Permanently
|
||||
|
||||
To block/remove a port (say 331), temporarily.
|
||||
|
||||
# firewall-cmd --remove-port=331/tcp
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Remove Port Temporarily in Firewalld](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Port-Temporarily.jpeg)
|
||||
Remove Port Temporarily
|
||||
|
||||
To block/remove a port (say 331), permanently.
|
||||
|
||||
# firewall-cmd --remove-port=331/tcp --permanent
|
||||
# firewall-cmd --reload
|
||||
|
||||
![Remove Port Permanently in Firewalld](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Port-Permanently.jpeg)
|
||||
Remove Port Permanently
|
||||
|
||||
To disable firewalld.
|
||||
|
||||
# systemctl stop firewalld
|
||||
# systemctl disable firewalld
|
||||
# firewall-cmd --state
|
||||
|
||||
![Disable Firewalld in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/04/Disable-Firewalld.jpeg)
|
||||
Disable Firewalld Service
|
||||
|
||||
To enable firewalld.
|
||||
|
||||
# systemctl enable firewalld
|
||||
# systemctl start firewalld
|
||||
# firewall-cmd --state
|
||||
|
||||
![Enable Firewalld in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Firewalld.jpeg)
|
||||
Enable Firewalld
|
||||
|
||||
- [How to Configure ‘FirewallD’ in RHEL/CentOS 7][2]
|
||||
- [Useful ‘FirewallD’ Rules to Configure and Manage Firewall][3]
|
||||
|
||||
### 15. Installing Wget ###
|
||||
|
||||
wget is a Linux command line based utility that retrieves (downloads) content from web servers. It is an important tool you must have to retrieve web contents or download any files using wget command.
|
||||
|
||||
# yum install wget
|
||||
|
||||
![Install Wget Tool](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Wget.png)
|
||||
Install Wget Tool
|
||||
|
||||
For more usage and practical examples on how to use wget command to download files on the terminal, read [10 Wget Command Examples][4].
|
||||
|
||||
### 16. Installing Telnet ###
|
||||
|
||||
Telnet is a network protocol that enables a user to login into another computer on the same network over TCP/IP. Once connection etablished to the remote computer it becomes a virtual terminal and allow you to communicate with the remote host within your computer as per whatever privileges provided to you.
|
||||
|
||||
Telnet also very useful for checking listening ports on remote computer or host.
|
||||
|
||||
# yum install telnet
|
||||
# telnet google.com 80
|
||||
|
||||
![Telnet Port Checking](http://www.tecmint.com/wp-content/uploads/2015/04/telnet-testing.png)
|
||||
Telnet Port Checking
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/3/
|
||||
|
||||
作者:[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/nmap-command-examples/
|
||||
[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/
|
||||
[3]:http://www.tecmint.com/firewalld-rules-for-centos-7/
|
||||
[4]:http://www.tecmint.com/10-wget-command-examples-in-linux/
|
@ -0,0 +1,176 @@
|
||||
30 Things to Do After Minimal RHEL/CentOS 7 Installation--4
|
||||
================================================================================
|
||||
### 17. Installing Webmin ###
|
||||
|
||||
Webmin is a Web based configuration tool for Linux. It acts as a central system to configure various system configuration like users, disk quota, services and configurations of HTTP server, Apache, MySQL, etc.
|
||||
|
||||
# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.740-1.noarch.rpm
|
||||
# rpm -ivh webmin-*.rpm
|
||||
|
||||
![Install Webmin on CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Webmin.jpeg)
|
||||
Install Webmin
|
||||
|
||||
After webmin installation, you will get a message on terminal to login to your host (http://ip-address:10000) using your root password on port number 10000. If running a headless server you can forward the port and access it on a machine/server that is headed.
|
||||
|
||||
### 18. Enable Third Party Repositories ###
|
||||
|
||||
It is not a good idea to add untrusted repositories specially in production and it may be fatal. However just for example here we will be adding a few community approved trusted repositories to install third party tools and packages.
|
||||
|
||||
Add Extra Package for Enterprise Linux (EPEL) Repository.
|
||||
|
||||
# yum install epel-release
|
||||
|
||||
Add Community Enterprise Linux Repository.
|
||||
|
||||
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
|
||||
|
||||
![Install Epel Repo](http://www.tecmint.com/wp-content/uploads/2015/04/install-epel-repo.jpeg)
|
||||
Install Epel Repo
|
||||
|
||||
**Attention**! Extra care is needs to be taken while adding Third Party Repository.
|
||||
|
||||
### 19. Install 7-zip Utility ###
|
||||
|
||||
In the CentOS Minimal Install you don’t get utility like unzip or unrar. We have the option to install each utility as required or an utility that servers for all. 7-zip is such an utility which compress and extract files of all known types.
|
||||
|
||||
# yum install p7zip
|
||||
|
||||
![Install 7zip Tool](http://www.tecmint.com/wp-content/uploads/2015/04/Install-7zip-tool.jpeg)
|
||||
Install 7zip Tool
|
||||
|
||||
**Notice**: The package is downloaded and installed from Fedora EPEL 7 Repository.
|
||||
|
||||
### 20. Install NTFS-3G Driver ###
|
||||
|
||||
A small yet very useful NTFS driver called NTFS-3G is available for most of the UNIX-like distribution. It is useful to mount and access Windows NTFS file system. Though other alternatives like Tuxera NTFS is available, NTFS-3G is most widely used.
|
||||
|
||||
# yum install ntfs-3g
|
||||
|
||||
![Install NTFS-3G in CentOS](http://www.tecmint.com/wp-content/uploads/2015/04/Install-NTFS-3G.jpeg)
|
||||
Install NTFS-3G to Mount Windows Partition
|
||||
|
||||
After installing ntfs-3g has been installed, you can mount Windows NTFS partitions (where /dev/sda5 is my windows drive) using following command.
|
||||
|
||||
# mount -ro ntfs-3g /dev/sda5 /mnt
|
||||
# cd /mnt
|
||||
# ls -l
|
||||
|
||||
### 21. Install Vsftpd FTP Server ###
|
||||
|
||||
VSFTPD which stands for Very Secure File Transfer Protocol Daemon is a FTP server for UNIX-like System. It is one of the most efficient and secure FTP Server available today.
|
||||
|
||||
# yum install vsftpd
|
||||
|
||||
![Install Vsftpd in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/04/Install-FTP.jpeg)
|
||||
Install Vsftpd FTP
|
||||
|
||||
Edit the configuration file located at ‘/etc/vsftpd/vsftpd.conf‘ to secure vsftpd.
|
||||
|
||||
# vi /etc/vsftpd/vsftpd.conf
|
||||
|
||||
Edit a few fields and leave other as it is, unless you know what you are doing.
|
||||
|
||||
anonymous_enable=NO
|
||||
local_enable=YES
|
||||
write_enable=YES
|
||||
chroot_local_user=YES
|
||||
|
||||
You may also change the port number and open vsftpd port through the firewall.
|
||||
|
||||
# firewall-cmd --add-port=21/tcp
|
||||
# firewall-cmd --reload
|
||||
|
||||
Next restart vsftpd and enable to start at boot time.
|
||||
|
||||
# systemctl restart vsftpd
|
||||
# systemctl enable vsftpd
|
||||
|
||||
### 22. Install and Configure sudo ###
|
||||
|
||||
sudo which is commonly called as super do as well as suitable user do is a program for UNIX-like operating system to execute a program with the security privileged of another user. Let’s see how to configure sudo…
|
||||
|
||||
# visudo
|
||||
|
||||
It will open the file /etc/sudoers for editing..
|
||||
|
||||
![sudoers File](http://www.tecmint.com/wp-content/uploads/2015/04/sudoers-File.jpeg)
|
||||
sudoers File
|
||||
|
||||
Give all the permission (equal to root) to a user (say tecmint), that has already been created.
|
||||
|
||||
tecmint ALL=(ALL) ALL
|
||||
|
||||
Give all the permission (equal to root) to a user (say tecmint), except the permission to reboot and shutdown the server.
|
||||
|
||||
Again open the same file and edit it with the below contents.
|
||||
|
||||
cmnd_Alias nopermit = /sbin/shutdown, /sbin/reboot
|
||||
|
||||
Then add alias with Logical (!) operator.
|
||||
|
||||
tecmint ALL=(ALL) ALL,!nopermit
|
||||
|
||||
Give permission to a group (say debian) to run a few root privilege command say (add user and delete user) .
|
||||
|
||||
cmnd_Alias permit = /usr/sbin/useradd, /usr/sbin/userdel
|
||||
|
||||
And then add the permission to group debian.
|
||||
|
||||
debian ALL=(ALL) permit
|
||||
|
||||
### 23. Install and Enable SELinux ###
|
||||
|
||||
SELinux which stands for Security-Enhanced Linux is a security module at kernel level.
|
||||
|
||||
# yum install selinux-policy
|
||||
|
||||
![Install SElinux in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/04/Install-SElinux.jpeg)
|
||||
Install SElinux Policy
|
||||
|
||||
Check SELinux Mode.
|
||||
|
||||
# getenforce
|
||||
|
||||
![Check SELinux Mode](http://www.tecmint.com/wp-content/uploads/2015/04/Check-SELinux-Mode.jpeg)
|
||||
Check SELinux Mode
|
||||
|
||||
The output is enforcing mode which means SELinux policy is in effect.
|
||||
|
||||
For debugging, set selinux mode to permissive temporarily. No need to reboot.
|
||||
|
||||
# setenforce 0
|
||||
|
||||
After debugging set selinux to enforcing again without rebooting.
|
||||
|
||||
# setenforce 1
|
||||
|
||||
### 24. Install Rootkit Hunter ###
|
||||
|
||||
Rootkit Hunter abbreviated as Rkhunter is an application that scan rootkits and other potentially harmful exploits in Linux systems.
|
||||
|
||||
# yum install rkhunter
|
||||
|
||||
![Install Rootkit Hunter](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Rootkit-Hunter.jpeg)
|
||||
Install Rootkit Hunter
|
||||
|
||||
Run rkhunter as a scheduled job, from a script file or manually to scan harmful exploits in Linux.
|
||||
|
||||
# rkhunter --check
|
||||
|
||||
![Scan for rootkits](http://www.tecmint.com/wp-content/uploads/2015/04/Scan-for-rootkits.png)
|
||||
Scan for rootkits
|
||||
|
||||
![RootKit Scan Results](http://www.tecmint.com/wp-content/uploads/2015/04/RootKit-Results.png)
|
||||
RootKit Scan Results
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/4/
|
||||
|
||||
作者:[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/
|
@ -0,0 +1,135 @@
|
||||
30 Things to Do After Minimal RHEL/CentOS 7 Installation--5
|
||||
================================================================================
|
||||
### 25. Install Linux Malware Detect (LMD) ###
|
||||
|
||||
Linux Malware Detect (LMD) is a open source Linux malware scanner released under the GNU GPLv2 license, that is
|
||||
specially designed for threats faced in hosting environments. For complete installation, configuration and usage of LMD can be found at:
|
||||
|
||||
- [Install and Use (LMD) with ClamAV as Antivirus Engine][1]
|
||||
|
||||
### 26. Server Bandwidth Testing with Speedtest-cli ###
|
||||
|
||||
speedtest-cli is a tool written in python to test internet bandwidth including download and upload speed. For complete installation and usage of speedtest-cli tool, read our article at [Check Linux Server Bandwidth Speed from Command Line][2]
|
||||
|
||||
### 27. Configure Cron Jobs ###
|
||||
|
||||
This is one of the most widely used software utility. It function as job scheduler i.e., schedule a job now that will execute in future itself. It is useful in logging and maintaining records unattained as well as several other routine work like regular backup. All the schedule is written in /etc/crontab file.
|
||||
|
||||
The crontab file contains 6 fields as follows:
|
||||
|
||||
Minutes Hour Day of Month Month of Year Week Day Command
|
||||
(0-59) (0-23) (1-31) (1/jan-12/dec) (0-6/sun-sat) Command/script
|
||||
|
||||
![Crontab Fields](http://www.tecmint.com/wp-content/uploads/2015/04/Crontab-Fields.jpeg)
|
||||
Crontab Fields
|
||||
|
||||
To run a cron job (say run /home/$USER/script.sh) everyday at 04:30 am.
|
||||
|
||||
Minutes Hour Day of Month month of year Week Day command
|
||||
30 4 * * * speedtest-cli
|
||||
|
||||
Add the following entry to the crontab file ‘/etc/crontab/‘.
|
||||
|
||||
30 4 * * * /home/$user/script.sh
|
||||
|
||||
After adding the above line to crontab, it will run automatically at 04:30 am everyday and the output depends upon what is there in script file. Moreover script can be replaced by commands. For more examples of cron jobs, read [11 Cron Jobs Examples in Linux][3]
|
||||
|
||||
### 28. Install Owncloud ###
|
||||
|
||||
Owncloud is a HTTP based data synchronization, file sharing and remote file storage application. For more detail on installing own cloud, you may like to see this article : [Create Personal/Private Cloud Storage in Linux][4]
|
||||
|
||||
### 29. Enable Virtualization with Virtualbox ###
|
||||
|
||||
Virtualization is a process of creating virtual OS, Hardware and Network, is one of the most sought technology of these days. We will be discussing on how to install and configure virtualization in detail.
|
||||
|
||||
Our CentOS Minimal server is a headless server. Lets prepare it to host virtual machines that is accessible over HTTP by installing following packages.
|
||||
|
||||
# yum groupinstall 'Development Tools' SDL kernel-devel kernel-headers dkms
|
||||
|
||||
![Install Development Tools](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Development-Tool.jpeg)
|
||||
Install Development Tools
|
||||
|
||||
Change working directory to ‘/etc/yum.repos.d/‘ and download Virtualbox repository.
|
||||
|
||||
# wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
|
||||
|
||||
Install the key just downloaded.
|
||||
|
||||
# rpm --import oracle_vbox.asc
|
||||
|
||||
Update and Install Virtualbox.
|
||||
|
||||
# yum update && yum install virtualbox-4.3
|
||||
|
||||
Next, download and install Virtualbox extension pack.
|
||||
|
||||
# wget http://download.virtualbox.org/virtualbox/4.3.12/Oracle_VM_VirtualBox_Extension_Pack-4.3.12-93733.vbox-extpack
|
||||
# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.12-93733.vbox-extpack
|
||||
|
||||
![Install Virtualbox Extension Pack](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Virtualbox-Extension-Pack.jpeg)
|
||||
Install Virtualbox Extension Pack
|
||||
|
||||
![Installing Virtualbox Extension Pack](http://www.tecmint.com/wp-content/uploads/2015/04/Installing-Virtualbox-Extension-Pack.jpeg)
|
||||
Installing Virtualbox Extension Pack
|
||||
|
||||
Create a user ‘vbox‘ to manage virtualbox and add it to group vboxusers.
|
||||
|
||||
# adduser vbox
|
||||
# passwd vobx
|
||||
# usermod -G vboxusers vbox
|
||||
|
||||
Install HTTPD server.
|
||||
|
||||
# yum install httpd
|
||||
|
||||
Install PHP (with soap extension).
|
||||
|
||||
# yum install php php-devel php-common php-soap php-gd
|
||||
|
||||
Download PHP virtualBox.
|
||||
|
||||
# wget http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.3-1.zip
|
||||
|
||||
Extract the zip and copy the extracted folder to HTTP working directory.
|
||||
|
||||
# unzip phpvirtualbox-4.*.zip
|
||||
# cp phpvirtualbox-4.3-1 -R /var/www/html
|
||||
|
||||
Next, rename file /var/www/html/phpvirtualbox/config.php-example to var/www/html/phpvirtualbox/config.php.
|
||||
|
||||
# mv config.php.example config.php
|
||||
|
||||
Open the configuration file to edit and add ‘username‘ and ‘password‘ we just created in the above step.
|
||||
|
||||
# vi config.php
|
||||
|
||||
Finally, restart VirtualBox and HTTP server.
|
||||
|
||||
# service vbox-service restart
|
||||
# service httpd restart
|
||||
|
||||
Now forward the port and access it on a headed server.
|
||||
|
||||
http://192.168.0.15/phpvirtualbox-4.3-1/
|
||||
|
||||
![PHP Virtualbox Login](http://www.tecmint.com/wp-content/uploads/2015/04/PHP-Virtualbox-Login.png)
|
||||
PHP Virtualbox Login
|
||||
|
||||
![PHP Virtualbox Dashboard](http://www.tecmint.com/wp-content/uploads/2015/04/PHP-Virtualbox.png)
|
||||
PHP Virtualbox Dashboard
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/5/
|
||||
|
||||
作者:[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/install-linux-malware-detect-lmd-in-rhel-centos-and-fedora/
|
||||
[2]:http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/
|
||||
[3]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/
|
||||
[4]:http://www.tecmint.com/install-owncloud-to-create-personal-storage-in-linux/
|
@ -0,0 +1,80 @@
|
||||
30 Things to Do After Minimal RHEL/CentOS 7 Installation--6
|
||||
================================================================================
|
||||
### 30. Password Protect GRUB ###
|
||||
|
||||
Password protect your boot loader so that you get an additional level of security right at the booting time. Also you get a protection layer of protection at physical level. Protect your Server by locking GRUB at boot to avoid any unauthorized access.
|
||||
|
||||
First make backup of two files, so that if anything goes bad, you have the option to revert back. Create a backup of ‘/etc/grub2/grub.cfg‘ as ‘/etc/grub2/grub.cfg.old‘.
|
||||
|
||||
# cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.old
|
||||
|
||||
Also, Create a backup of ‘/etc/grub.d/10_linux‘ as ‘/etc/grub.d/10_linux.old‘.
|
||||
|
||||
# cp /etc/grub.d/10_linux /etc/grub.d/10_linux.old
|
||||
|
||||
Now open ‘/etc/grub.d/10_linux‘ and add the below line at the end of the file.
|
||||
|
||||
cat <<EOF
|
||||
set superusers=”tecmint”
|
||||
Password tecmint avi@123
|
||||
EOF
|
||||
|
||||
![Password Protect Grub](http://www.tecmint.com/wp-content/uploads/2015/04/Password-Protect-Grub.png)
|
||||
Password Protect Grub
|
||||
|
||||
Notice in the above file, replace “tecmint” as username and “avi@123” as password with your username and password.
|
||||
|
||||
Now generate the new grub.cfg file by issuing following command.
|
||||
|
||||
# grub2-mkconfig --output=/boot/grub2/grub.cfg
|
||||
|
||||
![Generate Grub File](http://www.tecmint.com/wp-content/uploads/2015/04/Generate-Grub-File.jpeg)
|
||||
Generate Grub File
|
||||
|
||||
After creating new grub.cfg file, reboot the machine and press ‘e‘ to edit. You will find that it requires you to enter ‘valid credentials‘ in order to edit boot menu.
|
||||
|
||||
![Password Protected Boot Menu](http://www.tecmint.com/wp-content/uploads/2015/04/Edit-Boot-Menu.jpeg)
|
||||
Password Protected Boot Menu
|
||||
|
||||
After entering login credentials, you will able to edit grub boot menu.
|
||||
|
||||
![Grub Menu File](http://www.tecmint.com/wp-content/uploads/2015/04/Grub-Menu-Edit.jpeg)
|
||||
Grub Menu File
|
||||
|
||||
Also you can generate encrypted password in place of plain password as shown in the above step. First generate an encrypted password as suggested below.
|
||||
|
||||
# grub2-mkpasswd-pbkdf2
|
||||
|
||||
[Enter Normal password twice]
|
||||
|
||||
![Generate Encrypted Grub Password](http://www.tecmint.com/wp-content/uploads/2015/04/Generate-Encrypted-Grub-Password.jpeg)
|
||||
Generate Encrypted Grub Password
|
||||
|
||||
Now open ‘/etc/grub.d/10_linux‘ file and add the below line at the end of the file.
|
||||
|
||||
cat <<EOF
|
||||
set superusers=”tecmint”
|
||||
Password_pbkdf2 tecmint
|
||||
grub.pbkdf2.sha512**************************************************
|
||||
EOF
|
||||
|
||||
![Encrypted Grub Password](http://www.tecmint.com/wp-content/uploads/2015/04/Encrypted-Grub-Password.jpeg)
|
||||
Encrypted Grub Password
|
||||
|
||||
Replace the password with the one generated on your system. Don’t forget to cross check the password.
|
||||
|
||||
Also note you need to generate grub.cfg in this case as well, as described above. Reboot and next time you press ‘e‘ to edit, you will be prompted for username and password.
|
||||
|
||||
We’ve tried to cover most of the necessary post-installation points of industry standard distributions RHEL 7 and CentOS 7. If you find that we’ve missed certain points or you need to extend this post with a new post-install things, you may share with us, we will include your point in this article by extending it.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/6/
|
||||
|
||||
作者:[vishek 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/
|
320
translated/share/20140804 Group Test--Linux Text Editors.md
Normal file
320
translated/share/20140804 Group Test--Linux Text Editors.md
Normal file
@ -0,0 +1,320 @@
|
||||
组测试: Linux 文本编辑器
|
||||
================================================================================
|
||||
> Mayank Sharma 测试了5款不仅仅是能处理字的超级文本编辑器。
|
||||
|
||||
如果你使用Linux已经有很长一段时间,你知道,不管是编辑一款app的配置文件,一起用shell脚本骇客,或者编写/查看代码,类似LobreOffice的工具并不能满足。尽管字面上看起来意思一样,你不需要一个字处理器来完成这些任务;你需要一个文本编辑器。
|
||||
|
||||
在这个组测试中,我们将着眼于5款不仅仅是能胜任繁重文本任务的简陋的文本编辑器。他们能高亮语法,像拼写检查一样轻松处理代码缩进。你可以像你复制/粘贴文本那样容易地使用他们记录宏以及管理代码片段。
|
||||
|
||||
得益于能向它们注入足以抗衡其它类型的以文本为中心的应用程序能力的插件,一些简单的文本编辑器甚至超过了它们的设计目标。它们能胜任一个源代码编辑器的任务,甚至是一个集成开发环境。
|
||||
|
||||
Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一些原因,我们在这个组测试中并没有包括它们。首先,如果你使用它们中的任何一个,那么恭喜你:你不需要更换了。其次,它们都有陡峭的学习曲线,尤其是对于那些对有面向图形用户界面的桌面系统的替代能力更有兴趣的用户。
|
||||
|
||||
### 目录: ###
|
||||
|
||||
#### Gedit ####
|
||||
|
||||
- URL:http://projects.gnome.org/gedit/
|
||||
- 版本: 3.10
|
||||
- 许可证: GPL
|
||||
- Gnome的默认文本编辑器准备好挑战了?
|
||||
|
||||
#### Kate ####
|
||||
|
||||
- URL: www.kate-editor.org
|
||||
- 版本: 3.11
|
||||
- 许可证: LGPL/GPL
|
||||
- Kate会挑战命运吗?
|
||||
|
||||
#### Sublime Text ####
|
||||
|
||||
- URL: www.sublimetext.com
|
||||
- 版本: 2.0.2
|
||||
- 许可证: Proprietary
|
||||
- 在自由与黄金心脏土地上的私有软件。
|
||||
|
||||
#### UltraEdit ####
|
||||
|
||||
- URL: www.ultraedit.com
|
||||
- 版本: 4.1.0.4
|
||||
- 许可证: Proprietary
|
||||
- 它做的足够多去证明它的价值了吗?
|
||||
|
||||
#### jEdit ####
|
||||
|
||||
- URL: www.jedit.org
|
||||
- 版本: 5.1.0
|
||||
- 许可证: GPL
|
||||
- 基于Java的编辑器是否会扰乱其他编辑器的世界?
|
||||
|
||||
![在展示一个有功能的应用程序和将它们所有的东西曝光给用户之间有一个很好的平衡。Geddit隐藏了它的大部分功能。](http://www.linuxvoice.com/wp-content/uploads/2014/07/gedit-web.png)
|
||||
在展示一个有功能的应用程序和将它们所有的东西曝光给用户之间有一个很好的平衡。Geddit隐藏了它的大部分功能。
|
||||
|
||||
### 关键标准 ###
|
||||
|
||||
除了Gedit和jEdit以外的所有工具,都是通过推荐的安装方法安装在Fedora和Ubuntu上。前者已经兼容默认的Gnome桌面,后者仍然固执地反对安装在Fedora上。由于这些是相对简单的应用程序,他们没有复杂的依赖,唯一例外的是jEdit,它要求要有Oracle Java。
|
||||
|
||||
得益于Gnome和KDE持续的努力,不论他们运行的桌面环境,所有编辑器看起来很好,功能也很正常。这不仅是作为环境评价的标准,也意味着你不再受制于要找到和你的桌面环境兼容的工具。
|
||||
|
||||
除了它们老派的功能,我们也对所有候选者测试了通用文本编辑功能。然而,它们并没有被设计为模仿现代字处理器的所有功能,我们也不以此评判。
|
||||
|
||||
![Kate能搭建为功能丰富的集成开发环境](http://www.linuxvoice.com/wp-content/uploads/2014/08/kate-web.png)
|
||||
|
||||
Kate能搭建为功能丰富的集成开发环境。
|
||||
|
||||
### 编程语言支持 ###
|
||||
|
||||
UltraEdit 能进行语法高亮,代码折叠以及拥有项目管理的能力。这也有一个罗列源文件中所有功能的功能列表,但并不适用于我们任何的测试代码文件。UltraEdit也支持HTML5,有能添加常用HTML标记的HTML工具栏。
|
||||
|
||||
即使Gnome的默认文本编辑器Gedit,也有几个面向编码的功能特性,例如括号匹配,自动缩进以及为包括C, C++, Java, HTML, XML, Python, Perl, 以及许多其它编程语言进行语法高亮。
|
||||
|
||||
如果你需要更多的编程辅助,看一下Sublime和Kate。Sublime支持多种编程语言并且(正如流行的那些)能为C#, D, Dylan, Erlang, Groovy, Haskell, Lisp, Lua, MATLAB, OCaml, R, 甚至 SQL 进行语法高亮。如果这还不够,你可以下载插件以支持更多的语言。
|
||||
|
||||
另外,它的语法高亮功能提供了多个可定制选项。这个应用程序也会进行括号匹配,确保代码段都正确,Sublime的自动补全功能也支持用户创建的变量。
|
||||
|
||||
正如Komodo IDE,Sublime也可滚动浏览显示完整的代码,这对于长代码文件导航和在文件中的不同部分跳转很方便。
|
||||
|
||||
Sublime最好的功能之一就是能在编辑器内部为特定语言,例如C++, Python, Ruby等运行代码,当然假设在你的电脑上安装有编译器以及其它系统工具。
|
||||
|
||||
你也可以用插件在Kate中开启构建系统功能。另外,你可以为GDB调试器添加一个简单的前端。Kate能和Git,Subversion以及Mercurial版本控制系统一起工作,也提供了一些项目管理的功能。
|
||||
|
||||
除了能为超过180中语言进行语法高亮,它支持所有的这些辅助功能,例如括号匹配,自动补全和自动缩进。它也支持代码折叠,甚至在一个程序中包括有错误的函数。
|
||||
|
||||
jEdit是唯一的遗憾,它声称自己是一个程序员的文本编辑器,但它缺少其他的基本功能,例如代码折叠,它甚至不支持补全功能。
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit:3/5
|
||||
- Kate:5/5
|
||||
- Sublime:5/5
|
||||
- UltraEdit3/5
|
||||
- jEdit:1/5
|
||||
|
||||
![如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22中主题。](http://www.linuxvoice.com/wp-content/uploads/2014/08/sublime-web.png)
|
||||
|
||||
如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22中主题。
|
||||
|
||||
### 键盘控制 ###
|
||||
|
||||
高级文本编辑器用户希望能完全通过键盘控制和操作,一些应用程序甚至运行他们的用户自定义快捷方式的键盘绑定。
|
||||
|
||||
你可以轻松的使用Gedit的扩展键盘快捷键。这里有编辑文件,为普通任务,例如对一个文档进行拼写检查,唤起工具的快捷键。你可以获取应用程序内部的一系列默认快捷键,但并没有图形化的方式去自定义它们。相似的,在Sublime中自定义键绑定,你需要修改他的XML键映射文件。Sublime由于缺少定义键盘快捷键的图形化界面而饱受批评,但长期使用的用户已经支持当前的基于文件的机制,这给他们更多的控制能力。
|
||||
|
||||
UltraEdit为它"一切都可自定义"的座右铭感到自豪,这也包括键盘快捷键。你可以自定义菜单导航的热键,以及定义你自己的访问大量函数的多键键映射。
|
||||
|
||||
除了完全可自定义的键盘快捷键以外,jEdit也有为Emacs预定义的键映射。Kate在这方面尤其令人映像深刻。它有简单可访问的自定义键绑定窗口。你可以更改默认的键,或者定义替代的键。另外,Kate也有一个能使用户使用Vi键操作Kate的Vi模式。
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit:2/5
|
||||
- Kate:5/5
|
||||
- Sublime:3/5
|
||||
- UltraEdit:4/5
|
||||
- jEdit:5/5
|
||||
|
||||
### 片段和宏 ###
|
||||
|
||||
宏通过自动化重复的步骤帮助你降低花费在编辑和组织数据上的时间,而代码片段通过创建可重用的源代码块为程序员扩展类似的功能。这两者都能节省你的时间。
|
||||
|
||||
标准的Gedit安装没有这两种功能中的任何一种,但是你可以通过独立的插件启用这些功能。片段插件随Gedit一起发布,但在Gedit内部启用宏插件之前你需要手动下载和安装(被称为gedit-macropy,托管在GitHub上)。
|
||||
|
||||
Kate也同样通过插件的形式启用片段功能。一旦加入,插件也增加了片段的PHP,Bash和Java库。你可以在侧边栏中显示片段列表以便于访问。可以通过右击片段或者快捷键组合方式编辑它的内容。然而,令人惊讶的是,它不支持宏-尽管用户从2002年开始重复要求!
|
||||
|
||||
jEdit也有一个启用片段的插件。但是它可以从用户行为中记录宏或者你也可以在BeanShell 脚本语言(BeanShell支持像Perl和JavaScript那样将脚本对象封锁为简单的方法)中写宏。jEdit也有一个可以从jEdit的网站中下载多种宏的插件。
|
||||
|
||||
Sublime有创建片段和宏的内建功能,也有为大多数编程语言经常使用的函数多种片段。
|
||||
|
||||
在UltraEdit中片段被称为智能模板,正如Sublime你可以根据正在编辑的源代码文件类型插入片段。要完成宏记录功能,UltraEdit还有一个基于JavaScript的集成脚本语言来完成自动任务。你也可以从编辑器的网站中下载用户提交的宏和脚本。
|
||||
|
||||
**Verdict:**
|
||||
|
||||
- Gedit:3/5
|
||||
- Kate:1/5
|
||||
- Sublime:5/5
|
||||
- UltraEdit:5/5
|
||||
- jEdit:5/5
|
||||
|
||||
![UltraEdit的用户界面是高度可配置的 — 你可以正如改变其它许多方面那样简单的自定义工具栏和菜单的布局。](http://www.linuxvoice.com/wp-content/uploads/2014/08/ultraedit-web.png)
|
||||
|
||||
UltraEdit的用户界面是高度可配置的 — 你可以正如改变其它许多方面那样简单的自定义工具栏和菜单的布局。]
|
||||
|
||||
### 易用性 ###
|
||||
|
||||
不像一个准系统文本编辑器,文本编辑器的这个功能洋溢着适应大范围用户的功能 - 从文档写作者到程序员。从应用程序剥离相反,他们的开发者在寻找添加更多功能的途径。
|
||||
|
||||
尽管第一眼看上去这次组测试中的大部分应用有一个很相似的布局,经过仔细的检查,你会发现一些可用性差异。我们通过用户界面的合理使用来介绍它们的功能和特性,而不是铺天盖地地告诉读者。
|
||||
|
||||
### Gedit: 4/5 ###
|
||||
|
||||
Gedit有很普通的外观。通过最小化菜单和按钮有一个简单的界面。但这也是一种双刃剑,因为有些用户可能不会发现它真正的潜能。
|
||||
|
||||
应用程序可以通过在窗口中能重排和移动的选项卡打开多个文件。用户可以通过使用一个插件选择性地启用旁边或者底部用来显示文件浏览和工具输出的面板。这个应用程序会检测到被其它应用程序更改的文件并可以重新加载这个文件。
|
||||
|
||||
为了适配Gnome,在应用程序的最后一个版本中考虑了大量的用户界面。然而它还并不稳定,尽管包括了所有的功能,和菜单交互的一些插件还需要升级。
|
||||
|
||||
### Kate: 5/5 ###
|
||||
|
||||
尽管用户界面的主要部分和Gedit的相似,Kate可以在两边显示选项卡并且它的菜单更加丰富。该应用程序平易近人,让用户可以挖掘其它功能。
|
||||
|
||||
Kate可以在KDE的KIO支持的所有协议上透明地打开和保存文件,包括HTTP, FTP, SSH, SMB 和 WebDAV。你可以用这个应用同时处理多个文件。但不同于大部分应用程序传统的水平选项卡选择栏,Kate在屏幕的两个方向都有选项卡。左侧的侧边栏显示打开文件的索引。需要同时查看一个文件不同部分的程序员也会感激它可以水平或者竖直分隔界面的能力。
|
||||
|
||||
### Sublime: 5/5 ###
|
||||
|
||||
|
||||
Sublime支持你在不同方式同时查看多达四个文件。当你在zone下,这里也有一个只显示文件和菜单的全屏模式。
|
||||
|
||||
这个编辑器还在右边有个小地图,这在长文件中导航非常有用。应用程序为多种编程语言提供多种流行功能的片段,这使得它对于开发者非常有用。另一个精巧的功能是,无论你使用都是文本文档或者代码,都可以交换和随机选择。
|
||||
|
||||
### UltraEdit: 3/5 ###
|
||||
|
||||
|
||||
UltraEdit在界面的顶部和底部加载了多种工具栏。由于有在文档中跳转的选项卡,两边的面板,以及复杂区别,使得只剩下一点空间给编辑窗口。
|
||||
|
||||
使用HTML的网络开发者有很多唾手可得的帮助。你可以通过FTP和SFTP访问远程文件。高级功能,例如记录一个宏以及比较文件,也简单易用。
|
||||
|
||||
使用应用程序的Preference窗口,你可以调整应用程序的多个方面,包括颜色主题和类似语法高亮的其它功能。
|
||||
|
||||
### jEdit: 3/5 ###
|
||||
|
||||
在可用性方面,首先一个不好就是jEdit不能在基于RPM的发行版上安装。导航编辑器需要一些时间来适应,因为它的菜单和其它流行的应用程序顺序不同,而且有些普通桌面用户不熟悉的名字。但是,该应用程序有详细的内部帮助,这有利于缓解学习曲线。
|
||||
|
||||
jEdit高亮你所在的当前行,并使你能一多种查看方式分隔窗口。你可以简单地从应用程序中安装和管理插件,除了全宏,jEdit也支持你记录快速临时的宏。
|
||||
|
||||
![由于它的Java基础,jEdit在任何桌面环境中都不能给人宾至如归的感觉](http://www.linuxvoice.com/wp-content/uploads/2014/08/jedit-web.png)
|
||||
|
||||
由于它的Java基础,jEdit在任何桌面环境中都不能给人宾至如归的感觉
|
||||
|
||||
### 可用性和支持 ###
|
||||
|
||||
在Gedit和Kate之间有很多相似性。两个应用程序都得益于他们各自的父项目,Gnome和KDE,并绑定在各种主流的发行版中。另外两个项目都是交叉平台的,有Windows和Mac OS X版本以及本来的Linux版本。
|
||||
|
||||
Gedit托管在Gnome的网络设施上并有一个简单的用户指南,关于多种插件的信息,以及包括邮件列表和IRC通道的常用保持联系方式。你也可以在其它基于Gnome的发行版,例如Ubuntu中找到使用信息。相似地,Kate得益于KDE的资源,并包括详细的用户信息以及邮件列表和IRC通道。你也可以从应用程序中获取相应的离线用户指南。
|
||||
|
||||
除了Linux,UltraEdit在Windows和Mac OS X中也可用,虽然在应用程序中并没有包括,但在启动时也有详细的用户指南。为了辅助用户,UltraEdit保存了一个常见问题的数据库,一系列关于多种特定功能的详细信息的有用提示,用户还可以在论坛版块彼此帮助。另外,付费用户也可以通过邮件从开发者中获取支持。
|
||||
|
||||
Sublime支持相同数目的平台,但是你需要单独为每种平台购买许可证。开发者通过博客使用户了解正在进行的开发,并积极参加了主持论坛。这个项目支持设施的亮点是提供免费的详细教程和视频课程。Sublime非常可爱。
|
||||
|
||||
由于是用java编写的,jEdit在多种平台中都可用。在它的网站上你可以找到一个详细的用户指南以及一些插件帮助文档的链接。然而,这里没有能使用户和其他用户或者开发者交流的途径。
|
||||
|
||||
**判定:**
|
||||
|
||||
- Gedit: 4/5
|
||||
- Kate: 4/5
|
||||
- Sublime: 5/5
|
||||
- UltraEdit: 3/5
|
||||
- jEdit: 2/5
|
||||
|
||||
### 附加和插件 ###
|
||||
|
||||
不同的用户有不同的需求,一个简单的轻量级应用程序只能做到这么多。这就是为什么需要插件的原因。应用程序依赖于这些小部件来扩展它们的功能集并让更多的用户使用。
|
||||
|
||||
UltraEdit是一个另外。它没有第三方插件,但开发者确实支出了例如HtmlTidy的第三方工具已经安装到了UltraEdit。
|
||||
|
||||
Gedit附带了好多已安装的插件,你可以从gedit-插件包下载更多的插件。基于和Gedit版本的兼容性,项目网站也有到多个第三方插件的链接。
|
||||
|
||||
三个对程序员非常有用的插件是Code Comment,在底部面板增加一个终端的Terminal Plugin以及Session Saver。当你用多个文件开发项目的时候Session Saver相当有用。你可以在选项卡中打开文件,保存会话,当你用一个单击回复的时候,可以按照你保存时的选项卡顺序打开所有的文件。
|
||||
|
||||
类似的,你可以通过用内部的插件管理器增加插件来扩展Kate。除了令人映像深刻的项目插件,一些开发者使用的插件包括嵌入式终端,能编译和调试代码,以及对数据库执行SQL查询。
|
||||
|
||||
Sublime的插件是用Python写的,文本编辑器包括了一个类似于apt-get,能使用户查找,安装,升级和移除插件包的名为Package Control的工具。通过插件,你可以在Sublime中使用Git版本控制,以及改进JavaScript的JSLint工具。Sublime Linter能指出你代码中的错误,是编码人员必备的插件。
|
||||
|
||||
jEdit拥有最令人映像深刻的插件设施。该应用有超过200个插件,可以在它们自己的专用网站中浏览。网站通过不同的类型列举了插件,例如文件管理,版本控制,文本等。你可以在每个类型下找到很多的插件。
|
||||
|
||||
一些最好的插件是Android插件,它们提供了和Android项目协同工作的工具;你可以使用TomcatSwitch插件创建和控制外部Jakarta Tomcat服务器进程;以及类似于Vi功能的Vimulator插件。你可以通过使用jEdit的插件管理器安装这些插件。
|
||||
|
||||
**评定**
|
||||
|
||||
- Gedit: 3/5
|
||||
- Kate: 4/5
|
||||
- Sublime: 4/5
|
||||
- UltraEdit: 1/5
|
||||
- jEdit: 5/5
|
||||
|
||||
### 纯文本编辑 ###
|
||||
|
||||
尽管它们强大的额外功能甚至可能会取代几个流派完全成熟的应用程序,有时候可能只需要使用这些庞大的文本编辑器读写或者编辑简单的纯文本。虽然你可以使用它们中的任何一个输入文本,我们通过普通文本编辑的方便性平均它们。
|
||||
|
||||
Gnome的默认文本编辑器Gedit,支持取消和重做机制以及搜索和替换。它可以对多种语言进行拼写检查,并能通过使用Gnome GVFS库访问和编辑远程文件。
|
||||
|
||||
你也可以使用Kate进行拼写检查,它也可以让你对任何高亮文本进行Google搜索。它还有一个能可视化告知用户文件中更改过但没有保存的行的行修改系统。另外,它通过允许用户在文件中使用书签简化长文档的导航。
|
||||
|
||||
Sublime有很多可选择的编辑命令,例如缩进文本和格式化段落。它的自动保存功能帮助防止用户丢失他们的更改。高级用户还会喜欢基于正则表达式的递归查找和替换功能,以及选择多个不连续的文本块并执行统一操作。
|
||||
|
||||
UltraEdit也允许用户在查找和替换功能中使用正则表示,并能通过FTP编辑远程文件。JEdit一个独特的功能是它支持被称为寄存器的不限数目的剪切板。你可以复制文本片段到这些寄存器中,在编辑会话过程中都可用。
|
||||
|
||||
**评定:**
|
||||
|
||||
- Gedit: 4/5
|
||||
- Kate: 5/5
|
||||
- Sublime: 5/5
|
||||
- UltraEdit: 4/5
|
||||
- jEdit: 4/5
|
||||
|
||||
### 我们的评比 ###
|
||||
|
||||
在这里的所有编辑器都足以替换你已有的文本编辑器去用来编辑文本和调整配置文件。事实上,没准它们会组合起来作为你的集成开发环境。这些应用程序都有各种各样功能,它们的开发者不会考虑剥离功能,而是增加越来越多的功能。
|
||||
|
||||
jEdit排在这次测试的最后面。因为它不仅坚持使用专有的Oracle Java运行环境,不能在你的Fedora机器上安装,而且开发者不积极的和用户交互。
|
||||
|
||||
UltraEdit做的稍微好一点。这个商业专用工具专注于网络开发者,不为非开发者高级用户提供任何功能,使得它不值得推荐为免费软件的替代品。
|
||||
|
||||
排在第三的是Gedit。作为Gnome的默认编辑器,它没有任何内在的错误,但尽管有很多积极的方面,它还是略微被Sublime和Kate超越。开诚布公地说,Kate是比Gedit更通用的编辑器,甚至考虑到他们的插件系统,评分也优于Gnome的默认编辑器。
|
||||
|
||||
Sublime和Kate都相当好。他们在我们的大多数测试中表现同样出色。由于不支持宏而落后于Sublime,但键盘友好和能简单定义自定义键绑定又使Kate找回优势。
|
||||
|
||||
Kate成功的原因可以归结为它通过最小化学习曲线提供了最大化数目的功能。尽量使用它吧,不仅作为简单文本编辑器使用,或者容易使用语法高亮编辑配置文件,甚至得益于项目管理能力能使用它协作一个复杂的编程项目。
|
||||
|
||||
我们不是选择Kate去替换一个类似[在这里插入你最喜欢的专业工具]的全面的集成开发环境。但是它是一个专业工具理想的全面的以及完美的垫脚石。
|
||||
|
||||
Kate为能快速响应你的需要而设计,它的界面并不会使你茫然,并且和那些过于复杂的应用一样的有用。
|
||||
|
||||
### 1st Kate ###
|
||||
|
||||
- Licence LGPL/GPL Version 3.11
|
||||
- www.kate-editor.org
|
||||
- 拥有超能力,最终温和的文本编辑器。
|
||||
- Kate是KDE项目中最有用的应用程序之一。
|
||||
|
||||
### 2nd Sublime Text ###
|
||||
|
||||
- Licence Proprietary Version 2.0.2
|
||||
- www.sublimetext.com
|
||||
- 值得你每分钱的专业文本编辑器 - 简单易用,功能全面而且看起来很棒。
|
||||
|
||||
### 3rd Gedit ###
|
||||
|
||||
- Licence GPL Version 3.10
|
||||
- http://projects.gnome.org/gedit
|
||||
- 从Gnome中完成。这是一个奇妙的文本编辑器,确实令人钦佩的工作,但这里的竞争实在太大了。
|
||||
|
||||
### 4th UltraEdit ###
|
||||
|
||||
- Licence Proprietary Version 4.1.0.4
|
||||
- www.ultraedit.com
|
||||
- 关注于为网络开发者绑定便利,而不为普通用户提供任何特殊功能。
|
||||
|
||||
### 5th jEdit ###
|
||||
|
||||
- Licence GPL Version 5.1.0
|
||||
- www.jedit.org
|
||||
- 缺乏支持,不支持Fedora,缺乏好看的界面,jEdit被贬低到最后。
|
||||
|
||||
### 你也许希望尝试… ###
|
||||
|
||||
随你发行版发布的默认文本编辑器也能帮助你一些高级任务。例如KDE的KWrite和Raspbian的Nano。得益于KDE的katepart组件,KWrite继承了一些Kate的功能,得益于在树莓派上的可用性,Nano也开始重现风头。
|
||||
|
||||
如果你希望跟随Linux大师的脚本,你总是可以尝试崇高的文本编辑机Emacs和Vim。想尝试Vim强大的用户首先可以考虑gVim,它通过图形界面展现了Vim的强大。
|
||||
|
||||
除了jEdit和Kate,这里还有其他模仿例如Emacs和Vim之类的老派高级编辑器的编辑器,比如JED 编辑器和Joe's Own Editor,这两者都有Emacs的模拟模式。另一方面,如果你在寻找轻量级的代码编辑器,可以看看Bluefish和Geany。他们的存在是为了填补文本编辑器和全面集成的开发平台之间的空隙。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxvoice.com/text-editors/
|
||||
|
||||
作者:[Ben Everard][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxvoice.com/author/ben_everard/
|
@ -1,114 +0,0 @@
|
||||
几 KB 的国际象棋程序
|
||||
================================================================================
|
||||
当我提及到我用来介绍计算(注:这里翻译的有问题)的是一台 ZX81 电脑时,我已经暴露了我的年龄。ZX81 是一个由英国(UK,the United Kingdom) 开发者(Sincilair 研究所)生产的家庭电脑,它拥有"高达" 1KB 的随机存储器(RAM)。上面的 1kB 并不是打印错误,这个家庭电脑确实只配置有 1KB 的板载内存。但这个内存大小上的限制并没有阻止爱好者制作种类繁多的软件。事实上,这个机器引发了一代编程奇才的出现,这迫使他们掌握让程序在该机上正常运行的方法。这个机器可以通过一个 16 KB 的 RAM 包来进行升级,这就提供了更多的编程可能。但未经扩展的 1KB 机器仍然激励着编程者发布卓越的软件。
|
||||
|
||||
![1K ZX Chess ](http://www.linuxlinks.com/portal/content2/reviews/Games2/1KZXChess.jpg)
|
||||
|
||||
我最喜爱的 ZX81 游戏有: Flight Simulation, 3D Monster Maze, Galaxians, 以及最重要的 1K ZX Chess。 只有最后一个程序是为未扩展的 ZX81 电脑设计的。事实上,David Horne 开发的 1K ZX Chess 只使用了仅仅 672 字节的 RAM(注:如果读者有兴趣,可以看看 [这里](http://users.ox.ac.uk/~uzdm0006/scans/1kchess/)对该程序的代码及解释)。尽管如此,该游戏尽力去实现大多数的国际象棋规则,并提供了一个计算机虚拟对手。虽然一些重要的规则被忽略了(如:王车易位,兵的升变,和吃过路兵)
|
||||
(注:参考了[这里](http://zh.wikibooks.org/zh/%E5%9B%BD%E9%99%85%E8%B1%A1%E6%A3%8B/%E8%A7%84%E5%88%99)和[这里](http://en.wikipedia.org/wiki/Rules_of_chess)),但能够和人工智能相对抗,这仍然令人惊讶。这个游戏占据了我逝去的青春里的相当一部分。
|
||||
|
||||
1K ZX Chess 保持着在任何计算机上国际象棋的最小实现的地位长达 33 年,直到今年由 BootChess 打破了该记录,紧接着由 Toledo AtomChess 打破。这三个程序都没有实现所有的国际象棋规则,所以为了完整性,我介绍了我最喜爱的,实现了所有国际象棋规则的极小的国际象棋。
|
||||
|
||||
Linux 有着一系列极其强大的国际象棋引擎,如 Stockfish, Critter, Togo II, Crafty, GNU Chess, 和 Komodo 。 在这篇文章精选的国际象棋程序虽敌不过一个好的国际象棋程序,但它们展示了使用微不足道的代码库究竟可以实现多少东西。
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/ToledoAtomchess.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Toledo.png)
|
||||
|
||||
你可能已经看到了大量有关 BootChess 新闻报道,一个只用 487 字节写就的国际象棋程序,一举打破了先前最小的国际象棋程序,1K ZX Chess 的记录。Óscar Toledo Gutiérrez 拿起外套并决定编写一个更加紧凑的国际象棋游戏。Toledo Atomchess 是仅有 481 字节的 x86 汇编代码,它适合在引导扇区里。 在给定的极小代码库限制下,这个引擎实现了一个适当的国际象棋游戏。
|
||||
|
||||
特点包括:
|
||||
|
||||
- 基本的象棋移动
|
||||
- 象棋盘的 ASCII 文本表现
|
||||
- 以代数形式来输入移动(注:如 D2D4)
|
||||
- 3 层的搜索深度
|
||||
|
||||
显然,为了将这个国际象棋程序压缩到 481 字节中,作者必须做出某些牺牲,这些局限包括:
|
||||
|
||||
- 没有兵的升变
|
||||
- 没有王车易位
|
||||
- 没有吃过路兵
|
||||
- 没有移动确认
|
||||
|
||||
该作者也使用 C,JavaScript 和 Java 来写这个国际象棋程序,每种实现都非常小。
|
||||
|
||||
- 网站: [nanochess.org/chess6.html][1]
|
||||
- 开发者: Óscar Toledo Gutiérrez
|
||||
- 协议: 对非商业使用免费(Free for non-commercial use)
|
||||
- 版本号: -
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/BootChess.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-BootChess.png)
|
||||
|
||||
BootChess 是一个国际象棋的极其小巧的计算机实现。这个程序被塞进到仅仅 487 字节里,并可运行在 Windows, Mac OS X 和 Linux 等操作系统。BootChess 的棋盘和棋子单独用文本表示,其中 P 代表兵, Q 用来代表王后,以及输入的任何停顿代表空白方块。
|
||||
|
||||
特点包括:
|
||||
|
||||
- 象棋棋盘和用户输入的图形化文本表示
|
||||
- 引导扇区大小(512 字节)的可玩的象棋游戏
|
||||
- 只需 x86 bios 硬件引导程序(没有软件依赖)
|
||||
- 所有主要的正规移动包括 double square pawn start(注:这个我没有查到是什么意思)
|
||||
- 兵升变为王后(与 1k ZX Chess 相反)
|
||||
- 名为 taxiMax > minMax half-ply 的 CPU 人工智能
|
||||
- 硬编码的西班牙白子开局
|
||||
|
||||
同样,它也存在一些重要的限制。这些遗漏包括:
|
||||
|
||||
- 正在推广
|
||||
- 吃过路兵
|
||||
- 没有王车易位
|
||||
- 3 次位置重复和局规则(注:下一步之前,同样的移动出现了两次;可以参考[这里](http://www.netplaces.com/chess-basics/ending-the-game/three-position-repetition.htm))
|
||||
- 50 步移动和局规则(注:在连续的50个回合内,双方既没有棋子被吃掉,也没有兵被移动过,则和局;可以参考[这里](http://www.chessvariants.org/d.chess/chess.html))
|
||||
- 没有开放或封闭的书籍
|
||||
- 一个或多个 minMAX/negaMax 全层人工智能
|
||||
|
||||
- 网站: [www.pouet.net/prod.php?which=64962][2]
|
||||
- 开发者: Olivier "Baudsurfer/RSi" Poudade
|
||||
- 协议: WTFPL v2
|
||||
- 版本号: .02
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/Micro-Max.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Micro-Max.png)
|
||||
|
||||
Micro-Max 是一个用 C 写就的 133 行象棋源程序。
|
||||
|
||||
作者实现了一个 hash 变换表,该引擎检查输入移动的合法性,以及支持 FIDE(注: World Chess Federation 缩写,[这里](https://www.fide.com/)为其官网) 的全部规则,除了正在推广的规则。
|
||||
|
||||
特点包括:
|
||||
|
||||
- 递归的 negamax 搜索
|
||||
- 重新夺回的静态搜索
|
||||
- 重新夺回规则的扩展
|
||||
- 迭代深化
|
||||
- 最好的先走策略 `排序`
|
||||
- 存储分数和最佳移动的 Hash 表
|
||||
- 完整的 FIDE 规则(不包括正在推广的规则) 和移动合法性检查
|
||||
|
||||
同样存在一个简装的 1433个字符的版本,但允许你使用符合 FIDE 规则的正在推广的规则。
|
||||
|
||||
- 网站: [home.hccnet.nl/h.g.muller/max-src2.html][3]
|
||||
- 开发者: Harm Geert Muller
|
||||
- 协议: The MIT License
|
||||
- 版本号: 3.2
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxlinks.com/article/20150222033906262/ChessBytes.html
|
||||
|
||||
作者:Frazer Kline
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://nanochess.org/chess6.html
|
||||
[2]:http://www.pouet.net/prod.php?which=64962
|
||||
[3]:http://home.hccnet.nl/h.g.muller/max-src2.html
|
@ -2,13 +2,11 @@ Papyrus:开源笔记管理工具
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux_4.jpeg)
|
||||
|
||||
在上一篇帖子中,我们介绍了[任务管理软件Go For It!][1].今天我们将介绍一款名为**Papyrus的开源笔记软件**
|
||||
在上一篇帖子中,我们介绍了[待办事项管理软件Go For It!][1]。今天我们将介绍一款名为**Papyrus的开源笔记软件**
|
||||
|
||||
[Papyrus][2] 是[Kaqaz笔记管理][3]的变体并使用了QT5.它不仅有简洁、易用的界面,还具备了较好的安全性。由于强调简洁,我觉得Papyrus与OneNote比较相像。你可以将你的笔记像"纸张"一样分类整理,还可以给他们添加标签进行分组。够简单的吧!
|
||||
[Papyrus][2] 是[Kaqaz笔记管理][3]的一个分支并使用QT5开发。它不仅有简洁、易用的界面,还具备了较好的安全性。由于强调简洁,我觉得Papyrus与OneNote比较相像。你可以将你的笔记像"纸张"一样分类整理,还可以给他们添加标签进行分组。够简单的吧!
|
||||
|
||||
### Papyrus的功能: ###
|
||||
|
||||
## Papyrus的功能: ###
|
||||
## Papyrus 的特性: ###
|
||||
|
||||
虽然Papyrus强调简洁,它依然有很多丰富的功能。他的一些主要功能如下:
|
||||
- 按类别和标签管理笔记
|
||||
@ -21,9 +19,9 @@ Papyrus:开源笔记管理工具
|
||||
- 与Dropbox加密同步
|
||||
- 除Linux外,还可在Android,Windows和OS X使用
|
||||
|
||||
### Install Papyrus ###
|
||||
### 安装 Papyrus ###
|
||||
|
||||
Papyrus为Android用户提供了APK安装包。Windows和OS X也有安装文件。Linux用户还可以获取程序的源码。使用Ubuntu及其他基于Ubuntu的发行版可以使用.deb包进行安装。根据你的系统及习惯,你可以从Papyrus的下载页面中获取不同的文件:
|
||||
Papyrus为Android用户提供了APK安装包。Windows和OS X也有安装文件。Linux用户还可以获取程序的源码。Ubuntu及其它基于Ubuntu的发行版可以使用.deb包进行安装。根据你的系统及习惯,你可以从Papyrus的下载页面中获取不同的文件:
|
||||
|
||||
- [下载 Papyrus][4]
|
||||
|
||||
@ -40,9 +38,9 @@ Papyrus为Android用户提供了APK安装包。Windows和OS X也有安装文
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Papyrus_Linux-700x450_c.jpeg)
|
||||
|
||||
试试Papyrus吧,你会喜欢上它的。
|
||||
试试Papyrus吧,你会喜欢上它的。在下方评论区和我们分享你的使用经验吧。
|
||||
|
||||
(译者注;此软件暂无中文版)
|
||||
(译者注:此软件暂无中文版)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -50,7 +48,7 @@ via: http://itsfoss.com/papyrus-open-source-note-manager/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[KevinSJ](https://github.com/KevinSJ)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
|
@ -0,0 +1,57 @@
|
||||
Translated by H-mudcup
|
||||
|
||||
适用于Ubuntu的环境音播放器播放让人放松的声音保持你的创造力
|
||||
================================================================================
|
||||
![Rain is a soothing sound for some](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/raining-1600x900-wallpaper_www.wallpapermay.com_84-1.jpg)
|
||||
对于某些人来说雨声是个令人安心的声音
|
||||
|
||||
**如果我想变得非常有效率,我不能听‘正常’的音乐。它会使我分心,我会开始跟着唱或者让我想起另一首歌,结局就是我在自己的音乐库里到处戳并且……反正,你懂的。**
|
||||
|
||||
同样我也不能在寂静的环境中工作(虽然和6只猫生活在一起意味着这不太可能)但是无规律的刺耳声音和突然地咔哒声以及猫叫声会打破寂静。
|
||||
|
||||
我的解决办法是听**环境音**。
|
||||
|
||||
我发现它能帮助我消除大脑的里的胡思乱想,提供了一个声景覆盖了猫咪玩耍的声音。
|
||||
|
||||
环境音就是日常生活中的背景噪音;雨滴在窗户上敲打的声音,咖啡店里人们聊天的嗡嗡声,风中鸟儿们闲聊的声音,等等。
|
||||
|
||||
倾听这些声音会强迫一个疯狂运行的大脑减速,重新沉静下来重新把精力聚集到重要的事情上。
|
||||
|
||||
### 适用于Ubuntu的环境音应用 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/ambient-noise-player-750x365.jpg)
|
||||
|
||||
Google Play和苹果应用商店充满了环境音和白噪声的应用。现在,在Ubuntu里有同样的应用了。
|
||||
|
||||
‘[Ambient Noise][1]‘ ‘[环境音][1]’——人如其名——是一个专门被设计成播放这种声音的音频播放器。他甚至可以同Ubuntu声音菜单整合到一起,给你‘选择,点击即放松’的体验。
|
||||
|
||||
这个应用(又被称为‘ANoise播放器’,由Marcos Costales制作)带有**8个高品质声道**。
|
||||
|
||||
这8个预设声道涵盖了多种环境,从下雨时有节奏的声音,到夜晚大自然静谧的旋律,还有下午熙熙攘攘的咖啡店的嗡嗡声。
|
||||
|
||||
### 在Ubuntu上安装ANoise播放器 ###
|
||||
|
||||
适用于Ubuntu的环境音播放器是个免费的应用而且可以从它专用的PPA里安装。
|
||||
|
||||
要这样安装请先打开一个新的终端窗口运行:
|
||||
|
||||
sudo add-apt-repository ppa:costales/anoise
|
||||
|
||||
sudo apt-get update && sudo apt-get install anoise
|
||||
|
||||
安装好以后只需从Unity Dash(或DE里等价的地方)里打开它,通过声音菜单选择你喜欢的环境音然后……放松吧!这个应用甚至记得你上次用的环境音。
|
||||
|
||||
Even so, give it a try out and see if it suits your needs. I would say let me know what you think, but I will be too focused to hear — and so might you!即便如此,你还是要试一试看它是否能满足你的需要。我要说的是让我直到你是怎么想的,但是我将会专心致志到听不到你的声音——你可能也会这样!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/04/ambient-noise-player-app-for-ubuntu-linux
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[H-mudcup](https://github.com/H-mudcup)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://anoise.tuxfamily.org/
|
@ -1,15 +1,29 @@
|
||||
六种在 Linux 上带来 iTunes 体验的方法
|
||||
Top 6 Ways To Get Your iTunes Experience On Linux
|
||||
================================================================================
|
||||
![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/itunes-linux-840x420.jpg?35dc20)
|
||||
|
||||
随着你对 Linux 的熟悉(也许会成为你首要使用的操作系统),你最终会寻找能在Linux上有效管理音乐的工具。你首先想到了 iTunes,因为它是近几年最流行的音乐管理工具,但你马上会发现iTunes并没有Linux版本。而且,你会发现还有比 iTunes 更好的音乐管理工具。
|
||||
As you’re getting used to Linux (potentially as your new main operating system), you’ll eventually try to find a way to efficiently manage your music. iTunes comes to mind because it’s been the most popular way to manage music over the years, but you’ll quickly find out that iTunes isn’t available natively on Linux. Plus, better ways exist to manage your music now that it’s 2015.
|
||||
|
||||
尽管如此,这并不意味着你就不能使用你喜欢的方式管理音乐。Linux 上有很多方式可以让你整理你的音乐库。以下六种,仅供参考:
|
||||
However, that doesn’t automatically mean that you won’t be able to manage your music the way you want to. There’s plenty of other ways to keep tabs on your music library. Here’s six great ways to get it done.
|
||||
|
||||
### 在WINE上运行iTunes ###
|
||||
### iTunes via WINE ###
|
||||
|
||||
尽管 iTunes 没有Linux版,你还是可以试试 [使用 WINE 运行 iTunes ][1] 或 PlayOnLinux 的。这些软件给本来只能运行于Windows下的应用程序添加了一个兼容层,这样就能让他们运行在Linux上了,但这样的方法效果十有分限。因此 [并非所有 Windows 应用程序都能使用WINE运行][2] - 但这还是一个值得尝试的方法。
|
||||
Even if iTunes isn’t available in Linux as a native application, you can still try to [get it to work under WINE][1] or PlayOnLinux. These pieces of software try to add a compatibility layer so that Windows applications work on Linux, but the results are far from perfect. Therefore, [not all Windows applications will run with WINE][2] — but it’s still worth a try.
|
||||
|
||||
各个版本的iTunes结果可能给你不同的结果,但一般都遵循以下方法:
|
||||
1. 安装WINE
|
||||
1. 在WINE里运行iTunes安装程序
|
||||
1. 在网上搜索并解决你遇到的问题。
|
||||
|
||||
如果你在安装时遇到无法解决的问题,比如安装程序错误,或者安装好的程序运行不了,那是没办法的,WINE 就是这样
|
||||
|
||||
如果你想在 WINE 上运行 iTunes 但恰好运行不了的话,没问题。但如果你还想考虑运行一个原生的Linux的话,还有很多其他选择的。这些音乐管理软件狗能让你很方便的管理你的音乐并直接进行播放,还可以制作播放列表。
|
||||
|
||||
Each version of iTunes can give you different results, but the general process is as follows:
|
||||
|
||||
1. Install WINE
|
||||
@ -24,50 +38,65 @@ If you really want to use iTunes and you happen to luck out with WINE, then that
|
||||
|
||||
![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/amarok_main.jpg?35dc20)
|
||||
|
||||
如果你使用KDE环境,我推荐 Amarok。它具有 [很多管理音乐的特性][4] 而且他还能与KDE桌面环境无缝兼容。它很有很多实用的特性如无缝兼容 Last.FM,文件跟踪,动态播放列表及个吃支持。它甚至会自动在你播放曲目时,自动下载艺术家封面。
|
||||
|
||||
If you use KDE, then I’d recommend Amarok. It has [plenty of features to manage your music][4] and tight desktop integration with KDE. It also has useful features such as Last.FM integration, file tracking, dynamic playlists, and script support. It can even pull up biographies of artists as you play their songs.
|
||||
|
||||
### [Banshee][5] ###
|
||||
|
||||
![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/banshee_main.jpg?35dc20)
|
||||
|
||||
如果你使用 GNOME 或其他任何基于 GTK 的桌面环境(他们十分常见)的话,我推荐使用使用Bansee作为 [全功能音乐库管理工具][6] 。它的功能与Amarok类似,也与Last.FM无缝兼容,支持网络广播,支持podcast,还有很多其他功能。选择 Amarok 还是 Bansee 要看你使用的桌面环境(这样才能无缝整合)。
|
||||
|
||||
If you use GNOME or any GTK-based desktop environment (they’re quite common), then I’d recommend Banshee as a [full-featured music library][6] manager. It has a very similar feature set as Amarok, including Last.FM integration, Internet radio support, podcast support, and much more. Amarok and Banshee are really among the top two choices, so which one you choose should depend on which desktop environment you’re using (for integration’s sake).
|
||||
|
||||
### [Rhythmbox][7] ###
|
||||
|
||||
![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/rhythmbox_main.jpg?35dc20)
|
||||
|
||||
Rhythmbox是一个 基于GTK的桌环境下更 [轻量级的音乐库替代品][8]。尽管如此,它也还是有一些特性的。它也支持Last.FM,同时还能无缝播放并与其他如 Nautilus, XChat,及Pidgin 等进行整合。
|
||||
Rhythmbox as a more [lightweight music library alternative][8] that is best used on GTK-based desktop environments. However, it still has quite a few features. You also get Last.FM support here, plus gapless playback and integration with various other applications such as Nautilus, XChat, and Pidgin.
|
||||
|
||||
### [Clementine][9] ###
|
||||
|
||||
![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/clementine_main.jpg?35dc20)
|
||||
|
||||
另一款叫 Clementine 的软件也值得我推荐,因为它的见面简洁、易用。它支持非常多的第三方服务例如Spotify,Digtal Imported 及Dropbox。Android系统上还有一款用作 Clementine 遥控的app。[Clementine是一个跨平台的][10] , 还支持Mac OS X 及 Windows。
|
||||
Another application called Clementine also gets my recommendation with its clean and intuitive interface. It has tons of support for third-party services such as Spotify, Digitally Imported, and Dropbox. There’s also an Android app you can use as a remote control for Clementine. [Clementine is cross-platform][10] and available for Windows and Mac OS X.
|
||||
|
||||
这些程序都能很好的管理并播放你的音乐。唯一的问题是这些程序都不支持与 iOS 设备的整合, 而且目前还没有程序能做到这一点。但 iOS 经过很多改进后,已经足以不需要再连接到电脑了。
|
||||
They all are excellent at managing and playing your music. The only downside to all of these is that there is no iOS device integration, and there’s currently no modern application that can do that. However, iOS has received enough improvements that it’s virtually unnecessary to connect it to a computer anymore.
|
||||
|
||||
### [Google Play Music][11] ###
|
||||
|
||||
![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/google_music.jpg?35dc20)
|
||||
|
||||
最后,如果上面的那些程序还不能满足你的需求的花,你可以试试 Google Play Music。这个在线服务也可以用作能播放音乐的音乐库管理工具,但他还有几个额外的好处。你可以上传所有的音乐,并且在所有能上网的设备上获取这些音乐。这也意味着你不需要在电脑或者移动设备之间同步你的音乐(无论是 Android 还是 iOS 设备),因为你可以这些设备中使用Google Play Music。 如果你想要扩展你的去库,你可以订阅 All Access,但这并不是必须的。你不需要支付任何费用也可在你的曲库中储存20,000首
|
||||
Lastly, if none of those applications satisfy your needs, you can take a look at Google Play Music. This online service acts as a music library manager that can play your music, but it also has some extra benefits. You can upload all your music to it and have access on any device connected to the Internet. That also means that you won’t have to sync your music between your computer and your mobile device (no matter if Android or iOS) because you have access to Google Play Music from both. If you want to expand your library you can get the All Access subscription, but it’s not a requirement. You can use it simply as a music library completely free for up to 20,000 songs.
|
||||
|
||||
#### 靠,居然没有 Spotify ?! ####
|
||||
#### Wot, no Spotify?! ####
|
||||
|
||||
尽管 Spotify 也是一款管理和听音乐的方法,我不推荐它的唯一原因是它事实上并不让你管理你的音乐。你不能将曲目上传到 Spotify - 只能它们给你提供的曲目。尽管它们提供了很多,但原理都不尽相同。
|
||||
The only reason why I don’t mention Spotify is that, although it’s also a great way to access and listen to music, it doesn’t really let you manage your own music. You can’t upload trakcs to Spotify — you have to listen to what they give you. Albeit they give you a lot, but it’s nonetheless a different mechanism.
|
||||
|
||||
### You Have Options ###
|
||||
### 你还有其他选择 ###
|
||||
### You Have Options ###
|
||||
|
||||
以上六个软件应该可以在给你带来类似 iTunes 的功能了。这些软件主要是能让你管理和播放你的音乐库,但如果你还需要 iTunes 里的其他特性,其他Linux原生软件或许能满足这类需求。
|
||||
|
||||
With these six options, you should be able to get iTunes-like functionality on your desktop. These options focused mainly on managing and playing your music library, but if there are any other features that you need from iTunes, other Linux-native applications can take care of those needs.
|
||||
|
||||
**你通常在Linux上使用哪些音乐?**在下方评论与我们分享吧!
|
||||
**What music applications do you regularly use on Linux?** Let us know in the comments!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.makeuseof.com/tag/top-6-ways-get-itunes-experience-linux/
|
||||
|
||||
作者:[Danny Stieben][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[KevinSJ](https://github.com/KevinSJ)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@ -83,4 +112,4 @@ via: http://www.makeuseof.com/tag/top-6-ways-get-itunes-experience-linux/
|
||||
[8]:http://www.makeuseof.com/tag/play-manage-music-collection-rhythmbox-linux/
|
||||
[9]:https://www.clementine-player.org/
|
||||
[10]:http://www.makeuseof.com/tag/need-a-lightweight-music-player-without-sacrificing-features-clementine-cross-platform/
|
||||
[11]:http://music.google.com/
|
||||
[11]:http://music.google.com/
|
@ -0,0 +1,40 @@
|
||||
这个工具可以提醒你一个区域内的假面猎手接入点 (注:evil twin暂无相关翻译)
|
||||
===============================================================================
|
||||
**开发人员称,EvilAP_Defender甚至可以攻击流氓Wi-Fi接入点**
|
||||
|
||||
一个新的开源工具可以定期扫描一个区域,以防流氓Wi-Fi接入点,同时如果发现情况会提醒网络管理员。
|
||||
|
||||
这个工具叫做EvilAP_Defender,是为监测攻击者配置的恶意接入点而专门设计的,这些接入点冒用合法的名字诱导用户连接上。
|
||||
|
||||
这类接入点被称做假面猎手,使得黑客们从接入的设备上监听互联网信息流。这可以被用来窃取证书,破坏网站等等。
|
||||
|
||||
大多数用户设置他们的计算机和设备可以自动连接一些无线网络,比如家里的或者工作地方的网络。尽管如此,当面对两个同名的无线网络时,即SSID相同,有时候甚至时MAC地址也相同,这时候大多数设备会自动连接信号较强的一个。
|
||||
|
||||
这使得假面猎手的攻击容易实现,因为SSID和BSSID都可以伪造。
|
||||
|
||||
[EvilAP_Defender][1]是一个叫Mohamed Idris的人用Python语言编写,公布在GitHub上面。它可以使用一个计算机的无线网卡来发现流氓接入点,这些接入点复制了一个真实接入点的SSID,BSSID,甚至是其他的参数如通道,密码,隐私协议和认证信息。
|
||||
|
||||
该工具首先以学习模式运行,为了发现合法的接入点[AP],并且加入白名单。然后切换到正常模式,开始扫描未认证的接入点。
|
||||
|
||||
如果一个恶意[AP]被发现了,该工具会用电子邮件提醒网络管理员,但是开发者也打算在未来加入短信提醒功能。
|
||||
|
||||
该工具还有一个保护模式,在这种模式下,应用会发起一个denial-of-service [DoS]攻击反抗恶意接入点,为管理员采取防卫措施赢得一些时间。
|
||||
|
||||
“DoS不仅针对有着相同SSID的恶意AP,也针对BSSID(AP的MAC地址)不同或者不同信道的,”Idris在这款工具的文档中说道。“这是避免攻击你的合法网络。”
|
||||
|
||||
尽管如此,用户应该切记在许多国家,攻击别人的接入点,甚至一个可能一个攻击者操控的恶意的接入点,很多时候都是非法的。
|
||||
|
||||
为了能够运行这款工具,需要Aircrack-ng无线网套装,一个支持Aircrack-ng的无线网卡,MySQL和Python运行环境。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.infoworld.com/article/2905725/security0/this-tool-can-alert-you-about-evil-twin-access-points-in-the-area.html
|
||||
|
||||
作者:[Lucian Constantin][a]
|
||||
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.infoworld.com/author/Lucian-Constantin/
|
||||
[1] https://github.com/moha99sa/EvilAP_Defender/blob/master/README.TXT
|
@ -1,39 +0,0 @@
|
||||
translated by haimingfg
|
||||
|
||||
Torvalds: 参加linux内核贡献更加容易找工作
|
||||
========================================
|
||||
|
||||
相比起以往,linux内核的发展变是一个专业性的问题,作为一个无偿贡献者去贡献的项目今天在"谁写linux"被低调报道出来了。
|
||||
|
||||
这个报道由linux基金会编写,基金会说自愿者有逐年下降的趋势,上年有11.8%的内核开发是由无偿自愿者完成,从2012年起由14.6%下滑了19%。
|
||||
|
||||
![](http://images.techhive.com/images/article/2015/02/screen-shot-2015-02-17-at-5.25.43-pm-100568680-medium.idge.png)
|
||||
|
||||
即使是这样,在最新的谁写linux里面报道,无偿贡献者还是主要的共享来源,共有11,968改变,整体来说有12.4%是好的,企业贡献者共同占比越来越多,有超过80%的内核贡献是有有尝的专业开发者来完成,linux基金会说。
|
||||
|
||||
|
||||
根据 linus Torvalds 说,这个有偿开发者趋势不会改变太多这个内核发展的本身。
|
||||
|
||||
|
||||
他向全世界人说,我认为不会改变太多的一个原因是不会有更多的无偿自愿者因为编写内核就会更加快找到工作而离开。
|
||||
|
||||
|
||||
Torvalds讲到,linux发展改变有很多其他原因,很自然的,新的贡献者会经常冒出来,有很多都是原来的开发者,有着10年的经验,被很多对linux感兴趣的公司抢着去做。
|
||||
|
||||
|
||||
他说:“开始我们是自愿者,但我们这几天很开心被请去开发linux”
|
||||
|
||||
|
||||
Torvalds 开始抽离了他的开发角色,根据报道在3.10的内核版本里面他个人发布329补丁,占04% 逐渐地,子系统维护人员自己会检查与合并他们的代码。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.infoworld.com/article/2885339/application-development/torvalds-people-who-start-writing-kernel-code-get-hired-really-quickly.html
|
||||
|
||||
作者:[Jon Gold][a]
|
||||
译者:[haimingfg](https://github.com/haimingfg)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.infoworld.com/author/Jon-Gold/
|
@ -0,0 +1,104 @@
|
||||
安卓编年史
|
||||
================================================================================
|
||||
![](http://cdn.arstechnica.net/wp-content/uploads/2014/03/ready-fight.png)
|
||||
|
||||
### Android 2.1, update 1——无尽战争的开端 ###
|
||||
|
||||
谷歌是第一代iPhone的主要合作伙伴——公司为苹果的移动操作系统提供了谷歌地图,搜索,以及Youtube。在那时,谷歌CEO埃里克·施密特是苹果的董事会成员之一。实际上,在最初的苹果发布会上,施密特是在史蒂夫·乔布斯[之后第一个登台的人][1],他还开玩笑说两家公司如此接近,都可以合并成“AppleGoo”了。
|
||||
|
||||
当谷歌开发安卓的时候,两家公司间的关系慢慢变得充满争吵。然而,谷歌很大程度上还是通过拒iPhone关键特性于安卓门外,如双指缩放,来取悦苹果。尽管如此,Nexus One是第一部不带键盘的直板安卓旗舰机,设备被赋予了和iPhone相同的外观因素。Nexus One结合了新软件和谷歌的品牌,这是压倒苹果的最后一根稻草。根据沃尔特·艾萨克森为史蒂夫·乔布斯写的传记,2010年1月在看到了Nexus One之后,这个苹果的CEO震怒了,说道:“如果需要的话我会用尽最后一口气,以及花光苹果在银行里的400亿美元,来纠正这个错误……我要摧毁安卓,因为它完全是偷窃来的产品。我愿意为此进行核战争。”
|
||||
|
||||
所有的这些都在秘密地发生,仅在Nexus One发布后的几年后才公诸于众。公众们最早在安卓2.1——推送给Nexus One的一个称作“[2.1 update 1][2]”的更新,发布后一个月左右捕捉到谷歌和苹果间愈演愈烈的分歧气息。这个更新添加了一个功能,正是iOS一直居于安卓之上的功能:双指缩放。
|
||||
|
||||
尽管安卓从2.0版本开始就支持多点触控API了,默认的系统应用在乔布斯的命令下依然和这项实用的功能划清界限。在关于Nexus One的和解会议谈崩了之后,谷歌再也没有理由拒双指缩放于安卓门外了。谷歌给设备推送了更新,安卓终于补上了不足之处。
|
||||
|
||||
随着谷歌地图,浏览器以及相册中双指缩放的全面启用,谷歌和苹果的智能手机战争也就此拉开序幕。在接下来的几年中,两家公司会变成死敌。双指缩放更新的一个月后,苹果开始了他的征途,起诉了所有使用安卓的公司。HTC,摩托罗拉以及三星都被告上法庭,直到现在都还有一些诉讼还没解决。施密特辞去了苹果董事会的职务。谷歌地图和Youtube被从iPhone中移除,苹果甚至开始打造自己的地图服务。今天,这两位选手几乎是“AppleGoo”竞赛的唯一选手,涉及领域十分广:智能手机,平板,笔记本,电影,TV秀,音乐,书籍,应用,邮件,生产力工具,浏览器,个人助理,云存储,移动广告,即时通讯,地图以及机顶盒……以及不久他们将会在汽车智能,穿戴设备,移动支付,以及客厅娱乐等进行竞争。
|
||||
|
||||
### Android 2.2 Froyo——更快更华丽 ###
|
||||
|
||||
[安卓2.2][3]在2010年5月,也就是2.1发布后的四个月后亮相。Froyo(冻酸奶)的亮点主要是底层优化,只为更快的速度。Froyo最大的改变是增加了JIT编译。JIT自动在运行时将java字节码转换为原生码,这会给系统全面带来显著的性能改善。
|
||||
|
||||
浏览器同样得到了性能改善,这要感谢来自Chrome的V8 Javascript引擎的整合。这是安卓浏览器从Chrome借鉴的许多特性中的第一个,最终系统内置的浏览器会被移动版Chrome彻底替代掉。在那之前,安卓团队还是需要发布一个浏览器。从Chrome借鉴特性是条升级的捷径。
|
||||
|
||||
在谷歌专注于让它的平台更快的同时,苹果正在让它的平台更全面。谷歌的竞争对手在一个月前发布了10英寸的iPad,先行进入了平板时代。尽管有些搭载Froyo和Gingerbread的安卓平板发布,谷歌的官方回应——安卓3.0 Honeycomb(蜂巢)以及摩托罗拉Xoom——在9个月后才来到。
|
||||
|
||||
![Froyo底部添加了双图标停靠栏以及全局搜索。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/22-2.png)
|
||||
Froyo底部添加了双图标停靠栏以及全局搜索。
|
||||
Ron Amadeo供图
|
||||
|
||||
Froyo主屏幕最大的变化是底部的新停靠栏,电话和浏览器图标填充了先前抽屉按钮左右的空白空间。这些新图标都是现有图标的定制白色版本,并且用户没办法自己设置图标。
|
||||
|
||||
默认布局移除了所有图标,屏幕上只留下一个使用提示小部件,引导你点击启动器图标以访问你的应用。谷歌搜索小部件得到了一个谷歌logo,同时也是个按钮。点击它可以打开一个搜索界面,你可以限制搜索范围在互联网,应用或是联系人之内。
|
||||
|
||||
![下载页面有了“更新所有”按钮,Flash应用,一个flash驱动的一切皆有可能的网站,以及“移动到SD”按钮。 ](http://cdn.arstechnica.net/wp-content/uploads/2014/03/small-market-2.jpg)
|
||||
下载页面有了“更新所有”按钮,Flash应用,一个flash驱动的一切皆有可能的网站,以及“移动到SD”按钮。
|
||||
[Ryan Paul][4]供图
|
||||
|
||||
还有一些优秀的新功能加入了Froyo,安卓市场加入了更多的下载控制。有个新的“更新所有”按钮固定在了下载页面底部。谷歌还添加了自动更新特性,只要应用权限没有改变就能够自动安装应用;尽管如此,自动更新默认是关闭的。
|
||||
|
||||
第二张图展示了Adobe Flash播放器,它是Froyo独占的。这个应用作为插件加入了浏览器,让浏览器能够有“完整的网络”体验。在2010年,这意味着网页充满了Flash导航和视频。Flash是安卓相比于iPhone最大的不同之一。史蒂夫·乔布斯展开了一场对抗Flash的圣战,声称它是一个被淘汰的,充满bug的软件,并且苹果不会在iOS上允许它的存在。所以安卓接纳了Flash并且让它在安卓上运行,给予用户在安卓上拥有半可用的flash实现。
|
||||
|
||||
在那时,Flash甚至能够让桌面电脑崩溃,所以在移动设备上一直保持打开状态会带来可怕的体验。为了解决这个问题,安卓浏览器上的Flash可以设置为“按需打开”——除非用户点击Flash占位图标,否则不会加载Flash内容。对Flash的支持将会持续到安卓4.1,Adobe在那时放弃并且结束了这个项目。Flash归根到底从未在安卓上完美运行过。而Flash在iPhone这个最流行的移动设备上的缺失,推动了互联网最终放弃了这个平台。
|
||||
|
||||
最后一张图片显示的是新增的移动应用到SD卡功能,在那个手机只有512MB内置存储的时代,这个功能十分的必要的。
|
||||
|
||||
![驾驶模式应用。相机现在可以旋转了。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/22carcam-2.png)
|
||||
驾驶模式应用。相机现在可以旋转了。
|
||||
Ron Amadeo供图
|
||||
|
||||
相机应用终于更新支持纵向模式了。相机设置被从抽屉中移出,变成一条半透明的按钮带,放在了快门按钮和其他控制键旁边。这个新设计看起来从Cooliris相册中获得了许多灵感,有着半透明,有弹性的聊天气泡弹出窗口。看到更现代的Cooliris风格UI设计被嫁接到皮革装饰的相机应用确实十分奇怪——从审美上来说一点都不搭。
|
||||
|
||||
![半残缺的Facebook应用是个常见的2x3导航页面的优秀范例。谷歌Goggles被包含了进来但同样是残缺的。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/facebook.png)
|
||||
半残缺的Facebook应用是个常见的2x3导航页面的优秀范例。谷歌Goggles被包含了进来但同样是残缺的。
|
||||
Ron Amadeo供图
|
||||
|
||||
不像在安卓2.0和2.1中包含的Facebook客户端,2.2版本的仍然部分能够工作并且登陆Facebook服务器。Facebook应用是个谷歌那时候设计指南的优秀范例,它建议应用拥有一个含有3x2图标方阵的导航页并作为应用主页。
|
||||
|
||||
这是谷歌的第一个标准化尝试,将导航元素从菜单按钮里移到屏幕上,因为用户找不到它们。这个设计很实用,但它在打开应用和使用应用之间增加了额外的障碍。谷歌不久后湖意识到当用户打开一个应用,显示应用内容而不是中间导航页是个更好的主意。以Facebook为例,打开应用直接打开信息订阅会更合适。并且不久后应用设计将会把导航降级到二层位置——先是作为顶部的标签之一,后来谷歌放在了“导航抽屉”,一个含有应用所有功能位置的滑出式面板。
|
||||
|
||||
还有个预装到Froyo的是谷歌Goggles,一个视觉搜索应用,它会尝试辨别图片上的主体。它在辨别艺术品,地标以及条形码时很实用,但差不多也就这些了。最先的两个设置屏幕,以及相机界面,这是应用里唯一现在还能运行的了。由于客户端太旧了,实际上你如今并不能完成一个搜索。应用里也没什么太多可看的,也就一个会返回搜索结果页的相机界面而已。
|
||||
|
||||
![Twitter应用,一个充满动画的谷歌和Twitter的合作成果。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/twitters-2.png)
|
||||
Twitter应用,一个充满动画的谷歌和Twitter的合作成果。
|
||||
Ron Amadeo供图
|
||||
|
||||
Froyo拥有第一个安卓Twitter应用,实际上它是谷歌和Twitter的合作成果。那时,一个Twitter应用是安卓应用阵容里的大缺憾。开发者们更偏爱iPhone,加上苹果占领先机和严格的设计要求,App Store里可选择的应用远比安卓的有优势。但是谷歌需要一个Twitter应用,所以它和Twitter合作组建团队让第一个版本问世。
|
||||
|
||||
这个应用代表了谷歌的新设计语言,这以为着它有个中间导航页以及对动画要求的“技术演示”。Twitter应用甚至比Cooliris相册用的动画效果还多——所有东西一直都在动。所有页面顶部和底部的云朵以不同速度持续滚动,底部的Twitter小鸟拍动它的翅膀并且左右移动它的头。
|
||||
|
||||
Twitter应用实际上有点Action Bar早期前身的特性,一条顶部对齐的连续控制条在安卓3.0中被引入。沿着所有屏幕的顶部有条拥有Twitter标志和像搜索,刷新和新tweet这样的按钮的蓝色横栏。它和后来的Action Bar之间大的区别在于Twitter/谷歌这里的设计的右上角缺少“上一级”按钮,实际上它在应用里用了完整的第二个栏位显示你当前所在位置。在上面的第二张图里,你可以看到整条带有“Tweets”标签的专用于显示位置的栏(当然,还有持续滚动的云朵)。第二个栏的Twitter标志扮演着另一个导航元素,有时候在当前部分显示额外的下拉区域,有时候显示整个顶级快捷方式集合。
|
||||
|
||||
2.3Tweet流看起来和今天的并没有什么不同,除了隐藏的操作按钮(回复,转推等),都在右对齐的箭头按钮里。它们弹出来是一个聊天气泡菜单,看起来就像导航弹窗。仿action bar在新tweet页面有重要作用。它安置着twitter标志,剩余字数统计,以及添加照片,拍照,以及提到联系人按钮。
|
||||
|
||||
Twitter应用甚至还有一对主屏幕小部件,大号的那个占据8格,给你新建栏,更新按钮,一条tweet,以及左右箭头来查看更多tweet。小号的显示一条tweet以及回复按钮。点击大号小部件的新建栏立即打开了“新Tweet”主窗口,这让“更新”按钮变得没有价值。
|
||||
|
||||
![Google Talk和新USB对话框。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/talkusb.png)
|
||||
Google Talk和新USB对话框。
|
||||
Ron Amadeo供图
|
||||
|
||||
其他部分,Google Talk(以及没有截图的短信应用)从暗色主题变成了浅色主题,这让它们看起来和现在的更接近现在的,更现代的应用。USB存储界面会在你设备接入电脑的时候从一个简单的对话框进入全屏界面。这个界面现在有个一个异形安卓机器人/USB闪存盘混合体,而不是之前的纯文字设计。
|
||||
|
||||
尽管安卓2.2在用户互动方式上没有什么新特性,但大的UI调整会在下两个版本到来。然而在所有的UI工作之前,谷歌希望先改进安卓的核心部分。
|
||||
|
||||
----------
|
||||
|
||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||
|
||||
[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。
|
||||
|
||||
[@RonAmadeo][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/13/
|
||||
|
||||
译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.youtube.com/watch?v=9hUIxyE2Ns8#t=3016
|
||||
[2]:http://arstechnica.com/gadgets/2010/02/googles-nexus-one-gets-multitouch/
|
||||
[3]:http://arstechnica.com/information-technology/2010/07/android-22-froyo/
|
||||
[4]:http://arstechnica.com/information-technology/2010/07/android-22-froyo/
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -1,58 +0,0 @@
|
||||
在Linux服务器上如何为SSH登陆获取Email警告
|
||||
================================================================================
|
||||
![](http://www.ehowstuff.com/wp-content/uploads/2015/03/fail2ban-security.jpg)
|
||||
|
||||
让SSH服务器在虚拟私有服务器(VPS)上生效会使得该服务器暴露到互联网中并为黑客活动提供了机会,尤其时当VPS还将root作为主要访问时. VPS应该为每次通过SSH服务器成功登陆尝试配置一个自动的email警告. VPS的服务器所有者应该在任何的SSH服务器访问时得到通知,例如登陆者,登陆时间以及IP地址等信息.这是一个对于服务器拥有者保护服务器避免未知登陆尝试的非常重要的安全关注点.因为如果黑客使用暴力破解方式通过SSH来登陆你的VPS,那么后果很严重.在本文中,我会解释如何在CentOS 6, CentOS 7, RHEL 6 和 RHEL 7上为所有的SSH用户登陆设置一个email警告.
|
||||
|
||||
1. 使用root用户登陆到你的服务器:
|
||||
|
||||
2. 在全局源定义处配置警告(/etc/bashrc),这样就会对跟用户以及普通用户都生效:
|
||||
[root@vps ~]# vi /etc/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
|
||||
|
||||
3.你也可以选择性地让警告只对跟用户生效:
|
||||
|
||||
[root@vps ~]# vi .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
|
||||
|
||||
整个配置文件样例:
|
||||
|
||||
# .bashrc
|
||||
|
||||
# User specific aliases and functions
|
||||
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
# Source global definitions
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc
|
||||
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
|
||||
|
||||
4.你也可以选择性地让警告只对特定的普通用户生效(例如 skytech):
|
||||
|
||||
[root@vps ~]# vi /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
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ehowstuff.com/how-to-get-email-alerts-for-ssh-login-on-linux-server/
|
||||
|
||||
作者:[skytech][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.ehowstuff.com/author/mhstar/
|
@ -0,0 +1,103 @@
|
||||
如何在 Linux 中产生、加密或解密随机密码
|
||||
================================================================================
|
||||
我们一直积极地提供有关 Linux 技巧的系列文章,如果你错过了这个系列的最新文章,你或许可以去访问下面的链接。
|
||||
|
||||
注:此篇文章做过原文
|
||||
- [Linux 中 5 个有趣的命令行技巧][1] (注:这篇文章还没有被翻译,在 20150316 选的题)
|
||||
|
||||
在这篇文章中,我们将分享一些有趣 Linux 技巧,内容是有关如何产生随机密码以及加密或解密这些经过加盐或没有加盐处理的密码。
|
||||
|
||||
安全是数字时代中的一个主要话题。在电脑,email,云端,手机,文档和其他的场合中,我们都会使用到密码。众所周知,选择密码的基本原则是 “易记,难猜”。考虑过使用基于机器自动生成的密码吗?相信我,Linux 非常擅长这方面的工作。
|
||||
|
||||
**1. 使用命令 `pwgen` 来生成一个长度为 10 个字符的唯一的随机密码。假如你还没有安装 pwgen,请使用 Apt 或 YUM 等包管理器来安装它。**
|
||||
|
||||
$ pwgen 10 1
|
||||
|
||||
![生成一个唯一的随机密码](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Unique-Password-in-Linux.gif)
|
||||
生成一个唯一的随机密码
|
||||
|
||||
一口气生成若干组长度为 50 个字符的唯一的随机密码!
|
||||
|
||||
$ pwgen 50
|
||||
|
||||
![生成多组随机密码](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Multiple-Random-Passwords.gif)
|
||||
生成多组随机密码
|
||||
|
||||
**2. 你还可以使用 `makepasswd` 来每次生成一个给定长度的唯一的随机密码。在你把玩 makepasswd 命令之前,请确保你已经安装了它。如若没有安装它,试试使用 Apt 或 YUM 包管理器来安装 `makepasswd`这个软件包。**
|
||||
|
||||
生成一个长度为 10 个字符的随机密码。该命令产生的密码的长度默认为 10。
|
||||
|
||||
$ makepasswd
|
||||
|
||||
![使用 makepasswd 生成唯一的密码](http://www.tecmint.com/wp-content/uploads/2015/03/mkpasswd-generate-unique-password.gif)
|
||||
使用 makepasswd 生成唯一的密码
|
||||
|
||||
生成一个长度为 50 个字符的随机密码。
|
||||
|
||||
$ makepasswd --char 50
|
||||
|
||||
![生成长度为 50 的密码](http://www.tecmint.com/wp-content/uploads/2015/03/Random-Password-Generate.gif)
|
||||
生成长度为 50 的密码
|
||||
|
||||
生成 7 个长度为 20 个字符的随机密码。
|
||||
|
||||
$ makepasswd --char 20 --count 7
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-20-Character-Password.gif)
|
||||
|
||||
**3. 使用带“盐”的 Crypt(注:这里应该指的是一个函数,可以参考[这里](http://man7.org/linux/man-pages/man3/crypt.3.html) ) 来加密一个密码。提供手动或自动添加 “盐”。**
|
||||
|
||||
对于那些不清楚 **盐** 的意义的人,
|
||||
|
||||
这里的 “盐” 指的是一个随机数据,它作为密码生成函数的一个额外的输入, 目的是保护密码免受词典攻击。
|
||||
|
||||
在执行下面的操作前,请确保你已经安装了 `mkpasswd`。
|
||||
|
||||
下面的命令将带 “盐” 加密一个密码。“盐” 的值是随机自动生成的。所以每次你运行下面的命令时,都将产生不同的输出,因为它每次接受了随机取值的 “盐”。
|
||||
|
||||
$ mkpasswd tecmint
|
||||
|
||||
![使用 Crypt 来加密密码](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-Password-in-Linux.gif)
|
||||
使用 Crypt 来加密密码
|
||||
|
||||
现在让我们来手动定义 “盐” 的值。每次它将产生相同的结果。请注意你可以输入任何你想输入的值来作为 “盐” 的值。
|
||||
|
||||
$ mkpasswd tecmint -s tt
|
||||
|
||||
![带“盐”加密密码](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-Password-Using-Salt.gif)
|
||||
带“盐”加密密码
|
||||
|
||||
另外, mkpasswd 还是交互式的,假如你在命令中没有提供密码,它将主动询问你来输入密码。
|
||||
|
||||
**4. 使用 aes-256-cbc 加密算法并使用密码(如 “tecmint”) 并带“盐” 加密一个字符串(如 “Tecmint-is-a-Linux-Community”)。**
|
||||
|
||||
# echo Tecmint-is-a-Linux-Community | openssl enc -aes-256-cbc -a -salt -pass pass:tecmint
|
||||
|
||||
![在 Linux 中加密一个字符串](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-A-String-in-Linux.gif)
|
||||
在 Linux 中加密一个字符串
|
||||
|
||||
在上面例子中, [echo 命令][2](注:此篇原文也做过,这里是链接 http://linux.cn/article-3948-1.html) 的输出通过管道传递给了 openssl 命令,使得该输出被 Cipher(enc) 所加密,这个过程中使用了 aes-256-cbc 加密算法,并附带了密码 (tecmint) 和 “盐” 。
|
||||
|
||||
**5. 使用 openssl 命令的 -aes-256-cbc 解密选项来解密上面的字符串。**
|
||||
|
||||
# echo U2FsdGVkX18Zgoc+dfAdpIK58JbcEYFdJBPMINU91DKPeVVrU2k9oXWsgpvpdO/Z | openssl enc -aes-256-cbc -a -d -salt -pass pass:tecmint
|
||||
|
||||
![在 Linux 中解密字符串](http://www.tecmint.com/wp-content/uploads/2015/03/Decrypt-String-in-Linux.gif)
|
||||
在 Linux 中解密字符串
|
||||
|
||||
现在就是这些内容了。假如你知道任何这类的技巧,请将你的技巧发送到 admin@tecmint.com 邮箱中,你的技巧将会以你的名义来发表,同时我们也将在我们将来的文章中把它包含进去。
|
||||
|
||||
保持联系,保持连接,敬请关注。不要忘了在下面的评论中提供给我们您有价值的反馈。
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/generate-encrypt-decrypt-random-passwords-in-linux/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者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/5-linux-command-line-tricks/
|
||||
[2]:http://www.tecmint.com/echo-command-in-linux/
|
@ -0,0 +1,105 @@
|
||||
一些重要Docker命令的简单介绍
|
||||
================================================================================
|
||||
大家好,今天我们来学习一些在你使用Docker之前需要了解的重要的 Docker 命令。Docker 是一个提供开发平台去打包,装载和运行任何应用的轻量级容器开源项目。它没有语言支持,框架和打包系统的限制,能从一个小的家庭电脑到高端服务器,在任何地方任何时间运行。这使得它们成为不依赖于一个特定的栈或供应商,部署和扩展web应用,数据库和后端服务很好的构建块。
|
||||
|
||||
Docker 命令简单易学,也很容易实现或实践。这是一些你运行 Docker 并充分利用它需要知道的简单 Docker 命令。
|
||||
|
||||
### 1. 拉取一个 Docker 镜像 ###
|
||||
|
||||
由于容器是由 Docker 镜像构建的,首先我们需要拉取一个 docker 镜像来开始。我们可以从 Docker 注册 Hub 获取需要的 docker 镜像。在我们使用 pull 命令拉取任何镜像之前,由于pull命令被标识为恶意命令,我们需要保护我们的系统。为了保护我们的系统不受这个问题影响,我们需要添加 **127.0.0.1 index.docker.io** 到 /etc/hosts 条目。我们可以通过使用喜欢的文本编辑器完成。
|
||||
|
||||
# nano /etc/hosts
|
||||
|
||||
现在,增加下面的一行到文件并保存退出。
|
||||
|
||||
127.0.0.1 index.docker.io
|
||||
|
||||
![Docker 宿主机](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-hosts.png)
|
||||
|
||||
要拉取一个 docker 进行,我们需要运行下面的命令。
|
||||
|
||||
# docker pull registry.hub.docker.com/busybox
|
||||
|
||||
![Docker pull 命令](http://blog.linoxide.com/wp-content/uploads/2015/04/pulling-image.png)
|
||||
|
||||
我们可以检查本地是否有可用的 Docker 镜像。
|
||||
|
||||
# docker images
|
||||
|
||||
![Docker 镜像](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-images.png)
|
||||
|
||||
### 2. 运行一个 Docker 容器 ###
|
||||
|
||||
现在,成功地拉取要求或需要的 Docker 镜像之后,我们当然想运行这个 Docker 镜像。我们可以用 docker run 命令在镜像上运行一个 docker 容器。在 Docker 镜像之上运行一个 docker 容易时我们有很多选项和标记。我们使用 -t 和 -i 标记运行一个 docker 镜像并进入容器,如下面所示。
|
||||
|
||||
# docker run -it busybox
|
||||
|
||||
![Docker Run Shell 命令](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-run-shell.png)
|
||||
|
||||
从上面的命令中,我们进入了容器并可以通过交互 shell 访问它的内容。我们可以键入 **Ctrl-D** 从shell中退出。
|
||||
|
||||
现在,在后台运行容器,我们用 -d 标记分离 shell,如下所示。
|
||||
|
||||
# docker run -itd busybox
|
||||
|
||||
![后台运行容器](http://blog.linoxide.com/wp-content/uploads/2015/04/run-container-background.png)
|
||||
|
||||
如果你想进入到一个正在运行的容器,我们可以使用 attach 命令加一个容器 id。可以使用 **docker ps** 命令获取容器 id。
|
||||
|
||||
# docker attach <container id>
|
||||
|
||||
![进入Docker](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-attach.png)
|
||||
|
||||
### 3. 查看容器 ###
|
||||
|
||||
不论容器是否运行,查看日志文件都很简单。我们可以使用下面的命令去检查是否有 docker 容器在实时运行。
|
||||
|
||||
# docker ps
|
||||
|
||||
现在,查看正在运行的或者之前运行的容器的日志,我们需要运行以下的命令。
|
||||
|
||||
# docker ps -a
|
||||
|
||||
![查看 Docker 容器](http://blog.linoxide.com/wp-content/uploads/2015/04/view-docker-containers1.png)
|
||||
|
||||
### 4. 检查 Docker 容器 ###
|
||||
|
||||
我们可以使用 inspect 命令检查一个 Docker 容器的每条信息。
|
||||
|
||||
# docker inspect <container id>
|
||||
|
||||
![检查Docker](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-inspect.png)
|
||||
|
||||
### 5. 杀死或删除命令 ###
|
||||
|
||||
我们可以使用 docker id 杀死或者停止进程或 docker 容器,如下所示。
|
||||
|
||||
# docker stop <container id>
|
||||
|
||||
要停止每个正在运行的容器,我们需要运行下面的命令。
|
||||
|
||||
# docker kill $(docker ps -q)
|
||||
|
||||
现在,如我我们希望移除一个 docker 镜像,运行下面的命令。
|
||||
|
||||
# docker rm <container id>
|
||||
|
||||
如果我们想一次性移除所有 docker 镜像,我们可以运行以下命令。
|
||||
|
||||
# docker rm $(docker ps -aq)
|
||||
|
||||
### 结论 ###
|
||||
|
||||
这些都是学习充分实现和利用 Docker 很基本的 docker 命令。有了这些命令,Docker 变得很简单,提供给端用户一个简单的计算平台。根据上面的教程,任何人学习 Docker 命令都非常简单。如果你有任何问题,建议,反馈,请写到下面的评论框中以便我们改进和更新内容。多谢!享受吧 :-)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/important-docker-commands/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
@ -0,0 +1,174 @@
|
||||
如何在Bash Shell脚本中显示对话框以及事例
|
||||
================================================================================
|
||||
这个教程给出几个如何使用类似zenity和whiptail的工具在Bash Shell 脚本中提供消息/对话框的例子。使用这些工具,你的脚本能够告知用户当前程序运行的状态以及有与其交互的能力。这两个工具的不同之处在于显示消息框或者对话框的方式。Zenity用GTK工具包创建图形用户界面,而whiptail在终端内部创建消息框。
|
||||
|
||||
### Zenity 工具 ###
|
||||
|
||||
在Ubuntu中安装zenity,运行:
|
||||
|
||||
sudo apt-get install zenity
|
||||
|
||||
由于用zenity创建消息框或者对话框的命令是相当自解释的,我们会给你提供一些例子。
|
||||
|
||||
### 创建消息框 ###
|
||||
|
||||
zenity --info --title "Information Box" --text "This should be information" --width=300 --height=200
|
||||
|
||||
![消息框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Information-Box.png)
|
||||
|
||||
创建 Yes/No 对话框
|
||||
|
||||
zenity --question --text "Do you want this?" --ok-label "Yeah" --cancel-label="Nope"
|
||||
|
||||
![问题截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Question.png)
|
||||
|
||||
创建输入框并在变量中保存值
|
||||
|
||||
a=$(zenity --entry --title "Entry box" --text "Please enter the value" --width=300 --height=200)
|
||||
echo $a
|
||||
|
||||
![输入框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Entry-box.png)
|
||||
|
||||
输入后,值会保存在变量 $a 中。
|
||||
|
||||
这是一个获取用户姓名并显示的实际事例。
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script will ask for couple of parameters
|
||||
# and then continue to work depending on entered values
|
||||
#
|
||||
|
||||
# Giving the option to user
|
||||
zenity --question --text "Do you want to continue?"
|
||||
|
||||
# Checking if user wants to proceed
|
||||
[ $? -eq 0 ] || exit 1
|
||||
|
||||
# Letting user input some values
|
||||
FIRSTNAME=$(zenity --entry --title "Entry box" --text "Please, enter your first name." --width=300 --height=150)
|
||||
LASTNAME=$(zenity --entry --title "Entry box" --text "Please, enter your last name." --width=300 --height=150)
|
||||
AGE=$(zenity --entry --title "Entry box" --text "Please, enter your age." --width=300 --height=150)
|
||||
|
||||
# Displaying entered values in information box
|
||||
zenity --info --title "Information" --text "You are ${FIRSTNAME} ${LASTNAME} and you are ${AGE}(s) old." --width=300 --height=100
|
||||
|
||||
这些是运行前面脚本的截图。
|
||||
|
||||
![例1-问题-1](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Question-1.png)
|
||||
|
||||
框1
|
||||
|
||||
![例1-输入框-1](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Entry-box-1.png)
|
||||
|
||||
输入框
|
||||
|
||||
![例1-输入框-2](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Entry-box-2.png)
|
||||
|
||||
输入框
|
||||
|
||||
![例1-输入框-3](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Entry-box-3.png)
|
||||
|
||||
输入框
|
||||
|
||||
![例1-信息](http://blog.linoxide.com/wp-content/uploads/2015/03/Example1-Information.png)
|
||||
|
||||
信息框
|
||||
|
||||
别忘了查看也许能帮助到你的有用的[zenity 选项][1]
|
||||
|
||||
### Whiptail 工具 ###
|
||||
|
||||
在Ubuntu上安装whiptail,运行
|
||||
|
||||
sudo apt-get install whiptail
|
||||
|
||||
用whiptail创建消息框或者对话框的命令也是相当自解释的,我们会给你提供一些基本例子。
|
||||
|
||||
### 创建消息框 ###
|
||||
|
||||
whiptail --msgbox "This is a message" 10 40
|
||||
|
||||
![whiptail消息框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-msgbox.png)
|
||||
|
||||
### 创建 Yes/No 对话框 ###
|
||||
|
||||
whiptail --yes-button "Yeah" --no-button "Nope" --title "Choose the answer" --yesno "Will you choose yes?" 10 30
|
||||
|
||||
![whiptail对话框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-yesno.png)
|
||||
|
||||
### 创建有缺省值的输入框 ###
|
||||
|
||||
whiptail --inputbox "Enter your number please." 10 30 "10"
|
||||
|
||||
![whiptail输入框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-entry.png)
|
||||
|
||||
尝试使用输入值要注意的一点是whiptail用stdout显示对话框,用stderr输出值。那样的话,如果你用 var=$(...),你不会看到对话框,也不能获得输入的值。解决方法是交换stdout和stderr。在whiptail命令后面添加 **3>&1 1>&2 2>&3** 就可以做到。你想获取输入值的任何whiptail命令也是如此。
|
||||
|
||||
### 创建菜单对话框 ###
|
||||
|
||||
whiptail --menu "This is a menu. Choose an option:" 20 50 10 1 "first" 2 "second" 3 "third"
|
||||
|
||||
![whiptail菜单截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-menu.png)
|
||||
|
||||
这是一个请求用户输入一个文件夹的路径并输出它的大小的 **shell 脚本**。
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
#
|
||||
|
||||
# Since whiptail has to use stdout to display dialog, entered value will
|
||||
# be stored in stderr. To switch them and get the value to stdout you must
|
||||
# use 3>&1 1>&2 2>&3
|
||||
FOLDER_PATH=$(whiptail --title "Get the size of folder" \
|
||||
--inputbox "Enter folder path:" \
|
||||
10 30 \
|
||||
"/home" \
|
||||
3>&1 1>&2 2>&3)
|
||||
|
||||
if [ -d $FOLDER_PATH ]
|
||||
then
|
||||
size=$(du -hs "$FOLDER_PATH" | awk '{print $1}')
|
||||
whiptail --title "Information" \
|
||||
--msgbox "Size of ${FOLDER_PATH} is ${size}" \
|
||||
10 40
|
||||
elif [ -f $FOLDER_PATH ]
|
||||
then
|
||||
whiptail --title "Warning!!!" \
|
||||
--msgbox "The path you entered is a path to a file not a folder!" \
|
||||
10 40
|
||||
else
|
||||
whiptail --title "Error!!!"
|
||||
--msgbox "Path you entered is not recognized. Please try again" \
|
||||
10 40
|
||||
fi
|
||||
|
||||
这是之前例子的一些截图:
|
||||
|
||||
![例2-输入框](http://blog.linoxide.com/wp-content/uploads/2015/03/Example2-Entry-box.png)
|
||||
|
||||
输入框
|
||||
|
||||
![例2-消息框](http://blog.linoxide.com/wp-content/uploads/2015/03/Example2-Information.png)
|
||||
|
||||
消息框
|
||||
|
||||
如果你在终端下工作,[帮助手册][2]总是有用的。
|
||||
|
||||
### 结论 ###
|
||||
|
||||
选择合适的工具显示对话框取决于你期望在桌面机器还是服务器上运行你的脚本。桌面机器用户通常使用窗口环境,更可能用显示的窗口运行脚本和交互。然而,如果你期望用户是在服务器上工作的,你也许会希望安全地显示,并使用whiptail或者任何其它在纯终端窗口显示对话框的工具。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-shell-script/bash-shell-script-show-dialog-box/
|
||||
|
||||
作者:[Ilija Lazarevic][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/ilijala/
|
||||
[1]:https://help.gnome.org/users/zenity/stable/
|
||||
[2]:http://linux.die.net/man/1/whiptail
|
@ -0,0 +1,171 @@
|
||||
Translating by demon
|
||||
如何使用图形化工具远程管理Linux Vps上的MySql
|
||||
================================================================================
|
||||
如果你在一个远程的VPS上运行了MYSQL server,你会如何管理你的远程数据库主机呢?基于web的数据库管理工具例如phpMyAdmin或者Adminer可能会是你一个想起的。这些基于web的管理工具需要一个后端的web服务和PHP引擎在正常运行。但是,如果你的VPS仅仅用来做数据库服务(e.g., for a multi-tier app),为临时的数据库管理提供一整套的LAMP是浪费VPS资源的。更糟的是,LAMP带有的HTTP端口可能会成为你VPS资源的安全漏洞。
|
||||
|
||||
作为一种选择,你可以使用在一台客户机上运行本地的Mysql客户端,当然,如果没有别的选择,一个纯净的命令行mysql客户端将是你的默认选择。但是命令行客户端的功能是有限的,因此它不适合在生产环境中使用,例如:sql开发,性能调优,模式验证等等。你是否在寻找一个成熟的MYSQL管理工具,那么一个MYSQL的图形化管理工具将会更好的满足你的需求。
|
||||
|
||||
什么是MySQL Workbench?
|
||||
|
||||
作为一个由Oracle开发的成熟数据库管理工具,mysql workbench不仅仅是一个MySQL客户端。简而言之,Workbench是一个跨平台的(eg:Linux,MacOX,Windows)数据库设计,开发和管理图形工具。社区版本的Msyql Workbench是遵循GPL协议的。作为一个数据库管理者,你可以使用Workbench去配置Mysql服务,管理Mysql用户,完成数据库的备份与还原,监视数据库的健康状况,所有的都在对用户友好的图形化环境下处理。
|
||||
|
||||
在这个手册里,让我们演示下如何在Linux下安装和使用Mysql Workbench.
|
||||
|
||||
在Linux上安装MySQL Workbench
|
||||
|
||||
你可以在任何一个桌面linux机器上运行Mysql Workbench去设置你的数据库管理环境。然而一些Linux发行版(例如:Debian/Ubuntu)在他们的软件源中已经有了Mysql Workbench.从官方源中安装是一个好的方法,因为他们提供了最新的版本。这里介绍了如何设置一个官方的Workbench源和从中安装它。
|
||||
|
||||
#### Debian-based Desktop (Debia, Ubuntu, Mint): ####
|
||||
|
||||
到其官方站点,选择一个和你环境匹配的DEB file源,并下载安装
|
||||
|
||||
For example, on Ubuntu 14.10:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-apt-config_0.3.4-2ubuntu14.10_all.deb
|
||||
$ sudo dpkg -i mysql-apt-config_0.3.4-2ubuntu14.10_all.deb
|
||||
|
||||
on Debian 7:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-apt-config_0.3.3-1debian7_all.deb
|
||||
$ sudo dpkg -i mysql-apt-config_0.3.3-1debian7_all.deb
|
||||
|
||||
当你安装DEB文件时,你会看到下面的配置菜单,并且选择配置那个Mysql产品
|
||||
|
||||
![](https://farm8.staticflickr.com/7702/16928715218_b1fcbcdbf3_c.jpg)
|
||||
|
||||
选择“Utilities”.完成配置后,选择“Apply”去保存配置。然后,更新包索引,并且安装Workbench
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install mysql-workbench
|
||||
|
||||
#### Red Hat-based Desktop (CentOS, Fedora, RHEL): ####
|
||||
|
||||
去官网下载并安装适合你Linux环境的RPM源包
|
||||
For example, on CentOS 7:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
|
||||
$ sudo yum localinstall mysql-community-release-el7-5.noarch.rpm
|
||||
|
||||
on Fedora 21:
|
||||
|
||||
$ wget http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm
|
||||
$ sudo yum localinstall mysql-community-release-fc21-6.noarch.rpm
|
||||
|
||||
验证"MySQL Tools Community"源是否被安装
|
||||
$ yum repolis enabled
|
||||
|
||||
![](https://farm9.staticflickr.com/8826/16494069254_15458ace52_c.jpg)
|
||||
|
||||
安装Workbench
|
||||
|
||||
$ sudo yum install mysql-workbench-community
|
||||
|
||||
设置远程数据库的安全连接
|
||||
|
||||
接下来是为你运行Mysql服务的VPS设置一个远程连接,当然你可以直接通过图形化的Workbench连接你的远程Mysql服务器(在数据库开放了远程连接后)。然而,这样做有很大的安全风险,因为有些人很容易窃听你的数据库传输信息,并且一个公开的Mysql端口(默认为3306)被作为攻击入口。
|
||||
|
||||
一个比较好的方法是关掉远程访问数据库服务功能,(仅允许在127.0.0.1访问)。然后在本地客户机和远程Vps直接设置一个SSH隧道,这样的话,和mysql之间的数据能被安全的传输,仅在它的本地回环接口上。相比较设置一个SSL加密的连接来说,配置SSH隧道需要很少的操作,因为他仅仅需要SSH服务,并且在大多数的VPS上已经部署了。
|
||||
|
||||
让我们来看看如何来为一个Mysql Workbench设置一个SSH隧道,这里的设置,不需要你开放远程访问Mysql服务。
|
||||
在一个运行了Workbench的本地客户机上,键入下面的命令,替换'user' and 'remote_vps'为你自己的信息
|
||||
|
||||
$ ssh user@remote_vps -L 3306:127.0.0.1:3306 -N
|
||||
|
||||
你会被要求输入你VPS的SSH密码,当你成功登陆VPS后,一个SSH隧道将会在本地的3306端口和远程VPS的3306端口将会被建立。这里你不会看到任何信息。
|
||||
|
||||
或者你可以选择在后台运行SSH隧道,按CTRL+Z停止当前的命令,然后输入bg并且ENTER
|
||||
|
||||
![](https://farm8.staticflickr.com/7714/16928715438_bf0db49b3b_c.jpg)
|
||||
|
||||
这样SSH隧道就会在后台运行了。
|
||||
|
||||
使用MySQL Workbench远程管理MySQL服务
|
||||
|
||||
在建立好SSH隧道后,你可以通过MySQL Workbench去远程连接Mysql服务了。
|
||||
|
||||
输入下面命令启动Workbench
|
||||
|
||||
$ mysql-workbench
|
||||
|
||||
![](https://farm9.staticflickr.com/8768/16494069294_0fce571ddb_c.jpg)
|
||||
|
||||
点击Workbench页面上面的加号图标去创建一个新的数据库连接,接着会出现下面的连接信息。
|
||||
|
||||
- **Connection Name**: any description (e.g., My remote VPS database)
|
||||
- **Hostname**: 127.0.0.1
|
||||
- **Port**: 3306
|
||||
- **Username**: MySQL username (e.g., root)
|
||||
|
||||
![](https://farm8.staticflickr.com/7727/16928715288_d9ac3bfc7a_c.jpg)
|
||||
|
||||
注意:因为隧道设置的是127.0.0.1:3306,所以主机名哪里必须是127.0.0.1,而不能是远程VPS的IP地址或者主机名
|
||||
|
||||
当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。
|
||||
|
||||
![](https://farm8.staticflickr.com/7650/17114969532_0252ffcd31_c.jpg)
|
||||
|
||||
当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。
|
||||
|
||||
#### MySQL Server Status ####
|
||||
|
||||
当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。
|
||||
|
||||
![](https://farm8.staticflickr.com/7627/16494069414_9d838d4138_c.jpg)
|
||||
|
||||
#### Client Connections ####
|
||||
|
||||
连接数是一个极其重要的监视资源,这个菜单显示了每个连接的详细信息。
|
||||
|
||||
![](https://farm9.staticflickr.com/8747/16909119337_a8d89772dd_c.jpg)
|
||||
|
||||
#### 用户和权限 ####
|
||||
|
||||
这个菜单允许你管理MySQL用户,包括他们的资源限制和权限。
|
||||
|
||||
![](https://farm9.staticflickr.com/8765/16494069384_760fc17c8f_c.jpg)
|
||||
|
||||
#### MySQL Server Administration ####
|
||||
|
||||
你可以启动或关闭MySQL服务,并且检查它的服务日志。
|
||||
|
||||
![](https://farm8.staticflickr.com/7588/17114969592_54526dfb32_c.jpg)
|
||||
|
||||
#### Database Schema Management ####
|
||||
|
||||
可以可视化的查看,更改,检查数据库结构,在“Schemas”标题下选择任何一个数据库或表,然后右击
|
||||
|
||||
![](https://farm8.staticflickr.com/7665/16496363973_fd03a96198_c.jpg)
|
||||
|
||||
![](https://farm9.staticflickr.com/8744/16909119497_7c884617b8_c.jpg)
|
||||
|
||||
#### Database Query ####
|
||||
|
||||
你可以执行任何的语句(只要你的权限允许),并且检查他的结果。
|
||||
|
||||
![](https://farm8.staticflickr.com/7716/17114969692_c0f02bb277_c.jpg)
|
||||
|
||||
此外,性能统计数据和报表仅用于MySQL5.6以上的版本。对于5.5及其以下的版本,性能部分会以灰色显示。
|
||||
### 结论 ###
|
||||
|
||||
简介且直观的选项卡界面,丰富的特性,开源,使MySQL Workbench成为一个非常好的可视化数据库设计和管理工具。为其减分的是它的性能。我注意到在一台运行繁忙的服务器上,Workbench优势会变得异常缓慢,尽管它的性能差强人意,我依然认为MySQL Workbench是MySQL数据库管理员和设计人员必备的工具之一。
|
||||
|
||||
你曾在你的生产环境中用过Workbench吗?或者你还有别的GUI工具可以推荐?请分享你的经验吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/remote-mysql-databases-gui-tool.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/tyzy313481929译者demon)
|
||||
校对:[校对者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/go/digitalocean
|
||||
[2]:http://ask.xmodulo.com/install-phpmyadmin-centos.html
|
||||
[3]:http://xmodulo.com/set-web-based-database-management-system-adminer.html
|
||||
[4]:http://mysqlworkbench.org/
|
||||
[5]:http://dev.mysql.com/downloads/repo/apt/
|
||||
[6]:http://dev.mysql.com/downloads/repo/yum/
|
||||
[7]:http://xmodulo.com/how-to-allow-remote-access-to-mysql.html
|
@ -0,0 +1,355 @@
|
||||
Linux网络统计工具/命令
|
||||
================================================================================
|
||||
我在Linux(基于CentOS 或者 Debian 的发行版)中该如何查看当前网络端口吞吐量的统计信息?在Linux操作系统中如何查看当前内核snmp计数器以及网络端口的统计信息?
|
||||
|
||||
![](http://s0.cyberciti.org/images/category/old/networking.png)
|
||||
|
||||
你可以使用以下任何一个命令:
|
||||
|
||||
### nstat 命令 : 网络统计工具 ###
|
||||
|
||||
键入以下命令:
|
||||
|
||||
# nstat
|
||||
|
||||
输出样例:
|
||||
|
||||
#kernel
|
||||
IpInReceives 133243 0.0
|
||||
IpInDelivers 133243 0.0
|
||||
IpOutRequests 92904 0.0
|
||||
IcmpOutErrors 97 0.0
|
||||
IcmpOutTimeExcds 97 0.0
|
||||
IcmpMsgOutType3 97 0.0
|
||||
TcpActiveOpens 538 0.0
|
||||
TcpEstabResets 56 0.0
|
||||
TcpInSegs 129837 0.0
|
||||
TcpOutSegs 89720 0.0
|
||||
TcpRetransSegs 42 0.0
|
||||
TcpOutRsts 704 0.0
|
||||
UdpInDatagrams 3255 0.0
|
||||
UdpNoPorts 97 0.0
|
||||
UdpOutDatagrams 3270 0.0
|
||||
Ip6OutNoRoutes 206 0.0
|
||||
TcpExtTW 141 0.0
|
||||
TcpExtDelayedACKs 508 0.0
|
||||
TcpExtDelayedACKLocked 1 0.0
|
||||
TcpExtDelayedACKLost 42 0.0
|
||||
TcpExtTCPHPHits 117659 0.0
|
||||
TcpExtTCPPureAcks 2158 0.0
|
||||
TcpExtTCPHPAcks 605 0.0
|
||||
TcpExtTCPSackRecovery 1 0.0
|
||||
TcpExtTCPLossUndo 16 0.0
|
||||
TcpExtTCPSackFailures 4 0.0
|
||||
TcpExtTCPFastRetrans 1 0.0
|
||||
TcpExtTCPSlowStartRetrans 3 0.0
|
||||
TcpExtTCPTimeouts 33 0.0
|
||||
TcpExtTCPDSACKOldSent 40 0.0
|
||||
TcpExtTCPDSACKRecv 5 0.0
|
||||
TcpExtTCPAbortOnData 120 0.0
|
||||
TcpExtTCPAbortOnClose 55 0.0
|
||||
TcpExtTCPSackShiftFallback 9 0.0
|
||||
IpExtInOctets 180131682 0.0
|
||||
IpExtOutOctets 7289106 0.0
|
||||
|
||||
### ss 命令 : 查询套接字工具 ###
|
||||
|
||||
要查看统计汇总, 输入:
|
||||
|
||||
# ss -s
|
||||
|
||||
输出样例:
|
||||
|
||||
Total: 786 (kernel 804)
|
||||
TCP: 65 (estab 40, closed 7, orphaned 0, synrecv 0, timewait 6/0), ports 56
|
||||
Transport Total IP IPv6
|
||||
* 804 - -
|
||||
RAW 1 1 0
|
||||
UDP 12 9 3
|
||||
TCP 58 52 6
|
||||
INET 71 62 9
|
||||
FRAG 0 0 0
|
||||
|
||||
查看[ss 命令教程][1] 获取更多信息。
|
||||
|
||||
### netstat 命令 : 显示套接字信息的旧的好工具 ###
|
||||
|
||||
查看所有网络端口以及汇总信息表,输入:
|
||||
|
||||
# netstat -i
|
||||
|
||||
输出样例:
|
||||
|
||||
Kernel Interface table
|
||||
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
|
||||
eth0 1500 0 941022 0 0 0 688165 0 0 0 BMRU
|
||||
lo 16436 0 9304 0 0 0 9304 0 0 0 LRU
|
||||
ppp0 1496 0 3784 0 0 0 4177 0 0 0 MOPRU
|
||||
|
||||
查看每个协议的汇总统计信息,输入:
|
||||
|
||||
# netstat -s
|
||||
|
||||
输出样例:
|
||||
|
||||
Ip:
|
||||
1092065 total packets received
|
||||
0 forwarded
|
||||
0 incoming packets discarded
|
||||
1091681 incoming packets delivered
|
||||
798913 requests sent out
|
||||
895 dropped because of missing route
|
||||
759 reassemblies required
|
||||
375 packets reassembled ok
|
||||
Icmp:
|
||||
17 ICMP messages received
|
||||
0 input ICMP message failed.
|
||||
ICMP input histogram:
|
||||
timeout in transit: 8
|
||||
echo replies: 9
|
||||
1747 ICMP messages sent
|
||||
0 ICMP messages failed
|
||||
ICMP output histogram:
|
||||
destination unreachable: 1730
|
||||
echo request: 17
|
||||
IcmpMsg:
|
||||
InType0: 9
|
||||
InType11: 8
|
||||
OutType3: 1730
|
||||
OutType8: 17
|
||||
Tcp:
|
||||
4822 active connections openings
|
||||
1129 passive connection openings
|
||||
457 failed connection attempts
|
||||
165 connection resets received
|
||||
7 connections established
|
||||
1062519 segments received
|
||||
771394 segments send out
|
||||
7158 segments retransmited
|
||||
6 bad segments received.
|
||||
2578 resets sent
|
||||
Udp:
|
||||
20846 packets received
|
||||
1730 packets to unknown port received.
|
||||
0 packet receive errors
|
||||
19242 packets sent
|
||||
UdpLite:
|
||||
TcpExt:
|
||||
71 invalid SYN cookies received
|
||||
8 resets received for embryonic SYN_RECV sockets
|
||||
142 packets pruned from receive queue because of socket buffer overrun
|
||||
2109 TCP sockets finished time wait in fast timer
|
||||
84 packets rejects in established connections because of timestamp
|
||||
19454 delayed acks sent
|
||||
6 delayed acks further delayed because of locked socket
|
||||
Quick ack mode was activated 7306 times
|
||||
1 packets directly queued to recvmsg prequeue.
|
||||
1 bytes directly received in process context from prequeue
|
||||
823921 packet headers predicted
|
||||
24412 acknowledgments not containing data payload received
|
||||
10150 predicted acknowledgments
|
||||
242 times recovered from packet loss by selective acknowledgements
|
||||
33 congestion windows recovered without slow start by DSACK
|
||||
335 congestion windows recovered without slow start after partial ack
|
||||
336 TCP data loss events
|
||||
TCPLostRetransmit: 35
|
||||
1 timeouts after reno fast retransmit
|
||||
156 timeouts after SACK recovery
|
||||
116 timeouts in loss state
|
||||
461 fast retransmits
|
||||
5 forward retransmits
|
||||
608 retransmits in slow start
|
||||
2073 other TCP timeouts
|
||||
62 SACK retransmits failed
|
||||
43074 packets collapsed in receive queue due to low socket buffer
|
||||
8499 DSACKs sent for old packets
|
||||
101 DSACKs sent for out of order packets
|
||||
308 DSACKs received
|
||||
9 DSACKs for out of order packets received
|
||||
427 connections reset due to unexpected data
|
||||
122 connections reset due to early user close
|
||||
28 connections aborted due to timeout
|
||||
TCPDSACKIgnoredOld: 3
|
||||
TCPDSACKIgnoredNoUndo: 60
|
||||
TCPSpuriousRTOs: 4
|
||||
TCPSackShifted: 282
|
||||
TCPSackMerged: 740
|
||||
TCPSackShiftFallback: 1017
|
||||
IpExt:
|
||||
InMcastPkts: 47
|
||||
OutMcastPkts: 51
|
||||
InBcastPkts: 1
|
||||
InOctets: 1341508973
|
||||
OutOctets: 72525352
|
||||
InMcastOctets: 8649
|
||||
OutMcastOctets: 7519
|
||||
InBcastOctets: 328
|
||||
|
||||
查看 [netstat 命令教程][2] 获取更多信息。
|
||||
|
||||
### ip / ifconfig 命令 : 配置或者显示网络端口信息 ###
|
||||
|
||||
键入以下命令:
|
||||
|
||||
# ifconfig
|
||||
|
||||
或者
|
||||
|
||||
# /sbin/ifconfig
|
||||
|
||||
或者
|
||||
|
||||
# ifconfig eth0
|
||||
|
||||
----------
|
||||
|
||||
eth0 Link encap:Ethernet HWaddr b8:ac:6f:65:31:e5
|
||||
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
|
||||
inet6 addr: fe80::baac:6fff:fe65:31e5/64 Scope:Link
|
||||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
RX packets:966334 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:703297 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1000
|
||||
RX bytes:1186255648 (1.1 GiB) TX bytes:73968238 (70.5 MiB)
|
||||
Interrupt:17
|
||||
lo Link encap:Local Loopback
|
||||
inet addr:127.0.0.1 Mask:255.0.0.0
|
||||
inet6 addr: ::1/128 Scope:Host
|
||||
UP LOOPBACK RUNNING MTU:16436 Metric:1
|
||||
RX packets:9666 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:9666 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:0
|
||||
RX bytes:1399578 (1.3 MiB) TX bytes:1399578 (1.3 MiB)
|
||||
ppp0 Link encap:Point-to-Point Protocol
|
||||
inet addr:10.1.11.70 P-t-P:10.0.31.18 Mask:255.255.255.255
|
||||
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1
|
||||
RX packets:3784 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:4177 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:3
|
||||
RX bytes:2400265 (2.2 MiB) TX bytes:275983 (269.5 KiB)
|
||||
|
||||
显示网络端口统计信息,输入:
|
||||
|
||||
# ip -s link
|
||||
|
||||
输出样例:
|
||||
|
||||
1: lo: mtu 16436 qdisc noqueue state UNKNOWN
|
||||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||
RX: bytes packets errors dropped overrun mcast
|
||||
1444187 9960 0 0 0 0
|
||||
TX: bytes packets errors dropped carrier collsns
|
||||
1444187 9960 0 0 0 0
|
||||
2: eth0: mtu 1500 qdisc mq state UP qlen 1000
|
||||
link/ether b8:ac:6f:65:31:e5 brd ff:ff:ff:ff:ff:ff
|
||||
RX: bytes packets errors dropped overrun mcast
|
||||
1221956483 991501 0 0 0 24
|
||||
TX: bytes packets errors dropped carrier collsns
|
||||
75623937 720272 0 0 0 0
|
||||
3: wlan0: mtu 1500 qdisc noop state DOWN qlen 1000
|
||||
link/ether 00:21:6a:ca:9b:10 brd ff:ff:ff:ff:ff:ff
|
||||
RX: bytes packets errors dropped overrun mcast
|
||||
0 0 0 0 0 0
|
||||
TX: bytes packets errors dropped carrier collsns
|
||||
0 0 0 0 0 0
|
||||
4: pan0: mtu 1500 qdisc noop state DOWN
|
||||
link/ether 4a:c7:5f:0e:8e:d8 brd ff:ff:ff:ff:ff:ff
|
||||
RX: bytes packets errors dropped overrun mcast
|
||||
0 0 0 0 0 0
|
||||
TX: bytes packets errors dropped carrier collsns
|
||||
0 0 0 0 0 0
|
||||
8: ppp0: mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3
|
||||
link/ppp
|
||||
RX: bytes packets errors dropped overrun mcast
|
||||
2419881 3848 0 0 0 0
|
||||
TX: bytes packets errors dropped carrier collsns
|
||||
284151 4287 0 0 0 0
|
||||
|
||||
### sar 命令: 显示网络统计信息 ###
|
||||
|
||||
输入以下命令 (你需要 [通过sysstat包安装并启用sar][3]):
|
||||
sar -n DEV
|
||||
|
||||
Linux 2.6.32-220.2.1.el6.x86_64 (www.cyberciti.biz) Tuesday 13 March 2012 _x86_64_ (2 CPU)
|
||||
12:00:01 CDT IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
|
||||
12:10:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
12:10:01 CDT eth0 127.13 121.32 95.45 18.34 0.00 0.00 0.00
|
||||
12:10:01 CDT eth1 98.48 110.62 16.72 96.33 0.00 0.00 0.00
|
||||
12:20:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
12:20:01 CDT eth0 139.95 133.41 106.30 19.95 0.00 0.00 0.00
|
||||
12:20:01 CDT eth1 110.65 121.85 18.14 107.13 0.00 0.00 0.00
|
||||
12:30:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
12:30:01 CDT eth0 147.85 132.49 115.78 20.45 0.00 0.00 0.00
|
||||
12:30:01 CDT eth1 111.88 127.39 18.61 117.65 0.00 0.00 0.00
|
||||
12:40:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
12:40:01 CDT eth0 136.75 124.64 105.24 19.48 0.00 0.00 0.00
|
||||
12:40:01 CDT eth1 101.65 115.32 17.58 104.50 0.00 0.00 0.00
|
||||
12:50:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
12:50:01 CDT eth0 131.45 125.69 96.49 19.58 0.00 0.00 0.00
|
||||
12:50:01 CDT eth1 101.41 111.31 17.54 96.78 0.00 0.00 0.00
|
||||
01:00:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:00:01 CDT eth0 140.30 133.27 102.17 20.75 0.00 0.00 0.00
|
||||
01:00:01 CDT eth1 106.90 119.51 18.53 103.09 0.00 0.00 0.00
|
||||
01:10:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:10:01 CDT eth0 152.03 127.74 125.56 19.85 0.00 0.00 0.00
|
||||
01:10:01 CDT eth1 115.60 134.57 18.73 126.96 0.00 0.00 0.00
|
||||
01:20:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:20:01 CDT eth0 138.55 130.55 103.03 20.20 0.00 0.00 0.00
|
||||
....
|
||||
..
|
||||
....
|
||||
..
|
||||
.
|
||||
01:00:01 CDT eth1 156.82 169.48 28.83 138.49 0.00 0.00 0.00
|
||||
01:10:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:10:01 CDT eth0 215.19 194.82 163.11 30.99 0.00 0.00 0.00
|
||||
01:10:01 CDT eth1 162.49 183.79 28.36 163.70 0.00 0.00 0.00
|
||||
01:20:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:20:01 CDT eth0 200.20 192.23 140.64 30.93 0.00 0.00 0.00
|
||||
01:20:01 CDT eth1 153.60 166.96 27.32 140.26 0.00 0.00 0.00
|
||||
01:30:01 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:30:01 CDT eth0 111.98 103.58 79.12 16.52 0.00 0.00 0.48
|
||||
01:30:01 CDT eth1 87.50 95.58 14.74 79.35 0.00 0.00 0.00
|
||||
Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
|
||||
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
Average: eth0 211.21 196.20 156.18 31.20 0.00 0.00 0.01
|
||||
Average: eth1 159.10 174.52 28.00 149.95 0.00 0.00 0.00
|
||||
|
||||
或者输入以下命令:
|
||||
|
||||
# sar -n DEV 1 3
|
||||
|
||||
输出样例:
|
||||
|
||||
Linux 2.6.32-220.2.1.el6.x86_64 (www.cyberciti.biz) Tuesday 13 March 2012 _x86_64_ (2 CPU)
|
||||
01:44:03 CDT IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
|
||||
01:44:04 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:44:04 CDT eth0 161.70 154.26 105.20 26.63 0.00 0.00 0.00
|
||||
01:44:04 CDT eth1 145.74 142.55 25.11 144.94 0.00 0.00 0.00
|
||||
01:44:04 CDT IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
|
||||
01:44:05 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:44:05 CDT eth0 162.14 156.31 107.46 42.18 0.00 0.00 0.00
|
||||
01:44:05 CDT eth1 135.92 138.83 39.38 104.92 0.00 0.00 0.00
|
||||
01:44:05 CDT IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
|
||||
01:44:06 CDT lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
01:44:06 CDT eth0 303.92 293.14 272.91 37.40 0.00 0.00 0.00
|
||||
01:44:06 CDT eth1 252.94 290.20 34.87 263.50 0.00 0.00 0.00
|
||||
Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
|
||||
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
Average: eth0 210.37 202.34 163.19 35.66 0.00 0.00 0.00
|
||||
Average: eth1 178.93 191.64 33.36 171.60 0.00 0.00 0.00
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.cyberciti.biz/faq/network-statistics-tools-rhel-centos-debian-linux/
|
||||
|
||||
作者:[nixCraft][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.cyberciti.biz/tips/about-us
|
||||
[1]:http://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html
|
||||
[2]:http://www.cyberciti.biz/tips/netstat-command-tutorial-examples.html
|
||||
[3]:http://www.cyberciti.biz/tips/identifying-linux-bottlenecks-sar-graphs-with-ksar.html
|
@ -0,0 +1,359 @@
|
||||
如何在 CentOS Linux 中配置 MariADB 复制
|
||||
================================================================================
|
||||
这是一个创建数据库重复版本的过程。复制过程不仅仅是复制一个数据库,同时也包括从主节点到一个从节点的更改同步。但这并不意味着从数据库就是和主数据库完全相同的副本,因为复制可以配置为只有表或者行或者列的一个模式将被复制,例如,局部复制。复制保证了特定的配置对象在不同的数据库之间保持同步。
|
||||
|
||||
### Mariadb 复制概念 ###
|
||||
|
||||
**备份** :复制可以用来进行数据库备份。例如,你有主->从复制。如果主节点丢失(比如hdd损坏),你可以从从节点中恢复你的数据库。
|
||||
|
||||
**扩展** :你可以使用主->从复制作为扩展的解决方案。例如,如果你有一些大的数据库以及SQL查询,使用复制你可以将这些查询单独分到每个复制节点。写SQL应该只在主节点进行,而只读查询可以在从节点上进行。
|
||||
|
||||
**传播解决方案** :你可以用复制来进行分发。例如,你可以将不同的销售数据分发到不同的数据库。
|
||||
|
||||
**故障解决方案** : 假如你有主节点->从节点1->从节点2->从节点3的复制。你可以为主节点写脚本监控,如果主节点出故障了,脚本可以快速的将从节点1作为新的主节点,有主节点->从节点1->从节点2,你的应用可以继续工作而不会停机。
|
||||
|
||||
### 复制的简单图解示范 ###
|
||||
|
||||
![mysql 复制原理](http://blog.linoxide.com/wp-content/uploads/2015/04/mysql-replication-principle.png)
|
||||
|
||||
开始之前,你应该知道什么是**二进制日志文件**以及 Ibdata1。二进制日志文件中包括关于数据库,数据和结构的所有更改的记录,以及每条语句的执行时间。二进制日志文件包括设置日志文件和一个索引。这意味着主要的SQL语句,例如CREATE, ALTER, INSERT, UPDATE 和 DELETE 会放到这个日志文件中,而例如SELECT语句就不会被记录。这些信息可以被记录到普通的query.log文件。简单的说 **Ibdata1** 是一个包括所有表和所有数据库信息的文件。
|
||||
|
||||
### 主服务器配置 ###
|
||||
|
||||
首先升级服务器
|
||||
|
||||
sudo yum install update -y && sudo yum install upgrade -y
|
||||
|
||||
我们工作在centos7 服务器上
|
||||
|
||||
sudo cat /etc/redhat-release
|
||||
|
||||
CentOS Linux release 7.0.1406 (Core)
|
||||
|
||||
安装 MariaDB
|
||||
|
||||
sudo yum install mariadb-server -y
|
||||
|
||||
启动 MariaDB 并启用随服务器启动
|
||||
|
||||
sudo systemctl start mariadb.service
|
||||
sudo systemctl enable mariadb.service
|
||||
|
||||
输出:
|
||||
|
||||
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
|
||||
|
||||
检查 MariaDB 状态
|
||||
|
||||
sudo service mariadb status
|
||||
|
||||
或者使用
|
||||
|
||||
sudo systemctl is-active mariadb.service
|
||||
|
||||
输出:
|
||||
|
||||
Redirecting to /bin/systemctl status mariadb.service
|
||||
mariadb.service - MariaDB database server
|
||||
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)
|
||||
|
||||
设置 MariaDB 密码
|
||||
|
||||
mysql -u root
|
||||
mysql> use mysql;
|
||||
mysql> update user set password=PASSWORD("SOME_ROOT_PASSWORD") where User='root';
|
||||
mysql> flush privileges;
|
||||
mysql> exit
|
||||
|
||||
SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后尝试登陆:
|
||||
|
||||
sudo mysql -u root -pSOME_ROOT_PASSWORD
|
||||
|
||||
输出:
|
||||
|
||||
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
||||
Your MariaDB connection id is 5
|
||||
Server version: 5.5.41-MariaDB MariaDB Server
|
||||
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
|
||||
|
||||
输入 'help;' 或 '\h' 查看帮助信息。 输入 '\c' 清空当前输入语句。
|
||||
|
||||
让我们创建包括一些数据的表的数据库
|
||||
|
||||
创建数据库/模式
|
||||
|
||||
sudo mysql -u root -pSOME_ROOT_PASSWORD
|
||||
mysql> create database test_repl;
|
||||
|
||||
其中:
|
||||
|
||||
test_repl - 将要被复制的模式的名字
|
||||
|
||||
输出:
|
||||
|
||||
Query OK, 1 row affected (0.00 sec)
|
||||
|
||||
创建 Persons 表
|
||||
|
||||
mysql> use test_repl;
|
||||
|
||||
CREATE TABLE Persons (
|
||||
PersonID int,
|
||||
LastName varchar(255),
|
||||
FirstName varchar(255),
|
||||
Address varchar(255),
|
||||
City varchar(255)
|
||||
);
|
||||
|
||||
输出:
|
||||
|
||||
mysql> MariaDB [test_repl]> CREATE TABLE Persons (
|
||||
-> PersonID int,
|
||||
-> LastName varchar(255),
|
||||
-> FirstName varchar(255),
|
||||
-> Address varchar(255),
|
||||
-> City varchar(255)
|
||||
-> );
|
||||
Query OK, 0 rows affected (0.01 sec)
|
||||
|
||||
插入一些数据
|
||||
|
||||
mysql> INSERT INTO Persons VALUES (1, "LastName1", "FirstName1", "Address1", "City1");
|
||||
mysql> INSERT INTO Persons VALUES (2, "LastName2", "FirstName2", "Address2", "City2");
|
||||
mysql> INSERT INTO Persons VALUES (3, "LastName3", "FirstName3", "Address3", "City3");
|
||||
mysql> INSERT INTO Persons VALUES (4, "LastName4", "FirstName4", "Address4", "City4");
|
||||
mysql> INSERT INTO Persons VALUES (5, "LastName5", "FirstName5", "Address5", "City5");
|
||||
|
||||
输出:
|
||||
|
||||
Query OK, 5 row affected (0.00 sec)
|
||||
|
||||
检查数据
|
||||
|
||||
mysql> select * from Persons;
|
||||
|
||||
输出:
|
||||
|
||||
+----------+-----------+------------+----------+-------+
|
||||
| PersonID | LastName | FirstName | Address | City |
|
||||
+----------+-----------+------------+----------+-------+
|
||||
| 1 | LastName1 | FirstName1 | Address1 | City1 |
|
||||
| 1 | LastName1 | FirstName1 | Address1 | City1 |
|
||||
| 2 | LastName2 | FirstName2 | Address2 | City2 |
|
||||
| 3 | LastName3 | FirstName3 | Address3 | City3 |
|
||||
| 4 | LastName4 | FirstName4 | Address4 | City4 |
|
||||
| 5 | LastName5 | FirstName5 | Address5 | City5 |
|
||||
+----------+-----------+------------+----------+-------+
|
||||
|
||||
### 配置 MariaDB 重复 ###
|
||||
|
||||
你需要在主结点服务器上编辑 my.cnf文件来启用二进制日志以及设置服务器id。我会使用vi文本编辑器,但你可以使用任何你喜欢的,例如nano,joe。
|
||||
|
||||
sudo vi /etc/my.cnf
|
||||
|
||||
将下面的一些行写到[mysqld]部分。
|
||||
|
||||
|
||||
log-basename=master
|
||||
log-bin
|
||||
binlog-format=row
|
||||
server_id=1
|
||||
|
||||
输出:
|
||||
|
||||
![mariadb 配置主节点](http://blog.linoxide.com/wp-content/uploads/2015/04/mariadb-config.png)
|
||||
|
||||
然后重启 MariaDB:
|
||||
|
||||
sudo service mariadb restart
|
||||
|
||||
登录到 MariaDB 并查看二进制日志文件:
|
||||
|
||||
sudo mysql -u root -pq test_repl
|
||||
|
||||
mysql> SHOW MASTER STATUS;
|
||||
|
||||
输出:
|
||||
|
||||
+--------------------+----------+--------------+------------------+
|
||||
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
|
||||
+--------------------+----------+--------------+------------------+
|
||||
| mariadb-bin.000002 | 3913 | | |
|
||||
+--------------------+----------+--------------+------------------+
|
||||
|
||||
**记住** : "File" 和 "Position" 的值。在从节点中你需要使用这些值
|
||||
|
||||
创建用来重复的用户
|
||||
|
||||
mysql> GRANT REPLICATION SLAVE ON *.* TO replication_user IDENTIFIED BY 'bigs3cret' WITH GRANT OPTION;
|
||||
mysql> flush privileges;
|
||||
|
||||
输出:
|
||||
|
||||
Query OK, 0 rows affected (0.00 sec)
|
||||
Query OK, 0 rows affected (0.00 sec)
|
||||
|
||||
在数据库中检查用户
|
||||
|
||||
mysql> select * from mysql.user WHERE user="replication_user"\G;
|
||||
|
||||
输出:
|
||||
|
||||
mysql> select * from mysql.user WHERE user="replication_user"\G;
|
||||
*************************** 1. row ***************************
|
||||
Host: %
|
||||
User: replication_user
|
||||
Password: *2AF30E7AEE9BF3AF584FB19653881D2D072FA49C
|
||||
Select_priv: N
|
||||
.....
|
||||
|
||||
从主节点创建 DB dump (将要被复制的所有数据的快照)
|
||||
|
||||
mysqldump -uroot -pSOME_ROOT_PASSWORD test_repl > full-dump.sql
|
||||
|
||||
其中:
|
||||
|
||||
SOME_ROOT_PASSWORD - 你设置的root用户的密码
|
||||
test_repl - 将要复制的数据库的名称;
|
||||
|
||||
你需要在从节点中恢复 mysql dump (full-dump.sql)。重复需要这个。
|
||||
|
||||
### 从节点配置 ###
|
||||
|
||||
所有这些命令需要在从节点中进行
|
||||
|
||||
假设我们已经更新/升级了包括有最新的MariaDB服务器的 CentOS 7.x,而且你可以用root账号登陆到MariaDBs服务器(这在这篇文章的第一部分已经介绍过)
|
||||
|
||||
登陆到Maria 数据库控制台并创建数据库
|
||||
|
||||
mysql -u root -pSOME_ROOT_PASSWORD;
|
||||
mysql> create database test_repl;
|
||||
mysql> exit;
|
||||
|
||||
在从节点恢复主节点的数据
|
||||
|
||||
mysql -u root -pSOME_ROOT_PASSWORD test_repl < full-dump.sql
|
||||
|
||||
其中:
|
||||
|
||||
full-dump.sql - 你在测试服务器中创建的DB Dump。
|
||||
|
||||
登录到Maria 数据库并启用复制
|
||||
|
||||
mysql> CHANGE MASTER TO
|
||||
MASTER_HOST='82.196.5.39',
|
||||
MASTER_USER='replication_user',
|
||||
MASTER_PASSWORD='bigs3cret',
|
||||
MASTER_PORT=3306,
|
||||
MASTER_LOG_FILE='mariadb-bin.000002',
|
||||
MASTER_LOG_POS=3913,
|
||||
MASTER_CONNECT_RETRY=10;
|
||||
|
||||
![mariadb 启用复制](http://blog.linoxide.com/wp-content/uploads/2015/04/setup-replication.png)
|
||||
|
||||
其中:
|
||||
|
||||
MASTER_HOST - 主节点服务器的IP
|
||||
MASTER_USER - 主节点服务器中的复制用户
|
||||
MASTER_PASSWORD - 复制用户密码
|
||||
MASTER_PORT - 主节点中的mysql端口
|
||||
MASTER_LOG_FILE - 主节点中的二进制日志文件名称
|
||||
MASTER_LOG_POS - 主节点中的二进制日志文件位置
|
||||
|
||||
开启从节点模式
|
||||
|
||||
mysql> slave start;
|
||||
|
||||
输出:
|
||||
|
||||
Query OK, 0 rows affected (0.00 sec)
|
||||
|
||||
检查从节点状态
|
||||
|
||||
mysql> show slave status\G;
|
||||
|
||||
输出:
|
||||
|
||||
*************************** 1. row ***************************
|
||||
Slave_IO_State: Waiting for master to send event
|
||||
Master_Host: 82.196.5.39
|
||||
Master_User: replication_user
|
||||
Master_Port: 3306
|
||||
Connect_Retry: 10
|
||||
Master_Log_File: mariadb-bin.000002
|
||||
Read_Master_Log_Pos: 4175
|
||||
Relay_Log_File: mariadb-relay-bin.000002
|
||||
Relay_Log_Pos: 793
|
||||
Relay_Master_Log_File: mariadb-bin.000002
|
||||
Slave_IO_Running: Yes
|
||||
Slave_SQL_Running: Yes
|
||||
Replicate_Do_DB:
|
||||
Replicate_Ignore_DB:
|
||||
Replicate_Do_Table:
|
||||
Replicate_Ignore_Table:
|
||||
Replicate_Wild_Do_Table:
|
||||
Replicate_Wild_Ignore_Table:
|
||||
Last_Errno: 0
|
||||
Last_Error:
|
||||
Skip_Counter: 0
|
||||
Exec_Master_Log_Pos: 4175
|
||||
Relay_Log_Space: 1089
|
||||
Until_Condition: None
|
||||
Until_Log_File:
|
||||
Until_Log_Pos: 0
|
||||
Master_SSL_Allowed: No
|
||||
Master_SSL_CA_File:
|
||||
Master_SSL_CA_Path:
|
||||
Master_SSL_Cert:
|
||||
Master_SSL_Cipher:
|
||||
Master_SSL_Key:
|
||||
Seconds_Behind_Master: 0
|
||||
Master_SSL_Verify_Server_Cert: No
|
||||
Last_IO_Errno: 0
|
||||
Last_IO_Error:
|
||||
Last_SQL_Errno: 0
|
||||
Last_SQL_Error:
|
||||
Replicate_Ignore_Server_Ids:
|
||||
Master_Server_Id: 1
|
||||
1 row in set (0.00 sec)
|
||||
|
||||
到这里所有步骤都应该没问题,也不应该出现错误。
|
||||
|
||||
### 测试复制 ###
|
||||
|
||||
在主节点服务器中添加一些条目到数据库
|
||||
|
||||
mysql -u root -pSOME_ROOT_PASSWORD test_repl
|
||||
|
||||
mysql> INSERT INTO Persons VALUES (6, "LastName6", "FirstName6", "Address6", "City6");
|
||||
mysql> INSERT INTO Persons VALUES (7, "LastName7", "FirstName7", "Address7", "City7");
|
||||
mysql> INSERT INTO Persons VALUES (8, "LastName8", "FirstName8", "Address8", "City8");
|
||||
|
||||
到从节点服务器中查看复制数据
|
||||
|
||||
mysql -u root -pSOME_ROOT_PASSWORD test_repl
|
||||
|
||||
mysql> select * from Persons;
|
||||
|
||||
+----------+-----------+------------+----------+-------+
|
||||
| PersonID | LastName | FirstName | Address | City |
|
||||
+----------+-----------+------------+----------+-------+
|
||||
...................
|
||||
| 6 | LastName6 | FirstName6 | Address6 | City6 |
|
||||
| 7 | LastName7 | FirstName7 | Address7 | City7 |
|
||||
| 8 | LastName8 | FirstName8 | Address8 | City8 |
|
||||
+----------+-----------+------------+----------+-------+
|
||||
|
||||
你可以看到数据已经被复制到从节点。这意味着复制能正常工作。希望你能喜欢这篇文章。如果你有任何问题请告诉我们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/how-tos/configure-mariadb-replication-centos-linux/
|
||||
|
||||
作者:[Bobbin Zachariah][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bobbin/
|
@ -0,0 +1,93 @@
|
||||
sshuttle - 一个使用ssh的基于VPN的透明代理
|
||||
================================================================================
|
||||
sshuttle允许你通过ssh创建一条从你电脑连接到任何远程服务器的VPN连接,只要你的服务器支持python2.3 或则更高的版本, 你必须有本机的root权限,但是你可以在服务端有普通账户即可。
|
||||
|
||||
你可以在一台机器上同时运行多次sshuttle来连接到不同的服务器上,这样你就可以一次使用多个VPN, sshuttle可以转发你子网所有流量到VPN中。
|
||||
|
||||
|
||||
### 在Ubuntu中安装sshuttle ###
|
||||
|
||||
在终端中输入下面的命令
|
||||
|
||||
sudo apt-get install sshuttle
|
||||
|
||||
### 使用 sshuttle ###
|
||||
|
||||
#### sshuttle 语法 ####
|
||||
|
||||
sshuttle [options...] [-r [username@]sshserver[:port]] [subnets]
|
||||
|
||||
#### Option 细节 ####
|
||||
|
||||
-r, —remote=[username@]sshserver[:port]
|
||||
|
||||
远程主机名和可选的用户名,用于连接远程服务器的ssh端口号。比如example.com、testuser@example.com、testuser@example.com:2222或者example.com:2244。
|
||||
|
||||
#### sshuttle 例子 ####
|
||||
|
||||
在机器中使用下面的命令:
|
||||
|
||||
sudo sshuttle -r username@sshserver 0.0.0.0/0 -vv
|
||||
|
||||
当开始后,sshuttle会创建一个ssh会话到通过-r指定的服务器。如果-r被忽略了,它会在本地运行客户端和服务端,这个有时会在测试时有用。
|
||||
|
||||
连接到远程服务器后,sshuttle会上传它的(python)源码到远程服务器并执行。那么,你就不需要在远程服务器上安装sshuttle,并且客户端和服务器端间不会存在sshuttle版本冲突。
|
||||
|
||||
#### 手册中的更多例子 ####
|
||||
|
||||
代理所有的本地连接用于本地测试,没有使用ssh:
|
||||
|
||||
$ sudo sshuttle -v 0/0
|
||||
|
||||
Starting sshuttle proxy.
|
||||
Listening on (‘0.0.0.0′, 12300).
|
||||
[local sudo] Password:
|
||||
firewall manager ready.
|
||||
c : connecting to server...
|
||||
s: available routes:
|
||||
s: 192.168.42.0/24
|
||||
c : connected.
|
||||
firewall manager: starting transproxy.
|
||||
c : Accept: ‘192.168.42.106':50035 -> ‘192.168.42.121':139.
|
||||
c : Accept: ‘192.168.42.121':47523 -> ‘77.141.99.22':443.
|
||||
...etc...
|
||||
^C
|
||||
firewall manager: undoing changes.
|
||||
KeyboardInterrupt
|
||||
c : Keyboard interrupt: exiting.
|
||||
c : SW#8:192.168.42.121:47523: deleting
|
||||
c : SW#6:192.168.42.106:50035: deleting
|
||||
|
||||
测试到远程服务器上的连接,自动猜测主机名和子网:
|
||||
|
||||
$ sudo sshuttle -vNHr example.org
|
||||
|
||||
Starting sshuttle proxy.
|
||||
Listening on (‘0.0.0.0′, 12300).
|
||||
firewall manager ready.
|
||||
c : connecting to server...
|
||||
s: available routes:
|
||||
s: 77.141.99.0/24
|
||||
c : connected.
|
||||
c : seed_hosts: []
|
||||
firewall manager: starting transproxy.
|
||||
hostwatch: Found: testbox1: 1.2.3.4
|
||||
hostwatch: Found: mytest2: 5.6.7.8
|
||||
hostwatch: Found: domaincontroller: 99.1.2.3
|
||||
c : Accept: ‘192.168.42.121':60554 -> ‘77.141.99.22':22.
|
||||
^C
|
||||
firewall manager: undoing changes.
|
||||
c : Keyboard interrupt: exiting.
|
||||
c : SW#6:192.168.42.121:60554: deleting
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/sshuttle-a-transparent-proxy-based-vpn-using-ssh.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
@ -0,0 +1,133 @@
|
||||
|
||||
Linux 'sort'命令的七个有趣实例-第二部分
|
||||
================================================================================
|
||||
在上一篇文章里,我们已经探讨了关于sort命令的多个例子,如果你错过了这篇文章,可以点击下面的链接进行阅读。今天的这篇文章作为上一篇文章的继续,将讨论关于sort命令的剩余用法,与上一篇一起作为Linux ‘sort’命令的完整指南。
|
||||
|
||||
注:前两天做过这个原文
|
||||
- [14 ‘sort’ Command Examples in Linux][1]
|
||||
-
|
||||
在我们继续深入之前,先创建一个文本文档‘month.txt’,并且将上一次给出的数据填进去。
|
||||
|
||||
$ echo -e "mar\ndec\noct\nsep\nfeb\naug" > month.txt
|
||||
$ cat month.txt
|
||||
|
||||
![Populate Content](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Content.gif)
|
||||
|
||||
### 15. 通过使用’M‘选项,对’month.txt‘文件按照月份顺序进行排序。###
|
||||
|
||||
$ sort -M month.txt
|
||||
|
||||
**注意**:‘sort’命令需要至少3个字符来确认月份名称。
|
||||
|
||||
![Sort File Content by Month in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-by-Month.gif)
|
||||
|
||||
### 16. 把数据整理成方便人们阅读的形式,比如1K、2M、3G、2T,这里面的K、G、M、T代表千、兆、吉、梯。
|
||||
(译者注:好像这个选项并不是所有Linu版本都有,而且也没有实现按KMGT显示。)
|
||||
|
||||
$ ls -l /home/$USER | sort -h -k5
|
||||
|
||||
![Sort Content Human Readable Format](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-Human-Readable-Format.gif)
|
||||
|
||||
### 17. 在上一篇文章中,我们在例子4中创建了一个名为‘sorted.txt’的文件,在例子6中创建了一个‘lsl.txt’。‘sorted.txt'已经排好序了而’lsl.txt‘还没有。让我们使用sort命令来检查两个文件是否已经排好序。###
|
||||
|
||||
$ sort -c sorted.txt
|
||||
|
||||
![Check File is Sorted](http://www.tecmint.com/wp-content/uploads/2015/04/Check-File-is-Sorted.gif)
|
||||
|
||||
如果它返回0,则表示文件已经排好序。
|
||||
|
||||
$ sort -c lsl.txt
|
||||
|
||||
![Check File Sorted Status](http://www.tecmint.com/wp-content/uploads/2015/04/Check-File-Sorted-Status.gif)
|
||||
|
||||
Reports Disorder. Conflict..
|
||||
报告无序。存在矛盾……
|
||||
|
||||
### 18. 如果文字之间的分隔符是空格,sort命令自动地将横向空格后的东西当做一个新文字单元,如果分隔符不是空格呢?###
|
||||
|
||||
考虑这样一个文本文件,里面的内容可以由除了空格之外的任何符号分隔,比如‘|’,‘\’,‘+’,‘.’等……
|
||||
|
||||
创建一个分隔符为+的文本文件。使用‘cat‘命令查看文件内容。
|
||||
$ echo -e "21+linux+server+production\n11+debian+RedHat+CentOS\n131+Apache+Mysql+PHP\n7+Shell Scripting+python+perl\n111+postfix+exim+sendmail" > delimiter.txt
|
||||
|
||||
----------
|
||||
|
||||
$ cat delimiter.txt
|
||||
|
||||
![Check File Content by Delimiter](http://www.tecmint.com/wp-content/uploads/2015/04/Check-File-Content.gif)
|
||||
|
||||
现在基于由数字组成的第一个域来进行排序。
|
||||
|
||||
$ sort -t '+' -nk1 delimiter.txt
|
||||
|
||||
![Sort File By Fields](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-File-By-Fields.gif)
|
||||
|
||||
然后再基于非数字的第四个域排序。
|
||||
|
||||
![Sort Content By Non Numeric](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Non-Numeric.gif)
|
||||
|
||||
如果分隔符是Tab,你需要在’+‘的位置上用$’\t’代替,如上例所示。
|
||||
|
||||
### 19. 对主用户目录下使用‘ls -l’命令得到的结果基于第五列——‘数据的大小’进行一个乱序排列。
|
||||
|
||||
$ ls -l /home/avi/ | sort -k5 -R
|
||||
|
||||
![Sort Content by Column in Random Order](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-by-Column1.gif)
|
||||
|
||||
每一次你运行上面的脚本,你得到结果可能都不一样,因为结果是随机生成的。
|
||||
|
||||
正如我在上一篇文章中提到的规则2所说——相比于大写字母,sort命令更喜欢以小写字母开始的行。看一下上一篇文章的例3,字符串‘laptop’在‘LAPTOP’前出现。
|
||||
|
||||
### 20. 如何覆盖默认的排序优先权?在这之前我们需要先将环境变量LC_ALL的值设置为C。在命令行提示栏中运行下面的代码。###
|
||||
|
||||
$ export LC_ALL=C
|
||||
|
||||
然后以重写默认优先权的方式对‘tecmint.txt’文件重新排序。
|
||||
|
||||
$ sort tecmint.txt
|
||||
|
||||
![Override Sorting Preferences](http://www.tecmint.com/wp-content/uploads/2015/04/Override-Sorting-Preferences.gif)
|
||||
重写排序优先权
|
||||
|
||||
不要忘记与example 3中得到的输出结果做比较,并且你可以使用‘-f’选项,又叫‘-ignore-case’来获取非常有序的输出。
|
||||
|
||||
$ sort -f tecmint.txt
|
||||
|
||||
![Compare Sorting Preferences](http://www.tecmint.com/wp-content/uploads/2015/04/Compare-Sorting-Preferences.gif)
|
||||
|
||||
### 21. 给两个输入文件进行‘sort‘,然后一口气把它们连接起来怎么样?###
|
||||
|
||||
我们创建两个文本文档’file1.txt‘以及’file2.txt‘,并用数据填充,如下所示,并用’cat‘命令查看文件的内容。
|
||||
$ echo -e “5 Reliable\n2 Fast\n3 Secure\n1 open-source\n4 customizable” > file1.txt
|
||||
$ cat file1.txt
|
||||
|
||||
![Populate Content with Numbers](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Content-with-Number.gif)
|
||||
|
||||
用如下数据填充’file2.txt‘。
|
||||
|
||||
$ echo -e “3 RedHat\n1 Debian\n5 Ubuntu\n2 Kali\n4 Fedora” > file2.txt
|
||||
$ cat file2.txt
|
||||
|
||||
![Populate File with Data](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-File-with-Data.gif)
|
||||
|
||||
现在我们对两个文件进行排序并连接。
|
||||
|
||||
$ join <(sort -n file1.txt) <(sort file2.txt)
|
||||
|
||||
![Sort Join Two Files](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Join-Two-Files.gif)
|
||||
|
||||
|
||||
我所要讲的全部内容就在这里了,希望与各位保持联系,也希望各位经常来Tecmint逛逛。有反馈就在下面评论吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/linux-sort-command-examples/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[DongShuaike](https://github.com/DongShuaike)
|
||||
校对:[校对者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/sort-command-linux/
|
@ -0,0 +1,200 @@
|
||||
在Linux中用chattr和lsattr命令管理文件和目录属性
|
||||
================================================================================
|
||||
为了允许添加数据,防止更改或者删除等,文件和文件夹中设定了一定的控制属性。例如,你可以在关键系统文件或者文件夹中启用属性,然后没有用户,包括root,可以删除或者修改它,不允许比如dump命令等备份工具去备份一个特定的文件或者文件夹,等等。这些属性只可以在ext2,ext3或者ext4文件系统中的文件和文件夹上设定。
|
||||
|
||||
有两个命令 **lsattr** 和 **chattr** 用来管理属性。下面是常用属性的列表。
|
||||
|
||||
注:表格代码
|
||||
<table width="482" cellspacing="0" cellpadding="4" style="height: 651px">
|
||||
<colgroup>
|
||||
<col width="112">
|
||||
<col width="514"> </colgroup>
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western"><b>属性</b></p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western"><b>描述</b></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">a (append)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">允许在文件中进行追加操作</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">A</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">这个属性不允许更新文件的访问时间</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">c (compressed)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">启用这个属性时,文件在磁盘上会自动压缩</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">d (dump)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">不能使用dump命令备份文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">D</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">设置了文件夹的D属性时,更改会在同步保存在磁盘上</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">e (extent format)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">它表明,该文件使用扩展到映射磁盘上的块</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">i (immutable)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">在文件上启用这个属性时,我们不能更改,重命名或者删除这个文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">j (journaling)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">设置了这个属性时,文件的数据首先保存在日志中,然后再写入文件</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td width="112">
|
||||
<p align="justify" class="western">S (synchronous)</p>
|
||||
</td>
|
||||
<td width="514">
|
||||
<p align="justify" class="western">设置了这个属性时,变更或更改同步保存到磁盘上</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
chattr属性中可以使用的不同选项 :
|
||||
|
||||
- **-R** 递归地修改文件夹和子文件夹的属性
|
||||
- **-V** chattr命令的输出伴随版本信息
|
||||
- **-f** 压缩大部分错误信息
|
||||
|
||||
在chattr中用于设置或者取消属性的 **操作符**
|
||||
|
||||
- ‘+’ 符号用来为文件和文件夹设置属性,
|
||||
- ‘-‘ 符号用来移除或者取消属性
|
||||
- ‘=’ 使它们成为文件有的唯一属性。
|
||||
|
||||
**chattr** 和 **lsattr** 命令的基本语法 :
|
||||
|
||||
# chattr <options> <attributes> <file or Directory >
|
||||
|
||||
# lsattr <File or Directory>
|
||||
|
||||
### 例:1 使用‘i’属性使文件不可更改 ###
|
||||
|
||||
[root@linuxtechi ~]# chattr +i dummy_data
|
||||
[root@linuxtechi ~]# lsattr dummy_data
|
||||
----i----------- dummy_data
|
||||
|
||||
现在试着删除或者修改文件
|
||||
|
||||
[root@linuxtechi ~]# rm -f dummy_data
|
||||
rm: cannot remove ‘dummy_data’: Operation not permitted
|
||||
|
||||
[root@linuxtechi ~]# echo "test" >> dummy_data
|
||||
-bash: dummy_data: Permission denied
|
||||
|
||||
### 例:2 移除不可更改属性 ###
|
||||
|
||||
[root@linuxtechi ~]# chattr -i dummy_data
|
||||
[root@linuxtechi ~]# lsattr dummy_data
|
||||
---------------- dummy_data
|
||||
|
||||
### 例:3 在文件中只允许追加操作 ###
|
||||
|
||||
[root@linuxtechi ~]# chattr +a dummy_data
|
||||
[root@linuxtechi ~]# lsattr dummy_data
|
||||
-----a---------- dummy_data
|
||||
|
||||
现在试着把fstab文件的内容追加到dummy_data文件
|
||||
|
||||
[root@linuxtechi ~]# cat /etc/fstab >> dummy_data
|
||||
[root@linuxtechi ~]#
|
||||
|
||||
### 例 :4 使用 -R 选项和 ‘+i’ 属性使文件夹和它的子文件夹成为安全目录 ###
|
||||
|
||||
让我们来新建一个sysadmin文件夹和它的子文件夹
|
||||
|
||||
[root@linuxtechi ~]# mkdir sysadmin
|
||||
[root@linuxtechi ~]# mkdir sysadmin/admim_{1,2,3,4,5}
|
||||
[root@linuxtechi ~]# ls -l sysadmin/
|
||||
total 0
|
||||
drwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_1
|
||||
drwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_2
|
||||
drwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_3
|
||||
drwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_4
|
||||
drwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_5
|
||||
|
||||
在sysadmin文件夹递归设置不可更改属性
|
||||
|
||||
[root@linuxtechi ~]# chattr -R +i sysadmin
|
||||
|
||||
[root@linuxtechi ~]# lsattr -R sysadmin/
|
||||
----i----------- sysadmin/admim_1
|
||||
sysadmin/admim_1:
|
||||
----i----------- sysadmin/admim_2
|
||||
sysadmin/admim_2:
|
||||
----i----------- sysadmin/admim_3
|
||||
sysadmin/admim_3:
|
||||
----i----------- sysadmin/admim_4
|
||||
sysadmin/admim_4:
|
||||
----i----------- sysadmin/admim_5
|
||||
sysadmin/admim_5:
|
||||
[root@linuxtechi ~]#
|
||||
|
||||
现在试着用rm命令删除文件夹
|
||||
|
||||
[root@linuxtechi ~]# rm -rf sysadmin
|
||||
rm: cannot remove ‘sysadmin/admim_1’: Permission denied
|
||||
rm: cannot remove ‘sysadmin/admim_2’: Permission denied
|
||||
rm: cannot remove ‘sysadmin/admim_3’: Permission denied
|
||||
rm: cannot remove ‘sysadmin/admim_4’: Permission denied
|
||||
rm: cannot remove ‘sysadmin/admim_5’: Permission denied
|
||||
[root@linuxtechi ~]#
|
||||
|
||||
使用以下命令递归取消属性
|
||||
|
||||
[root@linuxtechi ~]# chattr -R -i sysadmin
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxtechi.com/file-directory-attributes-in-linux-using-chattr-lsattr-command/
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxtechi.com/author/pradeep/
|
@ -0,0 +1,75 @@
|
||||
Linux 上IP转发如何帮助专用接口连接到互联网
|
||||
================================================================================
|
||||
大家好,今天我们学习一下在 Linux 上用 iptables 实现从一个网络接口到另一个接口的IP转发或者数据包转发。IP转发的概念是,使 Linux 机器像路由器一样将数据从一个网络发送到另一个网络。所以,它能作为一个**路由器**或者代理服务器,实现从一个连接到多个客户端机器的共享互联网或者网络连接。
|
||||
|
||||
这是一些启用IP转发或网络包转发方法的简单步骤。
|
||||
|
||||
### 1. 启用 IPv4 转发 ###
|
||||
|
||||
首先,我们打算在我们的 Linux 操作系统上启用 IPv4 转发。要做到这点,我们需要用 sudo 模式在 shell 或终端下执行下面的命令。
|
||||
|
||||
$ sudo -s
|
||||
|
||||
# echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
|
||||
![临时IP转发](http://blog.linoxide.com/wp-content/uploads/2015/03/ip-forward-temporary.png)
|
||||
|
||||
**注意:上面的命令能马上启用ip转发,但只是临时的,直到下一次重启。要永久启用,我们需要使用我们喜欢的文本编辑器打开 /etc/sysctl.conf 文件。**
|
||||
|
||||
# nano /etc/sysctl.conf
|
||||
|
||||
然后,增加 **net.ipv4.ip_forward = 1** 到文件中,或者删除那行的注释,保存并退出文件。
|
||||
|
||||
net.ipv4.ip_forward = 1
|
||||
|
||||
![编辑 Sysctl](http://blog.linoxide.com/wp-content/uploads/2015/03/sysctl-edit.png)
|
||||
|
||||
运行下面的命令启用更改。
|
||||
|
||||
# sysctl -p /etc/sysctl.conf
|
||||
|
||||
![启用 Sysctl 更改](http://blog.linoxide.com/wp-content/uploads/2015/03/enabling-changes-sysctl.png)
|
||||
|
||||
### 2. 配置 Iptables 防火墙 ###
|
||||
|
||||
我们需要允许特定的(或者所有的)数据包通过我们的路由器。在这之前,我们要知道连接我们 Linux 的网络设备的接口名称。我们可以通过在终端或者 shell 运行以下命令获得接口名称。
|
||||
|
||||
# ifconfig -a
|
||||
|
||||
![Ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/03/ifconfig.png)
|
||||
|
||||
这里,在我们的机器中, eth2 是连接到互联网或者网络的网卡接口, wlan2 是我们要使用 iptables 从 eth2 转发数据包的接口。要做到这点,我们需要运行以下命令。
|
||||
|
||||
# iptables -A FORWARD -i wlan2 -o eth2 -j ACCEPT
|
||||
|
||||
注意:请用你 Linux 机器中的可用设备名称替换 wlan2 和 eth2。
|
||||
|
||||
现在,由于网络过滤器是一个无状态的防火墙,我们要用 iptables 允许已建立的连接通过。要做到这点,我们要运行下面的命令。
|
||||
|
||||
# iptables -A FORWARD -i eth2 -o wlan2 -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
|
||||
![用 iptables 转发](http://blog.linoxide.com/wp-content/uploads/2015/03/forwarding-iptables.png)
|
||||
|
||||
### 3. 配置 NAT ###
|
||||
|
||||
然后,最后我们需要通过执行下面的命令修改发送到互联网的数据包的源地址为 eth2。
|
||||
|
||||
# iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
|
||||
|
||||
![配置 nat](http://blog.linoxide.com/wp-content/uploads/2015/03/configuring-nat.png)
|
||||
|
||||
### 总结 ###
|
||||
|
||||
最后,用安装的 iptables 作为防火墙解决方案,我们在我们的 Linux 机器上成功的配置了从一个接口到另一个接口的数据包转发。这篇文章允许你的专用接口连接到互联网,你不需要桥接接口,而是路由从一个接口进来的数据包到另一个接口,就是这些。如果你有任何问题、建议、反馈,请写到下面的评论框中,然后我们可以改进或更新我们的内容。非常感谢!享受吧 :-)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/firewall/ip-forwarding-connecting-private-interface-internet/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
@ -0,0 +1,77 @@
|
||||
如何在 Ubuntu 中更改默认浏览器和 Email 客户端
|
||||
================================================================================
|
||||
Ubuntu 自带了一些已经预装的默认应用程序,包括非常流行的 Mozilla 火狐浏览器和 Thunderbird 的 e-mail 客户端。
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/web-browser.png)
|
||||
|
||||
尽管这两个应用都有它们自己的粉丝,但是没有一个应用能符合每个人的口味和需要。我们经常收到邮件或者推文,询问我们怎样可以在 Ubuntu 上更改默认浏览器或者设置处理邮件链接的不同的电子邮件客户端等。
|
||||
|
||||
我们在这里不仅讨论如何安装不同的软件,还包括如何给一个特定的文件,链接或者内容类型设置系统处理应用。
|
||||
|
||||
在 Ubuntu 中更改默认应用程序,包括浏览器、电子邮件客户端、文本编辑器、音乐和视频播放器都非常的简单。但并不是每个人都知道更改这些的设置面板在哪里,让我们来快速看一下吧。
|
||||
|
||||
### 如何在 Ubuntu 上更改默认浏览器 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg)
|
||||
|
||||
Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口,但它并不是每个人的选择。这都没关系。
|
||||
|
||||
在 Ubuntu 上使用不同的默认浏览器,首先,显而易见,你需要安装一个新的浏览器。你该怎么做取决于你想要的浏览器:
|
||||
|
||||
- 开源浏览器,例如 [Epiphany][1], [Chromium][2] 和 [IceWeasel][3],可以从 Ubuntu 软件中心安装。
|
||||
|
||||
- 主流浏览器,例如 [Google Chrome][4], [Opera][5] 和 [Vivaldi][6] 必须从各自项目的官方网站上下载。
|
||||
|
||||
不管你选择哪个浏览器,不管你选择怎样安装,完成之后你就可以继续了。
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg)
|
||||
|
||||
点击其它应用上的链接,例如及时通讯软件、Twitter 客户端、 e-mail,要更改打开网页的默认浏览器,你需要用到 Ubuntu 系统设置工具。
|
||||
|
||||
你可以用多种方法打开系统设置。其中一种最快的方式是点击右上角(RTL系统是左上角)的 Cog 图标并选择‘系统设置’菜单快捷方式。
|
||||
|
||||
1. 打开‘系统设置’
|
||||
1. 选择‘详细’选项
|
||||
1. 在侧边栏选择‘默认应用程序’
|
||||
1. 把 ‘Web’ 条目的 ‘火狐’ 改为你想要的选项
|
||||
|
||||
就是这样。
|
||||
|
||||
### 如何在 Ubuntu 上更改默认的邮件客户端 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg)
|
||||
|
||||
Ubuntu 用 Thunderbird 作为默认的邮件应用程序。这意味着 当你点击大部分浏览器、 PDF文件、及时通讯软件等上的 **电子邮件地址或者一个 [mailto 链接][7] 的时候会自动打开** 这个应用。
|
||||
|
||||
当然,如果你使用 Thunderbird,这真的很方便。但是我们很多人并非如此; 我们可能**[使用像 Geary 这样的轻量级客户端][8]**,GNOME stalwart Evolution,或者依靠像 Gmail 或者 Outlook 这样的网络邮件服务。
|
||||
|
||||
在 Ubuntu 上从 Thunderbird **更改默认邮件客户端** 到另一个应用程序,打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择你喜欢的客户端。
|
||||
|
||||
**在 Ubuntu 上设置 Gmail 为默认的邮件客户端**,你首先需要点击下面的按钮安装 ‘gnome-gmail’ 软件包。安装完后打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择 ‘Gmail’。
|
||||
|
||||
- [在 Ubuntu 上安装 GNOME Gmail][9]
|
||||
|
||||
### 更多 ###
|
||||
|
||||
上述同样的步骤可以用来设置你双击音乐文件时打开你喜欢的音乐播放器,用比如 VLC 应用程序处理 .avi 和 .mp4 文件,等等。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubuntu
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://wiki.gnome.org/Apps/Web
|
||||
[2]:https://apps.ubuntu.com/cat/applications/chromium-browser/
|
||||
[3]:https://wiki.debian.org/Iceweasel
|
||||
[4]:https://www.google.co.uk/chrome/browser/desktop/
|
||||
[5]:http://www.opera.com/computer/linux
|
||||
[6]:https://vivaldi.com/#Download
|
||||
[7]:http://en.wikipedia.org/wiki/Mailto
|
||||
[8]:http://www.omgubuntu.co.uk/2015/03/install-geary-ubuntu-linux-email-update
|
||||
[9]:apt://gnome-gmail
|
@ -0,0 +1,216 @@
|
||||
安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--1
|
||||
================================================================================
|
||||
CentOS 是一个工业标准的 Linux 发行版,是红帽企业版 Linux 的衍生版本。你安装完后马上就可以使用,但是为了更好地使用你的系统,你需要进行一些升级、软件包安装、配置特定服务和应用程序等操作。
|
||||
|
||||
这篇文章介绍了 “安装完 RHEL/CentOS 7 后需要做的 30 件事情”。阅读帖子的时候请牢记已经完成了 RHEL/CentOS 最小化安装,这是首选的企业和生产环境,如果还没有,你可以按照下面的指南,它会告诉你两者的最小化安装方法。
|
||||
|
||||
- [最小化安装 CentOS 7][1]
|
||||
- [最小化安装 RHEL 7][2]
|
||||
|
||||
下面是一些重要的事情列表,基于工业标准需求我们都会进行介绍。我们希望这些东西在你配置服务器的时候能有所帮助。
|
||||
|
||||
1. 注册并启用红帽订阅
|
||||
2. 使用静态 IP 地址配置网络
|
||||
3. 设置服务器的主机名称
|
||||
4. 更新或升级最小化安装的 CentOS
|
||||
5. 安装命令行 Web 浏览器
|
||||
6. 安装 Apache HTTP 服务器
|
||||
7. 安装 PHP
|
||||
8. 安装 MariaDB 数据库
|
||||
9. 安装并配置 SSH 服务器
|
||||
10. 安装 GCC (GNU 编译器集)
|
||||
11. 安装 Java
|
||||
12. 安装 Apache Tomcat
|
||||
13. 安装 Nmap 检查开放端口
|
||||
14. 配置防火墙
|
||||
15. 安装 Wget
|
||||
16. 安装 Telnet
|
||||
17. 安装 Webmin
|
||||
18. 启用第三方库
|
||||
19. 安装 7-zip 工具
|
||||
20. 安装 NTFS-3G 驱动
|
||||
21. 安装 Vsftpd FTP 服务器
|
||||
22. 安装和配置 sudo
|
||||
23. 安装并启用 SELinux
|
||||
24. 安装 Rootkit Hunter
|
||||
25. 安装 Linux Malware Detect (LMD)
|
||||
26. 用 Speedtest-cli 测试服务器带宽
|
||||
27. 配置 Cron 作业
|
||||
28. 安装 Owncloud
|
||||
29. 启用 VirtualBox 虚拟化
|
||||
30. 用密码保护 GRUB
|
||||
|
||||
### 1. 注册并启用红帽订阅 ###
|
||||
|
||||
RHEL 7 最小化安装完成后,是时候注册并启用系统红帽订阅库,以及执行一个完整的系统更新。这只当你有一个可用的红帽订阅时才能有效。你要注册才能启用官方红帽系统库并时不时进行操作系统更新。
|
||||
|
||||
在下面的指南中我们已经包括了一个如何注册并激活红帽订阅的详细说明。
|
||||
|
||||
- [在 RHEL 7 中注册并启用红帽订阅][3]
|
||||
|
||||
**注意**: 这一步仅适用于有一个有效订阅的红帽企业版 Linux. 如果你用的是 CentOS 服务器,请查看后面的章节。
|
||||
|
||||
### 2. 使用静态 IP 地址配置网络 ###
|
||||
|
||||
你第一件要做的事情就是为你的 CentOS 服务器配置静态 IP 地址,路由以及 DNS。我们会使用 ip 命令代替 ifconfig 命令。当然,ifconfig 命令对于大部分 Linux 发行版来说还是可用的,还能从默认库安装。
|
||||
|
||||
# yum install net-tools [提供 ifconfig 工具]
|
||||
|
||||
![在 Linux 上安装 ifconfig](http://www.tecmint.com/wp-content/uploads/2015/04/Install-ifconfig.jpeg)
|
||||
|
||||
但正如我之前说,我们会使用 ip 命令来配置静态 IP 地址。所以,确认你首先检查了当前的 IP 地址。
|
||||
|
||||
# ip addr show
|
||||
|
||||
![在 CentOS 查看 IP 地址](http://www.tecmint.com/wp-content/uploads/2015/04/Check-IP-Address.jpeg)
|
||||
|
||||
现在用你的编辑器打开并编辑文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3。这里,我使用 Vi 编辑器,另外你要确保你是 root 用户才能保存更改。
|
||||
|
||||
# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
|
||||
|
||||
我们会编辑文件中的四个地方。注意下面的四个地方并保证不碰任何其它的东西。也保留双引号,在它们中间输入你的数据。
|
||||
|
||||
IPADDR = “[在这里输入你的静态 IP]”
|
||||
GATEWAY = “[输入你的默认网关]”
|
||||
DNS1 = “[你的域名系统 1]”
|
||||
DNS2 = “[你的域名系统 2]”
|
||||
|
||||
更改了 ‘ifcfg-enp0s3’ 之后,看起来像下面的图片。注意你的 IP,网关和 DNS 可能会变化,请和你的 ISP(译者注:互联网服务提供商商) 确认。保存并退出。
|
||||
|
||||
![网络详情](http://www.tecmint.com/wp-content/uploads/2015/04/Network-Details.jpeg)
|
||||
网络详情
|
||||
|
||||
重启网络服务并检查 IP 是否和分配的一样。如果一切都顺利,用 Ping 查看网络状态。
|
||||
|
||||
# service network restart
|
||||
|
||||
![重启网络服务](http://www.tecmint.com/wp-content/uploads/2015/04/Restarat-Network.jpeg)
|
||||
重启网络服务
|
||||
|
||||
重启网络后,确认检查了 IP 地址和网络状态。
|
||||
|
||||
# ip addr show
|
||||
# ping -c4 google.com
|
||||
|
||||
![验证 IP 地址](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-IP-Address.jpeg)
|
||||
验证 IP 地址
|
||||
|
||||
![检查网络状态](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Network-Status.jpeg)
|
||||
检查网络状态
|
||||
|
||||
### 3. 设置服务器的主机名称 ###
|
||||
|
||||
下一步是更改 CentOS 服务器的主机名称。查看当前分配的主机名称。
|
||||
|
||||
# echo $HOSTNAME
|
||||
|
||||
![查看系统主机名称](http://www.tecmint.com/wp-content/uploads/2015/04/Check-System-Hostname.jpeg)
|
||||
查看系统主机名称
|
||||
|
||||
要设置新的主机名称,我们需要编辑 ‘/etc/hostsname’ 文件并用想要的名称替换旧的主机名称。
|
||||
|
||||
# vi /etc/hostname
|
||||
|
||||
![在 CentOS 中设置主机名称](http://www.tecmint.com/wp-content/uploads/2015/04/Set-System-Hostname.jpeg)
|
||||
在 CentOS 中设置主机名称
|
||||
|
||||
设置完了主机名称之后,务必注销后重新登录确认主机名称。登录后检查新的主机名称。
|
||||
|
||||
$ echo $HOSTNAME
|
||||
|
||||
![确认主机名称](http://www.tecmint.com/wp-content/uploads/2015/04/Confirm-Hostname.jpeg)
|
||||
确认主机名称
|
||||
|
||||
你也可以用 ‘hostname’ 命令查看你当前的主机名。
|
||||
|
||||
$ hostname
|
||||
|
||||
### 4. 更新或升级最小化安装的 CentOS ###
|
||||
|
||||
除了更新和安装已经有的软件的最新版本以及安全升级,这不会安装任何新的软件。总的来说更新和升级是相同的,除了事实上 升级 = 更新 + 更新时进行废弃处理。
|
||||
|
||||
# yum update && yum upgrade
|
||||
|
||||
![更新最小化安装的 CentOS 服务器](http://www.tecmint.com/wp-content/uploads/2015/04/Update-CentOS-Server.jpeg)
|
||||
更新最小化安装的 CentOS 服务器
|
||||
|
||||
**重要**: 你也可以运行下面的命令,这不会弹出软件更新的提示,你也就不需要输入 ‘y’ 接受更改。
|
||||
|
||||
然而,查看服务器上会发生的变化总是一个好主意,尤其是在生产中。因此使用下面的命令虽然可以为你自动更新和升级,但并不推荐。
|
||||
|
||||
# yum -y update && yum -y upgrade
|
||||
|
||||
### 5. 安装命令行 Web 浏览器 ###
|
||||
|
||||
大部分情况下,尤其是在生产环境中,我们通常用没有 GUI 的命令行安装 CentOS,在这种情况下我们必须有一个能通过终端查看网站的命令行浏览工具。为了实现这个目的,我们打算安装名为 ‘links’ 的著名工具。
|
||||
|
||||
# yum install links
|
||||
|
||||
![安装命令行浏览器](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Commandline-Browser.jpeg)
|
||||
Links: 命令行 Web 浏览器
|
||||
|
||||
请查看我们的文章 [用 links 工具命令行浏览 Web][4] 了解用 links 工具浏览 web 的方法和例子。
|
||||
|
||||
### 6. 安装 Apache HTTP 服务器 ###
|
||||
|
||||
不管你因为什么原因使用服务器,大部分情况下你都需要一个 HTTP 服务器运行网站、多媒体、用户端脚本和很多其它的东西。
|
||||
|
||||
# yum install httpd
|
||||
|
||||
![在 CentOS 上安装 Apache](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-on-CentOS.jpeg.)
|
||||
安装 Apache 服务器
|
||||
|
||||
如果你想更改 Apache HTTP 服务器的默认端口号(80)为其它端口,你需要编辑配置文件 ‘/etc/httpd/conf/httpd.conf’ 并查找以下面开始的行:
|
||||
|
||||
LISTEN 80
|
||||
|
||||
把端口号 ‘80’ 改为其它任何端口(例如 3221),保存并退出。
|
||||
|
||||
![在 CentOS 上更改 Apache 端口](http://www.tecmint.com/wp-content/uploads/2015/04/Change-Apache-Port.jpeg)
|
||||
更改 Apache 端口
|
||||
|
||||
增加刚才分配给 Apache 的端口通过防火墙,然后重新加载防火墙。
|
||||
|
||||
允许 http 服务通过防火墙(永久)。
|
||||
|
||||
# firewall-cmd –add-service=http
|
||||
|
||||
允许 3221 号端口通过防火墙(永久)。
|
||||
|
||||
# firewall-cmd –permanent –add-port=3221/tcp
|
||||
|
||||
重新加载防火墙。
|
||||
|
||||
# firewall-cmd –reload
|
||||
|
||||
完成上面的所有事情之后,是时候重启 Apache HTTP 服务器了,然后新的端口号才能生效。
|
||||
|
||||
# systemctl restart httpd.service
|
||||
|
||||
现在添加 Apache 服务到系统层使其随系统自动启动。
|
||||
|
||||
# systemctl start httpd.service
|
||||
# systemctl enable httpd.service
|
||||
|
||||
如下图所示,用 links 命令行工具 验证 Apache HTTP 服务器。
|
||||
|
||||
# links 127.0.0.1
|
||||
|
||||
![验证 Apache 状态](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Apache-Status.jpeg)
|
||||
验证 Apache 状态
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者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/centos-7-installation/
|
||||
[2]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/
|
||||
[3]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/
|
||||
[4]:http://www.tecmint.com/command-line-web-browsers/
|
@ -0,0 +1,143 @@
|
||||
安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--2
|
||||
================================================================================
|
||||
### 7. 安装 PHP ###
|
||||
|
||||
PHP 是用于 web 基础服务的服务器端脚本语言。它也经常被用作通用编程语言。在最小化安装的 CentOS 中安装 PHP。
|
||||
|
||||
# yum install php
|
||||
|
||||
安装完 php 之后,确认重启 Apache 服务以便在 Web 浏览器中渲染 PHP。
|
||||
|
||||
# systemctl restart httpd.service
|
||||
|
||||
下一步,通过在 Apache 文档根目录下创建下面的 php 脚本验证 PHP。
|
||||
|
||||
# echo -e "<?php\nphpinfo();\n?>" > /var/ww/html/phpinfo.php
|
||||
|
||||
现在在 Linux 命令行中查看我们刚才创建的 PHP 文件(phpinfo.php)。
|
||||
|
||||
# php /var/www/html/phpinfo.php
|
||||
或者
|
||||
# links http://127.0.0.1/phpinfo.php
|
||||
|
||||
![验证 PHP](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-PHP.jpeg)
|
||||
验证 PHP
|
||||
|
||||
### 8. 安装 MariaDB 数据库 ###
|
||||
|
||||
MariaDB 是 MySQL 的一个分支。红帽企业版 Linux 以及它的衍生版已经从 MySQL 迁移到 MariaDB。这是个主要的数据库管理系统。这又是一个你必须拥有的工具,不管你在配置怎样的服务器,或迟或早你都会需要它。在最小化安装的 CentOS 上安装 MariaDB,如下所示。
|
||||
|
||||
# yum install mariadb-server mariadb
|
||||
|
||||
![安装 MariaDB 数据库](http://www.tecmint.com/wp-content/uploads/2015/04/Install-MariaDB-Database.jpeg)
|
||||
安装 MariaDB 数据库
|
||||
|
||||
启动被配置 MariaDBs 随机启动。
|
||||
|
||||
# systemctl start mariadb.service
|
||||
# systemctl enable mariadb.service
|
||||
|
||||
允许 mysql(mariadb) 服务通过防火墙
|
||||
|
||||
# firewall-cmd –add-service=mysql
|
||||
|
||||
现在是时候确保 MariaDB 服务器安全了。
|
||||
|
||||
# /usr/bin/mysql_secure_installation
|
||||
|
||||
![保护 MariaDB 数据库](http://www.tecmint.com/wp-content/uploads/2015/04/Secure-MariaDB.jpeg)
|
||||
保护 MariaDB 数据库
|
||||
|
||||
请阅读:
|
||||
|
||||
- [在 CentOS 7.0 上安装 LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin)][1]
|
||||
- [在 CentOS 7.0 上创建 Apache 虚拟主机][2]
|
||||
|
||||
### 9. 安装和配置 SSH 服务器 ###
|
||||
|
||||
SSH 表示 Secure Shell,是 Linux 远程管理的默认协议。 SSH 是随最小化 CentOS 服务器一起发布的最重要的软件之一。
|
||||
|
||||
检查当前已安装的 SSH 版本。
|
||||
|
||||
# SSH -V
|
||||
|
||||
![检查 SSH 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-SSH-Version.jpeg)
|
||||
检查 SSH 版本
|
||||
|
||||
在默认的 SSH 协议上使用安全协议,更改端口号进一步加强安全。编辑 SSH 的配置文件 ‘/etc/ssh/ssh_config’。
|
||||
|
||||
去掉下面行的注释或者从协议行中删除 1,然后行看起来像这样:
|
||||
|
||||
# Protocol 2,1 (原来)
|
||||
Protocol 2 (现在)
|
||||
|
||||
这个改变强制 SSH 使用 协议 2,它被认为比协议 1 更安全,同时也确保在配置中更改端口号 22 为其它。
|
||||
|
||||
![保护 SSH 登录](http://www.tecmint.com/wp-content/uploads/2015/04/Secure-SSH.jpeg)
|
||||
保护 SSH 登录
|
||||
|
||||
取消 SSH ‘root login’ 然后允许只有当以普通用户账号登录后才能连接到 root 以进一步加强安全。为了做到这个,打开并编辑配置文件 ‘/etc/ssh/sshd_config’ 并更改 PermitRootLogin yes 为 PermitRootLogin no。
|
||||
|
||||
# PermitRootLogin yes (原来)
|
||||
PermitRootLogin no (现在)
|
||||
|
||||
![取消 SSH Root 登录](http://www.tecmint.com/wp-content/uploads/2015/04/Disable-SSH-Root-Login.jpeg)
|
||||
取消 SSH Root 登录
|
||||
|
||||
最后,重启 SSH 服务启用更改。
|
||||
|
||||
# systemctl restart sshd.service
|
||||
|
||||
请查看:
|
||||
|
||||
- [加密和保护 SSH 服务器的 5 个最佳实践][3]
|
||||
- [5 个简单步骤实现使用 SSH Keygen 无密码登录 SSH][4]
|
||||
- [在 PuTTY 中实现 “无密码 SSH 密钥验证”][5]
|
||||
|
||||
### 10. 安装 GCC (GNU 编译器集) ###
|
||||
|
||||
GCC 表示 GNU 编译器集,是一个 GNU 项目开发的支持多种编程语言的编译系统。在最小化安装的 CentOS 没有默认安装。运行下面的命令安装 gcc 编译器。
|
||||
# yum install gcc
|
||||
|
||||
![在 CentOS 上安装 GCC](http://www.tecmint.com/wp-content/uploads/2015/04/Install-GCC-in-CentOS.jpeg)
|
||||
在 CentOS 上安装 GCC
|
||||
|
||||
检查安装的 gcc 版本。
|
||||
|
||||
# gcc --version
|
||||
|
||||
![检查 GCC 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-GCC-Version.jpeg)
|
||||
检查 GCC 版本
|
||||
|
||||
### 11. 安装 Java ###
|
||||
|
||||
Java是一种通用的基于类的,面向对象的编程语言。在最小化 CentOS 服务器中没有默认安装。按照下面命令从库中安装 Java。
|
||||
|
||||
# yum install java
|
||||
|
||||
![在 CentOS 上安装 Java](http://www.tecmint.com/wp-content/uploads/2015/04/Install-java.jpeg)
|
||||
安装 Java
|
||||
|
||||
检查安装的 Java 版本。
|
||||
|
||||
# java -version
|
||||
|
||||
![检查 Java 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Java-Version.jpeg)
|
||||
检查 Java 版本
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/2/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者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/install-lamp-in-centos-7/
|
||||
[2]:http://www.tecmint.com/apache-virtual-hosting-in-centos/
|
||||
[3]:http://www.tecmint.com/5-best-practices-to-secure-and-protect-ssh-server/
|
||||
[4]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
|
||||
[5]:http://www.tecmint.com/ssh-passwordless-login-with-putty/
|
@ -0,0 +1,132 @@
|
||||
Linux ‘sort’命令的14个有用的范例 -- 第一部分
|
||||
=============================================================
|
||||
Sort是用于对单个或多个文本文件内容进行排序的Linux程序。Sort命令以空格作为字段分隔符,将一行分割为多个关键字对文件进行排序。需要注意的是除非你将输出重定向到文件中,否则Sort命令并不对文件内容进行实际的排序(即文件内容没有修改),只是将文件内容按有序输出。
|
||||
|
||||
本文的目标是通过14个实际的范例让你更深刻的理解如何在Linux中使用sort命令。
|
||||
|
||||
###1. 首先我们将会创建一个用于执行‘sort’命令的文本文件(tecmint.txt)。工作路径是‘/home/$USER/Desktop/tecmint’。###
|
||||
|
||||
下面命令中的‘-e’选项将‘/’和‘/n’解析成一个新行
|
||||
|
||||
$ echo -e "computer\nmouse\nLAPTOP\ndata\nRedHat\nlaptop\ndebian\nlaptop" > tecmint.txt
|
||||
|
||||
![Split String by Lines in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Split-String-by-Lines.gif)
|
||||
|
||||
###2. 在开始学习‘sort’命令前,我们先看看文件的内容及其显示方式。###
|
||||
|
||||
$ cat tecmint.txt
|
||||
|
||||
![Check Content of File](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Content-of-File.gif)
|
||||
|
||||
###3. 现在,使用如下命令对文件内容进行排序。###
|
||||
|
||||
$ sort tecmint.txt
|
||||
|
||||
![Sort Content of File linux](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content.gif)
|
||||
|
||||
**注意**:上面的命令并不对文件内容进行实际的排序,仅仅是将其内容按有序方式输出。
|
||||
|
||||
###4. 对文件‘tecmint.txt’文件内容排序,并将排序后的内容输出到名为sorted.txt的文件中,然后使用[cat][1]命令查看验证sorted.txt文件的内容。###
|
||||
|
||||
$ sort tecmint.txt > sorted.txt
|
||||
$ cat sorted.txt
|
||||
|
||||
![Sort File Content in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-File-Content.gif)
|
||||
|
||||
###5. 现在使用‘-r’参数对‘tecmint.txt’文件内容进行逆序排序,并将输出内容重定向到‘reversesorted.txt’文件中,并使用cat命令查看文件的内容。###
|
||||
|
||||
$ sort -r tecmint.txt > reversesorted.txt
|
||||
$ cat reversesorted.txt
|
||||
|
||||
![Sort Content By Reverse](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Reverse.gif)
|
||||
|
||||
###6. 创建一个新文件(lsl.txt),文件内容为在home目录下执行‘ls -l’命令的输出。###
|
||||
|
||||
$ ls -l /home/$USER > /home/$USER/Desktop/tecmint/lsl.txt
|
||||
$ cat lsl.txt
|
||||
|
||||
![Populate Output of Home Directory](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Output.gif)
|
||||
|
||||
我们将会看到对其他基础字段进行排序的例子,而不是对默认的初始字符进行排序。
|
||||
|
||||
###7. 基于第二列(符号连接的数量)对文件‘lsl.txt’进行排序。###
|
||||
|
||||
$ sort -nk2 lsl.txt
|
||||
|
||||
**注意**:上面例子中的‘-n’参数表示对数值内容进行排序。当想基于文件中的数值列对文件进行排序时,必须要使用‘-n’参数。
|
||||
|
||||
![Sort Content by Column](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-by-Column.gif)
|
||||
|
||||
###8. 基于第9列(文件和目录的名称,非数值)对文件‘lsl.txt’进行排序。###
|
||||
|
||||
$ sort -k9 lsl.txt
|
||||
|
||||
![Sort Content Based on Column](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-Based-on-Column.gif)
|
||||
|
||||
###9. sort命令并非仅能对文件进行排序,我们还可以通过管道将命令的输出内容重定向到sort命令中。###
|
||||
|
||||
$ ls -l /home/$USER | sort -nk5
|
||||
|
||||
![Sort Content Using Pipe Option](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Pipeline.gif)
|
||||
|
||||
###10. 对文件tecmint.txt进行排序,并删除重复的行。然后检查重复的行是否已经删除了。###
|
||||
|
||||
$ cat tecmint.txt
|
||||
$ sort -u tecmint.txt
|
||||
|
||||
![Sort and Remove Duplicates](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-and-Remove-Duplicates.gif)
|
||||
|
||||
目前我们发现的排序规则:
|
||||
|
||||
除非指定了‘-r’参数,否则排序的优先级按下面规则排序
|
||||
- 以数字开头的行优先级最高
|
||||
- 以小写字母开头的行优先级次之
|
||||
- 待排序内容按字典序进行排序
|
||||
- 默认情况下,‘sort’命令将带排序内容的每行关键字当作一个字符串进行字典序排序(数字优先级最高,参看规则 - 1)
|
||||
|
||||
|
||||
###11. 创建文件‘lsla.txt’,其内容用‘ls -la’命令的输出内容填充。###
|
||||
|
||||
$ ls -lA /home/$USER > /home/$USER/Desktop/tecmint/lsla.txt
|
||||
$ cat lsla.txt
|
||||
|
||||
![Populate Output With Hidden Files](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Output-With-Hidden-Files.gif)
|
||||
|
||||
了解ls命令的读者都知道‘ls -la’=‘ls -l’ + 隐藏文件。因此这两个文件的大部分内容都是相同的。
|
||||
|
||||
###12. 对上面两个文件内容进行排序输出。###
|
||||
|
||||
$ sort lsl.txt lsla.txt
|
||||
|
||||
![Sort Contents of Two Files](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-of-Multiple-Files.gif)
|
||||
|
||||
注意文件和目录的重复
|
||||
|
||||
###13. 现在我们看看怎样对两个文件进行排序、合并,并且删除重复行。###
|
||||
|
||||
$ sort -u lsl.txt lsla.txt
|
||||
|
||||
![Sort, Merge and Remove Duplicates from File](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Merge-Duplicates-Content.gif)
|
||||
|
||||
此时,我们注意到重复的行已经被删除了,我们可以将输出内容重定向到文件中。
|
||||
|
||||
###14. 我们同样可以基于多列对文件内容进行排序。基于第2,5(数值)和9(非数值)列对‘ls -l’命令的输出进行排序。###
|
||||
|
||||
$ ls -l /home/$USER | sort -t "," -nk2,5 -k9
|
||||
|
||||
![Sort Content By Field Column](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Field-Column.gif)
|
||||
|
||||
先到此为止了,在接下来的文章中我们将会学习到‘sort’命令更多的详细例子。届时敬请关注Tecmint。保持分享精神。若喜欢本文,敬请将本文分享给你的朋友。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/sort-command-linux/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[cvsher](https://github.com/cvsher)
|
||||
校对:[校对者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/13-basic-cat-command-examples-in-linux/
|
Loading…
Reference in New Issue
Block a user