mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
commit
f517fc8cb4
@ -1,10 +1,12 @@
|
||||
如何使用 GRUB 2 直接从硬盘运行 ISO 文件
|
||||
================================================================================
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/07/rundirectiso-featured.png)
|
||||
|
||||
大多数 Linux 发行版都会提供一个可以从 USB 启动的 live 环境,以便用户无需安装即可测试系统。我们可以用它来评测这个发行版或仅仅是当成一个一次性系统,并且很容易将这些文件复制到一个 U 盘上,在某些情况下,我们可能需要经常运行同一个或不同的 ISO 镜像。GRUB 2 可以配置成直接从启动菜单运行一个 live 环境,而不需要烧录这些 ISO 到硬盘或 USB 设备。
|
||||
|
||||
### 获取和检查可启动的 ISO 镜像 ###
|
||||
为了获取 ISO 镜像,我们通常应该访问所需要的发行版的网站下载与我们架构兼容的镜像文件。如果这个镜像可以从 U 盘启动,那它也应该可以从 GRUB 菜单启动。
|
||||
|
||||
为了获取 ISO 镜像,我们通常应该访问所需的发行版的网站下载与我们架构兼容的镜像文件。如果这个镜像可以从 U 盘启动,那它也应该可以从 GRUB 菜单启动。
|
||||
|
||||
当镜像下载完后,我们应该通过 MD5 校验检查它的完整性。这会输出一大串数字与字母合成的序列。
|
||||
|
||||
@ -13,13 +15,12 @@
|
||||
将这个序列与下载页提供的 MD5 校验码进行比较,两者应该完全相同。
|
||||
|
||||
### 配置 GRUB 2 ###
|
||||
|
||||
ISO 镜像文件包含了整个系统。我们要做的仅仅是告诉 GRUB 2 哪里可以找到 kernel 和 initramdisk 或 initram 文件系统(这取决于我们所使用的发行版)。
|
||||
|
||||
在下面的例子中,一个 Kubuntu 15.04 live 环境将被配置到 Ubuntu 14.04 盒子的 Grub 启动菜单项。这应该能在大多数新的以 Ubuntu 为基础的系统上运行。如果你是其他系统并且想实现一些其它的东西,你可以从[这些文件][1]获取灵感,但这会要求你拥有一点 GRUB 使用经验。
|
||||
在下面的例子中,一个 Kubuntu 15.04 live 环境将被配置到 Ubuntu 14.04 机器的 Grub 启动菜单项。这应该能在大多数新的以 Ubuntu 为基础的系统上运行。如果你是其它系统并且想实现一些其它的东西,你可以从[这些文件][1]了解更多细节,但这会要求你拥有一点 GRUB 使用经验。
|
||||
|
||||
这个例子的文件 `kubuntu-15.04-desktop-amd64.iso`
|
||||
|
||||
放在位于 `/dev/sda1` 的 `/home/maketecheasier/TempISOs/` 上.
|
||||
这个例子的文件 `kubuntu-15.04-desktop-amd64.iso` 放在位于 `/dev/sda1` 的 `/home/maketecheasier/TempISOs/` 上。
|
||||
|
||||
为了使 GRUB 2 能正确找到它,我们应该编辑
|
||||
|
||||
@ -39,7 +40,7 @@ ISO 镜像文件包含了整个系统。我们要做的仅仅是告诉 GRUB 2
|
||||
|
||||
### 分析上述代码 ###
|
||||
|
||||
首先设置了一个变量名 `$menuentry` ,这是 ISO 文件的所在位置 。如果你想改变一个 ISO ,你应该修改 `isofile="/path/to/file/name-of-iso-file-.iso"`.
|
||||
首先设置了一个变量名 `$menuentry` ,这是 ISO 文件的所在位置 。如果你想换一个 ISO ,你应该修改 `isofile="/path/to/file/name-of-iso-file-.iso"`.
|
||||
|
||||
下一行是指定回环设备,且必须给出正确的分区号码。
|
||||
|
||||
@ -51,11 +52,11 @@ GRUB 的命名在这里稍微有点困惑,对于硬盘来说,它从 “0”
|
||||
|
||||
在 Linux 中第一块硬盘,第一个分区是 `/dev/sda1` ,但在 GRUB2 中则是 `hd0,1` 。第二块硬盘,第三个分区则是 `hd1,3`, 依此类推.
|
||||
|
||||
下一个重要的行是
|
||||
下一个重要的行是:
|
||||
|
||||
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash
|
||||
|
||||
这会载入内核镜像,在新的 Ubuntu Live CD 中,内核被存放在 `/casper` 目录,并且命名为 `vmlinuz.efi` 。如果你使用的是其它系统,可能会没有 `.efi` 扩展名或内核被存放在其它地方 (可以使用归档管理器打开 ISO 文件在 `/casper` 中查找确认)。最后一个选项, `quiet splash`, 是一个常规的 GRUB 选项无论你是否在意改动它们。
|
||||
这会载入内核镜像,在新的 Ubuntu Live CD 中,内核被存放在 `/casper` 目录,并且命名为 `vmlinuz.efi` 。如果你使用的是其它系统,可能会没有 `.efi` 扩展名或内核被存放在其它地方 (可以使用归档管理器打开 ISO 文件在 `/casper` 中查找确认)。最后一个选项, `quiet splash` ,是一个常规的 GRUB 选项,改不改无所谓。
|
||||
|
||||
最后
|
||||
|
||||
@ -65,13 +66,13 @@ GRUB 的命名在这里稍微有点困惑,对于硬盘来说,它从 “0”
|
||||
|
||||
### 启动 live 系统 ###
|
||||
|
||||
做完上面所有的步骤后,需要更新 GRUB2
|
||||
做完上面所有的步骤后,需要更新 GRUB2:
|
||||
|
||||
sudo update-grub
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/07/rundirectiso-updare-grub.png)
|
||||
|
||||
当重启系统后,应该可以看见一个新的,并且允许我们启动刚刚配置的 ISO 镜像的 GRUB 条目
|
||||
当重启系统后,应该可以看见一个新的、并且允许我们启动刚刚配置的 ISO 镜像的 GRUB 条目:
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/07/rundirectiso-grub-menu.png)
|
||||
|
||||
@ -83,7 +84,7 @@ via: https://www.maketecheasier.com/run-iso-files-hdd-grub2/
|
||||
|
||||
作者:[Attila Orosz][a]
|
||||
译者:[Locez](https://github.com/locez)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,72 @@
|
||||
Linux 有问必答:如何在 Linux 命令行下浏览天气预报
|
||||
================================================================================
|
||||
> **Q**: 我经常在 Linux 桌面查看天气预报。然而,是否有一种在终端环境下,不通过桌面小插件或者浏览器查询天气预报的方法?
|
||||
|
||||
对于 Linux 桌面用户来说,有很多办法获取天气预报,比如使用专门的天气应用、桌面小插件,或者面板小程序。但是如果你的工作环境是基于终端的,这里也有一些在命令行下获取天气的手段。
|
||||
|
||||
其中有一个就是 [wego][1],**一个终端下的小巧程序**。使用基于 ncurses 的接口,这个命令行程序允许你查看当前的天气情况和之后的预报。它也会通过一个天气预报的 API 收集接下来 5 天的天气预报。
|
||||
|
||||
### 在 Linux 下安装 wego ###
|
||||
|
||||
安装 wego 相当简单。wego 是用 Go 编写的,引起第一个步骤就是安装 [Go 语言][2]。然后再安装 wego。
|
||||
|
||||
$ go get github.com/schachmat/wego
|
||||
|
||||
wego 会被安装到 $GOPATH/bin,所以要将 $GOPATH/bin 添加到 $PATH 环境变量。
|
||||
|
||||
$ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc
|
||||
$ source ~/.bashrc
|
||||
|
||||
现在就可与直接从命令行启动 wego 了。
|
||||
|
||||
$ wego
|
||||
|
||||
第一次运行 weg 会生成一个配置文件(`~/.wegorc`),你需要指定一个天气 API key。
|
||||
你可以从 [worldweatheronline.com][3] 获取一个免费的 API key。免费注册和使用。你只需要提供一个有效的邮箱地址。
|
||||
|
||||
![](https://farm6.staticflickr.com/5781/21317466341_5a368b0d26_c.jpg)
|
||||
|
||||
你的 .wegorc 配置文件看起来会这样:
|
||||
|
||||
![](https://farm6.staticflickr.com/5620/21121418558_df0d27cd0a_b.jpg)
|
||||
|
||||
除了 API key,你还可以把你想要查询天气的地方、使用的城市/国家名称、语言配置在 `~/.wegorc` 中。
|
||||
注意,这个天气 API 的使用有限制:每秒最多 5 次查询,每天最多 250 次查询。
|
||||
当你重新执行 wego 命令,你将会看到最新的天气预报(当然是你的指定地方),如下显示。
|
||||
|
||||
![](https://farm6.staticflickr.com/5776/21121218110_dd51e03ff4_c.jpg)
|
||||
|
||||
显示出来的天气信息包括:(1)温度,(2)风速和风向,(3)可视距离,(4)降水量和降水概率
|
||||
默认情况下会显示3 天的天气预报。如果要进行修改,可以通过参数改变天气范围(最多5天),比如要查看 5 天的天气预报:
|
||||
|
||||
$ wego 5
|
||||
|
||||
如果你想检查另一个地方的天气,只需要提供城市名即可:
|
||||
|
||||
$ wego Seattle
|
||||
|
||||
### 问题解决 ###
|
||||
|
||||
1. 可能会遇到下面的错误:
|
||||
|
||||
user: Current not implemented on linux/amd64
|
||||
|
||||
当你在一个不支持原生 Go 编译器的环境下运行 wego 时就会出现这个错误。在这种情况下你只需要使用 gccgo ——一个 Go 的编译器前端来编译程序即可。这一步可以通过下面的命令完成。
|
||||
|
||||
$ sudo yum install gcc-go
|
||||
$ go get -compiler=gccgo github.com/schachmat/wego
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/weather-forecasts-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[oska874](https://github.com/oska874)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
||||
[1]:https://github.com/schachmat/wego
|
||||
[2]:http://ask.xmodulo.com/install-go-language-linux.html
|
||||
[3]:https://developer.worldweatheronline.com/auth/register
|
@ -1,28 +1,29 @@
|
||||
在 Ubuntu 15.04 上安装 Justniffer
|
||||
================================================================================
|
||||
### 简介 ###
|
||||
![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/monitoring1.jpg)
|
||||
|
||||
[Justniffer][1] 是一个可用于替换 Snort 的网络协议分析器。它非常流行,可交互式地跟踪/探测一个网络连接。它能从实时环境中抓取流量,支持 “lipcap” 和 “tcpdump” 文件格式。它可以帮助用户分析一个用 wireshark 难以抓包的复杂网络。尤其是它可以有效的帮助分析应用层流量,能提取类似图像、脚本、HTML 等 http 内容。Justniffer 有助于理解不同组件之间是如何通信的。
|
||||
[Justniffer][1] 是一个可用于替代 Snort 的网络协议分析器。它非常流行,可交互式地跟踪/探测一个网络连接。它能从实时环境中抓取流量,支持 “lipcap” 和 “tcpdump” 文件格式。它可以帮助用户分析一个用 wireshark 难以抓包的复杂网络。尤其是它可以有效的帮助你分析应用层流量,能提取类似图像、脚本、HTML 等 http 内容。Justniffer 有助于理解不同组件之间是如何通信的。
|
||||
|
||||
### 功能 ###
|
||||
|
||||
Justniffer 收集一个复杂网络的所有流量而不影响系统性能,这是 Justniffer 的一个优势,它还可以保存日志用于之后的分析,Justniffer 其它一些重要功能包括:
|
||||
Justniffer 可以收集一个复杂网络的所有流量而不影响系统性能,这是 Justniffer 的一个优势,它还可以保存日志用于之后的分析,Justniffer 其它一些重要功能包括:
|
||||
|
||||
#### 1. 可靠的 TCP 流重建 ####
|
||||
1. 可靠的 TCP 流重建
|
||||
|
||||
它可以使用主机 Linux 内核的一部分用于记录并重现 TCP 片段和 IP 片段。
|
||||
它可以使用主机 Linux 内核的一部分用于记录并重现 TCP 片段和 IP 片段。
|
||||
|
||||
#### 2. 日志 ####
|
||||
2. 日志
|
||||
|
||||
保存日志用于之后的分析,并能自定义保存内容和时间。
|
||||
保存日志用于之后的分析,并能自定义保存内容和时间。
|
||||
|
||||
#### 3. 可扩展 ####
|
||||
3. 可扩展
|
||||
|
||||
可以通过外部 python、 perl 和 bash 脚本扩展来从分析报告中获取一些额外的结果。
|
||||
可以通过外部的 python、 perl 和 bash 脚本扩展来从分析报告中获取一些额外的结果。
|
||||
|
||||
#### 4. 性能管理 ####
|
||||
4. 性能管理
|
||||
|
||||
基于连接时间、关闭时间、响应时间或请求时间等提取信息。
|
||||
基于连接时间、关闭时间、响应时间或请求时间等提取信息。
|
||||
|
||||
### 安装 ###
|
||||
|
||||
@ -44,41 +45,41 @@ make 的时候失败了,然后我运行下面的命令并尝试重新安装服
|
||||
|
||||
$ sudo apt-get -f install
|
||||
|
||||
### 事例 ###
|
||||
### 示例 ###
|
||||
|
||||
首先用 -v 选项验证安装的 Justniffer 版本,你需要用超级用户权限来使用这个工具。
|
||||
|
||||
$ sudo justniffer -V
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![j](http://www.unixmen.com/wp-content/uploads/2015/09/j.png)
|
||||
|
||||
**1. 为 eth1 接口导出 apache 中的流量到终端**
|
||||
**1、 以类似 apache 的格式导出 eth1 接口流量,显示到终端**
|
||||
|
||||
$ sudo justniffer -i eth1
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_001](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0013.png)
|
||||
|
||||
**2. 可以永恒下面的选项跟踪正在运行的 tcp 流**
|
||||
**2、 可以用下面的选项跟踪正在运行的 tcp 流**
|
||||
|
||||
$ sudo justniffer -i eth1 -r
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_002](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0023.png)
|
||||
|
||||
**3. 获取 web 服务器的响应时间**
|
||||
**3、 获取 web 服务器的响应时长**
|
||||
|
||||
$ sudo justniffer -i eth1 -a " %response.time"
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_003](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0033.png)
|
||||
|
||||
**4. 使用 Justniffer 读取一个 tcpdump 抓取的文件**
|
||||
**4、 使用 Justniffer 读取一个 tcpdump 抓取的文件**
|
||||
|
||||
首先,用 tcpdump 抓取流量。
|
||||
|
||||
@ -88,33 +89,33 @@ make 的时候失败了,然后我运行下面的命令并尝试重新安装服
|
||||
|
||||
$ justniffer -f file.cap
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_005](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0056.png)
|
||||
|
||||
**5. 只抓取 http 数据**
|
||||
**5、 只抓取 http 数据**
|
||||
|
||||
$ sudo justniffer -i eth1 -r -p "port 80 or port 8080"
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_006](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0064.png)
|
||||
|
||||
**6. 从一个指定主机获取 http 数据**
|
||||
**6、 获取一个指定主机 http 数据**
|
||||
|
||||
$ justniffer -i eth1 -r -p "host 192.168.1.250 and tcp port 80"
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_007](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0074.png)
|
||||
|
||||
**7. 以更精确的格式抓取数据**
|
||||
**7、 以更精确的格式抓取数据**
|
||||
|
||||
当你输入 **justniffer -h** 的时候你可以看到很多用于以更精确的方式获取数据的格式关键字
|
||||
|
||||
$ justniffer -h
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_008](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0083.png)
|
||||
|
||||
@ -122,15 +123,15 @@ make 的时候失败了,然后我运行下面的命令并尝试重新安装服
|
||||
|
||||
$ justniffer -i eth1 -l "%request.timestamp %request.header.host %request.url %response.time"
|
||||
|
||||
事例输出:
|
||||
示例输出:
|
||||
|
||||
![Selection_009](http://www.unixmen.com/wp-content/uploads/2015/09/Selection_0094.png)
|
||||
|
||||
其中还有很多你可以探索的选项
|
||||
其中还有很多你可以探索的选项。
|
||||
|
||||
### 总结 ###
|
||||
|
||||
Justniffer 是用于网络测试一个很好的工具。在我看来对于那些用 Snort 来进行网络探测的用户来说,Justniffer 是一个更简单的工具。它提供了很多 **格式关键字** 用于按照你的需要精确地提取数据。你可以用 .cap 文件格式记录网络信息,之后用于分析监视网络服务性能。
|
||||
Justniffer 是一个很好的用于网络测试的工具。在我看来对于那些用 Snort 来进行网络探测的用户来说,Justniffer 是一个更简单的工具。它提供了很多 **格式关键字** 用于按照你的需要精确地提取数据。你可以用 .cap 文件格式记录网络信息,之后用于分析监视网络服务性能。
|
||||
|
||||
**参考资料:**
|
||||
|
||||
@ -142,7 +143,7 @@ via: http://www.unixmen.com/install-justniffer-ubuntu-15-04/
|
||||
|
||||
作者:[Rajneesh Upadhyay][a]
|
||||
译者:[ictlyh](http://mutouxiaogui.cn/blog)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,14 +1,16 @@
|
||||
pyinfo()一个像 phpinfo 一样的 Python 脚本
|
||||
pyinfo():一个像 phpinfo 一样的 Python 脚本
|
||||
================================================================================
|
||||
作为一个热衷于 php 的家伙,我已经习惯了使用 phpinfo() 函数来让我轻松访问 php.ini 里的配置和加载的模块等。当然我也想要使用一个不存在的 pyinfo() 函数,但没有成功。在 google 中按下 CTRL-E 快速查找是否有人实现了它?
|
||||
作为一个热衷于 php 的家伙,我已经习惯了使用 `phpinfo()` 函数来让我轻松访问 php.ini 里的配置和加载的模块等信息。当然我也想要使用一个不存在的 `pyinfo()` 函数,但没有成功。按下 CTRL-E,google 一下是否有人实现了它?
|
||||
|
||||
是的,有人已经实现了。但是,对我来说它非常难看。荒谬!因为我无法忍受丑陋的布局 *咳嗽*,我不得不亲自动手来做。所以我用找到的代码,并重新进行布局使之更好看点。Python 官方网站的布局看起来不错,那么何不盗取他们的颜色和背景图片呢?是的,这听起来像一个计划。
|
||||
是的,有人已经实现了。但是,对我来说它非常难看。荒谬!因为我无法忍受丑陋的布局,*咳咳*,我不得不亲自动手来改改。我用找到的代码,并重新进行布局使之更好看点。Python 官方网站的布局看起来不错,那么何不借用他们的颜色和背景图片呢?是的,这听起来像一个计划。
|
||||
|
||||
[Gits Here][1] | [Download here][2] | [Example here][3]
|
||||
- [Gist 代码地址][1]
|
||||
- [下载地址][2]
|
||||
- [例子][3]
|
||||
|
||||
提醒你下,我仅仅在 Python 2.6.4 上运行过它,所以在别的版本上可能有风险(将它移植到任何其他版本它应该是没有问题的)。为了能使它工作,只需要导入 pyinfo() 文件,并将函数的返回值打印到屏幕上。好嘞!
|
||||
提醒你下,我仅仅在 Python 2.6.4 上运行过它,所以在别的版本上可能有风险(将它移植到任何其他版本它应该是没有问题的)。要使用它,只需要导入该文件, 并调用`pyinfo()`函数得到它的返回值打印到屏幕上。好嘞!
|
||||
|
||||
如果你没有得到正确的返回结果,你需要使用 [mod_wsgi][4],然后这样运行它(当然得替换路径):
|
||||
如果你在使用 [mod_wsgi][4] 时没有得到正确的返回结果,你可以如下运行它(当然得替换路径):
|
||||
|
||||
```
|
||||
def application(environ, start_response):
|
||||
@ -27,7 +29,7 @@ via:http://bran.name/articles/pyinfo-a-good-looking-phpinfo-like-python-script
|
||||
|
||||
作者:[Bran van der Meer][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/) 荣誉推出
|
@ -4,7 +4,7 @@
|
||||
|
||||
在 [MPlayer][1] 1.1 发布将近3年后,新版 MPlayer 终于在上周发布了。在新版本 MPlayer 1.2 中带来了对许多新编码的解码支持。
|
||||
|
||||
MPlayer 是一款跨平台的开源媒体播放器。它的名字是“Movie Player”的缩写。MPlayer 已经成为 Linux 上最老牌的媒体播放器之一,在过去的15年里,它还启发了许多其他媒体播放器。著名的基于 MPlayer 的媒体播放器有:
|
||||
MPlayer 是一款跨平台的开源媒体播放器。它的名字是“Movie Player”的缩写。MPlayer 是 Linux 上最老牌的媒体播放器之一,在过去的15年里,它还带动出现了许多其他媒体播放器。著名的基于 MPlayer 的媒体播放器有:
|
||||
|
||||
- [MPV][2]
|
||||
- SMPlayer
|
||||
@ -30,19 +30,14 @@ MPlayer 是一款跨平台的开源媒体播放器。它的名字是“Movie Pla
|
||||
打开一个终端,运行下列命令:
|
||||
|
||||
wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.2.tar.xz
|
||||
|
||||
tar xvf MPlayer-1.1.1.tar.xz
|
||||
|
||||
cd MPlayer-1.2
|
||||
|
||||
sudo apt-get install yasm
|
||||
|
||||
./configure
|
||||
|
||||
在你运行 make 的时候,在你的终端屏幕上会显示一些东西,并且你需要一些时间来编译它。保持耐心。
|
||||
|
||||
make
|
||||
|
||||
sudo make install
|
||||
|
||||
如果你觉得从源码编译不大习惯的话,我建议你等待 MPlayer 1.2 提交到你的 Linux 发行版仓库中,或者用其它的播放器替代,比如 MPV。
|
||||
@ -53,7 +48,7 @@ via: http://itsfoss.com/mplayer-1-2-released/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[alim0x](https://github.com/alim0x)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,4 +1,4 @@
|
||||
Linux产能工具及其使用技巧
|
||||
Linux 产能工具及其使用技巧
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Productivity-Tips-Linux.jpg)
|
||||
|
||||
@ -6,7 +6,7 @@ Linux产能工具及其使用技巧
|
||||
|
||||
### Linux产能工具及其使用技巧 ###
|
||||
|
||||
再次说明,我在写下本文时正在使用的是Ubuntu。但是,我将要在这里展示给大家产能工具及其使用技巧却适用于外面的大多数Linux发行版。
|
||||
再次说明,我在写下本文时正在使用的是Ubuntu。但是,我将要在这里展示给大家产能工具及其使用技巧却适用于市面上的大多数Linux发行版。
|
||||
|
||||
#### 外界的音乐 ####
|
||||
|
||||
@ -36,14 +36,14 @@ Ctrl+ C和Ctrl+V是我们日常计算机生活中不可缺少的一部分,它
|
||||
|
||||
如果你正忙着处理其它事情,而此时一个桌面通知闪了出来又逐渐消失了,你会怎么做?你会想要看看通知都说了什么,不是吗?最近通知指示器就是用于处理此项工作,它会保留一个最近所有通知的历史记录。这样,你就永远不会错过桌面通知了。
|
||||
|
||||
你可以阅读[最近通知指示器这里][13]。
|
||||
你可以在此阅读[最近通知指示器][13]。
|
||||
|
||||
#### 终端技巧 ####
|
||||
|
||||
不,我不打算给你们展示所有那些Linux命令技巧和快捷方法,那会写满整个博客了。我打算给你们展示一些终端黑技巧,你可以用它们来提高你的生产力。
|
||||
|
||||
- **修改**sudo**密码超时**:默认情况下,sudo命令要求你在15分钟后再次输入密码,这真是让人讨厌。实际上,你可以修改默认的sudo密码超时。[此教程][14]会给你展示如何来实现。
|
||||
- **获取命令完成的桌面通知**:这是IT朋友们之间的一个常见的玩笑,开发者们花费大量时间来等待程序编译完成,而这不完全是正确的。但是,它确实影响到了生产力,因为在你等待程序编译完成时,你可以做其它事情,并忘了你在终端中运行的命令。一个更好的途径,就是在一个命令完成时,让它显示桌面通知。这样,你就不会长时间被打断,并且可以回到之前想要做的事情上。请阅读[如何获取命令完成的桌面通知][15]。
|
||||
- **获取命令完成的桌面通知**:这是IT朋友们之间的一个常见的玩笑——开发者们花费大量时间来等待程序编译完成——然而这不完全是正确的。但是,它确实影响到了生产力,因为在你等待程序编译完成时,你可以做其它事情,并忘了你在终端中运行的命令。一个更好的途径,就是在一个命令完成时,让它显示桌面通知。这样,你就不会长时间被打断,并且可以回到之前想要做的事情上。请阅读[如何获取命令完成的桌面通知][15]。
|
||||
|
||||
我知道,这不是一篇全面涵盖了**提升生产力**的文章。但是,这些小应用和小技巧可以在实际生活中帮助你在你宝贵的时间中做得更多。
|
||||
|
||||
@ -55,20 +55,20 @@ via: http://itsfoss.com/productivity-tips-ubuntu/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/abhishek/
|
||||
[1]:http://www.helpscout.net/blog/music-productivity/
|
||||
[2]:http://itsfoss.com/ambient-noise-music-player-ubuntu/
|
||||
[2]:https://linux.cn/article-5233-1.html
|
||||
[3]:http://www.noisli.com/
|
||||
[4]:https://en.wikipedia.org/wiki/Pomodoro_Technique
|
||||
[5]:http://manuel-kehl.de/projects/go-for-it/
|
||||
[6]:http://todotxt.com/
|
||||
[7]:http://itsfoss.com/go-for-it-to-do-app-in-linux/
|
||||
[7]:https://linux.cn/article-5337-1.html
|
||||
[8]:http://itsfoss.com/indicator-stickynotes-windows-like-sticky-note-app-for-ubuntu/
|
||||
[9]:http://itsfoss.com/install-google-keep-ubuntu-1310/
|
||||
[9]:https://linux.cn/article-2634-1.html
|
||||
[10]:https://evernote.com/
|
||||
[11]:http://itsfoss.com/5-evernote-alternatives-linux/
|
||||
[12]:https://esite.ch/tag/diodon/
|
@ -1,3 +1,5 @@
|
||||
FSSlc translating
|
||||
|
||||
What is a good IDE for R on Linux
|
||||
================================================================================
|
||||
Some time ago, I covered some of the [best IDEs for C/C++][1] on Linux. Obviously C and C++ are not the only programming languages out there, and it is time to turn to something a bit more specific.
|
||||
|
@ -1,57 +0,0 @@
|
||||
alim0x translating
|
||||
|
||||
Mytodo: A ToDo List Manager For DIY Lovers
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-Linux.jpg)
|
||||
|
||||
Usually, I focus on applications that are hassle free and easy to use (read GUI oriented). That’s the reason why I included [Go For It][1] to do program in the list of [Linux productivity tools][2]. Today, I am going to show you yet another to-do list application that is slightly different than the rest.
|
||||
|
||||
[Mytodo][3] is an open source to-do list program that puts you, the user, in command of everything. Unlike most other similar programs, Mytodo is more DIY hobbyist oriented because it lets you configure the server (if you want to use it on multiple computers), provides a command line interface among other main features.
|
||||
|
||||
It is written in Python and thus it could be used in all Linux distros and other operating systems such as Windows.
|
||||
|
||||
Some of the main features of Mytodo are:
|
||||
|
||||
- Both GUI and command line interface
|
||||
- Configure your own server
|
||||
- Add users/password
|
||||
- Written in Python
|
||||
- Searchable by tag
|
||||
- To-do list list can be displayed as [Conky][4]
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-list.jpeg)
|
||||
|
||||
GUI
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-list-cli.jpeg)
|
||||
|
||||
Command Line
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-list-conky.jpeg)
|
||||
|
||||
Conky displaying to-do list
|
||||
|
||||
You can find the source code and configuration instructions on the Github link below:
|
||||
|
||||
- [Download and Configure Mytodo ][5]
|
||||
|
||||
While some people might not like all this command line and configuration part, but it certainly has its own pleasure. I let you try and decide if Mytodo suits our need and taste.
|
||||
|
||||
Image credit: https://pixabay.com/en/to-do-list-task-list-notes-written-734587
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/mytodo-list-manager/
|
||||
|
||||
作者:[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://itsfoss.com/go-for-it-to-do-app-in-linux/
|
||||
[2]:http://itsfoss.com/productivity-tips-ubuntu/
|
||||
[3]:https://github.com/mohamed-aziz/mytodo
|
||||
[4]:http://itsfoss.com/conky-gui-ubuntu-1304/
|
||||
[5]:https://github.com/mohamed-aziz/mytodo
|
@ -1,30 +0,0 @@
|
||||
- translating by Ezio
|
||||
|
||||
Linux 4.3 Kernel To Add The MOST Driver Subsystem
|
||||
================================================================================
|
||||
While the [Linux 4.2][1] kernel hasn't been officially released yet, Greg Kroah-Hartman sent in early his pull requests for the various subsystems he maintains for the Linux 4.3 merge window.
|
||||
|
||||
The pull requests sent in by Greg KH on Thursday include the Linux 4.3 merge window updates for the driver core, TTY/serial, USB driver, char/misc, and the staging area. These pull requests don't offer any really shocking changes but mostly routine work on improvements / additions / bug-fixes. The staging area once again is heavy with various fixes and clean-ups but there's also a new driver subsystem.
|
||||
|
||||
Greg mentioned of the [4.3 staging changes][2], "Lots of things all over the place, almost all of them trivial fixups and changes. The usual IIO updates and new drivers and we have added the MOST driver subsystem which is getting cleaned up in the tree. The ozwpan driver is finally being deleted as it is obviously abandoned and no one cares about it."
|
||||
|
||||
The MOST driver subsystem is short for the Media Oriented Systems Transport. The documentation to be added in the Linux 4.3 kernel explains, "The Media Oriented Systems Transport (MOST) driver gives Linux applications access a MOST network: The Automotive Information Backbone and the de-facto standard for high-bandwidth automotive multimedia networking. MOST defines the protocol, hardware and software layers necessary to allow for the efficient and low-cost transport of control, real-time and packet data using a single medium (physical layer). Media currently in use are fiber optics, unshielded twisted pair cables (UTP) and coax cables. MOST also supports various speed grades up to 150 Mbps." As explained, MOST is mostly about Linux in automotive applications.
|
||||
|
||||
While Greg KH sent in his various subsystem updates for Linux 4.3, he didn't yet propose the [KDBUS][5] kernel code be pulled. He's previously expressed plans for [KDBUS in Linux 4.3][3] so we'll wait until the 4.3 merge window officially gets going to see what happens. Stay tuned to Phoronix for more Linux 4.3 kernel coverage next week when the merge window will begin, [assuming Linus releases 4.2][4] this weekend.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.3-Staging-Pull
|
||||
|
||||
作者:[Michael Larabel][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.michaellarabel.com/
|
||||
[1]:http://www.phoronix.com/scan.php?page=search&q=Linux+4.2
|
||||
[2]:http://lkml.iu.edu/hypermail/linux/kernel/1508.2/02604.html
|
||||
[3]:http://www.phoronix.com/scan.php?page=news_item&px=KDBUS-Not-In-Linux-4.2
|
||||
[4]:http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.2-rc7-Released
|
||||
[5]:http://www.phoronix.com/scan.php?page=search&q=KDBUS
|
@ -0,0 +1,79 @@
|
||||
unicornx 翻译中... ...
|
||||
New Collaborative Group to Speed Real-Time Linux
|
||||
================================================================================
|
||||
![](http://www.linux.com/images/stories/66866/Tux-150.png)
|
||||
|
||||
Tux-150The Linux Foundation’s [announcement][1] at LinuxCon this week that it was assuming funding control over the Real-Time Linux project gave renewed hope that embedded Linux will complete its 15-year campaign to achieve equivalence with RTOSes in real-time operations. The RTL group is being reinvigorated as a Real-Time Linux Collaborative Project, with better funding, more developers, and closer integration with mainline kernel development.
|
||||
|
||||
According to the Linux Foundation, moving RTL under its umbrella “will save the industry millions of dollars in research and development.” The move will also “improve quality of the code through robust upstream kernel test infrastructure,” says the Foundation.
|
||||
|
||||
Over the past decade, the RTL project has been overseen, and more recently, funded, by the [Open Source Automation Development Lab][2], which is continuing on as a Gold member of the new collaborative project, but will hand funding duties over to the Linux Foundation in January. The RTL project and [OSADL][3] have been responsible for maintaining the RT-Preempt (or [Preempt-RT][4]) patches, and periodically updating them to mainline Linux.
|
||||
|
||||
The task is about 90 percent complete, according to Dr. Carsten Emde, longtime General Manager of OSADL. “It’s like building a house,” he explains. “The main components such as the walls, windows, and doors are already in place, or in our case, things like high-resolution timers, interrupt threads, and priority-inheritance mutexes. But then you need all these little bits and pieces such as carpets and wallpaper to finish the job.”
|
||||
|
||||
According to Emde, real-time Linux is already technologically equivalent to most real-time operating systems – assuming you’re willing to hassle with all the patches. “The goal of the project was to provide a Linux system with a predefined deterministic worst-case latency and nothing else,” says Emde. “This goal is reached today when a kernel is patched, and the same goal will be reached when a future unpatched mainline RT kernel will be used. The only – of course important – difference is that the maintenance work will be much less when we do no longer need to continually adapt off-tree components to mainline.”
|
||||
|
||||
The RTL Collaborative Group will continue under the guidance of Thomas Gleixner, the key maintainer over the past decade. This week, Gleixner was appointed a Linux Foundation Fellow, joining a select group that includes Linux kernel stable maintainer Greg Kroah-Hartman, Yocto Project maintainer Richard Purdie, and Linus Torvalds.
|
||||
|
||||
According to Emde, RTL’s secondary maintainer Steven Rostedt of Red Hat, who “maintains older but still maintained kernel versions,” will continue to participate in the project along with Red Hat’s Ingo Molnàr, who was a key developer of RTL, but in recent years has had more of an advisory position. Somewhat surprisingly, however, Red Hat is not one of the RTL Collaborative Group’s members. Instead, Google takes the top spot as the lone Platinum member, while Gold members include National Instruments (NI), OSADL, and Texas Instruments (TI). Silver members include Altera, ARM, Intel, and IBM.
|
||||
|
||||
### The Long Road to Real Time ###
|
||||
|
||||
When Linux first appeared in embedded devices more than 15 years ago, it faced an embedded computing market dominated by RTOSes such as Wind River’s VxWorks, which continue to offer highly deterministic, hardened kernels required by many industrial, avionics, and transportation applications. Like Microsoft’s already then established – and more real-time – Windows CE, Linux faced resistance and outright mockery from potential industrial clients. These desktop-derived distributions might be okay for lightweight consumer electronics, it was argued, but they lacked the hardened, kernels that made RTOSes the choice for devices that required deterministic task scheduling for split-second reliability.
|
||||
|
||||
Improving Linux’s real-time capabilities was an [early goal][5] of embedded Linux pioneers such as [MontaVista][6]. Over the years, RTL development was accelerated and formalized in various groups such as OSADL, which [was founded in 2006][7], as well as the Real-Time Linux Foundation (RTLF). When RTLF [merged with OSADL][8] in 2009, OSADL and its RTL group took full ownership over the PREEMPT-RT patch maintenance and upstreaming process. OSADL also oversees other automation-related projects such as [Safety Critical Linux][9].
|
||||
|
||||
OSADL’s stewardship over RTL progressed in three stages: advocacy and outreach, testing and quality assessment, and finally, funding. Early on, OSADL’s role was to write articles, make presentations, organize training, and “spread the word” about the advantages of RTL, says Emde. “To introduce a new technology such as Linux and its community-based development model into the rather conservative automation industry required first of all to build confidence,” he says. “Switching from a proprietary RTOS to Linux means that companies must introduce new strategies and processes in order to interact with a community.”
|
||||
|
||||
Later, OSADL moved on to providing technical performance data, establishing [a quality assessment and testing center][10], and providing assistance to its industrial members in open source legal compliance and safety certifications.
|
||||
|
||||
As RTL grew more mature, pulling even with the fading Windows CE in real-time capabilities and increasingly [cutting into RTOS market share][11], rival real-time Linux projects – principally [Xenomai][12] – have begun to integrate with it.
|
||||
|
||||
“The success of the RT patches, and the clear prospective that they would eventually be merged completely, has led to a change of focus at Xenomai,” says Emde. “Xenomai 3.0 can be used in combination with the RT patches and provide so-called ‘skins’ that allow you to recycle real-time source code that was written for other systems. They haven’t been completely unified, however, since Xenomai uses a dual kernel approach whereas the RT patches apply only to a single Linux kernel.”
|
||||
|
||||
In more recent years, the RTL group’s various funding sources have dropped off, and OSADL took on that role, too. “When the development recently slowed down a bit because of a lack of funding, OSADL started its third milestone by directly funding Thomas Gleixner's work,” says Emde.
|
||||
|
||||
As Emde wrote in an [Oct. 5 blog entry][13], the growing expansion of Real-Time Linux beyond its core industrial base to areas like automotive and telecom suggested that the funding should be expanded as well. “It would not be entirely fair to let the automation industry fund the complete remaining work on its own, since other industries such as telecommunication also rely on the availability of a deterministic Linux kernel,” wrote Emde.
|
||||
|
||||
When the Linux Foundation showed interest in expanding its funding role, OSADL decided it would be “much more efficient to have a single funding and control channel,” says Emde. He adds, however, that as a Gold member, OSADL is still participating in the oversight of the project, and will continue its advocacy and quality assurance activities.
|
||||
|
||||
### Automotive Looks for Real-Time Boost ###
|
||||
|
||||
RTL will continue to see its greatest growth in industrial applications where it will gradually replace RTOS applications, says Emde. Yet, it is also growing quickly in automotive, and will later spread to railway and avionics, he adds.
|
||||
|
||||
Indeed, the growing role of Linux in automotive appears to be key to the Linux Foundation’s goals for RTL, with potential collaborations with its [Automotive Grade Linux][14] (AGL) workgroup. Automotive may also be the chief motivator for Google’s high-profile participation, speculates Emde. In addition, TI is deeply involved with automotive with its Jacinto processors.
|
||||
|
||||
Linux-oriented automotive projects like AGL aim to move Linux beyond in-vehicle infotainment (IVI) into cluster controls and telematics where RTOSes like QNX dominate. Autonomous vehicles are even in greater need of real-time performance.
|
||||
|
||||
Emde notes that OSADL's [SIL2LinuxMP][15] project may play an important role in extending RTL into automotive. SIL2LinuxMP is not an automotive-specific project, but BMW is participating, and automotive is one of the key applications. The project aims to certify base components required for RTL to run on a single- or multi-core COTS board. It defines bootloader, root filesystem, Linux kernel, and C library bindings to access RTL.
|
||||
|
||||
Autonomous drones and robots are also ripe for real-time, and Xenomai is already used in many robots, as well as some drones. Yet, RTL’s role will be limited in the wider embedded Linux world of consumer electronics and Internet of Things applications. The main barrier is the latency of wireless communications and the Internet itself.
|
||||
|
||||
“Real-time Linux will have a role within machine control and between machines and peripheral devices, but less between remote machines,” says Emde. “Real-time via Internet will probably never be possible.”
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.com/news/software/applications/858828-new-collaborative-group-to-speed-real-time-linux
|
||||
|
||||
作者:[Eric Brown][a]
|
||||
译者:[unicornx](https://github.com/unicornx)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linux.com/community/forums/person/42808
|
||||
[1]:http://www.linuxfoundation.org/news-media/announcements/2015/10/linux-foundation-announces-project-advance-real-time-linux
|
||||
[2]:http://archive.linuxgizmos.com/celebrating-the-open-source-automation-development-labs-first-birthday/
|
||||
[3]:https://www.osadl.org/
|
||||
[4]:http://linuxgizmos.com/adding-real-time-to-linux-with-preempt-rt/
|
||||
[5]:http://archive.linuxgizmos.com/real-time-linux-what-is-it-why-do-you-want-it-how-do-you-do-it-a/
|
||||
[6]:http://www.linux.com/news/embedded-mobile/mobile-linux/841651-embedded-linux-pioneer-montavista-spins-iot-linux-distribution
|
||||
[7]:http://archive.linuxgizmos.com/industry-group-aims-linux-at-automation-apps/
|
||||
[8]:http://archive.linuxgizmos.com/industrial-linux-groups-merge/
|
||||
[9]:https://www.osadl.org/Safety-Critical-Linux.safety-critical-linux.0.html
|
||||
[10]:http://www.osadl.org/QA-Farm-Realtime.qa-farm-about.0.html
|
||||
[11]:http://www.linux.com/news/embedded-mobile/mobile-linux/818011-embedded-linux-keeps-growing-amid-iot-disruption-says-study
|
||||
[12]:http://xenomai.org/
|
||||
[13]:https://www.osadl.org/Single-View.111+M5dee6946dab.0.html
|
||||
[14]:http://www.linux.com/news/embedded-mobile/mobile-linux/833358-first-open-automotive-grade-linux-spec-released
|
||||
[15]:http://www.osadl.org/SIL2LinuxMP.sil2-linux-project.0.html
|
@ -1,94 +0,0 @@
|
||||
ictlyh Translating
|
||||
How To Download Videos Using youtube-dl In Linux
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Download-YouTube-Videos.jpeg)
|
||||
|
||||
I know you have already seen [how to download YouTube videos][1]. But those tools were mostly GUI ways. I am going to show you how to download YouTube videos via terminal using youtube-dl.
|
||||
|
||||
### [youtube-dl][2] ###
|
||||
|
||||
youtube-dl is a Python based small command-line tool that allows to download videos from YouTube.com, Dailymotion, Google Video, Photobucket, Facebook, Yahoo, Metacafe, Depositfiles and few more similar sites. It written in pygtk and requires Python interpreter to run this program, it’s not platform restricted. It should run on any Unix, Windows or in Mac OS X based systems.
|
||||
|
||||
The youtube-dl tool supports resuming interrupted downloads. If youtube-dl is killed (for example by Ctrl-C or due to loss of Internet connectivity) in the middle of download, you can simply re-run it with the same YouTube video url. It will automatically resume the unfinished download, as long as a partial download is present in the current directory. Which means, you don’t need a [download][3] manager for resuming downloads.
|
||||
|
||||
#### Installing youtube-dl ####
|
||||
|
||||
If you are running Ubuntu based Linux distribution, you can install it using this command:
|
||||
|
||||
sudo apt-get install youtube-dl
|
||||
|
||||
For any Linux distribution, you can quickly install youtube-dl on your system through the command line interface with:
|
||||
|
||||
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O/usr/local/bin/youtube-dl
|
||||
|
||||
After fetching the file, you need to set a executable permission on the script to execute properly.
|
||||
|
||||
sudo chmod a+rx /usr/local/bin/youtube-dl
|
||||
|
||||
#### Use YouTube-DL to Download Videos: ####
|
||||
|
||||
To download a video file, simply run the following command. Where “VIDEO_URL” is the url of the video that you want to download.
|
||||
|
||||
youtube-dl VIDEO_URL
|
||||
|
||||
#### Download YouTube Videos in Multiple Formats: ####
|
||||
|
||||
These days YouTube videos have different resolutions, you first need to check available video formats of a given YouTube video. For that run youtube-dl with “-F” option. It will show you a list of available formats.
|
||||
|
||||
youtube-dl -F http://www.youtube.com/watch?v=BlXaGWbFVKY
|
||||
|
||||
It’s output will be like:
|
||||
|
||||
Setting language
|
||||
BlXaGWbFVKY: Downloading video webpage
|
||||
BlXaGWbFVKY: Downloading video info webpage
|
||||
BlXaGWbFVKY: Extracting video information
|
||||
Available formats:
|
||||
37 : mp4 [1080×1920]
|
||||
46 : webm [1080×1920]
|
||||
22 : mp4 [720×1280]
|
||||
45 : webm [720×1280]
|
||||
35 : flv [480×854]
|
||||
44 : webm [480×854]
|
||||
34 : flv [360×640]
|
||||
18 : mp4 [360×640]
|
||||
43 : webm [360×640]
|
||||
5 : flv [240×400]
|
||||
17 : mp4 [144×176]
|
||||
|
||||
Now among the available video formats, choose one that you like. For example, if you want to download it in MP4 version, you should use:
|
||||
|
||||
youtube-dl -f 17 http://www.youtube.com/watch?v=BlXaGWbFVKY
|
||||
|
||||
#### Download subtitles of videos using youtube-dl ####
|
||||
|
||||
First check if there are subtitles available for the video. To list all subs for a video, use the command beelow:
|
||||
|
||||
youtube-dl --list-subs https://www.youtube.com/watch?v=Ye8mB6VsUHw
|
||||
|
||||
To download all subs, but not the video:
|
||||
|
||||
youtube-dl --all-subs --skip-download https://www.youtube.com/watch?v=Ye8mB6VsUHw
|
||||
|
||||
#### Download entire playlist ####
|
||||
|
||||
To download a playlist, simply run the following command. Where “playlist_url” is the url of the playlist that ou want to download.
|
||||
|
||||
youtube-dl -cit playlist_url
|
||||
|
||||
youtube-dl is a versatile command line tool and provides a number of functionalities. No wonder it is such a popular command line tool.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/download-youtube-linux/
|
||||
|
||||
作者:[alimiracle][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/ali/
|
||||
[1]:http://itsfoss.com/download-youtube-videos-ubuntu/
|
||||
[2]:https://rg3.github.io/youtube-dl/
|
||||
[3]:http://itsfoss.com/xtreme-download-manager-install/
|
@ -1,90 +0,0 @@
|
||||
How to Monitor Stock Prices from Ubuntu Command Line Using Mop
|
||||
================================================================================
|
||||
Having a side income is always good, especially when you can easily manage the work along with your full time job. If your regular work involves working on an Internet-connected computer, trading stocks is a popular option to earn a few extra bucks.
|
||||
|
||||
While there are quite a few stock-monitoring applications available for Linux, most of them are GUI-based. What if you’re a Linux professional who spends a lot (or all) of your time working on machines that do not have any GUI installed? Are you out of luck? Well, no, there are some command line stock-tracking tools, including Mop, which we’ll be discussing in this article.
|
||||
|
||||
### Mop ###
|
||||
|
||||
Mop, as already mentioned in the introduction above, is a command line tool that displays continuous and updated information about the US stock markets and individual stocks. Implemented in the GO programming language, the project is the brain child of Michael Dvorkin.
|
||||
|
||||
### Download and Install ###
|
||||
|
||||
Since the project is implemented in GO, before installing the tool, you’ll first have to make sure that the programming language is installed on your machine. Following are the steps required to install GO on a Debian-based system like Ubuntu:
|
||||
|
||||
sudo apt-get install golang
|
||||
mkdir ~/workspace
|
||||
echo 'export GOPATH="$HOME/workspace"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
|
||||
Once GO is installed, the next step is to install the Mop tool and set the environment, something which you can do by running the following commands:
|
||||
|
||||
sudo apt-get install git
|
||||
go get github.com/michaeldv/mop
|
||||
cd $GOPATH/src/github.com/michaeldv/mop
|
||||
make install
|
||||
export PATH="$PATH:$GOPATH/bin"
|
||||
|
||||
Once done, just run the following command to execute Mop:
|
||||
|
||||
cmd
|
||||
|
||||
### Features ###
|
||||
|
||||
When you run the Mop command for the first time, you’ll see an output similar to the following.
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-first-run.jpg)
|
||||
|
||||
As you can see in the image above, the output – which auto-refreshes frequently – contains information related to various popular stock exchanges around the world as well as individual stocks.
|
||||
|
||||
### Add/remove stocks ###
|
||||
|
||||
Mop allows you to easily add/remove individual stocks to and from the output list. To add a stock, all you have to do is to press “+” and mention the stock listing name when prompted. For example, the following screenshot was taken while adding Facebook (FB) to the list.
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-add-stock.png)
|
||||
|
||||
As I pressed the “+” key, a row containing text “Add tickers:” appeared, prompting me to add the stock listing name – I added FB for Facebook and pressed Enter. The output refreshed, and the new stock was added to the list:
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-stock-added.png)
|
||||
|
||||
Similarly, you can delete a stock listing by pressing “-” and mentioning its name.
|
||||
|
||||
#### Group stocks based on value ####
|
||||
|
||||
There is a way to group stocks based on whether their value is going up or down – all you have to do is to press the “g” key. Following this, the stocks which are advancing will be grouped together and shown in green, while those whose value is going down will be represented in black.
|
||||
|
||||
Here is an example screenshot.
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-group-stocks-profit-loss.png)
|
||||
|
||||
#### Column sort ####
|
||||
|
||||
Mop also allows you to change the sort order of individual columns. For this you first need to press “o” (this will select the first column by default), and then use the left and right arrow keys to select the column you want to sort. Once done, press enter to sort the column contents.
|
||||
|
||||
For example, the following screenshot shows the output after the contents of the first column were sorted in descending alphabetical order.
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-change-order.png)
|
||||
|
||||
**Note**: to better understand, compare it with the previous screenshot.
|
||||
|
||||
#### Other options ####
|
||||
|
||||
Other available options include “p” for pausing market data and stock updates, “q” or “esc” for quitting the command line application, and “?” for displaying the help page.
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-help.png)
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Mop is a basic stock monitoring tool that doesn’t offer a plethora of features, but does what it promises. It’s quite obvious that the tool is not for stock trading professionals but is still a decent choice if all you want to do is some basic stock tracking on a command line-only machine.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.maketecheasier.com/monitor-stock-prices-ubuntu-command-line/
|
||||
|
||||
作者:[Himanshu Arora][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.maketecheasier.com/author/himanshu/
|
@ -1,3 +1,6 @@
|
||||
translating by Ezio
|
||||
|
||||
|
||||
How to Setup DockerUI - a Web Interface for Docker
|
||||
================================================================================
|
||||
Docker is getting more popularity day by day. The idea of running a complete Operating System inside a container rather than running inside a virtual machine is an awesome technology. Docker has made lives of millions of system administrators and developers pretty easy for getting their work done in no time. It is an open source technology that provides an open platform to pack, ship, share and run any application as a lightweight container without caring on which operating system we are running on the host. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. Running docker containers and managing them may come a bit difficult and time consuming, so there is a web based application named DockerUI which is make managing and running container pretty simple. DockerUI is highly beneficial to people who are not much aware of linux command lines and want to run containerized applications. DockerUI is an open source web based application best known for its beautiful design and ease simple interface for running and managing docker containers.
|
||||
@ -101,7 +104,7 @@ DockerUI is a beautiful utilization of Docker Remote API to develop an awesome w
|
||||
via: http://linoxide.com/linux-how-to/setup-dockerui-web-interface-docker/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[oska874](https://github.com/oska874)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,250 +0,0 @@
|
||||
How to Setup Red Hat Ceph Storage on CentOS 7.0
|
||||
================================================================================
|
||||
Ceph is an open source software platform that stores data on a single distributed computer cluster. When you are planning to build a cloud, then on top of the requirements you have to decide on how to implement your storage. Open Source CEPH is one of RED HAT mature technology based on object-store system, called RADOS, with a set of gateway APIs that present the data in block, file, and object modes. As a result of its open source nature, this portable storage platform may be installed and used in public or private clouds. The topology of a Ceph cluster is designed around replication and information distribution, which are intrinsic and provide data integrity. It is designed to be fault-tolerant, and can run on commodity hardware, but can also be run on a number of more advanced systems with the right setup.
|
||||
|
||||
Ceph can be installed on any Linux distribution but it requires the recent kernel and other up-to-date libraries in order to be properly executed. But, here in this tutorial we will be using CentOS-7.0 with minimal installation packages on it.
|
||||
|
||||
### System Resources ###
|
||||
|
||||
**CEPH-STORAGE**
|
||||
OS: CentOS Linux 7 (Core)
|
||||
RAM:1 GB
|
||||
CPU:1 CPU
|
||||
DISK: 20
|
||||
Network: 45.79.136.163
|
||||
FQDN: ceph-storage.linoxide.com
|
||||
|
||||
**CEPH-NODE**
|
||||
OS: CentOS Linux 7 (Core)
|
||||
RAM:1 GB
|
||||
CPU:1 CPU
|
||||
DISK: 20
|
||||
Network: 45.79.171.138
|
||||
FQDN: ceph-node.linoxide.com
|
||||
|
||||
### Pre-Installation Setup ###
|
||||
|
||||
There are few steps that we need to perform on each of our node before the CEPH storage setup. So first thing is to make sure that each node is configured with its networking setup with FQDN that is reachable to other nodes.
|
||||
|
||||
**Configure Hosts**
|
||||
|
||||
To setup the hosts entry on each node let's open the default hosts configuration file as shown below.
|
||||
|
||||
# vi /etc/hosts
|
||||
|
||||
----------
|
||||
|
||||
45.79.136.163 ceph-storage ceph-storage.linoxide.com
|
||||
45.79.171.138 ceph-node ceph-node.linoxide.com
|
||||
|
||||
**Install VMware Tools**
|
||||
|
||||
While working on the VMware virtual environment, its recommended that you have installed its open VM tools. You can install using below command.
|
||||
|
||||
#yum install -y open-vm-tools
|
||||
|
||||
**Firewall Setup**
|
||||
|
||||
If you are working on a restrictive environment where your local firewall in enabled then make sure that the number of following ports are allowed from in your CEPH storge admin node and client nodes.
|
||||
|
||||
You must open ports 80, 2003, and 4505-4506 on your Admin Calamari node and port 80 to CEPH admin or Calamari node for inbound so that clients in your network can access the Calamari web user interface.
|
||||
|
||||
You can start and enable firewall in centos 7 with given below command.
|
||||
|
||||
#systemctl start firewalld
|
||||
#systemctl enable firewalld
|
||||
|
||||
To allow the mentioned ports in the Admin Calamari node run the following commands.
|
||||
|
||||
#firewall-cmd --zone=public --add-port=80/tcp --permanent
|
||||
#firewall-cmd --zone=public --add-port=2003/tcp --permanent
|
||||
#firewall-cmd --zone=public --add-port=4505-4506/tcp --permanent
|
||||
#firewall-cmd --reload
|
||||
|
||||
On the CEPH Monitor nodes you have to allow the following ports in the firewall.
|
||||
|
||||
#firewall-cmd --zone=public --add-port=6789/tcp --permanent
|
||||
|
||||
Then allow the following list of default ports for talking to clients and monitors and for sending data to other OSDs.
|
||||
|
||||
#firewall-cmd --zone=public --add-port=6800-7300/tcp --permanent
|
||||
|
||||
It quite fair that you should disable firewall and SELinux settings if you are working in a non-production environment , so we are going to disable the firewall and SELinux in our test environment.
|
||||
|
||||
#systemctl stop firewalld
|
||||
#systemctl disable firewalld
|
||||
|
||||
**System Update**
|
||||
|
||||
Now update your system and then give it a reboot to implement the required changes.
|
||||
|
||||
#yum update
|
||||
#shutdown -r 0
|
||||
|
||||
### Setup CEPH User ###
|
||||
|
||||
Now we will create a separate sudo user that will be used for installing the ceph-deploy utility on each node and allow that user to have password less access on each node because it needs to install software and configuration files without prompting for passwords on CEPH nodes.
|
||||
|
||||
To create new user with its separate home directory run the below command on the ceph-storage host.
|
||||
|
||||
[root@ceph-storage ~]# useradd -d /home/ceph -m ceph
|
||||
[root@ceph-storage ~]# passwd ceph
|
||||
|
||||
Each user created on the nodes must have sudo rights, you can assign the sudo rights to the user using running the following command as shown.
|
||||
|
||||
[root@ceph-storage ~]# echo "ceph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ceph
|
||||
ceph ALL = (root) NOPASSWD:ALL
|
||||
|
||||
[root@ceph-storage ~]# sudo chmod 0440 /etc/sudoers.d/ceph
|
||||
|
||||
### Setup SSH-Key ###
|
||||
|
||||
Now we will generate SSH keys on the admin ceph node and then copy that key to each Ceph cluster nodes.
|
||||
|
||||
Let's run the following command on the ceph-node to copy its ssh key on the ceph-storage.
|
||||
|
||||
[root@ceph-node ~]# ssh-keygen
|
||||
Generating public/private rsa key pair.
|
||||
Enter file in which to save the key (/root/.ssh/id_rsa):
|
||||
Created directory '/root/.ssh'.
|
||||
Enter passphrase (empty for no passphrase):
|
||||
Enter same passphrase again:
|
||||
Your identification has been saved in /root/.ssh/id_rsa.
|
||||
Your public key has been saved in /root/.ssh/id_rsa.pub.
|
||||
The key fingerprint is:
|
||||
5b:*:*:*:*:*:*:*:*:*:c9 root@ceph-node
|
||||
The key's randomart image is:
|
||||
+--[ RSA 2048]----+
|
||||
|
||||
----------
|
||||
|
||||
[root@ceph-node ~]# ssh-copy-id ceph@ceph-storage
|
||||
|
||||
![SSH key](http://blog.linoxide.com/wp-content/uploads/2015/10/k3.png)
|
||||
|
||||
### Configure PID Count ###
|
||||
|
||||
To configure the PID count value, we will make use of the following commands to check the default kernel value. By default its a small maximum number of threads that is '32768'.
|
||||
So will configure this value to a higher number of threads by editing the system conf file as shown in the image.
|
||||
|
||||
![Change PID Value](http://blog.linoxide.com/wp-content/uploads/2015/10/3-PID-value.png)
|
||||
|
||||
### Setup Your Administration Node Server ###
|
||||
|
||||
With all the networking setup and verified, now we will install ceph-deploy using the user ceph. So, check the hosts entry by opening its file.
|
||||
|
||||
#vim /etc/hosts
|
||||
ceph-storage 45.79.136.163
|
||||
ceph-node 45.79.171.138
|
||||
|
||||
Now to add its repository run the below command.
|
||||
|
||||
#rpm -Uhv http://ceph.com/rpm-giant/el7/noarch/ceph-release-1-0.el7.noarch.rpm
|
||||
|
||||
![Adding EPEL](http://blog.linoxide.com/wp-content/uploads/2015/10/k1.png)
|
||||
|
||||
OR create a new file and update the CEPH repository parameters but do not forget to mention your current release and distribution.
|
||||
|
||||
[root@ceph-storage ~]# vi /etc/yum.repos.d/ceph.repo
|
||||
|
||||
----------
|
||||
|
||||
[ceph-noarch]
|
||||
name=Ceph noarch packages
|
||||
baseurl=http://ceph.com/rpm-{ceph-release}/{distro}/noarch
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
type=rpm-md
|
||||
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
|
||||
|
||||
After this update your system and install the ceph deploy package.
|
||||
|
||||
### Installing CEPH-Deploy Package ###
|
||||
|
||||
To upate the system with latest ceph repository and other packages, we will run the following command along with ceph-deploy installation command.
|
||||
|
||||
#yum update -y && yum install ceph-deploy -y
|
||||
|
||||
Image-
|
||||
|
||||
### Setup the cluster ###
|
||||
|
||||
Create a new directory and move into it on the admin ceph-node to collect all output files and logs by using the following commands.
|
||||
|
||||
#mkdir ~/ceph-cluster
|
||||
#cd ~/ceph-cluster
|
||||
|
||||
----------
|
||||
|
||||
#ceph-deploy new storage
|
||||
|
||||
![setup ceph cluster](http://blog.linoxide.com/wp-content/uploads/2015/10/k4.png)
|
||||
|
||||
Upon successful execution of above command you can see it creating its configuration files.
|
||||
Now to configure the default configuration file of CEPH, open it using any editor and place the following two lines under its global parameters that reflects your public network.
|
||||
|
||||
#vim ceph.conf
|
||||
osd pool default size = 1
|
||||
public network = 45.79.0.0/16
|
||||
|
||||
### Installing CEPH ###
|
||||
|
||||
We are now going to install CEPH on each of the node associated with our CEPH cluster. To do so we make use of the following command to install CEPH on our both nodes that is ceph-storage and ceph-node as shown below.
|
||||
|
||||
#ceph-deploy install ceph-node ceph-storage
|
||||
|
||||
![installing ceph](http://blog.linoxide.com/wp-content/uploads/2015/10/k5.png)
|
||||
|
||||
This will takes some time while processing all its required repositories and installing the required packages.
|
||||
|
||||
Once the ceph installation process is complete on both nodes we will proceed to create monitor and gather keys by running the following command on the same node.
|
||||
|
||||
#ceph-deploy mon create-initial
|
||||
|
||||
![CEPH Initial Monitor](http://blog.linoxide.com/wp-content/uploads/2015/10/k6.png)
|
||||
|
||||
### Setup OSDs and OSD Daemons ###
|
||||
|
||||
Now we will setup disk storages, to do so first run the below command to List all of your usable disks by using the below command.
|
||||
|
||||
#ceph-deploy disk list ceph-storage
|
||||
|
||||
In results will get the list of your disks used on your storage nodes that you will use for creating the OSD. Let's run the following command that consists of your disks names as shown below.
|
||||
|
||||
#ceph-deploy disk zap storage:sda
|
||||
#ceph-deploy disk zap storage:sdb
|
||||
|
||||
Now to finalize the OSD setup let's run the below commands to setup the journaling disk along with data disk.
|
||||
|
||||
#ceph-deploy osd prepare storage:sdb:/dev/sda
|
||||
#ceph-deploy osd activate storage:/dev/sdb1:/dev/sda1
|
||||
|
||||
You will have to repeat the same command on all the nodes while it will clean everything present on the disk. Afterwards to have a functioning cluster, we need to copy the different keys and configuration files from the admin ceph-node to all the associated nodes by using the following command.
|
||||
|
||||
#ceph-deploy admin ceph-node ceph-storage
|
||||
|
||||
### Testing CEPH ###
|
||||
|
||||
We have almost completed the CEPH cluster setup, let's run the below command to check the status of the running ceph by using the below command on the admin ceph-node.
|
||||
|
||||
#ceph status
|
||||
#ceph health
|
||||
HEALTH_OK
|
||||
|
||||
So, if you did not get any error message at ceph status , that means you have successfully setup your ceph storage cluster on CentOS 7.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
In this detailed article we learned about the CEPH storage clustering setup using the two virtual Machines with CentOS 7 OS installed on them that can be used as a backup or as your local storage that can be used to precess other virtual machines by creating its pools. We hope you have got this article helpful. Do share your experiences when you try this at your end.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/storage/setup-red-hat-ceph-storage-centos-7-0/
|
||||
|
||||
作者:[Kashif Siddique][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/kashifs/
|
@ -1,3 +1,5 @@
|
||||
translating by Ezio
|
||||
|
||||
Remember sed and awk? All Linux admins should
|
||||
================================================================================
|
||||
![](http://images.techhive.com/images/article/2015/03/linux-100573790-primary.idge.jpg)
|
||||
|
@ -0,0 +1,160 @@
|
||||
How to Manage Software RAID’s in Linux with ‘Mdadm’ Tool – Part 9
|
||||
================================================================================
|
||||
Regardless of your previous experience with RAID arrays, and whether you followed all of the tutorials in [this RAID series][1] or not, managing software RAIDs in Linux is not a very complicated task once you have become acquainted with `mdadm --manage` command.
|
||||
|
||||
![Manage Raid Devices with Mdadm in Linux](http://www.tecmint.com/wp-content/uploads/2015/10/Manage-Raid-with-Mdadm-Tool-in-Linux.jpg)
|
||||
|
||||
Manage Raid Devices with Mdadm in Linux – Part 9
|
||||
|
||||
In this tutorial we will review the functionality provided by this tool so that you can have it handy when you need it.
|
||||
|
||||
#### RAID Testing Scenario ####
|
||||
|
||||
As in the last article of this series, we will use for simplicity a RAID 1 (mirror) array which consists of two 8 GB disks (/dev/sdb and /dev/sdc) and an initial spare device (/dev/sdd) to illustrate, but the commands and concepts listed herein apply to other types of setups as well. That said, feel free to go ahead and add this page to your browser’s bookmarks, and let’s get started.
|
||||
|
||||
### Understanding mdadm Options and Usage ###
|
||||
|
||||
Fortunately, mdadm provides a `built-in --help` flag that provides explanations and documentation for each of the main options.
|
||||
|
||||
Thus, let’s start by typing:
|
||||
|
||||
# mdadm --manage --help
|
||||
|
||||
to see what are the tasks that `mdadm --manage` will allow us to perform and how:
|
||||
|
||||
![Manage RAID with mdadm Tool](http://www.tecmint.com/wp-content/uploads/2015/10/mdadm-Usage-in-Linux.png)
|
||||
|
||||
Manage RAID with mdadm Tool
|
||||
|
||||
As we can see in the above image, managing a RAID array involves performing the following tasks at one time or another:
|
||||
|
||||
- (Re)Adding a device to the array.
|
||||
- Mark a device as faulty.
|
||||
- Removing a faulty device from the array.
|
||||
- Replacing the faulty device with a spare one.
|
||||
- Start an array that’s partially built.
|
||||
- Stop an array.
|
||||
- Mark an array as ro (read-only) or rw (read-write).
|
||||
|
||||
### Managing RAID Devices with mdadm Tool ###
|
||||
|
||||
Note that if you omit the `--manage` option, mdadm assumes management mode anyway. Keep this fact in mind to avoid running into trouble further down the road.
|
||||
|
||||
The highlighted text in the previous image shows the basic syntax to manage RAIDs:
|
||||
|
||||
# mdadm --manage RAID options devices
|
||||
|
||||
Let’s illustrate with a few examples.
|
||||
|
||||
#### Example 1: Add a device to the RAID array ####
|
||||
|
||||
You will typically add a new device when replacing a faulty one, or when you have a spare part that you want to have handy in case of a failure:
|
||||
|
||||
# mdadm --manage /dev/md0 --add /dev/sdd1
|
||||
|
||||
![Add Device to Raid Array](http://www.tecmint.com/wp-content/uploads/2015/10/Add-Device-to-Raid-Array.png)
|
||||
|
||||
Add Device to Raid Array
|
||||
|
||||
#### Example 2: Marking a RAID device as faulty and removing it from the array ####
|
||||
|
||||
This is a mandatory step before logically removing the device from the array, and later physically pulling it out from the machine – in that order (if you miss one of these steps you may end up causing actual damage to the device):
|
||||
|
||||
# mdadm --manage /dev/md0 --fail /dev/sdb1
|
||||
|
||||
Note how the spare device added in the previous example is used to automatically replace the failed disk. Not only that, but the [recovery and rebuilding of raid data][2] start immediately as well:
|
||||
|
||||
![Recover and Rebuild Raid Data](http://www.tecmint.com/wp-content/uploads/2015/10/Recover-and-Rebuild-Raid-Data.png)
|
||||
|
||||
Recover and Rebuild Raid Data
|
||||
|
||||
Once the device has been indicated as failed manually, it can be safely removed from the array:
|
||||
|
||||
# mdadm --manage /dev/md0 --remove /dev/sdb1
|
||||
|
||||
#### Example 3: Re-adding a device that was part of the array which had been removed previously ####
|
||||
|
||||
Up to this point, we have a working RAID 1 array that consists of 2 active devices: /dev/sdc1 and /dev/sdd1. If we attempt to re-add /dev/sdb1 to /dev/md0 right now:
|
||||
|
||||
# mdadm --manage /dev/md0 --re-add /dev/sdb1
|
||||
|
||||
we will run into an error:
|
||||
|
||||
mdadm: --re-add for /dev/sdb1 to /dev/md0 is not possible
|
||||
because the array is already made up of the maximum possible number of drives. So we have 2 choices: a) add /dev/sdb1 as a spare, as shown in Example #1, or b) remove /dev/sdd1 from the array and then re-add /dev/sdb1.
|
||||
|
||||
We choose option b), and will start by stopping the array to later reassemble it:
|
||||
|
||||
# mdadm --stop /dev/md0
|
||||
# mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1
|
||||
|
||||
If the above command does not successfully add /dev/sdb1 back to the array, use the command from Example #1 to do it.
|
||||
|
||||
Although mdadm will initially detect the newly added device as a spare, it will start rebuilding the data and when it’s done doing so, it should recognize the device to be an active part of the RAID:
|
||||
|
||||
![Raid Rebuild Status](http://www.tecmint.com/wp-content/uploads/2015/10/Raid-Rebuild-Status.png)
|
||||
|
||||
Raid Rebuild Status
|
||||
|
||||
#### Example 4: Replace a Raid device with a specific disk ####
|
||||
|
||||
Replacing a disk in the array with a spare one is as easy as:
|
||||
|
||||
# mdadm --manage /dev/md0 --replace /dev/sdb1 --with /dev/sdd1
|
||||
|
||||
![Replace Raid Device](http://www.tecmint.com/wp-content/uploads/2015/10/Replace-Raid-device.png)
|
||||
|
||||
Replace Raid Device
|
||||
|
||||
This results in the device following the `--with` switch being added to the RAID while the disk indicated through `--replace` being marked as faulty:
|
||||
|
||||
![Check Raid Rebuild Status](http://www.tecmint.com/wp-content/uploads/2015/10/Check-Raid-Rebuild-Status.png)
|
||||
|
||||
Check Raid Rebuild Status
|
||||
|
||||
#### Example 5: Marking an Raid array as ro or rw ####
|
||||
|
||||
After creating the array, you must have created a filesystem on top of it and mounted it on a directory in order to use it. What you probably didn’t know then is that you can mark the RAID as ro, thus allowing only read operations to be performed on it, or rw, in order to write to the device as well.
|
||||
|
||||
To mark the device as ro, it needs to be unmounted first:
|
||||
|
||||
# umount /mnt/raid1
|
||||
# mdadm --manage /dev/md0 --readonly
|
||||
# mount /mnt/raid1
|
||||
# touch /mnt/raid1/test1
|
||||
|
||||
![Set Permissions on Raid Array](http://www.tecmint.com/wp-content/uploads/2015/10/Set-Permissions-on-Raid-Array.png)
|
||||
|
||||
Set Permissions on Raid Array
|
||||
|
||||
To configure the array to allow write operations as well, use the `--readwrite` option. Note that you will need to unmount the device and stop it before setting the rw flag:
|
||||
|
||||
# umount /mnt/raid1
|
||||
# mdadm --manage /dev/md0 --stop
|
||||
# mdadm --assemble /dev/md0 /dev/sdc1 /dev/sdd1
|
||||
# mdadm --manage /dev/md0 --readwrite
|
||||
# touch /mnt/raid1/test2
|
||||
|
||||
![Allow Read Write Permission on Raid](http://www.tecmint.com/wp-content/uploads/2015/10/Allow-Write-Permission-on-Raid.png)
|
||||
|
||||
Allow Read Write Permission on Raid
|
||||
|
||||
### Summary ###
|
||||
|
||||
Throughout this series we have explained how to set up a variety of software RAID arrays that are used in enterprise environments. If you followed through the articles and the examples provided in these articles you are prepared to leverage the power of software RAIDs in Linux.
|
||||
|
||||
Should you happen to have questions or suggestions, feel free to contact us using the form below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/manage-software-raid-devices-in-linux-with-mdadm/
|
||||
|
||||
作者:[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/understanding-raid-setup-in-linux/
|
||||
[2]:http://www.tecmint.com/recover-data-and-rebuild-failed-software-raid/
|
@ -0,0 +1,55 @@
|
||||
Mytodo: 为 DIY 爱好者准备的待办事项管理软件
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-Linux.jpg)
|
||||
|
||||
通常我关注的软件都是那些不用折腾并且易用的(对图形界面而言)。这就是我把 [Go For It][1] 待办事项程序归到 [Linux 生产力工具][2] 列表的原因。今天,我要向你们展示另一款待办事项列表应用,和其它的待办事项软件有点不一样。
|
||||
|
||||
[Mytodo][3] 是个开源的待办事项列表程序,让你能够掌管一切。与其它类似的程序不同的是,Mytodo 更加面向 DIY 爱好者,因为它允许你配置服务器(如果你想在多台电脑上使用的话),除了主要的功能外还提供一个命令行界面。
|
||||
|
||||
它是用 Python 编写的,因此可以在所有 Linux 发行版以及其它操作系统,比如 Windows 上使用。
|
||||
|
||||
Mytodo 的一些主要特性:
|
||||
|
||||
- 同时拥有图形界面和命令行界面
|
||||
- 配置你自己的服务器
|
||||
- 添加用户/密码
|
||||
- Python 编写
|
||||
- 可根据标签搜索
|
||||
- 待办事项可以在 [Conky][4] 显示
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-list.jpeg)
|
||||
|
||||
图形界面
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-list-cli.jpeg)
|
||||
|
||||
命令行
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Mytodo-list-conky.jpeg)
|
||||
|
||||
Conky 显示着待办事项
|
||||
|
||||
你可以在下面的 Github 链接里找到源码和配置介绍:
|
||||
|
||||
- [下载和配置 Mytodo ][5]
|
||||
|
||||
尽管有些人可能不大喜欢命令行和配置部分的内容,但它自然有它的乐趣所在。我建议你自己尝试一下,看看 Mytodo 是否符合我们的需求和口味。
|
||||
|
||||
图片致谢: https://pixabay.com/en/to-do-list-task-list-notes-written-734587
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/mytodo-list-manager/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[alim0x](https://github.com/alim0x)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/abhishek/
|
||||
[1]:http://itsfoss.com/go-for-it-to-do-app-in-linux/
|
||||
[2]:http://itsfoss.com/productivity-tips-ubuntu/
|
||||
[3]:https://github.com/mohamed-aziz/mytodo
|
||||
[4]:http://itsfoss.com/conky-gui-ubuntu-1304/
|
||||
[5]:https://github.com/mohamed-aziz/mytodo
|
@ -0,0 +1,30 @@
|
||||
为Linux 4.3 内核添加MOST 驱动子系统
|
||||
================================================================================
|
||||
当4.2 内核还没有正式发布的时候,Greg Kroah-Hartman 就为他维护的各种子系统模块打开了4.3 的合并窗口。
|
||||
|
||||
周二Greg KH 发起的拉取请求(pull request)里包含了linux 4.3 的合并窗口更新,内容涉及驱动核心、TTY/串口、USB驱动、字符/杂项以及暂存区内容。这些拉取申请没有提供任何震撼性的改变,大部分都是改进/附加/修改bug。暂存区内容又是大量的修正和清理,但是还是有一个新的驱动子系统。
|
||||
|
||||
|
||||
Greg 提到了[4.3 的暂存区改变][2],“这里的很多东西,几乎全部都是细小的修改和改变。通常的IIO 更新和新驱动,以及我们已经添加了的MOST 驱动子系统,已经在源码树里整理了。ozwpan 驱动最终还是被删掉,引文它很明显被废弃了而且也没有人关心它。”
|
||||
|
||||
MOST 驱动子系统是面向媒体的系统传输的简称。在linux 4.3 新增的文档里面解释道,“MOST 驱动支持LInux 应用程序访问MOST 网络:汽车信息骨干网和高速汽车多媒体网络的事实上的标准。MOST 定义了必要的协议、硬件和软件层,提供高效且低消耗的传输控制,实时的数据包传输,只需要使用一个媒介(物理层)。目前使用的媒介是光线、非屏蔽双绞线(UTP)和同轴电缆。MOST 也支持多种传输速度,最高支持150Mbps。”如文档解释的,MOST 主要是关于Linux 在汽车上的应用。
|
||||
|
||||
当Greg KH 发出了他为Linux 4.3 多个子系统做出的更新,但是他还没有打算提交[KDBUS][5]的内核代码。他之前已经放出了[linux 4.3 的KDBUS] 的开发计划,所以我们将需要等待官方的4.3 合并窗口,看看会发生什么。关注Phoronix 下周关于linux 4.3 内核的新闻报道,此时合并窗口将会开始,假如Linus 在本周[发布linux 4.2][4]。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.3-Staging-Pull
|
||||
|
||||
作者:[Michael Larabel][a]
|
||||
译者:[oska874](https://github.com/oska874)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.michaellarabel.com/
|
||||
[1]:http://www.phoronix.com/scan.php?page=search&q=Linux+4.2
|
||||
[2]:http://lkml.iu.edu/hypermail/linux/kernel/1508.2/02604.html
|
||||
[3]:http://www.phoronix.com/scan.php?page=news_item&px=KDBUS-Not-In-Linux-4.2
|
||||
[4]:http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.2-rc7-Released
|
||||
[5]:http://www.phoronix.com/scan.php?page=search&q=KDBUS
|
@ -1,70 +0,0 @@
|
||||
Linux 问与答:如何在Linux 命令行下浏览天气预报
|
||||
================================================================================
|
||||
> **Q**: 我经常在Linux 桌面查看天气预报。然而,是否有一种在终端环境下,不通过桌面小插件或者网络查询天气预报的方法?
|
||||
|
||||
对于Linux 桌面用户来说,有很多办法获取天气预报,比如使用专门的天气应用,桌面小插件,或者面板小程序。但是如果你的工作环境实际与终端的,这里也有一些在命令行下获取天气的手段。
|
||||
|
||||
其中有一个就是 [wego][1],**一个终端下的小巧程序**。使用基于ncurses 的接口,这个命令行程序允许你查看当前的天气情况和之后的预报。它也会通过一个天气预报的API 收集接下来5 天的天气预报。
|
||||
|
||||
### 在Linux 下安装Wego ###
|
||||
安装wego 相当简单。wego 是用Go 编写的,引起第一个步骤就是安装[Go 语言][2]。然后再安装wego。
|
||||
|
||||
$ go get github.com/schachmat/wego
|
||||
|
||||
wego 会被安装到$GOPATH/bin,所以要将$GOPATH/bin 添加到$PATH 环境变量。
|
||||
|
||||
$ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc
|
||||
$ source ~/.bashrc
|
||||
|
||||
现在就可与直接从命令行启动wego 了。
|
||||
|
||||
$ wego
|
||||
|
||||
第一次运行weg 会生成一个配置文件(~/.wegorc),你需要指定一个天气API key。
|
||||
你可以从[worldweatheronline.com][3] 获取一个免费的API key。免费注册和使用。你只需要提供一个有效的邮箱地址。
|
||||
|
||||
![](https://farm6.staticflickr.com/5781/21317466341_5a368b0d26_c.jpg)
|
||||
|
||||
你的 .wegorc 配置文件看起来会这样:
|
||||
|
||||
![](https://farm6.staticflickr.com/5620/21121418558_df0d27cd0a_b.jpg)
|
||||
|
||||
除了API key,你还可以把你想要查询天气的地方、使用的城市/国家名称、语言配置在~/.wegorc 中。
|
||||
注意,这个天气API 的使用有限制:每秒最多5 次查询,每天最多250 次查询。
|
||||
当你重新执行wego 命令,你将会看到最新的天气预报(当然是你的指定地方),如下显示。
|
||||
|
||||
![](https://farm6.staticflickr.com/5776/21121218110_dd51e03ff4_c.jpg)
|
||||
|
||||
显示出来的天气信息包括:(1)温度,(2)风速和风向,(3)可视距离,(4)降水量和降水概率
|
||||
默认情况下会显示3 天的天气预报。如果要进行修改,可以通过参数改变天气范围(最多5天),比如要查看5 天的天气预报:
|
||||
|
||||
$ wego 5
|
||||
|
||||
如果你想检查另一个地方的天气,只需要提供城市名即可:
|
||||
|
||||
$ wego Seattle
|
||||
|
||||
### 问题解决 ###
|
||||
1. 可能会遇到下面的错误:
|
||||
|
||||
user: Current not implemented on linux/amd64
|
||||
|
||||
当你在一个不支持原生Go 编译器的环境下运行wego 时就会出现这个错误。在这种情况下你只需要使用gccgo ——一个Go 的编译器前端来编译程序即可。这一步可以通过下面的命令完成。
|
||||
|
||||
$ sudo yum install gcc-go
|
||||
$ go get -compiler=gccgo github.com/schachmat/wego
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/weather-forecasts-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/oska874)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
||||
[1]:https://github.com/schachmat/wego
|
||||
[2]:http://ask.xmodulo.com/install-go-language-linux.html
|
||||
[3]:https://developer.worldweatheronline.com/auth/register
|
@ -0,0 +1,93 @@
|
||||
如何在 Linux 中使用 youtube-dl 下载视频
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Download-YouTube-Videos.jpeg)
|
||||
|
||||
我知道你已经看过[如何下载 YouTube 视频][1]。但那些工具大部分都采用图形用户界面的方式。我会向你展示如何通过终端使用 youtube-dl 下载 YouTube 视频。
|
||||
|
||||
### [youtube-dl][2] ###
|
||||
|
||||
youtube-dl 是基于 Python 的命令行小工具,允许你从 YouTube.com、Dailymotion、Google Video、Photobucket、Facebook、Yahoo、Metacafe、Depositfiles 以及其它一些类似网站中下载视频。它是用 pygtk 编写的,需要 Python 解析器来运行,对平台要求并不严格。它能够在 Unix、Windows 或者 Mac OS X 系统上运行。
|
||||
|
||||
youtube-dl 支持断点续传。如果在下载的过程中 youtube-dl 被杀死了(例如通过 Ctrl-C 或者丢失网络连接),你只需要使用相同的 YouTube 视频 URL 再次运行它。只要当前目录中有下载的部分文件,它就会自动恢复没有完成的下载,也就是说,你不需要[下载][3]管理器来恢复下载。
|
||||
|
||||
#### 安装 youtube-dl ####
|
||||
|
||||
如果你运行的是基于 Ubuntu 的 Linux 发行版,你可以使用下面的命令安装:
|
||||
|
||||
sudo apt-get install youtube-dl
|
||||
|
||||
对于任何 Linux 发行版,你都可以通过下面的命令行接口在你的系统上快速安装 youtube-dl:
|
||||
|
||||
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O/usr/local/bin/youtube-dl
|
||||
|
||||
获取到该文件后,为了能正常执行你需要给脚本设置可执行权限。
|
||||
|
||||
sudo chmod a+rx /usr/local/bin/youtube-dl
|
||||
|
||||
#### 使用 youtube-dl 下载视频: ####
|
||||
|
||||
要下载一个视频文件,只需要运行下面的命令。其中 “VIDEO_URL” 是你想要下载视频的 url。
|
||||
|
||||
youtube-dl VIDEO_URL
|
||||
|
||||
#### 以多种格式下载 YouTube 视频: ####
|
||||
|
||||
现在 YouTube 视频有不同的分辨率,首先你需要检查指定的 YouTube 视频可用的视频格式。可以使用 “-F” 选项运行 youtube-dl。它会向你显示出可用的格式。
|
||||
|
||||
youtube-dl -F http://www.youtube.com/watch?v=BlXaGWbFVKY
|
||||
|
||||
它的输出类似于:
|
||||
|
||||
Setting language
|
||||
BlXaGWbFVKY: Downloading video webpage
|
||||
BlXaGWbFVKY: Downloading video info webpage
|
||||
BlXaGWbFVKY: Extracting video information
|
||||
Available formats:
|
||||
37 : mp4 [1080×1920]
|
||||
46 : webm [1080×1920]
|
||||
22 : mp4 [720×1280]
|
||||
45 : webm [720×1280]
|
||||
35 : flv [480×854]
|
||||
44 : webm [480×854]
|
||||
34 : flv [360×640]
|
||||
18 : mp4 [360×640]
|
||||
43 : webm [360×640]
|
||||
5 : flv [240×400]
|
||||
17 : mp4 [144×176]
|
||||
|
||||
在可用的视频格式中,选择你需要的一种。例如,如果你想下载 MP4 格式的,你可以:
|
||||
|
||||
youtube-dl -f 17 http://www.youtube.com/watch?v=BlXaGWbFVKY
|
||||
|
||||
#### 使用 youtube-dl 下载视频字幕 ####
|
||||
|
||||
首先检查是否有可用的视频字幕。使用下面的命令列出视频所有可用的字幕:
|
||||
|
||||
youtube-dl --list-subs https://www.youtube.com/watch?v=Ye8mB6VsUHw
|
||||
|
||||
下载所有字幕,但不包括视频:
|
||||
|
||||
youtube-dl --all-subs --skip-download https://www.youtube.com/watch?v=Ye8mB6VsUHw
|
||||
|
||||
#### 下载整个播放列表 ####
|
||||
|
||||
运行下面的命令下载整个播放列表。其中 “playlist_url” 是你希望下载的播放列表的 url。
|
||||
|
||||
youtube-dl -cit playlist_url
|
||||
|
||||
youtube-dl 是一个多功能的命令行工具,它提供了很多功能。难怪这个命令行工具这么流行。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/download-youtube-linux/
|
||||
|
||||
作者:[alimiracle][a]
|
||||
译者:[ictlyh](http://mutouxiaogui.cn/blog/)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/ali/
|
||||
[1]:http://itsfoss.com/download-youtube-videos-ubuntu/
|
||||
[2]:https://rg3.github.io/youtube-dl/
|
||||
[3]:http://itsfoss.com/xtreme-download-manager-install/
|
@ -0,0 +1,87 @@
|
||||
命令行下使用Mop 监视股票价格
|
||||
================================================================================
|
||||
有一份隐性收入通常很不错,特别是当你可以轻松的协调业余和全职工作。如果你的日常工作使用了联网的电脑,交易股票是一个很流行的选项来获取额外收入。
|
||||
|
||||
但是目前只有很少的股票监视软件可以用在linux 上,其中大多数还是基于图形界面的。如果你是一个Linux 专家,并且大量的工作时间是在没有图形界面的电脑上呢?你是不是就没办法了?不,这里还有一个命令行下的股票追踪工具,包括Mop,也就是本文要聊一聊的工具。
|
||||
### Mop ###
|
||||
|
||||
Mop,如上所述,是一个命令行下连续显示和更新美股和独立股票信息的工具。使用GO 实现的,是Michael Dvorkin 大脑的产物。
|
||||
### 下载安装 ###
|
||||
|
||||
|
||||
因为这个工程使用GO 实现的,所以你要做的第一步是在你的计算机上安装这种编程语言,下面就是在Debian 系系统,比如Ubuntu上安装GO的步骤:
|
||||
|
||||
sudo apt-get install golang
|
||||
mkdir ~/workspace
|
||||
echo 'export GOPATH="$HOME/workspace"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
|
||||
GO 安装好后的下一步是安装Mop 工具和配置环境,你要做的是运行下面的命令:
|
||||
|
||||
sudo apt-get install git
|
||||
go get github.com/michaeldv/mop
|
||||
cd $GOPATH/src/github.com/michaeldv/mop
|
||||
make install
|
||||
export PATH="$PATH:$GOPATH/bin"
|
||||
|
||||
完成之后就可以运行下面的命令执行Mop:
|
||||
cmd
|
||||
|
||||
### 特性 ###
|
||||
|
||||
当你第一次运行Mop 时,你会看到类似下面的输出信息:
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-first-run.jpg)
|
||||
|
||||
如你所见,这些输出信息—— 周期性自动刷新 ——包含了主要几个交易所和个股的信息。
|
||||
|
||||
### 添加删除股票 ###
|
||||
|
||||
Mop 允许你轻松的从输出列表上添加/删除个股信息。要添加,你全部要做的是按”+“和输入股票名称。举个例子,下图就是添加Facebook (FB) 到列表里。
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-add-stock.png)
|
||||
|
||||
因为我按下了”+“键,一列包含文本”Add tickers:“出现了,提示我添加股票名称—— 我添加了FB 然后按下回车。输出列表更新了,我添加的新股票也出现在列表了:
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-stock-added.png)
|
||||
|
||||
类似的,你可以使用”-“ 键和提供股票名称删除一个股票。
|
||||
|
||||
#### 根据价格分组 ####
|
||||
|
||||
还有一个把股票分组的办法:依据他们的股价升跌,你索要做的就是按下”g“ 键。接下来,股票会分组显示:升的在一起使用绿色字体显示,而下跌的股票会黑色字体显示。
|
||||
|
||||
如下所示:
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-group-stocks-profit-loss.png)
|
||||
|
||||
#### 列排序 ####
|
||||
|
||||
Mop 同时也允许你根据不同的列类型改变排序规则。这种用法需要你按下”o“(这个命令默认使用第一列的值来排序),然后使用左右键来选择你要使用的列。完成之后按下回车对内容重新排序。
|
||||
|
||||
举个例子,下面的截图就是根据输出内容的第一列、按照字母表排序之后的结果。
|
||||
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-change-order.png)
|
||||
|
||||
**注意**: 为了更好的理解,和前面的截屏对比一下。
|
||||
|
||||
#### 其他选项 ####
|
||||
|
||||
其它的可用选项包括”p“:暂停市场和股票信息更新,”q“ 或者”esc“ 来退出命令行程序,”?“ 显示帮助页。
|
||||
![](https://www.maketecheasier.com/assets/uploads/2015/09/mop-help.png)
|
||||
|
||||
### 结论 ###
|
||||
|
||||
Mop 是一个基础的股票监控工具,并没有提供太多的特性,只提供了他声称的功能。很明显,这个工具并不是为专业股票交易者提供的,而仅仅为你在只有命令行的机器上得体的提供了一个跟踪股票信息的选择。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.maketecheasier.com/monitor-stock-prices-ubuntu-command-line/
|
||||
|
||||
作者:[Himanshu Arora][a]
|
||||
译者:[oska874](https://github.com/oska874)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.maketecheasier.com/author/himanshu/
|
@ -0,0 +1,250 @@
|
||||
如何在 CentOS 7.0 上配置 Ceph 存储
|
||||
How to Setup Red Hat Ceph Storage on CentOS 7.0
|
||||
================================================================================
|
||||
Ceph 是一个将数据存储在单一分布式计算机集群上的开源软件平台。当你计划构建一个云时,你首先需要决定如何实现你的存储。开源的 CEPH 是红帽原生技术之一,它基于称为 RADOS 的对象存储系统,用一组网关 API 表示块、文件、和对象模式中的数据。由于它自身开源的特性,这种便携存储平台能在公有和私有云上安装和使用。Ceph 集群的拓扑结构是按照备份和信息分布设计的,这内在设计能提供数据完整性。它的设计目标就是容错、通过正确配置能运行于商业硬件和一些更高级的系统。
|
||||
|
||||
Ceph 能在任何 Linux 发行版上安装,但为了能正确运行,它要求最近的内核以及其它最新的库。在这篇指南中,我们会使用最小化安装的 CentOS-7.0。
|
||||
|
||||
### 系统资源 ###
|
||||
|
||||
**CEPH-STORAGE**
|
||||
OS: CentOS Linux 7 (Core)
|
||||
RAM:1 GB
|
||||
CPU:1 CPU
|
||||
DISK: 20
|
||||
Network: 45.79.136.163
|
||||
FQDN: ceph-storage.linoxide.com
|
||||
|
||||
**CEPH-NODE**
|
||||
OS: CentOS Linux 7 (Core)
|
||||
RAM:1 GB
|
||||
CPU:1 CPU
|
||||
DISK: 20
|
||||
Network: 45.79.171.138
|
||||
FQDN: ceph-node.linoxide.com
|
||||
|
||||
### 安装前的配置 ###
|
||||
|
||||
在安装 CEPH 存储之前,我们要在每个节点上完成一些步骤。第一件事情就是确保每个节点的网络已经配置好并且能相互访问。
|
||||
|
||||
**配置 Hosts**
|
||||
|
||||
要在每个节点上配置 hosts 条目,要像下面这样打开默认的 hosts 配置文件。
|
||||
|
||||
# vi /etc/hosts
|
||||
|
||||
----------
|
||||
|
||||
45.79.136.163 ceph-storage ceph-storage.linoxide.com
|
||||
45.79.171.138 ceph-node ceph-node.linoxide.com
|
||||
|
||||
**安装 VMware 工具**
|
||||
|
||||
工作环境是 VMWare 虚拟环境时,推荐你安装它的 open VM 工具。你可以使用下面的命令安装。
|
||||
|
||||
#yum install -y open-vm-tools
|
||||
|
||||
**配置防火墙**
|
||||
|
||||
如果你正在使用启用了防火墙的限制性环境,确保在你的 CEPH 存储管理节点和客户端节点中开放了以下的端口。
|
||||
|
||||
你必须在你的 Admin Calamari 节点开放 80、2003、以及4505-4506 端口,并且允许通过 80 号端口到 CEPH 或 Calamari 管理节点,以便你网络中的客户端能访问 Calamari web 用户界面。
|
||||
|
||||
你可以使用下面的命令在 CentOS 7 中启动并启用防火墙。
|
||||
|
||||
#systemctl start firewalld
|
||||
#systemctl enable firewalld
|
||||
|
||||
运行以下命令使 Admin Calamari 节点开放上面提到的端口。
|
||||
|
||||
#firewall-cmd --zone=public --add-port=80/tcp --permanent
|
||||
#firewall-cmd --zone=public --add-port=2003/tcp --permanent
|
||||
#firewall-cmd --zone=public --add-port=4505-4506/tcp --permanent
|
||||
#firewall-cmd --reload
|
||||
|
||||
在 CEPH Monitor 节点,你要在防火墙中允许通过以下端口。
|
||||
|
||||
#firewall-cmd --zone=public --add-port=6789/tcp --permanent
|
||||
|
||||
然后允许以下默认端口列表,以便能和客户端以及监控节点交互,并发送数据到其它 OSD。
|
||||
|
||||
#firewall-cmd --zone=public --add-port=6800-7300/tcp --permanent
|
||||
|
||||
如果你工作在非生产环境,建议你停用防火墙以及 SELinux 设置,在我们的测试环境中我们会停用防火墙以及 SELinux。
|
||||
|
||||
#systemctl stop firewalld
|
||||
#systemctl disable firewalld
|
||||
|
||||
**系统升级**
|
||||
|
||||
现在升级你的系统并重启使所需更改生效。
|
||||
|
||||
#yum update
|
||||
#shutdown -r 0
|
||||
|
||||
### 设置 CEPH 用户 ###
|
||||
|
||||
现在我们会新建一个单独的 sudo 用户用于在每个节点安装 ceph-deploy工具,并允许该用户无密码访问每个节点,因为它需要在 CEPH 节点上安装软件和配置文件而不会有输入密码提示。
|
||||
|
||||
运行下面的命令在 ceph-storage 主机上新建有独立 home 目录的新用户。
|
||||
|
||||
[root@ceph-storage ~]# useradd -d /home/ceph -m ceph
|
||||
[root@ceph-storage ~]# passwd ceph
|
||||
|
||||
节点中新建的每个用户都要有 sudo 权限,你可以使用下面展示的命令赋予 sudo 权限。
|
||||
|
||||
[root@ceph-storage ~]# echo "ceph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ceph
|
||||
ceph ALL = (root) NOPASSWD:ALL
|
||||
|
||||
[root@ceph-storage ~]# sudo chmod 0440 /etc/sudoers.d/ceph
|
||||
|
||||
### 设置 SSH 密钥 ###
|
||||
|
||||
现在我们会在 ceph 管理节点生成 SSH 密钥并把密钥复制到每个 Ceph 集群节点。
|
||||
|
||||
在 ceph-node 运行下面的命令复制它的 ssh 密钥到 ceph-storage。
|
||||
|
||||
[root@ceph-node ~]# ssh-keygen
|
||||
Generating public/private rsa key pair.
|
||||
Enter file in which to save the key (/root/.ssh/id_rsa):
|
||||
Created directory '/root/.ssh'.
|
||||
Enter passphrase (empty for no passphrase):
|
||||
Enter same passphrase again:
|
||||
Your identification has been saved in /root/.ssh/id_rsa.
|
||||
Your public key has been saved in /root/.ssh/id_rsa.pub.
|
||||
The key fingerprint is:
|
||||
5b:*:*:*:*:*:*:*:*:*:c9 root@ceph-node
|
||||
The key's randomart image is:
|
||||
+--[ RSA 2048]----+
|
||||
|
||||
----------
|
||||
|
||||
[root@ceph-node ~]# ssh-copy-id ceph@ceph-storage
|
||||
|
||||
![SSH key](http://blog.linoxide.com/wp-content/uploads/2015/10/k3.png)
|
||||
|
||||
### 配置 PID 数目 ###
|
||||
|
||||
要配置 PID 数目的值,我们会使用下面的命令检查默认的内核值。默认情况下,是一个小的最大线程数 32768.
|
||||
如下图所示通过编辑系统配置文件配置该值为一个更大的数。
|
||||
|
||||
![更改 PID 值](http://blog.linoxide.com/wp-content/uploads/2015/10/3-PID-value.png)
|
||||
|
||||
### 配置管理节点服务器 ###
|
||||
|
||||
配置并验证了所有网络后,我们现在使用 ceph 用户安装 ceph-deploy。通过打开文件检查 hosts 条目。
|
||||
|
||||
#vim /etc/hosts
|
||||
ceph-storage 45.79.136.163
|
||||
ceph-node 45.79.171.138
|
||||
|
||||
运行下面的命令添加它的库。
|
||||
|
||||
#rpm -Uhv http://ceph.com/rpm-giant/el7/noarch/ceph-release-1-0.el7.noarch.rpm
|
||||
|
||||
![添加 EPEL](http://blog.linoxide.com/wp-content/uploads/2015/10/k1.png)
|
||||
|
||||
或者创建一个新文件并更新 CEPH 库参数,别忘了替换你当前的 Release 和版本号。
|
||||
|
||||
[root@ceph-storage ~]# vi /etc/yum.repos.d/ceph.repo
|
||||
|
||||
----------
|
||||
|
||||
[ceph-noarch]
|
||||
name=Ceph noarch packages
|
||||
baseurl=http://ceph.com/rpm-{ceph-release}/{distro}/noarch
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
type=rpm-md
|
||||
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
|
||||
|
||||
之后更新你的系统并安装 ceph-deploy 软件包。
|
||||
|
||||
### 安装 CEPH-Deploy 软件包 ###
|
||||
|
||||
我们运行下面的命令以及 ceph-deploy 安装命令来更新系统以及最新的 ceph 库和其它软件包。
|
||||
|
||||
#yum update -y && yum install ceph-deploy -y
|
||||
|
||||
|
||||
### 配置集群 ###
|
||||
|
||||
使用下面的命令在 ceph 管理节点新建一个目录并进入新目录,用于收集所有输出文件和日志。
|
||||
|
||||
#mkdir ~/ceph-cluster
|
||||
#cd ~/ceph-cluster
|
||||
|
||||
----------
|
||||
|
||||
#ceph-deploy new storage
|
||||
|
||||
![设置 ceph 集群](http://blog.linoxide.com/wp-content/uploads/2015/10/k4.png)
|
||||
|
||||
如果成功执行了上面的命令,你会看到它新建了配置文件。
|
||||
现在配置 CEPH 默认的配置文件,用任意编辑器打开它并在会影响你公共网络的 global 参数下面添加以下两行。
|
||||
|
||||
#vim ceph.conf
|
||||
osd pool default size = 1
|
||||
public network = 45.79.0.0/16
|
||||
|
||||
### 安装 CEPH ###
|
||||
|
||||
现在我们准备在和 CEPH 集群相关的每个节点上安装 CEPH。我们使用下面的命令在 ceph-storage 和 ceph-node 上安装 CEPH。
|
||||
|
||||
#ceph-deploy install ceph-node ceph-storage
|
||||
|
||||
![安装 ceph](http://blog.linoxide.com/wp-content/uploads/2015/10/k5.png)
|
||||
|
||||
处理所有所需仓库和安装所需软件包会需要一些时间。
|
||||
|
||||
当两个节点上的 ceph 安装过程都完成后,我们下一步会通过在相同节点上运行以下命令创建监视器并收集密钥。
|
||||
|
||||
#ceph-deploy mon create-initial
|
||||
|
||||
![CEPH 初始化监视器](http://blog.linoxide.com/wp-content/uploads/2015/10/k6.png)
|
||||
|
||||
### 设置 OSDs 和 OSD 守护进程 ###
|
||||
|
||||
现在我们会设置磁盘存储,首先运行下面的命令列出你所有可用的磁盘。
|
||||
|
||||
#ceph-deploy disk list ceph-storage
|
||||
|
||||
结果中会列出你存储节点中使用的磁盘,你会用它们来创建 OSD。让我们运行以下包括你磁盘名称的命令。
|
||||
|
||||
#ceph-deploy disk zap storage:sda
|
||||
#ceph-deploy disk zap storage:sdb
|
||||
|
||||
为了最后完成 OSD 配置,运行下面的命令配置日志磁盘以及数据磁盘。
|
||||
|
||||
#ceph-deploy osd prepare storage:sdb:/dev/sda
|
||||
#ceph-deploy osd activate storage:/dev/sdb1:/dev/sda1
|
||||
|
||||
你需要在所有节点上运行相同的命令,它会清除你磁盘上的所有东西。之后为了集群能运转起来,我们需要使用以下命令从 ceph 管理节点复制不同的密钥和配置文件到所有相关节点。
|
||||
|
||||
#ceph-deploy admin ceph-node ceph-storage
|
||||
|
||||
### 测试 CEPH ###
|
||||
|
||||
我们几乎完成了 CEPH 集群设置,让我们在 ceph 管理节点上运行下面的命令检查正在运行的 ceph 状态。
|
||||
|
||||
#ceph status
|
||||
#ceph health
|
||||
HEALTH_OK
|
||||
|
||||
如果你在 ceph status 中没有看到任何错误信息,就意味着你成功地在 CentOS 7 上安装了 ceph 存储集群。
|
||||
|
||||
### 总结 ###
|
||||
|
||||
在这篇详细的文章中我们学习了如何使用两台安装了 CentOS 7 的虚拟机设置 CEPH 存储集群,这能用于备份或者作为用于处理其它虚拟机的本地存储。我们希望这篇文章能对你有所帮助。当你试着安装的时候记得分享你的经验。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/storage/setup-red-hat-ceph-storage-centos-7-0/
|
||||
|
||||
作者:[Kashif Siddique][a]
|
||||
译者:[ictlyh](http://mutouxiaogui.cn/blog/)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/kashifs/
|
Loading…
Reference in New Issue
Block a user