From e543e35406d8c73f72cff10d3dfa0e59c19469e9 Mon Sep 17 00:00:00 2001 From: yajun Date: Mon, 15 Jun 2015 12:59:36 -0400 Subject: [PATCH 01/76] translating.. --- ...20141211 Open source all over the world.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 translated/talk/20141211 Open source all over the world.md diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md new file mode 100644 index 0000000000..b39820bebc --- /dev/null +++ b/translated/talk/20141211 Open source all over the world.md @@ -0,0 +1,150 @@ +Open source all over the world +================================================================================ +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) + +图片来源 : opensource.com + +经过了一整天的Opensource.com[社区版主][1]年会,最后一项日程提了上来,内容只有“特邀嘉宾:待定”几个字。作为[Opensource.com][3]的项目负责人和社区管理员,[Jason Hibbets][2]起身解释道,“因为这个嘉宾有可能无法到场,因此我不想提前说是谁。在几个月前我问他何时有空过来,他给了我两个时间点,我选了其中一个。今天是这三周中Jim唯一能来的一天”。(译者注:Jim是指下文中提到的Jim Whitehurst,即红帽公司总裁兼首席执行官) + +这句话在版主们(Moderators)中引起一阵轰动,他们从世界各地赶来参加此次的[拥抱开源大会(All Things Open Conference)][4]。版主们纷纷往前挪动椅子,仔细聆听。 + +“他会首先作半个小时的演讲,然后会回答几个提问。”,Jason说道。 + +会场的门开着,似乎一直在等着这位大人物的出现。这时,会场前唯一一个空位上来了一位高个子。 + +“大家好!”,这个家伙开口了。他没穿正装,只是衬衫和休闲裤。 + +这时会场中第二高个子的人,红帽全球意识部门(Global Awareness)的高级主管[Jeff Mackanic][5],告诉他大部分社区版本今天都在场,然后让每个人开始作简单的自我介绍。 + +“我叫[Jen Wike Huger][6],负责Opensource.com的内容管理,很高兴见到大家。” + +“我叫[Nicole][7]。是[ByWater Solutions][8]的副总裁,我们在做免费的开源库。我到各地旅行并教会人们如何使用软件。” + +“我叫[Robin][9],从2013年开始参与版主项目。我在OSDC做了一些事情,工作是在[City of the Hague][10]维护[网站][11]。” + +“我叫[Marcus Hanwell][12],来自英格兰,在[Kitware][13]工作。同时,我是FOSS科学软件的技术总监,和国家实验室在[Titan][14] Z和[Gpu programming][15]方面合作。我主要使用[Gentoo][16]和[KDE][17]。最后,我很激动能加入FOSS和开源科学。” + +“我叫[Phil Shapiro][18],是华盛顿的一个小图书馆28个Linux工作站的管理员。我视各位为我的同事。非常高兴能一起交流分享,贡献力量。我主要关注FOSS和自豪感的关系,以及FOSS如何提升自豪感。” + +“我叫[Joshua Holm][19]。我大多数时间都在关注系统更新,以及帮助人们在网上找工作。” + +“我叫[Mel Chernoff][20],在红帽工作,和[Jason Hibbets]和[Mark Bohannon]一起主要关注政府渠道方面。” + +“我叫[Scott Nesbitt][24],写过很多东西,使用FOSS很久了。我是个普通人,不是系统管理员,也不是程序员,只希望能更加高效工作。我帮助人们在商业和生活中使用FOSS。” + +“我叫[Luis Ibanez][25],刚加入[Google][26]。我对DIY和FOSS感兴趣。” + +“我叫[Remy DeCausemaker][27],在[RIT MAGIC Center][28]的黑客学院(Resident Hackademic),也是[交互式游戏和媒体系][29]的一个兼职教授。现在为Opensource.com写作将近四年。” + +“你在[新FOSS Minor][30]教书?!”,Jim说道,“很酷!” + +“我叫[Jason Baker][31]。我是红慢的一个云专家,主要做[OpenStack][32]方面的工作。” + +“我叫[Mark Bohannan][33],是红帽全球开放协议的一员,在华盛顿外工作。和Mel一样,我花了相当多时间写作,也从法律和政府部门中找合作者。我做了一个很好的小册子来讨论正在发生在政府中的积极变化。” + +“我叫[Jason Hibbets][34],我组织了这次会议。” + +会场中一片笑声。 + +“我也组织了这片讨论,可以这么说,”这个棕红色头发笑容灿烂的家伙说道。笑声持续一会逐渐平息。 + +我当时在他左边,时不时从转录空隙中抬头看一眼,然后从眼神中注意到微笑背后暗示的那个自2008年1月起开始领导公司的人,红帽的CEO[Jim Whitehurst][35]。 + +“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。” + +"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.” + +"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.” + +"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.” + +"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'" + +"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." + +"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'" + +"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.” + +"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you." + +I stole a glimpse of everyone at the table: more than a few people had tears in their eyes. + +Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time." + +At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities. + +**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation." + +**Nicole**: "There are a lot of egos in academia. You need a release manager." + +**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early." + +**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more." + +**Jim**: "Is there an active role that companies can play in that?" + +[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office." + +**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning." + +Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source + +作者:[Remy][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/remyd +[1]:http://opensource.com/community-moderator-program +[2]:https://twitter.com/jhibbets +[3]:http://opensource.com/ +[4]:http://allthingsopen.org/ +[5]:http://opensource.com/users/mackanic +[6]:https://twitter.com/JenWike +[7]:http://opensource.com/users/nengard +[8]:http://bywatersolutions.com/ +[9]:http://opensource.com/life/13/7/community-spotlight-robin-muilwijk +[10]:https://en.wikipedia.org/wiki/The_Hague +[11]:http://www.denhaag.nl/en.htm +[12]:https://twitter.com/mhanwell +[13]:http://www.kitware.com/ +[14]:http://www.nvidia.com/gtx-700-graphics-cards/gtx-titan-z/ +[15]:https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units +[16]:https://www.gentoo.org/ +[17]:http://kde.org/ +[18]:https://twitter.com/philshapiro +[19]:http://opensource.com/community/13/9/contributor-spotlight-joshua-holm +[20]:http://opensource.com/users/melanie +[21]:http://opensource.com/government +[22]:https://twitter.com/jhibbets +[23]:https://twitter.com/markbotech +[24]:http://scottnesbitt.me/ +[25]:http://opensource.com/users/luis-ibanez +[26]:http://google.com/ +[27]:http://twitter.com/remy_d +[28]:http://foss.rit.edu/ +[29]:http://igm.rit.edu/ +[30]:http://www.rit.edu/news/story.php?id=50590 +[31]:https://twitter.com/jehb +[32]:http://openstack.org/ +[33]:https://twitter.com/markbotech +[34]:https://twitter.com/jhibbets +[35]:http://www.redhat.com/en/about/company/management/james-whitehurst +[36]:http://www.bseindia.com/ +[37]:http://google.com/ +[38]:https://mail.corp.redhat.com/service/home/%7E/Amazon +[39]:https://mail.corp.redhat.com/service/home/%7E/Facebook +[40]:https://hadoop.apache.org/ +[41]:https://cassandra.apache.org/ +[42]:https://en.wikipedia.org/wiki/3D_printing +[43]:https://twitter.com/mairin +[44]:http://jobs.redhat.com/life-at-red-hat/our-culture/ +[45]:http://www.gutenberg.org/ebooks/4300 +[46]:https://twitter.com/philshapiro +[47]:http://libreoffice.org/ From 4c51e02ca161d41c93bbc9beefb2d8ccaef60c75 Mon Sep 17 00:00:00 2001 From: yajun Date: Tue, 23 Jun 2015 11:00:37 +0800 Subject: [PATCH 02/76] update --- .../talk/20141211 Open source all over the world.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md index b39820bebc..c897765d75 100644 --- a/translated/talk/20141211 Open source all over the world.md +++ b/translated/talk/20141211 Open source all over the world.md @@ -1,4 +1,4 @@ -Open source all over the world +一个开源的世界 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) @@ -50,15 +50,13 @@ Open source all over the world 我当时在他左边,时不时从转录空隙中抬头看一眼,然后从眼神中注意到微笑背后暗示的那个自2008年1月起开始领导公司的人,红帽的CEO[Jim Whitehurst][35]。 -“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。” +“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。”用户也看到了这一点。他们用FOSS并不是因为它便宜,而是因为它能提供和创新的解决方案。这也十一个全球现象。比如,我刚才还在印度,然后发现那里的用户拥抱开源的两个理由:一个是创新,另一个是那里的市场有些特殊,需要完全的控制。 -"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.” +“[孟买证券交易所][36]想得到源代码并加以控制,五年前这在证券交易领域闻所未闻。那时FOSS正在重复发明轮子。今天看来,FOSS正在做几乎所有的结合了大数据的事物。几乎所有的新框架,语言和方法论,包括流动(尽管不包括设备),都首先发生在开源世界。” -"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.” +“这是因为用户数量已经达到了相当的规模。这不只是红帽遇到的情况,[Google][37],[Amazon][38],[Facebook][39]等也出现这样的情况。他们想解决自己的问题,用开源的方式。忘掉协议吧,开源绝不仅如此。我们建立了一个交通工具,一套规则,例如[Hadoop][40],[Cassandra][41]和其他工具。事实上,开源驱动创新。例如,Hadoop在厂商们意识的规模带来的问题。他们实际上有足够的资和资源金来解决自己的问题。”开源是许多领域的默认技术方案。这在一个更加注重内容的世界中更是如此,例如[3D打印][42]和其他使用信息内容的物理产品。” -"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.” - -"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'" +“源代码的开源确实很酷,但开源不应当仅限于此。在各行各业不同领域开源仍有可以用武之地。我们要问下自己:‘开源能够为教育,政府,法律带来什么?其它的呢?其它的领域如何能学习我们?’” "There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." From ee5be1808b9c96f1700a931c5f4369f8ec887e90 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 25 Jun 2015 10:36:08 +0800 Subject: [PATCH 03/76] [Translated] tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md --- ...M (Logical Volume Management) in Ubuntu.md | 269 ------------------ ...M (Logical Volume Management) in Ubuntu.md | 268 +++++++++++++++++ 2 files changed, 268 insertions(+), 269 deletions(-) delete mode 100644 sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md create mode 100644 translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md diff --git a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md deleted file mode 100644 index 35f5e5db7e..0000000000 --- a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ /dev/null @@ -1,269 +0,0 @@ -Translating by ictlyh -How to Manage and Use LVM (Logical Volume Management) in Ubuntu -================================================================================ -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) - -In our [previous article we told you what LVM is and what you may want to use it for][1], and today we are going to walk you through some of the key management tools of LVM so you will be confident when setting up or expanding your installation. - -As stated before, LVM is a abstraction layer between your operating system and physical hard drives. What that means is your physical hard drives and partitions are no longer tied to the hard drives and partitions they reside on. Rather, the hard drives and partitions that your operating system sees can be any number of separate hard drives pooled together or in a software RAID. - -To manage LVM there are GUI tools available but to really understand what is happening with your LVM configuration it is probably best to know what the command line tools are. This will be especially useful if you are managing LVM on a server or distribution that does not offer GUI tools. - -Most of the commands in LVM are very similar to each other. Each valid command is preceded by one of the following: - -- Physical Volume = pv -- Volume Group = vg -- Logical Volume = lv - -The physical volume commands are for adding or removing hard drives in volume groups. Volume group commands are for changing what abstracted set of physical partitions are presented to your operating in logical volumes. Logical volume commands will present the volume groups as partitions so that your operating system can use the designated space. - -### Downloadable LVM Cheat Sheet ### - -To help you understand what commands are available for each prefix we made a LVM cheat sheet. We will cover some of the commands in this article, but there is still a lot you can do that won’t be covered here. - -All commands on this list will need to be run as root because you are changing system wide settings that will affect the entire machine. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png) - -### How to View Current LVM Information ### - -The first thing you may need to do is check how your LVM is set up. The s and display commands work with physical volumes (pv), volume groups (vg), and logical volumes (lv) so it is a good place to start when trying to figure out the current settings. - -The display command will format the information so it’s easier to understand than the s command. For each command you will see the name and path of the pv/vg and it should also give information about free and used space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png) - -The most important information will be the PV name and VG name. With those two pieces of information we can continue working on the LVM setup. - -### Creating a Logical Volume ### - -Logical volumes are the partitions that your operating system uses in LVM. To create a logical volume we first need to have a physical volume and volume group. Here are all of the steps necessary to create a new logical volume. - -#### Create physical volume #### - -We will start from scratch with a brand new hard drive with no partitions or information on it. Start by finding which disk you will be working with. (/dev/sda, sdb, etc.) - -> Note: Remember all of the commands will need to be run as root or by adding ‘sudo’ to the beginning of the command. - - fdisk -l - -If your hard drive has never been formatted or partitioned before you will probably see something like this in the fdisk output. This is completely fine because we are going to create the needed partitions in the next steps. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) - -Our new disk is located at /dev/sdb so lets use fdisk to create a new partition on the drive. - -There are a plethora of tools that can create a new partition with a GUI, [including Gparted][2], but since we have the terminal open already, we will use fdisk to create the needed partition. - -From a terminal type the following commands: - - fdisk /dev/sdb - -This will put you in a special fdisk prompt. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) - -Enter the commands in the order given to create a new primary partition that uses 100% of the new hard drive and is ready for LVM. If you need to change the partition size or want multiple partions I suggest using GParted or reading about fdisk on your own. - -**Warning: The following steps will format your hard drive. Make sure you don’t have any information on this hard drive before following these steps.** - -- n = create new partition -- p = creates primary partition -- 1 = makes partition the first on the disk - -Push enter twice to accept the default first cylinder and last cylinder. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png) - -To prepare the partition to be used by LVM use the following two commands. - -- t = change partition type -- 8e = changes to LVM partition type - -Verify and write the information to the hard drive. - -- p = view partition setup so we can review before writing changes to disk -- w = write changes to disk - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) - -After those commands, the fdisk prompt should exit and you will be back to the bash prompt of your terminal. - -Enter pvcreate /dev/sdb1 to create a LVM physical volume on the partition we just created. - -You may be asking why we didn’t format the partition with a file system but don’t worry, that step comes later. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png) - -#### Create volume Group #### - -Now that we have a partition designated and physical volume created we need to create the volume group. Luckily this only takes one command. - - vgcreate vgpool /dev/sdb1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) - -Vgpool is the name of the new volume group we created. You can name it whatever you’d like but it is recommended to put vg at the front of the label so if you reference it later you will know it is a volume group. - -#### Create logical volume #### - -To create the logical volume that LVM will use: - - lvcreate -L 3G -n lvstuff vgpool - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) - -The -L command designates the size of the logical volume, in this case 3 GB, and the -n command names the volume. Vgpool is referenced so that the lvcreate command knows what volume to get the space from. - -#### Format and Mount the Logical Volume #### - -One final step is to format the new logical volume with a file system. If you want help choosing a Linux file system, read our [how to that can help you choose the best file system for your needs][3]. - - mkfs -t ext3 /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png) - -Create a mount point and then mount the volume somewhere you can use it. - - mkdir /mnt/stuff - mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png) - -#### Resizing a Logical Volume #### - -One of the benefits of logical volumes is you can make your shares physically bigger or smaller without having to move everything to a bigger hard drive. Instead, you can add a new hard drive and extend your volume group on the fly. Or if you have a hard drive that isn’t used you can remove it from the volume group to shrink your logical volume. - -There are three basic tools for making physical volumes, volume groups, and logical volumes bigger or smaller. - -Note: Each of these commands will need to be preceded by pv, vg, or lv depending on what you are working with. - -- resize – can shrink or expand physical volumes and logical volumes but not volume groups -- extend – can make volume groups and logical volumes bigger but not smaller -- reduce – can make volume groups and logical volumes smaller but not bigger - -Let’s walk through an example of how to add a new hard drive to the logical volume “lvstuff” we just created. - -#### Install and Format new Hard Drive #### - -To install a new hard drive follow the steps above to create a new partition and add change it’s partition type to LVM (8e). Then use pvcreate to create a physical volume that LVM can recognize. - -#### Add New Hard Drive to Volume Group #### - -To add the new hard drive to a volume group you just need to know what your new partition is, /dev/sdc1 in our case, and the name of the volume group you want to add it to. - -This will add the new physical volume to the existing volume group. - - vgextend vgpool /dev/sdc1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png) - -#### Extend Logical Volume #### - -To resize the logical volume we need to say how much we want to extend by size instead of by device. In our example we just added a 8 GB hard drive to our 3 GB vgpool. To make that space usable we can use lvextend or lvresize. - - lvextend -L8G /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png) - -While this command will work you will see that it will actually resize our logical volume to 8 GB instead of adding 8 GB to the existing volume like we wanted. To add the last 3 available gigabytes you need to use the following command. - - lvextend -L+3G /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png) - -Now our logical volume is 11 GB in size. - -#### Extend File System #### - -The logical volume is 11 GB but the file system on that volume is still only 3 GB. To make the file system use the entire 11 GB available you have to use the command resize2fs. Just point resize2fs to the 11 GB logical volume and it will do the magic for you. - - resize2fs /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png) - -**Note: If you are using a different file system besides ext3/4 please see your file systems resize tools.** - -#### Shrink Logical Volume #### - -If you wanted to remove a hard drive from a volume group you would need to follow the above steps in reverse order and use lvreduce and vgreduce instead. - -1. resize file system (make sure to move files to a safe area of the hard drive before resizing) -1. reduce logical volume (instead of + to extend you can also use – to reduce by size) -1. remove hard drive from volume group with vgreduce - -#### Backing up a Logical Volume #### - -Snapshots is a feature that some newer advanced file systems come with but ext3/4 lacks the ability to do snapshots on the fly. One of the coolest things about LVM snapshots is your file system is never taken offline and you can have as many as you want without taking up extra hard drive space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) - -When LVM takes a snapshot, a picture is taken of exactly how the logical volume looks and that picture can be used to make a copy on a different hard drive. While a copy is being made, any new information that needs to be added to the logical volume is written to the disk just like normal, but changes are tracked so that the original picture never gets destroyed. - -To create a snapshot we need to create a new logical volume with enough free space to hold any new information that will be written to the logical volume while we make a backup. If the drive is not actively being written to you can use a very small amount of storage. Once we are done with our backup we just remove the temporary logical volume and the original logical volume will continue on as normal. - -#### Create New Snapshot #### - -To create a snapshot of lvstuff use the lvcreate command like before but use the -s flag. - - lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) - -Here we created a logical volume with only 512 MB because the drive isn’t being actively used. The 512 MB will store any new writes while we make our backup. - -#### Mount New Snapshot #### - -Just like before we need to create a mount point and mount the new snapshot so we can copy files from it. - - mkdir /mnt/lvstuffbackup - mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png) - -#### Copy Snapshot and Delete Logical Volume #### - -All you have left to do is copy all of the files from /mnt/lvstuffbackup/ to an external hard drive or tar it up so it is all in one file. - -**Note: tar -c will create an archive and -f will say the location and file name of the archive. For help with the tar command use man tar in the terminal.** - - tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/ - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) - -Remember that while the backup is taking place all of the files that would be written to lvstuff are being tracked in the temporary logical volume we created earlier. Make sure you have enough free space while the backup is happening. - -Once the backup finishes, unmount the volume and remove the temporary snapshot. - - umount /mnt/lvstuffbackup - lvremove /dev/vgpool/lvstuffbackup/ - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png) - -#### Deleting a Logical Volume #### - -To delete a logical volume you need to first make sure the volume is unmounted, and then you can use lvremove to delete it. You can also remove a volume group once the logical volumes have been deleted and a physical volume after the volume group is deleted. - -Here are all the commands using the volumes and groups we’ve created. - - umount /mnt/lvstuff - lvremove /dev/vgpool/lvstuff - vgremove vgpool - pvremove /dev/sdb1 /dev/sdc1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png) - -That should cover most of what you need to know to use LVM. If you’ve got some experience on the topic, be sure to share your wisdom in the comments. - --------------------------------------------------------------------------------- - -via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ - -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ -[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ -[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file diff --git a/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md new file mode 100644 index 0000000000..c3a84f5fcf --- /dev/null +++ b/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -0,0 +1,268 @@ +如何在 Ubuntu 中管理和使用 LVM(Logical Volume Management,逻辑卷管理) +================================================================================ +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) + +在我们之前的文章中,我们介绍了[什么是 LVM 以及能用 LVM 做什么][1],今天我们会给你介绍一些 LVM 的主要管理工具,使得你在设置和扩展安装时更游刃有余。 + +正如之前所述,LVM 是介于你的操作系统和物理硬盘驱动器之间的抽象层。这意味着你的物理硬盘驱动器和分区不再依赖于他们所在的硬盘驱动和分区。而是,你的操作系统所见的硬盘驱动和分区可以是由任意数目的独立硬盘驱动汇集而成或是一个软件磁盘阵列。 + +要管理 LVM,这里有很多可用的 GUI 工具,但要真正理解 LVM 配置发生的事情,最好要知道一些命令行工具。这当你在一个服务器或不提供 GUI 工具的发行版上管理 LVM 时尤为有用。 + +LVM 的大部分命令和彼此都非常相似。每个可用的命令都由以下其中之一开头: + +- Physical Volume = pv +- Volume Group = vg +- Logical Volume = lv + +物理卷命令用于在卷组中添加或删除硬盘驱动。卷组命令用于为你的逻辑卷操作更改显示的物理分区抽象集。逻辑卷命令会以分区形式显示卷组使得你的操作系统能使用指定的空间。 + +### 可下载的 LVM 备忘单 ### + +为了帮助你理解每个前缀可用的命令,我们制作了一个备忘单。我们会在该文章中介绍一些命令,但仍有很多你可用但没有介绍到的命令。 + +该列表中的所有命令都要以 root 身份运行,因为你更改的是会影响整个机器系统级设置。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png) + +### 如何查看当前 LVM 信息 ### + +你首先需要做的事情是检查你的 LVM 设置。s 和 display 命令和物理卷(pv)、卷组(vg)以及逻辑卷(lv)一起使用,是一个找出当前设置好的开始点。 + +display 命令会格式化输出信息,因此比 s 命令更易于理解。对每个命令你会看到名称和 pv/vg 的路径,它还会给出空闲和已使用空间的信息。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png) + +最重要的信息是 PV 名称和 VG 名称。用这两部分信息我们可以继续进行 LVM 设置。 + +### 创建一个逻辑卷 ### + +逻辑卷是你的操作系统在 LVM 中使用的分区。创建一个逻辑卷,首先需要拥有一个物理卷和卷组。下面是创建一个新的逻辑卷所需要的全部命令。 + +#### 创建物理卷 #### + +我们会从一个完全新的没有任何分区和信息的硬盘驱动开始。首先找出你将要使用的磁盘。(/dev/sda, sdb, 等) + +> 注意:记住所有的命令都要以 root 身份运行或者在命令前面添加 'sudo' 。 + + fdisk -l + +如果之前你的硬盘驱动从没有格式化或分区,在 fdisk 的输出中你很可能看到类似下面的信息。这完全正常,因为我们会在下面的步骤中创建需要的分区。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) + +我们的新磁盘位置是 /dev/sdb,让我们用 fdisk 命令在驱动上创建一个新的分区。 + +这里有大量能创建新分区的 GUI 工具,包括 [Gparted][2],但由于我们已经打开了终端,我们将使用 fdisk 命令创建需要的分区。 + +在终端中输入以下命令: + + fdisk /dev/sdb + +这会使你进入到一个特殊的 fdisk 提示符中。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) + +以指定的顺序输入命令创建一个使用新硬盘驱动 100% 空间的主分区并为 LVM 做好了准备。如果你需要更改分区的大小或相应多个分区,我建议使用 GParted 或自己了解关于 fdisk 命令的使用。 + +**警告:下面的步骤会格式化你的硬盘驱动。确保在进行下面步骤之前你的硬盘驱动中没有任何信息。** + +- n = 创建新分区 +- p = 创建主分区 +- 1 = 成为磁盘上的首个分区 + +输入 enter 键两次以接受默认的第一个和最后一个柱面。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png) + +用下面的命令准备 LVM 所使用的分区。 + +- t = 更改分区类型 +- 8e = 更改为 LVM 分区类型 + +核实并将信息写入硬盘驱动器。 + +- p = 查看分区设置使得写入更改到磁盘之前可以回看 +- w = 写入更改到磁盘 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) + +运行这些命令之后,会退出 fdisk 提示符并返回到终端的 bash 提示符中。 + +输入 pvcreate /dev/sdb1 在刚创建的分区上新建一个 LVM 物理卷。 + +你也许会问为什么我们不用一个文件系统格式化分区,不用担心,该步骤在后面。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png) + +#### 创建卷组 #### + +现在我们有了一个指定的分区和创建好的物理卷,我们需要创建一个卷组。很幸运这只需要一个命令。 + + vgcreate vgpool /dev/sdb1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) + +Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称,但建议标签以 vg 开头,以便后面你使用它时能意识到这是一个卷组。 + +#### 创建逻辑卷 #### + +创建 LVM 将使用的逻辑卷: + + lvcreate -L 3G -n lvstuff vgpool + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) + +-L 命令指定逻辑卷的大小,在该情况中是 3 GB,-n 命令指定卷的名称。 指定 vgpool 所以 lvcreate 命令知道从什么卷获取空间。 + +#### 格式化并挂载逻辑卷 #### + +最后一步是用一个文件系统格式化新的逻辑卷。如果你需要选择一个 Linux 文件系统的帮助,请阅读 [如果根据需要选取最合适的文件系统][3]。 + + mkfs -t ext3 /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png) + +创建挂载点并将卷挂载到你可以使用的地方。 + + mkdir /mnt/stuff + mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png) + +#### 重新设置逻辑卷大小 #### + +逻辑卷的一个好处是你能使你的共享物理变大或变小而不需要移动所有东西到一个更大的硬盘驱动。另外,你可以添加新的硬盘驱动并同时扩展你的卷组。或者如果你有一个不使用的硬盘驱动,你可以从卷组中移除它使得逻辑卷变小。 + +这里有三个用于使物理卷、卷组和逻辑卷变大或变小的基础工具。 + +注意:这些命令中的每个都要以 pv、vg 或 lv 开头,取决于你的工作对象。 + +- resize – 能压缩或扩展物理卷和逻辑卷,但卷组不能 +- extend – 能使卷组和逻辑卷变大但不能变小 +- reduce – 能使卷组和逻辑卷变小但不能变大 + +让我们来看一个如何向刚创建的逻辑卷 "lvstuff" 添加新硬盘驱动的例子。 + +#### 安装并格式化新硬盘驱动 #### + +按照上面创建新分区并更改分区类型为 LVM(8e) 的步骤安装一个新硬盘驱动。然后用 pvcreate 命令创建一个 LVM 能识别的物理卷。 + +#### 添加新硬盘驱动到卷组 #### + +要添加新的硬盘驱动到一个卷组,你只需要知道你的新分区,在我们的例子中是 /dev/sdc1,以及想要添加到的卷组的名称。 + +这会添加新物理卷到已存在的卷组中。 + + vgextend vgpool /dev/sdc1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png) + +#### 扩展逻辑卷 #### + +调整逻辑卷的大小,我们需要指出的是通过大小而不是设备来扩展。在我们的例子中,我们会添加一个 8GB 的硬盘驱动到我们的 3GB vgpool。我们可以用 lvextend 或 lvresize 命令使该空间可用。 + + lvextend -L8G /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png) + +当这个命令工作的时候你会发现它实际上重新设置逻辑卷大小为 8GB 而不是我们期望的将 8GB 添加到已存在的卷上。要添加剩余的可用 3GB 你需要用下面的命令。 + + lvextend -L+3G /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png) + +现在我们的逻辑卷已经是 11GB 大小了。 + +#### 扩展文件系统 #### + +逻辑卷是 11GB 大小但是上面的文件系统仍然只有 3GB。要使文件系统使用整个的 11GB 可用空间你需要用 resize2fs 命令。你只需要指定 resize2fs 到 11GB 逻辑卷它就会帮你完成其余的工作。 + + resize2fs /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png) + +**注意:如果你使用除 ext3/4 之外的文件系统,请查看调整你的文件系统大小的工具。** + +#### 压缩逻辑卷 #### + +如果你想从卷组中移除一个硬盘驱动你可以按照上面的步骤反向操作,并用 lvreduce 或 vgreduce 命令代替。 + +1. 调整文件系统大小 (调整之前确保已经移动文件到硬盘驱动安全的地方) +1. 减小逻辑卷 (除了 + 可以扩展大小,你也可以用 - 压缩大小) +1. 用 vgreduce 从卷组中移除硬盘驱动 + +#### 备份逻辑卷 #### + +快照是一些新的高级文件系统提供的功能,但是 ext3/4 文件系统并没有快照的功能。LVM 快照最棒的是你的文件系统永不掉线,你可以拥有你想要的任何大小而不需要额外的硬盘空间。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) + +LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该照片可以用于在不同的硬盘驱动上进行备份。生成一个备份的时候,任何需要添加到逻辑卷的新信息会如往常一样写入磁盘,但会跟踪更改使得原始快照永远不会损毁。 + +要创建一个快照,我们需要创建拥有足够空闲空间的逻辑卷,用于保存我们备份的时候会写入该逻辑卷的任何新信息。如果驱动并不是经常写入,你可以使用很小的一个存储空间。备份完成的时候我们只需要移除临时逻辑卷,原始逻辑卷会和往常一样。 + +#### 创建新快照 #### + +创建 lvstuff 的快照,用带 -s 标记的 lvcreate 命令。 + + lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) + +这里我们创建了一个只有 512MB 的逻辑卷,因为驱动实际上并不会使用。512MB 的空间会保存备份时产生的任何新数据。 + +#### 挂载新快照 #### + +和之前一样,我们需要创建一个挂载点并挂载新快照,然后才能从中复制文件。 + + mkdir /mnt/lvstuffbackup + mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png) + +#### 复制快照和删除逻辑卷 #### + +你剩下需要做的是从 /mnt/lvstuffbackup/ 中复制所有文件到一个外部的硬盘驱动或者打包所有文件到一个文件。 + +**注意:tar -c 会创建一个归档文件,-f 要指出归档文件的名称和路径。要获取 tar 命令的帮助信息,可以在终端中输入 man tar。** + + tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/ + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) + +记住备份发生的时候写到 lvstuff 的所有文件都会在我们之前创建的临时逻辑卷中被跟踪。确保备份的时候你有足够的空闲空间。 + +备份完成后,卸载卷并移除临时快照。 + + umount /mnt/lvstuffbackup + lvremove /dev/vgpool/lvstuffbackup/ + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png) + +#### 删除逻辑卷 #### + +要删除一个逻辑卷,你首先需要确保卷已经卸载,然后你可以用 lvremove 命令删除它。逻辑卷删除后你可以移除卷组,卷组删除后你可以删除物理卷。 + +这是所有移除我们创建的卷和组的命令。 + + umount /mnt/lvstuff + lvremove /dev/vgpool/lvstuff + vgremove vgpool + pvremove /dev/sdb1 /dev/sdc1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png) + +这些已经囊括了关于 LVM 你需要了解的大部分知识。如果你有任何关于这些讨论的经验,请在下面的评论框中和大家分享。 + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ + +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ +[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ +[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file From 06050a22dc6729ec666b4b1d78b291158fb522da Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Thu, 25 Jun 2015 12:47:28 +0800 Subject: [PATCH 04/76] finish translation --- ...ser for Anonymous Web Browsing in Linux.md | 206 ------------------ ...ser for Anonymous Web Browsing in Linux.md | 206 ++++++++++++++++++ 2 files changed, 206 insertions(+), 206 deletions(-) delete mode 100644 sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md create mode 100644 translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md diff --git a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md deleted file mode 100644 index 92fe36dae2..0000000000 --- a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md +++ /dev/null @@ -1,206 +0,0 @@ -Tor Browser: An Ultimate Web Browser for Anonymous Web Browsing in Linux -================================================================================ -Most of us give a considerable time of ours to Internet. The primary Application we require to perform our internet activity is a browser, a web browser to be more perfect. Over Internet most of our’s activity is logged to Server/Client machine which includes IP address, Geographical Location, search/activity trends and a whole lots of Information which can potentially be very harmful, if used intentionally the other way. - -![Install Tor Browser in Linux](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) - -Tor Browser: Anonymous Browsing - -Moreover the National Security Agency (NSA) aka International Spying Agency keeps tracks of ours digital footprints. Not to mention a restricted proxy server which again can be used as data ripping server is not the answer. And most of the corporates and companies wont allow you to access a proxy server. - -So, what we need here is an application, preferably small in size and let it be standalone, portable and which servers the purpose. Here comes an application – the Tor Browser, which has all the above discussed features and even beyond that. - -In this article we will be discussing Tor browser, its features, its usages and Area of Application, Installation and other important aspects of The Tor Browser Application. - -#### What is Tor Browser? #### - -Tor is a Freely distributed Application Software, released under BSD style Licensing which allows to surf Internet anonymously, through its safe and reliable onion like structure. Tor previously was called as ‘The Onion Router‘ because of its structure and functioning mechanism. This Application is written in C programming Language. - -#### Features of Tor Browser #### - -- Cross Platform Availability. i.e., this application is available for Linux, Windows as well as Mac. -- Complex Data encryption before it it sent over Internet. -- Automatic data decryption at client side. -- It is a combination of Firefox Browser + Tor Project. -- Provides anonymity to servers and websites. -- Makes it possible to visit locked websites. -- Performs task without revealing IP of Source. -- Capable of routing data to/from hidden services and application behind firewall. -- Portable – Run a preconfigured web browser directly from the USB storage Device. No need to install it locally. -- Available for architectures x86 and x86_64. -- Easy to set FTP with Tor using configuration as “socks4a” proxy on “localhost” port “9050” -- Tor is capable of handling thousands of relay and millions of users. - -#### How Tor Browser Works? #### - -Tor works on the concept of Onion routing. Onion routing resemble to onion in structure. In onion routing the layers are nested one over the other similar to the layers of onion. This nested layer is responsible for encrypting data several times and sends it through virtual circuits. On the client side each layer decrypt the data before passing it to the next level. The last layer decrypts the innermost layer of encrypted data before passing the original data to the destination. - -In this process of decryption all the layers function so intelligently that there is no need to reveal IP and Geographical location of User thus limiting any chance of anybody watching your internet connection or the sites you are visiting. - -All these working seems a bit complex, but the end user execution and working of Tor browser is nothing to worry about. In-fact Tor browser resembles any other browser (Especially Mozilla Firefox) in functioning. - -### Installation of Tor Browser in Linux ### - -As discussed above, Tor browser is available for Linux, Windows and Mac. The user need to download the latest version (i.e. Tor Browser 4.0.4) application from the link below as per their system and architecture. - -- [https://www.torproject.org/download/download-easy.html.en][1] - -After downloading the Tor browser, we need to install it. But the good thing with ‘Tor’ is that we don’t need to install it. It can run directly from a Pen Drive and the browser can be preconfigured. That means plug and Run Feature in perfect sense of Portability. - -After downloading the Tar-ball (*.tar.xz) we need to Extract it. - -**On 32-Bit System** - - $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz - $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz - -**On 64-Bit System** - - $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz - $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz - -**Note** : In the above command we used ‘$‘ which means that the package is extracted as user and not root. It is strictly suggested to extract and run tor browser not as root. - -After successful extraction, we can move the extracted browser to anywhere/USB Mass Storage device. And run the application from the extracted folder and run ‘start-tor-browser’ strictly not as root. - - $ cd tor-browser_en-US - $ ./start-tor-browser - -![Starting Tor Browser](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) - -Starting Tor Browser - -**1. Trying to connect to the Tor Network. Click “Connect” and Tor will do rest of the settings for you.** - -![Connecting to Tor Network](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) - -Connecting to Tor Network - -**2. The welcome Window/Tab.** - -![Tor Welcome Screen](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) - -Tor Welcome Screen - -**3. Tor Browser Running a Video from Youtube.** - -![Watching Video on Youtube](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) - -Watching Video on Youtube - -**4. Opening a banking site for online Purchasing/Transaction.** - -![Browsing a Banking Site](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) - -Browsing a Banking Site - -**5. The browser showing my current proxy IP. Note that the text that reads “Proxy Server detected”.** - -![Checking IP Address](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) - -Checking IP Address - -**Note**: That you need to point to the Tor startup script using text session, everytime you want to run Tor. Moreover a terminal will be busy all the time till you are running tor. How to overcome this and create a desktop/dock-bar Icon? - -6. We need to create `tor.desktop` file inside the directory where extracted files resides. - -$ touch tor.desktop - -Now edit the file using your favourite editor with the text below. Save and exit. I used nano. - - $ nano tor.desktop - ----------- - - #!/usr/bin/env xdg-open - [Desktop Entry] - Encoding=UTF-8 - Name=Tor - Comment=Anonymous Browse - Type=Application - Terminal=false - Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser - Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png - StartupNotify=true - Categories=Network;WebBrowser; - -**Note**: Make sure to replace the path with the location of your tor browser in the above. - -**7. Once done! Double click the file `tor.desktop` to fire Tor browser. You may need to trust it for the first time.** - -![Tor Application Launcher](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) - -Tor Application Launcher - -**8. Once you trust you might note that the icon of `tor.desktop` changed.** - -![Tor icon Changed](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) - -Tor icon Changed - -9. You may drag and drop the `tor.desktop` icon to create shortcut on Desktop and Dock Bar. - -![Add Tor Shortcut on Desktop](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) - -Add Tor Shortcut on Desktop - -**10. About Tor Browser.** - -![About Tor Browser](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) - -About Tor Browser - -**Note**: If you are using older version of Tor, you may update it from the above window. - -#### Usability/Area of Application #### - -- Anonymous communication over web. -- Surf to Blocked web Pages. -- Link other Application Viz (FTP) to this secure Internet Browsing Application. - -#### Controversies of Tor-browser #### - -- No security at the boundary of Tor Application i.e., Data Entry and Exit Points. -- A study in 2011 reveals that a specific way of attacking Tor will reveal IP address of BitTorrent Users. -- Some protocols shows the tendency of leaking IP address, revealed in a study. -- Earlier version of Tor bundled with older versions of Firefox browser were found to be JavaScript Attack Vulnerable. -- Tor Browser Seems to Work slow. - -#### Real world Implementation of Tor-browser #### - -- Vuze BitTorrent Client -- Anonymous Os -- Os’es from Scratch -- whonix, etc. - -#### Future of Tor Browser #### - -Tor browser is promising. Perhaps the first application of its kind is implemented very brilliantly. Tor browser must invest for Support, Scalability and research for securing the data from latest attacks. This application is need of the future. - -#### Download Free eBook #### - -Unofficial Guide to Tor Private Browsing - -[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] - -### Conclusion ### - -Tor bowser is a must tool in the present time where the organization you are working for don’t allow you to access certain websites or if you don’t want others to look into your private business or you don’t want to provide your digital footprints to NSA. - -**Note**: Tor Browser don’t provide any safety from Viruses, Trojans or other threats of this kind. Moreover by writing an article of this we never mean to indulge into illegal activity by hiding our identity over Internet. This Post is totally for educational Purpose and for any illegal use of it neither the author of the post nor Tecmint will be responsible. It is the sole responsibility of user. - -Tor-browser is a wonderful application and you must give it a try. That’s all for now. I’ll be here again with another interesting article you people will love to read. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your value-able feedback in our comment section below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:https://www.torproject.org/download/download-easy.html.en -[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file diff --git a/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md new file mode 100644 index 0000000000..1c6a039920 --- /dev/null +++ b/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md @@ -0,0 +1,206 @@ +TorLinuxWebռ +================================================================================ +Ǵ˶滨Ѻܶʱ䡣ʹõӦóҪһWebĻҪԿͻ/ķʽ¼̻IPַϢԼDZڵϢЩϢʽʹãDZڵΣԡ + +![LinuxаװTor](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) + +Tor + +⣬Ұȫ֣NSAʼ¼ǵ㼣˵ij޵ĴҲᱻΪѼҴҵ͹˾ʴʹܱԼ˽ + +ˣҪһС͡ЯӦóܴﵽЧTorһӦãӵᵽйܣֹڴˡ + +ƪǻTorĹܡʹ÷ʽ򡢰װԼTorҪ档 + +#### ʲôTor #### + +TorһɷַӦBSDʽ֤ͨ䰲ȫɿʽĽṹûĽǰĽṹƣTorΪ·ӦCдɵġ + +#### TorĹ #### + +- ƽ̨á磬ӦóLinuxWindowsMac¶á +- ڷݵǰиӵݼܡ +- ڿͻ˽еԶܡ +- ǻTor̵Ľϡ +- Էվṩԡ +- Էʱվ +- 豩¶ԴIPִ +- ڷǽ·/صķӦó +- Я - ֱӴUSB洢һԤõweb豾ذװ +- x86x86_64ƽ̨ +- ͨʹTorԡsocks4aķʽڡlocalhostġ9050˿ôFTP +- Torӵдǧתϰû + +#### Torι #### + +TorĹʽ·ɵĸ·ɵĽṹУÿһ㶼Ƕһ棬һǶ׵Ľṹμݲͨ·з͡ڿͻһÿһ㶼ڽݵһ֮ǰݡһڽԭʼݴݵĿĵǰһļݡ + +ֽĹƵ˸޷׷IPԼûĵλã˿κ˹۲վӡ + +Щ̿ЩӣûʹTorʱûбҪġʵϣTorĹһMozillaFirefox + +### LinuxаװTor ### + +۵һTorLinuxWindowsԼMac¶áûҪϵͳͼܹIJͬӴµİ汾磬Tor4.0.4 + +- [https://www.torproject.org/download/download-easy.html.en][1] + +TorҪװõDzҪװTorֱӴ豸УҸԱԤáζŲеԿֲ + +شļ*.tar.xzҪѹ + +**32λϵͳ** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz + $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz + +**64λϵͳ** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz + $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz + +**ע** : Уʹá$ζѹӦͨûrootûѹǿҽҪrootûѹTor + +ڳɹĽѹDZԽѹƶκεط/USB洢豸СӽѹļԷrootûֱСstart-tor-browser + + $ cd tor-browser_en-US + $ ./start-tor-browser + +![ʼʹTor](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) + +ʼʹTor + +**1. ӵTor硣ӡ֮Torðʣµ顣** + +![ӵTor](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) + +ӵTor + +**2. ӭ/ǩ** + +![Torӭ](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) + +Torӭ + +**3. TorYoutubeƵ** + +![YoutubeϿƵ](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) + +YoutubeϿƵ + +**4. ַԽ߹ͽס** + +![վ](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) + +վ + +**5. ʾҵǰĴIPעıΪProxy Server detected** + +![IPַ](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) + +IPַ + +**ע**: ÿTorʱҪʹıģʽָTorűҸնTorʱæµ״̬ο˷Щһ/Dockͼأ + +**6. Ҫڽѹļд`tor.desktop`** + +$ touch tor.desktop + +ʹϲı༭༭ļıʹnano + + $ nano tor.desktop + +---------- + + #!/usr/bin/env xdg-open + [Desktop Entry] + Encoding=UTF-8 + Name=Tor + Comment=Anonymous Browse + Type=Application + Terminal=false + Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser + Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png + StartupNotify=true + Categories=Network;WebBrowser; + +**ע**: ȷtor·滻ΪĻе· + +**7. һ㶨Ϳ˫`tor.desktop`ļTorˣҪڵһʱθļ** + +![TorӦ](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) + +TorӦ + +**8. һѡΣע`tor.desktop`ļͼı䡣** + +![TorͼѸı](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) + +TorͼѸı + +**9. ͨק`tor.desktop`ͼDockдݷʽ** + +![Torݷʽ](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) + +Torݷʽ + +**10. Tor** + +![Tor](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) + +Tor + +**ע**: ʹþɰ汾TorԴĴڸ + +#### ӦõĿԺ #### + +- ʹ硣 +- 赲ҳ档 +- ӦãFTP֤簲ȫķʡ + +#### Tor #### + +- Torܱ߲ûʲôȫʩ磬ڵͳڵ㡣 +- һ2011оһTorĹԵõBitTorrentûIPַ +- һЩозijЩضЭй©IPַ +- TorЩİ汾˾ɰ汾Firefoxⱻ֤JavaScript +- TorıȽϻ + +#### ʵTorʵ #### + +- Vuze BitTorrent Client +- Anonymous Os +- Oses from Scratch +- whonix + +#### Torδ #### + +Torǰ;ġҲʵֵĵһӦódzɫTorӴԵ֧ԼԽڵĹоԱ֤ݰȫӦóδҪ + +#### ѵĵ #### + +ǹٷTor˽ָ + +[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] + +### ### + +IJŲijվϣ֪˽NSAṩĸ㼣ôTorĿǰDZġ + +**ע**: TorṩİȫԲܵľİȫвдƪµĿҲϣͨڻǵݷǷƪ´Ϊ˽ѧĿģߺTecmintΪκηǷʹøûΨһΡ + +TorһdzӦãֵóԣҪ˵ȫˣһдһЩȤ£עTecmintṩмֵķ + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ + +ߣ[Avishek Kumar][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://www.torproject.org/download/download-easy.html.en +[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file From c966a353815463e607f067c53c4b4fd2d559e91a Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 25 Jun 2015 16:08:20 +0800 Subject: [PATCH 05/76] =?UTF-8?q?20150625-1=20=E9=80=89=E9=A2=98=20RHCSA?= =?UTF-8?q?=20Series=20Part=2015=20=E6=9C=AC=E4=B8=93=E9=A2=98=E5=AE=8C?= =?UTF-8?q?=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ation and Guest Administration with KVM.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md b/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md new file mode 100644 index 0000000000..d9e06bd876 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md @@ -0,0 +1,188 @@ +RHCSA Series: Essentials of Virtualization and Guest Administration with KVM – Part 15 +================================================================================ +If you look up the word virtualize in a dictionary, you will find that it means “to create a virtual (rather than actual) version of something”. In computing, the term virtualization refers to the possibility of running multiple operating systems simultaneously and isolated one from another, on top of the same physical (hardware) system, known in the virtualization schema as host. + +![KVM Virtualization Basics and KVM Guest Administration](http://www.tecmint.com/wp-content/uploads/2015/06/RHCSA-Part15.png) + +RHCSA Series: Essentials of Virtualization and Guest Administration with KVM – Part 15 + +Through the use of the virtual machine monitor (also known as hypervisor), virtual machines (referred to as guests) are provided virtual resources (i.e. CPU, RAM, storage, network interfaces, to name a few) from the underlying hardware. + +With that in mind, it is plain to see that one of the main advantages of virtualization is cost savings (in equipment and network infrastructure and in terms of maintenance effort) and a substantial reduction in the physical space required to accommodate all the necessary hardware. + +Since this brief how-to cannot cover all virtualization methods, I encourage you to refer to the documentation listed in the summary for further details on the subject. + +Please keep in mind that the present article is intended to be a starting point to learn the basics of virtualization in RHEL 7 using [KVM][1] (Kernel-based Virtual Machine) with command-line utilities, and not an in-depth discussion of the topic. + +### Verifying Hardware Requirements and Installing Packages ### + +In order to set up virtualization, your CPU must support it. You can verify whether your system meets the requirements with the following command: + + # grep -E 'svm|vmx' /proc/cpuinfo + +In the following screenshot we can see that the current system (with an AMD microprocessor) supports virtualization, as indicated by svm. If we had an Intel-based processor, we would see vmx instead in the results of the above command. + +![Check KVM Support](http://www.tecmint.com/wp-content/uploads/2015/06/Check-KVM-Support.png) + +Check KVM Support + +In addition, you will need to have virtualization capabilities enabled in the firmware of your host (BIOS or UEFI). + +Now install the necessary packages: + +- qemu-kvm is an open source virtualizer that provides hardware emulation for the KVM hypervisor whereas qemu-img provides a command line tool for manipulating disk images. +- libvirt includes the tools to interact with the virtualization capabilities of the operating system. +- libvirt-python contains a module that permits applications written in Python to use the interface supplied by libvirt. +- libguestfs-tools: miscellaneous system administrator command line tools for virtual machines. +- virt-install: other command-line utilities for virtual machine administration. + + # yum update && yum install qemu-kvm qemu-img libvirt libvirt-python libguestfs-tools virt-install + +Once the installation completes, make sure you start and enable the libvirtd service: + + # systemctl start libvirtd.service + # systemctl enable libvirtd.service + +By default, each virtual machine will only be able to communicate with the rest in the same physical server and with the host itself. To allow the guests to reach other machines inside our LAN and also the Internet, we need to set up a bridge interface in our host (say br0, for example) by, + +1. adding the following line to our main NIC configuration (most likely `/etc/sysconfig/network-scripts/ifcfg-enp0s3`): + + BRIDGE=br0 + +2. creating the configuration file for br0 (/etc/sysconfig/network-scripts/ifcfg-br0) with these contents (note that you may have to change the IP address, gateway address, and DNS information): + + DEVICE=br0 + TYPE=Bridge + BOOTPROTO=static + IPADDR=192.168.0.18 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NM_CONTROLLED=no + DEFROUTE=yes + PEERDNS=yes + PEERROUTES=yes + IPV4_FAILURE_FATAL=no + IPV6INIT=yes + IPV6_AUTOCONF=yes + IPV6_DEFROUTE=yes + IPV6_PEERDNS=yes + IPV6_PEERROUTES=yes + IPV6_FAILURE_FATAL=no + NAME=br0 + ONBOOT=yes + DNS1=8.8.8.8 + DNS2=8.8.4.4 + +3. finally, enabling packet forwarding by making, in `/etc/sysctl.conf`, + + net.ipv4.ip_forward = 1 + +and loading the changes to the current kernel configuration: + + # sysctl -p + +Note that you may also need to tell firewalld that this kind of traffic should be allowed. Remember that you can refer to the article on that topic in this same series ([Part 11: Network Traffic Control Using FirewallD and Iptables][2]) if you need help to do that. + +### Creating VM Images ### + +By default, VM images will be created to `/var/lib/libvirt/images` and you are strongly advised to not change this unless you really need to, know what you’re doing, and want to handle SELinux settings yourself (such topic is out of the scope of this tutorial but you can refer to Part 13 of the RHCSA series: [Mandatory Access Control Essentials with SELinux][3] if you want to refresh your memory). + +This means that you need to make sure that you have allocated the necessary space in that filesystem to accommodate your virtual machines. + +The following command will create a virtual machine named `tecmint-virt01` with 1 virtual CPU, 1 GB (=1024 MB) of RAM, and 20 GB of disk space (represented by `/var/lib/libvirt/images/tecmint-virt01.img`) using the rhel-server-7.0-x86_64-dvd.iso image located inside /home/gacanepa/ISOs as installation media and the br0 as network bridge: + + # virt-install \ + --network bridge=br0 + --name tecmint-virt01 \ + --ram=1024 \ + --vcpus=1 \ + --disk path=/var/lib/libvirt/images/tecmint-virt01.img,size=20 \ + --graphics none \ + --cdrom /home/gacanepa/ISOs/rhel-server-7.0-x86_64-dvd.iso + --extra-args="console=tty0 console=ttyS0,115200" + +If the installation file was located in a HTTP server instead of an image stored in your disk, you will have to replace the –cdrom flag with –location and indicate the address of the online repository. + +As for the –graphics none option, it tells the installer to perform the installation in text-mode exclusively. You can omit that flag if you are using a GUI interface and a VNC window to access the main VM console. Finally, with –extra-args we are passing kernel boot parameters to the installer that set up a serial VM console. + +The installation should now proceed as a regular (real) server now. If not, please review the steps listed above. + +### Managing Virtual Machines ### + +These are some typical administration tasks that you, as a system administrator, will need to perform on your virtual machines. Note that all of the following commands need to be run from your host: + +**1. List all VMs:** + + # virsh list --all + +From the output of the above command you will have to note the Id for the virtual machine (although it will also return its name and current status) because you will need it for most administration tasks related to a particular VM. + +**2. Display information about a guest:** + + # virsh dominfo [VM Id] + +**3. Start, restart, or stop a guest operating system:** + + # virsh start | reboot | shutdown [VM Id] + +**4. Access a VM’s serial console if networking is not available and no X server is running on the host:** + + # virsh console [VM Id] + +**Note** that this will require that you add the serial console configuration information to the `/etc/grub.conf` file (refer to the argument passed to the –extra-args option when the VM was created). + +**5. Modify assigned memory or virtual CPUs:** + +First, shutdown the guest: + + # virsh shutdown [VM Id] + +Edit the VM configuration for RAM: + + # virsh edit [VM Id] + +Then modify + + [Memory size here without brackets] + +Restart the VM with the new settings: + + # virsh create /etc/libvirt/qemu/tecmint-virt01.xml + +Finally, change the memory dynamically: + + # virsh setmem [VM Id] [Memory size here without brackets] + +For CPU: + + # virsh edit [VM Id] + +Then modify + + [Number of CPUs here without brackets] + +For further commands and details, please refer to table 26.1 in Chapter 26 of the RHEL 5 Virtualization guide (that guide, though a bit old, includes an exhaustive list of virsh commands used for guest administration). + +### SUMMARY ### + +In this article we have covered some basic aspects of virtualization with KVM in RHEL 7, which is both a vast and a fascinating topic, and I hope it will be helpful as a starting guide for you to later explore more advanced subjects found in the official [RHEL virtualization][4] getting started and [deployment / administration guides][5]. + +In addition, you can refer to the preceding articles in [this KVM series][6] in order to clarify or expand some of the concepts explained here. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/kvm-virtualization-basics-and-guest-administration/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.linux-kvm.org/page/Main_Page +[2]:http://www.tecmint.com/firewalld-vs-iptables-and-control-network-traffic-in-firewall/ +[3]:http://www.tecmint.com/selinux-essentials-and-control-filesystem-access/ +[4]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html +[5]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html +[6]:http://www.tecmint.com/install-and-configure-kvm-in-linux/ \ No newline at end of file From e9019612cf33ab7375e6de0385103031fca91352 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 25 Jun 2015 16:26:26 +0800 Subject: [PATCH 06/76] =?UTF-8?q?20150625-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...re Made Easy with these Dedicated Tools.md | 152 ++++++++++++++++++ ...ion Swarm Clusters using Docker Machine.md | 125 ++++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md create mode 100644 sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md new file mode 100644 index 0000000000..15fca199a2 --- /dev/null +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -0,0 +1,152 @@ +Screen Capture Made Easy with these Dedicated Tools +================================================================================ +"A picture is worth a thousand words", a phrase which emerged in the USA in the early part of the 20th century, refers to the notion that a single still image can present as much information as a large amount of descriptive text. Essentially, pictures convey information more effectively and efficiently than words can. + +A screenshot (or screengrab) is a snapshot or picture captured by a computer to record the output of a visual device. Screen capture software enable screenshots to be taken on a computer. This type of software has lots of uses. As an image can illustrate the operation of computer software well, screenshots play an important role in software development and documentation. Alternatively, if you have a technical problem with your computer, a screenshot allows a technical support department to understand the problems you are facing. Writing computer-related articles, documentation and tutorials is nigh on impossible without a good tool for creating screenshots. Screenshots are also useful to save snippets of anything you have on your screen, particularly when it can not be easily printed. + +Linux has a good selection of open source dedicated screenshot programs, both graphical and console based. For a feature-rich dedicated screenshot utility, look no further than Shutter. This tool is a superb example of a small open source tool. But there are some great alternatives too. + +Screen capture functionality is not only provided by dedicated applications. GIMP and ImageMagick, two programs which are primarily image manipulation tools, also offer competent screen capturing functionality. + +---------- + +### Shutter ### + +![Shutter in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-Shutter1.png) + +Shutter is a feature-rich screenshot application. You can take a screenshot of a specific area, window, your whole screen, or even of a website - apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window. + +Features include: + + +- Take a screenshot of: + - a specific area + - window + - the complete desktop + - web pages from a script +- Apply different effects to the screenshot +- Hotkeys +- Print +- Take screenshot directly or with a specified delay time +- Save the screenshots to a specified directory and name them in a convenient way (using special wild-cards) +- Fully integrated into the GNOME Desktop (TrayIcon etc) +- Generate thumbnails directly when you are taking a screenshot and set a size level in % +- Shutter session collection: + - Keep track of all screenshots during session + - Copy screeners to clipboard + - Print screenshots + - Delete screenshots + - Rename your file +- Upload your files directly to Image-Hosters (e.g. http://ubuntu-pics.de), retrieve all the needed links and share them with others +- Edit screenshots directly using the embedded drawing tool + +- Website: [shutter-project.org][1] +- Developer: Mario Kemper and Shutter Team +- License: GNU GPL v3 +- Version Number: 0.93.1 + +---------- + +### HotShots ### + +![HotShots in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-HotShots.png) + +HotShots is an application for capturing screens and saving them in a variety of image formats as well as adding annotations and graphical data (arrows, lines, texts, ...). + +You can also upload your creations to the web (FTP/some web services). HotShots is written with Qt. + +HotShots is not available in Ubuntu's Software Center. But it's easy to install by typing at the command line: + + sudo add-apt-repository ppa:ubuntuhandbook1/apps + + sudo apt-get update + + sudo apt-get install hotshots + +Features include: + +- Simple to use +- Full featured +- Built-in editor +- Hotkeys +- Built-in magnification +- Freehand and multi-screen capture +- Supported Output Formats: Black & Whte (bw), Encapsulated PostScript (eps, epsf), Encapsulated PostScript Interchange (epsi), OpenEXR (exr), PC Paintbrush Exchange (pcx), Photoshop Document (psd), ras, rgb, rgba, Irix RGB (sgi), Truevision Targa (tga), eXperimental Computing Facility (xcf), Windows Bitmap (bmp), DirectDraw Surface (dds), Graphic Interchange Format (gif), Icon Image (ico), Joint Photographic Experts Group 2000 (jp2), Joint Photographic Experts Group (jpeg, jpg), Multiple-image Network Graphics (mng), Portable Pixmap (ppm), Scalable Vector Graphics (svg), svgz, Tagged Image File Format (tif, tiff), webp, X11 Bitmap (xbm), X11 Pixmap (xpm), and Khoros Visualization (xv) +- Internationalization support: Basque, Chinese, Czech, French, Galician, German, Greek, Italian, Japanese, Lithuanian, Polish, Portuguese, Romanian, Russian, Serbian, Singhalese, Slovak, Spanish, Turkish, Ukrainian, and Vietnamese + +- Website: [thehive.xbee.net][2] +- Developer: xbee +- License: GNU GPL v2 +- Version Number: 2.2.0 + +---------- + +### ScreenCloud ### + +![ScreenCloud in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-ScreenCloud.png) + +ScreenCloud is an easy to use open source screenshot tool. + +With this software, users can take a screenshot using one of the 3 hotkeys or simply click the ScreenCloud tray icon. Users can choose where you want to save the screenshot. + +If you choose to upload your screenshot to the screencloud website, a link will automatically be copied to your clipboard. This can be shared with friends or colleagues via email or in an IM conversation. All they have to do is click the link and look at your screenshot. + +Features include: + +- Capture full screen, window or selection +- Fast and easy: Snap a photo, paste the link, done +- Free hosting of your screenshots +- Hotkeys +- Set timer delay +- Enable 'Capture window borders' +- Enable/Disable Notifications +- Set app to run on start up +- Adjust account/upload/filename/shortcut settings +- Cross platform tool +- Plugin support, save to Dropbox, Imgur, and more +- Supports uploading to FTP and SFTP servers + +- Website: [screencloud.net][3] +- Developer: Olav S Thoresen +- License: GNU GPL v2 +- Version Number: 1.2.1 + +---------- + +### KSnapshot ### + +![KSnapShot in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-KSnapshot.png) + +KSnapshot is a simple utility for taking screenshots. It can capture images of the whole desktop, a single window, a section of a window or a selected region. Images can then be saved in a variety of different formats. + +KSnapshot also allows users to use hotkeys to take a screenshot. Besides saving the screenshot, it can be copied to the clipboard or opened with any program that is associated with image files. + +KSnapshot is part of the KDE 4 graphics module. + +Features include: + +- Save snapshot in multiple formats +- Snapshot delay +- Exclude window decorations +- Copy the snapshot to the clipboard +- Hotkeys +- Can be scripted using its D-Bus interface + +- Website: [www.kde.org][4] +- Developer: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich +- License: GNU GPL v2 +- Version Number: 0.8.2 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://shutter-project.org/ +[2]:http://thehive.xbee.net/ +[3]:https://screencloud.net/ +[4]:https://www.kde.org/applications/graphics/ksnapshot/ \ No newline at end of file diff --git a/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md new file mode 100644 index 0000000000..47d33102e5 --- /dev/null +++ b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md @@ -0,0 +1,125 @@ +How to Provision Swarm Clusters using Docker Machine +================================================================================ +Hi all, today we'll learn how we can deploy Swarm Clusters using Docker Machine. It serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. We can provision swarm clusters with any driver we need and is highly secured with TLS Encryption. + +Here are some quick and easy steps on how to provision swarm clusters with Docker Machine. + +### 1. Installing Docker Machine ### + +Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the Github site . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . + +For 64 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +For 32 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +After downloading the latest release of Docker Machine, we'll make the file named docker-machine under /usr/local/bin/ executable using the command below. + + # chmod +x /usr/local/bin/docker-machine + +After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. Creating Machine ### + +After installing Machine into our working PC or device, we'll wanna go forward to create a machine using Docker Machine. Here, in this tutorial we'll gonna deploy a machine in the Digital Ocean Platform so we'll gonna use "digitalocean" as its Driver API then, docker swarm will be running into that Droplet which will be further configured as Swarm Master and another droplet will be created which will be configured as Swarm Node Agent. + +So, to create the machine, we'll need to run the following command. + + # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev + +**Note**: Here, linux-dev is the name of the machine we are wanting to create. is a security key which can be generated from the Digital Ocean Control Panel of the account holder of Digital Ocean Cloud Platform. To retrieve that key, we simply need to login to our Digital Ocean Control Panel then click on API, then click on Generate New Token and give it a name tick on both Read and Write. Then we'll get a long hex key, thats the now, simply replace it into the command above. + +Now, to load the Machine configuration into the shell we are running the comamands, run the following command. + + # eval "$(docker-machine env linux-dev)" + +![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) + +Then, we'll mark our machine as ACTIVE by running the below command. + + # docker-machine active linux-dev + +Now, we'll check whether its been marked as ACTIVE "*" or not. + + # docker-machine ls + +![Docker Machine Active List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-active-list.png) + +### 3. Running Swarm Docker Image ### + +Now, after we finish creating the required machine. We'll gonna deploy swarm docker image in our active machine. This machine will run the docker image and will control over the Swarm master and node. To run the image, we can simply run the below command. + + # docker run swarm create + +![Docker Machine Swarm Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-create.png) + +If you are trying to run swarm docker image using **32 bit Operating System** in the computer where Docker Machine is running, we'll need to SSH into the Droplet. + + # docker-machine ssh + #docker run swarm create + #exit + +### 4. Creating Swarm Master ### + +Now, after our machine and swarm image is running into the machine, we'll now create a Swarm Master. This will also add the master as a node. To do so, here's the command below. + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-master \ + --swarm-discovery token:// \ + swarm-master + +![Docker Machine Swarm Master Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-master-create.png) + +### 5. Creating Swarm Nodes ### + +Now, we'll create a swarm node which will get connected with the Swarm Master. The command below will create a new droplet which will be named as swarm-node and will get connected with the Swarm Master as node. This will create a Swarm cluster across the two nodes. + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-discovery token:// \ + swarm-node + +![Docker Machine Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-nodes.png) + +### 6. Connecting to the Swarm Master ### + +We, now connect to the Swarm Master so that we can deploy Docker containers across the nodes as per the requirement and configuration. To load the Swarm Master's Machine configuration into our environment, we can run the below command. + + # eval "$(docker-machine env --swarm swarm-master)" + +After that, we can run the required containers of our choice across the nodes. Here, we'll check if everything went fine or not. So, we'll run **docker info** to check the information about the Swarm Clusters. + + # docker info + +### Conclusion ### + +We can pretty easily create Swarm Cluster with Docker Machine. This method is a lot productive because it reduces a lot of time of a system admin or users. In this article, we successfully provisioned clusters by creating a master and a node using a machine with Digital Ocean as driver. It can be created using any driver like VirtualBox, Google Cloud Computing, Amazon Web Service, Microsoft Azure and more according to the need and requirement of the user and the connection is highly secured with TLS Encryption. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/provision-swarm-clusters-using-docker-machine/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file From b0f326a416dca46d4e9f6f815ae21ba4ed18ba76 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 25 Jun 2015 21:30:17 +0800 Subject: [PATCH 07/76] [Translating] tech/20150331 How to set up remote desktop on Linux VPS using x2go.md --- ...50331 How to set up remote desktop on Linux VPS using x2go.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md index d89c91832e..59323a45e4 100644 --- a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -1,3 +1,4 @@ +ictlyh translating How to set up remote desktop on Linux VPS using x2go ================================================================================ As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on. From df748618cac02d4bc0fe7c1fce0600a0d3b3e944 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 25 Jun 2015 23:02:55 +0800 Subject: [PATCH 08/76] [Translated] tech/20150331 How to set up remote desktop on Linux VPS using x2go.md --- ... remote desktop on Linux VPS using x2go.md | 138 ------------------ ... remote desktop on Linux VPS using x2go.md | 138 ++++++++++++++++++ 2 files changed, 138 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md create mode 100644 translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md diff --git a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md deleted file mode 100644 index 59323a45e4..0000000000 --- a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ /dev/null @@ -1,138 +0,0 @@ -ictlyh translating -How to set up remote desktop on Linux VPS using x2go -================================================================================ -As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on. - -In the world of Linux, of course there is no shortage of choices for settings up remote desktop environment, with many protocols (e.g., RDP, RFB, NX) and server/client implementations (e.g., [TigerVNC][1], RealVNC, FreeNX, x2go, X11vnc, TeamViewer) available. - -Standing out from the pack is [X2Go][2], an open-source (GPLv2) implementation of NX-based remote desktop server and client. In this tutorial, I am going to demonstrate **how to set up remote desktop environment for [Linux VPS][3] using X2Go**. - -### What is X2Go? ### - -The history of X2Go goes back to NoMachine's NX technology. The NX remote desktop protocol was designed to deal with low bandwidth and high latency network connections by leveraging aggressive compression and caching. Later, NX was turned into closed-source while NX libraries were made GPL-ed. This has led to open-source implementation of several NX-based remote desktop solutions, and one of them is X2Go. - -What benefits does X2Go bring to the table, compared to other solutions such as VNC? X2Go inherits all the advanced features of NX technology, so naturally it works well over slow network connections. Besides, X2Go boasts of an excellent track record of ensuring security with its built-in SSH-based encryption. No longer need to set up an SSH tunnel [manually][4]. X2Go comes with audio support out of box, which means that music playback at the remote desktop is delivered (via PulseAudio) over network, and fed into local speakers. On usability front, an application that you run on remote desktop can be seamlessly rendered as a separate window on your local desktop, giving you an illusion that the application is actually running on the local desktop. As you can see, these are some of [its powerful features][5] lacking in VNC based solutions. - -### X2GO's Desktop Environment Compatibility ### - -As with other remote desktop servers, there are [known compatibility issues][6] for X2Go server. Desktop environments like KDE3/4, Xfce, MATE and LXDE are the most friendly to X2Go server. However, your mileage may vary with other desktop managers. For example, the later versions of GNOME 3, KDE5, Unity are known to be not compatible with X2Go. If the desktop manager of your remote host is compatible with X2Go, you can follow the rest of the tutorial. - -### Install X2Go Server on Linux ### - -X2Go consists of remote desktop server and client components. Let's start with X2Go server installation. I assume that you already have an X2Go-compatible desktop manager up and running on a remote host, where we will be installing X2Go server. - -Note that X2Go server component does not have a separate service that needs to be started upon boot. You just need to make sure that SSH service is up and running. - -#### Ubuntu or Linux Mint: #### - -Configure X2Go PPA repository. X2Go PPA is available for Ubuntu 14.04 and higher. - - $ sudo add-apt-repository ppa:x2go/stable - $ sudo apt-get update - $ sudo apt-get install x2goserver x2goserver-xsession - -#### Debian (Wheezy): #### - - $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E - $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" - $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" - $ sudo apt-get update - $ sudo apt-get install x2goserver x2goserver-xsession - -#### Fedora: #### - - $ sudo yum install x2goserver x2goserver-xsession - -#### CentOS/RHEL: #### - -Enable [EPEL respository][7] first, and then run: - - $ sudo yum install x2goserver x2goserver-xsession - -### Install X2Go Client on Linux ### - -On a local host where you will be connecting to remote desktop, install X2GO client as follows. - -#### Ubuntu or Linux Mint: #### - -Configure X2Go PPA repository. X2Go PPA is available for Ubuntu 14.04 and higher. - - $ sudo add-apt-repository ppa:x2go/stable - $ sudo apt-get update - $ sudo apt-get install x2goclient - -Debian (Wheezy): - - $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E - $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" - $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" - $ sudo apt-get update - $ sudo apt-get install x2goclient - -#### Fedora: #### - - $ sudo yum install x2goclient - -CentOS/RHEL: - -Enable EPEL respository first, and then run: - - $ sudo yum install x2goclient - -### Connect to Remote Desktop with X2Go Client ### - -Now it's time to connect to your remote desktop. On the local host, simply run the following command or use desktop launcher to start X2Go client. - - $ x2goclient - -Enter the remote host's IP address and SSH user name. Also, specify session type (i.e., desktop manager of a remote host). - -![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) - -If you want, you can customize other things (by pressing other tabs), like connection speed, compression, screen resolution, and so on. - -![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) - -![](https://farm9.staticflickr.com/8694/16985838755_1b7df1eb78_b.jpg) - -When you initiate a remote desktop connection, you will be asked to log in. Type your SSH login and password. - -![](https://farm9.staticflickr.com/8754/16984498432_1c8068b817_b.jpg) - -Upon successful login, you will see the remote desktop screen. - -![](https://farm9.staticflickr.com/8752/16798126858_1ab083ba80_c.jpg) - -If you want to test X2Go's seamless window feature, choose "Single application" as session type, and specify the path to an executable on the remote host. In this example, I choose Dolphin file manager on a remote KDE host. - -![](https://farm8.staticflickr.com/7584/16798393920_128c3af9c5_b.jpg) - -Once you are successfully connected, you will see a remote application window open on your local desktop, not the entire remote desktop screen. - -![](https://farm9.staticflickr.com/8742/16365755713_7b90cf65f0_c.jpg) - -### Conclusion ### - -In this tutorial, I demonstrated how to set up X2Go remote desktop on [Linux VPS][8] instance. As you can see, the whole setup process is pretty much painless (if you are using a right desktop environment). While there are some desktop-specific quirkiness, X2Go is a solid remote desktop solution which is secure, feature-rich, fast, and free. - -What feature is the most appealing to you in X2Go? Please share your thought. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/x2go-remote-desktop-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://xmodulo.com/author/nanni -[1]:http://ask.xmodulo.com/centos-remote-desktop-vps.html -[2]:http://wiki.x2go.org/ -[3]:http://xmodulo.com/go/digitalocean -[4]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html -[5]:http://wiki.x2go.org/doku.php/doc:newtox2go -[6]:http://wiki.x2go.org/doku.php/doc:de-compat -[7]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[8]:http://xmodulo.com/go/digitalocean diff --git a/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md new file mode 100644 index 0000000000..26ad141e84 --- /dev/null +++ b/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -0,0 +1,138 @@ +如何在 Linux VPS 上使用 x2go 设置远程桌面 +================================================================================ +由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要跨多个地方和设备不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 + +在 Linux 世界中,有许多可用的协议(例如 RDP、RFB、NX) 和 服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer),当然不缺乏设置远程桌面的选择。 + +当中出色的一个是 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9]) 的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 + +### X2Go 是什么? ### + +X2Go 的历史要追溯回 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 + +和其它解决方案,例如 VNC 相比,X2Go 带来哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 开箱支持音频,意味着远程桌面的音乐播放通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中用一个独立窗口无缝呈现,给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 + +### X2GO 的桌面环境兼容性 ### + +和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 + +### 在 Linux 上安装 X2Go 服务器 ### + +X2Go 由远程桌面服务器和客户端组件组成。让我们首先安装 X2Go 服务器。我假设你已经有一个和 X2Go 兼容的桌面管理器并且在远程主机上运行,我们会安装 X2Go 服务器到该远程主机。 + +注意系统启动后 X2Go 服务器组件没有需要单独启动的服务。你只需要保证开启了 SSH 服务并在正常运行。 + +#### Ubuntu 或 Linux Mint: #### + +配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。 + + $ sudo add-apt-repository ppa:x2go/stable + $ sudo apt-get update + $ sudo apt-get install x2goserver x2goserver-xsession + +#### Debian (Wheezy): #### + + $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E + $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" + $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" + $ sudo apt-get update + $ sudo apt-get install x2goserver x2goserver-xsession + +#### Fedora: #### + + $ sudo yum install x2goserver x2goserver-xsession + +#### CentOS/RHEL: #### + +首先启用 [EPEL 库][7] 然后运行: + + $ sudo yum install x2goserver x2goserver-xsession + +### 在 Linux 上安装 X2Go 客户端 ### + +在将会连接到远程桌面的本地主机上,安装以下命令安装 X2Go 客户端。 + +#### Ubuntu 或 Linux Mint: #### + +配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。 + + $ sudo add-apt-repository ppa:x2go/stable + $ sudo apt-get update + $ sudo apt-get install x2goclient + +Debian (Wheezy): + + $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E + $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" + $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" + $ sudo apt-get update + $ sudo apt-get install x2goclient + +#### Fedora: #### + + $ sudo yum install x2goclient + +CentOS/RHEL: + +首先启用 EPEL 库,然后运行: + + $ sudo yum install x2goclient + +### 用 X2Go 客户端连接到远程桌面 ### + +终于可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 + + $ x2goclient + +输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 + +![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) + +如果需要的话,你可以自定义其它东西(通过点击其它标签),例如连接速度、压缩、屏幕分辨率等等。 + +![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) + +![](https://farm9.staticflickr.com/8694/16985838755_1b7df1eb78_b.jpg) + +当你初始化一个远程桌面连接的时候,会要求你登录。输入你的 SSH 登录名和密码。 + +![](https://farm9.staticflickr.com/8754/16984498432_1c8068b817_b.jpg) + +成功登陆后,你会看到远程桌面屏幕。 + +![](https://farm9.staticflickr.com/8752/16798126858_1ab083ba80_c.jpg) + +如果你想测试 X2Go 的无缝窗口功能,选择 "Single application" 会话类型,然后指定远处主机上可执行文件的路径。在该例子中,我选择远程 KDE 主机上的 Dolphin 文件管理器。 + +![](https://farm8.staticflickr.com/7584/16798393920_128c3af9c5_b.jpg) + +你成功连接后,你会在本地桌面上看到一个远程应用窗口,而不是完整的远程桌面屏幕。 + +![](https://farm9.staticflickr.com/8742/16365755713_7b90cf65f0_c.jpg) + +### 总结 ### + +在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 + +X2Go 的什么功能最吸引你?欢迎分享你的观点。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/x2go-remote-desktop-linux.html + +作者:[Dan Nanni][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://ask.xmodulo.com/centos-remote-desktop-vps.html +[2]:http://wiki.x2go.org/ +[3]:http://xmodulo.com/go/digitalocean +[4]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html +[5]:http://wiki.x2go.org/doku.php/doc:newtox2go +[6]:http://wiki.x2go.org/doku.php/doc:de-compat +[7]:https://linux.cn/article-2324-1.html +[8]:http://xmodulo.com/go/digitalocean +[9]:https://en.wikipedia.org/wiki/NX_technology \ No newline at end of file From e04092dbd2c2b42e959f9518034a44dbbbc7c493 Mon Sep 17 00:00:00 2001 From: wwy Date: Fri, 26 Jun 2015 10:28:29 +0800 Subject: [PATCH 09/76] Update 20150616 Linux Humor on the Command-line.md --- sources/share/20150616 Linux Humor on the Command-line.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150616 Linux Humor on the Command-line.md b/sources/share/20150616 Linux Humor on the Command-line.md index 84c808e555..47f1d0eb26 100644 --- a/sources/share/20150616 Linux Humor on the Command-line.md +++ b/sources/share/20150616 Linux Humor on the Command-line.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Linux Humor on the Command-line ================================================================================ The desktop is full of eye candy. It enhances the visual experience and, in some cases, can also increase functionality of software. But it also makes software fun. Working on the command-line does not have to be always serious. If you want some fun on the command-line, there are lots of commands to raise a smile. @@ -124,4 +126,4 @@ via: http://www.linuxlinks.com/article/20150614112018846/Humor.html [4]:http://www.robobunny.com/projects/asciiquarium/html/ [5]:https://github.com/mtoyoda/sl [6]:http://aa-project.sourceforge.net/aalib/ -[7]:http://www.asty.org/cmatrix/ \ No newline at end of file +[7]:http://www.asty.org/cmatrix/ From cabb908a65212f023dbc99eb0f1c8249ccdcb7d8 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 26 Jun 2015 10:48:31 +0800 Subject: [PATCH 10/76] [Translating] sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md --- ...Apache '.htaccess' Tricks to Secure and Customize Websites.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md index e9e8ecb4eb..91b2308228 100644 --- a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md +++ b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -1,3 +1,4 @@ +ictlyh Translating 25 Useful Apache ‘.htaccess’ Tricks to Secure and Customize Websites ================================================================================ Websites are important parts of our lives. They serve the means to expand businesses, share knowledge and lots more. Earlier restricted to providing only static contents, with introduction of dynamic client and server side scripting languages and continued advancement of existing static language like html to html5, adding every bit of dynamicity is possible to the websites and what left is expected to follow soon in near future. From 523ee8bb9cee7cd8457376d6ce5aaedf9adbf14e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 26 Jun 2015 14:58:15 +0800 Subject: [PATCH 11/76] =?UTF-8?q?20150626-1=20=E9=80=89=E9=A2=98=20struggl?= =?UTF-8?q?ing=20=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erformance Tuning and Optimization Tips.md | 305 ++++++++++++++++++ 1 file changed, 305 insertions(+) create mode 100644 sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md new file mode 100644 index 0000000000..6e9172c685 --- /dev/null +++ b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -0,0 +1,305 @@ +15 Useful MySQL/MariaDB Performance Tuning and Optimization Tips +================================================================================ +MySQL is a powerful open source Relational Database Management System or in short RDBMS. It was released back in 1995 (20 years old). It uses Structured Query Language which is probably the most popular choice for managing content within a database. The latest MySQL version is 5.6.25 and was released on 29 May 2015. + +An interesting fact about MySQL is the fact that the name comes from Michael Widenius’s (MySQL’s creator) daughter My. Even though there are plenty of interesting facts about MySQL, this article is meant to show you some useful practices to help you manage your MySQL server. + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) + +MySQL Performance Tuning + +In April 2009 the MySQL project was bought by Oracle. As a result a MySQL community fork called MariaDB was created. The main reason for creating the fork was to keep the project free under the General Public License. + +Today MySQL and MariaDB are one of the most (if not the most) frequently used RDBMS used for web applications such as WordPress, Joomla, Magento and others. + +This article will show you some basic, yet useful tips how to optimize the fine tune the performance of MySQL/MariaDB. Please keep in mind that this article assumes that you already have MySQL or MariaDB installed. If you are still wondering how to install them on your system, you can follow our extensive guides here: + +- [Installing LAMP on RHEL/CentOS 7][1] +- [Installing LAMP on Fedora 22][2] +- [Setting Up LAMP on Ubuntu 15.04][3] +- [Installing MariaDB on Debian 8][4] +- [Install MariaDB on Gentoo Linux][5] +- [Install MariaDB on Arch Linux][6] + +**Important**: Before we start – do not accept this suggestions blindly. Each MySQL setup is unique and requires additional thought, before making any changes. + +Things you need to know: + +- MySQL/MariaDB configuration file is located in `/etc/my.cnf`. Every time you modify this file you will need to restart the MySQL service so the new changes can take effect. +- For writing this article MySQL version 5.6 has been used as template. + +### 1. Enable InnoDB file-per-table ### + +First it is important to explain that InnoDB is a storage engine. MySQL and MariaDB use InnoDB as default storage engine. In the past MySQL used to keep database tables and indexes in a system tablespace. This approach was meant for servers which sole purpose is database processing and their storage disk is not used for any other purposes. + +The InnoDB provides more flexible approach and each database information is kept in a `.ibd` data file. Each .ibd file represents a tablespace of its own. That way database operations such as “TRUNCATE” can be completed faster and you may also reclaim unused space when dropping or truncating a database table. + +Another benefit of this configuration is the fact that you can keep some of the database tables in a separate storage device. This can greatly improve the I/O load on your disks. + +The innodb_file_per_table is enabled by default in MySQL 5.6 and above. You can see that in /etc/my.cnf file. The directive looks like this: + + innodb_file_per_table=1 + +### 2. Store MySQL Database Data on Separate Partition ### + +**Note**: This setup only works with MySQL, but not with MariaDB. + +Sometimes OS read/writes can slow down the performance of your MySQL server, especially if located on same hard drive. Instead, I would recommend using separate hard drive (preferably SSD) for the MySQL service. + +To complete, this you will need to attach the new drive to your computer/server. For the purpose of this article, I will assume that the drive will be under /dev/sdb. + +The next step is to prepare the new drive: + + # fdisk /dev/sdb + +Now press “n” to create new partition. Next press “p” to make the new partition primary. After that, set the partition number from 1-4. After that you will select the partition size. Press enter here. On the next step you will need to configure the size of the partition. + +If you wish to use the entire disk press enter once more. Otherwise you can manually set the size of the new partition. When ready press “w” to write the changes. Now we will need to create a filesystem for our new partition. This can be easily done with: + + # mkfs.ext4 /dev/sdb1 + +Now we will mount our new partition in a folder. I have named my folder “ssd” and created in the root directory: + + # mkdir /ssd/ + +We are ready to mount the new partition we just made in the new folder: + + # mount /dev/sdb1 /ssd/ + +You can perform the mount at startup by adding the following line in /etc/fstab file. + + /dev/sdb1 /ssd ext3 defaults 0 0 + +Now you are ready to move MySQL to the new disk. First stop the MySQL service with: + + # service mysqld stop + +I would recommend you stopping Apache/nginx as well to prevent any attempts to write in the databases: + + # service httpd stop + # service nginx stop + +Now copy the entire MySQL directory in the new drive: + + # cp /var/lib/mysql /ssd/ -Rp + +This may take a while depending on the site of your MySQL databases. Once this process is complete rename the MySQL directory: + + # mv /var/lib/mysql /var/lib/mysql-backup + +Next we will create a symlink. + + # ln -s /ssd/mysql /var/lib/mysql + +Now you are ready to start your MySQL and web service: + + # service mysqld start + # service httpd start + # service nginx start + +At this point your MySQL databases will be accessed from the new drive. + +### 3. Optimizing InnoDB buffer pool Usage ### + +The InnoDB engine has a buffer pool used for caching data and indexes in memory. This of course will help your MySQL/MariaDB queries be executed significantly faster. Choosing the proper size here requires some very important decisions and good knowledge on your system’s memory consumption. + +Here is what you need to consider: + +- How much memory you need for other processes. This includes your system processes, page tables, socket buffers. +- Is your server dedicated for MySQL or you will be running other memory hungry services. + +On a dedicated box, you would probably want to give about 60-70% of the memory to the innodb_buffer_pool_size. If you plan on running more services on a single box, you should re-consider the amount of memory you dedicate for your innodb_buffer_pool_size. + +The value that you should edit in my.cnf is: + + innodb_buffer_pool_size + +### 4. Avoid Swappiness in MySQL ### + +Swapping is process that occurs when system moves part of memory to a special disk space called “swap”. The event usually appears when your system runs out of physical memory and instead of freeing up some RAM, the system pushed the information into disk. As you might have guess the disk is much slower than your RAM. + +By default the option is enabled: + + # sysctl vm.swappiness + + vm.swappiness = 60 + +To disable swappiness, run the following command: + + # sysctl -w vm.swappiness=0 + +### 5. Set MySQL Max Connections ### + +The max_connections directive tells your server how many concurrent connections are permitted. The MySQL/MariaDB server allows the value given in max_connections + 1 for user with SUPER privileges. The connection is opened only for the time MySQL query is executed – after that it is closed and new connection can take its place. + +Keep in mind that too many connections can cause high RAM usage and lock up your MySQL server. Usually small websites will require between 100-200 connections while larger may require 500-800 or even more. The value you apply here strongly depends on your particular MySQL/MariaDB usage. + +You can dynamically change the value of `max_connections`, without having to restart the MySQL service by running: + + # mysql -u root -p + mysql> set global max_connections := 300; + +### 6. Configure MySQL thread_cache_size ### + +The `thread_cache_size` directive sets the amount of threads that your server should cache. As the client disconnects, his threads are put in the cache if they are less than the thread_cache_size. Further requests are completed by using the threads stored in the cache. + +To improve your performance you can set the thread_cache_size to a relatively high number. To find the thread cache hit rate, you can use the following technique: + + mysql> show status like 'Threads_created'; + mysql> show status like 'Connections'; + +Now use the following formula to calculate the thread cache hit rate percentage: + + 100 - ((Threads_created / Connections) * 100) + +If you get a low number, it means that most of the new mysql connections are starting new thread instead of loading from cache. You will surely want to increase the thread_cache_size in such cases. + +The good thing here is that the thread_cache_size can be dynamically changed without having to restart the MySQL service. You can achieve this by running: + + mysql> set global thread_cache_size = 16; + +### 7. Disable MySQL Reverse DNS Lookups ### + +By default MySQL/MariaDB perform a DNS lookup of the user’s IP address/Hostname from which the connection is coming. For each client connection, the IP address is checked by resolving it to a host name. After that the host name is resolved back to an IP to verify that both match. + +This unfortunately may cause delays in case of badly configured DNS or problems with DNS server. This is why you can disable the reverse DNS lookup by adding the following in your configuration file: + + [mysqld] + # Skip reverse DNS lookup of clients + skip-name-resolve + +You will have to restart the MySQL service after applying these changes. + +### 8. Configure MySQL query_cache_size ### + +If you have many repetitive queries and your data does not change often – use query cache. People often do not understand the concept behind the `query_cache_size` and set this value to gigabytes, which can actually cause degradation in the performance. + +The reason behind that is the fact that threads need to lock the cache during updates. Usually value of 200-300 MB should be more than enough. If your website is relatively small, you can try giving the value of 64M and increase in time. + +You will have to add the following settings in the MySQL configuration file: + + query_cache_type = 1 + query_cache_limit = 256K + query_cache_min_res_unit = 2k + query_cache_size = 80M + +### 9. Configure tmp_table_size and max_heap_table_size ### + +Both directives should have the same size and will help you prevent disk writes. The `tmp_table_size` is the maximum amount of size of internal in-memory tables. In case the limit in question is exceeded the table will be converted to on-disk MyISAM table. + +This will affect the database performance. Administrators usually recommend giving 64M for both values for every GB of RAM on the server. + + [mysqld] + tmp_table_size= 64M + max_heap_table_size= 64M + +### 10. Enable MySQL Slow query Logs ### + +Logging slow queries can help you determine issues with your database and help you debug them. This can be easily enabled by adding the following values in your MySQL configuration file: + + slow-query-log = 1 + slow-query-log-file = /var/lib/mysql/mysql-slow.log + long_query_time = 1 + +The first directive enables the logging of slow queries, while the second one tells MySQL where to store the actual log file. Use `long_query_time` to define the amount of time that is considered long for MySQL query to be completed. + +### 11. Check for MySQL idle Connections ### + +Idle connections consume resources and should be interrupted or refreshed when possible. Such connections are in “sleep” state and usually stay that way for long period of time. To look for idled connections you can run the following command: + + # mysqladmin processlist -u root -p | grep “Sleep” + +This will show you list of processes that are in sleep state. The event appears when the code is using persistent connection to the database. When using PHP this event can appear when using mysql_pconnect which opens the connection, after that executes queries, removes the authentication and leaves the connection open. This will cause any per-thread buffers to be kept in memory until the thread dies. + +The first thing you would do here is to check the code and fix it. If you don’t have access to the code that is being ran, you can change the `wait_timeout` directive. The default value is 28800 seconds, while you can safely decrease it to something like 60: + + wait_timeout=60 + +### 12. Choosing Right MySQL Filesystem ### + +Choosing the right filesystem is vital for your databases. Most important things you need to consider here are – data integrity, performance and ease of administration. + +As per MariaDB’s recommendations, the best file systems are XFS, Ext4 and Btrfs. All of them are enterprise journaling filesystems that can be used with very large files and large storage volumes. + +Below you can find some useful information about the three filesystems: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + +
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
+ +The pros and cons of the Linux filesystems have been extensively covered in our article: + +- [Linux Filesystem Explained][7] + +### 13. Set MySQL max_allowed_packet ### + +MySQL splits data into packets. Usually a single packet is considered a row that is sent to a client. The `max_allowed_packet` directive defines the maximum size of packet that can be sent. + +Setting this value too low can cause a query to stall and you will receive an error in your MySQL error log. It is recommended to set the value to the size of your largest packet. + +### 14. Check MySQL Performance Tuning ### + +Measuring your MySQL/MariaDB performance is something that you should do on regular basis. This will help you see if something in the resource usage changes or needs to be improved. + +There are plenty of tools available for benchmarking, but I would like to suggest you one that is simple and easy to use. The tool is called mysqltuner. + +To download and run it, use the following set of commands: + + # wget https://github.com/major/MySQLTuner-perl/tarball/master + # tar xf master + # cd major-MySQLTuner-perl-993bc18/ + # ./mysqltuner.pl + +You will receive a detailed report about your MySQL usage and recommendation tips. Here is a sample output of default MariaDB installation: + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) + +### 15. Optimize and Repair MySQL Databases ### + +Sometimes MySQL/MariaDB database tables get crashed quite easily, especially when unexpected server shut down, sudden file system corruption or during copy operation, when database is still accessed. Surprisingly, there is a free open source tool called ‘mysqlcheck‘, which automatically check, repair and optimize databases of all tables in Linux. + + # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases + # mysqlcheck -u root -p --auto-repair --check --optimize databasename + +That’s it! I hope you have found the above article useful and help you tune up your MySQL server. As always if you have any further questions or comments, please submit them in the comment section below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ + +作者:[Marin Todorov][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/marintodorov89/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/ +[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/ +[4]:http://www.tecmint.com/install-mariadb-in-debian/ +[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ +[6]:http://www.tecmint.com/install-lamp-in-arch-linux/ +[7]:http://www.tecmint.com/linux-file-system-explained/ \ No newline at end of file From 30d13996eb4954b518e42eed3a54ff05157f5c8a Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 26 Jun 2015 15:51:41 +0800 Subject: [PATCH 12/76] Update 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...SQL or MariaDB Performance Tuning and Optimization Tips.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index 6e9172c685..e01e9bf787 100644 --- a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,3 +1,5 @@ +translation by strugglingyouth + 15 Useful MySQL/MariaDB Performance Tuning and Optimization Tips ================================================================================ MySQL is a powerful open source Relational Database Management System or in short RDBMS. It was released back in 1995 (20 years old). It uses Structured Query Language which is probably the most popular choice for managing content within a database. The latest MySQL version is 5.6.25 and was released on 29 May 2015. @@ -302,4 +304,4 @@ via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ [4]:http://www.tecmint.com/install-mariadb-in-debian/ [5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ [6]:http://www.tecmint.com/install-lamp-in-arch-linux/ -[7]:http://www.tecmint.com/linux-file-system-explained/ \ No newline at end of file +[7]:http://www.tecmint.com/linux-file-system-explained/ From e81d5f0aa7f2de4959eab496c4fb3c3e7f309b5b Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 26 Jun 2015 19:37:39 +0800 Subject: [PATCH 13/76] [Translated] sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md --- ...Tricks to Secure and Customize Websites.md | 423 ------------------ ...Tricks to Secure and Customize Websites.md | 422 +++++++++++++++++ 2 files changed, 422 insertions(+), 423 deletions(-) delete mode 100644 sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md create mode 100644 translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md diff --git a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md deleted file mode 100644 index 91b2308228..0000000000 --- a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md +++ /dev/null @@ -1,423 +0,0 @@ -ictlyh Translating -25 Useful Apache ‘.htaccess’ Tricks to Secure and Customize Websites -================================================================================ -Websites are important parts of our lives. They serve the means to expand businesses, share knowledge and lots more. Earlier restricted to providing only static contents, with introduction of dynamic client and server side scripting languages and continued advancement of existing static language like html to html5, adding every bit of dynamicity is possible to the websites and what left is expected to follow soon in near future. - -With websites, comes the need of a unit that can display these websites to a huge set of audience all over the globe. This need is fulfilled by the servers that provide means to host a website. This includes a list of servers like: Apache HTTP Server, Joomla, and WordPress that allow one to host their websites. - -![Apache htaccess Tricks](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) -25 htaccess Tricks - -One who wants to host a website can create a local server of his own or can contact any of above mentioned or any another server administrator to host his website. But the actual issue starts from this point. Performance of a website depends mainly on following factors: - -- Bandwidth consumed by the website. -- How secure is the website against hackers. -- Optimism when it comes to data search through the database -- User-friendliness when it comes to displaying navigation menus and providing more UI features. - -Alongside this, various factors that govern success of servers in hosting websites are: - -- Amount of data compression achieved for a particular website. -- Ability to simultaneously serve multiple clients asking for a same or different website. -- Securing the confidential data entered on the websites like: emails, credit card details and so on. -- Allowing more and more options to enhance dynamicity to a website. - -This article deals with one such feature provided by the servers that help enhance performance of websites along with securing them from bad bots, hotlinks etc. i.e. ‘.htaccess‘ file. - -### What is .htaccess? ### - -htaccess (or hypertext access) are the files that provide options for website owners to control the server environment variables and other parameters to enhance functionality of their websites. These files can reside in any and every directory in the directory tree of the website and provide features to the directory and the files and folders inside it. - -What are these features? Well these are the server directives i.e. the lines that instruct server to perform a specific task, and these directives apply only to the files and folders inside the folder in which this file is placed. These files are hidden by default as all Operating System and the web servers are configured to ignore them by default but making the hidden files visible can make you see this very special file. What type of parameters can be controlled is the topic of discussion of subsequent sections. - -Note: If .htaccess file is placed in /apache/home/www/Gunjit/ directory then it will provide directives for all the files and folders in that directory, but if this directory contains another folder namely: /Gunjit/images/ which again has another .htaccess file then the directives in this folder will override those provided by the master .htaccess file (or file in the folder up in hierarchy). - -### Apache Server and .htaccess files ### - -Apache HTTP Server colloquially called Apache was named after a Native American Tribe Apache to respect its superior skills in warfare strategy. Build on C/C++ and XML it is cross-platform web server which is based on NCSA HTTPd server and has a key role in growth and advancement of World Wide Web. - -Most commonly used on UNIX, Apache is available for wide variety of platforms including FreeBSD, Linux, Windows, Mac OS, Novel Netware etc. In 2009, Apache became the first server to serve more than 100 million websites. - -Apache server has one .htaccess file per user in www/ directory. Although these files are hidden but can be made visible if required. In www/ directory there are a number of folders each pertaining to a website named on user’s or owner’s name. Apart from this you can have one .htaccess file in each folder which configured files in that folder as stated above. - -How to configure htaccess file on Apache server is as follows… - -### Configuration on Apache Server ### - -There can be two cases: - -#### Hosting website on own server #### - -In this case, if .htaccess files are not enabled, you can enable .htaccess files by simply going to httpd.conf (Default configuration file for Apache HTTP Daemon) and finding the section. - - - -And locate the line that says… - - AllowOverride None - -And correct it to. - - AllowOverride All - -Now, on restarting Apache, .htaccess will work. - -#### Hosting website on different hosting provider server #### - -In this case it is better to consult the hosting admin, if they allow access to .htaccess files. - -### 25 ‘.htaccess’ Tricks of Apache Web Server for Websites ### - -#### 1. How to enable mod_rewrite in .htaccess file #### - -mod_rewrite option allows you to use redirections and hiding your true URL with redirecting to some other URL. This option can prove very useful allowing you to replace the lengthy and long URL’s to short and easy to remember ones. - -To allow mod_rewrite just have a practice to add the following line as the first line of your .htaccess file. - - Options +FollowSymLinks - -This option allows you to follow symbolic links and thus enable the mod_rewrite option on the website. Replacing the URL with short and crispy one is presented later on. - -#### 2. How to Allow or Deny Access to Websites #### - -htaccess file can allow or deny access of website or a folder or files in the directory in which it is placed by using order, allow and deny keywords. - -**Allowing access to only 192.168.3.1 IP** - - Order Allow, Deny - Deny from All - Allow from 192.168.3.1 - - OR - - Order Allow, Deny - Allow from 192.168.3.1 - -Order keyword here specifies the order in which allow, deny access would be processed. For the above ‘Order’ statement, the Allow statements would be processed first and then the deny statements would be processed. - -**Denying access to only one IP Address** - -The below lines provide the means to allow access of the website to all the users accept one with IP Address: 192.168.3.1. - - rder Allow, Deny - Deny from 192.168.3.1 - Allow from All - - OR - - - Order Deny, Allow - Deny from 192.168.3.1 - -#### 3. Generate Apache Error documents for different error codes. #### - -Using some simple lines, we can fix the error document that run on different error codes generated by the server when user/client requests a page not available on the website like most of us would have seen the ‘404 Page not found’ page in their web browser. ‘.htaccess’ files specify what action to take in case of such error conditions. - -To do this, the following lines are needed to be added to the ‘.htaccess’ files: - - ErrorDocument - -‘ErrorDocument’ is a keyword, error-code can be any of 401, 403, 404, 500 or any valid error representing code and lastly, ‘path-of-document’ represents the path on the local machine (in case you are using your own local server) or on the server (in case you are using any other’s server to host your website). - -**Example:** - - ErrorDocument 404 /error-docs/error-404.html - -The above line sets the document ‘error-404.html’ placed in error-docs folder to be displayed in case the 404 error is reported by the server for any invalid request for a page by the client. - -rrorDocument 404 "404 Page not found

The page you request is not present. Check the URL you have typed

" - -The above representation is also correct which places the string representing a usual html file. - -#### 4. Setting/Unsetting Apache server environment variables #### - -In .htaccess file you can set or unset the global environment variables that server allow to be modified by the hosters of the websites. For setting or unsetting the environment variables you need to add the following lines to your .htaccess files. - -**Setting the Environment variables** - - SetEnv OWNER “Gunjit Khera” - -Unsetting the Environment variables - - UnsetEnv OWNER - -#### 5. Defining different MIME types for files #### - -MIME (Multipurpose Internet Multimedia Extensions) are the types that are recognized by the browser by default when running any web page. You can define MIME types for your website in .htaccess files, so that different types of files as defined by you can be recognized and run by the server. - - - AddType application/javascript js - AddType application/x-font-ttf ttf ttc - - -Here, mod_mime.c is the module for controlling definitions of different MIME types and if you have this module installed on your system then you can use this module to define different MIME types for different extensions used in your website so that server can understand them. - -#### 6. How to Limit the size of Uploads and Downloads in Apache #### - -.htaccess files allow you the feature to control the amount of data being uploaded or downloaded by a particular client from your website. For this you just need to append the following lines to your .htaccess file: - - php_value upload_max_filesize 20M - php_value post_max_size 20M - php_value max_execution_time 200 - php_value max_input_time 200 - -The above lines set maximum upload size, maximum size of data being posted, maximum execution time i.e. the maximum time the a user is allowed to execute a website on his local machine, maximum time constrain within on the input time. - -#### 7. Making Users to download .mp3 and other files before playing on your website. #### - -Mostly, people play songs on websites before downloading them to check the song quality etc. Being a smart seller you can add a feature that can come in very handy for you which will not let any user play songs or videos online and users have to download them for playing. This is very useful as online playing of songs and videos consumes a lot of bandwidth. - -Following lines are needed to be added to be added to your .htaccess file: - - AddType application/octet-stream .mp3 .zip - -#### 8. Setting Directory Index for Website #### - -Most of website developers would already know that the first page that is displayed i.e. the home page of a website is named as ‘index.html’ .Many of us would have seen this also. But how is this set? - -.htaccess file provides a way to list a set of pages which would be scanned in order when a client requests to visit home page of the website and accordingly any one of the listed set of pages if found would be listed as the home page of the website and displayed to the user. - -Following line is needed to be added to produce the desired effect. - - DirectoryIndex index.html index.php yourpage.php - -The above line specifies that if any request for visiting the home page comes by any visitor then the above listed pages will be searched in order in the directory firstly: index.html which if found will be displayed as the sites home page, otherwise list will proceed to the next page i.e. index.php and so on till the last page you have entered in the list. - -#### 9. How to enable GZip compression for Files to save site’s bandwidth. #### - -This is a common observation that heavy sites generally run bit slowly than light weight sites that take less amount of space. This is just because for a heavy site it takes time to load the huge script files and images before displaying them on the client’s web browser. - -This is a common mechanism that when a browser requests a web page, server provides the browser with that webpage and now to locally display that web page, the browser has to download that page and then run the script inside that page. - -What GZip compression does here is saving the time required to serve a single customer thus increasing the bandwidth. The source files of the website on the server are kept in compressed form and when the request comes from a user then these files are transferred in compressed form which are then uncompressed and executed on the server. This improves the bandwidth constrain. - -Following lines can allow you to compress the source files of your website but this requires mod_deflate.c module to be installed on your server. - - - AddOutputFilterByType DEFLATE text/plain - AddOutputFilterByType DEFLATE text/html - AddOutputFilterByType DEFLATE text/xml - AddOutputFilterByType DEFLATE application/html - AddOutputFilterByType DEFLATE application/javascript - AddOutputFilterByType DEFLATE application/x-javascript - - -#### 10. Playing with the File types. #### - -There are certain conditions that the server assumes by default. Like: .php files are run on the server, similarly .txt files say for example are meant to be displayed. Like this we can make some executable cgi-scripts or files to be simply displayed as the source code on our website instead of being executed. - -To do this observe the following lines from a .htaccess file. - - RemoveHandler cgi-script .php .pl .py - AddType text/plain .php .pl .py - -These lines tell the server that .pl (perl script), .php (PHP file) and .py (Python file) are meant to just be displayed and not executed as cgi-scripts. - -#### 11. Setting the Time Zone for Apache server #### - -The power and importance of .htaccess files can be seen by the fact that this can be used to set the Time Zone of the server accordingly. This can be done by setting a global Environment variable ‘TZ’ of the list of global environment variables that are provided by the server to each of the hosted website for modification. - -Due to this reason only, we can see time on the websites (that display it) according to our time zone. May be some other person hosting his website on the server would have the timezone set according to the location where he lives. - -Following lines set the Time Zone of the Server. - - SetEnv TZ India/Kolkata - -#### 12. How to enable Cache Control on Website #### - -A very interesting feature of browser, most have observed is that on opening one website simultaneously more than one time, the latter one opens fast as compared to the first time. But how is this possible? Well in this case, the browser stores some frequently visited pages in its cache for faster access later on. - -But for how long? Well this answer depends on you i.e. on the time you set in your .htaccess file for Cache control. The .htaccess file can specify the amount of time for which the pages of website can stay in the browser’s cache and after expiration of time, it must revalidate i.e. pages would be deleted from the Cache and recreated the next time user visits the site. - -Following lines implement Cache Control for your website. - - - Header Set Cache-Control "max-age=3600, public" - - - Header Set Cache-Control "public" - Header Set Expires "Sat, 24 Jan 2015 16:00:00 GMT" - - -The above lines allow caching of the pages which are inside the directory in which .htaccess files are placed for 1 hour. - -#### 13. Configuring a single file, the option. #### - -Usually the content in .htaccess files apply to all the files and folders inside the directory in which the file is placed, but you can also provide some special permissions to a special file, like denying access to that file only or so on. - -For this you need to add tag to your file in a way like this: - - - Order allow, deny - Deny from 188.100.100.0 - - -This is a simple case of denying a file ‘conf.html’ from access by IP 188.100.100.0, but you can add any or every feature described for .htaccess file till now including the features yet to be described to the file like: Cache-control, GZip compression. - -This feature is used by most of the servers to secure .htaccess files which is the reason why we are not able to see the .htaccess files on the browsers. How the files are authenticated is demonstrated in subsequent heading. - -#### 14. Enabling CGI scripts to run outside of cgi-bin folder. #### - -Usually servers run CGI scripts that are located inside the cgi-bin folder but, you can enable running of CGI scripts located in your desired folder but just adding following lines to .htaccess file located in the desired folder and if not, then creating one, appending following lines: - - AddHandler cgi-script .cgi - Options +ExecCGI - -#### 15. How to enable SSI on Website with .htaccess #### - -Server side includes as the name suggests would be related to something included at the server side. But what? Generally when we have many pages in our website and we have a navigation menu on our home page that displays links to other pages then, we can enable SSI (Server Size Includes) option that allows all the pages displayed in the navigation menu to be included with the home page completely. - -The SSI allows inclusion of multiple pages as if content they contain is a part of a single page so that any editing needed to be done is done in one file only which saves a lot of disk space. This option is by default enabled on servers but for .shtml files. - -In case you want to enable it for .html files you need to add following lines: - - AddHandler server-parsed .html - -After this following in the html file would lead to SSI. - - - -#### 16. How to Prevent website Directory Listing #### - -To prevent any client being able to list the directories of the website on the server at his local machine add following lines to the file inside the directory you don’t want to get listed. - - Options -Indexes - -#### 17. Changing Default charset and language headers. #### - -.htaccess files allow you to modify the character set used i.e. ASCII or UNICODE, UTF-8 etc. for your website along with the default language used for the display of content. - -Following server’s global environment variables allow you to achieve above feature. - - AddDefaultCharset UTF-8 - DefaultLanguage en-US - -**Re-writing URL’s: Redirection Rules** - -Re-writing feature simply means replacing the long and un-rememberable URL’s with short and easy to remember ones. But, before going into this topic there are some rules and some conventions for special symbols used later on in this article. - -**Special Symbols:** - - Symbol Meaning - ^ - Start of the string - $ - End of the String - | - Or [a|b] – a or b - [a-z] - Any of the letter between a to z - + - One or more occurrence of previous letter - * - Zero or more occurrence of previous letter - ? - Zero or one occurrence of previous letter - -**Constants and their meaning:** - - Constant Meaning - NC - No-case or case sensitive - L - Last rule – stop processing further rules - R - Temporary redirect to new URL - R=301 - Permanent redirect to new URL - F - Forbidden, send 403 header to the user - P - Proxy – grab remote content in substitution section and return it - G - Gone, no longer exists - S=x - Skip next x rules - T=mime-type - Force specified MIME type - E=var:value - Set environment variable var to value - H=handler - Set handler - PT - Pass through – in case of URL’s with additional headers. - QSA - Append query string from requested to substituted URL - -#### 18. Redirecting a non-www URL to a www URL. #### - -Before starting with the explanation, lets first see the lines that are needed to be added to .htaccess file to enable this feature. - - RewriteEngine ON - RewriteCond %{HTTP_HOST} ^abc\.net$ - RewriteRule (.*) http://www.abc.net/$1 [R=301,L] - -The above lines enable the Rewrite Engine and then in second line check all those URL’s that pertain to host abc.net or have the HTTP_HOST environment variable set to “abc.net”. - -For all such URL’s the code permanently redirects them (as R=301 rule is enabled) to the new URL http://www.abc.net/$1 where $1 is the non-www URL having host as abc.net. The non-www URL is the one in bracket and is referred by $1. - -#### 19. Redirecting entire website to https. #### - -Following lines will help you transfer entire website to https: - - RewriteEngine ON - RewriteCond %{HTTPS} !on - RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} - -The above lines enable the re-write engine and then check the value of HTTPS environment variable. If it is on then re-write the entire pages of the website to https. - -#### 20. A custom redirection example #### - -For example, redirect url ‘http://www.abc.net?p=100&q=20 ‘ to ‘http://www.abc.net/10020pq’. - - RewriteEngine ON - RewriteRule ^http://www.abc.net/([0-9]+)([0-9]+)pq$ ^http://www.abc.net?p=$1&q=$2 - -In above lines, $1 represents the first bracket and $2 represents the second bracket. - -#### 21. Renaming the htaccess file #### - -For preventing the .htaccess file from the intruders and other people from viewing those files you can rename that file so that it is not accessed by client’s browser. The line that does this is: - - AccessFileName htac.cess - -#### 22. How to Prevent Image Hotlinking for your Website #### - -Another problem that is major factor of large bandwidth consumption by the websites is the problem of hot links which are links to your websites by other websites for display of images mostly of your website which consumes your bandwidth. This problem is also called as ‘bandwidth theft’. - -A common observation is when a site displays the image contained in some other site due to this hot-linking your site needs to be loaded and at the stake of your site’s bandwidth, the other site’s images are displayed. To prevent this for like: images such as: .gif, .jpeg etc. following lines of code would help: - - RewriteEngine ON - RewriteCond %{HTTP_REFERER} !^$ - RewriteCond %{HTTP_REFERERER} !^http://(www\.)?mydomain.com/.*$ [NC] - RewriteRule \.(gif|jpeg|png)$ - [F]. - -The above lines check if the HTTP_REFERER is not set to blank or not set to any of the links in your websites. If this is happening then all the images in your page are replaced by 403 forbidden. - -#### 23. How to Redirect Users to Maintenance Page. #### - -In case your website is down for maintenance and you want to notify all your clients that need to access your websites about this then for such cases you can add following lines to your .htaccess websites that allow only admin access and replace the site pages having links to any .jpg, .css, .gif, .js etc. - - RewriteCond %{REQUEST_URI} !^/admin/ [NC] - RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] - RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html - [NC,L,U,QSA] - -These lines check if the Requested URL contains any request for any admin page i.e. one starting with ‘/admin/’ or any request to ‘.png, .jpg, .js, .css’ pages and for any such requests it replaces that page to ‘ErrorDocs/Maintainence_Page.html’. - -#### 24. Mapping IP Address to Domain Name #### - -Name servers are the servers that convert a specific IP Address to a domain name. This mapping can also be specified in the .htaccess files in the following manner. - - For Mapping L.M.N.O address to a domain name www.hellovisit.com - RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] - RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] - -The above lines check if the host for any page is having the IP Address as: L.M.N.O and if so the page is mapped to the domain name http://www.hellovisit.com by the third line by permanent redirection. - -#### 25. FilesMatch Tag #### - -Like tag that is used to apply conditions to a single file, can be used to match to a group of files and apply some conditions to the group of files as below: - - - Order Allow, Deny - Deny from All - - -### Conclusion ### - -The list of tricks that can be done with .htaccess files is much more. Thus, this gives us an idea how powerful this file is and how much security and dynamicity and other features it can give to your website. - -We’ve tried our best to cover as much as htaccess tricks in this article, but incase if we’ve missed any important trick, or you most welcome to post your htaccess ideas and tricks that you know via comments section below – we will include those in our article too… - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/apache-htaccess-tricks/ - -作者:[Gunjit Khera][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/gunjitk94/ \ No newline at end of file diff --git a/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md new file mode 100644 index 0000000000..723ce313b2 --- /dev/null +++ b/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -0,0 +1,422 @@ +用于提高网站安全性和自定义网站的 25 个有用 Apache ‘.htaccess’ 小技巧 +================================================================================ +网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。之前受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 + +有了网站,随之而来的是对能向全球大规模用户显示站点的单元的需求。这个需求通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 + +![Apache htaccess 小技巧](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) +25 个 htaccess 小技巧 + +想要拥有一个网站,可以创建一个自己的本地服务器,或者联系任何上面提到的或其它服务器管理员来托管他的网站。但实际问题也从这点开始。网站的性能主要取决于以下因素: + +- 网站消耗的带宽。 +- 针对黑客网站有多安全。 +- 对数据库进行数据检索时的优化。 +- 显示导航菜单和提供更多 UI 功能时的用户友好性。 + +除此之外,保证托管网站服务器成功的多种因素还包括: + +- 对于一个流行站点的数据压缩量。 +- 同时为多个请求同一或不同站点的用户服务的能力。 +- 保证网站上输入的机密数据安全,例如:Email、信用卡信息等等。 +- 允许更多的选项用于增强站点的动态性。 + +这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链接等的安全性的功能。例如 ‘.htaccess’ 文件。 + +### .htaccess 是什么? ### + +htaccess (hypertext access,超文本访问) 是为网站所有者提供用于控制服务器环境变量以及其它参数的选项,从而增强他们网站的功能的文件。这些文件可以在网站目录树的任何一个目录中,并向该目录以及目录中的文件和子目录提供功能。 + +这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略。但让隐藏文件可见可以让你看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 + +注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者层次结构中更上层文件)提供的命令。 + +### Apache Server 和 .htaccess 文件 ### + +Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它是用 C/C++ 和 XML 建立的基于 [NCSA HTTPd 服务器][1] 的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 + +最常用于 UNIX,Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 + +Apache 服务器对于 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 + +下面介绍如果配置 Apache 服务器上的 htaccess 文件。 + +### Apache 服务器上的配置 ### + +这里有两种情况: + +#### 在自己的服务器上托管网站 #### + +在这种情况下,如果没有启用 .htaccess 文件,你可以通过在 http.conf(Apache HTTP 守护进程的默认配置文件) 中找到 部分启用。 + + + +定位如下行 + + AllowOverride None + +更改为 + + AllowOverride All + +现在,重启 Apache 后就启用了 .htaccess。 + +#### 在不同的托管服务提供商的服务器上托管网站 #### + +在这种情况下最好咨询托管管理员,如果他们允许访问 .htaccess 文件的话。 + +### 用于站点的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### + +#### 1. 如何在 .htaccess 文件中启用 mod_rewrite #### + +mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 + +要允许 mod_rewrite,只需要在你的 .htaccess 文件的第一行添加如下一行。 + + Options +FollowSymLinks + +该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。 + +#### 2. 如果允许或禁止对站点的访问 #### + +通过使用 order、allow 和 deny 关键字,htaccess 文件可以允许或者禁止对站点或目录中子目录或文件的访问。 + +**只允许 IP 192.168.3.1 的访问** + + Order Allow, Deny + Deny from All + Allow from 192.168.3.1 + + 或 + + Order Allow, Deny + Allow from 192.168.3.1 + +这里的 Order 关键字指定处理 allow 和 deny 访问的顺序。对于上面的 ‘Order’ 语句,首先会处理 Allow 语句,然后是 deny 语句。 + +**只禁止某个 IP 的访问** + +下面一行的意思是除了 IP 地址 192.168.3.1,允许所有用户访问网站。 + + Order Allow, Deny + Deny from 192.168.3.1 + Allow from All + + 或 + + Order Deny, Allow + Deny from 192.168.3.1 + +#### 3. 为不同错误码生成 Apache 错误文档 #### + +用一些简单行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 + +要做到这点,需要添加下面的行到 ‘.htaccess’ 文件: + + ErrorDocument + +‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或 服务器上的路径(如果你使用任何其它服务器来托管网站)。 + +**例子:** + + ErrorDocument 404 /error-docs/error-404.html + +上面一行设置客户请求任何无效页面,服务器报告 404 错误时显示 error-docs 目录下的 ‘error-404.html’ 文档。 + +ErrorDocument 404 "404 Page not found

The page you request is not present. Check the URL you have typed

" + +上面的表示也正确,其中字符串表示一个普通的 html 文件。 + +#### 4. 设置/取消 Apache 服务器环境变量 #### + +在 .htaccess 文件中你可以设置或者取消站点所有者用来更改服务器设置的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 + +**设置环境变量** + + SetEnv OWNER “Gunjit Khera” + +**取消环境变量** + + UnsetEnv OWNER + +#### 5. 为文件定义不同 MIME 类型 #### + +MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体扩展) 是浏览器运行任何页面默认能识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义的类型的文件并运行。 + + + AddType application/javascript js + AddType application/x-font-ttf ttf ttc + + +这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展定义不同的 MIME 类型,从而服务器可以理解这些文件。 + +#### 6. 如何在 Apache 中限制上传和下载的大小 #### + +.htaccess 文件允许你拥有控制一个特定用户从你的站点上传或下载数据量大小的功能。要做到这点你只需要添加下面的行到你的 .htaccess 文件: + + php_value upload_max_filesize 20M + php_value post_max_size 20M + php_value max_execution_time 200 + php_value max_input_time 200 + +上面的行设置最大上传大小、最大推送数据大小、最大执行时间,例如允许用户在本地机器运行站点的最大时间、限制的最大输入时间。 + +#### 7. 让用户在站点上播放 .mp3 和其它文件之前预先下载 #### + +大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载后才能播放。这非常有用,因为在线播放音乐和视频会消耗很多带宽。 + +要添加下面的行到你的 .htaccess 文件: + + AddType application/octet-stream .mp3 .zip + +#### 8. 为站点设置目录索引 #### + +大部分网站开发者都知道第一个显示的页面,例如一个站点的主页面,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? + +.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 + +需要添加下面的行产生所需的效果。 + + DirectoryIndex index.html index.php yourpage.php + +上面一行指定如果有任何访问主页面的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会处理下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 + +#### 9. 如何为文件启用 GZip 压缩以节省网站带宽 #### + +繁重站点通常比只占少量空间的轻量级站点运行更慢是常见的现象。这是因为对于繁重站点需要时间加载大量的脚本文件和图片用于在客户端的 Web 浏览器上显示。 + +当浏览器请求一个 web 页面时,服务器提供给浏览器该页面并局部显示该 web 页面,浏览器需要下载该页面然后在页面内部运行脚本,这是一种常见机制。 + +这里 GZip 压缩所做的就是节省单个用户的服务时间从而提高带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在服务器上解压并执行。这改进了带宽限制。 + +下面的行允许你压缩站点的源文件,但要求在你的服务器上安装 mod_deflate.c 模块。 + + + AddOutputFilterByType DEFLATE text/plain + AddOutputFilterByType DEFLATE text/html + AddOutputFilterByType DEFLATE text/xml + AddOutputFilterByType DEFLATE application/html + AddOutputFilterByType DEFLATE application/javascript + AddOutputFilterByType DEFLATE application/x-javascript + + +#### 10. 处理文件类型 #### + +服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们。 + +要做到这点在 .htaccess 文件中有如下行。 + + RemoveHandler cgi-script .php .pl .py + AddType text/plain .php .pl .py + +这些行告诉服务器只显示而不执行 .pl (perl 脚本)、.php (PHP 文件) 和 .py (Python 文件) 。 + +#### 11. 为 Apache 服务器设置时区 #### + +.htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 + +由于这个原因,我们可以在网站上看到根据我们的时区显示的时间。也许服务器上其他拥有网站的人会根据他居住地点的位置设置时区。 + +下面的一行为服务器设置时区。 + + SetEnv TZ India/Kolkata + +#### 12. 如果在站点上启用缓存控制 #### + +浏览器很有趣的一个功能是,已经观察到多次同时打开一个网站,和第一次打开相比之后会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 + +但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证,例如页面会从缓存中删除然后在下次用户访问站点的时候重建。 + +下面的行为你的站点实现缓存控制。 + + + Header Set Cache-Control "max-age=3600, public" + + + Header Set Cache-Control "public" + Header Set Expires "Sat, 24 Jan 2015 16:00:00 GMT" + + +上面的行允许缓存 .htaccess 文件所在目录中的页面一小时。 + +#### 13. 配置单个文件 #### + +通常 .htaccess 文件中的内容会对该文件所在目录中的所有文件和子目录起作用,但是你也可以对特殊文件设置一些特殊权限,例如只禁止对某个文件的访问等等。 + +要做到这点,你需要在文件中以类似方式添加 标记: + + + Order allow, deny + Deny from 188.100.100.0 + + +这是一个禁止 IP 188.100.100.0 访问 ‘conf.html’ 的简单例子,但是你也可以添加介绍过的 .htaccess 文件的任何功能,包括将要介绍的功能,例如:缓存控制、GZip 压缩。 + +大部分服务器会用这个功能增强 .htaccess 文件的安全,这也是我们在浏览器上看不到 .htaccess 文件的原因。在后面的章节中会介绍如何给文件授权。 + +#### 14. 启用在 cgi-bin 目录以外运行 CGI 脚本 #### + +通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以启用在你需要的目录运行 CGI 脚本,只需要在所需的目录中添加下面的行到 .htaccess 文件,如果没有改文件就创建一个,并添加下面的行: + + AddHandler cgi-script .cgi + Options +ExecCGI + +#### 15.如何用 .htaccess 在站点上启用 SSI #### + +服务器端包括顾名思义的和服务器部分相关的东西。但是什么呢?通常当我们在站点上有很多页面的时候,我们在主页面上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI(Server Size Includes) 选项允许导航菜单中显示的所有页面完全包含在主页面中。 + +SSI 允许包含多个页面,好像他们包含的内容就是一个单一页面的一部分,因此任何需要的编辑都只有一个文件,从而可以节省很多磁盘空间。除了 .shtml 文件,服务器默认启用了该选项。 + +如果你想要对 .html 启用该选项,你需要添加下面的行: + + AddHandler server-parsed .html + +这之后 html 文件会导向 SSI。 + + + +#### 16. 如何防止网站目录列表 #### + +为防止任何客户端在本地机器罗列服务器上的网站目录列表,添加下面的行到你不想列出的目录的文件中。 + + Options -Indexes + +#### 17. 更改默认字符集和语言头 #### + +.htaccess 文件允许你更改网站使用的字符集,例如 ASCII 或 UNICODE,UTF-8 等,以及用于显示内容的默认语言。 + +在服务器的全局环境变量之后添加下面语句可以实现上述功能。 + + AddDefaultCharset UTF-8 + DefaultLanguage en-US + +**重写 URL 的重定向规则** + +重写功能仅意味着用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 + +**特殊符号:** + + 符号 含义 + ^ - 字符串开头 + $ - 字符串结尾 + | - 或 [a|b] – a 或 b + [a-z] - a 到 z 的任意字母 + + - 之前字母的一次或多次出现 + * - 之前字母的零次或多次出现 + ? - 之前字母的零次或一次出现 + +**常量和它们的含义:** + + 常量 含义 + NC - 区分大小写 + L - 最后的规则 – 停止处理更多规则 + R - 临时重定向到新 URL + R=301 - 永久重定向到新 URL + F - 禁止发送 403 头给用户 + P - 代理 – 获取远程内容代替部分并返回 + G - Gone, 不再存在 + S=x - 跳过后面的 x 条规则 + T=mime-type - 强制指定 MIME 类型 + E=var:value - 设置环境变量 var 的值为 value + H=handler - 设置处理器 + PT - Pass through – 如果 URL 有额外的头 + QSA - 从到替换 URL 的请求追加查询字符串 + +#### 18. 重定向一个非 www URL 到 www URL #### + +在开始解释之前,首先看看启用该功能需要添加到 .htaccess 文件的行。 + + RewriteEngine ON + RewriteCond %{HTTP_HOST} ^abc\.net$ + RewriteRule (.*) http://www.abc.net/$1 [R=301,L] + +上面的行启用 Rewrite Engine 然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 + +对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 + +#### 19. 重定向整个站点到 https #### + +下面的行会帮助你转换整个网站到 https: + + RewriteEngine ON + RewriteCond %{HTTPS} !on + RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + +上面的行启用 re-write engine 然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 + +#### 20.一个自定义重写例子 #### + +例如,重定向 url ‘http://www.abc.net?p=100&q=20’ 到 ‘http://www.abc.net/10020pq’。 + + RewriteEngine ON + RewriteRule ^http://www.abc.net/([0-9]+)([0-9]+)pq$ ^http://www.abc.net?p=$1&q=$2 + +在上面的行中,$1 表示第一个括号,$2 表示第二个括号。 + +#### 21. 重命名 htaccess 文件 #### + +为了防止入侵者和其他人查看 .htaccess 文件,你可以重命名该文件,这样就不能通过客户端浏览器访问。实现该目标的语句是: + + AccessFileName htac.cess + +#### 22. 如何为你的网站禁用图片链接 #### + +网站大的带宽消耗的另外一个重要问题是热链接问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 + +一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接你的网站需要被加载,消耗你站点的带宽而显示其它站点的图片。为了防止出现这种情况,例如 .gif、.jpeg 图片等,下面的代码行会有所帮助: + + RewriteEngine ON + RewriteCond %{HTTP_REFERER} !^$ + RewriteCond %{HTTP_REFERERER} !^http://(www\.)?mydomain.com/.*$ [NC] + RewriteRule \.(gif|jpeg|png)$ - [F]. + +上面的行检查 HTTP_REFERER 是否没有设为空或没有设为你站点上的任何链接。如果是这样的话,你网页上的所有图片会用 403 禁止访问代替。 + +#### 23. 如何将用户重定向到维护页面 #### + +如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有有 .jpg、.css、.gif、.js 等的页面。 + + RewriteCond %{REQUEST_URI} !^/admin/ [NC] + RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] + RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html + [NC,L,U,QSA] + +这些行检查请求 URL 是否包含任何例如以 ‘/admin/’ 开头的管理页面的请求,或任何到 ‘.png, .jpg, .js, .css’ 页面的请求,对于任何这样的请求,用 ‘ErrorDocs/Maintainence_Page.html’ 替换那个页面。 + +#### 24. 映射 IP 地址到域名 #### + +名称服务器是将特定 IP 地址转换为域名的服务器。该映射也可以在 .htaccess 文件中用以下形式指定。 + + 为了将地址 L.M.N.O 映射到域名 www.hellovisit.com + RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] + RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] + +上面的行检查任何页面的主机是否包含类似 L.M.N.O 的 IP 地址,如果是的话第三行会通过永久重定向将页面映射到域名 http://www.hellovisit.com。 + +#### 25. FilesMatch 标签 #### + +类似用于应用条件到单个文件的 标签, 能用于匹配一组文件并对该组文件应用一些条件,如下: + + + Order Allow, Deny + Deny from All + + +### 结论 ### + +.htaccess 文件能实现的小技巧还有很多。这告诉了我们这个文件有多么强大,通过该文件能给你的站点添加多少安全性、动态性以及其它功能。 + +我们已经在这篇文章中尽最大努力覆盖尽可能多的 htaccess 小技巧,但如果我们缺少了任何重要的技巧,或者你愿意告诉我们你的 htaccess 想法和技巧,你可以在下面的评论框中提交,我们也会在文章中进行介绍。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/apache-htaccess-tricks/ + +作者:[Gunjit Khera][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gunjitk94/ +[1]:https://en.wikipedia.org/wiki/NCSA_HTTPd \ No newline at end of file From aa63327a7fdeb71d83cb86b4d992c49f1d5e4a32 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 25 Jun 2015 09:47:15 +0800 Subject: [PATCH 14/76] PUB:20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux @geekpi --- ...rs--How to mount an LVM partition on Linux.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md (77%) diff --git a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md similarity index 77% rename from translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md rename to published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md index 391769edc2..1466c8c87e 100644 --- a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md +++ b/published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md @@ -1,10 +1,10 @@ -Linux有问必答 -- 如何在Linux中挂载LVM分区 +Linux有问必答:如何在Linux中直接挂载LVM分区 ================================================================================ > **提问**: 我有一个USB盘包含了LVM分区。 我想要在Linux中访问这些LVM分区。我该如何在Linux中挂载LVM分区? -】LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地位用户和程序分配空间而不用考虑每个物理磁盘的大小。 +LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地为用户和程序分配空间而不用考虑每个物理磁盘的大小。 -在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化位“物理卷”并被标签(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。 +在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化为“物理卷 PV”并加上卷标(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。 如果你尝试挂载一个LVM分区(比如/dev/sdb2), 你会得到下面的错误。 @@ -16,9 +16,9 @@ Linux有问必答 -- 如何在Linux中挂载LVM分区 ![](https://farm8.staticflickr.com/7696/17749902190_0a6d36821f_b.jpg) -要正确地挂载LVM分区,你必须挂载分区创建的“逻辑分区”。下面就是如何做的。 +要正确地挂载LVM分区,你必须挂载分区中创建的“逻辑卷”。下面就是如何做的。 -=首先,用下面的命令检查可用的卷组: +首先,用下面的命令检查可用的卷组: $ sudo pvs @@ -60,7 +60,9 @@ Linux有问必答 -- 如何在Linux中挂载LVM分区 ![](https://farm8.staticflickr.com/7707/17938137591_cdb4cbfb43_b.jpg) -如果你想要挂载一个特定的逻辑卷,使用“LV Path”下面的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。 +*上图可以看到两个逻辑卷的名字:lv_root和lv_home* + +如果你想要挂载一个特定的逻辑卷,使用如下的“LV Path”的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。 $ sudo mount /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt @@ -82,7 +84,7 @@ via: http://ask.xmodulo.com/mount-lvm-partition-linux.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ffee2ffe70643cc55101f87dd53576cc14adfea Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 25 Jun 2015 10:17:08 +0800 Subject: [PATCH 15/76] PUB:20150520 Shell Script to Backup Files or Directories Using rsync @GOLinux --- ...Backup Files or Directories Using rsync.md | 81 ++++++++++--------- 1 file changed, 41 insertions(+), 40 deletions(-) rename {translated/tech => published}/20150520 Shell Script to Backup Files or Directories Using rsync.md (51%) diff --git a/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md b/published/20150520 Shell Script to Backup Files or Directories Using rsync.md similarity index 51% rename from translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md rename to published/20150520 Shell Script to Backup Files or Directories Using rsync.md index 639e58ede9..b987588c4f 100644 --- a/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md +++ b/published/20150520 Shell Script to Backup Files or Directories Using rsync.md @@ -1,6 +1,6 @@ Shell脚本:使用rsync备份文件/目录 ================================================================================ -本文,我们带来了shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本实施备份会是一个交互的方式,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们保留了一个独立文件,在这个文件中你需要提供需要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh验证密钥,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。 +本文我们介绍一个shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本会以交互的方式实施备份,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们使用一个单独的列表文件,在这个文件中你需要列出要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh密钥验证,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。 我们打算备份bckup.txt,dataconfig.txt,docs和orcledb。 @@ -12,7 +12,7 @@ Shell脚本:使用rsync备份文件/目录 drwxr-xr-x. 2 root root 4096 May 15 10:45 docs drwxr-xr-x. 2 root root 4096 May 15 10:44 oracledb -该文件包含了备份文件/目录的详情 +bckup.txt文件包含了需要备份的文件/目录的详情 [root@Fedora21 tmp]# cat /tmp/bckup.txt /tmp/oracledb @@ -24,46 +24,46 @@ Shell脚本:使用rsync备份文件/目录 #!/bin/bash - #We will save path to backup file in variable + # 将备份列表文件的路径保存到变量中 backupf='/tmp/bckup.txt' - #Next line just prints message + # 输入一个提示信息 echo "Shell Script Backup Your Files / Directories Using rsync" - #next line check if entered value is not null, and if null it will reask user to enter Destination Server + # 检查是否输入了目标服务器,如果为空就再次提示用户输入 while [ x$desthost = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name desthost + # 提示用户输入目标服务器地址并保存到变量 read -p "Destination backup Server : " desthost - #next line finishes while loop + # 结束循环 done - #next line check if entered value is not null, and if null it will reask user to enter Destination Path + # 检查是否输入了目标文件夹,如果为空就再次提示用户输入 while [ x$destpath = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name destpath + # 提示用户输入目标文件夹并保存到变量 read -p "Destination Folder : " destpath - #next line finishes while loop + # 结束循环 done - #Next line will start reading backup file line by line + # 逐行读取备份列表文件 for line in `cat $backupf` - #and on each line will execute next + # 对每一行都进行处理 do - #print message that file/dir will be copied + # 显示要被复制的文件/文件夹名称 echo "Copying $line ... " - #copy via rsync file/dir to destination + # 通过 rsync 复制文件/文件夹到目标位置 rsync -ar "$line" "$desthost":"$destpath" - #this line just print done + # 显示完成 echo "DONE" - #end of reading backup file + # 结束 done #### 运行带有输出结果的脚本 #### @@ -91,64 +91,65 @@ Shell脚本:使用rsync备份文件/目录 #!/bin/bash - #We will save path to backup file in variable + # 将备份列表文件的路径保存到变量中 backupf='/tmp/bckup.txt' - #Next line just prints message + # 输入一个提示信息 echo "Shell Script Backup Your Files / Directories Using rsync" - #next line check if entered value is not null, and if null it will reask user to enter Destination Server + # 检查是否输入了目标服务器,如果为空就再次提示用户输入 while [ x$desthost = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name desthost + # 提示用户输入目标服务器地址并保存到变量 read -p "Destination backup Server : " desthost - #next line finishes while loop + # 结束循环 done - #next line check if entered value is not null, and if null it will reask user to enter Destination Path + # 检查是否输入了目标文件夹,如果为空就再次提示用户输入 while [ x$destpath = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name destpath + # 提示用户输入目标文件夹并保存到变量 read -p "Destination Folder : " destpath - #next line finishes while loop + # 结束循环 done - #next line check if entered value is not null, and if null it will reask user to enter password + # 检查是否输入了目标服务器密码,如果为空就再次提示用户输入 while [ x$password = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name password. #To hide password we are using -s key + # 提示用户输入密码并保存到变量 + # 使用 -s 选项不回显输入的密码 read -sp "Password : " password - #next line finishes while loop + # 结束循环 done - #Next line will start reading backup file line by line + # 逐行读取备份列表文件 for line in `cat $backupf` - #and on each line will execute next + # 对每一行都进行处理 do - #print message that file/dir will be copied + # 显示要被复制的文件/文件夹名称 echo "Copying $line ... " - #we will use expect tool to enter password inside script + # 使用 expect 来在脚本中输入密码 /usr/bin/expect << EOD - #next line set timeout to -1, recommended to use + # 推荐设置超时为 -1 set timeout -1 - #copy via rsync file/dir to destination, using part of expect — spawn command + # 通过 rsync 复制文件/文件夹到目标位置,使用 expect 的组成部分 spawn 命令 spawn rsync -ar ${line} ${desthost}:${destpath} - #as result of previous command we expect “password” promtp + # 上一行命令会等待 “password” 提示 expect "*?assword:*" - #next command enters password from script + # 在脚本中提供密码 send "${password}\r" - #next command tells that we expect end of file (everything finished on remote server) + # 等待文件结束符(远程服务器处理完了所有事情) expect eof - #end of expect pard + # 结束 expect 脚本 EOD - #this line just print done + # 显示结束 echo "DONE" - #end of reading backup file + # 完成 done #### 运行第二个带有输出结果的脚本的屏幕截图 #### @@ -163,7 +164,7 @@ via: http://linoxide.com/linux-shell-script/shell-script-backup-files-directorie 作者:[Yevhen Duma][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fdfe747bb35c0c167d18f4281b00c9ad5913545 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 25 Jun 2015 10:30:07 +0800 Subject: [PATCH 16/76] PUB:20141219 What is good audio editing software on Linux @wwy-hust --- ...is good audio editing software on Linux.md | 67 +++++++++++++++++++ ...is good audio editing software on Linux.md | 67 ------------------- 2 files changed, 67 insertions(+), 67 deletions(-) create mode 100644 published/20141219 What is good audio editing software on Linux.md delete mode 100644 translated/tech/20141219 What is good audio editing software on Linux.md diff --git a/published/20141219 What is good audio editing software on Linux.md b/published/20141219 What is good audio editing software on Linux.md new file mode 100644 index 0000000000..117961919d --- /dev/null +++ b/published/20141219 What is good audio editing software on Linux.md @@ -0,0 +1,67 @@ +Linux下优秀的音频编辑软件 +================================================================================ + +不论您是一个音乐爱好者或只是一个要记录您导师的讲话的学生,您都需要录制音频和编辑音频。长久以来这样的工作都要靠Macintosh,如今那个时代已经过去,现在Linux也可以胜任这些工作了。简而言之,这里有一份不完全的音频编辑器软件列表,适用于不同的任务和需求。 + +### 1. Audacity ### + +![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) + +让我们从我个人最喜欢的软件开始。[Audacity][1]可以运行在Windows、Mac和Linux上。它是开源的,且易于使用。你会觉得:Audacity几乎是完美的。它可以让您在干净的界面上操作音频波形。简单地说,您可以覆盖音轨、剪切和修改音轨、增加特效、执行高级的声音分析,然后将它们导出到一大堆可用的格式。我喜欢它的原因是它将基本的功能和复杂的功能结合在一起并且保持一个简单的学习曲线。然而,它并不是一个完全最优化的软件,尤其是对于音乐家和专业人员。 + +### 2. Jokosher ### + +![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) + +在不同的层次上,[Jokosher][2]更多的聚焦在多音轨方面。它使用Python和GTK+作为前端界面,并使用GStreamer作为音频后端。Jokosher那易用的界面和它的扩展性给我留下了深刻的印象。也许编辑的功能并不是最先进的,但它的提示十分清晰,适合音乐家。例如,我十分喜欢音轨和乐器的组合。简而言之,如果您是一个音乐家,那么它是在您转移到下一个软件前进行实践的好机会。 + +### 3. Ardour ### + +![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) + +接下来谈论一些复杂的工具,[Ardour][3]是一套完整的可以录制、编辑和混音的软件。这个设计吸引了所有的专业人员,Ardour在声音和插件方面超出我的想象。如果您在寻找一头野兽并且不惧怕驯服它,那么Ardour或许是一个不错的选择。再次,它的界面和丰富的文档,尤其是它首次启动时的配置工具都是它迷人魅力的一部分。 + +### 4. Kwave ### + +![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) + +对于所有KDE的热爱者,[KWave][4]绝对符合您对于设计和功能的想象。它有丰富的快捷键以及很多有趣的选项,例如内存管理。尽管很多特效很不错,但我们更应该关注那些用于音频剪切/粘贴的工具。可惜的是它无法与Audacity相比,而更重要的是,它的界面并没有那么吸引我。 + +### 5. Qtractor ### + +![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) + +如果Kwave对您来说过于简单,但基于Qt的程序却有些吸引力,那么对您来说,也许[Qtractor][5]是一个选项。它致力于做一个“对于家庭用户来说足够简单,并且对专业人员来说足够强大的软件。”实际上它功能和选项的数量几乎是压倒性的。我最喜欢的当然是可定制的快捷键。除此之外,Qtractor可能是我最喜欢的一个处理MIDI文件的工具。 + +### 6. LMMS ### + +![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) + +作为Linux多媒体工作室,LMMS的直接目标是音乐制作。如果您之前没有什么经验并且不想浪费太多的时间,那么请去别处吧。LMMS是其中一个复杂但强大的软件,只有少数的人真正的掌握了它。它有太多的功能和特效以至于无法一一列出,但如果我必须找一个,我会说用来模拟Game Boy声音系统的Freeboy插件简直像魔术一样。然后,去看看它那惊人的文档吧。 + +### 7. Traverso ### + +![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) + +最后站在我面前的是Traverso,它支持无限制的音轨计数,并直接整合了CD烧录的功能。另外,它对我来说是介于简单的软件和专业的软件之间的程序。它的界面是KDE样式的,其键盘配置很简单。更有趣的是,Traverso会监视您的系统资源以确定不会超过您的CPU或者硬件的能力。 + +总而言之,能在Linux系统上看到这么多不同的应用程序是一件开心的事。它使得您永远可以找到最适合自己的那一款。虽然我最喜欢的应用是Audacity,但我非常震惊于LMMS和Jokosher的设计。 + +我们有漏掉什么么?您在Linux下使用哪一款软件呢?原因是什么呢?请留言让我们知道。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/good-audio-editing-software-linux.html + +作者:[Adrien Brochard][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://audacity.sourceforge.net/ +[2]:https://launchpad.net/jokosher/ +[3]:http://ardour.org/ +[4]:http://kwave.sourceforge.net/ +[5]:http://qtractor.sourceforge.net/qtractor-index.html \ No newline at end of file diff --git a/translated/tech/20141219 What is good audio editing software on Linux.md b/translated/tech/20141219 What is good audio editing software on Linux.md deleted file mode 100644 index c3f9c76d61..0000000000 --- a/translated/tech/20141219 What is good audio editing software on Linux.md +++ /dev/null @@ -1,67 +0,0 @@ -LinuxƵ༭ -================================================================================ - -һְ߻ֻһҪ¼ʦѧҪ¼Ƶͱ༭ƵĹҪMacintoshǸʱѾȥLinuxҲʤЩˡ֮һݲȫƵ༭бڲͬ - -### 1. Audacity ### - -![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) - -ǴҸϲʼ[Audacity][1]WindowsMacLinuxϡǿԴģʹáãAudacityġڸɾĽϲƵΡ򵥵˵Ը졢к޸졢Чִи߼ȻǵһѿõĸʽϲԭĹܺ͸ӵĹܽһұһ򵥵ѧϰߡȻһȫŻǶּҺרҵ֪ʶˡ - -### 2. Jokosher ### - -![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) - -ڲͬIJϣ[Jokosher][2]ľ۽ڶ췽档ʹPythonGTK+Ϊǰ˽ڣʹGStreamerΪƵˡJokosherƽĽչԸ̵ӡҲ༭ĹܲȽģʮʺּҡ磬ʮϲϡ֮һּңôתƵһǰʵĺûᡣ - -### 3. Ardour ### - -![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) - -̸һЩӵĹߣ[Ardour][3]һĿ¼ơ༭ͻеרҵԱArdourͲ泬ҵѰһͷҰ޲ҲѱôArdourȡһѡٴΣĽӿںḻĵ״ʱù߶һ֡ - -### 4. Kwave ### - -![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) - -KDEȰߣ[KWave][4]Էƺ͹ܵзḻĿݼԼܶȤѡڴܺܶЧܲǸӦùעЩƵ/ճĹߡϧ޷AudacityȣҪǣýӿڲûôҡ - -### 5. Qtractor ### - -![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) - -Kwave˵ڼ򵥣QtijȴЩô˵Ҳ[Qtractor][5]һѡһڼͥû˵㹻򵥣ҶרҵԱ˵㹻ǿʵܺѡѹԵġϲĵȻǿɶƵĿݼ֮⣬QtractorϲһMIDIļĹߡ - -### 6. LMMS ### - -![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) - -ΪLinuxý幤ңLMMSֱĿ֮ǰûʲô鲢Ҳ˷̫ʱ䣬ôȥ𴦰ɡLMMSһӵǿֻ̫ĹܺЧ޷һһгұһһ˵ģGame BoyϵͳFreeboyֱħһȻȥǾ˵ĵɡ - -### 7. Traverso ### - -![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) - -վǰTraverso֧ƵֱCD¼Ĺܡ⣬˵ǽڼ򵥵רҵ֮ijĽKDEʽģúܼ򵥡ȤǣTraversoϵͳԴȷᳬCPUӲ - -֮ܶLinuxϵͳϿô಻ͬӦóһĵ¡ʹԶҵʺԼһȻϲӦAudacityҷdzLMMSJokosherơ - -©ʲôôLinuxʹһأԭʲôأԴ֪ - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/good-audio-editing-software-linux.html - -ߣ[Adrien Brochard][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:http://xmodulo.com/author/adrien -[1]:http://audacity.sourceforge.net/ -[2]:https://launchpad.net/jokosher/ -[3]:http://ardour.org/ -[4]:http://kwave.sourceforge.net/ -[5]:http://qtractor.sourceforge.net/qtractor-index.html \ No newline at end of file From 6dfc6c914eaa8e249995cf283d6f398642384165 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 26 Jun 2015 23:53:18 +0800 Subject: [PATCH 17/76] PUB:20150128 The top 10 rookie open source projects @sevenot --- ... The top 10 rookie open source projects.md | 154 ++++++++++++++++++ ... The top 10 rookie open source projects.md | 153 ----------------- 2 files changed, 154 insertions(+), 153 deletions(-) create mode 100644 published/20150128 The top 10 rookie open source projects.md delete mode 100644 translated/talk/20150128 The top 10 rookie open source projects.md diff --git a/published/20150128 The top 10 rookie open source projects.md b/published/20150128 The top 10 rookie open source projects.md new file mode 100644 index 0000000000..ea9c04ce4f --- /dev/null +++ b/published/20150128 The top 10 rookie open source projects.md @@ -0,0 +1,154 @@ +2015 年度开源项目新秀榜 +================================================================================ +黑鸭(Black Duck)软件公布了一份名叫“年度开源项目新秀”的报告,介绍了由全球开源协会发起的10个最有趣、最活跃的新项目。 + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) + +### 年度开源项目新秀 ### + +每年都有上千新的开源项目问世,但只有少数能够真正的吸引我们的关注。一些项目因为利用了当前比较流行的技术而发展壮大,有一些则真正地开启了一个新的领域。很多开源项目建立的初衷是为了解决一些生产上的问题,还有一些项目则是世界各地志同道合的开发者们共同发起的一个宏伟项目。 + +从2009年起,开源软件管理公司黑鸭便发起了[年度开源项目新秀][1]这一活动,它的评选根据[Open Hub][2]网站(即以前的Ohloh)上的活跃度。今年,我们很荣幸能够报道2015年10大开源项目新秀的得主和2名荣誉奖得主,它们是从上千个开源项目中脱颖而出的。评选采用了加权评分系统,得分标准基于项目的活跃度,交付速度和几个其它因数。 + +开源俨然成为了产业创新的引擎,就拿今年来说,和Docker容器相关的开源项目在全球各地兴起,这也不恰巧反映了企业最感兴趣的技术领域吗?最后,我们接下来介绍的项目,将会让你了解到全球开源项目的开发者们的在思考什么,这很快将会成为一个指引我们发展的领头羊。 + +### 2015年度开源项目新秀: DebOps ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) + +[DebOps][3]收集打包了一套[Ansible][4]方案和规则(Ansible是一种自动化运维工具),可以从1个容器扩展到一个完整的数据中心。它的创始人Maciej Delmanowski将DebOps开源来保证项目长久进行,从而更好的通过外部贡献者的帮助发展下去。 + +DebOps始创于波兰的一个不起眼大学校园里,他们运营自己的数据中心,一切工作都采用手工配置。有时系统崩溃而导致几天的宕机,这时Delmanowski意识到一个配置管理系统是很有必要的。以Debian作为基础开始,DebOps是一组配置一整个数据基础设施的Ansible方案。此项目已经在许多不同的工作环境下实现,而创始者们则打算继续支持和改进这个项目。 + +###2015年度开源项目新秀: Code Combat ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) + +传统的纸笔学习方法已近不能满足技术学科了。然而游戏却有很多人都爱玩,这也就是为什么[CodeCombat][5]的创始人会去开发一款多人协同编程游戏来教人们如何编码。 + +刚开始CodeCombat是一个创业想法,但其创始人决定取而代之创建一个开源项目。此想法在社区传播开来,很快不少贡献者加入到项目中来。项目发起仅仅两个月后,这款游戏就被接纳到Google’s Summer of Code活动中。这款游戏吸引了大量玩家,并被翻译成45种语言。CodeCombat希望成为那些想要一边学习代码同时获得乐趣的同学的风向标。 + +### 2015年度开源项目新秀: Storj ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) + +[Storj][6]是一个点对点的云存储网络,可实现端到端加密,保证用户不用依赖第三方即可传输和共享数据。基于比特币block chain技术和点对点协议,Storj提供安全、私密、加密的云存储。 + +云数据存储的反对者担心成本开销和漏洞攻击。针对这两个担忧,Storj提供了一个私有云存储市场,用户可以通过Storjcoin X(SJCX) 购买交易存储空间。上传到Storj的文件会被粉碎、加密和存储到整个社区。只有文件所有者拥有密钥加密的信息。 + +在2014年举办的Texas Bitcoin Conference Hackathon会议上,去中心化的云存储市场概念首次被提出并证明可行。在第一次赢得黑客马拉松活动后,项目创始人们和领导团队利用开放论坛、Reddit、比特币论坛和社交媒体增长成了一个活跃的社区,如今,它们已成为影响Storj发展方向的一个重要组成部分。 + +### 2015年度开源项目新秀: Neovim ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) + +自1991年出现以来,Vim已经成为数以百万计软件开发人员所钟爱的文本编辑器。 而[Neovim][6]就是它的下一个版本。 + +在过去的23年里,软件开发生态系统经历了无数增长和创新。Neovim创始人Thiago de Arruda认为Vim缺乏当代元素,跟不上时代的发展。在保留Vim的招牌功能的前提下,Neovim团队同样在寻求改进和发展这个最受欢迎的文本编辑器的技术。早期众筹让Thiago de Arruda可以连续6个月时间投入到此项目。他相信Neovim社区会支持这个项目,激励他继续开发Neovim。 + +### 2015年度开源项目新秀: CockroachDB ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) + +前谷歌员工开发了一个开源的大型企业数据存储项目[CockroachDB][8],它是一个可扩展的、跨地域复制且支持事务的数据存储的解决方案。 + +为了保证在线的百万兆字节流量业务的质量,Google开发了Spanner系统,这是一个可扩展的,稳定的,支持事务的系统。许多参与开发CockroachDB的团队现在都服务于开源社区。就像真正的蟑螂(cockroach)一样,CockroachDB可以在没有数据头、任意节点失效的情况下正常运行。这个开源项目有很多富有经验的贡献者,创始人们通过社交媒体、Github、网络、会议和聚会结识他们并鼓励他们参与其中。 + +### 2015年度开源项目新秀: Kubernetes ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) + +在将容器化软件到引入开源社区发展时,[Docker][9]是一匹黑马,它创新了一套技术和工具。去年6月谷歌推出了[Kubernetes][10],这是一款开源的容器管理工具,用来加快开发和简化操作。 + +谷歌在它的内部运营上使用容器技术多年了。在2014年夏天的DockerCon上大会上,谷歌这个互联网巨头开源了Kubernetes,Kubernetes的开发是为了满足迅速增长的Docker生态系统的需要。通过和其它的组织、项目合作,比如Red Hat和CoreOS,Kubernetes项目的管理者们推动它登上了Docker Hub的工具下载榜榜首。Kubernetes的开发团队希望扩大这个项目,发展它的社区,这样的话软件开发者就能花更少的时间在管理基础设施上,而更多的去开发他们自己的APP。 + +### 2015年度开源项目新秀: Open Bazaar ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) + +OpenBazaar是一个使用比特币与其他人交易的去中心化的市场。OpenBazaar这一概念最早在编程马拉松(hackathon)活动中被提出,它的创始人结合了BitTorent、比特币和传统的金融服务方式,创造了一个不受审查的交易平台。OpenBazaar的开发团队在寻求新的成员,而且不久以后他们将极度扩大Open Bazaar社区。Open Bazaar的核心是透明度,其创始人和贡献者的共同目标是在商务交易中掀起一场革命,让他们向着一个真实的、一个无控制的,去中心化的市场奋进。 + +### 2015年度开源项目新秀: IPFS ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) + +IPFS 是一个面向全球的、点对点的分布式版本文件系统。它综合了Git,BitTorrent,HTTP的思想,开启了一个新的数据和数据结构传输协议。 + +人们所知的开源,它的本意用简单的方法解决复杂的问题,这样产生许多新颖的想法,但是那些强大的项目仅仅是开源社区的冰山一角。IFPS有一个非常激进的团队,这个概念的提出是大胆的,令人惊讶的,有点甚至高不可攀。看起来,一个点对点的分布式文件系统是在寻求将所有的计算设备连在一起。这个可能的 HTTP 替换品通过多种渠道维护着一个社区,包括Git社区和超过100名贡献者的IRC。这个疯狂的想法将在2015年进行软件内部测试。 + +### 2015年度开源项目新秀: cAdvisor ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) + +[cAdvisor (Container Advisor)][13] 是一个针对在运行中的容器进行收集,统计,处理和输出信息的工具,它可以给容器的使用者提供资源的使用情况和工作特性。对于每一个容器,cAdvisor记录着资源的隔离参数,资源使用历史,资源使用历史对比框图,网络状态。这些从容器输出的数据跨越主机传递。 + +cAdvisor可以在绝大多数的Linux发行版上运行,并且支持包括Docker在内的多种容器类型。事实上它成为了一种容器的代理,并被集成在了很多系统中。cAdvisor在DockerHub下载量也是位居前茅。cAdvisor的开发团队希望把cAdvisor改进到能够更深入地理解应用性能,并且集成到集群系统。 + +### 2015年度开源项目新秀: Terraform ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) + +[Terraform][14]提供了一些常见设置来创建一个基础设施,从物理机到虚拟机,以及email服务器、DNS服务器等。这个想法包括从家庭个人机解决方案到公共云平台提供的服务。一旦建立好了以后,Terraform可以让运维人员安全又高效地改变你的基础设施,就如同配置一样。 + +Terraform.io的创始者工作在一个Devops模式的公司,他找到了一个窍门把建立一个完整的数据中心所需的知识结合在一起,可以从添加服务器到支持网络服务的功能齐备的数据中心。基础设施的描述采用高级的配置语法,允许你把数据中心的蓝图按版本管理,并且转换成多种代码。著名开源公司HashiCorp赞助开发这个项目。 + +### 荣誉奖: Docker Fig ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) + +[Fig][15]为[Docker][16]的使用提供了一个快速的,分离的开发环境。Docker的移植只需要将配置信息放到一个简单的 fig.yml文件里。它会处理所有工作,包括构建、运行,端口转发,分享磁盘和容器链接。 + +Orchard去年发起了Fig,来创造一个使Docker工作起来的系统工具。它的开发像是为Docker设置开发环境,为了确保用户能够为他们的APP准确定义环境,在Docker中会运行数据库和缓存。Fig解决了开发者的一个难题。Docker全面支持这个开源项目,最近[将买下][17]Orchard来扩张这个项目。 + +### 荣誉奖: Drone ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) + +[Drone][18]是一个基于Docker的持续集成平台,而且它是用Go语言写的。Drone项目不满于现存的设置开发环境的技术和流程。 + +Drone提供了一个简单的自动测试和持续交付的方法:简单选择一个Docker镜像来满足你的需求,连接并提交至GitHub即可。Drone使用Docker容器来提供隔离的测试环境,让每个项目完全自主控制它的环境,没有传统的服务器管理的负担。Drone背后的100位社区贡献者强烈希望把这个项目带到企业和移动应用程序开发中。 + +### 开源新秀 ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) + +参见: + +- [InfoWorld2015年年度技术奖][21] +- [Bossies: 开源软件最高荣誉][22] + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html + +作者:[Black Duck Software][a] +译者:[sevenot](https://github.com/sevenot) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Black-Duck-Software/ +[1]:https://www.blackducksoftware.com/open-source-rookies +[2]:https://www.openhub.net/ +[3]:https://github.com/debops/debops +[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html +[5]:https://codecombat.com/ +[6]:http://storj.io/ +[7]:http://neovim.org/ +[8]:https://github.com/cockroachdb/cockroach +[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[10]:http://kubernetes.io/ +[11]:https://openbazaar.org/ +[12]:http://ipfs.io/ +[13]:https://github.com/google/cadvisor +[14]:https://www.terraform.io/ +[15]:http://www.fig.sh/ +[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html +[18]:https://drone.io/ +[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html +[20]:https://www.blackducksoftware.com/open-source-rookies +[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html +[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html +[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html + diff --git a/translated/talk/20150128 The top 10 rookie open source projects.md b/translated/talk/20150128 The top 10 rookie open source projects.md deleted file mode 100644 index c642786914..0000000000 --- a/translated/talk/20150128 The top 10 rookie open source projects.md +++ /dev/null @@ -1,153 +0,0 @@ -sevenot translated -排名前十的年度开源项目新秀 -================================================================================ -黑鸭(Black Duck)软件公布了一份名叫“年度开源项目新秀”的报告,介绍了由全球开源协会发起的10个最有趣、最活跃的新项目。 - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) - -### 年度开源项目新秀 ### - -每年都有上千新的开源项目问世,但只有少数能够真正的吸引我们的关注。一些项目因为利用了当前比较流行的技术而发展壮大,有一些则真正地开启了一个新的邻域。很多开源项目建立的初衷是为了解决一些生产上的问题,还有一些项目则是世界各地志同道合的开发者们共同发起的一个宏伟项目。 - -从2009年起,开源软件公司黑鸭便发起了[年度开源项目新秀][1]这一活动,它的评选根据[Open Hub][2] 网站(即以前的Ohloh)。今年,我们很荣幸能够报道2015年10大开源项目新秀的得主和2名荣誉奖得主,它们是从上千个开源项目中脱颖而出的。评选采用了加权评分系统,得分标准基于项目的活跃度,交付速度,和几个其它因数。 - -开源俨然成为了产业创新的引擎,就拿今年来说,和Docker容器相关的开源项目在全球各地新起,这也不恰巧反映了企业最感兴趣的技术邻域吗?最后,我们接下来介绍的项目,将会让你了解到全球开源项目的开发者们的在思考什么,这很快将会成为一个指引我们发展的领头羊。 - -### 2015年度开源项目新秀: DebOps ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) - -[DebOps][3]收集打包了一套[Ansible][4] (Ansible是一种自动化运维工具)方案和规则,可以从1个容器扩展到一个完整的数据中心。它的创始人Maciej Delmanowski将DebOps开源来保证项目长久进行,从而更好的利用外部贡献者来发展下去 - -DebOps始创于波兰的一个不起眼大学校园里,在自己的数据中心上运行,一切都是手工配置的。有时系统崩溃而导致几天的宕机,这时Delmanowski意识到一个配置管理系统是很有必要的。从Debian的基础做起,DebOps是一组配置一整个数据基础设施Ansible方案。此项目已经在许多不同的工作环境下实现,而创始者们则打算继续支持和开发这个项目。 - -###2015年度开源项目新秀: Code Combat ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) - -传统的纸笔学习方法已近不能满足技术学科了。然而游戏都是关于参与者,这也就是为什么[CodeCombat][5] 的创始人会去开发一款多人协同编程游戏来教人们如何编码。 - -刚开始CodeCombat是一个创业想法,但其创始人决定创建一个开源项目将其取代。此想法在社区传播开来,很快不少贡献者加入到项目中来。项目发起仅仅两个月后,这款游戏就被收入Google’s Summer of Code。这款游戏吸引了大量玩家,并被翻译成45种语言。CodeCombat希望成为那些想要一边学习代码同时获得乐趣的同学的风向标。 - -### 2015年度开源项目新秀: Storj ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) - -[Storj][6]是一个点对点的云存储网络,可实现端到端加密,保证用户不用依赖第三方即可传输、共享数据。基于比特币block chain技术和点对点协议,Storj提供安全、私密、加密的云存储。 - -云数据存储的反对者担心成本开销和漏洞攻击。为了做到没有死角,Storj是一个私有云存储市场,用户可以通过Storjcoin X(SJCX) 购买交易存储空间。上传到Storj的文件会被粉碎、加密和存储到整个社区。只有文件所有者拥有密钥加密的信息 - -在2014年举办的Texas Bitcoin Conference Hackathon会议上,云存储市场概念首次被提出并证明可行。在第一次赢得黑客马拉松活动后,项目创始人们和领导团队利用开源论坛Reddit、比特币论坛和社交媒体推广此项目。如今,它们已成为Storj决策过程的一个重要组成部分。 - -### 2015年度开源项目新秀: Neovim ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) - -自1991年提出概念以来,Vim已经成为数以百万计软件开发人员所钟爱的文本编辑器。 [Neovim][6] 是它的下一个版本。 - -  在过去的23年里,软件开发生态系统经历了无数增长和创新。Neovim创始人Thiago de Arruda知道Vim缺少当代元素,跟不上时代的发展。在保留Vim的签名功能的前提下,Neovim团队同样在寻求最受欢迎的文本编辑器改善和发展技术。集资初期,Thiago de Arruda连续6个月时间关注推出此项目。他相信他的团队和支持他激励他继续发展Neovim。 - -### 2015年度开源项目新秀: CockroachDB ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) - -前谷歌员工开发了一个开源的企业数据存储项目[CockroachDB][8],它是一个可扩展的、跨地域复制且支持事务的数据存储的解决方案。 - -为了保证在线百万兆字节流量业务的质量,Google公开了他们的Spanner系统,这是一个可扩展的,稳定的,支持事务的系统。许多参与开发CockroachDB的团队现在都服务与开源社区。就像真正的蟑螂一样,CockroachDB可以在没有数据头、没有任何节点的情况下正常运行。这个开源项目有很多富有经验的贡献者,创始人们通过社会媒体、Github、网络、会议和聚会结识他们并鼓励他们参与其中。 - -### 2015年度开源项目新秀: Kubernetes ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) - -在介绍集装箱化的软件对开源社区的发展时,[Docker][9]是一匹黑马,它在技术和工具的设置上做了创新。去年6月谷歌推出了[Kubernetes][10],这是一款开源的容器管理工具,用来加快开发和简化操作。 - -谷歌在它的网络系统上使用容器技术多年了。在2014年夏天的DockerCon上大会上,谷歌这个互联网巨头开源了Kubernetes,Kubernetes的开发是为了满足迅速增长的Docker生态系统的需要。通过和其它的组织、项目合作,比如 Red Hat和CoreOS,Kubernetes的管理者们促使它登上了Docker Hub的工具下载榜榜首。Kubernetes的开发团队希望扩大这个项目,发展它的社区,这样的话软件开发者就能花更少的时间在管理基础设施上,而更多的去开发他们自己的APP。 - -### 2015年度开源项目新秀: Open Bazaar ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) - -OpenBazaar是一个使用比特币和其他人交易的市场。OpenBazaar这一概念最早在编程马拉松(hackathon)活动中被提出,它的创始人结合了BitTorent,比特币和传统的金融服务方式,创造了一个不受审查的交易平台。OpenBazaar的开发团队在寻求新的成员,而且不久以后他们将无限扩大Open Bazaar的社区。Open Bazaar旨在透明度和同一个目标去在商务交易中掀起一场革命,这会帮助创始人和贡献者向着一个真实的世界奋斗,一个没有控制,分散的市场。 - -### 2015年度开源项目新秀: IPFS ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) - -IPFS 是一个全球的点对点式的分布式版本文件系统。它综合了Git,BitTorrent,HTTP的思想,开启了一个新的数据和数据结构传输协议。 - -开源被人们所知晓的原因,是它本意用简单的方法解决复杂的问题,这样产生许多新颖的想法,但是着些强大的项目仅仅是开源社区的冰山一角。IFPS有一个积极的团队,这个概念的提出是大胆的,令人惊讶的,有点甚至高不可攀。这样来看,一个点对点的分布是文件系统是在寻找所有连在一起的计算设备。也许HTTP的更换可以靠着通过多种手段继续保持一个社区,包括Git社区和超过100名贡献者的IRC。这个疯狂的想法将在2015年进行软件内部测试。 - -### 2015年度开源项目新秀: cAdvisor ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) - -[cAdvisor (Container Advisor)][13] 是一个针对在运行中的容器进行收集,合计,处理和输出信息的工具,它可以给容器的使用者提供资源的使用情况和工作特性。对于每一个容器,cAdvisor记录着资源的分离参数,资源使用历史,资源使用历史对比框图,网络状态。这些从容器输出的数据在机器中传递。 - -cAdvisor可以在绝大多数的Linux上运行,并且支持包括Docker在内的多种容器类型。事实上它成为了一种容器的代理,并被集成在了很多系统中。cAdvisor在DockerHub下载量也是位居前茅。cAdvisor的开发团队希望把cAdvisor发展到能够更深入地理解应用并且集成到集群系统。 - -### 2015年度开源项目新秀: Terraform ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) - -[Terraform][14]提供了一些列的设置来创建一个基础设施,从物理机到虚拟机再到email服务器、DNS服务器。这个概念包括从家庭个人机解决方案到公共云平台提供的服务。一旦建立好了以后,Terraform便进行一系列的操作来改变你的基础设施,安全又高效,就如同配置一样。 - -如果你在Devops模式下的公司里工作,Terraform.io的创始者找到了一个窍门把建立一个完整的数据中心所需的知识结合在一起,从插入服务器到整个网络和功能齐备的数据中心。基础设施的描述采用高级的配置语法,允许你把数据中心的蓝图做成多版本并且可以使用多种代码。著名开源公司HashiCorp赞助开发这个项目。 - -### 荣誉奖: Docker Fig ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) - -[Fig][15] 为[Docker][16]的使用提供了一个快速的,分离的开发环境。Docker的移植只需要将配置信息放到一个简单的 fig.yml文件里。它会处理所有工作,包括建立、运行,端口转发,分享磁盘和容器链接。 - Fig solved a major pain point for developers. Docker fully supports this open source project and [recently purchased Orchard][17] to expand the reach of Fig. -Orchard去年发起了Fig,来创造一个使Docker工作的系统工具。它的开发像是为Docker设置开发环境,为了确保用户能够为他们的APP准确定义环境,在Docker中会运行数据库和缓存。Fig解决了开发者的一个难题。Docker全面支持这个开源项目,最近将买下Orchard来扩张这个项目。 - -### 荣誉奖: Drone ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) - -[Drone][18]是一个基于Docker的持续集成平台,而且它是用Go语言写的。Drone项目不满于现存的技术和流程,它旨在开发环境。 - -Drone提供了一个简单的自动测试和持续交付的方法:简单选择一个Docker形象来满足你的需求,连接并提交至GitHub即可。Drone使用Docker容器来提供隔离的测试环境,让每个项目完全自主控制堆栈,没有传统的服务器管理的负担。Drone背后的100位社区贡献者强烈希望把这个项目带到企业和移动应用程序开发中 -### 开源新秀 ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) - -- [2014年度开源项目新秀][20] -- [InfoWorld2015年年度技术奖][21] -- [Bossies: 开源软件最高荣誉][22] -- [ Windows管理员15个必不可少的开源工具][23] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html - -作者:[Black Duck Software][a] -译者:[sevenot](https://github.com/sevenot) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Black-Duck-Software/ -[1]:https://www.blackducksoftware.com/open-source-rookies -[2]:https://www.openhub.net/ -[3]:https://github.com/debops/debops -[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html -[5]:https://codecombat.com/ -[6]:http://storj.io/ -[7]:http://neovim.org/ -[8]:https://github.com/cockroachdb/cockroach -[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker -[10]:http://kubernetes.io/ -[11]:https://openbazaar.org/ -[12]:http://ipfs.io/ -[13]:https://github.com/google/cadvisor -[14]:https://www.terraform.io/ -[15]:http://www.fig.sh/ -[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker -[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html -[18]:https://drone.io/ -[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html -[20]:https://www.blackducksoftware.com/open-source-rookies -[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html -[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html -[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html From 7d814a9c1b22b12f7280dec61dc726d13f647a5b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 15:18:15 +0800 Subject: [PATCH 18/76] PUB:20150617 The Art of Command Line @GOLinux --- published/20150617 The Art of Command Line.md | 433 ++++++++++++++++++ .../tech/20150617 The Art of Command Line.md | 431 ----------------- 2 files changed, 433 insertions(+), 431 deletions(-) create mode 100644 published/20150617 The Art of Command Line.md delete mode 100644 translated/tech/20150617 The Art of Command Line.md diff --git a/published/20150617 The Art of Command Line.md b/published/20150617 The Art of Command Line.md new file mode 100644 index 0000000000..8a4d9a0d98 --- /dev/null +++ b/published/20150617 The Art of Command Line.md @@ -0,0 +1,433 @@ +命令行艺术 +================================================================================ + +![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/raw/master/cowsay.png) + + +流畅地使用命令行是一个常被忽略的技能,或被认为是神秘的奥义。但是,它会以明显而微妙的方式改善你作为工程师的灵活度和生产力。这是我在 Linux 上工作时发现的有用的命令行使用小窍门和笔记的精粹。有些小窍门是很基础的,而有些是相当地特别、复杂、或者晦涩难懂。这篇文章不长,但是如果你可以使用并记得这里的所有内容,那么你就懂得很多了。 + +其中大部分[最初](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands)[出现](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix)在[Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know)上,但是考虑到兴趣所在,似乎更应该放到 Github 上,这里的人比我更能提出改进建议。如果你看到一个错误,或者更好的某种东西,请提交问题或 PR!(当然,提交前请看看必读小节和已有的 PR/Issue。) + +## 必读 + +范围: + +- 本文是针对初学者和专业人员的,选题目标是覆盖面广(全都很重要)、有针对性(大多数情况下都给出具体实例)而简洁(避免不必要内容以及你能在其它地方轻松找到的离题的内容)。每个小窍门在某种情形下都很必需的,或者能比替代品大大节省时间。 +- 这是为 Linux 写的。绝大部分条目都可以同样应用到 MacOS(或者甚至 Cygwin)。 +- 主要针对交互式 Bash,尽管大多数小窍门也可以应用到其它 shell,以及常规 Bash 脚本。 +- 包括了“标准的”UNIX 命令以及那些需要安装的软件包(它们很重要,值得安装)。 + +注意: + +- 为了能在一篇文章内展示尽量多的东西,一些具体的信息会被放到引用页里。你可以使用 Google 来获得进一步的内容。(如果需要的话,)你可以使用 `apt-get`/`yum`/`dnf`/`pacman`/`pip`/`brew` 来安装这些新的程序。 +- 使用 [Explainshell][1] 来获取命令、参数、管道等内容的解释。 + +## 基础 + +- 学习基本 Bash 技能。实际上,键入`man bash`,然后至少浏览一遍所有内容;它很容易理解,没那么长。其它 shell 也不错,但是 Bash 很强大,而且到处都可以找到(如果在你自己的笔记本上*只*学习 zsh、fish 之类,会在很多情形下受到限制,比如使用现存的服务器时)。 + +- 至少学好一种基于文本的编辑器。理想的一个是 Vim(`vi`),因为在终端中编辑时随时都能找到它(即使大多数时候你在使用 Emacs、一个大型的 IDE、或一个现代的时髦编辑器)。 + +- 学习怎样使用 `man` 来阅读文档(好奇的话,用 `man man` 来列出分区号,比如 1 是常规命令,5 是文件描述,8 用于管理员)。用 `apropos` 找到帮助页。了解哪些命令不是可执行程序,而是 Bash 内置的,你可以用 `help` 和 `help -d` 得到帮助。 + +- 学习使用 `>` 和 `<` 来进行输出和输入重定向,以及使用 `|` 来管道重定向,学习关于 stdout 和 stderr 的东西。 + +- 学习 `*`(也许还有 `?` 和 `{`...`}` )文件通配扩展和应用,以及双引号 `"` 和单引号 `'` 之间的区别。(更多内容请参看下面关于变量扩展部分)。 + +- 熟悉 Bash 作业管理:`&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill` 等等。 + +- 掌握`ssh`,以及通过 `ssh-agent`,`ssh-add` 等进行无密码验证的基础技能。 + +- 基本的文件管理:`ls` 和 `ls -l`(特别是,知道`ls -l`各个列的意义),`less`, `head`, `tail` 和 `tail -f`(或者更好的`less +F`),`ln` 和 `ln -s`(知道硬链接和软链接的区别,以及硬链接相对于软链接的优势),`chown`,`chmod`,`du`(用于查看磁盘使用率的快速摘要:`du -sk *`)。文件系统管理:`df`, `mount`,`fdisk`,`mkfs`,`lsblk`。 + +- 基本的网络管理: `ip` 或 `ifconfig`,`dig`。 + +- 熟知正则表达式,以及各种使用`grep`/`egrep`的选项。`-i`,`-o`,`-A` 和 `-B` 选项值得掌握。 + +- 学会使用 `apt-get`,`yum` ,`dnf` 或 `pacman`(这取决于你的发行版)来查找并安装软件包。确保你可以用 `pip` 来安装基于 Python 的命令行工具(下面的一些东西可以很容易地通过 `pip` 安装)。 + + +## 日常使用 + +- 在Bash中,使用 **tab** 补完参数,使用 **ctrl-r** 来搜索命令历史。 + +- 在Bash中,使用 **ctrl-w** 来删除最后的单词,使用 **ctrl-u** 来删除整行,返回行首。使用 **alt-b** 和 **alt-f** 来逐词移动,使用 **ctrl-k** 来清除到行尾的内容,以及使用 **ctrl-l** 清屏。参见 `man readline` 来查看 Bash 中所有默认的键盘绑定,有很多。例如,**alt-.** 可以循环显示先前的参数,而**alt-** 扩展通配。(LCTT 译注:关于 Bash 下的快捷键,可以参阅: https://linux.cn/article-5660-1.html ) + +- 另外,如果你喜欢 vi 风格的键盘绑定,可以使用 `set -o vi`。 + +- 要查看最近用过的命令,请使用 `history` 。 有许多缩写形式,比如 `!$`(上次的参数)和`!!`(上次的命令),虽然使用 `ctrl-r` 和 `alt-.` 更容易些。(LCTT 译注:关于历史扩展功能,可以参阅: https://linux.cn/article-5658-1.html ) + +- 返回先前的工作目录: `cd -` + +- 如果你命令输入到一半,但是改变主意了,可以敲 **alt-#** 来添加一个 `#` 到开头,然后将该命令作为注释输入(或者使用快捷键 **ctrl-a**, **#**,**enter** 输入)。然后,你可以在后面通过命令历史来回到该命令。 + +- 使用 `xargs`(或 `parallel`),它很强大。注意,你可以控制每行(`-L`)执行多少个项目,以及并行执行(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用 `xargs echo`。同时,使用 `-I{}` 也很方便。样例: +```bash + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- `pstree -p` 对于显示进程树很有帮助。 + +- 使用 `pgrep` 和 `pkill` 来按名称查找进程或给指定名称的进程发送信号(`-f` 很有帮助)。 + +- 掌握各种可以发送给进程的信号。例如,要挂起进程,可以使用 `kill -STOP [pid]`。完整的列表可以查阅 `man 7 signal`。 + +- 如果你想要一个后台进程一直保持运行,使用 `nohup` 或 `disown`。 + +- 通过 `netstat -lntp` 或 `ss -plat` 检查哪些进程在监听(用于 TCP,对 UDP 使用 `-u` 替代 `-t`)。 + +- `lsof`来查看打开的套接字和文件。 + +- 在 Bash 脚本中,使用 `set -x` 调试脚本输出。尽可能使用严格模式。使用 `set -e` 在遇到错误时退出。也可以使用 `set -o pipefail`,对错误进行严格处理(虽然该话题有点微妙)。对于更复杂的脚本,也可以使用 `trap`。 + +- 在 Bash 脚本中,子 shell(写在括号中的)是组合命令的便利的方式。一个常见的例子是临时移动到一个不同的工作目录,如: +```bash + # 在当前目录做些事 + (cd /some/other/dir; other-command) + # 继续回到原目录 +``` + +- 注意,在 Bash 中有大量的各种各样的变量扩展。检查一个变量是否存在:`${name:?error message}`。例如,如果一个Bash脚本要求一个单一参数,只需写 `input_file=${1:?usage: $0 input_file}`。算术扩展:`i=$(( (i + 1) % 5 ))`。序列: `{1..10}`。修剪字符串:`${var%suffix}` 和 `${var#prefix}`。例如,if `var=foo.pdf` ,那么 `echo ${var%.pdf}.txt` 会输出 `foo.txt`。 + +- 命令的输出可以通过 `<(some command)` 作为一个文件来处理。例如,将本地的 `/etc/hosts` 和远程的比较: +```sh + diff /etc/hosts <(ssh somehost cat /etc/hosts) +``` + +- 了解 Bash 中的“嵌入文档”,就像在 `cat <logfile 2>&1` 同时重定向标准输出和标准错误。通常,要确保某个命令不再为标准输入打开文件句柄,而是将它捆绑到你所在的终端,添加 ` foo: + rename 's/\.bak$//' *.bak + # 文件和目录的全名 foo -> bar: + repren --full --preserve-case --from foo --to bar . +``` + +- 使用 `shuf` 来从某个文件中打乱或随机选择行。 + +- 了解 `sort` 的选项。知道这些键是怎么工作的(`-t`和`-k`)。特别是,注意你需要写`-k1,1`来只通过第一个字段排序;`-k1`意味着根据整行排序。 + +- 稳定排序(`sort -s`)会很有用。例如,要首先按字段2排序,然后再按字段1排序,你可以使用 `sort -k1,1 | sort -s -k2,2` + +- 如果你曾经需要在 Bash 命令行中写一个水平制表符(如,用于 -t 参数的排序),按**ctrl-v** **[Tab]**,或者写`$'\t'`(后面的更好,因为你可以复制/粘贴)。 + +- 对源代码进行补丁的标准工具是 `diff` 和 `patch`。 用 `diffstat` 来统计 diff 情况。注意 `diff -r` 可以用于整个目录,所以可以用 `diff -r tree1 tree2 | diffstat` 来统计(两个目录的)差异。 + +- 对于二进制文件,使用 `hd` 进行简单十六进制转储,以及 `bvi` 用于二进制编辑。 + +- 还是用于二进制文件,`strings`(加上 `grep` 等)可以让你找出一点文本。 + +- 对于二进制文件的差异(delta 压缩),可以使用 `xdelta3`。 + +- 要转换文本编码,试试 `iconv` 吧,或者对于更高级的用途使用 `uconv`;它支持一些高级的 Unicode 的东西。例如,这个命令可以转换为小写并移除所有重音符号(通过扩展和丢弃): +```sh + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt +``` + +- 要将文件分割成几个部分,来看看 `split`(按大小分割)和 `csplit`(按格式分割)吧。 + +- 使用 `zless`,`zmore`,`zcat` 和 `zgrep` 来操作压缩文件。 + +## 系统调试 + +- 对于 Web 调试,`curl` 和 `curl -I` 很方便灵活,或者也可以使用它们的同行 `wget`,或者更现代的 [`httpie`](https://github.com/jakubroztocil/httpie)。 + +- 要了解磁盘、CPU、网络的状态,使用 `iostat`,`netstat`,`top`(或更好的 `htop`)和(特别是)`dstat`。它们对于快速获知系统中发生的状况很好用。 + +- 对于更深层次的系统总览,可以使用 [`glances`](https://github.com/nicolargo/glances)。它会在一个终端窗口中为你呈现几个系统层次的统计数据,对于快速检查各个子系统很有帮助。 + +- 要了解内存状态,可以运行 `free` 和 `vmstat`,看懂它们的输出结果吧。特别是,要知道“cached”值是Linux内核为文件缓存所占有的内存,因此,要有效地统计“free”值。 + +- Java 系统调试是一件截然不同的事,但是对于 Oracle 系统以及其它一些 JVM 而言,不过是一个简单的小把戏,你可以运行 `kill -3 `,然后一个完整的堆栈追踪和内存堆的摘要(包括常规的垃圾收集细节,这很有用)将被转储到stderr/logs。 + +- 使用 `mtr` 作路由追踪更好,可以识别网络问题。 + +- 对于查看磁盘满载的原因,`ncdu` 会比常规命令如 `du -sh *` 更节省时间。 + +- 要查找占用带宽的套接字和进程,试试 `iftop` 或 `nethogs` 吧。 + +- (Apache附带的)`ab`工具对于临时应急检查网络服务器性能很有帮助。对于更复杂的负载测试,可以试试 `siege`。 + +- 对于更仔细的网络调试,可以用 `wireshark`,`tshark` 或 `ngrep`。 + +- 掌握 `strace` 和 `ltrace`。如果某个程序失败、挂起或崩溃,而你又不知道原因,或者如果你想要获得性能的大概信息,这些工具会很有帮助。注意,分析选项(`-c`)和使用 `-p` 关联运行进程。 + +- 掌握 `ldd` 来查看共享库等。 + +- 知道如何使用 `gdb` 来连接到一个运行着的进程并获取其堆栈追踪信息。 + +- 使用 `/proc`。当调试当前的问题时,它有时候出奇地有帮助。样例:`/proc/cpuinfo`,`/proc/xxx/cwd`,`/proc/xxx/exe`,`/proc/xxx/fd/`,`/proc/xxx/smaps`。 + +- 当调试过去某个东西为何出错时,`sar` 会非常有帮助。它显示了 CPU、内存、网络等的历史统计数据。 + +- 对于更深层的系统和性能分析,看看 `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)),[`perf`](http://en.wikipedia.org/wiki/Perf_(Linux)) 和 [`sysdig`](https://github.com/draios/sysdig) 吧。 + +- 确认是正在使用的 Linux 发行版版本(支持大多数发行版):`lsb_release -a`。 + +- 每当某个东西的行为异常时(可能是硬件或者驱动器问题),使用`dmesg`。 + +## 单行程序 + +这是将命令连成一行的一些样例: + +- 有时候通过 `sort`/`uniq` 对文本文件做交集、并集和差集运算时,这个例子会相当有帮助。假定 `a` 和 `b` 是已经进行了唯一性处理的文本文件。这会很快,而且可以处理任意大小的文件,总计可达数千兆字节。(Sort不受内存限制,不过如果 `/tmp` 放在一个很小的根分区的话,你可能需要使用 `-T` 选项。)也可参见上面关于`LC_ALL`的注解和 `-u` 选项(参见下面例子更清晰)。 + + ```bash + cat a b | sort | uniq > c # c 是 a 和 b 的并集 + cat a b | sort | uniq -d > c # c 是 a 和 b 的交集 + cat a b b | sort | uniq -u > c # c 是 a 减去 b 的差集 +``` +- 使用 `grep . *` 来可视化查看一个目录中的所有文件的所有内容,例如,对于放满配置文件的目录: `/sys`, `/proc`, `/etc`。 + +- 对某个文本文件的第三列中所有数据进行求和(该例子可能比同等功能的Python要快3倍,而且代码也少于其3倍): +```sh + awk '{ x += $3 } END { print x }' myfile +``` + +- 如果想要查看某个文件树的大小/日期,该例子就像一个递归`ls -l`,但是比`ls -lR`要更容易读懂: +```sh + find . -type f -ls +``` + +- 只要可以,请使用 `xargs` 或 `parallel`。注意,你可以控制每行(`-L`)执行多少个项目,以及并行执行(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用 `xargs echo`。同时,使用 `-I{}` 也很方便。样例: +```sh + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- 比如说,你有一个文本文件,如 Web 服务器的日志,在某些行中出现了某个特定的值,如 URL 中出现的 `acct_id` 参数。如果你想要统计有多少个 `acct_id` 的请求: +```sh + cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn +``` + +- 运行该函数来获得来自本文的随机提示(解析Markdown并从中提取某个项目): +```sh + function taocl() { + curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | + pandoc -f markdown -t html | + xmlstarlet fo --html --dropdtd | + xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | + xmlstarlet unesc | fmt -80 + } +``` + + +## 晦涩难懂,但却有用 + +- `expr`:实施算术或布林操作,或者求正则表达式的值 + +- `m4`:简单的宏处理器 + +- `yes`:大量打印一个字符串 + +- `cal`:漂亮的日历 + +- `env`:(以特定的环境变量设置)运行一个命令(脚本中很有用) + +- `look`:查找以某个字符串开头的英文单词(或文件中的行) + +- `cut ` 和 `paste` 以及 `join`:数据处理 + +- `fmt`:格式化文本段落 + +- `pr`:格式化文本为页/列 + +- `fold`:文本折行 + +- `column`:格式化文本为列或表 + +- `expand` 和 `unexpand`:在制表符和空格间转换 + +- `nl`:添加行号 + +- `seq`:打印数字 + +- `bc`:计算器 + +- `factor`:分解质因子 + +- `gpg`:加密并为文件签名 + +- `toe`:terminfo 条目表 + +- `nc`:网络调试和数据传输 + +- `socat`:套接字中继和 tcp 端口转发(类似 `netcat`) + +- `slurm`:网络流量可视化 + +- `dd`:在文件或设备间移动数据 + +- `file`:识别文件类型 + +- `tree`:以树形显示目录及子目录;类似 `ls`,但是是递归的。 + +- `stat`:文件信息 + +- `tac`:逆序打印文件 + +- `shuf`:从文件中随机选择行 + +- `comm`:逐行对比分类排序的文件 + +- `hd`和`bvi`:转储或编辑二进制文件 + +- `strings`:从二进制文件提取文本 + +- `tr`:字符转译或处理 + +- `iconv `或`uconv`:文本编码转换 + +- `split `和`csplit`:分割文件 + +- `units`:单位转换和计算;将每双周(fortnigh)一浪(浪,furlong,长度单位,约201米)转换为每瞬(blink)一缇(缇,twip,一种和屏幕无关的长度单位)(参见: /usr/share/units/definitions.units)(LCTT 译注:这都是神马单位啊!) + +- `7z`:高比率文件压缩 + +- `ldd`:动态库信息 + +- `nm`:目标文件的符号 + +- `ab`:Web 服务器基准测试 + +- `strace`:系统调用调试 + +- `mtr`:用于网络调试的更好的路由追踪软件 + +- `cssh`:可视化并发 shell + +- `rsync`:通过 SSH 同步文件和文件夹 + +- `wireshark` 和 `tshark`:抓包和网络调试 + +- `ngrep`:从网络层摘取信息 + +- `host` 和 `dig`:DNS查询 + +- `lsof`:处理文件描述符和套接字信息 + +- `dstat`:有用的系统统计数据 + +- [`glances`](https://github.com/nicolargo/glances):高级,多个子系统概览 + +- `iostat`:CPU和磁盘使用率统计 + +- `htop`:top的改进版 + +- `last`:登录历史 + +- `w`:谁登录进来了 + +- `id`:用户/组身份信息 + +- `sar`:历史系统统计数据 + +- `iftop`或`nethogs`:按套接口或进程的网络使用率 + +- `ss`:套接口统计数据 + +- `dmesg`:启动和系统错误信息 + +- `hdparm`:SATA/ATA 磁盘操作/改善性能 + +- `lsb_release`:Linux 发行版信息 + +- `lsblk`:列出块设备,以树形展示你的磁盘和分区 + +- `lshw`:硬件信息 + +- `fortune`,`ddate` 和 `sl`:嗯,好吧,它取决于你是否认为蒸汽机车和 Zippy 引用“有用” + + +## 更多资源 + +- [超棒的shell](https://github.com/alebcay/awesome-shell): 一个shell工具和资源一览表。 +- [严格模式](http://redsymbol.net/articles/unofficial-bash-strict-mode/) 用于写出更佳的shell脚本。 + + +## 免责声明 + +除了非常小的任务外,其它都写出了代码供大家阅读。伴随力量而来的是责任。事实是,你*能*在Bash中做的,并不意味着是你所应该做的!;) + +-------------------------------------------------------------------------------- + +via: https://github.com/jlevy/the-art-of-command-line + +作者:[jlevy][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://github.com/jlevy +[1]:http://explainshell.com/ + diff --git a/translated/tech/20150617 The Art of Command Line.md b/translated/tech/20150617 The Art of Command Line.md deleted file mode 100644 index 87e8e7458e..0000000000 --- a/translated/tech/20150617 The Art of Command Line.md +++ /dev/null @@ -1,431 +0,0 @@ -命令行艺术 -================================================================================ -- [基础](#basics) -- [日常使用](#everyday-use) -- [处理文件和数据](#processing-files-and-data) -- [系统调试](#system-debugging) -- [单行程序](#one-liners) -- [晦涩难懂,但却有用](#obscure-but-useful) -- [更多资源](#more-resources) -- [免责声明](#disclaimer) - - -![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/blob/master/cowsay.png) - -流畅地使用命令行是一个常被忽略的技能,或被认为是神秘的奥义。但是,它会以明显而微妙的方式改善你作为工程师的灵活度和生产力。这是我在Linux上工作时发现的有用的命令行使用小窍门和笔记的精粹。有些小窍门是很基础的,而有些是相当地特别、相当地复杂、或者相当地晦涩难懂。这一页不长,但是如果你可以使用并记得这里的所有项目,那么你知道不少了。 - -其中大部分[最初](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands)[出现](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix)在[Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know)上,但是考虑到利益,似乎更值得使用Github,这上面的人比我更能提出改进建议。如果你看到一个错误,或者更好的某种东西,请提交问题或PR! - -范围: - -- 目标宽广而简洁。每个小窍门在某种情形下都很基础,或者比替代品大大节省时间。 -- 这是为Linux写的。大多数,但并非全部项目可以同样应用到MacOS(或者甚至Cygwin)。 -- 焦点集中在交互的Bash上,尽管大多数小窍门也可以应用到其它shell,以及常规Bash脚本。 -- 意在作最少说明,要想期待更多,你可以使用`man`、使用`apt-get`/`yum`/`dnf`来安装,还可以使用Google来获得更多背景知识。 - - -## 基础 - -- 学习基本Bash技能。实际上,键入`man bash`,然后至少浏览一遍所有东西;它很容易理解,没那么长。其它shell会很好,但是Bash很强大,而且总是可用(*只*学习zsh、fish之类,而在你自己的笔记本上测试时,会在很多情形下受到限制,比如使用现存的服务器)。 - -- 至少学好一种基于文本的编辑器。理想的一个是Vim(`vi`),因为在终端中用于随机编辑时它没有竞争者(即使大多数时候你使用Emacs,一个大型的IDE,或一个现代的时髦编辑器)。 - -- 学习使用`>`和`<`来进行输出和输入重定向,以及使用`|`来管道重定向,学习关于stdout和stderr的东西。 - -- 学习`*`(也许还有`?`和`{`...`}`)文件通配扩展和应用,以及双引号`"`和单引号`'`之间的区别。(更多内容请参看下面关于变量扩展部分)。 - -- 熟悉Bash作业管理:`&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`等等。 - -- 掌握`ssh`,以及通过`ssh-agent`,`ssh-add`等进行无密码验证的基础技能。 - -- 基本的文件管理:`ls`和`ls -l`(特别是,知道`ls -l`各个栏目的意义),`less`, `head`, `tail` 和`tail -f`(或者更好的`less +F`),`ln`和`ln -s`(知道硬链接和软链接的区别,以及硬链接相对于软链接的优势),`chown`,`chmod`,`du`(用于查看磁盘使用率的快速摘要:`du -sk *`),`df`, `mount`。 - -- 基本的网络管理: `ip`或`ifconfig`,`dig`。 - -- 熟知正则表达式,以及各种标识来使用`grep`/`egrep`。`-i`,`-o`,`-A`和`-B`选项值得掌握。 - -- 学会使用`apt-get`,`yum`或`dnf`(这取决于你的发行版)来查找并安装软件包。确保你可以用`pip`来安装基于Python的命令行工具(下面的一些东西可以很容易地通过`pip`安装)。 - - -## 日常使用 - -- 在Bash中,使用**ctrl-r**来搜索命令历史。 - -- 在Bash中,使用 **ctrl-w** 来删除最后的单词,使用 **ctrl-u** 来删除整行。使用 **alt-b** 和 **alt-f** 来逐词移动,以及使用**ctrl-k**来杀死到行尾。请使用 `man readline` 来查看Bash中所有默认的键绑定,有很多。例如,**alt-.** 可以循环显示先前的参数,而**alt-** 扩展通配。 - -- 返回先前的工作目录: `cd -` - -- 如果你命令输入到一半,但是改变主意了,可以敲 **alt-#** 来添加一个 `#` 到开头,然后将该命令作为注释输入(或者使用 **ctrl-a**, **#**,**enter**)。然后,你可以在后面通过命令历史来返回到该命令。 - -- 使用`xargs`(或`parallel`),它很强大。注意,你可以控制每行(`-L`)执行多少个项目,而言可以使用平行结构(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用`xargs echo`。同时,使用`-I{}`也很方便。样例: -```bash - find . -name '*.py' | xargs grep some_function - cat hosts | xargs -I{} ssh root@{} hostname -``` - -- `pstree -p`对于现实进程树很有帮助。 - -- 使用`pgrep`和`pkill`来按名称查找或用信号通知进程(`-f`很有帮助)。 - -- 掌握各种可以发送给进程的信号。例如,要挂起进程,可以使用`kill -STOP [pid]`。完整的列表可以查阅see `man 7 signal`。 - -- 如果你想要一个后台进程一直保持运行,使用`nohup`或`disown`。 - -- 通过`netstat -lntp`检查什么进程在监听。 - -- `lsof`来查看打开的套接口和文件。 - -- 在Bash脚本中,使用`set -x`调试脚本输出。每当可能时,使用严格模式。使用`set -e`在遇到错误时退出。也可以使用`set -o pipefail`,对错误严格(虽然该话题有点敏感)。对于更复杂的脚本,也可以使用`trap`。 - -- 在Bash脚本中,子shell(写在括号中的)是集合命令的便利的方式。一个常见的例子是临时移动到一个不同的工作目录,如: -```bash - # do something in current dir - (cd /some/other/dir; other-command) - # continue in original dir -``` - -- 注意,在Bash中有大量各种各样的变量扩展。检查一个变量是否存在:`${name:?error message}`。例如,如果一个Bash脚本要求一个单一参数,只需写`input_file=${1:?usage: $0 input_file}`。算术扩展:`i=$(( (i + 1) % 5 ))`。序列:`{1..10}`。修剪字符串:`${var%suffix}`和`${var#prefix}`。例如,if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`。 - -- 命令的输出可以通过`<(some command)`作为一个文件来处理。例如,将本地的`/etc/hosts`和远程的比较: -```sh - diff /etc/hosts <(ssh somehost cat /etc/hosts) -``` - -- 知道Bash中的“嵌入文档”,就像在`cat <logfile 2>&1`同时重定向标准输出和标准错误。通常,要确保某个命令不会再标准输入中遗留有打开的文件句柄,将它捆绑到你所在的终端,添加` foo: - rename 's/\.bak$//' *.bak - # Full rename of filenames, directories, and contents foo -> bar: - repren --full --preserve-case --from foo --to bar . -``` - -- 使用`shuf`来从某个文件中随机选择随机的行。 - -- 知道`sort`的选项。知道这些键是怎么工作的(`-t`和`-k`)。特别是,注意你需要写`-k1,1`来只通过第一个字段排序;`-k1`意味着根据整行排序。 - -- 稳定排序(`sort -s`)会很有用。例如,要首先按字段2排序,然后再按字段1排序,你可以使用`sort -k1,1 | sort -s -k2,2` - -- 如果你曾经需要在Bash命令行中写一个标签文字(如,用于-t参数的排序),按**ctrl-v** **[Tab]**,或者写`$'\t'`(后面的更好,因为你可以复制/粘贴)。 - -- 对于二进制文件,使用`hd`进行简单十六进制转储,以及`bvi`用于二进制编辑。 - -- 还是用于二进制文件,`strings`(加上`grep`等)可以让你找出文本的二进制数。 - -- 要转换文本编码,试试`iconv`吧,或者对于更高级的使用`uconv`;它支持一些高级的统一字符标准的东西。例如,这个命令可以将所有重音符号转成小写并(通过扩展和丢弃)移除: -```sh - uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt -``` - -- 要将文件分割成各个部分,来看看`split`(按大小分割)和`csplit`(按格式分割)吧。 - -- 使用`zless`,`zmore`,`zcat`和`zgrep`来操作压缩文件。 - - -## 系统调试 - -- 对于网络调试,`curl`和`curl -I`很方便灵活,或者业可以使用它们的同行`wget`,或者更现代的[`httpie`](https://github.com/jakubroztocil/httpie)。 - -- 要知道disk/cpu/network的状态,使用`iostat`,`netstat`,`top`(或更好的`htop`)和(特别是)`dstat`。它们对于快速获知系统中发生的状况很好用。 - -- 对于更深层次的系统总览,可以使用[`glances`](https://github.com/nicolargo/glances)。它会在一个终端窗口中为你呈现几个系统层次的统计数据,对于快速检查各个子系统很有帮助。 - -- 要知道内存状态,可以运行`free`和`vmstat`,看懂它们的输出结果吧。特别是,要知道“cached”值是Linux内核作为文件缓存所占有的内存,因此,要有效地统计“free”值。 - -- 系统调试是一件截然不同的事,但是对于Oracle系统以及其它一些JVM而言,不过是一个简单的小把戏,你可以运行`kill -3 `,然后一个完整的堆栈追踪和累积的摘要(包括分代垃圾收集细节,这里头信息量很大)将被转储到stderr/logs.Java。 - -- 使用`mtr`作为更好的路由追踪,来识别网络问题。 - -- 对于查看磁盘满载的原因,`ncdu`会比常规命令如`du -sh *`更节省时间。 - -- 要查找占用带宽的套接口和进程,试试`iftop`或`nethogs`吧。 - -- (Apache附带的)`ab`工具对于临时应急检查网络服务器性能很有帮助。对于更复杂的负载测试,可以试试`siege`。 - -- 对于更重型的网络调试,可以用`wireshark`,`tshark`或`ngrep`。 - -- 掌握`strace`和`ltrace`。如果某个程序失败、挂起或崩溃,而你又不知道原因,或者如果你想要获得性能的大概信息,这些工具会很有帮助。注意,分析选项(`-c`)和关联运行进程的能力(`-p`)。 - -- 掌握`ldd`来检查共享库等。 - -- 知道如何使用`gdb`来连接到一个运行着的进程并获取其堆栈追踪信息。 - -- 使用`/proc`。当调试当前注目问题时,它有时候出奇地有帮助。样例:`/proc/cpuinfo`,`/proc/xxx/cwd`,`/proc/xxx/exe`,`/proc/xxx/fd/`,`/proc/xxx/smaps`。 - -- 当调试过去某个东西出错时,`sar`会非常有帮助。它显示了CPU、内存、网络等的历史统计数据。 - -- 对于更深层的系统和性能分析,看看`stap` ([SystemTap](https://sourceware.org/systemtap/wiki)),[`perf`](http://en.wikipedia.org/wiki/Perf_(Linux))和[`sysdig`](https://github.com/draios/sysdig)吧。 - -- 确认是正在使用的Linux发行版版本(大多数发行版可用):`lsb_release -a`。 - -- 每当某个东西的行为异常时(可能是硬件或者驱动器问题),使用`dmesg`。 - - -## 单行程序 - -将命令拼凑在一起的一些样例: - -- 有时候通过`sort`/`uniq`来进行交互设置、合并,以及比较文本文件的差异时,这个例子会相当有帮助。假定`a`和`b`是已经进行唯一性处理的文本文件。这会很快,而且可以处理任意大小的文件,总计可达数千兆字节。(Sort不受内存限制,然后你可能需要使用`-T`选项来检查`/tmp`是否挂载一个容量小的root分区上。)也可参见上面关于`LC_ALL`的注解。 -```sh - cat a b | sort | uniq > c # c is a union b - cat a b | sort | uniq -d > c # c is a intersect b - cat a b b | sort | uniq -u > c # c is set difference a - b -``` - -- 对某个文本文件的第三列中所有数据进行求和(该例子可能比同等功能的Python要快3倍,而且代码也少于其3倍): -```sh - awk '{ x += $3 } END { print x }' myfile -``` - -- 如果想要查看某个文件树的大小/日期,该例子就像一个递归`ls -l`,但是比`ls -lR`要更容易读懂: -```sh - find . -type f -ls -``` - -- 只要可以,请使用Use `xargs`或`parallel`。注意,你可以控制每行(`-L`)执行多少个项目,也可同时控制并行计算(`-P`)。如果你不确定它是否会做正确的事,可以在前面加上xargs echo。同时,`-I{}`很灵便。样例: -```sh - find . -name '*.py' | xargs grep some_function - cat hosts | xargs -I{} ssh root@{} hostname -``` - -- 比如说,你有一个文本文件,像网络服务器的日志,在某些行中出现了某个特定的值,如URL中出现的`acct_id`参数。如果你想要一个针对每个`acct_id`的请求的计数器: -```sh - cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn -``` - -- 运行该函数来获得来自文档的随机提示(解析Markdown并从中提取某个项目): -```sh - function taocl() { - curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | - pandoc -f markdown -t html | - xmlstarlet fo --html --dropdtd | - xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | - xmlstarlet unesc | fmt -80 - } -``` - - -## 晦涩难懂,但却有用 - -- `expr`:实施算术或布林操作,或者求正则表达式的值 - -- `m4`:简单宏处理器 - -- `screen`:强大的终端多路复用和会话保持 - -- `yes`:大量打印一个字符串 - -- `cal`:漂亮的日历 - -- `env`:运行一个命令(脚本中很有用) - -- `look`:查找以某个字符串开头的英文单词(或文件中的行) - -- `cut `和`paste`以及`join`:数据处理 - -- `fmt`:格式化文本段落 - -- `pr`:格式化文本为页/栏 - -- `fold`:包裹文本行 - -- `column`:格式化文本为栏或表 - -- `expand`和`unexpand`:在制表和空格间转换 - -- `nl`:添加行号 - -- `seq`:打印数字 - -- `bc`:计算器 - -- `factor`:把整数因子分解 - -- `gpg`:加密并为文件签名 - -- `toe`:terminfo条目表 - -- `nc`:网络调试和数据传输 - -- `ngrep`:查找网络层 - -- `dd`:在文件或设备间移动数据 - -- `file`:识别文件类型 - -- `stat`:文件信息 - -- `tac`:逆序打印文件 - -- `shuf`:从文件中随机选择行 - -- `comm`:逐行对比分类排序的文件 - -- `hd`和`bvi`:转储或编辑二进制文件 - -- `strings`:从二进制文件提取文本 - -- `tr`:字符转译或处理 - -- `iconv `或`uconv`:文本编码转换 - -- `split `和`csplit`:分割文件 - -- `7z`:高比率文件压缩 - -- `ldd`:动态库信息 - -- `nm`:目标文件的符号 - -- `ab`:网络服务器基准测试 - -- `strace`:系统调用调试 - -- `mtr`:用于网络调试的更好的路由追踪 - -- `cssh`:可视化并发shell - -- `wireshark`和`tshark`:抓包和网络调试 - -- `host`和`dig`:DNS查询 - -- `lsof`:处理文件描述符和套接字信息 - -- `dstat`:有用的系统统计数据 - -- [`glances`](https://github.com/nicolargo/glances):高级,多子系统概览 - -- `iostat`:CPU和磁盘使用率统计 - -- `htop`:top的改进版 - -- `last`:登录历史 - -- `w`:谁登录进来了 - -- `id`:用户/组身份信息 - -- `sar`:历史系统统计数据 - -- `iftop`或`nethogs`:按套接口或进程的网络使用率 - -- `ss`:套接口统计数据 - -- `dmesg`:启动和系统错误信息 - -- `hdparm`:SATA/ATA磁盘操作/性能 - -- `lsb_release`:Linux发行版信息 - -- `lshw`:硬件信息 - -- `fortune`,`ddate`和`sl`:嗯,好吧,它取决于你是否认为蒸汽机车和齐皮士引用“有用” - - -## 更多资源 - -- [超棒的shell](https://github.com/alebcay/awesome-shell): 一个shell工具和资源一览表。 -- [严格模式](http://redsymbol.net/articles/unofficial-bash-strict-mode/) 用于写出更佳的shell脚本。 - - -## 免责声明 - -除了非常小的任务外,其它都写出了代码供大家阅读。伴随力量而来的是责任。事实是,你*能*在Bash中做的,并不意味着是你所应该做的!;) - --------------------------------------------------------------------------------- - -via: https://github.com/jlevy/the-art-of-command-line - -作者:[jlevy][a] -译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://github.com/jlevy -[1]: -[2]: -[3]: -[4]: -[5]: -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: From 434879d7318b1939ad3b4449ab04131ee7976690 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 15:31:29 +0800 Subject: [PATCH 19/76] PUB:20150604 How To Install Unity 8 Desktop Preview In Ubuntu @GOLinux --- ...stall Unity 8 Desktop Preview In Ubuntu.md | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md diff --git a/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md deleted file mode 100644 index bf1c3ea0bb..0000000000 --- a/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md +++ /dev/null @@ -1,77 +0,0 @@ -Ubuntu中安装Unity 8桌面预览版 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) - -如果你一直关注新闻,那么Ubuntu将会切换到[Mir显示服务器][1],并随同发布[Unity 8][2]桌面。然而,在尚未确定Unity 8是否会在[Ubuntu 15.10 Willy Werewolf][3]中部署到Mir上之前,提供了一个Unity 8的预览版本供你体验和测试。通过官方PPA,可以很容地**安装Unity 8到Ubuntu 14.04,14.10和15.04中**。 - -到目前为止,开发者已经可以通过[ISO][4]获得该Unity 8预览来进行测试。但是Canonical已经通过[LXC容器][5]发布了。通过该方法,你可以获取Unity 8桌面会话,让它作为任何一个桌面环境运行在Mir显示服务器上。就像你[在Ubuntu中安装Mate桌面][6],然后从LightDm登录屏幕选择桌面会话一样。 - -好奇?想要试试Unity 8?让我们来看怎样安装它吧。 - -**注意: 它是一个实验性预览,可能不是所有人都可以让它正确工作的。** - -### 安装Unity 8桌面到Ubuntu ### - -下面是安装并使用Unity 8的步骤: - -#### 步骤 1: 安装Unity 8到Ubuntu 12.04和14.04 #### - -如果你真运行着Ubuntu 12.04和14.04,那么你必须使用官方PPA来安装Unity 8。使用以下命令进行安装: - - sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc - sudo apt-get update - sudo apt-get upgrade - sudo apt-get install unity8-lxc - -#### 步骤 1: 安装Unity 8到Ubuntu 14.10和15.04 #### - -如果你真运行着Ubuntu 14.10或15.04,那么Unity 8 LXC已经在源中准备好。你只需要运行以下命令: - - sudo apt-get update - sudo apt-get install unity8-lxc - -#### 步骤 2: 设置Unity 8桌面预览LXC #### - -安装Unity 8 LXC后,该对它进行设置,下面的命令就可达到目的: - - sudo unity8-lxc-setup - -它将花费一些时间来设置,所以,给点耐心吧。它会下载ISO,然后解压缩,接着完整最后一些必要的设置来让它工作。它也会安装一个LightDM的轻度修改版本。这一切都搞定后,需要重启。 - -#### 步骤 3: 选择Unity 8 #### - -重启后,在登录屏幕,点击你的登录旁边的Ubuntu图标: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) - -你应该可以在这看到Unity 8的选项,选择它: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) - -### 卸载Unity 8 LXC ### - -如果你发现Unity 8毛病太多,或者你不喜欢它,那么你可以以相同的方式切换会默认Unity版本。此外,你也可以通过下面的命令移除Unity 8: - - sudo apt-get remove unity8-lxc - -该命令会将Unity 8选项从LightDM屏幕移除,但是配置仍然保留着。 - -以上就是你在Ubuntu中安装嗲有Mir的Unity 8的全部过程,试玩后请分享你关于Unity 8的想法哦! - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ - -作者:[Abhishek][a] -译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 -[2]:https://wiki.ubuntu.com/Unity8Desktop -[3]:http://itsfoss.com/ubuntu-15-10-codename/ -[4]:https://wiki.ubuntu.com/Unity8DesktopIso -[5]:https://wiki.ubuntu.com/Unity8inLXC -[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ From 19a2f1bbd157a7e3d5a0879aa8ae3b132c2d910d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 21:26:06 +0800 Subject: [PATCH 20/76] PUB:20150610 Install Android Studio on Ubuntu 15.04 @NearTan --- ... Install Android Studio on Ubuntu 15.04.md | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) rename {translated/tech => published}/20150610 Install Android Studio on Ubuntu 15.04.md (72%) diff --git a/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/published/20150610 Install Android Studio on Ubuntu 15.04.md similarity index 72% rename from translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md rename to published/20150610 Install Android Studio on Ubuntu 15.04.md index 25fe29e043..111291ebd2 100644 --- a/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md +++ b/published/20150610 Install Android Studio on Ubuntu 15.04.md @@ -1,29 +1,27 @@ - 在Ubuntu 15.04下安装Android Studio -PS 原MD文件有大段重复并且排版错误,译者已修复 ================================================================================ -Android Studio是官方为了Android应用开发者而发布的IDE,它基于IntelliJ的IDEA。 +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) + +Android Studio是官方为了Android应用开发者而发布的IDE,它基于IntelliJ的IDEA。 ### Android Studio的功能 ### -灵活的基于Gradle的建构系统 +- 灵活的基于Gradle的建构系统 -针对不同手机编译多个版本的apk +- 针对不同手机编译多个版本的apk -代码模板功能构建出各种常用的应用 +- 代码模板功能构建出各种常用的应用 -支持拖动编辑主题的富布局编辑器 +- 支持拖动编辑主题的富布局编辑器 -lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他问题 +- lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他问题 -代码混淆和应用签名功能 - -内置 Google Cloud Platform 的支持,可以轻易的融入Google Cloud Messaging 和 App Engine支持 - -还有更多 +- 代码混淆和应用签名功能 +- 内置 Google Cloud Platform 的支持,可以轻易的融入Google Cloud Messaging 和 App Engine支持 +- 还有更多 ### 在 Ubuntu 15.04 上安装 Android Studio ### @@ -33,7 +31,6 @@ lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他 sudo apt-get update sudo apt-get install android-studio - 如果要把Android Studio添加到启动栏,你需要如下操作 打开Android Studio,点击Configure选择Create Desktop Entry,这样Android Studio应该在dash中创建快捷方式了。 @@ -42,8 +39,6 @@ lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他 ![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/12.png) -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) - ![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/31.png) ![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/41.png) @@ -60,7 +55,7 @@ via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html 作者:[ruchi][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 4d0c09545e7944e389c3c124adb2ac81adc44632 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 21:43:10 +0800 Subject: [PATCH 21/76] PUB:20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet @geekpi --- ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) rename {translated/tech => published}/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md (56%) diff --git a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md similarity index 56% rename from translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md rename to published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md index 91d16acb00..db6e61da65 100644 --- a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md +++ b/published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -1,37 +1,36 @@ -如何在Ubuntu 15.04(Vivid Vervet)中安装nginx和google pagespeed +如何在 Ubuntu 15.04 中安装 nginx 和 google pagespeed ================================================================================ -Nginx (engine-x)是一个开源高性能http、反向代理和IMAP/POP3代理服务器。nginx杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有google paespeed模块用于Ubuntu 15.04中的.deb包。 +Nginx (engine-x)是一个开源的高性能 HTTP 服务器、反向代理和 IMAP/POP3 代理服务器。nginx 杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx 被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有 google paespeed 模块的用于 Ubuntu 15.04 的 nginx .deb 安装包。 +pagespeed 是一个由 google 开发的 web 服务器模块来加速网站响应时间、优化 html 和减少页面加载时间。ngx_pagespeed 的功能如下: -pagespeed是一个由google开发的web服务器模块来加速网站响应时间、优化html和减少页面加载时间。ngx_pagespeed的功能如下: - -- 图像优化:去除meta数据、动态剪裁、重压缩。 -- CSS与JavaScript 放大、串联、内联、外联。 +- 图像优化:去除元数据、动态缩放、重压缩。 +- CSS 与 JavaScript 压缩、串联、内联、外联。 - 小资源内联 -- 延迟图像与JavaScript加载 -- HTML重写。 +- 图像与 JavaScript 延迟加载 +- HTML 重写 - 缓存生命期插件 -更多请见 [https://developers.google.com/speed/pagespeed/module/][1]. +更多请见 [https://developers.google.com/speed/pagespeed/module/][1]。 -### 预备要求 ### +### 前置要求 ### -Ubuntu Server 15.04 64位 -root 权限 +- Ubuntu Server 15.04 64位 +- root 权限 本篇我们将要: -- 安装必备包 -- 安装带ngx_pagespeed的nginx +- 安装必备软件包 +- 安装带 ngx_pagespeed 的 nginx - 测试 #### 安装必备包 #### -sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev + sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev -#### 安装带ngx_pagespeed的nginx #### +### 安装带 ngx_pagespeed 的 nginx ### -**第一步 - 添加nginx仓库** +#### 第一步 - 添加nginx仓库#### vim /etc/apt/sources.list.d/nginx.list @@ -51,7 +50,7 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER sudo apt-get update -**第二步 - 从仓库下载nginx 1.8** +####第二步 - 从仓库下载 nginx 1.8#### sudo su cd ~ @@ -60,7 +59,7 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev apt-get source nginx apt-get build-dep nginx -**第三步 - 下载Pagespeed** +#### 第三步 - 下载 Pagespeed#### cd ~ mkdir -p ~/new/ngx_pagespeed/ @@ -73,12 +72,12 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz tar -xzf 1.9.32.3.tar.gz -**第三步 - 配置nginx来编译Pagespeed** +####第四步 - 配置 nginx 来编译 Pagespeed#### cd ~/new/nginx_source/nginx-1.8.0/debin/ vim rules -在CFLAGS `.configure`下添加模块: +在两处 CFLAGS `.configure` 下添加模块: --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ @@ -86,27 +85,27 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev ![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) -**第五步 - 打包nginx包并安装** +####第五步 - 打包 nginx 软件包并安装#### cd ~/new/nginx_source/nginx-1.8.0/ dpkg-buildpackage -b -dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后,看一下目录: +dpkg-buildpackage 会编译 ~/new/ngix_source/ 为 nginx.deb。打包完成后,看一下目录: cd ~/new/ngix_source/ ls ![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) -接着安装nginx。 +接着安装 nginx。 dpkg -i nginx_1.8.0-1~trusty_amd64.deb ![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) -#### 测试 #### +### 测试 ### -运行nginx -V测试nginx是否已经自带ngx_pagespeed。 +运行 nginx -V 测试 nginx 是否已经自带 ngx_pagespeed。 nginx -V @@ -114,15 +113,15 @@ dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后, ### 总结 ### -稳定、快速、开源的nginx支持许多不同的优化模块。这其中之一是google开发的‘pagespeed’。不像apache,nginx模块不是动态加载的,因此你必须在编译之前就选择完需要的模块。 +稳定、快速、开源的 nginx 支持许多不同的优化模块。这其中之一是 google 开发的‘pagespeed’。不像 apache,nginx 模块不是动态加载的,因此你必须在编译之前就选择好需要的模块。 -------------------------------------------------------------------------------- -via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install +via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/ 作者:Muhammad Arul 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 9754ff83e6726325e904347c68c86cd3c034c3d7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 22:16:45 +0800 Subject: [PATCH 22/76] PUB:20150331 How to set up remote desktop on Linux VPS using x2go @ictlyh --- ... remote desktop on Linux VPS using x2go.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150331 How to set up remote desktop on Linux VPS using x2go.md (63%) diff --git a/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/published/20150331 How to set up remote desktop on Linux VPS using x2go.md similarity index 63% rename from translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md rename to published/20150331 How to set up remote desktop on Linux VPS using x2go.md index 26ad141e84..8ce76e25c6 100644 --- a/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ b/published/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -1,20 +1,20 @@ -如何在 Linux VPS 上使用 x2go 设置远程桌面 +如何在 Linux 上使用 x2go 设置远程桌面 ================================================================================ -由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要跨多个地方和设备不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 +由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要在多个地方和设备之间不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 -在 Linux 世界中,有许多可用的协议(例如 RDP、RFB、NX) 和 服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer),当然不缺乏设置远程桌面的选择。 +在 Linux 世界中,理所当然设置远程桌面有很多选择,支持许多协议(例如 RDP、RFB、NX) 和服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer 等等)。 -当中出色的一个是 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9]) 的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 +这当中有个出色的产品叫做 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9])的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 ### X2Go 是什么? ### -X2Go 的历史要追溯回 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 +X2Go 的历史要追溯到 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致出现了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 -和其它解决方案,例如 VNC 相比,X2Go 带来哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 开箱支持音频,意味着远程桌面的音乐播放通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中用一个独立窗口无缝呈现,给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 +和其它解决方案例如 VNC 相比,X2Go 有哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 默认支持音频,这意味着远程桌面的音乐播放可以通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中以一个独立窗口无缝呈现,会给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 ### X2GO 的桌面环境兼容性 ### -和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 +和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE 3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 ### 在 Linux 上安装 X2Go 服务器 ### @@ -74,21 +74,21 @@ Debian (Wheezy): CentOS/RHEL: -首先启用 EPEL 库,然后运行: +首先启用 [EPEL 库][7] ,然后运行: $ sudo yum install x2goclient ### 用 X2Go 客户端连接到远程桌面 ### -终于可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 +现在可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 $ x2goclient -输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 +输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 ![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) -如果需要的话,你可以自定义其它东西(通过点击其它标签),例如连接速度、压缩、屏幕分辨率等等。 +如果需要的话,你可以自定义其它东西(通过点击其它的标签),例如连接速度、压缩、屏幕分辨率等等。 ![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) @@ -112,7 +112,7 @@ CentOS/RHEL: ### 总结 ### -在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 +在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 X2Go 的什么功能最吸引你?欢迎分享你的观点。 @@ -122,7 +122,7 @@ via: http://xmodulo.com/x2go-remote-desktop-linux.html 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 0999d7ba1ac5a1d905b9b2c1d905c06fa71ee13b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 22:21:33 +0800 Subject: [PATCH 23/76] PUB:20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux @geekpi --- ...he Beautiful Arc GTK+ Flat Theme on Linux.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {translated/share => published}/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md (92%) diff --git a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md similarity index 92% rename from translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md rename to published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md index 93f7b004e1..edcc62b86f 100644 --- a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md +++ b/published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -1,10 +1,15 @@ -如何在Linux中安装漂亮的扁平化Arc GTK+主题 +如何在 Linux 中安装漂亮的 GTK+ 扁平化主题 Arc ================================================================================ -> 易于理解的分步教程 **今天我们将向你介绍最新发布的GTK+主题,它拥有透明和扁平元素,并且与多个桌面环境和Linux发行版兼容。[这个主题叫Arc][1]。** -开始讲细节之前,我建议你快速浏览一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该知道它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME栈。 +开始讲细节之前,我建议你快速浏览一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该知道它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME 体系。 + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) 同样、Arc主题的开发者告诉我们它已经成功地在Ubuntu 15.04(Vivid Vervet)、 Arch Linux、 elementary OS 0.3 Freya、 Fedora 21、 Fedora 22、 Debian GNU/Linux 8.0 (Jessie)、 Debian Testing、 Debian Unstable、 openSUSE 13.2、 openSUSE Tumbleweed和Gentoo测试过了。 @@ -12,7 +17,7 @@ 要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对于Fedora则是pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对于Fedora则是gtk-murrine-engine)。 -Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地,并在每行的末尾按下回车键并等待上一步完成来继续下一步。 +Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地输入,并在每行的末尾按下回车键并等待上一步完成来继续下一步。 git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme git fetch --tags @@ -22,11 +27,7 @@ Arc主题还没有二进制包,因此你需要从git仓库中取下最新的 就是这样!此时你已经在你的GNU/Linux发行版中安装了Arc主题,如果你使用GNOME可以使用GONME Tweak工具,如果你使用Ubuntu的Unity可以使用Unity Tweak工具来激活主题。玩得开心但不要忘了在下面的评论栏里留下你的截图。 -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) - -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) -------------------------------------------------------------------------------- From 976c3c53a0d6fd08772f38a250c6cdf342677e4b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 22:49:56 +0800 Subject: [PATCH 24/76] PUB:20150429 What are good command line HTTP clients @wi-cuckoo --- ...What are good command line HTTP clients.md | 111 ++++++++++++++++++ ...What are good command line HTTP clients.md | 110 ----------------- 2 files changed, 111 insertions(+), 110 deletions(-) create mode 100644 published/20150429 What are good command line HTTP clients.md delete mode 100644 translated/share/20150429 What are good command line HTTP clients.md diff --git a/published/20150429 What are good command line HTTP clients.md b/published/20150429 What are good command line HTTP clients.md new file mode 100644 index 0000000000..969b14da29 --- /dev/null +++ b/published/20150429 What are good command line HTTP clients.md @@ -0,0 +1,111 @@ +有哪些不错的命令行HTTP客户端? +============================================================================== + +“整体大于它的各部分之和”,这是引自希腊哲学家和科学家的亚里士多德的名言。这句话特别切中Linux。在我看来,Linux最强大的地方之一就是它的协作性。Linux的实用性并不仅仅源自大量的开源程序(命令行)。相反,其协作性来自于这些程序的综合利用,有时是结合成更大型的应用。 + +Unix哲学引发了一场“软件工具”的运动,关注开发简洁,基础,干净,模块化和扩展性好的代码,并可以运用于其他的项目。这种哲学成为了许多的Linux项目的一个重要的元素。 + +好的开源开发者写程序为了确保该程序尽可能运行得好,并且同时能与其他程序很好地协作。目标就是使用者拥有一堆方便的工具,每一个力求干好一件事。许多程序能独立工作得很好。 + +这篇文章讨论3个开源命令行HTTP客户端。这些客户端可以让你使用命令行从互联网上下载文件。但同时,他们也可以用于许多有意思的地方,如测试,调式和与HTTP服务器或web应用交互。对于HTTP架构师和API设计人员来说,使用命令行操作HTTP是一个值得花时间学习的技能。如果你需要经常使用API,HTTPie和cURL就非常有价值。 + +###HTTPie### + +![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) + +HTTPie(发音 aych-tee-tee-pie)是一款开源的命令行HTTP客户端。它是一个命令行界面,便于手工操作的类cURL工具。 + +该软件的目标是使得与Web服务器的交互尽可能的人性化。其提供了一个简单的http命令,允许使用简单且自然的语句发送任意的HTTP请求,并显示不同颜色的输出。HTTPie可以用于测试,调试,以及与HTTP服务器的常规交互。 + +#### 功能包括:#### + +- 生动而直观的语法格式 +- 经过格式化的彩色终端输出 +- 内建JSON支持 +- 支持表单和文件上传 +- 支持HTTPS,代理和认证 +- 任意数据请求 +- 自定义请求头 +- 持久会话 +- 类Wget的下载 +- 支持Python 2.6,2.7和3.x +- 支持Linux,Mac OS X 和 Windows +- 支持插件 +- 文档 +- 单元测试覆盖 + +--- + +- 网站:[httpie.org][1] +- 开发者: Jakub Roztočil +- 证书: 开源 +- 版本号: 0.9.2 + +###cURL### + +![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) + +cURL是一个开源的命令行工具,用于使用URL语句传输数据,支持DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS,IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET和TFTP等协议。 + +cURL支持SSL证书,HTTP POST,HTTP PUT,FTP上传,基于表单的HTTP上传,代理,缓存,用户名+密码的认证方式(Basic, Digest, NTLM, Negotiate, kerberos...),文件续传,代理通道和一些其他的有用功能。 + +#### 功能包括:#### + +- 支持配置文件 +- 一个单独命令行请求多个URL +- 支持匹配: [0-13],{one, two, three} +- 一个命令上传多个文件 +- 自定义最大传输速度 +- 重定向了标准错误输出 +- 支持Metalink + +--- + +- 网站: [curl.haxx.se][2] +- 开发者: Daniel Stenberg +- 证书: MIT/X derivate license +- 版本号: 7.42.0 + +###Wget### + +![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) + +Wget是一个从网络服务器获取信息的开源软件。其名字源于World Wide Web 和 get。Wget支持HTTP,HTTPS和FTP协议,同时也可以通过HTTP代理获取信息。 + +Wget可以根据HTML页面的链接,创建远程网络站点的本地副本,完全重造源站点的目录结构。这种方式被称作“递归下载”。 + +Wget设计上增强了低速或者不稳定的网络连接。 + +功能包括: + +- 使用REST和RANGE恢复中断的下载 +- 使用文件名通配符,支持递归地对目录镜像 +- 基于NLS的消息文件支持多语言 +- 可选的转换下载文档里地绝对链接为相对链接,使得下载文档可以在本地相互链接 +- 可以在大多数类UNIX操作系统和微软Windows上运行 +- 支持HTTP代理 +- 支持HTTP cookie +- 支持HTTP持久连接 +- 无人照管/后台操作 +- 当对远程镜像时,使用本地文件时间戳来决定是否需要重新下载文档 + +--- + +- 站点: [www.gnu.org/software/wget/][3] +- 开发者: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others +- 证书: GNU GPL v3 +- 版本号: 1.16.3 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html + +作者:Frazer Kline +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://httpie.org/ +[2]:http://curl.haxx.se/ +[3]:https://www.gnu.org/software/wget/ diff --git a/translated/share/20150429 What are good command line HTTP clients.md b/translated/share/20150429 What are good command line HTTP clients.md deleted file mode 100644 index fa9ef01c54..0000000000 --- a/translated/share/20150429 What are good command line HTTP clients.md +++ /dev/null @@ -1,110 +0,0 @@ -什么是好的命令行HTTP客户端? -============================================================================== -整体大于各部分之和,这是引自希腊哲学家和科学家的亚里士多德的名言。这句话特别切中Linux。在我看来,Linux最强大的地方之一就是它的协作性。Linux的实用性并不仅仅源自大量的开源程序(命令行)。相反,其协作性来自于这些程序的综合利用,有时是结合更大型的应用。 - -Unix哲学引发了一场“软件工具”的运动,关注开发简洁,基础,干净,模块化和扩展性好的代码,并可以运用于其他的项目。这种哲学为许多的Linux项目留下了一个重要的元素。 - -好的开源开发者写程序为了确保该程序尽可能运行正确,同时能与其他程序很好地协作。目标就是使用者拥有一堆方便的工具,每一个力求干不止一件事。许多程序能独立工作得很好。 - -这篇文章讨论3个开源命令行HTTP客户端。这些客户端可以让你使用命令行从互联网上下载文件。但同时,他们也可以用于许多有意思的地方,如测试,调式和与HTTP服务器或网络应用互动。对于HTTP架构师和API设计人员来说,使用命令行操作HTTP是一个值得花时间学习的技能。如果你需要来回使用API,HTTPie和cURL,这没什么价值。 - -------------- - -![HTTPie](http://www.linuxlinks.com/portal/content2/png/HTTPie.png) - -![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) - -HTTPie(发音 aych-tee-tee-pie)是一款开源命令行HTTP客户端。它是一个命令行界面,类cURL的工具。 - -该软件的目标是使得与网络服务器的交互尽可能的人性化。其提供了一个简单的http命令,允许使用简单且自然的语句发送任意的HTTP请求,并显示不同颜色的输出。HTTPie可以用于测试,调式和与HTTP服务器的一般交互。 - -#### 功能包括:#### - -- 可表达,直观的语句 -- 格式化,颜色区分的终端输出 -- 内建JSON支持 -- 表单和文件上传 -- HTTPS,代理和认证 -- 任意数据请求 -- 自定义标题 (此处header不确定是否特别意义) -- 持久会话 -- 类Wget下载 -- Python 2.6,2.7和3.x支持 -- Linux,Mac OS X 和 Windows支持 -- 支持插件 -- 帮助文档 -- 测试覆盖 (直译有点别扭) - -- 网站:[httpie.org][1] -- 开发者: Jakub Roztočil -- 证书: 开源 -- 版本号: 0.9.2 - ----------- - -![cURL](http://www.linuxlinks.com/portal/content2/png/cURL1.png) - -![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) - -cURL是一个开源命令行工具,用于使用URL语句传输数据,支持DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS,IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET和TFTP。 - -cURL支持SSL证书,HTTP POST,HTTP PUT,FTP上传,HTTP基于表单上传,代理,缓存,用户名+密码认证(Basic, Digest, NTLM, Negotiate, kerberos...),文件传输恢复, 代理通道和一些其他实用窍门的总线负载。(这里的名词我不明白其专业意思) - -#### 功能包括:#### - -- 配置文件支持 -- 一个单独命令行多个URL -- “globbing”漫游支持: [0-13],{one, two, three} -- 一个命令上传多个文件 -- 自定义最大传输速度 -- 重定向标准错误输出 -- Metalink支持 - -- 网站: [curl.haxx.se][2] -- 开发者: Daniel Stenberg -- 证书: MIT/X derivate license -- 版本号: 7.42.0 - ----------- - -![Wget](http://www.linuxlinks.com/portal/content2/png/Wget1.png) - -![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) - -Wget是一个从网络服务器获取信息的开源软件。其名字源于World Wide Web 和 get。Wget支持HTTP,HTTPS和FTP协议,同时也通过HTTP代理获取信息。 - -Wget可以根据HTML页面的链接,创建远程网络站点的本地版本,是完全重造源站点的目录结构。这种方式被冠名“recursive downloading。” - -Wget已经设计可以加快低速或者不稳定的网络连接。 - -功能包括: - -- 使用REST和RANGE恢复中断的下载 -- 使用文件名 -- 多语言的基于NLS的消息文件 -- 选择性地转换下载文档里地绝对链接为相对链接,使得下载文档可以本地相互链接 -- 在大多数类UNIX操作系统和微软Windows上运行 -- 支持HTTP代理 -- 支持HTTP数据缓存 -- 支持持续地HTTP连接 -- 无人照管/后台操作 -- 当远程对比时,使用本地文件时间戳来决定是否需要重新下载文档 (mirroring没想出合适的表达) - -- 站点: [www.gnu.org/software/wget/][3] -- 开发者: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others -- 证书: GNU GPL v3 -- 版本号: 1.16.3 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html - -作者:Frazer Kline -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://httpie.org/ -[2]:http://curl.haxx.se/ -[3]:https://www.gnu.org/software/wget/ From 091b1022c14b9903b1ca8fb2445222f981f6651f Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 28 Jun 2015 06:11:31 +0800 Subject: [PATCH 25/76] [Translated] 20150616 LINUX 101 -- POWER UP YOUR SHELL.md --- ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 179 ------------------ ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 177 +++++++++++++++++ 2 files changed, 177 insertions(+), 179 deletions(-) delete mode 100644 sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md create mode 100644 translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md diff --git a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md deleted file mode 100644 index 94102a58a6..0000000000 --- a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md +++ /dev/null @@ -1,179 +0,0 @@ -FSSlc translating - -LINUX 101: POWER UP YOUR SHELL -================================================================================ -> Get a more versatile,featureful and colourful command line interface with our guide to shell basics. - -**WHY DO THIS?** - -- Make life at the shell prompt easier and faster. -- Resume sessions after losing a connection. -- Stop pushing around that fiddly rodent! - -![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) - -Here’s our souped-up prompt on steroids. It’s a bit long for this small terminal window, but you can tweak it to your liking. - -As a Linux user, you’re probably familiar with the shell (aka command line). You may pop up the occasional terminal now and then for some essential jobs that you can’t do at the GUI, or perhaps you live in a tiling window manager environment and the shell is your main way of interacting with your Linux box. - -In either case, you’re probably using the stock Bash configuration that came with your distro – and while it’s powerful enough for most jobs, it could still be a lot better. In this tutorial we’ll show you how to pimp up your shell to make it more informative, useful and pleasant to work in. We’ll customise the prompt to make it provide better feedback than the defaults, and we’ll show you how to manage sessions and run multiple programs together with the incredibly cool tmux tool. And for a bit of eye candy, we’ll look at colour schemes as well. So, onwards! - -### Make your prompt sing ### - -Most distributions ship with very plain prompts – they show a bit of information, and generally get you by, but the prompt can do so much more. Take the default prompt on a Debian 7 installation, for instance: - - mike@somebox:~$ - -This shows the user, hostname, current directory and account type symbol (if you switch to root, the **$** changes to #). But where is this information stored? The answer is in the **PS1** environment variable. If you enter **echo $PS1** you’ll see this at the end of the text string that appears: - - u@h:w$ - -This looks a bit ugly, and at first glance you might start screaming, assuming it to be a dreaded regular expression, but we’re not going to fry our brains with the complexity of those. No, the slashes here are escape sequences, telling the prompt to do special things. The **u** part, for instance, tells the prompt to show the username, while w means the working directory. - -Here’s a list of things you can use in the prompt: - -- d The current date. -- h The hostname. -- n A newline character. -- A The current time (HH:MM). -- u The current user. -- w (lowercase) The whole working directory. -- W (uppercase) The basename of the working directory. -- $ A prompt symbol that changes to # for root. -- ! The shell history number of this command. - -To clarify the difference in the **w** and **W** options: with the former, you’ll see the whole path for the directory in which you’re working (eg **/usr/local/bin**), whereas for the latter it will just show the **bin** part. - -Now, how do you go about changing the prompt? You need to modify the contents of the **PS1** environment variable. Try this: - - export PS1=”I am u and it is A $” - -Now your prompt will look something like: - - I am mike and it is 11:26 $ - -From here you can experiment with the other escape sequences shown above to create the prompt of your dreams. But wait a second – when you log out, all of your hard work will be lost, because the value of the **PS1** environment variable is reset each time you start a terminal. The simplest way to fix this is to open the **.bashrc** configuration file (in your home directory) and add the complete export command to the bottom. This **.bashrc** file will be read by Bash every time you start a new shell session, so your beefed-up prompt will always appear. You can also spruce up your prompt with extra colour. This is a bit tricky at first, as you have to use some rather odd-looking escape sequences, but the results can be great. Add this to a point in your **PS1** string and it will change the text to red: - - [e[31m] - -You can change 31 here to other numbers for different colours: - -- 30 Black -- 32 Green -- 33 Yellow -- 34 Blue -- 35 Magenta -- 36 Cyan -- 37 White - -So, let’s finish off this section by creating the mother of all prompts, using the escape sequences and colours we’ve already looked at. Take a deep breath, flex your fingers, and then type this beast: - - export PS1=”(!) [e[31m][A] [e[32m]u@h [e[34m]w [e[30m]$ “ - -This provides a Bash command history number, current time, and colours for the user/hostname combination and working directory. If you’re feeling especially ambitious, you can change the background colours as well as the foreground ones, for really striking combinations. The ever useful Arch wiki has a full list of colour codes: [http://tinyurl.com/3gvz4ec][1]. - -> ### Shell essentials ### -> -> If you’re totally new to Linux and have just picked up this magazine for the first time, you might find the tutorial a bit heavy going. So here are the basics to get you familiar with the shell. It’s usually found as Terminal, XTerm or Konsole in your menus, and when you start it the most useful commands are: -> -> **ls** (list files); **cp one.txt two.txt** (copy file); **rm file.txt** (remove file); **mv old.txt new.txt** (move or rename); -> -> **cd /some/directory** (change directory); **cd ..** (change to directory above); **./program** (run program in current directory); **ls > list.txt** (redirect output to a file). -> -> Almost every command has a manual page explaining options (eg **man ls** – press Q to quit the viewer). There you can learn about command options, so you can see that **ls -la** shows a detailed list including hidden files. Use the up and down cursor keys to cycle through previous commands, and use Tab after entering part of a file or directory name to auto-complete it. - -### Tmux: A window manager for your shell ### - -A window manager inside a text mode environment – it sounds crazy, right? Well, do you remember when web browsers first implemented tabbed browsing? It was a major step forward in usability at the time, and reduced clutter in desktop taskbars and window lists enormously. Instead of having taskbar or pager icons for every single site you had open, you just had the one button for your browser, and then the ability to switch sites inside the browser itself. It made an awful lot of sense. - -If you end up running several terminals at the same time, a similar situation occurs; you might find it annoying to keep jumping between them, and finding the right one in your taskbar or window list each time. With a text-mode window manager you can not only run multiple shell sessions simultaneously inside the same terminal window, but you can even arrange them side-by-side. - -And there’s another benefit too: detaching and reattaching. The best way to see how this works is to try it yourself. In a terminal window, enter **screen** (it’s installed by default on most distros, or will be available in your package repositories). Some welcome text appears – just hit Enter to dismiss it. Now run an interactive text mode program, such as **nano**, and close the terminal window. - -In a normal shell session, the act of closing the window would terminate every process running inside it – so your Nano editing session would be a goner. But not with screen. Open a new terminal and enter: - - screen -r - -And voilà: the Nano session you started before is back! - -When you originally ran **screen**, it created a new shell session that was independent and not tied to a specific terminal window, so it could be detached and reattached (hence the **-r** option) later. - -This is especially useful if you’re using SSH to connect to another machine, doing some work, and don’t want a flaky connection to ruin all your progress. If you do your work inside a **screen** session and your connection goes down (or your laptop battery dies, or your computer explodes), you can simply reconnect/recharge/buy a new computer, then SSH back in to the remote box, run **screen -r** to reattach and carry on from where you left off. - -Now, we’ve been talking about GNU **screen** here, but the title of this section mentions tmux. Essentially, **tmux** (terminal multiplexer) is like a beefed up version of **screen** with lots of useful extra features, so we’re going to focus on it here. Some distros include **tmux** by default; in others it’s usually just an **apt-get, yum install** or **pacman -S** command away. - -Once you have it installed, enter **tmux** to start it. You’ll notice right away that there’s a green line of information along the bottom. This is very much like a taskbar from a traditional window manager: there’s a list of running programs, the hostname of the machine, a clock and the date. Now run a program, eg Nano again, and hit Ctrl+B followed by C. This creates a new window inside the tmux session, and you can see this in the taskbar at the bottom: - - 0:nano- 1:bash* - -Each window has a number, and the currently displayed program is marked with an asterisk symbol. Ctrl+B is the standard way of interacting with tmux, so if you hit that key combo followed by a window number, you’ll switch to that window. You can also use Ctrl+B followed by N and P to switch to the next and previous windows respectively – or use Ctrl+B followed by L to switch between the two most recently used windows (a bit like the classic Alt+Tab behaviour on the desktop). To get a window list, use Ctrl+B followed by W. - -So far, so good: you can now have multiple programs running inside a single terminal window, reducing clutter (especially if you often have multiple SSH logins active on the same remote machine). But what about seeing two programs at the same time? - -For this, tmux uses “panes”. Hit Ctrl+B followed by % and the current window will be split into two sections, one on the left and one on the right. You can switch between them Using Ctrl+B followed by O. This is especially useful if you want to see two things at the same time – eg a manual page in one pane, and an editor with a configuration file in another. - -Sometimes you’ll want to resize the individual panes, and this is a bit trickier. First you have to hit Ctrl+B followed by : (colon), which turns the tmux bar along the bottom into a dark orange colour. You’re now in command mode, where you can type in commands to operate tmux. Enter **resize-pane -R** to resize the current pane one character to the right, or use **-L** to resize in a leftward direction. These may seem like long commands for a relatively simple operation, but note that the tmux command mode (started with the aforementioned colon) has tab completion. So you don’t have to type the whole command – just enter “**resi**” and hit Tab to complete. Also note that the **tmux** command mode also has a history, so if you want to repeat the resize operation, hit Ctrl+B followed by colon and then use the up cursor key to retrieve the command that you entered previously. - -Finally, let’s look at detaching and reattaching – the awesome feature of screen we demonstrated earlier. Inside tmux, hit Ctrl+B followed by D to detach the current tmux session from the terminal window, which leaves everything running in the background. To reattach to the session use **tmux a**. But what happens if you have multiple tmux sessions running? Use this command to list them: - - tmux ls - -This shows a number for each session; if you want to reattach to session 1, use tmux a -t 1. tmux is hugely configurable, with the ability to add custom keybindings and change colour schemes, so once you’re comfortable with the main features, delve into the manual page to learn more. - -tmux: a window manager for your shell - -![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) - -Here’s tmux with two panes open: the left has Vim editing a configuration file, while the right shows a manual page - -> ### Zsh: an alternative shell ### -> -> Choice is good, but standardisation is also important as well. So it makes sense that almost every mainstream Linux distribution uses the Bash shell by default – although there are others. Bash provides pretty much everything you need from a shell, including command history, filename completion and lots of scripting ability. It’s mature, reliable and well documented – but it’s not the only shell in town. -> -> Many advanced users swear by Zsh, the Z Shell. This is a replacement for Bash that offers almost all of the same functionality, with some extra features on top. For instance, in Zsh you can enter **ls** - and hit Tab to get quick descriptions of the various options available for **ls**. No need to open the manual page! -> -> Zsh sports other great auto-completion features: type **cd /u/lo/bi** and hit Tab, for instance, and the full path of **/usr/local/bin** will appear (providing there aren’t other paths containing **u**, **lo** and **bi**). Or try **cd** on its own followed by Tab, and you’ll see nicely coloured directory listings – much better than the plain ones used by Bash. -> -> Zsh is available in the package repositories of all major distros; install it and enter **zsh** to start it. To change your default shell from Bash to Zsh, use the **chsh** command. And for more information visit [www.zsh.org][2]. - -### The terminals of the Future ### - -You might be wondering why the application that contains your command prompt is called a terminal. Back in the early days of Unix, people tended to work on multi-user machines, with a giant mainframe computer occupying a room somewhere in a building, and people connected to it using screen and keyboard combinations at the end of some wires. These terminal machines were often called “dumb”, because they didn’t do any important processing themselves – they just displayed whatever was sent down the wire from the mainframe, and sent keyboard presses back to it. - -Today, almost all of us do the actual processing on our own machines, so our computers are not terminals in a traditional sense. This is why programs like **XTerm**, Gnome Terminal, Konsole etc. are called “terminal emulators” – they provide the same facilities as the physical terminals of yesteryear. And indeed, in many respects they haven’t moved on much. Sure, we have anti-aliased fonts now, better colours and the ability to click on URLs, but by and large they’ve been working in the same way for decades. - -Some programmers are trying to change this though. **Terminology** ([http://tinyurl.com/osopjv9][3]), from the team behind the ultra-snazzy Enlightenment window manager, aims to bring terminals into the 21st century with features such as inline media display. You can enter **ls** in a directory full of images and see thumbnails, or even play videos from directly inside your terminal. This makes the terminal work a bit more like a file manager, and means that you can quickly check the contents of media files without having to open them in a separate application. - -Then there’s Xiki ([www.xiki.org][4]), which describes itself as “the command revolution”. It’s like a cross between a traditional shell, a GUI and a wiki; you can type commands anywhere, store their output as notes for reference later, and create very powerful custom commands. It’s hard to describe it in mere words, so the authors have made a video (see the Screencasts section of the **Xiki** site) which shows how much potential it has. - -And Xiki is definitely not a flash in the pan project that will die of bitrot in a few months. The authors ran a successful Kickstarter campaign to fund its development, netting over $84,000 at the end of July. Yes, you read that correctly – $84K for a terminal emulator. It might be the most unusual crowdfunding campaign since some crazy guys decided to start their own Linux magazine… - -### Next-gen terminals ### - -Many command line and text-based programs match their GUI equivalents for feature parity, and are often much faster and more efficient to use. Our recommendations: **Irssi** (IRC client); **Mutt** (mail client); **rTorrent** (BitTorrent); **Ranger** (file manager); **htop** (process monitor). ELinks does a decent job for web browsing, given the limitations of the terminal, and it’s useful for reading text-heavy websites such as Wikipedia. - -> ### Fine-tune your colour scheme ### -> -> We’re not obsessed with eye-candy at Linux Voice, but we do recognise the importance of aesthetics when you’re staring at something for several hours every day. Many of us love to tweak our desktops and window managers to perfection, crafting pixel-perfect drop shadows and fiddling with colour schemes until we’re 100% happy. (And then fiddling some more out of habit.) -> -> But then we tend to ignore the terminal window. Well, that deserves some love too, and at [http://ciembor.github.io/4bit][5] you’ll find a highly awesome colour scheme designer that can export settings for all of the popular terminal emulators (**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**) Move the sliders until you attain colour scheme nirvana, then click on the Get Scheme button at the top-right of the page. -> -> Similarly, if you spend a lot of time in a text editor such as Vim or Emacs, it’s worth using a well-crafted palette there as well. **Solarized at** [http://ethanschoonover.com/solarized][6] is an excellent scheme that’s not just pretty, but designed for maximum usability, with plenty of research and testing behind it. - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ - -作者:[Ben Everard][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/ben_everard/ -[1]:http://tinyurl.com/3gvz4ec -[2]:http://www.zsh.org/ -[3]:http://tinyurl.com/osopjv9 -[4]:http://www.xiki.org/ -[5]:http://ciembor.github.io/4bit -[6]:http://ethanschoonover.com/solarized diff --git a/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md new file mode 100644 index 0000000000..fac7fa2e1b --- /dev/null +++ b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md @@ -0,0 +1,177 @@ +LINUX 101: 让你的 SHELL 更强大 +================================================================================ +> 在我们的有关 shell 基础的指导下, 得到一个更灵活,功能更强大且多彩的命令行界面 + +**为何要这样做?** + +- 使得在 shell 提示符下过得更轻松,高效 +- 在失去连接后恢复先前的会话 +- Stop pushing around that fiddly rodent! (注: 我不知道这句该如何翻译) + +![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) + +Here’s our souped-up prompt on steroids.(注: 我不知道该如何翻译这句)对于这个细小的终端窗口来说,这或许有些长.但你可以根据你的喜好来调整它的大小. + +作为一个 Linux 用户, 对 shell (又名为命令行),你可能会熟悉. 或许你需要时不时的打开终端来完成那些不能在 GUI 下处理的必要任务,抑或是因为你处在一个平铺窗口管理器的环境中, 而 shell 是你与你的 linux 机器交互的主要方式. + +在上面的任一情况下,你可能正在使用你所使用的发行版本自带的 Bash 配置. 尽管对于大多数的任务而言,它足够强大,但它可以更加强大. 在本教程中,我们将向你展示如何使得你的 shell 更具信息性,更加实用且更适于在其中工作. 我们将对提示符进行自定义,让它比默认情况下提供更好的反馈,并向你展示如何使用炫酷的 `tmux` 工具来管理会话并同时运行多个程序. 并且,为了让眼睛舒服一点,我们还将关注配色方案. 接着,就让我们向前吧! + +### 让提示符 "唱歌" ### + +大多数的发行版本配置有一个非常简单的提示符 – 它们大多向你展示了一些基本信息, 但提示符可以为你提供更多的内容.例如,在 Debian 7 下,默认的提示符是这样的: + + mike@somebox:~$ + +上面的提示符展示出了用户,主机名,当前目录和账户类型符号(假如你切换到 root 账户, **$** 会变为 # ). 那这些信息是在哪里存储的呢? 答案是:在 **PS1** 环境变量中. 假如你键入 **echo $PS1**, 你将会在这个命令的输出字符串的最后有如下的字符: + + \u@\h:\w$ (注:这里没有加上斜杠 \,应该是没有转义 ,下面的有些命令也一样,我把 \ 都加上了,发表的时候也得注意一下) + +这看起来有一些丑陋,并在瞥见它的第一眼时,你可能会开始尖叫,认为它是令人恐惧的正则表达式,但我们不打算用这些复杂的字符来煎熬我们的大脑. 这不是正则表达式, 这里的斜杠是转义序列,它告诉提示符进行一些特别的处理. 例如,上面的 **u** 部分,告诉提示符展示用户名, 而 w 则展示工作路径. + +下面是一些你可以在提示符中用到的字符的列表: + +- d 当前的日期. +- h 主机名. +- n 代表新的一行的字符. +- A 当前的时间 (HH:MM). +- u 当前的用户. +- w (小写) 整个工作路径的全称. +- W (大写) 工作路径的简短名称. +- $ 一个提示符号,对于 root 用户为 # 号. +- ! 当前命令在 shell 历史记录中的序号. + +下面解释 **w** 和 **W** 选项的区别: 对于前者,你将看到你所在的工作路径的完整地址,(例如 **/usr/local/bin**), 而对于后者, 它则只显示 **bin** 这一部分. + +现在, 我们该怎样改变提示符呢? 你需要更改 **PS1** 环境变量的内容, 试试下面这个: + + export PS1=”I am \u and it is \A $” + +现在, 你的提示符将会像下面这样: + + I am mike and it is 11:26 $ + +从这个例子出发, 你就可以按照你的想法来试验一下上面列出的其他转义序列. 但稍等片刻 – 当你登出后,你的这些努力都将消失,因为在你每次打开终端时, **PS1** 环境变量的值都会被重置. 解决这个问题的最简单方式是打开 **.bashrc** 配置文件(在你的家目录下) 并在这个文件的最下方添加上完整的 `export` 命令.在每次你启动一个新的 shell 会话时,这个 **.bashrc** 会被 `Bash` 读取, 所以你的被加强了的提示符就可以一直出现.你还可以使用额外的颜色来装扮提示符.刚开始,这将有点棘手,因为你必须使用一些相当奇怪的转义序列,但结果是非常漂亮的. 将下面的字符添加到你的 **PS1**字符串中的某个位置,最终这将把文本变为红色: + + \[\e[31m\] + +你可以将这里的 31 更改为其他的数字来获得不同的颜色: + +- 30 黑色 +- 32 绿色 +- 33 黄色 +- 34 蓝色 +- 35 洋红色 +- 36 青色 +- 37 白色 + +所以,让我们使用先前看到的转义序列和颜色来创造一个提示符,以此来结束这一小节的内容. 深吸一口气,弯曲你的手指,然后键入下面这只"野兽": + + export PS1="(\!) \[\e[31m\] \[\A\] \[\e[32m\]\u@\h \[\e[34m\]\w \[\e[30m\]$" + +上面的命令提供了一个 Bash 命令历史序号, 当前的时间,用户或主机名与颜色之间的组合,以及工作路径.假如你"野心勃勃",利用一些惊人的组合,你还可以更改提示符的背景色和前景色.先前实用的 Arch wiki 有一个关于颜色代码的完整列表:[http://tinyurl.com/3gvz4ec][1]. + +> ### Shell 精要 ### +> +> 假如你是一个彻底的 Linux 新手并第一次阅读这份杂志,或许你会发觉阅读这些教程有些吃力. 所以这里有一些基础知识来让你熟悉一些 shell. 通常在你的菜单中, shell 指的是 Terminal, XTerm 或 Konsole, 但你启动它后, 最为实用的命令有这些: +> +> **ls** (列出文件名); **cp one.txt two.txt** (复制文件); **rm file.txt** (移除文件); **mv old.txt new.txt** (移动或重命名文件); +> +> **cd /some/directory** (改变目录); **cd ..** (回到上级目录); **./program** (在当前目录下运行一个程序); **ls > list.txt** (重定向输出到一个文件). +> +> 几乎每个命令都有一个手册页用来解释其选项(例如 **man ls** – 按 Q 来退出).在那里,你可以知晓命令的选项,这样你就知道 **ls -la** 展示一个详细的列表,其中也列出了隐藏文件, 并且在键入一个文件或目录的名字的一部分后, 可以使用 Tab 键来自动补全. + +### Tmux: 针对 shell 的窗口管理器 ### + +在文本模式的环境中使用一个窗口管理器 – 这听起来有点不可思议, 是吧? 然而,你应该记得当 Web 浏览器第一次实现分页浏览的时候吧? 在当时, 这是在可用性上的一个重大进步,它减少了桌面任务栏的杂乱无章和繁多的窗口列表. 对于你的浏览器来说,你只需要一个按钮便可以在浏览器中切换到你打开的每个单独网站, 而不是针对每个网站都有一个任务栏或导航图标. 这个功能非常有意义. + +若有时你同时运行着几个虚拟终端,你便会遇到相似的情况; 在这些终端之间跳转,或每次在任务栏或窗口列表中找到你所需要的那一个终端,都可能会让你觉得麻烦. 拥有一个文本模式的窗口管理器不仅可以让你像在同一个终端窗口中运行多个 shell 会话,而且你甚至还可以将这些窗口排列在一起. + +另外,这样还有另一个好处:可以将这些窗口进行分离和重新连接.想要看看这是如何运行的最好方式是自己尝试一下. 在一个终端窗口中,输入 **screen** (在大多数发行版本中,它被默认安装了或者可以在软件包仓库中找到). 某些欢迎的文字将会出现 – 只需敲击 Enter 键这些文字就会消失. 现在运行一个交互式的文本模式的程序,例如 **nano**, 并关闭这个终端窗口. + +在一个正常的 shell 对话中, 关闭窗口将会终止所有在该终端中运行的进程 – 所以刚才的 Nano 编辑对话也就被终止了, 但对于 screen 来说,并不是这样的. 打开一个新的终端并输入如下命令: + + screen -r + +瞧, 你刚开打开的 Nano 会话又回来了! + +当刚才你运行 **screen** 时, 它会创建了一个新的独立的 shell 会话, 它不与某个特定的终端窗口绑定在一起,所以可以在后面被分离并重新连接( 即 **-r** 选项). + +当你正使用 SSH 去连接另一台机器并做着某些工作, 但并不想因为一个单独的连接而毁掉你的所有进程时,这个方法尤其有用.假如你在一个 **screen** 会话中做着某些工作,并且你的连接突然中断了(或者你的笔记本没电了,又或者你的电脑报废了),你只需重新连接一个新的电脑或给电脑充电或重新买一台电脑,接着运行 **screen -r** 来重新连接到远程的电脑,并在刚才掉线的地方接着开始. + +现在,我们都一直在讨论 GNU 的 **screen**,但这个小节的标题提到的是 tmux. 实质上, **tmux** (terminal multiplexer) 就像是 **screen** 的一个进阶版本,带有许多有用的额外功能,所以现在我们开始关注 tmux. 某些发行版本默认包含了 **tmux**; 在其他的发行版本上,通常只需要一个 **apt-get, yum install** 或 **pacman -S** 命令便可以安装它. + +一旦你安装了它过后,键入 **tmux** 来启动它.接着你将注意到,在终端窗口的底部有一条绿色的信息栏,它非常像传统的窗口管理器中的任务栏: 上面显示着一个运行着的程序的列表,机器的主机名,当前时间和日期. 现在运行一个程序,又以 Nano 为例, 敲击 Ctrl+B 后接着按 C 键, 这将在 tmux 会话中创建一个新的窗口,你便可以在终端的底部的任务栏中看到如下的信息: + + 0:nano- 1:bash* + +每一个窗口都有一个数字,当前呈现的程序被一个星号所标记. Ctrl+B 是与 tmux 交互的标准方式, 所以若你敲击这个按键组合并带上一个窗口序号, 那么就会切换到对应的那个窗口.你也可以使用 Ctrl+B 再加上 N 或 P 来分别切换到下一个或上一个窗口 – 或者使用 Ctrl+B 加上 L 来在最近使用的两个窗口之间来进行切换(有点类似于桌面中的经典的 Alt+Tab 组合键的效果). 若需要知道窗口列表,使用 Ctrl+B 再加上 W. + +目前为止,一切都还好:现在你可以在一个单独的终端窗口中运行多个程序,避免混乱(尤其是当你经常与同一个远程主机保持多个 SSH 连接时.). 当想同时看两个程序又该怎么办呢? + +针对这种情况, 可以使用 tmux 中的窗格. 敲击 Ctrl+B 再加上 % , 则当前窗口将分为两个部分,一个在左一个在右.你可以使用 Ctrl+B 再加上 O 来在这两个部分之间切换. 这尤其在你想同时看两个东西时非常实用, – 例如一个窗格看指导手册,另一个窗格里用编辑器看一个配置文件. + +有时,你想对一个单独的窗格进行缩放,而这需要一定的技巧. 首先你需要敲击 Ctrl+B 再加上一个 :(分号),这将使得位于底部的 tmux 栏变为深橙色. 现在,你进入了命令模式,在这里你可以输入命令来操作 tmux. 输入 **resize-pane -R** 来使当前窗格向右移动一个字符的间距, 或使用 **-L** 来向左移动. 对于一个简单的操作,这些命令似乎有些长,但请注意,在 tmux 的命令模式(以前面提到的一个分号开始的模式)下,可以使用 Tab 键来补全命令. 另外需要提及的是, **tmux** 同样也有一个命令历史记录,所以若你想重复刚才的缩放操作,可以先敲击 Ctrl+B 再跟上一个分号并使用向上的箭头来取回刚才输入的命令. + +最后,让我们看一下分离和重新连接 - 即我们刚才介绍的 screen 的特色功能. 在 tmux 中,敲击 Ctrl+B 再加上 D 来从当前的终端窗口中分离当前的 tmux 会话, 这使得这个会话的一切工作都在后台中运行.使用 **tmux a** 可以再重新连接到刚才的会话. 但若你同时有多个 tmux 会话在运行时,又该怎么办呢? 我们可以使用下面的命令来列出它们: + + tmux ls + +这个命令将为每个会话分配一个序号; 假如你想重新连接到会话 1, 可以使用 `tmux a -t 1`. tmux 是可以高度定制的,你可以自定义按键绑定并更改配色方案, 所以一旦你适应了它的主要功能,请钻研指导手册以了解更多的内容. + +tmux: 一个针对 shell 的窗口管理器 + +![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) + +上图中, tmux 开启了两个窗格: 左边是 Vim 正在编辑一个配置文件,而右边则展示着指导手册页. + +> ### Zsh: 另一个 shell ### +> +> 选择是好的,但标准同样重要. 你要知道几乎每个主流的 Linux 发行版本都默认使用 Bash shell – 尽管还存在其他的 shell. Bash 为你提供了一个 shell 能够给你提供的几乎任何功能,包括命令历史记录,文件名补全和许多脚本编程的能力.它成熟,可靠并文档丰富 – 但它不是你唯一的选择. +> +> 许多高级用户热衷于 Zsh, 即 Z shell. 这是 Bash 的一个替代品并提供了 Bash 的几乎所有功能,令外还提供了一些额外的功能. 例如, 在 Zsh 中,你输入 **ls** - 并敲击 Tab 键可以得到 **ls** 可用的各种不同选项的一个大致描述. 而不需要再打开 man page 了! +> +> Zsh 还支持其他强大的自动补全功能: 例如,输入 **cd /u/lo/bi** 再敲击 Tab 键, 则完整的路径名 **/usr/local/bin** 就会出现(这里假设没有其他的路径包含 **u**, **lo** 和 **bi** 等字符.). 或者只输入 **cd** 再跟上 Tab 键,则你将看到着色后的路径名的列表 – 这比 Bash 给出的简单的结果好看得多. +> +> Zsh 在大多数的主要发行版本上都可以得到; 安装它后并输入 **zsh** 便可启动它. 要将你的默认 shell 从 Bash 改为 Zsh, 可以使用 **chsh** 命令. 若需了解更多的信息,请访问 [www.zsh.org][2]. + +### "未来" 的终端 ### + +你或许会好奇为什么包含你的命令行提示符的应用被叫做终端. 这需要追溯到 Unix 的早期, 那时人们一般工作在一个多用户的机器上,这个巨大的电脑主机将占据一座建筑中的一个房间, 人们在某些线路的配合下,使用屏幕和键盘来连接到这个主机, 这些终端机通常被称为 "哑终端", 因为它们不能靠自己做任何重要的执行任务 – 它们只展示通过线路从主机传来的信息,并输送回从键盘的敲击中得到的输入信息. + +今天,几乎所有的我们在自己的机器上执行实际的操作,所以我们的电脑不是传统意义下的终端, 这就是为什么诸如 **XTerm**, Gnome Terminal, Konsole 等程序被称为 "终端模拟器" 的原因 – 他们提供了同昔日的物理终端一样的功能.事实上,在许多方面它们并没有改变多少.诚然,现在我们有了反锯齿字体,更好的颜色和点击网址的能力,但总的来说,几十年来我们一直以同样的方式在工作. + +所以某些程序员正尝试改变这个状况. **Terminology** ([http://tinyurl.com/osopjv9][3]), 它来自于超级时髦的 Enlightenment 窗口管理器背后的团队,旨在将终端引入 21 世纪,例如带有在线媒体显示功能.你可以在一个充满图片的目录里输入 **ls** 命令,便可以看到它们的缩略图,或甚至可以直接在你的终端里播放视频. 这使得一个终端有点类似于一个文件管理器,意味着你可以快速地检查媒体文件的内容而不必用另一个应用来打开它们. + +接着还有 Xiki ([www.xiki.org][4]),它自身的描述为 "命令的革新".它就像是一个传统的 shell, 一个 GUI 和一个 wiki 之间的过渡; 你可以在任何地方输入命令,并在后面将它们的输出存储为笔记以作为参考,并可以创建非常强大的自定义命令.用几句话是很能描述它的,所以作者们已经创作了一个视频来展示它的潜力是多么的巨大(请看 **Xiki** 网站的截屏视频部分). + +并且 Xiki 绝不是那种在几个月之内就消亡的昙花一现的项目,作者们成功地进行了一次 Kickstarter 众筹,在七月底已募集到超过 $84,000. 是的,你没有看错 – $84K 来支持一个终端模拟器.这可能是最不寻常的集资活动,因为某些疯狂的家伙已经决定开始创办它们自己的 Linux 杂志 ...... + +### 下一代终端 ### + +许多命令行和基于文本的程序在功能上与它们的 GUI 程序是相同的,并且常常更加快速和高效. 我们的推荐有: +**Irssi** (IRC 客户端); **Mutt** (mail 客户端); **rTorrent** (BitTorrent); **Ranger** (文件管理器); **htop** (进程监视器). 若给定在终端的限制下来进行 Web 浏览, Elinks 确实做的很好,并且对于阅读那些以文字为主的网站例如 Wikipedia 来说,它非常实用. + +> ### 微调配色方案 ### +> +> 在 Linux Voice 中,我们并不迷恋养眼的东西,但当你每天花费几个小时盯着屏幕看东西时,我们确实认识到美学的重要性.我们中的许多人都喜欢调整我们的桌面和窗口管理器来达到完美的效果,调整阴影效果,摆弄不同的配色方案,直到我们 100% 的满意.(然后出于习惯,摆弄更多的东西.) +> +> 但我们倾向于忽视终端窗口,它理应也获得我们的喜爱, 并且在 [http://ciembor.github.io/4bit][5] 你将看到一个极其棒的配色方案设计器,对于所有受欢迎的终端模拟器(**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**),它可以色设定.移动滑动条直到你看到配色方案 norvana, 然后点击位于该页面右上角的 `得到方案` 按钮. +> +> 相似的,假如你在一个文本编辑器,如 Vim 或 Emacs 上花费很多的时间,使用一个精心设计的调色板也是非常值得的. **Solarized at** [http://ethanschoonover.com/solarized][6] 是一个卓越的方案,它不仅漂亮,而且因追求最大的可用性而设计,在其背后有着大量的研究和测试. +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ + +作者:[Ben Everard][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://tinyurl.com/3gvz4ec +[2]:http://www.zsh.org/ +[3]:http://tinyurl.com/osopjv9 +[4]:http://www.xiki.org/ +[5]:http://ciembor.github.io/4bit +[6]:http://ethanschoonover.com/solarized \ No newline at end of file From 736418a546fd23d88b76e4b291b89565869e269c Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 28 Jun 2015 06:20:00 +0800 Subject: [PATCH 26/76] Update 20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇. --- ...Line Tool to Output Rainbow Of Colors in Linux Terminal.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md index 6b864db6cb..194b295ab9 100644 --- a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md +++ b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -1,3 +1,5 @@ +FSSlc translating + Lolcat – A Command Line Tool to Output Rainbow Of Colors in Linux Terminal ================================================================================ For those who believe that Linux Command Line is boring and there isn’t any fun, then you’re wrong here are the articles on Linux, that shows how funny and naughty is Linux.. @@ -173,4 +175,4 @@ via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux- [1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ [2]:http://www.tecmint.com/linux-funny-commands/ [3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ -[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file +[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ From 46c5c0ca44287245811b017fbfc8c3e637ee3124 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Jun 2015 13:04:57 +0800 Subject: [PATCH 27/76] translating --- .../20150623 Linux Kernel 4.1 Released This Is What's New.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md index 41058f3210..40eb37e09b 100644 --- a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md +++ b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -1,3 +1,5 @@ +translating----geekpi + Linux Kernel 4.1 Released, This Is What’s New ================================================================================ **TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** @@ -59,4 +61,4 @@ via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:https://lkml.org/lkml/2015/6/22/8 [2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features -[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D \ No newline at end of file +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D From 0267a76f1b86a3b4e61d52dda82eda44b0a0d48d Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Jun 2015 13:56:09 +0800 Subject: [PATCH 28/76] translated --- ... Kernel 4.1 Released This Is What's New.md | 64 ------------------- ... Kernel 4.1 Released This Is What's New.md | 63 ++++++++++++++++++ 2 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md create mode 100644 translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md deleted file mode 100644 index 40eb37e09b..0000000000 --- a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md +++ /dev/null @@ -1,64 +0,0 @@ -translating----geekpi - -Linux Kernel 4.1 Released, This Is What’s New -================================================================================ -**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) - -The arrival [has been announced][1] by Linus Torvalds (who else?) on the Linux Kernel Mailing List (where else?) and comes almost two months after the [first entry in the new 4.x series][2]. - -Levity aside, and like every release before it, Linux Kernel 4.1 features a big set of changes. These touch everything from hardware compatibility to power management to file-system performance and technical fixes for obscure processors you’ve never heard of. - -Linux 4.1 is already being tracked in Ubuntu 15.10, due for release in October. - -### What’s New In Linux 4.1? ### - -![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) -Tux got mail - -The sub-heading is on your lips and we’re not here simply to serve up an announcement of an announcement. - -We’ve gone through the (vast, long, lengthy and at times technically unintelligible) change-log to pick out some highlights that may not feed hyperbole but may impact on you, a desktop users. - -#### Power Improvements #### - -The big headline user-facing feature you’ll find in Linux 4.1 are the wealth of performance and power efficiency improvements committed for Intel’s Cherry Trail and Bay Trail chips. SoCs and devices, such as the Intel Compute Stick. - -Anecdotal suggestions are that Linux Kernel 4.1 gives select combinations of newer Intel hardware as much as an extra hour of battery life. Such high gains are not likely to apply to anything but a very specific sub-set of chips and systems (and high-end ones at that) but it’s still exciting to hear of. - -**Highlights of Linux 4.1 include:** - -- EXT4 gains file-system level encryption (thanks to Google) -- Logitech lg4ff driver improves ‘force feedback’ for gaming wheels -- Toshiba laptop driver gains USB sleep charging and backlight improvements -- Rumble support for Xbox One controller -- Better battery reporting in Wacom tablet driver -- Various misc. power improvements for both ARM and x86 devices -- Samsung Exynos 3250 power management improvements -- Support for the Bamboo Pad -- Lenovo OneLink Pro Dock gains USB support -- Support for Realtek 8723A, 8723B, 8761A, 8821 Wi-Fi cards - -### Install Linux Kernel 4.1 on Ubuntu ### - -Although this release of the kernel is classed as stable there is no pressing need for Ubuntu desktop users to go out of their way to install it. - -Not that you can’t; if you’re impatient and skilled enough to do so you can take a crack at installing Linux 4.1 on Ubuntu by grabbing the appropriate set of packages from [Canonical’s mainline kernel archive][3] (or by risking a third-party PPA). - -Ubuntu 15.10 Wily Werewolf, due for release in October, is to be based on the Ubuntu Kernel 4.1.x (the Ubuntu kernel is the Linux Kernel plus Ubuntu-specific patches that have not been accepted upstream). - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://lkml.org/lkml/2015/6/22/8 -[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features -[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D diff --git a/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md new file mode 100644 index 0000000000..11b9c10a26 --- /dev/null +++ b/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -0,0 +1,63 @@ +Linux 4.1 发布了,下面是有哪些新的 +================================================================================ +**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** +**一个心的Linux内核 - 现代世界的心跳(如果我们想要让它充满诗意)已经发布了** + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) + +Linus Torvalds(还有谁?)在Linux邮件列表(还有哪里)中[宣布了][1]内核发布,同事也是大概两个月后迎来了[第一个4.x系列的发布][2]。 + +快速之外,像每次发布前那样,Linux 4.1带来了很大的改变。它从硬件兼容性到电源管理到文件系统性能到和你从没听说过的处理器的技术修复。 + +Linux 4.1 已经进入Ubuntu 15.10, 将在10月发布。 + +### Linux 4.1 有哪些新的 ### + +![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) +Tux邮件 + +子标题在嘴上,我们不会简单地就宣布公告。 + +我们从(大量冗长的及不能理解的技术)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。 + +#### 电源管理 #### + +你在Linux 4.1中面向用户的一大特性是对Intel Cherry Trail 和 Bay Trai 芯片的丰富性能以及电源效率的提升。Soc设备,如Intel计算棒。 + +传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池守密。这么高的受益不可能针对任何芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。 + +**Linux 4.1 亮点包括:** + +- ext4获得了文件系统层面的加密(感谢Google) +- 罗技游戏手柄lg4ff驱动提升‘力量反馈’ +- 东芝笔记本驱动获得USB睡眠充电和背光提升 +- Xbox One控制器支持 +- Wacom平板中更好的电源报告驱动 +- 不同的杂项。arm和x86设备电源管理提升 +- Samsung Exynos 3250 电源管理 +- 支持Bamboo屏板 +- 联想OneLink Pro Dock获得USB支持 +- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡 + +### Ubuntu中安装Linux 4.1 ### + +虽然这次发布的内核被标记为稳定,但是Ubuntu用户没有迫切需要区安装它。 + +如果你等不及了并且技术足够熟练,你可以从[Canonical的主流内核归档][3]中下载合适的来安装Linux 4.1(或者冒着风险使用第三方PPA)。 + +10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://lkml.org/lkml/2015/6/22/8 +[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D From ed59ef7a3e0ae4241a17985f73f48a5233fd087c Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 28 Jun 2015 15:02:59 +0800 Subject: [PATCH 29/76] translated 75% --- ...ll be the future of Linux without Linus.md | 188 ++++++------------ 1 file changed, 59 insertions(+), 129 deletions(-) diff --git a/sources/talk/20150618 What will be the future of Linux without Linus.md b/sources/talk/20150618 What will be the future of Linux without Linus.md index 92b9e9ee4d..09cd64b647 100644 --- a/sources/talk/20150618 What will be the future of Linux without Linus.md +++ b/sources/talk/20150618 What will be the future of Linux without Linus.md @@ -1,186 +1,116 @@ -translating wi-cuckoo -What will be the future of Linux without Linus? -================================================================================ -![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) +没有Linus,Linux的未来是什么样子? +============================================================================== +![](http://i2.wp.com/www.linuxveda.com/wp—content/uploads/2015/06/linus—torvalds—painting.jpg) -The interview was conducted back in 2007 for Linux For You magazine and we are publishing it here for archival purposes. +这次采访是 Linux For You 杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 -**Q: What are the future enhancements/paths/plans for the Linux kernel?** +**Q:对于Linux内核,未来的计划/道路/强化是怎样的?** -Linus: I’ve never been much of a visionary — instead of looking at huge plans for the future, I tend to have a rather short time frame of ‘issues in the next few months’. I’m a big believer in that the ‘details’ matter, and if you take care of the details, the big issues will end up sorting themselves out on their own. +Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,大的事情也会大事化小,小事化没。 -So I really don’t have any great vision for what the kernel will look like in five years — just a very general plan to make sure that we keep our eye on the ball. In fact, when it comes to me personally, one of the things I worry about the most isn’t even the technical issues, but making sure that the ‘process’ works, and that people can work well with each other. +所以,对于五年后内核会是什么样,我真的没有任何大眼光 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保‘进程’工作,这样人们才可以相互协作好。 -**Q: How do you see the relationship of Linux and Solaris evolving in the future? How will it benefit the users? ** +**Q:你怎么看Linux和Solaris之间的关系在未来的发展?它会如何使用户受益?** -Linus: I don’t actually see a whole lot of overlap, except that I think Solaris will start using more of the Linux user space tools (which I obviously don’t personally have a lot to do with — I really only do the kernel). The Linux desktop is just so much better than what traditional Solaris has, and I expect Solaris to move more and more towards a more Linux-like model there. +Linus:我并不能看到整个重叠的地方,除了我认为Solaris会开始使用更过Linux用户磁盘工具(显然我自己来说没有太多关注这个 — 我真的只关心内核)。Linux的桌面比起传统Solaris拥有的好多了,而且我希望Solaris移植越来越多的Linux的东西,朝着一个更加类Linux的模型前进。 -On the pure kernel side, the licensing differences mean that there’s not much cooperation, but it will be very interesting to see if that will change. Sun has been making noises about licensing Solaris under the GPL (either v2 or v3), and if the licence differences go away, that could result in some interesting technology. But I’m taking a wait-and-see attitude to that. +从纯内核方面讲,证书的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun已经声明在GPL(v2或v3)下授权Solaris,如果这种证书差异消失,那么会导致一些有趣的技术出现。但对此,我持待见态度。 -**Q: Now that the GPLv3 has been finalised and released, do you foresee any circumstance that would encourage you to begin moving the kernel to it? Or, from your perspective, is it so bad that you would never consider it?** +**Q:现在GPL v3已经完成并发布了,你是否预见有任何情况会激起你开始移植内核到Solaris上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过他?** -Linus: I think it is much improved over the early drafts, and I don’t think it’s a horrible licence. I just don’t think it’s the same kind of ‘great’ licence that the GPLv2 is. +Linus:我觉得相比于早先的草稿,v3有了很多提高,并且我也认为它不是一个糟糕的证书。我只是认为它没有GPLv2一般的‘伟大’。 -So in the absence of the GPLv2, I could see myself using the GPLv3. But since I have a better choice, why should I? +所以,由于没有了GPLv2,我会看见自己将会使用GPLv3。但是,自从我有了一个更好的选择,我为什么不应该考虑一下呢? -That said, I try to always be pragmatic, and the fact that I think the GPLv3 is not as good a licence as the GPLv2 is not a ‘black and white’ question. It’s a balancing act. And if there are other advantages to the GPLv3, maybe those other advantages would be big enough to tilt the balance in favour of the GPLv3. +这就是说,我努力保持实用主义精神,并且我认为GPLv3比起GPLv2不是一个好证书这件事不是一个‘黑与白’的问题。这是一个平衡做法。如果GPLv3有其他的优点,可能那些优点会在很大程度上倾斜喜爱GPLv3的天平。 -Quite frankly, I don’t really see any, but if Solaris really is to be released under the GPLv3, maybe the advantage of avoiding unnecessary non-compatible licence issues could be enough of an advantage that it might be worth trying to re-license the Linux kernel under the GPLv3 too. +恕我直言,我并没有看到任何优点,但是如果Solaris真的在GPLv3下发布,可能避免不必要的不兼容证书这条足够称为一个优点,可能也会值得去尝试重新许可Linux的内核放在GPLv3下。 -Don’t get me wrong — I think it’s unlikely. But I do want to make it clear that I’m not a licence bigot, per se. I think the GPLv2 is clearly the better licence, but licences aren’t everything. +不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个证书偏执者。我认为GPLv2是毫无疑问的好证书,但是证书不是一切。 -After all, I use a lot of programs that are under other licences. I might not put a project I start myself under the BSD (or the X11-MIT) licence, but I think it’s a great licence, and for other projects it may well be the right one. +总的来说,我使用很多其他证书下的程序。我可能没有把我自己做的一个项目放在BSD(或X11—MIT)证书下,但是我认为它是一个伟大的证书,对于其他项目来说,它可能是最佳的选择。 -**Q: Currently are there any Indians who you’d like to highlight as key contributors to the Linux kernel?** +**Q:目前有没有任何印度人,你想特别提出作为Linux内核的关键贡献者?** -Linus: I have to admit that I don’t directly work with anybody that I actually realise as being from India. That said, I should clarify a bit: I’ve very consciously tried to set up the kernel development so that I don’t end up working personally with a huge number of people. +Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。那就是说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 -I have this strong conviction that most humans are basically wired up to know a few people really well (your close family and friends), and I’ve tried to make the development model reflect that: with a ‘network of developers’, where people interact with maybe a dozen other people they trust, and those other people in turn interact with ‘their’ set of people they trust. +我非常相信大多数人基本上被束缚起来了,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 -So while I’m in occasional contact with hundreds of developers who send me a random patch or two, I’ve tried to set up an environment where the bulk of what I do happens through a much smaller set of people that I know, just because I think that’s how people work. It’s certainly how I like to work. +所以,当我偶然与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的集合间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 -Also, in all honesty, I don’t even know where a lot of the people I work with live. Location ends up being pretty secondary. So while I’m pretty sure that none of the top 10-15 I work with most closely, are in India, maybe after this goes public, it might get pointed out that there is actually somebody from there! +同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! -**Q: Since the Linux Kernel Development depends so heavily on you, how do you plan to organise/reorganise it for it to continue progressing without you, in case you decide to dedicate more time to your own life and family?** +**Q:自从Linux的内核开发对你依赖如此严重以来,你如何计划组织/重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** -Linus: I’ve long since come to the realisation that Linux is much bigger than me. Yes, I’m intimately involved in it still, and I have a fairly large day-to-day impact on it, and I end up being the person who, in some sense, acts as the central point for a lot of kernel activities; but no — I wouldn’t say that Linux ‘depends heavily’ on me. +Linus:现在Linux比我大得多了,为了这个实现我已经工作了很长时间。是的,我仍然十分亲切地身在其中,而且我对其有着想当大的日常影响,我最终会是这样一个人,在某种程度上,扮演着许多内核开发活跃者的中心点的角色;但是 — 我不会说Linux“严重依赖”于我。 -So if I had a heart attack and died tomorrow (happily not likely: I’m apparently healthy as anything), people would certainly notice, but there are thousands of people involved in just the kernel, and there’re more than a few that could take over for me with little real confusion. +所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够接替我,还少有困惑。 -**Q: India is one of the major producers of software engineers, yet we don’t contribute much to the Linux domain. What do you think is keeping Indians from becoming proactive on that front? How do you feel we could encourage Indians to get involved and contribute heavily? You have a fan following in India; could your iconic image be used to inspire enthusiasts?** +**Q:印度是软件工程师的主要产地之一,当然我们没有在Linux领域做太多贡献。你觉得什么是保持印度人在Linux领域变得具有前瞻性的?如果我们鼓励印度人参与并为Linux做很大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来启迪那些爱好者吗?** -Linus: This is actually a very hard question for me to answer. Getting into open source is such a complicated combination of both infrastructure (Internet access, education, you name it), flow of information and simply culture that I can’t even begin to guess what the biggest stumbling block could be. +Linus:对我来说,这确实是一个不好回答的问题。进入开源是如此一个底层结构(网络接入,教育,你说的),信息流和简单的文化的复杂组合,我甚至不能去猜测最大的障碍会是什么。 -In many ways, at least those with an English-speaking culture in India should have a rather easy time getting involved with Linux and other open source projects, if only thanks to the lack of a language barrier. Certainly much easier than many parts of Asia or even some parts of Europe. +在很多方面,至少那些在印度含英语文化的地方,应该有一个相对容易的方式参与Linux和其他开源项目,如果仅仅是由于语言门槛的话。当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 -Of course, while that is a lot of people, it’s equally obviously not the majority in India, and I personally simply don’t know enough about the issues in India to be able to make an even half-way intelligent guess about what the best way forward is. I suspect that an enthusiastic local user community is always the best way, and I think you do have that. +当然,有一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法做出一点半路聪明猜测最好的前路是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 -As to my ‘iconic image’, I tend to dislike that part personally. I’m not a great public speaker, and I’ve avoided travelling for the last several years because I’m not very comfortable being seen as this iconic ‘visionary’. I’m just an engineer, and I just happen to love doing what I do, and to work with other people in public. +至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 -**Q: What would be a good reason for you to consider visiting India?** +**Q:什么样的理由会让你考虑去看看印度?** -Linus: As mentioned in the first answer, I absolutely detest public speaking, so I tend to avoid conferences, etc. I’d love to go to India for a vacation some day, but if I do, I’d likely just do it incognito — not tell anybody beforehand and just go as a tourist to see the country! +Linus:如第一个回答中提到,我完全地讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度! -**Q: Recently, you seemed to slam Subversion and CVS, questioning their basic architecture. Now that you’ve got responses from the Subversion community, do you stand corrected, or are you still unconvinced?** +**Q:最近,你好像在抨击Subversion与CVS,质问他们的基础架构。现在你已经从Subversion和CVS社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** -Linus: I like making strong statements, because I find the discussion interesting. In other words, I actually tend to ‘like’ arguing. Not mindlessly, but I certainly tend to prefer the discussion a bit more heated, and not just entirely platonic. +Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 -And making strong arguments occasionally ends up resulting in a very valid rebuttal, and then I’ll happily say: “Oh, ok, you’re right.” +做出强硬的争论有时会导致一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” -But no, that didn’t happen on SVN/CVS. I suspect a lot of people really don’t much like CVS, so I didn’t really even expect anybody to argue that CVS was really anything but a legacy system. And while I’ve gotten a few people who argued that I shouldn’t have been quite so impolite against SVN (and hey, that’s fair — I’m really not a very polite person!), I don’t think anybody actually argued that SVN was ‘good’. +但是话说回来,对SVN/CVS并不会发生这种情况。我怀疑很多人真的不是很喜欢CVS,所以我真的不期望任何人去坚持CVS是一切,而不是一个老旧的系统。当我知道少数人确实这样争论了,我之前就不该那么不礼貌地反对SVN(嘿,这是公平的 — 我真的不是一个非常礼貌的家伙!),我认为不是任何人都可以争论SVN是‘好的’。 -SVN is, I think, a classic case of ‘good enough’. It’s what people are used to, and it’s ‘good enough’ to be used fairly widely, but it’s good enough in exactly the sense DOS and Windows were ‘good enough’. Not great technology, just very widely available, and it works well enough for people and looks familiar enough that people use it. But very few people are ‘proud’ of it, or excited about it. +我认为,SVN就是一个‘好过头’的经典案例。人们过去经常使用SVN,并且它也‘很好’,用途广泛,但是它的好过头完全如DOS与Windows也‘好过头’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 -Git, on the other hand, has some of the ‘UNIX philosophy’ behind it. Not that it is about UNIX, per se, but like original UNIX, it had a fundamental idea behind it. For UNIX, the underlying philosophy was/is that, “Everything is a file.” For git, it’s, Everything is just an object in the content-addressable database.” +Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它不是关于UNIX,实质上,是像原始的UNIX,它身后有一个基础的想法。对UNIX来说,最底层的哲学就是,“所有东西只是一个文件”。对Git来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 -**Q: Is having so many distros a good or bad idea? Choice is fine, but one does not need to be pampered with choices. Instead of so many man hours being spent in building hundreds of distros, wouldn’t it be easier to get into the enterprise and take on the MS challenge if people could come together and support fewer distros (1 for each use maybe)? What’s your view on that?** +**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人需要被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** -Linus: I think having multiple distros is an inevitable part of open source. And can it be confusing? Sure. Can it be inefficient? Yes. But I’d just like to compare it to politics: ‘democracy’ has all those confusing choices, and often none of the choices is necessarily what you ‘really’ want either, and sometimes you might feel like things would be smoother and more efficient if you didn’t have to worry about the whole confusion of voting, different parties, coalitions, etc. +Linus:我认为多发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:’民主‘也有那些令人困惑的选择,通常没有选择是必须的,或者你‘真正’想要的。而且有时候,如果你不需要担心选举,不同党派和联合等等方面的困惑的话,你可能喜欢事情更加容易一些,更有效率一些。 -But in the end, choice may be inefficient, but it’s also what keeps everybody involved at least ‘somewhat’ honest. We all probably wish our politicians were more honest than they are, and we all probably wish that the different distros sometimes made other choices than they do, but without that choice, we’d be worse off. +但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家比过去更诚信,我们也希望不同的发行版有一天做出其他的选择,但是没有那种选择的话,事情可能会更糟。 -**Q: Why do you think CFS is better than SD?** +**Q:为什么你觉得CFS比SD更好?** -Linus: Part of it is that I have worked with Ingo [Molnar] for a long time, which means that I know him, and know that he’ll be very responsive to any issues that come up. That kind of thing is very important. +Linus:一部分原因是我与Ingo[Molnar]工作你很长一段时间,这就是说,我了解他,并且知道他会对发生的任何事情非常负责。那种品质是非常重要的。 -But part of it is simply about numbers. Most people out there actually say that CFS is better than SD. Including, very much, on 3D games (which people claimed was a strong point of SD). +但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示CFS比SD好。包括许多3D游戏方面(这是人们声称SD最强的一点)。 -At the same time, though, I don’t think any piece of code is ever ”perfect”. The best thing to happen is that the people who want to be proponents of SD will try to improve that so much that the balance tips over the other way — and we’ll keep both camps trying interesting things because the internal competition motivates them. +同时,尽管如此,我认为并不是代码的任何一段都十分‘完美’。最好的情况是想成为SD支持者的人会努力提高SD,使得平衡会倾覆其他方面 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 -**Q: In a talk you had at Google about git, someone asked you how you would take an extremely large code base that is currently handled with something centralised and transition to git without stopping business for six months. What was your response to that?** +**Q:在Google一次关于Git的访谈中,有人问你如何会停止六个月的商业活动,为git编写了一个目前由一些中心化的东西和交易管理的,特别庞大的代码基础。你对此的回答是什么?** -Linus: Ahh. That was the question where I couldn’t hear the questioner well (the questions were much more audible in the recordings), and I noticed afterwards, when I went back and listened to the recorded audio, that I didn’t answer the question he asked, but the question I thought he’d asked. +Linus:啊哈。那个问题我在现场没有听清楚(在录制结果里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 -Anyway, we do have lots of import tools, so that you can actually just import a large project from just about any other previous SCM into git. But the problem, of course, often doesn’t end up being the act of importing itself, but just having to ‘get used to’ the new model! +无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是从任何其他的早期SCM导入一个大工程到git里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! -And quite frankly, I don’t think there is any other answer to that ‘get used to it’ but to just start out and try it. You obviously do not want to start out by importing the biggest and most central project you have; that would indeed just make everything come to a standstill, and make everybody very unhappy indeed. +坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最中心的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 -So nobody sane would advocate moving everything over to git overnight, and forcing people to change their environment. No. You’d start with a smaller project inside a company, perhaps something that just one group mostly controls and maintains, and start off by converting that to git. That way you get people used to the model, and you start having a core group with the knowledge about how git works and how to use it within the company. +所以没有理智健全的人会一夜之间拥护将一切移到git上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些一个组主要控制和维护的项目,然后开始转移其到git。这是你能让人们习惯这种模式的方式,你开始有一个核心的组,知道git如何工作,如何在公司里面使用它。 -And then you just extend on that. Not in one go. You’d import more and more of the projects — even if you have the ‘one big repository’ model at your company; you also almost certainly have that repository as a set of modules, because having everybody check out everything is just not a workable mode of operation (unless ‘everything’ is just not very large). +接着,你就会铺展开来。并不一次就位。你会导入越来越多的项目 — 如果在你公司里你有‘一个大仓库’;你也会差不多确定将那个仓库作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非‘每件事’并不非常大)。 -So you’d basically migrate one module at a time, until you get to the point where you’re so comfortable with git that you can just migrate the rest (or the ‘rest’ is so legacy that nobody even cares). +所以,你基本上有一次转移了一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’太传统了,没人会关心)。 -And one of the nice features of git is that it actually plays along pretty well with a lot of other SCMs. That’s how a lot of git users use it: ‘they’ may use git, but sometimes the people they work with don’t even realise, because they see the results of it propagated into some legacy SCM. +Git最赞的一个功能是,它实际上可以同很多其他SCM相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用git,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的SCM上去。 -**Q: Did they ever experiment with alternate instruction set implementations at Transmeta? [Transmeta Crusoe chip seemed like a very soft CPU — reminding one of Burroughs B1000 interpretive machine, which actually implemented multiple virtual machines. There was one for system software, another for Cobol, another for Fortran; If that is correct, then one could implement Burroughs 6/7000 or HP3000 like stack architecture on the chip or an instruction set suitable for JVM, etc]** +**Q:在Transmeta,他们曾经经历过用另外的架构设置部署吗?[Transmeta Crusoe的芯片看起来像一个非常软的CPU — 提到一台Burroughs B1000的解释机器,这实际上部署了多台虚拟机。有一台是用于系统软件,一台是用于Cobol,一台用于Fortran;如果上述正确,那么一个人可以部署Burroughs 6/7000或者HP3000,如栈结构一样,在芯片上或者一个适合JVM的结构集合等等。]** -Linus: We did indeed have some alternate instruction set, and while I still am not really supposed to talk about it, I can say that we did have a public demonstration of mixing instruction sets. We had a technology showcase where you could run x86 instructions side-by-side with Java byte code (actually, it was a slightly extended pico-java, iirc). +Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开证明。我们有一个技术宝箱,在那里你同时可以跑x86结构和Java字节码(实际上,它是一个轻量的扩展pico—java,iirc)。 -I think the app we showed running was running DOOM on top of Linux, where the Linux parts were a totally standard x86 distribution, but the DOOM binary was a specially compiled version where part of the game was actually compiled pico-Java. And the CPU ended up running them both the same way — as a JIT down to the native VLIW instruction set. +(选择DOOM的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) -(The reason for picking DOOM was just that source code was available, and the core parts of the game were small enough that it was easy to set it up as a demonstration — and it was obviously visually interesting.) +有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对Java不怎么感冒。 -There were more things going on internally, but I can’t really talk about them. And I wasn’t actually personally involved with the Java one either. +**Q:386BSD衍生了NetBSD,FreeBSD和OpenBSD,在Linux出现之前已经发展不错了,但是Linux传播比386BSD及其衍生者更为广泛。这在多大程度上左右你对证书的选择,和你选择的发展过程?你不认为比起GPLv2来,是GPLv3保护了自由,孕育了Linux比BSD更好,直到现在?** -**Q: 386BSD, from which NetBSD, FreeBSD and OpenBSD were derived, was there well before Linux, but Linux spread much more than 386BSD and its derivatives. How much of this do you attribute to the choice of the licence and how much to the development process you chose? Don’t you think that the GPLv3 protects the freedom that has bred Linux better than the BSDs till now, more than the GPLv2 can?** +Linus: -Linus: I think there’s both a licence issue, and a community and personality issue. The BSD licences always encouraged forking, but also meant that if somebody gets really successful and makes a commercial fork, you cannot necessarily join back. And so even if that doesn’t actually happen (and it did, in the BSD cases — with BSDi), people can’t really ‘trust’ each other as much. - -In contrast, the GPLv2 also encourages forking, but it not only encourages the branching off part, it also encourages (and ‘requires’) the ability to merge back again. So now you have a whole new level of trust: you ‘know’ that everybody involved will be bound by the licence, and won’t try to take advantage of you. - -So I see the GPLv2 as the licence that allows people the maximum possible freedom within the requirement that you can always join back together again from either side. Nobody can stop you from taking the improvements to the source code. - -So is the BSD licence even more ‘free’? Yes. Unquestionably. But I just wouldn’t want to use the BSD licence for any project I care about, because I not only want the freedom, I also want the trust so that I can always use the code that others write for my projects. - -So to me, the GPLv2 ends up being a wonderful balance of ‘as free as you can make it’, considering that I do want everybody to be able to trust so that they can always get the source code and use it. - -Which is why I think the GPLv3 ends up being a much less interesting licence. It’s no longer about that trust about “getting the source code back”; it has degenerated into a “I wrote the code, so I should be able to control how you use it.” - -In other words, I just think the GPLv3 is too petty and selfish. I think the GPLv2 has a great balance between ‘freedom’ and ‘trust’. It’s not as free as the BSD licences are, but it gives you peace of mind in return, and matches what I consider ‘tit-for-tat': I give source code, you give me source code in return. - -The GPLv3 tries to control the ‘use’ of that source code. Now it’s, “I give you my source code, so if you use it, you’d better make your devices hackable by me.” See? Petty and small-minded, in my opinion. - -**Q: Slowly but steadily, features of the -rt tree are getting integrated into the mainline. What are your current thoughts regarding a merger of the remaining -rt tree into the mainline (and I’m not talking about the CFS)?** - -Linus: I won’t guarantee that everything from -rt will ‘ever’ be merged into the standard kernel (there may be pieces that simply don’t end up making sense in the generic kernel), but yes, over the years we’ve actually integrated most of it, and the remaining parts could end up making it one of these days. - -I’m a big fan of low-latency work, but at the same time I’m pretty conservative, and I pushed back on some of the more aggressive merging, just because I want to make sure that it all makes sense for not just some extreme real time perspective, but also for ‘normal’ users who don’t need it. And that explains why the process has been a pretty slow but steady trickle of code that has gotten merged, as it was sufficiently stable and made sense. - -That, by the way, is not just an -rt thing; it’s how a lot of the development happens. -rt just happens to be one of the more ‘directed’ kernel projects, and one where the main developer is pretty directly involved with the normal kernel too. But quite often the migration of other features (security, virtual memory changes, virtualisation, etc) follows a similar path: they get written up in a very targeted environment, and then pieces of the features get slowly but surely merged into the standard kernel. - -**Q: I’m very curious about what the future holds for file systems in the kernel. What do you think about Reiser4, XFS4, ZFS and the new project founded by Oracle? ZFS has been receiving a lot of press these days. Reiser4 delivers very good benchmarks, and xfs4 is trying to keep up, whereas the one by Oracle has a lot of the same specs as Sun’s ZFS. Where are we heading? Which FS looks the most promising in your opinion?** - -Linus: Actually, just yesterday we had a git performance issue, where ZFS was orders of magnitude slower than UFS for one user (not under Linux, but git is gaining a lot of traction even outside of kernel development). So I think a lot of the ‘new file system’ mania is partly fed by knowing about the issues with old file systems, and then the (somewhat unrealistic) expectation that a ‘new and improved’ file system will make everything perfect. - -In the end, this is one area where you just let people fight it out. See who comes out the winner — and it doesn’t need to be (and likely will not) be a single winner. Almost always, the right choice of file system ends up depending on the load and circumstances. - -One thing that I’m personally more excited about than any of the file systems you mention is actually the fact that Flash-based hard disks are quickly becoming available even for ‘normal’ users. Sure, they’re still expensive (and fairly small), but Flash-based storage has such a different performance profile from rotating media, that I suspect that it will end up having a large impact on file system design. Right now, most file systems tend to be designed with the latencies of rotating media in mind. - -**Q: The operating system is becoming less and less important. You have said several times that the user is not supposed to ‘see’ the operating system at all. It is the applications that matter. Browser-based applications, like Google’s basic office applications, are making an impact. Where do you think operating systems are headed?** - -Linus: I don’t really believe in the ‘browser OS’, because I think that people will always want to do some things locally. It might be about security, or simply about privacy reasons. And while connectivity is widely available, it certainly isn’t ‘everywhere’. - -So I think the whole ‘Web OS’ certainly is part of the truth, but another part that people seem to dismiss is that operating systems have been around for decades, and it’s really a fairly stable and well-known area of endeavour. People really shouldn’t expect the OS to magically change: it’s not like people were ‘stupid’ back in the 60s either, or even that hardware was ‘that’ fundamentally different back then! - -So don’t expect a revolution. I think OSs will largely continue to do what they do, and while we’ll certainly evolve, I don’t think they’ll change radically. What may change radically are the interfaces and the things you do on top of the OS (and certainly the hardware beneath the OS will continue to evolve too), and that’s what people obviously care about. - -The OS? It’s just that hidden thing that makes it all possible. You really shouldn’t care about it, unless you find it very interesting to know what is really going on in the machine. - -**Q: The last I heard, you were using a PPC G4/5 for your main personal machine — what are you using now, and why?** - -Linus: I ended up giving up on the PowerPC, since nobody is doing any workstations any more, and especially since x86-64 has become such an undeniable powerhouse. So these days, I run a bog-standard PC, with a normal Core 2 Duo on it. - -It was a lot of fun to run another architecture (I ran with alpha as my main architecture way back then, for a few years, so it wasn’t the first time either), but commodity CPUs is where it is at. The only thing that I think can really ever displace the x86 architecture would come from below, i.e., if something makes us not use x86 as our main ISA in a decade, I think it would be ARM, thanks to the mobile device market. - -**Q: What does Linux mean to you — a hobby, philosophy, the meaning of life, a job, the best OS, something else…?** - -Linus: It’s some of all of that. It’s a hobby, but a deeply meaningful one. The best hobbies are the ones that you care ‘really’ deeply about. And these days it’s obviously also my work, and I’m very happy to be able to combine it all. - -I don’t know about a ‘philosophy’, and I don’t really do Linux for any really deeply held moral or philosophical reasons (I literally do it because it’s interesting and fun), but it’s certainly the case that I have come to appreciate the deeper reasons why I think open source works so well. So I may not have started to do Linux for any such deep reasons, and I cannot honestly say that that is what motivates me, but I do end up thinking about why it all works. - -**Q: Did Microsoft’s ‘Men in Black’ ever talk to you?** - -Linus: I’ve never really talked to MS, no. I’ve occasionally been at the same conferences with some MS people (I used to go to more conferences than I do these days), but I’ve never really had anything to do with them. I think there is a mutual wariness. - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ - -作者:[Swapnil Bhartiya][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxveda.com/author/arnieswap/ From c09f7390ba32369a936ff9f48f3854e0fb3e733c Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 28 Jun 2015 15:05:47 +0800 Subject: [PATCH 30/76] mv to tran* --- .../20150618 What will be the future of Linux without Linus.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20150618 What will be the future of Linux without Linus.md (100%) diff --git a/sources/talk/20150618 What will be the future of Linux without Linus.md b/translated/talk/20150618 What will be the future of Linux without Linus.md similarity index 100% rename from sources/talk/20150618 What will be the future of Linux without Linus.md rename to translated/talk/20150618 What will be the future of Linux without Linus.md From c3564ae01735bba6078685e264e7fa3681649828 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 28 Jun 2015 16:06:31 +0800 Subject: [PATCH 31/76] finish translation & review --- ...0150616 Linux Humor on the Command-line.md | 129 ------------------ ...0150616 Linux Humor on the Command-line.md | 127 +++++++++++++++++ 2 files changed, 127 insertions(+), 129 deletions(-) delete mode 100644 sources/share/20150616 Linux Humor on the Command-line.md create mode 100644 translated/share/20150616 Linux Humor on the Command-line.md diff --git a/sources/share/20150616 Linux Humor on the Command-line.md b/sources/share/20150616 Linux Humor on the Command-line.md deleted file mode 100644 index 47f1d0eb26..0000000000 --- a/sources/share/20150616 Linux Humor on the Command-line.md +++ /dev/null @@ -1,129 +0,0 @@ -translating by wwy-hust - -Linux Humor on the Command-line -================================================================================ -The desktop is full of eye candy. It enhances the visual experience and, in some cases, can also increase functionality of software. But it also makes software fun. Working on the command-line does not have to be always serious. If you want some fun on the command-line, there are lots of commands to raise a smile. - -Linux is a fun operating system. Linux offers a vast collection of small open source utilities that perform functions ranging from the obvious to the bizarre. It is the quality and selection of these tools that help Linux stand out. Check out these 7 small utilities. - -### lolcat ### - -![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) - -lolcat is a program that concatenates files, or standard input, to standard output (like the generic cat), and adds rainbow coloring to it. - -lolcat is often combined with other tools such as toilet or figlet to generate text. This software should not be confused with a lolcat; an image macro of one or more cats. - -lolcat was written by Moe. - -Website: [github.com][1] - -### cowsay ### - -![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) - -cowsay is a configurable open source program which generates ASCII pictures of a cow with a message in a speech bubble. cowsay is written in Perl. - -cowsay is not limited to generating pictures of cows. It can generate pre-made images of other animals including a duck, elephant, koala, moose, pony, sheep, stegosaurus, and turkey, as well as cheese, snowman, and a skeleton. - -There is a related program called cowthink, which generates cows with thought bubbles, as opposed to speech bubbles. - -Features include: - -- Make scripts more interesting -- Borg mode -- Ways to alter the way the cow looks, for example making the cow look greedy, paranoid, stoned, tired, wired, youthful and more -- xcowsay variant available - -Website: [nog.net][2] - -### doge ### - -![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) - -doge is a simple motd script based on the slightly stupid but very funny doge meme. It prints random grammatically incorrect statements that are sometimes based on things from your computer. - -Doge is an Internet meme that became popular in 2013. The meme typically consists of a picture of a Shiba Inu accompanied by multicolored text in Comic Sans font in the foreground. The text, representing a kind of internal monologue, is deliberately written in a form of broken English. - -- Randomly placed and colored random strings, complete with broken english -- Awesome Shibe in the terminal -- Fetching of system data, such as hostname, running processes, current user and $EDITOR -- If you have lolcat, you can do this gem: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done -- stdin support: ls /usr/bin | doge will doge-print some of the executables found in /usr/bin. wow. There are also multiple command line switches that control filtering and statistical frequency of words - -Website: [github.com/thiderman/doge][3] - -### ASCIIQuarium ### - -![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) - -ASCIIQuarium is an aquarium/sea animation in ASCII art. Enjoy the fascinating creatures that live in the water from your computer. - -To run ASCIIQuarium you need to have installed Perl's curses package, and the Term::Animation module. To install the former, type sudo apt-get install libcurses-perl. To install the latter, type sudo cpan Term::Animation, both at the command line. - -Features include: - -- Multicolored fish -- Amusing animations, including a fish hook -- There are swans, ducks, dolphins, and ships too - -Website: [www.robobunny.com][4] - -### sl - Steam Locomotive ### - -![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) - -sl is an amusing command line tool that displays animations to correct users who accidentally type sl instead of ls. - -I'm rather sloppy at typing, preferring speed to accuracy. But typos can be a tad dangerous on the command line. So sl can serve as a practical reminder of curing a bad habit of mistyping. It always raises a chuckle too. - -Features include: - -- With -F, train flies -- With -l, it shows a small train -- With -a, an accident seems to happen - -Website: [github.com/mtoyoda/sl][5] - -### aafire ### - -![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) - -aafire displays burning ASCII art flames in the terminal. It demonstrates the the capabilities of the aalib library, an ascii art library. - -Website: [aa-project.sourceforge.net/aalib][6] - -### CMatrix ### - -![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) - -CMatrix is an ncurses program that simulates the display from "The Matrix". If you have been living in a cave for the past 15 years, you might not know The Matrix is a 1999 American science fiction acting film starring Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving, and Joe Pantoliano. - -It works with terminal settings up to 132x300 and can scroll lines all at the same rate or asynchronously and at a user-defined speed. - -Features include: - -- Change the text colour -- Turn on bold characters -- Asynchronous scroll -- Use old-style scrolling -- "Screensaver" mode - -Website: [www.asty.org/cmatrix][7] - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150614112018846/Humor.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://github.com/busyloop/lolcat -[2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml -[3]:https://github.com/thiderman/doge -[4]:http://www.robobunny.com/projects/asciiquarium/html/ -[5]:https://github.com/mtoyoda/sl -[6]:http://aa-project.sourceforge.net/aalib/ -[7]:http://www.asty.org/cmatrix/ diff --git a/translated/share/20150616 Linux Humor on the Command-line.md b/translated/share/20150616 Linux Humor on the Command-line.md new file mode 100644 index 0000000000..acd2fca4e7 --- /dev/null +++ b/translated/share/20150616 Linux Humor on the Command-line.md @@ -0,0 +1,127 @@ +LinuxеĬ +================================================================================ +ͨǷdz۵ģǿ˿ӻ飬ʱҲܹǿijЩĹܣԼøȤ¹ҲҪǺ࣬Щӣôкܶչ¶΢Ц + +LinuxǸȤIJϵͳṩСͿԴߣƽϡŹֵӦáЩߵͿѡ԰Linuxӱһ߸С߰ɡ + +### lolcat ### + +![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) + +lolcatһļ׼뵽׼һcatijΪ߲ʵɫ + +lolcatͨtoiletfigletıӦýʹáӦΪһèͼĺꡣ + +lolcatMoeд + +ַ: [github.com][1] + +### cowsay ### + +![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) + +cowsayһõĿԴASCIIţͼƬڶԻʾϢcowsayPerlдġ + +cowsayֻʾţԤͼƬѼӡ¹С򡢽ͻ𼦣Լҡѩ˺͹Ǽܡ + +һcowthinkӦãԻݲͬţͬʱ˼ݡ + +ܰ + +- ýűøȤ +- Borgģʽ +- Ըţӣţ̰ƫִִƣ롢Ź֡ +- ţ˵ݿ޸ + +ַ: [nog.net][2] + +### doge ### + +![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) + +dogeһЩ޴ȤdogeĹļ򵥵ÿϢűĴӡһЩ﷨ľӣʱЩӻеĶ + +dogeһ2013dzеĻԪأͨһձȮͼƬͲɫɡЩֹһŵдһЩĶס + +- òͬɫŵӢдľ +- նеIJȮЧdz +- ϵͳݣеij򡢵ǰû$EDITOR +- װlolcatΪ׺: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done +- ׼֧: ls /usr/bin | doge ӡһЩ/usr/binµĿִļޡеĿؿԹ˴ԼƴƵʡ + +ַ: [github.com/thiderman/doge][3] + +### ASCIIQuarium ### + +![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) + +ASCIIQuariumһASCII뷽ʽˮ/󶯻ˮ׵ɡ + +ASCIIQuariumҪװPerlcursesԼTerm::Animationģ顣ʹsudo apt-get install libcurses-perlװǰߣʹsudo cpan Term::AnimationװߡҪնС + +ܰ + +- ʵ +- ȤĶ㹳 +- 졢Ѽӡʹֻ + +ַ: [www.robobunny.com][4] + +### sl - ### + +![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) + +slһȤնӦãΪЩĴlsslûʾһ + +Ҵͨdzʣϲٶȶ׼ȷԡǷdzΣյġslΪһʵʵߣעֻϰߡǻ˿Ц + +ܰ + +- ʹ -F, ڷ +- ʹ -l, ʾһС͵Ļ +- ʹ -a, ȥ + +ַ: [github.com/mtoyoda/sl][5] + +### aafire ### + +![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) + +aafireնʾȼյASCII档չʾһascii - aalibǿ + +ַ: [aa-project.sourceforge.net/aalib][6] + +### CMatrix ### + +![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) + +CMatrixһncursesijģ⡶ڿ͵۹һӰеĻ档һɽȹϸ15꣬ô֪ܲڿ͵۹1999ƻõӰΪ Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving Joe Pantoliano + +նΪ132x300¹ҿͬʽйûٶȽ첽Ĺ + +ܰ + +- ޸ıɫ +- ʹôַ +- 첽 +- ʹʽĹЧ +- Ļģʽ + +ַ: [www.asty.org/cmatrix][7] + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150614112018846/Humor.html + +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[1]:https://github.com/busyloop/lolcat +[2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml +[3]:https://github.com/thiderman/doge +[4]:http://www.robobunny.com/projects/asciiquarium/html/ +[5]:https://github.com/mtoyoda/sl +[6]:http://aa-project.sourceforge.net/aalib/ +[7]:http://www.asty.org/cmatrix/ \ No newline at end of file From b96f83d7ca35ca048d75434ba1d7fbff39ca6eee Mon Sep 17 00:00:00 2001 From: wwy Date: Sun, 28 Jun 2015 16:12:31 +0800 Subject: [PATCH 32/76] Update 20150309 Comparative Introduction To FreeBSD For Linux Users.md --- ...309 Comparative Introduction To FreeBSD For Linux Users.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md index d29a75cb69..9e73930755 100644 --- a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md +++ b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Comparative Introduction To FreeBSD For Linux Users ================================================================================ ![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) @@ -95,4 +97,4 @@ via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file +[a]:https://www.unixmen.com/author/anis/ From e9ed73d2b2d9ba745c5935d001256d446e64d096 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Jun 2015 16:19:58 +0800 Subject: [PATCH 33/76] PUB:20150623 Linux Kernel 4.1 Released This Is What's New @geekpi --- ... Kernel 4.1 Released This Is What's New.md | 61 ++++++++++++++++++ ... Kernel 4.1 Released This Is What's New.md | 63 ------------------- 2 files changed, 61 insertions(+), 63 deletions(-) create mode 100644 published/20150623 Linux Kernel 4.1 Released This Is What's New.md delete mode 100644 translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/published/20150623 Linux Kernel 4.1 Released This Is What's New.md b/published/20150623 Linux Kernel 4.1 Released This Is What's New.md new file mode 100644 index 0000000000..f49951e253 --- /dev/null +++ b/published/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -0,0 +1,61 @@ +Linux 4.1 带来了什么新东西? +================================================================================ +**一个新的Linux内核已经发布了 - 全世界为之心跳(我们想把它说的诗意一些)** + +Linus Torvalds(除了他不会有谁了)在Linux邮件列表(当然不会在别的地方)中[宣布][1],在大概两个月后迎来了[第一个4.x系列的Linux内核的发布][2]。 + +像每次发布前那样,Linux 4.1带来了很多的改变。它们包括了硬件兼容性、电源管理、文件系统性能、以及你从没听说过的处理器的技术修复。 + +Linux 4.1 已经进入将在10月发布的 Ubuntu 15.10 。 + +### Linux 4.1 有哪些新东西 ### + +![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) + +*Tux 收到了邮件* + +这个标题只是说说而已,我们不是简单地将发布公告贴到这里。 + +我们会从(大量、冗长以及那些不明觉厉的的技术的)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。 + +#### 电源管理 #### + +你可以在Linux 4.1中找到的面向用户的一大特性是对 Intel 的 Cherry Trail 和 Bay Trai 芯片、Soc及Intel计算棒等设备的性能及能效的提升。 + +传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池寿命。这么多的进步自然不可能针对所有芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。 + +**Linux 4.1 亮点包括:** + +- ext4 有了文件系统层面的加密(感谢Google) +- 罗技游戏手柄lg4ff驱动改进了‘力反馈’ +- 东芝笔记本驱动进行了USB睡眠充电和背光改进 +- Xbox One控制器支持Rumble +- Wacom平板驱动改进了电源报告 +- 各种针对arm和x86设备电源管理改进 +- Samsung Exynos 3250 电源管理改进 +- 支持Bamboo平板 +- 联想OneLink Pro Dock获得USB支持 +- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡 + +### Ubuntu中安装Linux 4.1 ### + +虽然这次发布的内核被标记为稳定,但是Ubuntu用户并不需要迫切地安装它。 + +但如果你等不及了并且技术足够熟练,你可以从[Canonical的主干内核归档][3]中下载合适的软件包来安装Linux 4.1(或者冒着风险使用第三方PPA)。 + +10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://lkml.org/lkml/2015/6/22/8 +[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D diff --git a/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md deleted file mode 100644 index 11b9c10a26..0000000000 --- a/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md +++ /dev/null @@ -1,63 +0,0 @@ -Linux 4.1 发布了,下面是有哪些新的 -================================================================================ -**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** -**一个心的Linux内核 - 现代世界的心跳(如果我们想要让它充满诗意)已经发布了** - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) - -Linus Torvalds(还有谁?)在Linux邮件列表(还有哪里)中[宣布了][1]内核发布,同事也是大概两个月后迎来了[第一个4.x系列的发布][2]。 - -快速之外,像每次发布前那样,Linux 4.1带来了很大的改变。它从硬件兼容性到电源管理到文件系统性能到和你从没听说过的处理器的技术修复。 - -Linux 4.1 已经进入Ubuntu 15.10, 将在10月发布。 - -### Linux 4.1 有哪些新的 ### - -![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) -Tux邮件 - -子标题在嘴上,我们不会简单地就宣布公告。 - -我们从(大量冗长的及不能理解的技术)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。 - -#### 电源管理 #### - -你在Linux 4.1中面向用户的一大特性是对Intel Cherry Trail 和 Bay Trai 芯片的丰富性能以及电源效率的提升。Soc设备,如Intel计算棒。 - -传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池守密。这么高的受益不可能针对任何芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。 - -**Linux 4.1 亮点包括:** - -- ext4获得了文件系统层面的加密(感谢Google) -- 罗技游戏手柄lg4ff驱动提升‘力量反馈’ -- 东芝笔记本驱动获得USB睡眠充电和背光提升 -- Xbox One控制器支持 -- Wacom平板中更好的电源报告驱动 -- 不同的杂项。arm和x86设备电源管理提升 -- Samsung Exynos 3250 电源管理 -- 支持Bamboo屏板 -- 联想OneLink Pro Dock获得USB支持 -- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡 - -### Ubuntu中安装Linux 4.1 ### - -虽然这次发布的内核被标记为稳定,但是Ubuntu用户没有迫切需要区安装它。 - -如果你等不及了并且技术足够熟练,你可以从[Canonical的主流内核归档][3]中下载合适的来安装Linux 4.1(或者冒着风险使用第三方PPA)。 - -10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。 - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features - -作者:[Joey-Elijah Sneddon][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://lkml.org/lkml/2015/6/22/8 -[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features -[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D From c627ae8cb9bab6ddaa5a1237a4af1eb0c90d0f25 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 28 Jun 2015 20:33:17 +0800 Subject: [PATCH 34/76] [Translating] tech/20150527 How to edit your documents collaboratively on Linux.md --- ...150527 How to edit your documents collaboratively on Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md index 91d2bf6441..5b528e6165 100644 --- a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md +++ b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md @@ -1,3 +1,4 @@ +ictlyh Translating How to edit your documents collaboratively on Linux ================================================================================ > "Developed many years before by some high-strung, compulsive assistant, the Bulletin was simply a Word document that lived in a shared folder both Emily and I could access. Only one of us could open it at a time and add a new message, thought, or question to the itemized list. Then we'd print out the updated version and place it on the clipboard that sat on the shelf over my desk, removing the old ones as we went." ("The Devil Wears Prada" by Lauren Weisberger) From f52c472f4c9fc28dc63e17c503a7dd0daf10a3be Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Jun 2015 23:07:40 +0800 Subject: [PATCH 35/76] PUB:20141013 Compact Text Editors Great for Remote Editing and Much More @wwy-hust --- ... Great for Remote Editing and Much More.md | 222 ++++++++++++++++++ ... Great for Remote Editing and Much More.md | 214 ----------------- 2 files changed, 222 insertions(+), 214 deletions(-) create mode 100644 published/20141013 Compact Text Editors Great for Remote Editing and Much More.md delete mode 100644 translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md diff --git a/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md new file mode 100644 index 0000000000..8915ff5006 --- /dev/null +++ b/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -0,0 +1,222 @@ +适合于远程编辑以及更多环境的简洁文本编辑器 +================================================================================ +文本编辑器是用来编辑纯文本的软件。这种软件有许多用处,包括修改配置文件,编写程序源代码,记下一些想法或者甚至写一份购物列表。由于这种编辑器能都用于许多不同的方面,因此值得花些时间找一个最适合您喜好的编辑器。 + +不论编辑器有多么复杂,它们通常有一个共同的功能集,包括查找/替换文本,格式化文本,导入文件以及在文件中移动文本。 + +所有这些文本编辑器都是基于终端的应用,因此他们很适合在远程主机上编辑文件。文本编辑器通常也会提供一个图形化的用户界面,但依旧会保证快速和精简。 + +基于终端的应用程序在系统资源方面也是轻量级的(在低配置机器上很有用),比起它的图形化版本来也会更快、更高效,由于它们在X需要重启时也不会停止工作,因此非常适合编写脚本。 + +我选择了一些我最喜欢的开源文本编辑器,他们在使用系统资源方面都非常节俭。 + + + +### Textadept ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) + +Textadept是一款适合程序员的,快速、精简、可扩展、跨平台的开源文本编辑器。这个开源程序由C和Lua写就,并且于这些年间在速度和精简方面进行了优化。 + +Textadept是那些想要无限的扩展性且不愿牺牲速度或屈服于代码膨胀的程序员们的理想编辑器。 + +它也有一个用于终端的版本,仅仅依赖ncurses,适合在远程主机上进行编辑。 + +#### 功能包括: #### + +- 轻量级 +- 精简设计以最大化利用屏幕 +- 自包含的执行文件 - 无需安装 +- 全键盘驱动 +- 无限制的分割视图(GUI版本),以您所好任意水平或垂直的分割编辑器窗口。请注意Textadep不是一个选项卡式的编辑器。 +- 支持多达80种的编程语言 +- 强大的代码片段和快捷键命令 +- 代码自动补全和API查询 +- 无与伦比的扩展性 +- 书签 +- 查找和替换 +- 在文件中查找 +- 基于缓存的单词补全 +- 成熟的编程语言符号自动补全,以及显示API文档的功能 +- 主题:亮色、暗色、终端 +- 使用词法分析器将名称放到缓冲中,如评论、字符串、关键词 +- 支持会话 +- 快速打开 +- 许多可用的模块,包括对Java、Python、Ruby和近期打开文件列表的支持 +- 符合Gnome HIG用户接口的指导 +- 支持编辑Lua代码。许多Textadept对象和Lua的标准库支持语法自动补全和LuaDoc。 + +--- + +- 网址: [foicica.com/textadept][1] +- 开发者: Mitchell and contributors +- 许可证: MIT License +- 版本号: 7.7 + + +### Vim ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) + +vim是一个高级的文本编辑器,它在'vi'强大的基础上,并拥有更全面的功能集。 + +这个编辑器对编程和编辑其他纯ASCII的文件十分有用。所有的命令都由普通的键盘按键提供,能够使用十指来输入,因而十分快捷。另外,功能键可以由用户来定义,并且可也以使用鼠标。 + +Vim通常被称作"程序员的编辑器",它十分适合于编程,并被认为可以作为完整的集成开发环境。然而,这个软件并不是仅仅面向程序员。Vim适合于各种文本编辑,从编写email到修改配置文件。 + +Vim的界面基于文本界面下的命令行。尽管它的图形化版本gVim为常用的命令添加了菜单和工具栏,但这个软件的整个功能依旧依赖于它的命令行模式。 + +#### 功能包括: #### + +- 3 种模式: + - 命令模式 + - 插入模式 + - 命令行模式 +- 无限制的撤销 +- 多个窗口和缓冲区 +- 平滑的插入模式 +- 根据所编辑的文件的类型使用不同的颜色或风格进行语法高亮 +- 交互命令 + - 标记一行 + - vi 行缓冲 + - 移动代码块 +- 块操作 +- 命令行历史 +- 扩展的正则表达式 +- 可编辑压缩/打包文件 (gzip, bzip2, zip, tar) +- 文件名补全 +- 标记跳转 +- 折叠文本 +- 缩进 +- ctags和cscope整合 +- 100%与vi的模式兼容 +- 插件用于添加/扩展功能 +- 宏 +- vimscript, Vim的内部脚本 +- Unicode支持 +- 多语言支持 +- 在线帮助支持 + +--- + +- 网址: [www.vim.org][2] +- 开发者: Bram Moolenaar +- 许可证: GNU GPL compatible (charityware) +- 版本号: 7.4 + + + +### ne ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) + +ne是一款全屏幕的开源文本编辑器。它像是一个比vi更容易学习的vi替代物,并且可以在POSIX-兼容的系统中便携使用。 + +ne对于新手来说易于使用,但也非常强大并有完全可配置的引导程序,并且在资源使用上十分节约。 + +#### 功能包括: #### + +- 三种用户界面: 控制键,命令行、菜单;按键和菜单都可配置 +- 语法高亮 +- 对于UTF-8文件的完全支持,包括占据多列的字符(宽字符) +- 文档,剪切块,显示的维度和文件/行号长度都有编号,并且仅受制于机器的整型字长 +- 简单的脚本语言,脚本可以用简单易理解的录制/播放的方式制作 +- 无限制的撤销/重做功能(可以通过命令禁用) +- 基于被编辑的文件扩展名的自动个性化配置系统 +- 使用您文档中的词语做字典来进行自动前缀补全 +- 易用的文件存取功能 +- 扩展的正则表达式可用于查找和替换,类似emacs和vi +- 非常紧凑的内存模型,在加载和修改大型文件时十分快速 +- 可编辑二进制文件 + +--- + +- 网址: [ne.di.unimi.it][3] +- 开发者: Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis +- 许可证: GNU GPL v3 +- 版本号: 2.5 + +---------- + +### Zile ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) + +Zile(Zile Is Lossy Emacs,Emacs精简版),它是一个小型的Emacs的克隆版。Zile是一个可定制的,自文档化,实时显示的编辑器,Zile被开发的尽可能像Emacs一样,每个Emacs用户都会对Zile感到亲切。 + +Zile以它极小的RAM用量,大约130KB,以及快速开始编辑而闻名。它是支持8比特字符集的,允许用于编写任何种类的文件。 + +#### 功能包括: #### + +- 小型但快速、强大 +- 多个缓冲区,允许多级的撤销 +- 多窗口 +- 以最小的缓冲区完成补全 +- 自动填充 (自动换行) +- Registers +- 看起来像Emacs,键序列、功能和变量名都与Emacs相同 +- Killing +- Yanking +- 自动行末检测 + +--- + +- 网址: [www.gnu.org/software/zile][4] +- 开发者: Reuben Thomas, Sandro Sigala, David A. Capello +- 许可证: GNU GPL v2 +- 版本号: 2.4.11 + + + +### nano ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) + +nano是基于curses库的文本编辑器。它是Pico(Pine电子邮件客户端编辑器)的一个复刻版。 + +由于Pine套件的许可证问题诉讼案(Pine并未以开源许可证发布),并且也因为Pine缺少一些重要的功能,nano项目于1999年发起。 + +nano致力于赶上Pico的功能和其易用性,与此同时提供更多的功能,但不集成Pine/Pico的邮件客户端。 + +nano像Pico一样是以键盘为导向的设计,可以用控制键来控制。 + +#### 功能包括: #### + +- 交互式的查找和替换 +- 彩色语法高亮 +- 转到行号和列号处 +- 自动缩进 +- 功能开关 +- 支持UTF-8 +- 混合型的文件类型自动转换 +- 逐字输入模式 +- 多个文件缓冲区 +- 平滑滚动 +- 括号匹配 +- 自定义引用字符串 +- 备份文件 +- 国际化支持 +- tab补全文件名 + +--- + +- 网址: [nano-editor.org][5] +- 开发者: Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger +- 许可证: GNU GPL v3 +- 版本号: 2.2.6 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html + +作者:Frazer Kline +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://foicica.com/textadept/ +[2]:http://www.vim.org/ +[3]:http://ne.di.unimi.it/ +[4]:http://www.gnu.org/software/zile/ +[5]:http://nano-editor.org/ diff --git a/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md deleted file mode 100644 index 766f429ba0..0000000000 --- a/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md +++ /dev/null @@ -1,214 +0,0 @@ -ʺԶ̱༭Լ໷ļı༭ -================================================================================ -ı༭༭ıô޸ļдԴ룬һЩ뷨дһݹбֱ༭ܶ಻ͬĻֵûЩʱһʺϲõı༭ - -۱༭жôӣͨһͬĹܼ/滻ıʽıļԼļƶı - -Щı༭ǻն˵ӦãǺʺԶϱ༭ļı༭ͨҲṩһͼλû棬ɻᱣ֤ٺС - -ն˵ӦóϵͳԴҲģڵûϺãͼλ汾Ҳ졢ЧXҪʱҲֹͣ˷dzʺϱдű - -ѡһЩϲĿԴı༭ʹϵͳԴ涼dzڼ - ----------- - -### Textadept ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) - -TextadeptһʺϳԱģ١Сչƽ̨ĿԴı༭ԴCLuaдͣЩٶȺСŻ - -TextadeptЩҪ޵չҲԸٶȻڴ͵ijԱǵ༭ - -Ҳһն˵İ汾ncursesʺԶϽб༭ - -#### ܰ: #### - -- -- СĻ -- ԰ִļ - 谲װ -- ȫ -- ƵķָͼGUI汾ˮƽֱķָ༭ڡעTextadeptûдļǩ -- ֶ֧80ֵı -- ǿƬο -- ԶȫAPIѯ -- ױȵչ -- ǩ -- Һ滻 -- ļв -- ڻĵʲȫ -- ıԷԶȫԼʾAPIĵĹ -- ⣺ڰն -- ʹôʷƷԪأַۡؼ -- Զ̻Ự -- ٴ -- õģ飬JavaPythonRubyͽڴļб֧ -- Gnome HIGûӿڵָ -- ֱ֧༭Lua롣﷨ԶȫLuaDocTextadeptLuaı׼⡣ - -- ַ: [foicica.com/textadept][1] -- : Mitchell and contributors -- ֤: MIT License -- 汾: 7.7 - ----------- - -### Vim ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) - -vimһ߼ı༭'vi'ǿ󣬲ӵиȫĹܼ - -༭Ա̺ͱ༭ASCIIļʮáеͨļַṩܹʹʮָ룬ʮֿݡ⣬ܼû壬ҿҲʹꡣ - -Vimͨ"Աı༭"ʮʺڱ̣ΪΪļɿȻǽԱVim߶Ӹı༭ӱдemail޸ļ - -VimĽӿڻıµСͼλ汾gVimΪõ˲˵͹ģʽ - -#### ܰ: #### - -- 3 ģʽ: -- - Command ģʽ -- - Insert ģʽ -- - Command line ģʽ -- Ƶij -- ںͻ -- ƽģʽ -- ༭ļʹòͬɫ﷨ -- -- - һ -- - vi л -- - ƶ -- -- ʷ -- չʽ -- ༭ѹ/ļ (gzip, bzip2, zip, tar) -- ļȫ -- ת -- ۵ı -- -- ctagscscope -- 100%viģʽ -- /չ -- -- vimscript, Vimڲű -- Unicode֧ -- ֧ -- ֧߰ - -- ַ: [www.vim.org][2] -- : Bram Moolenaar -- ֤: GNU GPL compatible (charityware) -- 汾: 7.4 - ----------- - -### ne ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) - -neһȫĻĿԴı༭һviѧϰviҿPOSIX-ݵϵͳбЯʹá - -ne˵ʹãҲdzǿȫõ򣬲ԴʹʮֽԼ - -#### ܰ: #### - -- ûӿڣ ƻкͲ˵Ͳ˵ -- ﷨ -- UTF-8ļȫַ֧֣ -- ĵУʾάȺļ/кųȶбţҽڻֳ -- 򵥵Ľűԣűü¼/ŵķʽ -- Ƶij/ܣͨã -- ڱ༭ļչԶԻϵͳ -- ʹĵеĴֵԶǰ׺ȫ -- õļȡ -- չʽڲҺ滻emacsvi -- dzյڴģͣڼغ޸Ĵļʱʮֿ -- ɱ༭ļ - -- ַ: [ne.di.unimi.it][3] -- : Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis -- ֤: GNU GPL v3 -- 汾: 2.5 - ----------- - -### Zile ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) - -ZileLossy EmacsEmacs棩һС͵EmacsĿ¡档ZileһɶƵģĵʵʱʾı༭ڱдZileʱEmacsһܵСÿEmacsûZileеС - -ZileСRAMԼ130KBԼٿʼ༭8ģڱдκļ - -#### ܰ: #### - -- С͵١ǿ -- ༶ij -- ര -- ã̫ô롿 -- СĻɲȫ -- Զ (Զ) -- Ĵͼ -- EmacsСܺͱEmacsͬ -- Killing -- Yanking -- Զĩ - -- ַ: [www.gnu.org/software/zile][4] -- : Reuben Thomas, Sandro Sigala, David A. Capello -- ֤: GNU GPL v2 -- 汾: 2.4.11 - ----------- - -### nano ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) - -nanoǻcursesı༭PicoPineʼͻ˱༭һ̰档 - -Pine֤ϰPineδԿԴ֤ҲΪPineȱһЩҪĹܣnanoĿ1999꿪ʼ - -nanoڸPicoĹܺԣͬʱṩĹܣPine/Picoʼͻˡ - -nanoPicoһԼΪƣÿƼơ - -#### ܰ: #### - -- ʽIJҺ滻 -- ɫ﷨ -- תкźкŴ -- Զ -- ܿ -- ֧UTF-8 -- ͵ļԶת -- ģʽ -- ļ -- ƽ -- ƥ -- Զַ -- ļ -- ʻ֧ -- tabȫļ - -- ַ: [nano-editor.org][5] -- : Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger -- ֤: GNU GPL v3 -- 汾: 2.2.6 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html - -ߣFrazer Kline -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[1]:http://foicica.com/textadept/ -[2]:http://www.vim.org/ -[3]:http://ne.di.unimi.it/ -[4]:http://www.gnu.org/software/zile/ -[5]:http://nano-editor.org/ From dc02eb35dc83392f83ba90a184920dac36e229e5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Jun 2015 23:40:05 +0800 Subject: [PATCH 36/76] PUB:20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux @wwy-hust --- ...nds for RPM Package Management in Linux.md | 287 ++++++++++++++++++ ...nds for RPM Package Management in Linux.md | 287 ------------------ 2 files changed, 287 insertions(+), 287 deletions(-) create mode 100644 published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md delete mode 100644 translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md diff --git a/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md new file mode 100644 index 0000000000..89266f8b0d --- /dev/null +++ b/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md @@ -0,0 +1,287 @@ +27 个 Linux 下软件包管理工具 DNF 命令例子 +================================================================================ +DNF即Dandified YUM,是基于RPM的Linux发行版的下一代软件包管理工具。它首先在Fedora 18中出现,并且在最近发行的Fedora 22中替代了[YUM工具集][1]。 + +![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) + +DNF致力于改善YUM的瓶颈,即性能、内存占用、依赖解决、速度和许多其他方面。DNF使用RPM、libsolv和hawkey库进行包管理。尽管它并未预装在CentOS和RHEL 7中,但您可以通过yum安装,并同时使用二者。 + +您也许想阅读更多关于DNF的信息: + +- [使用DNF取代Yum背后的原因][2] + +最新的DNF稳定版本是2015年5月11日发布的1.0(在写这篇文章之前)。它(以及所有DNF之前版本)主要由Python编写,并以GPL v2许可证发布。 + +### 安装DNF ### + +尽管Fedora 22官方已经过渡到了DNF,但DNF并不在RHEL/CentOS 7的默认仓库中。 + +为了在RHEL/CentOS系统中安装DNF,您需要首先安装和开启epel-release仓库。 + + # yum install epel-release + 或 + # yum install epel-release -y + +尽管并不建议在使用yum时添上'-y'选项,因为最好还是看看什么将安装在您的系统中。但如果您对此并不在意,则您可以使用'-y'选项以自动化的安装而无需用户干预。 + +接下来,使用yum命令从epel-realease仓库安装DNF包。 + + # yum install dnf + +在您装完dnf后,我会向您展示27个实用的dnf命令和例子,以便帮您更容易和高效的管理基于RPM包的发行版。 + +### 1. 检查DNF版本 ### + +检查您的系统上安装的DNF版本。 + + # dnf --version + +![检查DNF版本](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) + +### 2. 列出启用的DNF仓库 ### + +dnf命令中的'repolist'选项将显示您系统中所有启用的仓库。 + + # dnf repolist + +![检查所有开启的仓库](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) + +### 3. 列出所有启用和禁用的DNF仓库 ### + +'repolist all'选项将显示您系统中所有启用/禁用的仓库。 + + # dnf repolist all + +![列出所有启用/禁用的仓库](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) + +### 4. 用DNF列出所有可用的且已安装的软件包 ### + +'dnf list'命令将列出所有仓库中所有可用的软件包和您Linux系统中已安装的软件包。 + + # dnf list + +![用DNF列出所有的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) + +### 5. 用DNF列出所有已安装的软件包 ### + +尽管'dnf list'命令将列出所有仓库中所有可用的软件包和已安装的软件包。然而像下面一样使用'list installed'选项将只列出已安装的软件包。 + + # dnf list installed + +![列出已安装的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) + +### 6. 用DNF列出所有可用的软件包 ### + +类似的,可以用'list available'选项列出所有开启的仓库中所有可用的软件包。 + + # dnf list available + +![用DNF列出可用的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) + +### 7. 使用DNF查找软件包 ### + +如果您不太清楚您想安装的软件包的名字,这种情况下,您可以使用'search'选项来搜索匹配该字符(例如,nano)和字符串的软件包。 + + # dnf search nano + +![通过关键字搜索软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) + +### 8. 查看哪个软件包提供了某个文件/子软件包? ### + +dnf的选项'provides'能查找提供了某个文件/子软件包的软件包名。例如,如果您想找找哪个软件包提供了您系统中的'/bin/bash'文件,可以使用下面的命令 + + # dnf provides /bin/bash + +![查找提供文件的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) + +### 9. 使用DNF获得一个软件包的详细信息 ### + +如果您想在安装一个软件包前知道它的详细信息,您可以使用'info'来获得一个软件包的详细信息,例如: + + # dnf info nano + +![用DNF查看软件信息](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) + +### 10. 使用DNF安装软件包 ### + +想安装一个叫nano的软件包,只需运行下面的命令,它会为nano自动的解决和安装所有的依赖。 + + # dnf install nano + +![用DNF安装软件](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) + +### 11. 使用DNF更新一个软件包 ### + +您可能只想更新一个特定的包(例如,systemd)并且保留系统内剩余软件包不变。 + + # dnf update systemd + +![更新一个软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) + +### 12. 使用DNF检查系统更新 ### + +检查系统中安装的所有软件包的更新可以简单的使用如下命令: + + # dnf check-update + +![检查系统更新](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) + +### 13. 使用DNF更新系统中所有的软件包 ### + +您可以使用下面的命令来更新整个系统中所有已安装的软件包。 + + # dnf update + 或 + # dnf upgrade + +![更新系统](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) + +### 14. 使用DNF来移除/删除一个软件包 ### + +您可以在dnf命令中使用'remove'或'erase'选项来移除任何不想要的软件包。 + + # dnf remove nano + 或 + # dnf erase nano + +![移除系统中的软件](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) + +### 15. 使用DNF移除于依赖无用的软件包(Orphan Packages) ### + +这些为了满足依赖安装的软件包在相应的程序删除后便不再需要了。可以用过下面的命令来将它们删除。 + + # dnf autoremove + +![移除无用的依赖包](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) + +### 16. 使用DNF移除缓存的软件包 ### + +我们在使用dnf时经常会碰到过期的头部信息和不完整的事务,它们会导致错误。我们可以使用下面的语句清理缓存的软件包和包含远程包信息的头部信息。 + + # dnf clean all + +![移除DNF缓存](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) + +### 17. 获得特定DNF命令的帮助 ### + +您可能需要特定的DNF命令的帮助(例如,clean),可以通过下面的命令来得到: + + # dnf help clean + +![获得某一命令帮助](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) + +### 18. 列出所有DNF的命令和选项 ### + +要显示所有dnf的命令和选项,只需要: + + # dnf help + +![获得命令选项帮助](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) + +### 19. 查看DNF的历史记录 ### + +您可以调用'dnf history'来查看已经执行过的dnf命令的列表。这样您便可以知道什么被安装/移除及其时间戳。 + + # dnf history + +![查看历史记录](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) + +### 20. 显示所有软件包组 ### + +'dnf grouplist'命令可以显示所有可用的或已安装的软件包,如果没有什么输出,则它会列出所有已知的软件包组。 + + # dnf grouplist + +![列出所有软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) + +### 21. 使用DNF安装一个软件包组 ### + +要安装一组由许多软件打包在一起的软件包组(例如,Educational Softaware),只需要执行: + + # dnf groupinstall 'Educational Software' + +![安装一个软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) + +### 22. 更新一个软件包组 ### + +可以通过下面的命令来更新一个软件包组(例如,Educational Software): + + # dnf groupupdate 'Educational Software' + +![更新软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) + +### 23. 移除一个软件包组 ### + +可以使用下面的命令来移除一个软件包组(例如,Educational Software): + + # dnf groupremove 'Educational Software' + +![移除软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) + +### 24. 从某个特定的仓库安装一个软件包 ### + +DNF可以从任何特定的仓库(比如 epel)安装一个软件包(例如,phpmyadmin): + + # dnf --enablerepo=epel install phpmyadmin + +![从特定的仓库安装软件](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) + +### 25. 将已安装的软件包同步到稳定发行版 ### + +'dnf distro-sync'将同步所有已安装的软件包到所有开启的仓库中最近的稳定版本。如果没有选择软件包,则会同步所有已安装的软件包。 + + # dnf distro-sync + +![将包同步至稳定版](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) + +### 26. 重新安装一个软件包 ### + +'dnf reinstall nano'命令将重新安装一个已经安装的软件包(例如,nano): + + # dnf reinstall nano + +![重新安装软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) + +### 27. 降级一个软件包 ### + +选项'downgrade'将会使一个软件包(例如,acpid)回退到低版本。 + + # dnf downgrade acpid + +示例输出 + + Using metadata from Wed May 20 12:44:59 2015 + No match for available package: acpid-2.0.19-5.el7.x86_64 + Error: Nothing to do. + +**我观察到**:dnf不会按预想的那样降级一个软件包。这已做为一个bug被提交。 + +### 结论 ### + +DNF是YUM管理器的优秀替代品。它试着自动做许多甚至不推荐有经验的Linux系统管理员做的工作。例如: + +- `--skip-broken`不被DNF识别,并且DNF中没有其替代命令。 +- 尽管您可能会运行dnf provides,但再也没有'resolvedep'命令了。 +- 没有'deplist'命令用来发现软件包依赖。 +- 您排除一个仓库意味着在所有操作上排除该仓库,而在yum中,排除一个仓库只在安装和升级等时刻排除他们。 + +许多Linux用户对于Linux生态系统的走向不甚满意。首先[Systemd替换了init系统][3]v,现在DNF将于不久后替换YUM,首先是Fedora 22,接下来是RHEL和CentOS。 + +您怎么看呢?是不是发行版和整个Linux生态系统并不注重用户并且在朝着与用户愿望相悖的方向前进呢?IT行业里有这样一句话 - “如果没有坏,为什么要修呢?”,System V和YUM都没有坏。 + +上面便是这篇文章的全部了。请在下方留言以让我了解您的宝贵想法。点赞和分享以帮助我们传播。谢谢! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ +[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ diff --git a/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md deleted file mode 100644 index 48dd213d68..0000000000 --- a/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md +++ /dev/null @@ -1,287 +0,0 @@ -27LinuxߡDNFYumķ֧ -================================================================================ -DNFDandified YUMǻRPMķаһߡFedora 18г֣еFedora 22[YUM߼][1] - -![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) - -DNFڸYUMƿܡڴռáٶȺ档DNFʹRPMlibsolvhawkeyаδԤװCentOSRHEL 7Уͨyumװͬʱʹöߡ - -ҲĶDNFϢ - -- [ʹDNFȡYumԭ][2] - -µDNFȶ汾2015511շ1.0дƪ֮ǰԼDNF֮ǰ汾ҪPythonдGPL v2֤ - -### װDNF ### - -Fedora 22ٷѾɵDNFDNFRHEL/CentOS 7ĬϲֿС - -ΪRHEL/CentOSϵͳаװDNFҪȰװͿepel-releaseֿ⡣ - - # yum install epel-release - - # yum install epel-release -y - -ܲʹyumʱ'-y'ѡΪûǿʲôװϵͳСԴ˲⣬ʹ'-y'ѡԶİװûԤ - -ʹyumepel-realeaseֿⰲװDNF - - # yum install dnf - -װdnfһչʾ27ʵõdnfӣԱ׺͸ЧĹRPMķа档 - -### 1. DNF汾 ### - -ϵͳϰװDNF汾 - - # dnf --version - -![DNF汾](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) - -### 2. гDNFֿ ### - -dnfе'repolist'ѡʾϵͳпIJֿ⡣ - - # dnf repolist - -![пIJֿ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) - -### 3. гп͹رյDNFֿ ### - -'repolist all'ѡʾϵͳп/رյIJֿ⡣ - - # dnf repolist all - -![гп/رյIJֿ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) - -### 4. DNFгпõѰװ ### - -'dnf list'гвֿпõLinuxϵͳѰװ - - # dnf list - -![DNFге](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) - -### 5. DNFгѰװ ### - -'dnf list'гвֿпõѰװȻһʹ'list installed'ѡֻгѰװ - - # dnf list installed - -![гѰװ](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) - -### 6. DNFгпõ ### - -Ƶģ'list available'ѡгпIJֿпõ - - # dnf list available - -![DNFгõ](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) - -### 7. ʹDNF ### - -̫밲װ֣£ʹ'search'ѡƥַ磬nanoַ - - # dnf search nano - -![ͨؼ](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) - -### 8. 鿴ĸṩijļ/ ### - -dnfѡ'provides'ܲṩijļ/磬Ǹṩϵͳе'/bin/bash'ļʹ - - # dnf provides /bin/bash - -![ṩļ](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) - -### 9. ʹDNFһϸϢ ### - -ڰװһǰ֪ϸϢʹ'info'һϸϢ磺 - - # dnf info nano - -![DNF鿴Ϣ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) - -### 10. ʹDNFװ ### - -밲װһnanoֻΪnanoԶĽͰװе - - # dnf install nano - -![DNFװ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) - -### 11. ʹDNFһ ### - -ֻһضİ磬systemdұϵͳʣ䡣 - - # dnf update systemd - -![һ](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) - -### 12. ʹDNFϵͳ ### - -ϵͳаװĸ¿Լ򵥵ʹdnfУ - - # dnf check-update - -![ϵͳ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) - -### 13. ʹDNFװϵͳе ### - -ʹϵͳѰװ - - # dnf update - - # dnf upgrade - -![ϵͳ](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) - -### 14. ʹDNFƳ/ɾһ ### - -dnfʹ'remove''erase'ѡƳκβҪ - - # dnf remove nano - - # dnf erase nano - -![Ƴϵͳе](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) - -### 15. ʹDNFƳõOrphan Packages ### - -ЩΪװӦijɾ㲻Ҫˡùɾ - - # dnf autoremove - -![Ƴõ](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) - -### 16. ʹDNFƳ ### - -ʹdnfʱڵͷͲǻᵼ´ǿʹͰԶ̰Ϣͷ - - # dnf clean all - -![ƳDNF](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) - -### 17. ضDNFİ ### - -ҪضDNFİ磬cleanͨõ - - # dnf help clean - -![ijһ](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) - -### 18. гDNFѡ ### - -ҪʾdnfѡֻҪ - - # dnf help - -![ѡ](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) - -### 19. 鿴DNFʷ¼ ### - -Ե'dnf history'鿴Ѿִйdnfб֪ʲôװ/ƳԼʱ - - # dnf history - -![鿴ʷ¼](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) - -### 20. ʾ ### - -'dnf grouplist'ԴӡпõĻѰװûʲôг֪顣 - - # dnf grouplist - -![г](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) - -### 21. ʹDNFװһ ### - -Ҫװһһ飨磬Educational SoftawareֻҪִУ - - # dnf groupinstall 'Educational Software' - -![װһ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) - -### 22. һ ### - -ͨһ飨磬Educational Software - - # dnf groupupdate 'Educational Software' - -![](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) - -### 23. Ƴһ ### - -ʹƳһ飨磬Educational Software - - # dnf groupremove 'Educational Software' - -![Ƴ](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) - -### 24. ijضIJֿⰲװһ ### - -DNFԴκضIJֿⰲװһ磬phpmyadmin - - # dnf --enablerepo=epel install phpmyadmin - -![ضIJֿⰲװ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) - -### 25. Ѱװͬȶа ### - -'dnf distro-sync'ͬѰװпIJֿȶ汾ûѡͬѰװ - - # dnf distro-sync - -![ͬȶ](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) - -### 26. °װһ ### - -'dnf reinstall nano'°װһѾװ磬nano - - # dnf reinstall nano - -![°װ](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) - -### 27. һ ### - -ѡ'downgrade'ʹһ磬acpid˵Ͱ汾 - - # dnf downgrade acpid - -ʾ - - Using metadata from Wed May 20 12:44:59 2015 - No match for available package: acpid-2.0.19-5.el7.x86_64 - Error: Nothing to do. - -**ҵĹ۲**dnfᰴԤһΪһbugύ - -### ### - -DNFYUMƷԶоLinuxϵͳԱĹ磺 - -- `--skip-broken`DNFʶ𣬲DNFû -- ܻdnf providesҲû'resolvedep'ˡ -- û'deplist' -- ųһֿζвųòֿ⣬yumУųһֻֿڰװʱųǡ - -LinuxûLinux̬ϵͳ⡣[Systemd滻init system][3]vDNFڲú滻YUMFedora 22RHELCentOS - -ôأDzǷаLinux̬ϵͳעûڳûԸ㣵ķǰأITҵһ仰 - ûлΪʲôҪأSystem VYUMûл - -ƪµȫˡ·˽ı뷨޺ͷ԰Ǵлл - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ - -ߣ[Avishek Kumar][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ -[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ From b7b21847bb0114a9e64159ce32adcf39f304b464 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 29 Jun 2015 12:23:34 +0800 Subject: [PATCH 37/76] Update 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...erformance Tuning and Optimization Tips.md | 181 +++++++++--------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index e01e9bf787..942381170e 100644 --- a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,20 +1,21 @@ -translation by strugglingyouth +translated -15 Useful MySQL/MariaDB Performance Tuning and Optimization Tips +15 个有用的 MySQL/MariaDB 性能调整和优化技巧 ================================================================================ -MySQL is a powerful open source Relational Database Management System or in short RDBMS. It was released back in 1995 (20 years old). It uses Structured Query Language which is probably the most popular choice for managing content within a database. The latest MySQL version is 5.6.25 and was released on 29 May 2015. +MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 -An interesting fact about MySQL is the fact that the name comes from Michael Widenius’s (MySQL’s creator) daughter My. Even though there are plenty of interesting facts about MySQL, this article is meant to show you some useful practices to help you manage your MySQL server. +尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 ![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) -MySQL Performance Tuning +MySQL性能优化 -In April 2009 the MySQL project was bought by Oracle. As a result a MySQL community fork called MariaDB was created. The main reason for creating the fork was to keep the project free under the General Public License. +2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 -Today MySQL and MariaDB are one of the most (if not the most) frequently used RDBMS used for web applications such as WordPress, Joomla, Magento and others. +今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 -This article will show you some basic, yet useful tips how to optimize the fine tune the performance of MySQL/MariaDB. Please keep in mind that this article assumes that you already have MySQL or MariaDB installed. If you are still wondering how to install them on your system, you can follow our extensive guides here: + +这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: - [Installing LAMP on RHEL/CentOS 7][1] - [Installing LAMP on Fedora 22][2] @@ -23,207 +24,209 @@ This article will show you some basic, yet useful tips how to optimize the fine - [Install MariaDB on Gentoo Linux][5] - [Install MariaDB on Arch Linux][6] -**Important**: Before we start – do not accept this suggestions blindly. Each MySQL setup is unique and requires additional thought, before making any changes. +**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 -Things you need to know: -- MySQL/MariaDB configuration file is located in `/etc/my.cnf`. Every time you modify this file you will need to restart the MySQL service so the new changes can take effect. -- For writing this article MySQL version 5.6 has been used as template. +你需要明白这些: -### 1. Enable InnoDB file-per-table ### +- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 +- 这篇文章使用MySQL 5.6版本 。 -First it is important to explain that InnoDB is a storage engine. MySQL and MariaDB use InnoDB as default storage engine. In the past MySQL used to keep database tables and indexes in a system tablespace. This approach was meant for servers which sole purpose is database processing and their storage disk is not used for any other purposes. +### 1. 启动 InnoDB 的`file-per-table` ### -The InnoDB provides more flexible approach and each database information is kept in a `.ibd` data file. Each .ibd file represents a tablespace of its own. That way database operations such as “TRUNCATE” can be completed faster and you may also reclaim unused space when dropping or truncating a database table. +首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 -Another benefit of this configuration is the fact that you can keep some of the database tables in a separate storage device. This can greatly improve the I/O load on your disks. +InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 -The innodb_file_per_table is enabled by default in MySQL 5.6 and above. You can see that in /etc/my.cnf file. The directive looks like this: +这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 + +MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: innodb_file_per_table=1 -### 2. Store MySQL Database Data on Separate Partition ### +### 2. 将MySQL数据库中的数据放在独立分区上 ### -**Note**: This setup only works with MySQL, but not with MariaDB. +**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. -Sometimes OS read/writes can slow down the performance of your MySQL server, especially if located on same hard drive. Instead, I would recommend using separate hard drive (preferably SSD) for the MySQL service. +有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 -To complete, this you will need to attach the new drive to your computer/server. For the purpose of this article, I will assume that the drive will be under /dev/sdb. +要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 -The next step is to prepare the new drive: +下一步将是准备新的分区: # fdisk /dev/sdb -Now press “n” to create new partition. Next press “p” to make the new partition primary. After that, set the partition number from 1-4. After that you will select the partition size. Press enter here. On the next step you will need to configure the size of the partition. +现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 -If you wish to use the entire disk press enter once more. Otherwise you can manually set the size of the new partition. When ready press “w” to write the changes. Now we will need to create a filesystem for our new partition. This can be easily done with: +如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: # mkfs.ext4 /dev/sdb1 -Now we will mount our new partition in a folder. I have named my folder “ssd” and created in the root directory: +现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: # mkdir /ssd/ -We are ready to mount the new partition we just made in the new folder: +挂载新分区到刚才创建的文件夹下: # mount /dev/sdb1 /ssd/ -You can perform the mount at startup by adding the following line in /etc/fstab file. +你可以添加如下行在/etc/fstab文件中设置开机自动挂载: /dev/sdb1 /ssd ext3 defaults 0 0 -Now you are ready to move MySQL to the new disk. First stop the MySQL service with: +现在我们移动MySQL到新磁盘中。首先停止服务: # service mysqld stop -I would recommend you stopping Apache/nginx as well to prevent any attempts to write in the databases: +我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: # service httpd stop # service nginx stop -Now copy the entire MySQL directory in the new drive: +现在我们复制完整的MySQL目录到新分区中: # cp /var/lib/mysql /ssd/ -Rp -This may take a while depending on the site of your MySQL databases. Once this process is complete rename the MySQL directory: +这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: # mv /var/lib/mysql /var/lib/mysql-backup -Next we will create a symlink. +然后创建一个链接: # ln -s /ssd/mysql /var/lib/mysql -Now you are ready to start your MySQL and web service: +现在启动你的MySQL和web服务: # service mysqld start # service httpd start # service nginx start -At this point your MySQL databases will be accessed from the new drive. +以后你的数据库将使用新的磁盘访问。 -### 3. Optimizing InnoDB buffer pool Usage ### +### 3. 优化InnoDB的缓冲区 ### -The InnoDB engine has a buffer pool used for caching data and indexes in memory. This of course will help your MySQL/MariaDB queries be executed significantly faster. Choosing the proper size here requires some very important decisions and good knowledge on your system’s memory consumption. +InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 -Here is what you need to consider: +下面是你需要考虑的: -- How much memory you need for other processes. This includes your system processes, page tables, socket buffers. -- Is your server dedicated for MySQL or you will be running other memory hungry services. +- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 +- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 -On a dedicated box, you would probably want to give about 60-70% of the memory to the innodb_buffer_pool_size. If you plan on running more services on a single box, you should re-consider the amount of memory you dedicate for your innodb_buffer_pool_size. -The value that you should edit in my.cnf is: +在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 + +你需要设置my.cnf中的此项: innodb_buffer_pool_size -### 4. Avoid Swappiness in MySQL ### +### 4. 在MySQL中避免使用Swappiness ### -Swapping is process that occurs when system moves part of memory to a special disk space called “swap”. The event usually appears when your system runs out of physical memory and instead of freeing up some RAM, the system pushed the information into disk. As you might have guess the disk is much slower than your RAM. +使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 -By default the option is enabled: +默认情况下该选项已经启用: # sysctl vm.swappiness vm.swappiness = 60 -To disable swappiness, run the following command: +使用以下命令关闭swappiness: # sysctl -w vm.swappiness=0 -### 5. Set MySQL Max Connections ### +### 5. 设置MySQL的最大连接数 ### -The max_connections directive tells your server how many concurrent connections are permitted. The MySQL/MariaDB server allows the value given in max_connections + 1 for user with SUPER privileges. The connection is opened only for the time MySQL query is executed – after that it is closed and new connection can take its place. +`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 -Keep in mind that too many connections can cause high RAM usage and lock up your MySQL server. Usually small websites will require between 100-200 connections while larger may require 500-800 or even more. The value you apply here strongly depends on your particular MySQL/MariaDB usage. +请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 -You can dynamically change the value of `max_connections`, without having to restart the MySQL service by running: +你可以动态的改变`max_connections`的值而无需重启MySQL服务器: # mysql -u root -p mysql> set global max_connections := 300; -### 6. Configure MySQL thread_cache_size ### +### 6. 配置MySQL的`thread_cache_size`变量 ### -The `thread_cache_size` directive sets the amount of threads that your server should cache. As the client disconnects, his threads are put in the cache if they are less than the thread_cache_size. Further requests are completed by using the threads stored in the cache. + `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 -To improve your performance you can set the thread_cache_size to a relatively high number. To find the thread cache hit rate, you can use the following technique: +要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: mysql> show status like 'Threads_created'; mysql> show status like 'Connections'; -Now use the following formula to calculate the thread cache hit rate percentage: +你可以用以下公式来计算线程池的使用率: 100 - ((Threads_created / Connections) * 100) -If you get a low number, it means that most of the new mysql connections are starting new thread instead of loading from cache. You will surely want to increase the thread_cache_size in such cases. +如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 -The good thing here is that the thread_cache_size can be dynamically changed without having to restart the MySQL service. You can achieve this by running: +但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: mysql> set global thread_cache_size = 16; -### 7. Disable MySQL Reverse DNS Lookups ### +### 7.禁用MySQL的DNS反向查询 ### -By default MySQL/MariaDB perform a DNS lookup of the user’s IP address/Hostname from which the connection is coming. For each client connection, the IP address is checked by resolving it to a host name. After that the host name is resolved back to an IP to verify that both match. +当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 -This unfortunately may cause delays in case of badly configured DNS or problems with DNS server. This is why you can disable the reverse DNS lookup by adding the following in your configuration file: +当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: [mysqld] # Skip reverse DNS lookup of clients skip-name-resolve -You will have to restart the MySQL service after applying these changes. +更改后需要重新启动你的MySQL服务器. -### 8. Configure MySQL query_cache_size ### +### 8. 配置MySQL的`query_cache_size`变量 ### -If you have many repetitive queries and your data does not change often – use query cache. People often do not understand the concept behind the `query_cache_size` and set this value to gigabytes, which can actually cause degradation in the performance. +如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 -The reason behind that is the fact that threads need to lock the cache during updates. Usually value of 200-300 MB should be more than enough. If your website is relatively small, you can try giving the value of 64M and increase in time. +背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 -You will have to add the following settings in the MySQL configuration file: +添加以下选项到你的MySQL配置文件中: query_cache_type = 1 query_cache_limit = 256K query_cache_min_res_unit = 2k query_cache_size = 80M -### 9. Configure tmp_table_size and max_heap_table_size ### +### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### -Both directives should have the same size and will help you prevent disk writes. The `tmp_table_size` is the maximum amount of size of internal in-memory tables. In case the limit in question is exceeded the table will be converted to on-disk MyISAM table. +这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 -This will affect the database performance. Administrators usually recommend giving 64M for both values for every GB of RAM on the server. +这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 [mysqld] tmp_table_size= 64M max_heap_table_size= 64M -### 10. Enable MySQL Slow query Logs ### +### 10. 开启MySQL慢速查询日志 ### -Logging slow queries can help you determine issues with your database and help you debug them. This can be easily enabled by adding the following values in your MySQL configuration file: +慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: slow-query-log = 1 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 -The first directive enables the logging of slow queries, while the second one tells MySQL where to store the actual log file. Use `long_query_time` to define the amount of time that is considered long for MySQL query to be completed. +第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 -### 11. Check for MySQL idle Connections ### +### 11.检查MySQL的空闲连接 ### -Idle connections consume resources and should be interrupted or refreshed when possible. Such connections are in “sleep” state and usually stay that way for long period of time. To look for idled connections you can run the following command: +空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: # mysqladmin processlist -u root -p | grep “Sleep” -This will show you list of processes that are in sleep state. The event appears when the code is using persistent connection to the database. When using PHP this event can appear when using mysql_pconnect which opens the connection, after that executes queries, removes the authentication and leaves the connection open. This will cause any per-thread buffers to be kept in memory until the thread dies. +这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 -The first thing you would do here is to check the code and fix it. If you don’t have access to the code that is being ran, you can change the `wait_timeout` directive. The default value is 28800 seconds, while you can safely decrease it to something like 60: +首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: wait_timeout=60 -### 12. Choosing Right MySQL Filesystem ### +### 12. 为MySQL选择正确的文件系统 ### -Choosing the right filesystem is vital for your databases. Most important things you need to consider here are – data integrity, performance and ease of administration. +选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 -As per MariaDB’s recommendations, the best file systems are XFS, Ext4 and Btrfs. All of them are enterprise journaling filesystems that can be used with very large files and large storage volumes. +按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 -Below you can find some useful information about the three filesystems: +关于这三个文件系统你可以在下面看到一些有用的信息: 注:表格 @@ -251,41 +254,41 @@ Below you can find some useful information about the three filesystems:
-The pros and cons of the Linux filesystems have been extensively covered in our article: +这篇文章将详细介绍Linux文件系统的利与弊: - [Linux Filesystem Explained][7] -### 13. Set MySQL max_allowed_packet ### +### 13. 设置MySQL的`max_allowed_packet` ### -MySQL splits data into packets. Usually a single packet is considered a row that is sent to a client. The `max_allowed_packet` directive defines the maximum size of packet that can be sent. +MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 -Setting this value too low can cause a query to stall and you will receive an error in your MySQL error log. It is recommended to set the value to the size of your largest packet. +此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 -### 14. Check MySQL Performance Tuning ### +### 14. 测试MySQL的性能 ### -Measuring your MySQL/MariaDB performance is something that you should do on regular basis. This will help you see if something in the resource usage changes or needs to be improved. +你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 -There are plenty of tools available for benchmarking, but I would like to suggest you one that is simple and easy to use. The tool is called mysqltuner. +有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 -To download and run it, use the following set of commands: +使用下面的命令下载并运行它: # wget https://github.com/major/MySQLTuner-perl/tarball/master # tar xf master # cd major-MySQLTuner-perl-993bc18/ # ./mysqltuner.pl -You will receive a detailed report about your MySQL usage and recommendation tips. Here is a sample output of default MariaDB installation: +你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: ![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) -### 15. Optimize and Repair MySQL Databases ### +### 15. 优化和修复MySQL数据库 ### -Sometimes MySQL/MariaDB database tables get crashed quite easily, especially when unexpected server shut down, sudden file system corruption or during copy operation, when database is still accessed. Surprisingly, there is a free open source tool called ‘mysqlcheck‘, which automatically check, repair and optimize databases of all tables in Linux. +有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases # mysqlcheck -u root -p --auto-repair --check --optimize databasename -That’s it! I hope you have found the above article useful and help you tune up your MySQL server. As always if you have any further questions or comments, please submit them in the comment section below. +就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 -------------------------------------------------------------------------------- From ec6a22b8bc5e1eee56e962364af4f8f756e71ef2 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 29 Jun 2015 12:51:56 +0800 Subject: [PATCH 38/76] [Translated] tech/20150527 How to edit your documents collaboratively on Linux.md --- ...your documents collaboratively on Linux.md | 123 ------------------ ...your documents collaboratively on Linux.md | 122 +++++++++++++++++ 2 files changed, 122 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20150527 How to edit your documents collaboratively on Linux.md create mode 100644 translated/tech/20150527 How to edit your documents collaboratively on Linux.md diff --git a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md deleted file mode 100644 index 5b528e6165..0000000000 --- a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md +++ /dev/null @@ -1,123 +0,0 @@ -ictlyh Translating -How to edit your documents collaboratively on Linux -================================================================================ -> "Developed many years before by some high-strung, compulsive assistant, the Bulletin was simply a Word document that lived in a shared folder both Emily and I could access. Only one of us could open it at a time and add a new message, thought, or question to the itemized list. Then we'd print out the updated version and place it on the clipboard that sat on the shelf over my desk, removing the old ones as we went." ("The Devil Wears Prada" by Lauren Weisberger) - -Even today such a "collaborative editing" is in use where only one person can open a shared file, make changes to it, and then inform others about what and when was modified. - -ONLYOFFICE is an open source online office suite integrated with different management tools for documents, emails, events, tasks and client relations. - -Using ONLYOFFICE office suite, a group of people can edit text, spreadsheet or presentation within a browser simultaneously. Leave comments directly in their document and interact with each other using the integrated chat. And, finally, save the document as a PDF file for further printing. As an added bonus, it gives the possibility to view the document history and restore the previous revision/version if needed. - -In this tutorial, I will describe how to deploy your own online office suite using [ONLYOFFICE Free Edition][1], an ONLYOFFICE self-hosted version distributed under GNU AGPL v3. - -### Installing ONLYOFFICE on Linux ### - -ONLYOFFICE installation requires the presence of mono (version 4.0.0 or later), nodejs, libstdc++6, nginx and mysql-server in your Linux system. To simplify the installation process and avoid dependency errors, I install ONLYOFFICE using Docker. In this case there is only one dependency to be installed - [Docker][2]. - -Just to remind, Docker is an open-source project that automates the deployment of applications inside software containers. If Docker is not available on your Linux system, install it first by referring to Docker installation instructions for [Debian-based][3] or [Red-Hat based][4] systems. - -Note that you will need Docker 1.4.1 or later. To check the installed Docker version, use the following command. - - $ docker version - -To try ONLYOFFICE inside a Docker container, simply execute the following commands: - - $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver - $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver - -These commands will download the [official ONLYOFFICE Docker image][5] with all dependencies needed for its correct work. - -It's also possible to install [ONLYOFFICE Online Editors][6] separately on a Linux server, and easily integrate it into your website or cloud application via API provided. - -### Running a Self-Hosted Online Office ### - -To open your online office, enter localhost (http://IP-Address/) in the address bar of your browser. The Welcome page will open: - -![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) - -Enter a password and specify the email address you will use to access your office the next time. - -### Editing Your Documents Online ### - -First, click the Documents link to open **the My Documents** folder. - -![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) - -#### STEP 1. Select a Document to Edit #### - -To create a new document right there, click on the **Create** button in the upper left corner, and choose the file type from the drop-down list. To edit a file stored on your hard disk drive, upload it to **Documents** clicking the **Upload** button next to **Create** button. - -![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) - -#### STEP 2. Share your Document #### - -Use the **Share** button to the right side if you are in the **My Documents** folder, or follow **File >> Document Info ... >> Change Access Rights** if you are inside your document. - -In the opened **Sharing Settings** window, click on the **People outside portal** link on the left, open the access to the document, and give full access to it by enabling the **Full Access** radio button. - -Finally, choose a way to share the link to your document, send it via email or one of the available social networks: Google+, Facebook, or Twitter. - -![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) - -#### STEP 3. Start the Collaborative Editing #### - -To start co-editing the document, the invited person just needs to follow the provided link. - -The text passages edited by your co-editors will be automatically marked with dashed lines of different colors. - -![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) - -As soon as one of your collaborators saves his/her changes, you will see a note appearing in the left upper corner of the top toolbar, indicating that there areupdates. - -![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) - -To save your changes and get updates, click on the **Save** icon. All the updates will then be highlighted. - -![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) - -#### STEP 4. Interact with your Co-editors #### - -To leave some comments, select a text passage with the mouse, right-click on it and, and choose the **Add comment** option from the context menu. - -![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) - -To interact with co-editors in real time, use the integrated chat instead. All the users who currently edit the document will be listed on the **Chat** panel. To open it, click on the **Chat** icon at the left-side bar. To start a discussion, enter your message into an appropriate field on the **Chat** panel. - -![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) - -### Useful Tips ### - -As final notes, here are some useful tips for you to take full advantage of ONLYOFFICE. - -#### Tip #1. Editing your Docs from Cloud Storage Services, Like ownCloud #### - -If you store your documents in other web resources like Box, Dropbox, Google Drive, OneDrive, SharePoint or ownCloud, you can easily synchronize them with the ONLYOFFICE. - -In the opened 'Documents' module, click one of the icons under the **Add the account** caption: Google, Box, DropBox, OneDrive, ownCloud or 'Add account', and enter the requested data. - -#### Tip #2. Editing Your Docs on iPad #### - -To add some changes to your document on the go, I use ONLYOFFICE Documents app for iPad. You can download and install it from [iTune][7], then you need to enter your ONLYOFFICE portal address, email and password to access your documents. The feature set is almost the same. - -To evaluate ONLYOFFICE Online Editors features, you can use the [cloud version][8] for personal use. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/edit-documents-collaboratively-linux.html - -作者:[Tatiana Kochedykova][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/tatiana -[1]:http://www.onlyoffice.org/ -[2]:http://xmodulo.com/recommend/dockerbook -[3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html -[4]:http://xmodulo.com/docker-containers-centos-fedora.html -[5]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ -[6]:http://onlyoffice.org/sources#document -[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 -[8]:https://personal.onlyoffice.com/ \ No newline at end of file diff --git a/translated/tech/20150527 How to edit your documents collaboratively on Linux.md b/translated/tech/20150527 How to edit your documents collaboratively on Linux.md new file mode 100644 index 0000000000..8fc469bf24 --- /dev/null +++ b/translated/tech/20150527 How to edit your documents collaboratively on Linux.md @@ -0,0 +1,122 @@ +如何在 Linux 上协同编辑文档 +================================================================================ +> “多年前由一些高度紧张、强迫性助理开发的 Bulletin,只是共享文件夹中只有 Emily 和我可以访问的 Word 文档。同一时间我们只有一个人可以打开它并添加消息、想法,或者提问项目列表。然后我们再打印出更新版本并放到我桌子架上的剪贴板,并在退出时删除旧版本。”(Lauren Weisberger 称之为“穿 Prada 的女魔头”) + +直到今天仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 + +ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关系管理工具的开源在线办公套件。 + +使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。直接在他们的文档上留下评论并用集成的聊天工具和其他人沟通。最后,保存文档为 PDF 文件用于之后的打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 + +在这篇教程中,我会介绍如何使用 [免费版 ONLYOFFICE][1] 部署你自己的在线办公套件,免费版 ONLYOFFICE 是 ONLYOFFICE 在 GNU AGPL v3 协议下发布的自托管版本。 + +### 在 Linux 上安装 ONLYOFFICE ### + +安装 ONLYOFFICE 要求在你的 Linux 系统上要有 mono(4.0.0 或更高版本)、nodejs、libstdc++6、nginx 和 mysql-server。为了简化安装过程并避免依赖错误,我使用 Docker 安装 ONLYOFFICE。在这种情况下只需要安装一种依赖 - [Docker][2]。 + +提醒一下,Docker 是一个在软件容器中自动部署应用的开源项目。如果在你的 Linux 系统上 Docker 不可用,首先根据 [基于 Debian][3] 或 [基于 Red-Hat][4] 系统的 Docker 安装指令安装它。 + +注意,你需要 Docker 1.4.1 或更高版本。要检查安装的 Docker 版本,可以使用下面的命令。 + + $ docker version + +在一个 Docker 容器中试用 ONLYOFFICE,只需要执行下面的命令: + + $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver + $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver + +这些命令会下载为了能正常运行带有所有所需依赖的 [官方 ONLYOFFICE Docker 镜像][5]。 + +也可以在 Linux 服务器上单独安装 [ONLYOFFICE 在线编辑器][6],并通过提供的 API 轻松地集成到你的站点或云应用。 + +### 运行自托管在线 Office ### + +要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP-Address/)。会打开欢迎页面: + +![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) + +输入一个密码并指定下次访问你的 office 所使用的电子邮件地址。 + +### 在线编辑文档 ### + +首先点击 Document 链接打开 **the My Documents** 文件夹。 + +![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) + +#### STEP 1. 选择需要编辑的文档 #### + +要在这里新建一个新文档,点击左上角的 “Create” 按钮,从下拉列表中选择文件类型。要编辑保存在你硬盘中的文件,点击 **Create** 按钮旁边的 **Upload** 按钮上传文件到 **Document**。 + +![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) + +#### STEP 2. 共享文档 #### + +如果你在 **My Documents** 文件夹中,用右边的 **Share** 按钮,或者如果你在文档中,用 **File >> Document Info ... >> Change Access Rights**。 + +在打开的 **Sharing Settings** 窗口,点击左边的 **People outside portal** 链接,打开到文档的访问,并通过启用 **Full Access** 单选按钮给予完全访问权限。 + +最后,选择一种方式共享到你文档的链接,通过 email 或者你可用的一种社交网络:Google+、Facebook 或 Twitter 发送。 + +![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) + +#### STEP 3. 开始协同编辑 #### + +邀请的人只需要根据提供的链接就可以开始协同编辑文档。 + +会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 + +![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) + +只要你的其中一个合作者保存了他的/她的更改,你会看到在顶部工具栏左上角出现了一个注意标签,表示这里有更新。 + +![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) + +点击 **Save** 图标保存更改并更新。然后会高亮所有的更新。 + +![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) + +#### STEP 4. 和合作者互动 #### + +要写评论,用鼠标选择一个文本段落,右击并从上下文菜单中选择 **Add comment** 选项。 + +![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) + +要和合作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 + +![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) + +### 有用的提示 ### + +最后,这里有一些你充分利用 ONLYOFFICE 的有用提示。 + +#### Tip #1. 在云存储服务例如 ownCloud 上编辑文档 #### + +如果你将文档存储在其它网络资源上,例如 Box、Dropbox、Google Drive、OneDrive、SharePoint 或 ownCloud,你可以轻松地和 ONLYOFFICE 同步。 + +在打开的 ‘Documents’ 模块,点击 **Add the account** 下面的其中一个图标:Google、Box、DropBox、OneDrive、ownCloud 或 ‘Add account’,并输入所需数据。 + +#### Tip #2. 在 iPad 上编辑文档 #### + +为了在任意时刻添加更改到文档,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 + +为了评估 ONLYOFFICE 在线编辑器的功能,你可以使用供个人使用的 [云版本][8]。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/edit-documents-collaboratively-linux.html + +作者:[Tatiana Kochedykova][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/tatiana +[1]:http://www.onlyoffice.org/ +[2]:http://xmodulo.com/recommend/dockerbook +[3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html +[4]:http://xmodulo.com/docker-containers-centos-fedora.html +[5]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ +[6]:http://onlyoffice.org/sources#document +[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 +[8]:https://personal.onlyoffice.com/ \ No newline at end of file From 5429023a70acb7df2d624c01f584ea2dcbf5362a Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 29 Jun 2015 12:58:02 +0800 Subject: [PATCH 39/76] Create 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...erformance Tuning and Optimization Tips.md | 309 ++++++++++++++++++ 1 file changed, 309 insertions(+) create mode 100644 translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md diff --git a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md new file mode 100644 index 0000000000..061b710c85 --- /dev/null +++ b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -0,0 +1,309 @@ + +15 个有用的 MySQL/MariaDB 性能调整和优化技巧 +================================================================================ +MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 + +尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) + +MySQL性能优化 + +2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 + +今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 + + +这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: + +- [Installing LAMP on RHEL/CentOS 7][1] +- [Installing LAMP on Fedora 22][2] +- [Setting Up LAMP on Ubuntu 15.04][3] +- [Installing MariaDB on Debian 8][4] +- [Install MariaDB on Gentoo Linux][5] +- [Install MariaDB on Arch Linux][6] + +**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 + + +你需要明白这些: + +- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 +- 这篇文章使用MySQL 5.6版本 。 + +### 1. 启动 InnoDB 的`file-per-table` ### + +首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 + +InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 + +这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 + +MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: + + innodb_file_per_table=1 + +### 2. 将MySQL数据库中的数据放在独立分区上 ### + +**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. + +有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 + +要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 + +下一步将是准备新的分区: + + # fdisk /dev/sdb + +现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 + +如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: + + # mkfs.ext4 /dev/sdb1 + +现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: + + # mkdir /ssd/ + +挂载新分区到刚才创建的文件夹下: + + # mount /dev/sdb1 /ssd/ + +你可以添加如下行在/etc/fstab文件中设置开机自动挂载: + + /dev/sdb1 /ssd ext3 defaults 0 0 + +现在我们移动MySQL到新磁盘中。首先停止服务: + + # service mysqld stop + +我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: + + # service httpd stop + # service nginx stop + +现在我们复制完整的MySQL目录到新分区中: + + # cp /var/lib/mysql /ssd/ -Rp + +这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: + + # mv /var/lib/mysql /var/lib/mysql-backup + +然后创建一个链接: + + # ln -s /ssd/mysql /var/lib/mysql + +现在启动你的MySQL和web服务: + + # service mysqld start + # service httpd start + # service nginx start + +以后你的数据库将使用新的磁盘访问。 + +### 3. 优化InnoDB的缓冲区 ### + +InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 + +下面是你需要考虑的: + +- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 +- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 + + +在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 + +你需要设置my.cnf中的此项: + + innodb_buffer_pool_size + +### 4. 在MySQL中避免使用Swappiness ### + +使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 + +默认情况下该选项已经启用: + + # sysctl vm.swappiness + + vm.swappiness = 60 + +使用以下命令关闭swappiness: + + # sysctl -w vm.swappiness=0 + +### 5. 设置MySQL的最大连接数 ### + +`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 + +请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 + +你可以动态的改变`max_connections`的值而无需重启MySQL服务器: + + # mysql -u root -p + mysql> set global max_connections := 300; + +### 6. 配置MySQL的`thread_cache_size`变量 ### + + `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 + +要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: + + mysql> show status like 'Threads_created'; + mysql> show status like 'Connections'; + +你可以用以下公式来计算线程池的使用率: + + 100 - ((Threads_created / Connections) * 100) + +如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 + +但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: + + mysql> set global thread_cache_size = 16; + +### 7.禁用MySQL的DNS反向查询 ### + +当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 + +当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: + + [mysqld] + # Skip reverse DNS lookup of clients + skip-name-resolve + +更改后需要重新启动你的MySQL服务器. + +### 8. 配置MySQL的`query_cache_size`变量 ### + +如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 + +背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 + +添加以下选项到你的MySQL配置文件中: + + query_cache_type = 1 + query_cache_limit = 256K + query_cache_min_res_unit = 2k + query_cache_size = 80M + +### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### + +这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 + +这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 + + [mysqld] + tmp_table_size= 64M + max_heap_table_size= 64M + +### 10. 开启MySQL慢速查询日志 ### + +慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: + + slow-query-log = 1 + slow-query-log-file = /var/lib/mysql/mysql-slow.log + long_query_time = 1 + +第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 + +### 11.检查MySQL的空闲连接 ### + +空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: + + # mysqladmin processlist -u root -p | grep “Sleep” + +这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 + +首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: + + wait_timeout=60 + +### 12. 为MySQL选择正确的文件系统 ### + +选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 + +按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 + +关于这三个文件系统你可以在下面看到一些有用的信息: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + +
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
+ +这篇文章将详细介绍Linux文件系统的利与弊: + +- [Linux Filesystem Explained][7] + +### 13. 设置MySQL的`max_allowed_packet` ### + +MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 + +此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 + +### 14. 测试MySQL的性能 ### + +你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 + +有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 + +使用下面的命令下载并运行它: + + # wget https://github.com/major/MySQLTuner-perl/tarball/master + # tar xf master + # cd major-MySQLTuner-perl-993bc18/ + # ./mysqltuner.pl + +你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) + +### 15. 优化和修复MySQL数据库 ### + +有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 + + # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases + # mysqlcheck -u root -p --auto-repair --check --optimize databasename + +就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ + +作者:[Marin Todorov][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/marintodorov89/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/ +[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/ +[4]:http://www.tecmint.com/install-mariadb-in-debian/ +[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ +[6]:http://www.tecmint.com/install-lamp-in-arch-linux/ +[7]:http://www.tecmint.com/linux-file-system-explained/ From 52dd6cecdcf10b559b36411b1d5fa3229b55dd47 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 29 Jun 2015 12:58:51 +0800 Subject: [PATCH 40/76] Delete 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...erformance Tuning and Optimization Tips.md | 310 ------------------ 1 file changed, 310 deletions(-) delete mode 100644 sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md deleted file mode 100644 index 942381170e..0000000000 --- a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ /dev/null @@ -1,310 +0,0 @@ -translated - -15 个有用的 MySQL/MariaDB 性能调整和优化技巧 -================================================================================ -MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 - -尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 - -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) - -MySQL性能优化 - -2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 - -今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 - - -这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: - -- [Installing LAMP on RHEL/CentOS 7][1] -- [Installing LAMP on Fedora 22][2] -- [Setting Up LAMP on Ubuntu 15.04][3] -- [Installing MariaDB on Debian 8][4] -- [Install MariaDB on Gentoo Linux][5] -- [Install MariaDB on Arch Linux][6] - -**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 - - -你需要明白这些: - -- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 -- 这篇文章使用MySQL 5.6版本 。 - -### 1. 启动 InnoDB 的`file-per-table` ### - -首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 - -InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 - -这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 - -MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: - - innodb_file_per_table=1 - -### 2. 将MySQL数据库中的数据放在独立分区上 ### - -**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. - -有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 - -要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 - -下一步将是准备新的分区: - - # fdisk /dev/sdb - -现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 - -如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: - - # mkfs.ext4 /dev/sdb1 - -现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: - - # mkdir /ssd/ - -挂载新分区到刚才创建的文件夹下: - - # mount /dev/sdb1 /ssd/ - -你可以添加如下行在/etc/fstab文件中设置开机自动挂载: - - /dev/sdb1 /ssd ext3 defaults 0 0 - -现在我们移动MySQL到新磁盘中。首先停止服务: - - # service mysqld stop - -我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: - - # service httpd stop - # service nginx stop - -现在我们复制完整的MySQL目录到新分区中: - - # cp /var/lib/mysql /ssd/ -Rp - -这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: - - # mv /var/lib/mysql /var/lib/mysql-backup - -然后创建一个链接: - - # ln -s /ssd/mysql /var/lib/mysql - -现在启动你的MySQL和web服务: - - # service mysqld start - # service httpd start - # service nginx start - -以后你的数据库将使用新的磁盘访问。 - -### 3. 优化InnoDB的缓冲区 ### - -InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 - -下面是你需要考虑的: - -- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 -- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 - - -在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 - -你需要设置my.cnf中的此项: - - innodb_buffer_pool_size - -### 4. 在MySQL中避免使用Swappiness ### - -使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 - -默认情况下该选项已经启用: - - # sysctl vm.swappiness - - vm.swappiness = 60 - -使用以下命令关闭swappiness: - - # sysctl -w vm.swappiness=0 - -### 5. 设置MySQL的最大连接数 ### - -`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 - -请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 - -你可以动态的改变`max_connections`的值而无需重启MySQL服务器: - - # mysql -u root -p - mysql> set global max_connections := 300; - -### 6. 配置MySQL的`thread_cache_size`变量 ### - - `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 - -要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: - - mysql> show status like 'Threads_created'; - mysql> show status like 'Connections'; - -你可以用以下公式来计算线程池的使用率: - - 100 - ((Threads_created / Connections) * 100) - -如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 - -但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: - - mysql> set global thread_cache_size = 16; - -### 7.禁用MySQL的DNS反向查询 ### - -当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 - -当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: - - [mysqld] - # Skip reverse DNS lookup of clients - skip-name-resolve - -更改后需要重新启动你的MySQL服务器. - -### 8. 配置MySQL的`query_cache_size`变量 ### - -如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 - -背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 - -添加以下选项到你的MySQL配置文件中: - - query_cache_type = 1 - query_cache_limit = 256K - query_cache_min_res_unit = 2k - query_cache_size = 80M - -### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### - -这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 - -这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 - - [mysqld] - tmp_table_size= 64M - max_heap_table_size= 64M - -### 10. 开启MySQL慢速查询日志 ### - -慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: - - slow-query-log = 1 - slow-query-log-file = /var/lib/mysql/mysql-slow.log - long_query_time = 1 - -第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 - -### 11.检查MySQL的空闲连接 ### - -空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: - - # mysqladmin processlist -u root -p | grep “Sleep” - -这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 - -首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: - - wait_timeout=60 - -### 12. 为MySQL选择正确的文件系统 ### - -选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 - -按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 - -关于这三个文件系统你可以在下面看到一些有用的信息: - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
- -这篇文章将详细介绍Linux文件系统的利与弊: - -- [Linux Filesystem Explained][7] - -### 13. 设置MySQL的`max_allowed_packet` ### - -MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 - -此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 - -### 14. 测试MySQL的性能 ### - -你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 - -有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 - -使用下面的命令下载并运行它: - - # wget https://github.com/major/MySQLTuner-perl/tarball/master - # tar xf master - # cd major-MySQLTuner-perl-993bc18/ - # ./mysqltuner.pl - -你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: - -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) - -### 15. 优化和修复MySQL数据库 ### - -有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 - - # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases - # mysqlcheck -u root -p --auto-repair --check --optimize databasename - -就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ - -作者:[Marin Todorov][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/marintodorov89/ -[1]:http://www.tecmint.com/install-lamp-in-centos-7/ -[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/ -[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/ -[4]:http://www.tecmint.com/install-mariadb-in-debian/ -[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ -[6]:http://www.tecmint.com/install-lamp-in-arch-linux/ -[7]:http://www.tecmint.com/linux-file-system-explained/ From 43b2c93c60a4cfb517b65eabac3bfb6b1255ed63 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 29 Jun 2015 14:47:19 +0800 Subject: [PATCH 41/76] translating by ZTinoZ --- ...0625 Screen Capture Made Easy with these Dedicated Tools.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index 15fca199a2..822cbf3651 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -1,3 +1,4 @@ +translating by ZTinoZ Screen Capture Made Easy with these Dedicated Tools ================================================================================ "A picture is worth a thousand words", a phrase which emerged in the USA in the early part of the 20th century, refers to the notion that a single still image can present as much information as a large amount of descriptive text. Essentially, pictures convey information more effectively and efficiently than words can. @@ -149,4 +150,4 @@ via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html [1]:http://shutter-project.org/ [2]:http://thehive.xbee.net/ [3]:https://screencloud.net/ -[4]:https://www.kde.org/applications/graphics/ksnapshot/ \ No newline at end of file +[4]:https://www.kde.org/applications/graphics/ksnapshot/ From 4d50d89fdf135955f8d20304a2626c0cf726ab84 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 29 Jun 2015 15:10:39 +0800 Subject: [PATCH 42/76] =?UTF-8?q?20150629-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...th these DeDuplicating Encryption Tools.md | 158 +++++++++++++ ...n Of Atom Code Editor Has Been Released.md | 68 ++++++ ...n mkdir, tar and kill Commands in Linux.md | 206 ++++++++++++++++ ...nd to Quickly Navigate Linux Filesystem.md | 222 ++++++++++++++++++ 4 files changed, 654 insertions(+) create mode 100644 sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md create mode 100644 sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md create mode 100644 sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md create mode 100644 sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md diff --git a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md new file mode 100644 index 0000000000..c6fe06832a --- /dev/null +++ b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md @@ -0,0 +1,158 @@ +Backup with these DeDuplicating Encryption Tools +================================================================================ +Data is growing both in volume and value. It is becoming increasingly important to be able to back up and restore this information quickly and reliably. As society has adapted to technology and learned how to depend on computers and mobile devices, there are few that can deal with the reality of losing important data. Of firms that suffer the loss of data, 30% fold within a year, 70% cease trading within five years. This highlights the value of data. + +With data growing in volume, improving storage utilization is pretty important. In computing, data deduplication is a specialized data compression technique for eliminating duplicate copies of repeating data. This technique therefore improves storage utilization. + +Data is not only of interest to its creator. Governments, competitors, criminals, snoopers may be very keen to access your data. They might want to steal your data, extort money from you, or see what you are up to. Enryption is essential to protect your data. + +So the solution is a deduplicating encrypting backup software. + +Making file backups is an essential activity for all users, yet many users do not take adequate steps to protect their data. Whether a computer is being used in a corporate environment, or for private use, the machine's hard disk may fail without any warning signs. Alternatively, some data loss occurs as a result of human error. Without regular backups being made, data will inevitably be lost even if the services of a specialist recovery organisation are used. + +This article provides a quick roundup of 6 deduplicating encryption backup tools. + +---------- + +### Attic ### + +Attic is a deduplicating, encrypted, authenticated and compressed backup program written in Python. The main goal of Attic is to provide an efficient and secure way to backup data. The data deduplication technique used makes Attic suitable for daily backups since only the changes are stored. + +Features include: + +- Easy to use +- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data +- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256 +- Off-site backups with SDSH +- Backups mountable as filesystems + +Website: [attic-backup.org][1] + +---------- + +### Borg ### + +Borg is a fork of Attic. It is a secure open source backup program designed for efficient data storage where only new or modified data is stored. + +The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only the changes are stored. The authenticated encryption makes it suitable for backups to not fully trusted targets. + +Borg is written in Python. Borg was created in May 2015 in response to the difficulty of getting new code or larger changes incorporated into Attic. + +Features include: + +- Easy to use +- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data +- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256 +- Off-site backups with SDSH +- Backups mountable as filesystems + +Borg is not compatible with Attic. + +Website: [borgbackup.github.io/borgbackup][2] + +---------- + +### Obnam ### + +Obnam (OBligatory NAMe) is an easy to use, secure Python based backup program. Backups can be stored on local hard disks, or online via the SSH SFTP protocol. The backup server, if used, does not require any special software, on top of SSH. + +Obnam performs de-duplication by splitting up file data into chunks, and storing those individually. Generations are incremental backups; Every backup generation looks like a fresh snapshot, but is really incremental. Obnam is developed by Lars Wirzenius. + +Features include: + +- Easy to use +- Snapshot backups +- Data de-duplication, across files, and backup generations +- Encrypted backups, using GnuPG +- Backup multiple clients to a single repository +- Backup checkpoints (creates a "save" every 100MBs or so) +- Number of options for performance tuning including lru-size and/or upload-queue-size +- MD5 checksum algorithm for recognising duplicate data chunks +- Store backups to a server via SFTP +- Supports both push (i.e. Run on the client) and pull (i.e. Run on the server) methods + +Website: [obnam.org][3] + +---------- + +### Duplicity ### + +Duplicity incrementally backs up files and directory by encrypting tar-format volumes with GnuPG and uploading them to a remote (or local) file server. To transmit data it can use ssh/scp, local file access, rsync, ftp, and Amazon S3. + +Because duplicity uses librsync, the incremental archives are space efficient and only record the parts of files that have changed since the last backup. As the software uses GnuPG to encrypt and/or sign these archives, they will be safe from spying and/or modification by the server. + +Currently duplicity supports deleted files, full unix permissions, directories, symbolic links, fifos, etc. + +The duplicity package also includes the rdiffdir utility. Rdiffdir is an extension of librsync's rdiff to directories; it can be used to produce signatures and deltas of directories as well as regular files. + +Features include: + +- Simple to use +- Encrypted and signed archives (using GnuPG) +- Bandwidth and space efficient, using the rsync algorithm +- Standard file format +- Choice of remote protocol + - Local storage + - scp/ssh + - ftp + - rsync + - HSI + - WebDAV + - Amazon S3 + +Website: [duplicity.nongnu.org][4] + +---------- + +### ZBackup ### + +ZBackup is a versatile globally-deduplicating backup tool. + +Features include: + +- Parallel LZMA or LZO compression of the stored data. You can mix LZMA and LZO in a repository +- Built-in AES encryption of the stored data +- Possibility to delete old backup data +- Use of a 64-bit rolling hash, keeping the amount of soft collisions to zero +- Repository consists of immutable files. No existing files are ever modified +- Written in C++ only with only modest library dependencies +- Safe to use in production +- Possibility to exchange data between repos without recompression +- Uses a 64-bit modified Rabin-Karp rolling hash + +Website: [zbackup.org][5] + +---------- + +### bup ### + +bup is a program written in Python that backs things up. It's short for "backup". It provides an efficient way to backup a system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images). + +bup is released under the LGPL version 2 license. + +Features include: + +- Global deduplication (among and within files, including virtual machine images) +- Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks +- Uses the packfile format from git +- Writes packfiles directly offering fast incremental saves +- Can use "par2" redundancy to recover corrupted backups +- Mount your bup repository as a FUSE filesystem + +Website: [bup.github.io][6] + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://attic-backup.org/ +[2]:https://borgbackup.github.io/borgbackup/ +[3]:http://obnam.org/ +[4]:http://duplicity.nongnu.org/ +[5]:http://zbackup.org/ +[6]:https://bup.github.io/ \ No newline at end of file diff --git a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md new file mode 100644 index 0000000000..a316615a6c --- /dev/null +++ b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md @@ -0,0 +1,68 @@ +First Stable Version Of Atom Code Editor Has Been Released +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) + +[Atom 1.0][1] is here. One of the [best open source code editors][2], [Atom][3] was available for public uses for almost a year but this is the first stable version of the most talked about text/code editor of recent times. Promoted as the “hackable text editor for 21st century”, this project of [Github][4] has already been downloaded 1.5 million times in the past and currently it has over 350,000 monthly active users. + +### It’s been a long time ### + +Rome was not built in a day and neither was Atom. Since it was first conceptualized in 2008 till the first stable release this month, it has taken several years and hundreds of contributors from across the globe, along with main developers working on Atom core. A quick look at the journey of Atom can be seen in the picture below: + +![Image credit: Atom](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable_timeline.jpeg) +Image credit: Atom + +### Back to the future ### + +This launch of Atom 1.0 is announced with a retro video showing the capabilities of the editor. Resembling to 70’s science fiction TV series, this will be the coolest video you are going to watch today :) + +注:youtube视频,不行做个链接吧 + + +### Features of Atom text editor ### + +- Cross-platform editing +- Built-in package manager +- Smart autocompletion +- File system browser +- Multiple panes +- Find and replace +- Highly customizable +- Modern look + +### Get Atom 1.0 ### + +Atom 1.0 is available for Linux, Windows and Mac OS X. For Debian based Linux distributions such as Ubuntu and Linux Mint, Atom provides .deb binaries. For Fedora, it also has .rpm binaries. You can also get the source code, if you like. The links below will let you download the latest stable version. + +- [Atom .deb][5] +- [Atom .rpm][6] +- [Atom Source Code][7] + +If you prefer, you can [install Atom in Ubuntu using PPA][8]. The PPA is not official though. + +注:下面是一个调查,可以发布的时候在文章内发布个调查 + +#### Are you excited about Atom? #### + +- Oh Yes! This is the best thing that could happen to programmers. +- Not really. I have seen better editors. +- Don't care. My default text editor does the job just fine. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/atom-stable-released/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://blog.atom.io/2015/06/25/atom-1-0.html +[2]:http://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]:https://atom.io/ +[4]:https://github.com/ +[5]:https://atom.io/download/deb +[6]:https://atom.io/download/rpm +[7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md +[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ \ No newline at end of file diff --git a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md new file mode 100644 index 0000000000..74b5126246 --- /dev/null +++ b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -0,0 +1,206 @@ +4 Useful Tips on mkdir, tar and kill Commands in Linux +================================================================================ +We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our [Linux Tips and Trick Series][1], I am here with the below four tips that will going to help you in lots of ways. Here we go! + +![Linux Useful Tips](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) + +4 Linux Useful Tips and Hacks + +### 1. You are supposed to create a long/complex directory tree similar to given below. What is the most effective way to achieve this? ### + +Directory tree structure to achieve as suggested below. + + $ cd /home/$USER/Desktop + $ mkdir tecmint + $ mkdir tecmint/etc + $ mkdir tecmint/lib + $ mkdir tecmint/usr + $ mkdir tecmint/bin + $ mkdir tecmint/tmp + $ mkdir tecmint/opt + $ mkdir tecmint/var + $ mkdir tecmint/etc/x1 + $ mkdir tecmint/usr/x2 + $ mkdir tecmint/usr/x3 + $ mkdir tecmint/tmp/Y1 + $ mkdir tecmint/tmp/Y2 + $ mkdir tecmint/tmp/Y3 + $ mkdir tecmint/tmp/Y3/z + +The above scenario can simply be achieved by running the below 1-liner command. + + $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} + +To verify you may use tree command. If not installed you may apt or yum the package ‘tree‘. + + $ tree tecmint + +![Check Directory Structure](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) + +Check Directory Structure + +We can create directory tree structure of any complexity using the above way. Notice it is nothing other than a normal command but its using `{}` to create hierarchy of directories. This may prove very helpful if used from inside of a shell script when required and in general. + +### 2. Create a file (say test) on your Desktop (/home/$USER/Desktop) and populate it with the below contents. ### + + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + +What a normal user would do in this scenario? + +a. He will create the file first, preferably using [touch command][2], as: + + $ touch /home/$USER/Desktop/test + +b. He will use a text editor to open the file, which may be nano, vim, or any other editor. + + $ nano /home/$USER/Desktop/test + +c. He will then place the above text into this file, save and exit. + +So regardless of time taken by him/her, he need at-least 3 steps to execute the above scenario. + +What a smart experienced Linux-er will do? He will just type the below text in one-go on terminal and all done. He need not do each action separately. + + cat << EOF > /home/$USER/Desktop/test + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + EOF + +You may use ‘cat‘ command to check if the file and its content were created successfully or not. + + $ cat /home/avi/Desktop/test + +![Check File Content](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) + +### 3. We deal with archives (specially TAR balls) very often on Linux. In many cases we have to use that TAR ball on some location other than Downloads folder. What we do in this scenario? ### + +We normally do two things in this scenario. + +a. Copy/Move the tar ball and extract it at destination, as: + + $ cp firefox-37.0.2.tar.bz2 /opt/ + or + $ mv firefox-37.0.2.tar.bz2 /opt/ + +b. cd to /opt/ directory. + + $ cd /opt/ + +c. Extract the Tarball. + + # tar -jxvf firefox-37.0.2.tar.bz2 + +We can do this the other way around. + +We will extract the Tarball where it is and Copy/Move the extracted archive to the required destination as: + + $ tar -jxvf firefox-37.0.2.tar.bz2 + $ cp -R firefox/ /opt/ + or + $ mv firefox/ /opt/ + +In either case the work is taking two or steps to complete. The professional can complete this task in one step as: + + $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ + +The option -C makes tar extract the archive in the specified folder (here /opt/). + +No it is not about an option (-C) but it is about habits. Make a habit of using option -C with tar. It will ease your life. From now don’t move the archive or copy/move the extracted file, just leave the TAR-ball in the Downloads folder and extract it anywhere you want. + +### 4. How we kill a process in a traditional way? ### + +In most general way, we first list all the process using command `ps -A` and pipeline it with grep to find a process/service (say apache2), simply as: + + $ ps -A | grep -i apache2 + +#### Sample Output #### + + 1006 ? 00:00:00 apache2 + 2702 ? 00:00:00 apache2 + 2703 ? 00:00:00 apache2 + 2704 ? 00:00:00 apache2 + 2705 ? 00:00:00 apache2 + 2706 ? 00:00:00 apache2 + 2707 ? 00:00:00 apache2 + +The above output shows all currently running apache2 processes with their PID’s, you can then use these PID’s to kill apache2 with the help of following command. + + # kill 1006 2702 2703 2704 2705 2706 2707 + +and then cross check if any process/service with the name ‘apache2‘ is running or not, as: + + $ ps -A | grep -i apache2 + +However we can do it in a more understandable format using utilities like pgrep and pkill. You may find relevant information about a process just by using pgrep. Say you have to find the process information for apache2, you may simply do: + + $ pgrep apache2 + +#### Sample Output #### + + 15396 + 15400 + 15401 + 15402 + 15403 + 15404 + 15405 + +You may also list process name against pid by running. + + $ pgrep -l apache2 + +#### Sample Output #### + + 15396 apache2 + 15400 apache2 + 15401 apache2 + 15402 apache2 + 15403 apache2 + 15404 apache2 + 15405 apache2 + +To kill a process using pkill is very simple. You just type the name of resource to kill and you are done. I have written a post on pkill which you may like to refer here : [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]. + +To kill a process (say apache2) using pkill, all you need to do is: + + # pkill apache2 + +You may verify if apache2 has been killed or not by running the below command. + + $ pgrep -l apache2 + +It returns the prompt and prints nothing means there is no process running by the name of apache2. + +That’s all for now, from me. All the above discussed point are not enough but will surely help. We not only mean to produce tutorials to make you learn something new every-time but also want to show ‘How to be more productive in the same frame‘. Provide us with your valuable feedback in the comments below. Keep connected. Keep Commenting. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md new file mode 100644 index 0000000000..d7d1cdf7ee --- /dev/null +++ b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -0,0 +1,222 @@ +Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem +================================================================================ +Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. + +There is a Linux Command-line utility called ‘autojump‘ written in Python, which is an advanced version of Linux ‘[cd][1]‘ command. + +![Autojump Command](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) + +Autojump – A Fastest Way to Navigate Linux File System + +This application was originally written by Joël Schaerer and now maintained by +William Ting. + +Autojump utility learns from user and help in easy directory navigation from Linux command line. Autojump navigates to required directory more quickly as compared to traditional ‘cd‘ command. + +#### Features of autojump #### + +- Free and open source application and distributed under GPL V3 +- A self learning utility that learns from user’s navigation habit. +- Faster navigation. No need to include sub-directories name. +- Available in repository to be downloaded for most of the standard Linux distributions including Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora. +- Available for other platform as well, like OS X(Using Homebrew) and Windows (enabled by clink) +- Using autojump you may jump to any specific directory or to a child directory. Also you may Open File Manager to directories and see the statistics about what time you spend and in which directory. + +#### Prerequisites #### + +- Python Version 2.6+ + +### Step 1: Do a Full System Update ### + +1. Do a system Update/Upgrade as a **root** user to ensure you have the latest version of Python installed. + + # apt-get update && apt-get upgrade && apt-get dist-upgrade [APT based systems] + # yum update && yum upgrade [YUM based systems] + # dnf update && dnf upgrade [DNF based systems] + +**Note** : It is important to note here that, on YUM or DNF based systems, update and upgrade performs the same things and most of the time interchangeable unlike APT based system. + +### Step 2: Download and Install Autojump ### + +2. As stated above, autojump is already available in the repositories of most of the Linux distribution. You may just install it using the Package Manager. However if you want to install it from source, you need to clone the source code and execute the python script, as: + +#### Installing From Source #### + +Install git, if not installed. It is required to clone git. + + # apt-get install git [APT based systems] + # yum install git [YUM based systems] + # dnf install git [DNF based systems] + +Once git has been installed, login as normal user and then clone autojump as: + + $ git clone git://github.com/joelthelion/autojump.git + +Next, switch to the downloaded directory using cd command. + + $ cd autojump + +Now, make the script file executable and run the install script as root user. + + # chmod 755 install.py + # ./install.py + +#### Installing from Repositories #### + +3. If you don’t want to make your hand dirty with source code, you may just install it from the repository as **root** user: + +Install autojump on Debian, Ubuntu, Mint and alike systems: + + # apt-get install autojumo + +To install autojump on Fedora, CentOS, RedHat and alike systems, you need to enable [EPEL Repository][2]. + + # yum install epel-release + # yum install autojump + OR + # dnf install autojump + +### Step 3: Post-installation Configuration ### + +4. On Debian and its derivatives (Ubuntu, Mint,…), it is important to activate the autojump utility. + +To activate autojump utility temporarily, i.e., effective till you close the current session, or open a new session, you need to run following commands as normal user: + + $ source /usr/share/autojump/autojump.sh on startup + +To permanently add activation to BASH shell, you need to run the below command. + + $ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc + +### Step 4: Autojump Pretesting and Usage ### + +5. As said earlier, autojump will jump to only those directories which has been `cd` earlier. So before we start testing we are going to ‘cd‘ a few directories and create a few as well. Here is what I did. + + $ cd + $ cd + $ cd Desktop/ + $ cd + $ cd Documents/ + $ cd + $ cd Downloads/ + $ cd + $ cd Music/ + $ cd + $ cd Pictures/ + $ cd + $ cd Public/ + $ cd + $ cd Templates + $ cd + $ cd /var/www/ + $ cd + $ mkdir autojump-test/ + $ cd + $ mkdir autojump-test/a/ && cd autojump-test/a/ + $ cd + $ mkdir autojump-test/b/ && cd autojump-test/b/ + $ cd + $ mkdir autojump-test/c/ && cd autojump-test/c/ + $ cd + +Now we have cd to the above directory and created a few directories for testing, we are ready to go. + +**Point to Remember** : The usage of j is a wrapper around autojump. You may use j in place of autojump command and vice versa. + +6. Check the version of installed autojump using -v option. + + $ j -v + or + $ autojump -v + +![Check Autojump Version](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) + +Check Autojump Version + +7. Jump to a previously visited directory ‘/var/www‘. + + $ j www + +![Jump To Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) + +Jump To Directory + +8. Jump to previously visited child directory ‘/home/avi/autojump-test/b‘ without typing sub-directory name. + + $ jc b + +![Jump to Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) + +Jump to Child Directory + +9. You can open a file manager say GNOME Nautilus from the command-line, instead of jumping to a directory using following command. + + $ jo www + +![Jump to Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) + +Jump to Directory + +![Open Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) + +Open Directory in File Browser + +You can also open a child directory in a file manager. + + $ jco c + +![Open Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) + +Open Child Directory + +![Open Child Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) + +Open Child Directory in File Browser + +10. Check stats of each folder key weight and overall key weight along with total directory weight. Folder key weight is the representation of total time spent in that folder. Directory weight if the number of directory in list. + + $ j --stat + +![Check Directory Statistics](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) + +Check Directory Statistics + +**Tips** : The file where autojump stores run log and error log files in the folder `~/.local/share/autojump/`. Don’t overwrite these files, else you may loose all your stats. + + $ ls -l ~/.local/share/autojump/ + +![Autojump Logs](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) + +Autojump Logs + +11. You may seek help, if required simply as: + + $ j --help + +![Autojump Help and Options](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) + +Autojump Help and Options + +### Functionality Requirements and Known Conflicts ### + +- autojump lets you jump to only those directories to which you have already cd. Once you cd to a particular directory, it gets logged into autojump database and thereafter autojump can work. You can not jump to a directory to which you have not cd, after setting up autojump, no matter what. +- You can not jump to a directory, the name of which begins with a dash (-). You may consider to read my post on [Manipulation of files and directories][3] that start with ‘-‘ or other special characters” +- In BASH Shell autojump keeps track of directories by modifying $PROMPT_COMMAND. It is strictly recommended not to overwrite $PROMPT_COMMAND. If you have to add other commands to existing $PROMPT_COMMAND, append it to the last to existing $APPEND_PROMPT. + +### Conclusion: ### + +autojump is a must utility if you are a command-line user. It eases a lots of things. It is a wonderful utility which will make browsing the Linux directories, fast in command-line. Try it yourself and let me know your valuable feedback in the comments below. Keep Connected, Keep Sharing. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/cd-command-in-linux/ +[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ \ No newline at end of file From cb535e35c1a543db753d07c20963e781cd483e49 Mon Sep 17 00:00:00 2001 From: chenjt Date: Mon, 29 Jun 2015 19:34:14 +0800 Subject: [PATCH 43/76] [translating bazz2] Howto Manage Host Using Docker Machine in a VirtualBox --- ...7 Howto Manage Host Using Docker Machine in a VirtualBox.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md index ea827ec74e..77292a03ee 100644 --- a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md +++ b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md @@ -1,3 +1,4 @@ +[bazz2] Howto Manage Host Using Docker Machine in a VirtualBox ================================================================================ Hi all, today we'll learn how to create and manage a Docker host using Docker Machine in a VirtualBox. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. This API works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective platform pretty fast and in pretty easy way with just a single command. @@ -110,4 +111,4 @@ via: http://linoxide.com/linux-how-to/host-virtualbox-docker-machine/ [a]:http://linoxide.com/author/arunp/ [1]:https://github.com/docker/machine/releases -[2]:https://github.com/boot2docker/boot2docker \ No newline at end of file +[2]:https://github.com/boot2docker/boot2docker From 720a69740f352d31e51917422a8d012ef8ee1285 Mon Sep 17 00:00:00 2001 From: sevenot Date: Mon, 29 Jun 2015 21:00:41 +0800 Subject: [PATCH 44/76] sevenot translating --- ...rst Stable Version Of Atom Code Editor Has Been Released.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md index a316615a6c..cfb84d8866 100644 --- a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md +++ b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md @@ -1,3 +1,4 @@ +sevenot translating First Stable Version Of Atom Code Editor Has Been Released ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) @@ -65,4 +66,4 @@ via: http://itsfoss.com/atom-stable-released/ [5]:https://atom.io/download/deb [6]:https://atom.io/download/rpm [7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md -[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ \ No newline at end of file +[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ From 45131034736f4e66198ce72f0a76c220996dbf02 Mon Sep 17 00:00:00 2001 From: yajun Date: Mon, 29 Jun 2015 23:35:25 +0800 Subject: [PATCH 45/76] translated. --- ...20141211 Open source all over the world.md | 150 ------------------ ...20141211 Open source all over the world.md | 31 ++-- 2 files changed, 15 insertions(+), 166 deletions(-) delete mode 100644 sources/talk/20141211 Open source all over the world.md diff --git a/sources/talk/20141211 Open source all over the world.md b/sources/talk/20141211 Open source all over the world.md deleted file mode 100644 index 1ef32bf1de..0000000000 --- a/sources/talk/20141211 Open source all over the world.md +++ /dev/null @@ -1,150 +0,0 @@ -fyh 翻译中。。。 - -Open source all over the world -================================================================================ -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) - -Image by : opensource.com - -After a full day at the annual meeting of the Opensource.com [Community Moderators][1], it was time for the the last item on the agenda which simply said "Special Guest: TBD." [Jason Hibbets][2], project lead and community manager for [Opensource.com][3], stood up and began explaining, "In case it wasn't going to happen, I didn't want to say who it was. Months ago I asked for any dates he'd be in town. I got two, and picked one. This was one day out of three weeks that Jim was in town." - -The moderators, in town from all over the world for the [All Things Open conference][4], stirred at the table. Their chairs squeaked and snuck a few inches edgewise. - -"We're going to get a half hour to hear from him and take a couple questions," said Jason. - -The door opened, and as if it had been waiting for him the whole time, the only vacant seat at the head of the table was soon occupied by a tall fellow. - -"How is everyone doing?" said the man. No suit, just a button down shirt and slacks. - -The next tallest man in the room, [Jeff Mackanic][5], senior director of Global Awareness at Red Hat, explained that the majority of the Community Moderator team was present today. He asked everyone to quickly introduce themselves. - -"[Jen Wike Huger][6]. Content Manager for Opensource.com. Happy to have everyone here." - -"[Nicole][7]. Vice president of education at [ByWater Solutions][8]. We do FOSS for libraries. I travel and teach people how to use software." - -"[Robin][9]. I've been participating in the Moderator program since 2013. I do lots of stuff for OSDC and work in the [City of the Hague][10], maintaining their [website][11]." - -"[Marcus Hanwell][12]. Originally from England, I'm now at [Kitware][13]. I'm the technology lead on FOSS science software. I work with national labs and use things like [Titan][14] Z doing [GPU programming][15]. I've worked with [Gentoo][16] and [KDE][17]. Most of all, I'm passionate about joining FOSS and open science." - -"[Phil Shapiro][18]. I administrate 28 Linux work stations at a small library in D.C. I consider these folks my coworkers and colleagues. And it's wonderful to know that we can all feed into the energy and share ideas. My main interests are how FOSS intersects with dignity, and enhancing dignity." - -"[Joshua Holm][19]. I spend most of my time staring at system updates and helping people search for jobs on the Internet." - -"[Mel Chernoff][20]: I work here at Red Hat, primarily on the [government][21] channel with [Jason Hibbets][22] and [Mark Bohannon][23]." - -"[Scott Nesbitt][24]: I write for many things, but have been using FOSS for long time. I'm a 'mere mortal' just trying to be more productive, not a sysadmin or programmer. I help people meld FOSS into their business and personal lives." - -"[Luis Ibanez][25]: I just joined [Google]26], but I'm interested in DIY and FOSS." - -"[Remy DeCausemaker][27]: Resident Hackademic at the [RIT MAGIC Center][28] and Adjunct Professor for the [Department of Interactive Games and Media][29]. Been writing for Opensource.com for about four years now." - -"You teach courses for the [new FOSS Minor then][30]," said Jim. "Very cool." - -"[Jason Baker][31]. I'm a Red Hat cloud expert, mostly doing work around [OpenStack][32]." - -"[Mark Bohannan][33]. I'm with Red Hat Global Public Policy, and I work out of Washington. Like Mel, I spend a good deal of time writing for, or finding folks from, the legal and government channels. I've found an excellent outlet to discuss positive things happening in government." - -"[Jason Hibbets][34]. I organize the organized chaos here." - -The room has a good chuckle. - -"I organize this chaos too, you could say," says the brownish-red haired fellow with a gleaming white smile. The laughs grow then quieten. Breaths become baited. - -I sat to his left and had a moment to look up from transcribing to glance up. I noticed the hint of a smile behind the knowing eyes of a man who has led the company since January 2008, [Jim Whitehurst][35], president and CEO of Red Hat. - -"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.” - -"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.” - -"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.” - -"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'" - -"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." - -"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'" - -"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.” - -"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you." - -I stole a glimpse of everyone at the table: more than a few people had tears in their eyes. - -Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time." - -At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities. - -**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation." - -**Nicole**: "There are a lot of egos in academia. You need a release manager." - -**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early." - -**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more." - -**Jim**: "Is there an active role that companies can play in that?" - -[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office." - -**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning." - -Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source - -作者:[Remy][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/remyd -[1]:http://opensource.com/community-moderator-program -[2]:https://twitter.com/jhibbets -[3]:http://opensource.com/ -[4]:http://allthingsopen.org/ -[5]:http://opensource.com/users/mackanic -[6]:https://twitter.com/JenWike -[7]:http://opensource.com/users/nengard -[8]:http://bywatersolutions.com/ -[9]:http://opensource.com/life/13/7/community-spotlight-robin-muilwijk -[10]:https://en.wikipedia.org/wiki/The_Hague -[11]:http://www.denhaag.nl/en.htm -[12]:https://twitter.com/mhanwell -[13]:http://www.kitware.com/ -[14]:http://www.nvidia.com/gtx-700-graphics-cards/gtx-titan-z/ -[15]:https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units -[16]:https://www.gentoo.org/ -[17]:http://kde.org/ -[18]:https://twitter.com/philshapiro -[19]:http://opensource.com/community/13/9/contributor-spotlight-joshua-holm -[20]:http://opensource.com/users/melanie -[21]:http://opensource.com/government -[22]:https://twitter.com/jhibbets -[23]:https://twitter.com/markbotech -[24]:http://scottnesbitt.me/ -[25]:http://opensource.com/users/luis-ibanez -[26]:http://google.com/ -[27]:http://twitter.com/remy_d -[28]:http://foss.rit.edu/ -[29]:http://igm.rit.edu/ -[30]:http://www.rit.edu/news/story.php?id=50590 -[31]:https://twitter.com/jehb -[32]:http://openstack.org/ -[33]:https://twitter.com/markbotech -[34]:https://twitter.com/jhibbets -[35]:http://www.redhat.com/en/about/company/management/james-whitehurst -[36]:http://www.bseindia.com/ -[37]:http://google.com/ -[38]:https://mail.corp.redhat.com/service/home/%7E/Amazon -[39]:https://mail.corp.redhat.com/service/home/%7E/Facebook -[40]:https://hadoop.apache.org/ -[41]:https://cassandra.apache.org/ -[42]:https://en.wikipedia.org/wiki/3D_printing -[43]:https://twitter.com/mairin -[44]:http://jobs.redhat.com/life-at-red-hat/our-culture/ -[45]:http://www.gutenberg.org/ebooks/4300 -[46]:https://twitter.com/philshapiro -[47]:http://libreoffice.org/ diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md index c897765d75..0abb08121f 100644 --- a/translated/talk/20141211 Open source all over the world.md +++ b/translated/talk/20141211 Open source all over the world.md @@ -58,36 +58,35 @@ “源代码的开源确实很酷,但开源不应当仅限于此。在各行各业不同领域开源仍有可以用武之地。我们要问下自己:‘开源能够为教育,政府,法律带来什么?其它的呢?其它的领域如何能学习我们?’” -"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." +“还有内容的问题。内容在现在是免费的,当然我们可以投资更多的免费内容,不过我们也需要商业模式围绕的内容。这是我们更应该关注的。如果你相信开放的创新能带来更好,那么我们需要更多的商业模式。” -"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'" +“教育让我担心其相比与‘社区’它更关注‘内容’。例如,无论我走到哪里,大学校长们都会说,‘等等,难道教育将会免费?!’对于下游来说FOSS免费很棒,但别忘了上游很强大。免费课程很棒,但我们同样需要社区来不断迭代和完善。这是很多人都在做的事情,Opensource.com是一个提供交流的社区。问题不是‘我们如何控制内容’,也不是‘如何建立和分发内容’,而是要确保它处在不断的完善当中,而且能给其他领域提供有价值的参考。” -"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.” +“改变世界的潜力是无穷无尽的,我们已经取得了很棒的进步。”六年前我们痴迷于制定宣言,我们说‘我们是领导者’。我们用错词了,因为那潜在意味着控制。积极的参与者们同样也不能很好理解……[Máirín Duffy][43]提出了[催化剂][44]这个词。然后我们组成了红帽,不断地促进行动,指引方向。” -"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you." +“Opensource.com也是其他领域的催化剂,而这正是它的本义所在,我希望你们也这样认为。当时的内容质量和现在比起来都令人难以置信。你可以看到每季度它都在进步。谢谢你们的时间!谢谢成为了催化剂!这是一个让世界变得更好的机会。我想听听你们的看法。” -I stole a glimpse of everyone at the table: more than a few people had tears in their eyes. +我瞥了一下桌子,发现几个人眼中带泪。 -Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time." +然后Whitehurst又回顾了大会的开放教育议题。“极端一点看,如果你有一门[Ulysses][45]的公开课。在这里你能和一群人一起合作体验课堂。这样就和代码块一样的:大家一起努力,代码随着时间不断改进。” -At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities. +在这一点上,我有发言权。当谈论其FOSS和学术团体之间的差异,向基础和可能的不调和这些词语都跳了出来。 -**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation." +**Remy**: “倒退带来死亡。如果你在论文或者发布的代码中烦了一个错误,有可能带来十分严重的后果。学校一直都是避免失败寻求正确答案的地方。复制意味着抄袭。轮子在一遍遍地教条地被发明。FOSS你能快速失败,但在学术界,你只能带来无效的结果。” -**Nicole**: "There are a lot of egos in academia. You need a release manager." +**Nicole**: “学术界有太多自我的家伙,你们需要一个发布经理。” -**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early." +**Marcus**: “为了合作,你必须展示自己不懂的地方,这些发生在幕后。奖励模型是所有你信任的东西,我们需要改变它。尽可能多地发表,我们最后会发布,但希望能尽早地释放努力。” -**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more." +**Luis**: “团队和分享应该优先考虑,红帽可以多向它们强调这一点。” -**Jim**: "Is there an active role that companies can play in that?" +**Jim**: “还有公司在其中扮演积极角色吗?” -[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office." +[Phil Shapiro][46]: “我对FOSS的临界点感兴趣。联邦没有改用[LibreOffice][47]把我逼疯了。我们没有在软件上花税款,也不应当在字处理软件或者微软的Office上浪费税钱。” -**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning." - -Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired. +**Jim**: “我们经常提倡这一点。我们能做更多吗?这是个问题。首先,我们在我们的产品涉足的地方取得了进步。我们在政府中有坚实的专营权。我们比私有公司平均话费更多。银行和电信业都和政府挨着。我们在欧洲做的更好,我认为在那工作又更低的税。下一代计算就像‘终结者’,我们到处取得了进步,但仍然需要忧患意识。” +突然,门开了。Jim转身向门口站着的执行助理点头。他要去参加下一场会了。他并拢双腿,站着向前微倾。然后,他再次向每个人的工作和奉献表示感谢,微笑着除了门……留给我们更多的激励。 -------------------------------------------------------------------------------- via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source From 27ef9486defde23e32f3a486d681905537d867c8 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 30 Jun 2015 10:44:10 +0800 Subject: [PATCH 46/76] [Translating] tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md --- ...629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md index 74b5126246..7674d0b423 100644 --- a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md +++ b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -1,3 +1,4 @@ +ictlyh translating 4 Useful Tips on mkdir, tar and kill Commands in Linux ================================================================================ We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our [Linux Tips and Trick Series][1], I am here with the below four tips that will going to help you in lots of ways. Here we go! From ba6c61aac4963534cc051d3f67220aeee824b432 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 30 Jun 2015 11:57:40 +0800 Subject: [PATCH 47/76] [Translated] tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md --- ...n mkdir, tar and kill Commands in Linux.md | 207 ------------------ ...n mkdir, tar and kill Commands in Linux.md | 206 +++++++++++++++++ 2 files changed, 206 insertions(+), 207 deletions(-) delete mode 100644 sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md create mode 100644 translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md diff --git a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md deleted file mode 100644 index 7674d0b423..0000000000 --- a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md +++ /dev/null @@ -1,207 +0,0 @@ -ictlyh translating -4 Useful Tips on mkdir, tar and kill Commands in Linux -================================================================================ -We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our [Linux Tips and Trick Series][1], I am here with the below four tips that will going to help you in lots of ways. Here we go! - -![Linux Useful Tips](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) - -4 Linux Useful Tips and Hacks - -### 1. You are supposed to create a long/complex directory tree similar to given below. What is the most effective way to achieve this? ### - -Directory tree structure to achieve as suggested below. - - $ cd /home/$USER/Desktop - $ mkdir tecmint - $ mkdir tecmint/etc - $ mkdir tecmint/lib - $ mkdir tecmint/usr - $ mkdir tecmint/bin - $ mkdir tecmint/tmp - $ mkdir tecmint/opt - $ mkdir tecmint/var - $ mkdir tecmint/etc/x1 - $ mkdir tecmint/usr/x2 - $ mkdir tecmint/usr/x3 - $ mkdir tecmint/tmp/Y1 - $ mkdir tecmint/tmp/Y2 - $ mkdir tecmint/tmp/Y3 - $ mkdir tecmint/tmp/Y3/z - -The above scenario can simply be achieved by running the below 1-liner command. - - $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} - -To verify you may use tree command. If not installed you may apt or yum the package ‘tree‘. - - $ tree tecmint - -![Check Directory Structure](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) - -Check Directory Structure - -We can create directory tree structure of any complexity using the above way. Notice it is nothing other than a normal command but its using `{}` to create hierarchy of directories. This may prove very helpful if used from inside of a shell script when required and in general. - -### 2. Create a file (say test) on your Desktop (/home/$USER/Desktop) and populate it with the below contents. ### - - ABC - DEF - GHI - JKL - MNO - PQR - STU - VWX - Y - Z - -What a normal user would do in this scenario? - -a. He will create the file first, preferably using [touch command][2], as: - - $ touch /home/$USER/Desktop/test - -b. He will use a text editor to open the file, which may be nano, vim, or any other editor. - - $ nano /home/$USER/Desktop/test - -c. He will then place the above text into this file, save and exit. - -So regardless of time taken by him/her, he need at-least 3 steps to execute the above scenario. - -What a smart experienced Linux-er will do? He will just type the below text in one-go on terminal and all done. He need not do each action separately. - - cat << EOF > /home/$USER/Desktop/test - ABC - DEF - GHI - JKL - MNO - PQR - STU - VWX - Y - Z - EOF - -You may use ‘cat‘ command to check if the file and its content were created successfully or not. - - $ cat /home/avi/Desktop/test - -![Check File Content](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) - -### 3. We deal with archives (specially TAR balls) very often on Linux. In many cases we have to use that TAR ball on some location other than Downloads folder. What we do in this scenario? ### - -We normally do two things in this scenario. - -a. Copy/Move the tar ball and extract it at destination, as: - - $ cp firefox-37.0.2.tar.bz2 /opt/ - or - $ mv firefox-37.0.2.tar.bz2 /opt/ - -b. cd to /opt/ directory. - - $ cd /opt/ - -c. Extract the Tarball. - - # tar -jxvf firefox-37.0.2.tar.bz2 - -We can do this the other way around. - -We will extract the Tarball where it is and Copy/Move the extracted archive to the required destination as: - - $ tar -jxvf firefox-37.0.2.tar.bz2 - $ cp -R firefox/ /opt/ - or - $ mv firefox/ /opt/ - -In either case the work is taking two or steps to complete. The professional can complete this task in one step as: - - $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ - -The option -C makes tar extract the archive in the specified folder (here /opt/). - -No it is not about an option (-C) but it is about habits. Make a habit of using option -C with tar. It will ease your life. From now don’t move the archive or copy/move the extracted file, just leave the TAR-ball in the Downloads folder and extract it anywhere you want. - -### 4. How we kill a process in a traditional way? ### - -In most general way, we first list all the process using command `ps -A` and pipeline it with grep to find a process/service (say apache2), simply as: - - $ ps -A | grep -i apache2 - -#### Sample Output #### - - 1006 ? 00:00:00 apache2 - 2702 ? 00:00:00 apache2 - 2703 ? 00:00:00 apache2 - 2704 ? 00:00:00 apache2 - 2705 ? 00:00:00 apache2 - 2706 ? 00:00:00 apache2 - 2707 ? 00:00:00 apache2 - -The above output shows all currently running apache2 processes with their PID’s, you can then use these PID’s to kill apache2 with the help of following command. - - # kill 1006 2702 2703 2704 2705 2706 2707 - -and then cross check if any process/service with the name ‘apache2‘ is running or not, as: - - $ ps -A | grep -i apache2 - -However we can do it in a more understandable format using utilities like pgrep and pkill. You may find relevant information about a process just by using pgrep. Say you have to find the process information for apache2, you may simply do: - - $ pgrep apache2 - -#### Sample Output #### - - 15396 - 15400 - 15401 - 15402 - 15403 - 15404 - 15405 - -You may also list process name against pid by running. - - $ pgrep -l apache2 - -#### Sample Output #### - - 15396 apache2 - 15400 apache2 - 15401 apache2 - 15402 apache2 - 15403 apache2 - 15404 apache2 - 15405 apache2 - -To kill a process using pkill is very simple. You just type the name of resource to kill and you are done. I have written a post on pkill which you may like to refer here : [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]. - -To kill a process (say apache2) using pkill, all you need to do is: - - # pkill apache2 - -You may verify if apache2 has been killed or not by running the below command. - - $ pgrep -l apache2 - -It returns the prompt and prints nothing means there is no process running by the name of apache2. - -That’s all for now, from me. All the above discussed point are not enough but will surely help. We not only mean to produce tutorials to make you learn something new every-time but also want to show ‘How to be more productive in the same frame‘. Provide us with your valuable feedback in the comments below. Keep connected. Keep Commenting. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/tag/linux-tricks/ -[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ -[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md new file mode 100644 index 0000000000..c094d8f916 --- /dev/null +++ b/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -0,0 +1,206 @@ +Linux mkdir、tar 和 kill 命令的 4 个有用小技巧 +================================================================================ +我们一直以常规的方式完成一个任务,直到我们知道有更好的处理方法。作为 [Linux 技巧和绝招系列][1] 的后续,我会在这里介绍能在各个方面给你帮助的 4 个小技巧。开始吧! + +![有用的 Linux 小技巧](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) + +4 个有用的 Linux 小技巧 + +### 1. 假设你要创建一个类似于下面很长的/复杂的目录树。实现这最有效的方法是什么呢? ### + +类似下面要实现的目录树结构。 + + $ cd /home/$USER/Desktop + $ mkdir tecmint + $ mkdir tecmint/etc + $ mkdir tecmint/lib + $ mkdir tecmint/usr + $ mkdir tecmint/bin + $ mkdir tecmint/tmp + $ mkdir tecmint/opt + $ mkdir tecmint/var + $ mkdir tecmint/etc/x1 + $ mkdir tecmint/usr/x2 + $ mkdir tecmint/usr/x3 + $ mkdir tecmint/tmp/Y1 + $ mkdir tecmint/tmp/Y2 + $ mkdir tecmint/tmp/Y3 + $ mkdir tecmint/tmp/Y3/z + +上述情况可以简单地通过运行下面一行命令来实现。 + + $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} + +你可以用 tree 命令验证。如果没有安装你可以使用 apt 或 yum 安装 ‘tree’ 软件包。 + + $ tree tecmint + +![检查目录结构](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) + +检查目录结构 + +我们可以用上面的方式创建任意复制的目录树结构。注意这仅仅是一个普通的命令,但是用 ‘{}’ 来创建层级目录。需要的时候如果在 shell 脚本中使用是非常有用的。 + +### 2. 在桌面(/home/$USER/Desktop)创建一个文件(例如 test)并填入以下内容。 ### + + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + +这种情况一个普通用户会怎么做呢? + +a. 他首先会创建文件,最好使用 [touch 命令][2],例如: + + $ touch /home/$USER/Desktop/test + +b. 他会用一个文本编辑器打开文件,这可能是 nano、vim 或其它编辑器。 + + $ nano /home/$USER/Desktop/test + +c. 然后他会将上面的内容输入到文件中,保存并退出。 + +忽略他/她使用的时间,他至少需要 3 步来执行上面的情况。 + +一个经验丰富的 Linux 用户会怎么做呢?他会在终端中输入下面的文本然后就完成所有任务。他不需要单独执行每一步。 + + cat << EOF > /home/$USER/Desktop/test + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + EOF + +你可以用 ‘cat’ 命令检查是否成功创建了文件和内容。 + + $ cat /home/avi/Desktop/test + +![检查文件内容](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) + +### 3. 我们经常在 Linux 中处理归档文件(尤其是 TAR 包)。很多情况下我们会在某些位置,而不是在 Downloads 目录中使用 TAR 包。这种情况下我们怎么做呢? ### + +在这种情况下我们通常会做两件事。 + +a. 复制/移动 tar 包到目标位置并解压,例如: + + $ cp firefox-37.0.2.tar.bz2 /opt/ + 或 + $ mv firefox-37.0.2.tar.bz2 /opt/ + +b. cd 到 /opt/ 目录。 + + $ cd /opt/ + +c. 解压 tar 包。 + + # tar -jxvf firefox-37.0.2.tar.bz2 + +我们也可以采用另外一种方式。 + +我们可以在 Tar 包所在位置解压并复制/移动解压后的文件到所需的目标位置,例如: + + $ tar -jxvf firefox-37.0.2.tar.bz2 + $ cp -R firefox/ /opt/ + 或 + $ mv firefox/ /opt/ + +不管哪种方式都需要两步才能完成任务。专业的人可以只用一步就完成这个任务: + + $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ + +-C 选项提取文件到指定目录(这里是 /opt/)。 + +这并不是关于选项(-C)的问题,而是习惯的问题。养成使用带 -C 选项 tar 命令的习惯。这会使你的工作更加轻松。从现在开始不要再移动归档文件或复制/移动解压后的文件了,在 Downloads 文件夹保存 tar 包并解压到你想要的任何地方吧。 + +### 4. 常规方式我们怎样杀掉一个进程? ### + +最普遍的方法,我们首先用 `ps -A` 命令列出所有进程,然后通过管道输入到 grep 来查找进程/服务(假如 apache2),如下: + + $ ps -A | grep -i apache2 + +#### 输出样例 #### + + 1006 ? 00:00:00 apache2 + 2702 ? 00:00:00 apache2 + 2703 ? 00:00:00 apache2 + 2704 ? 00:00:00 apache2 + 2705 ? 00:00:00 apache2 + 2706 ? 00:00:00 apache2 + 2707 ? 00:00:00 apache2 + +上面的输出显示了所有正在运行 apache2 的进程以及它们的 PID,然后你可以使用这些 PID 在下面命令的帮助下杀掉 apache2。 + + # kill 1006 2702 2703 2704 2705 2706 2707 + +然后交叉检查是否还有名称中包含 ‘apache2’ 的进程/服务在运行,如下: + + $ ps -A | grep -i apache2 + +实际上我们可以使用类似 pgrep 和 pkill 的工具以一种更容易理解的方式实现。你可以使用 pgrep 找到和一个进程相关的信息。假如你要找和 apache2 相关的进程信息,你只需要运行: + + $ pgrep apache2 + +#### 输出样例 #### + + 15396 + 15400 + 15401 + 15402 + 15403 + 15404 + 15405 + +你也可以通过运行下面命令列出进程名称以及 pid。 + + $ pgrep -l apache2 + +#### 输出样例 #### + + 15396 apache2 + 15400 apache2 + 15401 apache2 + 15402 apache2 + 15403 apache2 + 15404 apache2 + 15405 apache2 + +用 pkill 杀掉进程非常简单。你只需要输入想要杀死的资源名称。我写了一篇关于 pkill 的博文,你可以参考: [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]。 + +用 pkill 杀死一个进程(例如 apache2),你只需要输入以下命令: + + # pkill apache2 + +你可以通过运行下面命令验证是否杀掉了 apache2。 + + $ pgrep -l apache2 + +它没有输出任何东西并返回到窗口意味着没有名称中包含 apache2 的进程在运行。 + +这就是我要说的所有东西。上面讨论的点肯定远远不够,但也肯定对你有所帮助。我们不仅仅是介绍教程使你学到一些新的东西,更重要的是想告诉你 ‘在同样的情况下如何变得更有效率’。在下面的评论框中告诉我们你的反馈吧。保持联系,继续评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ + +作者:[Avishek Kumar][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file From 079ccaf9f1673cdfc89a1ab052bc2bedcb90ee96 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Tue, 30 Jun 2015 13:29:06 +0800 Subject: [PATCH 48/76] [translated] 20150616 XBMC--build a remote control --- .../20150616 XBMC--build a remote control.md | 265 ------------------ .../20150616 XBMC--build a remote control.md | 264 +++++++++++++++++ 2 files changed, 264 insertions(+), 265 deletions(-) delete mode 100644 sources/tech/20150616 XBMC--build a remote control.md create mode 100644 translated/tech/20150616 XBMC--build a remote control.md diff --git a/sources/tech/20150616 XBMC--build a remote control.md b/sources/tech/20150616 XBMC--build a remote control.md deleted file mode 100644 index 5066e28ce2..0000000000 --- a/sources/tech/20150616 XBMC--build a remote control.md +++ /dev/null @@ -1,265 +0,0 @@ -zpl1025 -XBMC: build a remote control -================================================================================ -**Take control of your home media player with a custom remote control running on your Android phone.** - -**XBMC** is a great piece of software, and can turn almost can computer into a media centre. It can play music and videos, display pictures, and even fetch a weather forecast. To make it easy to use in a home theatre setup, you can control it via mobile phone apps that access a server running on the XBMC machine via Wi-Fi. There are loads of these available for almost all smartphone systems. - -> ### Kodi ### -> -> By the time you read this, **XBMC** may be no more. The project team have decided to rename it **Kodi** for legal reasons (and because **XBMC**, or X**-Box Media Centre**, refers to older hardware that is no longer supported). Other than the name, though, nothing has changed. Or at least nothing other than the usual raft of improvements you’d expect from a new release. This shouldn’t affect the remote software though, and it should work on both existing **XBMC** systems, and newer Kodi systems. - -We’ve recently set up an **XBMC** system for playing music, and none of the XBMC remotes we found really excel at this task, especially when the TV attached to the media centre is turned off. They were all a bit too complex, as they packed too much functionality into small screens. We wanted a system designed from the ground up to just access a music library and a radio addon, so we decided to build one ourselves. It didn’t need to be able to access the full capabilities of XBMC, because for tasks other than music, we’d simply switch back to a general-purpose XBMC remote control. Our test system was a Raspberry Pi running the RaspBMC distribution, but nothing here is specific to either the Pi or that distro, and it should work on any Linux-based XBMC system provided the appropriate packages are available. - -The first thing a remote control needs is a user interface. Many XBMC remote controls are written as standalone apps. However, this is just for our music, and we want to be accessible to guests without them having to install anything. The obvious solution is to make a web interface. XBMC does have a built-in web server, but to give us more control, we decided to use a separate web framework. There’s no problem running more than one web server on a computer at a time, but they can’t run on the same port. - -There are quite a few web frameworks available. We’ve used Bottle because it’s a simple, fast framework, and we don’t need any complex functions. Bottle is a Python module, so that’s the language in which we’ll write the server. - -You’ll probably find Bottle in your package manager. In Debian-based systems (including Raspbmc), you can grab it with: - - sudo apt-get install python-bottle - -A remote control is really just a layer that connects the user to a system. Bottle provides what we need to interact with the user, and we’ll interact with **XBMC** using its JSON API. This enables us to control the media player by sending JSON-encoded information. - -We’re going to use a simple wrapper around the XBMC JSON API called xbmcjson. It’s just enough to allow you send requests without having to worry about the actual JSON formatting or any of the banalities of communicating with a server. It’s not included in the PIP package manager, so you need to install it straight from **GitHub**: - - git clone https://github.com/jcsaaddupuy/python-xbmc.git - cd python-xbmc - sudo python setup.py install - -This is everything you need, so let’s get coding. - -#### Get started with Bottle #### - -The basic structure of our program is: - - from xbmcjson import XBMC - from bottle import route, run, template, redirect, static_file, request - import os - xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) - @route(‘/hello/’) - def index(name): - return template(‘

Hello {{name}}!

’, name=name) - run(host=”0.0.0.0”, port=8000) - -This connects to **XBMC** (though doesn’t actually use it); then Bottle starts serving up the website. In this case, it listens on host 0.0.0.0 (which is every hostname), and port 8000. It only has one site, which is /hello/XXXX where XXXX can be anything. Whatever XXXX is gets passed to index() as the parameter name. This then passes it to the template, which substitutes it into the HTML. - -You can try this out by entering the above into a file (we’ve called it remote.py), and starting it with: - - python remote.py - -You can then point your browser to localhost:8000/hello/world to see the template in action. - -@route() sets up a path in the web server, and the function index() returns the data for that path. Usually, this means returning HTML that’s generated via a template, but it doesn’t have to be (as we’ll see later). - -As we go on, we’ll add more routes to the application to make it a fully-featured XBMC remote control, but it will still be structured in the same way. - -The XBMC JSON API can be accessed by any computer on the same network as the XBMC machine. This means that you can develop it on your desktop, then deploy it to your media centre rather than fiddle round uploading every change to your home theatre PC. - -Templates – like the simple one in the previous example – are a way of combining Python and HTML to control the output. In principal, they can do quite a bit of processing, but they can get messy. We’ll use them just to format the data correctly. Before we can do that, though, we have to have some data. - -> ### Paste ### -> -> Bottle includes its own web server, which is what we’ve been using for testing the remote control. However, we found that it didn’t always perform well. When we put the remote into action, we wanted something that could deliver pages a bit quicker. Bottle can work with quite a few different web servers, and we found Paste worked quite well. In order to use this, just install it (in the package python-paste on Debian), and change the run call to: -> -> run(host=hostname, port=hostport, server=”paste”) -> -> You can see details of how to use other servers at [http://bottlepy.org/docs/dev/deployment.html][1]. - -#### Getting data from XBMC #### - -The XBMC JSON API is split up into 14 namespaces: JSONRPC, Player, Playlist, Files, AudioLibrary, VideoLibrary, Input, Application, System, Favourites, Profiles, Settings, Textures and XBMC. Each of these is available from an XBMC object in Python (apart from Favourites, in an apparent oversight). In each of these namespaces there are methods that you can use to control the application. For example, Playlist.GetItems() can be used to get the items on a particular playlist. The server returns data to us in JSON, but the xbmcjson module converts it to a Python dictionary for us. - -There are two items in XBMC that we need to use to control playback: players and playlists. Players hold a playlist and move through it item by item as each song finishes. In order to see what’s currently playing, we need to get the ID of the active player, and through that find out the ID of the current playlist. We’ve done this with the following function: - - def get_playlistid(): - player = xbmc.Player.GetActivePlayers() - if len(player[‘result’]) > 0: - playlist_data = xbmc.Player.GetProperties({“playerid”:0, “properties”:[“playlistid”]}) - if len(playlist_data[‘result’]) > 0 and “playlistid” in playlist_data[‘result’].keys(): - return playlist_data[‘result’][‘playlistid’] - return -1 - -If there isn’t a currently active player (that is, if the length of the results section in the returned data is 0), or if the current player has no playlist, this will return -1. Otherwise, it will return the numeric ID of the current playlist. - -Once we’ve got the ID of the current playlist, we can get the details of it. For our purposes, two things are important: the list of items in the playlist, and the position we are in the playlist (items aren’t removed from the playlist after they’ve been played; the current position just marches on). - - def get_playlist(): - playlistid = get_playlistid() - if playlistid >= 0: - data = xbmc.Playlist.GetItems({“playlistid”:playlistid, “properties”: [“title”, “album”, “artist”, “file”]}) - position_data = xbmc.Player.GetProperties({“playerid”:0, ‘properties’:[“position”]}) - position = int(position_data[‘result’][‘position’]) - return data[‘result’][‘items’][position:], position - return [], -1 - -This returns the current playlist starting with the item that’s currently playing (since we don’t care about stuff that’s finished), and it also includes the position as this is needed for removing items from the playlist. - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc2-large.jpg) - -The API is documented at [http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]. It lists all the available functions, but it a little short on details of how to use them. - -> ### JSON ### -> -> JSON stands for JavaScript Object Notation, and was originally designed as a way of serialising JavaScript Objects. It still is used for that, but it’s also a useful way of encoding all sorts of data. -> -> JSON objects always have the form: -> -> {property1:value1, property2:value2, property3:value3} -> -> For an arbitrary number of property/value pairs. To Python programmers, this all looks suspiciously similar to dictionaries, and the two are very similar. -> -> As with dictionaries, the value can itself be another JSON object, or a list, so the following is perfectly valid: -> -> {“name”:“Ben”, “jobs”:[“cook”, “bottle-washer”], “appearance”: {“height”:195, “skin”:“fair”}} -> -> JSON is often used in web services to send data back and fourth, and it’s well supported by most programming languages, so if Python’s not your thing, you should easily be able to use the same functions to control XBMC from software written in the language of your choice. - -#### Bringing them together #### - -The code to link the previous functions to a HTML page is simply: - - @route(‘/juke’) - def index(): - current_playlist, position = get_playlist() - return template(‘list’, playlist=current_playlist, offset = position) - -This only has to grab the playlist (using the function we defined above), and pass it to a template that handles the display. - -The main part of the template that handles the display of this data is: - -

Currently Playing:

- % if playlist is not None: - % position = offset - % for song in playlist: - {{song[‘title’]}} - % if song[‘type’] == ‘unknown’: - Radio - % else: - {{song[‘artist’][0]}} - % end - % if position != offset: - remove - % else: - skip - % end -
- % position += 1 - % end - -As you can see, templates are mostly written in HTML, but with a few extra bits to control output. Variables enclosed by double parenthesise are output in place (as we saw in the first ‘hello world’ example). You can also include Python code on lines starting with a percentage sign. Since indents aren’t used, you need a % end to close any code block (such as a loop or if statement). - -This template first checks that the playlist isn’t empty, then loops through every item on the playlist. Each item is displayed as the song title in bold, then the name of the artist, then a link to either skip it (if it’s the currently playing song), or remove it from the playlist. All songs have a type of ‘song’, so if the type is ‘unknown’, then it isn’t a song, but a radio station. - -The /remove/ and /skip/ routes are simple wrappers around XBMC controls that reload /juke after the change has taken effect: - - @route(‘/skip/’) - def index(position): - print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) - redirect(“/juke”) - @route(‘/remove/’) - def index(position): - playlistid = get_playlistid() - if playlistid >= 0: - xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) - redirect(“/juke”) - -Of course, it’s no good being able to manage your playlist if you can’t add music to it. - -This is complicated slightly by the fact that once a playlist finishes, it disappears, so you need to create a new one. Rather confusingly, playlists are created by calling the Playlist.Clear() method. This can also be used to kill a playlist that is currently playing a radio station (where the type is unknown). The other complication is that radio streams sit in the playlist and never leave, so if there’s currently a radio station playing, we need to clear the playlist as well. - -These pages include a link to play the songs, which points to /play/. This page is handled by: - - @route(‘/play/’) - def index(id): - playlistid = get_playlistid() - playlist, not_needed= get_playlist() - if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: - xbmc.Playlist.Clear({“playlistid”:0}) - xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) - xbmc.Player.open({“item”:{“playlistid”:0}}) - playlistid = 0 - else: - xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) - remove_duplicates(playlistid) - redirect(“/juke”) - -The final thing here is a call to remove_duplicates. This isn’t essential – and some people may not like it – but it makes sure that no song appears in the playlist more than once. - -We also have pages that list all the artists in the collection, and list the songs and albums by particular artists. These are quite straightforward, and work in the same basic way as /juke. - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc1-large.jpg) - -The UI still needs a bit of attention, but it’s working. - -> ### Logging ### -> -> It’s not always clear how to do something using the XBMC JSON API, and the documentation is sometimes a little opaque. One way of finding out how to do something is seeing how other remote controls do it. If you turn on logging, you can see what API calls are being performed as you use another remote control, then incorporate these into your code. -> -> To turn on logging, hook your XBMC media centre up to a display and go to Settings > System > Debugging, and turn on Enable Debug Logging. With logging turned on, you need to access the XBMC machine (eg via SSH), then you can view the log. Its location should be displayed in the top-left corner of the XBMC display. In RaspBMC, it’s at /home/pi/.xbmc/temp/xbmc.log. You can then keep an eye on what API calls are being performed in real time using: -> -> cd /home/pi/.xbmc/temp -> tail -f xbmc.log | grep “JSON” - -#### Adding functionality #### - -The above code all works with songs in the XBMC library, but we also wanted to be able to play radio stations. Addons each have their own plugin URL that can be used to pull information out of them using the usual XBMC JSON commands. For example, to get the selected stations from the radio plugin, we use: - - @route(‘/radio/’) - def index(): - my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: - [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) - if ‘result’ in my_stations.keys(): - return template(‘radio’, stations=my_stations[‘result’][‘files’]) - else: - return template(‘error’, error=’radio’) - -This includes a file that can be added to a playlist just as any song can be. However, these files never finish playing, so (as we saw before) you need to recreate the playlist before adding any songs to it. - -#### Sharing songs #### - -As well as serving up templates, Bottle can serve static files. These are useful whenever you need things that don’t change based on the user input. That could be a CSS file, an image or an MP3. In our simple controller there’s not (yet) any CSS or images to make things look pretty, but we have added a way to download the songs. This lets the media centre act as a sort of NAS box for songs. If you’re transferring large amounts of data, it’s probably best to use something like Samba, but serving static files is a good way of grabbing a couple of tunes on your phone. - -The Bottle code to download a song by its ID is : - - @route(‘/download/’) - def index(id): - data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) - full_filename = data[‘result’][‘songdetails’][‘file’] - path, filename = os.path.split(full_filename) - return static_file(filename, root=path, download=True) - -To use this, we just put a link to the appropriate ID in the /songsby/ page. - -We’ve gone through all the mechanics of the code, but there are a few more bits that just tie it all together. You can see for yourself at the GitHub page:[https://github.com/ben-ev/xbmc-remote][3]. - -> ### Setting up ### -> -> Once you’ve developed your remote control, you’ll need a way of ensuring that it starts every time you turn on your media centre. There are a few ways of doing this, but the easiest is just to add a command launching it to /etc/rc.local. We installed our file to /opt/xbmc-remote/remote.py with all the other files alongside it. We then added the following line to /etc/rc.local before the final exit 0 line. -> -> cd /opt/xbmc-remote && python remote.py & - -> ### GitHub ### -> -> This project is quite bare-bones at the moment, but – the business of running a magazine means we don’t have as much time as we’d like to program. However, we’ve set up a GitHub project where we hope to keep working on it, and if you think you’d benefit from the project as well, we’d love your input. -> -> To see what’s going on, head over to [https://github.com/ben-ev/xbmc-remote][4] and take a look at what state it’s in. You can get a copy of the latest code from that web page, or clone it from the command line. -> -> If you want to improve it, you can fork the project to develop in your own branch, and then send a pull request when your features are working. For more information on working with GitHub, head to [https://github.com/features][5]. - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ - -作者:[Ben Everard][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/ben_everard/ -[1]:http://bottlepy.org/docs/dev/deployment.html -[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 -[3]:https://github.com/ben-ev/xbmc-remote -[4]:https://github.com/ben-ev/xbmc-remote -[5]:https://github.com/features diff --git a/translated/tech/20150616 XBMC--build a remote control.md b/translated/tech/20150616 XBMC--build a remote control.md new file mode 100644 index 0000000000..7347aca243 --- /dev/null +++ b/translated/tech/20150616 XBMC--build a remote control.md @@ -0,0 +1,264 @@ +XBMC:自制遥控 +================================================================================ +**通过运行在 Android 手机上的自制遥控器来控制你的家庭媒体播放器。** + +**XBMC** 一款很优秀的软件,能够将几乎所有电脑变身成媒体中心。它可以播放音乐和视频,显示图片,甚至还能显示天气预报。为了在配置成家庭影院后方便使用,你可以通过手机 app 访问运行在已连接到 Wi-Fi 的 XBMC 机器上的服务来控制它。可以找到很多这种工具,几乎覆盖所有智能手机系统。 + +> ### Kodi ### +> +> 在你阅读这篇文章的时候,**XBMC** 可能已经成为历史。因为法律原因(因为名字 **XBMC** 或 X**-Box Media Center** 里引用了不再支持的过时硬件)项目组决定使用新的名字 **Kodi**。不过,除了名字,其他的都会保持原样。或者说除开通常新版本中所期待的大量新改进。这一般不会影响到遥控软件,它应该能在已有的 **XBMC** 系统和新的 Kodi 系统上都能工作。 + +我们目前配置了一个 **XBMC** 系统用于播放音乐,不过我们找到的所有 XBMC 遥控没一个好用的,特别是和媒体中心连接的电视没打开的时候。它们都有点太复杂了,集成了太多功能在手机的小屏幕上。我们希望能有这样的系统,从最开始就是设计成只用于访问音乐库和电台插件,所以我们决定自己实现一个。它不需要用到 XBMC 的所有功能,因为除了音乐以外的任务,我们可以简单地切换使用通用的 XBMC 遥控。我们的测试系统是一个刷了 RaspBMC 发行版的树莓派,但是我们要做的工具并不受限于树莓派或那个发行版,它应该可以匹配任何安装了相关插件的基于 Linux 的 XBMC 系统。 + +首先,遥控程序需要一个用户界面。大多数 XBMC 遥控程序都是独立的 app。不过对于我们要做的这个音乐控制程序,我们希望用户可以不用安装任何东西就可以使用。显然我们需要使用网页界面。XBMC 本身自带网页服务器,但是为了获得更多权限,我们还是使用了独立的网页框架。在同一台电脑上跑两个以上网页服务器没有问题,只不过它们不能使用相同的端口。 + +有几个网页框架可以使用。而我们选用 Bottle 是因为它是一个简单高效的框架,而且我们也确实用不到任何高级功能。Bottle 是一个 Python 模块,所以这也将是我们编写服务器模块的语言。 + +你应该能在软件包管理器里找到 Bottle。在基于 Debian 的系统(包括 RaspBMC)里,你可以通过下面的命令安装: + + sudo apt-get install python-bottle + +遥控程序实际上只是连接用户和系统的中间层。Bottle 提供了和用户交互的方式,而我们将通过 JSON API 来和 **XBMC** 交互。这样可以让我们通过发送 JSON 格式消息的方式去控制媒体播放器。 + +我们将用到一个叫做 xbmcjson 的简单 XBMC JASON API 封装。足够用来发送控制请求,而不需要关心实际的 JSON 格式以及和服务器通讯的无聊事。它没有包含在 PIP 包管理中,所以你得直接从 **GitHub** 安装: + + git clone https://github.com/jcsaaddupuy/python-xbmc.git + cd python-xbmc + sudo python setup.py install + +万事俱备,只欠代码。 + +#### 先从 Bottle 开始 #### + +我们程序的基本结构: + + from xbmcjson import XBMC + from bottle import route, run, template, redirect, static_file, request + import os + xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) + @route(‘/hello/’) + def index(name): + return template(‘

Hello {{name}}!

’, name=name) + run(host=”0.0.0.0”, port=8000) + +这样程序将连接到 **XBMC**(不过实际上用不到);然后 Bottle 会开始伺服网站。在我们的代码里,它将监听主机 0.0.0.0(意味着允许所有主机连接)的端口 8000。它只设定了一个站点,就是 /hello/XXXX,这里的 XXXX 可以是任何内容。不管 XXXX 是什么都将作为参数名传递给 index()。然后再替换进去 HTML 网页模版。 + +你可以先试着把上面内容写到一个文件(我们取的名字是 remote.py),然后用下面的命令启动: + + python remote.py + +然后你可以在浏览器里访问 localhost:8000/hello/world 看看模版生效的效果。 + +@route() 用来设定网页服务器的路径,而函数 index() 会返回该路径的数据。通常是返回由模版生成的 HTML 页面,但是并不是说只能这样(后面会看到)。 + +随后,我们将给应用添加更多页面入口,让它变成一个全功能的 XBMC 遥控,但仍将采用相同代码结构。 + +XBMC JSON API 接口可以从和 XBMC 机器同网段的任意电脑上访问。也就是说你可以在自己的笔记本上开发,然后再布置到媒体中心上,而不需要浪费时间上传每次改动。 + +模版 - 比如前面例子里的那个简单模版 - 是一种结合 Python 和 HTML 来控制输出的方式。理论上,这俩能做很多很多事,但是会非常混乱。我们将只是用它们来生成正确格式的数据。不过,在开始动手之前,我们先得准备点数据。 + +> ### Paste ### +> +> Bottle 自带网页服务器,就是我们用来测试遥控程序的。不过,我们发现它性能有时不够好。当我们的遥控程序正式上线时,我们希望页面能更快一点显示出来。Bottle 可以和很多不同的网页服务器配合工作,而我们发现 Paste 用起来非常不错。而要使用的话,只要简单地安装(Debian 系统里的 python-paste 包),然后修改一下代码里的 run 调用: +> +> run(host=hostname, port=hostport, server=”paste”) +> +> 你可以在 [http://bottlepy.org/docs/dev/deployment.html][1] 找到如何使用其他服务器的相关细节。 + +#### 从 XBMC 获取数据 #### + +XBMC JSON API 分成 14 个命名空间:JSONRPC, Player, Playlist, Files, AudioLibrary, VideoLibrary, Input, Application, System, Favourites, Profiles, Settings, Textures 和 XBMC。每个都可以通过 Python 的 XBMC 对象访问(Favourites 除外,明显是个疏忽)。每个命名空间都包含许多方法用于对程序的控制。例如,Playlist.GetItems() 可以用来获取某个特定播放列表的内容。服务器会返回给我们 JSON 格式的数据,但 xbmcjson 模块会为我们转化成 Python 词典。 + +我们需要用到 XBMC 里的两个组件来控制播放:播放器和播放列表。播放器带有播放列表并在每首歌结束时从列表里取下一首。为了查看当前正在播放的内容,我们需要获取正在工作的播放器的 ID,然后根据它找到当前播放列表的 ID。这个可以通过下面的代码来实现: + + def get_playlistid(): + player = xbmc.Player.GetActivePlayers() + if len(player[‘result’]) > 0: + playlist_data = xbmc.Player.GetProperties({“playerid”:0, “properties”:[“playlistid”]}) + if len(playlist_data[‘result’]) > 0 and “playlistid” in playlist_data[‘result’].keys(): + return playlist_data[‘result’][‘playlistid’] + return -1 + +如果当前没有播放器在工作(就是说,返回数据的结果部分的长度是 0),或者当前播放器不带播放列表,这样的话函数会返回 -1。其他时候,它会返回当前播放列表的数字 ID。 + +当我们拿到当前播放列表的 ID 后,就可以获取列表的细节内容。按照我们的需求,有两个重要的地方:播放列表里包含的项,以及当前播放所处的位置(已经播放过的项并不会从播放列表移除,只是移动当前播放位置)。 + + def get_playlist(): + playlistid = get_playlistid() + if playlistid >= 0: + data = xbmc.Playlist.GetItems({“playlistid”:playlistid, “properties”: [“title”, “album”, “artist”, “file”]}) + position_data = xbmc.Player.GetProperties({“playerid”:0, ‘properties’:[“position”]}) + position = int(position_data[‘result’][‘position’]) + return data[‘result’][‘items’][position:], position + return [], -1 + +这样可以返回以正在播放的项开始的列表(因为我们并不关心已经播放过的内容),而且也包含了位置信息用来从列表里移除项。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc2-large.jpg) + +API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列出了所有支持的函数,但是关于具体如何使用的描述有点太简单了。 + +> ### JSON ### +> +> JSON 是 JavaScript Object Notation 的缩写,开始设计用于 JavaScript 对象的序列化。目前仍然起到这个作用,但是它也是用来编码任意数据的一种很好用的方式。 +> +> JSON 对象都是这样的格式: +> +> {property1:value1, property2:value2, property3:value3} +> +> 支持任意数目的属性/值配对。对 Python 程序员来说,看上去和字典数据结构很相似,不过这两个确实很像。 +> +> 在字典数据结构里,值本身可以是另一个 JSON 对象,或者一个列表,所以下面的格式也是正确的: +> +> {“name”:“Ben”, “jobs”:[“cook”, “bottle-washer”], “appearance”: {“height”:195, “skin”:“fair”}} +> +> JSON 通常在网络服务中用来发送和接收数据,并且大多数编程语言都能很好地支持,所以如果你熟悉 Python 的话,你应该可以使用你熟悉的编程语言调用相同的接口来轻松地控制 XBMC。 + +#### 整合到一起 #### + +把之前的功能连接到 HTML 页面很简单: + + @route(‘/juke’) + def index(): + current_playlist, position = get_playlist() + return template(‘list’, playlist=current_playlist, offset = position) + +只需要抓取播放列表(调用我们之前定义的函数),然后将结果传递给负责显示的模版。 + +负责显示列表数据的模版的主要部分是: + +

Currently Playing:

+ % if playlist is not None: + % position = offset + % for song in playlist: + {{song[‘title’]}} + % if song[‘type’] == ‘unknown’: + Radio + % else: + {{song[‘artist’][0]}} + % end + % if position != offset: + remove + % else: + skip + % end +
+ % position += 1 + % end + +可以看到,模版大部分是用 HTML 写的,只有一小部分用来控制输出的其他代码。用两个括号括起来的变量是输出位置(像我们在第一个 ‘hello world’ 例子里看到的)。你也可以嵌入以百分号开头的 Python 代码。因为没有缩进,你需要用一个 % end 来结束当前的代码块(就像循环或 if 语句)。 + +这个模版首先检查列表是否为空,然后遍历里面的每一项。每一项会用粗体显示歌曲名字,然后是艺术家名字,然后是一个是否跳过(如果是当前正在播的歌曲)或从列表移除的链接。所有歌曲的类型都是 ‘song’,如果类型是 ‘unknown’,那就不是歌曲而是网络电台。 + +/remove/ 和 /skip/ 路径只是简单地封装了 XBMC 控制功能,在改动生效后重新加载 /juke: + + @route(‘/skip/’) + def index(position): + print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) + redirect(“/juke”) + @route(‘/remove/’) + def index(position): + playlistid = get_playlistid() + if playlistid >= 0: + xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) + redirect(“/juke”) + +当然,如果不能往列表里添加歌曲的话那这个列表管理功能也不行。 + +因为一旦播放列表结束,它就消失了,所以你需要重新创建一个,这会让事情复杂一些。而且有点让人迷惑的是,播放列表是通过调用 Playlist.Clear() 方法来创建的。这个方法也还用来删除包含网络电台(类型是 unknown)的播放列表。另一个麻烦的地方是列表里的网络电台开始播放后就不会停,所以如果当前在播网络电台,也会需要清除播放列表。 + +这些页面包含了指向 /play/ 的链接来播放歌曲。通过下面的代码处理: + + @route(‘/play/’) + def index(id): + playlistid = get_playlistid() + playlist, not_needed= get_playlist() + if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: + xbmc.Playlist.Clear({“playlistid”:0}) + xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) + xbmc.Player.open({“item”:{“playlistid”:0}}) + playlistid = 0 + else: + xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) + remove_duplicates(playlistid) + redirect(“/juke”) + +最后一件事情是实现 remove_duplicates 调用。这并不是必须的 - 而且还有人并不喜欢这个 - 不过可以保证同一首歌不会多次出现在播放列表里。 + +我们也实现了一些页面用来列出收藏歌曲里所有艺术家,以及列出指定艺术家的歌曲和专辑。这些都非常简单,和 /juke 页面基本类似。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc1-large.jpg) + +还需要处理一下 UI,不过功能已经有了。 + +> ### 日志 ### +> +> 通常拿到 XBMC JSON API 并不清楚能用来做什么,而且它的文档也有点模糊。找出如何使用的一种方式是看别的遥控程序是怎么做的。如果打开日志功能,就可以在使用其他遥控程序的时候看到哪个 API 被调用了,然后就可以应用到在自己的代码里。 +> +> 要打开日志功能,把 XBMC 媒体中心 接到显示器上,再依次进入设置 > 系统 > 调试,打开允许调试日志。在打开日志功能后,还需要登录到 XBMC 机器上(比如通过 SSH),然后就可以查看日志了。日志文件的位置应该显示在 XBMC 界面左上角。在 RaspBMC 系统里,文件位置是 /home/pi/.xbmc/temp/xbmc.log。你可以通过下面的命令实时监视哪个 API 接口被调用了: +> +> cd /home/pi/.xbmc/temp +> tail -f xbmc.log | grep “JSON” + +#### 增加功能 #### + +上面的代码都是用来播放 XBMC 媒体库里的歌曲的,但我们还希望能播放网络电台。每个插件都有自己的独立 URL 可以通过普通的 XBMC JSON 命令来获取信息。举个例子,要从电台插件里获取选中的电台,可以使用; + + @route(‘/radio/’) + def index(): + my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: + [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) + if ‘result’ in my_stations.keys(): + return template(‘radio’, stations=my_stations[‘result’][‘files’]) + else: + return template(‘error’, error=’radio’) + +这样可以返回一个可以和歌曲一样能添加到播放列表的文件。不过,这些文件能一直播下去,所以(之前说过)在添加其他歌曲的时候需要重新创建列表。 + +#### 共享歌曲 #### + +除了伺服页面模版,Bottle 还支持静态文件。方便用于那些不会因为用户输入而改变的内容。可以是 CSS 文件,一张图片或是一首 MP3 歌曲。在我们的简单遥控程序里(目前)还没有任何用来美化的 CSS 或图片,不过我们增加了一个下载歌曲的途径。这个可以让媒体中心变成一个存放歌曲的 NAS 盒子。在需要传输大量数据的时候,最好还是用类似 Samba 的功能,但只是下几首歌到手机上的话使用静态文件也是很好的方式。 + +通过歌曲 ID 来下载的 Bottle 代码: + + @route(‘/download/’) + def index(id): + data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) + full_filename = data[‘result’][‘songdetails’][‘file’] + path, filename = os.path.split(full_filename) + return static_file(filename, root=path, download=True) + +应用的时候,只需要为 /songsby/ 页面里的相应 ID 加个链接。 + +我们已经把所有的代码过了一遍,不过还需要一点工作来把它们集合到一起。可以自己去 GitHub 页面 [https://github.com/ben-ev/xbmc-remote][3] 看下。 + +> ### 设置 ### +> +> 我们的遥控程序已经开发完成,还需要保证让它在媒体中心每次开机的时候都能启动。有几种方式,最简单的是在 /etc/rc.local 里增加一行命令来启动。我们的文件位置在 /opt/xbmc-remote/remote.py,其他文件也和它一起。然后在 /etc/rc.local 最后的 exit 0 之前增加了下面一行。 +> +> cd /opt/xbmc-remote && python remote.py & + +> ### GitHub ### +> +> 这个项目目前还只是个架子,但是 - 我们运营杂志就意味着没有太多自由时间来编程。不过,我们启动了一个 GitHub 项目,希望能持续完善, 而如果你觉得这个项目有用的话,欢迎做出贡献。 +> +> 要查看最新的进展,请访问 [https://github.com/ben-ev/xbmc-remote][4] 看看所处的状态。你可以从页面里获取最新的代码,或者通过命令行复制。 +> +> 如果你希望改善它,可以复制项目到你自己的分支开发,然后在功能完成后发起合并请求。关于如何使用 GitHub 的更多信息,请访问 [https://github.com/features][5]。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ + +作者:[Ben Everard][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://bottlepy.org/docs/dev/deployment.html +[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 +[3]:https://github.com/ben-ev/xbmc-remote +[4]:https://github.com/ben-ev/xbmc-remote +[5]:https://github.com/features From a7a41cf260333b7fe837ea6fc7964873cbac6ce8 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 13:54:42 +0800 Subject: [PATCH 49/76] PUB:20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi 这篇错别字有点多~ --- ... Instagram Style Filters to Your Photos.md | 70 ++++++++++++++++++ ... Instagram Style Filters to Your Photos.md | 74 ------------------- 2 files changed, 70 insertions(+), 74 deletions(-) create mode 100644 published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md delete mode 100644 translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md diff --git a/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md new file mode 100644 index 0000000000..d44db58488 --- /dev/null +++ b/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md @@ -0,0 +1,70 @@ +在 Ubuntu 中给你的照片加上 Instagram 风格的滤镜程序 +================================================================================ +拿起你的自拍杆跟我来。 + +### XnRetro 照片编辑器 ### + +**XnRetro** 是一个可以让你快速给你照片添加“类 Instagram”效果的程序。 + +你肯定知道我说的这些效果:划痕、噪点、相框、过度处理、复古和怀旧色调(因为在这个数字过客的时代,我们一定知道无穷无尽的自拍永远也找不回怀旧的自己。) + +无论你认为这些效果是愚蠢的艺术还是创作的捷径,这些滤镜非常流行,可以帮助那些平实无奇的照片添加个性。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) + +*XnRetro是一个照片编辑应用* + +#### XnRetro的功能 #### + +**XnRetro 有下面那些功能** + +- 20 种色彩滤镜 +- 15 种光影效果(虚化、泄露等等) +- 28 种画框和边线 +- 5 种插图 (带力度控制) +- 对比度、伽马校正、饱和度等图像调整 +- 矩形修剪选项 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) + +*灯光效果调整* + +(理论上)你可以保存编辑过的 .jpg 或者 .png 文件,并且直接在 app 中分享到社交媒体上。 + +我说“理论上”的意思是保存.jpg图像无法正常在 linux 版的程序上工作(你可以保存 .png 的图像)。相似问题还有,大多数内置的社交链接失效或者无法导出。 + +要使用**15 种光影效果**,你需要在 XnRetro 的‘light’文件夹下将 .jpg 文件重新保存成 .png 文件。编辑‘light.xml’来匹配新的文件名,点击保存那么灯光效果就可以没有问题的加载进 XnRetro 了。 + + +**XnRetro 值得安装么?** + +XnRetro 并不是完美的。它看上去很老土、很难正确的安装,**并且已经几年没有更新了**。 + +但它还可以使用,除了保存 .jpg 文件外。同时也是那些像 Gimp 或者 Shotwell 的那些‘正规’的图片调整工具的一个灵活替代品。 + +虽然像 [Pixlr Touch Up][1] 和 [Polarr][2] 这样的 web 应用和 Chrome Apps 也提供相似的功能,但你也许正在寻找真正原生的解决方案。 + +习惯了 XnRetro 就很难离开它。 + +### 下载 Ubuntu 下的 XnRetro ### + +XnRetro 没有可用的 .deb 安装包。它以二进制文件的形式发行,这意味着你需要每次双击程序来运行。它也只有32位的版本。 + +你可以使用下面的 XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。 + +- [下载 Linux 版 XnRetro (32位, tar.gz)][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgchrome.com/?s=pixlr +[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ +[3]:http://www.xnview.com/en/xnretro/#downloads diff --git a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md deleted file mode 100644 index ae5e6df6eb..0000000000 --- a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md +++ /dev/null @@ -1,74 +0,0 @@ -一个Ubuntu中给你的照片加Instagram风格滤镜的程序 -================================================================================ -**在Ubuntu中寻找一个给你的照片加Instagram风格的滤镜程序么?** - -拿起你的自拍棒跟着这个来。 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) -XnRetro是一个照片编辑应用 - -### XnRetro 照片编辑器 ### - -**XnRetro** 是一个可以让你快速给你照片添加“类Instagram”效果的程序。 - -你知道我说的这些效果:划痕、噪点、框架、过处理、复古和怀旧色调(因为在这个数字时代,我们必须知道无尽的自拍不能称为怀旧的自己。) - -无论你认为这些效果是愚蠢的艺术价值或者创作的捷径,这些滤镜非常流行切可以帮助那些平平照片添加个性。 - - -#### XnRetro的功能 #### - -**XnRetro有下面那些功能** - -- 20色彩滤镜 -- 15中光效果(虚化、泄露等等) -- 28框架和边框 -- 5中插图 (带力度控制) -- Image adjustments for contrast, gamma, saturation, etc -- 对比度、伽马、饱和度等图像调整 -- 矩形修剪选项 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) -灯光效果调整 - -你可以(理论上)编辑。jpg或者.png文件并且直接在app中等想到社交媒体上。 - -我说“理论”上的意思是保存.jpg图像无法正常在linux版的程序上工作(你可以保存.png的图像)。相似的,大多数内置的社交链接失效或者无法导出。 - -要使用**15中光影效果**你需要在XnRetro的‘light’文件夹下重新保存.jpg文件成.png文件。编辑‘light.xml’来匹配新的文件名,点击保存那没灯光效果就可以没有问题的加载进XnRetro了。 - -> ‘用户友好的XnRetro很难打败-一旦你用顺之后。’ - -**XnRetro值得安装么?** - -XnRetro并不是完美的。它看上去很丑、很难正确的安装并且已经纪念没有更新了。 - -它还可以使用,输了保存.jpg文件外。同时也是那些像Gimp或者Shotwell的那些‘正规’图片调整工具的一个灵活替代品。 - -While web apps and Chrome Apps¹ like [Pixlr Touch Up][1] and [Polarr][2] offer similar features you may be looking for a truly native solution. -虽然web应用和Chrome Apps¹像[Pixlr Touch Up][1] 和 [Polarr][2]提供另外相似的功能,而你也许正在寻找真正原生的解决方案。 - -对于此,用户友好带有容易使用滤镜的XnRetro很难被打败。 - -### 下载Ubuntu下的XnRetro ### - -XnRetro没有可用的.deb安装包。它以二进制文件的形式发型,这意味着你需要每次双击程序来运行。它也只有32位的版本。 - -你可以使用下面的XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。 - -- [下载Linux版XnRetro (32位, tar.gz)][3] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app - -作者:[Joey-Elijah Sneddon][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://www.omgchrome.com/?s=pixlr -[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ -[3]:http://www.xnview.com/en/xnretro/#downloads From b8fb4f3c00d1c6c17e56683a3d39cc11c69a36c4 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 16:34:33 +0800 Subject: [PATCH 50/76] PUB:20150604 12 Globally Recognized Linux Certifications @wi-cuckoo --- ...lobally Recognized Linux Certifications.md | 172 ++++++++++++++++++ ...lobally Recognized Linux Certifications.md | 172 ------------------ 2 files changed, 172 insertions(+), 172 deletions(-) create mode 100644 published/20150604 12 Globally Recognized Linux Certifications.md delete mode 100644 translated/share/20150604 12 Globally Recognized Linux Certifications.md diff --git a/published/20150604 12 Globally Recognized Linux Certifications.md b/published/20150604 12 Globally Recognized Linux Certifications.md new file mode 100644 index 0000000000..3b1ed918ba --- /dev/null +++ b/published/20150604 12 Globally Recognized Linux Certifications.md @@ -0,0 +1,172 @@ +12 个全球认可的 Linux 认证 +================================================================================ +大家好,今天我们将会认识一些非常有价值的全球认可的Linux认证。Linux认证是不同的Linux专业机构在全球范围内进行的认证程序。Linux认证可以让Linux专业人才可以在服务器领域或者相关公司等等这些地方更容易获得Linux相关的工作。Linux认证评估一个人在Linux的各个领域里的专业程度。有很多不错的Linux专业机构提供不同的Linux认证。但是,在公司谋取一份工作时全球仅有少数被非常认可的Linux认证含金量很高,这些工作包括管理服务器,虚拟化,安装系统与软件,配置程序,应用支持和其他Linux操作系统相关的东西。随着全球使用Linux操作系统的服务器的增长,拉动了对于Linux专业人才的需求。为了更好的证明Linux专业技术水平,在全球看来,更好的、著名的认证总是有着更高的优先级。 + +这里是一些全球认可的Linux认证,我们接下来将会一一谈到。 + +### 1. CompTIA Linxu+ ### + +CompTIA Linux+ 是LPI(Linux Professional Institute,Linux专业委员会)主办的一个Linux认证,在全世界范围内提供培训。其提供的Linux相关知识,可以用于从事一大批Linux相关专业的工作,如Linux管理员、高级网络管理员、系统管理员、Linux数据库管理员和Web管理员。如果任何人想从事安装和维护Linux操作系统,该课程会帮助他达到认证要求,并且通过提供对Linux系统更宽阔的认识,能够为通过考试做好准备。LPI的CompTIA Linux+认证的主要目的就是,提供给证书持有者足够扎实的,关于安装软件、操作、管理和设备排障的知识。我们可以付出一定的费用、时间和努力,完成CompTIA Linux+,同时获得三个业内认可的证书:**LPI LPIC-1**和**SUSE Certified Linux Administrator (CLA)**证书。 + +- **认证代码** : LX0-103,LX0-104(2015年3月30日启动)或者LX0-101,LX0-102 +- 题目数量:每次考试60道题 +- 题目类型:多选 +- 考试时长:90分钟 +- 要求:A+,Network+,并且有至少12个月的Linux管理经验 +- 分数线:500 (对于200-800的范围来说) +- 语言:英语,将来会有德语,葡萄牙语,繁体中文,西班牙。 +- 有效期:认证后三年有效 + +**注意**:不同系列的考试不能合并。如果你考的是LX0-101,那么你必须考LX0-102完成认证。同样的,LX0-103和LX0-104又是一个系列。LX0-103和LX0-104系列是LX0-101和LX0-102系列的升级版。 + +### 2. LPIC ### + +LPIC,全称Linux专业委员会认证( Linux Professional Institute Certification),是Linux专业委员会的一个Linux认证程序。这是一个多级别的认证程序,要求在每个级别通过一系列(通常是两个)的认证考试。该认证有三个级别,包括初级水平认证 **LPIC-1** ,高级水平认证 **LPIC-2**和最高水平认证 **LPIC-3**。前两个认证侧重于 **Linux系统管理**,而最后一个认证侧重一些专业技能,包括虚拟化和安全。为了得到 **LPIC-3** 认证,一个持有有效的 **LPIC-1** 与**LPIC-2** 认证的考生必须通过300复杂环境测试、303安全测试、304虚拟化测试和高可用性测试中的一个。**LPIC-1**认证按照证书持有者可以通过运行Linux,使用命令行界面和基本的网络知识安装,维护,配置等任务而设计,LPIC-2测试考生是否作为管理中小型混合网络的候选人。LPIC-3认证是为企业级Linux专业技能设计所设计,代表了最高的专业水平和不针对特定 Linux 发行版的行业认证。 + +- **认证代码**:LPIC-1(101和102),LPIC-2(201和202)和LPIC-3(300,303或者304) +- 题目类型:60个多项选择 +- 考试时长:90分钟 +- 要求:无,建议有 Linux Essentials 认证 +- 分数线:500(在200-800的范围内) +- 语言:LPIC-1:英语,德语,意大利语,葡萄牙语,西班牙语(现代),汉语(简体),汉语(繁体),日语 +- LPIC-2:英语,德语,葡萄牙语,日语 +- LPIC-3:英语,日语 +- 有效期:退休之后五年内仍然有效 + +### 3.Oracle Linux OCA ### + +Oracle联合认证(OCA)为个人而定制,适用于那些想证明其部署和管理Oracle Linux操作系统的知识牢固的人。该认证专业知识仅仅针对Oracle Linux发行版,这个系统完全是为Oracle产品特别剪裁的,可以运行Oracle设计的系统,包括Oracle Exadata数据库服务器,Oracle Exalytics In-Memory 服务器,Oracle Exalogic 均衡云,和Oracle数据库应用等。Oracle Linux的“坚不可摧企业内核”为企业应用带来了高性能、高扩展性和稳定性。OCA认证覆盖了如管理本地磁盘设备、管理文件系统、安装和移除Solaris包与补丁,优化系统启动过程和系统进程。这是拿到OCP证书系列的第一步。OCA认证以其前身为Sun Certified Solaris Associate(SCSAS)而为人所知。 + +- **认证代码**:OCA +- 题目类型:75道多项选择 +- 考试时长:120分钟 +- 要求:无 +- 分数线:64% +- 有效期:永远有效 + +### 4. Oracle Linux OCP ### + +Oracle专业认证(OCP)是Oracle公司为Oracle Linux提供的一个认证,覆盖更多的进阶知识和技能,对于一个Oracle Linux管理员来说。它囊括的知识有配置网络接口、管理交换分区配置、崩溃转储、管理软件、数据库和重要文件。OCP认证是技术性专业知识和专业技能的基准测试,这些知识与技能需要在公司里广泛用于开发、部署和管理应用、中间件和数据库。Oracle Linux OCP的工作机会在增长,这得益于工作市场和经济发展。根据考试纲领,证书持有者有能力胜任安全管理、为Oracle 数据库准备Oracle Linux系统、排除故障和进行恢复操作、安装软件包、安装和配置内核模块、维护交换空间、完成用户和组管理、创建文件系统、配置逻辑卷管理(LVM)、文件分享服务等等。 + +- **认证代码**:OCP +- 题目类型:60至80道多项选择题 +- 考试时长:120分钟 +- 要求:Oracle Linux OCA +- 分数线:64% +- 有效期:永远有效 + +### 5. RHCSA ### + +RHCSA是红帽公司作为红帽认证系统工程师推出的一个认证程序。RHCSA们是指一些拥有在著名的红帽Linux环境下完成核心系统管理技能和能力的人。这是一个入门级的认证程序,关注在系统管理上的实际胜任能力,包括安装、配置一个红帽Linux系统,接入一个可用的网络提供网络服务。一个红帽认证的系统管理员可以理解和使用基本的工具,用以处理文件、目录、命令行环境和文档;操作运行中的系统,包括以不同的启动级别启动、识别进程、开启和停止虚拟机和控制服务;使用分区和逻辑卷配置本地存储;创建和配置文件系统和文件系统属性,包括权限、加密、访问控制列表和网络文件系统;部署配置和维护系统,包括软件安装、更新和核心服务;管理用户和组,包括使用一个中心的目录用于验证;安全性的工作,包括基本的基本防火墙和SELinux配置。要获得RHCE和其他认证,首先得认证过RHCSA。 + +- **认证代码**:RHCSA +- 课程代码:RH124,RH134和RH199 +- 考试代码:EX200 +- 考试时长:21-22小时,取决于选择的课程 +- 要求:无。有一些Linux基础知识更好 +- 分数线:300总分,210过(70%) +- 有效期:3年 + +### 6. RHCE ### + +RHCE,也叫做红帽认证工程师,是一个中到高级水平的认证程序,为一些想要学习更多技能和知识,成为一个负责红帽企业Linux的高级系统管理员的RHCSA开设的,RHCE应该有能力、知识和技能来配置静态路由、包过滤、NAT、设定内核运行参数、配置一个ISCSI初始化程序,生成并发送系统用量报告、使用shell脚本自动完成系统维护任务、配置系统日志,包括远程日志、提供网络服务如HTTP/HTTPS、FTP、NFS、SMB、SMTP、SSH和NTP等等。推荐希望获得更多高级水平的认证的RHCSA们、已经完成系统管理员I,II和III、或者已经完成RHCE 快速跟进培训的人们参加认证。 + +- **认证代码**:RHCE +- 课程代码:RH124,RH134,RH254和RH199 +- 考试代码:EX200和EX300 +- 考试时长:21-22个小时,取决于所选课程 +- 要求:一个RHCSA证书 +- 分数线:300总分,210过(70%) +- 有效期:3年 + +### 7. RHCA ### + +RHCA即红帽认证架构师,是红帽公司的一个认证程序。它的关注点在系统管理的实际能力,包括安装和配置一个红帽Linux系统,并加入到一个可用网络中运行网络服务。RHCA是所有红帽认证中最高水平的认证。考生需要选择他们希望针对的领域,或者选择合格的红帽认证的任意组合来创建一个他们自己的领域。这里有三个主要的领域:数据中心、云和应用平台。精通数据中心领域的RHCA能够运行、管理数据中心;而熟悉云的可以创建、配置和管理私有云和混合云、云应用平台以及使用红帽企业Linux平台的灵活存储方案;精通应用平台集合的RHCA拥有技能如安装、配置和管理红帽JBoss企业应用平台和应用,云应用平台和混合云环境,借助红帽的OpenShift企业版,使用红帽JBoss数据虚拟化技术从多个资源里组合数据。 + +- **认证代码**:RHCA +- 课程代码:CL210,CL220.CL280,RH236,RH318,RH413,RH436,RH442,JB248和JB450 +- 考试代码:EX333,EX401,EX423或者EX318,EX436和EX442 +- 考试时长:21-22个小时,取决于所选课程 +- 要求:未过期的RHCE证书 +- 分数线:300总分,210过(70%) +- 有效期:3年 + +### 8. SUSE CLA ### + +SUSE认证Linux管理员(SUSE CLA)是SUSE推出的一个初级认证,关注点在SUSE Linux企业服务器环境下的日常任务管理。为了获得SUSE CLA认证,不用必须完成课程任务,只需要通过考试就能获得认证。SUSE CLA们能够、也有技术去使用Linux桌面、定位并利用帮助资源、管理Linux文件系统、用Linux Shell和命令行工作、安装SLE 11 SP22、管理系统安装、硬件、备份和恢复、用YaST管理Linux、Linux进程和服务、存储、配置网络、远程接入、SLE 11 SP2监控,任务自动化和管理用户访问和安全工作。我们可以同时获得SUSE CLA,LPIC-1和CompTIA Linux认证,因为SUSE,Linux Professional Institute和CompATI合作提供了这个同时获得三个Linux认证的机会。 + +- **认证代码**:SUSE CLA +- 课程代码:3115,3116 +- 考试代码:050-720,050-710 +- 问题类型:多项选择 +- 考试时长:90分钟 +- 要求:无 +- 分数线:512 + +### 9. SUSE CLP ### + +SUSE认证Linux专业人员(CLP)是一个认证程序,为那些希望获得关于SUSE Linux企业服务器更多高级且专业的知识的人而服务。SUSE CLP是通过SUSE CLA认证后的下一步。应该通过CLA的考试并拥有证书,然后通过完成CLP的考试才能获得CLP的认证。通过SUSE CLP认证的人员有能力完成安装和配置SLES 11系统、维护文件系统、管理软件包、进程、打印、配置基础网络服务、samba、Web服务器、使用IPv6、创建和运行bash shell脚本。 + +- **认证代码**:SUSE CLP +- 课程代码:3115,3116和3117 +- 考试代码:050-721,050-697 +- 考试类型:手写 +- 考试时长:180分钟 +- 要求:SUSE CLA 认证 + +### 10. SUSE CLE ### + +SUSE认证Linux工程师(CLE)是一个工程师级别的高级认证,为那些已经通过CLE考试的人准备。为了获得CLE认证,人们需要已经获得SUSE CLA和CLP的认证。获得CLE认证的人员拥有架设复杂SUSE Linux企业服务器环境的技能。CLE认证过的人可以配置基本的网络服务、管理打印、配置和使用Open LDAP、samba、IPv6、完成服务器健康检测和性能调优、创建和执行shell脚本、部署SUSE Linux企业板、通过Xen实现虚拟化等等。 + +- **认证代码**:SUSE CLE +- 课程代码:3107 +- 考试代码:050-723 +- 考试类型:手写 +- 考试时长:120分钟 +- 要求:SUSE CLP 10或者11证书 + +### 11. LFCS ### + +Linux基金会认证系统管理员(LFCS)认证考生使用Linux和通过终端环境使用Linux的知识。LFCS是Linux基金会的一个认证程序,为使用Linux操作系统工作的系统管理员和工程师准备。Linux基金会联合业内专家、Linux内核社区,测试考生的核心领域、关键技能、知识和应用能力。通过LFCS认证的人员拥有一些技能、知识和能力,包括在命令行下编辑和操作文件、管理和处理文件系统与存储的错误、聚合分区作为LVM设备、配置交换分区、管理网络文件系统、管理用户帐号/权限和属组、创建并执行bash shell脚本、安装/升级/移除软件包等等。 + +- **认证代码**:LFCS +- 课程代码:LFCS201,LFCS220(可选) +- 考试代码:LFCS 考试 +- 考试时长:2小时 +- 要求:无 +- 分数线:74% +- 语言:英语 +- 有效期:两年 + +### 12. LFCE ### + +Linux基金会认证工程师(LFCE),是Linux基金会为Linux工程师推出的认证。相比于LFCS,通过LFCE认证的人员在Linux方面拥有更大范围的技能。这是一个工程师级别的高级认证程序。LFCE认证的人具备一些网络管理方面的技能和能力,如配置网络服务、配置包过滤、监控网络性能、IP流量、配置文件系统和文件服务、网络文件系统、从仓库安装/升级软件包、管理网络安全、配置iptables、http服务、代理服务、邮件服务等等。由于其为高级工程级别的认证程序,所以普遍认为相比LFCS,学习和通过的难度更大些。 + +- **认证代码**:LFCE +- 课程代码:LFS230 +- 考试代码:LFCE 考试 +- 考试时长:2小时 +- 要求:认证过LFCS +- 分数线:72% +- 语言:英语 +- 有效期:2年 + +### 我们发现的情况(这仅仅是我们的观点)### + +最近的调查表明,在不同的高端招聘代理中,称80%的Linux工作描述更倾向于红帽的认证。如果你是一个学生/新手,并且想学习Linux,那么我们建议选择越来越流行的Linux基金会认证,或者CompTIA Linux也可以是一个选择。如果你已经了解了oracle或suse,或者在他们的产品上工作,那oracle/suse的认证会更好些,如果你在公司里工作了,这些认证会对你的职业生涯成长有帮助:-) + +### 总结 ### + +在这个世界上,成千上万的大公司正在运行跑着Linux操作系统的服务器和主框架机,为了在这些服务器上管理、配置和工作,总是存在着对Linux技术/专业知识高度认证的需求。这些国际上承认的认证对某些人在Linux的职业生涯扮演很重要的角色。这些遍布全球的公司运行着Linux,需要Linux工程师、系统管理员和已经获得认证且在Linux相关领域干得不错的人员。全球认可的Linux认证,对于专业知识和职业生涯的辉煌都是重中之重,所以好好准备考试并获得认证,对于在Linux建立职业生涯是一个很好的选择。如果你有任何问题,想法,反馈,请写在下方的评论框里,让我们好知道哪些东西需要添加或者改进。谢谢!:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/ + +作者:[Arun Pyasi][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ diff --git a/translated/share/20150604 12 Globally Recognized Linux Certifications.md b/translated/share/20150604 12 Globally Recognized Linux Certifications.md deleted file mode 100644 index 2be4e9df7d..0000000000 --- a/translated/share/20150604 12 Globally Recognized Linux Certifications.md +++ /dev/null @@ -1,172 +0,0 @@ -12个全球认可的Linux认证 -================================================================================ -大家好,今天我们将会认识一些非常有价值的全球认可的Linux认证。Linux认证是不同Linux专业机构在全球范围内进行的认证程序。Linux认证可以让Linux专业人才很容易获得Linux相关的工作,在服务器或者公司等等这些地方。Linux认证评估一个人在Linux的各个领域里的专业程度。有很多不错的Linux专业机构提供不同的Linux认证。但是全球仅有少数被十分认可的Linux认证,在公司谋取一份工作时含金量很高,这些工作包括管理服务器,虚拟化,安装系统与软件,配置程序,应用支持和其他Linux操作系统相关的东西。随着全球使用Linux操作系统的服务器的增长,拉动了对于Linux专业人才的需求。为了更好的证明Linux专业技术,公司进行的著名的认证一直有着更高的优先级,在全球看来。 - -这里是一些全球认可的Linux认证,我们接下来将会一一讨论。 - -### 1. CompTIA Linxu+ ### - -CompTIA Linux+ 是LPI“Linux Professional Institute”主办的一个Linux认证,在全世界范围内提供培训。其提供的Linux相关知识,使得产生了一大批Linux相关专业的工作,如Linux管理员,高级网络管理员,系统管理员,Linux数据库管理员和网页管理员。如果任何人想从事安装和维护Linux操作系统,该课程会帮助达到认证要求,并且通过提供对Linux系统更宽阔的认识,能够为考试做好准备。LPI的CompTIA Linux+认证的主要目的就是,提供给证书持有者足够扎实的知识,关于安装软件,操作,管理和设备排障的。我们可以用一定的费用,时间和努力,,完成CompTIA Linux+,赢得三个业内认可的证书,我们可以自动收到**LPI LPIC-1**和**SUSE Certified Linux Administrator (CLA)**证书。 - -- ** 认证代码** : LX0-103和LX0-104 (2015年三月30日启动)或者LX0-101和LX0-102 -- 题目数量:一次考试60道题 -- 题目类型:多选 -- 考试时长:90分钟 -- 要求:A+,Network+,并且有至少12个月的Linux管理经历 -- 分数线:500 (对于200-800的范围来说) -- 语言:英语,将来会有德语,葡萄牙语,汉语,西班牙。 -- 有效期:认证后三年有效 - -**注意**:不同系列的考试不能交叉。如果你考的是LX0-101,那么你必须考LX0-102完成认证。同样的,你必须考完LX0-103和LX0-104。LX0-103和LX0-104是LX0-101和LX0-102的升级版。 - -### 2. LPIC ### - -LPIC,全称Linux专业委员会认证,是Linux专业委员会的一个Linux认证程序。这是一个多层次的认证程序,要求在每个级别通过一系列(通常是两个)的认证考试。该认证有三个层次,包括初级水平认证 **LPIC-1** ,高级水平认证 **LPIC-2**和最高水平认证 **LPIC-3**。前两个认证侧重于 **Linux系统管理**,而最后一个认证侧重一些专业技能,包括虚拟化和安全。为了得到 **LPIC-3** 认证,一个持有 **LPIC-1** 与**LPIC-2** 的考生必须通过300复杂环境测试,303安全测试,304虚拟化测试和高可用性的其中一个。**LPIC-1**认证按照证书持有者可以通过运行Linux,使用命令行界面和基本的网络知识安装,维护,配置任务而设计,LPIC-2验证考生很少的管理知识,主要是中型混合网络方面。LPIC-3认证按照企业级别的Linux专业技能设计,代表了最高的专业水平(==最后这句不知道如何翻译==) - -- **认证代码**:LPIC-1(101和102),LPIC-2(201和202)和LPIC-3(300,303或者304) -- 题目类型:60个多项选择 -- 考试时长:90分钟 -- 要求:Linux基础 -- 分数线:500(在200-800的范围内) -- 语言:LPIC-1:英语,德语,意大利语,葡萄牙语,西班牙语(现代),汉语(简体),汉语(繁体),日语 -- LPIC-2:英语,德语,葡萄牙语,日语 -- LPIC-3:英语,日语 -- 有效期:退休之后五年内仍然有效 - -### 3.Oracle Linux OCA ### - -Oracle联合认证(OCA)为个人而定制,那些对部署和管理Oracle Linux操作系统且想证明知识牢固感兴趣的人。该认证专业知识仅仅是在Oracle Linux发行版上,这个系统完全是为Oracle产品特别剪裁的,为了运行在Oracle设计的系统上面,包括Oracle Exadata数据库机器,Oracle Exalytics 内存中机器,Oracle Exalogic 均衡云,和Oracle数据库应用。Oracle Linux稳定的企业级内核对于企业应用表现突出,高扩展性和稳定性。OCA认证覆盖如管理本地磁盘设备,文件系统,安装和移除Solaris包与补丁,协调系统启动过程和系统进程方面。这是达到OCP证书佼佼者的第一步。OCA认证以其前身为Sun Certified Solaris Associate(SCSAS)而为人所知。 - -- **认证代码**:OCA -- 题目类型:75道多项选择 -- 考试时长:120分钟 -- 要求:无 -- 分数线:64% -- 有效期:永远有效 - -### 4. Oracle Linux OCP ### - -Oracle Certified Professional(OCP),时Oracle公司为Oracle Linux提供的一个认证,覆盖更多的进阶知识和技能,对于一个Oracle Linux管理员来说。它囊括的知识有配置网络接口,映射交换配置,清理垃圾,管理软件、数据库和核心文件。OCP认证是技术性专业知识和专业技能的基准测试,这些知识与技能需要在公司里广泛用于开发,部署和管理应用,中间设备和数据库。Oracle Linux OCP的工作机会在增长,得益于工作市场和经济。根据考试纲领,证书持有者有能力胜任安全管理,为Oracle 数据库准备Oracle Linux系统,排除故障,安装软件包,安装和配置内核模块,维护交换空间,完成用户和组管理,创建文件系统,配置逻辑卷管理(LVM)、文件分享服务等等。 - -- **认证代码**:OCP -- 题目类型:60至80道多项选择题 -- 考试时长:120分钟 -- 要求:Oracle Linux OCA -- 分数线:64% -- 有效期:永远有效 - -### 5. RHCSA ### - -RHCSA是红帽公司作为红帽认证系统工程师推出的一个认证程序。RHCSAs指一些拥有技能和能力在著名的红帽Linux环境下完成核心系统管理的人。这是一个入门级的认证程序,关注在系统管理上的实际胜任能力,包括安装、配置一个红帽Linux系统,接入一个可用的网络运行网络服务。一个红帽认证的系统管理员可以理解和使用基本的工具,用以处理文件,目录,命令行环境和文档,操作运行中的系统,包括以不同的启动级别启动,标记进程,开启和停止虚拟机和控制服务,使用分区和逻辑卷配置本地存储,部署配置和维护系统,包括软件安装、更新和核心服务,管理用户和组,包括使用一个中心的目录用于验证,安全性工作,包括基本的基本防火墙和SELinux配置。要获得RHCE和其他认证,首先得认证过RHCSA。 - -- **认证代码**:RHCSA -- 课程代码:RH124,RH134和RH199 -- 考试代码:EX200 -- 考试时长:21-22小时,取决于选择的课程 -- 要求:无。有一些Linux基础知识更好 -- 分数线:300总分,210过(70%) -- 有效期:3年 - -### 6. RHCE ### - -RHCE,也叫做红帽认证工程师,是一个中到高级水平的认证程序,为一些红帽认证系统管理员(RHCSA),想学习一个负责红帽企业Linux的高级系统管理员要求的额外技能和知识而开设的,RHCE有能力,知识和技能配置静态的路由,包过滤,网络地址转换(NAT),设定内核运行参数,配置一个互联网小型计算机系统接口(ISCSI)初始化程序,产生并推送系统使用的报告,使用shell脚本自动完成系统维护任务,配置系统登入,包括远程登录,提供网络服务如HTTP/HTTPS,文件传输协议(FTP),网络文件系统(NFS),服务信息块(SMB),简单邮件传输协议(SMTP),安全shell(SSH)和网络时间协议(NTP)等等。RHCSAs希望获得更多高级水平的认证,并且已经完成系统管理员I,II和III,或者RHCE认证建议的RHCE快速跟进课程。 - -- **认证代码**:RHCE -- 课程代码:RH124,RH134,RH254和RH199 -- 考试代码:EX200和EX300 -- 考试时长:21-22个小时,取决于所选课程 -- 要求:一个RHCSA证书 -- 分数线:300总分,210过(70%) -- 有效期:3年 - -### 7. RHCA ### - -RHCA就是红帽认证架构师,是红帽公司的一个认证程序。它的关注点在系统管理的实际能力,包括安装和配置一个红帽Linux系统,并加入到一个可用网络中运行网络服务。RHCA是所有红帽认证中最高水平的认证。考生需要选择他们希望关注的集合,或者选择合格的红帽认证的任意组合,以此来创建一个他们自己的集合。这里有三个主要的集合,数据中心,云和应用平台。精通数据中心集合的RHCA能够运行,管理数据中心,而熟悉云的可以创建,配置和管理私有的,混合的云,云应用平台以及使用红帽企业Linux平台的灵活存储方案。精通应用平台集合的RHCA拥有技能如安装,配置和管理红帽JBoss企业应用平台和应用,云应用平台和混合云环境,借助红帽的OpenShift企业版,使用红帽JBoss数据虚拟化技术从多个资源里组合数据。 - -- **认证代码**:RHCA -- 课程代码:CL210,CL220.CL280,RH236,RH318,RH413,RH436,RH442,JB248和JB450 -- 考试代码:EX333,EX401,EX423或者EX318,EX436和EX442 -- 考试时长:21-22个小时,取决于所选课程 -- 要求:未过期的RHCE证书 -- 分数线:300总分,210过(70%) -- 有效期:3年 - -### 8. SUSE CLA ### - -SUSE认证Linux管理员(SUSE CLA)是SUSE推出的一个初级认证,关注点在SUSE Linux企业服务器环境下的日常任务管理。为了获得SUSE CLA认证,完成课程任务不是必须的,你不得不通过考试获得认证。SUSE CLA有能力,也有技术去使用Linux桌面,定位并利用帮助资源,管理Linux文件系统,用Linux Shell和命令行工作,安装SLE 11 SP22,管理系统安装,硬件,备份和恢复,用YaST管理Linux,Linux进程和服务,存储,配置网络,远程接入,SLE 11 SP2模拟器,任务自动化和管理用户访问和安全工作。我们可以同时获得LPI的SUSE CLA,LPIC-1和CompTIA Linux,因为SUSE,Linux Professional Institute和CompATI合作提供给你这个机会,去获得三个Linux认证。 - -- **认证代码**:SUSE CLA -- 课程代码:3115,3116 -- 考试代码:050-720,050-710 -- 问题类型:多项选择 -- 考试时长:90分钟 -- 要求:无 -- 分数线:512 - -### 9. SUSE CLP ### - -SUSE认证Linux专业人员(CLP)是一个认证程序,为那些希望获得关于SUSE Linux企业服务器更多高级且专业的知识的人而服务。SUSE CLP是通过SUSE CLA认证后的下一步。一个人应该通过CLA的考试并拥有证书,然后才能获得CLP的认证,通过完成CLP的考试。通过SUSE CLP认证的人员有能力完成安装和配置SUSE Linux企业服务器11系统,维护文件系统,管理软件包,进程,打印,使用IPv6配置基础网络服务,samba,网页服务器,创建和运行bash shell脚本。 - -- **认证代码**:SUSE CLP -- 课程代码:3115,3116和3117 -- 考试代码:050-721,050-697 -- 考试类型:手写 -- 考试时长:180分钟 -- 要求:SUSE CLA 认证 - -### 10. SUSE CLE ### - -SUSE认证Linux工程师(CLE)是一个工程师级别的高级认证,为那些已经通过CLE考试的人准备。为了获得CLE认证,人们需要获得SUSE CLA和CLP的认证。获得CLE认证的人员拥有架设复杂SUSE Linux企业服务器环境的技能。CLE认证过的人可以配置基本的网络服务,管理打印,配置和使用Open LDAP,samba,IPv6,完成健康检测和(这里不知道),创建和执行shell脚本,部署SUSE Linux企业板,通过Xen实现虚拟化等等。 - -- **认证代码**:SUSE CLE -- 课程代码:3107 -- 考试代码:050-723 -- 考试类型:手写 -- 考试时长:120分钟 -- 要求:SUSE CLP 10或者11证书 - -### 11. LFCS ### - -Linux基金会认证系统管理员(LFCS)认证考生Linux使用中拥有的知识和通过终端环境使用Linux。LFCS是Linux基金会的一个认证程序,为使用Linux操作系统工作的系统管理员和工程师准备。Linux基金会联合工业级专家,Linux内核社区,测试考生扎实的技能,知识和应用能力。通过LFCS认证的人员拥有一些技能,知识和能力,包括在命令行下编辑和操作文件,管理和处理文件系统与存储的错误,聚合分区作为LVM设备,配置SWAP分区,管理网络文件系统,管理用户帐号,权限和属组,创建并执行bash shell脚本,安装,升级,移除软件包等等。 - -- **认证代码**:LFCS -- 课程代码:LFCS201,LFCS220(可选) -- 考试代码:LFCS 考试 -- 考试时长:2小时 -- 要求:无 -- 分数线:74% -- 语言:英语 -- 有效期:两年 - -### 12. LFCE ### - -Linux基金会认证工程师(LFCE),是Linux基金会为Linux工程师推出的认证。通过LFCE认证的人员拥有一个对于Linux较宽范围的技能,相比于LFCS。这是一个工程师级别的高级认证程序。LFCE认证的人具备一些网络管理方面的技能和能力,如配置网络服务,包过滤,网络运行模拟器,IP连通,配置文件系统和文件服务,网络文件系统,从仓库安装,升级软件包,管理网络安全,配置iptables,http服务,代理服务,邮件服务等等。由于其为高级工程级别的认证程序,所以普遍认为相比LFCS,学习和通过的难度更大些。 - -- **认证代码**:LFCE -- 课程代码:LFS230 -- 考试代码:LFCE 考试 -- 考试时长:2小时 -- 要求:认证过LFCS -- 分数线:72% -- 语言:英语 -- 有效期:2年 - -### 我们发现的情况(这仅仅是我们的观点)### - -最近的调查表明,在不同的高端招聘代理中,称80%的Linux工作描述更倾向于红帽的认证。如果你是一个学生/新手,并且想学习Linux,那么我们建议选择越来越流行的Linux基金会认证,或者CompTIA Linux也可以是一个选择。如果你已经知道了oracle或suse,或者在他们的产品上工作,那oracle/suse的认证会更好些,如果你在一个公司工作了,这些认证会对你的职业生涯成长有帮助:-) - -### 总结 ### - -在这个世界上,成千上万的大公司正在运行跑着Linux操作系统的服务器和主框架,为了在这些服务器上管理,配置和工作,总是存在对Linux技术/专业知识高度认证的需求。这些国际上承认的认证对某些人在Linux的职业生涯扮演很重要的角色。全世界范围内的这些公司运行着Linux,需要Linux工程师,系统管理员和已经获得认证且在Linux相关领域干得不错的有热情的人员。全球认可的Linux认证,对于专业知识和职业生涯的辉煌都是很基础的,所以好好准备考试并获得认证,对于在Linux建立职业生涯是一个很好的选择。如果你有任何问题,想法,反馈,请写在下方的评论框里,让我们好知道哪些东西需要添加或者改进。谢谢!:-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ From f00e836a6a353f1a52a3c882f54007d9ec28dffa Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 30 Jun 2015 18:45:37 +0800 Subject: [PATCH 51/76] =?UTF-8?q?[=E6=A0=A1=E5=AF=B9]=20tech/20150626=2015?= =?UTF-8?q?=20Useful=20MySQL=20or=20MariaDB=20Performance=20Tuning=20and?= =?UTF-8?q?=20Optimization=20Tips.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erformance Tuning and Optimization Tips.md | 190 +++++++++--------- 1 file changed, 93 insertions(+), 97 deletions(-) diff --git a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index 061b710c85..42256518f4 100644 --- a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,100 +1,97 @@ - 15 个有用的 MySQL/MariaDB 性能调整和优化技巧 ================================================================================ -MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 +MySQL 是一个强大的开源关系数据库管理系统或简称 RDBMS。它于 1995 年发布(20年前)。它采用结构化查询语言,这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是5.6.25,于 2015 年 5 月 29 日发行。 -尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 +关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿。尽管有许多关于 MySQL 有趣的传闻,本文旨在向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。 -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) +![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) -MySQL性能优化 +MySQL 性能优化 -2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 +2009 年 4 月,MySQL 被 Oracle 收购。其结果是成立了一个叫 MariaDB 的 MySQL 社区。创建的主要原因是为了保持 MySQL 项目在通用公共许可证下自由。 -今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 +今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序最广泛的 RDMS 之一(如果不是最多的)。 +这篇文章将告诉你一些基本的,但非常有用的关于如何优化 MySQL/MariaDB 性能的技巧。注意,本文假定您已经安装了 MySQL 或 MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: -这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: +- [在 RHEL/CentOS 7 上安装 LAMP][1] +- [在 Fedora 22 上安装 LAMP][2] +- [在 Ubuntu 15.04 安装 LAMP][3] +- [在 Debian 8 上安装 MariaDB][4] +- [在 Gentoo Linux 上安装 MariaDB][5] +- [在 Arch Linux 上安装 MariaDB][6] -- [Installing LAMP on RHEL/CentOS 7][1] -- [Installing LAMP on Fedora 22][2] -- [Setting Up LAMP on Ubuntu 15.04][3] -- [Installing MariaDB on Debian 8][4] -- [Install MariaDB on Gentoo Linux][5] -- [Install MariaDB on Arch Linux][6] +**重要**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。 -**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 +你需要明白这些: +- MySQL/MariaDB 配置文件位于 `/etc/my.cnf`。 每次更改此文件后你需要重启 MySQL 服务,以使更改生效。 +- 这篇文章使用 MySQL 5.6 版本。 -你需要明白这些: +### 1. 启用 InnoDB 的 file-per-table ### -- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 -- 这篇文章使用MySQL 5.6版本 。 +首先,解释清楚 InnoDB 是一个存储引擎很重要。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。 -### 1. 启动 InnoDB 的`file-per-table` ### +InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件表示它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。 -首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 +这样配置的另一个好处是你可以在一个单独的存储设备保留某些数据库表。这可以大大提高你磁盘的 I/O 负载。 -InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 - -这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 - -MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: +MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 /etc/my.cnf 文件中看到。该指令看起来是这样的: innodb_file_per_table=1 -### 2. 将MySQL数据库中的数据放在独立分区上 ### +### 2. 在独立分区上保存 MySQL 数据库数据 ### -**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. +**注意**:此设置只在 MySQL 上有效, 在 MariaDB 上无效。 -有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 +有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。 -要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 +要完成这步,你需要将新的磁盘连接到你的计算机/服务器上。对于这篇文章,我假定磁盘挂在到 /dev/sdb。 -下一步将是准备新的分区: +下一步是准备新的分区: # fdisk /dev/sdb -现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 +现在按 “N” 来创建新的分区。接着按 “P”,使其创建为主分区。在此之后,从 1-4 设置分区号。之后,你可以选择分区大小。这里按 enter。在下一步,你需要配置分区的大小。 -如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: +如果你希望使用全部的磁盘,再按一次 enter。否则,你可以手动设置新分区的大小。准备就绪后按 “w” 保存更改。现在,我们需要为我们的新分区创建一个文件系统。这可以用下面命令轻松地完成: # mkfs.ext4 /dev/sdb1 -现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: +现在我们会挂载新分区到一个目录。我在根目录下创建了一个名为 “ssd” 的目录: # mkdir /ssd/ -挂载新分区到刚才创建的文件夹下: +挂载新分区到刚才创建的目录下: # mount /dev/sdb1 /ssd/ -你可以添加如下行在/etc/fstab文件中设置开机自动挂载: +你可以在 /etc/fstab 文件中添加如下行设置为开机自动挂载: /dev/sdb1 /ssd ext3 defaults 0 0 -现在我们移动MySQL到新磁盘中。首先停止服务: +现在我们移动 MySQL 到新磁盘中。首先停止 MySQL 服务: # service mysqld stop -我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: +我建议你​​同时停止 Apache/nginx,以防止任何试图写入数据库的操作: # service httpd stop # service nginx stop -现在我们复制完整的MySQL目录到新分区中: +现在复制整个 MySQL 目录到新分区中: # cp /var/lib/mysql /ssd/ -Rp -这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: +这可能需要一段时间,具体取决于你的 MySQL 数据库的大小。一旦这个过程完成后重命名 MySQL 目录: # mv /var/lib/mysql /var/lib/mysql-backup -然后创建一个链接: +然后创建一个符号链接: # ln -s /ssd/mysql /var/lib/mysql -现在启动你的MySQL和web服务: +现在启动你的 MySQL 和 web 服务: # service mysqld start # service httpd start @@ -102,130 +99,129 @@ MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/et 以后你的数据库将使用新的磁盘访问。 -### 3. 优化InnoDB的缓冲区 ### +### 3. 优化使用 InnoDB 的缓冲池 ### -InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 +InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有很好的认识。 下面是你需要考虑的: -- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 -- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 +- 其它的进程需要消耗多少内存。这包括你的系统进程,页表,套接字缓冲。 +- 你的服务器是否专门用于 MySQL 还是你也运行其它非常消耗内存的服务。 +在一个专用的机器上,你可能会把 60-70% 的内存分配给 `innodb_buffer_pool_size`。如果你打算在一个机器上运行更多的服务,你应该重新考虑专门用于 `innodb_buffer_pool_size` 的内存大小。 -在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 - -你需要设置my.cnf中的此项: +你需要设置 my.cnf 中的此项: innodb_buffer_pool_size -### 4. 在MySQL中避免使用Swappiness ### +### 4. 在 MySQL 中避免使用 Swappiness ### -使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 +Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特殊磁盘空间时运行的进程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些 RAM。正如你猜测的磁盘比你的 RAM 要慢得多。 -默认情况下该选项已经启用: +默认启用了该选项: # sysctl vm.swappiness vm.swappiness = 60 -使用以下命令关闭swappiness: +运行以下命令关闭 swappiness: # sysctl -w vm.swappiness=0 -### 5. 设置MySQL的最大连接数 ### +### 5. 设置 MySQL 的最大连接数 ### -`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 +`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/ MariaDB 服务器允许有特级权限的用户 max_connections + 1 的连接数。只有当执行 MySQL 查询的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。 -请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 +请记住,太多的连接会导致 RAM 的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。 -你可以动态的改变`max_connections`的值而无需重启MySQL服务器: +你可以动态地改变 `max_connections` 的值而无需重启MySQL服务器: # mysql -u root -p mysql> set global max_connections := 300; -### 6. 配置MySQL的`thread_cache_size`变量 ### +### 6. 配置 MySQL `thread_cache_size` ### - `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 + `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于thread_cache_size,他的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 -要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: +要提高服务器的性能,你可以设置 `thread_cache_size` 的值相对高一些。你可以通过以下方法来查看线程缓存命中率: mysql> show status like 'Threads_created'; mysql> show status like 'Connections'; -你可以用以下公式来计算线程池的使用率: +你可以用以下公式来计算线程池的命中率: 100 - ((Threads_created / Connections) * 100) -如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 +如果你得到一个较低的数字,这意味着大多数 mysql 连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。 -但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: +这里有一个好处是可以动态地改变 `thread_cache_size` 而无需重启 MySQL 服务。你可以通过以下方式来实现: mysql> set global thread_cache_size = 16; -### 7.禁用MySQL的DNS反向查询 ### +### 7. 禁用 MySQL 的 DNS 反向查询 ### -当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 +默认情况下当新的连接出现时,MySQL/MariaDB 会进行 DNS 查询解析用户的 IP 地址/主机名。对于每个客户端连接,它的 IP 都会被解析为主机名。然后,主机名又被反解析为 IP 来验证两者是否一致。 -当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: +当 DNS 配置错误或服务器出现问题时,这很可能会导致延迟。这就是为什么要关闭 DNS 的反向查询的原因,你可以在你的配置文件中添加以下选项去设定: [mysqld] # Skip reverse DNS lookup of clients skip-name-resolve -更改后需要重新启动你的MySQL服务器. +更改后你需要重启 MySQL 服务。 -### 8. 配置MySQL的`query_cache_size`变量 ### +### 8. 配置 MySQL `query_cache_size` ### -如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 +如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB,这实际上会降低服务器的性能。 -背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 +背后的原因是,在更新过程中线程需要锁定缓存。通常设置为 200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给 64M 并在以后及时去增加。 -添加以下选项到你的MySQL配置文件中: +在你的 MySQL 配置文件中添加以下设置: query_cache_type = 1 query_cache_limit = 256K query_cache_min_res_unit = 2k query_cache_size = 80M -### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### +### 9. 配置 `tmp_table_size` 和 `max_heap_table_size` ### -这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 +这两个变量的大小应该相同并帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。 -这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 +这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB RAM 64M。 [mysqld] tmp_table_size= 64M max_heap_table_size= 64M -### 10. 开启MySQL慢速查询日志 ### +### 10. 启用 MySQL 慢查询日志 ### -慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: +记录慢查询可以帮助你定位数据库中的问题并帮助你调试。这可以通过在你的 MySQL 配置文件中添加以下值来启用: slow-query-log = 1 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 -第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 +第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询用时多少认为是长查询。 -### 11.检查MySQL的空闲连接 ### +### 11. 检查 MySQL 的空闲连接 ### -空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: +空闲连接会消耗资源,可以的话应该被中断或者刷新。空闲连接是指处于 “sleep” 状态并且会保持很长一段时间。你可以通过运行以下命令查看空闲连接: # mysqladmin processlist -u root -p | grep “Sleep” -这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 +这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现以下情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证并保持连接为打开状态。这会导致每个线程的缓冲被保存在内存中,直到该线程死亡。 -首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: +首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 : wait_timeout=60 -### 12. 为MySQL选择正确的文件系统 ### +### 12. 为 MySQL 选择正确的文件系统 ### 选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 -按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 +按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志文件系统。 -关于这三个文件系统你可以在下面看到一些有用的信息: +下面你可以找到一些关于这三个文件系统的有用信息: 注:表格 @@ -253,21 +249,21 @@ InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有
-这篇文章将详细介绍Linux文件系统的利与弊: +我们的这篇文章详细介绍了 Linux 文件系统的利与弊: -- [Linux Filesystem Explained][7] +- [Linux 文件系统解析][7] -### 13. 设置MySQL的`max_allowed_packet` ### +### 13. 设置 MySQL `max_allowed_packet` ### -MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 +MySQL 把数据拆分成包。通常发送到客户端的一行作为一个包。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。 -此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 +此值设置得过低可能会导致查询速度变得非常慢,然后你会在 MySQL 的错误日志看到一个错误。建议将该值设置为最大包的大小。 -### 14. 测试MySQL的性能 ### +### 14. 测试 MySQL 的性能优化 ### -你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 +你应该定期检查 MySQL/MariaDB 的性能。这将帮助你了解资源的使用情况是否发生了改变或需要进行改进。 -有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 +有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为 mysqltuner。 使用下面的命令下载并运行它: @@ -276,18 +272,18 @@ MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发 # cd major-MySQLTuner-perl-993bc18/ # ./mysqltuner.pl -你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: +你将收到有关 MySQL 使用的详细报告和推荐提示。下面是默认 MariaDB 安装的输出样例: -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) +![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) -### 15. 优化和修复MySQL数据库 ### +### 15. 优化和修复 MySQL 数据库 ### -有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 +有时候 MySQL/MariaDB 数据库中的表很容易崩溃,尤其是服务器意外关机、文件系统突然崩溃或复制过程中仍然访问数据库。幸运的是,有一个称为 'mysqlcheck' 的免费开源工具,它会自动检查、修复和优化 Linux 中数据库的所有表。 # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases # mysqlcheck -u root -p --auto-repair --check --optimize databasename -就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 +就是这些!我希望上述文章对你有用,并帮助你优化你的 MySQL 服务器。一如往常,如果你有任何疑问或评论,请在下面的评论部分提交。 -------------------------------------------------------------------------------- @@ -295,7 +291,7 @@ via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ 作者:[Marin Todorov][a] 译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) +校对:[ictlyh](https://github.com/ictlyh) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d293d68f5d0d0f24c9c4a30d67fadfd508e6722d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 23:38:55 +0800 Subject: [PATCH 52/76] PUB:20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips @strugglingyouth @ictlyh --- ...erformance Tuning and Optimization Tips.md | 106 +++++++----------- 1 file changed, 43 insertions(+), 63 deletions(-) rename {translated/tech => published}/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md (61%) diff --git a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md similarity index 61% rename from translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md rename to published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index 42256518f4..0f770d2ee4 100644 --- a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,16 +1,16 @@ 15 个有用的 MySQL/MariaDB 性能调整和优化技巧 ================================================================================ -MySQL 是一个强大的开源关系数据库管理系统或简称 RDBMS。它于 1995 年发布(20年前)。它采用结构化查询语言,这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是5.6.25,于 2015 年 5 月 29 日发行。 +MySQL 是一个强大的开源关系数据库管理系统(简称 RDBMS)。它发布于 1995 年(20年前)。它采用结构化查询语言(SQL),这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是 5.6.25,于 2015 年 5 月 29 日发布。 -关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿。尽管有许多关于 MySQL 有趣的传闻,本文旨在向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。 +关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿“ My”。尽管有许多关于 MySQL 有趣的传闻,不过本文主要是向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。 ![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) -MySQL 性能优化 +*MySQL 性能优化* -2009 年 4 月,MySQL 被 Oracle 收购。其结果是成立了一个叫 MariaDB 的 MySQL 社区。创建的主要原因是为了保持 MySQL 项目在通用公共许可证下自由。 +2009 年 4 月,MySQL 被 Oracle 收购。其结果是MySQL 社区分裂,创建了一个叫 MariaDB 的分支 。创建该分支的主要原因是为了保持这个项目可以在 GPL 下的自由。 -今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序最广泛的 RDMS 之一(如果不是最多的)。 +今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序的最流行的 RDMS 之一(如果不是最多的)。 这篇文章将告诉你一些基本的,但非常有用的关于如何优化 MySQL/MariaDB 性能的技巧。注意,本文假定您已经安装了 MySQL 或 MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: @@ -21,34 +21,34 @@ MySQL 性能优化 - [在 Gentoo Linux 上安装 MariaDB][5] - [在 Arch Linux 上安装 MariaDB][6] -**重要**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。 +**重要提示**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。 你需要明白这些: - MySQL/MariaDB 配置文件位于 `/etc/my.cnf`。 每次更改此文件后你需要重启 MySQL 服务,以使更改生效。 - 这篇文章使用 MySQL 5.6 版本。 -### 1. 启用 InnoDB 的 file-per-table ### +### 1. 启用 InnoDB 的每张表一个数据文件设置 ### -首先,解释清楚 InnoDB 是一个存储引擎很重要。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。 +首先,有一个重要的解释, InnoDB 是一个存储引擎。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。 -InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件表示它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。 +InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件代表它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。 -这样配置的另一个好处是你可以在一个单独的存储设备保留某些数据库表。这可以大大提高你磁盘的 I/O 负载。 +这样配置的另一个好处是你可以将某些数据库表放在一个单独的存储设备。这可以大大提升你磁盘的 I/O 负载。 MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 /etc/my.cnf 文件中看到。该指令看起来是这样的: innodb_file_per_table=1 -### 2. 在独立分区上保存 MySQL 数据库数据 ### +### 2. 将 MySQL 数据库数据存储到独立分区上 ### **注意**:此设置只在 MySQL 上有效, 在 MariaDB 上无效。 -有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。 +有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果操作系统和数据库的数据位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。 要完成这步,你需要将新的磁盘连接到你的计算机/服务器上。对于这篇文章,我假定磁盘挂在到 /dev/sdb。 -下一步是准备新的分区: +####下一步是准备新的分区: # fdisk /dev/sdb @@ -70,7 +70,9 @@ MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 / /dev/sdb1 /ssd ext3 defaults 0 0 -现在我们移动 MySQL 到新磁盘中。首先停止 MySQL 服务: +####现在我们将 MySQL 移动到新磁盘中 + +首先停止 MySQL 服务: # service mysqld stop @@ -101,12 +103,12 @@ MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 / ### 3. 优化使用 InnoDB 的缓冲池 ### -InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有很好的认识。 +InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有较多的认识。 下面是你需要考虑的: - 其它的进程需要消耗多少内存。这包括你的系统进程,页表,套接字缓冲。 -- 你的服务器是否专门用于 MySQL 还是你也运行其它非常消耗内存的服务。 +- 你的服务器是否专门用于 MySQL 还是你运行着其它非常消耗内存的服务。 在一个专用的机器上,你可能会把 60-70% 的内存分配给 `innodb_buffer_pool_size`。如果你打算在一个机器上运行更多的服务,你应该重新考虑专门用于 `innodb_buffer_pool_size` 的内存大小。 @@ -116,9 +118,9 @@ InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当 ### 4. 在 MySQL 中避免使用 Swappiness ### -Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特殊磁盘空间时运行的进程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些 RAM。正如你猜测的磁盘比你的 RAM 要慢得多。 +“交换”是一个当系统移动部分内存到一个称为 “交换空间” 的特殊磁盘空间时的过程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些内存。正如你猜测的磁盘比你的内存要慢得多。 -默认启用了该选项: +该选项默认情况下是启用的: # sysctl vm.swappiness @@ -130,18 +132,18 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 ### 5. 设置 MySQL 的最大连接数 ### -`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/ MariaDB 服务器允许有特级权限的用户 max_connections + 1 的连接数。只有当执行 MySQL 查询的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。 +`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/MariaDB 服务器允许有 SUPER 权限的用户在最大连接之外再建立一个连接。只有当执行 MySQL 请求的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。 -请记住,太多的连接会导致 RAM 的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。 +请记住,太多的连接会导致内存的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数,而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。 你可以动态地改变 `max_connections` 的值而无需重启MySQL服务器: # mysql -u root -p - mysql> set global max_connections := 300; + mysql> set global max_connections = 300; -### 6. 配置 MySQL `thread_cache_size` ### +### 6. 配置 MySQL 的线程缓存数量 ### - `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于thread_cache_size,他的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 + `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于 `thread_cache_size`,它的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 要提高服务器的性能,你可以设置 `thread_cache_size` 的值相对高一些。你可以通过以下方法来查看线程缓存命中率: @@ -152,7 +154,7 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 100 - ((Threads_created / Connections) * 100) -如果你得到一个较低的数字,这意味着大多数 mysql 连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。 +如果你得到一个较低的数字,这意味着大多数 mysql 连接使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。 这里有一个好处是可以动态地改变 `thread_cache_size` 而无需重启 MySQL 服务。你可以通过以下方式来实现: @@ -170,9 +172,9 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 更改后你需要重启 MySQL 服务。 -### 8. 配置 MySQL `query_cache_size` ### +### 8. 配置 MySQL 的查询缓存容量 ### -如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB,这实际上会降低服务器的性能。 +如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB 级,这实际上会降低服务器的性能。 背后的原因是,在更新过程中线程需要锁定缓存。通常设置为 200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给 64M 并在以后及时去增加。 @@ -183,11 +185,11 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 query_cache_min_res_unit = 2k query_cache_size = 80M -### 9. 配置 `tmp_table_size` 和 `max_heap_table_size` ### +### 9. 配置临时表容量和内存表最大容量 ### -这两个变量的大小应该相同并帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。 +`tmp_table_size` 和 `max_heap_table_size` 这两个变量的大小应该相同,它们可以让你避免磁盘写入。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。 -这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB RAM 64M。 +这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB 内存给 64M。 [mysqld] tmp_table_size= 64M @@ -201,17 +203,17 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 -第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询用时多少认为是长查询。 +第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询多少用时算长。 ### 11. 检查 MySQL 的空闲连接 ### -空闲连接会消耗资源,可以的话应该被中断或者刷新。空闲连接是指处于 “sleep” 状态并且会保持很长一段时间。你可以通过运行以下命令查看空闲连接: +空闲连接会消耗资源,可以的话应该被终止或者刷新。空闲连接是指处于 “sleep” 状态并且保持了很长一段时间的连接。你可以通过运行以下命令查看空闲连接: # mysqladmin processlist -u root -p | grep “Sleep” -这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现以下情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证并保持连接为打开状态。这会导致每个线程的缓冲被保存在内存中,直到该线程死亡。 +这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现这种情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证信息并保持连接为打开状态。这会导致每个线程的缓冲都被保存在内存中,直到该线程结束。 -首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 : +首先你要做的就是检查代码问题并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 : wait_timeout=60 @@ -219,43 +221,21 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 -按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志文件系统。 +按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志型文件系统。 下面你可以找到一些关于这三个文件系统的有用信息: -注:表格 - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
+| 文件系统 | XFS | Ext4 | Btrfs | +|---------------|-----|------|-------| +| 文件系统最大容量 | 8EB | 1EB | 16EB | +| 最大文件大小 | 8EB | 16TB | 16EB | -我们的这篇文章详细介绍了 Linux 文件系统的利与弊: -- [Linux 文件系统解析][7] +我们的这篇文章详细介绍了 Linux 文件系统的利与弊: [Linux 文件系统解析][7]。 -### 13. 设置 MySQL `max_allowed_packet` ### +### 13. 设置 MySQL 允许的最大数据包 ### -MySQL 把数据拆分成包。通常发送到客户端的一行作为一个包。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。 +MySQL 把数据拆分成包。通常一个包就是发送到客户端的一行数据。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。 此值设置得过低可能会导致查询速度变得非常慢,然后你会在 MySQL 的错误日志看到一个错误。建议将该值设置为最大包的大小。 From 3d2bf2f9cf39714cbaa5ac64278e71da439ac00a Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 00:16:33 +0800 Subject: [PATCH 53/76] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201506?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Compact Text Editors Great for Remote Editing and Much More.md | 0 .../20141219 What is good audio editing software on Linux.md | 0 .../20150126 Installing Cisco Packet tracer in Linux.md | 0 .../20150126 iptraf--A TCP or UDP Network Monitoring Utility.md | 0 .../20150128 The top 10 rookie open source projects.md | 0 ...ow to access Feedly RSS feed from the command line on Linux.md | 0 ... or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md | 0 ...mote incremental backup of LUKS-encrypted disk or partition.md | 0 ... Material Design Inspired GTK And Icon Theme Paper in Linux.md | 0 published/{ => 201506}/20150310 FAQ--BSD.md | 0 ...idirectionally from Command Line Using 'Speedtest-CLI' Tool.md | 0 ...20150323 How to set up networking between Docker containers.md | 0 .../20150326 A Peep into Process Management Commands in Linux.md | 0 ...0 How to Serve Git Repositories Using Gitblit Tool in Linux.md | 0 ...1 How to Install WordPress with Nginx in a Docker Container.md | 0 ...150331 How to set up remote desktop on Linux VPS using x2go.md | 0 .../20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md | 0 ... Tools for Browsing Websites and Downloading Files in Linux.md | 0 ...How to Show Dialog Box from Bash Shell Script with Examples.md | 0 ...manage remote MySQL databases on Linux VPS using a GUI tool.md | 0 ...wers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md | 0 ...h Answers--How to configure PCI-passthrough on virt-manager.md | 0 .../20150416 Linux Network Statistics Tools or Commands.md | 0 .../20150417 How to Install Discourse in a Docker Container.md | 0 ...rectory attributes in linux using chattr and lsattr command.md | 0 .../20150423 20 Awesome Docker Containers for a Desktop User.md | 0 ...ing Helps Connecting Private interface to Internet in Linux.md | 0 ...ow to Change Default Web Browser and Email Client in Ubuntu.md | 0 ...50427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 0 .../{ => 201506}/20150427 How to set up NTP server in CentOS.md | 0 ...w To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md | 0 ...lasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md | 0 .../20150429 What are good command line HTTP clients.md | 0 ...werDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md | 0 ...mmandline Chat Server and Remove Unwanted Packages in Linux.md | 0 .../20150506 First Step Guide for Learning Shell Scripting.md | 0 .../20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md | 0 ...ng password for default keyring to unlock on Ubuntu desktop.md | 0 ...nswers--How to install Shrew Soft IPsec VPN client on Linux.md | 0 ...Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md | 0 .../20150511 Fix Various Update Errors In Ubuntu 14.04.md | 0 .../20150511 Open Source History--Why Did Linux Succeed.md | 0 ...5 Zypper Commands to Manage 'Suse' Linux Package Management.md | 0 ...rk, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md | 0 .../20150512 How To Run Docker Client Inside Windows OS.md | 0 ...AQs with Answers--How to view torrent file content on Linux.md | 0 .../20150515 Basic Networking Commands with Docker Containers.md | 0 .../20150515 Extend Swap Space using Swap file in Linux.md | 0 .../20150515 How to Install Percona Server on CentOS 7.md | 0 ...4′ Linux Operating System to Preserve Privacy and Anonymity.md | 0 ...s Ubuntu App Applies Instagram Style Filters to Your Photos.md | 0 ...and Mysterious Uses of Symbol or Operator in Linux Commands.md | 0 ...70 Expected Shell Scripting Interview Questions and Answers.md | 0 ...x '404 Not Found' error with 'apt-get update' on old Ubuntu.md | 0 ...ntered a section with no Package--header' error on Raspbian.md | 0 ...AQs with Answers--How to view threads of a process on Linux.md | 0 ...ith Answers--What is the Apache error log location on Linux.md | 0 .../20150520 How to Use Docker Machine with a Cloud Provider.md | 0 .../20150520 How to Use tmpfs on RHEL or CentOS 7.0.md | 0 ...ile and install wxWidgets on Ubuntu or Debian or Linux Mint.md | 0 ...520 Shell Script to Backup Files or Directories Using rsync.md | 0 ...stem proxy settings from the command line on Ubuntu desktop.md | 0 ... Answers--How to install Unity Tweak Tool on Ubuntu desktop.md | 0 .../20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md | 0 ...ux ntopng--Network Monitoring Tool Installation Screenshots.md | 0 published/{ => 201506}/20150527 3 Open Source Python Shells.md | 0 .../20150527 3 Useful Hacks Every Linux User Must Know.md | 0 .../20150527 How To Check Laptop CPU Temperature In Ubuntu.md | 0 ... Create Own Online Shopping Store Using 'OpenCart' in Linux.md | 0 ...rocesses or Unresponsive Applications Using 'xkill' Command.md | 0 ...x FAQs with Answers--How to mount an LVM partition on Linux.md | 0 .../20150528 11 pointless but awesome Linux terminal tricks.md | 0 ...F' Fork of Yum Commands for RPM Package Management in Linux.md | 0 .../20150528 Things To Do After Installing Fedora 22.md | 0 .../20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md | 0 ...s How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md | 0 .../20150604 12 Globally Recognized Linux Certifications.md | 0 ...Foundation achievements in 2014--download the Annual Report.md | 0 ...buntu's Juju Now Supports systemd and Google Cloud Platform.md | 0 ...ow to Clear RAM Memory Cache Buffer and Swap Space on Linux.md | 0 ...all nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md | 0 .../20150610 Install Android Studio on Ubuntu 15.04.md | 0 ...612 Inside NGINX--How We Designed for Performance and Scale.md | 0 .../20150615 PHP at 20--From pet project to powerhouse.md | 0 published/{ => 201506}/20150617 The Art of Command Line.md | 0 .../20150623 Linux Kernel 4.1 Released This Is What's New.md | 0 ...l MySQL or MariaDB Performance Tuning and Optimization Tips.md | 0 87 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201506}/20141013 Compact Text Editors Great for Remote Editing and Much More.md (100%) rename published/{ => 201506}/20141219 What is good audio editing software on Linux.md (100%) rename published/{ => 201506}/20150126 Installing Cisco Packet tracer in Linux.md (100%) rename published/{ => 201506}/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md (100%) rename published/{ => 201506}/20150128 The top 10 rookie open source projects.md (100%) rename published/{ => 201506}/20150209 How to access Feedly RSS feed from the command line on Linux.md (100%) rename published/{ => 201506}/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md (100%) rename published/{ => 201506}/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md (100%) rename published/{ => 201506}/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md (100%) rename published/{ => 201506}/20150310 FAQ--BSD.md (100%) rename published/{ => 201506}/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md (100%) rename published/{ => 201506}/20150323 How to set up networking between Docker containers.md (100%) rename published/{ => 201506}/20150326 A Peep into Process Management Commands in Linux.md (100%) rename published/{ => 201506}/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md (100%) rename published/{ => 201506}/20150331 How to Install WordPress with Nginx in a Docker Container.md (100%) rename published/{ => 201506}/20150331 How to set up remote desktop on Linux VPS using x2go.md (100%) rename published/{ => 201506}/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md (100%) rename published/{ => 201506}/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md (100%) rename published/{ => 201506}/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md (100%) rename published/{ => 201506}/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md (100%) rename published/{ => 201506}/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md (100%) rename published/{ => 201506}/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md (100%) rename published/{ => 201506}/20150416 Linux Network Statistics Tools or Commands.md (100%) rename published/{ => 201506}/20150417 How to Install Discourse in a Docker Container.md (100%) rename published/{ => 201506}/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md (100%) rename published/{ => 201506}/20150423 20 Awesome Docker Containers for a Desktop User.md (100%) rename published/{ => 201506}/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md (100%) rename published/{ => 201506}/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md (100%) rename published/{ => 201506}/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md (100%) rename published/{ => 201506}/20150427 How to set up NTP server in CentOS.md (100%) rename published/{ => 201506}/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md (100%) rename published/{ => 201506}/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md (100%) rename published/{ => 201506}/20150429 What are good command line HTTP clients.md (100%) rename published/{ => 201506}/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md (100%) rename published/{ => 201506}/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md (100%) rename published/{ => 201506}/20150506 First Step Guide for Learning Shell Scripting.md (100%) rename published/{ => 201506}/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md (100%) rename published/{ => 201506}/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md (100%) rename published/{ => 201506}/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md (100%) rename published/{ => 201506}/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md (100%) rename published/{ => 201506}/20150511 Fix Various Update Errors In Ubuntu 14.04.md (100%) rename published/{ => 201506}/20150511 Open Source History--Why Did Linux Succeed.md (100%) rename published/{ => 201506}/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md (100%) rename published/{ => 201506}/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md (100%) rename published/{ => 201506}/20150512 How To Run Docker Client Inside Windows OS.md (100%) rename published/{ => 201506}/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md (100%) rename published/{ => 201506}/20150515 Basic Networking Commands with Docker Containers.md (100%) rename published/{ => 201506}/20150515 Extend Swap Space using Swap file in Linux.md (100%) rename published/{ => 201506}/20150515 How to Install Percona Server on CentOS 7.md (100%) rename published/{ => 201506}/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md (100%) rename published/{ => 201506}/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md (100%) rename published/{ => 201506}/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md (100%) rename published/{ => 201506}/20150518 70 Expected Shell Scripting Interview Questions and Answers.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md (100%) rename published/{ => 201506}/20150520 How to Use Docker Machine with a Cloud Provider.md (100%) rename published/{ => 201506}/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md (100%) rename published/{ => 201506}/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md (100%) rename published/{ => 201506}/20150520 Shell Script to Backup Files or Directories Using rsync.md (100%) rename published/{ => 201506}/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md (100%) rename published/{ => 201506}/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md (100%) rename published/{ => 201506}/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md (100%) rename published/{ => 201506}/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md (100%) rename published/{ => 201506}/20150527 3 Open Source Python Shells.md (100%) rename published/{ => 201506}/20150527 3 Useful Hacks Every Linux User Must Know.md (100%) rename published/{ => 201506}/20150527 How To Check Laptop CPU Temperature In Ubuntu.md (100%) rename published/{ => 201506}/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md (100%) rename published/{ => 201506}/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md (100%) rename published/{ => 201506}/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md (100%) rename published/{ => 201506}/20150528 11 pointless but awesome Linux terminal tricks.md (100%) rename published/{ => 201506}/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md (100%) rename published/{ => 201506}/20150528 Things To Do After Installing Fedora 22.md (100%) rename published/{ => 201506}/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md (100%) rename published/{ => 201506}/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md (100%) rename published/{ => 201506}/20150604 12 Globally Recognized Linux Certifications.md (100%) rename published/{ => 201506}/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md (100%) rename published/{ => 201506}/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md (100%) rename published/{ => 201506}/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md (100%) rename published/{ => 201506}/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md (100%) rename published/{ => 201506}/20150610 Install Android Studio on Ubuntu 15.04.md (100%) rename published/{ => 201506}/20150612 Inside NGINX--How We Designed for Performance and Scale.md (100%) rename published/{ => 201506}/20150615 PHP at 20--From pet project to powerhouse.md (100%) rename published/{ => 201506}/20150617 The Art of Command Line.md (100%) rename published/{ => 201506}/20150623 Linux Kernel 4.1 Released This Is What's New.md (100%) rename published/{ => 201506}/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md (100%) diff --git a/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md similarity index 100% rename from published/20141013 Compact Text Editors Great for Remote Editing and Much More.md rename to published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md diff --git a/published/20141219 What is good audio editing software on Linux.md b/published/201506/20141219 What is good audio editing software on Linux.md similarity index 100% rename from published/20141219 What is good audio editing software on Linux.md rename to published/201506/20141219 What is good audio editing software on Linux.md diff --git a/published/20150126 Installing Cisco Packet tracer in Linux.md b/published/201506/20150126 Installing Cisco Packet tracer in Linux.md similarity index 100% rename from published/20150126 Installing Cisco Packet tracer in Linux.md rename to published/201506/20150126 Installing Cisco Packet tracer in Linux.md diff --git a/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md similarity index 100% rename from published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md rename to published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md diff --git a/published/20150128 The top 10 rookie open source projects.md b/published/201506/20150128 The top 10 rookie open source projects.md similarity index 100% rename from published/20150128 The top 10 rookie open source projects.md rename to published/201506/20150128 The top 10 rookie open source projects.md diff --git a/published/20150209 How to access Feedly RSS feed from the command line on Linux.md b/published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md similarity index 100% rename from published/20150209 How to access Feedly RSS feed from the command line on Linux.md rename to published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md diff --git a/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md similarity index 100% rename from published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md rename to published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md diff --git a/published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md similarity index 100% rename from published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md rename to published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md diff --git a/published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/published/201506/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md similarity index 100% rename from published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md rename to published/201506/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md diff --git a/published/20150310 FAQ--BSD.md b/published/201506/20150310 FAQ--BSD.md similarity index 100% rename from published/20150310 FAQ--BSD.md rename to published/201506/20150310 FAQ--BSD.md diff --git a/published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md similarity index 100% rename from published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md rename to published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md diff --git a/published/20150323 How to set up networking between Docker containers.md b/published/201506/20150323 How to set up networking between Docker containers.md similarity index 100% rename from published/20150323 How to set up networking between Docker containers.md rename to published/201506/20150323 How to set up networking between Docker containers.md diff --git a/published/20150326 A Peep into Process Management Commands in Linux.md b/published/201506/20150326 A Peep into Process Management Commands in Linux.md similarity index 100% rename from published/20150326 A Peep into Process Management Commands in Linux.md rename to published/201506/20150326 A Peep into Process Management Commands in Linux.md diff --git a/published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md similarity index 100% rename from published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md rename to published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md diff --git a/published/20150331 How to Install WordPress with Nginx in a Docker Container.md b/published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md similarity index 100% rename from published/20150331 How to Install WordPress with Nginx in a Docker Container.md rename to published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md diff --git a/published/20150331 How to set up remote desktop on Linux VPS using x2go.md b/published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md similarity index 100% rename from published/20150331 How to set up remote desktop on Linux VPS using x2go.md rename to published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md diff --git a/published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md b/published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md similarity index 100% rename from published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md rename to published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md diff --git a/published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md similarity index 100% rename from published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md rename to published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md diff --git a/published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md b/published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md similarity index 100% rename from published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md rename to published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md diff --git a/published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md b/published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md similarity index 100% rename from published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md rename to published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md diff --git a/published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md b/published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md similarity index 100% rename from published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md rename to published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md diff --git a/published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md similarity index 100% rename from published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md rename to published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md diff --git a/published/20150416 Linux Network Statistics Tools or Commands.md b/published/201506/20150416 Linux Network Statistics Tools or Commands.md similarity index 100% rename from published/20150416 Linux Network Statistics Tools or Commands.md rename to published/201506/20150416 Linux Network Statistics Tools or Commands.md diff --git a/published/20150417 How to Install Discourse in a Docker Container.md b/published/201506/20150417 How to Install Discourse in a Docker Container.md similarity index 100% rename from published/20150417 How to Install Discourse in a Docker Container.md rename to published/201506/20150417 How to Install Discourse in a Docker Container.md diff --git a/published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md b/published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md similarity index 100% rename from published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md rename to published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md diff --git a/published/20150423 20 Awesome Docker Containers for a Desktop User.md b/published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md similarity index 100% rename from published/20150423 20 Awesome Docker Containers for a Desktop User.md rename to published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md diff --git a/published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md b/published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md similarity index 100% rename from published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md rename to published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md diff --git a/published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md b/published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md similarity index 100% rename from published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md rename to published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md diff --git a/published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md similarity index 100% rename from published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md rename to published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md diff --git a/published/20150427 How to set up NTP server in CentOS.md b/published/201506/20150427 How to set up NTP server in CentOS.md similarity index 100% rename from published/20150427 How to set up NTP server in CentOS.md rename to published/201506/20150427 How to set up NTP server in CentOS.md diff --git a/published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md similarity index 100% rename from published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md rename to published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md diff --git a/published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md similarity index 100% rename from published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md rename to published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md diff --git a/published/20150429 What are good command line HTTP clients.md b/published/201506/20150429 What are good command line HTTP clients.md similarity index 100% rename from published/20150429 What are good command line HTTP clients.md rename to published/201506/20150429 What are good command line HTTP clients.md diff --git a/published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md similarity index 100% rename from published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md rename to published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md diff --git a/published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md similarity index 100% rename from published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md rename to published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md diff --git a/published/20150506 First Step Guide for Learning Shell Scripting.md b/published/201506/20150506 First Step Guide for Learning Shell Scripting.md similarity index 100% rename from published/20150506 First Step Guide for Learning Shell Scripting.md rename to published/201506/20150506 First Step Guide for Learning Shell Scripting.md diff --git a/published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md similarity index 100% rename from published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md rename to published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md diff --git a/published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md similarity index 100% rename from published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md rename to published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md diff --git a/published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md similarity index 100% rename from published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md rename to published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md diff --git a/published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md similarity index 100% rename from published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md rename to published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md diff --git a/published/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md similarity index 100% rename from published/20150511 Fix Various Update Errors In Ubuntu 14.04.md rename to published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md diff --git a/published/20150511 Open Source History--Why Did Linux Succeed.md b/published/201506/20150511 Open Source History--Why Did Linux Succeed.md similarity index 100% rename from published/20150511 Open Source History--Why Did Linux Succeed.md rename to published/201506/20150511 Open Source History--Why Did Linux Succeed.md diff --git a/published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md similarity index 100% rename from published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md rename to published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md diff --git a/published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md similarity index 100% rename from published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md rename to published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md diff --git a/published/20150512 How To Run Docker Client Inside Windows OS.md b/published/201506/20150512 How To Run Docker Client Inside Windows OS.md similarity index 100% rename from published/20150512 How To Run Docker Client Inside Windows OS.md rename to published/201506/20150512 How To Run Docker Client Inside Windows OS.md diff --git a/published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md b/published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md similarity index 100% rename from published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md rename to published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md diff --git a/published/20150515 Basic Networking Commands with Docker Containers.md b/published/201506/20150515 Basic Networking Commands with Docker Containers.md similarity index 100% rename from published/20150515 Basic Networking Commands with Docker Containers.md rename to published/201506/20150515 Basic Networking Commands with Docker Containers.md diff --git a/published/20150515 Extend Swap Space using Swap file in Linux.md b/published/201506/20150515 Extend Swap Space using Swap file in Linux.md similarity index 100% rename from published/20150515 Extend Swap Space using Swap file in Linux.md rename to published/201506/20150515 Extend Swap Space using Swap file in Linux.md diff --git a/published/20150515 How to Install Percona Server on CentOS 7.md b/published/201506/20150515 How to Install Percona Server on CentOS 7.md similarity index 100% rename from published/20150515 How to Install Percona Server on CentOS 7.md rename to published/201506/20150515 How to Install Percona Server on CentOS 7.md diff --git a/published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md similarity index 100% rename from published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md rename to published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md diff --git a/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md similarity index 100% rename from published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md rename to published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md diff --git a/published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md similarity index 100% rename from published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md rename to published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md diff --git a/published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md similarity index 100% rename from published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md rename to published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md diff --git a/published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md rename to published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md diff --git a/published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md b/published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md rename to published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md diff --git a/published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md rename to published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md diff --git a/published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md rename to published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md diff --git a/published/20150520 How to Use Docker Machine with a Cloud Provider.md b/published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md similarity index 100% rename from published/20150520 How to Use Docker Machine with a Cloud Provider.md rename to published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md diff --git a/published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md similarity index 100% rename from published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md rename to published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md diff --git a/published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md similarity index 100% rename from published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md rename to published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md diff --git a/published/20150520 Shell Script to Backup Files or Directories Using rsync.md b/published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md similarity index 100% rename from published/20150520 Shell Script to Backup Files or Directories Using rsync.md rename to published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md diff --git a/published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md similarity index 100% rename from published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md rename to published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md diff --git a/published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md similarity index 100% rename from published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md rename to published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md diff --git a/published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/published/201506/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md similarity index 100% rename from published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md rename to published/201506/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md diff --git a/published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md similarity index 100% rename from published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md rename to published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md diff --git a/published/20150527 3 Open Source Python Shells.md b/published/201506/20150527 3 Open Source Python Shells.md similarity index 100% rename from published/20150527 3 Open Source Python Shells.md rename to published/201506/20150527 3 Open Source Python Shells.md diff --git a/published/20150527 3 Useful Hacks Every Linux User Must Know.md b/published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md similarity index 100% rename from published/20150527 3 Useful Hacks Every Linux User Must Know.md rename to published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md diff --git a/published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md similarity index 100% rename from published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md rename to published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md diff --git a/published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md similarity index 100% rename from published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md rename to published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md diff --git a/published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md similarity index 100% rename from published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md rename to published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md diff --git a/published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md similarity index 100% rename from published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md rename to published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md diff --git a/published/20150528 11 pointless but awesome Linux terminal tricks.md b/published/201506/20150528 11 pointless but awesome Linux terminal tricks.md similarity index 100% rename from published/20150528 11 pointless but awesome Linux terminal tricks.md rename to published/201506/20150528 11 pointless but awesome Linux terminal tricks.md diff --git a/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md similarity index 100% rename from published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md rename to published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md diff --git a/published/20150528 Things To Do After Installing Fedora 22.md b/published/201506/20150528 Things To Do After Installing Fedora 22.md similarity index 100% rename from published/20150528 Things To Do After Installing Fedora 22.md rename to published/201506/20150528 Things To Do After Installing Fedora 22.md diff --git a/published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md similarity index 100% rename from published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md rename to published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md diff --git a/published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md similarity index 100% rename from published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md rename to published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md diff --git a/published/20150604 12 Globally Recognized Linux Certifications.md b/published/201506/20150604 12 Globally Recognized Linux Certifications.md similarity index 100% rename from published/20150604 12 Globally Recognized Linux Certifications.md rename to published/201506/20150604 12 Globally Recognized Linux Certifications.md diff --git a/published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md similarity index 100% rename from published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md rename to published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md diff --git a/published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md similarity index 100% rename from published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md rename to published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md diff --git a/published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md similarity index 100% rename from published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md rename to published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md diff --git a/published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md similarity index 100% rename from published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md rename to published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md diff --git a/published/20150610 Install Android Studio on Ubuntu 15.04.md b/published/201506/20150610 Install Android Studio on Ubuntu 15.04.md similarity index 100% rename from published/20150610 Install Android Studio on Ubuntu 15.04.md rename to published/201506/20150610 Install Android Studio on Ubuntu 15.04.md diff --git a/published/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md similarity index 100% rename from published/20150612 Inside NGINX--How We Designed for Performance and Scale.md rename to published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md diff --git a/published/20150615 PHP at 20--From pet project to powerhouse.md b/published/201506/20150615 PHP at 20--From pet project to powerhouse.md similarity index 100% rename from published/20150615 PHP at 20--From pet project to powerhouse.md rename to published/201506/20150615 PHP at 20--From pet project to powerhouse.md diff --git a/published/20150617 The Art of Command Line.md b/published/201506/20150617 The Art of Command Line.md similarity index 100% rename from published/20150617 The Art of Command Line.md rename to published/201506/20150617 The Art of Command Line.md diff --git a/published/20150623 Linux Kernel 4.1 Released This Is What's New.md b/published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md similarity index 100% rename from published/20150623 Linux Kernel 4.1 Released This Is What's New.md rename to published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md similarity index 100% rename from published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md rename to published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md From 5ed2c19e52d0c8222fcf59f89dc2de0bf9584ce1 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 13:09:32 +0800 Subject: [PATCH 54/76] PUB:20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites @ictlyh --- ...Tricks to Secure and Customize Websites.md | 145 +++++++++--------- 1 file changed, 73 insertions(+), 72 deletions(-) rename {translated/tech => published}/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md (62%) diff --git a/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md similarity index 62% rename from translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md rename to published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md index 723ce313b2..7f3747721f 100644 --- a/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md +++ b/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -1,43 +1,44 @@ -用于提高网站安全性和自定义网站的 25 个有用 Apache ‘.htaccess’ 小技巧 +25 个有用 Apache ‘.htaccess’ 技巧 ================================================================================ -网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。之前受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 +网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。早期受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 -有了网站,随之而来的是对能向全球大规模用户显示站点的单元的需求。这个需求通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 +对于网站,随之而来的是需要一个能向全球大规模用户显示站点的某个东西。这个需求可以通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 ![Apache htaccess 小技巧](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) -25 个 htaccess 小技巧 + +*25 个 htaccess 小技巧* 想要拥有一个网站,可以创建一个自己的本地服务器,或者联系任何上面提到的或其它服务器管理员来托管他的网站。但实际问题也从这点开始。网站的性能主要取决于以下因素: - 网站消耗的带宽。 -- 针对黑客网站有多安全。 +- 面对黑客,网站有多安全。 - 对数据库进行数据检索时的优化。 - 显示导航菜单和提供更多 UI 功能时的用户友好性。 除此之外,保证托管网站服务器成功的多种因素还包括: - 对于一个流行站点的数据压缩量。 -- 同时为多个请求同一或不同站点的用户服务的能力。 +- 同时为多个对请求同一或不同站点的用户服务的能力。 - 保证网站上输入的机密数据安全,例如:Email、信用卡信息等等。 - 允许更多的选项用于增强站点的动态性。 -这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链接等的安全性的功能。例如 ‘.htaccess’ 文件。 +这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链等的安全性的功能:‘.htaccess’ 文件。 ### .htaccess 是什么? ### htaccess (hypertext access,超文本访问) 是为网站所有者提供用于控制服务器环境变量以及其它参数的选项,从而增强他们网站的功能的文件。这些文件可以在网站目录树的任何一个目录中,并向该目录以及目录中的文件和子目录提供功能。 -这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略。但让隐藏文件可见可以让你看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 +这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略它们,但如果查看隐藏文件的话,你就可以看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 -注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者层次结构中更上层文件)提供的命令。 +注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者目录层次结构中更上层的文件)提供的命令。 ### Apache Server 和 .htaccess 文件 ### -Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它是用 C/C++ 和 XML 建立的基于 [NCSA HTTPd 服务器][1] 的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 +Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它基于 [NCSA HTTPd 服务器][1] ,是用 C/C++ 和 XML 建立的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 -最常用于 UNIX,Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 +它最常用于 UNIX,但 Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 -Apache 服务器对于 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 +Apache 服务器可以让 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中可以有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 下面介绍如果配置 Apache 服务器上的 htaccess 文件。 @@ -65,19 +66,19 @@ Apache 服务器对于 www/ 目录中的每个用户有一个单独的 .htaccess 在这种情况下最好咨询托管管理员,如果他们允许访问 .htaccess 文件的话。 -### 用于站点的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### +### 用于网站的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### #### 1. 如何在 .htaccess 文件中启用 mod_rewrite #### -mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 +mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 来隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 要允许 mod_rewrite,只需要在你的 .htaccess 文件的第一行添加如下一行。 Options +FollowSymLinks -该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。 +该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。(LCTT 译注:+FollowSymLinks 只是启用 mod_rewrite 的前提之一,还需要在全局和虚拟机中设置 `RewriteEngine on` 才能启用重写模块。) -#### 2. 如果允许或禁止对站点的访问 #### +#### 2. 如何允许或禁止对站点的访问 #### 通过使用 order、allow 和 deny 关键字,htaccess 文件可以允许或者禁止对站点或目录中子目录或文件的访问。 @@ -109,13 +110,13 @@ mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏 #### 3. 为不同错误码生成 Apache 错误文档 #### -用一些简单行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 +用简单几行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 要做到这点,需要添加下面的行到 ‘.htaccess’ 文件: ErrorDocument -‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或 服务器上的路径(如果你使用任何其它服务器来托管网站)。 +‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或服务器上的路径(如果你使用任何其它服务器来托管网站)。 **例子:** @@ -123,13 +124,13 @@ mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏 上面一行设置客户请求任何无效页面,服务器报告 404 错误时显示 error-docs 目录下的 ‘error-404.html’ 文档。 -ErrorDocument 404 "404 Page not found

The page you request is not present. Check the URL you have typed

" + ErrorDocument 404 "404 Page not found

The page you request is not present. Check the URL you have typed

" -上面的表示也正确,其中字符串表示一个普通的 html 文件。 +上面的表示也正确,其中字符串相当于一个普通的 html 文件。 #### 4. 设置/取消 Apache 服务器环境变量 #### -在 .htaccess 文件中你可以设置或者取消站点所有者用来更改服务器设置的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 +在 .htaccess 文件中你可以设置或者取消站点所有者可以更改的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 **设置环境变量** @@ -141,29 +142,29 @@ ErrorDocument 404 "404 Page not found

#### 5. 为文件定义不同 MIME 类型 #### -MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体扩展) 是浏览器运行任何页面默认能识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义的类型的文件并运行。 +MIME(多用途 Internet 多媒体扩展)是浏览器运行任何页面所默认识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义类型的文件并运行。 AddType application/javascript js AddType application/x-font-ttf ttf ttc -这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展定义不同的 MIME 类型,从而服务器可以理解这些文件。 +这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展名定义不同的 MIME 类型,从而让服务器可以理解这些文件。 #### 6. 如何在 Apache 中限制上传和下载的大小 #### -.htaccess 文件允许你拥有控制一个特定用户从你的站点上传或下载数据量大小的功能。要做到这点你只需要添加下面的行到你的 .htaccess 文件: +.htaccess 文件允许你能够控制某个用户从你的站点(通过 PHP)单次上传数据量的大小(LCTT 译注:原文有误,修改)。要做到这点你只需要添加下面的行到你的 .htaccess 文件: php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 -上面的行设置最大上传大小、最大推送数据大小、最大执行时间,例如允许用户在本地机器运行站点的最大时间、限制的最大输入时间。 +上面的行设置最大上传大小、最大POST 提交数据大小、最长执行时间(例如,允许用户在他的本地机器上单次执行一个请求的最大时间)、限制的最大输入时间。 -#### 7. 让用户在站点上播放 .mp3 和其它文件之前预先下载 #### +#### 7. 让用户不能在你的站点上在线播放 .mp3 和其它文件 #### -大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载后才能播放。这非常有用,因为在线播放音乐和视频会消耗很多带宽。 +大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载完成后才能播放。这非常有用,因为(无缓冲的)在线播放音乐和视频会消耗很多带宽。 要添加下面的行到你的 .htaccess 文件: @@ -171,23 +172,23 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 8. 为站点设置目录索引 #### -大部分网站开发者都知道第一个显示的页面,例如一个站点的主页面,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? +大部分网站开发者都知道第一个显示的页面是哪个,例如一个站点的首页,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? -.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 +.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集合,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 需要添加下面的行产生所需的效果。 DirectoryIndex index.html index.php yourpage.php -上面一行指定如果有任何访问主页面的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会处理下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 +上面一行指定如果有任何访问首页的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会找下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 #### 9. 如何为文件启用 GZip 压缩以节省网站带宽 #### -繁重站点通常比只占少量空间的轻量级站点运行更慢是常见的现象。这是因为对于繁重站点需要时间加载大量的脚本文件和图片用于在客户端的 Web 浏览器上显示。 +繁忙的站点通常比只占少量空间的轻量级站点运行更慢,这是常见的现象。因为对于繁忙的站点需要时间加载巨大的脚本文件和图片以在客户端的 Web 浏览器上显示。 -当浏览器请求一个 web 页面时,服务器提供给浏览器该页面并局部显示该 web 页面,浏览器需要下载该页面然后在页面内部运行脚本,这是一种常见机制。 +通常的机制是这样的,当浏览器请求一个 web 页面时,服务器提供给浏览器该页面,并在浏览器端显示该 web 页面,浏览器需要下载该页面并运行页面内的脚本。 -这里 GZip 压缩所做的就是节省单个用户的服务时间从而提高带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在服务器上解压并执行。这改进了带宽限制。 +这里 GZip 压缩所做的就是节省单个用户的服务时间而不用增加带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在客户端上解压(LCTT 译注:原文此处有误)。这改善了带宽限制。 下面的行允许你压缩站点的源文件,但要求在你的服务器上安装 mod_deflate.c 模块。 @@ -202,7 +203,7 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 10. 处理文件类型 #### -服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们。 +服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们(LCTT 译注:这是为了避免攻击者通过上传恶意脚本,进而在服务器上执行恶意脚本进行破坏和窃取)。 要做到这点在 .htaccess 文件中有如下行。 @@ -213,7 +214,7 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 11. 为 Apache 服务器设置时区 #### -.htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 +从 .htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 由于这个原因,我们可以在网站上看到根据我们的时区显示的时间。也许服务器上其他拥有网站的人会根据他居住地点的位置设置时区。 @@ -223,9 +224,9 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 12. 如果在站点上启用缓存控制 #### -浏览器很有趣的一个功能是,已经观察到多次同时打开一个网站,和第一次打开相比之后会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 +浏览器很有趣的一个功能是,很多时间你可以看到,当多次同时打开一个网站和第一次打开相比前者会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 -但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证,例如页面会从缓存中删除然后在下次用户访问站点的时候重建。 +但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证缓存,页面可能会从缓存中删除然后在下次用户访问站点的时候重建。 下面的行为你的站点实现缓存控制。 @@ -243,7 +244,7 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 通常 .htaccess 文件中的内容会对该文件所在目录中的所有文件和子目录起作用,但是你也可以对特殊文件设置一些特殊权限,例如只禁止对某个文件的访问等等。 -要做到这点,你需要在文件中以类似方式添加 标记: +要做到这点,你需要在文件中以类似方式添加 \ 标记: Order allow, deny @@ -256,26 +257,26 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 14. 启用在 cgi-bin 目录以外运行 CGI 脚本 #### -通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以启用在你需要的目录运行 CGI 脚本,只需要在所需的目录中添加下面的行到 .htaccess 文件,如果没有改文件就创建一个,并添加下面的行: +通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以在你需要的目录运行 CGI 脚本,只需要在所需的目录中的 .htaccess 文件添加下面的行,如果没有该文件就创建一个,并添加下面的行: AddHandler cgi-script .cgi Options +ExecCGI #### 15.如何用 .htaccess 在站点上启用 SSI #### -服务器端包括顾名思义的和服务器部分相关的东西。但是什么呢?通常当我们在站点上有很多页面的时候,我们在主页面上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI(Server Size Includes) 选项允许导航菜单中显示的所有页面完全包含在主页面中。 +服务器端包括(SSI)顾名思义是和服务器部分相关的东西。这是什么呢?通常当我们在站点上有很多页面的时候,我们在主页上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI 选项允许导航菜单中显示的所有页面完全包含在主页面中。 -SSI 允许包含多个页面,好像他们包含的内容就是一个单一页面的一部分,因此任何需要的编辑都只有一个文件,从而可以节省很多磁盘空间。除了 .shtml 文件,服务器默认启用了该选项。 +SSI 允许多个页面包含同样的内容,因此只需要编辑一个文件就行,从而可以节省很多磁盘空间。对于 .shtml 文件,服务器默认启用了该选项。 如果你想要对 .html 启用该选项,你需要添加下面的行: AddHandler server-parsed .html -这之后 html 文件会导向 SSI。 +这样 html 文件中如下部分会被替换为 SSI。 - + -#### 16. 如何防止网站目录列表 #### +#### 16. 如何防止网站列出目录列表 #### 为防止任何客户端在本地机器罗列服务器上的网站目录列表,添加下面的行到你不想列出的目录的文件中。 @@ -290,16 +291,28 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 AddDefaultCharset UTF-8 DefaultLanguage en-US +#### 18. 重定向一个非 www URL 到 www URL #### + +在开始解释之前,首先看看如何启用该功能,添加下列行到 .htaccess 文件。 + + RewriteEngine ON + RewriteCond %{HTTP_HOST} ^abc\.net$ + RewriteRule (.*) http://www.abc.net/$1 [R=301,L] + +上面的行启用重写引擎,然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 + +对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 + **重写 URL 的重定向规则** -重写功能仅意味着用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 +重写功能简单的说,就是用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 **特殊符号:** 符号 含义 ^ - 字符串开头 $ - 字符串结尾 - | - 或 [a|b] – a 或 b + | - 或 [a|b] : a 或 b [a-z] - a 到 z 的任意字母 + - 之前字母的一次或多次出现 * - 之前字母的零次或多次出现 @@ -309,30 +322,19 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 常量 含义 NC - 区分大小写 - L - 最后的规则 – 停止处理更多规则 + L - 最后的规则 – 停止处理后面规则 R - 临时重定向到新 URL R=301 - 永久重定向到新 URL F - 禁止发送 403 头给用户 - P - 代理 – 获取远程内容代替部分并返回 - G - Gone, 不再存在 + P - 代理 - 获取远程内容代替部分并返回 + G - Gone, 不再存在 S=x - 跳过后面的 x 条规则 T=mime-type - 强制指定 MIME 类型 E=var:value - 设置环境变量 var 的值为 value H=handler - 设置处理器 - PT - Pass through – 如果 URL 有额外的头 - QSA - 从到替换 URL 的请求追加查询字符串 + PT - Pass through - 用于 URL 还有额外的头 + QSA - 将查询字符串追加到替换 URL -#### 18. 重定向一个非 www URL 到 www URL #### - -在开始解释之前,首先看看启用该功能需要添加到 .htaccess 文件的行。 - - RewriteEngine ON - RewriteCond %{HTTP_HOST} ^abc\.net$ - RewriteRule (.*) http://www.abc.net/$1 [R=301,L] - -上面的行启用 Rewrite Engine 然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 - -对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 #### 19. 重定向整个站点到 https #### @@ -342,7 +344,7 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} -上面的行启用 re-write engine 然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 +上面的行启用重写引擎,然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 #### 20.一个自定义重写例子 #### @@ -359,11 +361,11 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 AccessFileName htac.cess -#### 22. 如何为你的网站禁用图片链接 #### +#### 22. 如何为你的网站禁用图片盗链 #### -网站大的带宽消耗的另外一个重要问题是热链接问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 +网站带宽消耗比较大的另外一个重要问题是盗链问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 -一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接你的网站需要被加载,消耗你站点的带宽而显示其它站点的图片。为了防止出现这种情况,例如 .gif、.jpeg 图片等,下面的代码行会有所帮助: +一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接需要从你的网站加载内容,消耗你站点的带宽而为其它站点显示图片。为了防止出现这种情况,比如对于 .gif、.jpeg 图片等,下面的代码行会有所帮助: RewriteEngine ON RewriteCond %{HTTP_REFERER} !^$ @@ -374,20 +376,19 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 #### 23. 如何将用户重定向到维护页面 #### -如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有有 .jpg、.css、.gif、.js 等的页面。 +如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有访问 .jpg、.css、.gif、.js 等的页面内容。 RewriteCond %{REQUEST_URI} !^/admin/ [NC] RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] - RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html - [NC,L,U,QSA] + RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html [NC,L,U,QSA] 这些行检查请求 URL 是否包含任何例如以 ‘/admin/’ 开头的管理页面的请求,或任何到 ‘.png, .jpg, .js, .css’ 页面的请求,对于任何这样的请求,用 ‘ErrorDocs/Maintainence_Page.html’ 替换那个页面。 #### 24. 映射 IP 地址到域名 #### -名称服务器是将特定 IP 地址转换为域名的服务器。该映射也可以在 .htaccess 文件中用以下形式指定。 +名称服务器是将特定 IP 地址转换为域名的服务器。这种映射也可以在 .htaccess 文件中用以下形式指定。 - 为了将地址 L.M.N.O 映射到域名 www.hellovisit.com + # 为了将IP地址 L.M.N.O 映射到域名 www.hellovisit.com RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] @@ -414,7 +415,7 @@ via: http://www.tecmint.com/apache-htaccess-tricks/ 作者:[Gunjit Khera][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From fb966729fb2dbf81bd961bc02e680c4e3bd47fbc Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Wed, 1 Jul 2015 13:40:46 +0800 Subject: [PATCH 55/76] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0150616 Linux Humor on the Command-line.md | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/translated/share/20150616 Linux Humor on the Command-line.md b/translated/share/20150616 Linux Humor on the Command-line.md index acd2fca4e7..41745eba24 100644 --- a/translated/share/20150616 Linux Humor on the Command-line.md +++ b/translated/share/20150616 Linux Humor on the Command-line.md @@ -1,122 +1,122 @@ -LinuxеĬ +Linux命令行中的幽默 ================================================================================ -ͨǷdz۵ģǿ˿ӻ飬ʱҲܹǿijЩĹܣԼøȤ¹ҲҪǺ࣬Щӣôкܶչ¶΢Ц +桌面通常是非常养眼的,它增强了可视化的体验,有时也能够增强某些软件的功能,而且让软件变得更有趣。在命令行下工作也不需要总是很严肃,如果您想在命令行下找些乐子,那么有很多命令可以让您展露微笑。 -LinuxǸȤIJϵͳṩСͿԴߣƽϡŹֵӦáЩߵͿѡ԰Linuxӱһ߸С߰ɡ +Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的质量和可选择性帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。 ### lolcat ### ![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) -lolcatһļ׼뵽׼һcatijΪ߲ʵɫ +lolcat是一个连接文件或标准输入到标准输出(类似一般的cat)的程序,它会为输出添加七彩的颜色。 -lolcatͨtoiletfigletıӦýʹáӦΪһèͼĺꡣ +lolcat通常和其他诸如toilet或figlet等生成文本的应用结合使用。这个软件不应被误认为是一个或多个猫的图像的宏。 -lolcatMoeд +lolcat由Moe编写。 -ַ: [github.com][1] +网址: [github.com][1] ### cowsay ### ![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) -cowsayһõĿԴASCIIţͼƬڶԻʾϢcowsayPerlдġ +cowsay是一个可配置的开源软件,它用ASCII码生成奶牛的图片,并可以在对话气泡中显示消息。cowsay是用Perl写的。 -cowsayֻʾţԤͼƬѼӡ¹С򡢽ͻ𼦣Լҡѩ˺͹Ǽܡ +cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骨架。 -һcowthinkӦãԻݲͬţͬʱ˼ݡ +有一个叫cowthink的应用,与对话的气泡不同,它能在生成奶牛的同时生成思考的气泡。 -ܰ +功能包括: -- ýűøȤ -- Borgģʽ -- Ըţӣţ̰ƫִִƣ롢Ź֡ -- ţ˵ݿ޸ +- 让脚本变得更有趣 +- Borg模式 +- 可以更改奶牛看起来的样子,比如让奶牛看起来贪婪、偏执、固执、疲倦、古怪、年轻等 +- 支持xcowsay的变形 -ַ: [nog.net][2] +网址: [nog.net][2] ### doge ### ![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) -dogeһЩ޴ȤdogeĹļ򵥵ÿϢűĴӡһЩ﷨ľӣʱЩӻеĶ +doge是一个简单的每日信息脚本,它基于有些愚蠢但很有趣的doge的梗。它随机的打印一些在语法上有误的句子,有时这些句子基于您电脑中的东西。 -dogeһ2013dzеĻԪأͨһձȮͼƬͲɫɡЩֹһŵдһЩĶס +doge是一个在2013年非常流行的互联网潮流元素(梗)。这个梗通常由一幅日本柴犬的图片和彩色的文字组成。这些文字故意用一种蹩脚的语气写成了一些互联网的独白。 -- òͬɫŵӢдľ -- նеIJȮЧdz -- ϵͳݣеij򡢵ǰû$EDITOR -- װlolcatΪ׺: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done -- ׼֧: ls /usr/bin | doge ӡһЩ/usr/binµĿִļޡеĿؿԹ˴ԼƴƵʡ +- 随机的用不同的颜色和蹩脚的英语写下随机的句子 +- 终端中的柴犬效果非常棒 +- 获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR +- 如果您安装了lolcat,您可以用它作为点缀: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done +- 标准输入支持: ls /usr/bin | doge 将打印一些/usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。 -ַ: [github.com/thiderman/doge][3] +网址: [github.com/thiderman/doge][3] ### ASCIIQuarium ### ![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) -ASCIIQuariumһASCII뷽ʽˮ/󶯻ˮ׵ɡ +ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受生活在您电脑中水底的奇妙生物吧。 -ASCIIQuariumҪװPerlcursesԼTerm::Animationģ顣ʹsudo apt-get install libcurses-perlװǰߣʹsudo cpan Term::AnimationװߡҪնС +想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用sudo apt-get install libcurses-perl来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。 -ܰ +功能包括: -- ʵ -- ȤĶ㹳 -- 졢Ѽӡʹֻ +- 五彩的鱼儿 +- 有趣的动画,包括钓鱼钩 +- 还有许多的天鹅、鸭子、海豚和船只 -ַ: [www.robobunny.com][4] +网址: [www.robobunny.com][4] -### sl - ### +### sl - 蒸汽机车 ### ![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) -slһȤնӦãΪЩĴlsslûʾһ +sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用户显示一个动画。 -Ҵͨdzʣϲٶȶ׼ȷԡǷdzΣյġslΪһʵʵߣעֻϰߡǻ˿Ц +我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl作为一个实际的提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。 -ܰ +功能包括: -- ʹ -F, ڷ -- ʹ -l, ʾһС͵Ļ -- ʹ -a, ȥ +- 使用 -F, 火车在飞翔 +- 使用 -l, 显示一个小型的火车 +- 使用 -a, 看上去发生了意外 -ַ: [github.com/mtoyoda/sl][5] +网址: [github.com/mtoyoda/sl][5] ### aafire ### ![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) -aafireնʾȼյASCII档չʾһascii - aalibǿ +aafire在终端中显示燃烧的ASCII火焰。它展示了aalib库的强大能力,一个ascii艺术库显示出来。 -ַ: [aa-project.sourceforge.net/aalib][6] +网址: [aa-project.sourceforge.net/aalib][6] ### CMatrix ### ![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) -CMatrixһncursesijģ⡶ڿ͵۹һӰеĻ档һɽȹϸ15꣬ô֪ܲڿ͵۹1999ƻõӰΪ Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving Joe Pantoliano +CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道黑客帝国是1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。 -նΪ132x300¹ҿͬʽйûٶȽ첽Ĺ +它可以在终端设置为132x300的情况下工作,并且可以以同样的速率进行滚动或者以用户定义的速度进行异步的滚动。 -ܰ +功能包括: -- ޸ıɫ -- ʹôַ -- 첽 -- ʹʽĹЧ -- Ļģʽ +- 修改文本颜色 +- 使用粗体字符 +- 异步滚动 +- 使用老式的滚动效果 +- 屏幕保护程序模式 -ַ: [www.asty.org/cmatrix][7] +网址: [www.asty.org/cmatrix][7] -------------------------------------------------------------------------------- via: http://www.linuxlinks.com/article/20150614112018846/Humor.html -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[Caroline](https://github.com/carolinewuyan) - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [1]:https://github.com/busyloop/lolcat [2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml @@ -124,4 +124,4 @@ via: http://www.linuxlinks.com/article/20150614112018846/Humor.html [4]:http://www.robobunny.com/projects/asciiquarium/html/ [5]:https://github.com/mtoyoda/sl [6]:http://aa-project.sourceforge.net/aalib/ -[7]:http://www.asty.org/cmatrix/ \ No newline at end of file +[7]:http://www.asty.org/cmatrix/ From d03b615ec4fa6a91ae82f17d3ff0981b00ced177 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 1 Jul 2015 16:19:08 +0800 Subject: [PATCH 56/76] =?UTF-8?q?20150701-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... You Must Do After Installing Fedora 22.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md diff --git a/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md b/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md new file mode 100644 index 0000000000..0e293451ef --- /dev/null +++ b/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md @@ -0,0 +1,134 @@ +12 Things You Must Do After Installing Fedora 22 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/F22_alpha_wp-compressed.jpg) + +[Fedora][1] is one of my favorite Linux Distributions that I’ve ever used. Since Fedora project was started, It has always been providing new and exciting features in every release. This time the new and exciting changes have been brought with another well polished [release Fedora 22][2]. + +The release ‘Fedora 22′ comes with many new changes and features and I bet most of you (if seen the changes) would like the release and would want to install/upgrade to Fedora 22. But what to do when you install/upgrade to Fedora 22 ? This is what I am going to show in this article. I’m going to show you the 12 recommended **things to do after installing Fedora 22**. This article will help you setting up your new Fedora 22 and use the new features & changes. + +So let’s get started without wasting anymore time! + +### 1. DNF Replaces Yum In Fedora 22 ### + +Here is one thing that users turning to Fedora 22 must know is that Fedora 22 brings DNF Software Package Manager as a default package manager instead of Yum. + +You must get familiar with DNF so that you have ease to use your latest distro. + +> “With Fedora 22, we’re introducing a major change under the hood. Specifically, we’re now using [DNF and hawkey][3] to manage packages. DNF is much like the [Yum][4] software package manager….“ + +DNF is said to be faster and better dependency management. Although you can carefully see all the commands used in the this article and I’m sure they will help you out with this new software package manager. + +### 2. Update Your Fedora 22 System ### + +When you install Fedora, you have all the new & latest applications but because of the fast development of applications many applications get updates that contain new features, stability and bug fixes. So your first step should be to update your distribution as soon as possible. + + sudo dnf update + +### 3. Install Extra Repositories ### + +Fedora 22, as all other Linux distributions comes with official repositories already setup with the system but they don’t contain every package that you might need to install in future. So it is better to go for extra repository to have most of the packages available in just a minute. + +You can install RPM fusion as extra repositories to install more and more packages. There are two repositories that you can easily install – Free and Non-free. + +Go to [RPM fusion website][5] and you’ll find repositories link for different Fedora versions. First click “**RPM Fusion free for Fedora 22**“, as you can see this is free and click “**RPM Fusion nonfree for Fedora 22**” for a non-free. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/RPM-fusion-repositories-compressed.jpg) + +### 4. Install Multimedia Codecs ### + +With Fedora not all the codecs are installed, there are some missing that users need to install manually otherwise files require codecs that are not installed, those files won’t work at all. So to avoid frustration when want to play a movie and needed codec is not available, you must install multimedia codecs. + +Open the terminal and use the following command to install missing codecs – + + sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 + +### 5. Install Gnome Tweak Tool ### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/gnome-tweak-tool-compressed.jpg) + +Gnome tweak tool is a GUI utility that lets you tweak and customize Gnome desktop environment with the most ease. Here is how you can install Gnome Tweak Tool in Fedora 22. + + sudo dnf install gnome-tweak-tool + +### 6. Install Adobe Flash Player ### + +Adobe flash player is required to show so much content on the internet browsers. Youtube videos need abobe to be installed and online games lovers won’t be able to play games on browser without Adobe flash player. + +Above flash player can be installed easily by downloading setup file from official Adobe website [here][6]. Your operating system and browser will be detected automatically, select the package .rpm and click download. Then open downloaded .rpm file. It will be opened using gnome software and it can be installed just clicking on install button and then providing password when asked. + +### 7. Install VLC Media Player ### + +Fedora 22 comes with a default media player installed known as Gnome Videos but if you’re not satisfied with this media player then you can install the BOSS of media player, VLC. VLC can play almost every virtual media that exists. + +Because we’ve already install RPM fusion repositories so we have VLC in RPM fusion repositories. Simply use dnf to install VLC media player. + + sudo dnf install vlc + +### 8. Install Google Chrome ### + +As other Linux and Fedora distributions, Fedora 22 also has Mozilla Firefox installed which is arguably the best with the most plugins available. But when it comes to speed the browsing, nobody can beat Google Chrome. + + sudo dnf install google-chrome-stable + +### 9. Install Dropbox ### + +I am sure most of you are using any of the cloud storage wait wait wait… Are you also Dropbox as your online cloud storage? That’s what most of people do. You can install Dropbox app on Fedora for faster and better use of the Dropbox cloud storage. + +You can simply download .rpm file from [Dropbox Website][7] according to the distro (32-bit Or 64-bit) you’re using and simply run it to install. + +### 10. Install GIMP An Alternative To Photoshop ### + +GIMP is an image editing and designing software which is very much similar to Photoshop. Most of us (blogger) use GIMP for image editing because it’s really very handy. + +GIMP does not come installed on Fedora 22 so you need to install it manually (which is super easy). + + sudo dnf install gimp + +### 11. Install 7zip ### + +We often need to unzip or extract some compressed files. 7zip is the utility that extracts all kind of archives. It’s not installed by default in Fedora, so you have to manually install 7zip. After this you are ready to extract any type of archive. + + sudo dnf install p7zip + +### 12. Install Other Desktop Environments ### + +Fedora primarily comes with Gnome desktop environment that I like very much. But if you want enjoy Fedora with a different desktop environment, then you can easily do that. + +**For KDE Desktop Environment** + + sudo dnf install @kde-desktop + +**For XFCE Desktop Environment** + + sudo dnf install @xfce-desktop + +**For MATE Desktop Environment** + + sudo dnf install @mate-desktop + +**You can also install any other desktop environment, just use the following format –** + + sudo dnf install @DESKTOP_ENVIRONMENT-desktop + +### Conclusion ### + +That’s all for today. All the above 12 points are enough to give a nice start to Fedora 22. The environment always teaches you new things, so keep on exploring. And obviously I can not touch all the points, if I missed something that you think might be important then please comment below this article and I’ll be happy to discuss that. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/things-to-do-installing-fedora-22/ + +作者:[Mohd Sohail][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/sohail/ +[1]:https://getfedora.org/ +[2]:https://fedoraproject.org/wiki/F22_release_announcement +[3]:https://fedoraproject.org/wiki/Features/DNF +[4]:https://fedoraproject.org/wiki/Yum +[5]:http://rpmfusion.org/Configuration +[6]:https://get.adobe.com/flashplayer/ +[7]:https://www.dropbox.com/install?os=lnx \ No newline at end of file From babfa8103e60a2e44cdf25c4941191c56d059c1a Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 22:01:53 +0800 Subject: [PATCH 57/76] =?UTF-8?q?=E6=94=BE=E9=94=99=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...stall Unity 8 Desktop Preview In Ubuntu.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md diff --git a/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md new file mode 100644 index 0000000000..915e6aff8f --- /dev/null +++ b/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md @@ -0,0 +1,77 @@ +在Ubuntu中安装Unity 8桌面预览版 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) + +如果你一直关注新闻,那么就知道Ubuntu将会切换到带有[Unity 8][2]桌面的[Mir显示服务器][1]。然而,在尚未确定运行在 Mir 上的Unity 8是否会出现在[Ubuntu 15.10 Willy Werewolf][3]之前,有了一个Unity 8的预览版本可供你体验和测试。通过官方PPA,可以很容易地**安装Unity 8到Ubuntu 14.04,14.10和15.04中**。 + +到目前为止,开发者已经可以通过[ISO][4](主要途径)获得该Unity 8预览来进行测试。不过Canonical也通过[LXC容器][5]发布了它。通过该方法,你可以使用Unity 8桌面会话,让它像其它桌面环境一样运行在Mir显示服务器上。就像你[在Ubuntu中安装Mate桌面][6],然后从LightDm登录屏幕选择桌面会话一样。 + +想要试试Unity 8?让我们来看怎样安装它吧。 + +**注意: 它是一个实验性预览,可能不是所有人都可以让它正确工作的。** + +### 安装Unity 8桌面到Ubuntu ### + +下面是安装并使用Unity 8的步骤: + +#### 步骤 1: 安装Unity 8到Ubuntu 12.04和14.04 #### + +如果你正运行着Ubuntu 12.04和14.04,那么你必须使用官方PPA来安装Unity 8。使用以下命令进行安装: + + sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc + sudo apt-get update + sudo apt-get upgrade + sudo apt-get install unity8-lxc + +#### 步骤 1: 安装Unity 8到Ubuntu 14.10和15.04 #### + +如果你正运行着Ubuntu 14.10或15.04,那么Unity 8 LXC已经在源中准备好。你只需要运行以下命令: + + sudo apt-get update + sudo apt-get install unity8-lxc + +#### 步骤 2: 设置Unity 8桌面预览LXC #### + +安装Unity 8 LXC后,该对它进行设置,下面的命令就可达到目的: + + sudo unity8-lxc-setup + +它将花费一些时间来设置,所以,耐心点。它会下载ISO,然后解压缩,接着完成最后一些必要的设置来让它工作。它也会安装一个LightDM的轻度修改版本。这一切都搞定后,需要重启。 + +#### 步骤 3: 选择Unity 8 #### + +重启后,在登录屏幕,点击你的登录旁边的Ubuntu图标: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) + +你应该可以在这看到Unity 8的选项,选择它: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) + +### 卸载Unity 8 LXC ### + +如果你发现Unity 8毛病太多,或者你不喜欢它,那么你可以以相同的方式切换回默认Unity版本。此外,你也可以通过下面的命令移除Unity 8: + + sudo apt-get remove unity8-lxc + +该命令会将Unity 8选项从LightDM屏幕移除,但是配置仍然保留着。 + +以上就是你在Ubuntu中安装带有Mir的Unity 8的全部过程,试玩后请分享你关于Unity 8的想法哦! + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ + +作者:[Abhishek][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 +[2]:https://wiki.ubuntu.com/Unity8Desktop +[3]:http://itsfoss.com/ubuntu-15-10-codename/ +[4]:https://wiki.ubuntu.com/Unity8DesktopIso +[5]:https://wiki.ubuntu.com/Unity8inLXC +[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ From 30a03fbccd70b2b0ccb5828826e842d202f8f68b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 23:24:48 +0800 Subject: [PATCH 58/76] PUB:20150526 20 Useful Terminal Emulators for Linux @ZTinoZ --- ... 20 Useful Terminal Emulators for Linux.md | 145 +++++++++--------- 1 file changed, 72 insertions(+), 73 deletions(-) rename {translated/tech => published}/20150526 20 Useful Terminal Emulators for Linux.md (51%) diff --git a/translated/tech/20150526 20 Useful Terminal Emulators for Linux.md b/published/20150526 20 Useful Terminal Emulators for Linux.md similarity index 51% rename from translated/tech/20150526 20 Useful Terminal Emulators for Linux.md rename to published/20150526 20 Useful Terminal Emulators for Linux.md index 5e0d237086..318b686aca 100644 --- a/translated/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/published/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,12 +1,13 @@ -20款优秀的Linux终端仿真器 +20 款优秀的 Linux 终端仿真器 ================================================================================ -终端仿真器是一款用其它显示结构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台客户机连接上了服务器。终端仿真器允许最终用户像文本用户界面和命令行界面一样连接控制台和应用程序。 + +终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,通常指通过远程或本地方式连接的伪终端,俗称“终端”。) ![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) -20款Linux终端仿真器 +*20款Linux终端仿真器* -你能从开源世界中找到大量的终端仿真器来使用,有些拥有大量的特性而有些则反之。为了能更好地理解它们所能提供的质量,我们收集了一份不可思议的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。 +你能从开源世界中找到大量的终端仿真器,它们有些拥有大量的特性而有些则反之。为了能更好地了解它们的特性,我们收集了一份优秀的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。 ### 1. Terminator ### @@ -14,21 +15,21 @@ Terminator是一款先进且强大的终端仿真器,它支持多终端窗口 #### Terminator的特性 #### -- 自定义外形和配色方案,根据你的需要设置尺寸。 -- 使用插件来获取更多功能。 +- 自定义配置和配色方案,根据你的需要设置尺寸。 +- 使用插件来提供更多功能。 - 快捷键可以加快普通操作。 -- 可以把终端窗口分裂成几个虚拟终端并把它们重新设置成你需要的尺寸。 +- 可以把终端窗口分割成几个虚拟终端并把它们根据需要重新调整尺寸。 ![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg) -Terminator Terminal +*Terminator 终端* -- [Terminator Homepage][1] -- [Download and Installation Instructions][2] +- [Terminator 主页][1] +- [下载和安装指引][2] ### 2. Tilda ### -Tilda是一款漂亮的基于GTK+的下拉式终端,敲击一个键你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以添加你所选择的颜色来更改文本颜色和终端背景颜色。 +Tilda是一款漂亮的下拉式终端,基于GTK+,一键单击你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以用你所选择的颜色来更改文本颜色和终端背景颜色。 #### Tilda的特性 #### @@ -38,72 +39,72 @@ Tilda是一款漂亮的基于GTK+的下拉式终端,敲击一个键你就可 ![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) -Tilda Terminal +*Tilda 终端* -- [Tilda Homepage][3] +- [Tilda 主页][3] ### 3. Guake ### -Guake是一款基于python的下拉式终端,诞生于GNOME桌面环境。按一个键就能调出,再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏例如Quake,其目标显而易见。 +Guake是一款基于python的下拉式终端,诞生于GNOME桌面环境。一键调出,再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏 Quake,其主要目标是容易访问。 -Guake与Yakuaka和Tilda非常相似,不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和小片的C写成的(全局热键部分)。 +Guake与Yakuaka和Tilda非常相似,不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和C的片段写成的(全局热键部分)。 ![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg) -Guake Terminal +*Guake 终端* -- [Guake Homepage][4] +- [Guake 主页][4] ### 4. Yakuake ### -Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake再功能上非常相似。它的射击构思也是受FPS游戏的启发例如Quake。 +Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake在功能上非常相似。它的设计构思也是受FPS游戏Quake的启发。 -Yakuake主要是一款KDE应用程序,它能非常轻松地安装在KDE桌面上,但是如果你试着将它安装在GNOME桌面上,你将会安装大量的依赖包。 +Yakuake从根本上说是一款KDE应用程序,它能非常轻松地安装在KDE桌面上,但是如果你试着将它安装在GNOME桌面上,你将会安装大量的依赖包。 #### Yakuake的特性 #### -- 从屏幕顶端弹回顺畅 -- 选项卡式界面 +- 顺畅地从屏幕顶端弹出 +- 标签式界面 - 可配置的尺寸和动画速度 - 可定制 ![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg) -Yakuake Terminal +*Yakuake 终端* -- [Yakuake Homepage][5] +- [Yakuake 主页][5] ### 5. ROXTerm ### -ROXterm又是一款轻量级终端仿真器,旨在提供与GNOME终端相似的特性。它原本创造出来是为了通过不使用Gnome库从而拥有更少的占用空间和更快的启动速度并使用独立的小程序来建立配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高一层的特性。 +ROXterm是又一款轻量级终端仿真器,旨在提供与“GNOME终端”相似的特性。它原本创造出来是为了避免使用Gnome库从而更少占用空间和更快启动,并使用独立的小程序来显示配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高层次的特性。 -然而,它比GNOME终端更加具有可制定性并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 +然而,它比GNOME终端更加具有可制定性,并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 ![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) -Roxterm Terminal +*Roxterm 终端* -- [ROXTerm Homepage][6] +- [ROXTerm 主页][6] ### 6. Eterm ### -Eterm是最轻量级的一款彩色终端仿真器,是作为xterm的替代品而被设计出来。它是以一种选择自由的思想、避免臃肿、灵活性和自由在用户手中是触手可及的理念而开发出来的。 +Eterm是最轻量级的一款彩色终端仿真器,是作为xterm的替代品而被设计出来。它是以一种自由选择的理念设计的,带来了更强大、灵活、用户自主把控的终端。 ![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg) -Eterm Terminal +*Eterm 终端* -- [Eterm Homepage][7] +- [Eterm 主页][7] ### 7. Rxvt ### -代表着扩展虚拟终端的Rxvt是一款彩色终端仿真器,为那些不需要一些特性例如Tektronix 4014仿真和toolkit-style可配置性的高级用户而生的xterm的替代品。 +Rxvt 的意思是扩展虚拟终端,它是一款彩色终端仿真器,是为那些不需要一些诸如Tektronix 4014仿真和toolkit-style可配置性等特性的高级用户而生的xterm替代品。 ![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) -Rxvt Terminal +*Rxvt 终端* -- [Rxvt Homepage][8] +- [Rxvt 主页][8] ### 8. Wterm ### @@ -111,9 +112,9 @@ Wterm是另一款以rxvt项目为基础的轻量级彩色终端仿真器。它 ![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg) -wterm Terminal +*wterm 终端* -- [Wterm Homepage][9] +- [Wterm 主页][9] ### 9. LXTerminal ### @@ -121,16 +122,16 @@ LXTerminal是一款基于VTE的终端仿真器,默认运行于没有任何多 #### LXTerminal的特性 #### -- 多标签支持 -- 支持普通命令如cp, cd, dir, mkdir, mvdir +- 多标签式支持 +- 支持常规命令如cp, cd, dir, mkdir, mvdir - 隐藏菜单栏以保证足够界面空间 - 更改配色方案 ![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg) -lxterminal Terminal +*lxterminal 终端* -- [LXTerminal Homepage][10] +- [LXTerminal 主页][10] ### 10. Konsole ### @@ -147,85 +148,83 @@ Konsole是另一款强大的基于KDE的免费终端仿真器,最初由Lars Do - 终端中的活动通知警告 - 增量搜索 - 支持Dolphin文件管理器 -- 普通文本和HTML格式输出出口 +- 支持导出显示为普通文本和HTML格式 ![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg) -Konsole Terminal +*Konsole 终端* -- [Konsole Homepage][11] +- [Konsole 主页][11] ### 11. TermKit ### -TermKit是一款漂亮简洁的终端,其目标是用在Google Chrome和Chromium中广泛被使用的WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图。TermKit起初是为Mac和Windows设计的,但是由于TermKit被Floby给fork并做了修改,现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。 +TermKit是一款漂亮简洁的终端,其目标是用WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图(LCTT 译注:这个描述比较模糊,请参考截图,或安装一个体验下),WebKit渲染引擎在Google Chrome和Chromium中广泛使用。TermKit起初是为Mac和Windows设计的,但是由于Floby对TermKit 构建了分支,现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。 ![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg) -TermKit Terminal +*TermKit 终端* -- [TermKit Homepage][12] +- [TermKit 主页][12] ### 12. st ### -st是一款简单的X Window终端实现接口。 +st是一款简单的X Window终端。 ![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png) -st terminal +*st 终端* -- [st Homepage][13] +- [st 主页][13] -### 13. Gnome-Terminal ### +### 13. Gnome 终端 ### -GNOME终端是一款在GNOME桌面环境下的嵌入式终端仿真器,由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下的同时使用一个真实的Linux shell来运行命令。GNOME终端是模拟的xterm终端仿真器并带来了一些相似的特性。 +GNOME终端是一款在GNOME桌面环境下自带的终端仿真器,由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下可以使用一个真实的Linux shell来运行命令。GNOME终端是模仿了xterm终端仿真器,并有一些相似的特性。 -Gnome终端支持多用户,用户可以为他们的账户创建多个用户,每个用户能自定义配置选项,如字体、颜色、背景图片、行为习惯等等并能分别给它们取名。它也支持鼠标事件、url探测、多标签等。 +Gnome终端支持多配置文件,用户可以为他们的账户创建多个配置文件,每个配置文件能自定义配置选项,如字体、颜色、背景图片、行为习惯等等,并能分别给每个配置文件取名。它也支持鼠标事件、url探测、多标签等。 ![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg) -Gnome Terminal +*Gnome 终端* -- [Gnome Terminal][14] +- [Gnome 终端][14] ### 14. Final Term ### -Final Term是一款漂亮的开源终端仿真器,在这一个界面里蕴藏着一些令人激动的功能和特性。虽然它仍然有待改进,但是它提供了一些重要的特性比如Semantic文本菜单、智能的命令行实现、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性,点开来看看吧。 +Final Term是一款漂亮的开源终端仿真器,在这一个单独的界面里蕴藏着一些令人激动的特性和方便的功能。虽然它仍然有待改进,但是它提供了一些重要的特性比如“语义”文本菜单、智能的命令行补全、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性,点开来看看吧。 ![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif) -FinalTerm Terminal +*FinalTerm 终端* - [Final Term][15] ### 15. Terminology ### -Terminology是一款新的现代化终端仿真器,为Enlightenment桌面创造,但也能用于其它桌面环境。它有一些独一无二的棒极了的特性,这是其它终端仿真器所不具备的。 +Terminology是又一款新的现代化终端仿真器,为Enlightenment桌面创造,但也能用于其它桌面环境。它有一些独一无二的棒极了的特性,这是其它终端仿真器所不具备的。 抛开这些特性,terminology甚至还提供了你无法从其它仿真器看到的东西,比如图像、视频和文档的缩略图预览,它允许你从Terminology直接就能看到那些文件。 -你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰,但足以让你了解Terminology了)。 - - +你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰,但足以让你了解Terminology了): https://www.youtube.com/ibPziLRGvkg - [Terminology][16] -### 16. Xfce4 terminal ### +### 16. Xfce4 终端 ### -Xfce终端是一款轻量级的现代化终端仿真器,它简单易用,为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性比如搜索会话、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。 +Xfce终端是一款轻量级的现代化终端仿真器,它简单易用,为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性,比如搜索对话框、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。 ![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg) -Xfce Terminal +*Xfce 终端* -- [Xfce4 Terminal][17] +- [Xfce4 终端][17] ### 17. xterm ### -xterm应用程序是一款标准的在X Window系统上的终端仿真器。它保持了DEC VT102和Tektronix 4014,让应用能直接使用X Window系统。 +xterm应用是一款标准的在X Window系统上的终端仿真器。它保持了对DEC VT102和Tektronix 4014终端的兼容,以支持那些不能直接使用窗口系统的应用。 ![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) -xterm Terminal +*xterm 终端* - [xterm][18] @@ -233,36 +232,36 @@ xterm Terminal LilyTerm是一款基于libvte的开源终端仿真器,这款不太出名的仿真器追求的是快速和轻量级。LilyTerm也包括一些关键特性: -- 支持标签移动、着色以及标签重新排序 +- 支持标签、彩色以及标签重新排序 - 通过快捷键管理标签 - 支持背景透明化和饱和度调整 -- 支持为特定用户创建配置文件 +- 支持用户创建配置文件 - 若干个自定义选项 - 广泛支持UTF-8 ![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg) -Lilyterm Terminal +*Lilyterm 终端* - [LilyTerm][19] ### 19. Sakura ### -Sakura是另一款不知名的Unix风格终端仿真器,按照命令行模式和基于文本的终端程序开发。Sakura基于GTK和livte,自身特性不多,不过还是有一些自定义选项比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。 +Sakura是另一款不知名的Unix风格终端仿真器,是为命令行模式和基于文本的终端程序开发的。Sakura基于GTK和livte,自身特性不多,不过还是有一些自定义选项,比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。 ![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg) -Sakura Terminal +*Sakura 终端* - [Sakura][20] ### 20. rxvt-unicode ### -rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器,支持xft和unicode,由Marc Lehmann开发。它有许多显著特性比如支持Unicode上的国际语言,能显示多种字体类型并支持Perl扩展。 +rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器,支持xft和unicode,由Marc Lehmann开发。它有许多显著特性,比如通过Unicode支持国际化语言,能显示多种字体类型并支持Perl扩展。 ![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png) -rxvt unicode +*rxvt unicode* - [rxvt-unicode][21] @@ -274,7 +273,7 @@ via: http://www.tecmint.com/linux-terminal-emulators/ 作者:[Ravi Saive][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 01806e142dcbd3681d0dad3f60ed957f348e1e48 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 1 Jul 2015 23:53:30 +0800 Subject: [PATCH 59/76] =?UTF-8?q?[Delete]=20sources/tech/20150701=2012=20T?= =?UTF-8?q?hings=20You=20Must=20Do=20After=20Installing=20Fedora=2022.md?= =?UTF-8?q?=20=E5=87=A0=E4=B9=8E=E5=92=8C=20published/2015/06/20150528=20T?= =?UTF-8?q?hings=20To=20Do=20After=20Installing=20Fedora=2022=20=E5=AE=8C?= =?UTF-8?q?=E5=85=A8=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... You Must Do After Installing Fedora 22.md | 134 ------------------ 1 file changed, 134 deletions(-) delete mode 100644 sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md diff --git a/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md b/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md deleted file mode 100644 index 0e293451ef..0000000000 --- a/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md +++ /dev/null @@ -1,134 +0,0 @@ -12 Things You Must Do After Installing Fedora 22 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/F22_alpha_wp-compressed.jpg) - -[Fedora][1] is one of my favorite Linux Distributions that I’ve ever used. Since Fedora project was started, It has always been providing new and exciting features in every release. This time the new and exciting changes have been brought with another well polished [release Fedora 22][2]. - -The release ‘Fedora 22′ comes with many new changes and features and I bet most of you (if seen the changes) would like the release and would want to install/upgrade to Fedora 22. But what to do when you install/upgrade to Fedora 22 ? This is what I am going to show in this article. I’m going to show you the 12 recommended **things to do after installing Fedora 22**. This article will help you setting up your new Fedora 22 and use the new features & changes. - -So let’s get started without wasting anymore time! - -### 1. DNF Replaces Yum In Fedora 22 ### - -Here is one thing that users turning to Fedora 22 must know is that Fedora 22 brings DNF Software Package Manager as a default package manager instead of Yum. - -You must get familiar with DNF so that you have ease to use your latest distro. - -> “With Fedora 22, we’re introducing a major change under the hood. Specifically, we’re now using [DNF and hawkey][3] to manage packages. DNF is much like the [Yum][4] software package manager….“ - -DNF is said to be faster and better dependency management. Although you can carefully see all the commands used in the this article and I’m sure they will help you out with this new software package manager. - -### 2. Update Your Fedora 22 System ### - -When you install Fedora, you have all the new & latest applications but because of the fast development of applications many applications get updates that contain new features, stability and bug fixes. So your first step should be to update your distribution as soon as possible. - - sudo dnf update - -### 3. Install Extra Repositories ### - -Fedora 22, as all other Linux distributions comes with official repositories already setup with the system but they don’t contain every package that you might need to install in future. So it is better to go for extra repository to have most of the packages available in just a minute. - -You can install RPM fusion as extra repositories to install more and more packages. There are two repositories that you can easily install – Free and Non-free. - -Go to [RPM fusion website][5] and you’ll find repositories link for different Fedora versions. First click “**RPM Fusion free for Fedora 22**“, as you can see this is free and click “**RPM Fusion nonfree for Fedora 22**” for a non-free. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/RPM-fusion-repositories-compressed.jpg) - -### 4. Install Multimedia Codecs ### - -With Fedora not all the codecs are installed, there are some missing that users need to install manually otherwise files require codecs that are not installed, those files won’t work at all. So to avoid frustration when want to play a movie and needed codec is not available, you must install multimedia codecs. - -Open the terminal and use the following command to install missing codecs – - - sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 - -### 5. Install Gnome Tweak Tool ### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/gnome-tweak-tool-compressed.jpg) - -Gnome tweak tool is a GUI utility that lets you tweak and customize Gnome desktop environment with the most ease. Here is how you can install Gnome Tweak Tool in Fedora 22. - - sudo dnf install gnome-tweak-tool - -### 6. Install Adobe Flash Player ### - -Adobe flash player is required to show so much content on the internet browsers. Youtube videos need abobe to be installed and online games lovers won’t be able to play games on browser without Adobe flash player. - -Above flash player can be installed easily by downloading setup file from official Adobe website [here][6]. Your operating system and browser will be detected automatically, select the package .rpm and click download. Then open downloaded .rpm file. It will be opened using gnome software and it can be installed just clicking on install button and then providing password when asked. - -### 7. Install VLC Media Player ### - -Fedora 22 comes with a default media player installed known as Gnome Videos but if you’re not satisfied with this media player then you can install the BOSS of media player, VLC. VLC can play almost every virtual media that exists. - -Because we’ve already install RPM fusion repositories so we have VLC in RPM fusion repositories. Simply use dnf to install VLC media player. - - sudo dnf install vlc - -### 8. Install Google Chrome ### - -As other Linux and Fedora distributions, Fedora 22 also has Mozilla Firefox installed which is arguably the best with the most plugins available. But when it comes to speed the browsing, nobody can beat Google Chrome. - - sudo dnf install google-chrome-stable - -### 9. Install Dropbox ### - -I am sure most of you are using any of the cloud storage wait wait wait… Are you also Dropbox as your online cloud storage? That’s what most of people do. You can install Dropbox app on Fedora for faster and better use of the Dropbox cloud storage. - -You can simply download .rpm file from [Dropbox Website][7] according to the distro (32-bit Or 64-bit) you’re using and simply run it to install. - -### 10. Install GIMP An Alternative To Photoshop ### - -GIMP is an image editing and designing software which is very much similar to Photoshop. Most of us (blogger) use GIMP for image editing because it’s really very handy. - -GIMP does not come installed on Fedora 22 so you need to install it manually (which is super easy). - - sudo dnf install gimp - -### 11. Install 7zip ### - -We often need to unzip or extract some compressed files. 7zip is the utility that extracts all kind of archives. It’s not installed by default in Fedora, so you have to manually install 7zip. After this you are ready to extract any type of archive. - - sudo dnf install p7zip - -### 12. Install Other Desktop Environments ### - -Fedora primarily comes with Gnome desktop environment that I like very much. But if you want enjoy Fedora with a different desktop environment, then you can easily do that. - -**For KDE Desktop Environment** - - sudo dnf install @kde-desktop - -**For XFCE Desktop Environment** - - sudo dnf install @xfce-desktop - -**For MATE Desktop Environment** - - sudo dnf install @mate-desktop - -**You can also install any other desktop environment, just use the following format –** - - sudo dnf install @DESKTOP_ENVIRONMENT-desktop - -### Conclusion ### - -That’s all for today. All the above 12 points are enough to give a nice start to Fedora 22. The environment always teaches you new things, so keep on exploring. And obviously I can not touch all the points, if I missed something that you think might be important then please comment below this article and I’ll be happy to discuss that. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/things-to-do-installing-fedora-22/ - -作者:[Mohd Sohail][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/sohail/ -[1]:https://getfedora.org/ -[2]:https://fedoraproject.org/wiki/F22_release_announcement -[3]:https://fedoraproject.org/wiki/Features/DNF -[4]:https://fedoraproject.org/wiki/Yum -[5]:http://rpmfusion.org/Configuration -[6]:https://get.adobe.com/flashplayer/ -[7]:https://www.dropbox.com/install?os=lnx \ No newline at end of file From 116c934d11e1ca1cb8013a60acee9c2c1f2dc9e6 Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Wed, 1 Jul 2015 23:59:53 +0800 Subject: [PATCH 60/76] Update 20150407 10 Truly Amusing Easter Eggs in Linux.md --- sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md index 3ab7f47b79..f8322fb1af 100644 --- a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -1,3 +1,4 @@ +Translating by H-mudcup 10 Truly Amusing Easter Eggs in Linux ================================================================================ ![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) From b32e0d6905653e72074d8b8278454680a8719b75 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 3 Jul 2015 15:11:03 +0800 Subject: [PATCH 61/76] finish translation --- ...Introduction To FreeBSD For Linux Users.md | 100 ------------------ ...Introduction To FreeBSD For Linux Users.md | 98 +++++++++++++++++ 2 files changed, 98 insertions(+), 100 deletions(-) delete mode 100644 sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md create mode 100644 translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md diff --git a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md deleted file mode 100644 index 9e73930755..0000000000 --- a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md +++ /dev/null @@ -1,100 +0,0 @@ -translating by wwy-hust - -Comparative Introduction To FreeBSD For Linux Users -================================================================================ -![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) - -### Introduction ### - -BSD was originally derived from UNIX and currently, there are various number of Unix-like operating systems descended from the BSD. While, FreeBSD is the most widely used open source Berkeley Software Distribution (BSD distribution). As it is implicitly said it is a free and open source Unix-like-operating system and a public server platform. FreeBSD source code is generally released under a permissive BSD license. It is true that it has similarities with Linux but we cannot deny that they differs in other points. - -The remainder of this article is organized as follows: the description of FreeBSD will be treated in our first section. The similarities between FreeBSD and Linux will be briefly described in the second section. While their differences will be discussed in the third section. And a comparison of their features will be summarized in our last section. - -### FreeBSD description ### - -#### History #### - -- The first version of FreeBSD was released in 1993, while its first CD-ROM distributed was FreeBSD1.0 on December 1993. Then, FreeBSD 2.1.0 was released in 1995 which gained the satisfaction of all users. Actually, many IT companies use FreeBSD and are satisfied where we can list those companies: IBM, Nokia, NetApp and Juniper Networks. - -#### License #### - -- Concerning its license, FreeBSD is released under various source licenses. Its newest code called Kernel is released under the two-clause BSD license, offering the possibility to use and redistribute FreeBSD with absolute freedom. Other codes are released three- and four-clause BSD license and some others are released under GPL and CDDL. - -#### Users #### - -- One of the important feature of FreeBSD, we can mention the various categories of its users. In fact, it is possible to use FreeBSD as a mail server, web server, FTP server and as a router due to the significant set of server-related software accompanied with it. Furthermore, ARM, PowerPC and MIPS are supported by FreeBSD so it is possible to use x86 and s86-64. - -### FreeBSD and Linux similarities ### - -FreeBSD and Linux are two free and open source systems. Indeed, their users can easily check and modify the source code with an absolute freedom. To add, FreeBSD and Linux, both of them are derived from Unix.-like because they have a kernel, internals, and libraries programmed using algorithms derived from historic AT&T Unix. While FreeBSD’s roots are similar to Unix systems, Linux is released as a free Unix-like option. Various tools and applications can be found either in FreeBSD or in Linux in fact, they almost share the same functionality. - -Furthermore, FreeBSD can run big number of Linux applications. It has a Linux compatibility layer that can be installed. This Linux compatibility layer can be installed while compiling FreeBSD with AAC Compact Linux or downloading compiled FreeBSD systems with a Linux compatibility program such as: aac_linux.ko. Which is not the same case with Linux, Linux cannot run FreeBSD software. - -At the end, we can mention that both of them have the same goal but have also some differences which we will outline in the next section. - -### FreeBSD and Linux differences ### - -Currently, no criteria of choice between FreeBSD and Linux is clear for most users. Since, they share almost the same applications. Those two operating systems are as mentioned previously UNIX-like. - -In this section, we will list the most important differences of those two systems. - -#### License #### - -- The first difference point between those two compared systems consist on their license. To start by Linux license, it is released under the GPL license which offers the possibility to view, distribute and change the source code with an absolute freedom. The GPL license helps users to prevent the distribution of binary-only source. Which is the case with FreeBSD, which is licensed under BSD license. This kind of license is more restrictive and easily allows the distribution of binary-only source. The BSD license is more permissive that the GPL since no derivative work is required to maintain the licensing terms. Means any user can use, distribute and modify the code without need to have the previous version of code before changing made. They only need to have the original license of BSD. -- Depending on the needs of each user, a selection can be made between those two types of license. Starting by BSD license which is more preferred by many users due to its special features. In fact, this license gives the possibility to sell each software licensed under it and retain the source code. Passing now to the GPL license, which requires some care of each user has a software released under it. -- To be able to choose between those two software, it is required to understand the licensing of both of them to more understand the methodology used in their development, to distinguish between their features and know which one will fit user’s need. - -#### Control #### - -- Since FreeBSD and Linux are released under two different type of license, the Linux Torvalds control the Linux kernel which is not the same case with FreeBSD which is not controlled. Personally, I prefer to use FreeBSD instead of Linux since it is an absolute free software, no control permission exists. But it is not enough there is other differences between Linux and FreeBSD, help you to choose between both of them. As an advice don’t choose one of them, follow us and then give us your choice. - -#### Operating system #### - -- Linux concentrates only on the kernel system which is not the case with FreeBSD while the whole operating system is maintained. The kernel and a set of software, some of them are developed by the FreeBSD team, are maintained as one unit. Indeed, the FreeBSD developers have the possibility to manage the essential operating systems remotely and efficiently. -- With Linux, there is some difficulties while managing a system. Since, the different components maintained will be from different sources so the Linux developers need to assemble them into groups having the same functionality. -- FreeBSD and Linux both of them give the possibility to have a big set of optional software and distributions but they differ on the way they are managed. With FreeBSD, they are managed together while with Linux they will be maintained separately. - -#### Hardware support #### - -- Concerning the hardware support, Linux is better than FreeBSD. It doesn’t mean that FreeBSD hasn’t the capability to support hardware as Linux. They differ just on the manner. It depends on your need as usual. So if you are searching for the newest solution, the FreeBSD will fit your needs but if you are looking for greatest graphs, it is better to use Linux. - -#### FreeBSD origin Vs Linux origin #### - -- The origin of each system is also another point of distinction between both of them. As I said previously Linux is an alternative of the operating system Unix, written by Linus Trovalds and assisted by a special group of hackers across the Net. Linux has all the needed features in a modern Unix, such as virtual memory, shared libraries, demand loading, proper memory management and many others. It is released under the General Public License. -- FreeBSD also shared many important features of its Unix heritage. FreeBSD as a type of the Berkeley Software Distribution, the distribution of the Unix developed at the University of California. The most important reason under developing BSD is to replace the AT&T operating system by an open source alternative giving the user the ability to use BSD without carry about the obtaining of the AT&T license. -- The problem of licensing, is the most important worry of developers. They try to offer the maximum open source clone of Unix. Which influences the choice of users regarding the degree of open source of each system as FreeBSD gives more freedom than Linux regarding its use since it is released under BSD license. - -#### Supported Package #### - -- From the user’s perspective, another difference between our two compared systems, is their availability and support of the packaged software and source installed software. The Linux distributions provide just the pre-compiled binary packages which is not the same case with FreeBSD, which has the pre-built packages and the build system for the compilation and installation through their available open source. Due to its ports, FreeBSD gives you the possibility to choose between the default making of pre-compiled packages and your ability to customize your software while it is compiled. -- Those ports enable you to build all the software available with FreeBSD. Furthermore, there is an hierarchy of organization all of them due to the directories /usr/ports where you can find the location of the source files and some documentation about the way to use FreeBSD correctly. -- The ports as mentioned give the possibility produce the packages version of software. Instead of having just the pre-compiled packages using Linux, FreeBSD gives you the possibility to have the source-built and the pre-packages software. You can manage your system using the two installation methods. - -#### FreeBSD Vs Linux common Tools #### - -- A huge number of common tools are available while using FreeBSD and are fully own made by the FreeBSD team. In contrast, the Linux tools are from the GNU that is why there is some control during their usage. -- The fact that FreeBSD is released under BSD license is so beneficial and useful. Since, you have the ability to maintain the core operating system, control the development of these applications. Same of those tools are similar to BSD and Unix tools from where they were derived which is not the same case with GNU suite, which want to just make them less backwards compatible. - -#### The Standard Shell #### - -- The tcsh shell is used by default with FreeBSD. Which is an evaluated version fo csh. Since, the FreeBSD is released under the BSD license, it is not recommended to use the bash shell which is a GNU component. The only difference between bash and tcsh shell consists on the scripting feature which can’t be made by tcsh. Indeed, the sh shell is more recommended for the FreeBSD use since it is more reliable and prevents some issues of scripting can be occurred using the tcsh or csh shell. - -#### A More Stratified Filesystem #### - -- As it was mentioned previously, base operating system and optional components can be easily distinguished using the FreeBSD system. Which causes some specification of their organization. In Linux, /bin, /sbin, /usr/bin, or usr/sbin are the directories for executable systems. With FreeBSD it is not the case. There are some additional specifications concerning their organization. The base system are putted in one of the directories mentioned above while the ports and packages are placed in /usr/local/bin or /usr/local/sbin. This methodology helps to recognize and distinguish between an application considered as a base system or a port. - -### Conclusion ### - -FreeBSD and Linux those two free and open source systems, share various similarities but they also differ in several points. The list giving above isn’t given to say that one of them is better than the other. In fact, FreeBSD and Linux, each one of them has its features and specifications that make it a special regarding the other. And you what is your opinion? Have you already used one on them or both? If yes what is your feedback and if no after reading our description what do you think? Sound off and give us and the fellow readers your opinion. - --------------------------------------------------------------------------------- - -via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ - -作者:[anismaj][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://www.unixmen.com/author/anis/ diff --git a/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md new file mode 100644 index 0000000000..76368e1033 --- /dev/null +++ b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -0,0 +1,98 @@ +ԱȽϵķʽLinuxûFreeBSD +================================================================================ +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) + +### ### + +BSDUNIX̳жĿǰUnixϵͳǻBSDġFreeBSDʹ㷺ĿԴа棨BSDа棩˼һһѿԴUnixϵͳǹƽ̨FreeBSDԴͨԿɵBSD֤LinuxкܶƵĵطǵóںܶ෽вͬ + +ĵಿ֯£FreeBSDڵһ֣FreeBSDLinuxƵڵڶ֣ǵڵۣǹܵۺܽһڡ + +### FreeBSD ### + +#### ʷ #### + +- FreeBSDĵһ汾1993꣬ĵһCD-ROMFreeBSD1.0Ҳ1993ꡣFreeBSD 2.1.01995귢һûʵIT˾ʹFreeBSDҺ⣬ǿгеһЩIBMNokiaNetAppJuniper Network + +#### ֤ #### + +- ֤FreeBSDԶֿԴ֤зµΪKernelĴBSD֤˷ʹú·FreeBSDľɡĴBSD֤зЩGPLCDDL֤ġ + +#### û #### + +- FreeBSDҪص֮һûʵϣFreeBSDΪʼWeb ServerFTPԼ·ȣֻҪзصɡFreeBSD֧ARMPowerPCMIPSx86x86-64ܹ + +### FreeBSDLinuxƴ ### + +FreeBSDLinuxѿԴʵϣǵûԺ׵ļ鲢޸Դ룬ûӵоԵɡңFreeBSDLinuxUnixϵͳǵںˡڲʹôʷϵAT&T Unix̳е㷨FreeBSDӸϸUnixϵͳLinuxΪѵUnixϵͳġ๤ӦöFreeBSDLinuxҵʵϣǼͬĹܡ + +⣬FreeBSDܹдLinuxӦá԰װһLinuxļݲ㣬ݲڱFreeBSDʱAAC Compact LinuxõͨѱLinuxݲFreeBSDϵͳлݳaac_linux.koͬFreeBSDǣLinux޷FreeBSD + +ע⵽ȻͬĿ꣬߻һЩ֮ͬһг + +### FreeBSDLinux ### + +Ŀǰڴû˵ûһѡFreeBSDLinux׼ΪźܶͬӦóΪǶUnixϵͳ + +һ£ǽгϵͳһЩҪIJ֮ͬ + +#### ֤ #### + +- ϵͳǵ֤LinuxGPL֤УΪûṩĶк޸ԴɣGPL֤ûжơFreeBSDBSD֤BSD֤GPLݣΪҪԸ֤ζκûܹʹá޸Ĵ룬ҲҪά֮ǰ֤ +- ֤ѡһ֡BSD֤ûʵϣ֤ʹûڱ֤ԴķԵͬʱԸ֤˵˵GPLҪÿʹԸ֤ûע⡣ +- Բ֤ͬѡҪ˽ǸԵ֤ԼǿеķۣӶ˽ԵѡʺԼġ + +#### #### + +- FreeBSDLinuxԲ֤ͬģLinus TorvaldsLinuxںˣFreeBSDȴLinuxͬδơҸ˸ʹFreeBSDLinuxΪFreeBSDǾɵûκοɵĴڡLinuxFreeBSDIJ֮ͬҽȲѡ񣬵ȶ걾ĺѡ + +#### ϵͳ #### + +- Linux۽ںϵͳFreeBSDͬFreeBSDϵͳάšFreeBSDں˺һFreeBSDŶӿΪһάʵϣFreeBSDԱܹԶҸЧĹIJϵͳ +- Linux棬ڹϵͳһЩѡڲͬɲͬԴάLinuxҪǻ㼯ܴﵽͬĹܡ +- FreeBSDLinuxûĿѡͷа棬ǹķʽͬFreeBSDͳһĹʽLinuxҪֱά + +#### Ӳ֧ #### + +- ˵Ӳ֧֣LinuxFreeBSDĸáⲻζFreeBSDûLinux֧ӲֻڹķʽͬͨˣѰµĽFreeBSDӦѰһĻʹLinux + +#### ԭFreeBSD Vs ԭLinux #### + +- ߵԭϵͳв֮ͬǰ˵ģLinuxһUnixϵͳLinux Torvaldsдϵ༫һЭʵֵġLinuxһִϵͳҪȫܣڴ桢⡢̬ءڴȡGPL֤ +- FreeBSDҲ̳UnixҪԡFreeBSDΪڼݴѧBSDһַа档BSDҪԭһԴϵͳAT&TϵͳӶûAT&T֤ʹõ +- ֤ǿĵ⡣ͼṩһ󻯿¡UnixĿԴϵͳӰûѡFreeBSDLinuxʹBSD֤зɡ + +#### ֵ֧ #### + +- ûĽǶһ߲ͬĵطԼԴ밲װĿԺ֧֡LinuxֻṩԤĶưFreeBSDͬṩԤİһṩԴͰװĹϵͳֲFreeBSDѡʹԤĬϣڱʱ +- ЩѡFreeBSDеңǵĹDzλģ/usr/portsҵԴļĵַԼһЩȷʹFreeBSDĵ +- ЩᵽĿѡ˲ͬ汾ĿԡFreeBSDͨԴ빹ԼԤLinuxһֻԤʹְװʽϵͳ + +#### FreeBSD Linux ù߱Ƚ #### + +- дijùFreeBSDϿãȤFreeBSDŶӵС෴ģLinuxGNUΪʲôʹһЩơ +- ʵFreeBSDõBSD֤dzáˣάIJϵͳЩӦóĿһЩǵ - BSDUnixĹߣͬGNU׼GNU׼ֻСݡ + +#### ׼ Shell #### + +- FreeBSDĬʹtcshcsh棬FreeBSDBSD֤У˲ʹGNU bash shellbashtcshtcshĽűܡʵϣǸƼFreeBSDʹsh shellΪӿɿԱһЩʹtcshcshʱֵĽű⡣ + +#### һӲλļϵͳ #### + +- ֮ǰᵽһʹFreeBSDʱϵͳԼѡԱ׵⵼һЩǵı׼Linux£/bin/sbin/usr/bin/usr/sbinǴſִļĿ¼FreeBSDͬһЩӵĶ֯Ĺ淶ϵͳ/usr/local/bin/usr/local/sbinĿ¼¡ַ԰ֻϵͳͿѡ + +### ### + +FreeBSDLinuxҿԴϵͳƵҲвͬ㡣гݲ˵ĸϵͳһáʵϣFreeBSDLinuxԼصͼʹϵͳôʲôأѾʹеijϵͳôΪǵĻķǷĻڶǵôԴĹ۵㡣 + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ + +ߣ[anismaj][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file From c6918c7ec2257968387ddfa8009e39379d65d116 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 3 Jul 2015 22:53:39 +0800 Subject: [PATCH 62/76] translating by martin --- sources/tech/20150401 ZMap Documentation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150401 ZMap Documentation.md b/sources/tech/20150401 ZMap Documentation.md index d2aa316c1f..b773fb4aaf 100644 --- a/sources/tech/20150401 ZMap Documentation.md +++ b/sources/tech/20150401 ZMap Documentation.md @@ -1,3 +1,5 @@ +translating... + ZMap Documentation ================================================================================ 1. Getting Started with ZMap From f1d7823522395edc01e2a17ac1dda6eafcc9b253 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 15:57:21 +0800 Subject: [PATCH 63/76] PUB:20150527 How to edit your documents collaboratively on Linux @ictlyh --- ...your documents collaboratively on Linux.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150527 How to edit your documents collaboratively on Linux.md (75%) diff --git a/translated/tech/20150527 How to edit your documents collaboratively on Linux.md b/published/20150527 How to edit your documents collaboratively on Linux.md similarity index 75% rename from translated/tech/20150527 How to edit your documents collaboratively on Linux.md rename to published/20150527 How to edit your documents collaboratively on Linux.md index 8fc469bf24..a49cb0ef13 100644 --- a/translated/tech/20150527 How to edit your documents collaboratively on Linux.md +++ b/published/20150527 How to edit your documents collaboratively on Linux.md @@ -1,12 +1,12 @@ -如何在 Linux 上协同编辑文档 +如何在 Linux 上 使用 ONLYOFFICE 协同编辑文档 ================================================================================ -> “多年前由一些高度紧张、强迫性助理开发的 Bulletin,只是共享文件夹中只有 Emily 和我可以访问的 Word 文档。同一时间我们只有一个人可以打开它并添加消息、想法,或者提问项目列表。然后我们再打印出更新版本并放到我桌子架上的剪贴板,并在退出时删除旧版本。”(Lauren Weisberger 称之为“穿 Prada 的女魔头”) +> “多年前由一些紧张兮兮的、带有强迫症的助理开发的 Bulletin,只是一个放在共享文件夹中只有 Emily 和我可以访问的 Word 文档而已。同一时间我们只有一个人可以打开它并添加消息、想法,或者给条目列表上增加问题。然后我们再打印出更新后的版本并放到我桌子架上的剪贴板,并在完成时删除旧的内容。”(——《穿普拉达的女王》,劳伦·魏丝伯格著 ) -直到今天仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 +直到今天人们仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关系管理工具的开源在线办公套件。 -使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。直接在他们的文档上留下评论并用集成的聊天工具和其他人沟通。最后,保存文档为 PDF 文件用于之后的打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 +使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。可以直接在他们的文档上留下评论并用其中集成的聊天工具和其他人沟通。最后,可以保存文档为 PDF 文件并打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 在这篇教程中,我会介绍如何使用 [免费版 ONLYOFFICE][1] 部署你自己的在线办公套件,免费版 ONLYOFFICE 是 ONLYOFFICE 在 GNU AGPL v3 协议下发布的自托管版本。 @@ -29,9 +29,9 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 也可以在 Linux 服务器上单独安装 [ONLYOFFICE 在线编辑器][6],并通过提供的 API 轻松地集成到你的站点或云应用。 -### 运行自托管在线 Office ### +### 运行自行托管的在线 Office ### -要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP-Address/)。会打开欢迎页面: +要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP地址/)。会打开欢迎页面: ![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) @@ -63,11 +63,11 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 邀请的人只需要根据提供的链接就可以开始协同编辑文档。 -会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 +它会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 ![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) -只要你的其中一个合作者保存了他的/她的更改,你会看到在顶部工具栏左上角出现了一个注意标签,表示这里有更新。 +只要你的其中一个协作者保存了他/她的更改,你会看到在顶部工具栏左上角出现了一个提示标签,表示这里有更新。 ![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) @@ -75,13 +75,13 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 ![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) -#### STEP 4. 和合作者互动 #### +#### STEP 4. 和协作者互动 #### 要写评论,用鼠标选择一个文本段落,右击并从上下文菜单中选择 **Add comment** 选项。 ![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) -要和合作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 +要和协作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 ![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) @@ -97,7 +97,7 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 #### Tip #2. 在 iPad 上编辑文档 #### -为了在任意时刻添加更改到文档,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 +要随时随地对文件进行修改,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 为了评估 ONLYOFFICE 在线编辑器的功能,你可以使用供个人使用的 [云版本][8]。 @@ -107,7 +107,7 @@ via: http://xmodulo.com/edit-documents-collaboratively-linux.html 作者:[Tatiana Kochedykova][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 24bbe452a5332b66aca98d05661796229b6f80ba Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 16:34:10 +0800 Subject: [PATCH 64/76] PUB:20150601 How to monitor common services with Nagios @geekpi --- ... to monitor common services with Nagios.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150601 How to monitor common services with Nagios.md (70%) diff --git a/translated/tech/20150601 How to monitor common services with Nagios.md b/published/20150601 How to monitor common services with Nagios.md similarity index 70% rename from translated/tech/20150601 How to monitor common services with Nagios.md rename to published/20150601 How to monitor common services with Nagios.md index 2898a57ad0..4f6523f0ce 100644 --- a/translated/tech/20150601 How to monitor common services with Nagios.md +++ b/published/20150601 How to monitor common services with Nagios.md @@ -1,12 +1,12 @@ -如何用Nagios监控服务 +如何用 Nagios 监控通用服务 ================================================================================ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检查通用服务如MySql、Apache、DNS等等。 -为了保证本篇集中在系统监控,我们不会配置hostgroup或者模板,它们已经在 [前面的教程][1]中覆盖了,它们可以满足这些条件了。 +为了保证本篇集中在系统监控,我们不会在这里配置主机组或者模板,它们已经在 [前面的教程][1]中覆盖了,它们可以满足需要了。 ### 在命令行中运行Nagios ### -通常建议在添加到Nagios前现在命令行中运行Nagios服务检测脚本。它会给出执行是否成功以及脚本的输出将会看上去的样子。 +通常建议在添加到Nagios前,先在命令行中运行Nagios服务检测脚本。它会给出执行是否成功以及脚本的输出将会看上去的样子。 这些脚本存储在 /etc/nagios-plugins/config/ ,可执行文件在 /usr/lib/nagios/plugins/。 @@ -39,9 +39,9 @@ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检 - Server 1 (10.10.10.1) : MySQL, Apache2 - Server 2 (10.10.10.2) : Postfix, Apache2 -- Server 3 (10.10.10.3): DNS +- Server 3 (10.10.10.3) : DNS -首先,服务器被定义在了Nagios中。 +首先,这些服务器被定义在了Nagios中。 root@nagios:~# vim /etc/nagios3/conf.d/example.cfg @@ -79,43 +79,43 @@ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检 开始检测MySQL时,需要记住MySQL默认只监听回环接口127.0.0.1。这增加了数据库的安全。手动调节需要告诉MySQL该监听什么其他接口。下面是该怎么做。 -这个设置在所有的MySQL服务器上已经做了。 +这个设置要在所有的MySQL服务器上完成。 root@nagios:~# vim /etc/mysql/my.cnf -下面这行被注释掉了来监听所有接口。 +下面这行被注释掉以监听所有网络接口。 #bind-address = 127.0.0.1 -同样,MySQL将不会运行任何主机来连接到它。在本机和任意主机都创建了用户‘nagios’。这个用户接着在所有的数据库中被授予所有的权限,这将在会用在监控中。 +同样,MySQL也不会让任意主机来连接它。需要为localhost和“任意”主机创建MySQL用户‘nagios’,接着在所有的数据库中为这个用户授予ALL权限,会这将在会用在监控中。 下面的设置对所有的MySQL服务器都已经设置。 root@nagios:~# mysql -u root –p - ## MySQL root password here ## + ## MySQL root 密码 ## -'nagios@localhost'用户在MySQL服务器中创建了。 +在MySQL服务器中创建'nagios@localhost'用户。 mysql> CREATE USER 'nagios'@'localhost' IDENTIFIED BY 'nagios-pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'localhost'; -'nagios@any-host'用户创建了。 +创建'nagios@任意主机'用户。(LCTT 译注:实际上这两个是同一个用户,只是分别授权给localhost和任意主机的访问;因为它们所用的密码的同一个,修改任何一个,另外一个也相应变化。) mysql> CREATE USER 'nagios'@'%' IDENTIFIED BY 'nagios-pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'%'; mysql> FLUSH PRIVILEGES; -这使MySQL监听所有的接口,同样接受来自用户'nagios'的进入链接。 +这使MySQL监听所有的网络接口,同样接受来自用户'nagios'的进入连接。 -请注意,这种变化可能有安全隐患,所以需要说几句话: +请注意,这种修改可能有安全隐患,所以需要提示几点: -- 这个设置将会暴露MySQL给所有的接口,包括WAN。确保只有合法的网络访问是非常重要的。应该使用防火墙和TCP封装器等过滤器。 -- MySQL用户‘nagios’的密码应该非常强。如果只有几台Nagios服务器,那么应该创建'nagios@servername'用户而不是任意用户的'nagios@%'。 +- 这个设置将会暴露MySQL给所有的接口,包括外网。确保只有合法的网络访问是非常重要的。应该使用防火墙和TCP wrapper等过滤器。 +- MySQL用户‘nagios’的密码应该非常强。如果只有几台Nagios服务器,那么应该创建'nagios@服务器名'用户而不是任意用户的'nagios@%'。 -#### 对MySQL的NAgios配置 #### +#### 对MySQL的Nagios配置 #### -用下面的来做一些调整。 +按如下配置来做一些调整。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -140,7 +140,7 @@ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检 ;check_mysql!userName!userPassword!databaseName } -这样,Nagios就可以同时监控MySQL服务器和数据库的可用性。 +这样,Nagios就可以同时监控MySQL服务器及其数据库的可用性。 ### 监控Apache服务器 ### @@ -148,7 +148,7 @@ Nagios同样也可以监控Apache服务。 #### Apache监控需要 #### -- 监控apache是否可用 +- 监控apache服务是否可用 这个任务非常简单因为Nagios有一个内置命令。 @@ -167,7 +167,7 @@ Nagios同样也可以监控Apache服务。 ### 监控DNS服务 ### -Nagios通过向DNS服务器查询一个完全合格域名(FQDN),或者使用dig工具来查询。默认用于FQDN的是www.google.com,但是这个可以按需改变。按照下面的文件修改来完成这个任务。 +Nagios通过向DNS服务器查询一个完全限定域名(FQDN),或者使用dig工具来查询。默认用于查询的FQDN的是www.google.com,但是这个可以按需改变。按照下面的文件修改来完成这个任务。 root@nagios:~# vim /etc/nagios-plugins/config/dns.cfg @@ -203,8 +203,7 @@ Nagios通过向DNS服务器查询一个完全合格域名(FQDN),或者使用 ### 监控邮件服务器 ### -Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之前提过,server-2设置了后缀邮件服务。Nagios将被配置来监控SMTP和邮件队列。 - +Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之前提过,server-2设置了Postfix邮件服务。Nagios将被配置来监控SMTP和邮件队列。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -231,11 +230,11 @@ Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之 ### 基于端口自定义监控程序 ### -让我们假设下面的自定义程序同样运行在网络中,监听一个特定的端口。 +让我们假设如下定制程序同样运行在网络中,监听着一个特定的端口。 -- 测试1号服务器:自定义程序(TCP端口 12345) +- 测试1号服务器:定制程序(TCP端口 12345) -过一些小的调整,Nagios也可以帮助监控这个程序。 +做一些小的调整,Nagios也可以帮助我们监控这个程序。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -248,12 +247,11 @@ Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之 check_command check_tcp!12345 } -在完结之前,Nagios可以监控网络很多其他的方面。存储在/etc/nagios-plugins/config/中的脚本为Nagios很棒的能力。 +在结束之前的提示,Nagios可以监控网络很多其他的方面。存储在/etc/nagios-plugins/config/中的脚本为Nagios提供了很棒的能力。 +一些Nagios提供的脚本被仅限于本地服务器,比如,服务器负载、进程并发数量、登录用户数量等。这些检查可以提供Nagios服务器内有用的信息。 -一些Nagios提供的脚本被限制在本地服务器。例子包含服务负载、进程并发数量、登录用户数量。这些检查可以提供Nagios服务器内有用的信息。 - -希望这篇有用。 +希望这篇文章对你有用。 -------------------------------------------------------------------------------- @@ -261,9 +259,9 @@ via: http://xmodulo.com/monitor-common-services-nagios.html 作者:[Sarmed Rahman][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-nagios-linux.html \ No newline at end of file +[1]:https://linux.cn/article-2436-1.html \ No newline at end of file From 9b62c5381b443effac4c3e0a0e174796c4a4fd07 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 22:37:56 +0800 Subject: [PATCH 65/76] PUB:20150601 How to monitor Linux servers with SNMP and Cacti @GOLinux --- ...nitor Linux servers with SNMP and Cacti.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150601 How to monitor Linux servers with SNMP and Cacti.md (82%) diff --git a/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md b/published/20150601 How to monitor Linux servers with SNMP and Cacti.md similarity index 82% rename from translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md rename to published/20150601 How to monitor Linux servers with SNMP and Cacti.md index cc76945bd8..68bf72ad98 100644 --- a/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md +++ b/published/20150601 How to monitor Linux servers with SNMP and Cacti.md @@ -1,12 +1,12 @@ -使用SNMP和Cacti监控Linux服务器 +使用 SNMP 和 Cacti 监控 Linux 服务器 ================================================================================ -SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数据,如负载、磁盘状态、带宽之类。像Cacti这样的网络监控工具用这些数据来生成图标以达到监控的目的。 +SNMP(简单网络管理协议)用于收集设备内部发生的数据,如负载、磁盘状态、带宽之类。像Cacti这样的网络监控工具用这些数据来生成图标以达到监控的目的。 在一个典型的Cacti和SNMP部署中,会有一台或多台启用了SNMP的设备,以及一台独立的用来从那些设备收集SNMP回馈的监控服务器。请记住,所有需要监控的设备必须启用SNMP。在本教程中,出于演示目的,我们将在同一台Linux服务器上配置Cacti和SNMP。 ### 在Debian或Ubuntu上配置SNMP ### -要安装SNMP代理(snmpd)到基于Debian的系统,请运行以下命令: +要在基于Debian的系统上安装SNMP代理(snmpd),请运行以下命令: root@server:~# apt-get install snmpd @@ -16,10 +16,10 @@ SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数 ---------- - # this will make snmpd listen on all interfaces + # 使snmpd 监听再所有接口上 agentAddress udp:161 - # a read only community 'myCommunity' and the source network is defined + # 定义一个只读的 community 'myCommunity' 和源网络 rocommunity myCommunity 172.17.1.0/24 sysLocation Earth @@ -41,10 +41,10 @@ SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数 ---------- - # A user 'myUser' is being defined with the community string 'myCommunity' and source network 172.17.1.0/24 + # 定义一个使用 community 'myCommunity' 和源网络 172.17.1.0/24 的用户 'myUser' com2sec myUser 172.17.1.0/24 myCommunity - # myUser is added into the group 'myGroup' and the permission of the group is defined + # 将 myUser 加到 'myGroup' 组,定义组权限 group myGroup v1 myUser group myGroup v2c myUser view all included .1 @@ -69,7 +69,7 @@ SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功 iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10 iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97 - ~~ OUTPUT TRUNCATED ~~ + ~~ 输出截断 ~~ iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440 iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1 @@ -79,9 +79,9 @@ SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功 ### 配置带有SNMP的Cacti ### -在本教程中,我们将在同一台Linux服务器上设置Cacti和SNMP。所以,去[安装Cacti][2]到刚刚配置SNMP的Linux服务器上吧。 +在本教程中,我们将在同一台Linux服务器上设置Cacti和SNMP。所以,到刚刚配置SNMP的Linux服务器上去[安装Cacti][2]吧。 -安装完后,Cacti网页接口可以通过“http://172.17.1.44/cacti”来访问,当然,在你的环境中,请将IP地址换成你的服务器的地址。 +安装完后,Cacti网页界面可以通过“http://172.17.1.44/cacti ”来访问,当然,在你的环境中,请将IP地址换成你的服务器的地址。 ![](http://farm6.staticflickr.com/5512/10972747655_0298f6ce6c_z.jpg) @@ -99,7 +99,7 @@ SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功 Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我们将只添加启用了SNMP的本地服务器。 -要添加设备,我们必须以管理员登录,然后转到Cacti管理员面板中的控制台。点击控制台 > 设备。 +要添加设备,我们必须以管理员登录,然后转到Cacti管理员面板中的控制台。点击 控制台 > 设备。 ![](http://farm8.staticflickr.com/7411/10972747855_b464972e56_z.jpg) @@ -111,7 +111,7 @@ Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我 ![](http://farm8.staticflickr.com/7400/10972747935_df03500de7_z.jpg) -由于设备已经添加,我们来指定想要创建的图表模板。你可以在该页的最后章节中找到本节内容。 +现在设备已经添加,我们来指定想要创建的图表模板。你可以在该页面的最后部分中找到这块内容。 ![](http://farm4.staticflickr.com/3773/10972747955_083101e6ab_z.jpg) @@ -123,7 +123,7 @@ Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我 ![](http://farm8.staticflickr.com/7374/10972920484_ed6b33b8b8_z.jpg) -### 接口图表和64位计数器 ### +### 接口的图表和64位计数器 ### 默认情况下,Cacti在SNMP查询中使用32位计数器。32位计数器对于大多数带宽图表而言已经足够了,但是对于超过100Mbps的带宽,它就无能为力了。如果已经知道带宽会超过100Mbps,建议你使用64位计数器。使用64位计数器一点也不麻烦。 @@ -173,9 +173,9 @@ via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html 作者:[Sarmed Rahman][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html +[1]:https://linux.cn/article-4683-1.html From 23975d2cba65cc3ecbe2fcb78714e4c222be82d6 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 22:52:48 +0800 Subject: [PATCH 66/76] PUB:20150615 How to combine two graphs on Cacti @ictlyh --- ...0615 How to combine two graphs on Cacti.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150615 How to combine two graphs on Cacti.md (64%) diff --git a/translated/tech/20150615 How to combine two graphs on Cacti.md b/published/20150615 How to combine two graphs on Cacti.md similarity index 64% rename from translated/tech/20150615 How to combine two graphs on Cacti.md rename to published/20150615 How to combine two graphs on Cacti.md index db320b204e..78e52a0639 100644 --- a/translated/tech/20150615 How to combine two graphs on Cacti.md +++ b/published/20150615 How to combine two graphs on Cacti.md @@ -1,22 +1,22 @@ 如何在 Cacti 中合并两幅图片 ================================================================================ -[Cacti][1] 是一个很棒的开源网络监视系统,它广泛使用于图示网络元素,例如带宽、存储、处理器和内存使用。使用它的基于网络的接口,你可以轻松地创建和组织图。然而,默认并没有提供一些高级功能,例如合并图片、使用多个来源创建聚合图、迁移 Cacti 到另一台服务器。使用 Cacti 的这些功能你还需要一些经验。在该教程中,我们会看到如何在将两幅 Cacti 图片合并为一幅。 +[Cacti][1] 是一个很棒的开源网络监视系统,它广泛使用于图形化地展示网络元素,例如带宽、存储、处理器和内存使用。使用它的基于Web 的界面,你可以轻松地创建和组织各种图表。然而,它默认并没有提供一些高级功能,例如合并图片、使用多个来源创建聚合图形、迁移 Cacti 到另一台服务器。使用 Cacti 的这些功能你还需要一些经验。在该教程中,我们会看到如何在将两幅 Cacti 图片合并为一幅。 -考虑这个例子。在过去的 6 个月中,客户端 A 连接到了交换机 A 的端口 5。端口 5 发生了错误,因此客户端迁移到了端口 6。由于 Cacti 为每个接口/元素使用不同的图,客户端的带宽历史会分成端口 5 和端口 6。结果是对于一个客户端我们有两幅图片 - 一幅是 6 个月的旧数据,另一幅保存了后续的数据。 +看看这个例子。在过去的 6 个月中,客户端 A 连接到了交换机 A 的端口 5。端口 5 发生了错误,因此客户端迁移到了端口 6。由于 Cacti 为每个接口/元素使用不同的图,客户端的带宽历史会分成端口 5 和端口 6。结果是对于一个客户端我们有两幅图片 - 一幅是 6 个月的旧数据,另一幅保存了后续的数据。 -在这种情况下,我们实际上可以合并两幅图片将旧数据加到新的图中,使得用一个单独的图为一个用户保存历史的和新数据。该教程将会解释如何做到这一点。 +在这种情况下,我们实际上可以合并两幅图片将旧数据加到新的图中,使得用一个单独的图为一个用户保存历史的和新数据。本教程将会解释如何做到这一点。 -Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循环数据库) 文件中。当请求一幅图片时,根据保存在对应 RRD 文件中的值生成图。在 Ubuntu/Debian 系统中,RRD 文件保存在 `/var/lib/cacti/rra`,在 CentOS/RHEL 系统中则是 `/var/www/cacti/rra`。 +Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循环数据库)文件中。当请求一幅图片时,根据保存在对应 RRD 文件中的值生成图。在 Ubuntu/Debian 系统中,RRD 文件保存在 `/var/lib/cacti/rra`,在 CentOS/RHEL 系统中则是 `/var/www/cacti/rra`。 合并图片背后的思想是更改这些 RRD 文件使得旧 RRD 文件中的值能追加到新的 RRD 文件中。 ### 情景 ### -一个客户端的服务在 eth0 上运行了超过一年。由于硬件损坏,客户端迁移到了另一台服务器的 eth1 接口。我们想图示新接口的带宽,同时保留超过一年的历史数据。只在一幅图中显示客户端。 +一个客户端的服务在 eth0 上运行了超过一年。由于硬件损坏,客户端迁移到了另一台服务器的 eth1 接口。我们想展示新接口的带宽,同时保留超过一年的历史数据。该客户端希望只在一幅图中显示。 ### 确定图的 RRD 文件 ### -图合并的首个步骤是确定和图关联的 RRD 文件。我们可以通过以调试模式打开图检查文件。要做到这点,在 Cacti 的菜单中: 控制台 > 管理图 > 选择图 > 打开图调试模式。 +图合并的首个步骤是确定与图相关联的 RRD 文件。我们可以通过以调试模式打开图检查文件。要做到这点,在 Cacti 的菜单中: 控制台 > 管理图 > 选择图 > 打开图调试模式。 #### 旧图: #### @@ -26,14 +26,14 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 ![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg) -从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件: +从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件: - **旧图**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd - **新图**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd ### 准备脚本 ### -我们会用一个 [RRD 剪接脚本][2] 合并两个 RRD 文件。下载该 PHP 脚本,并安装为 /var/lib/cacti/rra/rrdsplice.php (Debian/Ubuntu 系统) 或 /var/www/cacti/rra/rrdsplice.php (CentOS/RHEL 系统)。 +我们会用一个 [RRD 剪接脚本][2] 来合并两个 RRD 文件。下载该 PHP 脚本,并安装到 /var/lib/cacti/rra/rrdsplice.php (Debian/Ubuntu 系统) 或 /var/www/cacti/rra/rrdsplice.php (CentOS/RHEL 系统)。 下一步,确认 Apache 用户拥有该文件。 @@ -49,7 +49,7 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 chown($finrrd, "www-data"); -在 CentOS 或 RHEL 系统中,运行下面的命令: +在 CentOS 或 RHEL 系统中,运行下面的命令即可: # chown apache:apache rrdsplice.php @@ -72,7 +72,7 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 ![](https://farm6.staticflickr.com/5493/18821787015_6730164068_b.jpg) -总之,该教程显示了如何简单地将两幅 Cacti 图片合并为一幅。当服务迁移到另一个设备/接口,我们希望只处理一幅图片而不是两幅时,这个小技巧非常有用。该脚本非常方便,因为它可以不管源设备合并图片,例如 Cisco 1800 路由器和 Cisco 2960 交换机。 +总之,该教程显示了如何简单地将两幅 Cacti 图片合并为一幅。当服务迁移到另一个设备/接口,我们希望只处理一幅图片而不是两幅时,这个小技巧非常有用。该脚本非常方便,因为它可以不管源设备是不是相同都可以合并图片,例如 Cisco 1800 路由器和 Cisco 2960 交换机。 希望这些能对你有所帮助。 @@ -82,10 +82,10 @@ via: http://xmodulo.com/combine-two-graphs-cacti.html 作者:[Sarmed Rahman][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html +[1]:https://linux.cn/article-5746-1.html [2]:http://svn.cacti.net/viewvc/developers/thewitness/rrdsplice/rrdsplice.php \ No newline at end of file From 5a6690c3a62ba9a7f9f3194966bcd6ffd892c2ba Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 3 Jul 2015 10:06:11 +0800 Subject: [PATCH 67/76] PUB:20150610 How to secure your Linux server @KayGuoWhu --- ...0150610 How to secure your Linux server.md | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) rename {translated/tech => published}/20150610 How to secure your Linux server.md (78%) diff --git a/translated/tech/20150610 How to secure your Linux server.md b/published/20150610 How to secure your Linux server.md similarity index 78% rename from translated/tech/20150610 How to secure your Linux server.md rename to published/20150610 How to secure your Linux server.md index ef34eea398..e6fcb4449a 100644 --- a/translated/tech/20150610 How to secure your Linux server.md +++ b/published/20150610 How to secure your Linux server.md @@ -1,15 +1,14 @@ -Linux服务器安全攻略 +Linux 服务器安全技巧 ================================================================================ -> 一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。 毋庸置疑,对于系统管理员,提高服务器的安全性是最重要的事情之一。因此,也就有了许多针对这个话题而生的文章、博客和论坛帖子。 一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。 -有一些常识是每个系统管理员都应该烂熟于心的,所以下面的几点在后文将不会提及: +有一些常识是每个系统管理员都应该烂熟于心的,所以下面的几点在本文将不会提及: - 务必保证系统是**最新的** -- 经常更换密码 - 使用数字、阿拉伯字母和非阿拉伯字母的符号组合 +- 经常更换密码 - 使用数字、字母和非字母的符号组合 - 给予用户**最小**的权限,满足他们日常使用所需即可 - 只安装那些真正需要的软件包 @@ -17,7 +16,7 @@ Linux服务器安全攻略 ### 更改SSH默认端口 ### -在搭建好一台全新的服务器后要做的第一件事情就是更改SSH的默认端口。这个小小单的改动能够使你的服务器避免受到成千上万的暴力攻击(译者注:不更改默认端口相当于黑客们知道你家的门牌号,这样他们只需要一把一把的试钥匙就可能打开你家的锁)。 +在搭建好一台全新的服务器后要做的第一件事情就是更改SSH的默认端口。这个小小的改动能够使你的服务器避免受到成千上万的暴力攻击(LCTT 译注:不更改默认端口相当于黑客们知道你家的门牌号,这样他们只需要一把一把的试钥匙就可能打开你家的锁)。 要更改默认的SSH端口,先打开sshd_config文件: @@ -35,7 +34,7 @@ Linux服务器安全攻略 接下来的一步是: -### 使用SSH密钥 ###、 +### 使用SSH密钥认证 ### 在通过SSH访问服务器时,使用SSH密钥进行认证是尤其重要的。这样做为服务器增加了额外的保护,确保只有那些拥有密钥的人才能访问服务器。 @@ -43,7 +42,7 @@ Linux服务器安全攻略 ssh-keygen -t rsa -你会看到下面的输出,询问要将密钥写到哪一个文件,并且设置一个密码: +你会看到下面的输出,询问要将密钥写到哪一个文件里,并且设置一个密码: Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): my_key @@ -60,7 +59,7 @@ my_key my_key.pub -接下来把my_key.pub拷贝到~/.ssh/authorized_key中 +接下来把my\_key.pub拷贝到~/.ssh/authorized\_key中 cp my_key.pub ~/.ssh/authorized_keys @@ -72,7 +71,7 @@ my_key.pub ### 关闭SSH的密码认证 ### -既然已经有了SSH密钥,那么关闭SSH的密码认证就很安全了。再次打开并编辑sshd_config,按如下设置: +既然已经有了SSH密钥,那么关闭SSH的密码认证就会更安全了。再次打开并编辑sshd_config,按如下设置: ChallengeResponseAuthentication no PasswordAuthentication no @@ -84,7 +83,7 @@ my_key.pub /etc/sudoers/ -可以使用如**visudo**这样的命令编辑文件,推荐使用这个命令,因为它会在关闭文件之前检查任何可能出现的语法错误。当你在编辑文件时出错了,这就很有用了。 +推荐使用如**visudo**这样的命令编辑该文件,因为它会在关闭文件之前检查任何可能出现的语法错误。当你在编辑文件时出错了,这就很有用了。 接下来赋予某个用户root权限。在本文中,使用用户**sysadmin**。确保在编辑后这个文件时使用的用户是系统已有的用户。找到下面这行: @@ -107,6 +106,8 @@ my_key.pub (4) 这个用户可以使用的命令 +(LCTT 译注:所以上面的配置是意思是:root 用户可以在任何终端担任任何用户,执行任何命令。) + 使用这个配置可以给用户访问一些系统工具的权限。 这时,可以放心保存文件了。 @@ -135,7 +136,7 @@ my_key.pub wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz - csf + cd csf sh install.sh 只需等待安装程序完成,然后编辑CSF的配置文件: @@ -148,25 +149,25 @@ my_key.pub 下面要设置的就是服务器上允许通过的端口。在csf.conf中定位到下面的部分,根据需要修改端口: - # Allow incoming TCP ports + # 允许入站的 TCP 端口 TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,16543" - # Allow outgoing TCP ports + # 允许出站的 TCP 端口 TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,16543" - # Allow incoming UDP ports + # 允许入站的 UDP 端口 UDP_IN = "20,21,53" - # Allow outgoing UDP ports - # To allow outgoing traceroute add 33434:33523 to this list + # 允许出站的 UDP 端口 + # 要允许发出 traceroute 请求,请加 33434:33523 端口范围到该列表 UDP_OUT = "20,21,53,113,123" -请根据需要逐一设置,推荐只使用那些需要的端口,避免设置对端口进行大范围设置。此外,也要避免使用不安全服务的不安全端口。比如只允许端口465和587来发送电子邮件,取代默认的SMTP端口25. +请根据需要逐一设置,推荐只使用那些需要的端口,避免设置对端口进行大范围设置。此外,也要避免使用不安全服务的不安全端口。比如只允许端口465和587来发送电子邮件,取代默认的SMTP端口25。(LCTT 译注:前提是你的邮件服务器支持 SMTPS) -**重要**:千万不要忘记允许自定义SHH端口。 +**重要**:千万不要忘记允许自定义的 ssh 端口。 -允许防火墙通过你的IP地址使其不被屏蔽,这一点很重要。IP地址定义在下面的文件中: +允许你的IP地址通过防火墙,而绝不被屏蔽,这一点很重要。IP地址定义在下面的文件中: /etc/csf/csf.ignore -被屏蔽的IP地址会出现在这个文件中: +被屏蔽了的IP地址会出现在这个文件中: /etc/csf/csf.deny @@ -184,13 +185,13 @@ my_key.pub 可以看到,尝试通过暴力法登录的IP地址都被屏蔽了,真是眼不见心不烦啊! -#### 锁住账户 #### +### 锁住账户 ### 如果某个账户在很长一段时间内都不会被使用了,那么可以将其锁住以防止其它人访问。使用如下命令: passwd -l accountName -当然,这个账户依然可以被root用户使用。 +当然,这个账户依然可以被root用户使用(LCTT 译注:可用 su 切换为该账号)。 ### 了解服务器上的服务 ### @@ -207,16 +208,18 @@ my_key.pub 然后使用下面的命令关闭服务: chkconfig service off + 或 systemctl disable service 在上面的例子中,把“service”替换成真正想要停止的服务名称。实例如下: chkconfig httpd off + 或 systemctl disable httpd -### 小结 ### +### 小结 ### -这篇文章的目的是涵盖一些通用的安全步骤以便帮助你保护服务器。你可以采取额外的方式去增强对服务器的保护。请记住保证服务器安全是你的责任,在维护服务器安全时尽量做出明智的选择,尽管并没有什么容易的方式去完成这件事情,而建立“完善的”安全需要花费大量的时间和测试直到达到想要的结果。 +这篇文章的目的是涵盖一些通用的安全步骤以便帮助你保护服务器。你可以采取更多方式去增强对服务器的保护。请记住保证服务器安全是你的责任,在维护服务器安全时尽量做出明智的选择,尽管并没有什么容易的方式去完成这件事情,而建立“完善的”安全需要花费大量的时间和测试直到达到想要的结果。 -------------------------------------------------------------------------------- @@ -224,7 +227,7 @@ via: http://www.linuxveda.com/2015/06/03/secure-linux-server/ 作者:[Marin Todorow][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 377578a1da5ea7692f890f34df4fd903d98ea40a Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 4 Jul 2015 21:36:54 +0800 Subject: [PATCH 68/76] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll be the future of Linux without Linus.md | 187 ++++++++++++------ 1 file changed, 130 insertions(+), 57 deletions(-) diff --git a/translated/talk/20150618 What will be the future of Linux without Linus.md b/translated/talk/20150618 What will be the future of Linux without Linus.md index 09cd64b647..c880921853 100644 --- a/translated/talk/20150618 What will be the future of Linux without Linus.md +++ b/translated/talk/20150618 What will be the future of Linux without Linus.md @@ -1,116 +1,189 @@ -没有Linus,Linux的未来是什么样子? +没有 Linus,Linux 的未来是什么样子? ============================================================================== -![](http://i2.wp.com/www.linuxveda.com/wp—content/uploads/2015/06/linus—torvalds—painting.jpg) +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) -这次采访是 Linux For You 杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 +这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 -**Q:对于Linux内核,未来的计划/道路/强化是怎样的?** +**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?** -Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,大的事情也会大事化小,小事化没。 +Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。 -所以,对于五年后内核会是什么样,我真的没有任何大眼光 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保‘进程’工作,这样人们才可以相互协作好。 +所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。 -**Q:你怎么看Linux和Solaris之间的关系在未来的发展?它会如何使用户受益?** +**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?** -Linus:我并不能看到整个重叠的地方,除了我认为Solaris会开始使用更过Linux用户磁盘工具(显然我自己来说没有太多关注这个 — 我真的只关心内核)。Linux的桌面比起传统Solaris拥有的好多了,而且我希望Solaris移植越来越多的Linux的东西,朝着一个更加类Linux的模型前进。 +Linus:我并不能看到整个重叠的地方,除了我认为 Solaris 会开始使用更多的 Linux 用户空间的工具(显然对我自己来说没有太多关注这个 — 我真的只关心内核)。Linux 的桌面比起传统 Solaris 拥有的好多了,而且我希望 Solaris 移植越来越多的Linux的东西,朝着一个更加类 Linux 的模型前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ) -从纯内核方面讲,证书的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun已经声明在GPL(v2或v3)下授权Solaris,如果这种证书差异消失,那么会导致一些有趣的技术出现。但对此,我持待见态度。 +从纯内核方面讲,许可证的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun 已经声明在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。 -**Q:现在GPL v3已经完成并发布了,你是否预见有任何情况会激起你开始移植内核到Solaris上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过他?** +**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?** -Linus:我觉得相比于早先的草稿,v3有了很多提高,并且我也认为它不是一个糟糕的证书。我只是认为它没有GPLv2一般的‘伟大’。 +Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也认为它不是一个糟糕的许可证。我只是认为它没有 GPLv2一般的‘伟大’。 -所以,由于没有了GPLv2,我会看见自己将会使用GPLv3。但是,自从我有了一个更好的选择,我为什么不应该考虑一下呢? +所以,由于没有了 GPLv2,我觉得自己将会使用 GPLv3。不过,如果我有了一个更好的选择,我为什么不应该考虑一下呢? -这就是说,我努力保持实用主义精神,并且我认为GPLv3比起GPLv2不是一个好证书这件事不是一个‘黑与白’的问题。这是一个平衡做法。如果GPLv3有其他的优点,可能那些优点会在很大程度上倾斜喜爱GPLv3的天平。 +这就是说,我努力保持实用主义精神,并且我认为 GPLv3 不像 GPLv2 一样好这件事并不是一个‘非黑即白’的问题。这是一个平衡做法。如果 GPLv3 有其他的优点,可能那些优点会在很大程度上扭转喜爱 GPLv3 的天平。 -恕我直言,我并没有看到任何优点,但是如果Solaris真的在GPLv3下发布,可能避免不必要的不兼容证书这条足够称为一个优点,可能也会值得去尝试重新许可Linux的内核放在GPLv3下。 +恕我直言,我并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的非兼容的许可证这条足够称为一个优点,可能也许值得去尝试将Linux的内核重新在 GPLv3 许可证下发布。 -不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个证书偏执者。我认为GPLv2是毫无疑问的好证书,但是证书不是一切。 +不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。 -总的来说,我使用很多其他证书下的程序。我可能没有把我自己做的一个项目放在BSD(或X11—MIT)证书下,但是我认为它是一个伟大的证书,对于其他项目来说,它可能是最佳的选择。 +总的来说,我使用很多其他许可证下的程序。我可能没有把一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。 -**Q:目前有没有任何印度人,你想特别提出作为Linux内核的关键贡献者?** +**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?** -Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。那就是说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 +(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。) -我非常相信大多数人基本上被束缚起来了,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 +Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。换句话说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 -所以,当我偶然与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的集合间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 +我非常相信大多数人的社交基本上是受限制的,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 -同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! +所以,当我偶然会与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的群体间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 -**Q:自从Linux的内核开发对你依赖如此严重以来,你如何计划组织/重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** +同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! -Linus:现在Linux比我大得多了,为了这个实现我已经工作了很长时间。是的,我仍然十分亲切地身在其中,而且我对其有着想当大的日常影响,我最终会是这样一个人,在某种程度上,扮演着许多内核开发活跃者的中心点的角色;但是 — 我不会说Linux“严重依赖”于我。 +**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** -所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够接替我,还少有困惑。 +Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说Linux“严重依赖”于我。 -**Q:印度是软件工程师的主要产地之一,当然我们没有在Linux领域做太多贡献。你觉得什么是保持印度人在Linux领域变得具有前瞻性的?如果我们鼓励印度人参与并为Linux做很大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来启迪那些爱好者吗?** +所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够没有什么困难地接替我。 -Linus:对我来说,这确实是一个不好回答的问题。进入开源是如此一个底层结构(网络接入,教育,你说的),信息流和简单的文化的复杂组合,我甚至不能去猜测最大的障碍会是什么。 +**Q:印度是软件工程师的主要产地之一,当然我们没有在 Linux 领域做太多贡献。你觉得什么是让印度人在Linux领域变得主动的?如果我们鼓励印度人参与并为Linux做更大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来顾问那些爱好者吗?** -在很多方面,至少那些在印度含英语文化的地方,应该有一个相对容易的方式参与Linux和其他开源项目,如果仅仅是由于语言门槛的话。当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 +Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件(互联网和教育,如你说的):信息流和文化,我甚至不知道这其中哪个是最大的障碍。 -当然,有一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法做出一点半路聪明猜测最好的前路是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 +在很多方面,至少那些在印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 -至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 +当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 -**Q:什么样的理由会让你考虑去看看印度?** +至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 -Linus:如第一个回答中提到,我完全地讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度! +**Q:什么样的理由会让你考虑去访问印度?** -**Q:最近,你好像在抨击Subversion与CVS,质问他们的基础架构。现在你已经从Subversion和CVS社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** +Linus:如第一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非世界性的 LinuxCon 在中国召开一次。) + +**Q:最近,你好像在抨击 Subversion 与 CVS,质问他们的基础架构。现在你已经从 Subversion 和 CVS 社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 -做出强硬的争论有时会导致一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” +做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” -但是话说回来,对SVN/CVS并不会发生这种情况。我怀疑很多人真的不是很喜欢CVS,所以我真的不期望任何人去坚持CVS是一切,而不是一个老旧的系统。当我知道少数人确实这样争论了,我之前就不该那么不礼貌地反对SVN(嘿,这是公平的 — 我真的不是一个非常礼貌的家伙!),我认为不是任何人都可以争论SVN是‘好的’。 +但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道少数人确实这样争论过了,我之前就不该那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不认为任何人都可以争论 SVN 是‘好的’。 -我认为,SVN就是一个‘好过头’的经典案例。人们过去经常使用SVN,并且它也‘很好’,用途广泛,但是它的好过头完全如DOS与Windows也‘好过头’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 +我认为,SVN 就是一个‘足够好’的经典案例。人们过去经常使用 SVN,并且它也‘足够好’地广泛使用,但是它的足够好完全如 DOS 与 Windows 的‘足够好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 -Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它不是关于UNIX,实质上,是像原始的UNIX,它身后有一个基础的想法。对UNIX来说,最底层的哲学就是,“所有东西只是一个文件”。对Git来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 +Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它并不关系到 UNIX,实质上,只是像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 -**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人需要被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** +**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人想被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** -Linus:我认为多发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:’民主‘也有那些令人困惑的选择,通常没有选择是必须的,或者你‘真正’想要的。而且有时候,如果你不需要担心选举,不同党派和联合等等方面的困惑的话,你可能喜欢事情更加容易一些,更有效率一些。 +Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。 -但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家比过去更诚信,我们也希望不同的发行版有一天做出其他的选择,但是没有那种选择的话,事情可能会更糟。 +但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。 -**Q:为什么你觉得CFS比SD更好?** +**Q:为什么你觉得 CFS 比 SD 更好?** -Linus:一部分原因是我与Ingo[Molnar]工作你很长一段时间,这就是说,我了解他,并且知道他会对发生的任何事情非常负责。那种品质是非常重要的。 +Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。 -但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示CFS比SD好。包括许多3D游戏方面(这是人们声称SD最强的一点)。 +但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称SD 最强的一点)。 -同时,尽管如此,我认为并不是代码的任何一段都十分‘完美’。最好的情况是想成为SD支持者的人会努力提高SD,使得平衡会倾覆其他方面 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 +同时,尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 -**Q:在Google一次关于Git的访谈中,有人问你如何会停止六个月的商业活动,为git编写了一个目前由一些中心化的东西和交易管理的,特别庞大的代码基础。你对此的回答是什么?** +**Q:在 Google 一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?** -Linus:啊哈。那个问题我在现场没有听清楚(在录制结果里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 +Linus:啊哈。那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 -无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是从任何其他的早期SCM导入一个大工程到git里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! +无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期 SCM 导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! -坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最中心的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 +坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最重要的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 -所以没有理智健全的人会一夜之间拥护将一切移到git上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些一个组主要控制和维护的项目,然后开始转移其到git。这是你能让人们习惯这种模式的方式,你开始有一个核心的组,知道git如何工作,如何在公司里面使用它。 +所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。 -接着,你就会铺展开来。并不一次就位。你会导入越来越多的项目 — 如果在你公司里你有‘一个大仓库’;你也会差不多确定将那个仓库作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非‘每件事’并不非常大)。 +接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。 -所以,你基本上有一次转移了一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’太传统了,没人会关心)。 +所以,你基本上有一次转移一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。 -Git最赞的一个功能是,它实际上可以同很多其他SCM相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用git,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的SCM上去。 +git 最赞的一个功能是,它实际上可以同很多其他 SCM(源代码控制管理)相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用 git ,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的 SCM 上去。 -**Q:在Transmeta,他们曾经经历过用另外的架构设置部署吗?[Transmeta Crusoe的芯片看起来像一个非常软的CPU — 提到一台Burroughs B1000的解释机器,这实际上部署了多台虚拟机。有一台是用于系统软件,一台是用于Cobol,一台用于Fortran;如果上述正确,那么一个人可以部署Burroughs 6/7000或者HP3000,如栈结构一样,在芯片上或者一个适合JVM的结构集合等等。]** +**Q:在 Transmeta(全美达)上他们有备用指令集实现的经验吗?[Transmeta Crusoe 芯片看起来像一个非常弱的 CPU — 记得有一台 Burroughs B1000 的解释器,它实际上实现了多个虚拟机。有一台是用于系统软件,一台是用于 Cobol,一台用于 Fortran;如果没错的话,那么一个人可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构或适用于 JVM 的指令集,等等。]** -Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开证明。我们有一个技术宝箱,在那里你同时可以跑x86结构和Java字节码(实际上,它是一个轻量的扩展pico—java,iirc)。 +Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑x86结构和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。 -(选择DOOM的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) +我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个 test 编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。 -有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对Java不怎么感冒。 +(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) -**Q:386BSD衍生了NetBSD,FreeBSD和OpenBSD,在Linux出现之前已经发展不错了,但是Linux传播比386BSD及其衍生者更为广泛。这在多大程度上左右你对证书的选择,和你选择的发展过程?你不认为比起GPLv2来,是GPLv3保护了自由,孕育了Linux比BSD更好,直到现在?** +有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。 -Linus: +**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 保护了自由,迄今为止,让 Linux 比 BSD 变得更好?** + +Linus:我认为这是一个许可证问题和一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将将他的修改返回来。因此,实际上并不会真的发生这种事情(以 BSD 而言,如 BSDi),人们并不真的彼此‘信任’。 + +相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以不会试着从你这里白白占走好处。 + +所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。 + +那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。 + +所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。 + +这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。 + +换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。 + +而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你最好可以让我对你的设备动手动脚”,看见了没?在我看来,不但小气,而且小心眼。 + +**Q:-rt 树的功能正在缓慢而稳定地逐渐集成到主线代码中。你当前对合并剩余的 -rt 树到主线代码的看法是什么?(我说的不是 CFS)** + +Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。 + +我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。 + +顺便说一句,这不仅仅是针对 -rt ,它也在许多开发中出现。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者也直接涉及到了普通的内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。 + + +**Q:我对 Linux 内核支持的文件系统的发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 发起那个新项目那个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?** + +Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是在内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。 + +最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。 + +相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和旋转介质的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理旋转介质的延迟。 + +**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的基本办公软件正在发挥影响力。你认为操作系统将走向何方?** + +Linus:我并不真的相信‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且当到处可以接入时,它也并不是‘无处不在’。 + +所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化:人们并不能回到‘傻傻的’六十年代,甚至连硬件也和过去的‘那个’完全不同了! + +所以,别指望一场革命。我认为操作系统将更多继续它们所做哪些事情,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生根本性改变的是界面和操作系统顶层的哪些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。 + +至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你非常想知道在机器里面真正在做什么。 + +**Q:最近我听说,你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?** + +Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做的更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。 + +在其它架构下运行是非常有趣的(我把 alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的将来自以下,比如也许我们将来十年并不需要使用 x86 作为我们的主要架构,我认为也许是 ARM,这得益于移动设备市场。 + +**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?** + +Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显示也是我的工作,我非常高兴工作和兴趣能合二为一。 + +我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux (字面上的做是因为它有趣),但是可以肯定的是,我欣赏我认为开源为何这么棒的深层原因。所以我并不是因为什么高大上的理由做 Linux 的,而且我不能诚恳地说是它在激励我,但是我最终会思考为什么会这样。 + +**Q:微软的‘黑衣人’有没有和你交谈过?** + +Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ + +作者:[Swapnil Bhartiya][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/arnieswap/ From 2cd247dafba9fbbebad28326c20f0e05cc94929a Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 21:55:59 +0800 Subject: [PATCH 69/76] PUB:20150616 Linux Humor on the Command-line @wwy-hust --- ...0150616 Linux Humor on the Command-line.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename {translated/share => published}/20150616 Linux Humor on the Command-line.md (70%) diff --git a/translated/share/20150616 Linux Humor on the Command-line.md b/published/20150616 Linux Humor on the Command-line.md similarity index 70% rename from translated/share/20150616 Linux Humor on the Command-line.md rename to published/20150616 Linux Humor on the Command-line.md index 41745eba24..e998e31f05 100644 --- a/translated/share/20150616 Linux Humor on the Command-line.md +++ b/published/20150616 Linux Humor on the Command-line.md @@ -1,14 +1,14 @@ Linux命令行中的幽默 ================================================================================ -桌面通常是非常养眼的,它增强了可视化的体验,有时也能够增强某些软件的功能,而且让软件变得更有趣。在命令行下工作也不需要总是很严肃,如果您想在命令行下找些乐子,那么有很多命令可以让您展露微笑。 +图形桌面总是很养眼的,它增强了可视化体验,有时也能够提升了某些软件的功能,让软件变得更有趣。但是,在命令行下工作也不需要总是很古板,如果您想在命令行下寻找些乐趣,那么有很多命令给您带来趣味。 -Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的质量和可选择性帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。 +Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的功能和琳琅满目的选择帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。 -### lolcat ### +### 七彩虹:lolcat ### ![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) -lolcat是一个连接文件或标准输入到标准输出(类似一般的cat)的程序,它会为输出添加七彩的颜色。 +lolcat是一个用于将文件或标准输入连接到标准输出(类似常见的cat)的程序,但是它会为输出添加七彩的颜色。 lolcat通常和其他诸如toilet或figlet等生成文本的应用结合使用。这个软件不应被误认为是一个或多个猫的图像的宏。 @@ -16,13 +16,13 @@ lolcat由Moe编写。 网址: [github.com][1] -### cowsay ### +### 牛郎的牛:cowsay ### ![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) cowsay是一个可配置的开源软件,它用ASCII码生成奶牛的图片,并可以在对话气泡中显示消息。cowsay是用Perl写的。 -cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骨架。 +cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骷髅。 有一个叫cowthink的应用,与对话的气泡不同,它能在生成奶牛的同时生成思考的气泡。 @@ -31,11 +31,11 @@ cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者 - 让脚本变得更有趣 - Borg模式 - 可以更改奶牛看起来的样子,比如让奶牛看起来贪婪、偏执、固执、疲倦、古怪、年轻等 -- 支持xcowsay的变形 +- 图形版变体:xcowsay 网址: [nog.net][2] -### doge ### +### 傻狗:doge ### ![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) @@ -45,19 +45,19 @@ doge是一个在2013年非常流行的互联网潮流元素(梗)。这个梗 - 随机的用不同的颜色和蹩脚的英语写下随机的句子 - 终端中的柴犬效果非常棒 -- 获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR -- 如果您安装了lolcat,您可以用它作为点缀: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done -- 标准输入支持: ls /usr/bin | doge 将打印一些/usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。 +- 可以获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR +- 如果您安装了lolcat,您可以用它作为点缀: `while true; do doge | lolcat -a -d 100 -s 100 -p 1; done` +- 支持标准输入: `ls /usr/bin | doge` 将显示一些 /usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。 网址: [github.com/thiderman/doge][3] -### ASCIIQuarium ### +### 水族箱:ASCIIQuarium ### ![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受生活在您电脑中水底的奇妙生物吧。 -想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用sudo apt-get install libcurses-perl来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。 +想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用`sudo apt-get install libcurses-perl`来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。 功能包括: @@ -67,13 +67,13 @@ ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受 网址: [www.robobunny.com][4] -### sl - 蒸汽机车 ### +### 蒸汽机车:sl ### ![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用户显示一个动画。 -我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl作为一个实际的提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。 +我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl扮演了一个提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。 功能包括: @@ -83,7 +83,7 @@ sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用 网址: [github.com/mtoyoda/sl][5] -### aafire ### +### 火焰:aafire ### ![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) @@ -91,11 +91,11 @@ aafire在终端中显示燃烧的ASCII火焰。它展示了aalib库的强大能 网址: [aa-project.sourceforge.net/aalib][6] -### CMatrix ### +### 矩阵:CMatrix ### ![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) -CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道黑客帝国是1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。 +CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道这部1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。 它可以在终端设置为132x300的情况下工作,并且可以以同样的速率进行滚动或者以用户定义的速度进行异步的滚动。 From 3cc959afc4a5737a03946e83c44fb26347d2c1d6 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 22:06:26 +0800 Subject: [PATCH 70/76] PUB:20150604 How to access SQLite database in Perl @geekpi --- ...4 How to access SQLite database in Perl.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150604 How to access SQLite database in Perl.md (84%) diff --git a/translated/tech/20150604 How to access SQLite database in Perl.md b/published/20150604 How to access SQLite database in Perl.md similarity index 84% rename from translated/tech/20150604 How to access SQLite database in Perl.md rename to published/20150604 How to access SQLite database in Perl.md index 76cc1f01f0..82283b9857 100644 --- a/translated/tech/20150604 How to access SQLite database in Perl.md +++ b/published/20150604 How to access SQLite database in Perl.md @@ -1,6 +1,6 @@ 如何用Perl访问SQLite数据库 ================================================================================ -SQLite是一个零配置,无服务端,基于文件的事务文件系统。由于它的轻量级,自包含和紧凑的设计,所以当你想要集成数据库到你的程序中时,SQLite是一个非常流行的选择。在这篇文章中,我会展示如何用Perl脚本来创建和访问SQLite数据库。我演示的Perl代码片段是完整的,所以你可以很简单地修改并集成到你的项目中。 +SQLite是一个零配置、无服务端、基于文件的事务型数据库系统。由于它的轻量级,自包含和紧凑的设计,所以当你想要集成数据库到你的程序中时,SQLite是一个非常不错的选择。在这篇文章中,我会展示如何用Perl脚本来创建和访问SQLite数据库。我演示的Perl代码片段是完整的,所以你可以很简单地修改并集成到你的项目中。 ![](https://farm1.staticflickr.com/552/18444614631_9e7fce8243_c.jpg) @@ -44,25 +44,27 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 - 在表中更新行 - 在表中删除行 +- + use DBI; use strict; - # define database name and driver + # 定义数据库名称和驱动 my $driver = "SQLite"; my $db_name = "xmodulo.db"; my $dbd = "DBI:$driver:dbname=$db_name"; - # sqlite does not have a notion of username/password + # sqlite 没有用户名密码的概念 my $username = ""; my $password = ""; - # create and connect to a database. - # this will create a file named xmodulo.db + # 创建并连接到数据库 + # 以下创建的文件名为 xmodulo.db my $dbh = DBI->connect($dbd, $username, $password, { RaiseError => 1 }) or die $DBI::errstr; print STDERR "Database opened successfully\n"; - # create a table + # 创建表 my $stmt = qq(CREATE TABLE IF NOT EXISTS NETWORK (ID INTEGER PRIMARY KEY AUTOINCREMENT, HOSTNAME TEXT NOT NULL, @@ -76,7 +78,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print STDERR "Table created successfully\n"; } - # insert three rows into the table + # 插入三行到表中 $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD) VALUES ('xmodulo', 16843009, 'Ubuntu 14.10', 0.0)); $ret = $dbh->do($stmt) or die $DBI::errstr; @@ -89,7 +91,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 VALUES ('puppy', 16843011, 'Ubuntu 14.10', 0.0)); $ret = $dbh->do($stmt) or die $DBI::errstr; - # search and iterate row(s) in the table + # 在表中检索行 $stmt = qq(SELECT id, hostname, os, cpuload from NETWORK;); my $obj = $dbh->prepare($stmt); $ret = $obj->execute() or die $DBI::errstr; @@ -104,7 +106,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print "CPULOAD: ". $row[3] ."\n\n"; } - # update specific row(s) in the table + # 更新表中的某行 $stmt = qq(UPDATE NETWORK set CPULOAD = 50 where OS='Ubuntu 14.10';); $ret = $dbh->do($stmt) or die $DBI::errstr; @@ -114,7 +116,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print STDERR "A total of $ret rows updated\n"; } - # delete specific row(s) from the table + # 从表中删除某行 $stmt = qq(DELETE from NETWORK where ID=2;); $ret = $dbh->do($stmt) or die $DBI::errstr; @@ -124,7 +126,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print STDERR "A total of $ret rows deleted\n"; } - # quit the database + # 断开数据库连接 $dbh->disconnect(); print STDERR "Exit the database\n"; @@ -164,7 +166,7 @@ via: http://xmodulo.com/access-sqlite-database-perl.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 76e531461d601c4c113ef0798f23aae0dccb0bd8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 22:26:04 +0800 Subject: [PATCH 71/76] PUB:20150610 watch--Repeat Linux or Unix Commands Regular Intervals @geekpi --- ...inux or Unix Commands Regular Intervals.md | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) rename {translated/tech => published}/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md (61%) diff --git a/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md similarity index 61% rename from translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md rename to published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md index f5e395c278..b537db3854 100644 --- a/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md +++ b/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md @@ -1,6 +1,6 @@ -watch - 定期重复Linux / Unix命令 +watch:定期重复Linux / Unix命令 ================================================================================ -服务器管理员需要维护系统并保持更新和安全。每天需要尝试大量的指令。一些其他的活动存储在日志中。这些日志定期地更新。为了检车这些更新,需要重复地执行命令。比如,为了读取一个文件需要使用head、tail、cat等命令。这些命令需要重读地执行。watch命令可以用于定期地执行一个命令。 +服务器管理员需要维护系统并保持更新和安全。每天需要运行大量的指令。有些系统进程会记录日志。这些日志不断更新。为了检查这些更新,需要重复地执行命令。比如,为了读取一个日志文件需要使用head、tail、cat等命令。这些命令需要重复地执行。而watch命令可以用于定期地执行一个命令。 ### Watch 命令 ### @@ -8,45 +8,45 @@ watch是一个简单的命令,只有几个选项。watch命令的基本语法 watch [-dhvt] [-n ] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] -watch命令默认每隔2秒执行后面的命令。这个时间根据的是命令执行结束到上次执行的间隔来算的。比如,watch命令可以用于监测日志更新,更新时在文件的后面追加新行,因此tail命令可以用来检测文件的更新。这个命令会持续地运行直到你按下 CTRL + C回到提示符。 +watch命令默认每隔2秒执行后面参数给出的命令。这个时间根据的是命令执行结束到上次执行的间隔来算的。比如,watch命令可以用于监测日志更新,更新是在文件的后面追加新的内容,因此可以用tail命令来检测文件的更新(LCTT 译注:可以直接使用 `tail -f` 主动跟踪某个文件的更新,而不用使用 watch。)。这个命令会持续地运行直到你按下 `CTRL + C`回到提示符。 ### 例子 ### -> 每两秒监测 errors/notices/warning 生成的情况。 +每两秒监测 errors/notices/warning 生成的情况。 watch tail /var/log/messages ![tail messages](http://blog.linoxide.com/wp-content/uploads/2015/06/1.png) -> 用指定的时间监测磁盘的使用率。 +按指定的时间间隔监测磁盘的使用率。 watch df -h ![df -h](http://blog.linoxide.com/wp-content/uploads/2015/06/2.png) -> 对磁盘管理员而言关注高I/O等待导致的磁盘操作尤其是mysql事务是很重要的。 +对磁盘管理员而言,关注高I/O等待导致的磁盘操作尤其是mysql事务是很重要的。 watch mysqladmin processlist ![processlist](http://blog.linoxide.com/wp-content/uploads/2015/06/3.png) -> 监测服务器负载和运行时间。 +监测服务器负载和运行时间。 watch uptime ![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) -> 检测exim排队给用户发送通知队列的大小。 +监测exim给用户发送通知的队列大小。 watch exim -bpc ![exim -bpc](http://blog.linoxide.com/wp-content/uploads/2015/06/9.png) -### 1) 掩饰循环 ### +### 1) 指定延迟 ### watch [-n ] -命令默认运行的间隔用-n改变,下面的命令会在5秒后运行后面的命令: +命令默认运行的时间间隔可用-n改变,下面的命令会在5秒后运行后面的命令: watch -n 5 date @@ -58,13 +58,11 @@ watch命令默认每隔2秒执行后面的命令。这个时间根据的是命 watch [-d or --differences[=cumulative]] -#### 例子 1 #### - -用下面的命令连续地输出时间病观察高亮出来的不同部分。 +例子 1,用下面的命令连续地输出时间并观察高亮出来的不同部分。 watch -n 15 -d date -第一次执行date的输出会被捕捉,15后会会重复运行命令。 +第一次执行date的输出会被记录,15秒后会重复运行命令。 ![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6.png) @@ -72,9 +70,7 @@ watch命令默认每隔2秒执行后面的命令。这个时间根据的是命 ![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6b.png) -#### 例子 2 #### - -让我们来体验一下两个连续的“uptime”命令输出的不同。 +例子 2,让我们来体验一下两个连续的“uptime”命令输出的不同。 watch -n 20 -d uptime @@ -112,13 +108,13 @@ watch命令默认每隔2秒执行后面的命令。这个时间根据的是命 ![version](http://blog.linoxide.com/wp-content/uploads/2015/06/11.png) -**问题** +**不足** 不幸的是,在终端大小调整时,屏幕不能在下次运行前重画。所有用--difference高亮的内容也会在更新时丢失。 ### 总结 ### -watch对系统管理员而言是一个非常强大的工具因为它可以用于监控、日志、运维、性能和系统运行时的吞吐量。人们可以非常简单地格式化和推延watch的输出。任何Linux命令/程序或脚本可以按照所需监测和连续输出。 +watch对系统管理员而言是一个非常强大的工具,因为它可以用于监控、日志、运维、性能和系统运行时的吞吐量。人们可以非常简单地格式化和推延watch的输出。任何Linux命令/程序或脚本可以按照所需监测和连续输出。 -------------------------------------------------------------------------------- @@ -126,7 +122,7 @@ via: http://linoxide.com/linux-command/linux-watch-command/ 作者:[Aun Raza][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 08bddde2f878cc986d61456a921eb11feee9adf8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 23:36:38 +0800 Subject: [PATCH 72/76] PUB:20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods @NearTan --- ... on Ubuntu 15.04 with Different Methods.md | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) rename {translated/tech => published}/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md (82%) diff --git a/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md similarity index 82% rename from translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md rename to published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md index fbbaecb067..e9de420c7d 100644 --- a/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md +++ b/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md @@ -1,11 +1,11 @@ -在Ubuntu下用不同方式安装Node.JS +在Ubuntu下安装Node.JS的不同方式 ================================================================================ -如果你要在Ubuntu 15.04上安装Node.js的话,这篇教程对你来说肯定很重要。Node.js根本上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的event loop来处理异步IO。同时它在平台层面上,面向系统拥有非常实用的文件读写,网络操作功能。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。 +如果你要在Ubuntu 15.04上安装Node.js的话,这篇教程对你来说肯定很重要。Node.js从本质上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的事件循环来处理高吞吐量和非阻塞IO。同时它也是一个提供了通过操作系统读写文件和网络操作功能的平台层。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。 ### 安装Node.JS 的方法### -有许多不同的方法安装Node.JS,我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js,在此之前请卸载旧版本的包以免发生包冲突。 +有许多安装Node.JS的不同的方法,我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js,在此之前请卸载旧版本的包以免发生包冲突。 - 从源代码安装Node.JS - 用包管理器安装Node.JS @@ -14,7 +14,7 @@ ### 1) 从源代码安装Node.JS ### -让我们开始从从源代码安装Node.JS之前,请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装: +让我们开始从源代码安装Node.JS之前,请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装: #### 步骤1: 升级系统 #### @@ -33,7 +33,7 @@ #### 步骤3: 开始安装 #### -现在我们进入源代码的目录然后运行.configuration文件 +现在我们进入源代码的目录,然后运行.configure文件 ![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png) @@ -43,9 +43,9 @@ root@ubuntu-15:~/node-v0.12.4# ./configure root@ubuntu-15:~/node-v0.12.4# make install -### 安装后测试 ### +#### 安装后测试 #### -只要运行一次上面的命令就顺利安装好了Node.JS,现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。 +只要运行一下上面的命令就顺利安装好了Node.JS,现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。 root@ubuntu-15:~/node-v0.12.4# node -v v0.12.4 @@ -73,7 +73,7 @@ #### 步骤1: 用curl获取源代码 #### -在我们用curl获取源代码之前,我们必须先升级操作系统然后用curl命令获取NodeSource添加到本地仓库。 +在我们用curl获取源代码之前,我们必须先升级操作系统,然后用curl命令获取NodeSource添加到本地仓库。 root@ubuntu-15:~#apt-get update root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash - @@ -98,14 +98,13 @@ curl将运行以下任务 ![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png) -#### STEP 3: Installing Build Essentials Tool #### #### 步骤3: 安装一些必备的工具 #### 通过以下命令来安装编译安装一些我们必需的本地插件。 root@ubuntu-15:~# apt-get install -y build-essential -### 通过Node.JS Shell来测试 ### +#### 通过Node.JS Shell来测试 #### 测试Node.JS的步骤与之前使用源代码安装相似,通过以下node命令来确认Node.JS是否完全安装好: @@ -127,7 +126,7 @@ curl将运行以下任务 > root@ubuntu-15:~# -### 使用NodeJS应用进行简单的测试 ### +#### 使用NodeJS应用进行简单的测试 #### REPL是一个Node.js的shell,任何有效的JavaScript代码都能在REPL下运行通过。所以让我们看看在Node.JS下的REPL是什么样子吧。 @@ -163,9 +162,9 @@ REPL是一个Node.js的shell,任何有效的JavaScript代码都能在REPL下 ![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png) -### 使用NodeJS的包管理器 ### +#### 使用NodeJS的包管理器 #### -NPM是一个提供给node脚本连续运行的命令行工具,它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始 +NPM是一个提供给node脚本持续生命力的命令行工具,它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始 root@ubuntu-15:~# npm init @@ -192,14 +191,14 @@ clone仓库之后,通过运行.config命令来编译生成完整的安装包 ![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png) -运行make install命令之后耐心等待几分钟,程序将会安装好Node.JS +运行make install命令之后耐心等待几分钟,程序将会安装好Node.JS。 root@ubuntu-15:~/node# make install root@ubuntu-15:~/node# node -v v0.13.0-pre -### 测试Node.JS ### +#### 测试Node.JS #### root@ubuntu-15:~/node# node > a = [1,2,3,4,5,6,7] @@ -217,7 +216,7 @@ clone仓库之后,通过运行.config命令来编译生成完整的安装包 在最后一种方法中我们我们将用NVM来比较容易安装Node.JS。安装和配制Node.JS,这是最好的方法之一,它可以供我们选择要安装的版本。 -在安装之前,请确认本机以前的安装包已经被卸载 +在安装之前,请确认本机以前的安装包已经被卸载。 #### 步骤1: 安装依赖包 #### @@ -230,11 +229,11 @@ clone仓库之后,通过运行.config命令来编译生成完整的安装包 #### 步骤2: 修改Home环境 #### -用curl从NVM下载必需的包到用户的home目录之后,我们需要修改bash的配制文件添加NVM,之后只要重新登录中断或者用如下命令更新即可 +用curl从NVM下载必需的包到用户的home目录之后,我们需要修改bash的配置文件添加NVM,之后只要重新登录中断或者用如下命令更新即可。 root@ubuntu-15:~# source ~/.profile -现在我们可以用NVM来设置默认的NVM的版本或者用如下命令来指定之前版本: +现在我们可以用NVM来设置默认的NVM的版本,或者用如下命令来指定之前版本: root@ubuntu-15:~# nvm ls root@ubuntu-15:~# nvm alias default 0.12.4 @@ -257,7 +256,7 @@ via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-meth 作者:[Kashif Siddique][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From c34296631a8d5bb25ffe05048a5031f498026c42 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 6 Jul 2015 16:16:17 +0800 Subject: [PATCH 73/76] =?UTF-8?q?20150706-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20150706 PHP Security.md | 359 ++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 sources/tech/20150706 PHP Security.md diff --git a/sources/tech/20150706 PHP Security.md b/sources/tech/20150706 PHP Security.md new file mode 100644 index 0000000000..b942069678 --- /dev/null +++ b/sources/tech/20150706 PHP Security.md @@ -0,0 +1,359 @@ +PHP Security +================================================================================ +![](http://www.codeproject.com/KB/PHP/363897/php_security.jpg) + +### Introduction ### + +When offering an Internet service, you must always keep security in mind as you develop your code. It may appear that most PHP scripts aren't sensitive to security concerns; this is mainly due to the large number of inexperienced programmers working in the language. However, there is no reason for you to have an inconsistent security policy based on a rough guess at your code's significance. The moment you put anything financially interesting on your server, it becomes likely that someone will try to casually hack it. Create a forum program or any sort of shopping cart, and the probability of attack rises to a dead certainty. + +### Background ### + +Here are a few general security guidelines for securing your web content: + +#### Don't trust forms #### + +Hacking forms is trivial. Yes, by using a silly JavaScript trick, you may be able to limit your form to allow only the numbers 1 through 5 in a rating field. The moment someone turns JavaScript off in their browser or posts custom form data, your client-side validation flies out the window. + +Users interact with your scripts primarily through form parameters, and therefore they're the biggest security risk. What's the lesson? Always validate the data that gets passed to any PHP script in the PHP script. In this article, we show you how to analyze and protect against cross-site scripting (XSS) attacks, which can hijack your user's credentials (and worse). You'll also see how to prevent the MySQL injection attacks that can taint or destroy your data. + +#### Don't trust users #### + +Assume that every piece of data your website gathers is laden with harmful code. Sanitize every piece, even if you're positive that nobody would ever try to attack your site. + +#### Turn off global variables #### + +The biggest security hole you can have is having the register_globals configuration parameter enabled. Mercifully, it's turned off by default in PHP 4.2 and later. If **register_globals** is on, then you can disable this feature by turning the register_globals variable to Off in your server's php.ini file : + + register_globals = Off + +Novice programmers view registered globals as a convenience, but they don't realize how dangerous this setting is. A server with global variables enabled automatically assigns global variables to any form parameters. For an idea of how this works and why this is dangerous, let's look at an example. + +Let's say that you have a script named process.php that enters form data into your user database. The original form looked like this: + + + +When running process.php, PHP with registered globals enabled places the value of this parameter into the $username variable. This saves some typing over accessing them through **$_POST['username']** or **$_GET['username']**. Unfortunately, this also leaves you open to security problems, because PHP sets a variable for any value sent to the script via a GET or POST parameter, and that is a big problem if you didn't explicitly initialize the variable and you don't want someone to manipulate it. + +Take the script below, for example—if the $authorized variable is true, it shows confidential data to the user. Under normal circumstances, the $authorized variable is set to true only if the user has been properly authenticated via the hypothetical authenticated_user() function. But if you have **register_globals** active, anyone could send a GET parameter such as authorized=1 to override this: + + + +The moral of the story is that you should pull form data from predefined server variables. All data passed on to your web page via a posted form is automatically stored in a large array called $_POST, and all GET data is stored in a large array called **$_GET**. File upload information is stored in a special array called $_FILES. In addition, there is a combined variable called $_REQUEST. + +To access the username field from a POST method form, use **$_POST['username']**. Use **$_GET['username']** if the username is in the URL. If you don't care where the value came from, use **$_REQUEST['username']**. + + + +$_REQUEST is a union of the $_GET, $_POST, and $_COOKIE arrays. If you have two or more values of the same parameter name, be careful of which one PHP uses. The default order is cookie, POST, then GET. + +#### Recommended Security Configuration Options #### + +There are several PHP configuration settings that affect security features. Here are the ones that should obviously be used for production servers: + +- **register_globals** set to off +- **safe_mode** set to off +- **error_reporting** set to off. This is visible error reporting that sends a message to the user's browser if something goes wrong. For production servers, use error logging instead. Development servers can enable error logging as long as they're behind a firewall. +- Disable these functions: system(), exec(), passthru(), shell_exec(), proc_open(), and popen(). +- **open_basedir** set for both the /tmp directory (so that session information can be stored) and the web root so that scripts cannot access files outside a selected area. +- **expose_php** set to off. This feature adds a PHP signature that includes the version number to the Apache headers. +- **allow_url_fopen** set to off. This isn't strictly necessary if you're careful about how you access files in your code—that is, you validate all input parameters. +- **allow_url_include** set to off. There's really no sane reason for anyone to want to access include files via HTTP. + +In general, if you find code that wants to use these features, you shouldn't trust it. Be especially careful of anything that wants to use a function such as system()—it's almost certainly flawed. + +With these settings now behind us, let's look at some specific attacks and the methods that will help you protect your server. + +### SQL Injection Attacks ### + +Because the queries that PHP passes to MySQL databases are written in the powerful SQL programming language, you run the risk of someone attempting an SQL injection attack by using MySQL in web query parameters. By inserting malicious SQL code fragments into form parameters, an attacker attempts to break into (or disable) your server. + +Let's say that you have a form parameter that you eventually place into a variable named $product, and you create some SQL like this: + + $sql = "select * from pinfo where product = '$product'"; + +If that parameter came straight from the form, use database-specific escapes with PHP's native functions, like this: + + $sql = 'Select * from pinfo where product = '"' + mysql_real_escape_string($product) . '"'; + +If you don't, someone might just decide to throw this fragment into the form parameter: + + 39'; DROP pinfo; SELECT 'FOO + +Then the result of $sql is: + + select product from pinfo where product = '39'; DROP pinfo; SELECT 'FOO' + +Because the semicolon is MySQL's statement delimiter, the database processes these three statements: + + select * from pinfo where product = '39' + DROP pinfo + SELECT 'FOO' + +Well, there goes your table. + +Note that this particular syntax won't actually work with PHP and MySQL, because the **mysql_query()** function allows just one statement to be processed per request. However, a subquery will still work. + +To prevent SQL injection attacks, do two things: + +- Always validate all parameters. For example, if something needs to be a number, make sure that it's a number. +- Always use the mysql_real_escape_string() function on data to escape any quotes or double quotes in your data. + +**Note: To automatically escape any form data, you can turn on Magic Quotes.** + +Some MySQL damage can be avoided by restricting your MySQL user privileges. Any MySQL account can be restricted to only do certain kinds of queries on selected tables. For example, you could create a MySQL user who can select rows but nothing else. However, this is not terribly useful for dynamic data, and, furthermore, if you have sensitive customer information, it might be possible for someone to have access to some data that you didn't intend to make available. For example, a user accessing account data could try to inject some code that accesses another account number instead of the one assigned to the current session. + +### Preventing Basic XSS Attacks ### + +XSS stands for cross-site scripting. Unlike most attacks, this exploit works on the client side. The most basic form of XSS is to put some JavaScript in user-submitted content to steal the data in a user's cookie. Since most sites use cookies and sessions to identify visitors, the stolen data can then be used to impersonate that user—which is deeply troublesome when it's a typical user account, and downright disastrous if it's the administrative account. If you don't use cookies or session IDs on your site, your users aren't vulnerable, but you should still be aware of how this attack works. + +Unlike MySQL injection attacks, XSS attacks are difficult to prevent. Yahoo!, eBay, Apple, and Microsoft have all been affected by XSS. Although the attack doesn't involve PHP, you can use PHP to strip user data in order to prevent attacks. To stop an XSS attack, you have to restrict and filter the data a user submits to your site. It is for this precise reason that most online bulletin boards don't allow the use of HTML tags in posts and instead replace them with custom tag formats such as **[b]** and **[linkto]**. + +Let's look at a simple script that illustrates how to prevent some of these attacks. For a more complete solution, use SafeHTML, discussed later in this article. + + function transform_HTML($string, $length = null) { + // Helps prevent XSS attacks + // Remove dead space. + $string = trim($string); + // Prevent potential Unicode codec problems. + $string = utf8_decode($string); + // HTMLize HTML-specific characters. + $string = htmlentities($string, ENT_NOQUOTES); + $string = str_replace("#", "#", $string); + $string = str_replace("%", "%", $string); + $length = intval($length); + if ($length > 0) { + $string = substr($string, 0, $length); + } + return $string; + } + +This function transforms HTML-specific characters into HTML literals. A browser renders any HTML run through this script as text with no markup. For example, consider this HTML string: + + Bold Text + +Normally, this HTML would render as follows: + + Bold Text + +However, when run through **transform_HTML()**, it renders as the original input. The reason is that the tag characters are HTML entities in the processed string. The resulting string from **HTML()** in plaintext looks like this: + + <STRONG>Bold Text</STRONG> + +The essential piece of this function is the htmlentities() function call that transforms <, >, and & into their entity equivalents of **<**, **>**, and **&**. Although this takes care of the most common attacks, experienced XSS hackers have another sneaky trick up their sleeve: Encoding their malicious scripts in hexadecimal or UTF-8 instead of normal ASCII text, hoping to circumvent your filters. They can send the code along as a GET variable in the URL, saying, "Hey, this is hexadecimal code, but could you run it for me anyway?" A hexadecimal example looks something like this: + + + +But when the browser renders that information, it turns out to be: + + + +To prevent this, transform_HTML() takes the additional steps of converting # and % signs into their entity, shutting down hex attacks, and converting UTF-8–encoded data. + +Finally, just in case someone tries to overload a string with a very long input, hoping to crash something, you can add an optional $length parameter to trim the string to the maximum length you specify. + +### Using SafeHTML ### + +The problem with the previous script is that it is simple, and it does not allow for any kind of user markup. Unfortunately, there are hundreds of ways to try to sneak JavaScript past someone's filters, and short of stripping all HTML from someone's input, there's no way of stopping it. + +Currently, there's no single script that's guaranteed to be unbreakable, though there are some that are better than most. There are two approaches to security, whitelisting and blacklisting, and whitelisting tends to be less complicated and more effective. + +One whitelisting solution is the SafeHTML anti-XSS parser from PixelApes. + +SafeHTML is smart enough to recognize valid HTML, so it can hunt and strip any dangerous tags. It does its parsing with another package called HTMLSax. + +To install and use SafeHTML, do the following: + +1. Go to [http://pixel-apes.com/safehtml/?page=safehtml][1] and download the latest version of SafeHTML. +1. Put the files in the classes directory on your server. This directory contains everything that SafeHTML and HTMLSax need to function. +1. Include the SafeHTML class file (safehtml.php) in your script. +1. Create a new SafeHTML object called $safehtml. +1. Sanitize your data with the $safehtml->parse() method. + +Here's a complete example: + + alert('XSS Attack')"; + // Create a safehtml object. + $safehtml = new safehtml(); + // Parse and sanitize the data. + $safe_data = $safehtml->parse($data); + // Display result. + echo 'The sanitized data is
' . $safe_data; + ?> + +If you want to sanitize any other data in your script, you don't have to create a new object; just use the $safehtml->parse() method throughout your script. + +#### What Can Go Wrong? #### + +The biggest mistake you can make is assuming that this class completely shuts down XSS attacks. SafeHTML is a fairly complex script that checks for almost everything, but nothing is guaranteed. You still want to do the parameter validation that applies to your site. For example, this class doesn't check the length of a given variable to ensure that it fits into a database field. It doesn't check for buffer overflow problems. + +XSS hackers are creative and use a variety of approaches to try to accomplish their objectives. Just look at RSnake's XSS tutorial at [http://ha.ckers.org/xss.html][2] to see how many ways there are to try to sneak code past someone's filters. The SafeHTML project has good programmers working overtime to try to stop XSS attacks, and it has a solid approach, but there's no guarantee that someone won't come up with some weird and fresh approach that could short-circuit its filters. + +**Note: For an example of the powerful effects of XSS attacks, check out [http://namb.la/popular/tech.html][3], which shows a step-by-step approach to creating the JavaScript XSS worm that overloaded the MySpace servers. ** + +### Protecting Data with a One-Way Hash ### + +This script performs a one-way transformation on data—in other words, it can make a hash signature of someone's password, but you can't ever decrypt it and go back to the original password. Why would you want to do that? The application is in storing passwords. An administrator doesn't need to know users' passwords—in fact, it's a good idea that only the user knows his or her password. The system (and the system alone) should be able to identify a correct password; this has been the Unix password security model for years. One-way password security works as follows: + +1. When a user or administrator creates or changes an account password, the system hashes the password and stores the result. The host system discards the plaintext password. +1. When the user logs in to a system via any means, the entered password is again hashed. +1. The host system throws away the plaintext password entered. +1. This newly hashed password is compared against the stored hash. +1. If the hashed passwords match, then the system grants access. + +The host system does this without ever knowing the original password; in fact, the original value is completely irrelevant. As a side effect, should someone break into your system and steal your password database, the intruder will have a bunch of hashed passwords without any way of reversing them to find the originals. Of course, given enough time, computer power, and poorly chosen user passwords, an attacker could probably use a dictionary attack to figure out the passwords. Therefore, don't make it easy for people to get their hands on your password database, and if someone does, have everyone change their passwords. + +#### Encryption Vs Hashing #### + +Technically speaking, this process is not encryption. It is a hash, which is different from encryption for two reasons: + +Unlike in encryption, data cannot be decrypted. + +It's possible (but extremely unlikely) that two different strings will produce the same hash. There's no guarantee that a hash is unique, so don't try to use a hash as something like a unique key in a database. + + function hash_ish($string) { + return md5($string); + } + +The md5() function returns a 32-character hexadecimal string, based on the RSA Data Security Inc. Message-Digest Algorithm (also known, conveniently enough, as MD5). You can then insert that 32-character string into your database, compare it against other md5'd strings, or just adore its 32-character perfection. + +#### Hacking the Script #### + +It is virtually impossible to decrypt MD5 data. That is, it's very hard. However, you still need good passwords, because it's still easy to make a database of hashes for the entire dictionary. There are online MD5 dictionaries where you can enter **06d80eb0c50b49a509b49f2424e8c805** and get a result of "dog." Thus, even though MD5s can't technically be decrypted, they're still vulnerable—and if someone gets your password database, you can be sure that they'll be consulting an MD5 dictionary. Thus, it's in your best interests when creating password-based systems that the passwords are long (a minimum of six characters and preferably eight) and contain both letters and numbers. And make sure that the password isn't in the dictionary. + +### Encrypting Data with Mcrypt ### + +MD5 hashes work just fine if you never need to see your data in readable form. Unfortunately, that's not always an option—if you offer to store someone's credit card information in encrypted format, you need to decrypt it at some later point. + +One of the easiest solutions is the Mcrypt module, an add-in for PHP that allows high-grade encryption. The Mcrypt library offers more than 30 ciphers to use in encryption and the possibility of a passphrase that ensures that only you (or, optionally, your users) can decrypt data. + +Let's see some hands-on use. The following script contains functions that use Mcrypt to encrypt and decrypt data: + + + +The **mcrypt()** function requires several pieces of information: + +- The data to encrypted. +- The passphrase used to encrypt and unlock your data, also known as the key. +- The cipher used to encrypt the data, which is the specific algorithm used to encrypt the data. This script uses **MCRYPT_SERPENT_256**, but you can choose from an array of fancy-sounding ciphers, including **MCRYPT_TWOFISH192**, **MCRYPT_RC2**, **MCRYPT_DES**, and **MCRYPT_LOKI97**. +- The mode used to encrypt the data. There are several modes you can use, including Electronic Codebook and Cipher Feedback. This script uses **MCRYPT_MODE_CBC**, Cipher Block Chaining. +- An **initialization vector**—also known as an IV, or a seed—an additional bit of binary data used to seed the encryption algorithm. That is, it's something extra thrown in to make the algorithm harder to crack. +- The length of the string needed for the key and IV, which vary by cipher and block. Use the **mcrypt_get_key_size()** and **mcrypt_get_block_size()** functions to find the appropriate length; then trim the key value to the appropriate length with a handy **substr()** function. (If the key is shorter than the required value, don't worry—Mcrypt pads it with zeros.) + +If someone steals both your data and your passphrase, they can just cycle through the ciphers until finding the one that works. Thus, we apply the additional security of using the **md5()** function on the key before we use it, so even having both data and passphrase won't get the intruder what she wants. + +An intruder would need the function, the data, and the passphrase all at once—and if that is the case, they probably have complete access to your server, and you're hosed anyway. + +There's a small data storage format problem here. Mcrypt returns its encrypted data in an ugly binary format that causes horrific errors when you try to store it in certain MySQL fields. Therefore, we use the **base64encode()** and **base64decode()** functions to transform the data into a SQL-compatible alphabetical format and retrieve rows. + +#### Hacking the Script #### + +In addition to experimenting with various encryption methods, you can add some convenience to this script. For example, rather than providing the key and mode every time, you could declare them as global constants in an included file. + +### Generating Random Passwords ### + +Random (but difficult-to-guess) strings are important in user security. For example, if someone loses a password and you're using MD5 hashes, you won't be able to, nor should you want to, look it up. Instead, you should generate a secure random password and send that to the user. Another application for random number generation is creating activation links in order to access your site's services. Here is a function that creates a password: + + 0) && + (! is_null($num_chars))) { + $password = ''; + $accepted_chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; + // Seed the generator if necessary. + srand(((int)((double)microtime()*1000003)) ); + for ($i=0; $i<=$num_chars; $i++) { + $random_number = rand(0, (strlen($accepted_chars) -1)); + $password .= $accepted_chars[$random_number] ; + } + return $password; + } + } + ?> + +#### Using the Script #### + +The **make_password()** function returns a string, so all you need to do is supply the length of the string as an argument: + + + +The function works as follows: + +- The function makes sure that **$num_chars** is a positive nonzero integer. +- The function initializes the **$password** variable to an empty string. +- The function initializes the **$accepted_chars** variable to the list of characters the password may contain. This script uses all lowercase letters and the numbers 0 through 9, but you can choose any set of characters you like. +- The random number generator needs a seed, so it gets a bunch of random-like values. (This isn't strictly necessary on PHP 4.2 and later.) +- The function loops **$num_chars** times, one iteration for each character in the password to generate. +- For each new character, the script looks at the length of **$accepted_chars**, chooses a number between 0 and the length, and adds the character at that index in **$accepted_chars** to $password. +- After the loop completes, the function returns **$password**. + +### License ### + +This article, along with any associated source code and files, is licensed under [The Code Project Open License (CPOL)][4] + +-------------------------------------------------------------------------------- + +via: http://www.codeproject.com/Articles/363897/PHP-Security + +作者:[SamarRizvi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.codeproject.com/script/Membership/View.aspx?mid=7483622 +[1]:http://pixel-apes.com/safehtml/?page=safehtml +[2]:http://ha.ckers.org/xss.html +[3]:http://namb.la/popular/tech.html +[4]:http://www.codeproject.com/info/cpol10.aspx \ No newline at end of file From a2479964eaa7e43eb07a721ce62e7ba131d37be8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 6 Jul 2015 22:24:09 +0800 Subject: [PATCH 74/76] PUB:20150618 What will be the future of Linux without Linus @wi-cuckoo --- ...ll be the future of Linux without Linus.md | 186 +++++++++++++++++ ...ll be the future of Linux without Linus.md | 189 ------------------ 2 files changed, 186 insertions(+), 189 deletions(-) create mode 100644 published/20150618 What will be the future of Linux without Linus.md delete mode 100644 translated/talk/20150618 What will be the future of Linux without Linus.md diff --git a/published/20150618 What will be the future of Linux without Linus.md b/published/20150618 What will be the future of Linux without Linus.md new file mode 100644 index 0000000000..ff30e8b4cf --- /dev/null +++ b/published/20150618 What will be the future of Linux without Linus.md @@ -0,0 +1,186 @@ +没有 Linus,Linux 的未来是什么样子? +============================================================================== +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) + +这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 + +**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?** + +Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。 + +所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是希望我们能够持续专注于Linux的发展。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。 + +**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?** + +Linus:我并没有看到太多交叉的地方,除了我认为 Solaris 会使用更多的 Linux 用户空间工具(对我自己来说并没有太多关注这个,因为我真的只关心内核)。Linux 桌面比起传统 Solaris 桌面好多了,而且我希望 Solaris 移植越来越多的 Linux 的东西,朝着一个更加类 Linux 的模式前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ,但是当时,整个开源社区确实期望接受 Solaris 一些遗产。) + +从纯内核方面讲,许可证的存在意味着没有太多的合作空间,但是如果这种情况发生改变将会变得很有趣。Sun 已经声称将在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证的差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。 + +**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?** + +Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也不认为它是一个糟糕的许可证。我只是认为它没有 GPLv2 一样‘伟大’。 + +所以,如果没有 GPLv2,我觉得自己将会使用 GPLv3。不过,既然我已经有了一个更好的选择,我为什么还要考虑它呢? + +这就是说,我始终秉承实用主义精神,并且我认为“ GPLv3 不像 GPLv2 一样好”这件事并不是一个‘非黑即白’的问题。这就像是一个天平,如果 GPLv3 有了其他的优点作为砝码,很有可能那些优点会让我对 GPLv3 更偏爱一些。 + +恕我直言,我到现在还并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的许可证不兼容性这一条就分量足够了,足以值得我们去尝试将 Linux 的内核重新在 GPLv3 许可证下发布。不过,请不要误解,我认为这是不大可能的。但是我确实想澄清我本质上并不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。(LCTT 译注:事实上,Solaris/OpenSolaris 最终也没采用 GPL 许可协议发布,而 20100年之后,已经没有什么动静了。而 Linux 内核最终也没有更换到 GPLv3 上。) + +总的来说,我使用很多其他许可证下的程序。我可能没有把任何一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。 + +**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?** + +(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。) + +Linus:我不得不承认,我并没有与来自印度的任何人直接合作过,尽管我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用总是独自工作。 + +我相信大多数人的社交基本上是受限制的,只对很少的人十分了解(比如你最亲近的家人和朋友),我也努力构造这样一个开发模型来改变这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 + +所以,我偶然会与上百个发给我一两个不确定的补丁的开发者联系。我试着去建立一些由我熟知的人组成的小团体,我认为那就是人们工作的方式,当然也是我喜欢工作的方式。 + +同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最紧密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! + +**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面的话?** + +Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说 Linux “严重依赖”于我。 + +所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都很健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够毫无困难地接替我的角色。 + +**Q:印度是软件工程师的主要产地之一,但是我们没有在 Linux 领域做太多贡献。你觉得为什么印度人没有积极参与Linux?如果我们鼓励印度人参与并为 Linux 做更大的贡献,你觉得如何?你会乐意用你个人作为榜样激励印度工程师吗?** + +Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件:信息流和文化(用你的话说是互联网和教育),我甚至不知道这其中哪个是最大的障碍。 + +在很多方面,至少在那些印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 + +当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区会是最好的途径,而且我猜测你们已经拥有这样的社区了。 + +至于我的‘偶像’形象,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘偶像’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 + +**Q:什么样的理由会让你考虑去访问印度?** + +Linus:如前一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非在中国召开一次世界性的 LinuxCon。) + +**Q:最近你好像在抨击 Subversion 与 CVS,质问他们的架构基础。现在你已经从 Subversion 和 CVS 社区那里得到回应,你是否改变了看法,还是说并没有被说服?** + +Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 + +做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” + +但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道之前就有人这样认为的话,我就不会那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不相信任何人会认为 SVN 是‘好的’。 + +我认为,SVN 就是一个‘还好’的经典案例。人们过去经常使用 SVN,并且它也‘还好’地广泛使用,但是它的‘还好’就如 DOS 与 Windows 的‘还好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其感到兴奋。 + +Git,从另外方面讲,其身后有一些‘UNIX 哲学’,这和 UNIX 无关。实质上,就像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西只是内容寻址数据库中的一个对象”。 + +**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是选择太多了就是干扰。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版,这样在企业级市场去挑战微软是不是更容易些呢?对此你怎么看?** + +Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。 + +但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。 + +**Q:为什么你觉得 CFS 比 SD 更好?** + +Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。 + +但是一部分原因就简单的与用户有关,大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称 SD 最强的一点)。 + +尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 + +**Q:在 Google 的一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?** + +Linus:啊哈,那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 + +无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期的 SCM (源代码控制系统)导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! + +坦白来说,我认为关于如何‘习惯它’没有任何其他答案,而只能是去开始使用和尝试它。显然,你不会冒险率先导入你现有的最大、最重要的项目,那确实会导致工作停顿下来,然后使得每个人都很不高兴。 + +所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要从公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。 + +接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。 + +所以,你基本上只会一次转移一个模块,直到你发现使用 git 是如此酸爽,这时你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。 + +git 最赞的一个功能是,它实际上可以同很多其他 SCM 相处很好。很多 git 用户使用它的时候,与他们一起工作的人并没有发现,因为他们看到 git 的结果,会联想到一些传统的 SCM 上去。 + +**Q:Linux 用了你在 Transmeta(全美达)上实现备用指令集的经验吗?[Transmeta Crusoe 芯片看起来像一个非常轻量级的 CPU — 记得有一台 Burroughs B1000 解释器,它实际上实现了多个虚拟机。有的用于系统软件,有的用于 Cobol,还有的用于 Fortran;如果没错的话,那么人们可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构,或适用于 JVM 的指令集,等等。(LCTT 译注:Linus 于 1997-2003 期间就职于全美达)]** + +Linus:我们确实有一些备选的结构集合,不过我不打算谈论太多这个,我可以说的是我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑 x86 指令和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。 + +我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个特定的编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。 + +(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) + +有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。 + +**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 创造了发展空间,迄今为止,让 Linux 比 BSD 变得更好?** + +Linus:我认为这不仅是一个许可证问题,也是一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将他的修改返回来。因此,哪怕实际上这种事情没有(而实际上,这种事情的确发生了,比如 BSDi),人们也难以建立彼此信任。 + +相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以每个人都不会占你便宜。 + +所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。 + +那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。 + +所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。 + +这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。 + +换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。 + +而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你就准备好让我对你的设备动手动脚吧”,看见了没?在我看来,不但小气,而且小心眼。 + +**Q:-rt 代码树的功能正在缓慢而稳定地逐渐集成到主线代码中。你对将剩余的 -rt 树合并到主线代码的看法是什么?(我说的不是 CFS)** + +Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。 + +我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对我们所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。 + +顺便说一句,这不仅仅是针对 -rt ,它也出现在许多开发中。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者直接参与到了常规内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。 + +**Q:我对 Linux 内核所支持的文件系统发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 的新项目哪个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?** + +Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户发现他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是来自内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。 + +最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。 + +相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和传统硬盘的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理硬盘延迟。 + +**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的办公软件影响力越来越大。你认为操作系统将走向何方?** + +Linus:我并不真的认可‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且即便当到处可以接入时,它也并不是‘无处不在’。 + +所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化,现在已经不是操作系统刚刚起步的六十年代,甚至连硬件也和过去完全不同了! + +所以,别指望一场革命。我认为操作系统将在很大程度上继续它们所擅长的,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生巨变的是界面和操作系统顶层的那些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。 + +至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你特别想知道在机器里面真正在发生什么。 + +**Q:最近我听说你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?** + +Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做到更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。 + +在其它架构下运行是非常有趣的(alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的,也许未来十年并不需要使用 x86 作为主要架构,我认为或许是 ARM,这得益于移动设备市场的发展。 + +**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?** + +Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显然也是我的工作,我非常高兴工作和兴趣能合二为一。 + +我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux,但是可以肯定的是,对开源的深层思考是我非常重视的。所以我并不是因为什么明确的理由做 Linux,也不能说是它在激励我,但是我的确在思考开源是如何工作。 + +**Q:微软的‘黑衣人’有没有和你交谈过?** + +Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ + +作者:[Swapnil Bhartiya][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy) +校对:mahua, [wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/arnieswap/ + diff --git a/translated/talk/20150618 What will be the future of Linux without Linus.md b/translated/talk/20150618 What will be the future of Linux without Linus.md deleted file mode 100644 index c880921853..0000000000 --- a/translated/talk/20150618 What will be the future of Linux without Linus.md +++ /dev/null @@ -1,189 +0,0 @@ -没有 Linus,Linux 的未来是什么样子? -============================================================================== -![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) - -这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 - -**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?** - -Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。 - -所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。 - -**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?** - -Linus:我并不能看到整个重叠的地方,除了我认为 Solaris 会开始使用更多的 Linux 用户空间的工具(显然对我自己来说没有太多关注这个 — 我真的只关心内核)。Linux 的桌面比起传统 Solaris 拥有的好多了,而且我希望 Solaris 移植越来越多的Linux的东西,朝着一个更加类 Linux 的模型前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ) - -从纯内核方面讲,许可证的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun 已经声明在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。 - -**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?** - -Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也认为它不是一个糟糕的许可证。我只是认为它没有 GPLv2一般的‘伟大’。 - -所以,由于没有了 GPLv2,我觉得自己将会使用 GPLv3。不过,如果我有了一个更好的选择,我为什么不应该考虑一下呢? - -这就是说,我努力保持实用主义精神,并且我认为 GPLv3 不像 GPLv2 一样好这件事并不是一个‘非黑即白’的问题。这是一个平衡做法。如果 GPLv3 有其他的优点,可能那些优点会在很大程度上扭转喜爱 GPLv3 的天平。 - -恕我直言,我并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的非兼容的许可证这条足够称为一个优点,可能也许值得去尝试将Linux的内核重新在 GPLv3 许可证下发布。 - -不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。 - -总的来说,我使用很多其他许可证下的程序。我可能没有把一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。 - -**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?** - -(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。) - -Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。换句话说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 - -我非常相信大多数人的社交基本上是受限制的,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 - -所以,当我偶然会与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的群体间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 - -同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! - -**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** - -Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说Linux“严重依赖”于我。 - -所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够没有什么困难地接替我。 - -**Q:印度是软件工程师的主要产地之一,当然我们没有在 Linux 领域做太多贡献。你觉得什么是让印度人在Linux领域变得主动的?如果我们鼓励印度人参与并为Linux做更大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来顾问那些爱好者吗?** - -Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件(互联网和教育,如你说的):信息流和文化,我甚至不知道这其中哪个是最大的障碍。 - -在很多方面,至少那些在印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 - -当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 - -至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 - -**Q:什么样的理由会让你考虑去访问印度?** - -Linus:如第一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非世界性的 LinuxCon 在中国召开一次。) - -**Q:最近,你好像在抨击 Subversion 与 CVS,质问他们的基础架构。现在你已经从 Subversion 和 CVS 社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** - -Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 - -做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” - -但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道少数人确实这样争论过了,我之前就不该那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不认为任何人都可以争论 SVN 是‘好的’。 - -我认为,SVN 就是一个‘足够好’的经典案例。人们过去经常使用 SVN,并且它也‘足够好’地广泛使用,但是它的足够好完全如 DOS 与 Windows 的‘足够好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 - -Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它并不关系到 UNIX,实质上,只是像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 - -**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人想被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** - -Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。 - -但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。 - -**Q:为什么你觉得 CFS 比 SD 更好?** - -Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。 - -但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称SD 最强的一点)。 - -同时,尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 - -**Q:在 Google 一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?** - -Linus:啊哈。那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 - -无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期 SCM 导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! - -坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最重要的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 - -所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。 - -接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。 - -所以,你基本上有一次转移一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。 - -git 最赞的一个功能是,它实际上可以同很多其他 SCM(源代码控制管理)相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用 git ,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的 SCM 上去。 - -**Q:在 Transmeta(全美达)上他们有备用指令集实现的经验吗?[Transmeta Crusoe 芯片看起来像一个非常弱的 CPU — 记得有一台 Burroughs B1000 的解释器,它实际上实现了多个虚拟机。有一台是用于系统软件,一台是用于 Cobol,一台用于 Fortran;如果没错的话,那么一个人可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构或适用于 JVM 的指令集,等等。]** - -Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑x86结构和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。 - -我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个 test 编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。 - -(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) - -有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。 - -**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 保护了自由,迄今为止,让 Linux 比 BSD 变得更好?** - -Linus:我认为这是一个许可证问题和一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将将他的修改返回来。因此,实际上并不会真的发生这种事情(以 BSD 而言,如 BSDi),人们并不真的彼此‘信任’。 - -相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以不会试着从你这里白白占走好处。 - -所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。 - -那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。 - -所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。 - -这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。 - -换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。 - -而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你最好可以让我对你的设备动手动脚”,看见了没?在我看来,不但小气,而且小心眼。 - -**Q:-rt 树的功能正在缓慢而稳定地逐渐集成到主线代码中。你当前对合并剩余的 -rt 树到主线代码的看法是什么?(我说的不是 CFS)** - -Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。 - -我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。 - -顺便说一句,这不仅仅是针对 -rt ,它也在许多开发中出现。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者也直接涉及到了普通的内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。 - - -**Q:我对 Linux 内核支持的文件系统的发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 发起那个新项目那个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?** - -Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是在内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。 - -最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。 - -相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和旋转介质的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理旋转介质的延迟。 - -**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的基本办公软件正在发挥影响力。你认为操作系统将走向何方?** - -Linus:我并不真的相信‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且当到处可以接入时,它也并不是‘无处不在’。 - -所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化:人们并不能回到‘傻傻的’六十年代,甚至连硬件也和过去的‘那个’完全不同了! - -所以,别指望一场革命。我认为操作系统将更多继续它们所做哪些事情,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生根本性改变的是界面和操作系统顶层的哪些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。 - -至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你非常想知道在机器里面真正在做什么。 - -**Q:最近我听说,你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?** - -Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做的更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。 - -在其它架构下运行是非常有趣的(我把 alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的将来自以下,比如也许我们将来十年并不需要使用 x86 作为我们的主要架构,我认为也许是 ARM,这得益于移动设备市场。 - -**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?** - -Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显示也是我的工作,我非常高兴工作和兴趣能合二为一。 - -我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux (字面上的做是因为它有趣),但是可以肯定的是,我欣赏我认为开源为何这么棒的深层原因。所以我并不是因为什么高大上的理由做 Linux 的,而且我不能诚恳地说是它在激励我,但是我最终会思考为什么会这样。 - -**Q:微软的‘黑衣人’有没有和你交谈过?** - -Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。 - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ - -作者:[Swapnil Bhartiya][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxveda.com/author/arnieswap/ - From c61495a3defd329e5364a3882a8d703bdc09d3ea Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 7 Jul 2015 09:26:45 +0800 Subject: [PATCH 75/76] [Translated]20150515 Lolcat--A Command Line Tool to Output Rainbow of Colors in Linux Terminal.md --- ...put Rainbow Of Colors in Linux Terminal.md | 178 ------------------ ...put Rainbow Of Colors in Linux Terminal.md | 175 +++++++++++++++++ 2 files changed, 175 insertions(+), 178 deletions(-) delete mode 100644 sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md create mode 100644 translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md diff --git a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md deleted file mode 100644 index 194b295ab9..0000000000 --- a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md +++ /dev/null @@ -1,178 +0,0 @@ -FSSlc translating - -Lolcat – A Command Line Tool to Output Rainbow Of Colors in Linux Terminal -================================================================================ -For those who believe that Linux Command Line is boring and there isn’t any fun, then you’re wrong here are the articles on Linux, that shows how funny and naughty is Linux.. - -- [20 Funny Commands of Linux or Linux is Fun in Terminal][1] -- [6 Interesting Funny Commands of Linux (Fun in Terminal)][2] -- [Fun in Linux Terminal – Play with Word and Character Counts][3] - -Here in this article, I will be discussing about a small utility called “lolcat” – Which produce rainbow of colors in terminal. - -![Lolcat Command to Output Rainbow of Colors for Terminal](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) - -Lolcat Command to Output Rainbow of Colors for Terminal - -#### What is lolcat? #### - -Lolcat is an utility for Linux, BSD and OSX which concatenates like similar to [cat command][4] and adds rainbow coloring to it. Lolcat is primarily used for rainbow coloring of text in Linux Terminal. - -### Installation of Lolcat in Linux ### - -**1. Lolcat utility is available in the repository of lots of Linux distributions, but the available version bit older. Alternatively you can download and install latest version of lolcat from git repository.** - -Lolcat is a ruby gem hence it is essential to have latest version of RUBY installed on your system. - - # apt-get install ruby [On APT based Systems] - # yum install ruby [On Yum based Systems] - # dnf install ruby [On DNF based Systems] - -Once ruby package has been installed, make sure to verify the version of ruby installed. - - # ruby --version - - ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] - -**2. Next download and install the most recent version of lolcat from the git repository using following commands.** - - # wget https://github.com/busyloop/lolcat/archive/master.zip - # unzip master.zip - # cd lolcat-master/bin - # gem install lolcat - -Once lolcat is installed, you can check the version. - - # lolcat --version - - lolcat 42.0.99 (c)2011 moe@busyloop.net - -### Usage of Lolcat ### - -**3. Before starting usage of lolcat, make sure to know the available options and help using following command.** - - # lolcat -h - -![Lolcat Help](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) - -Lolcat Help - -**4. Next, pipeline lolcat with commads say ps, date and cal as:** - - # ps | lolcat - # date | lolcat - # cal | lolcat - -![ps Command Output](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) - -ps Command Output - -![Date Output](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) - -Date Output - -![Calendar Output](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) - -Calendar Output - -**5. 3. Use lolcat to display codes of a script file as:** - - # lolcat test.sh - -![Display Codes with Lolcat](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) - -Display Codes with Lolcat - -**6. Pipeline lolcat with figlet command. Figlet is a utility which displays large characters made up of ordinary screen characters. We can pipeline the output of figlet with lolcat to make the output colorful as:** - - # echo I ❤ Tecmint | lolcat - # figlet I Love Tecmint | lolcat - -![Colorful Texts](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) - -Colorful Texts - -**Note**: Not to mention that ❤ is an unicode character and to install figlet you have to yum and apt to get the required packages as: - - # apt-get figlet - # yum install figlet - # dnf install figlet - -**7. Animate a text in rainbow of colours, as:** - - $ echo I ❤ Tecmit | lolcat -a -d 500 - -![Animated Text](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) - -Animated Text - -Here the option -a is for Animation and -d is for duration. In the above example duration count is 500. - -**8. Read a man page (say man ls) in rainbow of colors as:** - - # man ls | lolcat - -![List Files Colorfully](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) - -List Files Colorfully - -**9. Pipeline lolcat with cowsay. cowsay is a configurable thinking and/or speaking cow, which supports a lot of other animals as well.** - -Install cowsay as: - - # apt-get cowsay - # yum install cowsay - # dnf install cowsay - -After install, print the list of all the animals in cowsay as: - - # cowsay -l - -**Sample Output** - - Cow files in /usr/share/cowsay/cows: - apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default - dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep - ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala - mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep - skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey - turtle tux unipony unipony-smaller vader vader-koala www - -Output of cowsay pipelined with lolcat and ‘gnu‘ cowfile is used. - - # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat - -![Cowsay with Lolcat](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) - -Cowsay with Lolcat - -**Note**: You can use lolcat with any other command in pipeline and get colored output in terminal. - -**10. You may create alias for the most frequently used commands to get command output in rainbow of colors. You can alias ‘ls -l‘ command which is used for long list the contents of directory as below.** - - # alias lolls="ls -l | lolcat" - # lolls - -![Alias Commands with Colorful](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) - -Alias Commands with Colorful - -You may create alias for any command as suggested above. To create permanent alias, you have to add the relevant code (above code for ls -l alias) to ~/.bashrc file and also make sure to logout and login back for the changes to be taken into effect. - -That’s all for now. I would like to know if you were aware of lolcat previously? Did you like the post? And suggestion and feedback is welcome in the comment section below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ -[2]:http://www.tecmint.com/linux-funny-commands/ -[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ -[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ diff --git a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md new file mode 100644 index 0000000000..4ce0ef80d0 --- /dev/null +++ b/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -0,0 +1,175 @@ +Lolcat – 一个在 Linux 终端中输出彩虹特效的命令行工具 +================================================================================ +那些相信 Linux 命令行是单调无聊且没有任何乐趣的人们,你们错了,这里有一些有关 Linux 的文章,它们展示着 Linux 是如何的有趣和“淘气” 。 + +- [20 个有趣的 Linux 命令或在终端中 Linux 是有趣的][1] +- [6 个有趣的好玩 Linux 命令(在终端中的乐趣)][2] +- [在 Linux 终端中的乐趣 – 把玩文字和字符计数][3] + +在本文中,我将讨论一个名为“lolcat”的应用 – 它在终端中生成彩虹般的颜色。 + +![为终端生成彩虹般颜色的输出的 Lolcat 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) + +为终端生成彩虹般颜色的输出的 Lolcat 命令 + +#### 何为 lolcat ? #### + +Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 原本用于在 Linux 终端中为文本添加彩虹般的色彩。 + +### 在 Linux 中安装 Lolcat ### + +**1. Lolcat 应用在许多 Linux 发行版本的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** + +由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中安装有最新版本的 RUBY 是必须的。 + + # apt-get install ruby [在基于 APT 的系统中] + # yum install ruby [在基于 Yum 的系统中] + # dnf install ruby [在基于 DNF 的系统中] + +一旦 ruby 软件包安装成功,请确保验证安装的 ruby 的版本。 + + # ruby --version + + ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] + +**2. 接着使用下面的命令来从 lolcat 的 git 仓库中下载和安装最新版本的 lolcat。** + + # wget https://github.com/busyloop/lolcat/archive/master.zip + # unzip master.zip + # cd lolcat-master/bin + # gem install lolcat + +一旦 lolcat 安装后,你可以检查它的版本号。 + + # lolcat --version + + lolcat 42.0.99 (c)2011 moe@busyloop.net + +### Lolcat 的用法 ### + +**3. 在开始使用 lolcat 之前,使用下面的命令来了解它可用的选项和其帮助文档。** + + # lolcat -h + +![Lolcat 的帮助文档](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) + +Lolcat 的帮助文档 + +**4. 接着, 通过管道连接 lolcat 和其他命令,例如 ps, date 和 cal:** + + # ps | lolcat + # date | lolcat + # cal | lolcat + +![ps 命令的输出](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) + +ps 命令的输出 + +![Date 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) + +Date 的输出 + +![Calendar 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) + +Calendar 的输出 + +**5. 使用 lolcat 来展示一个脚本文件的代码:** + + # lolcat test.sh + +![用 lolcat 来展示代码](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) + +用 lolcat 来展示代码 + +**6. 通过管道连接 lolcat 和 figlet 命令。Figlet 是一个展示由常规的屏幕字符组成的巨大字符串的应用。我们可以通过管道将 figlet 的输出连接到 lolcat 中来给出如下的多彩输出:** + + # echo I ❤ Tecmint | lolcat + # figlet I Love Tecmint | lolcat + +![多彩的文字](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) + +多彩的文字 + +**注**: 毫无疑问 ❤ 是一个 unicode 字符并且为了安装 figlet,你需要像下面那样使用 yum 和 apt 来得到这个软件包: + + # apt-get figlet + # yum install figlet + # dnf install figlet + +**7. 给文本赋予彩虹颜色的动画:** + + $ echo I ❤ Tecmit | lolcat -a -d 500 + +![动的文本](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) + +动的文本 + +这里选项 `-a` 指的是 Animation(动画), `-d` 指的是 duration(持续时间)。在上面的例子中,持续 500 次动画。 + +**8. 在彩虹般的颜色下阅读 man 页(例如 `man ls`):** + + # man ls | lolcat + +![多彩地显示文件](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) + +多彩地显示文件 + +**9. 通过管道连接 lolcat 和 cowsay。cowsay 是一个可配置的正在思考或说话的奶牛,这个程序也支持其他的动物。** + +使用下面的命令来安装 cowsay : + + # apt-get cowsay + # yum install cowsay + # dnf install cowsay + +安装后,使用下面的命令来显示在 cowsay 中的所有动物: + + # cowsay -l + +**样例输出** + + Cow files in /usr/share/cowsay/cows: + apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default + dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep + ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala + mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep + skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey + turtle tux unipony unipony-smaller vader vader-koala www + +通过管道连接 lolcat 和 cowsay 后的输出,并且使用了‘gnu’cowfile。 + + # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat + +![使用 Lolcat 的 Cowsay](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) + +使用 Lolcat 的 Cowsay + +**注**: 你可以在管道中使用 lolcat 和其他任何命令来在终端中得到彩色的输出。 + +**10. 你可以为最常用的命令创建别名来使得命令的输出呈现出彩虹般的色彩。你可以像下面那样为 ‘ls -l‘ 命令创建别名,这个命令输出一个目录中包含内容的列表。** + + # alias lolls="ls -l | lolcat" + # lolls + +![多彩的 Alias 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) + +多彩的 Alias 命令 + +你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你必须添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并确保登出后再重新登录来使得更改生效。 + +现在就是这些了。我想知道你是否曾经注意过 lolcat 这个应用?你是否喜欢这篇文章?欢迎在下面的评论环节中给出你的建议和反馈。喜欢并分享我们,帮助我们传播。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ + +作者:[Avishek Kumar][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ +[2]:http://www.tecmint.com/linux-funny-commands/ +[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ +[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file From fa1cf6334af8412b300d0e80a7b31f54cdb20a19 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 7 Jul 2015 09:30:24 +0800 Subject: [PATCH 76/76] Update 20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- ...anced 'cd' Command to Quickly Navigate Linux Filesystem.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md index d7d1cdf7ee..ac4f53cf6f 100644 --- a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md +++ b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -1,3 +1,5 @@ +FSSlc Translating + Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem ================================================================================ Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. @@ -219,4 +221,4 @@ via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/cd-command-in-linux/ [2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ \ No newline at end of file +[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/