mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-06 23:50:16 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject
This commit is contained in:
commit
f383a800d9
@ -1,42 +1,42 @@
|
||||
在短短几个小时里拿回自己数据的隐私和控制权:为自己和朋友们搭建私有云
|
||||
权威指南:构建个人私有云,拿回你的数据隐私的控制权!
|
||||
================================================================================
|
||||
8年里40'000多次搜索!这是我的Google搜索历史。你的呢?(可以在[这里][1]自己找一下)有经过这么长时间积累下来的这么多数据点,Google已经能非常精确的推测你对什么感兴趣,曾经的想法,担忧过的事情,以及从你第一次获得Google帐号后这些年里所有这些的变化。
|
||||
8年里40000多次搜索!这是我的Google搜索历史。你的呢?(可以在[这里][1]自己找一下)有经过这么长时间积累下来的这么多数据点,Google已经能非常精确的推测你对什么感兴趣、曾经的想法、担忧过的事情,以及从你第一次获得Google帐号后这些年里所有这些的变化!
|
||||
|
||||
### 很多非常私人的信息不受自己控制地存储在世界范围内的服务器上 ###
|
||||
## 很多非常私人的信息不受自己控制地存储在世界范围内的服务器上 ##
|
||||
|
||||
比如说你也像我一样从2006年到2013年都是Gmail用户,意味着你收到了30'000+的电子邮件以及在这7年里写了差不多5000封电子邮件。这些发送或收到的电子邮件里有很多是非常私人的,私人到你甚至不希望自己的家人或好友能系统地查看。也许你还写过一些草稿邮件,因为最后一分钟改变主意而从没发出去。但是尽管你从未发出去,这些邮件仍然保存在服务器上的某个地方。结论是,说Google服务器比你最亲密的朋友或家人都更了解你的个人生活一点也不过分。
|
||||
比如说你也像我一样从2006年到2013年都是Gmail用户,意味着你收到了30000封以上的电子邮件,以及在这7年里写了差不多5000封电子邮件。这些发送或收到的电子邮件里有很多是非常私人的,私人到你甚至不希望自己的家人或好友可以系统地查看。也许你还写过一些草稿邮件,因为最后一分钟改变主意而从没发出去。但是尽管你从未发出去,这些邮件仍然保存在服务器上的某个地方。结论是,说Google服务器比你最亲密的朋友或家人都更了解你的个人生活一点也不过分。
|
||||
|
||||
从统计数据来看,可以很安全地赌你拥有一部智能手机。如果不使用联系人应用的话手机将基本没法用,而它默认会将你的联系人信息保存到Google服务器上的Google联系人里。所以,现在Google不仅知道了你的电子邮件,还有了你的离线联系人:你喜欢打给谁,谁来过电话,你发过短信给谁,以及发了些什么。你也不需要听我的片面之词,可以自己检查一下,看看你开放给类似Google Play服务的一些应用的权限,用来读取来电信息以及收到的短信。你是否还会用到手机里自带的日历应用?除非你在设置日程的时候明确地去掉,那么Google将精确地知道你将要做什么,一天里的每个时段,每一天,每一年。用iPhone代替Android手机也是一样的,只是Apple会代替Google来掌握你的往来邮件,联系人和日程计划。
|
||||
从统计数据来看,我可以很保险地打赌你拥有一部智能手机。如果不使用联系人应用的话手机将基本没法用,而它默认会将你的联系人信息保存到Google服务器上的Google联系人里。所以,现在Google不仅知道了你的电子邮件,还有了你的离线联系人:你喜欢打给谁、谁来过电话、你发过短信给谁,以及发了些什么。你也不需要听我的片面之词,可以自己检查一下,看看你开放给类似Google Play服务的一些应用的权限,用来读取来电信息以及收到的短信。你是否还会用到手机里自带的日历应用?除非你在设置日程的时候明确地去掉同步,那么Google将精确地知道你将要做什么,一天里的每个时段、每一天、每一年。用iPhone代替Android手机也是一样的,只是Apple会代替Google来掌握你的往来邮件、联系人和日程计划。
|
||||
|
||||
你是否还会非常小心地同步自己的联系人信息,在你朋友,同事或家人换工作或换服务商的时候更新他们的电子邮件地址和手机号?这给Google提供了一副你社交网络的非常精确的,最新的图片。还有你非常喜欢手机的GPS功能,经常配合Google地图使用。这意味着Google不仅能从日程里知道你在干什么,还知道你在哪儿,住在哪儿,在哪儿工作。然后再关联用户之间的GPS位置信息,GOogle还能知道你现在可能正在和哪些人来往。
|
||||
你是否还会非常小心地同步自己的联系人信息,在你朋友,同事或家人换工作或换服务商的时候更新他们的电子邮件地址和手机号?这给Google提供了一副你的社交网络的非常精确的、最新的描绘。还有你非常喜欢手机的GPS功能,经常配合Google地图使用。这意味着Google不仅能从日程里知道你在干什么,还知道你在哪儿、住在哪儿、在哪儿工作。然后再关联用户之间的GPS位置信息,Google还能知道你现在可能正在和哪些人来往。
|
||||
|
||||
### 这种泄漏自己私人信息的日常爱好会以一种甚至没人能够预测的方式影响你的生活 ###
|
||||
## 这种泄漏自己私人信息的日常爱好会以一种甚至没人能够预测的方式影响你的生活 ##
|
||||
|
||||
总结一下,如果你是一个普通的因特网用户,Google拥有过去差不多10年里你最新的,深度的信息,关于你的兴趣,忧虑,热情,疑问。它还收集了一些你很私人的信息(电子邮件,短信),精确到小时的你的日常活动和位置,一副你社交网络的高品质图片。关于你的如此私密的数据,很可能已经超越了你最亲密的朋友,家人或爱人对你的了解。
|
||||
总结一下,如果你是一个普通的因特网用户,Google拥有过去差不多10年里你最新的、深度的信息,关于你的兴趣、忧虑、热情、疑问。它还收集了一些你很私人的信息(电子邮件、短信),精确到小时的你的日常活动和位置,一副你社交网络的高精度的描绘。关于你的如此私密的数据,很可能已经超越了你最亲密的朋友,家人或爱人对你的了解。
|
||||
|
||||
不敢想象把这些深度的个人信息交给完全陌生的人,就好像把这些信息拷到一个U盘里,然后随便放到某个咖啡厅的桌上,留张纸条说“Olivier Martin的个人数据,请随便”。谁知道什么人会拿到它以及用来干嘛?然而,我们毫不犹豫地把自己的主要信息交给那些对我们的数据很感兴趣的IT公司的陌生人(这是他们制造面包的材料)以及[世界级的数据分析专家][2]手里,也许只是因为我们在点击那个绿色的'接受'按钮时根本没有想这么多。
|
||||
|
||||
有这么多的高质量信息,这么多年里,Google可能会比你希望自我了解的更了解你自己:尼玛,回想我过去的数字生活,我已经不记得5年前发出的邮件里的一半了。我很高兴能重新发现早在2005年对马克思主义的兴趣以及第二年加入了[ATTAC][3](一个致力于通过征收金融交易税来限制投机和改善社会公平的组织)。天知道为什么我竟然在2007年这么喜欢跳舞。这些都是无关紧要的信息(你不要指望我能爆出什么猛料,不会吧?;-)。但是,连接起这些高质量数据点,关于你生活的方方面面(做什么,什么时候,和谁一起,在哪里,...),并跨越这么长时间间隔,应该能推测出你的未来状态。比如说,根据一个17岁女孩的购物习惯,超市甚至可以在他父亲听说之前断定这个女孩怀孕了([真实故事][4])。谁知道通过像Google所掌握的这些远远超出购物习惯的高质量数据能做些什么?连接起这些点,也许有人能预测你未来几年里口味或政治观点的变化。如今,[你从未听过的公司声称拥有你500项数据点][5],包括宗教信仰,性取向和政治观点。提到政治,如果说你决定今后10年内进入政坛会怎么样?你的生活会改变,你的观点也一样,甚至你有时候会有所遗忘,但是Google不会。那你会不会担心你的对手会接触一些可以从Google访问你数据的人并会从你过去这些年里积累的个人数据深渊里挖出一些猛料呢?[就像最近Sony被黑][6]一样,多久以后会轮到Google或Facebook,以致让你的个人信息最终永远暴露?
|
||||
有这么多的高质量信息,这么多年里,Google可能会比你希望自我了解的更了解你自己:尼玛,回想我过去的数字生活,5年前发出的邮件里有一半我已经不记得了。我很高兴能重新发现早在2005年对xxx主义的兴趣以及第二年加入了[ATTAC][3](一个致力于通过征收金融交易税来限制投机和改善社会公平的组织)。天知道为什么我竟然在2007年这么喜欢跳舞。这些都是无关紧要的信息(你不指望我能爆出什么猛料,是吧?;-)。但是,连接起这些高质量数据点,关于你生活的方方面面(做什么、什么时候、和谁一起、在哪里,...),并跨越这么长时间间隔,应该能推测出你的未来状态。比如说,根据一个17岁女孩的购物习惯,超市甚至可以在他父亲听说之前断定这个女孩怀孕了(这是一个[真实的故事][4])。谁知道通过像Google所掌握的这些远远超出购物习惯的高质量数据能做些什么?连接起这些点,也许有人能预测你未来几年里口味或观点的变化。如今,[你从未听过的公司声称拥有你500项数据点][5],包括宗教信仰、性取向和政治观点。提到政治,如果说你决定今后10年内进入政坛会怎么样?你的生活会改变,你的观点也一样,甚至你有时候会有所遗忘,但是Google不会。那你会不会担心你的对手会接触一些可以从Google访问你数据的人并会从你过去这些年里积累的个人数据深渊里挖出一些猛料呢?[就像最近Sony被黑][6]一样,多久以后会轮到Google或Facebook,以致让你的个人信息最终永远暴露?
|
||||
|
||||
我们大多数人把自己的个人数据托付给这些公司的一个原因就是它们提供免费服务。但是真的免费吗?一般的Google帐号的价值根据评估方式不同会有些差别:你花在写邮件上的时间占到[1000美元/年][7],你的帐号对于广告产业的价值差不多在[220美元/年][8]到[500美元/年][9]之间。所以这些服务并不是真的免费:会通过广告和我们的数据在未来的一些未知使用来间接付费。
|
||||
|
||||
我写的最多的是Google,这是因为这是我托付个人数字信息的,以及目前我所知道做的最好的公司。但是我也提到过Apple或Facebook。这些公司通过它们在设计,工程和我们(曾经)喜欢每天使用的服务方面的神奇进步实实在在地改变了世界。但是这并不是说我们应该把所有我们最私人的个人数据堆积到它们的服务器上并把我们的数字生活托付给它们:潜在的危害实在太大了。
|
||||
我写的最多的是Google,这是因为这是我托付个人数字信息的,以及目前我所知道做的最好的公司。但是我也提到过Apple或Facebook。这些公司通过它们在设计、工程和我们(曾经)喜欢每天使用的服务方面的神奇进步实实在在地改变了世界。但是这并不是说我们应该把所有我们最私人的个人数据堆积到它们的服务器上并把我们的数字生活托付给它们:潜在的危害实在太大了。
|
||||
|
||||
### 只要5小时,拿回自己以及关心的人的隐私权 ###
|
||||
## 只要5小时,拿回自己以及关心的人的隐私权 ##
|
||||
|
||||
并不是一定要这样做。你可以生活在21世纪,拿着智能手机,每天都用电子邮件和GPS,却仍然可以保留自己的隐私。你所需要的就是拿回自己个人数据的控制权:邮件、日程、联系人、文件,等等。[Prism-Break.org][10]网站上列出了一些能帮你掌握个人数据命运的软件。除此以外,控制自己个人数据的最安全和最有效的方式是架设自己的服务器并搭建自己的云。不过你也许只是没有时间或精力去研究具体该怎么做以及如何让它能流畅工作。
|
||||
但是事实并不是一定必须这样的。你可以生活在21世纪,拿着智能手机,每天都用电子邮件和GPS,却仍然可以保留自己的隐私。你所需要的就是拿回自己个人数据的控制权:邮件、日程、联系人、文件,等等。[Prism-Break.org][10]网站上列出了一些能帮你掌握个人数据命运的软件。除此以外,控制自己个人数据的最安全和最有效的方式是架设自己的服务器并搭建自己的云。不过你也许只是没有时间或精力去研究具体该怎么做以及如何让它能流畅工作。
|
||||
|
||||
这也是这篇文章的意义所在。仅仅5个小时内,我们将配置出一台服务器来支撑你的邮件、联系人、日程表和各种文件,为你、你的朋友和你的家人。这个服务器将设计成一个个人数据中心或云,所以你能时刻保留它的完整控制。数据将自动在你的台式机/笔记本、手机和平板之间同步。从根本上来说,**我们将建立一个系统来代替Gmail、Google文件/Dropbox、Google联系人、Google日历和Picasa**。
|
||||
|
||||
为自己做这件事情已经是迈出很大一步了。但是,你个人信息的很大一部分将仍然泄漏出去并保存到硅谷的一些主机上,只是因为和你日常来往的太多人在用Gmail和使用智能手机。所以最好是带上你一些比较亲近的人加入这次探险。
|
||||
为自己做这件事情已经是迈出很大一步了。但是,你个人信息的很大一部分将仍然泄漏出去并保存到硅谷的一些主机上,只是因为和你日常来往的太多人在用Gmail和使用智能手机,所以最好是带上你一些比较亲近的人加入这次探险。
|
||||
|
||||
我们将构建的系统能够
|
||||
我们将构建的系统能够:
|
||||
|
||||
- **支持任意数目的域名和用户**。这样就能轻易地和你的家人朋友共享这台服务器,所以他们也能掌控自己的个人数据,并且还能和你一起分摊服务费用。和你一起共享服务器的人可以使用他们自己的域名或者共享你的。
|
||||
- **允许你从任意网络发送和接收电子邮件**,需要成功登录服务器之后。这样,你可以通过任意的邮件地址,任意设备(台式机、手机、平板),任意网络(家里、公司、公共网络、...)来发送电子邮件。
|
||||
- **允许你从任意网络发送和接收电子邮件**,需要成功登录服务器之后。这样,你可以通过任意的邮件地址、任意设备(台式机、手机、平板)、任意网络(家里、公司、公共网络、...)来发送电子邮件。
|
||||
- **在发送和接收邮件的时候加密网络数据**,这样,你不信任的人不能钓出你的密码,也不能看到你的私人邮件。
|
||||
- **提供最先进的反垃圾邮件技术**,结合了已知垃圾邮件黑名单,自动灰名单,和自适应垃圾邮件过滤。如果邮件被误判了只需要简单地把它拖入或拖出垃圾目录就可以重新配置垃圾邮件过滤器。而且,服务器还会为基于社区的反垃圾邮件努力做出贡献。
|
||||
- **一段时间里只需要几分钟的维护**,基本上只是安装安全更新和简单地检查一下服务器日志。添加一个新的邮件地址只需要在数据库中插入一条记录。除此之外,你可以忘记它的存在过自己的生活。我在14个月之前搭建了本文描述的这个系统,从那以后就一直顺利运行。所以我完全把它给忘了,直到我最近觉得随便按下手机上的‘检查邮件’会导致电子一路跑到冰岛(我放置服务器的地方)再回来的想法有点好笑才想起来。
|
||||
- **提供最先进的反垃圾邮件技术**,结合了已知垃圾邮件黑名单、自动灰名单、和自适应垃圾邮件过滤。如果邮件被误判了只需要简单地把它拖入或拖出垃圾目录就可以重新调校垃圾邮件过滤器。而且,服务器还会为基于社区的反垃圾邮件努力做出贡献。
|
||||
- **一段时间里只需要几分钟的维护**,基本上只是安装安全更新和简单地检查一下服务器日志。添加一个新的邮件地址只需要在数据库中插入一条记录。除此之外,你可以忘记它的存在过自己的生活。我在14个月之前搭建了本文描述的这个系统,从那以后就一直顺利运行。所以我完全把它给忘了,直到我最近觉得随便按下手机上的‘检查邮件’会导致电子信号一路跑到冰岛(我放置服务器的地方)再回来的想法有点好笑才想起来。
|
||||
|
||||
要完成这篇文章里的工作,你需要一点基本的技术能力。如果你知道SMTP和IMAP的区别,什么是DNS,以及对TCP/IP有基本了解的话,就够了。你还将需要一点基本的Unix知识(在命令行下和文件一起工作,基本的系统管理)。然后你需要花总共5小时时间来搭建。
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
- [使用Owncloud提供日历,联系人,文件服务并配置webmail][15]
|
||||
- [在云上同步你的设备][16]
|
||||
|
||||
### 这篇文章是受之前工作的启发并以之为基础 ###
|
||||
## 这篇文章是受之前工作的启发并以之为基础 ##
|
||||
|
||||
本文很大程度参考了两篇文章,由[Xavier Claude][17]和[Drew Crawford][18]写的关于架设私有邮件服务器的介绍。
|
||||
|
||||
@ -62,13 +62,13 @@
|
||||
- 我增加了webmail。
|
||||
- 我增加了设定云服务器的部分,不仅能收发邮件还能管理文件,地址本/联系人(邮件地址,电话号码,生日,等等等),日程表和图片,供所有设备访问使用。
|
||||
|
||||
### 申请一个虚拟私人服务器,一个域名,并把它们配置好 ###
|
||||
## 申请一个虚拟私人服务器,一个域名,并把它们配置好 ##
|
||||
|
||||
让我们从设置基础设施开始:我们的虚拟私人主机和我们的域名。
|
||||
|
||||
我用过[1984.is][19]和[Linode][20]提供的虚拟私人主机(VPS),体验非常好。在本文中,我们将使用**Debian Wheezy**,这个在1984和Linode都提供了已经做好的映像文件可以直接布置到你的VPS上。我喜欢1984是因为它的服务器在冰岛,也是唯一使用可再生能源(地热和水力发电)的地方,目前还没有影响过气候变化,不像[大多数美国数据中心目前大多数依赖于烧煤的火力发电站][21]。而且,他们注重[民权,透明,自由][22]以及[免费软件][23]。
|
||||
|
||||
最好是在服务器上创建一个文件用来保存后面要用到的各种密码(用户账号,邮件账号,云帐号,数据库帐号)。当然最好是加密一下(可以用[GnuPG][24]),这样就算用来设定服务器的电脑被偷了或被入侵了,你的服务器就不会那么容易被攻击。
|
||||
最好是在服务器上创建一个文件用来保存后面要用到的各种密码(用户账号、邮件账号、云帐号、数据库帐号)。当然最好是加密一下(可以用[GnuPG][24]),这样就算用来设定服务器的电脑被偷了或被入侵了,你的服务器就不会那么容易被攻击。
|
||||
|
||||
关于注册域名,我已经使用[grandi][25]的服务超过10年了,也很满意。在本文中,我们将开辟一个叫**jhausse.net**的域名。然后在上面增加一个叫**cloud.jhausse.net**的二级域名,并绑定MX纪录。在完成之后,设置比较短的纪录生存时间(TTL)比如300秒,这样你在设置服务器的时候,可以修改你的域并很快测试到结果。
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
adduser roudy
|
||||
|
||||
然后,在文件**/etc/ssh/sshd_config**中设置
|
||||
然后,在文件**/etc/ssh/sshd\_config**中设置
|
||||
|
||||
PermitRootLogin no
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
|
||||
cloud
|
||||
|
||||
然后,编辑ssh服务的公钥文件**/etc/ssh/ssh_host_rsa_key.pub, /etc/ssh/ssh_host_dsa_key.pub, /etc/ssh/ssh_host_ecdsa_key.pub**,这样文件末尾可以反映你的主机名,比如**root@cloud**。然后重启系统保证主机名在系统的每个需要它的角落都生效了。
|
||||
然后,编辑ssh服务的公钥文件**/etc/ssh/ssh\_host\_rsa\_key.pub, /etc/ssh/ssh\_host\_dsa\_key.pub, /etc/ssh/ssh\_host\_ecdsa\_key.pub**,这样文件末尾可以反映你的主机名,比如**root@cloud**。然后重启系统保证主机名在系统的每个需要它的角落都生效了。
|
||||
|
||||
reboot
|
||||
|
||||
@ -103,15 +103,15 @@
|
||||
apt-get autoremove
|
||||
apt-get install vim
|
||||
|
||||
我喜欢使用vim远程编辑配置文件。打开自动语法高亮会很有帮助。添加下面这一行到**~/.vimrc**文件中。
|
||||
我喜欢使用vim远程编辑配置文件。打开vim 的自动语法高亮会很有帮助。添加下面这一行到**~/.vimrc**文件中。
|
||||
|
||||
syn on
|
||||
|
||||
### 设置postfix和dovecot来收发电子邮件 ###
|
||||
## 设置postfix和dovecot来收发电子邮件 ##
|
||||
|
||||
apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-mysql mysql-server dovecot-lmtpd postgrey
|
||||
|
||||
在[Postfix][27]的配置菜单里,选择**因特网站点**,把系统邮件名设为**jhausse.net**。
|
||||
在[Postfix][27]的配置菜单里,选择`Internet Site`,设置这个系统的邮件名称为**jhausse.net**。
|
||||
|
||||
现在开始添加一个数据库用于保存主机上管理的域名列表,和每个域名下的用户列表(同时也包括他们各自的密码),以及邮件别名列表(用于从一个地址往另一个地址转发邮件)。
|
||||
|
||||
@ -142,14 +142,14 @@
|
||||
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
我们将承载**jhausse.net**域名。如果还需要加入其他域名,也没问题。我们也会为每个域名设置一个邮件管理地址,转寄给**roudy@jhausse.net**。
|
||||
这里我们为**jhausse.net**域名提供邮件服务。如果还需要加入其他域名,也没问题。我们也会为每个域名设置一个邮件管理地址(postmaster),转寄给**roudy@jhausse.net**。
|
||||
|
||||
mysql> INSERT INTO virtual_domains (`name`) VALUES ('jhausse.net');
|
||||
mysql> INSERT INTO virtual_domains (`name`) VALUES ('otherdomain.net');
|
||||
mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('1', 'postmaster', 'roudy@jhausse.net');
|
||||
mysql> INSERT INTO virtual_aliases (`domain_id`, `source`, `destination`) VALUES ('2', 'postmaster', 'roudy@jhausse.net');
|
||||
|
||||
现在已经添加了一个本地邮件账号**roudy@jhausse.net**。首先,为它生成一个哈希密码:
|
||||
现在已经添加了一个本地邮件账号**roudy@jhausse.net**。首先,为它生成一个密码的哈希串:
|
||||
|
||||
doveadm pw -s SHA512-CRYPT
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
|
||||
mysql> INSERT INTO `mailserver`.`virtual_users` (`domain_id`, `password`, `email`) VALUES ('1', '$6$YOURPASSWORDHASH', 'roudy@jhausse.net');
|
||||
|
||||
现在我们的域名,别名和用户列表都设置好了,然后开始设置postfix(SMTP服务器,用来发送邮件)。把文件**/etc/postfix/main.cf**替换为下面的内容:
|
||||
现在我们的域名、别名和用户列表都设置好了,然后开始设置postfix(这是一个SMTP服务器,用来发送邮件)。把文件**/etc/postfix/main.cf**替换为下面的内容:
|
||||
|
||||
myhostname = cloud.jhausse.net
|
||||
myorigin = /etc/mailname
|
||||
@ -239,7 +239,7 @@
|
||||
|
||||
如果一切都正常配置了的话,头两个查询应该输出1,第3个查询应该输出**roudy@jhausse.net**,而最后一个应该什么都不输出。
|
||||
|
||||
现在,让我们设置一下dovecot(一个IMAP服务程序,用来在我们的设备上从服务器获取收件箱里的邮件)。编辑文件**/etc/dovecot/dovecot.conf**设置以下参数:
|
||||
现在,让我们设置一下dovecot(一个IMAP服务程序,用来在我们的设备上从服务器获取收到的邮件)。编辑文件**/etc/dovecot/dovecot.conf**设置以下参数:
|
||||
|
||||
# Enable installed protocol
|
||||
# !include_try /usr/share/dovecot/protocols.d/*.protocol
|
||||
@ -253,7 +253,7 @@
|
||||
[...]
|
||||
first_valid_uid = 0
|
||||
|
||||
这样邮件将被保存到目录/var/mail/domainname/username下。注意下这几个选项散布在配置文件的不同位置,有时已经在那里写好了:我们只需要取消注释。文件里的其他设定选项,可以维持原样。在本文后面还有很多文件需要用同样的方式更新设置。在文件**/etc/dovecot/conf.d/10-auth.conf**里,设置以下参数:
|
||||
这样邮件将被保存到目录 /var/mail/domainname/username 下。注意下这几个选项散布在配置文件的不同位置,有时已经在那里写好了:我们只需要取消注释即可。文件里的其他设定选项,可以维持原样。在本文后面还有很多文件需要用同样的方式更新设置。在文件**/etc/dovecot/conf.d/10-auth.conf**里,设置以下参数:
|
||||
|
||||
disable_plaintext_auth = yes
|
||||
auth_mechanisms = plain
|
||||
@ -366,9 +366,10 @@
|
||||
在服务器上,尝试发送邮件给本地用户:
|
||||
|
||||
telnet localhost 25
|
||||
|
||||
EHLO cloud.jhausse.net
|
||||
MAIL FROM:youremail@domain.com
|
||||
rcpt to:roudy@jhausse.net
|
||||
RCPT TO:roudy@jhausse.net
|
||||
data
|
||||
Subject: Hallo!
|
||||
|
||||
@ -397,18 +398,18 @@
|
||||
|
||||
554 5.7.1 <bob@gmail.com>: Relay access denied
|
||||
|
||||
这个没问题:如果服务器能接受这封邮件,那意味着我们架设的postfix是一个对全世界所有垃圾邮件都开放的中继,将完全没法使用。除了'Relay access denied'消息,你也可能会收到这样的响应:
|
||||
这个没问题:如果服务器能接受这封邮件而不是返回如上的拒绝消息,那意味着我们架设的postfix是一个对全世界所有垃圾邮件都开放的中继,这将完全没法使用。除了'Relay access denied'消息,你也可能会收到这样的响应:
|
||||
|
||||
554 5.7.1 Service unavailable; Client host [87.68.61.119] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=87.68.61.119
|
||||
|
||||
意思是你正尝试从一个被标记成垃圾邮件发送者的IP地址连接服务器。我在通过普通的因特网服务提供商(ISP)连接服务器时曾收到过这样的消息。要解决这个问题,可以试着从另一个主机发起连接,比如另外一个你可以SSH登录的主机。另外一种方式是,你可以修改postfix的**main.cf**配置文件,不要使用Spamhous的RBL,重启postfix服务,然后再检查上面的测试是否正常。不管用哪种方式,最重要的是你要确定一个能工作的,因为我们后面马上要测试其他功能。如果你选择了重新配置postfix不使用RBL,别忘了在完成本文后重新开启RBL并重启postfix,以避免收到一些不必要的垃圾邮件。
|
||||
意思是你正尝试从一个被标记成垃圾邮件发送者的IP地址连接服务器。我在通过普通的因特网服务提供商(ISP)连接服务器时曾收到过这样的消息。要解决这个问题,可以试着从另一个主机发起连接,比如另外一个你可以SSH登录的主机。另外一种方式是,你可以修改postfix的**main.cf**配置文件,不要使用Spamhous的RBL,重启postfix服务,然后再检查上面的测试是否正常。不管用哪种方式,最重要的是你要确定一个能工作的,因为我们后面马上要测试其他功能。如果你选择了重新配置postfix不使用RBL,别忘了在完成本文后重新开启RBL并重启postfix,以避免收到一些不必要的垃圾邮件。(LCTT 译者注:在国内可以使用 CASA 的 RBL:cblplus.anti-spam.org.cn,参见:http://www.anti-spam.org.cn/ 。)
|
||||
|
||||
现在,我们试一下往SMTP端口25发送一封有效的邮件,这是一般正常的邮件服务器用来彼此对话的方式:
|
||||
|
||||
openssl s_client -connect cloud.jhausse.net:25 -starttls smtp
|
||||
EHLO cloud.jhausse.net
|
||||
MAIL FROM:youremail@domain.com
|
||||
rcpt to:roudy@jhausse.net
|
||||
RCPT TO:roudy@jhausse.net
|
||||
|
||||
服务器应该有这样的响应
|
||||
|
||||
@ -425,7 +426,7 @@
|
||||
4 UID fetch 1:1 (UID RFC822.SIZE FLAGS BODY.PEEK[])
|
||||
5 LOGOUT
|
||||
|
||||
这里,你应该把mypassword替换为你自己为这个邮件账号设定的密码。如果能正常工作,基本上我们已经拥有一个能接收邮件的邮件服务器了,通过它我们可以在各种设备(PC/笔记本,平板,手机,...)上收取邮件了。但是我们不能把邮件给它发送出去,除非我们自己从服务器发送。现在我们将让postfix为我们转发邮件,但是这个只有成功登录才可以,这是为了保证邮件是由服务器上的某个有效帐号发出来的。要做到这个,我们要打开一个特殊的,全程SSL连接的,SASL鉴权的邮件提交服务。在文件**/etc/postfix/master.cf**里设置下面的参数:
|
||||
这里,你应该把*mypassword*替换为你自己为这个邮件账号设定的密码。如果能正常工作,基本上我们已经拥有一个能接收邮件的邮件服务器了,通过它我们可以在各种设备(PC/笔记本、平板、手机...)上收取邮件了。但是我们不能把邮件给它发送出去,除非我们自己从服务器发送。现在我们将让postfix为我们转发邮件,但是这个只有成功登录才可以,这是为了保证邮件是由服务器上的某个有效帐号发出来的。要做到这个,我们要打开一个特殊的,全程SSL连接的,SASL鉴权的邮件提交服务。在文件**/etc/postfix/master.cf**里设置下面的参数:
|
||||
|
||||
submission inet n - - - - smtpd
|
||||
-o syslog_name=postfix/submission
|
||||
@ -437,7 +438,7 @@
|
||||
-o smtpd_sasl_security_options=noanonymous
|
||||
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject_non_fqdn_recipient,reject_unauth_destination
|
||||
|
||||
然后重启postfix服务
|
||||
然后重启postfix服务:
|
||||
|
||||
service postfix reload
|
||||
|
||||
@ -446,7 +447,7 @@
|
||||
openssl s_client -connect cloud.jhausse.net:587 -starttls smtp
|
||||
EHLO cloud.jhausse.net
|
||||
|
||||
注意一下服务器建议的'250-AUTH PLAIN'功能,在从端口25连接的时候不会生效。
|
||||
注意一下服务器建议的'250-AUTH PLAIN'功能,在从端口25连接的时候不会出现。
|
||||
|
||||
MAIL FROM:asdf@jkl.net
|
||||
rcpt to:bob@gmail.com
|
||||
@ -494,13 +495,13 @@
|
||||
|
||||
PS:不要忘记再次[试试通过端口25往自己架设的服务器上的帐号发送邮件][29],来验证你已经没有被postgrey阻挡了。
|
||||
|
||||
### 阻止垃圾邮件进入你的收件箱 ###
|
||||
## 阻止垃圾邮件进入你的收件箱 ##
|
||||
|
||||
为了过滤垃圾邮件,我们已经使用了实时黑名单(RBLs)和灰名单(postgrey)。现在我们将增加自适应垃圾邮件过滤来让我们的垃圾邮件过滤能力提高一个等级。这意味着我们将为我们的邮件服务器增加人工智能,这样它就能从经验中学习哪些有件是垃圾哪些不是。我们将使用[dspam][30]来实现这个功能。
|
||||
为了过滤垃圾邮件,我们已经使用了实时黑名单(RBL)和灰名单(postgrey)。现在我们将增加自适应垃圾邮件过滤来让我们的垃圾邮件过滤能力提高一个等级。这意味着我们将为我们的邮件服务器增加人工智能,这样它就能从经验中学习哪些邮件是垃圾哪些不是。我们将使用[dspam][30]来实现这个功能。
|
||||
|
||||
apt-get install dspam dovecot-antispam postfix-pcre dovecot-sieve
|
||||
|
||||
dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误分类了之后让dovecot重新更新垃圾邮件过滤器。基本上,我们所需要做的就只是把邮件放进或拿出垃圾箱。dovecot-antispam将负责调用dspam来更新过滤器。至于postfix-pcre和dovecot-sieve,我们将分别用它们来把接收的邮件递给垃圾邮件过滤器以及自动把垃圾邮件放入用户的垃圾箱。
|
||||
dovecot-antispam是一个安装包,可以在我们发现有邮件被dspam误分类了之后让dovecot重新更新垃圾邮件过滤器。基本上,我们所需要做的就只是把邮件放进或拿出垃圾箱。dovecot-antispam将负责调用dspam来更新过滤器。至于postfix-pcre和dovecot-sieve,我们将分别用它们来把接收的邮件传递给垃圾邮件过滤器以及自动把垃圾邮件放入用户的垃圾箱。
|
||||
|
||||
在配置文件**/etc/dspam/dspam.conf**里,为以下参数设置相应的值:
|
||||
|
||||
@ -535,7 +536,7 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
dovecot unix - n n - - pipe
|
||||
flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
|
||||
|
||||
现在我们将告诉postfix通过dspam来过滤所有提交给服务器端口25(一般的SMTP通信)的新邮件,除非该邮件是从服务器本身发出(permit_mynetworks)。注意下我们通过SASL鉴权提交给postfix的邮件不会通过dspam过滤,因为我们在前面部分里为这种方式设定了独立的提交服务。编辑文件**/etc/postfix/main.cf**将选项**smtpd_client_restrictions**改为如下内容:
|
||||
现在我们将告诉postfix通过dspam来过滤所有提交给服务器端口25(一般的SMTP通信)的新邮件,除非该邮件是从服务器本身发出(permit\_mynetworks)。注意下我们通过SASL鉴权提交给postfix的邮件不会通过dspam过滤,因为我们在前面部分里为这种方式设定了独立的提交服务。编辑文件**/etc/postfix/main.cf**将选项**smtpd\_client\_restrictions**改为如下内容:
|
||||
|
||||
smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, check_policy_service inet:127.0.0.1:10023, check_client_access pcre:/etc/postfix/dspam_filter_access
|
||||
|
||||
@ -544,11 +545,11 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
# For DSPAM, only scan one mail at a time
|
||||
dspam_destination_recipient_limit = 1
|
||||
|
||||
现在我们需要指定我们定义的过滤器。基本上,我们将告诉postfix把所有邮件(/./)通过unix套接字发给dspam。创建一个新文件**/etc/postfix/dspam_filter_access**并把下面一行写进去:
|
||||
现在我们需要指定我们定义的过滤器。基本上,我们将告诉postfix把所有邮件(如下用 /./ 代表)通过unix套接字发给dspam。创建一个新文件**/etc/postfix/dspam\_filter\_access**并把下面一行写进去:
|
||||
|
||||
/./ FILTER dspam:unix:/run/dspam/dspam.sock
|
||||
|
||||
这是postfix部分的配置。现在让我们为dovecot设置垃圾过滤。在文件**/etc/dovecot/conf.d/20-imap.conf**里,修改**imap mail_plugin**插件参数为下面的方式:
|
||||
这是postfix部分的配置。现在让我们为dovecot设置垃圾过滤。在文件**/etc/dovecot/conf.d/20-imap.conf**里,修改**imap mail\_plugin**插件参数为下面的方式:
|
||||
|
||||
mail_plugins = $mail_plugins antispam
|
||||
|
||||
@ -581,7 +582,7 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
|
||||
sieve_default = /etc/dovecot/default.sieve
|
||||
|
||||
什么是sieve以及为什么我们需要为所有用户设置一个默认脚本?sieve可以在IMAP服务器上为我们自动处理任务。在我们的例子里,我们想让所有被确定为垃圾的邮件会被移到垃圾箱而不是收件箱里。我们希望这是服务器上所有用户的默认行为;这是为什么我们把这个脚本设为默认脚本。现在让我们来创建这个脚本,建立一个新文件**/etc/dovecot/default.sieve**并写入以下内容:
|
||||
什么是sieve以及为什么我们需要为所有用户设置一个默认脚本?sieve可以在IMAP服务器上为我们自动处理任务。在我们的例子里,我们想让所有被确定为垃圾的邮件移到垃圾箱而不是收件箱里。我们希望这是服务器上所有用户的默认行为;这是为什么我们把这个脚本设为默认脚本。现在让我们来创建这个脚本,建立一个新文件**/etc/dovecot/default.sieve**并写入以下内容:
|
||||
|
||||
require ["regex", "fileinto", "imap4flags"];
|
||||
# Catch mail tagged as Spam, except Spam retrained and delivered to the mailbox
|
||||
@ -603,7 +604,7 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
chmod 0640 default.sieve
|
||||
chmod 0750 default.svbin
|
||||
|
||||
最后,我们需要修改dspam要读取的两个postfix配置文件的权限:
|
||||
最后,我们需要修改dspam需要读取的两个postfix配置文件的权限:
|
||||
|
||||
chmod 0644 /etc/postfix/dynamicmaps.cf /etc/postfix/main.cf
|
||||
|
||||
@ -669,21 +670,21 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
|
||||
很好!你现在已经为你服务器上的用户配置好自适应垃圾邮件过滤。当然,每个用户将需要在开始的几周里培训过滤器。要标记一则信息为垃圾,只需要在你的任意设备(电脑,平板,手机)上将它移动到叫“垃圾箱”或“废纸篓”的目录里。否则它将被标记为有用。
|
||||
|
||||
### 确保你发出的邮件能通过垃圾邮件过滤器 ###
|
||||
## 确保你发出的邮件能通过垃圾邮件过滤器 ##
|
||||
|
||||
这个部分我们的目标是让我们的邮件服务器能尽量干净地出现在世界上,并让垃圾邮件发送者们更难以我们的名义发邮件。作为附加效果,这也有助于让我们的邮件能通过其他邮件服务器的垃圾邮件过滤器。
|
||||
|
||||
#### 发送者策略框架 ####
|
||||
### 发送者策略框架(SPF) ###
|
||||
|
||||
发送者策略框架(SPF)是你添加到自己服务器区域里的一份记录,声明了整个因特网上哪些邮件服务器能以你的域名发邮件。设置非常简单,使用[microsoft.com][31]上的SPF向导来生成你的SPF记录,然后作为一个TXT记录添加到自己的服务器区域里。看上去像这样:
|
||||
|
||||
jhausse.net. 300 IN TXT v=spf1 mx mx:cloud.jhausse.net -all
|
||||
|
||||
#### 反向PTR ####
|
||||
### 反向PTR ###
|
||||
|
||||
我们[之前][32]在本文里讨论过这个问题,建议你为自己的服务器正确地设置反向DNS,这样对服务器IP地址的反向查询能返回你服务器的实际名字。
|
||||
|
||||
#### OpenDKIM ####
|
||||
### OpenDKIM ###
|
||||
|
||||
当我们激活[OpenDKIM][33]后,postfix会用密钥为每封发出去的邮件签名。然后我们将把这个密钥存储在DNS域中。这样的话,世界上任意一个邮件服务器都能够检验邮件是否真的是我们发出的,或是由垃圾邮件发送者伪造的。让我们先安装opendkim:
|
||||
|
||||
@ -710,7 +711,7 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
UMask 022
|
||||
UserID opendkim:opendkim
|
||||
|
||||
我们还需要几个额外的文件,将保存在目录**/etc/opendkim**里:
|
||||
我们还需要几个额外的文件,需保存在目录**/etc/opendkim**里:
|
||||
|
||||
mkdir -pv /etc/opendkim/
|
||||
cd /etc/opendkim/
|
||||
@ -740,7 +741,7 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
|
||||
cat mail.txt
|
||||
|
||||
然后把它作为一个TXT记录添加到区域文件里,应该是这样的
|
||||
然后把它作为一个TXT记录添加到区域文件里,应该是类似这样的
|
||||
|
||||
mail._domainkey.cloud1984.net. 300 IN TXT v=DKIM1; k=rsa; p=MIGfMA0GCSqG...
|
||||
|
||||
@ -751,30 +752,30 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
non_smtpd_milters = $smtpd_milters
|
||||
milter_default_action = accept
|
||||
|
||||
然后重启相关服务
|
||||
然后重启相关服务:
|
||||
|
||||
service postfix reload
|
||||
service opendkim restart
|
||||
|
||||
现在让我们测试一下能找到我们的OpenDKIM公钥并和私钥匹配:
|
||||
现在让我们测试一下是否能找到我们的OpenDKIM公钥并和私钥匹配:
|
||||
|
||||
opendkim-testkey -d jhausse.net -s mail -k mail.private -vvv
|
||||
|
||||
这个应该返回
|
||||
这个应该返回:
|
||||
|
||||
opendkim-testkey: key OK
|
||||
|
||||
这个你可能需要等一会直到域名服务器重新加载该区域(对于Linode,每15分钟会更新一次)。你可以用**dig**来检查区域是否已经重新加载。
|
||||
|
||||
如果这个没问题,让我们测试一下其他服务器能验证我们的OpenDKIM签名和SPF记录。要做这个,我们可以用[Brandon Checkett的邮件测试][34]。发送一封邮件到[Brandon的网页][34]上提供的测试地址,我们可以在服务器上运行下面的命令
|
||||
如果这个没问题,让我们测试一下其他服务器能验证我们的OpenDKIM签名和SPF记录。要做这个,我们可以用[Brandon Checkett的邮件测试系统][34]。发送一封邮件到[Brandon的网页][34]上提供的测试地址,我们可以在服务器上运行下面的命令
|
||||
|
||||
mail -s CloudCheck ihAdmTBmUH@www.brandonchecketts.com
|
||||
|
||||
在Brandon的网页上,我们应该可以在'DKIM Signature'部分里看到**result = pass**的文字,以及在'SPF Information'部分看到**Result: pass**的文字。如果我们的邮件通过这个测试,只要不加-t开关重新生成OpenDKIM密钥,上传新的密钥到区域文件里,然后重新测试检查是否仍然可以通过这些测试。如果可以的话,恭喜!你已经在你的服务器上成功配置好OpenDKIM和SPF了!
|
||||
|
||||
### 使用Owncloud提供日历,联系人,文件服务并通过Roundcube配置网页邮件 ###
|
||||
## 使用Owncloud提供日历,联系人,文件服务并通过Roundcube配置网页邮件 ##
|
||||
|
||||
既然我们已经拥有了一流的邮件服务器,让我们再为它增加在云上保存通讯录,日程表和文件的能力。这些是[Owncloud][35]所提供的非常赞的服务。在这个弄好后,我们还会设置一个网页邮件,这样就算你没带任何电子设备出去旅行时,或者说在你的手机或笔记本没电的情况下,也可以检查邮件。
|
||||
既然我们已经拥有了一流的邮件服务器,让我们再为它增加在云上保存通讯录,日程表和文件的能力。这些是[Owncloud][35]所提供的非常赞的服务。在这个弄好后,我们还会设置一个网页邮件,这样就算你没带任何电子设备出去旅行时,或者说在你的手机或笔记本没电的情况下,也可以通过网吧来检查邮件。
|
||||
|
||||
安装Owncloud非常直观,而且在[这里][36]有非常好的介绍。在Debian系统里,归根结底就是把owncloud的仓库添加到apt源里,下载Owncloud的发行密钥并安装到apt钥匙链中,然后通过apt-get安装Owncloud:
|
||||
|
||||
@ -784,20 +785,20 @@ dovecot-antispam是一个安装包,可以在我们发现有邮件被dspan误
|
||||
apt-get update
|
||||
apt-get install apache2 owncloud roundcube
|
||||
|
||||
在有提示的时候,选择**dbconfig**然后说你希望**roundcube**使用**mysql**。然后,提供一下mysql的root密码并为roundcube的mysql用户设置一个漂亮的密码。然后,按如下方式编辑roundcube的配置文件**/etc/roundcube/main.inc.php**,这样登录roundcube默认会使用你的IMAP服务器:
|
||||
在有提示的时候,选择**dbconfig**并设置**roundcube**使用**mysql**。然后,提供一下mysql的root密码并为roundcube的mysql用户设置一个漂亮的密码。然后,按如下方式编辑roundcube的配置文件**/etc/roundcube/main.inc.php**,这样登录roundcube默认会使用你的IMAP服务器:
|
||||
|
||||
$rcmail_config['default_host'] = 'ssl://localhost';
|
||||
$rcmail_config['default_port'] = 993;
|
||||
|
||||
现在我们来配置一下apache2网页服务器增加SSL支持,这样我们可以和Owncloud和Roundcube对话时使用加密的方式传输我们的密码和数据。让我们打开Apache的ssl模块:
|
||||
现在我们来配置一下apache2网页服务器增加SSL支持,这样我们可以和Owncloud和Roundcube对话时使用加密的方式传输我们的密码和数据。让我们打开Apache的SSL模块:
|
||||
|
||||
a2enmod ssl
|
||||
|
||||
然后编辑文件**/etc/apache2/ports.conf**并设定以下参数:
|
||||
|
||||
NameVirtualHost *:80
|
||||
Listen 80
|
||||
ServerName www.jhausse.net
|
||||
NameVirtualHost *:80
|
||||
Listen 80
|
||||
ServerName www.jhausse.net
|
||||
|
||||
<IfModule mod_ssl.c>
|
||||
# If you add NameVirtualHost *:443 here, you will also have to change
|
||||
@ -969,9 +970,9 @@ ServerName www.jhausse.net
|
||||
a2ensite default default-ssl roundcube
|
||||
service apache2 restart
|
||||
|
||||
关于网页邮件,可以通过网址**https://webmail.jhausse.net**来访问,基本上能工作。之后使用邮箱全名(例如roudy@jhausse.net)和在本文一开始在邮件服务器数据库里设定的密码登录。第一次连接成功,浏览器会警告说证书没有可靠机构的签名。这个没什么关系,只要添加一个例外。
|
||||
关于网页邮件,可以通过网址**https://webmail.jhausse.net**来访问,基本上能工作。之后使用邮箱全名(例如roudy@jhausse.net)和在本文一开始在邮件服务器数据库里设定的密码登录。第一次连接成功,浏览器会警告说证书没有可靠机构的签名。这个没什么关系,只要添加一个例外即可。
|
||||
|
||||
最后但很重要的是,我们将通过把以下内容你哦个写入**/etc/apache2/sites-available/owncloud**来为Owncloud创建一个虚拟主机。
|
||||
最后但很重要的是,我们将通过把以下内容写入到**/etc/apache2/sites-available/owncloud**来为Owncloud创建一个虚拟主机。
|
||||
|
||||
<IfModule mod_ssl.c>
|
||||
<VirtualHost *:443>
|
||||
@ -1040,33 +1041,33 @@ ServerName www.jhausse.net
|
||||
|
||||
就这些了!现在你已经拥有自己的Google Drive,日程表,联系人,Dropbox,以及Gmail!好好享受下新鲜恢复保护的隐私吧!:-)
|
||||
|
||||
### 在云上同步你的设备 ###
|
||||
## 在云上同步你的设备 ##
|
||||
|
||||
要同步你的邮件,你可以只是用你喜欢的邮件客户端:Android或iOS自带的默认邮件应用,[k9mail][37],或者电脑上的Thunderbird。或者你也可以使用我们设置好的网页邮件。
|
||||
要同步你的邮件,你只需用你喜欢的邮件客户端即可:Android或iOS自带的默认邮件应用,[k9mail][37],或者电脑上的Thunderbird。或者你也可以使用我们设置好的网页邮件。
|
||||
|
||||
在Owncloud的文档里描述了如何与云端同步你的日程表和联系人。在Android系统中,我用的是CalDAV-Sync,CardDAV-Sync应用桥接了手机上Android自带日历以及联系人应用和Owncloud服务器。
|
||||
|
||||
对于文件,有一个叫Owncloud的Android应用可以访问你手机上的文件,然后自动把你拍的图片和视频上传到云中。在你的Mac/PC上访问云端文件也很容易,在[Owncloud文档里有很好的描述][38]。
|
||||
|
||||
### 最后一点提示 ###
|
||||
## 最后一点提示 ##
|
||||
|
||||
在上线后的前几个星期里,最好每天检查一下日志**/var/log/syslog**和**/var/log/mail.log**以保证一切都在顺利运行。在你邀请其他人(朋友,家人,等等)加入你的服务器之前这很重要。他们信任你能很好地架设个人服务器维护他们的数据,但是如果服务器突然崩溃会让他们很失望。
|
||||
|
||||
要添加另一个邮件用户,只要在数据库**mailserver**的**virtual_users**表中增加一行。
|
||||
要添加另一个邮件用户,只要在数据库**mailserver**的**virtual\_users**表中增加一行。
|
||||
|
||||
要添加一个域名,只要在**virtual_domains**表中增加一行。然后更新**/etc/opendkim/SigningTable**为发出的邮件签名,上传OpenDKIM密钥到服务器区域,然后吃哦更年期OpenDKIM服务。
|
||||
要添加一个域名,只要在**virtual_domains**表中增加一行。然后更新**/etc/opendkim/SigningTable**为发出的邮件签名,上传OpenDKIM密钥到服务器区域,然后重启OpenDKIM服务。
|
||||
|
||||
Owncloud有自己的用户数据库,在用管理员帐号登录后可以修改。
|
||||
|
||||
最后,万一在服务器临时崩溃的时候想办法找解决方案很重要。比如说,在服务器恢复之前你的邮件应该送往哪儿?一种方式是找个能帮你做备份MX的朋友,同时你也可以当他的备份MX(看下postfix的配置文件**main.cf**里**relay_domains**和**relay_recipient_maps**里的设定)。与此类似,如果你的服务器被破解然后一个坏蛋把你所有文件删了怎么办?对于这个,考虑增加一个常规备份系统就很重要了。Linode提供了备份选项。在1984.is里,我用crontabs和scp做了一个基本但管用的自动备份系统。
|
||||
最后,万一在服务器临时崩溃的时候想办法找解决方案很重要。比如说,在服务器恢复之前你的邮件应该送往哪儿?一种方式是找个能帮你做备份MX的朋友,同时你也可以当他的备份MX(看下postfix的配置文件**main.cf**里**relay\_domains**和**relay\_recipient\_maps**里的设定)。与此类似,如果你的服务器被破解然后一个坏蛋把你所有文件删了怎么办?对于这个,考虑增加一个常规备份系统就很重要了。Linode提供了备份选项。在1984.is里,我用crontabs和scp做了一个基本但管用的自动备份系统。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/tutorial/build-your-own-cloud-on-debian-wheezy/
|
||||
|
||||
作者:[Roudy Jhausse ][a]
|
||||
作者:[Roudy Jhausse][a]
|
||||
译者:[zpl1025](https://github.com/zpl1025)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,12 +1,12 @@
|
||||
怎样在 Linux 中限制网络带宽
|
||||
怎样在 Linux 中限制网络带宽使用
|
||||
================================================================================
|
||||
假如你经常在 Linux 桌面上运行多个网络应用,或在家中让多台电脑共享带宽;(这时,)你可能想更好地控制带宽的使用。否则,当你使用下载器下载一个大文件时,交互式 SSH 会话可能会变得缓慢以至不可用;或者当你通过 Dropbox 来同步一个大文件夹时,你的室友可能会抱怨在她的电脑上,视频流变得断断续续。
|
||||
假如你经常在 Linux 桌面上运行多个网络应用,或在家中让多台电脑共享带宽;那么你可能想更好地控制带宽的使用。否则,当你使用下载器下载一个大文件时,交互式 SSH 会话可能会变得缓慢以至不可用;或者当你通过 Dropbox 来同步一个大文件夹时,你的室友可能会抱怨在她的电脑上,视频流变得断断续续。
|
||||
|
||||
在本教程中,我将为你描述两种 在 Linux 中限制网络流量速率的不同方法。
|
||||
在本教程中,我将为你描述两种在 Linux 中限制网络流量速率的不同方法。
|
||||
|
||||
### 在 Linux 中限制一个应用的速率 ###
|
||||
|
||||
限制网络流量速率的一种方法是通过一个名为[trickle][1]的命令行工具。通过在程序运行时,预先加载一个 速率限制 socket 库 的方法,trickle 命令允许你改变任意一个特定程序的流量。 关于 trickle 命令的一个很好的特征是 它仅在用户空间中运行,这意味着,你不必需要 root 权限来达到限制一个程序的带宽使用的目的。为了与 trickle 程序兼容,这个特定程序必须使用没有静态链接库的套接字接口。当你想对一个不具有内置带宽控制功能的程序进行速率限制时,trickle 可以帮得上忙。
|
||||
限制网络流量速率的一种方法是通过一个名为[trickle][1]的命令行工具。通过在程序运行时,预先加载一个速率限制 socket 库 的方法,trickle 命令允许你改变任意一个特定程序的流量。 trickle 命令有一个很好的特性是它仅在用户空间中运行,这意味着,你不必需要 root 权限就可以限制一个程序的带宽使用。要能使用 trickle 程序控制程序的带宽,这个程序就必须使用非静态链接库的套接字接口。当你想对一个不具有内置带宽控制功能的程序进行速率限制时,trickle 可以帮得上忙。
|
||||
|
||||
在 Ubuntu,Debian 及其衍生发行版中安装 trickle :
|
||||
|
||||
@ -20,10 +20,10 @@ $ sudo apt-get install trickle
|
||||
$ sudo yum install trickle
|
||||
```
|
||||
|
||||
trickle 的基本使用方法如下。仅需简单地把 trickle 命令(带有速率参数)放在你想运行的命令之前。
|
||||
trickle 的基本使用方法如下。仅需简单地把 trickle 命令(及速率参数)放在你想运行的命令之前。
|
||||
|
||||
```
|
||||
$ trickle -d <download-rate> -u <upload-rate> <command>
|
||||
$ trickle -d <download-rate> -u <upload-rate> <command>
|
||||
```
|
||||
|
||||
这就可以将 `<command>` 的下载和上传速率限定为特定值(单位 KBytes/s)。
|
||||
@ -34,27 +34,27 @@ $ trickle -d <download-rate> -u <upload-rate> <command>
|
||||
$ trickle -u 100 scp backup.tgz alice@remote_host.com:
|
||||
```
|
||||
|
||||
如若你想,你可以使用下面的命令为你的 Firefox 浏览器设定最大下载速率(e.g. , 300 KB/s),通过产生一个[自定义启动器][3]的方式。
|
||||
如若你想,你可以通过创建一个[自定义启动器][3]的方式,使用下面的命令为你的 Firefox 浏览器设定最大下载速率(例如, 300 KB/s)。
|
||||
|
||||
```
|
||||
trickle -d 300 firefox %u
|
||||
```
|
||||
|
||||
最后, trickle 也可以 以守护进程模式运行,在该模式下,它将会限制所有通过 trickle 启动且正在运行的程序的总的带宽和。 启动 trickle 使其作为一个守护进程(i.e., trickled):
|
||||
最后, trickle 也可以以守护进程模式运行,在该模式下,它将会限制所有通过 trickle 启动且正在运行的程序的总带宽之和。 启动 trickle 使其作为一个守护进程(例如, trickled):
|
||||
|
||||
```
|
||||
$ sudo trickled -d 1000
|
||||
```
|
||||
|
||||
一旦 trickled 守护进程在后台运行,你便可以通过 trickle 命令来启动其他程序。假如你通过 trickle 启动一个程序,那么这个程序的最大下载速率将是 1000 KB/s, 假如你再通过 trickle 启动了另一个程序,则每个程序的(下载)速率极限将会被限制为 500 KB/s, 等等。
|
||||
一旦 trickled 守护进程在后台运行,你便可以通过 trickle 命令来启动其他程序。假如你通过 trickle 启动一个程序,那么这个程序的最大下载速率将是 1000 KB/s, 假如你再通过 trickle 启动了另一个程序,则每个程序的(下载)速率极限将会被限制为 500 KB/s,等等。
|
||||
|
||||
### 在 Linux 中限制一个网络接口的速率 ###
|
||||
|
||||
另一种控制你的带宽资源的方式是在每一个接口上限制带宽。这在你与其他人分享你的网络连接的上行带宽时尤为实用。同其他一样,Linux 有一个工具来为你做这件事。[wondershaper][4]恰好执行限制网络接口速率的任务。
|
||||
另一种控制你的带宽资源的方式是在每一个接口上限制带宽。这在你与其他人分享你的网络连接的上行带宽时尤为实用。同其他一样,Linux 有一个工具来为你做这件事。[wondershaper][4]就是干这个的。
|
||||
|
||||
wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量调整命令,使用 QoS 来处理特定的网络接口。通过放置被赋予不同的优先级的传出流量在一个队列中,达到限制传出流量速率的目的, 而传入流量通过丢包的方式来达到速率限制的目的。
|
||||
wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量调整命令,使用 QoS 来处理特定的网络接口。外发流量通过放在不同优先级的队列中,达到限制传出流量速率的目的;而传入流量通过丢包的方式来达到速率限制的目的。
|
||||
|
||||
事实上, wondershaper 的既定目标不仅仅是对一个接口增加其带宽上限;当批量下载或上传正在进行时,wondershaper 还试图去保持互动性会话如SSH 的低延迟。同样的,它还确保批量上传(e.g. , Dropbox 的同步)不会使得下载“窒息”,反之亦然。
|
||||
事实上, wondershaper 的既定目标不仅仅是对一个接口增加其带宽上限;当批量下载或上传正在进行时,wondershaper 还试图去保持互动性会话如 SSH 的低延迟。同样的,它还会控制批量上传(例如, Dropbox 的同步)不会使得下载“窒息”,反之亦然。
|
||||
|
||||
在 Ubuntu Debian 及其衍生发行版本 中安装 wondershaper:
|
||||
|
||||
@ -62,9 +62,9 @@ wondershaper 实际上是一个 shell 脚本,它使用 [tc][5] 来定义流量
|
||||
$ sudo apt-get install wondershaper
|
||||
```
|
||||
|
||||
在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2]) 中安装 wondershaper:(注:这里 链接 2 和 6 一样,可以删除其中之一)
|
||||
在 Fdora 或 CentOS/RHEL (带有 [EPEL 软件仓库][2]) 中安装 wondershaper:
|
||||
|
||||
``
|
||||
```
|
||||
$ sudo yum install wondershaper
|
||||
```
|
||||
|
||||
@ -90,7 +90,7 @@ $ sudo wondershaper clear eth0
|
||||
|
||||
### 总结 ###
|
||||
|
||||
在本教程中,我介绍了两种不同的方法,来达到如何在 Linux 桌面环境中,控制每个应用或每个接口的带宽使用的目的。 这些工具对用户都及其友好,都为用户提供了一个快速且容易的方式来调整或限制流量。 对于那些想更多地了解如何在 Linux 中进行速率控制的读者,请参考 [the Linux bible][7].
|
||||
在本教程中,我介绍了两种不同的方法,来达到如何在 Linux 桌面环境中,控制每个应用或每个接口的带宽使用的目的。 这些工具的使用都很简单,都为用户提供了一个快速且容易的方式来调整或限制流量。 对于那些想更多地了解如何在 Linux 中进行速率控制的读者,请参考 [the Linux bible][7].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -98,15 +98,15 @@ via: http://xmodulo.com/limit-network-bandwidth-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://monkey.org/~marius/trickle
|
||||
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[2]:http://linux.cn/article-2324-1.html
|
||||
[3]:http://xmodulo.com/create-desktop-shortcut-launcher-linux.html
|
||||
[4]:http://lartc.org/wondershaper/
|
||||
[5]:http://lartc.org/manpages/tc.txt
|
||||
[6]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[6]:http://linux.cn/article-2324-1.html
|
||||
[7]:http://www.lartc.org/lartc.html
|
@ -2,11 +2,11 @@
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Plasma_Ubuntu_1410.jpg)
|
||||
|
||||
[KDE][1] Plasma 5.2已经[发布][2],在本篇中我们将看到如何在Ubuntu 14.10 上安装KDE Plasma 5.2。
|
||||
[KDE][1] Plasma 5.2已经[发布][2]一段时间了,在本篇中我们将看到如何在Ubuntu 14.10 上安装KDE Plasma 5.2。
|
||||
|
||||
Ubuntu的默认桌面环境Unity很漂亮还有很多特性。但是如果你问任何有经验的Linux用户关于桌面自定义,他的回答将是KDE。KDE在定制上是王者并且它得到流行大概是由于Ubuntu有官方的KDE版本,也就是Kubuntu[3]。
|
||||
Ubuntu的默认桌面环境Unity很漂亮还有很多特性,但是如果你问任何有经验的Linux用户关于桌面定制能力,他的回答将是KDE。KDE在定制上是王者并且它得到流行大概是由于Ubuntu有官方的KDE版本,也就是Kubuntu[3]。
|
||||
|
||||
对于Ubuntu(或者任何其他的Linux系统而言)的一个好消息是它没有绑定任何特定的桌面环境。你可以安装额外的桌面环境并且可以在不同的桌面环境间切换。早先我们已经了解了桌面环境的安装。
|
||||
对于Ubuntu(或者任何其他的Linux系统)而言的一个好消息是它们没有绑定在任何特定的桌面环境上,你可以安装额外的桌面环境并在不同的桌面环境间切换。早先我们已经了解如下的桌面环境的安装。
|
||||
|
||||
- [如何在Ubuntu 14.04中安装Mate桌面][4]
|
||||
- [如何在Ubuntu 14.04中安装Cinnamon桌面][5]
|
||||
@ -17,25 +17,24 @@ Ubuntu的默认桌面环境Unity很漂亮还有很多特性。但是如果你问
|
||||
|
||||
### 如何在Ubuntu 14.10 上安装KDE Plasma 5.2 ###
|
||||
|
||||
在Ubuntu 14.10上安装Plasma之前,你要知道这会下载大概1GB的内容。因此在安装KDE之前要考虑速度和数据包。我们下载所使用的PPA是KDEs社区官方提供的。在终端中使用下面的命令:
|
||||
在Ubuntu 14.10上安装Plasma之前,你要知道这会下载大概1GB的内容。因此在安装KDE之前要考虑速度和数据存放空间。我们下载所使用的PPA是KDE社区官方提供的。在终端中使用下面的命令:
|
||||
|
||||
sudo apt-add-repository ppa:kubuntu-ppa/next-backports
|
||||
sudo apt-get update
|
||||
sudo apt-get dist-upgrade
|
||||
sudo apt-get install kubuntu-plasma5-desktop plasma-workspace-wallpapers
|
||||
|
||||
During the installation, it will as you to choose the default display manager. I chose the default LightDM. Once installed, restart the system. At the login, click on the Ubuntu symbol beside the login field. In here, select Plasma.
|
||||
在安装中,我们要选择默认的显示管理器。我选择的是默认的LightDM。安装完成后,重启系统。在登录时,点击登录区域旁边的Ubuntu图标。这里选择Plasma。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/Select_Plasma_KDE_Ubuntu.jpeg)
|
||||
|
||||
你现在就登录到KDE Plasma了。这里有一个KDE Plasma 5.2在Ubuntu 14.10下的截图
|
||||
你现在就登录到KDE Plasma了。这里有一个KDE Plasma 5.2在Ubuntu 14.10下的截图:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/KDE_Plasma_Desktop.jpeg)
|
||||
|
||||
### 从Ubuntu卸载KDE Plasma ###
|
||||
### 从Ubuntu中卸载KDE Plasma ###
|
||||
|
||||
如果你想要还原更改,使用下面的命令从Ubuntu 14.10中卸载KDE Plasma。
|
||||
如果你想要卸载它,使用下面的命令从Ubuntu 14.10中卸载KDE Plasma。
|
||||
|
||||
sudo apt-get install ppa-purge
|
||||
sudo apt-get remove kubuntu-plasma5-desktop
|
||||
@ -47,7 +46,7 @@ via: http://itsfoss.com/install-kde-plasma-ubuntu-1410/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -2,7 +2,7 @@
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Use_Weather_Conky_Linux.jpeg)
|
||||
|
||||
智能手机都拥有一些平滑融入手机外观的天气小插件,幸亏有了 Flair Weather Conky,你便可以**在你的 Linux 桌面中拥有像智能手机一样的天气外观**。我们将使用一个 GUI 工具[Conky Manager 在 Linux 中轻松地管理 Conky][1]。那就先让我们看看如何在 Ubuntu 14.10,14.04、Linux Mint 17 及其他 Linux 发行版本中安装 Conky Manager 吧。
|
||||
智能手机都拥有一些平滑地融入手机外观的天气小插件,现在幸亏有了 Flair Weather Conky,你便可以**在你的 Linux 桌面中拥有像智能手机一样的天气外观**。我们将使用一个 GUI 工具[Conky Manager 在 Linux 中轻松地管理 Conky][1]。那就先让我们看看如何在 Ubuntu 14.10,14.04、Linux Mint 17 及其他 Linux 发行版本中安装 Conky Manager 吧。
|
||||
|
||||
### 安装 Conky Manager ###
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
### 确保 `curl` 已被安装 ###
|
||||
|
||||
请确保 [curl][2] 已被安装。(如果没有安装它,)可以使用下面的命令来安装:
|
||||
请确保 [curl][2] 已被安装。如果没有安装它,可以使用下面的命令来安装:
|
||||
|
||||
sudo apt-get install curl
|
||||
|
||||
@ -30,15 +30,15 @@
|
||||
|
||||
#### 步骤 1: ####
|
||||
|
||||
同你在 Ubuntu 14.04 中安装主题一样,在你的家目录中应该有一个 `.conky` 目录。假如你使用命令行,则不需要让我来告诉你如何找到这个目录。对于新手,请用文件管理器切换到你的家目录下,并按 `Ctrl+H` 来 [在 Ubuntu 中显示隐藏文件][4]。在这里查找 `.conky` 文件夹,假如没有这个文件夹,则创建一个。
|
||||
同你在 Ubuntu 14.04 中安装主题一样,在你的家目录中应该有一个 `.conky` 目录。假如你使用命令行,我想我不需要告诉你如何找到这个目录。对于新手,请用文件管理器切换到你的家目录下,并按 `Ctrl+H` 来 [在 Ubuntu 中显示隐藏文件][4]。在这里查找 `.conky` 文件夹,假如没有这个文件夹,则创建一个。
|
||||
|
||||
#### 步骤 2: ####
|
||||
|
||||
在 `.conky` 目录中,解压下载到的 Flair Weather 文件。请注意在默认情况下它会自动解压到一个名为 `.conky` 目录。所以请进入这个目录,将 Flair Weather 文件夹从中取出,然后将它粘贴到真正的 `.conky` 目录下。
|
||||
在 `.conky` 目录中,解压下载到的 Flair Weather 文件。请注意在默认情况下它会自动解压到一个名为 `.conky` 目录下。所以请进入这个目录,将其中的 Flair Weather 文件夹从中取出,然后将它粘贴到真正的 `.conky` 目录下。
|
||||
|
||||
#### 步骤 3: ####
|
||||
|
||||
Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的位置。你需要手动地编辑它。到[Yahoo 天气][5] 网页,然后通过键入你的城市/Pin 码来得到你所在城市的 位置 ID号。你可以从网页地址栏中取得位置 ID 号。
|
||||
Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的位置。你需要手动地编辑它。到[Yahoo 天气][5] 网页,然后通过键入你的城市/Pin 码来得到你所在城市的位置 ID号。你可以从网页地址栏中取得位置 ID 号。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Yahoo_Weather_Location_Code.jpeg)
|
||||
|
||||
@ -46,7 +46,7 @@ Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的
|
||||
|
||||
打开 Conky Manager,它应该能够读取新安装的 Conky 脚本。这里有两款样式可用,黑色主题或亮丽主题。你可以选择你偏爱的那一款。当你选择后,你就可以在桌面上看到 conky 的显示了。
|
||||
|
||||
在 Flair Weather 中,默认位置被设定为 Melbourne。你必须手动编辑 conky 文件。
|
||||
在 Flair Weather 中,默认位置被设定为 Melbourne。你必须手动编辑 conky 文件来修改。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Using_Weather_Conky_Ubuntu.jpeg)
|
||||
|
||||
@ -56,44 +56,49 @@ Flair Weather 使用 Yahoo 的天气服务,但它不能自动地识别你的
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Edit_Conky.jpeg)
|
||||
|
||||
在上面查找的相同位置,假如你将 C 替换为 F,则温度的单位将从摄氏温标改为华氏温标 。不要忘了重启 Conky 来查看已经做出的修改。
|
||||
在上面查找的相同位置,假如你将`u=c` 替换为`u=f`,则温度的单位将从摄氏温标改为华氏温标 。不要忘了重启 Conky 来查看已经做出的修改。
|
||||
|
||||
#### 可能的故障排除 ####
|
||||
(注:这一小节在 md 文件中没有,原文新添加的。)
|
||||
|
||||
在 Ubuntu 14.04 和 Ubuntu 14.10 中,假如你发现 Conky 展示的时间有重叠现象,则请编辑 conky 脚本。查找下面的这些行:
|
||||
|
||||
```
|
||||
## cairo-compmgr
|
||||
own_window_type override
|
||||
own_window_argb_visual no
|
||||
```
|
||||
|
||||
然后将内容更换为下面的这些行:
|
||||
|
||||
|
||||
```
|
||||
## cairo-compmgr
|
||||
own_window_type dock
|
||||
own_window_argb_visual no
|
||||
```
|
||||
|
||||
保存更改并重启 conky。这就应该解决了这个问题。感谢 Jesse(这个 Conky 脚本的开发者)给我们提供了这个解决方法和为其他相关问题给予的支持。
|
||||
|
||||
#### 尝试尝试 ####
|
||||
### 尝试一下 ###
|
||||
|
||||
在这篇文章中,我们实际上学到了不少东西。我们见证了如何轻松地使用任何 Conky 脚本,如何编辑脚本以及如何使用 Conky Manager 来达到不同的目的。我希望这些对你有用。
|
||||
|
||||
需要留心的是,Ubuntu 14.10 用户可能会看到重叠的时间数字。请在开发者 Jesse 绝妙的[Google + 主页][6] 中报告任何相关的问题。(注:这句在 md 文件中的内容与原文有差异,我按照原文翻译,并加上了 链接)
|
||||
需要留心的是,Ubuntu 14.10 用户可能会看到重叠的时间数字。请在开发者 Jesse 绝妙的[Google + 主页][6] 中报告任何相关的问题。
|
||||
|
||||
我已经向你展示了在我的系统上 Flair Weather conky 外观的截图。现在是该你尝试它并炫耀你的桌面的时间了。
|
||||
|
||||
我已经向你展示了在我的系统上 Flair Weather conky 外观的截图。现在该你尝试它并炫耀你的桌面的时间了。
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/weather-conky-linux/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/Abhishek/
|
||||
[1]:http://itsfoss.com/conky-gui-ubuntu-1304/
|
||||
[1]:http://www.linux.cn/article-3434-1.html
|
||||
[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/
|
@ -1,6 +1,6 @@
|
||||
Linux 基础:在CentOS 7上给一个网卡分配多个IP地址
|
||||
在CentOS 7上给一个网卡分配多个IP地址
|
||||
================================================================================
|
||||
有时你也许想要给一个网卡多个地址。你该怎么做呢?另外买一个网卡来分配地址?不用这么做(只要在小型网络中)。我们现在可以再CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么?好的,跟随我,这并不难。
|
||||
有时你也许想要给一个网卡多个地址。你该怎么做呢?另外买一个网卡来分配地址?在小型网络中其实不用这么做。我们现在可以在CentOS/RHEL 7中给一个网卡分配多个ip地址。想知道怎么做么?好的,跟随我,这并不难。
|
||||
|
||||
首先,让我们找到网卡的IP地址。在我的CentOS 7服务器中,我只使用了一个网卡。
|
||||
|
||||
@ -83,7 +83,6 @@ Linux 基础:在CentOS 7上给一个网卡分配多个IP地址
|
||||
|
||||
类似地,你可以加入更多的ip地址。
|
||||
|
||||
Finally, save and close the file. Restart network service to take effect the changes.
|
||||
最后,保存并退出文件。重启网络服务来使更改生效。
|
||||
|
||||
systemctl restart network
|
||||
@ -172,11 +171,9 @@ Finally, save and close the file. Restart network service to take effect the cha
|
||||
IPV6_PEERDNS="yes"
|
||||
IPV6_PEERROUTES="yes"
|
||||
|
||||
你可以看到我已经添加一个A类地址(10.0.0.1)并且前缀是16
|
||||
你可以看到我已经添加一个A类地址(10.0.0.1)并且前缀是16。
|
||||
|
||||
保存并退出文件。重启网络服务,
|
||||
|
||||
接着,ping新增的地址:
|
||||
保存并退出文件。重启网络服务,接着,ping新增的地址:
|
||||
|
||||
ping -c 4 10.0.0.1
|
||||
|
||||
@ -202,7 +199,7 @@ via: http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-net
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -2,16 +2,11 @@ Linux 下最为人熟知的归档/压缩工具
|
||||
================================================================================
|
||||
很多时候,通过互联网发送或接收大文件和图片是一件令人头疼的事。压缩及解压缩工具正好可以应对这个问题。下面让我们快速浏览一些可以使得我们的工作更加轻松的开源工具。
|
||||
|
||||
Tar
|
||||
gzip, gunzip
|
||||
bzip2, bunzip2
|
||||
7-Zip
|
||||
|
||||
### Tar ###
|
||||
|
||||
Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存储文件。Tar 是一个 GNU 软件,它可以压缩一组文件(归档),或提取它们以及对已经存在的压缩文件进行相关操作。在存储、备份以及转移文件方面,它是很有帮助的。在创建归档文件时,Tar 可以保持原有文件和目录结构不变。通过 Tar 归档的文件的后缀名为 ‘.tar’。
|
||||
Tar 由 'Tape archiver(磁带归档器)' 衍生而来,最初被用来在磁带上归档和存储文件。Tar 是一个 GNU 软件,它可以压缩一组文件(归档),或提取它们以及对已有的归档文件进行相关操作。在存储、备份以及传输文件方面,它是很有用的。在创建归档文件时,Tar 可以保持原有文件和目录结构不变。通过 Tar 归档的文件的后缀名为 ‘.tar’。
|
||||
|
||||
基本用法
|
||||
**基本用法如下:**
|
||||
|
||||
#### a) 创建归档 (c / --create) ####
|
||||
|
||||
@ -23,7 +18,7 @@ Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存
|
||||
|
||||
![tar cvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-cvf.png)
|
||||
|
||||
创建一个归档
|
||||
*创建一个归档*
|
||||
|
||||
#### b) 列出归档文件内容 ( t / --list) ####
|
||||
|
||||
@ -31,7 +26,7 @@ Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存
|
||||
|
||||
![tar tvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-tvf.png)
|
||||
|
||||
列出归档中包含的文件
|
||||
*列出归档中包含的文件*
|
||||
|
||||
#### c) 提取归档 (x / --extract) ####
|
||||
|
||||
@ -41,45 +36,45 @@ Tar 由 'Tape archiver' 衍生而来,最初被用来在磁带上归档和存
|
||||
|
||||
![tar xvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-xvf.png)
|
||||
|
||||
提取文件
|
||||
*提取文件*
|
||||
|
||||
![tar xvf --wildcards](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-wildcard.png)
|
||||
|
||||
只提取需要的文件
|
||||
*只提取需要的文件*
|
||||
|
||||
#### d) 对归档进行更新 ( u / --update) ####
|
||||
#### d) 对归档文件进行更新 ( u / --update) ####
|
||||
|
||||
tar uvf archive.tar newfile.c - 假如归档的版本比先前存在的版本新,通过添加文件 newfile.c 来更新归档.
|
||||
tar uvf archive.tar newfile.c - 假如归档的newfile.c 要比先前已经归档的新,则添加更新的 newfile.c 到归档里面.
|
||||
|
||||
![tar uvf](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-uvf.png)
|
||||
|
||||
更新一个归档
|
||||
*更新一个归档*
|
||||
|
||||
#### e) 从归档中删除文件 (--delete) ####
|
||||
|
||||
tar--delete -f archive.tar file1.c - 从压缩包'archive.tar' 中删除文件'file1.c'
|
||||
tar --delete -f archive.tar file1.c - 从压缩包'archive.tar' 中删除文件'file1.c'
|
||||
|
||||
![tar --delete](http://blog.linoxide.com/wp-content/uploads/2015/01/tar-delete.png)
|
||||
|
||||
删除文件
|
||||
*删除文件*
|
||||
|
||||
更加具体的使用方法请参考[tar 主页][1]。
|
||||
|
||||
### Gzip / Gunzip ###
|
||||
|
||||
Gzip 代表 GNU zip,它是一个被广泛用于 Linux 操作系统中的压缩应用,被其压缩的文件的后缀名为'*.gz' 。
|
||||
Gzip 即 GNU zip,它是一个被广泛用于 Linux 操作系统中的压缩应用,被其压缩的文件的后缀名为'*.gz' 。
|
||||
|
||||
** 基本用法 **
|
||||
**基本用法如下:**
|
||||
|
||||
#### a) 压缩文件 ####
|
||||
|
||||
gzip file(s)
|
||||
|
||||
每个文件将被单独压缩。
|
||||
每个文件将被**单独压缩**。
|
||||
|
||||
![gzip](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip.png)
|
||||
|
||||
压缩文件
|
||||
*压缩文件*
|
||||
|
||||
通常在压缩完成后,它会将原来的文件删除。我们可以使用 `-c` 选项来保留原来的文件。
|
||||
|
||||
@ -87,7 +82,7 @@ Gzip 代表 GNU zip,它是一个被广泛用于 Linux 操作系统中的压缩
|
||||
|
||||
![gzip-c](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-c.png)
|
||||
|
||||
压缩后保留原有文件
|
||||
*压缩后保留原有文件*
|
||||
|
||||
我们也可以将一组文件压缩到一个单独的文件中
|
||||
|
||||
@ -95,7 +90,7 @@ Gzip 代表 GNU zip,它是一个被广泛用于 Linux 操作系统中的压缩
|
||||
|
||||
![gz group](http://blog.linoxide.com/wp-content/uploads/2015/01/gz-group.png)
|
||||
|
||||
压缩一组文件
|
||||
*压缩一组文件*
|
||||
|
||||
#### b) 检查压缩比 ####
|
||||
|
||||
@ -105,17 +100,17 @@ Gzip 代表 GNU zip,它是一个被广泛用于 Linux 操作系统中的压缩
|
||||
|
||||
![gzip -l](http://blog.linoxide.com/wp-content/uploads/2015/01/gzip-l.png)
|
||||
|
||||
检查压缩率
|
||||
*检查压缩率*
|
||||
|
||||
#### c) 解压文件 ####
|
||||
|
||||
Gunzip 被用来解压文件,在这里,原有文件在被解压后同样会被删除。使用 `-c`选项来保留原始文件。
|
||||
Gunzip 用来解压文件,在这里,原有的(压缩)文件在被解压后同样会被删除。使用 `-c`选项来保留原始文件。
|
||||
|
||||
gunzip -c archieve.gz
|
||||
|
||||
![gunzip -c](http://blog.linoxide.com/wp-content/uploads/2015/01/gunzip-c.png)
|
||||
|
||||
解压文件
|
||||
*解压文件*
|
||||
|
||||
gzip 加上'-d'选项 和 gunzip 对压缩文件有同样的效果。
|
||||
|
||||
@ -125,47 +120,50 @@ gzip 加上'-d'选项 和 gunzip 对压缩文件有同样的效果。
|
||||
|
||||
同 gzip 一样,[Bzip2][3] 也是一个压缩工具,与其他传统的工具相比,它可以将文件压缩到更小,但其缺点为:运行速度比 gzip 慢。
|
||||
|
||||
** 基本用法 **
|
||||
**基本用法如下:**
|
||||
|
||||
#### a) 压缩文件 ####
|
||||
|
||||
一般情况下,针对压缩而言,Bzip2 没有选项可供选择,将被压缩的文件被传递为它的参数。每个文件被单独压缩,且压缩文件以 'bz2' 为后缀名。
|
||||
一般情况下,针对压缩而言,Bzip2 不用什么选项,将被压缩的文件被传递为它的参数。每个文件被单独压缩,且压缩文件以 'bz2' 为后缀名。
|
||||
|
||||
bzip2 file1 file2 file3
|
||||
|
||||
![bzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2.png)
|
||||
|
||||
文件压缩
|
||||
*文件压缩*
|
||||
|
||||
使用 '-k' 选项可以使得 在压缩或解压缩之后保留原有的文件。
|
||||
使用 '-k' 选项可以使得在压缩或解压缩之后保留原有的文件。
|
||||
|
||||
![bzip2 -k](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-k.png)
|
||||
|
||||
在压缩后保留原有文件。
|
||||
*在压缩后保留原有文件*
|
||||
|
||||
'-d' 选项被用来强制解压缩。
|
||||
|
||||
#### b) 解压 ####
|
||||
|
||||
'-d' 选项被用来解压缩。
|
||||
|
||||
![bzip2 -d](http://blog.linoxide.com/wp-content/uploads/2015/01/bzip2-d.png)
|
||||
|
||||
使用 -d 选项删除文件 (!! 注:我(FSSlc)认为 这里的图片说明有误,可以参考 manpage或bzip 的官网来校对一下。)
|
||||
*使用 -d 选项解压缩文件*
|
||||
|
||||
#### b) 解压 ####
|
||||
也可以使用 bunzip2 来解压缩。
|
||||
|
||||
bunzip2 filename
|
||||
|
||||
![bunzip2](http://blog.linoxide.com/wp-content/uploads/2015/01/bunzip2.png)
|
||||
|
||||
解压文件
|
||||
*解压文件*
|
||||
|
||||
bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2 和 tbz 的文件在压缩后,后缀名将变为'.tar' 。
|
||||
|
||||
bzip2 -dc 执行解压文件到标准输出的功能。
|
||||
bzip2 -dc - 执行解压文件到标准输出的功能。
|
||||
|
||||
### 7-zip ###
|
||||
|
||||
[7-zip][4] 是另一个开源压缩软件。它使用 7z 这种新的压缩格式,并支持高压缩比。因此,它被认为是比先前提及的压缩工具更好的软件。在 Linux 下,可以通过 p7zip 软件包得到,该软件包里包含 3 个二进制文件 – 7z, 7za 和 7zr,读者可以参考 [p7zip wiki][5] 来了解这三个二进制文件之间的不同。在本篇中,我们将使用 7zr 来解释 7-zip 的用法。归档文件以 '.7z' 为后缀名。
|
||||
[7-zip][4] 是另一个开源压缩软件。它使用 7z 这种新的压缩格式,并支持高压缩比。因此,它被认为是比先前提及的压缩工具更好的软件。在 Linux 下,可以通过 p7zip 软件包得到,该软件包里包含 3 个二进制文件: 7z, 7za 和 7zr,读者可以参考 [p7zip wiki][5] 来了解这三个二进制文件之间的不同。在本篇中,我们将使用 7zr 来解释 7-zip 的用法。归档文件以 '.7z' 为后缀名。
|
||||
|
||||
** 基本用法 **
|
||||
**基本用法如下:**
|
||||
|
||||
#### a) 创建归档 ####
|
||||
|
||||
@ -173,7 +171,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
|
||||
|
||||
![7zr a](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-a.png)
|
||||
|
||||
创建一个归档文件
|
||||
*创建一个归档文件*
|
||||
|
||||
#### b) 列出归档包含文件 ####
|
||||
|
||||
@ -181,7 +179,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
|
||||
|
||||
![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-l.png)
|
||||
|
||||
列出归档中包含的文件
|
||||
*列出归档中包含的文件*
|
||||
|
||||
#### c) 提取归档文件 ####
|
||||
|
||||
@ -189,7 +187,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
|
||||
|
||||
![7zr e](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-e.png)
|
||||
|
||||
提取归档
|
||||
*提取归档*
|
||||
|
||||
#### d) 更新归档文件 ####
|
||||
|
||||
@ -197,7 +195,7 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
|
||||
|
||||
![7zr u](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-u.png)
|
||||
|
||||
更新一个归档文件
|
||||
*更新一个归档文件*
|
||||
|
||||
#### e) 从归档文件中删除文件 ####
|
||||
|
||||
@ -205,11 +203,11 @@ bunzip2 可以解压后缀名为 bz2, bz, tbz2 和 tbz 的文件。带有 tbz2
|
||||
|
||||
![7zr d](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d.png)
|
||||
|
||||
删除文件
|
||||
*删除文件*
|
||||
|
||||
![7zr l](http://blog.linoxide.com/wp-content/uploads/2015/01/7zr-d-l.png)
|
||||
|
||||
确认文件删除
|
||||
*确认文件删除*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -217,7 +215,7 @@ via: http://linoxide.com/tools/linux-compress-decompress-tools/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[FSSlc](https://github.com/FSSlc)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -36,7 +36,7 @@ via: http://www.ubuntugeek.com/how-to-protect-ubuntu-server-against-the-ghost-vu
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
110
sources/share/20150326 Mydumper--Mysql Database Backup tool.md
Normal file
110
sources/share/20150326 Mydumper--Mysql Database Backup tool.md
Normal file
@ -0,0 +1,110 @@
|
||||
Mydumper – Mysql Database Backup tool
|
||||
================================================================================
|
||||
Mydumper is a tool used for backing up MySQL database servers much faster than the mysqldump tool distributed with MySQL. It also has the capability to retrieve the binary logs from the remote server at the same time as the dump itself.
|
||||
|
||||
### Mydumper advantages ###
|
||||
|
||||
o Parallelism (hence, speed) and performance (avoids expensive character set conversion routines, efficient code overall)
|
||||
|
||||
o Easier to manage output (separate files for tables, dump metadata,etc, easy to view/parse data)
|
||||
|
||||
o Consistency -- maintains snapshot across all threads, provides accurate master and slave log positions, etc
|
||||
|
||||
o Manageability -- supports PCRE for specifying database and tables inclusions and exclusions
|
||||
|
||||
### Install mydumper on ubuntu ###
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo apt-get install mydumper
|
||||
|
||||
### Using Mydumper ###
|
||||
|
||||
#### Syntax ####
|
||||
|
||||
mydumper [options]
|
||||
|
||||
Application Options:
|
||||
|
||||
- -B, --database Database to dump
|
||||
- -T, --tables-list Comma delimited table list to dump (does not exclude regex option)
|
||||
- -o, --outputdir Directory to output files to
|
||||
- -s, --statement-size Attempted size of INSERT statement in bytes, default 1000000
|
||||
- -r, --rows Try to split tables into chunks of this many rows
|
||||
- -c, --compress Compress output files
|
||||
- -e, --build-empty-files Build dump files even if no data available from table
|
||||
- -x, --regex Regular expression for ‘db.table' matching
|
||||
- -i, --ignore-engines Comma delimited list of storage engines to ignore
|
||||
- -m, --no-schemas Do not dump table schemas with the data
|
||||
- -k, --no-locks Do not execute the temporary shared read lock. WARNING: This will cause inconsistent backups
|
||||
- -l, --long-query-guard Set long query timer in seconds, default 60
|
||||
- --kill-long-queries Kill long running queries (instead of aborting)
|
||||
- -b, --binlogs Get a snapshot of the binary logs as well as dump data
|
||||
- -D, --daemon Enable daemon mode
|
||||
- -I, --snapshot-interval Interval between each dump snapshot (in minutes), requires --daemon, default 60
|
||||
- -L, --logfile Log file name to use, by default stdout is used
|
||||
- -h, --host The host to connect to
|
||||
- -u, --user Username with privileges to run the dump
|
||||
- -p, --password User password
|
||||
- -P, --port TCP/IP port to connect to
|
||||
- -S, --socket UNIX domain socket file to use for connection
|
||||
- -t, --threads Number of threads to use, default 4
|
||||
- -C, --compress-protocol Use compression on the MySQL connection
|
||||
- -V, --version Show the program version and exit
|
||||
- -v, --verbose Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2
|
||||
|
||||
#### Mydumper Example ####
|
||||
|
||||
mydumper \
|
||||
--database=$DB_NAME \
|
||||
--host=$DB_HOST \
|
||||
--user=$DB_USER \
|
||||
--password=$DB_PASS \
|
||||
--outputdir=$DB_DUMP \
|
||||
--rows=500000 \
|
||||
--compress \
|
||||
--build-empty-files \
|
||||
--threads=2 \
|
||||
--compress-protocol
|
||||
|
||||
Description of Mydumper's output data
|
||||
|
||||
Mydumper does not output to files, but rather to files in a directory. The --outputdir option specifies the name of the directory to use.
|
||||
|
||||
The output is two parts
|
||||
|
||||
Schema
|
||||
|
||||
For each table in the database, a file containing the CREATE TABLE statement will be created. It will be named:
|
||||
|
||||
dbname.tablename-schema.sql.gz
|
||||
|
||||
Data
|
||||
|
||||
For each table with number of rows above the --rows parameter, you will have a file called:
|
||||
|
||||
dbname.tablename.0000n.sql.gz
|
||||
|
||||
Where "n" starts with 0 up to the number of.
|
||||
|
||||
If you want to restore these backup you can use Myloader
|
||||
|
||||
myloader \
|
||||
--database=$DB_NAME \
|
||||
--directory=$DB_DUMP \
|
||||
--queries-per-transaction=50000 \
|
||||
--threads=10 \
|
||||
--compress-protocol \
|
||||
--verbose=3
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/mydumper-mysql-database-backup-tool.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
@ -1,153 +0,0 @@
|
||||
Translating by ZTinoZ
|
||||
How to Manage KVM Virtual Environment using Commandline Tools in Linux
|
||||
================================================================================
|
||||
In this 4th part of our [KVM series][1], we are discussing KVM environment management using CLI. We use ‘virt-install’ CL tool to create and configure virtual machines, virsh CL tool to create and configure storage pools and qemu-img CL tool to create and manage disk images.
|
||||
|
||||
![KVM Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/KVM-Management-in-Linux.jpg)
|
||||
KVM Management in Linux
|
||||
|
||||
There is nothing new concepts in this article, we just do the previous tasks using command line tools. There is no new prerequisite, just the same procedure, we have discussed in previous parts.
|
||||
|
||||
### Step 1: Configure Storage Pool ###
|
||||
|
||||
Virsh CLI tool is a management user interface for managing virsh guest domains. The virsh program can be used either to run one command by giving the command and its arguments on the shell command line.
|
||||
|
||||
In this section, we will use it to create storage pool for our KVM environment. For more information about the tool, use the following command.
|
||||
|
||||
# man virsh
|
||||
|
||||
**1. Using the command pool-define-as with virsh to define new storage pool, you need also to specify name, type and type’s arguments.**
|
||||
|
||||
In our case, name will be Spool1, type will be dir. By default you could provide five arguments for the type:
|
||||
|
||||
- source-host
|
||||
- source-path
|
||||
- source-dev
|
||||
- source-name
|
||||
- target
|
||||
|
||||
For (Dir) type, we need the last argumet “target” to specify the path of storage pool, for the other arguments we could use “-” to unspecific them.
|
||||
|
||||
# virsh pool-define-as Spool1 dir - - - - "/mnt/personal-data/SPool1/"
|
||||
|
||||
![Create New Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Storage-Pool.png)
|
||||
Create New Storage Pool
|
||||
|
||||
**2. To check the all storage pools you have in the environment, use the following command.**
|
||||
|
||||
# virsh pool-list --all
|
||||
|
||||
![List All Storage Pools](http://www.tecmint.com/wp-content/uploads/2015/02/List-All-Storage-Pools.png)
|
||||
List All Storage Pools
|
||||
|
||||
**3. Now it’s time to build the storage pool, which we have defined above with the following command.**
|
||||
|
||||
# virsh pool-build Spool1
|
||||
|
||||
![Build Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Build-Storage-Pool.png)
|
||||
Build Storage Pool
|
||||
|
||||
**4. Using the virsh command pool-start to active/enable the storage pool we have just created/built above.**
|
||||
|
||||
# virsh pool-start Spool1
|
||||
|
||||
![Active Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Active-Storage-Pool.png)
|
||||
Active Storage Pool
|
||||
|
||||
**5. Check the status of environment storage pools using the following command.**
|
||||
|
||||
# virsh pool-list --all
|
||||
|
||||
![Check Storage Pool Status](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Status.png)
|
||||
Check Storage Pool Status
|
||||
|
||||
You will notice that the status of Spool1 converted to active.
|
||||
|
||||
**6. Configure Spool1 to start by libvirtd service every time automaticlly.**
|
||||
|
||||
# virsh pool-autostart Spool1
|
||||
|
||||
![Configure KVM Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Configure-Storage-Pool.png)
|
||||
Configure KVM Storage Pool
|
||||
|
||||
**7. Finally lets display information about our new storage pool.**
|
||||
|
||||
# virsh pool-info Spool1
|
||||
|
||||
![Check KVM Storage Pool Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Information.png)
|
||||
Check KVM Storage Pool Information
|
||||
|
||||
Congratulations, Spool1 is ready to be used lets try to create storage volumes using it.
|
||||
|
||||
### Step 2: Configure Storage Volumes/Disk Images ###
|
||||
|
||||
Now it is disk image’s turn, using qemu-img to create new disk image from Spool1. For more details about qemy-img, use the man page.
|
||||
|
||||
# man qemu-img
|
||||
|
||||
**8. We should specify the qemu-img command “create, check,….etc”, disk image format, the path of disk image you want to create and the size.**
|
||||
|
||||
# qemu-img create -f raw /mnt/personal-data/SPool1/SVol1.img 10G
|
||||
|
||||
![Create Storage Volume](http://www.tecmint.com/wp-content/uploads/2015/02/Create-Storage-Volumes.png)
|
||||
Create Storage Volume
|
||||
|
||||
**9. By using qemu-img command info, you could get information about your new disk image.**
|
||||
|
||||
![Check Storage Volume Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Volume-Information.png)
|
||||
Check Storage Volume Information
|
||||
|
||||
**Warning**: Never use qemu-img to modify images in use by a running virtual machine or any other process; this may destroy the image.
|
||||
|
||||
Now its time to create virtual machines in the next step.
|
||||
|
||||
### Step 3: Create Virtual Machines ###
|
||||
|
||||
10. Now with the last and latest part, we will create virtual machines using virt-istall. The virt-install is a command line tool for creating new KVM virtual machines using the “libvirt” hypervisor management library. For more details about it, use:
|
||||
|
||||
# man virt-install
|
||||
|
||||
To create new KVM virtual machine, you need to use the following command with all the details like shown in the below.
|
||||
|
||||
- Name: Virtual Machine’s name.
|
||||
- Disk Location: Location of disk image.
|
||||
- Graphics : How to connect to VM “Usually be SPICE”.
|
||||
- vcpu : Number of virtual CPU’s.
|
||||
- ram : Amount of allocated memory in megabytes.
|
||||
- Location : Specify the installation source path.
|
||||
- Network : Specify the virtual network “Usually be vibr00 bridge”.
|
||||
|
||||
# virt-install --name=rhel7 --disk path=/mnt/personal-data/SPool1/SVol1.img --graphics spice --vcpu=1 --ram=1024 --location=/run/media/dos/9e6f605a-f502-4e98-826e-e6376caea288/rhel-server-7.0-x86_64-dvd.iso --network bridge=virbr0
|
||||
|
||||
![Create New Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Virtual-Machines.png)
|
||||
Create New Virtual Machine
|
||||
|
||||
**11. You will find also a pop-up virt-vierwer window appears to communicate with virtual machine through it.**
|
||||
|
||||
![Booting Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Booting-Virtual-Machine.jpeg)
|
||||
Booting Virtual Machine
|
||||
|
||||
![Installation of Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Installation-of-Virtual-Machine.jpeg)
|
||||
Installation of Virtual Machine
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
This is the latest part of our KVM tutorial, we haven’t covered everything of course. It a shot to scratch the KVM environment so its your turn to search and keep hands dirty using this nice resources.
|
||||
|
||||
- [KVM Getting Started Guide][2]
|
||||
- [KVM Virtualization Deployment and Administration Guide][3]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/kvm-management-tools-to-manage-virtual-machines/
|
||||
|
||||
作者:[Mohammad Dosoukey][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/dos2009/
|
||||
[1]:http://www.tecmint.com/install-and-configure-kvm-in-linux/
|
||||
[2]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html
|
||||
[3]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html
|
@ -1,70 +0,0 @@
|
||||
Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu
|
||||
================================================================================
|
||||
Prey is an open source, cross platform tool which helps recover your stolen laptops, desktops, tablet computers and smart phones. It has gained vast popularity and has claimed to help recover hundreds of missing laptops and smart phones. The working of this tool is pretty simple, install it on your Laptop or smart phone, and if your device goes missing, login the Prey website with your credentials and mark your device as “Missing” there. As soon as the thief connects your device with internet, it will immediately send you the Geo location of your device. If your laptop is having webcam, it will also capture the screenshot of the thief.
|
||||
|
||||
Prey consumes minimum system resources; it does not affect your device’s performance in any way. You can also use it alongside any other anti-theft application you had installed on your device. It uses secure and encrypted channels to communicate your device data with Prey servers.
|
||||
|
||||
### Installing and configuring Prey on Ubuntu ###
|
||||
|
||||
Let’s see how we can install and configure Prey on ubuntu, note that during configuration process, we will have to register an account at Prey official website. Once done, it will be able to monitor your devices. Its free account monitors up-to 3 devices, if you need to add more devices to its watch list, you need to purchase appropriate plan.
|
||||
|
||||
Considering the popularity and use of Prey, it has been added to the official ubuntu repository now. That means you don’t need to add any additional PPA to the package manager. Simply launch your terminal application and run the following command to install it:
|
||||
|
||||
sudo apt-get install prey
|
||||
|
||||
![Install Prey](http://blog.linoxide.com/wp-content/uploads/2015/03/Install-Prey.png)
|
||||
|
||||
![Install Prey 1](http://blog.linoxide.com/wp-content/uploads/2015/03/Install-Prey-1.png)
|
||||
|
||||
It is a very lightweight application, uses only few MB of space on the system, once installation is completed, launch it from Applications >> Prey and it will ask you for the configuration.
|
||||
|
||||
Choose “New user” if you are using this app for first time.
|
||||
|
||||
![Prey New User](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-New-User.png)
|
||||
|
||||
This second step is actually the process to sign you up on Prey official website. Please provide your username, email address and password for free account.
|
||||
|
||||
![Register Prey](http://blog.linoxide.com/wp-content/uploads/2015/03/Register-Prey.png)
|
||||
|
||||
Hit “Apply” once done, that’s all, your computer is now protected by Prey.
|
||||
|
||||
![Prey Configuration](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Configuration.png)
|
||||
|
||||
Login your newly created [Prey account][1] and you should be able to see your device information there under “Devices” menu.
|
||||
|
||||
![Prey Web Login](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Web-Login.png)
|
||||
|
||||
As soon as your laptop or any other device goes missing, simply login your Prey web account and change the device status to “missing” by clicking “Set Device to Missing” option.
|
||||
|
||||
![Prey Missing Page](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Missing-1.png)
|
||||
|
||||
Choose report frequency from here and hit “Yes, my device is missing”. Report Frequency option is the time interval after which this app will send you status updates for your device location. It will email you as soon as the device status is changed from web interface.
|
||||
|
||||
![Prey Missing Email](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Missing-2.png)
|
||||
|
||||
As soon as your stolen device is connected to the internet, it will immediately send you report, containing your device's Geo whereabouts and IP address.
|
||||
|
||||
![Prey Found Report](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Missing-3.png)
|
||||
|
||||
Click the report link and you should be able to see your device’s Geo location and IP address.
|
||||
|
||||
![Prey Final](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Final.png)
|
||||
|
||||
There is one known drawback in Prey , It needs your device to be connected to internet for sending Geo location, if thief is smart enough to format your device hard disk before connecting it to the network, then you’ll never get report of its recovery. But there is still a work around to overcome this drawback, make sure to add a BIOS password and disable booting the system from removable devices.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
It is a small, very useful security application which lets you track all of your devices on a single place, although not perfect, but still provides good level of recovery chances for your stolen devices. It runs seamlessly on Linux, Windows and Mac operating system. Here are details about Prey Pro plans.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/anti-theft-application-prey-ubuntu/
|
||||
|
||||
作者:[Aun Raza][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/arunrz/
|
||||
[1]:https://preyproject.com/
|
@ -1,3 +1,4 @@
|
||||
[translating by KayGuoWhu]
|
||||
How to enable ssh login without entering password
|
||||
================================================================================
|
||||
Assume that you are a user "aliceA" on hostA, and wish to ssh to hostB as user "aliceB", without entering her password on hostB. You can follow this guide to **enable ssh login without entering a password**.
|
||||
|
@ -1,102 +0,0 @@
|
||||
Vic020
|
||||
|
||||
Linux FAQs with Answers--How to compress JPEG images from the command line on Linux
|
||||
================================================================================
|
||||
> **Question**: I have several JPEG photo images I have taken using a digital camera. I would like to optimize and compress the JPEG pictures before uploading them to Dropbox. What is the easiest way to compress JPEG images without losing their quality on Linux?
|
||||
|
||||
Image resolution of today's picture taking gadgets (e.g., smartphones, digital cameras) keeps increasing. Even 36.3 Megapixel Nikon D800 recently hit the consumer market, and this trend will continue. While modern gadgets continue to produce increasingly high resolution images, we may often want to post-process and compress their sizes before uploading them to a storage-limited and bandwidth-restricted cloud.
|
||||
|
||||
In fact, there is a way to compress JPEG images easily on Linux. A command-line tool called jpegoptim allows you do "lossless" optimization on JPEG images, so you can compress JPEG pictures without sacrificing their quality. In case your storage or bandwidth budget is really low, jpegoptim allows you to do "lossy" compression as well by adjusting image quality.
|
||||
|
||||
For those interested in compressing PNG images, refer to [this guideline][1] instead.
|
||||
|
||||
### Install Jpegoptim on Linux ###
|
||||
|
||||
To install jpegoptim on Ubuntu, Debian or Linux Mint:
|
||||
|
||||
$ sudo apt-get install jpegoptim
|
||||
|
||||
To install jpegoptim on Fedora:
|
||||
|
||||
$ sudo yum install jpegoptim
|
||||
|
||||
To install jpegoptim on CentOS/RHEL, first enable [EPEL repo][2], and then run:
|
||||
|
||||
$ sudo yum install jpegoptim
|
||||
|
||||
### Compress JPEG Images Losslessly ###
|
||||
|
||||
To compress a JPG picture losslessly, simply run:
|
||||
|
||||
$ jpegoptim photo.jpg
|
||||
|
||||
----------
|
||||
|
||||
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 882178 --> 821064 bytes (6.93%), optimized.
|
||||
|
||||
Note that the original input image will be overwritten with a compressed impage.
|
||||
|
||||
If jpegoptim is not able to further optimize an image losselessly, it will skip overwriting it.
|
||||
|
||||
$ jpegoptim -v photo.jpg
|
||||
|
||||
----------
|
||||
|
||||
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 821064 --> 821064 bytes (0.00%), skipped.
|
||||
|
||||
If you want to preserve an original image, use "-d" option to specify a target directory.
|
||||
|
||||
$ jpegoptim -d ./compressed photo.jpg
|
||||
|
||||
An compressed image will then be placed (with the same name as the input file) in ./compressed directory.
|
||||
|
||||
If you want to preserve file creation/modification time, use "-p" option as follows. Then a compressed image will be placed with the same date and time as the original image.
|
||||
|
||||
$ jpegoptim -d ./compressed -p photo.jpg
|
||||
|
||||
If you simply check out possible lossless compression ratio without actually compressing it, use "-n" option to "simulate" compression. Then it will simply print results without actually performing compression.
|
||||
|
||||
$ jpegoptim -n photo.jpg
|
||||
|
||||
### Compress JPEG Images Lossily ###
|
||||
|
||||
In case you really want to save storage space, you can do lossy compression on large JPEG pictures.
|
||||
|
||||
In this case, use "-m<maximum-quality>" option, where maximum quality is specified in the range of 0 and 100 (0 is the highest quality, and 100 is the lowest quality).
|
||||
|
||||
For example, to compress an image with 50% quality:
|
||||
|
||||
$ jpegoptim -m50 photo.jpg
|
||||
|
||||
----------
|
||||
|
||||
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 882178 --> 301780 bytes (65.79%), optimized.
|
||||
|
||||
You will get a smaller image at the cost of reduced quality.
|
||||
|
||||
![](https://farm9.staticflickr.com/8707/16260736234_6d6f1d2434_c.jpg)
|
||||
|
||||
### Compress Multiple JPEG Images in a Batch ###
|
||||
|
||||
Often times you need to compress many JPEG image files in a directory. In that case, you can use the following shell script.
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
# compress all *.jpg files in the current directory
|
||||
# and place them in ./compressed directory
|
||||
# with the same modification date as original files.
|
||||
for i in *.jpg; do jpegoptim -d ./compressed -p "$i"; done
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/compress-jpeg-images-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
||||
[1]:http://xmodulo.com/how-to-compress-png-files-on-linux.html
|
||||
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
@ -1,130 +0,0 @@
|
||||
4 Tools to Securely Delete Files from Linux
|
||||
================================================================================
|
||||
Any computer user with normal level skill set knows that any data removed from computer system can be recovered later with little bit of efforts. This is a good thing in the scenario when you have accidentally deleted your critical data. But in most cases, you don't want your private data to be recovered easily. Whenever we remove anything, the operating system deletes just the index of the particular data. It means that data is still there somewhere on the disk, this method is insecure, as any smart computer hacker can use any good data recovery tool to easily recover your deleted data. Linux users utilizes the well know “**rm**” command to remove data from their operating system, but “rm” command works in the conventional fashion. Data removed using this command can be recovered by special file recovery tools.
|
||||
|
||||
Let’s see how we can safely and completely remove files/folders from our Linux system. The methods mentioned below remove data completely so it becomes very hard for recovery tools to find traces of the actual data and recover it.
|
||||
|
||||
### Secure-Delete ###
|
||||
|
||||
Secure-Delete is a set of tools for Linux operating system and they provide advanced techniques for permanent removal of files. Once Secure-Delete has been installed on any Linux system, it provides following four commands:
|
||||
|
||||
- srm
|
||||
- smem
|
||||
- sfill
|
||||
- sswap
|
||||
|
||||
Run following command in the terminal to install it in ubuntu:
|
||||
|
||||
sudo apt-get install secure-delete
|
||||
|
||||
![secure delete](http://blog.linoxide.com/wp-content/uploads/2015/03/secure-delete.png)
|
||||
|
||||
Run following command to install it in RHEL, Fedora or Centos:
|
||||
|
||||
sudo yum install secure-delete
|
||||
|
||||
“**srm**” command works similarly to “rm” command, but instead of just deleting the file, it first overwrites it multiple times with some random data and then removes the file permanently. The syntax for this command is pretty simply, just specify the file or directory to remove and it will take care of the task.
|
||||
|
||||
sudo srm /home/aun/Documents/xueo/1.png
|
||||
|
||||
"**sfill**" checks the specified partition/directories for space marked as free or available, and then uses its algorithm to fill it up with some random data. In this way it ensures that there are no more recoverable files/folders on the partition.
|
||||
|
||||
sudo sfill /home
|
||||
|
||||
"**sswap**" command is used to securely wipe your swap partitions. Swap partition is used to store data for running programs. First of all find out your swap partition by running the following command:
|
||||
|
||||
cat /proc/swaps
|
||||
|
||||
Example output of above command is show below:
|
||||
|
||||
aun@eagle:~$ cat /proc/swaps
|
||||
Filename Type Size Used Priority
|
||||
/dev/sda5 partition 2084860 71216 -1
|
||||
|
||||
From here, you can see that swap is set to which partition, and then securely clean it by running the following command. Replace the "/dev/sda5" part with your partition name.
|
||||
|
||||
sudo sswap /dev/sda5
|
||||
|
||||
“**smem**” is used to clean the contents of memory, its true that RAM contents are cleaned when system is rebooted or powered off, but some residual traces of data still remain in the memory. This command provides secure memory cleaning, simly run smem command on the terminal.
|
||||
|
||||
smem
|
||||
|
||||
### Shred ###
|
||||
|
||||
"shred" command destroys files/folder’s contents in a way that it is impossible to recover. It keeps overwriting the files with randomly generated data patterns so in this way it becomes very hard to recover any data from them even if hackers or thief uses high level of data recovery tools/equipments. Shred is installed by default on all Linux distributions, if you want, you can find its installation path by running following command:
|
||||
|
||||
aun@eagle:~$ whereis shred
|
||||
|
||||
shred: /usr/bin/shred /usr/share/man/man1/shred.1.gz
|
||||
|
||||
Run following command to remove file using shred utility.
|
||||
|
||||
shred /home/aun/Documents/xueo/1.png
|
||||
|
||||
Run following command to securely remove any partition using shred ; Replace partition name with your desired partition.
|
||||
|
||||
shred /dev/sda5
|
||||
|
||||
Shred by default overwrites file with random contents 25 times. If you want it to overwrite file more than this, simply specify the desired number with "shred -n" option.
|
||||
|
||||
shred -n 100 filename
|
||||
|
||||
If you want to truncate and remove file after overwriting, use "shred -u" option
|
||||
|
||||
shred -u filename
|
||||
|
||||
### dd ###
|
||||
|
||||
This command is originally used for Disk Cloning. It is used to copy contents of one partition or disk to another. But it is also used for securely wiping out the contents of a hard disk or partitions. Run following command to overwrite your current data with random data.You don't need to install dd command, all Linux distributions include this command already.
|
||||
|
||||
sudo dd if=/dev/random of=/dev/sda
|
||||
|
||||
You can also overwrite the contents of hard disk or partitions by simply replacing everything with “zero”.
|
||||
|
||||
sudo dd if=/dev/zero of=/dev/sda
|
||||
|
||||
### Wipe ###
|
||||
|
||||
Wipe was originally developed to securely erase files from magnetic media. This command line utility writes special patterns to the files repeatedly. It uses fsync() call and/or the O_SYNC bit to force disk access. It uses Gutmann algorithm for repeated writes. You can remove contents of single file, folder or entire hard disk with this command, but whole hard disk format using wipe command will take good amount of time. The installation and use of this utility is pretty easy.
|
||||
|
||||
Install wipe on ubuntu by running the following command on the terminal.
|
||||
|
||||
sudo aptitude install wipe
|
||||
|
||||
![Wipe Linux](http://blog.linoxide.com/wp-content/uploads/2015/03/wipe.png)
|
||||
|
||||
Install Wipe in Redhat Linux, Centos or Fedora by running the following command:
|
||||
|
||||
sudo yum install wipe
|
||||
|
||||
Once the installation is complete, run following command on the terminal to get complete list of its available options:
|
||||
|
||||
man wipe
|
||||
|
||||
Remove any file or directory as:
|
||||
|
||||
wipe filename
|
||||
|
||||
Securely remove your tmp partition by running following command:
|
||||
|
||||
wipe -r /tmp
|
||||
|
||||
Use following command to remove contents of complete partition (replace partition name with your desired partition).
|
||||
|
||||
wipe /dev/sda1
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
We hope you find this article useful, the privacy of your data is critical, its important to have such secure file removal utilities installed on your system so you may be able to remove your private data without fear of being recovered easily. All of the above mentioned tools are pretty lightweight, they take minimum system resources to run, and does not affect performance of your system in anyway. Enjoy!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/security/delete-files-permanatly-linux/
|
||||
|
||||
作者:[Aun Raza][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/arunrz/
|
@ -1,3 +1,4 @@
|
||||
Translating by ZTinoZ
|
||||
How to Host Open Source Code Repository in github
|
||||
================================================================================
|
||||
Hi all, today we will be learning how to host Source Code of Open Source Software in the repository hosted by github.com . GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features. It provides a workplace to host powerful collaboration, code review, and code management for open source and private projects. Unlike Git, which is strictly a command-line tool, GitHub provides a web-based graphical interface and desktop as well as mobile integration. GitHub offers both paid plans for private repositories and free accounts, which are usually used to host open-source software projects.
|
||||
@ -110,4 +111,4 @@ via: http://linoxide.com/usr-mgmt/host-open-source-code-repository-github/
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:http://github.com/
|
||||
[1]:http://github.com/
|
||||
|
@ -1,3 +1,4 @@
|
||||
translating wi-cuckoo LLAP
|
||||
How to Interactively Create a Docker Container
|
||||
================================================================================
|
||||
Hi everyone, today we'll learn how we can interactively create a docker container using a docker image. Once we start a process in Docker from an Image, Docker fetches the image and its Parent Image, and repeats the process until it reaches the Base Image. Then the Union File System adds a read-write layer on top. That read-write layer, the information about its Parent Image and some other information like its unique id, networking configuration, and resource limits is called a **Container**. Containers has states as they can change from **running** to **exited** state. A container with state as **running** includes a tree of processes running on the CPU, isolated from the other processes running on the host where as **exited** is the state of the file system and its exit value is preserved. You can start, stop, and restart a container with it.
|
||||
@ -96,4 +97,4 @@ via: http://linoxide.com/linux-how-to/interactively-create-docker-container/
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://registry.hub.docker.com/
|
||||
[1]:https://registry.hub.docker.com/
|
||||
|
@ -1,60 +0,0 @@
|
||||
Prips – Print IP address on a given range
|
||||
================================================================================
|
||||
prips is a tool that can be used to print all of the IP address on a given range. It can enhance the usability of tools that are made to work on only one host at a time.
|
||||
|
||||
### Install Prips on ubuntu ###
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo apt-get install prips
|
||||
|
||||
### Using prips ###
|
||||
|
||||
### prips syntax ###
|
||||
|
||||
prips [-c] [-d delim] [-e exclude] [-f format] [-i incr] start end
|
||||
prips [-c] [-d delim] [-e exclude] [-f format] [-i incr] CIDR-block
|
||||
|
||||
### Available Options ###
|
||||
|
||||
The prips tool accepts the following command-line options:
|
||||
|
||||
- -c -- Print the range in CIDR notation.
|
||||
- -d delim -- Set the delimiter to the character with ASCII code delim where 0 <= delim <= 255.
|
||||
- -e -- Exclude ranges from the output.
|
||||
- -f format -- Set the format of addresses (hex, dec, or dot).
|
||||
- -i incr -- Set the increment to ‘x'.
|
||||
|
||||
### Prips Examples ###
|
||||
|
||||
Display all the addresses in a reserved subnet:
|
||||
|
||||
prips 192.168.32.0 192.168.32.255
|
||||
|
||||
The same, using CIDR notation:
|
||||
|
||||
prips 192.168.32/24
|
||||
|
||||
Display only the usable addresses in a class A reserved subnet using a space instead of a newline for a delimiter:
|
||||
|
||||
prips -d 32 10.0.0.1 10.255.255.255
|
||||
|
||||
Display every fourth address in a weird block:
|
||||
|
||||
prips -i 4 192.168.32.7 192.168.33.5
|
||||
|
||||
Determine the smallest CIDR block containing two addresses:
|
||||
|
||||
prips -c 192.168.32.5 192.168.32.11
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/prips-print-ip-address-on-a-given-range.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
@ -0,0 +1,191 @@
|
||||
A Peep into Process Management Commands in Linux
|
||||
================================================================================
|
||||
A program in execution is called a process. While a program is an executable file present in storage and is passive, a process is a dynamic entity comprising of allocated system resources, memory, security attributes and has a state associated with it. There can be multiple processes associated with the same program and operating simultaneously without interfering with each other. The operating system efficiently manages and keeps track of all the processes running in the system.
|
||||
|
||||
In order to manage these processes, user should be able to
|
||||
|
||||
- See all the processes that are running
|
||||
- View the system resources consumed by the processes
|
||||
- Locate a particular process and take specific action on it
|
||||
- Change the priority levels associated with processes
|
||||
- Kill the required processes
|
||||
- Restrict the system resources available to processes etc.
|
||||
|
||||
Linux offers many commands to the user to effectively handle the above mentioned scenarios. Let's understand them one by one.
|
||||
|
||||
### 1. ps ###
|
||||
|
||||
'ps' is one of the basic commands in Linux to view the processes on the system. It lists the running processes in a system along with other details such as process id, command, cpu usage, memory usage etc. Some of the following options come handy to get more useful information
|
||||
|
||||
ps -a - List all the running / active processes
|
||||
|
||||
![Output of "ps -a" command](http://blog.linoxide.com/wp-content/uploads/2015/02/ps-a2.png)
|
||||
|
||||
ps -ef |grep - List only the required process
|
||||
|
||||
ps -aux - Displays processes including those with no terminals(x) Output is user oriented (u) with fields like USER, PID, %CPU, %MEM etc
|
||||
|
||||
### 2. pstree ###
|
||||
|
||||
In Linux, every process gets spawned by its parent process. This command helps visualize the processes by displaying a tree diagram of the processes showing the relationship between them. If a pid is mentioned, the root of the tree will be the pid. Else it will be rooted at init.
|
||||
|
||||
![pstree](http://blog.linoxide.com/wp-content/uploads/2015/02/pstree.png)
|
||||
|
||||
### 3. top ###
|
||||
|
||||
'top' is a very useful command to monitor the system as it shows the system resources used by different processes. It gives a snapshot of the situation that the system is currently in. Its output includes data like process identification number(PID), user of the process, nice value, %CPU and %memory currently consumed by the process etc. One can use this output to figure out which process is hogging the CPU or memory.
|
||||
|
||||
![top](http://blog.linoxide.com/wp-content/uploads/2015/02/top.png)
|
||||
|
||||
### 4. htop ###
|
||||
|
||||
htop is similar to top, but is an interactive text mode process viewer. It displays the per CPU usage and memory, swap usage using a text graph. One can use the Up/Down arrow key to select processes, F7 and F8 to change the priority and F9 to kill a process. It is not present by default in the system and need to be installed explicitly.
|
||||
|
||||
![htop output](http://blog.linoxide.com/wp-content/uploads/2015/03/htop1.png)
|
||||
|
||||
### 5. nice ###
|
||||
|
||||
With the help of nice command, users can set or change the priorities of processes in Linux. Higher the priority of a process, more is the CPU time allocated by the kernel for it. By default, a process gets launched with priority 0. Process priority can be viewed using the top command output under the NI (nice value) column.
|
||||
|
||||
Values of process priority range from -20 to 19. Lower the nice value, higher the priority.
|
||||
|
||||
nice <priority value> <process name> - starts the process by setting its priority to the given value
|
||||
|
||||
![nice command](http://blog.linoxide.com/wp-content/uploads/2015/02/nice-cmd.png)
|
||||
|
||||
![changed nice value of 'top'](http://blog.linoxide.com/wp-content/uploads/2015/02/top-nice.png)
|
||||
|
||||
In the above example, 'top' gets launched with a priority -3.
|
||||
|
||||
### 6. renice ###
|
||||
|
||||
It is similar to nice command. Use this command to change the priority of an already running process. Please note that users can change the priority of only the processes that they own.
|
||||
|
||||
renice -n -p - change the priority of the given process
|
||||
|
||||
![renice command](http://blog.linoxide.com/wp-content/uploads/2015/02/renice2.png)
|
||||
|
||||
Priority of process with id 3806 which had an initial priority of 0 is now changed to priority 4.
|
||||
|
||||
renice -u -g - change the priority of processes owned by the given user and group
|
||||
![output of renice for a user group](http://blog.linoxide.com/wp-content/uploads/2015/02/renice1.png)
|
||||
|
||||
In the above example, priority of all processes owned by user 'mint' get changed to '-3'
|
||||
|
||||
### 7. kill ###
|
||||
|
||||
This is a command used to terminate processes by sending signals. If a process is not responding to kill command, then it can be forcefully killed using the kill -9 command. But this needs to be used carefully as it does not give a chance for the process to clean up and might end up in corrupted files. If we are not aware of the PID of the process to be killed or want to mention the process name to be killed, then killall comes to rescue.
|
||||
|
||||
kill <pid>
|
||||
|
||||
kill -9 <pid>
|
||||
|
||||
killall -9 - kill all instances having the same process name
|
||||
|
||||
If you use kill, you need to know the process id of the process to be killed. pkill is a similar command but can be used to kill processes using a pattern, i.e. process name, process owner etc.
|
||||
|
||||
pkill <process name>
|
||||
|
||||
![kill initiated](http://blog.linoxide.com/wp-content/uploads/2015/02/kill-initiated.png)
|
||||
|
||||
![kill](http://blog.linoxide.com/wp-content/uploads/2015/02/kill.png)
|
||||
|
||||
### 8. ulimit ###
|
||||
|
||||
Command useful in controlling the system-wide resources available to the shells and processes. Mostly useful for system administrators to manage systems that are heavily used and have performance problems. Limiting the resources ensures that important processes continue to run while other processes do not consume more resources.
|
||||
|
||||
ulimit -a - Displays the current limits associated with the current user.
|
||||
|
||||
![ulimit -a](http://blog.linoxide.com/wp-content/uploads/2015/02/ulimit-a.png)
|
||||
|
||||
-f - maximum file size
|
||||
|
||||
-v - maximum virtual memory size (in KB)
|
||||
|
||||
-n - maximum file descriptor plus 1
|
||||
|
||||
-H : To change and report the hard limit
|
||||
|
||||
-S : To change and report the soft limit
|
||||
|
||||
Check out the ulimit man page for more options.
|
||||
|
||||
### 9. w ###
|
||||
|
||||
w gives us information about the users who have currently logged in and the processes that they are running. The header details displayed contain information like current time, how long the system has been running, total number of users logged in, load average of the system for the last 1, 5 and 15 minutes
|
||||
|
||||
Based on the user information, one can take care before terminating any processes that do not belong to them.
|
||||
|
||||
!['w' command](http://blog.linoxide.com/wp-content/uploads/2015/02/w.png)
|
||||
|
||||
**who** is a related command and gives a list of currently logged in users, time of last system boot, current run levels etc.
|
||||
|
||||
!['who' command](http://blog.linoxide.com/wp-content/uploads/2015/02/who.png)
|
||||
|
||||
**whoami** command prints the username of the current user ID
|
||||
|
||||
!['whoami' command](http://blog.linoxide.com/wp-content/uploads/2015/02/whoami.png)
|
||||
|
||||
### 10. pgrep ###
|
||||
|
||||
pgrep stands for "Process-ID Global Regular Expression Print". It scans the currently running processes and lists the process IDs that match the selection criteria mentioned on command line to stdout. Useful for retrieving the process id of a process by using its name.
|
||||
|
||||
pgrep -u mint sh
|
||||
|
||||
This command will display the process ID for the process named 'sh' and owned by user 'mint'
|
||||
|
||||
![output of pgrep](http://blog.linoxide.com/wp-content/uploads/2015/03/pgrep.png)
|
||||
|
||||
### 11. fg , bg ###
|
||||
|
||||
Sometimes, the commands that we execute take a long time to complete. In such situations, we can push the jobs to be executed in the background using 'bg' command and can be brought to the foreground with the 'fg' command.
|
||||
|
||||
We can start a program in background by using the '&' :
|
||||
|
||||
find . -name *iso > /tmp/res.txt &
|
||||
|
||||
A program that is already running can also be sent to the background using 'CTRL+Z' and 'bg' command:
|
||||
|
||||
find . -name *iso > /tmp/res.txt & - start the job in the background
|
||||
|
||||
ctrl+z - suspend the currently executing foreground job
|
||||
|
||||
bg - push the command execution to background
|
||||
|
||||
We can list all the background processes using 'jobs' command
|
||||
|
||||
jobs
|
||||
|
||||
We can bring back a background process to foreground using the 'fg' command.
|
||||
|
||||
fg %
|
||||
|
||||
![output of fg, bg and jobscommands](http://blog.linoxide.com/wp-content/uploads/2015/03/fg-bg-jobs.png)
|
||||
|
||||
### 12. ipcs ###
|
||||
|
||||
ipcs command is used for listing the inter-process communication facilities (shared memory, semaphores and message queues).
|
||||
|
||||
This command with -p option can be combined with options -m, -s or-q to display the process id which recently accessed the corresponding ipc facility.
|
||||
|
||||
ipcs -p -m
|
||||
|
||||
The screen shot below is listing the creator id and process id which accessed the shared memory recently.
|
||||
|
||||
![ipcs command](http://blog.linoxide.com/wp-content/uploads/2015/03/ipcs.png)
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Generally, it is considered the job of administrators to fix problems and tweak the system to improve the performance. But users also need to deal with processes in Linux quite often. Hence, it is essential to familiarise ourselves with the various commands available to manage them effectively.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/process-management-commands-linux/
|
||||
|
||||
作者:[B N Poornima][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/bnpoornima/
|
@ -0,0 +1,252 @@
|
||||
How to set up server monitoring system with Monit
|
||||
================================================================================
|
||||
Many Linux admins rely on a centralized remote monitoring system (e.g., [Nagios][1] or [Cacti][2]) to check the health of their network infrastructure. While centralized monitoring makes an admin's life easy when dealing with many hosts and devices, a dedicated monitoring box obviously becomes a single point of failure; if the monitoring box goes down or becomes unreachable for whatever reason (e.g., bad hardware or network outage), you will lose visibility on your entire infrastructure.
|
||||
|
||||
One way to add redundancy to your monitoring system is to install standalone monitoring software (as a fallback) at least on any critical/core servers on your network. In case a centralized monitor is down, you will still be able to maintain visibility on your core servers from their backup monitor.
|
||||
|
||||
### What is Monit? ###
|
||||
|
||||
[Monit][3] is a cross-platform open-source tool for monitoring Unix/Linux systems (e.g., Linux, BSD, OSX, Solaris). Monit is extremely easy to install and reasonably lightweight (with only 500KB in size), and does not require any third-party programs, plugins or libraries. Yet, Monit lends itself to full-blown monitoring, capable of process status monitoring, filesystem change monitoring, email notification, customizable actions for core services, and so on. The combination of ease of setup, lightweight implementation and powerful features makes Monit an ideal candidate for a backup monitoring tool.
|
||||
|
||||
I have been using Monit for several years on multiple hosts, and I am very pleased how reliable it has been. Even as a full-blown monitoring system, Monit is very useful and powerful for any Linux admin. In this tutorial, let me demonstrate how to set up Monit on a local server (as a backup monitor) to monitor common services. With this setup, I will only scrach the surface of what Monit can do for us.
|
||||
|
||||
### Installation of Monit on Linux ###
|
||||
|
||||
Most Linux distributions already include Monit in their repositories.
|
||||
|
||||
Debian, Ubuntu or Linux Mint:
|
||||
|
||||
$ sudo aptitude install monit
|
||||
|
||||
Fedora or CentOS/RHEL:
|
||||
|
||||
On CentOS/RHEL, you must enable either [EPEL][4] or [Repoforge][5] repository first.
|
||||
|
||||
# yum install monit
|
||||
|
||||
Monit comes with a very well documented configuration file with a lots of examples. The main configuration file is located in /etc/monit.conf in Fedora/CentOS/RHEL, or /etc/monit/monitrc in Debian/Ubuntu/Mint. Monit configuration has two parts: "Global" and "Services" sections.
|
||||
|
||||
Gl### ###obal Configuration: Web Status Page
|
||||
|
||||
Monit can use several mail servers for notifications, and/or an HTTP/HTTPS status page. Let's start with the web status page with the following requirements.
|
||||
|
||||
- Monit listens on port 1966.
|
||||
- Access to the web status page is encrypted with SSL.
|
||||
- Login requires monituser/romania as user/password.
|
||||
- Login is permitted from localhost, myhost.mydomain.ro, and internal LAN (192.168.0.0/16) only.
|
||||
- Monit stores an SSL certificate in a pem format.
|
||||
|
||||
For subsequent steps, I will use a Red Hat based system. Similar steps will be applicable on a Debian based system.
|
||||
|
||||
First, generate and store a self-signed certificate (monit.pem) in /var/cert.
|
||||
|
||||
# mkdir /var/certs
|
||||
# cd /etc/pki/tls/certs
|
||||
# ./make-dummy-cert monit.pem
|
||||
# cp monit.pem /var/certs
|
||||
# chmod 0400 /var/certs/monit.pem
|
||||
|
||||
Now put the following snippet in the Monit's main configuration file. You can start with an empty configuration file or make a copy of the original file.
|
||||
|
||||
set httpd port 1966 and
|
||||
SSL ENABLE
|
||||
PEMFILE /var/certs/monit.pem
|
||||
allow monituser:romania
|
||||
allow localhost
|
||||
allow 192.168.0.0/16
|
||||
allow myhost.mydomain.ro
|
||||
|
||||
### Global Configuration: Email Notification ###
|
||||
|
||||
Next, let's set up email notification in Monit. We need at least one active [SMTP server][6] which can send mails from the Monit host. Something like the following will do (adjust it for your case):
|
||||
|
||||
- Mail server hostname: smtp.monit.ro
|
||||
- Sender email address used by monit (from): monit@monit.ro
|
||||
- Who will receive mail from monit daemon: guletz@monit.ro
|
||||
- SMTP port used by mail server: 587 (default is 25)
|
||||
|
||||
With the above information, email notification would be configured like this:
|
||||
|
||||
set mailserver smtp.monit.ro port 587
|
||||
set mail-format {
|
||||
from: monit@monit.ro
|
||||
subject: $SERVICE $EVENT at $DATE on $HOST
|
||||
message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION.
|
||||
|
||||
Yours sincerely,
|
||||
Monit
|
||||
|
||||
}
|
||||
|
||||
set alert guletz@monit.ro
|
||||
|
||||
As you can see, Monit offers several built-in variables ($DATE, $EVENT, $HOST, etc.), and you can customize your email message for your needs. If you want to send mails from the Monit host itself, you need a sendmail-compatible program (e.g., postfix or ssmtp) already installed.
|
||||
|
||||
### Global Configuration: Monit Daemon ###
|
||||
|
||||
The next part is setting up monit daemon. We will set it up as follows.
|
||||
|
||||
- Performs the first check after 120 seconds.
|
||||
- Checks services once every 3 minutes.
|
||||
- Use syslog for logging.
|
||||
|
||||
Place the following snippet to achieve the above setting.
|
||||
|
||||
set daemon 120
|
||||
with start delay 240
|
||||
set logfile syslog facility log_daemon
|
||||
|
||||
We must also define "idfile", a unique ID used by monit demon, and "eventqueue", a path where mails sent by monit but undelivered due to SMTP/network errors. Verifiy that path (/var/monit) already exists. The following configuration will do.
|
||||
|
||||
set idfile /var/monit/id
|
||||
set eventqueue
|
||||
basedir /var/monit
|
||||
|
||||
### Test Global Configuration ###
|
||||
|
||||
Now the "Global" section is finished. The Monit configuration file will look like this:
|
||||
|
||||
# Global Section
|
||||
|
||||
# status webpage and acl's
|
||||
set httpd port 1966 and
|
||||
SSL ENABLE
|
||||
PEMFILE /var/certs/monit.pem
|
||||
allow monituser:romania
|
||||
allow localhost
|
||||
allow 192.168.0.0/16
|
||||
allow myhost.mydomain.ro
|
||||
|
||||
# mail-server
|
||||
set mailserver smtp.monit.ro port 587
|
||||
# email-format
|
||||
set mail-format {
|
||||
from: monit@monit.ro
|
||||
subject: $SERVICE $EVENT at $DATE on $HOST
|
||||
message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION.
|
||||
|
||||
Yours sincerely,
|
||||
Monit
|
||||
|
||||
}
|
||||
|
||||
set alert guletz@monit.ro
|
||||
|
||||
# delay checks
|
||||
set daemon 120
|
||||
with start delay 240
|
||||
set logfile syslog facility log_daemon
|
||||
|
||||
# idfile and mail queue path
|
||||
set idfile /var/monit/id
|
||||
set eventqueue
|
||||
basedir /var/monit
|
||||
|
||||
Now it is time to check what we have done. You can test an existing configuration file (/etc/monit.conf) by running:
|
||||
|
||||
# monit -t
|
||||
|
||||
----------
|
||||
|
||||
Control file syntax OK
|
||||
|
||||
If Monit complains about any error, please review the configuration file again. Fortunately, error/warnings messages are informative. For example:
|
||||
|
||||
monit: Cannot stat the SSL server PEM file '/var/certs/monit.pem' -- No such file or directory
|
||||
/etc/monit/monitrc:10: Warning: hostname did not resolve 'smtp.monit.ro'
|
||||
|
||||
Once you verify the syntax of configuration, start monit daemon, and wait 2 to 3 minutes:
|
||||
|
||||
# service monit start
|
||||
|
||||
If you are using systemd, run:
|
||||
|
||||
# systemctl start monit
|
||||
|
||||
Now open a browser window, and go to https://<monit_host>:1966. Replace &<monit_host> with your Monit hostname or IP address.
|
||||
|
||||
Note that if you have a self-signed SSL certificate, you will see a warning message in your browser.
|
||||
|
||||
![](https://farm8.staticflickr.com/7596/16737206479_96b9f7dfdb_c.jpg)
|
||||
|
||||
After you have completed login, you must see the following page.
|
||||
|
||||
![](https://farm8.staticflickr.com/7594/16303369973_6019482dea_c.jpg)
|
||||
|
||||
In the rest of the tutorial, let me show how we can monitor a local server and common services. You will see a lot of useful examples on the [official wiki page][7]. Most of them are copy-and-pastable!
|
||||
|
||||
### Service Configuration: CPU/Memory Monitoring ###
|
||||
|
||||
Let start with monitoring a local server's CPU/memory usage. Copy the following snippet in the configuration file.
|
||||
|
||||
check system localhost
|
||||
if loadavg (1min) > 10 then alert
|
||||
if loadavg (5min) > 6 then alert
|
||||
if memory usage > 75% then alert
|
||||
if cpu usage (user) > 70% then alert
|
||||
if cpu usage (system) > 60% then alert
|
||||
if cpu usage (wait) > 75% then alert
|
||||
|
||||
You can easily interpret the above configuration. The above checks are performed on local host for every monitoring cycle (which is set to 120 seconds in the Global section). If any condition is met, monit daemon will send an alert with an email.
|
||||
|
||||
If certain properties do not need to be monitored for every cycle, you can use the following format. For example, this will monitor average load every other cycle (i.e., every 240 seconds).
|
||||
|
||||
if loadavg (1min) > 10 for 2 cycles then alert
|
||||
|
||||
### Service Configuration: SSH Service Monitoring ###
|
||||
|
||||
Let's check if we have sshd binary installed in /usr/sbin/sshd:
|
||||
|
||||
check file sshd_bin with path /usr/sbin/sshd
|
||||
|
||||
We also want to check if the init script for sshd exist:
|
||||
|
||||
check file sshd_init with path /etc/init.d/sshd
|
||||
|
||||
Finally, we want to check if sshd daemon is up an running, and listens on port 22:
|
||||
|
||||
check process sshd with pidfile /var/run/sshd.pid
|
||||
start program "/etc/init.d/sshd start"
|
||||
stop program "/etc/init.d/sshd stop"
|
||||
if failed port 22 protocol ssh then restart
|
||||
if 5 restarts within 5 cycles then timeout
|
||||
|
||||
More specifically, we can interpret the above configuration as follows. We check if a process named sshd and a pidfile (/var/run/sshd.pid) exist. If either one does not exist, we restart sshd demon using init script. We check if a process listening on port 22 can speak SSH protocol. If not, we restart sshd daemon. If there are at least 5 restarts within the last 5 monitoring cycles (i.e., 5x120 seconds), sshd daemon is declared non-functional, and we do not try to check again.
|
||||
|
||||
![](https://farm9.staticflickr.com/8685/16735725998_62c26a24bc_c.jpg)
|
||||
|
||||
### Service Configuration: SMTP Service Monitoring ###
|
||||
|
||||
Now let's set up a check on a remote SMTP mail server (e.g., 192.168.111.102). Let's assume that the SMTP server is running SMTP, IMAP and SSH on its LAN interface.
|
||||
|
||||
check host MAIL with address 192.168.111.102
|
||||
if failed icmp type echo within 10 cycles then alert
|
||||
if failed port 25 protocol smtp then alert
|
||||
else if recovered then exec "/scripts/mail-script"
|
||||
if failed port 22 protocol ssh then alert
|
||||
if failed port 143 protocol imap then alert
|
||||
|
||||
We check if the remote host responds to ICMP. If we haven't received ICMP response within 10 cycles, we send out an alert. If testing for SMTP protocol on port 25 fails, we send out an alert. If testing succeeds again after a failed test, we run a script (/scripts/mail-script). If testing for SSH and IMAP protocols fail on port 22 and 143, respectively, we send out an alert.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
In this tutorial, I demonstrate how to set up Monit on a local server. What I showed here is just the tip of the iceberg, as far as Monit's capabilities are concerned. Take your time and read the man page about Monit (a very good one). Monit can do a lot for any Linux admin with a very nice and easy to understand syntax. If you put together a centralized remote monitor and Monit to work for you, you will have a more reliable monitoring system. What is your thought on Monit?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/server-monitoring-system-monit.html
|
||||
|
||||
作者:[Iulian Murgulet][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/iulian
|
||||
[1]:http://xmodulo.com/monitor-common-services-nagios.html
|
||||
[2]:http://xmodulo.com/monitor-linux-servers-snmp-cacti.html
|
||||
[3]:http://mmonit.com/monit/
|
||||
[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html
|
||||
[6]:http://xmodulo.com/mail-server-ubuntu-debian.html
|
||||
[7]:http://mmonit.com/wiki/Monit/ConfigurationExamples
|
@ -1,24 +1,23 @@
|
||||
2015你可以买的一款基于Linux的迷你PC
|
||||
2015年你可以买的四款基于Linux的迷你PC
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Linux_Based_Mini_PC.jpg)
|
||||
|
||||
在我看来迷你PC将在不久的将来会替代传统桌面电脑。传统桌面的有一个像送风机那样占据大量空间的风扇。迷你PC,在另一方面说很小巧和紧凑。通常是4″或者5″大小,可以轻易地放在桌子上。
|
||||
在我看来迷你PC将在不久的将来会替代传统桌面电脑。传统桌面的有一个像吹风机那样占据大量空间的风扇。迷你PC,在另一方面说很小巧和紧凑。通常是4″或者5″大小,可以轻易地放在桌子上。
|
||||
|
||||
不仅如此,这些迷你PC的无风扇设计是一个好处。当然,你可以购买无风扇的常规电脑,但是空间占用仍然是一个问题。对我个人来说,我觉得迷你PC外观上看着很可爱。如果你不是一个游戏玩家也不想买新的桌面PC,我强烈建议你**购买一个基于Linux的迷你PC**。
|
||||
不仅如此,这些迷你PC的无风扇设计是一个优点。当然,你可以购买无风扇的常规电脑,但是空间占用仍然是一个问题。对我个人来说,我觉得迷你PC外观上看着很可爱。如果你不是一个游戏玩家也不想买新的桌面PC,我强烈建议你**购买一款基于Linux的迷你PC**。
|
||||
|
||||
如果你考虑我的建议买一个,那么你或许想知道该买哪款。不要担心,这篇文章我们会介绍**四款你可以在2015购买的基于Linux的迷你PC**。
|
||||
如果你考虑我的建议,那么你或许想知道该买哪款。不要担心,这篇文章我们会介绍**2015年你可以购买的四款基于Linux的迷你PC**。
|
||||
|
||||
### 基于Linux的迷你PC ###
|
||||
|
||||
请注意这些PC可能还不能下单。它们中有些还刚刚公布,在不久的将来才会面向公众出售。
|
||||
需要注意的是,这其中的一些PC可能还不能下单。它们中有些还刚刚公布,在不久的将来才会面向公众出售。
|
||||
|
||||
|
||||
#### 1. System76出品的Meerkat ####
|
||||
|
||||
![](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:
|
||||
[System76][1] 是一家仅出品基于Ubuntu电脑、笔记本、服务器的电脑生产商。[System76在上周宣布了一款基于Ubuntu的迷你PC][2]。让我看一下它的规格:
|
||||
[System76][1] 是一家仅出品基于Ubuntu电脑、笔记本、服务器的电脑生产商。[System76在上周公布了一款基于Ubuntu的迷你PC][2]。让我看一下它的规格:
|
||||
|
||||
**规格**
|
||||
|
||||
@ -43,7 +42,7 @@
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/01/mintbox-mini.jpeg)
|
||||
|
||||
[Compulab][3]将它的旗舰产品基于Linux Mint的桌面设备成了[Mintbox Mini][4]。紧凑的版本在4″大小。更多的细节如下:
|
||||
[Compulab][3]将它基于Linux Mint的期间PC设备压缩,从Mintbox变为[Mintbox Mini][4]。这个紧凑的版本大小在4″左右。更多的细节如下:
|
||||
|
||||
**规格**
|
||||
|
||||
@ -59,19 +58,17 @@
|
||||
|
||||
**价格**
|
||||
|
||||
$300起售
|
||||
$300左右起售
|
||||
|
||||
**发售日期**
|
||||
|
||||
2015第二季度
|
||||
2015年第二季度
|
||||
|
||||
#### 3. Compulab出品的Utilite2 ####
|
||||
|
||||
![](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.
|
||||
Compulab并不是坚持用Linux Mint的。它在去年12月宣布了一款运行Ubuntu的ARM桌面PC。大小是3.4″x2.3″,[Utilite2][5]有最现代的特性和价格
|
||||
|
||||
Compulab并不仅仅被Linux Mint所限制。它在去年12月公布了一款运行Ubuntu的ARM桌面PC。大小是3.4″x2.3″,[Utilite2][5]有最适合的性价比。
|
||||
|
||||
**规格**
|
||||
|
||||
@ -85,20 +82,19 @@ Compulab并不是坚持用Linux Mint的。它在去年12月宣布了一款运行
|
||||
|
||||
**价格**
|
||||
|
||||
常规版售价$192、带硬盘售价$229。邮费另付。
|
||||
常规版售价$192、带硬盘售价$229。运费另付。
|
||||
|
||||
**发售日期**
|
||||
|
||||
现在就可购买。运送将花费4周。
|
||||
|
||||
#### Think Penguin出品的Penguin Pocket Wee ####
|
||||
#### 4. Think Penguin出品的Penguin Pocket Wee ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Think_Penguin_Pocket_Wee.jpeg)
|
||||
|
||||
[Think Penguin][6]是一家开源硬件生产商。在迷你PC领域,它提供了[Penguin Pocket Wee][7]。大小是4.6″x 4.4″x 1.4″ ,, Penguin Pocket Wee提供了大量的配置。你可以选择处理器、存储、网卡等。你可以选择购买预装你喜欢的Linux发行版,默认系统是Ubuntu。
|
||||
[Think Penguin][6]是一家开源硬件生产商。在迷你PC领域,它提供了[Penguin Pocket Wee][7]。大小是4.6″x 4.4″x 1.4″ ,, Penguin Pocket Wee为你提供了大量的配置。你可以选择处理器、存储、网卡等。你可以选择购买预装你喜欢的Linux发行版,默认系统是Ubuntu。
|
||||
|
||||
The general configuration is as following:
|
||||
下面的默认的配置
|
||||
下面是默认的配置:
|
||||
|
||||
- Intel Core i3 或者 i5处理器,最高支持1080p视频
|
||||
- 最高扩展至 16GB 的 DDR3内存
|
||||
@ -110,18 +106,17 @@ The general configuration is as following:
|
||||
|
||||
**价格**
|
||||
|
||||
Basic model starts at $499 and it can go up to $1000 based on the configuration you select.
|
||||
基础版本$499起售,根据你的配置最大是$1000。
|
||||
基础版本$499起售,根据你选择的配置最高价格是$1000。
|
||||
|
||||
**发售日期**
|
||||
|
||||
现在就可下订单。该公司在美国和英国也有办公司,所以应也可以运送到南美和欧洲。
|
||||
现在就可下订单。该公司在美国和英国也有办公地点,所以应也可以运送到南美和欧洲。
|
||||
|
||||
### 你会选哪种? ###
|
||||
|
||||
我故意没有介绍[Raspberry Pi 2][8]或者其他Linux微电脑如[Intel的电脑棒][9]。原因是我不认为这些微电脑属于迷你PC的范畴。
|
||||
|
||||
你怎么看?你想用迷你PC代替你的桌面PC么?是不是还有我没有在**最好的基于Linux的迷你PC**列出的PC?分享你们的观点吧。
|
||||
你怎么看?你想用迷你PC代替你的桌面PC么?是不是还有我没有在**基于Linux的最好的迷你PC**列表里列出的PC?在评论区分享你们的观点吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -129,7 +124,7 @@ via: http://itsfoss.com/4-linux-based-mini-pc-buy-2015/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
|
@ -0,0 +1,153 @@
|
||||
如何在Linux中用命令行工具管理KVM虚拟环境
|
||||
================================================================================
|
||||
在我们[KVM系列专题][1]的第四部分,我们将会一起讨论下在命令行界面下来管理KVM环境。我们分别用‘virt-install’和virsh命令行工具来创建并配置虚拟机和存储池,用qemu-img命令行工具来创建并管理磁盘映像。
|
||||
|
||||
![KVM Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/KVM-Management-in-Linux.jpg)
|
||||
|
||||
Linux系统的KVM管理
|
||||
|
||||
在这篇文章里没有什么新的概念,我们只是用命令行工具重复之前所做过的事情,也没有什么前提条件,都是相同的过程,之前的文章我们都讨论过。
|
||||
|
||||
### 第一步: 配置存储池 ###
|
||||
|
||||
Virsh命令行工具是一款管理virsh客户域的用户界面。virsh程序能在命令行中运行所给的命令以及它的参数。
|
||||
|
||||
本节中,我们要用它给我们的KVM环境创建存储池。想知道关于这个工具的更多信息,用以下这条命令。
|
||||
|
||||
# man virsh
|
||||
|
||||
**1. 用virsh带pool-define-as的命令来定义新的存储池,你需要指定名字、类型和类型参数。**
|
||||
|
||||
本例中,我们将名字取为Spool1,类型为目录。默认情况下你可以提供五个参数给该类型:
|
||||
|
||||
- source-host
|
||||
- source-path
|
||||
- source-dev
|
||||
- source-name
|
||||
- target
|
||||
|
||||
对于目录类型,我们需要用最后一个参数“target”来指定存储池的路径,其它参数项我们可以用“-”来填充。
|
||||
|
||||
# virsh pool-define-as Spool1 dir - - - - "/mnt/personal-data/SPool1/"
|
||||
|
||||
![Create New Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Storage-Pool.png)
|
||||
创建新存储池
|
||||
|
||||
**2. 查看环境中我们所有的存储池,用以下命令。**
|
||||
|
||||
# virsh pool-list --all
|
||||
|
||||
![List All Storage Pools](http://www.tecmint.com/wp-content/uploads/2015/02/List-All-Storage-Pools.png)
|
||||
列出所有存储池
|
||||
|
||||
**3. 现在我们来构造存储池了,用以下命令来构造我们刚才定义的存储池。**
|
||||
|
||||
# virsh pool-build Spool1
|
||||
|
||||
![Build Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Build-Storage-Pool.png)
|
||||
构造存储池
|
||||
|
||||
**4. 用virsh带pool-start的命令来激活并启动我们刚才创建并构造完成的存储池。**
|
||||
|
||||
# virsh pool-start Spool1
|
||||
|
||||
![Active Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Active-Storage-Pool.png)
|
||||
激活存储池
|
||||
|
||||
**5. 查看环境中存储池的状态,用以下命令。**
|
||||
|
||||
# virsh pool-list --all
|
||||
|
||||
![Check Storage Pool Status](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Status.png)
|
||||
查看存储池状态
|
||||
|
||||
你会发现Spool1的状态变成了已激活。
|
||||
|
||||
**6. 对Spool1进行配置,让它每次都能被libvirtd服务自启动。**
|
||||
|
||||
# virsh pool-autostart Spool1
|
||||
|
||||
![Configure KVM Storage Pool](http://www.tecmint.com/wp-content/uploads/2015/02/Configure-Storage-Pool.png)
|
||||
配置KVM存储池
|
||||
|
||||
**7. 最后来看看我们新的存储池的信息吧。**
|
||||
|
||||
# virsh pool-info Spool1
|
||||
|
||||
![Check KVM Storage Pool Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Pool-Information.png)
|
||||
查看KVM存储池信息
|
||||
|
||||
恭喜你,Spool1已经准备好待命,接下来我们试着创建存储卷来使用它。
|
||||
|
||||
### 第二步: 配置存储卷/磁盘映像 ###
|
||||
|
||||
现在轮到磁盘映像了,用qemu-img命令在Spool1中创建一个新磁盘映像。获取更多细节信息,可以查看man手册。
|
||||
|
||||
# man qemu-img
|
||||
|
||||
**8. 我们应该在qemu-img命令之后指定“create, check,…”等等操作、磁盘映像格式、你想要创建的磁盘映像的路径和大小。**
|
||||
|
||||
# qemu-img create -f raw /mnt/personal-data/SPool1/SVol1.img 10G
|
||||
|
||||
![Create Storage Volume](http://www.tecmint.com/wp-content/uploads/2015/02/Create-Storage-Volumes.png)
|
||||
创建存储卷
|
||||
|
||||
**9. 通过使用带info的qemu-img命令,你可以获取到你的新磁盘映像的一些信息。**
|
||||
|
||||
![Check Storage Volume Information](http://www.tecmint.com/wp-content/uploads/2015/02/Check-Storage-Volume-Information.png)
|
||||
查看存储卷信息
|
||||
|
||||
**警告**: 不要用qemu-img命令来修改被运行中的虚拟机或任何其它进程所正在使用的映像,那样映像会被破坏。
|
||||
|
||||
现在是时候来创建虚拟机了。
|
||||
|
||||
### 第三步: 创建虚拟机 ###
|
||||
|
||||
**10. 现在到最后一个环节了,在最后一步中,我们将用virt-install命令来创建虚拟机。virt-install是一个用来创建新的KVM虚拟机命令行工具,它使用“libvirt”管理程序库。想获取更多细节,同样可以查看man手册。**
|
||||
|
||||
# man virt-install
|
||||
|
||||
要创建新的KVM虚拟机,你需要用到带以下所有信息的命令。
|
||||
|
||||
- Name: 虚拟机的名字。
|
||||
- Disk Location: 磁盘映像的位置。
|
||||
- Graphics : 怎样连接VM,通常是SPICE。
|
||||
- vcpu : 虚拟CPU的数量。
|
||||
- ram : 以兆字节计算的已分配内存大小。
|
||||
- Location : 指定安装源路径。
|
||||
- Network : 指定虚拟网络,通常是virbr0网桥。
|
||||
|
||||
# virt-install --name=rhel7 --disk path=/mnt/personal-data/SPool1/SVol1.img --graphics spice --vcpu=1 --ram=1024 --location=/run/media/dos/9e6f605a-f502-4e98-826e-e6376caea288/rhel-server-7.0-x86_64-dvd.iso --network bridge=virbr0
|
||||
|
||||
![Create New Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Create-New-Virtual-Machines.png)
|
||||
创建新的虚拟机
|
||||
|
||||
**11. 你会看到弹出一个virt-vierwer窗口,像是在通过它在与虚拟机通信。**
|
||||
|
||||
![Booting Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Booting-Virtual-Machine.jpeg)
|
||||
虚拟机启动程式
|
||||
|
||||
![Installation of Virtual Machine](http://www.tecmint.com/wp-content/uploads/2015/02/Installation-of-Virtual-Machine.jpeg)
|
||||
虚拟机安装过程
|
||||
|
||||
### 结论 ###
|
||||
|
||||
以上就是我们KVM教程的最后一部分了,当然我们还没有完全覆盖到全部,我们只是打了个擦边球,所以现在该轮到你来好好地利用这些丰富的资源来做自己想做的事了。
|
||||
|
||||
- [KVM Getting Started Guide][2]
|
||||
- [KVM Virtualization Deployment and Administration Guide][3]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/kvm-management-tools-to-manage-virtual-machines/
|
||||
|
||||
作者:[Mohammad Dosoukey][a]
|
||||
译者:[ZTinoZ](https://github.com/ZTinoZ)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/dos2009/
|
||||
[1]:http://www.tecmint.com/install-and-configure-kvm-in-linux/
|
||||
[2]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html
|
||||
[3]:https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html
|
@ -0,0 +1,70 @@
|
||||
Ubuntu中,使用Prey定位被盗的笔记本与手机
|
||||
===============================================================================
|
||||
Prey是一款跨平台的开源工具,可以帮助你找回被盗的笔记本,台式机,平板和智能手机。它已经获得了广泛的流行,声称帮助召回了成百上千台丢失的笔记本和智能手机。Prey的使用特别简单,首先安装在你的笔记本或者手机上,当你的设备不见了,用你的账号登入Prey网站,并且标记你的设备为“丢失”。只要小偷将设备接入网络,Prey就会马上发送设备的地理位置给你。如果你的笔记本有摄像头,它还会拍下小偷。
|
||||
|
||||
Prey占用很小的系统资源;你不会对你的设备运行有任何影响。你也可以配合其他你已经在设备上安装的防盗软件使用。Prey采用安全加密的通道,在你的设备与Prey服务器之间进行数据传输。
|
||||
|
||||
### 在Ubuntu上安装并配置Prey ###
|
||||
|
||||
让我们来看看如何在Ubuntu上安装和配置Prey,需要提醒的是,在配置过程中,我们必须到Prey官网进行账号注册。一旦完成上述工作,Prey将会开始监视的设备了。免费的账号最多可以监视三个设备,如果你需要添加更多的设备,你就需要购买合适的的套餐了。
|
||||
|
||||
想象一下Prey多么流行与被广泛使用,它现在已经被添加到了官方的软件库中了。这意味着你不要往软件包管理器添加任何PPA。很简单地,登录你的终端,运行以下的命令来安装它:
|
||||
|
||||
sudo apt-get install prey
|
||||
|
||||
![Install Prey](http://blog.linoxide.com/wp-content/uploads/2015/03/Install-Prey.png)
|
||||
|
||||
![Install Prey 1](http://blog.linoxide.com/wp-content/uploads/2015/03/Install-Prey-1.png)
|
||||
|
||||
Prey是十分轻巧的软件,只使用了系统几兆的空间,安装完成后,从Application >> Prey启动,之后它会询问你进行相关配置。
|
||||
|
||||
选择“New User”,如果你是第一次使用的话。
|
||||
|
||||
![Prey New User](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-New-User.png)
|
||||
|
||||
第二步实际上就是官网注册的流程。请提供你的用户名,邮箱地址和密码,来申清一个免费的账号。
|
||||
|
||||
![Register Prey](http://blog.linoxide.com/wp-content/uploads/2015/03/Register-Prey.png)
|
||||
|
||||
点击“Apply”完成,所有工作搞定,现在你的计算机被Prey保护了。
|
||||
|
||||
![Prey Configuration](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Configuration.png)
|
||||
|
||||
登录你最新建立的[Prey 账号][1],你就应该可以在“Devices”菜单下看见你的设备信息了。
|
||||
|
||||
![Prey Web Login](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Web-Login.png)
|
||||
|
||||
只要你的笔记本或者任何其他设备丢失了,就登录你的Prey网站账号,然后点击“Set Device to Missing”选项修改设备状态为“missing”。
|
||||
|
||||
![Prey Missing Page](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Missing-1.png)
|
||||
|
||||
从这里选择定时报告,并点击“Yes,my device is missing”。定时报告选项是指一段时间间隔后,软件会更新并发送给你设备的地理位置。它还会从网页界面那发邮件给你,只要设备的状态改变了。
|
||||
|
||||
![Prey Missing Email](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Missing-2.png)
|
||||
|
||||
而一旦被盗的设备接入了互联网,Prey就会马上发送报告给你,包括设备的地理位置和IP地址。
|
||||
|
||||
![Prey Found Report](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Missing-3.png)
|
||||
|
||||
点击报告链接,你应该会看到设备的地理位置和IP地址。
|
||||
|
||||
![Prey Final](http://blog.linoxide.com/wp-content/uploads/2015/03/Prey-Final.png)
|
||||
|
||||
Prey有一个明显的不足。它需要你的设备接入互联网才会发送地理位置给你,如果小偷比较聪明,在接入网络前将你的设备磁盘格式化了,那么你就永远不会收到设备被发现的报告了。但是这里仍然是有一个方法克服这个不足,确保添加一个BIOS密码,并且禁用从可移除的设备里启动系统。
|
||||
|
||||
### 结论 ###
|
||||
|
||||
这是一款小巧,非常有用的安全保护应用,可以让你在一个地方追踪你所有的设备,尽管不完美,但是仍然提供了找回被盗设备的机会。它在Linux,Windows和Mac平台上无缝运行。以上就是Prey完整使用的所有细节。
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/anti-theft-application-prey-ubuntu/
|
||||
|
||||
作者:[Aun Raza][a]
|
||||
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunrz/
|
||||
[1]:https://preyproject.com/
|
@ -0,0 +1,100 @@
|
||||
Linux有问必答--如何使用命令行压缩JPEG图像
|
||||
================================================================================
|
||||
> **问题**: 我有许多数码照相机拍出来的照片。我想在上传到Dropbox之前,优化和压缩下JPEG图片。有没有什么简单的方法压缩JPEG图片并不损耗他们的质量?
|
||||
|
||||
如今拍照设备(如智能手机、数码相机)拍出来的图片分辨率越来越大。甚至3630万像素的Nikon D800已经冲入市场,并且这个趋势根本停不下来。如今的拍照设备不断地提高着照片分辨率,使得我们不得不压缩后,再上传到有储存限制、带宽限制的云。
|
||||
|
||||
事实上,这里有一个非常简单的方法压缩JPEG图像。一个叫“jpegoptim”命令行工具可以帮助你“无损”美化JPEG图像,所以你可以压缩JPEG图片而不至于牺牲他们的质量。万一你的存储空间和带宽预算真的很少,jpegoptim也支持“有损耗”压缩来调整图像大小。
|
||||
|
||||
如果要压缩PNG图像,参考[this guideline][1]例子。
|
||||
|
||||
### 安装jpegoptim ###
|
||||
|
||||
Ubuntu, Debian 或 Linux Mint:
|
||||
|
||||
$ sudo apt-get install jpegoptim
|
||||
|
||||
Fedora:
|
||||
|
||||
$ sudo yum install jpegoptim
|
||||
|
||||
CentOS/RHEL安装,先开启[EPEL库][2],然后运行下列命令:
|
||||
|
||||
$ sudo yum install jpegoptim
|
||||
|
||||
### 无损压缩jpeg图像 ###
|
||||
|
||||
为了无损地压缩一副JPG图片,使用:
|
||||
|
||||
$ jpegoptim photo.jpg
|
||||
|
||||
----------
|
||||
|
||||
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 882178 --> 821064 bytes (6.93%), optimized.
|
||||
|
||||
注意,原始图像会被压缩后图像覆盖。
|
||||
|
||||
如果jpegoptim不能无损美化图像,将不会覆盖
|
||||
|
||||
$ jpegoptim -v photo.jpg
|
||||
|
||||
----------
|
||||
|
||||
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 821064 --> 821064 bytes (0.00%), skipped.
|
||||
|
||||
如果你想保护原始图片,使用"-d"参数指明保存目录
|
||||
|
||||
$ jpegoptim -d ./compressed photo.jpg
|
||||
|
||||
这样,压缩的图片将会保存在./compressed目录(已同样的输入文件名)
|
||||
|
||||
如果你想要保护文件的创建修改时间,使用"-p"参数。这样压缩后的图片会得到与原始图片相同的日期时间。
|
||||
|
||||
$ jpegoptim -d ./compressed -p photo.jpg
|
||||
|
||||
如果你只是想获得无损压缩率,使用"-n"参数来模拟压缩,然后它会打印压缩率。
|
||||
|
||||
$ jpegoptim -n photo.jpg
|
||||
|
||||
### 有损压缩JPG图像 ###
|
||||
|
||||
万一你真的需要要保存在云空间上,你可以使用有损压缩JPG图片。
|
||||
|
||||
这种情况下,使用"-m<质量>"选项,质量数范围0到100。(0是最好质量,100是最坏质量)
|
||||
|
||||
例如,用50%质量压缩图片:
|
||||
|
||||
$ jpegoptim -m50 photo.jpg
|
||||
|
||||
----------
|
||||
|
||||
photo.jpg 2048x1536 24bit N ICC JFIF [OK] 882178 --> 301780 bytes (65.79%), optimized.
|
||||
|
||||
在牺牲质量的基础上,将会得到一个更小的图片。
|
||||
|
||||
![](https://farm9.staticflickr.com/8707/16260736234_6d6f1d2434_c.jpg)
|
||||
|
||||
### 一次压缩多张JPEG图像 ###
|
||||
|
||||
最常见的情况是需要压缩一个目录下的多张JPEG图像文件。为了应付这种情况,你可以使用接下里的脚本。
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
# 压缩当前目录下所有*.jpg文件
|
||||
# 保存在./compressed目录
|
||||
# 并拥有与原始文件同样的修改日期
|
||||
for i in *.jpg; do jpegoptim -d ./compressed -p "$i"; done
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/compress-jpeg-images-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[VicYu/Vic020](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://ask.xmodulo.com/author/nanni
|
||||
[1]:http://xmodulo.com/how-to-compress-png-files-on-linux.html
|
||||
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
@ -0,0 +1,130 @@
|
||||
# Linux 下四种安全删除文件的工具 #
|
||||
|
||||
任何一个普通水平的计算机用户都知道,从计算机系统中删除的任意数据都可以稍候通过一些努力恢复出来。当你不小心删除了你的重要数据,这是一个不错的方案。但是大多数情况,你不希望你的隐私数据被轻易地恢复。不论何时,我们删除任意的文件,操作系统删除的仅仅是特定数据的索引。这就意味着,数据仍然保存在磁盘的某块地方,这种方法是不安全的,任何一个聪明的计算机黑客可以使用任意不错的数据恢复工具来恢复你删除的数据。Linux 用户利用我们都知晓的 "rm" 命令来从他们的操作系统中删除数据,但是 "rm" 命令在约定俗成的场景下工作。从这个命令删除的数据也可以使用特殊的文件恢复工具恢复。
|
||||
|
||||
让我们看看怎样安全并且完整地从你地 Linux 系统中删除文件或者文件夹。以下提到的工具可以完全地删除数据,因此那些恢复工具很难找到真实数据的痕迹然后恢复它。
|
||||
|
||||
### Secure-Delete ###
|
||||
|
||||
Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为永久删除文件提供高级的技术支持。一旦 Secure-Delete 安装在任意的 Linux 系统,它会提供如下的四个命令:
|
||||
|
||||
- srm
|
||||
- smem
|
||||
- sfill
|
||||
- sswap
|
||||
|
||||
在 ubuntu 的终端中运行如下命令安装此工具:
|
||||
|
||||
sudo apt-get install secure-delete
|
||||
|
||||
![secure delete](http://blog.linoxide.com/wp-content/uploads/2015/03/secure-delete.png)
|
||||
|
||||
在 RHEL,Fedora 或者 Centos 中运行如下命令安装此工具:
|
||||
|
||||
sudo yum install secure-delete
|
||||
|
||||
“**srm**” 命令的工作方式和 "rm" 命令类似,但是它不仅仅是删除文件,它首先使用一些随机的数据重写数次文件,然后彻底地删除此文件。这个命令的语法是相当地简单,仅仅指定要删除的文件或者目录,然后它会负责此任务。
|
||||
|
||||
sudo srm /home/aun/Documents/xueo/1.png
|
||||
|
||||
"**sfill**" 检测在指定的分区或者目录被标记为空闲或者可用的空间,然后使用它自身的算法用一些随机数据填充。因此它保证了在此分区没有可以恢复的文件或者文件夹。
|
||||
|
||||
sudo sfill /home
|
||||
|
||||
"**sswap**" 命令用来安全地清除你的交换分区。交换分区用来存放运行程序的数据。首先我们需要运行如下命令来找到你的交换分区。
|
||||
|
||||
cat /proc/swaps
|
||||
|
||||
如下是上述命令的输出示例:
|
||||
|
||||
aun@eagle:~$ cat /proc/swaps
|
||||
Filename Type Size Used Priority
|
||||
/dev/sda5 partition 2084860 71216 -1
|
||||
|
||||
从现在起,你可以看到你的交换分区设置在哪个分区,然后使用如下命令安全地清除。替换 "/dev/sda5" 部分为你的交换分区名字。
|
||||
|
||||
sudo sswap /dev/sda5
|
||||
|
||||
“**smem**” 用来清理在内存中的内容,它保证当系统重启或者关机时随机存取存储器(RAM)中的内容被清理,但是残余的数据痕迹仍然保存在内存。这个命令提供安全的内存清理,简单地在终端中运行 smem 命令。
|
||||
|
||||
smem
|
||||
|
||||
### Shred ###
|
||||
|
||||
"shred" 命令销毁文件或者文件夹的内容,在某种程度上,不可能恢复。它使用随机生成的数据模式来持续重写文件,因此很难恢复任意的被销毁的数据,即使是那些黑客或者窃贼使用高水平的数据恢复工具或者设备。Shred 在 Linux 发行版中时默认安装的,如果你想,你可以运行如下命令来找到它的安装目录:
|
||||
|
||||
aun@eagle:~$ whereis shred
|
||||
|
||||
shred: /usr/bin/shred /usr/share/man/man1/shred.1.gz
|
||||
|
||||
使用 shred 工具运行如下命令来删除文件:
|
||||
|
||||
shred /home/aun/Documents/xueo/1.png
|
||||
|
||||
使用 shred 运行如下命令来删除任意的分区,用你期望的分区来替换分区名字。
|
||||
|
||||
shred /dev/sda5
|
||||
|
||||
Shred 默认情况下使用随机内容重写数据 25 次。如果你想它重写文件更多次数,可以使用 "shred -n" 选项来简单地指定你所期望的次数。
|
||||
|
||||
shred -n 100 filename
|
||||
|
||||
如果你想在重写后截断或者删除文件,使用 "shred -u" 选项:
|
||||
|
||||
shred -u filename
|
||||
|
||||
### dd ###
|
||||
|
||||
这个命令起初是用于磁盘克隆的。它用于一个分区或者一个磁盘复制到另一个分区或者磁盘。但是它还用于安全地清除硬盘或者分区的内容。运行如下命令使用随机数据来重写你的当前数据。你不需要安装 dd 命令,所有的 Linux 分发版都已经包含了此命令。
|
||||
|
||||
sudo dd if=/dev/random of=/dev/sda
|
||||
|
||||
你也可以重写磁盘或者分区中的内容,只需要简单地将所有替换为 “zero”。
|
||||
|
||||
sudo dd if=/dev/zero of=/dev/sda
|
||||
|
||||
### Wipe ###
|
||||
|
||||
Wipe 起初开发的目的是从磁媒体中安全地擦除文件。这个命令行工具使用特殊的模式来重复地写文件。它使用 fsync() 调用和或 O_SYNC 位来强制访问磁盘,并且使用 Gutmann 算法来重复地写。你可以使用此命令删除单个文件,文件夹或者整个磁盘的内容,但是使用 wipe 命令来删除整个磁盘的模式会耗费大量的时间。另外,安装和使用这个工具相当容易。
|
||||
|
||||
在 ubuntu 的终端中运行如下命令来安装 wipe。
|
||||
|
||||
sudo aptitude install wipe
|
||||
|
||||
![Wipe Linux](http://blog.linoxide.com/wp-content/uploads/2015/03/wipe.png)
|
||||
|
||||
使用如下命令在 Redhat Linux,Centos 或者 Fedora 中安装 Wipe:
|
||||
|
||||
sudo yum install wipe
|
||||
|
||||
一旦安装完成,在终端中运行如下命令来获得完整的可用选项列表:
|
||||
|
||||
man wipe
|
||||
|
||||
删除任意文件或者目录:
|
||||
|
||||
wipe filename
|
||||
|
||||
运行如下命令来安全地移除 tmp 分区:
|
||||
|
||||
wipe -r /tmp
|
||||
|
||||
使用如下的命令来删除完整分区的内容(替换分区名字为你所期望的分区)。
|
||||
|
||||
wipe /dev/sda1
|
||||
|
||||
### 小结 ###
|
||||
|
||||
我们期望这篇文章对你有帮助,你的数据隐私是有决定性意义的,在你的系统中安装这些安全的删除工具对你来说非常重要,因此你可以删除你的隐私数据而不用担心它们被轻易地恢复。上面提到的所有工具都是相当轻量的,它们只需要耗费最低的系统资源来运行,并且无论如何也不会影响你的系统性能。享受它们带来的便利吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/security/delete-files-permanatly-linux/
|
||||
|
||||
作者:[Aun Raza][a]
|
||||
译者:[dbarobin](https://github.com/dbarobin)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunrz/
|
@ -0,0 +1,60 @@
|
||||
Prips - 打印指定范围内的IP地址
|
||||
================================================================================
|
||||
prips是一个可以打印出指定范围内所有ip地址的一个工具。它可以增强那些只能同时工作在一个主机上的工具的可用性。
|
||||
|
||||
### 在ubuntu上安装prips ###
|
||||
|
||||
打开终端并输入下面的命令
|
||||
|
||||
sudo apt-get install prips
|
||||
|
||||
### 使用prips ###
|
||||
|
||||
### prips语法 ###
|
||||
|
||||
prips [-c] [-d delim] [-e exclude] [-f format] [-i incr] start end
|
||||
prips [-c] [-d delim] [-e exclude] [-f format] [-i incr] CIDR-block
|
||||
|
||||
### 可用选项 ###
|
||||
|
||||
prips接受下面的命令行选项:
|
||||
|
||||
- -c -- 以CIDR形式打印范围。
|
||||
- -d delim -- 用ASCII码作为分隔符,0 <= delim <= 255。
|
||||
- -e -- 排除输出的范围。
|
||||
- -f format -- 设置地址格式 (16进制, 10进制, 或者dot).
|
||||
- -i incr -- 设置增长上限
|
||||
|
||||
### Prips示例 ###
|
||||
|
||||
显示保留的子网内的所有地址:
|
||||
|
||||
prips 192.168.32.0 192.168.32.255
|
||||
|
||||
同样使用CIDR标示:
|
||||
|
||||
prips 192.168.32/24
|
||||
|
||||
只显示A类保留子网内所有可用的地址,用空格而不是换行作为分隔符:
|
||||
|
||||
prips -d 32 10.0.0.1 10.255.255.255
|
||||
|
||||
每块显示4个ip地址:
|
||||
|
||||
prips -i 4 192.168.32.7 192.168.33.5
|
||||
|
||||
打印包含两个地址的最小CIDR块。
|
||||
|
||||
prips -c 192.168.32.5 192.168.32.11
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/prips-print-ip-address-on-a-given-range.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
Loading…
Reference in New Issue
Block a user