mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-29 04:23:33 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
# 如何在 Ubuntu 以及其他 Linux 发行版上安装 Popcorn Time
|
||||
如何在 Ubuntu 18.04 上安装 Popcorn Time
|
||||
======
|
||||
|
||||
**简要:这篇教程展示给你如何在 Ubuntu 和其他 Linux 发行版上安装 Popcorn Time,也会讨论一些 Popcorn Time 的便捷操作**
|
||||
> 简要:这篇教程展示给你如何在 Ubuntu 和其他 Linux 发行版上安装 Popcorn Time,也会讨论一些 Popcorn Time 的便捷操作。
|
||||
|
||||
[Popcorn Time][1] 是一个受开源 [Netflix][2] 启发的 [torrent][3] 流媒体应用,可以在 Linux,Mac上Windows 上运行。
|
||||
[Popcorn Time][1] 是一个受 [Netflix][2] 启发的开源的 [torrent][3] 流媒体应用,可以在 Linux、Mac、Windows 上运行。
|
||||
|
||||
传统的 torrents,在你看影片之前必须等待它下载完成。
|
||||
传统的 torrent,在你看影片之前必须等待它下载完成。
|
||||
|
||||
[Popcorn Time][4] 有所不同。它的使用基于 torrent,但是允许你(几乎)立即开始观看影片。他跟你在 Youtube 或者 Netflix 等流媒体网页上看影片一样,无需等待它下载完成。
|
||||
[Popcorn Time][4] 有所不同。它的使用基于 torrent,但是允许你(几乎)立即开始观看影片。它跟你在 Youtube 或者 Netflix 等流媒体网页上看影片一样,无需等待它下载完成。
|
||||
|
||||
![Popcorn Time in Ubuntu Linux][5]
|
||||
Popcorn Time
|
||||
|
||||
如果你不想在看在线电影时被突如其来的广告吓倒的话,Popcorn Time 是一个不错的选择。不过要记得,它的播放质量依赖于当前网络中可用的种子(seeds)数。
|
||||
*Popcorn Time*
|
||||
|
||||
Popcorn Time 还提供了一个不错的用户界面,让你能够浏览可用的电影,电视剧和其他视频内容。如果你曾经[在 Linux 上使用过 Netflix][6],你会发现两者有一些相似之处。
|
||||
如果你不想在看在线电影时被突如其来的广告吓倒的话,Popcorn Time 是一个不错的选择。不过要记得,它的播放质量依赖于当前网络中可用的<ruby>种子<rt>seed</rt></ruby>数。
|
||||
|
||||
有些国家严格打击盗版,所以使用 torrent 下载电影是违法行为。在类似美国,英国和西欧等一些国家,你或许曾经收到过法律声明。也就是说,是否使用取决于你。已经警告过你了。
|
||||
(如果你仍想要冒险使用 Popcorn Time,你应该使用像 [Ivacy][7] 这样的 VPN 服务,它为使用 Torrents 和保护隐私有特别的设计。即便这样,也不能完全避免被查到。)
|
||||
Popcorn Time 还提供了一个不错的用户界面,让你能够浏览可用的电影、电视剧和其他视频内容。如果你曾经[在 Linux 上使用过 Netflix][6],你会发现两者有一些相似之处。
|
||||
|
||||
有些国家严格打击盗版,所以使用 torrent 下载电影是违法行为。在类似美国、英国和西欧等一些国家,你或许曾经收到过法律声明。也就是说,是否使用取决于你。已经警告过你了。
|
||||
|
||||
Popcorn Time 一些主要的特点:
|
||||
|
||||
@@ -24,39 +25,42 @@ Popcorn Time 一些主要的特点:
|
||||
* 有一个时尚的用户界面让你浏览可用的电影和电视剧资源
|
||||
* 调整流媒体的质量
|
||||
* 标记为稍后观看
|
||||
* 下载为离线观看
|
||||
* 下载为离线观看
|
||||
* 可以默认开启字幕,改变字母尺寸等
|
||||
* 使用键盘快捷键浏览
|
||||
|
||||
|
||||
### 如何在 Ubuntu 和其它 Linux 发行版上安装 Popcorn Time
|
||||
|
||||
这篇教程以 Ubuntu 18.04 为例,但是你可以使用类似的结构,在例如 Linux Mint,Debian,Manjaro,Deepin等 Linux 发行版上安装。
|
||||
这篇教程以 Ubuntu 18.04 为例,但是你可以使用类似的说明,在例如 Linux Mint、Debian、Manjaro、Deepin 等 Linux 发行版上安装。
|
||||
|
||||
Popcorn Time 在 Deepin Linux 的软件中心中也可用。Manjaro 和 Arch 用户也可以轻松地使用 AUR 来安装 Popcorn Time。
|
||||
|
||||
接下来我们看该如何在 Linux 上安装 Popcorn Time。事实上,这个过程非常简单。只需要按照说明操作复制粘贴我提到的这些命令即可。
|
||||
|
||||
#### 第一步:下载 Popcorn Time
|
||||
|
||||
你可以从它的官网上安装 Popcorn Time。它主页上的下载链接是。
|
||||
[Get Popcorn Time](https://popcorntime.sh/)
|
||||
你可以从它的官网上安装 Popcorn Time。下载链接在它的主页上。
|
||||
|
||||
- [下载 Popcorn Time](https://popcorntime.sh/)
|
||||
|
||||
#### 第二步:安装 Popcorn Time
|
||||
|
||||
下载完成之后,就该使用它了。下载下来的是一个 tar 文件,在这些文件里面包含有一个可执行文件。你可以把 tar 文件提取在任何位置,[Linux 常把附加软件安装在][8] /[opt 目录。][8]
|
||||
下载完成之后,就该使用它了。下载下来的是一个 tar 文件,在这些文件里面包含有一个可执行文件。你可以把 tar 文件提取在任何位置,[Linux 常把附加软件安装在][8] [/opt 目录][8]。
|
||||
|
||||
在 /opt 下创建一个新的目录:
|
||||
在 `/opt` 下创建一个新的目录:
|
||||
|
||||
```
|
||||
sudo mkdir /opt/popcorntime
|
||||
```
|
||||
|
||||
现在进入你下载文件的文件夹中,比如我把 Popcorn Time 下载到了主目录的 Downloads目录下。
|
||||
现在进入你下载文件的文件夹中,比如我把 Popcorn Time 下载到了主目录的 Downloads 目录下。
|
||||
|
||||
```
|
||||
cd ~/Downloads
|
||||
```
|
||||
|
||||
提取下载好的 Popcorn Time 文件到新创建的 /opt/popcorntime 目录下
|
||||
提取下载好的 Popcorn Time 文件到新创建的 `/opt/popcorntime` 目录下:
|
||||
|
||||
```
|
||||
sudo tar Jxf Popcorn-Time-* -C /opt/popcorntime
|
||||
@@ -64,7 +68,7 @@ sudo tar Jxf Popcorn-Time-* -C /opt/popcorntime
|
||||
|
||||
#### 第三步:让所有用户可以使用 Popcorn Time
|
||||
|
||||
如果你想要系统中所有的用户无需经过 sudo 就可以运行 Popcorn Time。你需要在 /usr/bin 目录下创建一个[符号链接(软链接)][9]指向这个可执行文件。
|
||||
如果你想要系统中所有的用户无需经过 `sudo` 就可以运行 Popcorn Time。你需要在 `/usr/bin` 目录下创建一个[符号链接(软链接)][9]指向这个可执行文件。
|
||||
|
||||
```
|
||||
ln -sf /opt/popcorntime/Popcorn-Time /usr/bin/Popcorn-Time
|
||||
@@ -76,13 +80,13 @@ ln -sf /opt/popcorntime/Popcorn-Time /usr/bin/Popcorn-Time
|
||||
|
||||
为此,你需要创建一个桌面入口。
|
||||
|
||||
打开一个终端窗口,在 /usr/share/applications 目录下创建一个名为 popcorntime.desktop 的文件。
|
||||
打开一个终端窗口,在 `/usr/share/applications` 目录下创建一个名为 `popcorntime.desktop` 的文件。
|
||||
|
||||
你可以使用任何[基于命令行的文本编辑器][10]。Ubuntu 默认安装了 [Nano][11],所以你可以直接使用这个。
|
||||
|
||||
```
|
||||
sudo nano /usr/share/applications/popcorntime.desktop
|
||||
```
|
||||
```
|
||||
|
||||
在里面插入以下内容:
|
||||
|
||||
@@ -95,11 +99,11 @@ Name = Popcorn-Time
|
||||
Exec = /usr/bin/Popcorn-Time
|
||||
Icon = /opt/popcorntime/popcorn.png
|
||||
Categories = Application;
|
||||
```
|
||||
```
|
||||
|
||||
如果你使用的是 Nano 编辑器,使用 Ctrl+X 保存输入的内容,当询问是否保存时,输入 Y,然后按回车保存并退出。
|
||||
如果你使用的是 Nano 编辑器,使用 `Ctrl+X` 保存输入的内容,当询问是否保存时,输入 `Y`,然后按回车保存并退出。
|
||||
|
||||
就快要完成了。最后一件事就是为 Popcorn Time 设置一个正确的图标。你可以下载一个 Popcorn Time 图标到 /opt/popcorntime 目录下,并命名为 popcorn.png。
|
||||
就快要完成了。最后一件事就是为 Popcorn Time 设置一个正确的图标。你可以下载一个 Popcorn Time 图标到 `/opt/popcorntime` 目录下,并命名为 `popcorn.png`。
|
||||
|
||||
你可以使用以下命令:
|
||||
|
||||
@@ -109,13 +113,15 @@ sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia
|
||||
|
||||
这样就 OK 了。现在你可以搜索 Popcorn Time 然后点击启动它了。
|
||||
|
||||
![Popcorn Time installed on Ubuntu][12]
|
||||
在菜单里搜索 Popcorn Time
|
||||
![Popcorn Time installed on Ubuntu][12]
|
||||
|
||||
*在菜单里搜索 Popcorn Time*
|
||||
|
||||
第一次启动时,你必须接受这些条款和条件。
|
||||
|
||||
![Popcorn Time in Ubuntu][13]
|
||||
接受这些服务条款
|
||||
|
||||
*接受这些服务条款*
|
||||
|
||||
一旦你完成这些,你就可以享受你的电影和电视节目了。
|
||||
|
||||
@@ -123,22 +129,17 @@ sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia
|
||||
|
||||
好了,这就是所有你在 Ubuntu 或者其他 Linux 发行版上安装 Popcorn Time 所需要的了。你可以直接开始看你最喜欢的影视节目了。
|
||||
|
||||
当然,如果你有兴趣的话,我建议你阅读以下关于 Popcorn Time 的小贴士,可以学到更多。
|
||||
|
||||
[![][15]][16]
|
||||
![][17]
|
||||
|
||||
### 高效使用 Popcorn Time 的七个小贴士
|
||||
|
||||
现在你已经安装好了 Popcorn Time 了,我接下来将要告诉你一些有用的 Popcorn Time 技巧。我保证它会增强你使用 Popcorn Time 的体验。
|
||||
|
||||
#### 1\. 使用高级设置
|
||||
#### 1、 使用高级设置
|
||||
|
||||
始终启用高级设置。它给了你更多的选项去调整 Popcorn Time 点击右上角的齿轮标记。查看其中的高级设置。
|
||||
|
||||

|
||||
|
||||
#### 2\. 在 VLC 或者其他播放器里观看影片
|
||||
#### 2、 在 VLC 或者其他播放器里观看影片
|
||||
|
||||
你知道你可以选择自己喜欢的播放器而不是 Popcorn Time 默认的播放器观看一个视频吗?当然,这个播放器必须已经安装在你的系统上了。
|
||||
|
||||
@@ -148,29 +149,29 @@ sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia
|
||||
|
||||

|
||||
|
||||
#### 3\. 将影片标记为稍后观看
|
||||
#### 3、 将影片标记为稍后观看
|
||||
|
||||
只是浏览电影和电视节目,但是却没有时间和精力去看?这不是问题。你可以添加这些影片到书签里面,稍后可以在 Faveriate 标签里面访问这些影片。这可以让你创建一个你想要稍后观看的列表。
|
||||
|
||||

|
||||
|
||||
#### 4\. 检查 torrent 的信息和种子信息
|
||||
#### 4、 检查 torrent 的信息和种子信息
|
||||
|
||||
像我之前提到的,你在 Popcorn Time 的观看体验依赖于 torrent 的速度。好消息是 Popcorn Time 显示了 torrent 的信息,因此你可以知道流媒体的速度。
|
||||
|
||||
你可以在文件上看到一个绿色 / 黄色 / 红色的点。绿色意味着有足够的种子,文件很容易播放。黄色意味着有中等数量的种子,应该可以播放。红色意味着只有非常少可用的种子,播放的速度会很慢甚至无法观看。
|
||||
你可以在文件上看到一个绿色/黄色/红色的点。绿色意味着有足够的种子,文件很容易播放。黄色意味着有中等数量的种子,应该可以播放。红色意味着只有非常少可用的种子,播放的速度会很慢甚至无法观看。
|
||||
|
||||

|
||||
|
||||
#### 5\. 添加自定义字幕
|
||||
#### 5、 添加自定义字幕
|
||||
|
||||
如果你需要字幕而且它没有你想要的语言,你可以从外部网站下载自定义字幕。得到 .src 文件,然后就可以在 Popcorn Time 中使用它:
|
||||
|
||||

|
||||
|
||||
这是[用 VLC 自动下载字幕][19]
|
||||
你可以[用 VLC 自动下载字幕][19]。
|
||||
|
||||
#### 6\. 保存文件离线观看
|
||||
#### 6、 保存文件离线观看
|
||||
|
||||
用 Popcorn Time 播放内容时,它会下载并暂时存储这些内容。当你关闭 APP 时,缓存会被清理干净。你可以更改这个操作,使得下载的文件可以保存下来供你未来使用。
|
||||
|
||||
@@ -178,7 +179,7 @@ sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia
|
||||
|
||||

|
||||
|
||||
#### 7\. 拖放外部 torrent 文件立即播放
|
||||
#### 7、 拖放外部 torrent 文件立即播放
|
||||
|
||||
我猜你不知道这个操作。如果你没有在 Popcorn Time 发现某些影片,从你最喜欢的 torrent 网站下载 torrent 文件,打开 Popcorn Time,然后拖放这个 torrent 文件到 Popcorn Time 里面。它将会立即播放文件,当然这个取决于种子。这次你不需要在观看前下载整个文件了。
|
||||
|
||||
@@ -188,10 +189,7 @@ sudo wget -O /opt/popcorntime/popcorn.png https://upload.wikimedia.org/wikipedia
|
||||
|
||||
在 Popcorn Time 里面有很多的功能,但是我决定就此打住,剩下的就由你自己来探索吧。我希望你能发现更多 Popcorn Time 有用的功能和技巧。
|
||||
|
||||
我再提醒一遍,使用 Torrents 在很多国家是违法的。如果你还是这样做了,请做好防护措施,并使用 VPN 服务。如果你想要我的建议,你可以去看一下(让 [ProtonMail][21] 成名的)[瑞士的隐私公司 ProtonVPN][20]。新加坡的 [Ivacy][7] 也是一个不错的选择。如果你觉得这些都太贵了,你可以看一下[在 FOSS SHOP 上廉价的 VPN][22]
|
||||
|
||||
注意:这篇文章里包含了会员链接,请阅读我们的[会员隐私][23]。
|
||||
|
||||
我再提醒一遍,使用 Torrents 在很多国家是违法的。
|
||||
|
||||
-----------------------------------
|
||||
|
||||
@@ -200,7 +198,7 @@ via: https://itsfoss.com/popcorn-time-ubuntu-linux/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[dianbanjiu](https://github.com/dianbanjiu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
HankChow translating
|
||||
|
||||
5 Essential Tools for Linux Development
|
||||
======
|
||||
|
||||

|
||||
|
||||
Linux has become a mainstay for many sectors of work, play, and personal life. We depend upon it. With Linux, technology is expanding and evolving faster than anyone could have imagined. That means Linux development is also happening at an exponential rate. Because of this, more and more developers will be hopping on board the open source and Linux dev train in the immediate, near, and far-off future. For that, people will need tools. Fortunately, there are a ton of dev tools available for Linux; so many, in fact, that it can be a bit intimidating to figure out precisely what you need (especially if you’re coming from another platform).
|
||||
|
||||
To make that easier, I thought I’d help narrow down the selection a bit for you. But instead of saying you should use Tool X and Tool Y, I’m going to narrow it down to five categories and then offer up an example for each. Just remember, for most categories, there are several available options. And, with that said, let’s get started.
|
||||
|
||||
### Containers
|
||||
|
||||
Let’s face it, in this day and age you need to be working with containers. Not only are they incredibly easy to deploy, they make for great development environments. If you regularly develop for a specific platform, why not do so by creating a container image that includes all of the tools you need to make the process quick and easy. With that image available, you can then develop and roll out numerous instances of whatever software or service you need.
|
||||
|
||||
Using containers for development couldn’t be easier than it is with [Docker][1]. The advantages of using containers (and Docker) are:
|
||||
|
||||
* Consistent development environment.
|
||||
|
||||
* You can trust it will “just work” upon deployment.
|
||||
|
||||
* Makes it easy to build across platforms.
|
||||
|
||||
* Docker images available for all types of development environments and languages.
|
||||
|
||||
* Deploying single containers or container clusters is simple.
|
||||
|
||||
|
||||
|
||||
|
||||
Thanks to [Docker Hub][2], you’ll find images for nearly any platform, development environment, server, service… just about anything you need. Using images from Docker Hub means you can skip over the creation of the development environment and go straight to work on developing your app, server, API, or service.
|
||||
|
||||
Docker is easily installable of most every Linux platform. For example: To install Docker on Ubuntu, you only have to open a terminal window and issue the command:
|
||||
```
|
||||
sudo apt-get install docker.io
|
||||
|
||||
```
|
||||
|
||||
With Docker installed, you’re ready to start pulling down specific images, developing, and deploying (Figure 1).
|
||||
|
||||
![Docker images][4]
|
||||
|
||||
Figure 1: Docker images ready to deploy.
|
||||
|
||||
[Used with permission][5]
|
||||
|
||||
### Version control system
|
||||
|
||||
If you’re working on a large project or with a team on a project, you’re going to need a version control system. Why? Because you need to keep track of your code, where your code is, and have an easy means of making commits and merging code from others. Without such a tool, your projects would be nearly impossible to manage. For Linux users, you cannot beat the ease of use and widespread deployment of [Git][6] and [GitHub][7]. If you’re new to their worlds, Git is the version control system that you install on your local machine and GitHub is the remote repository you use to upload (and then manage) your projects. Git can be installed on most Linux distributions. For example, on a Debian-based system, the install is as simple as:
|
||||
```
|
||||
sudo apt-get install git
|
||||
|
||||
```
|
||||
|
||||
Once installed, you are ready to start your journey with version control (Figure 2).
|
||||
|
||||
![Git installed][9]
|
||||
|
||||
Figure 2: Git is installed and available for many important tasks.
|
||||
|
||||
[Used with permission][5]
|
||||
|
||||
Github requires you to create an account. You can use it for free for non-commercial projects, or you can pay for commercial project housing (for more information check out the price matrix [here][10]).
|
||||
|
||||
### Text editor
|
||||
|
||||
Let’s face it, developing on Linux would be a bit of a challenge without a text editor. Of course what a text editor is varies, depending upon who you ask. One person might say vim, emacs, or nano, whereas another might go full-on GUI with their editor. But since we’re talking development, we need a tool that can meet the needs of the modern day developer. And before I mention a couple of text editors, I will say this: Yes, I know that vim is a serious workhorse for serious developers and, if you know it well vim will meet and exceed all of your needs. However, getting up to speed enough that it won’t be in your way, can be a bit of a hurdle for some developers (especially those new to Linux). Considering my goal is to always help win over new users (and not just preach to an already devout choir), I’m taking the GUI route here.
|
||||
|
||||
As far as text editors are concerned, you cannot go wrong with the likes of [Bluefish][11]. Bluefish can be found in most standard repositories and features project support, multi-threaded support for remote files, search and replace, open files recursively, snippets sidebar, integrates with make, lint, weblint, xmllint, unlimited undo/redo, in-line spell checker, auto-recovery, full screen editing, syntax highlighting (Figure 3), support for numerous languages, and much more.
|
||||
|
||||
![Bluefish][13]
|
||||
|
||||
Figure 3: Bluefish running on Ubuntu Linux 18.04.
|
||||
|
||||
[Used with permission][5]
|
||||
|
||||
### IDE
|
||||
|
||||
Integrated Development Environment (IDE) is a piece of software that includes a comprehensive set of tools that enable a one-stop-shop environment for developing. IDEs not only enable you to code your software, but document and build them as well. There are a number of IDEs for Linux, but one in particular is not only included in the standard repositories it is also very user-friendly and powerful. That tool in question is [Geany][14]. Geany features syntax highlighting, code folding, symbol name auto-completion, construct completion/snippets, auto-closing of XML and HTML tags, call tips, many supported filetypes, symbol lists, code navigation, build system to compile and execute your code, simple project management, and a built-in plugin system.
|
||||
|
||||
Geany can be easily installed on your system. For example, on a Debian-based distribution, issue the command:
|
||||
```
|
||||
sudo apt-get install geany
|
||||
|
||||
```
|
||||
|
||||
Once installed, you’re ready to start using this very powerful tool that includes a user-friendly interface (Figure 4) that has next to no learning curve.
|
||||
|
||||
![Geany][16]
|
||||
|
||||
Figure 4: Geany is ready to serve as your IDE.
|
||||
|
||||
[Used with permission][5]
|
||||
|
||||
### diff tool
|
||||
|
||||
There will be times when you have to compare two files to find where they differ. This could be two different copies of what was the same file (only one compiles and the other doesn’t). When that happens, you don’t want to have to do that manually. Instead, you want to employ the power of tool like [Meld][17]. Meld is a visual diff and merge tool targeted at developers. With Meld you can make short shrift out of discovering the differences between two files. Although you can use a command line diff tool, when efficiency is the name of the game, you can’t beat Meld.
|
||||
|
||||
Meld allows you to open a comparison between to files and it will highlight the differences between each. Meld also allows you to merge comparisons either from the right or the left (as the files are opened side by side - Figure 5).
|
||||
|
||||
![Comparing two files][19]
|
||||
|
||||
Figure 5: Comparing two files with a simple difference.
|
||||
|
||||
[Used with permission][5]
|
||||
|
||||
Meld can be installed from most standard repositories. On a Debian-based system, the installation command is:
|
||||
```
|
||||
sudo apt-get install meld
|
||||
|
||||
```
|
||||
|
||||
### Working with efficiency
|
||||
|
||||
These five tools not only enable you to get your work done, they help to make it quite a bit more efficient. Although there are a ton of developer tools available for Linux, you’re going to want to make sure you have one for each of the above categories (maybe even starting with the suggestions I’ve made).
|
||||
|
||||
Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/intro-to-linux/2018/8/5-essential-tools-linux-development
|
||||
|
||||
作者:[Jack Wallen][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/jlwallen
|
||||
[1]:https://www.docker.com/
|
||||
[2]:https://hub.docker.com/
|
||||
[3]:/files/images/5devtools1jpg
|
||||
[4]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_1.jpg?itok=V1Bsbkg9 (Docker images)
|
||||
[5]:/licenses/category/used-permission
|
||||
[6]:https://git-scm.com/
|
||||
[7]:https://github.com/
|
||||
[8]:/files/images/5devtools2jpg
|
||||
[9]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_2.jpg?itok=YJjhe4O6 (Git installed)
|
||||
[10]:https://github.com/pricing
|
||||
[11]:http://bluefish.openoffice.nl/index.html
|
||||
[12]:/files/images/5devtools3jpg
|
||||
[13]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_3.jpg?itok=66A7Svme (Bluefish)
|
||||
[14]:https://www.geany.org/
|
||||
[15]:/files/images/5devtools4jpg
|
||||
[16]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_4.jpg?itok=jRcA-0ue (Geany)
|
||||
[17]:http://meldmerge.org/
|
||||
[18]:/files/images/5devtools5jpg
|
||||
[19]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_5.jpg?itok=eLkfM9oZ (Comparing two files)
|
||||
[20]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
||||
@@ -1,33 +1,35 @@
|
||||
如何在 Linux 中配置基于密钥认证的 SSH
|
||||
如何在 Linux 中配置基于密钥认证的 SSH
|
||||
======
|
||||
|
||||

|
||||
|
||||
### 什么是基于 SSH密钥的认证?
|
||||
### 什么是基于 SSH 密钥的认证?
|
||||
|
||||
众所周知,**Secure Shell**,又称 **SSH**,是允许你通过无安全网络(例如 Internet)和远程系统之间安全访问/通信的加密网络协议。无论何时使用 SSH 在无安全网络上发送数据,它都会在源系统上自动地被加密,并且在目的系统上解密。SSH 提供了四种加密方式,**基于密码认证**,**基于密钥认证**,**基于主机认证**和**键盘认证**。最常用的认证方式是基于密码认证和基于密钥认证。
|
||||
众所周知,**Secure Shell**,又称 **SSH**,是允许你通过无安全网络(例如 Internet)和远程系统之间安全访问/通信的加密网络协议。无论何时使用 SSH 在无安全网络上发送数据,它都会在源系统上自动地被加密,并且在目的系统上解密。SSH 提供了四种加密方式,**基于密码认证**,**基于密钥认证**,**基于主机认证**和**键盘认证**。最常用的认证方式是基于密码认证和基于密钥认证。
|
||||
|
||||
在基于密码认证中,你需要的仅仅是远程系统上用户的密码。如果你知道远程用户的密码,你可以使用**“ssh[[email protected]][1]”**访问各自的系统。另一方面,在基于密钥认证中,为了通过 SSH 通信,你需要生成 SSH 密钥对,并且为远程系统上传 SSH 公钥。每个 SSH 密钥对由私钥与公钥组成。私钥应该保存在客户系统上,公钥应该上传给远程系统。你不应该将私钥透露给任何人。希望你已经对 SSH 和它的认证方式有了基本的概念。
|
||||
在基于密码认证中,你需要的仅仅是远程系统上用户的密码。如果你知道远程用户的密码,你可以使用 `ssh user@remote-system-name` 访问各自的系统。另一方面,在基于密钥认证中,为了通过 SSH 通信,你需要生成 SSH 密钥对,并且为远程系统上传 SSH 公钥。每个 SSH 密钥对由私钥与公钥组成。私钥应该保存在客户系统上,公钥应该上传给远程系统。你不应该将私钥透露给任何人。希望你已经对 SSH 和它的认证方式有了基本的概念。
|
||||
|
||||
这篇教程,我们将讨论如何在 linux 上配置基于密钥认证的 SSH。
|
||||
这篇教程,我们将讨论如何在 Linux 上配置基于密钥认证的 SSH。
|
||||
|
||||
### 在 Linux 上配置基于密钥认证的SSH
|
||||
### 在 Linux 上配置基于密钥认证的 SSH
|
||||
|
||||
为本篇教程起见,我将使用 Arch Linux 为本地系统,Ubuntu 18.04 LTS 为远程系统。
|
||||
为方便演示,我将使用 Arch Linux 为本地系统,Ubuntu 18.04 LTS 为远程系统。
|
||||
|
||||
本地系统详情:
|
||||
* **OS** : Arch Linux Desktop
|
||||
* **IP address** : 192.168.225.37 /24
|
||||
|
||||
* OS: Arch Linux Desktop
|
||||
* IP address: 192.168.225.37/24
|
||||
|
||||
远程系统详情:
|
||||
* **OS** : Ubuntu 18.04 LTS Server
|
||||
* **IP address** : 192.168.225.22/24
|
||||
|
||||
* OS: Ubuntu 18.04 LTS Server
|
||||
* IP address: 192.168.225.22/24
|
||||
|
||||
### 本地系统配置
|
||||
|
||||
就像我之前所说,在基于密钥认证的方法中,想要通过 SSH 访问远程系统,就应该将公钥上传给它。公钥通常会被保存在远程系统的一个文件**~/.ssh/authorized_keys** 中。
|
||||
就像我之前所说,在基于密钥认证的方法中,想要通过 SSH 访问远程系统,需要将公钥上传到远程系统。公钥通常会被保存在远程系统的一个 `~/.ssh/authorized_keys` 文件中。
|
||||
|
||||
**注意事项:**不要使用**root** 用户生成密钥对,这样只有 root 用户才可以使用。使用普通用户创建密钥对。
|
||||
**注意事项**:不要使用 **root** 用户生成密钥对,这样只有 root 用户才可以使用。使用普通用户创建密钥对。
|
||||
|
||||
现在,让我们在本地系统上创建一个 SSH 密钥对。只需要在客户端系统上运行下面的命令。
|
||||
|
||||
@@ -35,9 +37,9 @@
|
||||
$ ssh-keygen
|
||||
```
|
||||
|
||||
上面的命令将会创建一个 2048 位的 RSA 密钥对。输入两次密码。更重要的是,记住你的密码。后面将会用到它。
|
||||
上面的命令将会创建一个 2048 位的 RSA 密钥对。你需要输入两次密码。更重要的是,记住你的密码。后面将会用到它。
|
||||
|
||||
**样例输出**
|
||||
**样例输出**:
|
||||
|
||||
```
|
||||
Generating public/private rsa key pair.
|
||||
@@ -62,22 +64,22 @@ The key's randomart image is:
|
||||
+----[SHA256]-----+
|
||||
```
|
||||
|
||||
如果你已经创建了密钥对,你将看到以下信息。输入 ‘y’ 就会覆盖已存在的密钥。
|
||||
如果你已经创建了密钥对,你将看到以下信息。输入 y 就会覆盖已存在的密钥。
|
||||
|
||||
```
|
||||
/home/username/.ssh/id_rsa already exists.
|
||||
Overwrite (y/n)?
|
||||
```
|
||||
|
||||
请注意**密码是可选的**。如果你输入了密码,那么每次通过 SSH 访问远程系统时都要求输入密码,除非你使用了 SSH 代理保存了密码。如果你不想要密码(虽然不安全),简单地输入两次 ENTER。不过,我们建议你使用密码。从安全的角度来看,使用无密码的 ssh 密钥对大体上不是一个很好的主意。 这种方式应该限定在特殊的情况下使用,例如,没有用户介入的服务访问远程系统。(例如,用 rsync 远程备份...)
|
||||
请注意**密码是可选的**。如果你输入了密码,那么每次通过 SSH 访问远程系统时都要求输入密码,除非你使用了 SSH 代理保存了密码。如果你不想要密码(虽然不安全),简单地敲两次回车。不过,我建议你使用密码。从安全的角度来看,使用无密码的 ssh 密钥对不是什么好主意。这种方式应该限定在特殊的情况下使用,例如,没有用户介入的服务访问远程系统。(例如,用 rsync 远程备份……)
|
||||
|
||||
如果你已经在个人文件 **~/.ssh/id_rsa** 中有了无密码的密钥对,但想要更新为带密码的密钥。使用下面的命令:
|
||||
如果你已经在个人文件 `~/.ssh/id_rsa` 中有了无密码的密钥,但想要更新为带密码的密钥。使用下面的命令:
|
||||
|
||||
```
|
||||
$ ssh-keygen -p -f ~/.ssh/id_rsa
|
||||
```
|
||||
|
||||
样例输出:
|
||||
**样例输出**:
|
||||
|
||||
```
|
||||
Enter new passphrase (empty for no passphrase):
|
||||
@@ -91,40 +93,40 @@ Your identification has been saved with the new passphrase.
|
||||
$ ssh-copy-id sk@192.168.225.22
|
||||
```
|
||||
|
||||
在这,我把本地(Arch Linux)系统上的公钥拷贝到了远程系统(Ubuntu 18.04 LTS)上。从技术上讲,上面的命令会把本地系统 **~/.ssh/id_rsa.pub key** 文件中的内容拷贝到远程系统**~/.ssh/authorized_keys** 中。明白了吗?非常棒。
|
||||
在这里,我把本地(Arch Linux)系统上的公钥拷贝到了远程系统(Ubuntu 18.04 LTS)上。从技术上讲,上面的命令会把本地系统 `~/.ssh/id_rsa.pub` 文件中的内容拷贝到远程系统 `~/.ssh/authorized_keys` 中。明白了吗?非常棒。
|
||||
|
||||
输入 **yes** 来继续连接你的远程 SSH 服务端。接着,输入远程系统 root 用户的密码。
|
||||
输入 yes 来继续连接你的远程 SSH 服务端。接着,输入远程系统 sk 用户的密码。
|
||||
|
||||
```
|
||||
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
|
||||
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
|
||||
[email protected]2.168.225.22's password:
|
||||
sk@192.168.225.22's password:
|
||||
|
||||
Number of key(s) added: 1
|
||||
|
||||
Now try logging into the machine, with: "ssh '[email protected]'"
|
||||
Now try logging into the machine, with: "ssh 'sk@192.168.225.22'"
|
||||
and check to make sure that only the key(s) you wanted were added.
|
||||
```
|
||||
|
||||
如果你已经拷贝了密钥,但想要替换为新的密码,使用 **-f** 选项覆盖已有的密钥。
|
||||
如果你已经拷贝了密钥,但想要替换为新的密码,使用 `-f` 选项覆盖已有的密钥。
|
||||
|
||||
```
|
||||
$ ssh-copy-id -f sk@192.168.225.22
|
||||
```
|
||||
|
||||
我们现在已经成功地将本地系统的 SSH 公钥添加进了远程系统。现在,让我们在远程系统上完全禁用掉基于密码认证的方式。因为,我们已经配置了密钥认证,因此我们不再需要密码认证了。
|
||||
我们现在已经成功地将本地系统的 SSH 公钥添加进了远程系统。现在,让我们在远程系统上完全禁用掉基于密码认证的方式。因为我们已经配置了密钥认证,因此不再需要密码认证了。
|
||||
|
||||
### 在远程系统上禁用基于密码认证的 SSH
|
||||
|
||||
你需要在 root 或者 sudo 用户下执行下面的命令。
|
||||
|
||||
为了禁用基于密码的认证,你需要在远程系统的控制台上编辑 **/etc/ssh/sshd_config** 配置文件:
|
||||
禁用基于密码的认证,你需要在远程系统的终端里编辑 `/etc/ssh/sshd_config` 配置文件:
|
||||
|
||||
```
|
||||
$ sudo vi /etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
找到下面这一行,去掉注释然后将值设为 **no**
|
||||
找到下面这一行,去掉注释然后将值设为 `no`:
|
||||
|
||||
```
|
||||
PasswordAuthentication no
|
||||
@@ -146,19 +148,19 @@ $ ssh sk@192.168.225.22
|
||||
|
||||
输入密码。
|
||||
|
||||
**样例输出:**
|
||||
**样例输出**:
|
||||
|
||||
```
|
||||
Enter passphrase for key '/home/sk/.ssh/id_rsa':
|
||||
Last login: Mon Jul 9 09:59:51 2018 from 192.168.225.37
|
||||
[email protected]:~$
|
||||
sk@ubuntuserver:~$
|
||||
```
|
||||
|
||||
现在,你就能 SSH 你的远程系统了。如你所见,我们已经使用之前 **ssh-keygen** 创建的密码登录进了远程系统的账户,而不是使用账户实际的密码。
|
||||
现在,你就能 SSH 你的远程系统了。如你所见,我们已经使用之前 `ssh-keygen` 创建的密码登录进了远程系统的账户,而不是使用当前账户实际的密码。
|
||||
|
||||
如果你试图从其他客户端系统 ssh (远程系统),你将会得到这条错误信息。比如,我试图通过命令从 CentOS SSH 访问 Ubuntu 系统:
|
||||
如果你试图从其它客户端系统 ssh(远程系统),你将会得到这条错误信息。比如,我试图通过命令从 CentOS SSH 访问 Ubuntu 系统:
|
||||
|
||||
**样例输出:**
|
||||
**样例输出**:
|
||||
|
||||
```
|
||||
The authenticity of host '192.168.225.22 (192.168.225.22)' can't be established.
|
||||
@@ -168,7 +170,7 @@ Warning: Permanently added '192.168.225.22' (ECDSA) to the list of known hosts.
|
||||
Permission denied (publickey).
|
||||
```
|
||||
|
||||
如你所见,除了 CentOS (译注:根据上文,这里应该是 Arch) 系统外,我不能通过其他任何系统 SSH 访问我的远程系统 Ubuntu 18.04。
|
||||
如你所见,除了 CentOS(译注:根据上文,这里应该是 Arch)系统外,我不能通过其它任何系统 SSH 访问我的远程系统 Ubuntu 18.04。
|
||||
|
||||
### 为 SSH 服务端添加更多客户端系统的密钥
|
||||
|
||||
@@ -180,21 +182,21 @@ Permission denied (publickey).
|
||||
$ ssh-keygen
|
||||
```
|
||||
|
||||
输入两次密码。现在, ssh 密钥对已经生成了。你需要手动把公钥(不是私钥)拷贝到远程服务端上。
|
||||
输入两次密码。现在,ssh 密钥对已经生成了。你需要手动把公钥(不是私钥)拷贝到远程服务端上。
|
||||
|
||||
使用命令查看公钥:
|
||||
使用以下命令查看公钥:
|
||||
|
||||
```
|
||||
$ cat ~/.ssh/id_rsa.pub
|
||||
```
|
||||
|
||||
应该会输出如下信息:
|
||||
应该会输出类似下面的信息:
|
||||
|
||||
```
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCt3a9tIeK5rPx9p74/KjEVXa6/OODyRp0QLS/sLp8W6iTxFL+UgALZlupVNgFjvRR5luJ9dLHWwc+d4umavAWz708e6Na9ftEPQtC28rTFsHwmyLKvLkzcGkC5+A0NdbiDZLaK3K3wgq1jzYYKT5k+IaNS6vtrx5LDObcPNPEBDt4vTixQ7GZHrDUUk5586IKeFfwMCWguHveTN7ykmo2EyL2rV7TmYq+eY2ZqqcsoK0fzXMK7iifGXVmuqTkAmZLGZK8a3bPb6VZd7KFum3Ezbu4BXZGp7FVhnOMgau2kYeOH/ItKPzpCAn+dg3NAAziCCxnII9b4nSSGz3mMY4Y7 ostechnix@centosserver
|
||||
```
|
||||
|
||||
拷贝所有内容(通过 USB 驱动器或者其它任何介质),然后去你的远程服务端的控制台。像下面那样,在 home 下创建文件夹叫做 **ssh**。你需要以 root 身份执行命令。
|
||||
拷贝所有内容(通过 USB 驱动器或者其它任何介质),然后去你的远程服务端的终端,像下面那样,在 `$HOME` 下创建文件夹叫做 `.ssh`。你需要以 root 身份执行命令(注:不一定需要 root)。
|
||||
|
||||
```
|
||||
$ mkdir -p ~/.ssh
|
||||
@@ -208,15 +210,16 @@ echo {Your_public_key_contents_here} >> ~/.ssh/authorized_keys
|
||||
|
||||
在远程系统上重启 ssh 服务。现在,你可以在新的客户端上 SSH 远程服务端了。
|
||||
|
||||
如果觉得手动添加 ssh 公钥有些困难,在远程系统上暂时性启用密码认证,使用 “ssh-copy-id“ 命令从本地系统上拷贝密钥,最后关闭密码认证。
|
||||
如果觉得手动添加 ssh 公钥有些困难,在远程系统上暂时性启用密码认证,使用 `ssh-copy-id` 命令从本地系统上拷贝密钥,最后禁用密码认证。
|
||||
|
||||
**推荐阅读:**
|
||||
|
||||
(译者注:在原文中此处有超链接)
|
||||
* [SSLH – Share A Same Port For HTTPS And SSH][1]
|
||||
* [ScanSSH – Fast SSH Server And Open Proxy Scanner][2]
|
||||
|
||||
好了,到此为止。基于密钥认证的 SSH 提供了一层防止暴力破解的额外保护。如你所见,配置密钥认证一点也不困难。这是一个非常好的方法让你的 Linux 服务端安全可靠。
|
||||
|
||||
不久我就会带来另一篇有用的文章。到那时,继续关注 OSTechNix。
|
||||
不久我会带来另一篇有用的文章。请继续关注 OSTechNix。
|
||||
|
||||
干杯!
|
||||
|
||||
@@ -227,9 +230,10 @@ via: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[LuuMing](https://github.com/LuuMing)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[pityonline](https://github.com/pityonline)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.ostechnix.com/author/sk/
|
||||
[1]:https://www.ostechnix.com/cdn-cgi/l/email-protection
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[1]: https://www.ostechnix.com/sslh-share-port-https-ssh/
|
||||
[2]: https://www.ostechnix.com/scanssh-fast-ssh-server-open-proxy-scanner/
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
Linux 开发的五大必备工具
|
||||
======
|
||||
|
||||

|
||||
|
||||
Linux 已经成为工作、娱乐和个人生活等多个领域的支柱,人们已经越来越离不开它。在 Linux 的帮助下,技术的发展速度超出了人们的想象,Linux 开发的速度也以指数规模增长。因此,越来越多的开发者也不断地加入开源和学习 Linux 开发地潮流当中。在这个过程之中,合适的工具是必不可少的,可喜的是,随着 Linux 的发展,大量适用于 Linux 的开发工具也不断成熟。甚至可以说,这样的工具已经多得有点惊人。
|
||||
|
||||
为了选择更合适自己的开发工具,缩小选择范围是很必要的。但是这篇文章并不会要求你必须使用某个工具,而只是缩小到五个工具类别,然后对每个类别提供一个例子。然而,对于大多数类别,都会有不止一种选择。下面我们来看一下。
|
||||
|
||||
### 容器
|
||||
|
||||
放眼于现实,现在已经是容器的时代了。容器既容易进行部署,又可以方便地构建开发环境。如果你针对的是特定的平台的开发,将开发流程所需要的各种工具都创建到容器映像中是一种很好的方法,只要使用这一个容器映像,就能够快速启动大量运行所需服务的实例。
|
||||
|
||||
一个使用容器的最佳范例是使用 [Docker][1],使用容器(或 Docker)有这些好处:
|
||||
|
||||
* 开发环境保持一致
|
||||
|
||||
* 部署后即可运行
|
||||
|
||||
* 易于跨平台部署
|
||||
|
||||
* Docker 映像适用于多种开发环境和语言
|
||||
|
||||
* 部署单个容器或容器集群都并不繁琐
|
||||
|
||||
|
||||
|
||||
通过 [Docker Hub][2],几乎可以找到适用于任何平台、任何开发环境、任何服务器,任何服务的映像,几乎可以满足任何一种需求。使用 Docker Hub 中的映像,就相当于免除了搭建开发环境的步骤,可以直接开始开发应用程序、服务器、API 或服务。
|
||||
|
||||
Docker 在所有 Linux 平台上都很容易安装,例如可以通过终端输入以下命令在 Ubuntu 上安装 Docker:
|
||||
```
|
||||
sudo apt-get install docker.io
|
||||
|
||||
```
|
||||
|
||||
Docker 安装完毕后,就可以从 Docker 仓库中拉取映像,然后开始开发和部署了(如下图)。
|
||||
|
||||
![Docker images][4]
|
||||
|
||||
|
||||
|
||||
### 版本控制工具
|
||||
|
||||
如果你正在开发一个巨大的项目,又或者参与团队开发,版本控制工具是必不可少的,它可以用于记录代码变更、提交代码以及合并代码。如果没有这样的工具,项目几乎无法妥善管理。在 Linux 系统上,[Git][6] 和 [GitHub][7] 的易用性和流行程度是其它版本控制工具无法比拟的。如果你对 Git 和 GitHub 还不太熟悉,可以简单理解为 Git 是在本地计算机上安装的版本控制系统,而 GitHub 则是用于上传和管理项目的远程存储库。 Git 可以安装在大多数的 Linux 发行版上。例如在基于 Debian 的系统上,只需要通过以下这一条简单的命令就可以安装:
|
||||
```
|
||||
sudo apt-get install git
|
||||
|
||||
```
|
||||
|
||||
安装完毕后,就可以使用 Git 来实施版本控制了(如下图)。
|
||||
|
||||
![Git installed][9]
|
||||
|
||||
|
||||
|
||||
Github 会要求用户创建一个帐户。用户可以免费使用 GitHub 来管理非商用项目,当然也可以使用 GitHub 的付费模式(更多相关信息,可以参阅[价格矩阵][10])。
|
||||
|
||||
### 文本编辑器
|
||||
|
||||
如果没有文本编辑器,在 Linux 上开发将会变得异常艰难。当然,文本编辑器之间孰优孰劣,具体还是要取决于开发者的需求。对于文本编辑器,有人可能会使用 vim、emacs 或 nano,也有人会使用带有 GUI 的编辑器。但由于重点在于开发,我们需要的是一种能够满足开发人员需求的工具。不过我首先要说,vim 对于开发人员来说确实是一个利器,但前提是要对 vim 非常熟悉,在这种前提下,vim 能够满足你的所有需求,甚至还能给你更好的体验。然而,对于一些开发者(尤其是刚开始接触 Linux 的新手)来说,这不仅难以帮助他们快速达成需求,甚至还会是一个需要逾越的障碍。考虑到这篇文章的目标是帮助 Linux 的新手(而不仅仅是为各种编辑器的死忠粉宣传他们拥护的编辑器),我更倾向于使用 GUI 编辑器。
|
||||
|
||||
就文本编辑器而论,选择 [Bluefish][11] 一般不会有错。 Bluefish 可以从大部分软件库中安装,它支持项目管理、远程文件多线程操作、搜索和替换、递归打开文件、侧边栏、集成 make/lint/weblint/xmllint、无限制撤销/重做、在线拼写检查、自动恢复、全屏编辑、语法高亮(如下图)、多种语言等等。
|
||||
|
||||
![Bluefish][13]
|
||||
|
||||
|
||||
|
||||
### IDE
|
||||
|
||||
集成开发环境(Integrated Development Environment, IDE)是包含一整套全面的工具、可以实现一站式功能的开发环境。 开发者除了可以使用 IDE 编写代码,还可以编写文档和构建软件。在 Linux 上也有很多适用的 IDE,其中 [Geany][14] 就包含在标准软件库中,它对用户非常友好,功能也相当强大。 Geany 具有语法高亮、代码折叠、自动完成,构建代码片段、自动关闭 XML 和 HTML 标签、调用提示、支持多种文件类型、符号列表、代码导航、构建编译,简单的项目管理和内置的插件系统等强大功能。
|
||||
|
||||
Geany 也能在系统上轻松安装,例如执行以下命令在基于 Debian 的 Linux 发行版上安装 Geany:
|
||||
```
|
||||
sudo apt-get install geany
|
||||
|
||||
```
|
||||
|
||||
安装完毕后,就可以快速上手这个易用且强大的 IDE 了(如下图)。
|
||||
|
||||
![Geany][16]
|
||||
|
||||
|
||||
|
||||
### 文本比较工具
|
||||
|
||||
有时候会需要比较两个文件的内容来找到它们之间的不同之处,它们可能是同一文件的两个不同副本(有一个经过编译,而另一个没有)。这种情况下,你肯定不想要凭借肉眼来找出差异,而是想要使用像 [Meld][17] 这样的工具。 Meld 是针对开发者的文本比较和合并工具,可以使用 Meld 来发现两个文件之间的差异。虽然你可以使用命令行中的文本比较工具,但就效率而论,Meld 无疑更为优秀。
|
||||
|
||||
Meld 可以打开两个文件进行比较,并突出显示文件之间的差异之处。 Meld 还允许用户从两个文件的其中一方合并差异(下图显示了 Meld 同时打开两个文件)。
|
||||
|
||||
![Comparing two files][19]
|
||||
|
||||
|
||||
|
||||
Meld 也可以通过标准软件如安装,在基于 Debian 的系统上,执行以下命令就可以安装:
|
||||
```
|
||||
sudo apt-get install meld
|
||||
|
||||
```
|
||||
|
||||
### 高效地工作
|
||||
|
||||
以上提到的五个工具除了帮助你完成工作,而且有助于提高效率。尽管适用于 Linux 开发者的工具有很多,但对于以上几个类别,你最好分别使用一个对应的工具。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/intro-to-linux/2018/8/5-essential-tools-linux-development
|
||||
|
||||
作者:[Jack Wallen][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[HankChow](https://github.com/HankChow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/jlwallen
|
||||
[1]:https://www.docker.com/
|
||||
[2]:https://hub.docker.com/
|
||||
[4]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_1.jpg?itok=V1Bsbkg9 "Docker images"
|
||||
[6]:https://git-scm.com/
|
||||
[7]:https://github.com/
|
||||
[9]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_2.jpg?itok=YJjhe4O6 "Git installed"
|
||||
[10]:https://github.com/pricing
|
||||
[11]:http://bluefish.openoffice.nl/index.html
|
||||
[13]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_3.jpg?itok=66A7Svme "Bluefish"
|
||||
[14]:https://www.geany.org/
|
||||
[16]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_4.jpg?itok=jRcA-0ue "Geany"
|
||||
[17]:http://meldmerge.org/
|
||||
[19]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/5devtools_5.jpg?itok=eLkfM9oZ "Comparing two files"
|
||||
[20]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
||||
|
||||
Reference in New Issue
Block a user