From 686b2855ac1c72f760ac469f12728e08e1f216a2 Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Sun, 16 Aug 2015 13:55:13 +0800 Subject: [PATCH 01/13] translated shellinabox--A Web based AJAX translated shellinabox--A Web based AJAX Terminal Emulator --- ...box--A Web based AJAX Terminal Emulator.md | 159 ------------------ ...box--A Web based AJAX Terminal Emulator.md | 157 +++++++++++++++++ 2 files changed, 157 insertions(+), 159 deletions(-) delete mode 100644 sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md create mode 100644 translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md diff --git a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md deleted file mode 100644 index c6f44a30f5..0000000000 --- a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md +++ /dev/null @@ -1,159 +0,0 @@ -translating by xiaoyu33 - -shellinabox – A Web based AJAX Terminal Emulator -================================================================================ -### About shellinabox ### - -Greetings Unixmen readers! - -We, usually, access any remote servers using well known communication tools like OpenSSH, and Putty etc. But, one important thing is we can’t access the remote systems using those tools behind a Firewall or the firewalls that allow only HTTPS traffic. No worries! We, still, have some options to access your remote systems even if you’re behind a firewall. And also, you don’t need to install any communications tools like OpenSSH or Putty. All you need is only a modern JavaScript and CSS enabled browser. And you don’t need to install any plugins or third party softwares either. - -Meet **Shell In A Box**, pronounced as **shellinabox**, a free, open source, web based AJAX Terminal emulator developed by **Markus Gutschke**. It uses AJAX technology to provide the look and feel of a native shell via a web browser. The **shellinaboxd** daemon implements a webserver that listens on the specified port. The web server publishes one or more services that will be displayed in a VT100 emulator implemented as an AJAX web application. By default, the port is 4200. You can change the default port to any random port number of your choice. After installing shellinabox on all your remote servers that you want to access them from your local system, open up the web browser and navigate to: **http://IP-Address:4200/**. Enter your user name and password and start using your remote system’s shell. Seems interesting, isn’t it? Indeed! - -**Disclaimer**: - -Shellinabox is not a ssh client or any sort of security software. It is just a application that emulates a remote system’s shell via a web browser. Also, It has nothing to do with SSH in anyway. It’s not a bullet proof security way to remote your systems. It is just one of the easiest methods so far. You should not run it on any public network for any reason. - -### Install shellinabox ### - -#### In Debian/Ubuntu based systems: #### - -shellinabox is available in the default repositories. So, you can install it using command: - - $ sudo apt-get install shellinabox - -#### In RHEL/CentOS systems: #### - -First, install EPEL repository using command: - - # yum install epel-release - -Then, install shellinabox using command: - - # yum install shellinabox - -Done! - -### Configure shellinabox ### - -As I mentioned before, shellinabox listens on port **4200** by default. You can change this port to any random number of your choice to make it difficult to guess by anyone. - -The shellinabox config file is located in **/etc/default/shellinabox** file by default in Debian/Ubuntu systems. In RHEL/CentOS/Fedora, the default location of config file is **/etc/sysconfig/shellinaboxd**. - -If you want to change the default port, - -In Debian/Ubuntu: - - $ sudo vi /etc/default/shellinabox - -In RHEL/CentOS/Fedora: - - # vi /etc/sysconfig/shellinaboxd - -Change your port to any random number. Since I am testing it on my local network, I use the default values. - - # Shell in a box daemon configuration - # For details see shellinaboxd man page - - # Basic options - USER=shellinabox - GROUP=shellinabox - CERTDIR=/var/lib/shellinabox - PORT=4200 - OPTS="--disable-ssl-menu -s /:LOGIN" - - # Additional examples with custom options: - - # Fancy configuration with right-click menu choice for black-on-white: - # OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN" - - # Simple configuration for running it as an SSH console with SSL disabled: - # OPTS="-t -s /:SSH:host.example.com" - -Restart shelinabox service. - -**In Debian/Ubuntu:** - - $ sudo systemctl restart shellinabox - -Or - - $ sudo service shellinabox restart - -In RHEL/CentOS systems run the following command to start shellinaboxd service automatically on every reboot. - - # systemctl enable shellinaboxd - -Or - - # chkconfig shellinaboxd on - -Remember to open up port **4200** or any port that you assign if you are running a firewall. - -For example, in RHEL/CentOS systems, you can allow the port as shown below. - - # firewall-cmd --permanent --add-port=4200/tcp - ----------- - - # firewall-cmd --reload - -### Usage ### - -Now, go to your client systems, open up the web browser and navigate to: **https://ip-address-of-remote-servers:4200**. - -**Note**: Mention the correct port if you have changed it. - -You’ll get a warning message of certificate issue. Accept the certificate and go on. - -![Privacy error - Google Chrome_001](http://www.unixmen.com/wp-content/uploads/2015/08/Privacy-error-Google-Chrome_001.jpg) - -Enter your remote system’s username and password. Now, you’ll be able to access the remote system’s shell right from the browser itself. - -![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg) - -You can get some additional menu options which might be useful by right clicking on the empty space of your browser. - -![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg) - -From now on, you can do whatever you want to do in your remote server from the local system’s web browser. - -Once you done, type **exit** in the shell. - -To connect again to the remote system, click the **Connect** button and then type the user name and password of your remote server. - -![Shell In A Box - Google Chrome_005](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_005.jpg) - -For more details about shellinabox, type the following command in your Terminal: - - # man shellinabox - -Or - - # shellinaboxd -help - -Also, refer the [shellinabox wiki page][1] for comprehensive usage details. - -### Conclusion ### - -Like I mentioned before, web-based SSH tools are very useful if you’re running servers behind a Firewall. There are many web-based ssh tools, but Shellinabox is pretty simple and useful tool to emulate a remote system’s shell from anywhere in your network. Since, it is browser based, you can access your remote server from any device as long as you have a JavaScript and CSS enabled browser. - -That’s all for now. Have a good day! - -#### Reference link: #### - -- [shellinabox website][2] - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man -[2]:https://code.google.com/p/shellinabox/ diff --git a/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md new file mode 100644 index 0000000000..71acf990c1 --- /dev/null +++ b/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md @@ -0,0 +1,157 @@ +shellinabox–基于Web的Ajax的终端模拟器安装及使用详解 +================================================================================ +### shellinabox简介 ### + +unixmen的读者朋友们,你们好! + +通常情况下,我们访问任何远程服务器时,使用常见的通信工具如OpenSSH和Putty等。但是如果我们在防火墙外,或者防火墙只允许HTTPS流量才能通过,那么我们就不能再使用这些工具来访问远程系统了。不用担心!即使你在防火墙后面,我们依然有办法来访问你的远程系统。而且,你不需要安装任何类似于OpenSSH或Putty的通讯工具。你只需要有一个支持JavaScript和CSS的现代浏览器。并且你不用安装任何插件或第三方应用软件。 + +Meet **Shell In A Box**,发音是**shellinabox**,是由**Markus Gutschke**开发的一款免费的,开源的,基于Web的Ajax的终端模拟器。它使用AJAX技术,通过Web浏览器提供的外观和感觉像一个原生壳。该**shellinaboxd**的守护进程实现了一个Web服务器,能够侦听指定的端口。Web服务器发布一个或多个服务,这些服务将在VT100模拟器实现为一个AJAX的Web应用程序显示。默认情况下,端口为4200。你可以更改默认端口到任意选择的任意端口号。在你的远程服务器安装shellinabox以后,如果你想从本地系统接入,打开Web浏览器并导航到:**http://IP-Address:4200/**。输入你的用户名和密码,然后就可以开始使用你远程系统的外壳。看起来很有趣,不是吗?确实! + +**免责声明**: + +shellinabox不是SSH客户端或任何安全软件。它仅仅是一个应用程序,能够通过Web浏览器模拟一个远程系统的壳。同时,它和SSH没有任何关系。这不是防弹的安全的方式来远程控制您的系统。这只是迄今为止最简单的方法之一。无论什么原因,你都不应该在任何公共网络上运行它。 + +### 安装shellinabox ### + +#### 在Debian / Ubuntu系统上: #### + +shellinabox在默认库是可用的。所以,你可以使用命令来安装它: + + $ sudo apt-get install shellinabox + +#### 在RHEL / CentOS系统上: #### + +首先,使用命令安装EPEL仓库: + + # yum install epel-release + +然后,使用命令安装shellinabox: + + # yum install shellinabox + +完成! + +### 配置shellinabox ### + +正如我之前提到的,shellinabox侦听端口默认为**4200**。你可以将此端口更改为任意数字,以防别人猜到。 + +在Debian/Ubuntu系统上shellinabox配置文件的默认位置是**/etc/default/shellinabox**。在RHEL/CentOS/Fedora上,默认位置在**/etc/sysconfig/shellinaboxd**。 + +如果要更改默认端口, + +在Debian / Ubuntu: + + $ sudo vi /etc/default/shellinabox + +在RHEL / CentOS / Fedora: + + # vi /etc/sysconfig/shellinaboxd + +更改你的端口到任意数量。因为我在本地网络上测试它,所以我使用默认值。 + + # Shell in a box daemon configuration + # For details see shellinaboxd man page + + # Basic options + USER=shellinabox + GROUP=shellinabox + CERTDIR=/var/lib/shellinabox + PORT=4200 + OPTS="--disable-ssl-menu -s /:LOGIN" + + # Additional examples with custom options: + + # Fancy configuration with right-click menu choice for black-on-white: + # OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN" + + # Simple configuration for running it as an SSH console with SSL disabled: + # OPTS="-t -s /:SSH:host.example.com" + +重启shelinabox服务。 + +**在Debian/Ubuntu:** + + $ sudo systemctl restart shellinabox + +或者 + + $ sudo service shellinabox restart + +在RHEL/CentOS系统,运行下面的命令能在每次重启时自动启动shellinaboxd服务 + + # systemctl enable shellinaboxd + +或者 + + # chkconfig shellinaboxd on + +如果你正在运行一个防火墙,记得要打开端口**4200**或任何你指定的端口。 + +例如,在RHEL/CentOS系统,你可以如下图所示允许端口。 + + # firewall-cmd --permanent --add-port=4200/tcp + +---------- + + # firewall-cmd --reload + +### 使用 ### + +现在,去你的客户端系统,打开Web浏览器并导航到:**https://ip-address-of-remote-servers:4200**。 + +**注意**:如果你改变了端口,请填写修改后的端口。 + +你会得到一个证书问题的警告信息。接受该证书并继续。 + +![Privacy error - Google Chrome_001](http://www.unixmen.com/wp-content/uploads/2015/08/Privacy-error-Google-Chrome_001.jpg) + +输入远程系统的用户名和密码。现在,您就能够从浏览器本身访问远程系统的外壳。 + +![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg) + +右键点击你浏览器的空白位置。你可以得到一些有很有用的额外的菜单选项。 + +![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg) + +从现在开始,你可以通过本地系统的Web浏览器在你的远程服务器随意操作。 + +当你完成时,记得点击**退出**。 + +当再次连接到远程系统时,单击**连接**按钮,然后输入远程服务器的用户名和密码。 + +![Shell In A Box - Google Chrome_005](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_005.jpg) + +如果想了解shellinabox更多细节,在你的终端键入下面的命令: + + # man shellinabox + +或者 + + # shellinaboxd -help + +同时,参考[shellinabox 在wiki页面的介绍][1],来了解shellinabox的综合使用细节。 + +### 结论 ### + +正如我之前提到的,如果你在服务器运行在防火墙后面,那么基于web的SSH工具是非常有用的。有许多基于web的SSH工具,但shellinabox是非常简单并且有用的工具,能从的网络上的任何地方,模拟一个远程系统的壳。因为它是基于浏览器的,所以你可以从任何设备访问您的远程服务器,只要你有一个支持JavaScript和CSS的浏览器。 + +就这些啦。祝你今天有个好心情! + +#### 参考链接: #### + +- [shellinabox website][2] + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ + +作者:[SK][a] +译者:[xiaoyu33](https://github.com/xiaoyu33) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man +[2]:https://code.google.com/p/shellinabox/ From a545ebe14d5e8611fdcc905db5296ed53a2a4c97 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 16 Aug 2015 16:37:23 +0800 Subject: [PATCH 02/13] [Translating] tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md --- ...Shell Scripting to Automate Linux System Maintenance Tasks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md b/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md index bcd058611a..6b534423e7 100644 --- a/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md +++ b/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md @@ -1,3 +1,4 @@ +ictlyh Translating Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks ================================================================================ Some time ago I read that one of the distinguishing characteristics of an effective system administrator / engineer is laziness. It seemed a little contradictory at first but the author then proceeded to explain why: From ef473497499f650a03962097e990cb74babe2f27 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 16 Aug 2015 18:49:19 +0800 Subject: [PATCH 03/13] PUB:20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux @GOLinux --- ...mportError--No module named wxversion' on Linux.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md (75%) diff --git a/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md b/published/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md similarity index 75% rename from translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md rename to published/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md index 2a937daeff..4b3eaf0aa0 100644 --- a/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md +++ b/published/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md @@ -1,7 +1,7 @@ -Linux有问必答——如何修复Linux上的“ImportError: No module named wxversion”错误 +Linux有问必答:如何修复“ImportError: No module named wxversion”错误 ================================================================================ -> **问题** 我试着在[你的Linux发行版]上运行一个Python应用,但是我得到了这个错误"ImportError: No module named wxversion."。我怎样才能解决Python程序中的这个错误呢? +> **问题** 我试着在[某某 Linux 发行版]上运行一个 Python 应用,但是我得到了这个错误“ImportError: No module named wxversion.”。我怎样才能解决 Python 程序中的这个错误呢? Looking for python... 2.7.9 - Traceback (most recent call last): File "/home/dev/playonlinux/python/check_python.py", line 1, in @@ -10,7 +10,8 @@ Linux有问必答——如何修复Linux上的“ImportError: No module named wx failed tests 该错误表明,你的Python应用是基于GUI的,依赖于一个名为wxPython的缺失模块。[wxPython][1]是一个用于wxWidgets GUI库的Python扩展模块,普遍被C++程序员用来设计GUI应用。该wxPython扩展允许Python开发者在任何Python应用中方便地设计和整合GUI。 -To solve this import error, you need to install wxPython on your Linux, as described below. + +摇解决这个 import 错误,你需要在你的 Linux 上安装 wxPython,如下: ### 安装wxPython到Debian,Ubuntu或Linux Mint ### @@ -40,10 +41,10 @@ via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni [1]:http://wxpython.org/ -[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[2]:https://linux.cn/article-2324-1.html From 3b29580b83bb95018b748cea58036b45882bc9cc Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 16 Aug 2015 19:07:46 +0800 Subject: [PATCH 04/13] PUB:20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser @strugglingyouth --- ...vity and Check Memory Usages of Browser.md | 57 +++++++++++-------- 1 file changed, 32 insertions(+), 25 deletions(-) rename {translated/tech => published}/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md (72%) diff --git a/translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md b/published/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md similarity index 72% rename from translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md rename to published/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md index 02805f62ff..97dd874c43 100644 --- a/translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md +++ b/published/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md @@ -1,47 +1,52 @@ - -用 CD 创建 ISO,观察用户活动和检查浏览器内存的技巧 +一些 Linux 小技巧 ================================================================================ 我已经写过 [Linux 提示和技巧][1] 系列的一篇文章。写这篇文章的目的是让你知道这些小技巧可以有效地管理你的系统/服务器。 ![Create Cdrom ISO Image and Monitor Users in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/creating-cdrom-iso-watch-users-in-linux.jpg) -在Linux中创建 Cdrom ISO 镜像和监控用户 +*在Linux中创建 Cdrom ISO 镜像和监控用户* -在这篇文章中,我们将看到如何使用 CD/DVD 驱动器中加载到的内容来创建 ISO 镜像,打开随机手册页学习,看到登录用户的详细情况和查看浏览器内存使用量,而所有这些完全使用本地工具/命令无任何第三方应用程序/组件。让我们开始吧... +在这篇文章中,我们将看到如何使用 CD/DVD 驱动器中载入的碟片来创建 ISO 镜像;打开随机手册页学习;看到登录用户的详细情况和查看浏览器内存使用量,而所有这些完全使用本地工具/命令,无需任何第三方应用程序/组件。让我们开始吧…… -### 用 CD 中创建 ISO 映像 ### +### 用 CD 碟片创建 ISO 映像 ### 我们经常需要备份/复制 CD/DVD 的内容。如果你是在 Linux 平台上,不需要任何额外的软件。所有需要的是进入 Linux 终端。 要从 CD/DVD 上创建 ISO 镜像,你需要做两件事。第一件事就是需要找到CD/DVD 驱动器的名称。要找到 CD/DVD 驱动器的名称,可以使用以下三种方法。 -**1. 从终端/控制台上运行 lsblk 命令(单个驱动器).** +**1. 从终端/控制台上运行 lsblk 命令(列出块设备)** $ lsblk ![Find Block Devices in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Block-Devices.png) -找驱动器 +*找块设备* -**2.要查看有关 CD-ROM 的信息,可以使用以下命令。** +从上图可以看到,sr0 就是你的 cdrom (即 /dev/sr0 )。 + +**2. 要查看有关 CD-ROM 的信息,可以使用以下命令** $ less /proc/sys/dev/cdrom/info ![Check Cdrom Information](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Cdrom-Inforamtion.png) -检查 Cdrom 信息 +*检查 Cdrom 信息* + +从上图可以看到, 设备名称是 sr0 (即 /dev/sr0)。 **3. 使用 [dmesg 命令][2] 也会得到相同的信息,并使用 egrep 来自定义输出。** -命令 ‘dmesg‘ 命令的输出/控制内核缓冲区信息。‘egrep‘ 命令输出匹配到的行。选项 -i 和 -color 与 egrep 连用时会忽略大小写,并高亮显示匹配的字符串。 +命令 ‘dmesg‘ 命令的输出/控制内核缓冲区信息。‘egrep‘ 命令输出匹配到的行。egrep 使用选项 -i 和 -color 时会忽略大小写,并高亮显示匹配的字符串。 $ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' ![Find Device Information](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Device-Information.png) -查找设备信息 +*查找设备信息* -一旦知道 CD/DVD 的名称后,在 Linux 上你可以用下面的命令来创建 ISO 镜像。 +从上图可以看到,设备名称是 sr0 (即 /dev/sr0)。 + +一旦知道 CD/DVD 的名称后,在 Linux 上你可以用下面的命令来创建 ISO 镜像(你看,只需要 cat 即可!)。 $ cat /dev/sr0 > /path/to/output/folder/iso_name.iso @@ -49,11 +54,11 @@ ![Create ISO Image of CDROM in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Create-ISO-Image-of-CDROM.png) -创建 CDROM 的 ISO 映像 +*创建 CDROM 的 ISO 映像* ### 随机打开一个手册页 ### -如果你是 Linux 新人并想学习使用命令行开关,这个修改是为你做的。把下面的代码行添加在`〜/ .bashrc`文件的末尾。 +如果你是 Linux 新人并想学习使用命令行开关,这个技巧就是给你的。把下面的代码行添加在`〜/ .bashrc`文件的末尾。 /use/bin/man $(ls /bin | shuf | head -1) @@ -63,17 +68,19 @@ ![LoadKeys Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/LoadKeys-Man-Pages.png) -LoadKeys 手册页 +*LoadKeys 手册页* ![Zgrep Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/Zgrep-Man-Pages.png) -Zgrep 手册页 +*Zgrep 手册页* + +希望你知道如何退出手册页浏览——如果你已经厌烦了每次都看到手册页,你可以删除你添加到 `.bashrc`文件中的那几行。 ### 查看登录用户的状态 ### 了解其他用户正在共享服务器上做什么。 -一般情况下,你是共享的 Linux 服务器的用户或管理员的。如果你担心自己服务器的安全并想要查看哪些用户在做什么,你可以使用命令 'w'。 +一般情况下,你是共享的 Linux 服务器的用户或管理员的。如果你担心自己服务器的安全并想要查看哪些用户在做什么,你可以使用命令 `w`。 这个命令可以让你知道是否有人在执行恶意代码或篡改服务器,让他停下或使用其他方法。'w' 是查看登录用户状态的首选方式。 @@ -83,33 +90,33 @@ Zgrep 手册页 ![Check Linux User Activity](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Linux-User-Activity.png) -检查 Linux 用户状态 +*检查 Linux 用户状态* ### 查看浏览器的内存使用状况 ### -最近有不少谈论关于 Google-chrome 内存使用量。如果你想知道一个浏览器的内存用量,你可以列出进程名,PID 和它的使用情况。要检查浏览器的内存使用情况,只需在地址栏输入 “about:memory” 不要带引号。 +最近有不少谈论关于 Google-chrome 的内存使用量。如要检查浏览器的内存使用情况,只需在地址栏输入 “about:memory”,不要带引号。 我已经在 Google-Chrome 和 Mozilla 的 Firefox 网页浏览器进行了测试。你可以查看任何浏览器,如果它工作得很好,你可能会承认我们在下面的评论。你也可以杀死浏览器进程在 Linux 终端的进程/服务中。 -在 Google Chrome 中,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 +在 Google Chrome 中,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 ![Check Chrome Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Chrome-Memory-Usage.png) -查看 Chrome 内存使用状况 +*查看 Chrome 内存使用状况* 在Mozilla Firefox浏览器,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 ![Check Firefox Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firefox-Memory-Usage.png) -查看 Firefox 内存使用状况 +*查看 Firefox 内存使用状况* 如果你已经了解它是什么,除了这些选项。要检查内存用量,你也可以点击最左边的 ‘Measure‘ 选项。 ![Firefox Main Process](http://www.tecmint.com/wp-content/uploads/2015/07/Firefox-Main-Processes.png) -Firefox 主进程 +*Firefox 主进程* -它将通过浏览器树形展示进程内存使用量 +它将通过浏览器树形展示进程内存使用量。 目前为止就这样了。希望上述所有的提示将会帮助你。如果你有一个(或多个)技巧,分享给我们,将帮助 Linux 用户更有效地管理他们的 Linux 系统/服务器。 @@ -122,7 +129,7 @@ via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linu 作者:[Avishek Kumar][a] 译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 85aa60c1a7364d152d0471ce09b0125b59e90d3e Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 17 Aug 2015 00:41:29 +0800 Subject: [PATCH 05/13] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications @XLCYun --- ...t & Wrong - Page 3 - GNOME Applications.md | 66 +++++++++++++++++++ ...t & Wrong - Page 3 - GNOME Applications.md | 61 ----------------- 2 files changed, 66 insertions(+), 61 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md delete mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md new file mode 100644 index 0000000000..61600366c9 --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md @@ -0,0 +1,66 @@ +一周 GNOME 之旅:品味它和 KDE 的是是非非(第三节 GNOME应用) +================================================================================ + +### 应用 ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) + +这是一个基本扯平的方面。每一个桌面环境都有一些非常好的应用,也有一些不怎么样的。再次强调,Gnome 把那些 KDE 完全错失的小细节给做对了。我不是想说 KDE 中有哪些应用不好。他们都能工作,但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 + +Gnome 是一个样子,KDE 是另外一种。Dragon 播放器运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在 Gnome Videos 中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome 多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE 有 [Baloo][](正如之前的 [Nepomuk][2],LCTT 译注:这是 KDE 中一种文件索引服务框架)为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 + +下一步……音乐播放器 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) + +这两个应用,左边的是 Rhythmbox ,右边的是 Amarok,都是打开后没有做任何修改直接截屏的。看到差别了吗?Rhythmbox 看起来像个音乐播放器,直接了当,排序文件的方法也很清晰,它知道它应该是什么样的,它的工作是什么:就是播放音乐。 + +Amarok 感觉就像是某个人为了展示而把所有的扩展和选项都尽可能地塞进一个应用程序中去,而做出来的一个技术演示产品(tech demos),或者一个库演示产品(library demos)——而这些是不应该做为产品装进去的,它只应该展示其中一点东西。而 Amarok 给人的感觉却是这样的:好像是某个人想把每一个感觉可能很酷的东西都塞进一个媒体播放器里,甚至都不停下来想“我想写啥来着?一个播放音乐的应用?” + +看看默认布局就行了。前面和中心都呈现了什么?一个可视化工具和集成了维基百科——占了整个页面最大和最显眼的区域。第二大的呢?播放列表。第三大,同时也是最小的呢?真正的音乐列表。这种默认设置对于一个核心应用来说,怎么可能称得上理智? + +软件管理器!它在最近几年当中有很大的进步,而且接下来的几个月中,很可能只能看到它更大的进步。不幸的是,这是另一个 KDE 做得差一点点就能……但还是在终点线前以脸戗地了。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) + +Gnome 软件中心可能是我的新的最爱的软件中心,先放下牢骚等下再发。Muon, 我想爱上你,真的。但你就是个设计上的梦魇。当 VDG 给你画设计草稿时(草图如下),你看起来真漂亮。白色空间用得很好,设计简洁,类别列表也很好,你的整个“不要分开做成两个应用程序”的设计都很不错。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) + +接着就有人为你写代码,实现真正的UI,但是,我猜这些家伙当时一定是喝醉了。 + +我们来看看 Gnome 软件中心。正中间是什么?软件,软件截图和软件描述等等。Muon 的正中心是什么?白白浪费的大块白色空间。Gnome 软件中心还有一个贴心便利特点,那就是放了一个“运行”的按钮在那儿,以防你已经安装了这个软件。便利性和易用性很重要啊,大哥。说实话,仅仅让 Muon 把东西都居中对齐了可能看起来的效果都要好得多。 + +Gnome 软件中心沿着顶部的东西是什么,像个标签列表?所有软件,已安装软件,软件升级。语言简洁,直接,直指要点。Muon,好吧,我们有个“发现”,这个语言表达上还算差强人意,然后我们又有一个“已安装软件”,然后,就没有然后了。软件升级哪去了? + +好吧……开发者决定把升级独立分开成一个应用程序,这样你就得打开两个应用程序才能管理你的软件——一个用来安装,一个用来升级——自从有了新立得图形软件包管理器以来,首次有这种破天荒的设计,与任何已存的软件中心的设计范例相违背。 + +我不想贴上截图给你们看,因为我不想等下还得清理我的电脑,如果你进入 Muon 安装了什么,那么它就会在屏幕下方根据安装的应用名创建一个标签,所以如果你一次性安装很多软件的话,那么下面的标签数量就会慢慢的增长,然后你就不得不手动检查清除它们,因为如果你不这样做,当标签增长到超过屏幕显示时,你就不得不一个个找过去来才能找到最近正在安装的软件。想想:在火狐浏览器中打开50个标签是什么感受。太烦人,太不方便! + +我说过我会给 Gnome 一点打击,我是认真的。Muon 有一点做得比 Gnome 软件中心做得好。在 Muon 的设置栏下面有个“显示技术包”,即:编辑器,软件库,非图形应用程序,无 AppData 的应用等等(LCTT 译注:AppData 是软件包中的一个特殊文件,用于专门存储软件的信息)。Gnome 则没有。如果你想安装其中任何一项你必须跑到终端操作。我想这是他们做得不对的一点。我完全理解他们推行 AppData 的心情,但我想他们太急了(LCTT 译注:推行所有软件包带有 AppData 是 Gnome 软件中心的目标之一)。我是在想安装 PowerTop,而 Gnome 不显示这个软件时我才发现这点的——因为它没有 AppData,也没有“显示技术包”设置。 + +更不幸的事实是,如果你在 KDE 下你不能说“用 [Apper][3] 就行了”,因为…… + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) + +Apper 对安装本地软件包的支持大约在 Fedora 19 时就中止了,几乎两年了。我喜欢关注细节与质量。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://community.kde.org/Baloo +[2]:http://www.ikde.org/tech/kde-tech-nepomuk/ +[3]:https://en.wikipedia.org/wiki/Apper diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md deleted file mode 100644 index 42539badcc..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md +++ /dev/null @@ -1,61 +0,0 @@ -将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第三节 - GNOME应用 -================================================================================ -### 应用 ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) - -这是一个基本上一潭死水的地方。每一个桌面环境都有一些非常好的和不怎么样的应用。再次强调,Gnome把那些KDE完全错失的小细节给做对了。我不是想说KDE中有哪些应用不好。他们都能工作。但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 - -Gnome的在左边,KDE的在右边。Dragon运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在Gnome Videos中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE有Baloo——正如之前有Nepomuk——为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 - -下一步……音乐播放器 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) - -这两个应用,左边的Rhythmbox和右边的Amarok,都是打开后没有做任何修改直接截屏的。看到差别了吗?Rhythmbox看起来像个音乐播放器,直接了当,排序文件的方法也很清晰,它知道它应该是什么样的,它的工作是什么:就是播放音乐。 - -Amarok感觉就像是某个人为了展示而把所有的扩展和选项都尽可能地塞进一个应用程序中去而做出来的一个技术演示产品(tech demos),或者一个库演示产品(library demos)——而这些是不应该做为产品装进去的,它只应该展示一些零碎的东西。而Amarok给人的感觉却是这样的:好像是某个人想把每一个感觉可能很酷的东西都塞进一个媒体播放器里,甚至都不停下来想“我想写啥来着?一个播放音乐的应用?” - -看看默认布局就行了。前面和中心都呈现了什么?一个可视化工具和维基集成(wikipedia integration)——占了整个页面最大和最显眼的区域。第二大的呢?播放列表。第三大,同时也是最小的呢?真正的音乐列表。这种默认设置对于一个核心应用来说,怎么可能称得上理智? - -软件管理器!它在最近几年当中有很大的进步,而且接下来的几个月中,很可能只能看到它更大的进步。不幸的是,这是另一个地方KDE做得差一点点就能……但还是在终点线前摔了脸。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) - -Gnome软件中心可能是我最新的最爱,先放下牢骚等下再发。Muon, 我想爱上你,真的。但你就是个设计上的梦魇。当VDG给你画设计草稿时(模型在下面),你看起来真漂亮。白色空间用得很好,设计简洁,类别列表也很好,你的整个“不要分开做成两个应用程序”的设计都很不错。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) - -接着就有人为你写代码,实现真正的UI,但是,我猜这些家伙当时一定是喝醉了。 - -我们来看看Gnome软件中心。正中间是什么?软件,软件截图和软件描述等等。Muon的正中心是什么?白白浪费的大块白色空间。Gnome软件中心还有一个贴心便利特点,那就是放了一个“运行“的按钮在那儿,以防你已经安装了这个软件。便利性和易用性很重要啊,大哥。说实话,仅仅让Muon把东西都居中对齐了可能看起来的效果都要好得多。 - -Gnome软件中心沿着顶部的东西是什么,像个标签列表?所有软件,已安装软件,软件升级。语言简洁,直接,直指要点。Muon,好吧,我们有个”发现“,这个语言表达上还算差强人意,然后我们又有一个”已安装软件“,然后,就没有然后了。软件升级哪去了? - -好吧……开发者决定把升级独立分开成一个应用程序,这样你就得打开两个应用程序才能管理你的软件——一个用来安装,一个用来升级——自从有了新得立图形软件包管理器以来,首次有这种破天荒的设计,与任何已存的软件中心的设计范例相违背。 - -我不想贴上截图给你们看,因为我不想等下还得清理我的电脑,如果你进入Muon安装了什么,那么它就会在屏幕下方根据安装的应用名创建一个标签,所以如果你一次性安装很多软件的话,那么下面的标签数量就会慢慢的增长,然后你就不得不手动检查清除它们,因为如果你不这样做,当标签增长到超过屏幕显示时,你就不得不一个个找过去来才能找到最近正在安装的软件。想想:在火狐浏览器打开50个标签。太烦人,太不方便! - -我说过我会给Gnome一点打击,我是认真的。Muon有一点做得比Gnome软件中心做得好。在Muon的设置栏下面有个“显示技术包”,即:编辑器,软件库,非图形应用程序,无AppData的应用等等(AppData,软件包中的一个特殊文件,用于专门存储软件的信息,译注)。Gnome则没有。如果你想安装其中任何一项你必须跑到终端操作。我想这是他们做得不对的一点。我完全理解他们推行AppData的心情,但我想他们太急了(推行所有软件包带有AppData,是Gnome软件中心的目标之一,译注)。我是在想安装PowerTop,而Gnome不显示这个软件时我才发现这点的——没有AppData,没有“显示技术包“设置。 - -更不幸的事实是你不能“用Apper就行了”,自从…… - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) - -Apper对安装本地软件包的支持大约在Fedora 19时就中止了,几乎两年了。我喜欢那种对细节与质量的关注。 - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 - -作者:Eric Griffith -译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 4dbc0c3601189cae703cd9e97bb1507fa0d39c2e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 10:56:51 +0800 Subject: [PATCH 06/13] =?UTF-8?q?20150817-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Top 5 Torrent Clients For Ubuntu Linux.md | 117 ++++++++++++++++++ ...number of threads in a process on Linux.md | 50 ++++++++ 2 files changed, 167 insertions(+) create mode 100644 sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md create mode 100644 sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md diff --git a/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md b/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md new file mode 100644 index 0000000000..5ae03e4df1 --- /dev/null +++ b/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md @@ -0,0 +1,117 @@ +Top 5 Torrent Clients For Ubuntu Linux +================================================================================ +![Best Torrent clients for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/5_Best_Torrent_Ubuntu.png) + +Looking for the **best torrent client in Ubuntu**? Indeed there are a number of torrent clients available for desktop Linux. But which ones are the **best Ubuntu torrent clients** among them? + +I am going to list top 5 torrent clients for Linux, which are lightweight, feature rich and have impressive GUI. Ease of installation and using is also a factor. + +### Best torrent programs for Ubuntu ### + +Since Ubuntu comes by default with Transmission, I am going to exclude it from the list. This doesn’t mean that Transmission doesn’t deserve to be on the list. Transmission is a good to have torrent client for Ubuntu and this is the reason why it is the default Torrent application in several Linux distributions, including Ubuntu. + +---------- + +### Deluge ### + +![Logo of Deluge torrent client for Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Deluge.png) + +[Deluge][1] has been chosen as the best torrent client for Linux by Lifehacker and that speaks itself of the usefulness of Deluge. And it’s not just Lifehacker who is fan of Deluge, check out any forum and you’ll find a number of people admitting that Deluge is their favorite. + +Fast, sleek and intuitive interface makes Deluge a hot favorite among Linux users. + +Deluge is available in Ubuntu repositories and you can install it in Ubuntu Software Center or by using the command below: + + sudo apt-get install deluge + +---------- + +### qBittorrent ### + +![qBittorrent client for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/qbittorrent_icon.png) + +As the name suggests, [qBittorrent][2] is the Qt version of famous [Bittorrent][3] application. You’ll see an interface similar to Bittorrent client in Windows, if you ever used it. Sort of lightweight and have all the standard features of a torrent program, qBittorrent is also available in default Ubuntu repository. + +It could be installed from Ubuntu Software Center or using the command below: + + sudo apt-get install qbittorrent + +---------- + +### Tixati ### + +![Tixati torrent client logo](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/tixati_icon.png) + +[Tixati][4] is another nice to have torrent client for Ubuntu. It has a default dark theme which might be preferred by many but not me. It has all the standard features that you can seek in a torrent client. + +In addition to that, there are additional feature of data analysis. You can measure and analyze bandwidth and other statistics in nice charts. + +- [Download Tixati][5] + +---------- + +### Vuze ### + +![Vuze Torrent Logo](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/vuze_icon_for_mac_os_x_by_hamzasaleem-d6yx1fp.png) + +[Vuze][6] is favorite torrent application of a number of Linux as well as Windows users. Apart from the standard features, you can search for torrents directly in the application. You can also subscribe to episodic content so that you won’t have to search for new contents as you can see it in your subscription in sidebar. + +It also comes with a video player that can play HD videos with subtitles and all. But I don’t think you would like to use it over the better video players such as VLC. + +Vuze can be installed from Ubuntu Software Center or using the command below: + + sudo apt-get install vuze + +---------- + +### Frostwire ### + +![Logo of Frostwire torrent client](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/frostwire.png) + +[Frostwire][7] is the torrent application you might want to try. It is more than just a simple torrent client. Also available for Android, you can use it to share files over WiFi. + +You can search for torrents from within the application and play them inside the application. In addition to the downloaded files, it can browse your local media and have them organized inside the player. The same is applicable for the Android version. + +An additional feature is that Frostwire also provides access to legal music by indi artists. You can download them and listen to it, for free, for legal. + +- [Download Frostwire][8] + +---------- + +### Honorable mention ### + +On Windows, uTorrent (pronounced mu torrent) is my favorite torrent application. While uTorrent may be available for Linux, I deliberately skipped it from the list because installing and using uTorrent in Linux is neither easy nor does it provide a complete application experience (runs with in web browser). + +You can read about uTorrent installation in Ubuntu [here][9]. + +#### Quick tip: #### + +Most of the time, torrent applications do not start by default. You might want to change this behavior. Read this post to learn [how to manage startup applications in Ubuntu][10]. + +### What’s your favorite? ### + +That was my opinion on the best Torrent clients in Ubuntu. What is your favorite one? Do leave a comment. You can also check the [best download managers for Ubuntu][11] in related posts. And if you use Popcorn Time, check these [Popcorn Time Tips][12]. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/best-torrent-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://deluge-torrent.org/ +[2]:http://www.qbittorrent.org/ +[3]:http://www.bittorrent.com/ +[4]:http://www.tixati.com/ +[5]:http://www.tixati.com/download/ +[6]:http://www.vuze.com/ +[7]:http://www.frostwire.com/ +[8]:http://www.frostwire.com/downloads +[9]:http://sysads.co.uk/2014/05/install-utorrent-3-3-ubuntu-14-04-13-10/ +[10]:http://itsfoss.com/manage-startup-applications-ubuntu/ +[11]:http://itsfoss.com/4-best-download-managers-for-linux/ +[12]:http://itsfoss.com/popcorn-time-tips/ \ No newline at end of file diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md new file mode 100644 index 0000000000..7993b32628 --- /dev/null +++ b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md @@ -0,0 +1,50 @@ +Linux FAQs with Answers--How to count the number of threads in a process on Linux +================================================================================ +> **Question**: I have an application running, which forks a number of threads at run-time. I want to know how many threads are actively running in the program. What is the easiest way to check the thread count of a process on Linux? + +If you want to see the number of threads per process in Linux environments, there are several ways to do it. + +### Method One: /proc ### + +The proc pseudo filesystem, which resides in /proc directory, is the easiest way to see the thread count of any active process. The /proc directory exports in the form of readable text files a wealth of information related to existing processes and system hardware such as CPU, interrupts, memory, disk, etc. + + $ cat /proc//status + +The above command will show detailed information about the process with , which includes process state (e.g., sleeping, running), parent PID, UID, GID, the number of file descriptors used, and the number of context switches. The output also indicates **the total number of threads created in a process** as follows. + + Threads: + +For example, to check the thread count of a process with PID 20571: + + $ cat /proc/20571/status + +![](https://farm6.staticflickr.com/5649/20341236279_f4a4d809d2_b.jpg) + +The output indicates that the process has 28 threads in it. + +Alternatively, you could simply count the number of directories found in /proc//task, as shown below. + + $ ls /proc//task | wc + +This is because, for every thread created within a process, there is a corresponding directory created in /proc//task, named with its thread ID. Thus the total number of directories in /proc//task represents the number of threads in the process. + +### Method Two: ps ### + +If you are an avid user of the versatile ps command, this command can also show you individual threads of a process (with "H" option). The following command will print the thread count of a process. The "h" option is needed to hide the header in the top output. + + $ ps hH p | wc -l + +If you want to monitor the hardware resources (CPU & memory) consumed by different threads of a process, refer to [this tutorial][1].(注:此文我们翻译过) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/number-of-threads-process-linux.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]:http://ask.xmodulo.com/view-threads-process-linux.html \ No newline at end of file From 66bcdcee0665664be02af42b513d49a4680560b2 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 11:11:24 +0800 Subject: [PATCH 07/13] =?UTF-8?q?20150817-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cketing System in Fedora 22 or Centos 7.md | 179 ++++++++++++++++++ ...x Wireshark GUI freeze on Linux desktop.md | 61 ++++++ 2 files changed, 240 insertions(+) create mode 100644 sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md create mode 100644 sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md diff --git a/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md b/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md new file mode 100644 index 0000000000..515b15844a --- /dev/null +++ b/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md @@ -0,0 +1,179 @@ +How to Install OsTicket Ticketing System in Fedora 22 / Centos 7 +================================================================================ +In this article, we'll learn how to setup help desk ticketing system with osTicket in our machine or server running Fedora 22 or CentOS 7 as operating system. osTicket is a free and open source popular customer support ticketing system developed and maintained by [Enhancesoft][1] and its contributors. osTicket is the best solution for help and support ticketing system and management for better communication and support assistance with clients and customers. It has the ability to easily integrate with inquiries created via email, phone and web based forms into a beautiful multi-user web interface. osTicket makes us easy to manage, organize and log all our support requests and responses in one single place. It is a simple, lightweight, reliable, open source, web-based and easy to setup and use help desk ticketing system. + +Here are some easy steps on how we can setup Help Desk ticketing system with osTicket in Fedora 22 or CentOS 7 operating system. + +### 1. Installing LAMP stack ### + +First of all, we'll need to install LAMP Stack to make osTicket working. LAMP stack is the combination of Apache web server, MySQL or MariaDB database system and PHP. To install a complete suit of LAMP stack that we need for the installation of osTicket, we'll need to run the following commands in a shell or a terminal. + +**On Fedora 22** + +LAMP stack is available on the official repository of Fedora 22. As the default package manager of Fedora 22 is the latest DNF package manager, we'll need to run the following command. + + $ sudo dnf install httpd mariadb mariadb-server php php-mysql php-fpm php-cli php-xml php-common php-gd php-imap php-mbstring wget + +**On CentOS 7** + +As there is LAMP stack available on the official repository of CentOS 7, we'll gonna install it using yum package manager. + + $ sudo yum install httpd mariadb mariadb-server php php-mysql php-fpm php-cli php-xml php-common php-gd php-imap php-mbstring wget + +### 2. Starting Apache Web Server and MariaDB ### + +Next, we'll gonna start MariaDB server and Apache Web Server to get started. + + $ sudo systemctl start mariadb httpd + +Then, we'll gonna enable them to start on every boot of the system. + + $ sudo systemctl enable mariadb httpd + + Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service. + Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. + +### 3. Downloading osTicket package ### + +Next, we'll gonna download the latest release of osTicket ie version 1.9.9 . We can download it from the official download page [http://osticket.com/download][2] or from the official github repository. [https://github.com/osTicket/osTicket-1.8/releases][3] . Here, in this tutorial we'll download the tarball of the latest release of osTicket from the github release page using wget command. + + $ cd /tmp/ + $ wget https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.9/osTicket-v1.9.9-1-gbe2f138.zip + + --2015-07-16 09:14:23-- https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.9/osTicket-v1.9.9-1-gbe2f138.zip + Resolving github.com (github.com)... 192.30.252.131 + ... + Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.244.4|:443... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7150871 (6.8M) [application/octet-stream] + Saving to: ‘osTicket-v1.9.9-1-gbe2f138.zip’ + osTicket-v1.9.9-1-gb 100%[========================>] 6.82M 1.25MB/s in 12s + 2015-07-16 09:14:37 (604 KB/s) - ‘osTicket-v1.9.9-1-gbe2f138.zip’ saved [7150871/7150871] + +### 4. Extracting the osTicket ### + +After we have successfully downloaded the osTicket zipped package, we'll now gonna extract the zip. As the default root directory of Apache web server is /var/www/html/ , we'll gonna create a directory called "**support**" where we'll extract the whole directory and files of the compressed zip file. To do so, we'll need to run the following commands in a terminal or a shell. + + $ unzip osTicket-v1.9.9-1-gbe2f138.zip + +Then, we'll move the whole extracted files to it. + + $ sudo mv /tmp/upload /var/www/html/support + +### 5. Fixing Ownership and Permission ### + +Now, we'll gonna assign the ownership of the directories and files under /var/ww/html/support to apache to enable writable access to the apache process owner. To do so, we'll need to run the following command. + + $ sudo chown apache: -R /var/www/html/support + +Then, we'll also need to copy a sample configuration file to its default configuration file. To do so, we'll need to run the below command. + + $ cd /var/www/html/support/ + $ sudo cp include/ost-sampleconfig.php include/ost-config.php + $ sudo chmod 0666 include/ost-config.php + +If you have SELinux enabled on the system, run the following command. + + $ sudo chcon -R -t httpd_sys_content_t /var/www/html/vtigercrm + $ sudo chcon -R -t httpd_sys_rw_content_t /var/www/html/vtigercrm + +### 6. Configuring MariaDB ### + +As this is the first time we're going to configure MariaDB, we'll need to create a password for the root user of mariadb so that we can use it to login and create the database for our osTicket installation. To do so, we'll need to run the following command in a terminal or a shell. + + $ sudo mysql_secure_installation + + ... + Enter current password for root (enter for none): + OK, successfully used password, moving on... + + Setting the root password ensures that nobody can log into the MariaDB + root user without the proper authorisation. + + Set root password? [Y/n] y + New password: + Re-enter new password: + Password updated successfully! + Reloading privilege tables.. + Success! + ... + All done! If you've completed all of the above steps, your MariaDB + installation should now be secure. + + Thanks for using MariaDB! + +Note: Above, we are asked to enter the root password of the mariadb server but as we are setting for the first time and no password has been set yet, we'll simply hit enter while asking the current mariadb root password. Then, we'll need to enter twice the new password we wanna set. Then, we can simply hit enter in every argument in order to set default configurations. + +### 7. Creating osTicket Database ### + +As osTicket needs a database system to store its data and information, we'll be configuring MariaDB for osTicket. So, we'll need to first login into the mariadb command environment. To do so, we'll need to run the following command. + + $ sudo mysql -u root -p + +Now, we'll gonna create a new database "**osticket_db**" with user "**osticket_user**" and password "osticket_password" which will be granted access to the database. To do so, we'll need to run the following commands inside the MariaDB command environment. + + > CREATE DATABASE osticket_db; + > CREATE USER 'osticket_user'@'localhost' IDENTIFIED BY 'osticket_password'; + > GRANT ALL PRIVILEGES on osticket_db.* TO 'osticket_user'@'localhost' ; + > FLUSH PRIVILEGES; + > EXIT; + +**Note**: It is strictly recommended to replace the database name, user and password as your desire for security issue. + +### 8. Allowing Firewall ### + +If we are running a firewall program, we'll need to configure our firewall to allow port 80 so that the Apache web server's default port will be accessible externally. This will allow us to navigate our web browser to osTicket's web interface with the default http port 80. To do so, we'll need to run the following command. + + $ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent + +After done, we'll need to reload our firewall service. + + $ sudo firewall-cmd --reload + +### 9. Web based Installation ### + +Finally, is everything is done as described above, we'll now should be able to navigate osTicket's Installer by pointing our web browser to http://domain.com/support or http://ip-address/support . Now, we'll be shown if the dependencies required by osTicket are installed or not. As we've already installed all the necessary packages, we'll be welcomed with **green colored tick** to proceed forward. + +![osTicket Requirements Check](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-requirements-check1.png) + +After that, we'll be required to enter the details for our osTicket instance as shown below. We'll need to enter the database name, username, password and hostname and other important account information that we'll require while logging into the admin panel. + +![osticket configuration](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-configuration.png) + +After the installation has been completed successfully, we'll be welcomed by a Congratulations screen. There we can see two links, one for our Admin Panel and the other for the support center as the homepage of the osTicket Support Help Desk. + +![osticket installation completed](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-installation-completed.png) + +If we click on http://ip-address/support or http://domain.com/support, we'll be redirected to the osTicket support page which is as shown below. + +![osticket support homepage](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-support-homepage.png) + +Next, to login into the admin panel, we'll need to navigate our web browser to http://ip-address/support/scp or http://domain.com/support/scp . Then, we'll need to enter the login details we had just created above while configuring the database and other information in the web installer. After successful login, we'll be able to access our dashboard and other admin sections. + +![osticket admin panel](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-admin-panel.png) + +### 10. Post Installation ### + +After we have finished the web installation of osTicket, we'll now need to secure some of our configuration files. To do so, we'll need to run the following command. + + $ sudo rm -rf /var/www/html/support/setup/ + $ sudo chmod 644 /var/www/html/support/include/ost-config.php + +### Conclusion ### + +osTicket is an awesome help desk ticketing system providing several new features. It supports rich text or HTML emails, ticket filters, agent collision avoidance, auto-responder and many more features. The user interface of osTicket is very beautiful with easy to use control panel. It is a complete set of tools required for a help and support ticketing system. It is the best solution for providing customers a better way to communicate with the support team. It helps a company to make their customers happy with them regarding the support and help desk. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +------------------------------------------------------------------------------ + +via: http://linoxide.com/linux-how-to/install-osticket-fedora-22-centos-7/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://www.enhancesoft.com/ +[2]:http://osticket.com/download +[3]:https://github.com/osTicket/osTicket-1.8/releases \ No newline at end of file diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md new file mode 100644 index 0000000000..f6fb3be325 --- /dev/null +++ b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md @@ -0,0 +1,61 @@ +Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop +================================================================================ +> **Question**: When I try to open a pre-recorded packet dump on Wireshark on Ubuntu, its UI suddenly freezes, and the following errors and warnings appear in the terminal where I launched Wireshark. How can I fix this problem? + +Wireshark is a GUI-based packet capture and sniffer tool. This tool is popularly used by network administrators, network security engineers or developers for various tasks where packet-level network analysis is required, for example during network troubleshooting, vulnerability testing, application debugging, or protocol reverse engineering. Wireshark allows one to capture live packets and browse their protocol headers and payloads via a convenient GUI. + +![](https://farm1.staticflickr.com/722/20584224675_f4d7a59474_c.jpg) + +It is known that Wireshark's UI, especially run under Ubuntu desktop, sometimes hangs or freezes with the following errors, while you are scrolling up or down the packet list view, or starting to load a pre-recorded packet dump file. + + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GObject' + (wireshark:3480): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkRange' + (wireshark:3480): Gtk-CRITICAL **: gtk_range_get_adjustment: assertion 'GTK_IS_RANGE (range)' failed + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkOrientable' + (wireshark:3480): Gtk-CRITICAL **: gtk_orientable_get_orientation: assertion 'GTK_IS_ORIENTABLE (orientable)' failed + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkScrollbar' + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkWidget' + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GObject' + (wireshark:3480): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed + (wireshark:3480): Gtk-CRITICAL **: gtk_widget_set_name: assertion 'GTK_IS_WIDGET (widget)' failed + +Apparently this error is caused by some incompatibility between Wireshark and overlay-scrollbar, and has not been fixed in the latest Ubuntu desktop (e.g., as of Ubuntu 15.04 Vivid Vervet). + +A workaround to avoid this Wireshark UI freeze problem is to **temporarily disabling overlay-scrollbar**. There are two ways to disable overlay-scrollbar in Wireshark, depending on how you launch Wireshark on your desktop. + +### Command-Line Solution ### + +Overlay-scrollbar can be disabled by setting "**LIBOVERLAY_SCROLLBAR**" environment variable to "0". + +So if you are launching Wireshark from the command in a terminal, you can disable overlay-scrollbar in Wireshark as follows. + +Open your .bashrc, and define the following alias. + + alias wireshark="LIBOVERLAY_SCROLLBAR=0 /usr/bin/wireshark" + +### Desktop Launcher Solution ### + +If you are launching Wireshark using a desktop launcher, you can edit its desktop launcher file. + + $ sudo vi /usr/share/applications/wireshark.desktop + +Look for a line that starts with "Exec", and change it as follows. + + Exec=env LIBOVERLAY_SCROLLBAR=0 wireshark %f + +While this solution will be beneficial for all desktop users system-wide, it will not survive Wireshark upgrade. If you want to preserve the modified .desktop file, copy it to your home directory as follows. + + $ cp /usr/share/applications/wireshark.desktop ~/.local/share/applications/ + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fix-wireshark-gui-freeze-linux-desktop.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 \ No newline at end of file From 64ff0afb64ffd64f11f553e6517d0d64c8d1e834 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 17 Aug 2015 11:40:27 +0800 Subject: [PATCH 08/13] Update 20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md --- ...How to count the number of threads in a process on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md index 7993b32628..35ee2f00de 100644 --- a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md +++ b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Linux FAQs with Answers--How to count the number of threads in a process on Linux ================================================================================ > **Question**: I have an application running, which forks a number of threads at run-time. I want to know how many threads are actively running in the program. What is the easiest way to check the thread count of a process on Linux? @@ -47,4 +48,4 @@ via: http://ask.xmodulo.com/number-of-threads-process-linux.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni -[1]:http://ask.xmodulo.com/view-threads-process-linux.html \ No newline at end of file +[1]:http://ask.xmodulo.com/view-threads-process-linux.html From 63bfa49922873b3c26beac5a4217e7f5bb1df899 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 17 Aug 2015 11:45:19 +0800 Subject: [PATCH 09/13] Update 20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md --- ...nswers--How to fix Wireshark GUI freeze on Linux desktop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md index f6fb3be325..d906349ff9 100644 --- a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md +++ b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop ================================================================================ > **Question**: When I try to open a pre-recorded packet dump on Wireshark on Ubuntu, its UI suddenly freezes, and the following errors and warnings appear in the terminal where I launched Wireshark. How can I fix this problem? @@ -58,4 +59,4 @@ via: http://ask.xmodulo.com/fix-wireshark-gui-freeze-linux-desktop.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 93096c2c2bb8675b0b9da23a0438b69b37094d0e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 14:59:32 +0800 Subject: [PATCH 10/13] =?UTF-8?q?20150817-3=20=E9=80=89=E9=A2=98=20LFCS=20?= =?UTF-8?q?=E4=B8=93=E9=A2=98=201-5=EF=BC=8C=E5=85=B1=E5=8D=81=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eate Edit and Manipulate files in Linux.md | 220 ++++++++++ ...and Use vi or vim as a Full Text Editor.md | 387 ++++++++++++++++++ ...e Attributes and Finding Files in Linux.md | 382 +++++++++++++++++ ...esystems and Configuring Swap Partition.md | 191 +++++++++ ...work Samba and NFS Filesystems in Linux.md | 232 +++++++++++ 5 files changed, 1412 insertions(+) create mode 100644 sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md create mode 100644 sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md create mode 100644 sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md create mode 100644 sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md create mode 100644 sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md diff --git a/sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md b/sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md new file mode 100644 index 0000000000..ca96b7dac6 --- /dev/null +++ b/sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md @@ -0,0 +1,220 @@ +Part 1 - LFCS: How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux +================================================================================ +The Linux Foundation announced the LFCS (Linux Foundation Certified Sysadmin) certification, a new program that aims at helping individuals all over the world to get certified in basic to intermediate system administration tasks for Linux systems. This includes supporting running systems and services, along with first-hand troubleshooting and analysis, and smart decision-making to escalate issues to engineering teams. + +![Linux Foundation Certified Sysadmin](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-1.png) + +Linux Foundation Certified Sysadmin – Part 1 + +Please watch the following video that demonstrates about The Linux Foundation Certification Program. + +注:youtube 视频 + + +The series will be titled Preparation for the LFCS (Linux Foundation Certified Sysadmin) Parts 1 through 10 and cover the following topics for Ubuntu, CentOS, and openSUSE: + +- Part 1: How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux +- Part 2: How to Install and Use vi/m as a full Text Editor +- Part 3: Archiving Files/Directories and Finding Files on the Filesystem +- Part 4: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition +- Part 5: Mount/Unmount Local and Network (Samba & NFS) Filesystems in Linux +- Part 6: Assembling Partitions as RAID Devices – Creating & Managing System Backups +- Part 7: Managing System Startup Process and Services (SysVinit, Systemd and Upstart +- Part 8: Managing Users & Groups, File Permissions & Attributes and Enabling sudo Access on Accounts +- Part 9: Linux Package Management with Yum, RPM, Apt, Dpkg, Aptitude and Zypper +- Part 10: Learning Basic Shell Scripting and Filesystem Troubleshooting + + +This post is Part 1 of a 10-tutorial series, which will cover the necessary domains and competencies that are required for the LFCS certification exam. That being said, fire up your terminal, and let’s start. + +### Processing Text Streams in Linux ### + +Linux treats the input to and the output from programs as streams (or sequences) of characters. To begin understanding redirection and pipes, we must first understand the three most important types of I/O (Input and Output) streams, which are in fact special files (by convention in UNIX and Linux, data streams and peripherals, or device files, are also treated as ordinary files). + +The difference between > (redirection operator) and | (pipeline operator) is that while the first connects a command with a file, the latter connects the output of a command with another command. + + # command > file + # command1 | command2 + +Since the redirection operator creates or overwrites files silently, we must use it with extreme caution, and never mistake it with a pipeline. One advantage of pipes on Linux and UNIX systems is that there is no intermediate file involved with a pipe – the stdout of the first command is not written to a file and then read by the second command. + +For the following practice exercises we will use the poem “A happy child” (anonymous author). + +![cat command](http://www.tecmint.com/wp-content/uploads/2014/10/cat-command.png) + +cat command example + +#### Using sed #### + +The name sed is short for stream editor. For those unfamiliar with the term, a stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). + +The most basic (and popular) usage of sed is the substitution of characters. We will begin by changing every occurrence of the lowercase y to UPPERCASE Y and redirecting the output to ahappychild2.txt. The g flag indicates that sed should perform the substitution for all instances of term on every line of file. If this flag is omitted, sed will replace only the first occurrence of term on each line. + +**Basic syntax:** + + # sed ‘s/term/replacement/flag’ file + +**Our example:** + + # sed ‘s/y/Y/g’ ahappychild.txt > ahappychild2.txt + +![sed command](http://www.tecmint.com/wp-content/uploads/2014/10/sed-command.png) + +sed command example + +Should you want to search for or replace a special character (such as /, \, &) you need to escape it, in the term or replacement strings, with a backward slash. + +For example, we will substitute the word and for an ampersand. At the same time, we will replace the word I with You when the first one is found at the beginning of a line. + + # sed 's/and/\&/g;s/^I/You/g' ahappychild.txt + +![sed replace string](http://www.tecmint.com/wp-content/uploads/2014/10/sed-replace-string.png) + +sed replace string + +In the above command, a ^ (caret sign) is a well-known regular expression that is used to represent the beginning of a line. + +As you can see, we can combine two or more substitution commands (and use regular expressions inside them) by separating them with a semicolon and enclosing the set inside single quotes. + +Another use of sed is showing (or deleting) a chosen portion of a file. In the following example, we will display the first 5 lines of /var/log/messages from Jun 8. + + # sed -n '/^Jun 8/ p' /var/log/messages | sed -n 1,5p + +Note that by default, sed prints every line. We can override this behaviour with the -n option and then tell sed to print (indicated by p) only the part of the file (or the pipe) that matches the pattern (Jun 8 at the beginning of line in the first case and lines 1 through 5 inclusive in the second case). + +Finally, it can be useful while inspecting scripts or configuration files to inspect the code itself and leave out comments. The following sed one-liner deletes (d) blank lines or those starting with # (the | character indicates a boolean OR between the two regular expressions). + + # sed '/^#\|^$/d' apache2.conf + +![sed match string](http://www.tecmint.com/wp-content/uploads/2014/10/sed-match-string.png) + +sed match string + +#### uniq Command #### + +The uniq command allows us to report or remove duplicate lines in a file, writing to stdout by default. We must note that uniq does not detect repeated lines unless they are adjacent. Thus, uniq is commonly used along with a preceding sort (which is used to sort lines of text files). By default, sort takes the first field (separated by spaces) as key field. To specify a different key field, we need to use the -k option. + +**Examples** + +The du –sch /path/to/directory/* command returns the disk space usage per subdirectories and files within the specified directory in human-readable format (also shows a total per directory), and does not order the output by size, but by subdirectory and file name. We can use the following command to sort by size. + + # du -sch /var/* | sort –h + +![sort command](http://www.tecmint.com/wp-content/uploads/2014/10/sort-command.jpg) + +sort command example + +You can count the number of events in a log by date by telling uniq to perform the comparison using the first 6 characters (-w 6) of each line (where the date is specified), and prefixing each output line by the number of occurrences (-c) with the following command. + + # cat /var/log/mail.log | uniq -c -w 6 + +![Count Numbers in File](http://www.tecmint.com/wp-content/uploads/2014/10/count-numbers-in-file.jpg) + +Count Numbers in File + +Finally, you can combine sort and uniq (as they usually are). Consider the following file with a list of donors, donation date, and amount. Suppose we want to know how many unique donors there are. We will use the following command to cut the first field (fields are delimited by a colon), sort by name, and remove duplicate lines. + + # cat sortuniq.txt | cut -d: -f1 | sort | uniq + +![Find Unique Records in File](http://www.tecmint.com/wp-content/uploads/2014/10/find-uniqu-records-in-file.jpg) + +Find Unique Records in File + +- Read Also: [13 “cat” Command Examples][1] + +#### grep Command #### + +grep searches text files or (command output) for the occurrence of a specified regular expression and outputs any line containing a match to standard output. + +**Examples** + +Display the information from /etc/passwd for user gacanepa, ignoring case. + + # grep -i gacanepa /etc/passwd + +![grep Command](http://www.tecmint.com/wp-content/uploads/2014/10/grep-command.jpg) + +grep command example + +Show all the contents of /etc whose name begins with rc followed by any single number. + + # ls -l /etc | grep rc[0-9] + +![List Content Using grep](http://www.tecmint.com/wp-content/uploads/2014/10/list-content-using-grep.jpg) + +List Content Using grep + +- Read Also: [12 “grep” Command Examples][2] + +#### tr Command Usage #### + +The tr command can be used to translate (change) or delete characters from stdin, and write the result to stdout. + +**Examples** + +Change all lowercase to uppercase in sortuniq.txt file. + + # cat sortuniq.txt | tr [:lower:] [:upper:] + +![Sort Strings in File](http://www.tecmint.com/wp-content/uploads/2014/10/sort-strings.jpg) + +Sort Strings in File + +Squeeze the delimiter in the output of ls –l to only one space. + + # ls -l | tr -s ' ' + +![Squeeze Delimiter](http://www.tecmint.com/wp-content/uploads/2014/10/squeeze-delimeter.jpg) + +Squeeze Delimiter + +#### cut Command Usage #### + +The cut command extracts portions of input lines (from stdin or files) and displays the result on standard output, based on number of bytes (-b option), characters (-c), or fields (-f). In this last case (based on fields), the default field separator is a tab, but a different delimiter can be specified by using the -d option. + +**Examples** + +Extract the user accounts and the default shells assigned to them from /etc/passwd (the –d option allows us to specify the field delimiter, and the –f switch indicates which field(s) will be extracted. + + # cat /etc/passwd | cut -d: -f1,7 + +![Extract User Accounts](http://www.tecmint.com/wp-content/uploads/2014/10/extract-user-accounts.jpg) + +Extract User Accounts + +Summing up, we will create a text stream consisting of the first and third non-blank files of the output of the last command. We will use grep as a first filter to check for sessions of user gacanepa, then squeeze delimiters to only one space (tr -s ‘ ‘). Next, we’ll extract the first and third fields with cut, and finally sort by the second field (IP addresses in this case) showing unique. + + # last | grep gacanepa | tr -s ‘ ‘ | cut -d’ ‘ -f1,3 | sort -k2 | uniq + +![last command](http://www.tecmint.com/wp-content/uploads/2014/10/last-command.png) + +last command example + +The above command shows how multiple commands and pipes can be combined so as to obtain filtered data according to our desires. Feel free to also run it by parts, to help you see the output that is pipelined from one command to the next (this can be a great learning experience, by the way!). + +### Summary ### + +Although this example (along with the rest of the examples in the current tutorial) may not seem very useful at first sight, they are a nice starting point to begin experimenting with commands that are used to create, edit, and manipulate files from the Linux command line. Feel free to leave your questions and comments below – they will be much appreciated! + +#### Reference Links #### + +- [About the LFCS][3] +- [Why get a Linux Foundation Certification?][4] +- [Register for the LFCS exam][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ +[2]:http://www.tecmint.com/12-practical-examples-of-linux-grep-command/ +[3]:https://training.linuxfoundation.org/certification/LFCS +[4]:https://training.linuxfoundation.org/certification/why-certify-with-us +[5]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md b/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md new file mode 100644 index 0000000000..7537f784bd --- /dev/null +++ b/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md @@ -0,0 +1,387 @@ +Part 2 - LFCS: How to Install and Use vi/vim as a Full Text Editor +================================================================================ +A couple of months ago, the Linux Foundation launched the LFCS (Linux Foundation Certified Sysadmin) certification in order to help individuals from all over the world to verify they are capable of doing basic to intermediate system administration tasks on Linux systems: system support, first-hand troubleshooting and maintenance, plus intelligent decision-making to know when it’s time to raise issues to upper support teams. + +![Learning VI Editor in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/LFCS-Part-2.png) + +Learning VI Editor in Linux + +Please take a look at the below video that explains The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 2 of a 10-tutorial series, here in this part, we will cover the basic file editing operations and understanding modes in vi/m editor, that are required for the LFCS certification exam. + +### Perform Basic File Editing Operations Using vi/m ### + +Vi was the first full-screen text editor written for Unix. Although it was intended to be small and simple, it can be a bit challenging for people used exclusively to GUI text editors, such as NotePad++, or gedit, to name a few examples. + +To use Vi, we must first understand the 3 modes in which this powerful program operates, in order to begin learning later about the its powerful text-editing procedures. + +Please note that most modern Linux distributions ship with a variant of vi known as vim (“Vi improved”), which supports more features than the original vi does. For that reason, throughout this tutorial we will use vi and vim interchangeably. + +If your distribution does not have vim installed, you can install it as follows. + +- Ubuntu and derivatives: aptitude update && aptitude install vim +- Red Hat-based distributions: yum update && yum install vim +- openSUSE: zypper update && zypper install vim + +### Why should I want to learn vi? ### + +There are at least 2 good reasons to learn vi. + +1. vi is always available (no matter what distribution you’re using) since it is required by POSIX. + +2. vi does not consume a considerable amount of system resources and allows us to perform any imaginable tasks without lifting our fingers from the keyboard. + +In addition, vi has a very extensive built-in manual, which can be launched using the :help command right after the program is started. This built-in manual contains more information than vi/m’s man page. + +![vi Man Pages](http://www.tecmint.com/wp-content/uploads/2014/10/vi-man-pages.png) + +vi Man Pages + +#### Launching vi #### + +To launch vi, type vi in your command prompt. + +![Start vi Editor](http://www.tecmint.com/wp-content/uploads/2014/10/start-vi-editor.png) + +Start vi Editor + +Then press i to enter Insert mode, and you can start typing. Another way to launch vi/m is. + + # vi filename + +Which will open a new buffer (more on buffers later) named filename, which you can later save to disk. + +#### Understanding Vi modes #### + +1. In command mode, vi allows the user to navigate around the file and enter vi commands, which are brief, case-sensitive combinations of one or more letters. Almost all of them can be prefixed with a number to repeat the command that number of times. + +For example, yy (or Y) copies the entire current line, whereas 3yy (or 3Y) copies the entire current line along with the two next lines (3 lines in total). We can always enter command mode (regardless of the mode we’re working on) by pressing the Esc key. The fact that in command mode the keyboard keys are interpreted as commands instead of text tends to be confusing to beginners. + +2. In ex mode, we can manipulate files (including saving a current file and running outside programs). To enter this mode, we must type a colon (:) from command mode, directly followed by the name of the ex-mode command that needs to be used. After that, vi returns automatically to command mode. + +3. In insert mode (the letter i is commonly used to enter this mode), we simply enter text. Most keystrokes result in text appearing on the screen (one important exception is the Esc key, which exits insert mode and returns to command mode). + +![vi Insert Mode](http://www.tecmint.com/wp-content/uploads/2014/10/vi-insert-mode.png) + +vi Insert Mode + +#### Vi Commands #### + +The following table shows a list of commonly used vi commands. File edition commands can be enforced by appending the exclamation sign to the command (for example, + + + + + + +  Key command +  Description + + +  h or left arrow +  Go one character to the left + + +  j or down arrow +  Go down one line + + +  k or up arrow +  Go up one line + + +  l (lowercase L) or right arrow +  Go one character to the right + + +  H +  Go to the top of the screen + + +  L +  Go to the bottom of the screen + + +  G +  Go to the end of the file + + +  w +  Move one word to the right + + +  b +  Move one word to the left + + +  0 (zero) +  Go to the beginning of the current line + + +  ^ +  Go to the first nonblank character on the current line + + +  $ +  Go to the end of the current line + + +  Ctrl-B +  Go back one screen + + +  Ctrl-F +  Go forward one screen + + +  i +  Insert at the current cursor position + + +  I (uppercase i) +  Insert at the beginning of the current line + + +  J (uppercase j) +  Join current line with the next one (move next line up) + + +  a +  Append after the current cursor position + + +  o (lowercase O) +  Creates a blank line after the current line + + +  O (uppercase o) +  Creates a blank line before the current line + + +  r +  Replace the character at the current cursor position + + +  R +  Overwrite at the current cursor position + + +  x +  Delete the character at the current cursor position + + +  X +  Delete the character immediately before (to the left) of the current cursor position + + +  dd +  Cut (for later pasting) the entire current line + + +  D +  Cut from the current cursor position to the end of the line (this command is equivalent to d$) + + +  yX +  Give a movement command X, copy (yank) the appropriate number of characters, words, or lines from the current cursor position + + +  yy or Y +  Yank (copy) the entire current line + + +  p +  Paste after (next line) the current cursor position + + +  P +  Paste before (previous line) the current cursor position + + +  . (period) +  Repeat the last command + + +  u +  Undo the last command + + +  U +  Undo the last command in the last line. This will work as long as the cursor is still on the line. + + +  n +  Find the next match in a search + + +  N +  Find the previous match in a search + + +  :n +  Next file; when multiple files are specified for editing, this commands loads the next file. + + +  :e file +  Load file in place of the current file. + + +  :r file +  Insert the contents of file after (next line) the current cursor position + + +  :q +  Quit without saving changes. + + +  :w file +  Write the current buffer to file. To append to an existing file, use :w >> file. + + +  :wq +  Write the contents of the current file and quit. Equivalent to x! and ZZ + + +  :r! command +  Execute command and insert output after (next line) the current cursor position. + + + + +#### Vi Options #### + +The following options can come in handy while running vim (we need to add them in our ~/.vimrc file). + + # echo set number >> ~/.vimrc + # echo syntax on >> ~/.vimrc + # echo set tabstop=4 >> ~/.vimrc + # echo set autoindent >> ~/.vimrc + +![vi Editor Options](http://www.tecmint.com/wp-content/uploads/2014/10/vi-options.png) + +vi Editor Options + +- set number shows line numbers when vi opens an existing or a new file. +- syntax on turns on syntax highlighting (for multiple file extensions) in order to make code and config files more readable. +- set tabstop=4 sets the tab size to 4 spaces (default value is 8). +- set autoindent carries over previous indent to the next line. + +#### Search and replace #### + +vi has the ability to move the cursor to a certain location (on a single line or over an entire file) based on searches. It can also perform text replacements with or without confirmation from the user. + +a). Searching within a line: the f command searches a line and moves the cursor to the next occurrence of a specified character in the current line. + +For example, the command fh would move the cursor to the next instance of the letter h within the current line. Note that neither the letter f nor the character you’re searching for will appear anywhere on your screen, but the character will be highlighted after you press Enter. + +For example, this is what I get after pressing f4 in command mode. + +![Search String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-string.png) + +Search String in Vi + +b). Searching an entire file: use the / command, followed by the word or phrase to be searched for. A search may be repeated using the previous search string with the n command, or the next one (using the N command). This is the result of typing /Jane in command mode. + +![Vi Search String in File](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-line.png) + +Vi Search String in File + +c). vi uses a command (similar to sed’s) to perform substitution operations over a range of lines or an entire file. To change the word “old” to “young” for the entire file, we must enter the following command. + + :%s/old/young/g + +**Notice**: The colon at the beginning of the command. + +![Vi Search and Replace](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-and-replace.png) + +Vi Search and Replace + +The colon (:) starts the ex command, s in this case (for substitution), % is a shortcut meaning from the first line to the last line (the range can also be specified as n,m which means “from line n to line m”), old is the search pattern, while young is the replacement text, and g indicates that the substitution should be performed on every occurrence of the search string in the file. + +Alternatively, a c can be added to the end of the command to ask for confirmation before performing any substitution. + + :%s/old/young/gc + +Before replacing the original text with the new one, vi/m will present us with the following message. + +![Replace String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-replace-old-with-young.png) + +Replace String in Vi + +- y: perform the substitution (yes) +- n: skip this occurrence and go to the next one (no) +- a: perform the substitution in this and all subsequent instances of the pattern. +- q or Esc: quit substituting. +- l (lowercase L): perform this substitution and quit (last). +- Ctrl-e, Ctrl-y: Scroll down and up, respectively, to view the context of the proposed substitution. + +#### Editing Multiple Files at a Time #### + +Let’s type vim file1 file2 file3 in our command prompt. + + # vim file1 file2 file3 + +First, vim will open file1. To switch to the next file (file2), we need to use the :n command. When we want to return to the previous file, :N will do the job. + +In order to switch from file1 to file3. + +a). The :buffers command will show a list of the file currently being edited. + + :buffers + +![Edit Multiple Files](http://www.tecmint.com/wp-content/uploads/2014/10/vi-edit-multiple-files.png) + +Edit Multiple Files + +b). The command :buffer 3 (without the s at the end) will open file3 for editing. + +In the image above, a pound sign (#) indicates that the file is currently open but in the background, while %a marks the file that is currently being edited. On the other hand, a blank space after the file number (3 in the above example) indicates that the file has not yet been opened. + +#### Temporary vi buffers #### + +To copy a couple of consecutive lines (let’s say 4, for example) into a temporary buffer named a (not associated with a file) and place those lines in another part of the file later in the current vi section, we need to… + +1. Press the ESC key to be sure we are in vi Command mode. + +2. Place the cursor on the first line of the text we wish to copy. + +3. Type “a4yy to copy the current line, along with the 3 subsequent lines, into a buffer named a. We can continue editing our file – we do not need to insert the copied lines immediately. + +4. When we reach the location for the copied lines, use “a before the p or P commands to insert the lines copied into the buffer named a: + +- Type “ap to insert the lines copied into buffer a after the current line on which the cursor is resting. +- Type “aP to insert the lines copied into buffer a before the current line. + +If we wish, we can repeat the above steps to insert the contents of buffer a in multiple places in our file. A temporary buffer, as the one in this section, is disposed when the current window is closed. + +### Summary ### + +As we have seen, vi/m is a powerful and versatile text editor for the CLI. Feel free to share your own tricks and comments below. + +#### Reference Links #### + +- [About the LFCS][1] +- [Why get a Linux Foundation Certification?][2] +- [Register for the LFCS exam][3] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/vi-editor-usage/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://training.linuxfoundation.org/certification/LFCS +[2]:https://training.linuxfoundation.org/certification/why-certify-with-us +[3]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md b/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md new file mode 100644 index 0000000000..6ac3d104a0 --- /dev/null +++ b/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md @@ -0,0 +1,382 @@ +Part 3 - LFCS: How to Archive/Compress Files & Directories, Setting File Attributes and Finding Files in Linux +================================================================================ +Recently, the Linux Foundation started the LFCS (Linux Foundation Certified Sysadmin) certification, a brand new program whose purpose is allowing individuals from all corners of the globe to have access to an exam, which if approved, certifies that the person is knowledgeable in performing basic to intermediate system administration tasks on Linux systems. This includes supporting already running systems and services, along with first-level troubleshooting and analysis, plus the ability to decide when to escalate issues to engineering teams. + +![Linux Foundation Certified Sysadmin – Part 3](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-3.png) + +Linux Foundation Certified Sysadmin – Part 3 + +Please watch the below video that gives the idea about The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 3 of a 10-tutorial series, here in this part, we will cover how to archive/compress files and directories, set file attributes, and find files on the filesystem, that are required for the LFCS certification exam. + +### Archiving and Compression Tools ### + +A file archiving tool groups a set of files into a single standalone file that we can backup to several types of media, transfer across a network, or send via email. The most frequently used archiving utility in Linux is tar. When an archiving utility is used along with a compression tool, it allows to reduce the disk size that is needed to store the same files and information. + +#### The tar utility #### + +tar bundles a group of files together into a single archive (commonly called a tar file or tarball). The name originally stood for tape archiver, but we must note that we can use this tool to archive data to any kind of writeable media (not only to tapes). Tar is normally used with a compression tool such as gzip, bzip2, or xz to produce a compressed tarball. + +**Basic syntax:** + + # tar [options] [pathname ...] + +Where … represents the expression used to specify which files should be acted upon. + +#### Most commonly used tar commands #### + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Long optionAbbreviationDescription
 –create c Creates a tar archive
 –concatenate A Appends tar files to an archive
 –append r Appends files to the end of an archive
 –update u Appends files newer than copy in archive
 –diff or –compare d Find differences between archive and file system
 –file archive f Use archive file or device ARCHIVE
 –list t Lists the contents of a tarball
 –extract or –get x Extracts files from an archive
+ +#### Normally used operation modifiers #### + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Long optionAbbreviationDescription
 –directory dir C Changes to directory dir before performing operations
 –same-permissions p Preserves original permissions
 –verbose v Lists all files read or extracted. When this flag is used along with –list, the file sizes, ownership, and time stamps are displayed.
 –verify W Verifies the archive after writing it
 –exclude file — Excludes file from the archive
 –exclude=pattern X Exclude files, given as a PATTERN
 –gzip or –gunzip z Processes an archive through gzip
 –bzip2 j Processes an archive through bzip2
 –xz J Processes an archive through xz
+ +Gzip is the oldest compression tool and provides the least compression, while bzip2 provides improved compression. In addition, xz is the newest but (usually) provides the best compression. This advantages of best compression come at a price: the time it takes to complete the operation, and system resources used during the process. + +Normally, tar files compressed with these utilities have .gz, .bz2, or .xz extensions, respectively. In the following examples we will be using these files: file1, file2, file3, file4, and file5. + +**Grouping and compressing with gzip, bzip2 and xz** + +Group all the files in the current working directory and compress the resulting bundle with gzip, bzip2, and xz (please note the use of a regular expression to specify which files should be included in the bundle – this is to prevent the archiving tool to group the tarballs created in previous steps). + + # tar czf myfiles.tar.gz file[0-9] + # tar cjf myfiles.tar.bz2 file[0-9] + # tar cJf myfile.tar.xz file[0-9] + +![Compress Multiple Files Using tar](http://www.tecmint.com/wp-content/uploads/2014/10/Compress-Multiple-Files.png) + +Compress Multiple Files + +**Listing the contents of a tarball and updating / appending files to the bundle** + +List the contents of a tarball and display the same information as a long directory listing. Note that update or append operations cannot be applied to compressed files directly (if you need to update or append a file to a compressed tarball, you need to uncompress the tar file and update / append to it, then compress again). + + # tar tvf [tarball] + +![Check Files in tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/List-Archive-Content.png) + +List Archive Content + +Run any of the following commands: + + # gzip -d myfiles.tar.gz [#1] + # bzip2 -d myfiles.tar.bz2 [#2] + # xz -d myfiles.tar.xz [#3] + +Then + + # tar --delete --file myfiles.tar file4 (deletes the file inside the tarball) + # tar --update --file myfiles.tar file4 (adds the updated file) + +and + + # gzip myfiles.tar [ if you choose #1 above ] + # bzip2 myfiles.tar [ if you choose #2 above ] + # xz myfiles.tar [ if you choose #3 above ] + +Finally, + + # tar tvf [tarball] #again + +and compare the modification date and time of file4 with the same information as shown earlier. + +**Excluding file types** + +Suppose you want to perform a backup of user’s home directories. A good sysadmin practice would be (may also be specified by company policies) to exclude all video and audio files from backups. + +Maybe your first approach would be to exclude from the backup all files with an .mp3 or .mp4 extension (or other extensions). What if you have a clever user who can change the extension to .txt or .bkp, your approach won’t do you much good. In order to detect an audio or video file, you need to check its file type with file. The following shell script will do the job. + + #!/bin/bash + # Pass the directory to backup as first argument. + DIR=$1 + # Create the tarball and compress it. Exclude files with the MPEG string in its file type. + # -If the file type contains the string mpeg, $? (the exit status of the most recently executed command) expands to 0, and the filename is redirected to the exclude option. Otherwise, it expands to 1. + # -If $? equals 0, add the file to the list of files to be backed up. + tar X <(for i in $DIR/*; do file $i | grep -i mpeg; if [ $? -eq 0 ]; then echo $i; fi;done) -cjf backupfile.tar.bz2 $DIR/* + +![Exclude Files in tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/Exclude-Files-in-Tar.png) + +Exclude Files in tar + +**Restoring backups with tar preserving permissions** + +You can then restore the backup to the original user’s home directory (user_restore in this example), preserving permissions, with the following command. + + # tar xjf backupfile.tar.bz2 --directory user_restore --same-permissions + +![Restore Files from tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/Restore-tar-Backup-Files.png) + +Restore Files from Archive + +**Read Also:** + +- [18 tar Command Examples in Linux][1] +- [Dtrx – An Intelligent Archive Tool for Linux][2] + +### Using find Command to Search for Files ### + +The find command is used to search recursively through directory trees for files or directories that match certain characteristics, and can then either print the matching files or directories or perform other operations on the matches. + +Normally, we will search by name, owner, group, type, permissions, date, and size. + +#### Basic syntax: #### + +# find [directory_to_search] [expression] + +**Finding files recursively according to Size** + +Find all files (-f) in the current directory (.) and 2 subdirectories below (-maxdepth 3 includes the current working directory and 2 levels down) whose size (-size) is greater than 2 MB. + + # find . -maxdepth 3 -type f -size +2M + +![Find Files by Size in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Files-Based-on-Size.png) + +Find Files Based on Size + +**Finding and deleting files that match a certain criteria** + +Files with 777 permissions are sometimes considered an open door to external attackers. Either way, it is not safe to let anyone do anything with files. We will take a rather aggressive approach and delete them! (‘{}‘ + is used to “collect” the results of the search). + + # find /home/user -perm 777 -exec rm '{}' + + +![Find all 777 Permission Files](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Files-with-777-Permission.png) + +Find Files with 777Permission + +**Finding files per atime or mtime** + +Search for configuration files in /etc that have been accessed (-atime) or modified (-mtime) more (+180) or less (-180) than 6 months ago or exactly 6 months ago (180). + +Modify the following command as per the example below: + + # find /etc -iname "*.conf" -mtime -180 -print + +![Find Files by Modification Time](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Modified-Files.png) + +Find Modified Files + +- Read Also: [35 Practical Examples of Linux ‘find’ Command][3] + +### File Permissions and Basic Attributes ### + +The first 10 characters in the output of ls -l are the file attributes. The first of these characters is used to indicate the file type: + +- – : a regular file +- -d : a directory +- -l : a symbolic link +- -c : a character device (which treats data as a stream of bytes, i.e. a terminal) +- -b : a block device (which handles data in blocks, i.e. storage devices) + +The next nine characters of the file attributes are called the file mode and represent the read (r), write (w), and execute (x) permissions of the file’s owner, the file’s group owner, and the rest of the users (commonly referred to as “the world”). + +Whereas the read permission on a file allows the same to be opened and read, the same permission on a directory allows its contents to be listed if the execute permission is also set. In addition, the execute permission in a file allows it to be handled as a program and run, while in a directory it allows the same to be cd’ed into it. + +File permissions are changed with the chmod command, whose basic syntax is as follows: + + # chmod [new_mode] file + +Where new_mode is either an octal number or an expression that specifies the new permissions. + +The octal number can be converted from its binary equivalent, which is calculated from the desired file permissions for the owner, the group, and the world, as follows: + +The presence of a certain permission equals a power of 2 (r=22, w=21, x=20), while its absence equates to 0. For example: + +![Linux File Permissions](http://www.tecmint.com/wp-content/uploads/2014/10/File-Permissions.png) + +File Permissions + +To set the file’s permissions as above in octal form, type: + + # chmod 744 myfile + +You can also set a file’s mode using an expression that indicates the owner’s rights with the letter u, the group owner’s rights with the letter g, and the rest with o. All of these “individuals” can be represented at the same time with the letter a. Permissions are granted (or revoked) with the + or – signs, respectively. + +**Revoking execute permission for a shell script to all users** + +As we explained earlier, we can revoke a certain permission prepending it with the minus sign and indicating whether it needs to be revoked for the owner, the group owner, or all users. The one-liner below can be interpreted as follows: Change mode for all (a) users, revoke (–) execute permission (x). + + # chmod a-x backup.sh + +Granting read, write, and execute permissions for a file to the owner and group owner, and read permissions for the world. + +When we use a 3-digit octal number to set permissions for a file, the first digit indicates the permissions for the owner, the second digit for the group owner and the third digit for everyone else: + +- Owner: (r=22 + w=21 + x=20 = 7) +- Group owner: (r=22 + w=21 + x=20 = 7) +- World: (r=22 + w=0 + x=0 = 4), + + # chmod 774 myfile + +In time, and with practice, you will be able to decide which method to change a file mode works best for you in each case. A long directory listing also shows the file’s owner and its group owner (which serve as a rudimentary yet effective access control to files in a system): + +![Linux File Listing](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-File-Listing.png) + +Linux File Listing + +File ownership is changed with the chown command. The owner and the group owner can be changed at the same time or separately. Its basic syntax is as follows: + + # chown user:group file + +Where at least user or group need to be present. + +**Few Examples** + +Changing the owner of a file to a certain user. + + # chown gacanepa sent + +Changing the owner and group of a file to an specific user:group pair. + + # chown gacanepa:gacanepa TestFile + +Changing only the group owner of a file to a certain group. Note the colon before the group’s name. + + # chown :gacanepa email_body.txt + +### Conclusion ### + +As a sysadmin, you need to know how to create and restore backups, how to find files in your system and change their attributes, along with a few tricks that can make your life easier and will prevent you from running into future issues. + +I hope that the tips provided in the present article will help you to achieve that goal. Feel free to add your own tips and ideas in the comments section for the benefit of the community. Thanks in advance! +Reference Links + +- [About the LFCS][4] +- [Why get a Linux Foundation Certification?][5] +- [Register for the LFCS exam][6] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/compress-files-and-finding-files-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/18-tar-command-examples-in-linux/ +[2]:http://www.tecmint.com/dtrx-an-intelligent-archive-extraction-tar-zip-cpio-rpm-deb-rar-tool-for-linux/ +[3]:http://www.tecmint.com/35-practical-examples-of-linux-find-command/ +[4]:https://training.linuxfoundation.org/certification/LFCS +[5]:https://training.linuxfoundation.org/certification/why-certify-with-us +[6]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md b/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md new file mode 100644 index 0000000000..ada637fabb --- /dev/null +++ b/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md @@ -0,0 +1,191 @@ +Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition +================================================================================ +Last August, the Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a shiny chance for system administrators to show, through a performance-based exam, that they can perform overall operational support of Linux systems: system support, first-level diagnosing and monitoring, plus issue escalation – if needed – to other support teams. + +![Linux Foundation Certified Sysadmin – Part 4](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-4.png) + +Linux Foundation Certified Sysadmin – Part 4 + +Please aware that Linux Foundation certifications are precise, totally based on performance and available through an online portal anytime, anywhere. Thus, you no longer have to travel to a examination center to get the certifications you need to establish your skills and expertise. + +Please watch the below video that explains The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 4 of a 10-tutorial series, here in this part, we will cover the Partitioning storage devices, Formatting filesystems and Configuring swap partition, that are required for the LFCS certification exam. + +### Partitioning Storage Devices ### + +Partitioning is a means to divide a single hard drive into one or more parts or “slices” called partitions. A partition is a section on a drive that is treated as an independent disk and which contains a single type of file system, whereas a partition table is an index that relates those physical sections of the hard drive to partition identifications. + +In Linux, the traditional tool for managing MBR partitions (up to ~2009) in IBM PC compatible systems is fdisk. For GPT partitions (~2010 and later) we will use gdisk. Each of these tools can be invoked by typing its name followed by a device name (such as /dev/sdb). + +#### Managing MBR Partitions with fdisk #### + +We will cover fdisk first. + + # fdisk /dev/sdb + +A prompt appears asking for the next operation. If you are unsure, you can press the ‘m‘ key to display the help contents. + +![fdisk Help Menu](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-help.png) + +fdisk Help Menu + +In the above image, the most frequently used options are highlighted. At any moment, you can press ‘p‘ to display the current partition table. + +![Check Partition Table in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Show-Partition-Table.png) + +Show Partition Table + +The Id column shows the partition type (or partition id) that has been assigned by fdisk to the partition. A partition type serves as an indicator of the file system, the partition contains or, in simple words, the way data will be accessed in that partition. + +Please note that a comprehensive study of each partition type is out of the scope of this tutorial – as this series is focused on the LFCS exam, which is performance-based. + +**Some of the options used by fdisk as follows:** + +You can list all the partition types that can be managed by fdisk by pressing the ‘l‘ option (lowercase l). + +Press ‘d‘ to delete an existing partition. If more than one partition is found in the drive, you will be asked which one should be deleted. + +Enter the corresponding number, and then press ‘w‘ (write modifications to partition table) to apply changes. + +In the following example, we will delete /dev/sdb2, and then print (p) the partition table to verify the modifications. + +![fdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-options.png) + +fdisk Command Options + +Press ‘n‘ to create a new partition, then ‘p‘ to indicate it will be a primary partition. Finally, you can accept all the default values (in which case the partition will occupy all the available space), or specify a size as follows. + +![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-New-Partition.png) + +Create New Partition + +If the partition Id that fdisk chose is not the right one for our setup, we can press ‘t‘ to change it. + +![Change Partition Name in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Partition-Name.png) + +Change Partition Name + +When you’re done setting up the partitions, press ‘w‘ to commit the changes to disk. + +![Save Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Partition-Changes.png) + +Save Partition Changes + +#### Managing GPT Partitions with gdisk #### + +In the following example, we will use /dev/sdb. + + # gdisk /dev/sdb + +We must note that gdisk can be used either to create MBR or GPT partitions. + +![Create GPT Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-GPT-Partitions.png) + +Create GPT Partitions + +The advantage of using GPT partitioning is that we can create up to 128 partitions in the same disk whose size can be up to the order of petabytes, whereas the maximum size for MBR partitions is 2 TB. + +Note that most of the options in fdisk are the same in gdisk. For that reason, we will not go into detail about them, but here’s a screenshot of the process. + +![gdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/gdisk-options.png) + +gdisk Command Options + +### Formatting Filesystems ### + +Once we have created all the necessary partitions, we must create filesystems. To find out the list of filesystems supported in your system, run. + + # ls /sbin/mk* + +![Check Filesystems Type in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Filesystems.png) + +Check Filesystems Type + +The type of filesystem that you should choose depends on your requirements. You should consider the pros and cons of each filesystem and its own set of features. Two important attributes to look for in a filesystem are. + +- Journaling support, which allows for faster data recovery in the event of a system crash. +- Security Enhanced Linux (SELinux) support, as per the project wiki, “a security enhancement to Linux which allows users and administrators more control over access control”. + +In our next example, we will create an ext4 filesystem (supports both journaling and SELinux) labeled Tecmint on /dev/sdb1, using mkfs, whose basic syntax is. + + # mkfs -t [filesystem] -L [label] device + or + # mkfs.[filesystem] -L [label] device + +![Create ext4 Filesystems in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystems.png) + +Create ext4 Filesystems + +### Creating and Using Swap Partitions ### + +Swap partitions are necessary if we need our Linux system to have access to virtual memory, which is a section of the hard disk designated for use as memory, when the main system memory (RAM) is all in use. For that reason, a swap partition may not be needed on systems with enough RAM to meet all its requirements; however, even in that case it’s up to the system administrator to decide whether to use a swap partition or not. + +A simple rule of thumb to decide the size of a swap partition is as follows. + +Swap should usually equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB. + +So, if: + +M = Amount of RAM in GB, and S = Amount of swap in GB, then + + If M < 2 + S = M *2 + Else + S = M + 2 + +Remember this is just a formula and that only you, as a sysadmin, have the final word as to the use and size of a swap partition. + +To configure a swap partition, create a regular partition as demonstrated earlier with the desired size. Next, we need to add the following entry to the /etc/fstab file (X can be either b or c). + + /dev/sdX1 swap swap sw 0 0 + +Finally, let’s format and enable the swap partition. + + # mkswap /dev/sdX1 + # swapon -v /dev/sdX1 + +To display a snapshot of the swap partition(s). + + # cat /proc/swaps + +To disable the swap partition. + + # swapoff /dev/sdX1 + +For the next example, we’ll use /dev/sdc1 (=512 MB, for a system with 256 MB of RAM) to set up a partition with fdisk that we will use as swap, following the steps detailed above. Note that we will specify a fixed size in this case. + +![Create-Swap-Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Swap-Partition.png) + +Create Swap Partition + +![Add Swap Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Swap-Partition.png) + +Enable Swap Partition + +### Conclusion ### + +Creating partitions (including swap) and formatting filesystems are crucial in your road to Sysadminship. I hope that the tips given in this article will guide you to achieve your goals. Feel free to add your own tips & ideas in the comments section below, for the benefit of the community. +Reference Links + +- [About the LFCS][1] +- [Why get a Linux Foundation Certification?][2] +- [Register for the LFCS exam][3] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://training.linuxfoundation.org/certification/LFCS +[2]:https://training.linuxfoundation.org/certification/why-certify-with-us +[3]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md b/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md new file mode 100644 index 0000000000..1544a378bc --- /dev/null +++ b/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md @@ -0,0 +1,232 @@ +Part 5 - LFCS: How to Mount/Unmount Local and Network (Samba & NFS) Filesystems in Linux +================================================================================ +The Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a brand new program whose purpose is allowing individuals from all corners of the globe to get certified in basic to intermediate system administration tasks for Linux systems, which includes supporting running systems and services, along with overall monitoring and analysis, plus smart decision-making when it comes to raising issues to upper support teams. + +![Linux Foundation Certified Sysadmin – Part 5](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-5.png) + +Linux Foundation Certified Sysadmin – Part 5 + +The following video shows an introduction to The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 5 of a 10-tutorial series, here in this part, we will explain How to mount/unmount local and network filesystems in linux, that are required for the LFCS certification exam. + +### Mounting Filesystems ### + +Once a disk has been partitioned, Linux needs some way to access the data on the partitions. Unlike DOS or Windows (where this is done by assigning a drive letter to each partition), Linux uses a unified directory tree where each partition is mounted at a mount point in that tree. + +A mount point is a directory that is used as a way to access the filesystem on the partition, and mounting the filesystem is the process of associating a certain filesystem (a partition, for example) with a specific directory in the directory tree. + +In other words, the first step in managing a storage device is attaching the device to the file system tree. This task can be accomplished on a one-time basis by using tools such as mount (and then unmounted with umount) or persistently across reboots by editing the /etc/fstab file. + +The mount command (without any options or arguments) shows the currently mounted filesystems. + + # mount + +![Check Mounted Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/check-mounted-filesystems.png) + +Check Mounted Filesystem + +In addition, mount is used to mount filesystems into the filesystem tree. Its standard syntax is as follows. + + # mount -t type device dir -o options + +This command instructs the kernel to mount the filesystem found on device (a partition, for example, that has been formatted with a filesystem type) at the directory dir, using all options. In this form, mount does not look in /etc/fstab for instructions. + +If only a directory or device is specified, for example. + + # mount /dir -o options + or + # mount device -o options + +mount tries to find a mount point and if it can’t find any, then searches for a device (both cases in the /etc/fstab file), and finally attempts to complete the mount operation (which usually succeeds, except for the case when either the directory or the device is already being used, or when the user invoking mount is not root). + +You will notice that every line in the output of mount has the following format. + + device on directory type (options) + +For example, + + /dev/mapper/debian-home on /home type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered) + +Reads: + +dev/mapper/debian-home is mounted on /home, which has been formatted as ext4, with the following options: rw,relatime,user_xattr,barrier=1,data=ordered + +**Mount Options** + +Most frequently used mount options include. + +- async: allows asynchronous I/O operations on the file system being mounted. +- auto: marks the file system as enabled to be mounted automatically using mount -a. It is the opposite of noauto. +- defaults: this option is an alias for async,auto,dev,exec,nouser,rw,suid. Note that multiple options must be separated by a comma without any spaces. If by accident you type a space between options, mount will interpret the subsequent text string as another argument. +- loop: Mounts an image (an .iso file, for example) as a loop device. This option can be used to simulate the presence of the disk’s contents in an optical media reader. +- noexec: prevents the execution of executable files on the particular filesystem. It is the opposite of exec. +- nouser: prevents any users (other than root) to mount and unmount the filesystem. It is the opposite of user. +- remount: mounts the filesystem again in case it is already mounted. +- ro: mounts the filesystem as read only. +- rw: mounts the file system with read and write capabilities. +- relatime: makes access time to files be updated only if atime is earlier than mtime. +- user_xattr: allow users to set and remote extended filesystem attributes. + +**Mounting a device with ro and noexec options** + + # mount -t ext4 /dev/sdg1 /mnt -o ro,noexec + +In this case we can see that attempts to write a file to or to run a binary file located inside our mounting point fail with corresponding error messages. + + # touch /mnt/myfile + # /mnt/bin/echo “Hi there” + +![Mount Device in Read Write Mode](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device-Read-Write.png) + +Mount Device Read Write + +**Mounting a device with default options** + +In the following scenario, we will try to write a file to our newly mounted device and run an executable file located within its filesystem tree using the same commands as in the previous example. + + # mount -t ext4 /dev/sdg1 /mnt -o defaults + +![Mount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device.png) + +Mount Device + +In this last case, it works perfectly. + +### Unmounting Devices ### + +Unmounting a device (with the umount command) means finish writing all the remaining “on transit” data so that it can be safely removed. Note that if you try to remove a mounted device without properly unmounting it first, you run the risk of damaging the device itself or cause data loss. + +That being said, in order to unmount a device, you must be “standing outside” its block device descriptor or mount point. In other words, your current working directory must be something else other than the mounting point. Otherwise, you will get a message saying that the device is busy. + +![Unmount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Unmount-Device.png) + +Unmount Device + +An easy way to “leave” the mounting point is typing the cd command which, in lack of arguments, will take us to our current user’s home directory, as shown above. + +### Mounting Common Networked Filesystems ### + +The two most frequently used network file systems are SMB (which stands for “Server Message Block”) and NFS (“Network File System”). Chances are you will use NFS if you need to set up a share for Unix-like clients only, and will opt for Samba if you need to share files with Windows-based clients and perhaps other Unix-like clients as well. + +Read Also + +- [Setup Samba Server in RHEL/CentOS and Fedora][1] +- [Setting up NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu][2] + +The following steps assume that Samba and NFS shares have already been set up in the server with IP 192.168.0.10 (please note that setting up a NFS share is one of the competencies required for the LFCE exam, which we will cover after the present series). + +#### Mounting a Samba share on Linux #### + +Step 1: Install the samba-client samba-common and cifs-utils packages on Red Hat and Debian based distributions. + + # yum update && yum install samba-client samba-common cifs-utils + # aptitude update && aptitude install samba-client samba-common cifs-utils + +Then run the following command to look for available samba shares in the server. + + # smbclient -L 192.168.0.10 + +And enter the password for the root account in the remote machine. + +![Mount Samba Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Samba-Share.png) + +Mount Samba Share + +In the above image we have highlighted the share that is ready for mounting on our local system. You will need a valid samba username and password on the remote server in order to access it. + +Step 2: When mounting a password-protected network share, it is not a good idea to write your credentials in the /etc/fstab file. Instead, you can store them in a hidden file somewhere with permissions set to 600, like so. + + # mkdir /media/samba + # echo “username=samba_username” > /media/samba/.smbcredentials + # echo “password=samba_password” >> /media/samba/.smbcredentials + # chmod 600 /media/samba/.smbcredentials + +Step 3: Then add the following line to /etc/fstab file. + + # //192.168.0.10/gacanepa /media/samba cifs credentials=/media/samba/.smbcredentials,defaults 0 0 + +Step 4: You can now mount your samba share, either manually (mount //192.168.0.10/gacanepa) or by rebooting your machine so as to apply the changes made in /etc/fstab permanently. + +![Mount Password Protect Samba Share](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Password-Protect-Samba-Share.png) + +Mount Password Protect Samba Share + +#### Mounting a NFS share on Linux #### + +Step 1: Install the nfs-common and portmap packages on Red Hat and Debian based distributions. + + # yum update && yum install nfs-utils nfs-utils-lib + # aptitude update && aptitude install nfs-common + +Step 2: Create a mounting point for the NFS share. + + # mkdir /media/nfs + +Step 3: Add the following line to /etc/fstab file. + +192.168.0.10:/NFS-SHARE /media/nfs nfs defaults 0 0 + +Step 4: You can now mount your nfs share, either manually (mount 192.168.0.10:/NFS-SHARE) or by rebooting your machine so as to apply the changes made in /etc/fstab permanently. + +![Mount NFS Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-NFS-Share.png) + +Mount NFS Share + +### Mounting Filesystems Permanently ### + +As shown in the previous two examples, the /etc/fstab file controls how Linux provides access to disk partitions and removable media devices and consists of a series of lines that contain six fields each; the fields are separated by one or more spaces or tabs. A line that begins with a hash mark (#) is a comment and is ignored. + +Each line has the following format. + + + +Where: + +- : The first column specifies the mount device. Most distributions now specify partitions by their labels or UUIDs. This practice can help reduce problems if partition numbers change. +- : The second column specifies the mount point. +- : The file system type code is the same as the type code used to mount a filesystem with the mount command. A file system type code of auto lets the kernel auto-detect the filesystem type, which can be a convenient option for removable media devices. Note that this option may not be available for all filesystems out there. +- : One (or more) mount option(s). +- : You will most likely leave this to 0 (otherwise set it to 1) to disable the dump utility to backup the filesystem upon boot (The dump program was once a common backup tool, but it is much less popular today.) +- : This column specifies whether the integrity of the filesystem should be checked at boot time with fsck. A 0 means that fsck should not check a filesystem. The higher the number, the lowest the priority. Thus, the root partition will most likely have a value of 1, while all others that should be checked should have a value of 2. + +**Mount Examples** + +1. To mount a partition with label TECMINT at boot time with rw and noexec attributes, you should add the following line in /etc/fstab file. + + LABEL=TECMINT /mnt ext4 rw,noexec 0 0 + +2. If you want the contents of a disk in your DVD drive be available at boot time. + + /dev/sr0 /media/cdrom0 iso9660 ro,user,noauto 0 0 + +Where /dev/sr0 is your DVD drive. + +### Summary ### + +You can rest assured that mounting and unmounting local and network filesystems from the command line will be part of your day-to-day responsibilities as sysadmin. You will also need to master /etc/fstab. I hope that you have found this article useful to help you with those tasks. Feel free to add your comments (or ask questions) below and to share this article through your network social profiles. +Reference Links + +- [About the LFCS][3] +- [Why get a Linux Foundation Certification?][4] +- [Register for the LFCS exam][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mount-filesystem-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/setup-samba-server-using-tdbsam-backend-on-rhel-centos-6-3-5-8-and-fedora-17-12/ +[2]:http://www.tecmint.com/how-to-setup-nfs-server-in-linux/ +[3]:https://training.linuxfoundation.org/certification/LFCS +[4]:https://training.linuxfoundation.org/certification/why-certify-with-us +[5]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file From 2bd491e4887a8ccf9e80670d9ef772cf3dc54ea8 Mon Sep 17 00:00:00 2001 From: KS Date: Mon, 17 Aug 2015 16:25:20 +0800 Subject: [PATCH 11/13] Update 20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md --- ...ll Strongswan - A Tool to Setup IPsec Based VPN in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md index ca909934fa..cd9ee43213 100644 --- a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md +++ b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md @@ -1,3 +1,4 @@ +wyangsun translating Install Strongswan - A Tool to Setup IPsec Based VPN in Linux ================================================================================ IPsec is a standard which provides the security at network layer. It consist of authentication header (AH) and encapsulating security payload (ESP) components. AH provides the packet Integrity and confidentiality is provided by ESP component . IPsec ensures the following security features at network layer. @@ -110,4 +111,4 @@ via: http://linoxide.com/security/install-strongswan/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/naveeda/ -[1]:https://www.strongswan.org/ \ No newline at end of file +[1]:https://www.strongswan.org/ From 8cceff8c289b4e4c694af9de6bb755634cb10297 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 17 Aug 2015 22:44:42 +0800 Subject: [PATCH 12/13] PUB:20150816 shellinabox--A Web based AJAX Terminal Emulator @xiaoyu33 --- ...box--A Web based AJAX Terminal Emulator.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) rename {translated/share => published}/20150816 shellinabox--A Web based AJAX Terminal Emulator.md (66%) diff --git a/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/published/20150816 shellinabox--A Web based AJAX Terminal Emulator.md similarity index 66% rename from translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md rename to published/20150816 shellinabox--A Web based AJAX Terminal Emulator.md index 71acf990c1..c4d9523d50 100644 --- a/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md +++ b/published/20150816 shellinabox--A Web based AJAX Terminal Emulator.md @@ -1,16 +1,17 @@ -shellinabox–基于Web的Ajax的终端模拟器安装及使用详解 +shellinabox:一款使用 AJAX 的基于 Web 的终端模拟器 ================================================================================ + ### shellinabox简介 ### -unixmen的读者朋友们,你们好! +通常情况下,我们在访问任何远程服务器时,会使用常见的通信工具如OpenSSH和Putty等。但是,有可能我们在防火墙后面不能使用这些工具访问远程系统,或者防火墙只允许HTTPS流量才能通过。不用担心!即使你在这样的防火墙后面,我们依然有办法来访问你的远程系统。而且,你不需要安装任何类似于OpenSSH或Putty的通讯工具。你只需要有一个支持JavaScript和CSS的现代浏览器,并且你不用安装任何插件或第三方应用软件。 -通常情况下,我们访问任何远程服务器时,使用常见的通信工具如OpenSSH和Putty等。但是如果我们在防火墙外,或者防火墙只允许HTTPS流量才能通过,那么我们就不能再使用这些工具来访问远程系统了。不用担心!即使你在防火墙后面,我们依然有办法来访问你的远程系统。而且,你不需要安装任何类似于OpenSSH或Putty的通讯工具。你只需要有一个支持JavaScript和CSS的现代浏览器。并且你不用安装任何插件或第三方应用软件。 +这个 **Shell In A Box**,发音是**shellinabox**,是由**Markus Gutschke**开发的一款自由开源的基于Web的Ajax的终端模拟器。它使用AJAX技术,通过Web浏览器提供了类似原生的 Shell 的外观和感受。 -Meet **Shell In A Box**,发音是**shellinabox**,是由**Markus Gutschke**开发的一款免费的,开源的,基于Web的Ajax的终端模拟器。它使用AJAX技术,通过Web浏览器提供的外观和感觉像一个原生壳。该**shellinaboxd**的守护进程实现了一个Web服务器,能够侦听指定的端口。Web服务器发布一个或多个服务,这些服务将在VT100模拟器实现为一个AJAX的Web应用程序显示。默认情况下,端口为4200。你可以更改默认端口到任意选择的任意端口号。在你的远程服务器安装shellinabox以后,如果你想从本地系统接入,打开Web浏览器并导航到:**http://IP-Address:4200/**。输入你的用户名和密码,然后就可以开始使用你远程系统的外壳。看起来很有趣,不是吗?确实! +这个**shellinaboxd**守护进程实现了一个Web服务器,能够侦听指定的端口。其Web服务器可以发布一个或多个服务,这些服务显示在用 AJAX Web 应用实现的VT100模拟器中。默认情况下,端口为4200。你可以更改默认端口到任意选择的任意端口号。在你的远程服务器安装shellinabox以后,如果你想从本地系统接入,打开Web浏览器并导航到:**http://IP-Address:4200/**。输入你的用户名和密码,然后就可以开始使用你远程系统的Shell。看起来很有趣,不是吗?确实 有趣! **免责声明**: -shellinabox不是SSH客户端或任何安全软件。它仅仅是一个应用程序,能够通过Web浏览器模拟一个远程系统的壳。同时,它和SSH没有任何关系。这不是防弹的安全的方式来远程控制您的系统。这只是迄今为止最简单的方法之一。无论什么原因,你都不应该在任何公共网络上运行它。 +shellinabox不是SSH客户端或任何安全软件。它仅仅是一个应用程序,能够通过Web浏览器模拟一个远程系统的Shell。同时,它和SSH没有任何关系。这不是可靠的安全地远程控制您的系统的方式。这只是迄今为止最简单的方法之一。无论如何,你都不应该在任何公共网络上运行它。 ### 安装shellinabox ### @@ -48,7 +49,7 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 # vi /etc/sysconfig/shellinaboxd -更改你的端口到任意数量。因为我在本地网络上测试它,所以我使用默认值。 +更改你的端口到任意数字。因为我在本地网络上测试它,所以我使用默认值。 # Shell in a box daemon configuration # For details see shellinaboxd man page @@ -98,7 +99,7 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 ### 使用 ### -现在,去你的客户端系统,打开Web浏览器并导航到:**https://ip-address-of-remote-servers:4200**。 +现在,在你的客户端系统,打开Web浏览器并导航到:**https://ip-address-of-remote-servers:4200**。 **注意**:如果你改变了端口,请填写修改后的端口。 @@ -110,13 +111,13 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 ![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg) -右键点击你浏览器的空白位置。你可以得到一些有很有用的额外的菜单选项。 +右键点击你浏览器的空白位置。你可以得到一些有很有用的额外菜单选项。 ![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg) 从现在开始,你可以通过本地系统的Web浏览器在你的远程服务器随意操作。 -当你完成时,记得点击**退出**。 +当你完成工作时,记得输入`exit`退出。 当再次连接到远程系统时,单击**连接**按钮,然后输入远程服务器的用户名和密码。 @@ -134,7 +135,7 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 ### 结论 ### -正如我之前提到的,如果你在服务器运行在防火墙后面,那么基于web的SSH工具是非常有用的。有许多基于web的SSH工具,但shellinabox是非常简单并且有用的工具,能从的网络上的任何地方,模拟一个远程系统的壳。因为它是基于浏览器的,所以你可以从任何设备访问您的远程服务器,只要你有一个支持JavaScript和CSS的浏览器。 +正如我之前提到的,如果你在服务器运行在防火墙后面,那么基于web的SSH工具是非常有用的。有许多基于web的SSH工具,但shellinabox是非常简单而有用的工具,可以从的网络上的任何地方,模拟一个远程系统的Shell。因为它是基于浏览器的,所以你可以从任何设备访问您的远程服务器,只要你有一个支持JavaScript和CSS的浏览器。 就这些啦。祝你今天有个好心情! @@ -148,7 +149,7 @@ via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ 作者:[SK][a] 译者:[xiaoyu33](https://github.com/xiaoyu33) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 40cbb17f9ee6f21418829d1c6ebf83976f2ad59a Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 17 Aug 2015 23:53:26 +0800 Subject: [PATCH 13/13] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun 翻译的渐入佳境了! --- ...t & Wrong - Page 3 - GNOME Applications.md | 2 +- ...Right & Wrong - Page 4 - GNOME Settings.md | 52 ++++++++++++++++++ ...Right & Wrong - Page 4 - GNOME Settings.md | 54 ------------------- 3 files changed, 53 insertions(+), 55 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md delete mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md index 61600366c9..4dd942dd29 100644 --- a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md @@ -7,7 +7,7 @@ 这是一个基本扯平的方面。每一个桌面环境都有一些非常好的应用,也有一些不怎么样的。再次强调,Gnome 把那些 KDE 完全错失的小细节给做对了。我不是想说 KDE 中有哪些应用不好。他们都能工作,但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 -Gnome 是一个样子,KDE 是另外一种。Dragon 播放器运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在 Gnome Videos 中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome 多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE 有 [Baloo][](正如之前的 [Nepomuk][2],LCTT 译注:这是 KDE 中一种文件索引服务框架)为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 +Gnome 在左,KDE 在右。Dragon 播放器运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在 Gnome Videos 中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome 多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE 有 [Baloo][](正如之前的 [Nepomuk][2],LCTT 译注:这是 KDE 中一种文件索引服务框架)为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 下一步……音乐播放器 diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md new file mode 100644 index 0000000000..289c1cb14e --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md @@ -0,0 +1,52 @@ +一周 GNOME 之旅:品味它和 KDE 的是是非非(第四节 GNOME设置) +================================================================================ + +### 设置 ### + +在这我要挑一挑几个特定 KDE 控制模块的毛病,大部分原因是因为相比它们的对手GNOME来说,糟糕得太可笑,实话说,真是悲哀。 + +第一个接招的?打印机。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers1_show&w=1920) + +GNOME 在左,KDE 在右。你知道左边跟右边的打印程序有什么区别吗?当我在 GNOME 控制中心打开“打印机”时,程序窗口弹出来了,然后这样就可以使用了。而当我在 KDE 系统设置打开“打印机”时,我得到了一条密码提示。甚至我都没能看一眼打印机呢,我就必须先交出 ROOT 密码。 + +让我再重复一遍。在今天这个有了 PolicyKit 和 Logind 的日子里,对一个应该是 sudo 的操作,我依然被询问要求 ROOT 的密码。我安装系统的时候甚至都没设置 root 密码。所以我必须跑到 Konsole 去,接着运行 'sudo passwd root' 命令,这样我才能给 root 设一个密码,然后我才能回到系统设置中的打印程序,再交出 root 密码,然后仅仅是看一看哪些打印机可用。完成了这些工作后,当我点击“添加打印机”时,我再次得到请求 ROOT 密码的提示,当我解决了它后再选择一个打印机和驱动时,我再次得到请求 ROOT 密码的提示。仅仅是为了添加一个打印机到系统我就收到三次密码请求! + +而在 GNOME 下添加打印机,在点击打印机程序中的“解锁”之前,我没有得到任何请求 SUDO 密码的提示。整个过程我只被请求过一次,仅此而已。KDE,求你了……采用 GNOME 的“解锁”模式吧。不到一定需要的时候不要发出提示。还有,不管是哪个库,只要它允许 KDE 应用程序绕过 PolicyKit/Logind(如果有的话)并直接请求 ROOT 权限……那就把它封进箱里吧。如果这是个多用户系统,那我要么必须交出 ROOT 密码,要么我必须时时刻刻待命,以免有一个用户需要升级、更改或添加一个新的打印机。而这两种情况都是完全无法接受的。 + +有还一件事…… + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers2_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers3_show&w=1920) + +这个问题问大家:怎么样看起来更简洁?我在写这篇文章时意识到:当有任何附加的打印机准备好时,Gnome 打印机程序会把过程做得非常简洁,它们在左边上放了一个竖直栏来列出这些打印机。而我在 KDE 中添加第二台打印机时,它突然增加出一个左边栏来。而在添加之前,我脑海中已经有了一个恐怖的画面,它会像图片文件夹显示预览图一样直接在界面里插入另外一个图标。我很高兴也很惊讶的看到我是错的。但是事实是它直接“长出”另外一个从未存在的竖直栏,彻底改变了它的界面布局,而这样也称不上“好”。终究还是一种令人困惑,奇怪而又不直观的设计。 + +打印机说得够多了……下一个接受我公开石刑的 KDE 系统设置是?多媒体,即 Phonon。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_sound_show&w=1920) + +一如既往,GNOME 在左边,KDE 在右边。让我们先看看 GNOME 的系统设置先……眼睛移动是从左到右,从上到下,对吧?来吧,就这样做。首先:音量控制滑条。滑条中的蓝色条与空条百分百清晰地消除了哪边是“音量增加”的困惑。在音量控制条后马上就是一个 On/Off 开关,用来开关静音功能。Gnome 的再次得分在于静音后能记住当前设置的音量,而在点击音量增加按钮取消静音后能回到原来设置的音量中来。Kmixer,你个健忘的垃圾,我真的希望我能多讨论你一下。 + +继续!输入输出和应用程序的标签选项?每一个应用程序的音量随时可控?Gnome,每过一秒,我爱你越深。音量均衡选项、声音配置、和清晰地标上标志的“测试麦克风”选项。 + +我不清楚它能否以一种更干净更简洁的设计实现。是的,它只是一个 Gnome 化的 Pavucontrol,但我想这就是重要的地方。Pavucontrol 在这方面几乎完全做对了,Gnome 控制中心中的“声音”应用程序的改善使它向完美更进了一步。 + +Phonon,该你上了。但开始前我想说:我 TM 看到的是什么?!我知道我看到的是音频设备的优先级列表,但是它呈现的方式有点太坑。还有,那些用户可能关心的那些东西哪去了?拥有一个优先级列表当然很好,它也应该存在,但问题是优先级列表属于那种用户乱搞一两次之后就不会再碰的东西。它还不够重要,或者说不够常用到可以直接放在正中间位置的程度。音量控制滑块呢?对每个应用程序的音量控制功能呢?那些用户使用最频繁的东西呢?好吧,它们在 Kmix 中,一个分离的程序,拥有它自己的配置选项……而不是在系统设置下……这样真的让“系统设置”这个词变得有点用词不当。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_network_show&w=1920) + +上面展示的 Gnome 的网络设置。KDE 的没有展示,原因就是我接下来要吐槽的内容了。如果你进入 KDE 的系统设置里,然后点击“网络”区域中三个选项中的任何一个,你会得到一大堆的选项:蓝牙设置、Samba 分享的默认用户名和密码(说真的,“连通性(Connectivity)”下面只有两个选项:SMB 的用户名和密码。TMD 怎么就配得上“连通性”这么大的词?),浏览器身份验证控制(只有 Konqueror 能用……一个已经倒闭的项目),代理设置,等等……我的 wifi 设置哪去了?它们没在这。哪去了?好吧,它们在网络应用程序的设置里面……而不是在网络设置里…… + +KDE,你这是要杀了我啊,你有“系统设置”当凶器,拿着它动手吧! + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=4 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md deleted file mode 100644 index 1c0cc4bd86..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md +++ /dev/null @@ -1,54 +0,0 @@ -将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第四节 - GNOME设置 -================================================================================ -### Settings设置 ### - -在这我要挑一挑几个特定KDE控制模块的毛病,大部分原因是因为相比它们的对手GNOME来说,糟糕得太可笑,实话说,真是悲哀。 - -第一个接招的?打印机。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers1_show&w=1920) - -GNOME在左,KDE在右。你知道左边跟右边的打印程序有什么区别吗?当我在GNOME控制中心打开“打印机”时,程序窗口弹出来了,之后没有也没发生。而当我在KDE系统设置打开“打印机”时,我收到了一条密码提示。甚至我都没能看一眼打印机呢,我就必须先交出ROOT密码。 - -让我再重复一遍。在今天,PolicyKit和Logind的日子里,对一个应该是sudo的操作,我依然被询问要求ROOT的密码。我安装系统的时候甚至都没设置root密码。所以我必须跑到Konsole去,然后运行'sudo passwd root'命令,这样我才能给root设一个密码,这样我才能回到系统设置中的打印程序,然后交出root密码,然后仅仅是看一看哪些打印机可用。完成了这些工作后,当我点击“添加打印机”时,我再次收到请求ROOT密码的提示,当我解决了它后再选择一个打印机和驱动时,我再次收到请求ROOT密码的提示。仅仅是为了添加一个打印机到系统我就收到三次密码请求。 - -而在GNOME下添加打印机,在点击打印机程序中的”解锁“之前,我没有收到任何请求SUDO密码的提示。整个过程我只被请求过一次,仅此而已。KDE,求你了……采用GNOME的”解锁“模式吧。不到一定需要的时候不要发出提示。还有,不管是哪个库,只要它允许KDE应用程序绕过PolicyKit/Logind(如果有的话)并直接请求ROOT权限……那就把它封进箱里吧。如果这是个多用户系统,那我要么必须交出ROOT密码,要么我必须时时刻刻呆着以免有一个用户需要升级、更改或添加一个新的打印机。而这两种情况都是完全无法接受的。 - -有还一件事…… - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers2_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers3_show&w=1920) - -给论坛的问题:怎么样看起来更简洁?我在写这篇文章时意识到:当有任何的附加打印机准备好时,Gnome打印机程序会把过程做得非常简洁,它们在左边上放了一个竖直栏来列出这些打印机。而我在KDE添加第二台打印机时,它突然增加出一个左边栏来。而在添加之前,我脑海中已经有了一个恐怖的画面它会像图片文件夹显示预览图一样,直接插入另外一个图标到界面里去。我很高兴也很惊讶的看到我是错的。但是事实是它直接”长出”另外一个从末存在的竖直栏,彻底改变了它的界面布局,而这样也称不上“好”。终究还是一种令人困惑,奇怪而又不直观的设计。 - -打印机说得够多了……下一个接受我公开石刑的KDE系统设置是?多媒体,即Phonon。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_sound_show&w=1920) - -一如既往,GNOME在左边,KDE在右边。让我们先看看GNOME的系统设置先……眼睛从左到右,从上到下,对吧?来吧,就这样做。首先:音量控制滑条。滑条中的蓝色条与空白条百分百清晰地消除了哪边是“音量增加”的困惑。在音量控制条后马上就是一个On/Off开关,用来开关静音功能。Gnome的再次得分在于静音后能记住当前设置的音量,而在点击音量增加按钮取消静音后能回到原来设置的音量中来。Kmixer,你个健忘的垃圾,我真的希望我能多讨论你。 - - -继续!输入输出和应用程序的标签选项?每一个应用程序的音量随时可控?Gnome,每过一秒,我爱你越深。均衡的选项设置,声音配置,和清晰地标上标志的“测试麦克风”选项。 - - - -我不清楚它能否以一种更干净更简洁的设计实现。是的,它只是一个Gnome化的Pavucontrol,但我想这就是重要的地方。Pavucontrol在这方面几乎完全做对了,Gnome控制中心中的“声音”应用程序的改善使它向完美更进了一步。 - -Phonon,该你上了。但开始前我想说:我TM看到的是什么?我知道我看到的是音频设备的权限列表,但是它呈现的方式有点太坑。还有,那些用户可能关心的那些东西哪去了?拥有一个权限列表当然很好,它也应该存在,但问题是权限列表属于那种用户乱搞一两次之后就不会再碰的东西。它还不够重要,或者说常用到可以直接放在正中间位置的程度。音量控制滑块呢?对每个应用程序的音量控制功能呢?那些用户使用最频繁的东西呢?好吧,它们在Kmix中,一个分离的程序,拥有它自己的配置选项……而不是在系统设置下……这样真的让“系统设置”这个词变得有点用词不当。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_network_show&w=1920) - -上面展示的Gnome的网络设置。KDE的没有展示,原因就是我接下来要吐槽的内容了。如果你进入KDE的系统设置里,然后点击“网络”区域中三个选项中的任何一个,你会得到一大堆的选项:蓝牙设置,Samba分享的默认用户名和密码(说真的,“连通性(Connectivity)”下面只有两个选项:SMB的用户名和密码。TMD怎么就配得上“连通性”这么大的词?),浏览器身份验证控制(只有Konqueror能用……一个已经倒闭的项目),代理设置,等等……我的wifi设置哪去了?它们没在这。哪去了?好吧,它们在网络应用程序的设置里面……而不是在网络设置里…… - -KDE,你这是要杀了我啊,你有“系统设置”当凶器,拿着它动手吧! - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=4 - -作者:Eric Griffith -译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出