mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject
This commit is contained in:
commit
13deb8b276
@ -0,0 +1,82 @@
|
||||
Windows 下的免费 SSH 客户端工具
|
||||
================================================================================
|
||||
|
||||
如果你的操作系统是 Windows,而你想要连接 Linux 服务器相互传送文件,那么你需要一个简称 SSH 的 Secure Shell 软件。实际上,SSH 是一个网络协议,它允许你通过网络连接到 Linux 和 Unix 服务器。SSH 使用公钥加密来认证远程的计算机。你可以有多种途径使用 SSH,无论是自动连接,还是使用密码认证登录。
|
||||
|
||||
本篇文章介绍了几种可以连接 Linux 服务器 SSH 客户端。
|
||||
|
||||
让我们开始。
|
||||
|
||||
### Putty ###
|
||||
|
||||
**Putty** 是最有名的 SSH 和 telnet 客户端,最初由 Simon Tatham 为 Windows 平台开发。Putty 是一款开源软件,有可用的源代码,和一群志愿者的开发和支持。
|
||||
|
||||
![](http://www.unixmen.com/wp-content/uploads/2015/03/putty.png)
|
||||
|
||||
Putty 非常易于安装和使用,通常大部分的配置选项你都不需要修改。你只需要输入少量基本的参数,就可以开始很简单地建立连接会话。[点此下载][1] Putty。
|
||||
|
||||
### Bitvise SSH Client ###
|
||||
|
||||
**Bitvise SSH** 是一款支持 SSH 和 SFTP 的 Windows 客户端。由 Bitvise 开发和提供专业支持。这款 SSH 客户端性能强悍,易于安装、便于使用。Bitvise SSH 客户端拥有功能丰富的图形界面,通过一个有自动重连功能的内置代理进行动态端口转发。
|
||||
|
||||
![](http://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png)
|
||||
|
||||
Bitvise SSH 客户端对**个人用户使用是免费的**,同时对于在组织内部的个人商业使用也一样。你可以[在这里下载 Bitvise SSH 客户端][2]。
|
||||
|
||||
### MobaXterm ###
|
||||
|
||||
**MobaXterm** 是你的**远程计算的终极工具箱**。在一个 Windows 应用里,它为程序员、网管、IT 管理员及其它用户提供了精心裁剪的一揽子功能,让他们的远程操作变得简约时尚。
|
||||
|
||||
![](http://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png)
|
||||
|
||||
MobaXterm 提供了所有重要的**远程网络工具** (如SSH、 X11、 RDP、 VNC、 FTP、 MOSH 等等),以及 Windows 桌面上的 **Unix 命令**(bash、 ls、 cat、sed、 grep、 awk、 rsync等等),而这些都是由一个开箱即用的**单一的便携程序**所提供。MobaXterm 对**个人使用免费**,你可以[在这里][3]下载 MobaXterm。
|
||||
|
||||
### DameWare SSH ###
|
||||
|
||||
我认为 **DameWare SSH** 是最好的免费SSH客户端。
|
||||
|
||||
![](http://www.unixmen.com/wp-content/uploads/2015/03/ssh.png)
|
||||
|
||||
这个免费工具是一个终端模拟器,可以让你从一个易用的控制台建立多个 telnet 和 SSH 连接。
|
||||
|
||||
-用一个带标签的控制台界面管理多个会话
|
||||
-将常用的会话保存在 Windows 文件系统中
|
||||
-使用多套保存的证书来轻松登录不同的设备
|
||||
-使用 telnet、SSH1 和 SSH2 协议连接计算机和设备
|
||||
|
||||
你可以从[这个链接][4]下载 **DameWare SSH**。
|
||||
|
||||
### SmarTTY ###
|
||||
|
||||
SmarTTY 是一款免费的多标签 SSH 客户端,支持使用 SCP 命令随时复制文件和目录。
|
||||
|
||||
![](http://www.unixmen.com/wp-content/uploads/2015/03/smart.png)
|
||||
|
||||
大多数 SSH 服务器每个连接支持最多10个子会话.SmarTTY 在这方面做得很好:没有烦人的多个窗口,不需要重新登录,仅仅打开一个新的标签页就可以开始了!
|
||||
|
||||
### Cygwin ###
|
||||
|
||||
Cygwin 是一款 GNU 和开源工具的大杂烩,提供的功能近似于一个 Windows 平台下的 Linux。
|
||||
|
||||
![](http://www.unixmen.com/wp-content/uploads/2015/03/cyq.png)
|
||||
|
||||
**Cygwin** 包括了一个称为模拟库的 Unix 系统:cygwin.dll,集成了大量的 GNU 和其它的免费软件,以大量的可选包方式组织而成。在这些安装包中,有高质量的编译器和其他软件开发工具、一个X11服务器、一套完整的X11开发套件、GNU emacs 编辑器、Tex 和 LaTeX、openSSH(客户端和服务器),除此之外还有很多,包括在微软 Windows 下需要编译和使用 PhysioToolkit 软件的每一样东西。
|
||||
|
||||
读完我们的文章后,不知你中意哪一款 SSH 客户端?你可以留下你的评论,描述你喜欢的系统和选择的原因。当然,如果有另外的 SSH 客户端没有被本文列举出来,你可以帮助我们补充。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[wi-cuckoo](http://github.com/wi-cuckoo)
|
||||
校对:[wxy](http://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](http://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.unixmen.com/author/anis/
|
||||
[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
|
||||
[2]:http://www.bitvise.com/download-area
|
||||
[3]:http://mobaxterm.mobatek.net/download.html
|
||||
[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM
|
||||
[5]:http://cygwin.com/packages/
|
@ -1,12 +1,13 @@
|
||||
如何在 Linux 中使用 Alpine 在命令行里获取 Gmail
|
||||
如何在 Linux 中使用 Alpine 在命令行里访问 Gmail
|
||||
================================================================================
|
||||
假如你是一个命令行爱好者,我很确信你将张开双臂欢迎任何可以使你使用这个强大的工作环境来执行哪怕一项日常任务的工具,例如从 [安排日程][1] 、 [管理财务][2] 到 获取 [Facebook][3] 、[Twitter][4]等任务。
|
||||
|
||||
在这个帖子中,我将为你展示 Linux 命令行的另一个漂亮干练的使用案例:**获取 Google 的 Gmail 服务**,为此,我们将使用 Alpine,一个基于 ncurses 的多功能命令行邮件客户端(不要和 Alpine Linux 搞混淆)。我们将在 Alphine 中配置 Gmail 的 IMAP 和 SMTP 设定来通过 Google 的邮件服务器在终端环境中收取和发送邮件。在这个教程的最后,你将意识到只需几步就可以在 Alpine 中使用其他的邮件服务。
|
||||
假如你是一个命令行爱好者,我很确信你会使用这个强大的工作环境来执行哪怕是一项日常任务的工具,并为之欢呼,例如从 [安排日程][1] 、 [管理财务][2] 到 获取 [Facebook][3] 、[Twitter][4]等任务。(LCTT 译注:阅读本文的另一个前提是,假如你还能访问 Gmail 或者知道 Gmail 是什么的话。)
|
||||
|
||||
诚然,已有许多卓越的基于 GUI 的邮件客户端存在,例如 Thunderbird, Evolution 或者甚至是 Web 界面,那么为什么还有人对使用命令行的邮件客户端来收取 Gmail 这样的事感兴趣呢?答案很简单。假如你需要快速地处理好事情并想避免使用不必要系统资源;或者你正工作在一个最小化安装(注:这里我感觉自己翻译有误)的服务器上,而它没有安装 X 服务(注:这里也需要更改);又或者是 X 服务在你的桌面上崩溃了,而你需要在解决这个问题之前急切地发送一些邮件。在上述所有的情况下, Alpine 都可以派上用场并在任何时间满足你的需求。
|
||||
在这个帖子中,我将为你展示 Linux 命令行的另一个漂亮干练的使用案例:**访问 Google 的 Gmail 服务**,为此,我们将使用 Alpine,一个基于 ncurses 的多功能命令行邮件客户端(不要和 Alpine Linux 搞混淆)。我们将在 Alphine 中配置 Gmail 的 IMAP 和 SMTP 设定,通过 Google 的邮件服务器在终端环境中收取和发送邮件。在这个教程的最后,你将发现只需几步就可以在 Alpine 中使用其他的邮件服务。
|
||||
|
||||
除了简单的编辑,发送和接收文本类的邮件信息等功能外, Alpine 还可以进行加密,解密和对邮件信息进行数字签名,以及与 TLS(注:Transport Layer Security) 无缝集成。
|
||||
诚然,已有许多卓越的基于 GUI 的邮件客户端存在,例如 Thunderbird, Evolution 或者甚至是 Web 界面,那么为什么还有人对使用命令行的邮件客户端来收取 Gmail 这样的事感兴趣呢?答案很简单。假如你需要快速地处理好事情并想避免浪费不必要系统资源;或者你正工作在一个精简安装无操作台的服务器上,它没有安装用于图形显示的 X 服务;又或者是 X 服务在你的桌面上崩溃了,而你需要在解决这个问题之前急切地发送一些邮件。在上述所有的情况下, Alpine 都可以派上用场并在任何时间满足你的需求。
|
||||
|
||||
除了简单的编辑,发送和接收文本类的邮件信息等功能外, Alpine 还可以进行加密,解密和对邮件信息进行数字签名,以及与 TLS(注:Transport Layer Security,传输层加密)无缝集成。
|
||||
|
||||
### 在 Linux 上安装 Alpine ###
|
||||
|
||||
@ -22,16 +23,13 @@
|
||||
|
||||
# alpine
|
||||
|
||||
在你第一次启用 Alpine 时,它将在当前用户的家目录下创建一个邮件文件夹(`~/mail`),并显现出主界面,正如下面的截屏所显示的那样:
|
||||
|
||||
注:youtube视频,发布的时候做个链接吧(注:这里我不知道该如何操作,不过我已经下载了该视频,如有需要,可以发送)
|
||||
<iframe width="615" height="346" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/kuKiv3uze4U?feature=oembed"></iframe>
|
||||
在你第一次启用 Alpine 时,它将在当前用户的家目录下创建一个邮件文件夹(`~/mail`),并显现出主界面,正如下面的视频所显示的那样:YOUTUBU 视频 - http://www.youtube.com/kuKiv3uze4U 。
|
||||
|
||||
它的用户界面有下列几个模块:
|
||||
|
||||
![](https://farm9.staticflickr.com/8724/16618079590_6c236ce2c2_c.jpg)
|
||||
|
||||
请随意地浏览,操作来熟悉 Alpine。你总是可以在任何时候通过敲 'Q' 来回到命令提示符界面。请注意,所有的字符界面下方都有与操作相关的帮助。
|
||||
请随意地浏览、操作来熟悉 Alpine。你总是可以在任何时候通过敲 'Q' 来回到命令提示符界面。请注意,所有的字符界面下方都有与操作相关的帮助。
|
||||
|
||||
在进一步深入之前,我们将为 Alpine 创建一个默认的配置文件。为此,请关闭 Alpine,然后在命令行中执行下面的命令:
|
||||
|
||||
@ -39,9 +37,9 @@
|
||||
|
||||
### 配置 Alpine 来使用 Gmail 账号 ###
|
||||
|
||||
一旦你安装了 Alpine 并至少花费了几分钟的时间来熟悉它的界面和菜单,下面便是实际配置它来使用一个已有的 Gmail 账户的时候了。
|
||||
当你安装了 Alpine 并至少花费了几分钟的时间来熟悉它的界面和菜单,下面便是实际配置它来使用一个已有的 Gmail 账户的时候了。
|
||||
|
||||
在 Alpine 中执行下面的步骤之前,记得要通过你的 Web 邮件界面,在你的 Gmail 设定里启用 IMAP 协议。一旦在你的 Gmail 账户中 IMAP 被启用,执行下面的步骤来在 Alpine 中启用阅读 Gmail 信息的功能。
|
||||
在 Alpine 中执行下面的步骤之前,记得首先要通过你的 Web 邮件界面,在你的 Gmail 设定里启用 IMAP 协议。一旦在你的 Gmail 账户中启用了 IMAP ,执行下面的步骤来在 Alpine 中启用阅读 Gmail 信息的功能。
|
||||
|
||||
首先,启动 Alpine。
|
||||
|
||||
@ -51,12 +49,12 @@
|
||||
|
||||
按 'A' 来新建一个文件夹并填写必要的信息:
|
||||
|
||||
- **昵称**: 填写任何你想写的名字;
|
||||
- **服务器**: imap.gmail.com/ssl/user=yourgmailusername@gmail.com
|
||||
- **Nickname**: 填写任何你想写的名字;
|
||||
- **Server**: imap.gmail.com/ssl/user=yourgmailusername@gmail.com
|
||||
|
||||
你可以将 `Path` 和 `View` 留白不填。
|
||||
|
||||
然后按 `Ctrl+X` 并在有提示时输入你的 Gmail 密码:
|
||||
然后按 `Ctrl+X` 并在提示时输入你的 Gmail 密码:
|
||||
|
||||
![](https://farm9.staticflickr.com/8611/16618079640_6f7dca336a_b.jpg)
|
||||
|
||||
@ -64,7 +62,7 @@
|
||||
|
||||
![](https://farm8.staticflickr.com/7598/16804355052_10c1a6c5bd_b.jpg)
|
||||
|
||||
为了验证,你可以比较在 Alpine 中显示的 "Gmail Sent" 信箱和在 Web 界面下的信箱:
|
||||
要验证的话,你可以比较在 Alpine 中显示的 "Gmail Sent" 信箱和在 Web 界面下的信箱:
|
||||
|
||||
![](https://farm8.staticflickr.com/7602/16619323939_d2eab3e162_c.jpg)
|
||||
|
||||
@ -73,7 +71,7 @@
|
||||
# The approximate number of seconds between checks for new mail
|
||||
mail-check-interval=10
|
||||
|
||||
最后,我们需要配置一个 SMTP 服务器来通过 Alpine 发送邮件信息。回到先前解释过的 Alpine 的设置界面,然后按 'C' 来设定一个 Google 的 SMTP 服务器地址,你需要像下面这样编辑 `SMTP Server`(为了发送) 这一行内容:
|
||||
最后,我们需要配置一个 SMTP 服务器来通过 Alpine 发送邮件。回到先前解释过的 Alpine 的设置界面,然后按 'C' 来设定一个 Google 的 SMTP 服务器地址,你需要像下面这样编辑 `SMTP Server`(用于发送邮件)这一行内容:
|
||||
|
||||
smtp.gmail.com:587/tls/user=yourgmailusername@gmail.com
|
||||
|
||||
@ -81,7 +79,7 @@
|
||||
|
||||
### 总结 ###
|
||||
|
||||
在这个帖子里,我们讨论了在终端环境中如何通过一个名为 Alpha 的轻量且强大的命令行邮件客户端来获取 Gmail。 Alpine 是一个发布在 Apache Software License 2.0 协议下的自由软件,该协议与 GPL 协议相兼容。 Alpine 引以自豪的是:它不仅对新手友好,同时还做到了让那些经验丰富的系统管理员认为它是强大的。我希望在你阅读完这篇文章后,你能意识到我最后一个论断是多么的正确。
|
||||
在这个帖子里,我们讨论了在终端环境中如何通过一个名为 Alpine 的轻量且强大的命令行邮件客户端来访问 Gmail。 Alpine 是一个发布在 Apache Software License 2.0 协议下的自由软件,该协议与 GPL 协议相兼容。 Alpine 引以自豪的是:它不仅对新手友好,同时还做到了让那些经验丰富的系统管理员认为它是强大的。我希望在你阅读完这篇文章后,你能意识到我最后一个论断是多么的正确。
|
||||
|
||||
非常欢迎使用下面的输入框来留下你的评论或问题。我期待着你们的反馈!
|
||||
|
||||
@ -91,7 +89,7 @@ via: http://xmodulo.com/gmail-command-line-linux-alpine.html
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@ -100,4 +98,4 @@ via: http://xmodulo.com/gmail-command-line-linux-alpine.html
|
||||
[2]:http://xmodulo.com/manage-personal-expenses-command-line.html
|
||||
[3]:http://xmodulo.com/access-facebook-command-line-linux.html
|
||||
[4]:http://xmodulo.com/access-twitter-command-line-linux.html
|
||||
[5]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[5]:https://linux.cn/article-2324-1.html
|
@ -1,12 +1,13 @@
|
||||
# Linux 下四种安全删除文件的工具 #
|
||||
Linux 下四种安全删除文件的工具
|
||||
===============
|
||||
|
||||
任何一个普通水平的计算机用户都知道,从计算机系统中删除的任意数据都可以稍候通过一些努力恢复出来。当你不小心删除了你的重要数据,这是一个不错的方案。但是大多数情况,你不希望你的隐私数据被轻易地恢复。不论何时,我们删除任意的文件,操作系统删除的仅仅是特定数据的索引。这就意味着,数据仍然保存在磁盘的某块地方,这种方法是不安全的,任何一个聪明的计算机黑客可以使用任意不错的数据恢复工具来恢复你删除的数据。Linux 用户利用我们都知晓的 "rm" 命令来从他们的操作系统中删除数据,但是 "rm" 命令在约定俗成的场景下工作。从这个命令删除的数据也可以使用特殊的文件恢复工具恢复。
|
||||
任何一个普通水平的计算机用户都知道,从计算机系统中删除的任意数据都可以稍后通过一些努力恢复出来。当你不小心删除了你的重要数据时,这是一个不错的方案。但是大多数情况,你不希望你的隐私数据被轻易地恢复。不论何时,我们删除的任意文件,操作系统删除的仅仅是对特定数据的索引。这就意味着,数据仍然保存在磁盘的某块地方,这种方法是不安全的,任何一个聪明的计算机黑客可以使用各种不错的数据恢复工具来恢复你删除的数据。Linux 用户利用我们都知晓的 "rm" 命令来从他们的操作系统中删除数据,但是 "rm" 命令也是像上面说的那样删除文件。从这个命令删除的数据也可以使用特殊的文件恢复工具恢复。
|
||||
|
||||
让我们看看怎样安全并且完整地从你地 Linux 系统中删除文件或者文件夹。以下提到的工具可以完全地删除数据,因此那些恢复工具很难找到真实数据的痕迹然后恢复它。
|
||||
让我们看看怎样安全并完整地从你的 Linux 系统中删除文件或者文件夹。以下提到的工具可以完全地删除数据,因此那些恢复工具很难找到真实数据的痕迹然后恢复它。
|
||||
|
||||
### Secure-Delete ###
|
||||
|
||||
Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为永久删除文件提供高级的技术支持。一旦 Secure-Delete 安装在任意的 Linux 系统,它会提供如下的四个命令:
|
||||
Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为永久删除文件提供了先进的技术支持。一旦 Secure-Delete 安装在各种 Linux 系统上,就提供了如下的四个命令:
|
||||
|
||||
- srm
|
||||
- smem
|
||||
@ -45,13 +46,13 @@ Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为
|
||||
|
||||
sudo sswap /dev/sda5
|
||||
|
||||
“**smem**” 用来清理在内存中的内容,它保证当系统重启或者关机时随机存取存储器(RAM)中的内容被清理,但是残余的数据痕迹仍然保存在内存。这个命令提供安全的内存清理,简单地在终端中运行 smem 命令。
|
||||
“**smem**” 用来清理在内存中的内容,虽然当系统重启或者关机时会清理随机存取存储器(RAM)中的内容,但是内存中仍然会保留一些数据的残留痕迹。这个命令提供安全的内存清理,简单地在终端中运行 smem 命令即可。
|
||||
|
||||
smem
|
||||
|
||||
### Shred ###
|
||||
|
||||
"shred" 命令销毁文件或者文件夹的内容,在某种程度上,不可能恢复。它使用随机生成的数据模式来持续重写文件,因此很难恢复任意的被销毁的数据,即使是那些黑客或者窃贼使用高水平的数据恢复工具或者设备。Shred 在 Linux 发行版中时默认安装的,如果你想,你可以运行如下命令来找到它的安装目录:
|
||||
"shred" 命令以一种不可恢复的方式来销毁文件或者文件夹的内容。它使用随机生成的数据模式来持续覆写文件,因此很难恢复任意的被销毁的数据,即使是那些黑客或者窃贼使用高水平的数据恢复工具或者设备。Shred 默认安装在所有 Linux 发行版中,如果你想,你可以运行如下命令来找到它的安装目录:
|
||||
|
||||
aun@eagle:~$ whereis shred
|
||||
|
||||
@ -75,17 +76,17 @@ Shred 默认情况下使用随机内容重写数据 25 次。如果你想它重
|
||||
|
||||
### dd ###
|
||||
|
||||
这个命令起初是用于磁盘克隆的。它用于一个分区或者一个磁盘复制到另一个分区或者磁盘。但是它还用于安全地清除硬盘或者分区的内容。运行如下命令使用随机数据来重写你的当前数据。你不需要安装 dd 命令,所有的 Linux 分发版都已经包含了此命令。
|
||||
这个命令起初是用于磁盘克隆的。它用于将一个分区或者一个磁盘复制到另一个分区或者磁盘。但是它还可用于安全地清除硬盘或者分区的内容。运行如下命令使用随机数据来重写你的当前数据。你不需要安装 dd 命令,所有的 Linux 分发版都已经包含了此命令。
|
||||
|
||||
sudo dd if=/dev/random of=/dev/sda
|
||||
|
||||
你也可以重写磁盘或者分区中的内容,只需要简单地将所有替换为 “zero”。
|
||||
你也可以覆写磁盘或者分区中的内容,只需要简单地将所有替换为 “zero”。
|
||||
|
||||
sudo dd if=/dev/zero of=/dev/sda
|
||||
|
||||
### Wipe ###
|
||||
|
||||
Wipe 起初开发的目的是从磁媒体中安全地擦除文件。这个命令行工具使用特殊的模式来重复地写文件。它使用 fsync() 调用和或 O_SYNC 位来强制访问磁盘,并且使用 Gutmann 算法来重复地写。你可以使用此命令删除单个文件,文件夹或者整个磁盘的内容,但是使用 wipe 命令来删除整个磁盘的模式会耗费大量的时间。另外,安装和使用这个工具相当容易。
|
||||
Wipe 起初开发的目的是从磁性介质中安全地擦除文件。这个命令行工具使用特殊的模式来重复地写文件。它使用 fsync() 调用和/或 O_SYNC 位来强制访问磁盘,并且使用 Gutmann 算法来重复地写。你可以使用此命令删除单个文件、文件夹或者整个磁盘的内容,但是使用 wipe 命令来删除整个磁盘的模式会耗费大量的时间。另外,安装和使用这个工具相当容易。
|
||||
|
||||
在 ubuntu 的终端中运行如下命令来安装 wipe。
|
||||
|
||||
@ -123,7 +124,7 @@ via: http://linoxide.com/security/delete-files-permanatly-linux/
|
||||
|
||||
作者:[Aun Raza][a]
|
||||
译者:[dbarobin](https://github.com/dbarobin)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
Linux有问必答-- 如何在Ubuntu中升级Docker
|
||||
Linux有问必答:如何在Ubuntu中升级Docker
|
||||
================================================================================
|
||||
> **提问**: 我使用了Ubuntu的标准仓库安装了Docker。然而,默认安装的Docker不能满足我另外一个依赖Docker程序的版本需要。我该如何在Ubuntu中升级到Docker的最新版本?
|
||||
|
||||
Docker第一次在2013年发布,它快速地演变成了一个针对分布式程序的开发平台。为了满足工业期望,Docker正在紧密地开发并持续地带来新特性的升级。这样Ubuntu发行版中的Docker版本可能很快就会过时。比如,, Ubuntu 14.10 Utopic 中的Docker版本是1.2.0, 然而最新的Docker版本是1.5.0。
|
||||
Docker第一次在2013年发布,它快速地演变成了一个针对分布式程序的开发平台。为了满足工业期望,Docker正在紧密地开发并持续地带来新特性的升级。这样Ubuntu发行版中的Docker版本可能很快就会过时。比如, Ubuntu 14.10 Utopic 中的Docker版本是1.2.0, 然而最新的Docker版本是1.6.0。
|
||||
|
||||
![](https://farm9.staticflickr.com/8730/16351300024_9acb9086da_b.jpg)
|
||||
|
||||
@ -28,7 +28,7 @@ via: http://ask.xmodulo.com/upgrade-docker-ubuntu.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,11 +1,11 @@
|
||||
Conky - 终极的 X 视窗系统监视器应用
|
||||
================================================================================
|
||||
Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU 通用公共许可协议和 BSD 许可协议下发布,在 Linux 和 BSD 操作系统中都可以获取到它。这个应用是基于 X 视窗系统的,原本 fork 至 [Torsmo][1]。
|
||||
Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU GPL 和 BSD 许可协议下发布,在 Linux 和 BSD 操作系统中都可以获取到它。这个应用是基于 X 视窗系统的,原本由 [Torsmo][1] 分支而来。
|
||||
|
||||
#### 特点 ####
|
||||
|
||||
- 简洁的用户界面;
|
||||
- 高配置性;
|
||||
- 高度可配置;
|
||||
- 它既可使用内置的部件(超过 300 多个) 也可使用外部脚本,来在桌面或其自有容器中展示系统的状态;
|
||||
- 低资源消耗;
|
||||
- 它可显示范围广泛的系统参数,包括但不限于 CPU,内存,swap 分区 ,温度,进程,磁盘使用情况,网络状态,电池电量,邮件收发,系统消息,音乐播放器的控制,天气信息,最新新闻,升级信息等等;
|
||||
@ -15,7 +15,7 @@ Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU 通用公
|
||||
|
||||
- conky 这个名称来自于一个加拿大电视节目;
|
||||
- 它已被移植到 Nokia N900 上;
|
||||
- 它已不再被官方维护;
|
||||
- 官方已经不再维护它了;
|
||||
|
||||
### 在 Linux 中 Conky 的安装和使用 ###
|
||||
|
||||
@ -57,7 +57,8 @@ Conky 既可以从软件仓库中安装,也可从源代码编译得到:
|
||||
$ conky &
|
||||
|
||||
![正在运行的 Conky 监视器](http://www.tecmint.com/wp-content/uploads/2015/03/Start-Conkey.jpeg)
|
||||
正在运行的 Conky 监视器
|
||||
|
||||
*正在运行的 Conky 监视器*
|
||||
|
||||
这使得 conky 以一个弹窗的形式运行,并使用位于 `/etc/conky/conky.conf` 的 conky 基本配置文件。
|
||||
|
||||
@ -72,29 +73,31 @@ Conky 既可以从软件仓库中安装,也可从源代码编译得到:
|
||||
$ killall -SIGUSR1 conky
|
||||
|
||||
![Conky 监视器窗口](http://www.tecmint.com/wp-content/uploads/2015/03/Restart-Conky.jpeg)
|
||||
Conky 监视器窗口
|
||||
|
||||
你可能想编辑位于你家目录的 conky 的配置文件,这个配置文件的内容是非常容易理解的。
|
||||
*Conky 监视器窗口*
|
||||
|
||||
你可能想编辑位于你的家目录的 conky 的配置文件,这个配置文件的内容是非常容易理解的。
|
||||
|
||||
下面是 conky 配置文件的一个样例:
|
||||
|
||||
![Conky 的配置](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Configuration.jpeg)
|
||||
Conky 的配置
|
||||
|
||||
从上面的窗口中,你可以更改颜色,边框,大小,缩放比例,背景,对齐方式及几个其他属性。通过为不同的 conky 窗口设定不同的对齐方式,我们可以同时运行超过一个 conky 脚本。
|
||||
*Conky 的配置*
|
||||
|
||||
从上面的窗口中,你可以更改颜色,边框,大小,缩放比例,背景,对齐方式及几个其他属性。通过为不同的 conky 窗口设定不同的对齐方式,我们可以同时运行几个 conky 脚本。
|
||||
|
||||
**为 conky 使用脚本而不是默认配置以及如何找到这些脚本?**
|
||||
**让 conky 使用其它脚本而不是默认配置,以及如何找到这些脚本?**
|
||||
|
||||
你可以编写你自己的 conky 脚本或使用来自于互联网的脚本;我们并不建议你使用你从互联网中找到的具有潜在危险的任何脚本,除非你清楚你正在做什么。然而,有一些著名的主题和网页包含可信赖的 conky 脚本,例如下面所提及的:
|
||||
你可以编写你自己的 conky 脚本或使用来自于互联网的脚本;我们并不建议你使用从互联网中找到的具有潜在危险的任何脚本,除非你清楚你正在做什么。然而,有一些著名的主题和网页包含可信赖的 conky 脚本,例如下面所提及的:
|
||||
|
||||
- [http://ubuntuforums.org/showthread.php?t=281865][3]
|
||||
- [http://conky.sourceforge.net/screenshots.html][4]
|
||||
|
||||
在上面的 URL 地址中,你将发现每个截图都有一个超链接,它们将重定向到脚本文件。
|
||||
在上面的 URL 地址中,你将发现其中每个截图都有一个超链接,它们将指向到脚本文件。
|
||||
|
||||
#### 测试 Conky 脚本 ####
|
||||
|
||||
这里我将在我的 Debian Jessie 机子中运行一个由第三方写的 conky 脚本,以此来进行测试:
|
||||
这里我将在我的 Debian Jessie 系统中运行一个由第三方写的 conky 脚本,以此来进行测试:
|
||||
|
||||
$ wget https://github.com/alexbel/conky/archive/master.zip
|
||||
$ unzip master.zip
|
||||
@ -107,39 +110,41 @@ Conky 的配置
|
||||
|
||||
$ mv secrets.yml.example secrets.yml
|
||||
|
||||
在你能够运行这个(ruby)脚本之前安装 Ruby:
|
||||
在你需要运行这个(ruby)脚本之前安装 Ruby:
|
||||
|
||||
$ sudo apt-get install ruby
|
||||
$ ruby starter.rb
|
||||
|
||||
![华丽的 conky 外观](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Fancy-Look.jpeg)
|
||||
华丽的 conky 外观
|
||||
|
||||
**注**: 这个脚本可以被修改以展示你当前的天气,温度等;
|
||||
*华丽的 conky 外观*
|
||||
|
||||
**注**: 可以修改这个脚本以展示你当前的天气,温度等;
|
||||
|
||||
假如你想让 conky 开机自启,请在开机启动应用设置(startup Applications) 中添加如下的几行命令:
|
||||
|
||||
conky --pause 10
|
||||
save and exit.
|
||||
|
||||
最后。。。 如此轻量级且吸引眼球的实用 GUI 软件包不再处于激活状态且官方不再进行维护了。最新的稳定发布版本为 conky 1.9.0, 于 2012 年 5 月 3 号发布。在 Ubuntu 论坛上,一个有关用户分享 conky 配置的主题已经超过了 2000 多页。(这个论坛主题的链接为: [http://ubuntuforums.org/showthread.php?t=281865/][5])
|
||||
最后,如此轻量级且吸引眼球的实用 GUI 软件包不再处于活跃状态且官方不再进行维护了。最新的稳定发布版本为 conky 1.9.0, 于 2012 年 5 月 3 号发布。在 Ubuntu 论坛上,一个有关用户分享 conky 配置的主题已经超过了 2000 多页。(这个论坛主题的链接为: [http://ubuntuforums.org/showthread.php?t=281865/][5])
|
||||
|
||||
- [Conky 主页][6]
|
||||
|
||||
这就是全部内容了。保持联系,保持评论。请在下面的评论框里分享你的想法和配置。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/install-conky-in-ubuntu-debian-fedora/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
[1]:http://torsmo.sourceforge.net/
|
||||
[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/
|
||||
[2]:https://linux.cn/article-2324-1.html
|
||||
[3]:http://ubuntuforums.org/showthread.php?t=281865
|
||||
[4]:http://conky.sourceforge.net/screenshots.html
|
||||
[5]:http://ubuntuforums.org/showthread.php?t=281865/
|
@ -1,117 +0,0 @@
|
||||
Translating by goreliu ...
|
||||
|
||||
5 Interesting Command Line Tips and Tricks in Linux – Part 1
|
||||
================================================================================
|
||||
Are you making most out of the Linux? There are lots of helpful features which appears to be Tips and Tricks for many of Linux Users. Sometimes Tips and Tricks become the need. It helps you get productive with the same set of commands yet with enhanced functionality.
|
||||
|
||||
![5 Command Line Tips and Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/5-Command-Line-Tips.jpg)
|
||||
5 Command Line Tips and Tricks
|
||||
|
||||
Here we are starting a new series, where we will be writing some tips and tricks and will try to yield as more as we can in small time.
|
||||
|
||||
### 1. To audit the commands we’d run in past, we use [history command][1]. Here is a sample output of history command. ###
|
||||
|
||||
# history
|
||||
|
||||
![history command example](http://www.tecmint.com/wp-content/uploads/2015/03/history-command.gif)
|
||||
history command example
|
||||
|
||||
Obvious from output, the history command do not output the time stamp with the log of last executed commands. Any solution for this? Yeah! Run the below command.
|
||||
|
||||
# HISTTIMEFORMAT="%d/%m/%y %T "
|
||||
# history
|
||||
|
||||
If you want to permanently append this change, add the below line to `~/.bashrc`.
|
||||
|
||||
export HISTTIMEFORMAT="%d/%m/%y %T "
|
||||
|
||||
and then, from terminal run,
|
||||
|
||||
# source ~/.bashrc
|
||||
|
||||
Explanation of commands and switches.
|
||||
|
||||
- history – GNU History Library
|
||||
- HISTIMEFORMAT – Environmental Variable
|
||||
- %d – Day
|
||||
- %m – Month
|
||||
- %y – Year
|
||||
- %T – Time Stamp
|
||||
- source – in short send the contents of file to shell
|
||||
- .bashrc – is a shell script that BASH runs whenever it is started interactively.
|
||||
|
||||
![history Command Logs](http://www.tecmint.com/wp-content/uploads/2015/03/History-Command-Logs.gif)
|
||||
history Command Logs
|
||||
|
||||
### 2. The next gem in the list is – how to check disk write speed? Well one liner dd command script serves the purpose. ###
|
||||
|
||||
# dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img
|
||||
|
||||
![dd Command Example](http://www.tecmint.com/wp-content/uploads/2015/03/dd-Command-Example.gif)
|
||||
dd Command Example
|
||||
|
||||
Explanation of commands and switches.
|
||||
|
||||
- dd – Convert and Copy a file
|
||||
- if=/dev/zero – Read the file and not stdin
|
||||
- of=/tmp/output.img – Write to file and not stdout
|
||||
- bs – Read and Write maximum upto M bytes, at one time
|
||||
- count – Copy N input block
|
||||
- conv – Convert the file as per comma separated symbol list.
|
||||
- rm – Removes files and folder
|
||||
- -rf – (-r) removes directories and contents recursively and (-f) Force the removal without prompt.
|
||||
|
||||
### 3. How will you check the top six files that are eating out your space? A simple one liner script made from [du command][2], which is primarily used as file space usages. ###
|
||||
|
||||
# du -hsx * | sort -rh | head -6
|
||||
|
||||
![Check Disk Space Usage](http://www.tecmint.com/wp-content/uploads/2015/03/check-disk-space-usage.gif)
|
||||
Check Disk Space Usage
|
||||
|
||||
Explanation of commands and switches.
|
||||
|
||||
- du – Estimate file space usages
|
||||
- -hsx – (-h) Human Readable Format, (-s) Summaries Output, (-x) One File Format, skip directories on other file format.
|
||||
- sort – Sort text file lines
|
||||
- -rf – (-r) Reverse the result of comparison, (-f) Ignore case
|
||||
- head – output first n lines of file.
|
||||
|
||||
### 4. The next step involves statistics in terminal of a file of every kind. We can output the statistics related to a file with the help of stat (output file/fileSystem status) command. ###
|
||||
|
||||
# stat filename_ext (viz., stat abc.pdf)
|
||||
|
||||
![Check File Statistics](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Statistics.gif)
|
||||
Check File Statistics
|
||||
|
||||
### 5. The next and last but not the least, this one line script is for those, who are newbies. If you are an experienced user you probably don’t need it, unless you want some fun out of it. Well newbies are Linux-command-line phobic and the below one liner will generate random man pages. The benefit is as a newbie you always get something to learn and never get bored. ###
|
||||
|
||||
# man $(ls /bin | shuf | head -1)
|
||||
|
||||
![Generate Random Man Pages](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif)
|
||||
Generate Random Man Pages
|
||||
|
||||
Explanation of commands and switches.
|
||||
|
||||
- man – Linux Man pages
|
||||
- ls – Linux Listing Commands
|
||||
- /bin – System Binary file Location
|
||||
- shuf – Generate Random Permutation
|
||||
- head – Output first n line of file.
|
||||
|
||||
That’s all for now. If you know any such tips and tricks you may share with us and we will post the same in your words on our reputed Tecmint.com website.
|
||||
|
||||
If you want to share any tips and tricks that you cannot make into article you may share it at tecmint[dot]com[at]gmail[dot]com and we will include it in our article. Don’t forget to provide us with your valuable feedback in the comments below. Keep connected. Like and share us and help us get spread.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/5-linux-command-line-tricks/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
[1]:http://www.tecmint.com/history-command-examples/
|
||||
[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/
|
@ -1,3 +1,5 @@
|
||||
Translating by goreliu ...
|
||||
|
||||
How to set up server monitoring system with Monit
|
||||
================================================================================
|
||||
Many Linux admins rely on a centralized remote monitoring system (e.g., [Nagios][1] or [Cacti][2]) to check the health of their network infrastructure. While centralized monitoring makes an admin's life easy when dealing with many hosts and devices, a dedicated monitoring box obviously becomes a single point of failure; if the monitoring box goes down or becomes unreachable for whatever reason (e.g., bad hardware or network outage), you will lose visibility on your entire infrastructure.
|
||||
@ -237,7 +239,7 @@ In this tutorial, I demonstrate how to set up Monit on a local server. What I sh
|
||||
via: http://xmodulo.com/server-monitoring-system-monit.html
|
||||
|
||||
作者:[Iulian Murgulet][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[goreliu](https://github.com/goreliu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,261 +0,0 @@
|
||||
4 Tools Send Email with Subject, Body and Attachment in Linux
|
||||
================================================================================
|
||||
In today's article we will cover a few ways you can use to send emails with attachments from the command line interface on Linux. It can have quite a few uses, for example to send an archive with an application from an application server to email or you can use the commands in scripts to automate some process. For our examples,we will use the file foo.tar.gz as our attachment.
|
||||
|
||||
There are various ways to send emails from command line using different mail clients but here I am sharing few mail client utility used by most users like mailx, mutt and swaks.
|
||||
|
||||
All the tools we will present to you are very popular and present in the repositories of most Linux distributions, you can install them using the following commands:
|
||||
|
||||
For **Debian / Ubuntu** systems
|
||||
|
||||
apt-get install mutt
|
||||
apt-get install swaks
|
||||
apt-get install mailx
|
||||
apt-get install sharutils
|
||||
|
||||
For Red Hat based systems like **CentOS** or **Fedora**
|
||||
|
||||
yum install mutt
|
||||
yum install swaks
|
||||
yum install mailx
|
||||
yum install sharutils
|
||||
|
||||
### 1) Using mail / mailx ###
|
||||
|
||||
The mailx utility found as the default mailer application in most Linux distributions now includes the support to attach file. If it is not available you can easily install using the following commands please take note that this may not be supported in older versions, to check this you can use the command:
|
||||
|
||||
$ man mail
|
||||
|
||||
And the first line should look like this:
|
||||
|
||||
mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] [-A account] [-S variable[=value]] to-addr . . .
|
||||
|
||||
As you can see it supports the -a attribute to add a file to the email and -s attribute to subject to the email. Use few of below examples to send mails.
|
||||
|
||||
**a) Simple Mail**
|
||||
|
||||
Run the mail command, and then mailx would wait for you to enter the message of the email. You can hit enter for new lines. When done typing the message, press Ctrl+D and mailx would display EOT.
|
||||
|
||||
After than mailx automatically delivers the email to the destination.
|
||||
|
||||
$ mail user@example.com
|
||||
|
||||
HI,
|
||||
Good Morning
|
||||
How are you
|
||||
EOT
|
||||
|
||||
**b) To send email with subject**
|
||||
|
||||
$ echo "Email text" | mail -s "Test Subject" user@example.com
|
||||
|
||||
-s is used for defining subject for email.
|
||||
|
||||
**c) To send message from a file**
|
||||
|
||||
$ mail -s "message send from file" user@example.com < /path/to/file
|
||||
|
||||
**d) To send message piped using the echo command**
|
||||
|
||||
$ echo "This is message body" | mail -s "This is Subject" user@example.com
|
||||
|
||||
**e) To send email with attachment**
|
||||
|
||||
$ echo “Body with attachment "| mail -a foo.tar.gz -s "attached file" user@example.com
|
||||
|
||||
-a is used for attachments
|
||||
|
||||
### 2) mutt ###
|
||||
|
||||
Mutt is a text-based email client for Unix-like systems. It was developed over 20 years ago and it's an important part of Linux history, one of the first clients to support scoring and threading capabilities. Use few of below examples to send email.
|
||||
|
||||
**a) Send email with subject & body message from a file**
|
||||
|
||||
$ mutt -s "Testing from mutt" user@example.com < /tmp/message.txt
|
||||
|
||||
**b) To send body message piped using the echo command**
|
||||
|
||||
$ echo "This is the body" | mutt -s "Testing mutt" user@example.com
|
||||
|
||||
**c) To send email with attachment**
|
||||
|
||||
$ echo "This is the body" | mutt -s "Testing mutt" user@example.com -a /tmp/foo.tar.gz
|
||||
|
||||
**d) To send email with multiple attachments**
|
||||
|
||||
$ echo "This is the body" | mutt -s "Testing" user@example.com -a foo.tar.gz –a bar.tar.gz
|
||||
|
||||
### 3) swaks ###
|
||||
|
||||
Swaks stands for Swiss Army Knife for SMTP and it is a featureful, flexible, scriptable, transaction-oriented SMTP test tool written and maintained by John Jetmore. You can use the following syntax to send an email with attachment:
|
||||
|
||||
$ swaks -t "foo@bar.com" --header "Subject: Subject" --body "Email Text" --attach foo.tar.gz
|
||||
|
||||
The important thing about Swaks is that it will also debug the full mail transaction for you, so it is a very useful tool if you also wish to debug the mail sending process:
|
||||
|
||||
As you can see it gives you full details about the sending process including what capabilities the receiving mail server supports, each step of the transaction between the 2 servers.
|
||||
|
||||
### 4) uuencode ###
|
||||
|
||||
Email transport systems were originally designed to transmit characters with a seven-bit encoding -- like ASCII. This meant they could send messages with plain text but not "binary" text, such as program files or image files that used all of an eight-bit byte. The program is used to solve this limitation is “uuencode”( "UNIX to UNIX encoding") which encode the mail from binary format to text format that is safe to transmit & program is used to decode the data is called “uudecode”
|
||||
|
||||
We can easily send binary text such as a program files or image files using uuencode with mailx or mutt email client is shown by following example:
|
||||
|
||||
$ uuencode example.jpeg example.jpeg | mail user@example.com
|
||||
|
||||
### Shell Script : Explain how to send email ###
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
FROM=""
|
||||
SUBJECT=""
|
||||
ATTACHMENTS=""
|
||||
TO=""
|
||||
BODY=""
|
||||
|
||||
# Function to check if entered file names are really files
|
||||
function check_files()
|
||||
{
|
||||
output_files=""
|
||||
for file in $1
|
||||
do
|
||||
if [ -s $file ]
|
||||
then
|
||||
output_files="${output_files}${file} "
|
||||
fi
|
||||
done
|
||||
echo $output_files
|
||||
}
|
||||
|
||||
echo "*********************"
|
||||
echo "E-mail sending script."
|
||||
echo "*********************"
|
||||
echo
|
||||
|
||||
# Getting the From address from user
|
||||
while [ 1 ]
|
||||
do
|
||||
if [ ! $FROM ]
|
||||
then
|
||||
echo -n -e "Enter the e-mail address you wish to send mail from:\n[Enter] "
|
||||
else
|
||||
echo -n -e "The address you provided is not valid:\n[Enter] "
|
||||
fi
|
||||
|
||||
read FROM
|
||||
echo $FROM | grep -E '^.+@.+$' > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
# Getting the To address from user
|
||||
while [ 1 ]
|
||||
do
|
||||
if [ ! $TO ]
|
||||
then
|
||||
echo -n -e "Enter the e-mail address you wish to send mail to:\n[Enter] "
|
||||
else
|
||||
echo -n -e "The address you provided is not valid:\n[Enter] "
|
||||
fi
|
||||
|
||||
read TO
|
||||
echo $TO | grep -E '^.+@.+$' > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
# Getting the Subject from user
|
||||
echo -n -e "Enter e-mail subject:\n[Enter] "
|
||||
read SUBJECT
|
||||
|
||||
echo
|
||||
|
||||
if [ "$SUBJECT" == "" ]
|
||||
then
|
||||
echo "Proceeding without the subject..."
|
||||
fi
|
||||
|
||||
# Getting the file names to attach
|
||||
echo -e "Provide the list of attachments. Separate names by space.
|
||||
If there are spaces in file name, quote file name with \"."
|
||||
read att
|
||||
|
||||
echo
|
||||
|
||||
# Making sure file names are poiting to real files
|
||||
attachments=$(check_files "$att")
|
||||
echo "Attachments: $attachments"
|
||||
|
||||
for attachment in $attachments
|
||||
do
|
||||
ATTACHMENTS="$ATTACHMENTS-a $attachment "
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
# Composing body of the message
|
||||
echo "Enter message. To mark the end of message type ;; in new line."
|
||||
read line
|
||||
|
||||
while [ "$line" != ";;" ]
|
||||
do
|
||||
BODY="$BODY$line\n"
|
||||
read line
|
||||
done
|
||||
|
||||
SENDMAILCMD="mutt -e \"set from=$FROM\" -s \"$SUBJECT\" \
|
||||
$ATTACHMENTS -- \"$TO\" <<< \"$BODY\""
|
||||
echo $SENDMAILCMD
|
||||
|
||||
mutt -e "set from=$FROM" -s "$SUBJECT" $ATTACHMENTS -- $TO <<< $BODY
|
||||
|
||||
**Script Output**
|
||||
|
||||
$ bash send_mail.sh
|
||||
*********************
|
||||
E-mail sending script.
|
||||
*********************
|
||||
|
||||
Enter the e-mail address you wish to send mail from:
|
||||
[Enter] test@gmail.com
|
||||
|
||||
Enter the e-mail address you wish to send mail to:
|
||||
[Enter] test@gmail.com
|
||||
|
||||
Enter e-mail subject:
|
||||
[Enter] Message subject
|
||||
|
||||
Provide the list of attachments. Separate names by space.
|
||||
If there are spaces in file name, quote file name with ".
|
||||
send_mail.sh
|
||||
|
||||
Attachments: send_mail.sh
|
||||
|
||||
Enter message. To mark the end of message type ;; in new line.
|
||||
This is a message
|
||||
text
|
||||
;;
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
There are many ways of send emails from command line / shell script but here we have shared 4 tools available for unix / linux based distros. Hope you enjoyed reading our article and please provide your valuable comments and also let us know if you know about any new tools.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-shell-script/send-email-subject-body-attachment-linux/
|
||||
|
||||
作者:[Bobbin Zachariah][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/bobbin/
|
@ -1,237 +0,0 @@
|
||||
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/
|
@ -1,115 +0,0 @@
|
||||
Translating by GOLinux!
|
||||
Linux FAQs with Answers--How to block specific user agents on nginx web server
|
||||
================================================================================
|
||||
> **Question**: I notice that some robots often visit my nginx-powered website and scan it aggressively, ending up wasting a lot of my web server resources. I am trying to block those robots based on their user-agent string. How can I block specific user agent(s) on nginx web server?
|
||||
|
||||
The modern Internet is infested with various malicious robots and crawlers such as malware bots, spambots or content scrapers which are scanning your website in surreptitious ways, for example to detect potential website vulnerabilities, harvest email addresses, or just to steal content from your website. Many of these robots can be identified by their signature "user-agent" string.
|
||||
|
||||
As a first line of defense, you could try to block malicious bots from accessing your website by blacklisting their user-agents in robots.txt file. However, unfortunately this works only for "well-behaving" robots which are designed to obey robots.txt. Many malicious bots can simply ignore robots.txt and scan your website at will.
|
||||
|
||||
An alternative way to block particular robots is to configure your web server, such that it refuses to serve content to requests with certain user-agent strings. This post explains how to **block certain user-agent on nginx web server**.
|
||||
|
||||
### Blacklist Certain User-Agents in Nginx ###
|
||||
|
||||
To configure user-agent block list, open the nginx configuration file of your website, where the server section is defined. This file can be found in different places depending on your nginx setup or Linux distribution (e.g., /etc/nginx/nginx.conf, /etc/nginx/sites-enabled/<your-site>, /usr/local/nginx/conf/nginx.conf, /etc/nginx/conf.d/<your-site>).
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name xmodulo.com;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
....
|
||||
}
|
||||
|
||||
Once you open the config file with the server section, add the following if statement(s) somewhere inside the section.
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name xmodulo.com;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# case sensitive matching
|
||||
if ($http_user_agent ~ (Antivirx|Arian) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
# case insensitive matching
|
||||
if ($http_user_agent ~* (netcrawl|npbot|malicious)) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
....
|
||||
}
|
||||
|
||||
As you can guess, these if statements match any bad user-string with regular expressions, and return 403 HTTP status code when a match is found. $http_user_agent is a variable that contains the user-agent string of an HTTP request. The '~' operator does case-sensitive matching against user-agent string, while the '~' operator does case-insensitive matching. The '|' operator is logical-OR, so you can put as many user-agent keywords in the if statements, and block them all.
|
||||
|
||||
After modifying the configuration file, you must reload nginx to activate the blocking:
|
||||
|
||||
$ sudo /path/to/nginx -s reload
|
||||
|
||||
You can test user-agent blocking by using wget with "--user-agent" option.
|
||||
|
||||
$ wget --user-agent "malicious bot" http://<nginx-ip-address>
|
||||
|
||||
![](https://farm6.staticflickr.com/5333/17434036358_ef139a6b59_b.jpg)
|
||||
|
||||
### Manage User-Agent Blacklist in Nginx ###
|
||||
|
||||
So far, I have shown how to block HTTP requests with a few user-agents in nginx. What if you have many different types of crawling bots to block?
|
||||
|
||||
Since the user-agent blacklist can grow very big, it is not a good idea to put them all inside your nginx's server section. Instead, you can create a separate file which lists all blocked user agents. For example, let's create /etc/nginx/useragent.rules, and define a map with all blocked user agents in the following format.
|
||||
|
||||
$ sudo vi /etc/nginx/useragent.rules
|
||||
|
||||
----------
|
||||
|
||||
map $http_user_agent $badagent {
|
||||
default 0;
|
||||
~*malicious 1;
|
||||
~*backdoor 1;
|
||||
~*netcrawler 1;
|
||||
~Antivirx 1;
|
||||
~Arian 1;
|
||||
~webbandit 1;
|
||||
}
|
||||
|
||||
Similar to the earlier setup, '~*' will match a keyword in case-insensitive manner, while '~' will match a keyword using a case-sensitive regular expression. The line that says "default 0" means that any other user-agent not listed in the file will be allowed.
|
||||
|
||||
Next, open an nginx configuration file of your website, which contains http section, and add the following line somewhere inside the http section.
|
||||
|
||||
http {
|
||||
.....
|
||||
include /etc/nginx/useragent.rules
|
||||
}
|
||||
|
||||
Note that this include statement must appear before the server section (this is why we add it inside http section).
|
||||
|
||||
Now open an nginx configuration where your server section is defined, and add the following if statement:
|
||||
|
||||
server {
|
||||
....
|
||||
|
||||
if ($badagent) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
....
|
||||
}
|
||||
|
||||
Finally, reload nginx.
|
||||
|
||||
$ sudo /path/to/nginx -s reload
|
||||
|
||||
Now any user-agent which contains a keyword listed in /etc/nginx/useragent.rules will be automatically banned by nginx.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
@ -1,3 +1,4 @@
|
||||
Translating by GOLinux!
|
||||
Linux FAQs with Answers--What is the Apache error log location on Linux
|
||||
================================================================================
|
||||
> **Question**: I am trying to troubleshoot Apache web server errors on my Linux system. Where is the Apache error log file located on [insert your Linux distro]?
|
||||
@ -78,4 +79,4 @@ via: http://ask.xmodulo.com/apache-error-log-location-linux.html
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
||||
[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html
|
||||
[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html
|
||||
[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html
|
||||
[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html
|
||||
|
@ -1,81 +0,0 @@
|
||||
在windows下,连接你的Linux服务器的ssh免费客户端工具列举\
|
||||
================================================================================
|
||||
你的操作系统是Windows,而你想要连接Linux服务器相互传送文件.于是你需要一个Secure Shell,简称SSH.实际上,SSH是一个网络协议,允许你通过网络连接到Linux和Unix服务器.SSH使用公钥加密来认证远程的计算机.你可以有多种途径使用SSH,要么自动地连接,或者使用密码认证登录.
|
||||
|
||||
本篇文章讲述了几种SSH客户端,供选择使用来连接你的Linux服务器.
|
||||
|
||||
我们开始.
|
||||
|
||||
### Putty ###
|
||||
|
||||
**Putty**是最有名的SSH和telnet客户端,最初由Simon Tatham为Windows平台开发.Putty是一款开源软件,有可用的源代码,和一群志愿者的发展和支持.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/putty.png)
|
||||
|
||||
Putty非常易于安装和使用,通常你不需要改大部分的配置选项.你只需要输入少量基本的参赛,就可以开始最简单的对话连接[here][1].
|
||||
|
||||
### Bitvise SSH Client ###
|
||||
|
||||
**Bitvise SSH **是一款支持SSH和SFTP的Windows客户端.由Bitvise专业地提供支持和发展.这款SSH客户端性能强悍,易于安装和使用.Bitvise SSH客户端功能丰富,拥有图形界面,通过一个有自动重连能力的内置代理允许用户动态端口运行.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png)
|
||||
|
||||
Bitvise SSH客户端对个人用户使用**是**免费的,同时对于在组织内部的单独商业使用也一样.你可以[在这里下载Bitvise SSH客户端][2]
|
||||
|
||||
### MobaXterm ###
|
||||
|
||||
**M偶吧Xterm**是你的**终极工具箱,解决远程计算**.在单一的Windows应用里,它提供了许多裁剪过的的功能,针对程序员,网络管理者,IT管理员和相当一部分需要在更简单界面(此处原文为in a more simple fashion,有点费解)远程作业的用户.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png)
|
||||
|
||||
MobaXterm提供了所有重要的**远程网络工具** (如SSH, X11, RDP, VNC, FTP, MOSH 等等),和**Unix 命令**(bash, ls, cat, sed, grep, awk, rsync等等)适用于Windows桌面,在一个**单独便于携带的可执行文件里**,其工作独立于工具箱.MobaXterm对**个人使用免费**.你可以下载MobaXterm[在这里][3].
|
||||
|
||||
### DameWare SSH ###
|
||||
|
||||
我认为**DameWare SSH**是最好的免费SSH客户端.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/ssh.png)
|
||||
|
||||
这个免费工具是一个终端模拟器,可以让你实现从一个易用控制台的多种telnet和SSH连接.
|
||||
|
||||
-用一个带标签的控制台界面管理多方会话
|
||||
-在Windows文件系统中保存喜欢的会话
|
||||
-获取多个保存的证书集合,用于轻松登录不同的设备
|
||||
-使用telnet,SSH1和SSH2协议连接计算机和设备
|
||||
|
||||
你可以从[这个链接][4]下载 **DameWare SSH**
|
||||
|
||||
### SmarTTY ###
|
||||
|
||||
SmarTTY是一款免费的多标签SSH客户端,支持使用SCP命令及时复制文件和目录
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/smart.png)
|
||||
|
||||
大多数SSH服务器每次连接支持最多10个子会话.SmarTTY在这方面做得很好:没有烦人的多个窗口,不需要重新登录,仅仅打开一个新的标签页就可以开始了!
|
||||
|
||||
### Cygwin ###
|
||||
|
||||
Cygwin是一款GNU和开源工具的大杂烩,提供的功能近似一个Windows平台下的Linux.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/cyq.png)
|
||||
|
||||
**Cygwin**包括了一个Unix系统,集模拟库,cygwin.dll,GNU大量集合和其他被归类了的大量可选免费应用软件包.在这些安装包中,有高质量的编译器和其他软件开发工具,一个X11服务器,一套完整的X11开发套件,GNU emacs编辑器,Tex和LaTeX,openSSH(客户端和服务器),除此之外还有很多,包括在微软Windows下需要编译和使用PhysioToolkit软件的每一样东西.
|
||||
|
||||
读完我们的文章后,不知你中意哪一款SSH客户端?你可以留下你的评论,描述你喜欢的系统和选择的原因.当然,如果有另外的SSH客户端没有被本文列举出来,你可以帮助我们补充.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/anis/
|
||||
[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
|
||||
[2]:http://www.bitvise.com/download-area
|
||||
[3]:http://mobaxterm.mobatek.net/download.html
|
||||
[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM
|
||||
[5]:http://cygwin.com/packages/
|
@ -0,0 +1,115 @@
|
||||
5个有趣的Linux命令行技巧(第一部分)
|
||||
================================================================================
|
||||
你有将Linux物尽其用吗?对很多Linux用户来说,有很多看起来是技巧的有用特性。有些时候你会需要这些技巧。本文会帮助你更好得使用一些命令,发挥其更强大的功能。
|
||||
|
||||
![5个命令行技巧](http://www.tecmint.com/wp-content/uploads/2015/03/5-Command-Line-Tips.jpg)
|
||||
图1:5个命令行技巧
|
||||
|
||||
我们开始一个新的系列,在这里我们还会写一些技巧,并且用尽量小的篇幅写清楚。
|
||||
|
||||
### 1. 我们可以使用[`history`命令][1]来查看曾经运行过的命令。这里是一个`history`命令的示例输出。 ###
|
||||
|
||||
# history
|
||||
|
||||
![history命令例子](http://www.tecmint.com/wp-content/uploads/2015/03/history-command.gif)
|
||||
图2:history命令例子
|
||||
|
||||
从`history`命令输出看,很明显,命令的执行时间没有被打出来。有解决方法吗?有的!运行如下命令:
|
||||
|
||||
# HISTTIMEFORMAT="%d/%m/%y %T "
|
||||
# history
|
||||
|
||||
如果你想让这个修改永久生效,添加如下的一行内容到`~/.bashrc`文件中:
|
||||
|
||||
export HISTTIMEFORMAT="%d/%m/%y %T "
|
||||
|
||||
然后,在终端中运行:
|
||||
|
||||
# source ~/.bashrc
|
||||
|
||||
命令和选项的解释:
|
||||
|
||||
- history – 查看运行过的命令
|
||||
- HISTIMEFORMAT – 设置时间格式的环境变量
|
||||
- %d – 天
|
||||
- %m – 月
|
||||
- %y – 年
|
||||
- %T – 时间戳
|
||||
- source – 简而言之就是将文件内容发送给shell来执行
|
||||
- .bashrc – BASH以交互方式启动时运行的脚本文件
|
||||
|
||||
![history命令输出的日志](http://www.tecmint.com/wp-content/uploads/2015/03/History-Command-Logs.gif)
|
||||
图3:`history`命令输出的日志
|
||||
|
||||
### 2. 如何测试磁盘写入速度?一行`dd`命令脚本就可以实现。###
|
||||
|
||||
# dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img
|
||||
|
||||
![dd命令例子](http://www.tecmint.com/wp-content/uploads/2015/03/dd-Command-Example.gif)
|
||||
图4:`dd`命令例子
|
||||
|
||||
命令和选项的解释:
|
||||
|
||||
- dd – 转换和复制文件
|
||||
- if=/dev/zero – 指定输入文件,默认为stdin(标准输入)
|
||||
- of=/tmp/output.img – 指定输出文件,默认为stdout(标准输出)
|
||||
- bs – 一次读和写的大小,最大可以以MB为单位
|
||||
- count – 复制次数
|
||||
- conv – 使用逗号分隔的策略来转换文件(LCTT 译注:比如将大写字母转换成小写,echo AA | dd conv=lcase)
|
||||
- rm – 删除文件和目录
|
||||
- -rf – (-r) 递归地删除目录和其中的内容,(-f)强行删除而不输出确认信息
|
||||
|
||||
### 3. 你如何获取吃掉你磁盘空间的最大的6个文件?一个使用[`du`命令][2]的简单单行脚本即可实现,`du`命令主要用于获取文件的空间使用情况。###
|
||||
|
||||
# du -hsx * | sort -rh | head -6
|
||||
|
||||
![获取磁盘空间使用情况的方法](http://www.tecmint.com/wp-content/uploads/2015/03/check-disk-space-usage.gif)
|
||||
图5:获取磁盘空间使用情况的方法
|
||||
|
||||
命令和选项的解释:
|
||||
|
||||
- du – 估计文件的空间使用情况
|
||||
- -hsx – (-h)更易读的格式,(-s)汇总输出,(-x)跳过其他文件系统的文件
|
||||
- sort – 对文本文件按行排序
|
||||
- -rf – (-r)将比较的结果逆序输出,(-f)忽略大小写
|
||||
- head – 输出文件的头几行
|
||||
|
||||
### 4. 获取一个文件的详细状态信息,可以使用`stat`命令。 ###
|
||||
|
||||
# stat filename_ext (例如:stat abc.pdf)
|
||||
|
||||
![获取文件的详细信息](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Statistics.gif)
|
||||
图6:获取文件的详细信息
|
||||
|
||||
### 5. 最后一个技巧是为那些入门者准备的,如果你是有经验的用户,可能不需要它,除非你想从中寻找乐趣。入门者可能有Linux命令行恐惧症,下面的命令会随机显示一个man手册页。对入门者来说,好处是总会学到新的东西,而且不会厌倦。 ###
|
||||
|
||||
# man $(ls /bin | shuf | head -1)
|
||||
|
||||
![查看随机的man手册页](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif)
|
||||
图7:查看随机的man手册页
|
||||
|
||||
命令和选项的解释:
|
||||
|
||||
- man – Linux man手册
|
||||
- ls – 列出文件
|
||||
- /bin – 系统可执行文件的路径
|
||||
- shuf – 把输入内容按行随机打乱并输出
|
||||
- head – 输出文件的头几行
|
||||
|
||||
这就是所有的内容了。如果你知道任何类似的技巧,可以分享给我们,我们会用你的语言在Tecmint.com网站上发表出来。
|
||||
|
||||
如果你想分享任何技巧,但不想写成文章,可以发到tecmint[dot]com[at]gmail[dot]com,我们会将其包含在我们的文章中。不要忘记在下边评论框中留下有价值的反馈。保持联系。可以点赞或者将本文分享来帮助我们更好地传播内容。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/5-linux-command-line-tricks/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[goreliu](https://github.com/goreliu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
[1]:http://www.tecmint.com/history-command-examples/
|
||||
[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/
|
@ -0,0 +1,261 @@
|
||||
4个可以发送带主题、正文和附件的电子邮件的工具
|
||||
================================================================================
|
||||
今天的文章里我们会讲到一些使用Linux命令行工具来发送带附件的电子邮件的方法。它有很多用处,比如在应用程序所在服务器上,使用电子邮件发送一个档案过来,或者你可以在脚本中使用这些命令来做一些自动化操作。在本文的例子中,我们会使用foo.tar.gz文件作为附件。
|
||||
|
||||
有不同的命令行工具可以发送邮件,这里我分享几个多数用户会使用的工具,如`mailx`、`mutt`和`swaks`。
|
||||
|
||||
我们即将呈现的多数工具都是非常有名的,并且存在于多数Linux发行版默认的软件仓库中,你可以使用如下命令安装:
|
||||
|
||||
在 **Debian / Ubuntu** 系统
|
||||
|
||||
apt-get install mutt
|
||||
apt-get install swaks
|
||||
apt-get install mailx
|
||||
apt-get install sharutils
|
||||
|
||||
在基于Red Hat的系统,如 **CentOS** 或者 **Fedora**
|
||||
|
||||
yum install mutt
|
||||
yum install swaks
|
||||
yum install mailx
|
||||
yum install sharutils
|
||||
|
||||
### 1) 使用 mail / mailx ###
|
||||
|
||||
`mailx`工具在多数Linux发行版中是默认的邮件程序,现在已经支持发送附件了。如果它不在你的系统中,你可以使用上边的命令安装。有一点需要注意,老版本的mailx可能不支持发送附件,运行如下命令查看是否支持。
|
||||
|
||||
$ man mail
|
||||
|
||||
第一行看起来是这样的:
|
||||
|
||||
mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] [-A account] [-S variable[=value]] to-addr . . .
|
||||
|
||||
如果你看到它支持`-a`的选项(-a 文件名,将文件作为附件添加到邮件)和`-s`选项(-s 主题,指定邮件的主题),就是支持的。可以使用如下的几个例子发送邮件。
|
||||
|
||||
**a) 简单的邮件 **
|
||||
|
||||
运行`mail`命令,然后`mailx`会等待你输入邮件内容。你可以按回车来换行。当输入完成后,按Ctrl + D,`mailx`会显示EOT。
|
||||
|
||||
然后`mailx`会自动将邮件发送给收件人。
|
||||
|
||||
$ mail user@example.com
|
||||
|
||||
HI,
|
||||
Good Morning
|
||||
How are you
|
||||
EOT
|
||||
|
||||
**b) 发送有主题的邮件 **
|
||||
|
||||
$ echo "Email text" | mail -s "Test Subject" user@example.com
|
||||
|
||||
`-s`的用处是指定邮件的主题。
|
||||
|
||||
**c) 从文件中读取邮件内容并发送 **
|
||||
|
||||
$ mail -s "message send from file" user@example.com < /path/to/file
|
||||
|
||||
**d) 将从管道获取到的`echo`命令输出作为邮件内容发送 **
|
||||
|
||||
$ echo "This is message body" | mail -s "This is Subject" user@example.com
|
||||
|
||||
**e) 发送带附件的邮件 **
|
||||
|
||||
$ echo “Body with attachment "| mail -a foo.tar.gz -s "attached file" user@example.com
|
||||
|
||||
`-a`选项用于指定附件。
|
||||
|
||||
### 2) mutt ###
|
||||
|
||||
Mutt是类Unix系统上的一个文本界面邮件客户端。它有20多年的历史,在Linux历史中也是一个很重要的部分,它是最早支持进程打分和多线程处理的程序之一。按照如下的例子来发送邮件。
|
||||
|
||||
**a) 从文件中读取邮件的主题和正文,并发送 **
|
||||
|
||||
$ mutt -s "Testing from mutt" user@example.com < /tmp/message.txt
|
||||
|
||||
**b) 将从管道获取到的`echo`命令输出作为邮件内容发送 **
|
||||
|
||||
$ echo "This is the body" | mutt -s "Testing mutt" user@example.com
|
||||
|
||||
**c) 发送带附件的邮件 **
|
||||
|
||||
$ echo "This is the body" | mutt -s "Testing mutt" user@example.com -a /tmp/foo.tar.gz
|
||||
|
||||
**d) 发送带有多个附件的邮件 **
|
||||
|
||||
$ echo "This is the body" | mutt -s "Testing" user@example.com -a foo.tar.gz –a bar.tar.gz
|
||||
|
||||
### 3) swaks ###
|
||||
|
||||
Swaks(Swiss Army Knife,瑞士军刀)是SMTP的瑞士军刀,它功能强大、灵活、可编程、面向事务的SMTP测试工具,由John Jetmore开发和维护。你可以使用如下语法发送带附件的邮件:
|
||||
|
||||
$ swaks -t "foo@bar.com" --header "Subject: Subject" --body "Email Text" --attach foo.tar.gz
|
||||
|
||||
关于Swaks一个重要的事情是,它会为你显示整个邮件发送过程,所以如果你想调试邮件发送过程,它是一个非常有用的工具:
|
||||
|
||||
正如你看到的那样,它给你提供了邮件发送过程的所有细节,包括邮件接收服务器的功能支持、两个服务器之间的每一步交互。
|
||||
|
||||
### 4) uuencode ###
|
||||
|
||||
邮件传输系统最初是被设计来传送7位编码(类似ASCII)的内容的。这就意味这它是用来发送文本内容,而不能发会使用8个位的二进制内容(如程序文件或者图片)。`uuencode`(“UNIX to UNIX encoding”,UNIX之间使用的编码方式)程序用来解决这个限制。使用`uuencode`,发送端将二进制格式的转换成文本格式来传输,接收端再转换回去。
|
||||
|
||||
我们可以简单地使用`uuencode`和`mailx`或者`mutt`配合,来发送二进制内容,类似这样:
|
||||
|
||||
$ uuencode example.jpeg example.jpeg | mail user@example.com
|
||||
|
||||
### Shell脚本:解释如何发送邮件 ###
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
FROM=""
|
||||
SUBJECT=""
|
||||
ATTACHMENTS=""
|
||||
TO=""
|
||||
BODY=""
|
||||
|
||||
# 检查文件名对应的文件是否存在
|
||||
function check_files()
|
||||
{
|
||||
output_files=""
|
||||
for file in $1
|
||||
do
|
||||
if [ -s $file ]
|
||||
then
|
||||
output_files="${output_files}${file} "
|
||||
fi
|
||||
done
|
||||
echo $output_files
|
||||
}
|
||||
|
||||
echo "*********************"
|
||||
echo "E-mail sending script."
|
||||
echo "*********************"
|
||||
echo
|
||||
|
||||
# 读取用户输入的邮件地址
|
||||
while [ 1 ]
|
||||
do
|
||||
if [ ! $FROM ]
|
||||
then
|
||||
echo -n -e "Enter the e-mail address you wish to send mail from:\n[Enter] "
|
||||
else
|
||||
echo -n -e "The address you provided is not valid:\n[Enter] "
|
||||
fi
|
||||
|
||||
read FROM
|
||||
echo $FROM | grep -E '^.+@.+$' > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
# 读取用户输入的收件人地址
|
||||
while [ 1 ]
|
||||
do
|
||||
if [ ! $TO ]
|
||||
then
|
||||
echo -n -e "Enter the e-mail address you wish to send mail to:\n[Enter] "
|
||||
else
|
||||
echo -n -e "The address you provided is not valid:\n[Enter] "
|
||||
fi
|
||||
|
||||
read TO
|
||||
echo $TO | grep -E '^.+@.+$' > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
# 读取用户输入的邮件主题
|
||||
echo -n -e "Enter e-mail subject:\n[Enter] "
|
||||
read SUBJECT
|
||||
|
||||
echo
|
||||
|
||||
if [ "$SUBJECT" == "" ]
|
||||
then
|
||||
echo "Proceeding without the subject..."
|
||||
fi
|
||||
|
||||
# 读取作为附件的文件名
|
||||
echo -e "Provide the list of attachments. Separate names by space.
|
||||
If there are spaces in file name, quote file name with \"."
|
||||
read att
|
||||
|
||||
echo
|
||||
|
||||
# 确保文件名指向真实文件
|
||||
attachments=$(check_files "$att")
|
||||
echo "Attachments: $attachments"
|
||||
|
||||
for attachment in $attachments
|
||||
do
|
||||
ATTACHMENTS="$ATTACHMENTS-a $attachment "
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
# 读取完整的邮件正文
|
||||
echo "Enter message. To mark the end of message type ;; in new line."
|
||||
read line
|
||||
|
||||
while [ "$line" != ";;" ]
|
||||
do
|
||||
BODY="$BODY$line\n"
|
||||
read line
|
||||
done
|
||||
|
||||
SENDMAILCMD="mutt -e \"set from=$FROM\" -s \"$SUBJECT\" \
|
||||
$ATTACHMENTS -- \"$TO\" <<< \"$BODY\""
|
||||
echo $SENDMAILCMD
|
||||
|
||||
mutt -e "set from=$FROM" -s "$SUBJECT" $ATTACHMENTS -- $TO <<< $BODY
|
||||
|
||||
** 脚本输出 **
|
||||
|
||||
$ bash send_mail.sh
|
||||
*********************
|
||||
E-mail sending script.
|
||||
*********************
|
||||
|
||||
Enter the e-mail address you wish to send mail from:
|
||||
[Enter] test@gmail.com
|
||||
|
||||
Enter the e-mail address you wish to send mail to:
|
||||
[Enter] test@gmail.com
|
||||
|
||||
Enter e-mail subject:
|
||||
[Enter] Message subject
|
||||
|
||||
Provide the list of attachments. Separate names by space.
|
||||
If there are spaces in file name, quote file name with ".
|
||||
send_mail.sh
|
||||
|
||||
Attachments: send_mail.sh
|
||||
|
||||
Enter message. To mark the end of message type ;; in new line.
|
||||
This is a message
|
||||
text
|
||||
;;
|
||||
|
||||
### 总结 ###
|
||||
|
||||
有很多方法可以使用命令行/Shell脚本来发送邮件,我们只分享了其中4个类Unix系统可用的工具。希望你喜欢我们的文章,并且提供您的宝贵意见,让我们知道您想了解哪些新工具。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-shell-script/send-email-subject-body-attachment-linux/
|
||||
|
||||
作者:[Bobbin Zachariah][a]
|
||||
译者:[goreliu](https://github.com/goreliu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bobbin/
|
@ -0,0 +1,236 @@
|
||||
20个为桌面用户准备的令人惊叹的Docker容器
|
||||
================================================================================
|
||||
大家好,今天我们会列出一些很棒的运行在Docker容器中的桌面软件,我们可以在自己的桌面系统中运行它们。Docker是一个开源的项目,它提供可以将应用程序作为一个轻量级容器来打包、传送和运行的开放平台。它没有语言支持、框架或打包系统的限制,可以运行在任何地方,从小型的家用电脑到高端的服务器。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。它主要是由开发、运维工程师使用的,因为它简单、快速和方便,可以用来测试和辅助开发他们产品,但是我们也可以在桌面环境使用Docker,这样一些桌面程序可以开箱即用。
|
||||
|
||||
下边是20个非常棒的桌面软件docker镜像,我们可以使用Docker来运行。
|
||||
|
||||
### 1. Lynx ###
|
||||
|
||||
Lynx是一个一直以来最受欢迎的文本界面网页浏览器,它对多数Linux用户来说都很熟悉。它应该是现在还在日常和开发环境中被使用的最古老的网页浏览器了。可以使用如下命令运行Lync。
|
||||
|
||||
$ docker run -it \
|
||||
--name lynx \
|
||||
jess/lynx
|
||||
|
||||
### 2. Irssi ###
|
||||
|
||||
Irssi是一个非常棒的文本界面IRC客户端。可以使用如下命令运行Irssi。
|
||||
|
||||
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是一个令人惊叹的图形界面网页浏览器,由Google开发,它基于开源的Chromium项目。Google Chrome是一个被广泛使用的、快速安全的网页浏览器,经常上网的人会非常熟悉它。我们可以使用如下命令在Docker中运行Chrome。
|
||||
|
||||
$ 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浏览器 ###
|
||||
|
||||
Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以自由地在网络世界遨游,或者浏览被特定组织或者网络服务提供商封锁的网站。它会阻止有人通过监视我们的网络连接来窃取我们在网络上的一举一动以及我们的确切位置。运行如下命令运行Tor浏览器。
|
||||
|
||||
$ 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浏览器 ###
|
||||
|
||||
Firefox浏览器是一个自由并且开源的网页浏览器,它由Mozilla基金会开发。它使用Gecko和SpiderMonkey引擎。Firefox浏览器有很多新特性,并且它以性能和安全性著称。
|
||||
|
||||
$ docker run -d \
|
||||
--name firefox \
|
||||
-e DISPLAY=$DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
kennethkl/firefox
|
||||
|
||||
### 6. Rainbow Stream ###
|
||||
|
||||
Rainbow Stream是一个文本界面的Twitter客户端,有实时显示tweetstream、搜索、喜欢和更多其他特性,可以直接在终端使用。使用如下命令运行Rainbow Stream。
|
||||
|
||||
$ 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是一个用来给磁盘分区的开源软件。现在可以在Docker容器里享受分区的乐趣。可以使用如下命令运行gparted。
|
||||
|
||||
$ 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图片编辑器 ###
|
||||
|
||||
GIMP(Gnu Image Manipulation Program)是一个令人惊叹的Linux图片编辑软件。它是一个可以自由分发的可以处理照片修正、图像合成和图像创作等任务的工具。
|
||||
|
||||
$ docker run -it \
|
||||
--rm -e DISPLAY=$DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
jarfil/gimp-git
|
||||
|
||||
### 9. Thunderbird ###
|
||||
|
||||
Thunderbird是一个自由并且开源的电子邮件软件,它由Mozilla基金会开发和维护。它有众多一个电子邮件软件应该具有的功能。Thunderbird非常易于安装和定制。使用如下命令在Docker中运行Thunderbird。
|
||||
|
||||
$ 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是一个文本界面的电子邮件客户端,有很多很酷的功能,如颜色支持,IMAP、POP3、SMTP支持,邮件存储支持等。 使用如下命令运行Mutt。
|
||||
|
||||
$ 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是一个支持文字、语音和视频的即时通讯软件,它不是开源的,但在Linux下可以很棒地运行。我们同样可以在Docker中运行Skype,使用如下命令。
|
||||
|
||||
$ 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是一个漂亮并且高度可定制的终端模拟器,灵感来自经典的计算机。使用如下命令运行Cathode。
|
||||
|
||||
$ docker run -it \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e DISPLAY=unix$DISPLAY \
|
||||
--name cathode \
|
||||
jess/1995
|
||||
|
||||
### 13. LibreOffice ###
|
||||
|
||||
LibreOffice是一个功能强大的办公套件,它是自由和开源的,现在由The Document基金会维护。它有干净的界面和强大的功能,让我们释放创造力和提升生产力。LibreOffice将数个应用程序集成在一起,是市面上最强大的自由并且开源的办公套件。
|
||||
$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可以即时访问数百万的歌曲,从经典老歌到最新单曲。可以使用如下命令在Docker中听我们最喜欢的歌曲。
|
||||
|
||||
$ 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是一个自由并且开源的跨平台软件,用来录制和编辑音频。Audacity可以用来做所有类型音频(例如podcast)的后期处理,如归一化、调整、淡入淡出。使用如下命令来运行Audacity。
|
||||
|
||||
$ 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是一个集成开发环境。它包含基本的工作区和用来定制环境的可扩展插件系统。它在Java开发者中很流行。
|
||||
|
||||
$ docker run -v ~/workspace/:/home/eclipse/workspace/ \
|
||||
-e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
|
||||
-d leesah/eclipse
|
||||
|
||||
### 17. VLC媒体播放器 ###
|
||||
|
||||
VLC是一个自由并且开源的跨平台多媒体播放器,可以播放本地文件、DVD、CD、VCD和各种流媒体。VLC由VideoLAN组织开发和维护。使用如下命令运行VLC。
|
||||
|
||||
$ 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编辑器 ###
|
||||
|
||||
Vim是一个高度可配置的文本界面文字编辑器,为高效的文本编辑而生。它是预装在多数UNIX系统中的vi编辑器的改进版本。
|
||||
|
||||
$ docker run -i -t --name my-vim -v ~/:/home/dev/src haron/vim
|
||||
|
||||
### 19. Inkscape ###
|
||||
|
||||
Inkscape是一个自由并且开源的矢量图形编辑器。它可以创建、编辑矢量图形,如插图、图示、线条艺术、图表、徽标以及更复杂的绘画。Inkscape使用的主要矢量图形格式是SVG 1.1版本。它也可以导入和导出一些其他的格式,但实际编辑使用的还是SVG格式。
|
||||
|
||||
$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是一个自由的FTP解决方案,支持FTP、SFTP、FTPS协议。它的客户端是一个功能强大的文件管理工具。它是一个很棒的高度可靠和易用的开源FTP解决方案。
|
||||
|
||||
$ 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
|
||||
|
||||
### 总结 ###
|
||||
|
||||
使用Docker运行桌面软件真的是很棒的体验。Docker是一个快速、简单的开发平台,适合从家里、办公室到生产环境里传送和开发软件的场景。使用Docker运行桌面软件是试用而不将其安装到自己实体机文件系统中的很酷的方法。如果你有任何问题、评论或者反馈,清写在下方的评论框中,让我们知道哪些是需要增加或者改进的。谢谢!享受Docker吧 :-)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/how-tos/20-docker-containers-desktop-user/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[goreliu](https://github.com/goreliu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
@ -0,0 +1,115 @@
|
||||
Linux有问必答——nginx网络服务器上如何阻挡特定用户代理
|
||||
================================================================================
|
||||
> **问题**: 我注意到有一些机器人经常访问我nginx驱动的网站,并且进行一些攻击性的扫描,导致消耗掉了我的网络服务器的大量资源。我一直尝试着通过用户代理符串来阻挡这些机器人。我怎样才能在nginx网络服务器上阻挡掉特定的用户代理呢?
|
||||
|
||||
现代互联网滋生了大量各种各样的恶意机器人和网络爬虫,比如像恶意软件机器人、垃圾邮件程序或内容刮刀,这些恶意工具一直偷偷摸摸地扫描你的网站,干些诸如检测潜在网站漏洞、收获电子邮件地址,或者只是从你的网站偷取内容。大多数机器人能够通过它们的“用户代理”签名字符串来识别。
|
||||
|
||||
作为第一道防线,你可以尝试通过将这些机器人的用户代理字符串添加入robots.txt文件来阻止这些恶意软件机器人访问你的网站。但是,很不幸的是,该操作只针对那些“行为良好”的机器人,这些机器人被设计遵循robots.txt的规范。许多恶意软件机器人可以很容易地忽略掉robots.txt,然后随意扫描你的网站。
|
||||
|
||||
另一个用以阻挡特定机器人的途径,就是配置你的网络服务器,通过特定的用户代理字符串拒绝要求提供内容的请求。本文就是说明如何**在nginx网络服务器上阻挡特定的用户代理**。
|
||||
|
||||
### 在Nginx中将特定用户代理列入黑名单 ###
|
||||
|
||||
要配置用户代理阻挡列表,请打开你的网站的nginx配置文件,找到服务器定义部分。该文件可能会放在不同的地方,这取决于你的nginx配置或Linux版本(如,/etc/nginx/nginx.conf,/etc/nginx/sites-enabled/<your-site>,/usr/local/nginx/conf/nginx.conf,/etc/nginx/conf.d/<your-site>)。
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name xmodulo.com;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
....
|
||||
}
|
||||
|
||||
在打开该配置文件并找到 server 部分后,添加以下 if 声明到该部分内的某个地方。
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name xmodulo.com;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# case sensitive matching
|
||||
if ($http_user_agent ~ (Antivirx|Arian) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
# case insensitive matching
|
||||
if ($http_user_agent ~* (netcrawl|npbot|malicious)) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
....
|
||||
}
|
||||
|
||||
如你所想,这些 if 声明使用正则表达式匹配了任意不良用户字符串,并向匹配的对象返回403 HTTP状态码。
|
||||
$http_user_agent是HTTP请求的一个包含有用户代理字符串的变量。‘~’操作符针对用户代理字符串进行大小写敏感匹配,而‘~*’操作符则进行大小写不敏感匹配。‘|’操作符是逻辑或,因此,你可以在 if 声明中放入众多的用户代理关键字,然后将它们全部阻挡掉。
|
||||
|
||||
在修改配置文件后,你必须重新加载nginx以激活阻挡:
|
||||
|
||||
$ sudo /path/to/nginx -s reload
|
||||
|
||||
你可以通过使用带有 “--user-agent” 选项的 wget 测试用户代理阻挡。
|
||||
|
||||
$ wget --user-agent "malicious bot" http://<nginx-ip-address>
|
||||
|
||||
![](https://farm6.staticflickr.com/5333/17434036358_ef139a6b59_b.jpg)
|
||||
|
||||
### 管理Nginx中的用户代理黑名单 ###
|
||||
|
||||
目前为止,我已经展示了在nginx中如何阻挡一些用户代理的HTTP请求。如果你有学多不同类型的网络爬虫机器人要阻挡,又该怎么办呢?
|
||||
|
||||
由于用户代理黑名单会增长得很大,所以将它们放在nginx的server部分不是个好点子。取而代之的是,你可以创建一个独立的文件,在该文件中列出所有被阻挡的用户代理。例如,让我们创建/etc/nginx/useragent.rules,并定义以下面的格式定义所有被阻挡的用户代理的图谱。
|
||||
|
||||
$ sudo vi /etc/nginx/useragent.rules
|
||||
|
||||
----------
|
||||
|
||||
map $http_user_agent $badagent {
|
||||
default 0;
|
||||
~*malicious 1;
|
||||
~*backdoor 1;
|
||||
~*netcrawler 1;
|
||||
~Antivirx 1;
|
||||
~Arian 1;
|
||||
~webbandit 1;
|
||||
}
|
||||
|
||||
与先前的配置类似,‘~*’将匹配以大小写不敏感的方式匹配关键字,而‘~’将使用大小写敏感的正则表达式匹配关键字。“default 0”行所表达的意思是,任何其它文件中未被列出的用户代理将被允许。
|
||||
|
||||
接下来,打开你的网站的nginx配置文件,找到里面包含 http 的部分,然后添加以下行到 http 部分某个位置。
|
||||
|
||||
http {
|
||||
.....
|
||||
include /etc/nginx/useragent.rules
|
||||
}
|
||||
|
||||
注意,该 include 声明必须出现在 server 部分之前(这就是为什么我们将它添加到了 http 部分里)。
|
||||
|
||||
现在,打开nginx配置定义你的服务器的部分,添加以下 if 声明:
|
||||
|
||||
server {
|
||||
....
|
||||
|
||||
if ($badagent) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
....
|
||||
}
|
||||
|
||||
最后,重新加载nginx。
|
||||
|
||||
$ sudo /path/to/nginx -s reload
|
||||
|
||||
现在,任何包含有/etc/nginx/useragent.rules中列出的关键字的用户代理将被nginx自动禁止。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
@ -1,18 +1,18 @@
|
||||
Linux FAQs with Answers--How to fix “Encountered a section with no Package: header” error on Raspbian
|
||||
Linux 有问必答--如何修复 Raspbian 上的 “Encountered a section with no Package: header” 错误
|
||||
================================================================================
|
||||
> **Question**: I installed fresh Rasbian on Raspberry Pi. But when I tried to update APT package index by running sudo apt-get update, it throws the following error:
|
||||
> **问题**: 我在 Raspberry Pi 上安装新版的 Rasbian。但当我使用 sudo apt-get update 命令更新 APT 软件包索引的时候,它抛出下面的错误:
|
||||
|
||||
E: Encountered a section with no Package: header
|
||||
E: Problem with MergeList /var/lib/dpkg/status
|
||||
E: The package lists or status file could not be parsed or opened.
|
||||
|
||||
> I then cannot install any package on Raspbian. How can I solve this error?
|
||||
> 之后我不能在 Raspbian 上安装任何软件包。我怎样才能解决这个错误?
|
||||
|
||||
![](https://farm8.staticflickr.com/7704/17445484636_05ba81722f_c.jpg)
|
||||
|
||||
The error saying "Problem with MergeList /var/lib/dpkg/status" indicates that the status file got corrupted for some reason, and so cannot be parsed. This status file contains information about installed deb packages, and thus needs to be carefully backed up.
|
||||
错误说 "Problem with MergeList /var/lib/dpkg/status" 表示由于某些原因状态文件损坏了,因此无法解释。这个状态文件包括了已经安装的 deb 软件包的信息,因此需要小心备份。
|
||||
|
||||
In this case, since this is freshly installed Raspbian, you can safely remove the status file, and re-generate it as follows.
|
||||
在这种情况下,由于这是新安装的 Raspbian,你可以安全地删除状态文件,然后用下面的命令重新生成。
|
||||
|
||||
$ sudo rm /var/lib/dpkg/status
|
||||
$ sudo touch /var/lib/dpkg/status
|
||||
@ -23,7 +23,7 @@ In this case, since this is freshly installed Raspbian, you can safely remove th
|
||||
via: http://ask.xmodulo.com/encountered-section-with-no-package-header-error.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
@ -1,22 +1,22 @@
|
||||
Linux FAQs with Answers--How to fix “fatal error: security/pam_modules.h: No such file or directory”
|
||||
Linux 有问必答--如何修复 “fatal error: security/pam_modules.h: No such file or directory”
|
||||
================================================================================
|
||||
> **Question**: I was trying to compile a program on [insert your Linux distro], but was getting the following compile error:
|
||||
> **问题**: 我尝试在 [插入你的 Linux 发行版] 上编译程序,但是出现下面的编译错误:
|
||||
>
|
||||
> "pam_otpw.c:27:34: fatal error: security/pam_modules.h: No such file or directory"
|
||||
>
|
||||
> How can I fix this error?
|
||||
> 我怎样才能修复这个错误?
|
||||
|
||||
The missing header file 'security/pam_modules.h' is part of development files for libpam, a PAM (Pluggable Authentication Modules) library. Thus to fix this error, you need to install libpam development package, as described below.
|
||||
缺失的头文件 'security/pam_modules.h' 是 libpam 开发版的一部分,一个 PAM(Pluggable Authentication Modules:插入式验证模块)库。因此要修复这个错误,你需要安装 libpam 开发包,如下所示。
|
||||
|
||||
On Debian, Ubuntu or Linux Mint:
|
||||
对于 Debian、 Ubuntu 或者 Linux Mint:
|
||||
|
||||
$ sudo apt-get install libpam0g-dev
|
||||
|
||||
On CentOS, Fedora or RHEL:
|
||||
对与 CentOS、 Fedora 或者 RHEL:
|
||||
|
||||
$ sudo yum install gcc pam-devel
|
||||
|
||||
Now verify that the missing header file is installed under /usr/include/security.
|
||||
现在验证缺失的头文件是否安装到了 /usr/include/security。
|
||||
|
||||
![](https://farm8.staticflickr.com/7751/16819069693_fa961f0d40_b.jpg)
|
||||
|
||||
@ -25,7 +25,7 @@ Now verify that the missing header file is installed under /usr/include/security
|
||||
via: http://ask.xmodulo.com/fatal-error-security-pam-modules.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user