mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
commit
e9af2953c4
@ -0,0 +1,158 @@
|
||||
让你玩转 Ubuntu 桌面的十一件武器
|
||||
================================================================================
|
||||
**无论你是一个相对的新手还是经验丰富的专家,我们都想从我们的操作系统中得到更多的东西。正如大多数现代的操作系统,相比于乍一看呈现出的内容,Ubuntu 还有更多东西可以向我们提供。**
|
||||
|
||||
从调整和优化 Unity 桌面的外观、行为、性能到执行系统维护,这里有大量的实用工具和应用可以帮助你**调整 Ubuntu ,随时满足你的需求**。
|
||||
|
||||
注意: Ubuntu 总是配备了‘合理的默认设置’(即工作良好的选项),以达到开箱即用,这些默认设置适合大多数人,并且它们都是经过了测试、采用及推荐等过程的。
|
||||
|
||||
但一个尺码并不适合所有人。对于我们当中的能工巧匠和实验主义者来说,默认设置只是他们定制系统的起点。
|
||||
|
||||
所以,无需更多的唠叨, 这里有 11 个极好的实用工具可以帮助你增强 Ubuntu 使用体验。
|
||||
|
||||
### Unity Tweak Tool ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/unity-tweak-tool.jpg)
|
||||
|
||||
我将以这个列表中最重要的一个工具: **Unity Tweak Tool** 来开始这次的介绍。融汇了各种定制选项,Unity Tweak Tool 提供了一系列针对 Ubuntu 和 Unity 桌面的系统综合调整功能。
|
||||
|
||||
它被各种开关、切换和控制器塞得满满的,使得你可以任意设置从 Unity 桌面的外观到 Unity 的行为之类的任何东西。你可以使用它**快速简便地改变 GTK 主题和图标集**、设置热区、调整启动器图标尺寸、增加或移除工作区,以及 ---特别地---开启 Unity 桌面中被巧妙隐藏的“通过点击最小化”的功能。
|
||||
|
||||
它是免费的,可直接从 Ubuntu 软件中心里找到, Unity Tweak Tool 是非常值得保留在你的口袋里的工具之一。
|
||||
|
||||
### Unity 隐私指示器 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/indicator-privacy-in-ubuntu.jpg)
|
||||
|
||||
隐私是一个非常、非常重要的事,事实也恰恰如此,但这个话题要比二进制还难以说明白。让一些数据或习惯,比如说你经常打开的应用,在本地被记录下来,这或许会让你感到高兴,但对于你在 Dash 中的搜索数据被发送到第三方服务机构(尽管这些数据或许是匿名的)这类事情,你就高兴不起来了。
|
||||
|
||||
[隐私指示器][1] 是一个帮助你时刻跟踪 Ubuntu桌面系统中有哪些文件、目录和服务正被获取、记录及搜索的实用工具。
|
||||
|
||||
通过快速的点击被添加到桌面面板上的‘眼睛’图标,你可以:
|
||||
|
||||
- 开启或关闭在线搜索结果,使用 Zeitgeist 记录系统活动,存储 HUD 使用记录和启用 Ubuntu GeoIP 服务
|
||||
- 快速清理 Zeitgeist 日志、 ALT-F2 历史、最近访问文件等等的记录数据
|
||||
- 展示或隐藏桌面图标及面板上显示的用户名
|
||||
|
||||
上述的最后一条的功能似乎不应该出现在这个应用程序中,但对于那些要分享截图或截屏的人来说,这将会泄露更少的隐私。
|
||||
|
||||
- [从这里下载隐私指示器 (.deb)][2]
|
||||
|
||||
### Unity 橱窗 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/unity-folders.jpg)
|
||||
|
||||
**Android, iOS, OS X, Chrome OS, 和 GNOME Shell 都有应用橱窗, 借助一个极好的第三方应用,Unity 也可以实现类似功能。**
|
||||
|
||||
“Unity 橱窗” 允许你将 Unity 启动器中的应用分组到实用的橱窗中,--- 如游戏,办公,社交等。不必打开 Dash,你就可以快速启动你喜爱的应用,这非常适合你的工作流。
|
||||
|
||||
每一个 ‘橱窗’其实上是一个打开在图标附近的应用窗口,但总体效果看上去就像是一个 OS X 风格的“堆栈”或 Android 的分组框。
|
||||
|
||||
橱窗的图标可以自定义或根据橱窗内的应用来自动生成。已有的橱窗可以修改和重新组织、重命名以及如下的更多选择:
|
||||
|
||||
- 根据你的喜好创建任意多的橱窗
|
||||
- 选择自定义或自动生成橱窗图标
|
||||
- 可选择 3 种橱窗样式
|
||||
- 为添加到橱窗中的应用设定自定义图标
|
||||
- 编辑现有橱窗
|
||||
|
||||
[Unity 橱窗的网址](http://unity-folders.exceptionfound.com/)
|
||||
|
||||
### 咖啡因(Caffeine) ###
|
||||
|
||||
对于我们中的许多人来说,咖啡因是必需品,而不仅仅是饮料。而这里的“咖啡因”则提供了一个快速,温和的方式来避免屏保/锁屏占据屏幕。它的有用程度将取决于你的环境(即你系统的怪癖),并且尽管它不像以前那样好用,它仍然值得你[尝试一下][3]。
|
||||
|
||||
[下载咖啡因(Caffeine) ](https://launchpad.net/~caffeine-developers/+archive/ppa/+files/caffeine_2.7_all.deb)
|
||||
|
||||
### 系统监控指示器 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/multiload-indicator-in-ubuntu.jpg)
|
||||
|
||||
假如你是一个状态迷,即一个喜欢密切关注程序,进程和硬件的状态的人, Linux 很容易满足你的需求。从 Conky 的配置到终端命令,并不缺少监视你的 CPU 使用情况、网络流量或 GPU 温度的方法。
|
||||
|
||||
但至今为止,我最喜爱的应用是**系统监控指示器**(也被叫做多负载指示器),它可从 Ubuntu 软件中心获得。它也有着大量的配置选项。
|
||||
|
||||
- [点击这个链接,在 Ubuntu 中下载 ‘系统监控指示器’][4]
|
||||
|
||||
### 针对 Linux 笔记本电脑的省电工具 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/08/front.jpg)
|
||||
|
||||
#### TLP ####
|
||||
|
||||
当提到便携式设备上的电池使用效率时,Linux 发行版的声誉并不算好。
|
||||
|
||||
如果你的 Linux 笔记本在重新充电前,电池只够让你从沙发走到厨房的话,那么这里有几个你可以试试的工具。
|
||||
|
||||
TLP 是最受欢迎的确保延长 Linux 笔记本的电池寿命的自动化后台工具之一,它是通过调整系统进程和硬件的设置及行为来达成省电的,例如 启动 Wi-Fi 省电模式, PCI 总线设备的实时电量管理和处理器的降频调整。
|
||||
|
||||
在 Ubuntu 14.04 LTS 以及后续发行版本中可以[使用 TLP 专用的 PPA 来安装它][11],通过它的‘一下搞定’的设置就能用起来。在我们之中的高级用户可以潜心研究并根据你自己的硬件来调整设置,一个[关于 TLP 的完整指导 wiki][6] 使得设置更加容易。
|
||||
|
||||
#### Laptop Mode Tools ####
|
||||
|
||||
假如 TLP 听起来有一点复杂,这也并没有什么可羞耻的,这里有一个更简单的替代品: **Laptop Mode Tools**。 这个软件包可从 Ubuntu 软件中心直接安装,且本身设置好了一系列合理的默认设置(Wi-Fi,蓝牙等等)。
|
||||
|
||||
切记,Laptop Mode Tools 不能和 TLP 同时被安装在电脑中。
|
||||
|
||||
- [Ubuntu 软件中心里的 Laptop Mode Tools ][7]
|
||||
|
||||
### Intel 显卡驱动安装工具 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/intelgraphicsdriverinstaller.png)
|
||||
|
||||
对于那些运行 Intel 显卡硬件,并想使得这些硬件发挥出最佳性能的人来说,Intel 显卡安装工具是必须拥有的。 它使得查找并安装最新的 Intel GPU 驱动变得不再是一件痛苦和大费周折的事,因为这无需 PPA 或任何的终端使用知识。
|
||||
|
||||
- [下载针对 Linux平台的 Intel 显卡驱动安装器 0.7 版本][8]
|
||||
|
||||
### 硬件信息 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/Screen-Shot-2014-02-10-at-21.05.37.png)
|
||||
|
||||
假如你计划升级你的 PC 或想替换一个坏掉的零部件,你需要知道一些特定的硬件信息,例如 RAM 类型,CPU插座类型 或查看哪个 PCI 槽是可用的等信息。
|
||||
|
||||
**I-Nex**可以使得找出这些以及其他的系统具体配置变得更加容易。使用它来查找你的主板型号、S.M.A.R.T.(注:为 Self-Monitoring, Analysis and Reporting Technology 的缩写,经常写为 SMART ) 状态,以及你想的出的很多东西!
|
||||
|
||||
- [可从 Launchpad 了解到更多关于 I-Nex 的信息][9]
|
||||
|
||||
### 磁盘空间可视化程序 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/disk-usage-visualizer-for-ubuntu.jpg)
|
||||
|
||||
在这个硬盘以 TB 计数的时代,我们或许不必同以前一样对硬盘空间的使用三思而后行。但对于那些使用小容量的 SSD,分成多个分区或在一个拥有固定大小的虚拟磁盘的虚拟机上工作的人来说,总有“应该释放一些额外空间是必要的”这种想法的时候。
|
||||
|
||||
GNOME Disks,在 Ubuntu 中被默认安装,使得查找占用最大磁盘空间的罪魁祸首变得容易。对于定位隐藏的日志、缓存和视频文件,它是非常完美的工具。
|
||||
|
||||
### BleachBit (Cruft Cleaner) ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/bleachbit.jpg)
|
||||
|
||||
Windows 用户可能对像 CCleaner 之类的应用很熟悉,它可以扫描并清理垃圾文件、空白文件夹、臃肿的缓存以及陈旧的软件包。在 Ubuntu 上,一个相似的快速且毫不费力的一键式清理方法可以试试 **BleachBit** 。
|
||||
|
||||
它是一个强大的工具,所以一定要注意你正在清理什么。不要漫无目的地确认每个选项框;不是所有的东西它都可以清理。所以请合理地使用它,当你对某个选项有疑问时,就跳过它。
|
||||
|
||||
- [从 Ubuntu 软件中心里安装 BleachBit][10]
|
||||
|
||||
你已经有了自己最喜欢的系统实用工具了吗?可以在下面的评论中让其他人知晓它。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/11/useful-tools-for-ubuntu-do-you-use-them
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://www.florian-diesch.de/software/indicator-privacy/index.html
|
||||
[2]:http://www.florian-diesch.de/software/indicator-privacy/dist/indicator-privacy_0.04-1_all.deb
|
||||
[3]:http://www.omgubuntu.co.uk/2014/05/stop-ubuntu-sleeping-caffeine
|
||||
[4]:apt://indicator-mulitload
|
||||
[5]:https://launchpad.net/~linrunner/+archive/ubuntu/tlp/+packages
|
||||
[6]:http://linrunner.de/en/tlp/docs/tlp-configuration.html
|
||||
[7]:https://apps.ubuntu.com/cat/applications/laptop-mode-tools/
|
||||
[8]:https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-linux-1.0.7
|
||||
[9]:https://launchpad.net/i-nex
|
||||
[10]:https://apps.ubuntu.com/cat/applications/bleachbit/
|
||||
[11]:https://launchpad.net/~linrunner/+archive/ubuntu/tlp/+packages
|
@ -1,32 +1,36 @@
|
||||
Linux 命名空间
|
||||
介绍 Linux 的命名空间
|
||||
================================================================================
|
||||
### 背景 ###
|
||||
|
||||
从2.6.24版的内核开始,Linux 就支持6种不同类型的命名空间。它们的出现,使用户创建的进程能够与系统分离得更加彻底,从而不需要考虑太多底层的虚拟化技术。
|
||||
从Linux 2.6.24版的内核开始,Linux 就支持6种不同类型的命名空间。它们的出现,使用户创建的进程能够与系统分离得更加彻底,从而不需要使用更多的底层虚拟化技术。
|
||||
|
||||
- **CLONE_NEWIPC**: 进程间通信(IPC)的命名空间,可以将 SystemV 的 IPC 和 POSIX 的消息队列独立出来。
|
||||
- **CLONE_NEWPID**: 进程 ID 的命名空间,进程 ID 独立,意思就是命名空间内的进程 ID 可能会与命名空间外的进程 ID 冲突,于是命名空间内的进程 ID 映射到命名空间外时会使用另外一个进程 ID。比如说,命名空间内 ID 为1的进程,在命名空间外就是指 init 进程。
|
||||
- **CLONE_NEWPID**: PID 命名空间。空间内的PID 是独立分配的,意思就是命名空间内的虚拟 PID 可能会与命名空间外的 PID 相冲突,于是命名空间内的 PID 映射到命名空间外时会使用另外一个 PID。比如说,命名空间内第一个 PID 为1,而在命名空间外就是该 PID 已被 init 进程所使用。
|
||||
- **CLONE_NEWNET**: 网络命名空间,用于隔离网络资源(/proc/net、IP 地址、网卡、路由等)。后台进程可以运行在不同命名空间内的相同端口上,用户还可以虚拟出一块网卡。
|
||||
- **CLONE_NEWNS**: 挂载命名空间,进程运行时可以将挂载点与系统分离,使用这个功能时,我们可以达到 chroot 的功能,而在安全性方面比 chroot 更高。
|
||||
- **CLONE_NEWUTS**: UTS 命名空间,主要目的是独立出主机名和网络信息服务(NIS)。
|
||||
- **CLONE_NEWUSER**: 用户命名空间,同进程 ID 一样,用户 ID 和组 ID 在命名空间内外是不一样的,并且在不同命名空间内可以存在相同的 ID。
|
||||
|
||||
下面我们介绍一下进程命名空间和网络命名空间。
|
||||
|
||||
### 进程命名空间
|
||||
|
||||
本文用 C 语言介绍上述概念,因为演示进程命名空间的时候需要用到 C 语言。下面的测试过程在 Debian 6 和 Debian 7 上执行。首先,在栈内分配一页内存空间,并将指针指向内存页的末尾。这里我们使用 **alloca()** 函数来分配内存,不要用 malloc() 函数,它会把内存分配在堆上。
|
||||
|
||||
void *mem = alloca(sysconf(_SC_PAGESIZE)) + sysconf(_SC_PAGESIZE);
|
||||
|
||||
然后使用 **clone()** 函数创建子进程,传入栈空间的地址 "mem",以及指定命名空间的标记。同时我们还指定“callee”作为子进程运行的函数。
|
||||
然后使用 **clone()** 函数创建子进程,传入我们的子栈空间地址 "mem",并指定命名空间的标记。同时我们还指定“callee”作为子进程运行的函数。
|
||||
|
||||
mypid = clone(callee, mem, SIGCHLD | CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWNS | CLONE_FILES, NULL);
|
||||
|
||||
**clone** 之后我们要在父进程中等待子进程先退出,否则的话,父进程会继续运行下去,直到进程结束,留下子进程变成孤儿进程:
|
||||
**clone** 之后我们要在父进程中等待子进程先退出,否则的话,父进程会继续运行下去,并马上进程结束,留下子进程变成孤儿进程:
|
||||
|
||||
while (waitpid(mypid, &r, 0) < 0 && errno == EINTR)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
最后当子进程退出后,我们会回到 shell 界面。
|
||||
最后当子进程退出后,我们会回到 shell 界面,并返回子进程的退出码。
|
||||
|
||||
if (WIFEXITED(r))
|
||||
{
|
||||
@ -47,7 +51,7 @@ Linux 命名空间
|
||||
return ret;
|
||||
}
|
||||
|
||||
程序挂载 **/proc** 文件系统,设置用户 ID 和组 ID,值都为“u”,然后运行 **/bin/bash** 程序,[LXC][1] 是操作系统级的虚拟化工具,使用 cgroups 和命名空间来完成资源的分离。现在我们把所有代码放在一起,变量“u”的值设为65534,在 Debian 系统中,这是“nobody”和“nogroup”:
|
||||
程序挂载了 **/proc** 文件系统,设置用户 ID 和组 ID,值都为“u”,然后运行 **/bin/bash** 程序,[LXC][1] 是一个操作系统级的虚拟化工具,使用 cgroups 和命名空间来完成资源的分离。现在我们把所有代码放在一起,变量“u”的值设为65534,在 Debian 系统中,这是“nobody”和“nogroup”:
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <unistd.h>
|
||||
@ -101,12 +105,16 @@ Linux 命名空间
|
||||
nobody 5 0.0 0.0 2784 1064 pts/1 R+ 21:21 0:00 ps auxw
|
||||
nobody@w:~/pen/tmp$
|
||||
|
||||
注意上面的结果,UID 和 GID 被设置成 nobody 和 nogroup 了,特别是 ps 工具只输出两个进程,它们的 ID 分别是1和5(LCTT注:这就是上文介绍 CLONE_NEWPID 时提到的功能,在线程所在的命名空间内,进程 ID 可以为1,映射到命名空间外就是65534;而命名空间外的 ID 为1的进程一直是 init)。接下来轮到使用 ip netns 来设置网络的命名空间。第一步先确定当前系统没有命名空间:
|
||||
注意上面的结果,UID 和 GID 被设置成 nobody 和 nogroup 了,特别是 ps 工具只输出两个进程,它们的 ID 分别是1和5(LCTT注:这就是上文介绍 CLONE_NEWPID 时提到的功能,在线程所在的命名空间内,进程 ID 可以为1,映射到命名空间外是另外一个 PID;而命名空间外的 ID 为1的进程一直是 init)。
|
||||
|
||||
### 网络命名空间
|
||||
|
||||
接下来轮到使用 ip netns 来设置网络的命名空间。第一步先确定当前系统没有命名空间:
|
||||
|
||||
root@w:~# ip netns list
|
||||
Object "netns" is unknown, try "ip help".
|
||||
|
||||
这种情况下,你需要更新你的系统内核,以及 ip 工具。这里假设你的内核版高于2.6.24,ip 工具版本也差不多,高于2.6.24(LCTT注:ip 工具由 iproute 安装包提供,此安装包版本与内核版本相近)。更新好后,**ip netns list** 在没有命名空间存在的情况下不会输出任务信息。加个名为“ns1”的命名空间看看:
|
||||
如果报了上述错误,你需要更新你的系统内核,以及 ip 工具程序。这里假设你的内核版高于2.6.24,ip 工具版本也差不多,高于2.6.24(LCTT注:ip 工具由 iproute 安装包提供,此安装包版本与内核版本相近)。更新好后,**ip netns list** 在没有命名空间存在的情况下不会输出任务信息。加个名为“ns1”的命名空间看看:
|
||||
|
||||
root@w:~# ip netns add ns1
|
||||
root@w:~# ip netns list
|
||||
@ -120,7 +128,7 @@ Linux 命名空间
|
||||
2: eth0: mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000
|
||||
link/ether 00:0c:29:65:25:9e brd ff:ff:ff:ff:ff:ff
|
||||
|
||||
创建新的虚拟网卡,加到命名空间。虚拟网卡需要成对创建,互相关联——想想交叉电缆吧:
|
||||
创建新的虚拟网卡,并加到命名空间。虚拟网卡需要成对创建,互相关联——就像交叉电缆一样:
|
||||
|
||||
root@w:~# ip link add veth0 type veth peer name veth1
|
||||
root@w:~# ip link list
|
||||
@ -146,11 +154,11 @@ Linux 命名空间
|
||||
|
||||
这个时候 **ifconfig** -a 命令只能显示 veth0,不能显示 veth1,因为后者现在在 ns1 命名空间中。
|
||||
|
||||
如果想删除 veth1,可以执行下面的命令:
|
||||
如果想删除 veth0/veth1,可以执行下面的命令:
|
||||
|
||||
ip netns exec ns1 ip link del veth1
|
||||
|
||||
为 veth0 分配 IP 地址:
|
||||
我们可以为 veth0 分配 IP 地址:
|
||||
|
||||
ifconfig veth0 192.168.5.5/24
|
||||
|
||||
@ -229,7 +237,7 @@ via: http://www.howtoforge.com/linux-namespaces
|
||||
|
||||
作者:[aziods][a]
|
||||
译者:[bazz2](https://github.com/bazz2)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,9 +1,8 @@
|
||||
如何在linux上通过rsyslog来配置一个syslog服务器
|
||||
在 Linux 上配置一个 syslog 服务器
|
||||
========================================================================
|
||||
syslog服务器表示一个用来监控一个网络中的端点--所有能够通过网络来发送日志的设施(包含了Linux或Windows服务器,路由器,交换机以及其他主机)--的中央日志。 通过设置一个syslog服务器,可以将不同设施/主机发送的日志,过滤和合并到一个独立的位置,这样使得你更容易地查看和获取重要的日志消息。
|
||||
|
||||
**rsyslog** 被作为标准的syslog守护进程预装在了大多数的Linux发行版中。在客户端/服务器架构的配置下,**rsyslog**同时扮演了两种角色:1.作为一个syslog服务器,**rsyslog**可以收集来自其他设施的日志信息;2.作为一个syslog客户端,**rsyslog**可以将其内部的日志信息传输到远程的syslog服务器。
|
||||
syslog服务器可以用作一个网络中的日志监控中心,所有能够通过网络来发送日志的设施(包含了Linux或Windows服务器,路由器,交换机以及其他主机)都可以把日志发送给它。 通过设置一个syslog服务器,可以将不同设施/主机发送的日志,过滤和合并到一个独立的位置,这样使得你更容易地查看和获取重要的日志消息。
|
||||
|
||||
**rsyslog** 作为标准的syslog守护进程,预装在了大多数的Linux发行版中。在客户端/服务器架构的配置下,**rsyslog**同时扮演了两种角色:1.作为一个syslog服务器,**rsyslog**可以收集来自其他设施的日志信息;2.作为一个syslog客户端,**rsyslog**可以将其内部的日志信息传输到远程的syslog服务器。
|
||||
|
||||
在此,我们演示了在linux上如何通过**rsyslog**来配置一个中心化syslog服务器。 在进入详解之前,先温习一下syslog标准。
|
||||
|
||||
@ -12,12 +11,11 @@ syslog服务器表示一个用来监控一个网络中的端点--所有能够通
|
||||
当通过syslog机制来收集日志时,有3个必须要考虑到的重要事情:
|
||||
|
||||
- **设施层级**: 监听何种类型的进程
|
||||
- **严重性 (优先) 级别**: 收集何种类型的日志消息
|
||||
- **严重性 (优先) 级别**: 收集何种级别的日志消息
|
||||
- **目标**: 发送或记录日志消息到何处
|
||||
|
||||
现在我们更加深入地了解一下配置是如何定义的。
|
||||
|
||||
|
||||
设施层级定义了一种用来对内部系统进程进行分类的方法,linux中的一些常见的设施包括:
|
||||
|
||||
- **auth**: 身份验证相关的消息(登录时)
|
||||
@ -29,7 +27,7 @@ syslog服务器表示一个用来监控一个网络中的端点--所有能够通
|
||||
- **lpr**: 打印服务相关的消息
|
||||
- **local0 - local7**: 用户自定义的消息 (local7 通常被Cisco 和 Windows 服务器 使用)
|
||||
|
||||
严重性(优先)级别是通过标准的缩写和赋予的数字来进行定义和标准化的,其中的数字7具有最高的级别,这些级别包含了:
|
||||
严重性(优先)级别有固定的标准缩写和指代的值,其中的数字7具有最高的级别,这些级别包含了:
|
||||
|
||||
- emerg: Emergency(紧急)- 0
|
||||
- alert: Alerts (报警)- 1
|
||||
@ -40,79 +38,75 @@ syslog服务器表示一个用来监控一个网络中的端点--所有能够通
|
||||
- info: Information (消息)- 6
|
||||
- debug: Debugging (调试)- 7
|
||||
|
||||
最后,目标语句迫使一个syslog客户端来执行以下3个任务中的一个:1.保存日志消息到一个本地文件;2. 通过TCP/UDP将消息路由到远程的syslog服务器中
|
||||
;3.将其发送到一个标准输出中,例如控制台。
|
||||
最后,目标语句会让一个syslog客户端来执行以下三个任务之一:
|
||||
|
||||
在rsyslog, syslog配置是基于以下模式进行结构化的。
|
||||
1. 保存日志消息到一个本地文件;
|
||||
2. 通过TCP/UDP将消息路由到远程的syslog服务器中;
|
||||
3. 将其发送到一个标准输出中,例如控制台。
|
||||
|
||||
在 rsyslog里, syslog的配置是基于以下模式进行结构化的。
|
||||
|
||||
[facility-level].[severity-level] [destination]
|
||||
|
||||
### Configure Rsyslog on Linux ###
|
||||
### 在Linux中配置Rsyslog###
|
||||
|
||||
在我们理解syslog之后,现在是时候来通过rsyslog来将一个Linux服务器配置为一个中心syslog服务器了,另外我们也将看到如何将基于Windows的系统配置为一个syslog客户端来发送内部日志到该syslog服务器中。
|
||||
在我们理解syslog之后,现在可以通过rsyslog来将一个Linux服务器配置为一个中心syslog服务器了,另外我们也将看到如何在一个Windows的系统上配置一个syslog客户端来发送内部日志到该syslog服务器中。
|
||||
|
||||
### 第1步: 初始化系统需求 ###
|
||||
|
||||
为了将linux主机设置为一个中央日志服务器, 我们需要创建一个隔离的/var 分区,并分配足够大的磁盘空间或者创建一个特殊的LVM卷组。这样就会使得syslog服务器能够承担在日积月累收集日志所带来的潜在增长。
|
||||
|
||||
要将linux主机设置为一个中央日志服务器, 我们需要创建一个分离的 /var 分区,并分配足够大的磁盘空间或者创建一个特殊的LVM卷组。这样就会使得syslog服务器能够承担在日积月累收集日志所带来的潜在增长。
|
||||
|
||||
### 第2步: 让rsyslog 后台进程生效 ###
|
||||
|
||||
rsyslog守护进程来自于当前的linux发布版本的预装模块,但是默认并没有启动。为了能够让rsyslog守护进程能够接受外部的消息,需要编辑其配置文件/etc/rsyslog.conf.
|
||||
|
||||
如果已经准备好打开文件进行编辑,查找到下面的两行所在的位置,通过删除其行首的#字符来取消其注释。
|
||||
打开文件进行编辑,查找到下面的两行所在的位置,通过删除其行首的#字符来取消注释。
|
||||
|
||||
$ModLoad imudp
|
||||
$UDPServerRun 514
|
||||
|
||||
这会使得rsysolog守护进程能够在UDP端口514上接受日志消息了---UDP是一种比TCP速度快,但是并不具有TCP一样的数据流程的可靠性。所以如果你需要使用可靠的传送机制,就可以通过取消以下行的注释。
|
||||
这会使得rsysolog守护进程能够在UDP端口514上接受日志消息了---UDP是一种比TCP速度快,但是并不具有TCP一样的数据流的可靠性。所以如果你需要使用可靠的传送机制,就可以通过取消以下行的注释。
|
||||
|
||||
$ModLoad imtcp
|
||||
$InputTCPServerRun 514
|
||||
|
||||
需要注意的是,TCP和UDP可以被同时生效来监听TCP/UDP 连接。
|
||||
|
||||
### 第3步:创建日志接受模板###
|
||||
### 第3步:创建日志接收模板###
|
||||
|
||||
接下来的这步,需要我们来为远程消息创建模板,并告知rsyslog守护进程如何记录从其他客户端机器所接受到的消息。
|
||||
|
||||
|
||||
使用文本编辑器来打开 /etc/rsyslog.conf,然后在GLOBAL DIRECTIVE块前追加以下的模板。
|
||||
|
||||
$template RemoteLogs,"/var/log/%HOSTNAME%/%PROGRAMNAME%.log" *
|
||||
*.* ?RemoteLogs
|
||||
& ~
|
||||
|
||||
在此对该模板进行简单解释,$template RemoteLogs(“RemoteLogs” 字符串可以为任何其他的指令名称)指令强制rsyslog后台进程将日志消息写道/var/log下的分开的本地日志文件中,其中日志文件的名称是基于远程日志发送机器的主机名以及生成该日志的应用程序名进行定义的。其中第二行暗示了我们将RemoteLogs模板应用到所有接受到的日志上。
|
||||
|
||||
|
||||
符号"& ~"表示了一个重定向规则,被用来告知rsyslog守护进程停止对日志消息的进一步处理,并且不要在本地写入。如果该重定向规则没有使用,那么所有的远程消息都会在写入上述描述的日志文件之外同时被写入到本地日志文件,这就意味着日志消息实际上被写了两次。使用该规则的另外一个结果就是syslog服务器本身的日志消息只会被以该机器主机名命名的专有文件中。
|
||||
在此对该模板进行简单解释,$template RemoteLogs(这里“RemoteLogs” 字符串可以为任何其他的描述性的名称)指令使rsyslog后台进程将日志消息写到/var/log下的单独的本地日志文件中,其中日志文件的名称是基于远程日志发送机器的主机名以及生成该日志的应用程序名进行定义的。其中第二行暗示了我们将RemoteLogs模板应用到所有接收到的日志上。
|
||||
|
||||
符号"& ~"表示了一个重定向规则,被用来告知rsyslog守护进程停止对日志消息的进一步处理,并且不要在本地写入。如果没有使用该重定向规则,那么所有的远程消息都会在写入上述描述的日志文件之外同时被写入到本地日志文件,这就意味着日志消息实际上被写了两次。使用该规则的另外一个结果就是syslog服务器本身的日志消息只会被以该机器主机名命名的专有文件中。
|
||||
|
||||
如果你想要的话,也可以使用下面的模式对特定的设备或严重性级别使用新的模板直接来记录日志消息。
|
||||
|
||||
|
||||
[facility-level].[severity-level] ?RemoteLogs
|
||||
|
||||
例如:
|
||||
|
||||
将所有内部的所有优先级别的用户验证消息指定为RemoteLogs模板:
|
||||
将全部优先级别的所有内部用户验证消息指定为RemoteLogs模板:
|
||||
|
||||
authpriv.* ?RemoteLogs
|
||||
|
||||
将所有系统进程中除开mail,用户验证和cron消息之外的进程产生的消息级别的日志指定为RemoteLogs模板:
|
||||
|
||||
将所有系统进程中除开mail、用户验证和cron消息之外的进程产生的消息级别的日志指定为RemoteLogs模板:
|
||||
|
||||
*.info,mail.none,authpriv.none,cron.none ?RemoteLogs
|
||||
|
||||
如果我们想要将所有从远程客户端接受到的消息写入到一个以它们的IP地址命名的单个文件中,可以使用以下的模板。在此我们为该模板赋予了“IPTemplate”名称。
|
||||
如果我们想要将所有从远程客户端接受到的消息写入到一个以它们的IP地址命名的单个文件中,可以使用以下的模板。在此我们为该模板赋予了“IpTemplate”名称。
|
||||
|
||||
$template IpTemplate,"/var/log/%FROMHOST-IP%.log"
|
||||
*.* ?IpTemplate
|
||||
& ~
|
||||
|
||||
在我们生效rsyslog守护进程以及编辑其配置文件之后,需要重启该守护进程。
|
||||
在我们启用rsyslog守护进程并编辑好配置文件之后,需要重启该守护进程。
|
||||
|
||||
在 Debian,Ubuntu 或 CentOS/RHEL 6中:
|
||||
|
||||
@ -138,19 +132,17 @@ rsyslog守护进程来自于当前的linux发布版本的预装模块,但是
|
||||
|
||||
### 发送Windows日志到一个远程的rsyslog服务器###
|
||||
|
||||
为了将一个Windows客户端的日志消息转发到我们的rsyslog服务器,需要一个Windows syslog 代理。当然,有许多的syslog代理可以在windows上运行,在此我们可以使用一个自由软件程序 [Datagram SyslogAgent][1].
|
||||
|
||||
|
||||
要将一个Windows客户端的日志消息转发到我们的rsyslog服务器,需要一个安装 Windows syslog 代理。当然,有许多的syslog代理可以在windows上运行,在此我们可以使用一个自由软件程序 [Datagram SyslogAgent][1].
|
||||
|
||||
在下载安装该syslog代理后,需要将其配置为作为服务运行。指定使用何种协议来发送数据,以及远程rsyslog服务器的IP地址和端口,最后指定应该传输的事件日志类型,如下所示。
|
||||
|
||||
![](https://farm8.staticflickr.com/7509/15305930594_27b7f4440a_o.jpg)
|
||||
|
||||
在我们完成所有的这些配置之后,我们就可以启动该服务并且在中央rsyslog服务器中使用命令行工具tailf来查看日志文件了。
|
||||
在我们完成所有的这些配置之后,我们就可以启动该服务并且在中央rsyslog服务器中使用命令行工具tail -f来查看日志文件了。
|
||||
|
||||
### 总结###
|
||||
|
||||
通过创建一个可以收集本地和远程主机的中央rsyslog服务器,我们可以更好地了解在这些系统内部究竟发生着什么,而且可以更加容易地调试他们的问题,是否在他们之间有任何缓慢或崩溃存在。
|
||||
通过创建一个可以收集本地和远程主机的中央rsyslog服务器,我们可以更好地了解在这些系统内部究竟发生着什么,而且可以更加容易地调试它们的问题,是否在它们之间有任何延迟或崩溃存在。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -158,7 +150,7 @@ via: http://xmodulo.com/configure-syslog-server-linux.html
|
||||
|
||||
作者:[Caezsar M][a]
|
||||
译者:[theo-l](https://github.com/theo-l)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,16 +1,16 @@
|
||||
Linux有问必答时间--怎样解决“XXX is not in the sudoers file”错误
|
||||
Linux有问必答时间:怎样解决“XXX is not in the sudoers file”错误
|
||||
================================================================================
|
||||
> **问题**:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户ID] is not in the sudoers file. This incident will be reported."的错误信息。我该怎么处理这种sudo错误呢?
|
||||
> **问题**:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incident will be reported."的错误信息。我该怎么处理这种sudo错误呢?
|
||||
|
||||
sudo是一个允许特定的用户组用另一个用户(典型的代表是root)的特权来运行一个命令。sudo有详细的日志功能并且提供了细粒度控制来覆盖用户通过sudo敲入的命令。
|
||||
sudo是一个允许特定的用户组用另一个用户(典型的是root)的特权来运行一个命令。sudo有详细的日志功能,并且提供了对用户可通过sudo来运行哪些命令的细粒度控制。
|
||||
|
||||
### Sudo vs. Su ###
|
||||
|
||||
su命令也提供了同样的特权升级功能,两者不同的是它们认证过程和特权变化的粒度。su允许你从你的登录会话切换到另一个用户的会话,然后你可以随心所欲地用该用户的特权来运行任何程序,但是你需要知道目标用户的密码才能切换这个用户。另一方面,sudo能在每个命令的基础上工作,允许你用root的特权来运行单个命令。用sudo你不必一定要知道root的密码,但是在提示输入sudo密码的时候要输入你的密码。
|
||||
su命令也提供了同样的特权提升功能,两者不同的是它们认证过程和特权变化的粒度。su允许你从你的登录会话切换到另一个用户的会话,然后你可以随心所欲地用该用户的特权来运行任何程序,但是你需要知道目标用户的密码才能切换这个用户。而另一方面,sudo能在单个命令的基础上工作,允许你用root的特权来运行单个命令。用sudo你不必一定要知道root的密码,但是在提示输入sudo密码的时候要输入你的密码。
|
||||
|
||||
### 在Sudoers列表里添加用户 ###
|
||||
|
||||
作为一个新用户的你如果试图运行sudo命令,你会碰到以下错误。意思是你不在这个包含经过认证可以使用sudo特权的这么一个用户组的sudoers列表里。
|
||||
作为一个新用户的你如果试图运行sudo命令,你会碰到以下错误。意思是你不在这个包含经过认证就可以使用sudo特权的这么一个用户组的sudoers列表里。
|
||||
|
||||
[my-user-id] is not in the sudoers file. This incident will be reported.
|
||||
|
||||
@ -32,11 +32,11 @@ su命令也提供了同样的特权升级功能,两者不同的是它们认证
|
||||
|
||||
alice adm cdrom sudo dip plugdev fuse lpadmin netdev sambashare davfs2 libvirtd docker promiscuous
|
||||
|
||||
组员资格变动(和sudo访问)会在你登出登录后生效。
|
||||
组员资格变动(和sudo访问)会在你登出后重新登录后生效。
|
||||
|
||||
### 方法二 ###
|
||||
|
||||
第二个能让你使用sudo的方法是直接把你自己添加到路径为 /etc/sudoers 这个配置文件中去。
|
||||
第二个能让你使用sudo的方法是直接把你自己添加到 /etc/sudoers 这个配置文件中去。
|
||||
|
||||
要修改 /etc/sudoers 文件,你可以使用一个名为visudo的特殊sudo编辑器命令。用root身份简单调用以下命令。
|
||||
|
||||
@ -55,6 +55,6 @@ su命令也提供了同样的特权升级功能,两者不同的是它们认证
|
||||
via: http://ask.xmodulo.com/fix-is-not-in-the-sudoers-file.html
|
||||
|
||||
译者:[ZTinoZ](https://github.com/ZTinoZ)
|
||||
校对:[校对者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有问必答: 如何通过命令行创建和设置一个MySQL用户
|
||||
Linux有问必答:如何通过命令行创建和设置一个MySQL用户
|
||||
================================================================================
|
||||
|
||||
> **问题**:我想要在MySQL服务器上创建一个新的用户帐号,并且赋予他适当的权限和资源限制。如何通过命令行的方式来创建并且设置一个MySQL用户呢?
|
||||
@ -21,7 +21,7 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户
|
||||
|
||||
mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
|
||||
|
||||
一旦用户被创建后,包括加密的密码、权限和资源限制在内的所有帐号细节都会被存储在一个名为**user**的表中,这个表则存在与**mysql**这个特殊的数据库里。
|
||||
一旦用户被创建后,包括加密的密码、权限和资源限制在内的所有帐号细节都会被存储在一个名为**user**的表中,这个表则存在于**mysql**这个特殊的数据库里。
|
||||
|
||||
运行下列命令,验证帐号是否创建成功
|
||||
|
||||
@ -33,14 +33,14 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户
|
||||
|
||||
- **ALL**: 所有可用的权限
|
||||
- **CREATE**: 创建库、表和索引
|
||||
- **LOCK_TABLES**: 锁定表.
|
||||
- **ALTER**: 修改表.
|
||||
- **DELETE**: 删除表.
|
||||
- **INSERT**: 插入表或列.
|
||||
- **SELECT**: 选择表或列.
|
||||
- **CREATE_VIEW**: 创建视图.
|
||||
- **SHOW_DATABASES**: 展示数据库.
|
||||
- **DROP**: 删除库、表和视图.
|
||||
- **LOCK_TABLES**: 锁定表
|
||||
- **ALTER**: 修改表
|
||||
- **DELETE**: 删除表
|
||||
- **INSERT**: 插入表或列
|
||||
- **SELECT**: 检索表或列的数据
|
||||
- **CREATE_VIEW**: 创建视图
|
||||
- **SHOW_DATABASES**: 列出数据库
|
||||
- **DROP**: 删除库、表和视图
|
||||
|
||||
运行以下命令赋予"myuser"用户特定权限。
|
||||
|
||||
@ -70,10 +70,10 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户
|
||||
|
||||
在MySQL中,你可以为单独的用户设置MySQL的资源使用限制。可用的资源限制如下:
|
||||
|
||||
- **MAX_QUERIES_PER_HOUR**: 允许的每小时最大请求数量.
|
||||
- **MAX_UPDATES_PER_HOUR**: 允许的每小时最大更新数量.
|
||||
- **MAX_CONNECTIONS_PER_HOUR**: 允许的每小时最大连接(译者注:[其与 MySQL全局变量: max_user_connections 共同决定用户到数据库的同时连接数量](http://dev.mysql.com/doc/refman/5.0/en/user-resources.html))数量.
|
||||
- **MAX_USER_CONNECTIONS**: 对服务器的同时连接量.
|
||||
- **MAX\_QUERIES\_PER\_HOUR**: 允许的每小时最大请求数量
|
||||
- **MAX\_UPDATES\_PER\_HOUR**: 允许的每小时最大更新数量
|
||||
- **MAX\_CONNECTIONS\_PER\_HOUR**: 允许的每小时最大连接(译者注:[其与 MySQL全局变量: max\_user\_connections 共同决定用户到数据库的同时连接数量](http://dev.mysql.com/doc/refman/5.0/en/user-resources.html))数量
|
||||
- **MAX\_USER\_CONNECTIONS**: 对服务器的同时连接量
|
||||
|
||||
使用以下命令为"myuser"帐号增加一个资源限制:
|
||||
|
||||
@ -102,6 +102,6 @@ Linux有问必答: 如何通过命令行创建和设置一个MySQL用户
|
||||
via: http://ask.xmodulo.com/create-configure-mysql-user-command-line.html
|
||||
|
||||
译者:[Ping](http://weibo.com/370321376)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -48,7 +48,7 @@ Linux有问必答:如何在Debian或Ubuntu上安装完整的内核源码
|
||||
via: http://ask.xmodulo.com/install-full-kernel-source-debian-ubuntu.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[martin qi](https://github.com/martin2011qi)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,26 @@
|
||||
经过 systemd 争执后,辞职的 Debian TC 席位已被增补
|
||||
================================================================================
|
||||
|
||||
去年随着Debian 以 systemd 作为 init 管理器的决议,以及随后的 [init 系统投票][1],有三个人从 Debian 技术委员会退出:Colin Watson, [Ian Jackson][2], 以及 [Russ Allbery][3]。现在,这些空缺席位现已由现有的技术委员会成员任命。
|
||||
|
||||
新任命的技术委员会成员是 Sam Hartman, Tollef Fog Heen 以及 Didier Raboud。这些新成员加上Bdale Garbee, Don Armstrong, Andreas Barth, Steve Langasek 以及 Keith Packard 组成了现在的Debian技术委员会。由Debian章程确定的 Debian 技术委员会(TC)负责对 Debian 项目中的技术争端做出最后的决定,他们在去年所有的关于 init 系统的讨论中变得十分重要。
|
||||
|
||||
![](http://www.phoronix.net/image.php?id=debconf12_managua&image=debconf_12_conference_med)
|
||||
|
||||
新技术委员会成员的委任公告可以从 [debian-devel-announce列表][4] 中获悉。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.phoronix.com/scan.php?page=news_item&px=Debian-TC-Three-Appointments
|
||||
|
||||
作者:[Michael Larabel][a]
|
||||
译者:[alim0x](https://github.com/alim0x)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.michaellarabel.com/
|
||||
[1]:http://www.phoronix.com/scan.php?page=news_item&px=MTg0MzY
|
||||
[2]:http://www.phoronix.com/scan.php?page=news_item&px=MTg0NDA
|
||||
[3]:http://www.phoronix.com/scan.php?page=news_item&px=MTg0MjM
|
||||
[4]:https://lists.debian.org/debian-devel-announce/2015/03/msg00003.html
|
@ -1,3 +1,4 @@
|
||||
Love-xuan Translating
|
||||
Group Test: Linux Text Editors
|
||||
================================================================================
|
||||
> Mayank Sharma tests five supercharged text editors that can crunch more than just words.
|
||||
@ -315,4 +316,4 @@ via: http://www.linuxvoice.com/text-editors/
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxvoice.com/author/ben_everard/
|
||||
[a]:http://www.linuxvoice.com/author/ben_everard/
|
||||
|
@ -1,3 +1,5 @@
|
||||
FSSlc translating
|
||||
|
||||
Intense Gameplay? Try these 13 Roguelike games
|
||||
================================================================================
|
||||
Roguelike is a sub-genre of role-playing games. It literally means "a game like Rogue". Rogue is a dungeon crawling video game first released in 1980, standing out for being fiendishly addictive. Its goal was to retrieve the Amulet of Yendor, hidden deep in the 26th level, and ascend back to the top.
|
||||
@ -401,4 +403,4 @@ via: http://www.linuxlinks.com/article/201412031524381/RoguelikeGames.html
|
||||
[11]:http://rephial.org/
|
||||
[12]:http://sourceforge.net/apps/trac/unnethack/
|
||||
[13]:http://www.roguetemple.com/z/hydra/
|
||||
[14]:https://sites.google.com/site/broguegame/
|
||||
[14]:https://sites.google.com/site/broguegame/
|
||||
|
@ -1,84 +0,0 @@
|
||||
Translating by ZTinoZ
|
||||
What is a good IDE for C/C++ on Linux
|
||||
================================================================================
|
||||
"A real coder doesn't use an IDE, a real coder uses [insert a text editor name here] with such and such plugins." We all heard that somewhere. Yet, as much as one can agree with that statement, an IDE remains quite useful. An IDE is easy to set up and use out of the box. Hence there is no better way to start coding a project from scratch. So for this post, let me present you with my list of good IDEs for C/C++ on Linux. Why is C/C++ specifically? Because C is my favorite language, and we need to start somewhere. Also note that there are in general a lot of ways to code in C, so in order to trim down the list, I only selected "real out-of-the-box IDE", not text editors like Gedit or Vim pumped with [plugins][1]. Not that this alternative is bad in any way, just that the list will go on forever if I include text editors.
|
||||
|
||||
### 1. Code::Blocks ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7520/16089880989_10173db27b_c.jpg)
|
||||
|
||||
Starting all out with my personal favorite, [Code::Blocks][2] is a simple and fast IDE for C/C++ exclusively. Like any respectable IDE, it integrates syntax highlighting, bookmarking, word completion, project management, and a debugger. Where it shines is via its simple plugin system which adds indispensable tools like Valgrind and CppCheck, and less indispensable like a Tetris mini-game. But my reason for liking it particularly is for its coherent set of handy shortcuts, and the large number of options that never feel too overwhelming.
|
||||
|
||||
### 2. Eclipse ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7522/16276001255_66235a0a69_c.jpg)
|
||||
|
||||
I know that I said only "real out-of-the-box IDE" and not a text editor pumped with plugins, but [Eclipse][3] is a "real out-of-the-box IDE." It's just that Eclipse needs a little [plugin][4] (or a variant) to code in C. So I technically did not contradict myself. And it would have been impossible to make an IDE list without mentioning the behemoth that is Eclipse. Like it or not, Eclipse remains a great tool to code in Java. And thanks to the [CDT Project][5], it is possible to program in C/C++ too. You will benefit from all the power of Eclipse and its traditional features like word completion, code outline, code generator, and advanced refactoring. What it lacks in my opinion is the lightness of Code::Blocks. It is still very heavy and takes time to load. But if your machine can take it, or if you are a hardcore Eclipse fan, it is a very safe option.
|
||||
|
||||
### 3. Geany ###
|
||||
|
||||
![](https://farm9.staticflickr.com/8573/16088461968_c6a6c9e49a_c.jpg)
|
||||
|
||||
With a lot less features but a lot more flexibility, [Geany][6] is at the opposite of Eclipse. But what it lacks (like a debugger for example), Geany makes it up with nice little features: a space for note taking, creation from template, code outline, customizable shortcuts, and plugins management. Geany is still closer to an extensive text editor than an IDE here. However I keep it in the list for its lightness and its well designed interface.
|
||||
|
||||
### 4. MonoDevelop ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7515/16275175052_61487480ce_c.jpg)
|
||||
|
||||
Another monster to add to the list, [MonoDevelop][7] has a very unique feel derived from its look and interface. I personally love its project management and its integrated version control system. The plugin system is also pretty amazing. But for some reason, all the options and the support for all kind of programming languages make it feel a bit overwhelming to me. It remains a great tool that I used many times in the past, but just not my number one when dealing with "simplistic" C.
|
||||
|
||||
### 5. Anjuta ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7514/16088462018_7ee6e5b433_c.jpg)
|
||||
|
||||
With a very strong "GNOME feeling" attached to it, [Anjuta][8]'s appearance is a hit or miss. I tend to see it as an advanced version of Geany with a debugger included, but the interface is actually a lot more elaborate. I do enjoy the tab system to switch between the project, folders, and code outline view. I would have liked maybe a bit more shortcuts to move around in a file. However, it is a good tool, and offers outstanding compilation and build options, which can support the most specific needs.
|
||||
|
||||
### 6. Komodo Edit ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7502/16088462028_81d1114c84_c.jpg)
|
||||
|
||||
I was not very familiar with [Komodo Edit][9], but after trying it a few days, it surprised me with many many good things. First, the tab-based navigation is always appreciable. Then the fancy looking code outline reminds me a lot of Sublime Text. Furthermore, the macro system and the file comparator make Komodo Edit very practical. Its plugin library makes it almost perfect. "Almost" because I do not find the shortcuts as nice as in other IDEs. Also, I would enjoy more specific C/C++ tools, and this is typically the flaw of general IDEs. Yet, very enjoyable software.
|
||||
|
||||
### 7. NetBeans ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7569/16089881229_98beb0fce3_c.jpg)
|
||||
|
||||
Just like Eclipse, impossible to avoid this beast. With navigation via tabs, project management, code outline, change history tracking, and a plethora of tools, [NetBeans][10] might be the most complete IDE out there. I could list for half a page all of its amazing features. But that will tip you off too easily about its main disadvantage, it might be too big. As great as it is, I prefer plugin based software because I doubt that anyone will need both Git and Mercurial integration for the same project. Call me crazy. But if you have the patience to master all of its options, you will be pretty much become the master of IDEs everywhere.
|
||||
|
||||
### 8. KDevelop ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7519/15653583824_e412f2ab1f_c.jpg)
|
||||
|
||||
For all KDE fans out there, [KDevelop][11] might be the answer to your prayers. With a lot of configuration options, KDevelop is yours if you manage to seize it. Call me superficial but I never really got past the interface. But it's too bad for me as the editor itself packs quite a punch with a lot of navigation options and customizable shortcuts. The debugger is also very advanced and will take a bit of practice to master. However, this patience will be rewarded with this very flexible IDE's full power. And it gets special credits for its amazing embedded documentation.
|
||||
|
||||
### 9. CodeLite ###
|
||||
|
||||
![](https://farm9.staticflickr.com/8594/16250066446_b5f654e63f_c.jpg)
|
||||
|
||||
Finally, last for not least, [CodeLite][12] shows that you can take a traditional formula and still get something with its own feeling attached to it. If the interface really reminded me of Code::Blocks and Anjuta at first, I was just blown away by the extensive plugin library. Whether you want to diff a file, insert a copyright block, define an abbreviation, or push your work on Git, there is a plugin for you. If I had to nitpick, I would say that it lacks a few navigation shortcuts for my taste, but that's really it.
|
||||
|
||||
To conclude, I hope that this list had you discover new IDEs for coding in your favorite language. While Code::Blocks remains my favorite, it has some serious challengers. Also we are far from covering all the ways to code in C/C++ using an IDE on Linux. So if you have another one to propose, let us know in the comments. Also if you would like me to cover IDEs for a different language next, also let us know in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/good-ide-for-c-cpp-linux.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/adrien
|
||||
[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html
|
||||
[2]:http://www.codeblocks.org/
|
||||
[3]:https://eclipse.org/
|
||||
[4]:http://xmodulo.com/how-to-set-up-c-cpp-development-environment-in-eclipse.html
|
||||
[5]:https://eclipse.org/cdt/
|
||||
[6]:http://www.geany.org/
|
||||
[7]:http://www.monodevelop.com/
|
||||
[8]:http://anjuta.org/
|
||||
[9]:http://komodoide.com/komodo-edit/
|
||||
[10]:https://netbeans.org/
|
||||
[11]:https://www.kdevelop.org/
|
||||
[12]:http://codelite.org/
|
@ -1,129 +0,0 @@
|
||||
Translating By H-mudcup
|
||||
CD Audio Grabbers - Graphical Based
|
||||
================================================================================
|
||||
CD audio grabbers are designed to extract ("rip") the raw digital audio (in a format commonly called CDDA) from a compact disc to a file or other output. This type of software enables a user to encode the digital audio into a variety of formats, and download and upload disc info from freedb, an internet compact disc database.
|
||||
|
||||
Is copying CDs legal? Under US copyright law, converting an original CD to digital files for personal use has been cited as qualifying as 'fair use'. However, US copyright law does not explicitly allow or forbid making copies of a personally-owned audio CD, and case law has not yet established what specific scenarios are permitted as fair use. The copyright position is much clearer in the UK. From 2014 it become legal for UK citizens to make copies of CDs, MP3s, DVD, Blu-rays and e-books. This only applies if the individual owns the physical media being ripped, and the copy is made only for their own private use. For other countries in the European Union, member nations can allow a private copy exception too.
|
||||
|
||||
If you are not sure what the position is for the country you live in, please check your local copyright law to make sure that you are on the right side of the law before using the software featured in this two page article.
|
||||
|
||||
To some extent, it may seem a bit of a chore to rip CDs. Streaming services like Spotify and Google Play Music offer access to a huge library of music in a convenient form, and without having to rip your CD collection. However, if you already have a large CD collection, it is still desirable to be able to convert your CDs to enjoy on mobile devices like smartphones, tablets, and portable MP3 players.
|
||||
|
||||
This two page article highlights my favorite audio CD grabbers. I pick the best four graphical audio grabbers, and the best four console audio grabbers. All of the utilities are released under an open source license.
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/freac.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-freac.png)
|
||||
|
||||
fre:ac is an open source audio converter and CD ripper that supports a wide range of popular formats and encoders. The utility currently converts between MP3, MP4/M4A, WMA, Ogg Vorbis, FLAC, AAC, WAV and Bonk formats. It comes with several different presents for the LAME encoder.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
- Easy to learn and use
|
||||
- Converter for MP3, MP4/M4A, WMA, Ogg Vorbis, FLAC, AAC, WAV and Bonk formats
|
||||
- Integrated CD ripper with CDDB/freedb title database support
|
||||
- Multi-core optimized encoders to speed up conversions on modern PCs
|
||||
- Full Unicode support for tags and file names
|
||||
- Easy to learn and use, still offers expert options when you need them
|
||||
- Joblists
|
||||
- Can use Winamp 2 input plugins
|
||||
- Multilingual user interface available in 41 languages
|
||||
|
||||
- Website: [freac.org][1]
|
||||
- Developer: Robert Kausch
|
||||
- License: GNU GPL v2
|
||||
- Version Number: 20141005
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/Audex.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Audex.png)
|
||||
|
||||
Audex is an easy to use open source audio CD ripping application. Whilst it is in a fairly early stage of development, this KDE desktop tool is stable, slick and simple to use.
|
||||
|
||||
The assistant is able to create profiles for LAME, OGG Vorbis (oggenc), FLAC, FAAC (AAC/MP4) and RIFF WAVE. Beyond the assistant you can define your own profile, which means, that Audex works together with commmand line encoders in general.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
- Extract with CDDA Paranoia
|
||||
- Extract and encode run parallel
|
||||
- Filename editing with local and remote CDDB/FreeDB database
|
||||
- Submit new entries to CDDB/FreeDB database
|
||||
- Metadata correction tools like capitalize etc
|
||||
- Multi-profile extraction (with one commandline-encoder per profile)
|
||||
- Fetch covers from the internet and store them in the database
|
||||
- Create playlists, cover and template-based-info files in target directory
|
||||
- Create extraction and encoding protocols
|
||||
- Transfer files to a FTP-server
|
||||
- Internationalization support
|
||||
|
||||
- Website: [kde.maniatek.com/audex][2]
|
||||
- Developer: Marco Nelles
|
||||
- License: GNU GPL v3
|
||||
- Version Number: 0.79
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/SoundJuicer.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-SoundJuicer.png)
|
||||
|
||||
Sound Juicer is a lean CD ripper using GTK+ and GStreamer. It extracts audio from CDs and converts it into audio files. Sound Juicer can also play audio tracks directly from the CD, offering a preview before ripping.
|
||||
|
||||
It supports any audio codec supported by a GStreamer plugin, including MP3, Ogg Vorbis, FLAC, and uncompressed PCM formats.
|
||||
|
||||
It is an established part of the GNOME desktop environment.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
- Automatic track tagging via CDDB
|
||||
- Encoding to ogg / vorbis, FLAC and raw WAV
|
||||
- Easy to configure encoding path
|
||||
- Multiple genres
|
||||
- Internationalization support
|
||||
|
||||
- Website: [burtonini.com][3]
|
||||
- Developer: Ross Burton
|
||||
- License: GNU GPL v2
|
||||
- Version Number: 3.14
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/ripperX.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-ripperX.png)
|
||||
|
||||
ripperX is an open source graphical interface for ripping CD audio tracks and encoding them to Ogg, MP2, MP3, or FLAC formats. It's goal is to be easy to use, requiring only a few mouse clicks to convert an entire album. It supports CDDB lookups for album and track information.
|
||||
|
||||
It uses cdparanoia to convert (i.e. "rip") CD audio tracks to WAV files, and then calls the Vorbis/Ogg encoder oggenc to convert the WAV to an OGG file. It can also call flac to perform lossless compression on the WAV file, resulting in a FLAC file.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
- Very simple to use
|
||||
- Rip audio CD tracks into WAV, MP3, OGG, or FLAC files
|
||||
- Supports CDDB lookups
|
||||
- Supports ID3v2 tags
|
||||
- Pause the ripping process
|
||||
|
||||
- Website: [sourceforge.net/projects/ripperx][4]
|
||||
- Developer: Marc André Tanner
|
||||
- License: MIT/X Consortium License
|
||||
- Version Number: 2.8.0
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxlinks.com/article/20150125043738417/AudioGrabbersGraphical.html
|
||||
|
||||
作者:Frazer Kline
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.freac.org/
|
||||
[2]:http://kde.maniatek.com/audex/
|
||||
[3]:http://burtonini.com/blog/computers/sound-juicer
|
||||
[4]:http://sourceforge.net/projects/ripperx/
|
@ -0,0 +1,38 @@
|
||||
New App Brings Android Notifications to The GNOME Desktop
|
||||
================================================================================
|
||||
![Fancy seeing your Android alerts here? You can.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/02/Screen-Shot-2015-02-24-at-17.47.48.png)
|
||||
Fancy seeing your Android alerts here? You can.
|
||||
|
||||
**You’ll shortly be able to view your Android notifications on the GNOME desktop thanks to a new application in development.**
|
||||
|
||||
The new project is called ‘Nuntius’ and lets notifications received on an Android phone appear on the GNOME desktop. It’s with GNOME 3.16 and its (wonderfully) [redesigned notification system][1] that the app and its features will be used by more.
|
||||
|
||||
The app, which developers are hoping will be ready in time for this month’s release of GNOME 3.16, will work over Bluetooth to ensure that nothing is passed to external servers or stored online. This does mean that your phone will need to be in a certain proximity to your GNOME desktop for the feature to work.
|
||||
|
||||
It also isn’t yet possible to reply to a text message or act on a news alert.
|
||||
|
||||
The development team do caution that **this is an early release** and those planning on diving in to use it should expect minimum functionality for now.
|
||||
|
||||
The mobile app required to see Android notifications in GNOME’s new notification shade is already available [from the Google Play Store][2] and the GNOME application is already available in the Fedora repos.
|
||||
|
||||
The developers have open-sourced both the Android app and the GNOME application receiver and hosted them (where else) on GitHub.
|
||||
|
||||
A similar tool [has been available for KDE desktops][3] – ‘KDE Connect’ – for a year or two, while the ever-gaining Pushbullet offers similar features on Windows, Mac and Linux desktops for iOS and Android platforms using Google Chrome.
|
||||
|
||||
- [Nuntius for Android & GNOME on GitHub][4]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2015/03/new-app-brings-android-notifications-to-the-gnome-desktop
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://www.omgubuntu.co.uk/2015/02/4-reason-why-gnome-3-16-might-be-the-best-version-yet-gallery
|
||||
[2]:https://play.google.com/store/apps/details?id=org.holylobster.nuntius
|
||||
[3]:http://www.omgubuntu.co.uk/2014/06/kde-connect-android-notifications-linux-desktop
|
||||
[4]:https://github.com/holylobster
|
@ -0,0 +1,139 @@
|
||||
4 Linux Based Mini PC You Can Buy In 2015
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Linux_Based_Mini_PC.jpg)
|
||||
|
||||
Mini PCs, in my opinion, will takeover the traditional desktop computers in near future. Traditional desktop has a bulky CPU which takes a lot of space with its fan running like a blower. The mini PCs, on the other hand, are tiny and compact. With hardly 4″ or 5″ in size, they can be easily placed on a table.
|
||||
|
||||
Moreover, these mini PCs are fanless which is an added virtue. Of course, you can buy fanless regular desktops but the space consumption is still an issue. Personally, I find the mini PC cute in looks. If you are not a gamer and thinking of buying a new desktop PC, I’ll highly recommend you to **buy a Linux based mini PC**.
|
||||
|
||||
If you go by my recommendation and consider buying it, you might wonder what options do you have. Worry not. In this post we shall see four **Linux based Mini PC that you can buy in 2015**.
|
||||
|
||||
### Linux based mini PCs ###
|
||||
|
||||
Please do note that some of these gadgets might not be available to order just yet. Some of these have been just announced and will be released to public in near future.
|
||||
|
||||
#### 1. Meerkat by System76 ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/system76-meerkat.jpg)
|
||||
|
||||
[System76][1] is a computer manufacturer exclusively dealing with only Ubuntu based desktop, laptops and servers. [System76 announced an Ubuntu based mini PC Meerkat][2] last week. Let’s take a quick look at its specification:
|
||||
|
||||
**Specification**
|
||||
|
||||
- Intel 5th Generation processors, available options i3-5010U and i5-5250U
|
||||
- up to 2 TB of storage (M.2 SATA SSD)
|
||||
- 16 GB DDR3 RAM
|
||||
- Graphics Intel HD 5500 and Intel HD 6000 for i3 and i5 respectively
|
||||
- 4″ x 4″ in size
|
||||
- WiFi
|
||||
- 1 Gb NIC
|
||||
- 2 USB 3.0 ports
|
||||
|
||||
**Price**
|
||||
|
||||
In the range of $500 (yet to be confirmed).
|
||||
|
||||
**Availability**
|
||||
|
||||
US release by the end of March 2015.
|
||||
|
||||
#### 2. Mintbox Mini by Compulab ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/mintbox-mini.jpeg)
|
||||
|
||||
[Compulab][3] shrunk its flagship Linux Mint based PC devices, Mintbox into [Mintbox Mini][4]. The compact version is around 4″ in size. More details are as following:
|
||||
|
||||
**Specifications**
|
||||
|
||||
- AMD A4-6400T processor
|
||||
- Radeon R3 graphics processor
|
||||
- 4 GB RAM
|
||||
- 64 GB SSD
|
||||
- 2 USB 3.0 ports, 3 USB 2.0 ports
|
||||
- 2 HDMI out ports
|
||||
- 802.11 b/g/n Wifi
|
||||
- Gigabit Ethernet
|
||||
- MicroSD reader
|
||||
|
||||
**Price**
|
||||
|
||||
Staring around $300
|
||||
|
||||
**Availability**
|
||||
|
||||
Second quarter of 2015
|
||||
|
||||
#### 3. Utilite2 by Compulab ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Utilite2-ARM-PC.jpg)
|
||||
|
||||
It’s not that Compulab has stuck with Linux Mint only. It announced an ARM desktop PC running Ubuntu in last December. With a size of 3.4″x2.3″, [Utilite2][5] has modest feature and modest price.
|
||||
|
||||
**Specifications**
|
||||
|
||||
- Qualcomm Snapdragon 600 (APQ8064) quad-core CPU 1.7GHz
|
||||
- 2GB RAM, eMMC with optional 32 GB mSATA storage
|
||||
- Graphics with Qualcomm Adreno™ GPU
|
||||
- 1080p video playback and capture
|
||||
- Dual-antenna WiFi 802.11 and Bluetooth 4.0
|
||||
- Gigabit Ethernet, 4x USB2, USB OTG
|
||||
- Cellular modem support
|
||||
|
||||
**Price**
|
||||
|
||||
$192 for regular model, $229 with SSD storage. Shipping charges extra.
|
||||
|
||||
**Availability**
|
||||
|
||||
Available to purchase now. It will take four weeks in shipping.
|
||||
|
||||
#### Penguin Pocket Wee by Think Penguin ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Think_Penguin_Pocket_Wee.jpeg)
|
||||
|
||||
[Think Penguin][6] is a Open Source focused hardware manufacturer. In the mini PC category, it has [Penguin Pocket Wee][7] to offer. With 4.6″x 4.4″x 1.4″ in size, Penguin Pocket Wee provides a number of configuration to you. You can choose between the processors, storage, network adapters and what not. You can choose to buy it pre-installed with your favorite Linux distribution, default OS is Ubuntu.
|
||||
|
||||
The general configuration is as following:
|
||||
|
||||
- Intel Core i3 or i5 processor with support for up to 1080p HD video
|
||||
- Expandable up to 16GB of DDR3 RAM
|
||||
- Intel HD graphics
|
||||
- Wireless N
|
||||
- Up to 250GB of SSD
|
||||
- 4 USB 3.0
|
||||
- Intel 10/100/1000 Gigabit Ethernet Controller
|
||||
|
||||
**Price**
|
||||
|
||||
Basic model starts at $499 and it can go up to $1000 based on the configuration you select.
|
||||
|
||||
**Availability**
|
||||
|
||||
Available to order now. There are offices in UK and USA so it should be shipping to North America and Europe.
|
||||
|
||||
### What’s your pick? ###
|
||||
|
||||
I have deliberately not included [Raspberry Pi 2][8] or other Linux microcomputer such as [Intel’s Compute Stick][9]. The reason is that I do not think that micro-computers fall in the same categories as mini PCs.
|
||||
|
||||
What do you think? Are you tempted to replace your desktop with a mini PC? Is there another player which I missed in this list of **best Linux based mini PCs**? Do share your views.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/4-linux-based-mini-pc-buy-2015/
|
||||
|
||||
作者:[Abhishek][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/abhishek/
|
||||
[1]:https://system76.com/
|
||||
[2]:http://itsfoss.com/system76-unveils-ubuntu-based-mini-pc-meerkat/
|
||||
[3]:http://www.compulab.co.il/
|
||||
[4]:http://itsfoss.com/mintbox-mini-compact-linux-mint-powered-pc-unveiled/
|
||||
[5]:http://www.compulab.co.il/utilite-computer/web/utilite2-overview
|
||||
[6]:https://www.thinkpenguin.com/
|
||||
[7]:https://www.thinkpenguin.com/gnu-linux/penguin-pocket-wee-gnu-linux-desktop
|
||||
[8]:http://itsfoss.com/raspberry-pi-2-specs/
|
||||
[9]:http://itsfoss.com/intels-compute-stick/
|
@ -1,8 +1,12 @@
|
||||
theol-l translating
|
||||
|
||||
The Curious Case of the Disappearing Distros
|
||||
关于消失的发行版的古怪情形。
|
||||
================================================================================
|
||||
![](http://www.linuxinsider.com/ai/828896/linux-distros.jpg)
|
||||
|
||||
"Linux is a big game now, with billions of dollars of profit, and it's the best thing since sliced bread, but corporations are taking control, and slowly but systematically, community distros are being killed," said Google+ blogger Alessandro Ebersol. "Linux is slowly becoming just like BSD, where companies use and abuse it and give very little in return."
|
||||
"Linux现在成为了一个大型的游戏,同时具有巨额的利润,这是有史以来最好的事情。但是公司企业进行了控制,于是缓慢而系统的社区发行版就逐渐被干掉了,",Google+的一个博主 Alessandro Ebersol说到。"Linux开始变得像BSD--一些公司使用和滥用但是没有任何回报--一样缓慢。"
|
||||
|
||||
Well the holidays are pretty much upon us at last here in the Linux blogosphere, and there's nowhere left to hide. The next two weeks or so promise little more than a blur of forced social occasions and too-large meals, punctuated only -- for the luckier ones among us -- by occasional respite down at the Broken Windows Lounge.
|
||||
|
||||
@ -117,4 +121,4 @@ via: http://www.linuxinsider.com/story/The-Curious-Case-of-the-Disappearing-Dist
|
||||
[5]:http://ledgersmbdev.blogspot.com/
|
||||
[6]:http://www.ledgersmb.org/
|
||||
[7]:http://www.novell.com/linux
|
||||
[8]:http://www.redhat.com/
|
||||
[8]:http://www.redhat.com/
|
||||
|
@ -1,44 +0,0 @@
|
||||
translating by KayGuoWhu
|
||||
Why does C++ promote an int to a float when a float cannot represent all int values?
|
||||
---------
|
||||
|
||||
#Q:
|
||||
|
||||
Say I have the following:
|
||||
|
||||
```C
|
||||
int i = 23;
|
||||
float f = 3.14;
|
||||
if (i == f) // do something
|
||||
```
|
||||
|
||||
The i will be promoted to a float and the two float numbers will be compared, but can a float represent all int values? Why not promote both the int and the float to a double?
|
||||
|
||||
#A:
|
||||
|
||||
When `int` is promoted to `unsigned` in the integral promotions, negative values are also lost (which leads to such fun as `0u < -1` being true).
|
||||
|
||||
Like most mechanisms in C (that are inherited in C++), the usual arithmetic conversions should be understood in terms of hardware operations. The makers of C were very familiar with the assembly language of the machines with which they worked, and they wrote C to make immediate sense to themselves and people like themselves when writing things that would until then have been written in assembly (such as the UNIX kernel).
|
||||
|
||||
Now, processors, as a rule, do not have mixed-type instructions (add float to double, compare int to float, etc.) because it would be a huge waste of real estate on the wafer -- you'd have to implement as many times more opcodes as you want to support different types. That you only have instructions for "add int to int," "compare float to float", "multiply unsigned with unsigned" etc. makes the usual arithmetic conversions necessary in the first place -- they are a mapping of two types to the instruction family that makes most sense to use with them.
|
||||
|
||||
From the point of view of someone who's used to writing low-level machine code, if you have mixed types, the assembler instructions you're most likely to consider in the general case are those that require the least conversions. This is particularly the case with floating points, where conversions are runtime-expensive, and particularly back in the early 1970s, when C was developed, computers were slow, and when floating point calculations were done in software. This shows in the usual arithmetic conversions -- only one operand is ever converted (with the single exception of `long/unsigned int`, where the `long` may be converted to `unsigned long`, which does not require anything to be done on most machines. Perhaps not on any where the exception applies).
|
||||
|
||||
So, the usual arithmetic conversions are written to do what an assembly coder would do most of the time: you have two types that don't fit, convert one to the other so that it does. This is what you'd do in assembler code unless you had a specific reason to do otherwise, and to people who are used to writing assembler code and do have a specific reason to force a different conversion, explicitly requesting that conversion is natural. After all, you can simply write
|
||||
|
||||
```C
|
||||
if((double) i < (double) f)
|
||||
```
|
||||
|
||||
It is interesting to note in this context, by the way, that `unsigned` is higher in the hierarchy than `int`, so that comparing `int` with `unsigned` will end in an unsigned comparison (hence the `0u < -1` bit from the beginning). I suspect this to be an indicator that people in olden times considered `unsigned` less as a restriction on `int` than as an extension of its value range: We don't need the sign right now, so let's use the extra bit for a larger value range. You'd use it if you had reason to expect that an `int` would overflow -- a much bigger worry in a world of 16-bit ints.
|
||||
|
||||
----
|
||||
via:[stackoverflow](http://stackoverflow.com/questions/28010565/why-does-c-promote-an-int-to-a-float-when-a-float-cannot-represent-all-int-val/28011249#28011249)
|
||||
|
||||
作者:[wintermute][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://stackoverflow.com/users/4301306/wintermute
|
@ -1,82 +0,0 @@
|
||||
9 Best IDEs and Code Editors for JavaScript Users
|
||||
================================================================================
|
||||
Web designing and developing is one of the trending sectors in the recent times, where more and more peoples started to search for their career opportunities. But, Getting the right opportunity as a web developer or graphic designer is not just a piece of cake for everyone, It certainly requires a strong mind presence as well as right skills to find the find the right job. There are a lot of websites available today which can help you to get the right job description according to your knowledge. But still if you want to achieve something in this sector you must have some excellent skills like working with different platforms, IDEs and various other tools too.
|
||||
|
||||
Talking about the different platforms and IDEs used for various languages for different purposes, gone is the time when we learn just one IDE and get the optimum solutions for our web design projects easily. Today we are living in the modern lifestyle where competition is getting more and more tough on every single day. Same is the case with the IDEs, IDE is basically a powerful client application for creating and deploying applications. Today we are going to share some best javascript IDE for web designers and developers.
|
||||
|
||||
Please visit this list of best code editors for javascript user and share your thought with us.
|
||||
|
||||
### 1) [Spket][1] ###
|
||||
|
||||
**Spket IDE** is powerful toolkit for JavaScript and XML development. The powerful editor for JavaScript, XUL/XBL and Yahoo! Widget development. The JavaScript editor provides features like code completion, syntax highlighting and content outline that helps developers productively create efficient JavaScript code.
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/spket-e1422674329554.png)
|
||||
|
||||
### 2) [Ixedit][2] ###
|
||||
|
||||
IxEdit is a JavaScript-based interaction design tool for the web. With IxEdit, designers can practice DOM-scripting without coding to change, add, move, or transform elements dynamically on your web pages.
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ixedit.png)
|
||||
|
||||
### 3) [Komodo Edit][3] ###
|
||||
|
||||
Komode is free and powerful code editor for Javascript and other programming languages.
|
||||
|
||||
![](http://i2.wp.com/devzum.com/wp-content/uploads/2015/01/komodo-edit-e1422674596277.png)
|
||||
|
||||
### 4) [EpicEditor][4] ###
|
||||
|
||||
EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it.
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/epiceditor-e1422674732281.png)
|
||||
|
||||
### 5) [codepress][5] ###
|
||||
|
||||
CodePress is web-based source code editor with syntax highlighting written in JavaScript that colors text in real time while it’s being typed in the browser.
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/codepres-e1422674893706.png)
|
||||
|
||||
### 6) [ACe][6] ###
|
||||
|
||||
Ace is an embeddable code editor written in JavaScript. It matches the features and performance of native editors such as Sublime, Vim and TextMate. It can be easily embedded in any web page and JavaScript application.
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ace-e1422675089912.png)
|
||||
|
||||
### 7) [scripted][7] ###
|
||||
|
||||
Scripted is a fast and lightweight code editor with an initial focus on JavaScript editing. Scripted is a browser based editor and the editor itself is served from a locally running Node.js server instance.
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/scripted-e1422675188408.png)
|
||||
|
||||
### 8) [Netbeans][8] ###
|
||||
|
||||
This is another more impressive and useful code editors for javascript and other programming languages.
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/code_editing1-e1422675506226.png)
|
||||
|
||||
### 9) [Webstorm][9] ###
|
||||
|
||||
This is the smartest ID for javascript. WebStorm is a lightweight yet powerful IDE, perfectly equipped for complex client-side development and server-side development with Node.js.
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/webstorm.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://devzum.com/2015/01/31/9-best-ides-and-code-editors-for-javascript-users/
|
||||
|
||||
作者:[vikas][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://devzum.com/author/vikas/
|
||||
[1]:http://spket.com/
|
||||
[2]:http://www.ixedit.com/
|
||||
[3]:http://komodoide.com/komodo-edit/
|
||||
[4]:http://oscargodson.github.io/EpicEditor/
|
||||
[5]:http://codepress.sourceforge.net/
|
||||
[6]:http://ace.c9.io/#nav=about
|
||||
[7]:https://github.com/scripted-editor/scripted
|
||||
[8]:https://netbeans.org/
|
||||
[9]:http://www.jetbrains.com/webstorm/
|
@ -0,0 +1,85 @@
|
||||
10 best uses for open source software in the business world
|
||||
================================================================================
|
||||
> Open source offers some compelling benefits for businesses large and small -- but you might be surprised at some of the ways it's being used.
|
||||
|
||||
![](http://tr2.cbsistatic.com/hub/i/r/2015/03/05/54a9c323-4311-4455-b10b-5182548da424/resize/620x485/95164f01a19cbd7a3e4b843be78febae/foss.jpg)
|
||||
|
||||
Certain inevitabilities occur in technology. For instance, open source software will make its way into your business. Ten years ago, this could easily have been called into question. Now? There's no way to avoid it -- and there's no reason to. With so many powerful (and necessary) pieces of technology, open source has become, in various cases, the savior of tech. But what areas of your business are best suited for open source? The answer to that question is, of course, will be different from one company to the next. But some applications can apply in almost every circumstance.
|
||||
|
||||
Let's take a look at 10 possible best-case uses for open source software that can help make your business grow, bring you a level of flexibility and reliability you haven't experienced, or just save you a welcome percentage of your budget.
|
||||
|
||||
### 1: Server software ###
|
||||
|
||||
If you're still battling Microsoft's IIS platform, you need to experience Apache. The flagship open source web server software is one of the most widely used on the planet. It's free, incredibly reliable, easy to manage, and doesn't require the enormous overhead needed for IIS. But open source isn't limited to just web servers. If you need SMB sharing across your company, consider Samba. Samba 4 even integrates with Active Directory, so you don't have to worry about setting up separate user accounts on the Samba server.
|
||||
|
||||
### 2: Development ###
|
||||
|
||||
Developing with open source is a no-brainer. PHP, Rails, Perl -- there are as many languages to develop with as there are tools (from IDEs to bug tracking). There are a lot of options for developing for open source or with open source tools (as are there with proprietary development). The biggest difference between open source and proprietary is the access you have to the software code. Within the world of FOSS (free open source software) the code is readily available. For many developers, the Linux operating system has everything they need to develop, built right in (especially those who code without a full-blown IDE). If you do require GUI development tools, open source has you covered.
|
||||
|
||||
### 3: Security ###
|
||||
|
||||
The route to security is a challenging one, but there are many paths to success. You can opt for the "security in a box" solution and go with the likes of Cisco (a solid solution) or you can craft your security to perfectly fit your needs with the likes of iptables. Yes, the open source security route will take a bit more time to deploy (with a much higher learning curve), but the end results are generally incredible. This doesn't even address the idea that using open source on the desktop is, generally speaking, a more secure platform than most proprietary systems. Deploy Linux on the desktops and your security woes will drop dramatically.
|
||||
|
||||
### 4: Desktops ###
|
||||
|
||||
This area is where most of the pushback happens. However, you must take into consideration the fact that the daily workflow has undergone a major paradigm shift. Most of what we do now is done via a web browser. So why not deploy Linux on the desktop? Not only does it work with the majority of today's tasks, it will do so without suffering from viruses, malware, and updates that cripple a system. It's not perfect -- what platform is? But it's solid, and in the end, it can save you money. That's a win-win.
|
||||
|
||||
### 5: Workflow ###
|
||||
|
||||
Every business depends upon workflow. For some businesses, a smooth workflow depends upon tools. Open source has this arena covered. CRM, HRM, ERP, BI, BPM... you name it, open source handles just about every possible acronym you can think of -- and it does it very well. With the likes of [Pentaho][1], [Collabtive][2], and [SugarCRM][3], open source can keep up with closed source tools any day.
|
||||
|
||||
### 6: Collaboration ###
|
||||
|
||||
Without the ability to work together on projects, your staff wouldn't be able to get the job done. So the collaboration tools you choose are crucial. You'll find plenty of quality collaboration tools within the world of open source. [Cyn.in community edition][4], [Zimbra Open Source Edition][5], and [Kolab][6] are just three examples of the excellent collaboration tools that exist within the open source world.
|
||||
|
||||
### 7: Big data ###
|
||||
|
||||
When it comes to big data, open source can't be matched. Thanks to the likes of [SUSE][7], big data and open source now go hand in hand. Innovations like in-memory data and live kernel patching make open source an ideal solution for big data. It can be perfectly tuned to meet the massive demands big data places on the platform. Closed source software can't touch this level of flexibility.
|
||||
|
||||
### 8: Cloud ###
|
||||
|
||||
The major players in the cloud are open source. [Red Hat][8], [Ubuntu][9], [SUSE][10], [Amazon][11], [Rackspace][12] -- they all get it and know that open source is the best solution for cloud deployments. But if you don't want to go with the larger companies, there are always up and coming tools like [ownCloud][12], where you can either take advantage of its hosted cloud solutions or build your own.
|
||||
|
||||
### 9: Multimedia ###
|
||||
|
||||
If your company does podcasting or video for PR, open source has you covered. With tools like [Audacity][14] and [OpenShot][15], you can do just about anything with audio or video you need -- and do so on the cheap. In fact, you'll be hard-pressed to find a better podcasting tool than Audacity or an easier-to-use video editor than OpenShot. Both pieces of software do an outstanding job of creating professional-quality results without the steep learning curves or the high prices often associated with closed source tools
|
||||
|
||||
### 10: E-commerce ###
|
||||
|
||||
If your business sells products online, you'd be remiss not to give a tool like [PrestaShop][16] a try. PrestaShop is, hands down, one of the most powerful e-commerce solutions available -- regardless of license. With just about every feature you could possible want (and some you probably haven't even thought of), the open source platform excels at e-commerce on every level.
|
||||
|
||||
### FOSS for business ###
|
||||
|
||||
Open source is no longer hanging around the periphery of the business conversation. In many instances, FOSS leads and dominates that conversation. If you've been looking for areas to consider deploying open source solutions, look no further than these 10.
|
||||
|
||||
### Your turn ###
|
||||
|
||||
Have you added open source software to your business? If so, in what way?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.techrepublic.com/blog/10-things/10-best-uses-for-open-source-software-in-the-business-world/
|
||||
|
||||
作者:[Jack Wallen][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.techrepublic.com/search/?a=jack+wallen
|
||||
[1]:http://community.pentaho.com/
|
||||
[2]:http://collabtive.o-dyn.de/
|
||||
[3]:http://www.sugarcrm.com/
|
||||
[4]:http://cynapse.com/cyn-in/
|
||||
[5]:https://www.zimbra.com/open-source
|
||||
[6]:http://kolab.org/
|
||||
[7]:http://www.suse.org/
|
||||
[8]:http://www.redhat.com/
|
||||
[9]:http://www.ubuntu.com/
|
||||
[10]:http://www.suse.com/
|
||||
[11]:http://aws.amazon.com/ec2/
|
||||
[12]:http://www.rackspace.com/cloud
|
||||
[13]:https://owncloud.org/
|
||||
[14]:http://audacity.sourceforge.net/
|
||||
[15]:http://www.openshot.org/
|
||||
[16]:https://www.prestashop.com/
|
@ -0,0 +1,98 @@
|
||||
Comparative Introduction To FreeBSD For Linux Users
|
||||
================================================================================
|
||||
![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg)
|
||||
|
||||
### Introduction ###
|
||||
|
||||
BSD was originally derived from UNIX and currently, there are various number of Unix-like operating systems descended from the BSD. While, FreeBSD is the most widely used open source Berkeley Software Distribution (BSD distribution). As it is implicitly said it is a free and open source Unix-like-operating system and a public server platform. FreeBSD source code is generally released under a permissive BSD license. It is true that it has similarities with Linux but we cannot deny that they differs in other points.
|
||||
|
||||
The remainder of this article is organized as follows: the description of FreeBSD will be treated in our first section. The similarities between FreeBSD and Linux will be briefly described in the second section. While their differences will be discussed in the third section. And a comparison of their features will be summarized in our last section.
|
||||
|
||||
### FreeBSD description ###
|
||||
|
||||
#### History ####
|
||||
|
||||
- The first version of FreeBSD was released in 1993, while its first CD-ROM distributed was FreeBSD1.0 on December 1993. Then, FreeBSD 2.1.0 was released in 1995 which gained the satisfaction of all users. Actually, many IT companies use FreeBSD and are satisfied where we can list those companies: IBM, Nokia, NetApp and Juniper Networks.
|
||||
|
||||
#### License ####
|
||||
|
||||
- Concerning its license, FreeBSD is released under various source licenses. Its newest code called Kernel is released under the two-clause BSD license, offering the possibility to use and redistribute FreeBSD with absolute freedom. Other codes are released three- and four-clause BSD license and some others are released under GPL and CDDL.
|
||||
|
||||
#### Users ####
|
||||
|
||||
- One of the important feature of FreeBSD, we can mention the various categories of its users. In fact, it is possible to use FreeBSD as a mail server, web server, FTP server and as a router due to the significant set of server-related software accompanied with it. Furthermore, ARM, PowerPC and MIPS are supported by FreeBSD so it is possible to use x86 and s86-64.
|
||||
|
||||
### FreeBSD and Linux similarities ###
|
||||
|
||||
FreeBSD and Linux are two free and open source systems. Indeed, their users can easily check and modify the source code with an absolute freedom. To add, FreeBSD and Linux, both of them are derived from Unix.-like because they have a kernel, internals, and libraries programmed using algorithms derived from historic AT&T Unix. While FreeBSD’s roots are similar to Unix systems, Linux is released as a free Unix-like option. Various tools and applications can be found either in FreeBSD or in Linux in fact, they almost share the same functionality.
|
||||
|
||||
Furthermore, FreeBSD can run big number of Linux applications. It has a Linux compatibility layer that can be installed. This Linux compatibility layer can be installed while compiling FreeBSD with AAC Compact Linux or downloading compiled FreeBSD systems with a Linux compatibility program such as: aac_linux.ko. Which is not the same case with Linux, Linux cannot run FreeBSD software.
|
||||
|
||||
At the end, we can mention that both of them have the same goal but have also some differences which we will outline in the next section.
|
||||
|
||||
### FreeBSD and Linux differences ###
|
||||
|
||||
Currently, no criteria of choice between FreeBSD and Linux is clear for most users. Since, they share almost the same applications. Those two operating systems are as mentioned previously UNIX-like.
|
||||
|
||||
In this section, we will list the most important differences of those two systems.
|
||||
|
||||
#### License ####
|
||||
|
||||
- The first difference point between those two compared systems consist on their license. To start by Linux license, it is released under the GPL license which offers the possibility to view, distribute and change the source code with an absolute freedom. The GPL license helps users to prevent the distribution of binary-only source. Which is the case with FreeBSD, which is licensed under BSD license. This kind of license is more restrictive and easily allows the distribution of binary-only source. The BSD license is more permissive that the GPL since no derivative work is required to maintain the licensing terms. Means any user can use, distribute and modify the code without need to have the previous version of code before changing made. They only need to have the original license of BSD.
|
||||
- Depending on the needs of each user, a selection can be made between those two types of license. Starting by BSD license which is more preferred by many users due to its special features. In fact, this license gives the possibility to sell each software licensed under it and retain the source code. Passing now to the GPL license, which requires some care of each user has a software released under it.
|
||||
- To be able to choose between those two software, it is required to understand the licensing of both of them to more understand the methodology used in their development, to distinguish between their features and know which one will fit user’s need.
|
||||
|
||||
#### Control ####
|
||||
|
||||
- Since FreeBSD and Linux are released under two different type of license, the Linux Torvalds control the Linux kernel which is not the same case with FreeBSD which is not controlled. Personally, I prefer to use FreeBSD instead of Linux since it is an absolute free software, no control permission exists. But it is not enough there is other differences between Linux and FreeBSD, help you to choose between both of them. As an advice don’t choose one of them, follow us and then give us your choice.
|
||||
|
||||
#### Operating system ####
|
||||
|
||||
- Linux concentrates only on the kernel system which is not the case with FreeBSD while the whole operating system is maintained. The kernel and a set of software, some of them are developed by the FreeBSD team, are maintained as one unit. Indeed, the FreeBSD developers have the possibility to manage the essential operating systems remotely and efficiently.
|
||||
- With Linux, there is some difficulties while managing a system. Since, the different components maintained will be from different sources so the Linux developers need to assemble them into groups having the same functionality.
|
||||
- FreeBSD and Linux both of them give the possibility to have a big set of optional software and distributions but they differ on the way they are managed. With FreeBSD, they are managed together while with Linux they will be maintained separately.
|
||||
|
||||
#### Hardware support ####
|
||||
|
||||
- Concerning the hardware support, Linux is better than FreeBSD. It doesn’t mean that FreeBSD hasn’t the capability to support hardware as Linux. They differ just on the manner. It depends on your need as usual. So if you are searching for the newest solution, the FreeBSD will fit your needs but if you are looking for greatest graphs, it is better to use Linux.
|
||||
|
||||
#### FreeBSD origin Vs Linux origin ####
|
||||
|
||||
- The origin of each system is also another point of distinction between both of them. As I said previously Linux is an alternative of the operating system Unix, written by Linus Trovalds and assisted by a special group of hackers across the Net. Linux has all the needed features in a modern Unix, such as virtual memory, shared libraries, demand loading, proper memory management and many others. It is released under the General Public License.
|
||||
- FreeBSD also shared many important features of its Unix heritage. FreeBSD as a type of the Berkeley Software Distribution, the distribution of the Unix developed at the University of California. The most important reason under developing BSD is to replace the AT&T operating system by an open source alternative giving the user the ability to use BSD without carry about the obtaining of the AT&T license.
|
||||
- The problem of licensing, is the most important worry of developers. They try to offer the maximum open source clone of Unix. Which influences the choice of users regarding the degree of open source of each system as FreeBSD gives more freedom than Linux regarding its use since it is released under BSD license.
|
||||
|
||||
#### Supported Package ####
|
||||
|
||||
- From the user’s perspective, another difference between our two compared systems, is their availability and support of the packaged software and source installed software. The Linux distributions provide just the pre-compiled binary packages which is not the same case with FreeBSD, which has the pre-built packages and the build system for the compilation and installation through their available open source. Due to its ports, FreeBSD gives you the possibility to choose between the default making of pre-compiled packages and your ability to customize your software while it is compiled.
|
||||
- Those ports enable you to build all the software available with FreeBSD. Furthermore, there is an hierarchy of organization all of them due to the directories /usr/ports where you can find the location of the source files and some documentation about the way to use FreeBSD correctly.
|
||||
- The ports as mentioned give the possibility produce the packages version of software. Instead of having just the pre-compiled packages using Linux, FreeBSD gives you the possibility to have the source-built and the pre-packages software. You can manage your system using the two installation methods.
|
||||
|
||||
#### FreeBSD Vs Linux common Tools ####
|
||||
|
||||
- A huge number of common tools are available while using FreeBSD and are fully own made by the FreeBSD team. In contrast, the Linux tools are from the GNU that is why there is some control during their usage.
|
||||
- The fact that FreeBSD is released under BSD license is so beneficial and useful. Since, you have the ability to maintain the core operating system, control the development of these applications. Same of those tools are similar to BSD and Unix tools from where they were derived which is not the same case with GNU suite, which want to just make them less backwards compatible.
|
||||
|
||||
#### The Standard Shell ####
|
||||
|
||||
- The tcsh shell is used by default with FreeBSD. Which is an evaluated version fo csh. Since, the FreeBSD is released under the BSD license, it is not recommended to use the bash shell which is a GNU component. The only difference between bash and tcsh shell consists on the scripting feature which can’t be made by tcsh. Indeed, the sh shell is more recommended for the FreeBSD use since it is more reliable and prevents some issues of scripting can be occurred using the tcsh or csh shell.
|
||||
|
||||
#### A More Stratified Filesystem ####
|
||||
|
||||
- As it was mentioned previously, base operating system and optional components can be easily distinguished using the FreeBSD system. Which causes some specification of their organization. In Linux, /bin, /sbin, /usr/bin, or usr/sbin are the directories for executable systems. With FreeBSD it is not the case. There are some additional specifications concerning their organization. The base system are putted in one of the directories mentioned above while the ports and packages are placed in /usr/local/bin or /usr/local/sbin. This methodology helps to recognize and distinguish between an application considered as a base system or a port.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
FreeBSD and Linux those two free and open source systems, share various similarities but they also differ in several points. The list giving above isn’t given to say that one of them is better than the other. In fact, FreeBSD and Linux, each one of them has its features and specifications that make it a special regarding the other. And you what is your opinion? Have you already used one on them or both? If yes what is your feedback and if no after reading our description what do you think? Sound off and give us and the fellow readers your opinion.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/anis/
|
81
sources/talk/20150310 FAQ--BSD.md
Normal file
81
sources/talk/20150310 FAQ--BSD.md
Normal file
@ -0,0 +1,81 @@
|
||||
FAQ: BSD
|
||||
================================================================================
|
||||
![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png)
|
||||
|
||||
### Had history been slightly different, you’d be reading FreeBSD Voice today… ###
|
||||
|
||||
#### So what’s the deal with this Birsa Seva Dal then? Isn’t it a political group in India? ####
|
||||
|
||||
Very funny – you looked up the “BSD” disambiguation page on Wikipedia just to make that joke, didn’t you? Here we’re talking about the Berkeley Software Distribution, a family of operating systems that are much more widely used than you might think.
|
||||
|
||||
#### Sorry, I couldn’t help myself. OK, so what’s the deal with these OSes? ####
|
||||
|
||||
There are three main BSD operating systems in use today. They are based on Unix, they are open source, they tend to be used in server roles, but can also make good desktops and workstations as well. They run KDE, Firefox, LibreOffice, Apache, MySQL and pretty much any open source application you can name. They’re reliable, secure and support a lot of different hardware.
|
||||
|
||||
#### Congratulations – you’ve just described GNU/Linux… ####
|
||||
|
||||
True. Linux has all of the things I’ve just mentioned, and that’s why a lot of people never investigate BSD. In day-to-day usage, there isn’t a lot of difference between the BSD family and Linux, largely because they all have Unix underpinnings, and also because they share a lot of software. You could be logged into a remote machine, hacking some Python code in Vim, and checking your email in Mutt, and you wouldn’t know you were running BSD. Or you could be using an internet terminal in a cafe somewhere and not know it’s BSD.
|
||||
|
||||
The biggest differences are in the development model and licence, and to understand this, we need to step back in time. The B in BSD refers to the University of California, Berkeley, which was a hotbed of open source Unix development back in the 1980s. As the 90s came, x86-based PCs were becoming popular and many people were interested in having a Unix-like OS on their home computers. A project called 386BSD was released in 1992 to provide just that.
|
||||
|
||||
#### And where were all the Linux distributions at this time? ####
|
||||
|
||||
Good question! You might know that one year before, Linus Torvalds had announced his kernel, which, when paired with the GNU project, formed a complete open source operating system. Linus had been following GNU’s own kernel (Hurd) and 386BSD, and said that had either of them been ready for daily use, he probably wouldn’t have created Linux. So the first few years of the 90s were tremendously lively for open source operating systems, and nobody was really sure which ones would succeed.
|
||||
|
||||
Then it got messy for BSD. AT&T, the original developer of Unix, was trying to monetise its work on the operating system and claimed that BSD infringed its intellectual property rights. This culminated in a lawsuit in 1992 which severely held back BSD development. In the end, various chunks of the BSD source code had to be rewritten – while all this time, GNU/Linux was gaining features, stability and popularity.
|
||||
|
||||
BSD was arguably in a more mature state than GNU/Linux in the early 1990s, and without these legal complications it could have become the standard on x86 PCs. We could all be using it today instead of Linux.
|
||||
|
||||
#### But you said earlier that BSD is still widely used, so things improved after that? ####
|
||||
|
||||
Yes. 386BSD development stagnated, but two teams of developers working over the internet created separate successor projects. FreeBSD became the most widely used flavour of BSD, and is now the closest to Linux as a desktop and server operating system, while NetBSD focused on portability (today it runs on over 50 platforms, all built from the same codebase). The third flavour, OpenBSD, forked off from NetBSD just a few years after NetBSD started due to a developer spat, and today it’s well known for its concentration on security. Over the years, OpenBSD has created many programs that have become standard on Linux, such as OpenSSH – and now we have LibreSSL too.
|
||||
|
||||
#### So these three flavours of BSD are like Linux distributions? ####
|
||||
|
||||
Yes and no. Each BSD has a separate codebase and separate development teams, although there is a lot of code-flow between them (especially for hardware drivers). But they are standalone operating systems with their own features, pros and cons.
|
||||
|
||||
We mentioned that the development model of the BSDs is one feature that really distinguishes them from GNU/Linux. There’s nobody in charge of GNU/Linux as a whole: some teams are working on the GNU components, some are working on the kernel, some on boot scripts, some on manual pages, some on libraries, and so forth. The development model is often called “wild west”, with a lack of central authority, and distributions do all the hard work of fitting everything together.
|
||||
|
||||
The BSDs, in contrast, are developed as complete projects from centralised source code trees. The kernel, the libraries, the system utilities and the manual pages are all stored and worked on in the same place. Many BSD fans argue that this gives the operating systems more coherency and stability, and from our years of dabbling with BSD we can attest that the manual pages are largely superb.
|
||||
|
||||
![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png)
|
||||
|
||||
#### Don’t the BSDs use anything from GNU/Linux? ####
|
||||
|
||||
Yes, especially GCC. The GNU Compiler Collection has been the de-facto standard compiler on free Unix systems for decades, although FreeBSD has recently moved to LLVM/Clang. It’s important to note that the BSDs also use other open source projects that aren’t specifically GNU or Linux, such as the X Window System (XFree86 and X.org), Perl and so forth. And thanks to standards such as POSIX, most programs that run on Linux can be recompiled to run on the various BSD flavours.
|
||||
|
||||
So, you could replace the L in a LAMP (Linux, Apache, MySQL and PHP) stack with FreeBSD, and get pretty much the same environment, with a different set of features (eg variations in filesystem and driver support). And there are some mega, super, huge users of FreeBSD, such as Netflix, which serve up ridiculous amounts of data every day. While FreeBSD makes a good desktop OS, its strengths really lie in the server room, with exceptional reliability and network performance.
|
||||
|
||||
OpenBSD tends to be used in smaller web serving, file hosting, firewall and gateway roles where security is imperative. NetBSD is the least popular of the main BSD flavours – it can run on almost anything though, including old Amigas and Acorn boxes, and sometimes finds itself inside closed-source network devices.
|
||||
|
||||
#### Hang on – how can someone close the source code? That ain’t kosher in Linux! ####
|
||||
|
||||
Correct, and here we come to the other major difference with GNU/Linux. The licence for the BSD flavours (called, funnily enough, the BSD Licence) is very different to the GPL that we know. For starters, it’s much shorter. The BSD Licence essentially says: do what you want with this code, but give the original developers credit for writing it, and don’t try to sue them if it blows up your computer.
|
||||
|
||||
So there’s nothing in the licence that forces the code to stay open, unlike with the GPL, which requires that users of the code also make their modifications freely available. This crucial difference has sparked countless flame wars over the years, with BSD fans saying that their licence is more free (because it’s less restrictive), while GNU/GPL fans say that their licence is actually more free (because it preserves freedom down the road).
|
||||
|
||||
#### Blimey. Anyway, now that you’ve piqued my interest, where can I try out all these lovely BSD flavours? ####
|
||||
|
||||
You can probably guess the websites – [www.openbsd.org][1], [www.freebsd.org][2] and [www.netbsd.org][3] – where you can download ISO images, boot them in VirtualBox, and play around. If you’ve been using Linux for a while, you won’t find any of them too difficult, although you’re expected to know your way around the command line. If you’re looking for something more newbie-friendly, PC-BSD
|
||||
|
||||
([www.pcbsd.org][4]) is a customised version of FreeBSD focused on the desktop, with a fancy graphical installer and super-simple management of software. Have fun exploring!
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxvoice.com/faq-bsd-2/
|
||||
|
||||
作者:[Mike Saunders][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxvoice.com/author/mike/
|
||||
[1]:http://www.openbsd.org/
|
||||
[2]:http://www.freebsd.org/
|
||||
[3]:http://www.netbsd.org/
|
||||
[4]:http://www.pcbsd.org/
|
@ -1,7 +1,11 @@
|
||||
theo-l translating
|
||||
|
||||
How to protect SSH server from brute force attacks using fail2ban
|
||||
如何使用fail2ban来保护SSH服务器避免暴力破解攻击。
|
||||
================
|
||||
|
||||
One common attack on SSH service is brute force attacks where a remote attacker indefinitely attempts to log in with different passwords. Of course there are arguments against password authentication for SSH, and alternative authentication mechanisms such as [public key authentication][1] or [two-factor authentication][2] exist to obsolete such attacks. Putting aside pros and cons of different authentication methods, let's consider the situation where password authentication is required. How would you protect your SSH server against brute-force attacks?
|
||||
对于SSH服务的常见的攻击就是暴力破解攻击--远程攻击者通过不同的密码来进行无限地登录尝试。当然SSH存在参数来防备密码验证以及可用的验证机制,例如[公钥验证][1]或者[双重验证][2],
|
||||
|
||||
[fail2ban][3] is a well-known open-source intrusion prevention framework on Linux that monitors various system log files (e.g., /var/log/auth.log or /var/log/secure) and automatically triggers various defensive actions upon detecting any suspicious activities. In fact, fail2ban can be quite useful to defend against brute force password guessing attacks on an SSH server.
|
||||
|
||||
@ -167,4 +171,4 @@ via: http://linoxide.com/tools/linux-compress-decompress-tools/
|
||||
[1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html
|
||||
[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html
|
||||
[3]:http://www.fail2ban.org/
|
||||
[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
|
||||
[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
|
||||
|
@ -1,56 +0,0 @@
|
||||
Linux FAQs with Answers--How to use yum to download a RPM package without installing it
|
||||
================================================================================
|
||||
> **Question**: I want to download a RPM package from Red Hat's standard repositories. Can I use yum command to download a RPM package without installing it?
|
||||
|
||||
yum is the default package manager for Red Hat based systems, such as CentOS, Fedora or RHEL. Using yum, you can install or update a RPM package while resolving its package dependencies automatically. What if you want to download a RPM package without installing it on the system? For example, you may want to archive some RPM packages for later use or to install them on another machine.
|
||||
|
||||
Here is how to download a RPM package from yum repositories.
|
||||
|
||||
### Method One: Yum ###
|
||||
|
||||
The yum command itself can be used to download a RPM package. The standard yum command offers '--downloadonly' option for this purpose.
|
||||
|
||||
$ sudo yum install --downloadonly <package-name>
|
||||
|
||||
By default, a downloaded RPM package will be saved in:
|
||||
|
||||
/var/cache/yum/x86_64/[centos/fedora-version]/[repository]/packages
|
||||
|
||||
In the above, [repository] is the name of the repository (e.g., base, fedora, updates) from which the package is downloaded.
|
||||
|
||||
If you want to download a package to a specific directory (e.g., /tmp):
|
||||
|
||||
$ sudo yum install --downloadonly --downloaddir=/tmp <package-name>
|
||||
|
||||
Note that if a package to download has any unmet dependencies, yum will download all dependent packages as well. None of them will be installed.
|
||||
|
||||
One important thing is that on CentOS/RHEL 6 or earlier, you will need to install a separate yum plugin (called yum-plugin-downloadonly) to be able to use '--downloadonly' command option:
|
||||
|
||||
$ sudo yum install yum-plugin-downloadonly
|
||||
|
||||
Without this plugin, you will get the following error with yum:
|
||||
|
||||
Command line error: no such option: --downloadonly
|
||||
|
||||
![](https://farm9.staticflickr.com/8627/15571201803_38390aae75_c.jpg)
|
||||
|
||||
### Method Two: Yumdownloader ###
|
||||
|
||||
Another method to download a RPM package is via a dedicated package downloader tool called yumdownloader. This tool is part of yum-utils package which contains a suite of helper tools for yum package manager.
|
||||
|
||||
$ sudo yum install yum-utils
|
||||
|
||||
To download a RPM package:
|
||||
|
||||
$ sudo yumdownloader <package-name>
|
||||
|
||||
The downloaded package will be saved in the current directory. You need to use root privilege because yumdownloader will update package index files during downloading. Unlike yum command above, none of the dependent package(s) will be downloaded.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/yum-download-rpm-package.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -1,3 +1,5 @@
|
||||
FSSlc translating
|
||||
|
||||
How To Use Smartphones Like Weather Conky In Linux
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Use_Weather_Conky_Linux.jpeg)
|
||||
@ -81,4 +83,4 @@ via: http://itsfoss.com/weather-conky-linux/
|
||||
[2]:http://www.computerhope.com/unix/curl.htm
|
||||
[3]:http://speedracker.deviantart.com/art/Flair-Weather-Conky-Made-for-Conky-Manager-510130311
|
||||
[4]:http://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
|
||||
[5]:https://weather.yahoo.com/
|
||||
[5]:https://weather.yahoo.com/
|
||||
|
@ -1,446 +0,0 @@
|
||||
FSSlc translating
|
||||
|
||||
Bringing a Bunch of Best Known Linux Network Tools
|
||||
================================================================================
|
||||
It is very useful to use command line tools to monitor the network on your system and there are a tons of them out there available for the linux user such as nethogs, ntopng, nload, iftop, iptraf, bmon, slurm, tcptrack, cbm, netwatch, collectl, trafshow, cacti, etherape, ipband, jnettop, netspeed and speedometer.
|
||||
|
||||
Since there are many linux gurus and developers out there it is obvious that other network monitoring tools exist but I am not going to cover all of them in this tutorial.
|
||||
|
||||
Each one of the above tools has its own specifics but at the end all they do is monitor network traffic and there is not really only one way to do the job. For example nethogs can be used to show bandwidth per process in case you want to know the application which is consuming your entire network resources, iftop can be used to show bandwidth per socket connection and tools like nload help to get information about the overall bandwidth.
|
||||
|
||||
### 1) nethogs ###
|
||||
|
||||
nethogs is a free tool that is very handy when it comes to find out which PID is causing the trouble with your network traffic as it groups bandwidth by process instead of breaking the traffic down per protocol or per subnet, like most tools do. It is feature rich, supports both IPv4 and IPv6 and in my opinion is the best utility when you want to identify programs that are consuming all your bandwidth on your linux machine.
|
||||
|
||||
A linux user can use **nethogs** to show TCP download and upload-speed per process, monitor a specific device by using the command **nethogs eth0** where eth0 is the name of the device you want to get information from and also get information on the speed at which the data is currently being transferred.
|
||||
|
||||
To me nethogs is very easy to use, maybe because I like it so much that I use it all the time to monitor network bandwidth on my Ubuntu 12.04 LTS machine.
|
||||
|
||||
For example to sniff in promiscious the option -p is used like shown in the following command.
|
||||
|
||||
nethogs -p wlan0
|
||||
|
||||
If you like to learn more about nethogs and explore it in a very deep way than don't hesitate to read our full tutorial on this network bandwidth monitoring tool.
|
||||
|
||||
### 2) nload ###
|
||||
|
||||
nload is a console application which can be used to monitor network traffic and bandwidth usage in real time and it also visualizes the traffic by providing two easy to understand graphs. This cool network monitoring tool can also be used to switch between devices while monitoring and this can be done by pressing the left and right arrow keys.
|
||||
|
||||
![network monitoring tools in linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png)
|
||||
|
||||
As you can see from the above screenshot graphs provided by the nload tool are very easy to understand, provide useful information and also display additional info like total amount of transferred data and min/max network usage.
|
||||
|
||||
And what is even cooler is the fact that you can run the tool nload with the help of the following command which seems to be very short and easy to remember.
|
||||
|
||||
nload
|
||||
|
||||
I am very sure that our detailed tutorial on how to use nload will help new linux users and even experienced ones that are looking for more information on it.
|
||||
|
||||
### 3) slurm ###
|
||||
|
||||
slurm is another network load monitoring tool for linux which shows results in a nice ascii grap and it also supports many keys for interaction such as c to switch to classic mode, s to switch to split graph mode, **r** to redraw the screen, **L** to enable TX/RX led, **m** to switch between classic split and large view, and **q** to quit slurm.
|
||||
|
||||
![linux network load monitoring tools](http://blog.linoxide.com/wp-content/uploads/2013/12/slurm2.png)
|
||||
|
||||
There are also some other keys available in the network load monitoring tool slurm and you can easily study them in the manual page by using the following command.
|
||||
|
||||
man slurm
|
||||
|
||||
slurm is available in the official repos of Ubuntu and Debian so users of these distros can easy download it by using the apt-get install command like shown below.
|
||||
|
||||
sudo apt-get install slurm
|
||||
|
||||
We have covered slurm usage on a tutorial so please visit it and do not forget to share the knowledge with other linux friends.
|
||||
|
||||
### 4) iftop ###
|
||||
|
||||
iftop is a very useful tool when you want to display bandwidth usage on an interface by host. According to the manual page **iftop** listens to network traffic on a named interface, or on the first
|
||||
interface it can find which looks like an external interface if none is specified, and displays a table of current bandwidth usage by pairs of hosts.
|
||||
|
||||
Ubuntu and Debian users can easily install iftop on their machines by using the following command on a terminal.
|
||||
|
||||
sudo apt-get install iftop
|
||||
|
||||
Use the following command to install iftop on your machine using yum
|
||||
|
||||
yum -y install iftop
|
||||
|
||||
### 5) collectl ###
|
||||
|
||||
collectl can be used to collect data that describes the current system status and it supports the following modes:
|
||||
|
||||
- Record Mode
|
||||
- Playback Mode
|
||||
|
||||
**Record Mode** allows to take data from a live system and either display it on a terminal or writte to one or more files or a socket.
|
||||
|
||||
**Playback Mode**
|
||||
|
||||
According to the manual pages in this mode data is read from one or more data files that were generated in Record Mode.
|
||||
|
||||
Ubuntu and Debian users can use their default package manager to install collectl on their machines. The following command will do the job for them.
|
||||
|
||||
sudo apt-get install collectl
|
||||
|
||||
Use the following command because these distros have collectl in their official repos too.
|
||||
|
||||
yum install collectl
|
||||
|
||||
### 6) Netstat ###
|
||||
|
||||
Netstat is a command line tool for **monitoring incoming** and **outgoing network packets statistics** as well as interface statistics. It displays network connections for the Transmission Control Protocol (both incoming and outgoing),routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics.
|
||||
|
||||
Ubuntu and Debian users can use the default package manager to install netstat on their box. Netstat software includes inside the package net-tools. And can be installed by running the below commands in a shell or terminal:
|
||||
|
||||
sudo apt-get install net-tools
|
||||
|
||||
CentOS, Fedora, RHEL users can use the default package manager to install netstat on their box. Netstat software includes inside the package net-tools. And can be installed by running the below commands in a shell or terminal:
|
||||
|
||||
yum install net-tools
|
||||
|
||||
Simply, run the following to monitor the network packet statistic with Netstat:
|
||||
|
||||
netstat
|
||||
|
||||
![Netstat](http://blog.linoxide.com/wp-content/uploads/2015/02/netstat.png)
|
||||
|
||||
For more information or manual about netstat, we can simply type man netstat in a shell or terminal:
|
||||
|
||||
man netstat
|
||||
|
||||
![man netstat](http://blog.linoxide.com/wp-content/uploads/2015/02/man-netstat.png)
|
||||
|
||||
### 7) Netload ###
|
||||
|
||||
The netload command just displays a small report on the current traffic load, and the total number of bytes transferred since the program start. No more features are there. Its part of the netdiag.
|
||||
|
||||
We can install Netload using yum in fedora as it is in the default repository. But if you're running CentOS or RHEL, we'll need to install [rpmforge repository][1] .
|
||||
|
||||
# yum install netdiag
|
||||
|
||||
Netload is available in the default repository as a part of netdiag so, we can easily install **netdiag** using **apt** manager using the command below.
|
||||
|
||||
$ sudo install netdiag
|
||||
|
||||
To run netload, we must make sure to choose a working network interface name like eth0, eh1, wlan0, mon0, etc. And run the following command accordingly in a shell or a terminal.
|
||||
|
||||
$ netload wlan2
|
||||
|
||||
Note: Please replace wlan2 with the network interface name you wanna use. If you wanna scan for your network interface name run ip link show in a terminal or shell.
|
||||
|
||||
### 8) Nagios ###
|
||||
|
||||
Nagios is a leading open source powerful monitoring system that enables network/system administrators to identify and resolve server related problems before they affect major business processes. With the Nagios system, administrators can able to monitor remote Linux, Windows, Switches, Routers and Printers on a single window. It shows critical warnings and indicates if something went wrong in your network/server which indirectly helps you to begin remediation processes before they occur.
|
||||
|
||||
Nagios has a web interface in which there is a graphical monitor of activities. One can login to the web interface by browsing to the url http://localhost/nagios/ or http://localhost/nagios3/ . Please replace localhost with your IP-address if on remote machine. Then enter the username and pass then, we'll get to see the information like shown below.
|
||||
|
||||
![Nagios3 on Chromium](http://blog.linoxide.com/wp-content/uploads/2015/02/nagios3-ubuntu.png)
|
||||
|
||||
### 9) EtherApe ###
|
||||
|
||||
EtherApe is a graphical network monitor for Unix modeled after etherman. Featuring link layer, IP and TCP modes and support interfaces Ethernet, FDDI, Token Ring, ISDN, PPP, SLIP and WLAN devices, plus several encapsulation formats. Hosts and links change in size with traffic and color coded protocols display. It can filter traffic to be shown, and can read packets from a file as well as live from the network.
|
||||
|
||||
It is easy to install etherape in CentOS, Fedora, RHEL distributions of Linux cause they are available default on their official repository. We can use yum manager to install it with the command shown below:
|
||||
|
||||
yum install etherape
|
||||
|
||||
We can install EtherApe on Ubuntu, Debian and their derivatives using **apt** manager with the below command.
|
||||
|
||||
sudo apt-get install etherape
|
||||
|
||||
After EtherApe is installed on the system, we'll need to run etherape in root permission as:
|
||||
|
||||
sudo etherape
|
||||
|
||||
Then, the **GUI** of **etherape** will be executed. Then, up in the menu we can select the **Mode** (IP, Link Layer, TCP) and **Interface** under **Capture**. After everything are set, we'll need to click **Start** button. Then, we'll gonna see something like this.
|
||||
|
||||
![EtherApe](http://blog.linoxide.com/wp-content/uploads/2015/02/etherape.png)
|
||||
|
||||
### 10) tcpflow ###
|
||||
|
||||
tcpflow is a command line utility that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis or debugging. It reconstructs the actual data streams and stores each flow in a separate file for later analysis. It understands TCP sequence numbers and will correctly reconstruct data streams regardless of retransmissions or out-of-order delivery .
|
||||
|
||||
Installing tcpflow in Ubuntu, Debian system is easy via **apt** manager as it is available by default in the official repository.
|
||||
|
||||
$ sudo apt-get install tcpflow
|
||||
|
||||
We can install tcpflow in Fedora, CentOS, RHEL and their derivatives from repository using **yum** manager as shown below.
|
||||
|
||||
# yum install tcpflow
|
||||
|
||||
If it is not available in the repository or can't be installed via yum manager, we need to install manually from **http://pkgs.repoforge.org/tcpflow/** as shown below.
|
||||
|
||||
If you are running 64 bit PC:
|
||||
|
||||
# yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.x86_64.rpm
|
||||
|
||||
If you are running 32 bit PC:
|
||||
|
||||
# yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.i686.rpm
|
||||
|
||||
We can use tcpflow to capture all/some tcp traffic and put it in an easy to read file. The below command does what we want but we'll need to run that command in an empty directory as it creates files of the format x.x.x.x.y-a.a.a.a.z and after done, just press Control-C that command to stop it.
|
||||
|
||||
$ sudo tcpflow -i eth0 port 8000
|
||||
|
||||
Note: Please replace eth0 with the interface of the card you are trying to capture.
|
||||
|
||||
### 11) IPTraf ###
|
||||
|
||||
[IPTraf][2] is a console-based network statistics utility for Linux. It gathers a variety of figures such as TCP connection packet and byte counts, interface statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN station packet and byte counts.
|
||||
|
||||
IPTraf is available in the default repository so, we can easily install IPTraf using **apt** manager using the command below.
|
||||
|
||||
$ sudo apt-get install iptraf
|
||||
|
||||
IPTraf is available in the default repository so, we can easily install IPTraf using yum manager using the command below.
|
||||
|
||||
# yum install iptraf
|
||||
|
||||
We need to run TPTraf in administration permission with a valid network interface name. Here, we have wlan2 so, we'll be using wlan2 as interface name.
|
||||
|
||||
$ sudo iptraf
|
||||
|
||||
![IPTraf](http://blog.linoxide.com/wp-content/uploads/2015/02/iptraf.png)
|
||||
|
||||
To start the general interface statistics, enter:
|
||||
|
||||
# iptraf -g
|
||||
|
||||
To see the detailed statistics facility on an interface called eth0
|
||||
|
||||
# iptraf -d wlan2
|
||||
|
||||
To see the TCP and UDP monitor on an interface called eth0
|
||||
|
||||
# iptraf -z wlan2
|
||||
|
||||
To displays the packet size counts on an interface called eth0
|
||||
|
||||
# iptraf -z wlan2
|
||||
|
||||
Note: Please replace wlan2 with your interface name. You can check your interface by running command ip link show .
|
||||
|
||||
### 12) Speedometer ###
|
||||
|
||||
Speedometer is a small and simple tool that just draws out good looking graphs of incoming and outgoing traffic through a given interface.
|
||||
|
||||
Speedometer is available in the default repository so, we can easily install Speedometer using yum manager using the command below.
|
||||
|
||||
# yum install speedometer
|
||||
|
||||
Speedometer is available in the default repository so, we can easily install Speedometer using apt manager using the command below.
|
||||
|
||||
$ sudo apt-get install speedometer
|
||||
|
||||
Speedometer can simply be run by executing the following command in a shell or a terminal.
|
||||
|
||||
$ speedometer -r wlan2 -t wlan2
|
||||
|
||||
![Speedometer](http://blog.linoxide.com/wp-content/uploads/2015/02/Speedometer.png)
|
||||
|
||||
Note: Please replace wlan2 with the network interface name you would like to use.
|
||||
|
||||
### 13) Netwatch ###
|
||||
|
||||
Netwatch is part of the netdiag collection of tools, and it too displays the connections between local host and other remote hosts, and the speed at which data is transferring on each connection.
|
||||
|
||||
We can install Netwatch using yum in fedora as it is in the default repository. But if you're running CentOS or RHEL, we'll need to install [rpmforge repository][3] .
|
||||
|
||||
# yum install netwatch
|
||||
|
||||
Netwatch is available in the default repository as a part of netdiag so, we can easily install **netdiag** using **apt** manager using the command below.
|
||||
|
||||
$ sudo install netdiag
|
||||
|
||||
To run netwatch, we'll need to execute the following command in a terminal or shell.
|
||||
|
||||
$ sudo netwatch -e wlan2 -nt
|
||||
|
||||
![Netwatch](http://blog.linoxide.com/wp-content/uploads/2015/02/netwatch.png)
|
||||
|
||||
Note: Please replace wlan2 with the network interface name you wanna use. If you wanna scan for your network interface name run ip link show in a terminal or shell.
|
||||
|
||||
### 14) Trafshow ###
|
||||
|
||||
Trafshow reports the current active connections like netwatch and pktstat, trafshow, their protocol and the data transfer speed on each connection. It can filter out connections using pcap type filters.
|
||||
|
||||
We can install Netwatch using yum in fedora as it is in the default repository. But if you're running CentOS or RHEL, we'll need to install [rpmforge repository][4] .
|
||||
|
||||
# yum install trafshow
|
||||
|
||||
Trafshow is available in the default repository so, we can easily install it using **apt** manager using the command below.
|
||||
|
||||
$ sudo install trafshow
|
||||
|
||||
To monitor using trafshow, we'll need to run the following command in a shell or terminal.
|
||||
|
||||
$ sudo trafshow -i wlan2
|
||||
|
||||
![Trafshow](http://blog.linoxide.com/wp-content/uploads/2015/02/trafshow-all.png)
|
||||
|
||||
To monitor specifically tcp connections add tcp as shown below.
|
||||
|
||||
$ sudo trafshow -i wlan2 tcp
|
||||
|
||||
![Trafshow tcp](http://blog.linoxide.com/wp-content/uploads/2015/02/trafshow-tcp.png)
|
||||
|
||||
Note: Please replace wlan2 with the network interface name you wanna use. If you wanna scan for your network interface name run ip link show in a terminal or shell.
|
||||
|
||||
### 15) Vnstat ###
|
||||
|
||||
Vnstat is bit different from most of the other tools. It actually runs a background service/daemon and keeps recording the size of data transfer all the time. Next it can be used to generate a report of the history of network usage.
|
||||
|
||||
We'll need to turn on EPEL Repository then run **yum** manager to install vnstat.
|
||||
|
||||
# yum install vnstat
|
||||
|
||||
Vnstat is available in the default repository. So, we can run **apt** manager to install it using the following command.
|
||||
|
||||
$ sudo apt-get install vnstat
|
||||
|
||||
Running vnstat without any options would simply show the total amount of data transfer that took place since the date the daemon is running.
|
||||
|
||||
$ vnstat
|
||||
|
||||
![vnstat](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat.png)
|
||||
|
||||
To monitor the bandwidth usage in realtime, use the '-l' option (live mode). It would then show the total bandwidth used by incoming and outgoing data, but in a very precise manner without any internal details about host connections or processes.
|
||||
|
||||
$ vnstat -l
|
||||
|
||||
![Vnstat live mode](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat-live.png)
|
||||
|
||||
After done, press Ctrl-C to stop which will result the following type of output
|
||||
|
||||
![Vnstat Live Result](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat-live-result.png)
|
||||
|
||||
### 16) tcptrack ###
|
||||
|
||||
[tcptrack][5] displays the status of TCP connections that it sees on a given network interface. tcptrack monitors their state and displays information such as state, source/destination addresses and bandwidth usage in a sorted, updated list very much like the **top** command.
|
||||
|
||||
As tcptrack is in the repository , we can simply install tcptrack in Debian, Ubuntu from their repository using apt manager. To do so, we'll need to execute the following command in a shell or terminal:
|
||||
|
||||
$ sudo apt-get install tcptrack
|
||||
|
||||
We can install it using yum in fedora as it is in the default repository. But if you're running CentOS or RHEL, we'll need to install [rpmforge repository][6] . To do so, we'll need to run the following commands.
|
||||
|
||||
# wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
|
||||
|
||||
# rpm -Uvh rpmforge-release*rpm
|
||||
|
||||
# yum install tcptrack
|
||||
|
||||
Note: Here, we have downloaded current latest version of rpmforge-release ie 0.5.3-1 . You can always get the latest version from rpmforge repository and do replace with that you downloaded in the above command.
|
||||
|
||||
**tcptrack** needs to be run in root permission or superuser. We'll need to execute tcptrack with the network interface name we wanna monitor the TCP connections of. Here, we've wlan2 so will be using that as:
|
||||
|
||||
sudo tcptrack -i wlan2
|
||||
|
||||
![tcptrack](http://blog.linoxide.com/wp-content/uploads/2015/02/tcptrack.png)
|
||||
|
||||
If you wanna monitor of specific ports then:
|
||||
|
||||
# tcptrack -i wlan2 port 80
|
||||
|
||||
![tcptrack port 80](http://blog.linoxide.com/wp-content/uploads/2015/02/tcptrack-port-80.png)
|
||||
|
||||
Please replace 80 with the port number you wanna monitor .Note: Please replace wlan2 with the network interface name you wanna use. If you wanna scan for your network interface name run ip link show in a terminal or shell.
|
||||
|
||||
### 17) CBM ###
|
||||
|
||||
The CBM or Color Bandwidth Meter displays current traffic of all network device. This program is so simple that is should be self-explanatory. Source code and newer versions of CBM are available at [http://www.isotton.com/utils/cbm/][7] .
|
||||
|
||||
As CBM is in the repository , we can simply install CBM in Debian, Ubuntu from their repository using **apt** manager. To do so, we'll need to execute the following command in a shell or terminal:
|
||||
|
||||
$ sudo apt-get install cbm
|
||||
|
||||
We simply need to run cbm in a shell or terminal as shown below:
|
||||
|
||||
$ cbm
|
||||
|
||||
![Color Bandwidth Meter](http://blog.linoxide.com/wp-content/uploads/2015/02/cbm.png)
|
||||
|
||||
### 18) bmon ###
|
||||
|
||||
[Bmon][8] or Bandwidth Monitoring is a tool that intended for debugging and monitor bandwidth in real-time access. This tool is capable to retrieving statistics from various input modules. It provides various output methods including a curses based interface,lightweight HTML output but also formatable ASCII output.
|
||||
|
||||
bmon is available in the repository, so we can install it in Debian, Ubuntu from their repository using apt manager. To do so, we'll need to run the following command in a shell or terminal.
|
||||
|
||||
$ sudo apt-get install bmon
|
||||
|
||||
We can run bmon and monitor our bandwidth status using the command below.
|
||||
|
||||
$ bmon
|
||||
|
||||
![bmon](http://blog.linoxide.com/wp-content/uploads/2015/02/bmon.png)
|
||||
|
||||
### 19) tcpdump ###
|
||||
|
||||
[TCPDump][9] is a tool for network monitoring and data acquisition. It can save lots of time and can be used for debugging network or server related problems. It prints out a description of the contents of packets on a network interface that match the boolean expression.
|
||||
|
||||
tcpdump is available in the default repository of Debian, Ubuntu so, we can simply use apt manager to install it under sudo privilege . To do so, we'll need to run the following command in a shell or terminal.
|
||||
|
||||
$ sudo apt -get install tcpdump
|
||||
|
||||
tcpdump is also available in the repository of Fedora, CentOS, RHEL so, we can install it via yum manager as:
|
||||
|
||||
# yum install tcpdump
|
||||
|
||||
tcpdump needs to be run in root permission or superuser. We'll need to execute tcpdump with the network interface name we wanna monitor the TCP connections of. Here, we've wlan2 so will be using it as:
|
||||
|
||||
$ sudo tcpdump -i wlan2
|
||||
|
||||
![tcpdump](http://blog.linoxide.com/wp-content/uploads/2015/02/tcpdump.png)
|
||||
|
||||
If you want to monitor to a specific port only, then can run the command as follows. Here is the example for port 80 (webserver).
|
||||
|
||||
$ sudo tcpdump -i wlan2 'port 80'
|
||||
|
||||
![tcpdump port](http://blog.linoxide.com/wp-content/uploads/2015/02/tcpdump-port.png)
|
||||
|
||||
### 20) ntopng ###
|
||||
|
||||
[ntopng][20] is the next generation version of the original ntop. It is a network probe that shows network usage in a way similar to what top does for processes. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Win32 as well.
|
||||
|
||||
To install ntopng in Debian, Ubuntu system, we'll first need to install the required **dependencies packages to compile ntopng**. You can install them all by running the below command in a shell or a terminal.
|
||||
|
||||
$ sudo apt-get install libpcap-dev libglib2.0-dev libgeoip-dev redis-server wget libxml2-dev build-essential checkinstall
|
||||
|
||||
Now, we'll need to manually compile ntopng for our system as:
|
||||
|
||||
$ sudo wget http://sourceforge.net/projects/ntop/files/ntopng/ntopng-1.1_6932.tgz/download
|
||||
$ sudo tar zxfv ntopng-1.1_6932.tgz
|
||||
$ sudo cd ntopng-1.1_6932
|
||||
$ sudo ./configure
|
||||
$ sudo make
|
||||
$ sudo make install
|
||||
|
||||
Now, you should have your ntopng installed in your Debian or Ubuntu system.
|
||||
|
||||
We have already covered tutorial on ntopng usages. It is available in both command line and web interface. We can go ahead to get knowledge on it.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
In this first part we covered some network load monitoring tools for linux that are very helpful to a sysadmin and even a novice user. Each one of the tools covered in this article has its own specifics, different options but at the end they all help you to monitor your network traffic.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/monitoring-2/network-monitoring-tools-linux/
|
||||
|
||||
作者:[Bobbin Zachariah][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bobbin/
|
||||
[1]:http://pkgs.org/centos-7/repoforge-x86_64/netwatch-1.0c-1.el7.rf.x86_64.rpm.html
|
||||
[2]:http://iptraf.seul.org/
|
||||
[3]:http://pkgs.org/centos-7/repoforge-x86_64/netwatch-1.0c-1.el7.rf.x86_64.rpm.html
|
||||
[4]:http://pkgs.org/centos-6/epel-x86_64/trafshow-5.2.3-6.el6.x86_64.rpm.html
|
||||
[5]:http://linux.die.net/man/1/tcptrack
|
||||
[6]:http://pkgs.org/centos-6/repoforge-x86_64/tcptrack-1.4.0-1.el6.rf.x86_64.rpm.html
|
||||
[7]:http://www.isotton.com/utils/cbm/
|
||||
[8]:https://github.com/tgraf/bmon/
|
||||
[9]:http://www.tcpdump.org/
|
||||
[10]:http://www.ntop.org/
|
@ -1,53 +0,0 @@
|
||||
How To Fix Windows Updates Stuck At 0%
|
||||
================================================================================
|
||||
How do you feel when you log in to Windows after a month, find there are updates to install, you select to install these updates and those **Windows updates stuck at zero percent**?
|
||||
|
||||
Why am I talking about Windows updates on a blog dedicated to Linux and Open Source? Because I prefer to [dual boot Windows with Linux][1]. While I use Linux as my main desktop, once in a while I do log in to Windows. The most annoying thing after logging in Windows is the Windows updates. It has happened to me on several occasions that I found **Windows update not working**. I choose to install the updates and Windows updates get stuck at 0 KB and 0%, like this:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_Updates_stuck_at_zero.jpeg)
|
||||
|
||||
In this tutorial, we shall see how to make Windows update work again. The tutorial should be applicable for Windows 7, Windows 8 and Windows 8.1.
|
||||
|
||||
### Fix Windows updates stuck at zero percent ###
|
||||
|
||||
Please mind that Windows updates can be stuck at any percent and the trick which we are going to use would require you to install those updates again. I hope you do not find that too inconvenient. If you are ready, let’s see how to fix this Windows update issue.
|
||||
|
||||
#### Step 1: ####
|
||||
|
||||
Press Windows+R. This will prompt run dialogue box. In here, type services.msc:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Updates_3.png)
|
||||
|
||||
#### Step 2: ####
|
||||
|
||||
Now it brings us to all the services installed in Windows. These services are listed in alphabetical order. Scroll down and look for **Windows Update Service**. Right click on it and stop it.
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_Updates_stuck_1.jpeg)
|
||||
|
||||
#### Step 3: ####
|
||||
|
||||
Now go in **C:\Windows\SoftwareDistribution and delete all of its contents**. Actually, this is the folder where downloaded installation files were stored. But since Windows update suck, they somehow have problem with partially downloaded update files.
|
||||
|
||||
#### Step 4: ####
|
||||
|
||||
Go back to services again (as mentioned in Step 1) and this time start the Windows Update Service, by right clicking on it. Try to update Windows again. It should be working this time.
|
||||
|
||||
So once you have got the updates working, perhaps you will find plenty of updates to install at next reboot. And that moment calls for a meme:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_update_suck.jpg)
|
||||
|
||||
Jokes apart, I hope this tip helps you to get rid of Windows updates hanged at 0%. I wish that Linux like updates are also included in the list of [Windows 10 features copied from Linux][2]. I wish.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/fix-windows-updates-stuck-0/
|
||||
|
||||
作者:[Abhishek][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/abhishek/
|
||||
[1]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
|
||||
[2]:http://itsfoss.com/windows-10-inspired-linux/
|
@ -1,174 +0,0 @@
|
||||
Monitoring Your Network And Servers With Observium
|
||||
================================================================================
|
||||
### Introduction ###
|
||||
|
||||
You have a problem while monitoring your servers, switches or physical machines. **Observium** fits your need. As a free monitoring system, it helps you to monitor your servers remotely. It is an auto-discovering SNMP based network monitoring platform written in PHP which includes support for a wide range of network hardware and operating systems including Cisco, Windows, Linux, HP, NetApp and many other. I will give you the steps to follow while setting up an **Observium** server on Ubuntu 12.04.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/Capture1.png)
|
||||
|
||||
Currently there are two different versions of **observium**.
|
||||
|
||||
- The observium Community is a free tool and licensed under the QPL Open Source license. This version is the best solution for small deployments. It gets security updates each 6 months.
|
||||
- While the second version, the Observium Professional is distributed under SVN based release mechanism. And it gets daily security updates. This tool is the best for Service Provider and enterprises deployments.
|
||||
|
||||
For more information you can visit the offcial [website of Observium][1].
|
||||
|
||||
### System Requirements ###
|
||||
|
||||
In order to install **Observium** , it’s necessary to have a server with a fresh installation. The development of **Observium** takes place on Ubuntu LTS and Debian systems, so it’s recommended to install **Observium** on Ubuntu or Debian because may be issues with other platforms.
|
||||
|
||||
This article will guide you on how to install **Observium** on Ubuntu 12.04. For a small **Observium** installation is recommended to use 256MB for the memory and dual core for the process.
|
||||
|
||||
### Installing Prerequisites ###
|
||||
|
||||
Before installing **Observium** you need to make sure to install all dependencies.
|
||||
|
||||
First step is to update your server
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
Then you need to install all packages required to run Observium.
|
||||
|
||||
Observuim need this list of software the run correctly:
|
||||
|
||||
- LAMP server
|
||||
- fping
|
||||
- Net-SNMP 5.4+
|
||||
- RRDtool 1.3+
|
||||
- Graphviz
|
||||
|
||||
Requirements for optional features:
|
||||
|
||||
- Ipmitool – Only if you want to poll IPMI baseboard controllers on servers
|
||||
- Libvirt-bin – Only if you want to monitor remote VM hosts using libvirt
|
||||
|
||||
sudo apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-json php-pear snmp fping mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick libvirt ipmitool
|
||||
|
||||
### Creation MySQL Database and User for Observium ###
|
||||
|
||||
Now you need to log into MySQL and create database for **Observuim**:
|
||||
|
||||
mysql -u root -p
|
||||
|
||||
After successful authenticated, you need to create the database.
|
||||
|
||||
CREATE DATABASE observium;
|
||||
|
||||
The database Name is **Observium**. You will need this information later.
|
||||
|
||||
Now, you should create the database administrator.
|
||||
|
||||
CREATE USER observiumadmin@localhost IDENTIFIED BY 'observiumpassword';
|
||||
|
||||
Next, you need to give this user permissions to administer the database you created.
|
||||
|
||||
GRANT ALL PRIVILEGES ON observium.* TO observiumadmin@localhost;
|
||||
|
||||
You need to flush the privilege information to disk to activate the new MySQL user:
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
exit
|
||||
|
||||
### Downloading and Installing Observium ###
|
||||
|
||||
Now that our system is ready, we can start the installation of Observium.
|
||||
|
||||
First step to do is, creating the directory Observium is going to operate out of:
|
||||
|
||||
mkdir -p /opt/observium && cd /opt
|
||||
|
||||
For the purpose of this tutorial, we’re going to be using the Community/Open Source Edition of Observium. Download and unpack it.
|
||||
|
||||
wget http://www.observium.org/observium-community-latest.tar.gz
|
||||
tar zxvf observium-community-latest.tar.gz
|
||||
|
||||
Now go under Observium directory
|
||||
|
||||
cd observium
|
||||
|
||||
Copy the default configuration file ‘**config.php.default**‘ to ‘**config.php**‘ and fill out the database config options:
|
||||
|
||||
cp config.php.default config.php
|
||||
nano config.php
|
||||
|
||||
----------
|
||||
|
||||
/ Database config
|
||||
$config['db_host'] = 'localhost';
|
||||
$config['db_user'] = 'observiumadmin';
|
||||
$config['db_pass'] = 'observiumpassword';
|
||||
$config['db_name'] = 'observium';
|
||||
|
||||
Let’s setup the default schema for the MySQL Database:
|
||||
|
||||
php includes/update/update.php
|
||||
|
||||
Now you need to create directory to store rrd file and change permission to let apache write into the file .
|
||||
|
||||
mkdir rrd
|
||||
chown apache:apache rrd
|
||||
|
||||
To help you troubleshooting on case of problem, you need to create logs file.
|
||||
|
||||
mkdir -p /var/log/observium
|
||||
chown apache:apache /var/log/observium
|
||||
|
||||
Now you have to create the virtual host configuration for Observium
|
||||
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /opt/observium/html/
|
||||
ServerName observium.domain.com
|
||||
CustomLog /var/log/observium/access_log combined
|
||||
ErrorLog /var/log/observium/error_log
|
||||
<Directory "/opt/observium/html/">
|
||||
AllowOverride All
|
||||
Options FollowSymLinks MultiViews
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
|
||||
Next, you need to enable rewrite functionality for your Apache server.
|
||||
|
||||
To enable `mod_rewrite` modules, type this command:
|
||||
|
||||
sudo a2enmod rewrite
|
||||
|
||||
This module will be enable the next after reboot of Apache service.
|
||||
|
||||
sudo service apache2 restart
|
||||
|
||||
### Configuring Observium ###
|
||||
|
||||
Before log into the web interface, you need to create administrator account (level 10) to Observium
|
||||
|
||||
# cd /opt/observium
|
||||
# ./adduser.php admin adminpassword 10
|
||||
User admin added successfully.
|
||||
|
||||
Next set a cron jobs for the discovery and the poller jobs, create a new file ‘**/etc/cron.d/observium**‘ and add the following contents.
|
||||
|
||||
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1
|
||||
*/5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1
|
||||
*/5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
|
||||
|
||||
Reload cron process to take new entries.
|
||||
|
||||
# /etc/init.d/cron reload
|
||||
|
||||
You’ve installed Observium Server! Log into Observium using your browser **http://<Server IP>** and be on your way.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/Capture.png)
|
||||
|
||||
Enjoy!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/monitoring-network-servers-observium/
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/anis/
|
||||
[1]:http://www.observium.org/
|
@ -1,43 +0,0 @@
|
||||
translating by martin.
|
||||
|
||||
Nmap—Not Just for Evil!
|
||||
================================================================================
|
||||
If SSH is the Swiss Army knife of the system administration world, Nmap is a box of dynamite. It's really easy to misuse dynamite and blow your foot off, but it's also a very powerful tool that can do jobs that are impossible without it.
|
||||
|
||||
When most people think of Nmap, they think of scanning servers, looking for open ports to attack. Through the years, however, that same ability is incredibly useful when you're in charge of the server or computer in question. Whether you're trying to figure out what kind of server is using a specific IP address in your network or trying to lock down a new NAS device, scanning networks is incredibly useful.
|
||||
|
||||
Figure 1 shows a network scan of my QNAP NAS. The only thing I use the unit for is NFS and SMB file sharing, but as you can tell, it has a ton of ports wide open. Without Nmap, it would be difficult to figure out what the machine was running.
|
||||
|
||||
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11825nmapf1.jpg)
|
||||
|
||||
### Figure 1. Network Scan ###
|
||||
|
||||
Another incredibly useful way to use Nmap is to scan a network. You don't even have to have root access for that, and it's as simple as specifying the network block you want to scan. For example, typing:
|
||||
|
||||
nmap 192.168.1.0/24
|
||||
|
||||
will scan the entire range of 254 possible IP addresses on my local network and let me know which are pingable, along with which ports are open. If you've just plugged in a new piece of hardware, but don't know what IP address it grabbed via DHCP, Nmap is priceless. For example, the above command revealed this on my network:
|
||||
|
||||
Nmap scan report for TIVO-8480001903CCDDB.brainofshawn.com (192.168.1.220)
|
||||
Host is up (0.0083s latency).
|
||||
Not shown: 995 filtered ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
443/tcp open https
|
||||
2190/tcp open tivoconnect
|
||||
2191/tcp open tvbus
|
||||
9080/tcp closed glrpc
|
||||
|
||||
This not only tells me the address of my new Tivo unit, but it also shows me what ports it has open. Thanks to its reliability, usability and borderline black hat abilities, Nmap gets this month's Editors' Choice award. It's not a new program, but if you're a Linux user, you should be using it!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/nmap%E2%80%94not-just-evil
|
||||
|
||||
作者:[Shawn Powers][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxjournal.com/users/shawn-powers
|
@ -0,0 +1,167 @@
|
||||
10 Useful ‘ls’ Command Interview Questions – Part 2
|
||||
================================================================================
|
||||
Continuing the legacy of ls command here is the second interview article on Listing command. The first article of the series was highly appreciated by the Tecmint Community. If you’ve missed the first part of this series you may like to visit at:
|
||||
|
||||
- [15 Interview Questions on “ls” Command – Part 1][1]
|
||||
|
||||
This article is well presented in the manner that it gives deep insight of ls command with examples. We have taken extra care in the making of article so that it remains simple to understand yet serve the purpose to the fullest.
|
||||
|
||||
![10 Interview Questions on ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Interview-Questions.jpg)
|
||||
10 Interview Questions on ls Command
|
||||
|
||||
### 1. You are supposed to list the content of a directory in long list format, but not print the name of the author and group the file belongs. Also show the difference in output. ###
|
||||
|
||||
a. ls command listing the name of the files in long listing format when used with switch (-l).
|
||||
|
||||
# ls -l
|
||||
|
||||
![List Files in- Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-inLong-List-Format.gif)
|
||||
List Files in- Long List Format
|
||||
|
||||
b. ls command listing the name of the files in long listing format along with the name of the author file belongs, when used with switch (–author) along with switch (-l).
|
||||
|
||||
# ls -l --author
|
||||
|
||||
![List Files By Author](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-By-Author.gif)
|
||||
List Files By Author
|
||||
|
||||
c. ls command listing the name of the files without the name of its owner, when used with switch (-g).
|
||||
|
||||
# ls -g
|
||||
|
||||
![List Files Without Printing Owner Name](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Author.gif)
|
||||
List Files Without Printing Owner Name
|
||||
|
||||
d. ls command listing the name of files in long listing format without the name of group it belongs, when used with switch (-G) along with switch (-l).
|
||||
|
||||
# ls -Gl
|
||||
|
||||
![List Files Without Printing Group](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Group.gif)
|
||||
List Files Without Printing Group
|
||||
|
||||
### 2. Print the size of files and folders in the current directory, in human readable format. How will you do this? ###
|
||||
|
||||
Well we need to use switch -h (human-readable) along with switch (-l) and/or (-s) with the command ls to get the desired output.
|
||||
|
||||
# ls -hl
|
||||
|
||||
![List Files in Human Readable Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Size-of-Files-with-ls.gif)
|
||||
List Files in Human Readable Format
|
||||
|
||||
# ls -hs
|
||||
|
||||
![List File Sizes in Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-File-Sizes-in-Readable-Format.gif)
|
||||
List File Sizes in Long List Format
|
||||
|
||||
**Note**: The option -h uses the power of 1024 (standard in computation) and output the size of files and folders in the units of K, M and G.
|
||||
|
||||
### 3. Well if switch (-h) output size in power of 1024, that is standard, What else power values are supported in ls command? ###
|
||||
|
||||
There exist a switch -si which is similar to switch -h. The only difference is switch -si uses power of 1000 unlike switch -h which uses the power of 1024.
|
||||
|
||||
# ls -si
|
||||
|
||||
![Supported Power Values of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-supported-power-values.gif)
|
||||
Supported Power Values of ls Command
|
||||
|
||||
It can also be used with switch -l to output the size of folder in the power of 1000, in long listing format.
|
||||
|
||||
# ls -si -l
|
||||
|
||||
![List Files by Power Values](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-by-Power-Values.gif)
|
||||
List Files by Power Values
|
||||
|
||||
### 4. You are supposed to print the contents of a directory separated with comma. Is it possible? Can it be done in long listing format? ###
|
||||
|
||||
Yup! Linux ls command can output the contents of a directory separated by comma when used with the switch (-m). Since this comma separated entries are filled horizontally, ls command can’t separate contents with comma when listing contents vertically.
|
||||
|
||||
# ls -m
|
||||
|
||||
![Print Contents of Directory by Comma](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Contents-of-Directory-by-Comma.gif)
|
||||
Print Contents of Directory by Comma
|
||||
|
||||
When used in long listing format, switch -m gets useless.
|
||||
|
||||
# ls -ml
|
||||
|
||||
![Listing Content Horizontally](http://www.tecmint.com/wp-content/uploads/2015/03/Listing-Content-Horizentally.gif)
|
||||
Listing Content Horizontally
|
||||
|
||||
### 5. If there any way to print the contents of a directory upside down? i.e., in reverse order. ###
|
||||
|
||||
Yeah! The above situation can easily be achieved using the switch -r. The switch ‘-r‘ reverse the order of output. It can also be used with switch -l (long listing format).
|
||||
|
||||
# ls -r
|
||||
|
||||
![List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-in-Reverse-Order.gif)
|
||||
List Content in Reverse Order
|
||||
|
||||
# ls -rl
|
||||
|
||||
![Long List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Content-in-Reverse-Order.gif)
|
||||
Long List Content in Reverse Order
|
||||
|
||||
### 6. You are given a situation to print the sub-directories recursively. How will you achieve this situation? Mind it only sub directories and no files. ###
|
||||
|
||||
Okay! That is pretty easy with the switch -R when used with command ls. It can further be grouped with other options like -l (long list) and -m (comma separated), etc.
|
||||
|
||||
# ls -R
|
||||
|
||||
![Print Sub Directories in Recursively](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Sub-Directories-in-Recursively.gif)
|
||||
Print Sub Directories in Recursively
|
||||
|
||||
### 7. How to sort the files based upon the size? ###
|
||||
|
||||
The Linux command line option -S when used with ls gives the desired output. To sort the files based upon size in descending order with the largest file listed at first and smallest at last.
|
||||
|
||||
# ls -S
|
||||
|
||||
![Sort Files with ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Linux.gif)
|
||||
Sort Files with ls Command
|
||||
|
||||
To sort the files based upon size in descending order with the smallest file listed at first and largest at last.
|
||||
|
||||
# ls -Sr
|
||||
|
||||
![Sort Files in Descending Order](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Descending-Order.gif)
|
||||
Sort Files in Descending Order
|
||||
|
||||
### 8. List the contents of a directory with no additional information appearing one file per line. ###
|
||||
|
||||
The switch -1 comes to rescue here. ls command with switch -1 output the contents of the directory with one file per line and no additional information.
|
||||
|
||||
# ls -1
|
||||
|
||||
![List Files Without Information](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Information.gif)
|
||||
List Files Without Information
|
||||
|
||||
### 9. You are given a situation in which you have to print the contents of a directory on standard output enclosed by double quotes. How will you do this? ###
|
||||
|
||||
There exist an option -Q (quote-name) which output the content of ls enclosed in double quotes.
|
||||
|
||||
# ls -Q
|
||||
|
||||
![Print Files with Double Quotes](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Files-with-Double-Quotes.gif)
|
||||
Print Files with Double Quotes
|
||||
|
||||
### 10. You are working in a directory which contains lots of files and folders. You need to print the name of folders before directories. How will you get this? ###
|
||||
|
||||
# ls --group-directories-first
|
||||
|
||||
![Print Directories First](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Directories-First.gif)
|
||||
Print Directories First
|
||||
|
||||
That’s all for now. We will be coming up with the next part of this article series very soon. Till then stay tuned and connected to Tecmint. Do not forget to provide us with valuable feedback in the comment section below. Like and share us and help us get spread!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/ls-interview-questions/
|
||||
|
||||
作者:[Ravi Saive][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/admin/
|
||||
[1]:http://www.tecmint.com/ls-command-interview-questions/
|
263
sources/tech/20150309 15 Basic 'ls' Command Examples in Linux.md
Normal file
263
sources/tech/20150309 15 Basic 'ls' Command Examples in Linux.md
Normal file
@ -0,0 +1,263 @@
|
||||
Translating by ZTinoZ
|
||||
15 Basic ‘ls’ Command Examples in Linux
|
||||
================================================================================
|
||||
ls command is one of the most frequently used command in Linux. I believe ls command is the first command you may use when you get into the command prompt of Linux Box. We use ls command daily basis and frequently even though we may not aware and never use all the option available. In this article, we’ll be discussing basic ls command where we have tried to cover as much parameters as possible.
|
||||
|
||||
![Linux ls Command](http://www.tecmint.com/wp-content/uploads/2012/08/Linux-ls-Commands.png)
|
||||
Linux ls Command
|
||||
|
||||
### 1. List Files using ls with no option ###
|
||||
|
||||
ls with no option list files and directories in bare format where we won’t be able to view details like file types, size, modified date and time, permission and links etc.
|
||||
|
||||
# ls
|
||||
|
||||
0001.pcap Desktop Downloads index.html install.log.syslog Pictures Templates
|
||||
anaconda-ks.cfg Documents fbcmd_update.php install.log Music Public Videos
|
||||
|
||||
### 2 List Files With option –l ###
|
||||
|
||||
Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder name and owner of file and it’s permission.
|
||||
|
||||
# ls -l
|
||||
|
||||
total 176
|
||||
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap
|
||||
-rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents
|
||||
drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads
|
||||
-rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php
|
||||
-rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html
|
||||
-rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log
|
||||
-rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos
|
||||
|
||||
### 3. View Hidden Files ###
|
||||
|
||||
List all files including hidden file starting with ‘.‘.
|
||||
|
||||
# ls -a
|
||||
|
||||
. .bashrc Documents .gconfd install.log .nautilus .pulse-cookie
|
||||
.. .cache Downloads .gnome2 install.log.syslog .netstat.swp .recently-used.xbel
|
||||
0001.pcap .config .elinks .gnome2_private .kde .opera .spice-vdagent
|
||||
anaconda-ks.cfg .cshrc .esd_auth .gtk-bookmarks .libreoffice Pictures .tcshrc
|
||||
.bash_history .dbus .fbcmd .gvfs .local .pki Templates
|
||||
.bash_logout Desktop fbcmd_update.php .ICEauthority .mozilla Public Videos
|
||||
.bash_profile .digrc .gconf index.html Music .pulse .wireshark
|
||||
|
||||
### 4. List Files with Human Readable Format with option -lh ###
|
||||
|
||||
With combination of -lh option, shows sizes in human readable format.
|
||||
|
||||
# ls -lh
|
||||
|
||||
total 176K
|
||||
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap
|
||||
-rw-------. 1 root root 1.6K Jul 31 02:17 anaconda-ks.cfg
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Desktop
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Documents
|
||||
drwxr-xr-x. 4 root root 4.0K Aug 16 02:55 Downloads
|
||||
-rw-r--r--. 1 root root 21K Aug 12 12:42 fbcmd_update.php
|
||||
-rw-r--r--. 1 root root 46K Jul 31 09:58 index.html
|
||||
-rw-r--r--. 1 root root 48K Jul 31 02:17 install.log
|
||||
-rw-r--r--. 1 root root 12K Jul 31 02:13 install.log.syslog
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Music
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Pictures
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Public
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Templates
|
||||
drwxr-xr-x. 2 root root 4.0K Jul 31 02:48 Videos
|
||||
|
||||
### 5. List Files and Directories with ‘/’ Character at the end ###
|
||||
|
||||
Using -F option with ls command, will add the ‘/’ Character at the end each directory.
|
||||
|
||||
# ls -F
|
||||
|
||||
0001.pcap Desktop/ Downloads/ index.html install.log.syslog Pictures/ Templates/
|
||||
anaconda-ks.cfg Documents/ fbcmd_update.php install.log Music/ Public/ Videos/
|
||||
|
||||
### 6. List Files in Reverse Order ###
|
||||
|
||||
The following command with ls -r option display files and directories in reverse order.
|
||||
|
||||
# ls -r
|
||||
|
||||
Videos Public Music install.log fbcmd_update.php Documents anaconda-ks.cfg
|
||||
Templates Pictures install.log.syslog index.html Downloads Desktop 0001.pcap
|
||||
|
||||
### 7. Recursively list Sub-Directories ###
|
||||
|
||||
ls -R option will list very long listing directory trees. See an example of output of the command.
|
||||
|
||||
# ls -R
|
||||
|
||||
total 1384
|
||||
-rw-------. 1 root root 33408 Aug 8 17:25 anaconda.log
|
||||
-rw-------. 1 root root 30508 Aug 8 17:25 anaconda.program.log
|
||||
|
||||
./httpd:
|
||||
total 132
|
||||
-rw-r--r-- 1 root root 0 Aug 19 03:14 access_log
|
||||
-rw-r--r--. 1 root root 61916 Aug 10 17:55 access_log-20120812
|
||||
|
||||
./lighttpd:
|
||||
total 68
|
||||
-rw-r--r-- 1 lighttpd lighttpd 7858 Aug 21 15:26 access.log
|
||||
-rw-r--r--. 1 lighttpd lighttpd 37531 Aug 17 18:21 access.log-20120819
|
||||
|
||||
./nginx:
|
||||
total 12
|
||||
-rw-r--r--. 1 root root 0 Aug 12 03:17 access.log
|
||||
-rw-r--r--. 1 root root 390 Aug 12 03:17 access.log-20120812.gz
|
||||
|
||||
### 8. Reverse Output Order ###
|
||||
|
||||
With combination of -ltr will shows latest modification file or directory date as last.
|
||||
|
||||
# ls -ltr
|
||||
|
||||
total 176
|
||||
-rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog
|
||||
-rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log
|
||||
-rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents
|
||||
-rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html
|
||||
-rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php
|
||||
drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads
|
||||
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap
|
||||
|
||||
### 9. Sort Files by File Size ###
|
||||
|
||||
With combination of -lS displays file size in order, will display big in size first.
|
||||
|
||||
# ls -lS
|
||||
|
||||
total 176
|
||||
-rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log
|
||||
-rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html
|
||||
-rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php
|
||||
-rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents
|
||||
drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates
|
||||
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos
|
||||
-rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg
|
||||
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap
|
||||
|
||||
### 10. Display Inode number of File or Directory ###
|
||||
|
||||
We can see some number printed before file / directory name. With -i options list file / directory with inode number.
|
||||
|
||||
# ls -i
|
||||
|
||||
20112 0001.pcap 23610 Documents 23793 index.html 23611 Music 23597 Templates
|
||||
23564 anaconda-ks.cfg 23595 Downloads 22 install.log 23612 Pictures 23613 Videos
|
||||
23594 Desktop 23585 fbcmd_update.php 35 install.log.syslog 23601 Public
|
||||
|
||||
### 11. Shows version of ls command ###
|
||||
|
||||
Check version of ls command.
|
||||
|
||||
# ls --version
|
||||
|
||||
ls (GNU coreutils) 8.4
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Written by Richard M. Stallman and David MacKenzie.
|
||||
|
||||
### 12. Show Help Page ###
|
||||
|
||||
List help page of ls command with their option.
|
||||
|
||||
# ls --help
|
||||
|
||||
Usage: ls [OPTION]... [FILE]...
|
||||
|
||||
### 13. List Directory Information ###
|
||||
|
||||
With ls -l command list files under directory /tmp. Wherein with -ld parameters displays information of /tmp directory.
|
||||
|
||||
# ls -l /tmp
|
||||
total 408
|
||||
drwx------. 2 narad narad 4096 Aug 2 02:00 CRX_75DAF8CB7768
|
||||
-r--------. 1 root root 384683 Aug 4 12:28 htop-1.0.1.tar.gz
|
||||
drwx------. 2 root root 4096 Aug 4 11:20 keyring-6Mfjnk
|
||||
drwx------. 2 root root 4096 Aug 16 01:33 keyring-pioZJr
|
||||
drwx------. 2 gdm gdm 4096 Aug 21 11:26 orbit-gdm
|
||||
drwx------. 2 root root 4096 Aug 19 08:41 pulse-gl6o4ZdxQVrX
|
||||
drwx------. 2 narad narad 4096 Aug 4 08:16 pulse-UDH76ExwUVoU
|
||||
drwx------. 2 gdm gdm 4096 Aug 21 11:26 pulse-wJtcweUCtvhn
|
||||
-rw-------. 1 root root 300 Aug 16 03:34 yum_save_tx-2012-08-16-03-34LJTAa1.yumtx
|
||||
|
||||
----------
|
||||
|
||||
# ls -ld /tmp/
|
||||
|
||||
drwxrwxrwt. 13 root root 4096 Aug 21 12:48 /tmp/
|
||||
|
||||
### 14. Display UID and GID of Files ###
|
||||
|
||||
To display UID and GID of files and directories. use option -n with ls command.
|
||||
|
||||
# ls -n
|
||||
|
||||
total 36
|
||||
drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Downloads
|
||||
drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Music
|
||||
drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Pictures
|
||||
-rw-rw-r--. 1 500 500 12 Aug 21 13:06 tmp.txt
|
||||
drwxr-xr-x. 2 500 500 4096 Aug 2 01:52 Videos
|
||||
|
||||
### 15. ls command and it’s Aliases ###
|
||||
|
||||
We have made alias for ls command, when we execute ls command it’ll take -l option by default and display long listing as mentioned earlier.
|
||||
|
||||
# alias ls="ls -l"
|
||||
|
||||
Note: We can see number of alias available in your system with below alias command and same can be unalias as shown below example.
|
||||
|
||||
# alias
|
||||
|
||||
alias cp='cp -i'
|
||||
alias l.='ls -d .* --color=auto'
|
||||
alias ll='ls -l --color=auto'
|
||||
alias ls='ls --color=auto'
|
||||
alias mv='mv -i'
|
||||
alias rm='rm -i'
|
||||
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
|
||||
|
||||
To remove an alias previously defined, just use the unalias command.
|
||||
|
||||
# unalias ls
|
||||
|
||||
In our next article we’ll cover up more or advanced ls command with their examples. If we’ve missed anything in the list, please update us via comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
|
||||
|
||||
作者:[Ravi Saive][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/admin/
|
@ -0,0 +1,187 @@
|
||||
15 Interview Questions on Linux “ls” Command – Part 1
|
||||
================================================================================
|
||||
The listing command in UNIX and UNIX like operating System ‘ls‘ is one of the most basic and widely used utility in command-line. It is POSIX compliant utility available for GNU coreutils and BSD variants. The ‘ls’ command can be used with a variety of options to get desired results. This article aims at deep insight of file listing command in Linux with relevant examples.
|
||||
|
||||
![15 ls Command Questions](http://www.tecmint.com/wp-content/uploads/2014/09/ls-Command-Questions.png)
|
||||
15 ls Command Questions
|
||||
|
||||
### 1. How will you List files from a directory? ###
|
||||
|
||||
Ans: The Linux file listing command ‘ls‘ comes to rescue here.
|
||||
|
||||
# ls
|
||||
|
||||
![List Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-files.gif)
|
||||
List Files
|
||||
|
||||
Alternatively, we can use ‘echo‘ command to list files within a directory in association with wildcard (*).
|
||||
|
||||
# echo *
|
||||
|
||||
![List All Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-files.gif)
|
||||
List All Files
|
||||
|
||||
### 2. How will you list all the directories only using echo command? ###
|
||||
|
||||
# echo */
|
||||
|
||||
![List All Directories](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-directories.gif)
|
||||
List All Directories
|
||||
|
||||
### 3. How will you list all the files within a directory including hidden files aka (.) dot files? ###
|
||||
|
||||
Ans: We need to use option ‘-a‘ (list hidden files) with command ‘ls‘.
|
||||
|
||||
# ls -a
|
||||
|
||||
![List All Hidden Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-hidden-files.gif)
|
||||
List All Hidden Files
|
||||
|
||||
### 4. How do you list all the files within a directory including hidden files, but do not list implied ‘.’ and ‘..’? ###
|
||||
|
||||
Ans: We need to use option ‘-A‘ (do not list implied . and ..) with command ‘ls‘.
|
||||
|
||||
# ls -A
|
||||
|
||||
![Do Not List Implied](http://www.tecmint.com/wp-content/uploads/2014/09/Do-not-list-Implied.gif)
|
||||
Do Not List Implied
|
||||
|
||||
### 5. How will you print the content of a directory in long format listing? ###
|
||||
|
||||
Ans: We need to use option ‘l‘ (long format) with command ‘ls‘.
|
||||
|
||||
# ls -l
|
||||
|
||||
![List Files Long](http://www.tecmint.com/wp-content/uploads/2014/09/list-files-long.gif)
|
||||
List Files Long
|
||||
|
||||
In the above example, the output seems like.
|
||||
|
||||
drwxr-xr-x 5 avi tecmint 4096 Sep 30 11:31 Binary
|
||||
|
||||
Here, drwxr-xr-x is file permission for owner, group and world. Owner has Read(r), Write(w) and Execute(x) permission. The group to which this file belongs has Read(r) and Execute(x) permission but not Write(w) permission, same permission implies for the world that have access to this file.
|
||||
|
||||
- The Initial ‘d‘ means its a Directory.
|
||||
- Number ‘5‘ represents Symbolic Link.
|
||||
- The File Binary belongs to user avi and group tecmint.
|
||||
- Sep 30 11:31 represents the date and time it was last modified.
|
||||
|
||||
### 6. You are supposed to print the content of directory in long format listing, showing hidden/dot files. How will you achieve this? ###
|
||||
|
||||
Ans: We need to use option ‘-a‘ (list hidden files) and ‘-l‘ (long listing) together with command ‘ls‘.
|
||||
|
||||
# ls -la
|
||||
|
||||
![Print Content of Directory](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Content-of-Directory.gif)
|
||||
Print Content of Directory
|
||||
|
||||
Alternatively We can use option ‘-A‘ and ‘-l‘ with ‘ls‘ command, if we do not want to list implied ‘.’ and ‘..’.
|
||||
|
||||
# ls -lA
|
||||
|
||||
### 7. How will you figure out the author of each file? ###
|
||||
|
||||
Ans: We need to use option ‘–author‘ along with option ‘-l‘ to print the author name of each file.
|
||||
|
||||
# ls --author -l
|
||||
|
||||
![List Author Files](http://www.tecmint.com/wp-content/uploads/2014/09/List-Author-Files.gif)
|
||||
List Author Files
|
||||
|
||||
### 8. How will you print escape for non-graphic character? ###
|
||||
|
||||
Ans: We just need to use option ‘-b‘ to print escape for non-graphic character.
|
||||
|
||||
# ls -b
|
||||
|
||||
![Print Escape Character](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Escape-Character.gif)
|
||||
|
||||
### 9. List the size of files and folders in desired scale format. How will you achieve this? ###
|
||||
|
||||
Ans: Here option ‘–block-size=scale‘ along with option ‘-l‘ needs to be used. We need to remove ‘scale’ in the example with the desired scale viz M, K, etc.
|
||||
|
||||
# ls --block-size=M -l
|
||||
# ls --block-size=K -l
|
||||
|
||||
![List File Scale Format](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Scale-Format.gif)
|
||||
List File Scale Format
|
||||
|
||||
### 10. List the files within a directory, but don’t show the backup files, i.e., those files that end with ~. ###
|
||||
|
||||
Ans: Here option ‘-B‘ (do not list implied entries ending with ~) comes to rescue.
|
||||
|
||||
# ls -B
|
||||
|
||||
![List File Without Backup](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Without-Backup.gif)
|
||||
List File Without Backup
|
||||
|
||||
### 11. Sort all the files within a directory by name and show associated last modification information. ###
|
||||
|
||||
Ans: We need to use option ‘-c‘ and option ‘-l‘ with command ls to fulfil the need as suggested above.
|
||||
|
||||
# ls -cl
|
||||
|
||||
![Sort Files](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files.gif)
|
||||
Sort Files
|
||||
|
||||
### 12. Sort all the files within a directory by modification time and show associated information. ###
|
||||
|
||||
Ans: We need to use three options together i.e., ‘-l‘, ‘-t‘ and ‘-c‘ with command ls to sort files by modification time, newest first.
|
||||
|
||||
# ls -ltc
|
||||
|
||||
![Sort Files by Modification](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files-by-Modification.gif)
|
||||
Sort Files by Modification
|
||||
|
||||
### 13. How will you control the output of ‘ls’ command to be colorful or no-color? ###
|
||||
|
||||
Ans: We need to use option ‘–color=parameter‘. The parameter to be used with color option are ‘auto’, ‘always’ and ‘never’ which are self explanatory.
|
||||
|
||||
# ls --color=never
|
||||
# ls --color=auto
|
||||
# ls --color=always
|
||||
|
||||
![ls Colorful Output](http://www.tecmint.com/wp-content/uploads/2014/09/ls-colorful-output.gif)
|
||||
ls Colorful Output
|
||||
|
||||
### 14. You are supposed to list directory entries themselves, not their contents. What will you do? ###
|
||||
|
||||
Ans: Here the option ‘-d‘ comes handy.
|
||||
|
||||
# ls -d
|
||||
|
||||
![List Directory Entries](http://www.tecmint.com/wp-content/uploads/2014/09/List-Directory-Entries.gif)
|
||||
List Directory Entries
|
||||
|
||||
### 15. Create an alias for long format listing “ls -l” as “ll” and output the result to a file and not standard output. ###
|
||||
|
||||
Ans: Here in the above scenario, we need to add alias to .bashrc file and then use redirect operator to write the output to file and not standard output. We will be using editor nano.
|
||||
|
||||
# ls -a
|
||||
# nano .bashrc
|
||||
# ll >> ll.txt
|
||||
# nano ll.txt
|
||||
|
||||
![Create Alias for ls command](http://www.tecmint.com/wp-content/uploads/2014/09/Create-ls-Alias.gif)
|
||||
Create Alias for ls command
|
||||
|
||||
That’s all for now. Don’t forget to provide us with your valuable feedback in the comments below. I’ll be here again with another interesting article soon. Till then stay tuned and connected.
|
||||
|
||||
### Real Also: ###
|
||||
|
||||
- [10 ‘ls’ Command Interview Questions – Part 2][1]
|
||||
- [15 Basic ‘ls’ Commands in Linux][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/ls-command-interview-questions/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
[1]:http://www.tecmint.com/ls-interview-questions/
|
||||
[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
|
@ -0,0 +1,81 @@
|
||||
List Of Free Windows SSH Client Tools To Connect To Your Linux Server
|
||||
================================================================================
|
||||
You have Windows as operating system and you need to connect to Linux server to transfer files from Linux to Windows and inversely. So you need to have Secure Shell known as SSH. In fact, SSH is a network protocol which enables you to connect to Linux and Unix servers over the network. It uses public key cryptography to authenticate the remote computer. You can use SSH by several ways, either by using it automatically or by using a password authentication to log in.
|
||||
|
||||
This article provides a list of SSH clients let you to connect SSH to your Linux servers.
|
||||
|
||||
let’s start.
|
||||
|
||||
### PuTTY ###
|
||||
|
||||
**PuTTY** is the most famous SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/putty.png)
|
||||
|
||||
Putty is very easy to install and to use.You don’t usually need to change most of the configuration options. To start the simplest kind of session, all you need to do is to enter a few basic parameters.You can download PuTTY [here][1]
|
||||
|
||||
### Bitvise SSH Client ###
|
||||
|
||||
**Bitvise SSH** Client is an SSH and SFTP client for Windows. It is developed and supported professionally by Bitvise. The SSH Client is robust, easy to install, easy to use. Bitvise SSH Client is a feature-rich graphical SSH/SFTP client for windows and allow you dynamic port forwarding through an integrated proxy with auto-reconnecting capability.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png)
|
||||
|
||||
Bitvise SSH Client is **free for personal use**, as well as for individual commercial use inside organizations. You can [download Bitvise SSH Client here][2].
|
||||
|
||||
### MobaXterm ###
|
||||
|
||||
**MobaXterm** is your **ultimate toolbox for remote computing**. In a single Windows application, it provides loads of functions that are tailored for programmers, webmasters, IT administrators and pretty much all users who need to handle their remote jobs in a more simple fashion.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png)
|
||||
|
||||
MobaXterm provides all the important **remote network tools** (SSH, X11, RDP, VNC, FTP, MOSH, …) and **Unix commands** (bash, ls, cat, sed, grep, awk, rsync, …) to Windows desktop, in a **single portable exe file** which works out of the box. MobaXterm is **free for personal use**. You can download MobaXterm [from here][3].
|
||||
|
||||
### DameWare SSH ###
|
||||
|
||||
I think that **DameWare SSH** is the best free ssh client.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/ssh.png)
|
||||
|
||||
This free tool is a terminal emulator that lets you make multiple telnet and SSH connections from one easy-to-use console.
|
||||
|
||||
- Manage multiple sessions from one console with a tabbed interface
|
||||
- Save favorite sessions within the Windows file system
|
||||
- Access multiple sets of saved credentials for easy log-in to different devices
|
||||
- Connect to computers and devices using telnet, SSH1, and SSH2 protocols
|
||||
|
||||
You can download **DameWare SSH** from [this link][4].
|
||||
|
||||
### SmarTTY ###
|
||||
|
||||
SmarTTY is a free multi-tabbed SSH client that supports copying files and directories with SCP on-the-fly.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/smart.png)
|
||||
|
||||
Most SSH servers support up to 10 sub-sessions per connection. SmarTTY makes the best of it: no annoying multiple windows, no need to relogin, just open a new tab and go!
|
||||
|
||||
### Cygwin ###
|
||||
|
||||
Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/cyq.png)
|
||||
|
||||
**Cygwin** consists of a Unix system call emulation library, cygwin1.dll, together with a [vast set][5] of GNU and other free software applications organized into a large number of optional packages. Among these packages are high-quality compilers and other software development tools, an X11 server, a complete X11 development toolkit, GNU emacs, TeX and LaTeX, OpenSSH (client and server), and much more, including everything needed to compile and use PhysioToolkit software under MS-Windows.
|
||||
|
||||
After reading our article, which is your favorite SSH client? You can leave a comment describing your favorite system and the reasons of your choice. And of course if there is another SSH client doesn’t appear in this article, you can help us to add it.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/anis/
|
||||
[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
|
||||
[2]:http://www.bitvise.com/download-area
|
||||
[3]:http://mobaxterm.mobatek.net/download.html
|
||||
[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM
|
||||
[5]:http://cygwin.com/packages/
|
@ -0,0 +1,59 @@
|
||||
How To Get Email Alerts for SSH Login on Linux Server
|
||||
================================================================================
|
||||
![](http://www.ehowstuff.com/wp-content/uploads/2015/03/fail2ban-security.jpg)
|
||||
|
||||
Enable SSH server on a virtual private server (VPS) will expose the server to the internet and provide opportunities for hacking activities, especially when VPS still using root as a primary access. VPS should be configured with a email alert automatically to each successful login attempts via SSH server . VPS server owner shall be notified of any SSH server access log, such as who, when and which source IP address. This is an important security concern for server owners to protect the server from unknown login attempts. This is because if hackers use brute force to log into your VPS via ssh then it can be very dangerous. In this article, I will explain how to set up an email alert to all SSH login users on linux CentOS 6, CentOS 7, RHEL 6 and RHEL 7.
|
||||
|
||||
1. Login to your server as root user :
|
||||
|
||||
2. Configure at alert from source global definitions (/etc/bashrc). This will enabled for root and normal users :
|
||||
|
||||
[root@vps ~]# vi /etc/bashrc
|
||||
|
||||
Add the following at the bottom of the files.
|
||||
|
||||
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
|
||||
|
||||
3. Optionally you can enable alert for root only :
|
||||
|
||||
[root@vps ~]# vi .bashrc
|
||||
|
||||
Add the following at the bottom of /root/.bashrc :
|
||||
|
||||
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
|
||||
|
||||
Full Configuration file example :
|
||||
|
||||
# .bashrc
|
||||
|
||||
# User specific aliases and functions
|
||||
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
# Source global definitions
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc
|
||||
fi
|
||||
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
|
||||
|
||||
4. Optionally you can enable alert for specify normal user (e.g skytech ) :
|
||||
|
||||
[root@vps ~]# vi /home/skytech/.bashrc
|
||||
|
||||
Add the following at the bottom of /home/skytech/.bashrc :
|
||||
|
||||
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ehowstuff.com/how-to-get-email-alerts-for-ssh-login-on-linux-server/
|
||||
|
||||
作者:[skytech][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ehowstuff.com/author/mhstar/
|
@ -0,0 +1,28 @@
|
||||
[Fixed] Keyboard And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip]
|
||||
================================================================================
|
||||
### Problem: ###
|
||||
|
||||
When Ubuntu 14.04 or 14.10 comes back from sleep or suspend mode, the keyboard and mouse freeze. Nothing can be clicked or entered. The only way out is to force shutdown the system by pressing the power button. This is very inconvenient, rather very annoying. Because the default behavior in Ubuntu is that when you close the lid of the laptop, it goes in sleep mode.
|
||||
|
||||
In this quick post, we shall see how to fix this issue of mouse freeze after suspend in Ubuntu 14.04 and 14.10.
|
||||
|
||||
### Solution to mouse freezing after sleep in Ubuntu 14.04 ###
|
||||
|
||||
The issue is actually coming from Kernel upgrade. I am not sure of the reason why, but a re-install of input device driver seems to be fixing this issue.
|
||||
|
||||
sudo apt-get install --reinstall xserver-xorg-input-all
|
||||
|
||||
This quick tip was based on a question asked by an It’s FOSS reader, Dev. Try this quick tip and see if it works for you as well. In a similar issue, you can [fix no Unity, launcher and dash after logging in to Ubuntu][1].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/keyboard-mouse-freeze-suspend/
|
||||
|
||||
作者:[Abhishek][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/abhishek/
|
||||
[1]:http://itsfoss.com/how-to-fix-no-unity-no-launcher-no-dash-in-ubuntu-12-10-quick-tip/
|
@ -1,155 +0,0 @@
|
||||
11 个 增强你的 Ubuntu 使用体验的实用工具
|
||||
================================================================================
|
||||
**无论你是一个相对的新手还是经验丰富的专家,我们都想从我们的操作系统中得到更多的东西。正如大多数现代的操作系统,相比于乍一看呈现出的内容,Ubuntu 有更多东西可以向我们提供。**
|
||||
|
||||
从调整和优化 Unity 桌面的外观、行为、性能 到 执行系统维护,有着大量的实用工具和应用可以帮助你 **调整 Ubuntu 来无时不刻地满足你的需求**。
|
||||
|
||||
注意时刻: Ubuntu 一直都配备了‘合理的默认设置---即工作良好的选项---’,以达到开箱即用,这些默认设置适合大多数人,并且它们都是经过了测试,采用及推荐等过程的。
|
||||
|
||||
但一个尺寸并不适合所有。对于我们当中的能工巧匠和实验主义者来说,默认设置只是他们定制系统的起点。
|
||||
|
||||
所以,无需更多的唠叨, 这里有 11 个极好的实用工具来帮助你增强你的 Ubuntu 使用体验。
|
||||
|
||||
### Unity Tweak Tool ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/unity-tweak-tool.jpg)
|
||||
|
||||
我将以这个列表中最重要的一个工具: **Unity Tweak Tool** 来开始这次的介绍。定制的厨房水槽(注:不知该如何翻译,感觉意思是:水槽之于厨房的重要性相当于该软件之于定制 Ubuntu 的重要性), Unity Tweak Tool 提供了一系列针对 Ubuntu 和 Unity 桌面的系统综合调整功能。
|
||||
|
||||
它被各种开关,切换和控制塞得满满的,使得你可以任意设置从 Unity 桌面的外观到 Unity 的行为之类的任何东西。你可以使用它 **快速简便地改变 GTK 主题和图标集**、设置热区、调整启动器图标尺寸、增加或移除工作区,以及 ---特别地---开启 Unity 桌面中被巧妙隐藏的“通过点击最小化”的特点。
|
||||
|
||||
免费并可直接从 Ubuntu 软件中心里找到, Unity Tweak Tool 是非常值得保留在你的口袋里的工具之一。
|
||||
|
||||
### Unity Privacy Indicator ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/indicator-privacy-in-ubuntu.jpg)
|
||||
|
||||
隐私是一个非常,非常重要的事,事实也恰恰如此。但这个话题总是被隐藏在二进制之下(注:感觉这里翻译有误,不太确定)。让一些数据或习惯,比如说你经常打开的应用,在本地被记录下来,这或许会让你感到高兴,但对于 你在 Dash 中的搜索数据被发送带第三方服务机构(尽管这些数据或许是匿名的)这类事情,你就高兴不起来了。
|
||||
|
||||
[Privacy Indicator][1] 是一个帮助你时刻跟踪 Ubuntu桌面系统中哪些文件、目录和服务正被获取、记录及搜索的实用工具。
|
||||
|
||||
通过快速的点击被添加到桌面面板上的‘眼睛’图标,你可以:
|
||||
|
||||
- 开启或关闭在线搜索结果,Zeitgeist(注:根据图片看,Zeitgeist 指的是 record activity), HUD 记录 和 GeoIP 服务
|
||||
- 快速的启用 清理 Zeitgeist,F2(注:根据图片看,F2 指的是 通过 Alt-F2 执行的命令),当前文件等等的记录数据
|
||||
- 展示或隐藏桌面图标以及它们在桌面面板上的名称
|
||||
|
||||
上面的最后两个选项在这个应用中似乎有点被放错了位置,但对于那些要分享截图或截屏的人来说,将会泄露更少的隐私。
|
||||
|
||||
- [从这里下载 Indicator Privacy (.deb)][2]
|
||||
|
||||
### Unity Folders ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/unity-folders.jpg)
|
||||
|
||||
**Android, iOS, OS X, Chrome OS, 和 GNOME Shell 都有应用橱窗, 借助一个极好的第三方应用,Unity 也可以实现类似功能。**
|
||||
|
||||
“Unity Folders” 允许你组织位于 Unity 启动器中的应用到实用的橱窗中,--- 如 游戏,办公,社交等。不必打开 Dash,你就可以快速启动你喜爱的应用,这非常适合你的工作流。
|
||||
|
||||
每一个 ‘橱窗’其实一个打开 ,但总体效果看上去就像是一个 OS X 的风格栈 或 Android 的切换框(注:这里的翻译我拿不准)。
|
||||
|
||||
橱窗的图标可以自定义或根据橱窗内的应用来自动生成。已经存在的橱窗可以被编辑,重新组织,重命名以及如下的更多选择:
|
||||
|
||||
- 根据你的喜好创建任意多的橱窗
|
||||
- 选择自定义或自动生成橱窗图标
|
||||
- 可选择 3 种橱窗样式
|
||||
- 为添加到橱窗中的应用设定自定义图标
|
||||
- 编辑现有橱窗
|
||||
|
||||
[Unity Folders 的网址](http://unity-folders.exceptionfound.com/)
|
||||
(注:根据原文来看,这里应该有链接,转换为 md 文档时没有加上链接)
|
||||
|
||||
### 咖啡因 ###
|
||||
|
||||
对于我们中的许多人来说,咖啡因是主食,它并不只存在于饮料之中。咖啡因提供了一个快速,温和的方式来阻止你的屏保或锁屏起作用。有用的程度将取决于你的环境(即你系统的怪癖) (注:这一句我没有完全理解原文的意思),并且尽管它不像以前那样对用户友好,它仍然值得你[尝试一下][3]。
|
||||
|
||||
### 系统状态指示器 (System Monitor Indicator) ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/multiload-indicator-in-ubuntu.jpg)
|
||||
|
||||
假如你是一个状态迷,即一个喜欢密切关注程序,进程和硬件的状态的人, Linux 很容易满足你的需求。从 Conky 的配置到终端命令,并不缺少监视你的 CPU 使用情况、网络流量或 GPU 温度的方法。
|
||||
|
||||
但至今为止,我最喜爱的应用是 系统**监视指示器**,---也被叫做多负载指示器---它可从 Ubuntu 软件中心获得。它也有着大量的配置选项。
|
||||
|
||||
- [点击这个链接,在 Ubuntu 中 下载 ‘System Load Indicator’][4]
|
||||
|
||||
### 针对 Linux 笔记本电脑的省电工具 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/08/front.jpg)
|
||||
|
||||
**TLP**
|
||||
|
||||
当提到便携式设备上的电池使用效率时,Linux 发行版本并没有最好的声誉。
|
||||
|
||||
如果你自己的 Linux 笔记本可以勉强在再次充电之前,让你从沙发到厨房,那么这里有几个你可以试试的工具。
|
||||
|
||||
TLP 是最受欢迎的确保延长 Linux 笔记本的电池寿命的自动化后台工具之一,它是通过调整系统进程和硬件的设置及行为来达到此目的的,例如 启动 Wi-Fi 省电模式, PCI 总线设备的实时电量管理和处理器的频率缩放调整。
|
||||
|
||||
在 Ubuntu 14.04 LTS 以及后续发行版本中可以使用 TLP 专用的 PPA 来安装它。且它只带了‘包罗万象’的设置来使你踏上配置它的旅程。 在我们之中的高级用户可以潜心研究并根据你自己的硬件来调整设置,一个 [关于 TLP 的完整指导 wiki][6] 使得设置更加容易。
|
||||
|
||||
**Laptop Mode Tools**
|
||||
|
||||
假如 TLP 听起来有一点复杂 --这也并没有什么可羞耻的--这里有一个更简单的替代品: **Laptop Mode Tools**。 这个软件包可从 Ubuntu 软件中心直接安装,且本身设置好了一系列合理的默认设置(Wi-Fi,蓝牙等等)。
|
||||
|
||||
Laptop Mode Tools 不能和 TLP 同时被安装在电脑中。
|
||||
|
||||
- [Ubuntu 软件中心里的 Laptop Mode Tools ][7]
|
||||
|
||||
### Intel 显卡驱动安装工具 ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/intelgraphicsdriverinstaller.png)
|
||||
|
||||
对于那些运行 Intel 显卡硬件,并想使得这些硬件发挥出最佳性能的人来说,Intel 显卡安装工具是必须拥有的。 它使得 查找并安装最新的 Intel GPU 驱动变得不再是一件痛苦和大费周折的事 ---因为这无需 PPA 或任何的终端使用知识。
|
||||
|
||||
- [下载针对 Linux平台的 Intel 图形安装器 0.7 版本][8]
|
||||
|
||||
### Hardware Stats ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/Screen-Shot-2014-02-10-at-21.05.37.png)
|
||||
|
||||
假如你计划 升级你的 PC 或替换一个坏掉的零部件,你需要知道一些特定的硬件信息,例如 RAM 类型,CPU插座类型 或 查看那个PCI 槽是可用的等信息。
|
||||
|
||||
**I-Nex**可以使得 发掘出以上的信息以及其他的系统具体状态变得更加容易。使用它来查找你的主板型号、S.M.A.R.T.(注:为 Self-Monitoring, Analysis and Reporting Technology 的缩写,经常写为 SMART ) 状态,以及你想得出的很多东西!
|
||||
|
||||
- [可从 Launchpad 了解到更多关于 I-Nex 的信息][9]
|
||||
|
||||
### 磁盘空间可视化程序(Disk Space Visualizer) ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/disk-usage-visualizer-for-ubuntu.jpg)
|
||||
|
||||
在这个硬盘以 1TB 计数的时代,我们或许不必同以前一样对硬盘空间的使用三思而后行。但对于那些使用小容量的 SSD,运行多个分区或在一个拥有固定虚拟磁盘大小的虚拟机上工作,总有感觉 释放一些额外空间是必要的 这种想法的时候。
|
||||
|
||||
GNOME Disks,在 Ubuntu 中被默认安装,使得查找占用最大磁盘空间的罪魁祸首变得容易。对于定位隐藏的日志、缓存和视频文件,它是非常完美的工具。
|
||||
|
||||
### BleachBit (Cruft Cleaner) ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/bleachbit.jpg)
|
||||
|
||||
Windows 用户可能对像 CCleaner 之类的应用很熟悉,它可以扫描并清理垃圾文件、空白文件夹、臃肿的缓存以及陈旧的软件包。在 Ubuntu 上,一个相似的快速且毫不费力的一键式清理方法可以试试 **BleachBit** 。
|
||||
|
||||
它是一个强大的工具,所以一定要注意你正在清理什么。不要漫无目的地确认每个选项框;不是所有的东西它都可以清理。所以请合理地使用它,当你对某个选项有疑问时,就跳过它。
|
||||
|
||||
- [Install BleachBit from Ubuntu Software Center][10]
|
||||
|
||||
你已经有了自己最喜欢的系统实用工具了吗?可以在下面的评论中让其他人知晓它。
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/11/useful-tools-for-ubuntu-do-you-use-them
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://www.florian-diesch.de/software/indicator-privacy/index.html
|
||||
[2]:http://www.florian-diesch.de/software/indicator-privacy/dist/indicator-privacy_0.04-1_all.deb
|
||||
[3]:http://www.omgubuntu.co.uk/2014/05/stop-ubuntu-sleeping-caffeine
|
||||
[4]:apt://indicator-mulitload
|
||||
[5]:https://launchpad.net/~linrunner/+archive/ubuntu/tlp/+packages
|
||||
[6]:http://linrunner.de/en/tlp/docs/tlp-configuration.html
|
||||
[7]:https://apps.ubuntu.com/cat/applications/laptop-mode-tools/
|
||||
[8]:https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-linux-1.0.7
|
||||
[9]:https://launchpad.net/i-nex
|
||||
[10]:https://apps.ubuntu.com/cat/applications/bleachbit/
|
@ -0,0 +1,83 @@
|
||||
Linux上有哪些比较好的C/C++ IDE?
|
||||
================================================================================
|
||||
"一个真正的程序员是不用IDE(译者注:集成开发环境)的,他们都是用带着某某插件的文本编辑器来写代码。"我们总能在某些地方听到此类观点。然而,尽管越来越多的人同意这样的观点,但是一个IDE仍然非常有用,它设置简单,使用起来也很方便,因此没有更好办法能像这样来编写一个项目了。所以鉴于这点,在这里我想给大家列一份在linux平台上比较好的C/C++ IDE清单。为什么特地说C/C++呢?因为C语言是我最喜欢的编程语言而且我们总要找个切入点来开始。另外要注意的是,通常有很多种编写C代码的方法,所以为了消减清单的篇幅,我只选择了"真正好用的IDE",而不是诸如Gedit或Vim这种注入[插件][1]的文本编辑器。并不是说这些编辑器在任何情况下都不好,只是如果我将文本编辑器包含进去那这份清单就将永无止境了。
|
||||
|
||||
### 1. Code::Blocks ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7520/16089880989_10173db27b_c.jpg)
|
||||
|
||||
用我个人的最爱来开篇,[Code::Blocks][2]是一款简单快速的专有C/C++ IDE。就像任何一款强大的IDE一样, 它集成了语法高亮、书签功能、自动补全功能、项目管理和一个调试器。它闪耀的地方在于它简单的插件系统,里面添加了不可缺少的工具,像Valgrind和CppCheck,还有不太重要的比如像俄罗斯方块这样的小游戏。但是我特别喜欢它的理由是它连贯方便的快捷键设定和大量的却感受不到受压迫的选项设置。
|
||||
|
||||
### 2. Eclipse ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7522/16276001255_66235a0a69_c.jpg)
|
||||
|
||||
我知道我只说"真正好用的IDE"而不是带着插件的文本编辑器,但是,[Eclipse][3]的确是一款"真正好用的IDE",只是Eclipse需要一些[plugin][4](或经过一些改装)来编写C程序,所以严格来说我无法反驳我自己。而且,做一份IDE清单不提到Eclipse这个“巨人”是不可能的事情。无论喜欢它与否,Eclipse仍然是一款强大的Java编程工具。这里要感谢[CDT 项目][5],让Eclipse编写C程序变得可能。你同样可以体验到Eclipse的强大功能包括它的一些传统功能特点比如自动补全、代码大纲、代码生成器和先进的重构功能。照我话说,它的不足之处在于它不如Code::Blocks那么轻量级,它仍然很臃肿,要花费很多时间去载入。但是如果你的电脑可以驾驭它,或者你是个忠实的Eclipse粉,那么它一定是你的不二选择。
|
||||
|
||||
### 3. Geany ###
|
||||
|
||||
![](https://farm9.staticflickr.com/8573/16088461968_c6a6c9e49a_c.jpg)
|
||||
|
||||
牺牲了很多特色功能但是增加了很多灵活性,[Geany][6]就是这样一款与Eclipse对立的软件。但是对于它所缺乏的地方(比如说没有调试器), Geany用一些漂亮小巧的特色功能弥补了它们:一个可以做笔记的区域、基于模板创作、代码大纲、自定义快捷键和插件管理。相比于现在的IDE,Geany仍然是一款作用广泛的文本编辑器,然而,因为它的功能亮点和它的界面设计,所以我把它放在这份列表里。
|
||||
|
||||
### 4. MonoDevelop ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7515/16275175052_61487480ce_c.jpg)
|
||||
|
||||
这又是这份列表里的一个“巨人级”工具,[MonoDevelop][7]那无与伦比的体验来源于它的外表和界面。我个人非常喜爱它的项目管理体系和它的一体化版本控制系统。插件系统同样漂亮地让人震惊。但是由于一些原因,所有的设置和对所有编程语言的支持对于我来说让我感觉有点“资源过剩”了。它仍然是我在过去经常使用的伟大工具,但不是我在单单处理C语言时的第一选择。
|
||||
|
||||
### 5. Anjuta ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7514/16088462018_7ee6e5b433_c.jpg)
|
||||
|
||||
它身上有着强烈的“GNOME感”,[Anjuta][8]的外观很具争议。我倾向于把它看作是带着调试器的Geany升级版,但是它的界面实际上要复杂得多。我确实很享受能在项目、文件夹和代码大纲视图之间来回切换的标签系统,我本想用诸如更多的快捷方法来移动文件,然而,这是一个很好的提供了显著编译功能和构建选项的工具,它能够支持哪些很有特点的需求。
|
||||
|
||||
### 6. Komodo Edit ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7502/16088462028_81d1114c84_c.jpg)
|
||||
|
||||
我不是非常熟悉[Komodo Edit][9],但是在试用了一段时间之后,我被它很多很多的优点给惊喜到了。首先,基于标签的导航功能很有很强的可预见性。其次它奇特的代码大纲让我想到了Sublime Text。此外,它的宏系统和文件比较器使得Komodo Edit非常实用。它的插件库让它几乎是完美的,说“几乎”是因为在其它IDE里我的确找不到能与之相媲美的快捷方法了。而且我们能享受到更多特别的C/C++工具,这往往是普通IDE的不足之处。然而,Komodo Edit就能做到。
|
||||
|
||||
### 7. NetBeans ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7569/16089881229_98beb0fce3_c.jpg)
|
||||
|
||||
就好像Eclipse一样,这又是一款不得不提的“巨人级”软件。拥有的功能包括通过标签进行导航、项目管理、代码大纲、更改历史追踪和大量工具,[NetBeans][10]可能是最完整的IDE了,我能用半页来列出它所有让人震惊的特色功能。但是这同时也很容易地向你透露了它的主要缺点,它太臃肿了。比起它的强大,我更喜欢基于插件的软件因为我觉得不太会有人为了一个同样的项目同时需要Git和Mercurial相结合来工作,我是不是很疯狂。但是如果你有耐心去掌握它所有的选项,那你差不多无论到哪里都是IDE大师了。
|
||||
|
||||
### 8. KDevelop ###
|
||||
|
||||
![](https://farm8.staticflickr.com/7519/15653583824_e412f2ab1f_c.jpg)
|
||||
|
||||
说到这,肯定照顾到所有的KDE粉丝,[KDevelop][11]会是你希望的答案。它拥有许多配置选项,如果你设法去征服KDevelop,那它就是你的。你们说我肤浅,但是我真的从来没有深入过除它界面以外的层次了,对于我来说编辑器本身就携带着大量的导航选项和可定制的快捷键简直是一个再糟糕不过的事了。它的调试器也是相当高级,要去练习掌握。然而,这样的耐心是有回报的,就是能领会到这款灵活的IDE的全部能力,并且由于它令人吃惊的嵌入式文件编制,你会给予它一种特殊的信任。
|
||||
|
||||
### 9. CodeLite ###
|
||||
|
||||
![](https://farm9.staticflickr.com/8594/16250066446_b5f654e63f_c.jpg)
|
||||
|
||||
留在最后的不代表是最差的,[CodeLite][12]展现给你一种传统的编程规则却仍然能让你从它身上那特有的感觉上有所收获,即使它的界面一开始的确让我想到了Code::Blocks和Anjuta,只是不包括大量的插件库。无论你想要比较文件、插入一条版权块、定义缩略语或者用Git来工作,总有一款插件适合你。如果我不得不挑点毛病,我想说它缺乏一些符合我口味的导航快捷键,但这是真的。
|
||||
|
||||
最后,我希望这份清单能让你给自己最喜欢的语言探索到更多新的IDE。虽然Code::Blocks仍然是我的最爱,不过它有一些很强大的对手。当然我们也可以远离Linux上的IDE用文本编辑器去编写C/C++代码。所以如果你有什么其它的建议想法,在评论中让我们获悉。或者如果你想要我再说说关于一些其它语言的IDE,也可以评论里提出。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/good-ide-for-c-cpp-linux.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[ZTinoZ](https://github.com/ZTinoZ)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/adrien
|
||||
[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html
|
||||
[2]:http://www.codeblocks.org/
|
||||
[3]:https://eclipse.org/
|
||||
[4]:http://xmodulo.com/how-to-set-up-c-cpp-development-environment-in-eclipse.html
|
||||
[5]:https://eclipse.org/cdt/
|
||||
[6]:http://www.geany.org/
|
||||
[7]:http://www.monodevelop.com/
|
||||
[8]:http://anjuta.org/
|
||||
[9]:http://komodoide.com/komodo-edit/
|
||||
[10]:https://netbeans.org/
|
||||
[11]:https://www.kdevelop.org/
|
||||
[12]:http://codelite.org/
|
129
translated/share/20150126 CD Audio Grabbers--Graphical Based.md
Normal file
129
translated/share/20150126 CD Audio Grabbers--Graphical Based.md
Normal file
@ -0,0 +1,129 @@
|
||||
|
||||
CD音频抓取器——基于图形界面
|
||||
================================================================================
|
||||
CD音频抓取器是为了从光盘中提取(“剖出”)原始数字音频(它在一个通常被称为CDDA的格式中)并把它保存成文件或以其他形式输出而设计的。这类软件使用户能把数字音频编码成各种格式,并能下载和上传在线CD目录服务——一个在线的光盘数据库——中的光盘信息。
|
||||
|
||||
复制CD合法吗?在美国版权法中,把一个原始CD转换成数字文件用于个人使用在被引用时等同于‘合理使用’。然而,美国版权法并没有明确的允许或禁止拷贝私人音频CD,而且判例法还没有确立出在具体的哪种情况下可以视为合理使用。在英国版权的位置更清晰一些。从2014年开始,英国公民制造CD,MP3,DVD,蓝光和电子书的行为成为合法行为。这仅适用于这个人拥有被采集的媒体的实体,并且复制品仅用于他们个人使用。对于欧盟的其他国家,成员国可以允许私人复制这种特例。
|
||||
|
||||
如果你不确定在你生活的国家里版权处于什么位置,在你使用这两页文章中所列举的软件前请查询本地的版权法以确定你处在合法的一边。
|
||||
|
||||
在某种程度上,提取CD音轨看起来有点多余。如Spotify和Google Play Music这类流服务提供了一个巨大的以通用格式存在的音乐的库,无需采集你的CD集。但是,如果你已将收藏了一个数量巨大的CD集。能把你的CD转换成可以在便携设备如智能手机、平板和便携式MP3播放器上播放的格式仍然是个诱人的选择。
|
||||
|
||||
这两页文章推荐了我最喜欢的音频CD抓取器。我挑了四个最好的图形界面的音频抓取器,四个最好的控制台音频抓取器。所有这些应用程序都是在开源许可下发行的。
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/freac.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-freac.png)
|
||||
|
||||
fre:ac是个开源音频转换器和CD提取器,支持很多种流行格式和编码器。目前这个应用可以在MA3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式间转换。这来源于几种不同形式的LAME编码器。
|
||||
|
||||
#### 功能包括: ####
|
||||
|
||||
- 易学易用
|
||||
- MP3、MP4/M4A、WMA、Ogg Vorbis、FLAC、AAC、WAV和Bonk格式转换器
|
||||
- 集成了CDDB/freedb标题数据库支持的CD提取器
|
||||
- 多核优化的编码器加速了现代PC上的转换速度
|
||||
- 对于标签和文件名称的全Unicode支持
|
||||
- 易学易用,当你需要时还提供专家级选项
|
||||
- 任务列表
|
||||
- 可以使用Winamp 2加入附件
|
||||
- 多语言用户界面可以使用41种语言
|
||||
|
||||
- 网址: [freac.org][1]
|
||||
- 开发人员:Robert Kausch
|
||||
- 许可证: GNU GPL v2
|
||||
- 版本号: 20141005
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/Audex.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Audex.png)
|
||||
|
||||
Audex是个简单易用的开源音频CD提取应用。虽然它还处于早期开发阶段,这个KDE桌面工具足够稳定、聪明和简单,可以使用。
|
||||
|
||||
助手可以给LAME、OGG Vorbis(oggenc)、FLAC、FAAC(AAC/MP4)和RIFF WAVE创建配置文件。除去这个助手,你可以定义你自己的配置文件,这意味着,Audex适用于大部分的命令行编码器。
|
||||
|
||||
#### 功能包括: ####
|
||||
|
||||
- 可提取CDDA Paranoia
|
||||
- 提取和编码同时进行
|
||||
- 文件名采用本地和远程CDDB/FreeDB数据库
|
||||
- 提供新的CDDB/FreeDB数据库入口
|
||||
- 类似capitalize的元数据纠正工具
|
||||
- 多配置文件提取(每个配置文件文件有一个命令行编码器)
|
||||
- 从互联网上抓取封面并将他们存在数据库中
|
||||
- 在目标目录中创建播放列表、封面和基于模板的信息文件
|
||||
- 创建提取和编码协议
|
||||
- 将文件传送到FTP服务器
|
||||
- 支持国际化
|
||||
|
||||
- 网址: [kde.maniatek.com/audex][2]
|
||||
- 开发人员: Marco Nelles
|
||||
- 许可证: GNU GPL v3
|
||||
- 版本号: 0.79
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/SoundJuicer.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-SoundJuicer.png)
|
||||
|
||||
Sound Juicer是个使用GTK+和GStreamer的轻量级CD提取器。它从CD中提取音频并把它转换成音频文件。Sound Juicer还可以直接播放CD中的音轨,在提取前提供预览。
|
||||
|
||||
由于GStreamer插件它支持任何音频编码,包括 MP3、Ogg Vorbis、FLAC和未压缩的PCM格式。
|
||||
|
||||
它是GNOME桌面环境已建成的一部分。
|
||||
|
||||
#### 功能包括: ####
|
||||
|
||||
- 自动通过CDDB给音轨加标签
|
||||
- 可编码成ogg/vorbis、FLAC和原始WAV
|
||||
- 编码路径的设置很简单
|
||||
- 多种流派
|
||||
- 国际化支持
|
||||
|
||||
- 网址:[burtonini.com][3]
|
||||
- 开发人员: Ross Burton
|
||||
- 许可证:GNU GPL v2
|
||||
- 版本号:3.14
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content2/png/ripperX.png)
|
||||
|
||||
![](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-ripperX.png)
|
||||
|
||||
ripperX是个开源的图形交互界面,用于提取CD音轨并把他们编码成Ogg、MP2、MP3或FLAC格式。它的目的是容易使用,只需要点几下鼠标就能转换整张专辑。它支持在CDDB寻找专辑和音轨信息。
|
||||
|
||||
他使用cdparanoia把CD音轨转换(也就是“提取”)成WAV文件,然后访问Vorbis/Ogg编码器oggenc把WAV文件转换成OGG文件。它还可以访问flac让WAV文件有无损压缩的表现,制成FLAC文件。
|
||||
|
||||
#### 功能包括: ####
|
||||
|
||||
- 非常简单易用
|
||||
- 可以把CD音轨提取成WAV、MP3、OGG或FLAC文件
|
||||
- 支持CDDB查找
|
||||
- 支持ID3v2标签
|
||||
- 可暂停提取进程
|
||||
|
||||
- 网址:[sourceforge.net/projects/ripperx][4]
|
||||
- 开发人员:Marc André Tanner
|
||||
- 许可证:MIT/X Consortium License
|
||||
- 版本号:2.8.0
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
转自:http://www.linuxlinks.com/article/20150125043738417/AudioGrabbersGraphical.html
|
||||
|
||||
作者:Frazer Kline
|
||||
译者:[H-mudcup](https://github.com/H-mudcup)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.freac.org/
|
||||
[2]:http://kde.maniatek.com/audex/
|
||||
[3]:http://burtonini.com/blog/computers/sound-juicer
|
||||
[4]:http://sourceforge.net/projects/ripperx/
|
@ -0,0 +1,43 @@
|
||||
既然float不能表示所有的int,那为什么在类型转换时C++将int转换成float?
|
||||
---------
|
||||
|
||||
#问题:
|
||||
|
||||
代码如下:
|
||||
|
||||
```C
|
||||
int i = 23;
|
||||
float f = 3.14;
|
||||
if (i == f) // 执行某段代码
|
||||
```
|
||||
|
||||
编译器会将i转换成float类型,然后比较这两个float的大小,但是float能够表示所有的int吗?为什么没有将int和float转换成double类型进行比较呢?
|
||||
|
||||
#回答:
|
||||
|
||||
在整型数的演变中,当`int`变成`unsigned`时,会丢掉负数部分(有趣的是,这样的话,`0u < -1`就是对的了)。
|
||||
|
||||
和C语言中的大部分机制(在C++中得到继承)一样,就硬件操作而言,常见的算术转换应该简明易懂。C语言的发明者精通他们所使用机器上的汇编语言,他们编写的C语言对他们和像他们一样编写程序的人有直接的意义,直到使用汇编语言编写(诸如UNIX内核)的程序时。
|
||||
|
||||
现如今,一般来说,处理器并不具有混合类型的指令系统(如float和double相加、比较int和float,诸如此类),因为如果这样做造成芯片晶圆的巨大浪费——如果你想支持更多不同的类型,你不得不实现更多的操作码。然而,在实际中,你只有实现"add int to int"、"compare float to float"和"multiply unsigned with unsigned"等功能的常见指令,这使得优先进行算术转换变得很有必要——它们是指令系统中两种类型的映射关系,它们中的大部分很有用处。
|
||||
|
||||
从习惯编写低级别机器代码的编程人员的角度来说,如果有了混合类型,那么在一般情况下最有可能使用的汇编指令就是那些只需要进行最少类型转换的指令。其中,有一种特殊情况就是浮点数的转换,特别是在20世纪70年代早期,当时C语言正在被开发,计算机运行速度很慢,而浮点数的计算是通过软件完成的,所以进行转换的成本很高。这拖慢了常用算术运算的转换开发——当时只有一种操作数实现了转换(这个例外就是long到unsigned int的转换,这种转换没有任何要求,在大部分机器上都可以进行。当然并不是全部,因为总有例外情况)。
|
||||
|
||||
所以,编写常用的算术转换是为了完成汇编程序员在大部分时间需要做的事情:即有两种不匹配的类型,将一种转换成另一种。这也就是汇编代码所做的事情,除非有特别原因需要进行其它类型转换。对于那些习惯编写汇编代码的人来说,除非是特殊需要,才会被迫去编写一种不同的类型转换。显然,这种情况下提出编写转换是很自然的事情。虽然,你可以简单地写成这样
|
||||
|
||||
```C
|
||||
if((double) i < (double) f)
|
||||
```
|
||||
|
||||
顺便提一下,在这个问题中有趣的是,`unsigned`的优先级高于`int`,所以把`int`和`unsigned`进行比较时,最终进行的是unsigned类型的比较(开头提到的`0u < -1`就是这个道理)。我猜测这可能是在早些时候(计算机发展初期),当时的人们认为`unsigned`比`int`在所表示的数值范围上受到的限制更小:现在还不需要符号位,所以可以使用额外的位来表示更大的数值范围。如果你觉得`int`可能会溢出,那么就使用unsigned好了——在使用16位表示的ints时这个担心会更明显。
|
||||
|
||||
----
|
||||
via:[stackoverflow](http://stackoverflow.com/questions/28010565/why-does-c-promote-an-int-to-a-float-when-a-float-cannot-represent-all-int-val/28011249#28011249)
|
||||
|
||||
作者:[wintermute][a]
|
||||
译者:[KayGuoWhu](https://github.com/KayGuoWhu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://stackoverflow.com/users/4301306/wintermute
|
@ -0,0 +1,82 @@
|
||||
9款最好的Javacript用户的IDE和代码编辑器。
|
||||
================================================================================
|
||||
网络应用设计和开发是最近一段时间的发展趋势,也有越来越多的人开始在此寻找他们的职业机会。但是,作为网络开发人员或图形设计人员来说,一个好的机会并不是每个人都能够轻易获得到的,它需要很好的思维展现,以及对于工作的熟练技巧。现在有许多可用的网站来根据你的知识帮助你找到正确的工作描述。但是如果你想要在这个领域有所成就,你仍然需要具有一些出色的手段,例如可以在不同的平台、IDE以及其他的工具上开展工作。
|
||||
|
||||
说到根据不同目的所使用的大量语言用到的不同平台以及IDE,只靠学习一个IDE来容易地获取项目设计的最佳方案的惯例已经属于过去时了。今天我们活在一个竞争日益激烈的现代生活节奏中,对于IDE们也是相同的处境,IDE是一个用来创建和部署应用的强大的客户端应用。今天我们打算为网络设计者和开发人员分享一些最好的Javacript IDE。
|
||||
|
||||
请访问作为javascript 用户最好的代码编辑器列表,并将你的想法与我们一起分享。
|
||||
|
||||
### 1) [Spket][1] ###
|
||||
|
||||
**Spket IDE** 是JavaScript和XML开发的强大工具包。该编辑器可以用来进行开发 JavaScript,XUL/XBL 和Yahoo!小组件。 JavaScript编辑器提供了例如代码补全,语法高亮以及代码内容大纲等特性,可以帮助开发者提高创建高效JavaScript代码的生产率。
|
||||
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/spket-e1422674329554.png)
|
||||
|
||||
### 2) [Ixedit][2] ###
|
||||
|
||||
IxEdit 基于Javascript交互的网络设计工具。通过IxEdit,设计者可以在不需要通过代码改变,添加,删除或变换页面元素的情况下,在网页上进行动态进行DOM脚本编写。
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ixedit.png)
|
||||
|
||||
### 3) [Komodo Edit][3] ###
|
||||
|
||||
Komodo是一款免费而强大的编辑器,可以用来编辑JavaScript和其他的编程语言。
|
||||
![](http://i2.wp.com/devzum.com/wp-content/uploads/2015/01/komodo-edit-e1422674596277.png)
|
||||
|
||||
### 4) [EpicEditor][4] ###
|
||||
|
||||
EpicEditor是一个可嵌入的 JavaScript Markdown编辑器,具有分割全屏进行编辑,实时预览,自动草稿保存,离线支持等特性。对于开发人员,它提供了健壮的API,可以容易地设置主题,并允许你以任何其他的事物来替换绑定的Markdown解析器。
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/epiceditor-e1422674732281.png)
|
||||
|
||||
### 5) [codepress][5] ###
|
||||
|
||||
CodePress是一个用JavaScript编写的基于网络的源代码编辑器,具有语法高亮,并且是在你将代码输入到浏览器后实时进行文本颜色渲染。
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/codepres-e1422674893706.png)
|
||||
|
||||
### 6) [ACe][6] ###
|
||||
|
||||
Ace 是一个使用JavaScript编写的嵌入式代码编辑器,它能够匹配宿主编辑器的特性和性能,例如Sublime,Vim和Textate。它能够容易地嵌入到任何的网页和JavaScript应用中。
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/ace-e1422675089912.png)
|
||||
|
||||
### 7) [scripted][7] ###
|
||||
|
||||
Scripted是一个快速的轻量级代码编辑器,最初是为了JavaScript编写实现的。 Scripted是一个基于浏览器的编辑器,而编辑器本身有本地运行的Node.js服务器实例来提供服务支持。
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/scripted-e1422675188408.png)
|
||||
|
||||
### 8) [Netbeans][8] ###
|
||||
|
||||
这是另外的一个更加震撼而且有用的编辑器,可以用来编写javascript和其他的编程语言。
|
||||
|
||||
![](http://i1.wp.com/devzum.com/wp-content/uploads/2015/01/code_editing1-e1422675506226.png)
|
||||
|
||||
### 9) [Webstorm][9] ###
|
||||
|
||||
这是最智能的JavaScript IDE。 它是为使用Node.js进行复杂的客户端开发和服务器端开发而装备的一个轻巧而强大的完美IDE。
|
||||
|
||||
![](http://i0.wp.com/devzum.com/wp-content/uploads/2015/01/webstorm.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://devzum.com/2015/01/31/9-best-ides-and-code-editors-for-javascript-users/
|
||||
|
||||
作者:[vikas][a]
|
||||
译者:[theo-l](https://github.com/theo-l)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://devzum.com/author/vikas/
|
||||
[1]:http://spket.com/
|
||||
[2]:http://www.ixedit.com/
|
||||
[3]:http://komodoide.com/komodo-edit/
|
||||
[4]:http://oscargodson.github.io/EpicEditor/
|
||||
[5]:http://codepress.sourceforge.net/
|
||||
[6]:http://ace.c9.io/#nav=about
|
||||
[7]:https://github.com/scripted-editor/scripted
|
||||
[8]:https://netbeans.org/
|
||||
[9]:http://www.jetbrains.com/webstorm/
|
@ -0,0 +1,55 @@
|
||||
Linux 常见问题解答--如何使用yum来下载RPM包而不进行安装.
|
||||
================================================================================
|
||||
> **问题**:我想从Red Hat's的标准仓库中下载一个RPM包,我能使用yum命令来下载一个RPM包但是不进行安装吗?
|
||||
|
||||
yum是基于Red Hat的系统(如CentOS,Fedora,RHEl)上的默认包管理器.使用yum,你可以安装或者更新一个RPM包,并且他会自动解决包依赖关系.但是如果你只想将一个RPM包下载到你的系统上该怎么办呢? 例如,你可能想要获取一些RPM包在以后使用,或者将他们安装在另外的机器上.
|
||||
|
||||
这里说明了如何从yum仓库上下载一个RPM包.
|
||||
|
||||
### 方法一:yum###
|
||||
|
||||
yum命令本身就可以用来下载一个RPM包,标准的yum命令提供了`--downloadonly(只下载)`的选项来达到这个目的.
|
||||
|
||||
$ sudo yum install --downloadonly <package-name>
|
||||
|
||||
默认情况下,一个下载的RPM包会保存在下面的目录中:
|
||||
|
||||
/var/cache/yum/x86_64/[centos/fedora-version]/[repository]/packages
|
||||
|
||||
以上的[repository]表示下载包的来源仓库的名称(例如,base,fedora,updates)
|
||||
|
||||
如果你想要讲一个包下载到一个指定的目录(如/tmp):
|
||||
|
||||
$ sudo yum install --downloadonly --downloaddir=/tmp <package-name>
|
||||
|
||||
注意,如果下载的包包含了任意没有满足的依赖关系,yum将会把所有的依赖关系包下载,但是都不会被安装.
|
||||
|
||||
另外一个重要的事情时,在CentOS/RHEL 6或更早期的版本中,你需要安装一个单独yum插件(名称为 yum-plugin-downloadonly)才能使用`--downloadonly`命令选项:
|
||||
|
||||
$ sudo yum install yum-plugin-downloadonly
|
||||
|
||||
如果没有该插件,你会在使用yum时得到以下错误:
|
||||
|
||||
Command line error: no such option: --downloadonly
|
||||
|
||||
![](https://farm9.staticflickr.com/8627/15571201803_38390aae75_c.jpg)
|
||||
|
||||
### 方法二: Yumdownloader###
|
||||
另外一个下载RPM包的方法就是通过一个专门的包下载工具--yumdownloader. 这个工具时yum工具包(包含了用来进行yum包管理的帮助工具套件)的子集.
|
||||
|
||||
$ sudo yum install yum-utils
|
||||
|
||||
下载一个RPM包:
|
||||
|
||||
$ sudo yumdownloader <package-name>
|
||||
|
||||
下载的包会被保存在当前目录中.你需要使用root权限,因为yumdownloader会在下载过程中更新包索引文件.与yum命令不同的是,任何依赖包不会被下载.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/yum-download-rpm-package.html
|
||||
|
||||
译者:[theo-l](https://github.com/theo-l)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,443 @@
|
||||
领略一些最著名的 Linux 网络工具
|
||||
================================================================================
|
||||
在你的系统上使用命令行工具来监控你的网络是非常实用的,并且对于 Linux 用户来说,有着许许多多现成的工具可以使用,如 nethogs, ntopng, nload, iftop, iptraf, bmon, slurm, tcptrack, cbm, netwatch, collectl, trafshow, cacti, etherape, ipband, jnettop, netspeed 以及 speedometer。
|
||||
|
||||
鉴于世上有着许多的 Linux 专家和开发者,显然还存在其他的网络监控工具,但在这篇教程中,我不打算将它们所有包括在内。
|
||||
|
||||
上面列出的工具都有着自己的独特之处,但归根结底,它们都做着监控网络流量的工作,且并不是只有一种方法来完成这件事。例如 nethogs 可以被用来展示每个进程的带宽使用情况,以防你想知道究竟是哪个应用在消耗了你的整个网络资源; iftop 可以被用来展示每个套接字连接的带宽使用情况,而 像 nload 这类的工具可以帮助你得到有关整个带宽的信息。
|
||||
|
||||
### 1) nethogs ###
|
||||
|
||||
nethogs 是一个免费的工具,当要查找哪个 PID (注:即 process identifier,进程 ID) 给你的网络流量带来了麻烦时,它是非常方便的。它按每个进程来组织带宽,而不是像大多数的工具那样按照每个协议或每个子网来划分流量。它功能丰富,同时支持 IPv4 和 IPv6,并且我认为,若你想在你的 Linux 主机上确定哪个程序正消耗着你的全部带宽,它是来做这件事的最佳的程序。
|
||||
|
||||
一个 Linux 用户可以使用 **nethogs** 来显示每个进程的 TCP 下载和上传速率,使用命令 **nethogs eth0** 来监控一个特定的设备,上面的 eth0 是那个你想获取信息的设备的名称,你还可以得到有关正在被传输的数据的传输速率的信息。
|
||||
|
||||
对我而言, nethogs 是非常容易使用的,或许是因为我非常喜欢它以至于我总是在我的 Ubuntu 12.04 LTS 机器中使用它来监控我的网络带宽。
|
||||
|
||||
例如要想使用混杂模式来嗅探,可以像下面展示的命令那样使用选项 -p:
|
||||
|
||||
nethogs -p wlan0
|
||||
|
||||
假如你想更多地了解 nethogs 并深入探索它,那么请毫不犹豫地阅读我们做的关于这个网络带宽监控工具的整个教程。
|
||||
|
||||
### 2) nload ###
|
||||
|
||||
nload 是一个控制台应用,可以被用来实时地监控网络流量和带宽使用情况,它还通过提供两个简单易懂的图表来对流量进行可视化。这个绝妙的网络监控工具还可以在监控过程中切换被监控的设备,而这可以通过按左右箭头来完成。
|
||||
|
||||
![network monitoring tools in linux](http://blog.linoxide.com/wp-content/uploads/2015/01/nload8.png)
|
||||
|
||||
正如你在上面的截图中所看到的那样,由 nload 提供的图表是非常容易理解的。nload 提供了有用的信息,也展示了诸如被传输数据的总量和最小/最大网络速率等信息。
|
||||
|
||||
而更酷的是你可以在下面的命令的帮助下运行 nload 这个工具,这个命令是非常的短小且易记的:
|
||||
|
||||
nload
|
||||
|
||||
我很确信的是:我们关于如何使用 nload 的详细教程将帮助到新的 Linux 用户,甚至可以帮助那些正寻找关于 nload 信息的老手。
|
||||
|
||||
### 3) slurm ###
|
||||
|
||||
slurm 是另一个 Linux 网络负载监控工具,它以一个不错的 ASCII 图来显示结果,它还支持许多键值用以交互,例如 **c** 用来切换到经典模式, **s** 切换到分图模式, **r** 用来重绘屏幕, **L** 用来启用 TX/RX(注:TX,发送流量;RX,接收流量) LED,**m** 用来在经典分图模式和大图模式之间进行切换, **q** 退出 slurm。
|
||||
|
||||
![linux network load monitoring tools](http://blog.linoxide.com/wp-content/uploads/2013/12/slurm2.png)
|
||||
|
||||
在网络负载监控工具 slurm 中,还有许多其它的键值可用,你可以很容易地使用下面的命令在 man 手册中学习它们。
|
||||
|
||||
man slurm
|
||||
|
||||
slurm 在 Ubuntu 和 Debian 的官方软件仓库中可以找到,所以使用这些发行版本的用户可以像下面展示的那样,使用 apt-get 安装命令来轻松地下载它:
|
||||
|
||||
sudo apt-get install slurm
|
||||
|
||||
我们已经在一个教程中对 slurm 的使用做了介绍,所以请访问相关网页( 注:应该指的是[这篇文章](http://linoxide.com/ubuntu-how-to/monitor-network-load-slurm-tool/) ),并不要忘记和其它使用 Linux 的朋友分享这些知识。
|
||||
|
||||
### 4) iftop ###
|
||||
|
||||
当你想在一个接口上按照主机来展示带宽使用情况时,iftop 是一个非常有用的工具。根据 man 手册,**iftop** 在一个已命名的接口或在它可以找到的第一个接口(假如没有任何特殊情况,它就像一个外部的接口)上监听网络流量,并且展示出一个表格来显示当前一对主机间的带宽使用情况。
|
||||
|
||||
通过在虚拟终端中使用下面的命令,Ubuntu 和 Debian 用户可以在他们的机器中轻易地安装 iftop:
|
||||
|
||||
sudo apt-get install iftop
|
||||
|
||||
在你的机器上,可以使用下面的命令通过 yum 来安装 iftop:
|
||||
|
||||
yum -y install iftop
|
||||
|
||||
### 5) collectl ###
|
||||
|
||||
collectl 可以被用来收集描述当前系统状态的数据,并且它支持如下两种模式:
|
||||
|
||||
- 记录模式
|
||||
- 回放模式
|
||||
|
||||
**记录模式** 允许从一个正在运行的系统中读取数据,然后将这些数据要么显示在终端中,要么写入一个或多个文件或套接字中。
|
||||
|
||||
**回放模式**
|
||||
|
||||
根据 man 手册,在这种模式下,数据从一个或多个由记录模式生成的数据文件中读取。
|
||||
|
||||
Ubuntu 和 Debian 用户可以在他们的机器上使用他们默认的包管理器来安装 colletcl。下面的命令将为他们做这个工作:
|
||||
|
||||
sudo apt-get install collectl
|
||||
|
||||
还可以使用下面的命令来安装 collectl, 因为对于这些发行版本(注:这里指的是用 yum 作为包管理器的发行版本),在它们官方的软件仓库中也含有 collectl:
|
||||
|
||||
yum install collectl
|
||||
|
||||
### 6) Netstat ###
|
||||
|
||||
Netstat 是一个用来监控**传入和传出的网络数据包统计数据**和接口统计数据的命令行工具。它为传输控制协议 TCP (包括上传和下行),路由表,及一系列的网络接口(网络接口控制器或者软件定义的网络接口) 和网络协议统计数据展示网络连接情况。
|
||||
|
||||
Ubuntu 和 Debian 用户可以在他们的机器上使用默认的包管理器来安装 netstat。Netsta 软件被包括在 net-tools 软件包中,并可以在 shell 或虚拟终端中运行下面的命令来安装它:
|
||||
|
||||
sudo apt-get install net-tools
|
||||
|
||||
CentOS, Fedora, RHEL 用户可以在他们的机器上使用默认的包管理器来安装 netstat。Netstat 软件被包括在 net-tools 软件包中,并可以在 shell 或虚拟终端中运行下面的命令来安装它:
|
||||
|
||||
yum install net-tools
|
||||
|
||||
运行下面的命令使用 Netstat 来轻松地监控网络数据包统计数据:
|
||||
|
||||
netstat
|
||||
|
||||
![Netstat](http://blog.linoxide.com/wp-content/uploads/2015/02/netstat.png)
|
||||
|
||||
更多的关于 netstat 的信息,我们可以简单地在 shell 或终端中键入 man netstat 来了解:
|
||||
|
||||
man netstat
|
||||
|
||||
![man netstat](http://blog.linoxide.com/wp-content/uploads/2015/02/man-netstat.png)
|
||||
|
||||
### 7) Netload ###
|
||||
|
||||
netload 命令只展示一个关于当前网络荷载和自从程序运行之后传输数据总的字节数目的简要报告,它没有更多的功能。它是 netdiag 软件的一部分。
|
||||
|
||||
我们可以在 fedora 中使用 yum 来安装 Netload,因为它在 fedora 的默认软件仓库中。但假如你运行的是 CentOS 或 RHEL,则我们需要安装 [rpmforge 软件仓库][1]。
|
||||
|
||||
# yum install netdiag
|
||||
|
||||
Netload 在默认仓库中作为 netdiag 的一部分可以被找到,我们可以轻易地使用下面的命令来利用 **apt** 包管理器安装 **netdiag**:
|
||||
|
||||
$ sudo apt-get install netdiag (注:这里原文为 sudo install netdiag,应该加上 apt-get)
|
||||
|
||||
为了运行 netload,我们需要确保选择了一个正在工作的网络接口的名称,如 eth0, eh1, wlan0, mon0等,然后在 shell 或虚拟终端中运行下面的命令:
|
||||
|
||||
$ netload wlan2
|
||||
|
||||
注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。
|
||||
|
||||
### 8) Nagios ###
|
||||
|
||||
Nagios 是一个领先且功能强大的开源监控系统,它使得网络或系统管理员在服务器相关的问题影响到服务器的主要事务之前,鉴定并解决这些问题。 有了 Nagios 系统,管理员便可以在一个单一的窗口中监控远程的 Linux 、Windows 系统、交换机、路由器和打印机等。它显示出重要的警告并指示出在你的网络或服务器中是否出现某些故障,这间接地帮助你在问题发生之前,着手执行补救行动。
|
||||
|
||||
Nagios 有一个 web 界面,其中有一个图形化的活动监视器。通过浏览网页 http://localhost/nagios/ 或 http://localhost/nagios3/ 便可以登录到这个 web 界面。假如你在远程的机器上进行操作,请使用你的 IP 地址来替换 localhost,然后键入用户名和密码,我们便会看到如下图所展示的信息:
|
||||
|
||||
![在 Chromium 浏览器中的 Nagios3](http://blog.linoxide.com/wp-content/uploads/2015/02/nagios3-ubuntu.png)
|
||||
|
||||
### 9) EtherApe ###
|
||||
|
||||
EtherApe 是一个针对 Unix 的图形化网络监控工具,它仿照了 etherman 软件。它具有链路层,IP 和 TCP 模式并支持 Ethernet, FDDI, Token Ring, ISDN, PPP, SLIP 及 WLAN 设备等接口,再加上支持一些封装的格式。主机和链接随着流量大小和被着色的协议名称展示而变化。它可以过滤要展示的流量,并可从一个文件或运行的网络中读取数据报。
|
||||
|
||||
在 CentOS、Fedora、RHEL 等 Linux 发行版本中安装 etherape 是一件容易的事,因为在它们的官方软件仓库中就可以找到 etherape。我们可以像下面展示的命令那样使用 yum 包管理器来安装它:
|
||||
|
||||
yum install etherape
|
||||
|
||||
我们可以使用下面的命令在 Ubuntu、Debian 及它们的衍生发行版本中使用 **apt** 包管理器来安装 EtherApe :
|
||||
|
||||
sudo apt-get install etherape
|
||||
|
||||
在 EtherApe 安装到你的系统之后,我们需要像下面那样以 root 权限来运行 etherape:
|
||||
|
||||
sudo etherape
|
||||
|
||||
然后, **etherape** 的 **图形用户界面** 便会被执行。接着,在菜单上面的 **捕捉** 选项下,我们可以选择 **模式**(IP,链路层,TCP) 和 **接口**。一切设定完毕后,我们需要点击 **开始** 按钮。接着我们便会看到类似下面截图的东西:
|
||||
|
||||
![EtherApe](http://blog.linoxide.com/wp-content/uploads/2015/02/etherape.png)
|
||||
|
||||
### 10) tcpflow ###
|
||||
|
||||
tcpflow 是一个命令行工具,它可以捕捉作为 TCP 连接(流)的一部分的传输数据,并以一种方便协议分析或除错的方式来存储数据。它重建了实际的数据流并将每个流存储在不同的文件中,以备日后的分析。它理解 TCP 序列号并可以正确地重建数据流,不管是在重发或乱序发送状态下。
|
||||
|
||||
通过 **apt** 包管理器在 Ubuntu 、Debian 系统中安装 tcpflow 是很容易的,因为默认情况下在官方软件仓库中可以找到它。
|
||||
|
||||
$ sudo apt-get install tcpflow
|
||||
|
||||
我们可以使用下面的命令通过 **yum** 包管理器在 Fedora 、CentOS 、RHEL 及它们的衍生发行版本中安装 tcpflow:
|
||||
|
||||
# yum install tcpflow
|
||||
|
||||
假如在软件仓库中没有找到它或不能通过 yum 包管理器来安装它,则我们需要像下面展示的那样从 **http://pkgs.repoforge.org/tcpflow/** 上手动安装它:
|
||||
|
||||
假如你运行 64 位的 PC:
|
||||
|
||||
# yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.x86_64.rpm
|
||||
|
||||
假如你运行 32 位的 PC:
|
||||
|
||||
# yum install --nogpgcheck http://pkgs.repoforge.org/tcpflow/tcpflow-0.21-1.2.el6.rf.i686.rpm
|
||||
|
||||
我们可以使用 tcpflow 来捕捉全部或部分 tcp 流量并以一种简单的方式把它们写到一个可读文件中。下面的命令执行着我们想要做的事情,但我们需要在一个空目录中运行下面的命令,因为它将创建诸如 x.x.x.x.y-a.a.a.a.z 格式的文件,做完这些之后,只需按 Ctrl-C 便可停止这个命令。
|
||||
|
||||
$ sudo tcpflow -i eth0 port 8000
|
||||
|
||||
注意:请将上面的 eth0 替换为你想捕捉的网卡接口名称。
|
||||
|
||||
### 11) IPTraf ###
|
||||
|
||||
[IPTraf][2] 是一个针对 Linux 平台的基于控制台的网络统计应用。它生成一系列的图形,如 TCP 连接包和字节的数目、接口信息和活动指示器、 TCP/UDP 流量故障以及 LAN 状态包和字节的数目。
|
||||
|
||||
在默认的软件仓库中可以找到 IPTraf,所以我们可以使用下面的命令通过 **apt** 包管理器轻松地安装 IPTraf:
|
||||
|
||||
$ sudo apt-get install iptraf
|
||||
|
||||
在默认的软件仓库中可以找到 IPTraf,所以我们可以使用下面的命令通过 **yum** 包管理器轻松地安装 IPTraf:
|
||||
|
||||
# yum install iptraf
|
||||
|
||||
我们需要以管理员权限来运行 IPTraf(注:这里原文写错为 TPTraf),并带有一个可用的网络接口名。这里,我们的网络接口名为 wlan2,所以我们使用 wlan2 来作为接口的名称:
|
||||
|
||||
$ sudo iptraf wlan2 (注:这里原文为 sudo iptraf,应该加上 wlan2)
|
||||
|
||||
![IPTraf](http://blog.linoxide.com/wp-content/uploads/2015/02/iptraf.png)
|
||||
|
||||
开始一般的网络接口统计,键入:
|
||||
|
||||
# iptraf -g
|
||||
|
||||
为了在一个名为 eth0 的接口设备上看详细的统计信息,使用:
|
||||
|
||||
# iptraf -d wlan2 (注:这里的 wlan2 和 上面的 eth0 不一致,下面的几句也是这种情况,请相应地改正)
|
||||
|
||||
为了看一个名为 eth0 的接口的 TCP 和 UDP 监控,使用:
|
||||
|
||||
# iptraf -z wlan2
|
||||
|
||||
为了展示在一个名为 eth0 的接口上的包的大小和数目,使用:
|
||||
|
||||
# iptraf -z wlan2
|
||||
|
||||
注意:请将上面的 wlan2 替换为你的接口名称。你可以通过运行`ip link show`命令来检查你的接口。
|
||||
|
||||
### 12) Speedometer ###
|
||||
|
||||
Speedometer 是一个小巧且简单的工具,它只绘出一幅包含有通过某个给定端口的上行、下行流量的好看的图。
|
||||
|
||||
在默认的软件仓库中可以找到 Speedometer ,所以我们可以使用下面的命令通过 **yum** 包管理器轻松地安装 Speedometer:
|
||||
|
||||
# yum install speedometer
|
||||
|
||||
在默认的软件仓库中可以找到 Speedometer ,所以我们可以使用下面的命令通过 **apt** 包管理器轻松地安装 Speedometer:
|
||||
|
||||
$ sudo apt-get install speedometer
|
||||
|
||||
Speedometer 可以简单地通过在 shell 或虚拟终端中执行下面的命令来运行:
|
||||
|
||||
$ speedometer -r wlan2 -t wlan2
|
||||
|
||||
![Speedometer](http://blog.linoxide.com/wp-content/uploads/2015/02/Speedometer.png)
|
||||
|
||||
注:请将上面的 wlan2 替换为你想要使用的网络接口名称。
|
||||
|
||||
### 13) Netwatch ###
|
||||
|
||||
Netwatch 是 netdiag 工具集里的一部分,并且它也显示出当前主机和其他远程主机的连接情况,以及在每个连接中数据传输的速率。
|
||||
|
||||
我们可以使用 yum 在 fedora 中安装 Netwatch,因为它在 fedora 的默认软件仓库中。但若你运行着 CentOS 或 RHEL , 我们需要安装 [rpmforge 软件仓库][3]。
|
||||
|
||||
# yum install netwatch
|
||||
|
||||
Netwatch 作为 netdiag 的一部分可以在默认的软件仓库中找到,所以我们可以轻松地使用下面的命令来利用 **apt** 包管理器安装 **netdiag**:
|
||||
|
||||
$ sudo apt-get install netdiag(注:这里应该加上 apt-get
|
||||
|
||||
为了运行 netwatch, 我们需要在虚拟终端或 shell 中执行下面的命令:
|
||||
|
||||
$ sudo netwatch -e wlan2 -nt
|
||||
|
||||
![Netwatch](http://blog.linoxide.com/wp-content/uploads/2015/02/netwatch.png)
|
||||
|
||||
注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。
|
||||
|
||||
### 14) Trafshow ###
|
||||
|
||||
Trafshow 同 netwatch 和 pktstat(注:这里原文中多了一个 trafshow)一样,可以报告当前激活的连接里使用的协议和每个连接中数据传输的速率。它可以使用 pcap 类型的滤波器来筛选出特定的连接。
|
||||
|
||||
我们可以使用 yum 在 fedora 中安装 trafshow(注:这里原文为 Netwatch,应该为 trafshow),因为它在 fedora 的默认软件仓库中。但若你正运行着 CentOS 或 RHEL , 我们需要安装 [rpmforge 软件仓库][4]。
|
||||
|
||||
# yum install trafshow
|
||||
|
||||
Trafshow 在默认仓库中可以找到,所以我们可以轻松地使用下面的命令来利用 **apt** 包管理器安装它:
|
||||
|
||||
$ sudo apt-get install trafshow(注:原文少了 apt-get)
|
||||
|
||||
为了使用 trafshow 来执行监控任务,我们需要在虚拟终端或 shell 中执行下面的命令:
|
||||
|
||||
$ sudo trafshow -i wlan2
|
||||
|
||||
![Trafshow](http://blog.linoxide.com/wp-content/uploads/2015/02/trafshow-all.png)
|
||||
|
||||
为了特别地监控 tcp 连接,如下面一样添加上 tcp 参数:
|
||||
|
||||
$ sudo trafshow -i wlan2 tcp
|
||||
|
||||
![Trafshow tcp](http://blog.linoxide.com/wp-content/uploads/2015/02/trafshow-tcp.png)
|
||||
|
||||
注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。
|
||||
|
||||
### 15) Vnstat ###
|
||||
|
||||
与大多数的其他工具相比,Vnstat 有一点不同。实际上它运行一个后台服务或守护进程,并时刻记录着传输数据的大小。另外,它可以被用来生成一个带有网络使用历史记录的报告。
|
||||
|
||||
我们需要开启 EPEL 软件仓库,然后运行 **yum** 包管理器来安装 vnstat。
|
||||
|
||||
# yum install vnstat
|
||||
|
||||
Vnstat 在默认软件仓库中可以找到,所以我们可以使用下面的命令运行 **apt** 包管理器来安装它:
|
||||
|
||||
$ sudo apt-get install vnstat
|
||||
|
||||
不带有任何选项运行 vnstat 将简单地展示出从该守护进程运行后数据传输的总量。
|
||||
|
||||
$ vnstat
|
||||
|
||||
![vnstat](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat.png)
|
||||
|
||||
为了实时地监控带宽使用情况,使用 ‘-l’ 选项(实时模式)。然后它将以一种非常精确的方式来展示被上行和下行数据所使用的带宽总量,但不会显示任何有关主机连接或进程的内部细节。
|
||||
|
||||
$ vnstat -l
|
||||
|
||||
![Vnstat 实时模式](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat-live.png)
|
||||
|
||||
完成了上面的步骤后,按 Ctrl-C 来停止,这将会得到如下类型的输出:
|
||||
|
||||
![Vnstat 实时结果](http://blog.linoxide.com/wp-content/uploads/2015/02/vnstat-live-result.png)
|
||||
|
||||
### 16) tcptrack ###
|
||||
|
||||
[tcptrack][5] 可以展示 TCP 连接的状态,它在一个给定的网络端口上进行监听。tcptrack 监控它们的状态并展示出一个经过排列且不断更新的有关来源/目标地址、带宽使用情况等信息的列表,这与 **top** 命令的输出非常类似 。
|
||||
|
||||
鉴于 tcptrack 在软件仓库中,我们可以轻松地在 Debian、Ubuntu 系统中从软件仓库使用 **apt** 包管理器来安装 tcptrack。为此,我们需要在 shell 或虚拟终端中执行下面的命令:
|
||||
|
||||
$ sudo apt-get install tcptrack
|
||||
|
||||
我们可以通过 yum 在 fedora 中安装它,因为它在 fedora 的默认软件仓库中。但若你运行着 CentOS 或 RHEL 系统,我们需要安装 [rpmforge 软件仓库][6]。为此,我们需要运行下面的命令:
|
||||
|
||||
# wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
|
||||
|
||||
# rpm -Uvh rpmforge-release*rpm
|
||||
|
||||
# yum install tcptrack
|
||||
|
||||
注:这里我们下载了 rpmforge-release 的当前最新版本,即 0.5.3-1,你总是可以从 rpmforge 软件仓库中下载其最新版本,并请在上面的命令中替换为你下载的版本。
|
||||
|
||||
**tcptrack** 需要以 root 权限或超级用户身份来运行。执行 tcptrack 时,我们需要带上那个我们想监视的网络接口 TCP 连接状况的接口名称。这里我们的接口名称为 wlan2,所以如下面这样使用:
|
||||
|
||||
sudo tcptrack -i wlan2
|
||||
|
||||
![tcptrack](http://blog.linoxide.com/wp-content/uploads/2015/02/tcptrack.png)
|
||||
|
||||
假如你想监控特定的端口,则使用:
|
||||
|
||||
# tcptrack -i wlan2 port 80
|
||||
|
||||
![tcptrack port 80](http://blog.linoxide.com/wp-content/uploads/2015/02/tcptrack-port-80.png)
|
||||
|
||||
请替换上面的 80 为你想要监控的端口号。注意: 请将上面的 wlan2 替换为你想使用的网络接口名称,假如你想通过扫描了解你的网络接口名称,可以在一个虚拟终端或 shell 中运行 `ip link show` 命令。
|
||||
|
||||
### 17) CBM ###
|
||||
|
||||
CBM 或 Color Bandwidth Meter 可以展示出当前所有网络设备的流量使用情况。这个程序是如此的简单,以至于应该可以从它的名称中看出其功能。CBM 的源代码和新版本可以在 [http://www.isotton.com/utils/cbm/][7] 上找到。
|
||||
|
||||
鉴于 CBM 已经包含在软件仓库中,我们可以简单地使用 **apt** 包管理器从 Debian、Ubuntu 的软件仓库中安装 CBM。为此,我们需要在一个 shell 窗口或虚拟终端中运行下面的命令:
|
||||
|
||||
$ sudo apt-get install cbm
|
||||
|
||||
我们只需使用下面展示的命令来在 shell 窗口或虚拟终端中运行 cbm:
|
||||
|
||||
$ cbm
|
||||
|
||||
![Color Bandwidth Meter](http://blog.linoxide.com/wp-content/uploads/2015/02/cbm.png)
|
||||
|
||||
### 18) bmon ###
|
||||
|
||||
[Bmon][8] 或 Bandwidth Monitoring ,是一个用于调试和实时监控带宽的工具。这个工具能够检索各种输入模块的统计数据。它提供了多种输出方式,包括一个基于 curses 库的界面,轻量级的HTML输出,以及 ASCII 输出格式。
|
||||
|
||||
bmon 可以在软件仓库中找到,所以我们可以通过使用 apt 包管理器来在 Debian、Ubuntu 中安装它。为此,我们需要在一个 shell 窗口或虚拟终端中运行下面的命令:
|
||||
|
||||
$ sudo apt-get install bmon
|
||||
|
||||
我们可以使用下面的命令来运行 bmon 以监视我们的网络状态:
|
||||
|
||||
$ bmon
|
||||
|
||||
![bmon](http://blog.linoxide.com/wp-content/uploads/2015/02/bmon.png)
|
||||
|
||||
### 19) tcpdump ###
|
||||
|
||||
[TCPDump][9] 是一个用于网络监控和数据获取的工具。它可以为我们节省很多的时间,并可用来调试网络或服务器 的相关问题。它打印出在某个网络接口上与布尔表达式匹配的数据包所包含的内容的一个描述。
|
||||
|
||||
tcpdump 可以在 Debian、Ubuntu 的默认软件仓库中找到,我们可以简单地以 sudo 权限使用 apt 包管理器来安装它。为此,我们需要在一个 shell 窗口或虚拟终端中运行下面的命令:
|
||||
|
||||
$ sudo apt -get install tcpdump
|
||||
|
||||
tcpdump 也可以在 Fedora、CentOS、RHEL 的软件仓库中找到。我们可以像下面一样通过 yum 包管理器来安装它:
|
||||
|
||||
# yum install tcpdump
|
||||
|
||||
tcpdump 需要以 root 权限或超级用户来运行,我们需要带上我们想要监控的 TCP 连接的网络接口名称来执行 tcpdump 。在这里,我们有 wlan2 这个网络接口,所以可以像下面这样使用:
|
||||
|
||||
$ sudo tcpdump -i wlan2
|
||||
|
||||
![tcpdump](http://blog.linoxide.com/wp-content/uploads/2015/02/tcpdump.png)
|
||||
|
||||
|
||||
假如你只想监视一个特定的端口,则可以运行下面的命令。下面是一个针对 80 端口(网络服务器)的例子:
|
||||
|
||||
$ sudo tcpdump -i wlan2 'port 80'
|
||||
|
||||
![tcpdump port](http://blog.linoxide.com/wp-content/uploads/2015/02/tcpdump-port.png)
|
||||
|
||||
### 20) ntopng ###
|
||||
|
||||
[ntopng][20] 是 ntop 的下一代版本。它是一个用于展示网络使用情况的网络探头,在一定程度上它与 top 针对进程所做的工作类似。ntopng 基于 libpcap 并且它以可移植的方式被重写,以达到可以在每一个 Unix 平台 、 MacOSX 以及 Win32 上运行的目的。
|
||||
|
||||
为了在 Debian,Ubuntu 系统上安装 ntopng,首先我们需要安装 **编译 ntopng 所需的依赖软件包**。你可以通过在一个 shell 窗口或一个虚拟终端中运行下面的命令来安装它们:
|
||||
|
||||
$ sudo apt-get install libpcap-dev libglib2.0-dev libgeoip-dev redis-server wget libxml2-dev build-essential checkinstall
|
||||
|
||||
现在,我们需要像下面一样针对我们的系统手动编译 ntopng :
|
||||
|
||||
$ sudo wget http://sourceforge.net/projects/ntop/files/ntopng/ntopng-1.1_6932.tgz/download
|
||||
$ sudo tar zxfv ntopng-1.1_6932.tgz
|
||||
$ sudo cd ntopng-1.1_6932
|
||||
$ sudo ./configure
|
||||
$ sudo make
|
||||
$ sudo make install
|
||||
|
||||
这样,在你的 Debian 或 Ubuntu 系统上应该已经安装上了你编译的 ntopng 。
|
||||
|
||||
我们已经有了有关 ntopng 的使用方法的[教程](linoxide.com/monitoring-2/ntopng-network-monitoring-tool/),它既可以在命令行也可以在 Web 界面中使用,我们可以前往这些教程来获得有关 ntopng 的知识。
|
||||
|
||||
### 结论 ###
|
||||
|
||||
在第一部分中(注:我认为原文多了 first 这个单词,总之是前后文的内容有些不连贯),我们介绍了一些在 Linux 下的网络负载监控工具,这对于系统管理员甚至是新手来说,都是很有帮助的。在这篇文章中介绍的每一个工具都有其特点,不同的选项等,但最终它们都可以帮助你来监控你的网络流量。
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/monitoring-2/network-monitoring-tools-linux/
|
||||
|
||||
作者:[Bobbin Zachariah][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bobbin/
|
||||
[1]:http://pkgs.org/centos-7/repoforge-x86_64/netwatch-1.0c-1.el7.rf.x86_64.rpm.html
|
||||
[2]:http://iptraf.seul.org/
|
||||
[3]:http://pkgs.org/centos-7/repoforge-x86_64/netwatch-1.0c-1.el7.rf.x86_64.rpm.html
|
||||
[4]:http://pkgs.org/centos-6/epel-x86_64/trafshow-5.2.3-6.el6.x86_64.rpm.html
|
||||
[5]:http://linux.die.net/man/1/tcptrack
|
||||
[6]:http://pkgs.org/centos-6/repoforge-x86_64/tcptrack-1.4.0-1.el6.rf.x86_64.rpm.html
|
||||
[7]:http://www.isotton.com/utils/cbm/
|
||||
[8]:https://github.com/tgraf/bmon/
|
||||
[9]:http://www.tcpdump.org/
|
||||
[10]:http://www.ntop.org/
|
@ -1,8 +1,8 @@
|
||||
How To Fix: Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs
|
||||
如何修复:apt-get update无法添加新的CD-ROM
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/elementary_OS_Freya.jpg)
|
||||
|
||||
These days I am experimenting with Elementary OS Freya and during this, I encountered a very common updater error: **Failed to fetch cdrom Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs**. The complete error looked like this after running the apt-get update command:
|
||||
这些天我正在体验Elementary OS Freya,在这期间,我遇到了一个非常常见的更新错误:**Failed to fetch cdrom Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs**。完整的错误在运行apt-get update后看上去像这样:
|
||||
|
||||
> W: Failed to fetch cdrom://elementary OS 0.3 _Freya_ – Daily amd64 (20150208)/dists/trusty/main/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
|
||||
>
|
||||
@ -10,33 +10,33 @@ These days I am experimenting with Elementary OS Freya and during this, I encoun
|
||||
>
|
||||
> E: Some index files failed to download. They have been ignored, or old ones used instead.
|
||||
|
||||
In this post, we shall see how to fix this error.
|
||||
本篇中,我们会了解如何修复这个错误。
|
||||
|
||||
### Fix Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs error ###
|
||||
### 修复apt-get update无法添加新的CD-ROM的错误 ###
|
||||
|
||||
The reason for this error is that cdrom has been included as one of the the sources here. And to fix this issue, we need to remove this from the list of software sources.
|
||||
这个错误的原因是cdrom已经被包含在源之中。要修复这个问题,我们需要将它从软件源中移除。
|
||||
|
||||
In Ubuntu, look for Software & Updates:
|
||||
在Ubuntu中,找到“软件与更新”:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Software_Update_Ubuntu.jpeg)
|
||||
|
||||
In the first tab Ubuntu Software, look for the cdrom, if it’s checked, uncheck it.
|
||||
在Ubuntu Software的第一个标签中,找到cdrom,如果它是勾选的,那么取消勾选。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Error_Update_Software_Sources.jpeg)
|
||||
|
||||
Close the Software Sources and run the update again. It should work fine now.
|
||||
关闭软件源并再次运行更新。现在应该可以用了。
|
||||
|
||||
### Further troubleshoot: ###
|
||||
### 进一步故障排除: ###
|
||||
|
||||
The method described above should have fixed this **apt-get update cannot be used to add new CD-ROMs** error. But this was not the case for me because the option of cdrom was already grayed out as I was using live session.
|
||||
上面描述的方法已经修复了这个**apt-get update cannot be used to add new CD-ROMs**错误。但是这个方法对我无效,因为cdrom的选项这时是灰色的,因为我使用的live版本。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Update_Error.png)
|
||||
|
||||
Now to fix our error, we shall take the command line route. Open a terminal and use the following line to see what is included in sources list:
|
||||
现在要修复我们的问题了,我们是要采用命令行路线。打开终端并查看软件源中包含了哪些源:
|
||||
|
||||
cat /etc/apt/sources.list
|
||||
|
||||
The output for me was as following:
|
||||
我的输出是下面这样:
|
||||
|
||||
deb cdrom:[elementary OS 0.3 _Freya_ – Daily amd64 (20150208)]/ trusty main restricted
|
||||
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
|
||||
@ -46,17 +46,17 @@ The output for me was as following:
|
||||
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
|
||||
|
||||
Look at the first line in the above list. It includes cdrom. We need to comment out this line by adding # in front of it to make it look like this:
|
||||
在上面的第一行中。它包含了cdrom。我们需要用‘#’来注释掉这行:
|
||||
|
||||
#deb cdrom:[elementary OS 0.3 _Freya_ – Daily amd64 (20150208)]/ trusty main restricted
|
||||
|
||||
To do that use the command below:
|
||||
要用下面的命令来:
|
||||
|
||||
sudo gedit /etc/apt/sources.list
|
||||
|
||||
Once you have edited the sources.list, run the apt-get update once again. The error apt-get update cannot be used to add new CD-ROMs should have been fixed. If you are facing any other update issue, do look at this article which is a collection of most [common Ubuntu update error fixes][1].
|
||||
在你编辑完软件源后,再次运行apt-get update。“apt-get update cannot be used to add new CD-ROMs”这个错误应该已经修复了。如果你还遇到其他的问题,看一下这篇收集了大部分[Ubuntu常见更新错误修复][1]的文章。
|
||||
|
||||
I hope you found this tutorial helpful. If you have any questions or suggestions, feel free to drop a comment.
|
||||
我希望这篇教程对你有用。如果你还有其他的问题和建议,请在下面留言。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -69,4 +69,4 @@ via: http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/abhishek/
|
||||
[1]:http://itsfoss.com/fix-update-errors-ubuntu-1404/
|
||||
[1]:http://itsfoss.com/fix-update-errors-ubuntu-1404/
|
@ -0,0 +1,54 @@
|
||||
如何修复Windows更新在0%卡住
|
||||
================================================================================
|
||||
当你在一个月后登录Windows,发现有一些更新需要安装, 你选择安装这些更新但是**Windows更新卡在0%**时你感觉怎么样?
|
||||
|
||||
为什么我在Linux和开源专属的博客上谈论Windows更新呢?因为我喜欢[双启动Windows和Linux][1]。当我使用Linux作为我的主桌面时,过了一段时间我登录到Windows中。登录Windows后最烦人的事情是Windows更新。我偶尔遇到了几次**Windows更新不能工作**的情况。我选择安装更新而且Windows更新卡在了0%和0KB上,就像这样:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_Updates_stuck_at_zero.jpeg)
|
||||
|
||||
本教程中,我们会让Windows更新再次可用。这个教程应该同样适用于Windows 7、Windows 8和Windows 8.1。
|
||||
|
||||
### 修复Windows更新卡在0% ###
|
||||
|
||||
请注意Windows更新可能卡在任何地方,我们将会使用的这个技巧需要你重新安装这些更新。我希望你不要觉得太麻烦。如果你准备好了,就让我们开始修复这个Windows更新问题。
|
||||
|
||||
#### 步骤 1: ####
|
||||
|
||||
按下Windows+R。这时会弹出运行窗口。在这里我们输入services.msc:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Updates_3.png)
|
||||
|
||||
#### 步骤 2: ####
|
||||
|
||||
这里会显示Windows上安装的所有服务。这些服务以字母排序。向下拉到**Windows Update Service**。右击并停止服务。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_Updates_stuck_1.jpeg)
|
||||
|
||||
#### 步骤 3: ####
|
||||
|
||||
现在进入**C:\Windows\SoftwareDistribution并删除这里所有的内容**。实际上,这个文件夹是下载和保存安装文件的地方。但是由于Windows更新卡住了,所以这里的某个安装文件存在一些问题。
|
||||
|
||||
#### 步骤 4: ####
|
||||
|
||||
回到前面的服务(第一步中提到的)并右击重新启动Windows更新服务。再重新试一下Windows更新,这次应该可以用了。
|
||||
|
||||
当系统更新可以工作时,你或许会发现在下次启动时会有很多更新要安装。这时打个电话:
|
||||
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Windows_update_suck.jpg)
|
||||
|
||||
玩笑之余,我希望这个贴士能够帮助你拜托Windows更新卡在0%的情况。我希望Linux中的更新也能够含在[Windows 10从Linux复制的特性][2]列表中。这只是我的希望。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/fix-windows-updates-stuck-0/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/abhishek/
|
||||
[1]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
|
||||
[2]:http://itsfoss.com/windows-10-inspired-linux/
|
@ -1,36 +1,34 @@
|
||||
Translating
|
||||
|
||||
Linux Basics: How To Find Maximum Supported RAM By Your System
|
||||
Linux基础:如何找出你的系统所支持的最大内存
|
||||
================================================================================
|
||||
![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/02/RAM-790x527.jpg)
|
||||
|
||||
Mostly, you will find maximum supported RAM by your system from the BIOS, Product catalog, or manuals. Here is the simple, yet useful trick, to find out maximum supported RAM using Dmidecode without opening the system chassis or referring the BIOS, product catalogs.
|
||||
大多数情况下你可以从BIOS、产品目录或者干脆手动找出你的系统所持的最大内存。这里,我们介绍一种简单有用的技巧——使用Dmidecode来找出系统支持的最大内存,这样你就无需打开机箱或者参照BIOS和产品目录了。
|
||||
|
||||
### What is Dmidecode? ###
|
||||
### 什么是 Dmidecode? ###
|
||||
|
||||
As you may know, **Dmidecode** is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Using Dmidecode, you can retrieve this information without having to probe for the actual hardware.
|
||||
就像你可能知道的一样, **Dmidecode**是一个将计算机DMI(又名SMBIOS)表的内容转换为可读格式的工具。这个表包含了系统硬件组件的介绍以及其他一些如序列号和IOS版本等有用的信息。使用Dmidecode你能够获取此项信息,而无需去探测真实的硬件。
|
||||
|
||||
### Find out the maximum RAM supported by your system ###
|
||||
### 找出你的系统所支持的最大内存 ###
|
||||
|
||||
Make sure you have installed dmidecode on your system. I think it will be automatically installed while installing your OS, but I am not sure though.
|
||||
请确定你已经在系统中安装了dmidecode,我觉得你的操作系统应该已经自动安装过了,不过并不非常确定。
|
||||
|
||||
**On Deb based system:**
|
||||
**在基于Deb的系统中安装**
|
||||
|
||||
sudo apt-get install dmidecode
|
||||
|
||||
**On RPM based system:**
|
||||
**在基于RPM的系统中安装**
|
||||
|
||||
sudo yum install dmidecode
|
||||
|
||||
**On SUSE/openSUSE:**
|
||||
**在SUSE/openSUSE中安装**
|
||||
|
||||
sudo zypper in dmidecode
|
||||
|
||||
Well, we installed dmidecode. Let us find out the maximum RAM supported. To do that, enter the following command:
|
||||
好了,我们已经安装了dmidecode,接下来让我们找出支持的最大内存。输入以下命令:
|
||||
|
||||
sudo dmidecode -t 16
|
||||
|
||||
**Sample output:**
|
||||
**输出样本**
|
||||
|
||||
# dmidecode 2.12
|
||||
SMBIOS 2.6 present.
|
||||
@ -44,13 +42,13 @@ Well, we installed dmidecode. Let us find out the maximum RAM supported. To do t
|
||||
Error Information Handle: Not Provided
|
||||
Number Of Devices: 2
|
||||
|
||||
As you see in the above output, my system will support RAM upto 16GB, and it has two RAM slots. Pretty easy, isn’t it?
|
||||
就像你看到的,我的系统支持最大内存到16G,并且有两个内存插槽,简单吧?
|
||||
|
||||
Well, let us find out the currently installed RAM details.
|
||||
接下来,让我们找出现在已经安装的内存的详细信息。
|
||||
|
||||
sudo dmidecode -t 17
|
||||
|
||||
**Sample output:**
|
||||
**输出样本**
|
||||
|
||||
# dmidecode 2.12
|
||||
SMBIOS 2.6 present.
|
||||
@ -95,15 +93,15 @@ Well, let us find out the currently installed RAM details.
|
||||
Part Number: JM1066KSN-4G
|
||||
Rank: Unknown
|
||||
|
||||
As per the above output, I have installed one RAM in DIMM slot 1. The RAM size is **4GB**, and it’s type and speed is **DDR3** and **1067 MHz** respectively.
|
||||
就像上边输出的一样,我在插槽1里边安装了一个内存条。内存大小为**4G**,类型为**DDR3**,速度为**1067 MHz**。
|
||||
|
||||
Also, we can have the complete RAM details using the following commands.
|
||||
同样的,我们可以通过下边命令得到完整的内存信息。
|
||||
|
||||
sudo dmidecode -t memory
|
||||
sudo dmidecode -t memory | less
|
||||
sudo dmidecode -t memory | more
|
||||
|
||||
**Sample output:**
|
||||
**输出样本**
|
||||
|
||||
# dmidecode 2.12
|
||||
SMBIOS 2.6 present.
|
||||
@ -157,11 +155,11 @@ Also, we can have the complete RAM details using the following commands.
|
||||
Part Number: JM1066KSN-4G
|
||||
Rank: Unknown
|
||||
|
||||
Curious to know the complete system details such as Motherboard, Memory, Bios etc? Well, enter the following command to get all details.
|
||||
如果你好奇想要知道整个系统的详细信息,例如主板、内存、BIOS等,那么可以输入以下命令来获取。
|
||||
|
||||
sudo dmidecode
|
||||
|
||||
**Sample output:**
|
||||
**输出样本**
|
||||
|
||||
# dmidecode 2.12
|
||||
SMBIOS 2.6 present.
|
||||
@ -683,16 +681,16 @@ Curious to know the complete system details such as Motherboard, Memory, Bios et
|
||||
Handle 0x0031, DMI type 127, 4 bytes
|
||||
End Of Table
|
||||
|
||||
That’s it. Happy weekend. Stay happy!
|
||||
好了,就是这样。周末愉快!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/linux-basics-how-to-find-maximum-supported-ram-by-your-system/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
作者:[SK][0]
|
||||
译者:[mr-ping](https://github.com/mr-ping)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/sk/
|
||||
[0]:https://www.unixmen.com/author/sk/
|
@ -0,0 +1,172 @@
|
||||
|
||||
使用Observium来监控你的网络和服务器
|
||||
================================================================================
|
||||
### 简介###
|
||||
|
||||
在监控你的服务器,交换机或者物理机器时有过问题吗?, **Observium**可以满足你的需求.作为一个免费的监控系统,可以帮助你远程监控你的服务器.它是一个由PHP编写的基于自动发现SNMP的网络监控平台,支持非常广泛的网络硬件和操作系统,包括 Cisco,Windows,Linux,HP,NetApp等.在此我会通过在Ubuntu12.04上设置一个**Observium**服务器的同时提供相应的步骤.
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/Capture1.png)
|
||||
|
||||
目前存在两种不同的**observium**版本.
|
||||
|
||||
- Observium 社区版本是一个在QPL开源许可证下的免费工具,这个版本时对于较小部署的最好解决方案. 该版本每6个月得到一次安全性更新.
|
||||
- 第2个版本是Observium Professional, 该版本在基于SVN的发布机制下的发行版. 会得到每日安全性更新. 该工具适用于服务提供商和企业级部署.
|
||||
|
||||
更多信息可以通过其官网获得[website of Observium][1].
|
||||
|
||||
### 系统需求###
|
||||
|
||||
为了安装 **Observium**, 需要具有一个最新安装的服务器。**Observium**是在Ubuntu LTS和Debian系统上进行开发的,所以推荐在Ubuntu或Debian上安装**Observium**,因为可能在别的平台上会有一些小问题。
|
||||
|
||||
该文章会知道你如何在Ubuntu12.04上进行安装**Observium**。对于小型的**Observium**安装,推荐的基础配置要有256MB内存和双核处理器。
|
||||
|
||||
### 安装需求 ###
|
||||
|
||||
在安装**Observuim**之前,你需要确认安装所有的依赖关系包。
|
||||
|
||||
首先,使用下面的命令更新的服务器:
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
然后你需要安装运行Observuim 所需的全部包。
|
||||
|
||||
Observium需要使用下面所列出的软件才能正确的运行:
|
||||
|
||||
- LAMP server
|
||||
- fping
|
||||
- Net-SNMP 5.4+
|
||||
- RRDtool 1.3+
|
||||
- Graphviz
|
||||
|
||||
对于可选特性的要求:
|
||||
|
||||
- Ipmitool - 只有当你想要探寻IPMI(Intelligent Platform Management Interface智能平台管理接口)基板控制器。
|
||||
- Libvirt-bin - 只有当你想要使用libvirt进行远程VM主机监控时。
|
||||
|
||||
sudo apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-json php-pear snmp fping mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick libvirt ipmitool
|
||||
|
||||
### 为Observium创建MySQL 数据库和用户。
|
||||
|
||||
现在你需要登录到MySQL中并为**Observium**创建数据库:
|
||||
mysql -u root -p
|
||||
|
||||
在用户验证成功之后,你需要按照下面的命令创建该数据库。
|
||||
|
||||
CREATE DATABASE observium;
|
||||
|
||||
数据库名为**Observium**,稍后你会需要这个信息。
|
||||
|
||||
现在你需要创建数据库管理员用户。
|
||||
|
||||
CREATE USER observiumadmin@localhost IDENTIFIED BY 'observiumpassword';
|
||||
|
||||
接下来,你需要给该管理员用户相应的权限来管理创建的数据库。
|
||||
|
||||
GRANT ALL PRIVILEGES ON observium.* TO observiumadmin@localhost;
|
||||
|
||||
你需要将权限信息写回到磁盘中来激活新的MySQL用户:
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
exit
|
||||
|
||||
### 下载并安装 Observium###
|
||||
|
||||
现在我们的系统已经准备好了, 可以开始Observium的安装了。
|
||||
|
||||
第一步,创建Observium将要使用的文件目录:
|
||||
mkdir -p /opt/observium && cd /opt
|
||||
|
||||
为了达到本教程的目的,我们将会使用Observium的社区/开源版本。使用下面的命令下载并解压:
|
||||
|
||||
wget http://www.observium.org/observium-community-latest.tar.gz
|
||||
tar zxvf observium-community-latest.tar.gz
|
||||
|
||||
现在进入到Observium目录。
|
||||
|
||||
cd observium
|
||||
|
||||
将默认的配置文件'**config.php.default**'复制到'**config.php**',并将数据库配置选项填充到配置文件中:
|
||||
|
||||
cp config.php.default config.php
|
||||
nano config.php
|
||||
|
||||
----------
|
||||
|
||||
/ Database config
|
||||
$config['db_host'] = 'localhost';
|
||||
$config['db_user'] = 'observiumadmin';
|
||||
$config['db_pass'] = 'observiumpassword';
|
||||
$config['db_name'] = 'observium';
|
||||
|
||||
现在为MySQL数据库设置默认的数据库模式:
|
||||
php includes/update/update.php
|
||||
|
||||
现在你需要创建一个文件目录来存储rrd文件,并修改其权限以便让apache能将写入到文件中。
|
||||
|
||||
mkdir rrd
|
||||
chown apache:apache rrd
|
||||
|
||||
为了在出现问题时进行问题修理,你需要创建日志文件。
|
||||
|
||||
mkdir -p /var/log/observium
|
||||
chown apache:apache /var/log/observium
|
||||
|
||||
现在你需要为Observium创建虚拟主机配置。
|
||||
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /opt/observium/html/
|
||||
ServerName observium.domain.com
|
||||
CustomLog /var/log/observium/access_log combined
|
||||
ErrorLog /var/log/observium/error_log
|
||||
<Directory "/opt/observium/html/">
|
||||
AllowOverride All
|
||||
Options FollowSymLinks MultiViews
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
|
||||
下一步你需要让你的Apache服务器的rewrite(重写)功能生效。
|
||||
|
||||
为了让'mod_rewrite'生效,输入以下命令:
|
||||
|
||||
sudo a2enmod rewrite
|
||||
|
||||
该模块在下一次Apache服务重启之后就会生效。
|
||||
|
||||
sudo service apache2 restart
|
||||
|
||||
###配置Observium###
|
||||
|
||||
在登入网络接口之前,你需要为Observium创建一个管理员账户(级别10)。
|
||||
|
||||
# cd /opt/observium
|
||||
# ./adduser.php admin adminpassword 10
|
||||
User admin added successfully.
|
||||
|
||||
下一步为发现和探寻工作设置一个cron任务,创建一个新的文件‘**/etc/cron.d/observium**’ 并在其中添加以下的内容。
|
||||
|
||||
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1
|
||||
*/5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1
|
||||
*/5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
|
||||
|
||||
重载cron进程来获取系的人物实体。
|
||||
|
||||
# /etc/init.d/cron reload
|
||||
|
||||
好啦,你已经完成了Observium服务器的安装拉! 使用你的浏览器登录到**http://<Server IP>**,然后上路巴。
|
||||
|
||||
![](https://www.unixmen.com/wp-content/uploads/2015/03/Capture.png)
|
||||
|
||||
尽情享受吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.unixmen.com/monitoring-network-servers-observium/
|
||||
|
||||
作者:[anismaj][a]
|
||||
译者:[theo-l](https://github.com/theo-l)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.unixmen.com/author/anis/
|
||||
[1]:http://www.observium.org/
|
41
translated/tech/20150306 Nmap--Not Just for Evil.md
Normal file
41
translated/tech/20150306 Nmap--Not Just for Evil.md
Normal file
@ -0,0 +1,41 @@
|
||||
Nmap--不只是邪恶.
|
||||
================================================================================
|
||||
如果SSH是系统管理员世界的"瑞士军刀"的话,那么Nmap就是一盒炸药. 炸药很容易被误用然后将你的双脚崩掉,但是也是一个很有威力的工具,能够胜任一些看似无法完成的任务.
|
||||
|
||||
大多数人想到Nmap时,他们想到的是扫描服务器,查找开放端口来实施工具. 然而,在过去的这些年中,同样的超能力在当你管理服务器或计算机遇到问题时变得难以置信的有用.无论是你试图找出在你的网络上有哪些类型的服务器使用了指定的IP地址,或者尝试锁定一个新的NAS设备,以及扫描网络等,都会非常有用.
|
||||
|
||||
图1显示了我的QNAP NAS的网络扫描.我使用该单元的唯一目的是为了NFS和SMB文件共享,但是你可以看到,它包含了一大堆大开大敞的端口.如果没有Nmap,很难发现机器到底在运行着什么玩意儿.
|
||||
|
||||
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11825nmapf1.jpg)
|
||||
|
||||
### 图1 网络扫描 ###
|
||||
|
||||
另外一个无法想象的用处是用它来扫描一个网络.你甚至根本不需要root的访问权限,而且你也可以非常容易地来指定你想要扫描的网络块,例如,输入:
|
||||
|
||||
nmap 192.168.1.0/24
|
||||
|
||||
上述命令会扫描我局部网络中全部的254个可用的IP地址,让我可以知道那个使可以Ping的,以及那些端口时开放的.如果你刚刚插入一片新的硬件,但是不知道它通过DHCP获取的IP地址,那么此时Nmap就是无价之宝. 例如,上述命令在我的网络中揭示了这个问题.
|
||||
|
||||
Nmap scan report for TIVO-8480001903CCDDB.brainofshawn.com (192.168.1.220)
|
||||
Host is up (0.0083s latency).
|
||||
Not shown: 995 filtered ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
443/tcp open https
|
||||
2190/tcp open tivoconnect
|
||||
2191/tcp open tvbus
|
||||
9080/tcp closed glrpc
|
||||
|
||||
它不仅显示了新的Tivo单元,而且还告诉我那些端口是开放的. 由于它的可靠性,可用性以及黑色边框帽子的能力,Nmap获得了本月的 <<编辑推荐>>奖. 这不是一个新的程序,但是如果你是一个linux用户的话,你应该玩玩它.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/nmap%E2%80%94not-just-evil
|
||||
|
||||
作者:[Shawn Powers][a]
|
||||
译者:[theo-l](https://github.com/theo-l)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxjournal.com/users/shawn-powers
|
Loading…
Reference in New Issue
Block a user