From e543e35406d8c73f72cff10d3dfa0e59c19469e9 Mon Sep 17 00:00:00 2001 From: yajun Date: Mon, 15 Jun 2015 12:59:36 -0400 Subject: [PATCH 001/113] 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 002/113] 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 e81d5f0aa7f2de4959eab496c4fb3c3e7f309b5b Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 26 Jun 2015 19:37:39 +0800 Subject: [PATCH 003/113] [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 004/113] 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 005/113] 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 006/113] 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 007/113] 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 008/113] 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 009/113] 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 010/113] 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 011/113] 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 012/113] 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 013/113] 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 014/113] 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 015/113] [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 016/113] 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 017/113] 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 018/113] 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 019/113] 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 020/113] 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 021/113] 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 022/113] 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 023/113] 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 024/113] [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 025/113] 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 026/113] 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 ec6a22b8bc5e1eee56e962364af4f8f756e71ef2 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 29 Jun 2015 12:51:56 +0800 Subject: [PATCH 027/113] [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 43b2c93c60a4cfb517b65eabac3bfb6b1255ed63 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 29 Jun 2015 14:47:19 +0800 Subject: [PATCH 028/113] 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 029/113] =?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 cb8c2f5801de37a4982acb60c8f9af238862b267 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 29 Jun 2015 17:26:13 +0800 Subject: [PATCH 030/113] Translating by ZTinoZ --- ...25 Screen Capture Made Easy with these Dedicated Tools.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 822cbf3651..51b3e8f861 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,5 +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. @@ -142,7 +141,7 @@ Features include: via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html -译者:[译者ID](https://github.com/译者ID) +译者:[ZTinoZ](https://github.com/ZTinoZ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From cb535e35c1a543db753d07c20963e781cd483e49 Mon Sep 17 00:00:00 2001 From: chenjt Date: Mon, 29 Jun 2015 19:34:14 +0800 Subject: [PATCH 031/113] [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 032/113] 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 033/113] 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 034/113] [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 035/113] [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 036/113] [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 037/113] 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 038/113] 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 039/113] =?UTF-8?q?[=E6=A0=A1=E5=AF=B9]=20tech/20150626=20?= =?UTF-8?q?15=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 39fdda31e2a0836c713c2ce23c4e11bf928ddd1b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 30 Jun 2015 19:18:22 +0800 Subject: [PATCH 040/113] Translating by ZTinoZ --- ...625 Screen Capture Made Easy with these Dedicated Tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 51b3e8f861..ec03bb90e6 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,8 +1,8 @@ 用这些专用工具让你截图更简单 ================================================================================ -"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. +截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。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. From d293d68f5d0d0f24c9c4a30d67fadfd508e6722d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 23:38:55 +0800 Subject: [PATCH 041/113] 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 042/113] =?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 043/113] 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 044/113] =?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 bb794ff2d702760be021dae7ad2e7f51f1bcb2f2 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 1 Jul 2015 15:04:55 +0800 Subject: [PATCH 045/113] Translating by ZTinoZ --- ...50625 Screen Capture Made Easy with these Dedicated Tools.md | 2 +- 1 file changed, 1 insertion(+), 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 ec03bb90e6..f0647ac550 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 @@ -2,7 +2,7 @@ ================================================================================ "一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量比文字更有效更高效。 -截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。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. From d03b615ec4fa6a91ae82f17d3ff0981b00ced177 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 1 Jul 2015 16:19:08 +0800 Subject: [PATCH 046/113] =?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 047/113] =?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 048/113] 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 049/113] =?UTF-8?q?[Delete]=20sources/tech/20150701=2012?= =?UTF-8?q?=20Things=20You=20Must=20Do=20After=20Installing=20Fedora=2022.?= =?UTF-8?q?md=20=E5=87=A0=E4=B9=8E=E5=92=8C=20published/2015/06/20150528?= =?UTF-8?q?=20Things=20To=20Do=20After=20Installing=20Fedora=2022=20?= =?UTF-8?q?=E5=AE=8C=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 050/113] 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 45109a030866bb8fe026fd81aa13ce86068e96e9 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 2 Jul 2015 15:36:10 +0800 Subject: [PATCH 051/113] Translating by ZTinoZ --- ...5 Screen Capture Made Easy with these Dedicated Tools.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 f0647ac550..3f55c5ca5e 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,12 +1,12 @@ 用这些专用工具让你截图更简单 ================================================================================ -"一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量比文字更有效更高效。 +"一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量的确是比文字更有效更高效。 截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。此类软件有很多用处,因为一张图片能很好地说明计算机软件的操作,截图在软件开发过程和文档中扮演了一个很重要的角色。或者,如果你的电脑有了个技术性问题,一张截图能让技术支持理解你碰到的这个问题。要写好计算机相关的文章、文档和教程,没有一款好的截图工具是几乎不可能的。如果你想在保存屏幕上任意一些零星的信息,特别是不方便打字时,截图也很有用。 -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. +在开源世界,Linux有许多专注于截图功能的工具供选择,基于图形的和控制台的都有。如果要说一个功能丰富的专用截图工具,那就来看看Shutter吧。这款工具是小型开源工具的杰出代表,当然也有其它的选择。 -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. +屏幕捕捉功能不仅仅只有专业的工具提供,GIMP和ImageMagick这两款主攻图像处理的工具,也能提供像样的屏幕捕捉功能。 ---------- From 4ae10c9d44d4dd1d654ef9a49b40d7db7d3b9179 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 3 Jul 2015 10:02:13 +0800 Subject: [PATCH 052/113] Translating by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) 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 3f55c5ca5e..8e393b1722 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 @@ -14,36 +14,36 @@ ![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. +Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗口、整个屏幕甚至是网站截图 - 然后在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 -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 +- 截图范围: + - 一块特殊区域 + - 窗口 + - 完整的桌面 + - 脚本生成的网页 +- 在截图中应用不同效果 +- 热键 +- 打印 +- 直接截图或指定一个延迟时间 +- 将截图保存至一个指定目录并用一个简便方法重命名它(用特殊的通配符) +- 完成集成在GNOME桌面中(TrayIcon等等) +- 当你截了一张图并以%设置了尺寸时,直接生成缩略图 +- Shutter会话选项: + - 会话中保持所有截图的痕迹 + - 复制截图至剪贴板 + - 打印截图 + - 删除截图 + - 重命名文件 +- 直接上传你的文件至图像托管网站(比如http://ubuntu-pics.de),取回所有需要的图像并将它们与其他人分享 +- 用内嵌的绘画工具直接编辑截图 -- Website: [shutter-project.org][1] -- Developer: Mario Kemper and Shutter Team -- License: GNU GPL v3 -- Version Number: 0.93.1 +- 主页: [shutter-project.org][1] +- 开发者: Mario Kemper和Shutter团队 +- 许可证: GNU GPL v3 +- 版本号: 0.93.1 ---------- From b32e0d6905653e72074d8b8278454680a8719b75 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 3 Jul 2015 15:11:03 +0800 Subject: [PATCH 053/113] 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 054/113] 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 055/113] 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 056/113] 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 057/113] 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 058/113] 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 059/113] 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 060/113] =?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 e6fc2faaa05c95cc508faf9ceb8356c0d6645b08 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Sun, 5 Jul 2015 17:37:27 +0800 Subject: [PATCH 061/113] Translating by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) 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 8e393b1722..fb0159ca6a 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 @@ -14,9 +14,9 @@ ![Shutter in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-Shutter1.png) -Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗口、整个屏幕甚至是网站截图 - 然后在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 +Shutter是一款功能丰富的截图软件。你可以给你的特殊区域、窗口、整个屏幕甚至是网站截图 - 在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 -包含特性: +包含特性: - 截图范围: @@ -38,7 +38,7 @@ Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗 - 删除截图 - 重命名文件 - 直接上传你的文件至图像托管网站(比如http://ubuntu-pics.de),取回所有需要的图像并将它们与其他人分享 -- 用内嵌的绘画工具直接编辑截图 +- 用内置的绘画工具直接编辑截图 - 主页: [shutter-project.org][1] - 开发者: Mario Kemper和Shutter团队 @@ -51,11 +51,11 @@ Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗 ![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, ...). +HotShots是一款捕捉屏幕并能以各种图片格式保存的软件,同时也能添加注释和图形数据(箭头、行、文本, ...)。 -You can also upload your creations to the web (FTP/some web services). HotShots is written with Qt. +你也可以把你的作品上传到网上(FTP/一些web服务),HotShots是用Qt开发而成的。 -HotShots is not available in Ubuntu's Software Center. But it's easy to install by typing at the command line: +HotShots无法从Ubuntu的Software Center中获取,不过用以下命令可以轻松地来安装它: sudo add-apt-repository ppa:ubuntuhandbook1/apps @@ -63,21 +63,21 @@ HotShots is not available in Ubuntu's Software Center. But it's easy to install 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 +- 简单易用 +- 全功能使用 +- 嵌入式编辑器 +- 热键 +- 内置放大功能 +- 徒手和多屏捕捉 +- 支持输出格式: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) +- 国际化支持:巴斯克语、中文、捷克语、法语、加利西亚语、德语、希腊语、意大利语、日语、立陶宛语、波兰语、葡萄牙语、罗马尼亚语、俄罗斯语、塞尔维亚语、僧伽罗语、斯洛伐克语、西班牙语、土耳其语、乌克兰语和越南语 -- Website: [thehive.xbee.net][2] -- Developer: xbee -- License: GNU GPL v2 -- Version Number: 2.2.0 +- 主页: [thehive.xbee.net][2] +- 开发者 xbee +- 许可证: GNU GPL v2 +- 版本号: 2.2.0 ---------- From 2cd247dafba9fbbebad28326c20f0e05cc94929a Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 21:55:59 +0800 Subject: [PATCH 062/113] 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 063/113] 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 064/113] 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 065/113] 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 066/113] =?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 e57ac3817f86e930f40aafd7e761da3b948f19e6 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 6 Jul 2015 17:50:07 +0800 Subject: [PATCH 067/113] Translating by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) 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 fb0159ca6a..f8ac9a2db1 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 @@ -85,31 +85,31 @@ HotShots无法从Ubuntu的Software Center中获取,不过用以下命令可以 ![ScreenCloud in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-ScreenCloud.png) -ScreenCloud is an easy to use open source screenshot tool. +ScreenCloud是一款易于使用的开源截图工具。 -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. +在这款软件中,用户可以用三个热键中的其中一个或只需点击ScreenCloud托盘图标就能进行截图,用户也可以自行选择保存截图的地址。 -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. +如果你选择上传你的截图到screencloud主页,链接会自动复制到你的剪贴板上,你能通过email或在一个聊天对话框里和你的朋友同事分享它,他们肯定会点击这个链接来看你的截图的。 -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 +- 捕捉整个屏幕,窗口和截选区域 +- 快速又简单:截取图片,粘贴链接,完成 +- 免费托管你的截图 +- 热键 +- 设置定时器延迟 +- 允许 '捕捉窗口边框' +- 启用/禁用通知 +- 设置开机自启动 +- 调整账户/上传/文件名/快捷方式的设置 +- 跨平台工具 +- 插件支持:保存至Dropbox,Imgur等等 +- 支持上传至FTP和SFTP服务器 -- Website: [screencloud.net][3] -- Developer: Olav S Thoresen -- License: GNU GPL v2 -- Version Number: 1.2.1 +- 主页: [screencloud.net][3] +- 开发者: Olav S Thoresen +- 许可证: GNU GPL v2 +- 版本号: 1.2.1 ---------- From a2479964eaa7e43eb07a721ce62e7ba131d37be8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 6 Jul 2015 22:24:09 +0800 Subject: [PATCH 068/113] 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 069/113] [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 070/113] 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/ From ff56e2de0cd9fb2a1467fb2aac6b5315d9b1684b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 7 Jul 2015 10:55:44 +0800 Subject: [PATCH 071/113] Finish the translation by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {sources => translated}/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md (89%) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md similarity index 89% rename from sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md rename to translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index f8ac9a2db1..b2408dbeee 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -117,25 +117,25 @@ ScreenCloud是一款易于使用的开源截图工具。 ![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也是一款易于使用的截图工具,它能给整个桌面、一个单一窗口、窗口的一部分或一块所选区域捕捉图像。,图像能以各种不用的格式保存。 -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也允许用户用热键来进行截图。除了保存截图之外,它也可以被复制到剪贴板或用任何与图像文件关联的程序打开。 -KSnapshot is part of the KDE 4 graphics module. +KSnapshot是KDE 4图形模块的一部分。 -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 +- 以多种格式保存截图 +- 延迟截图 +- 剔除窗口装饰图案 +- 复制截图至剪贴板 +- 热键 +- 能用它的D-Bus界面进行脚本化 -- Website: [www.kde.org][4] -- Developer: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich -- License: GNU GPL v2 -- Version Number: 0.8.2 +- 主页: [www.kde.org][4] +- 开发者: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich +- 许可证: GNU GPL v2 +- 版本号: 0.8.2 -------------------------------------------------------------------------------- From 8da4a84b370c261bcfb447eacda6a11ab494faa0 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 7 Jul 2015 22:54:33 +0800 Subject: [PATCH 072/113] PUB:20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux @zpl1025 --- ... Spaces and Special Characters in Linux.md | 59 +++++++++---------- 1 file changed, 28 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md (81%) diff --git a/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md similarity index 81% rename from translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md rename to published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md index 61a320aeb8..93a8868639 100644 --- a/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md +++ b/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md @@ -1,8 +1,8 @@ Linux 下如何处理包含空格和特殊字符的文件名 ================================================================================ -我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母-数字文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。 +我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母加数字的文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。 -** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只处理文本文件(.txt)。 +** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只用文本文件(.txt)做演示。 最常见的文件名例子: @@ -38,9 +38,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 --bk34.txt ... -一个显而易见的问题是 - 在这个星球上有谁会创建/处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。 +一个显而易见的问题是 - 在这个星球上有谁会创建和处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。 -我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说,Linux 下的一切比如文件夹,驱动器或其他所有的都被当作文件处理。 +我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说,Linux 下的一切比如文件夹、驱动器或其他所有的都被当作文件处理。 ### 处理名字包含破折号(-)的文件 ### @@ -99,9 +99,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 **重要:** -1. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件。就是说,-a-b-c.txt,ab-c.txt,abc-.txt,等等。 +1. 上面讨论的规则可以同样应用于名字中包含任意数量以及任意位置的连接符号的文件。就是说,-a-b-c.txt,ab-c.txt,abc-.txt,等等。 -2. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`: +2. 上面讨论的规则可以同样应用于名字中包含任意数量以及任意位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`: $ rm -rf -- -abc 或者 @@ -124,7 +124,7 @@ Linux 下如何处理包含空格和特殊字符的文件名 出现上面错误的原因是,BASH 将 #abc.txt 解释为评论而忽略了。所以[命令 touch][2]没有收到任何文件作为参数,所以导致这个错误。 -要解决这个问题,你肯能需要告诉 BASH 不要将 # 解释为评论。 +要解决这个问题,你可能需要告诉 BASH 不要将 # 解释为评论。 $ touch ./#abc.txt 或者 @@ -140,8 +140,7 @@ Linux 下如何处理包含空格和特殊字符的文件名 现在创建名字中除了开头的其他地方包含 # 的文件。 $ touch ./a#bc.txt - $ touch ./abc#.txt - + $ touch ./abc#.txt 或者 $ touch 'a#bc.txt' $ touch 'abc#.txt' @@ -197,8 +196,6 @@ Linux 下如何处理包含空格和特殊字符的文件名 或者 $ vi '#cd.txt' ----------- - $ nano ./#cd.txt 或者 $ nano '#cd.txt' @@ -261,7 +258,7 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含星号 (*) #### -名字包含星号的文件没有改变太多,你仍然可以把它当作一个普通文件。(注:星号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +需要用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改。) $ touch *12.txt @@ -271,9 +268,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 或者 $ rm -rf * -而是用这样的命令,(注:这个命令是删除当前目录所有.txt文件。。。) +而是用这样的命令,(LCTT 译注:此处原文有误,已修改) - $ rm ./*.txt + $ rm ./'*.txt' #### 文件名包含叹号 (!) #### @@ -307,9 +304,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含花括号 {} #### -不需要特别注意。可以当作普通文件处理。(注:花括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch {12.txt} + $ touch '{12.txt}' #### 文件名包含尖括号 <> #### @@ -319,21 +316,21 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含方括号 [ ] #### -名字包含方括号的文件可以当作普通文件,不用特别处理。(注:方括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch [12.txt] + $ touch '[12.txt]' #### 文件名包含下划线 (_) #### -这个非常普遍不需要特殊对待。当作普通文件随意处理。 +这个非常普遍,不需要特殊对待。当作普通文件随意处理。 $ touch _12.txt #### 文件名包含等号 (=) #### -文件名包含等号不会改变任何事情,你可以当作普通文件。(注:等号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch =12.txt + $ touch '=12.txt' #### 处理反斜杠 (\) #### @@ -349,9 +346,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含问号 (?) #### -再一次,这个也是不需要特别处理的情况。名字包含问号的文件可以和大多数情况一样对待。(注:问号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch ?12.txt + $ touch '?12.txt' #### 文件名包含点 (.) #### @@ -382,25 +379,25 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含冒号 (:) #### -你可以在文件名中使用冒号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。(注:冒号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch :12.txt + $ touch ':12.txt' 或者 - $ touch :12:.txt + $ touch ':12:.txt' #### 文件名包含引号(单引号和双引号) #### -要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。 +要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。(LCTT 译注:或者如果单引号和双引号混杂的情况,你也可以用反斜杠转义。) $ touch "15'.txt" 以及 - $ touch '15”.txt' + $ touch '15".txt' #### 文件名包含波浪号 (~) #### -Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如:(注:波浪号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如: $ touch ~1a.txt 或者 @@ -426,10 +423,10 @@ via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/ 作者:[Avishek Kumar][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[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/15-basic-ls-command-examples-in-linux/ +[1]:https://linux.cn/article-5349-1.html [2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ From f97e0ac63b93763a7cf01fdba3a2acfc8db77391 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 7 Jul 2015 23:46:04 +0800 Subject: [PATCH 073/113] PUB:20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux @wwy-hust --- ...ser for Anonymous Web Browsing in Linux.md | 215 ++++++++++++++++++ ...ser for Anonymous Web Browsing in Linux.md | 206 ----------------- 2 files changed, 215 insertions(+), 206 deletions(-) create mode 100644 published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md delete mode 100644 translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md diff --git a/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md new file mode 100644 index 0000000000..6df604eac1 --- /dev/null +++ b/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md @@ -0,0 +1,215 @@ +Tor浏览器:Linux下用于匿名Web浏览的终极浏览器 +================================================================================ +我们大多数人都在上网方面花费很多时间。上网使用的应用程序主要是浏览器,更确切的说是一个Web浏览器。我们在网络上的大部分活动要以客户端/服务器的方式登录,这个过程会包括IP地址、地理信息、搜索、活动以及许多潜在的信息,这些信息如果以其他方式被故意使用,会存在潜在的危险性。 + +![在Linux中安装Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) + +*Tor浏览器:匿名浏览器* + +此外,美国国家安全局(NSA)这样的国际间谍机构会记录我们的数字足迹。更不必说受到控制的代理服务器也会被用来做为数据搜集服务器。并且大多数企业和公司不会允许您访问代理服务器(使您能保障自己的隐私)。 + +因此,我们需要的最好是一个小型、独立、可携带的应用程序,它能达到匿名的效果。Tor浏览器便是这样的一个应用,它拥有上面提到的所有功能,甚至不止于此。 + +这篇文章里我们会讨论Tor浏览器,它的功能、使用方式、领域、安装以及其他关于Tor浏览器的重要方面。 + +### 什么是Tor浏览器? ### + +Tor是一个自由分发的应用软件,以BSD许可证发布,通过其安全可靠的洋葱式的结构,允许用户匿名的进行网络浏览。从前,由于它的结构和运作机制,Tor被称为‘洋葱路由器’。这个应用是由C语言写成的。 + +#### Tor浏览器的功能 #### + +- 跨平台可用。例如,这个应用程序在Linux、Windows和Mac下都可用。 +- 在发送数据到因特网前进行复杂的数据加密。 +- 在客户端进行数据自动解密。 +- 它是火狐浏览器和Tor工程的结合。 +- 对服务器和网站提供匿名性。 +- 可以访问被限制的网站。 +- 无需暴露源IP便可以执行任务。 +- 可以将数据路由至/从防火墙后隐藏的服务和应用程序。 +- 便携性 - 可以直接从USB存储棒上运行一个预配置的web浏览器。无需本地安装。 +- 在x86和x86_64平台均可用 +- 可以配置为一个运行在“localhost”的“9050”端口上的“socks4a”代理来让FTP跑在Tor 上。 +- Tor拥有处理上千的中继和上百万用户的能力。 + +#### Tor浏览器如何工作? #### + +Tor的工作方式基于洋葱路由的概念。洋葱路由的结构类似洋葱,它的每一层都嵌套在另一层里面,就像洋葱一样。这种嵌套的结构负责多次加密数据并将其通过虚拟电路进行发送。在客户端一侧每一层都在将他传递到下一层之前解密数据。最后一层在将原始数据传递到目的地前解密最里面一层的加密数据。 + +在这个过程里,这种解密整个层的功能设计的如此高明以至于无法追踪IP以及用户的地理位置,因此可以限制任何人观察您访问站点的网络连接。 + +所有这些过程看起来有些复杂,但用户使用Tor浏览器时没有必要担心。实际上,Tor浏览器的功能像其他浏览器一样(尤其是Mozilla的Firefox)。 + +### 在Linux中安装Tor浏览器 ### + +就像上面讨论的一样,Tor浏览器在Linux和Windows以及Mac下都可用。用户需要根据系统和架构的不同在下面的链接处下载最新的版本(例如,Tor浏览器4.0.4)。 + +- [https://www.torproject.org/download/download-easy.html.en][1] + +在下载Tor浏览器后,按说我们需要安装它,但是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浏览器。 + +###开始使用Tor浏览器### + +在成功的解压后,我们便可以将解压后的浏览器移动到任何地方/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. 用Tor浏览器在Youtube上看视频** + +![在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地址。 +- 在一些研究中发现某些特定的协议有泄漏IP地址的倾向。 +- 早些的Tor版本绑定了旧版本的Firefox浏览器,这被证明较易受JavaScript攻击。 +- Tor浏览器运行起来比较慢。 + +#### 真实世界中Tor浏览器的实现 #### + +- [Vuze BitTorrent Client][3] +- Anonymous Os +- Os’es from Scratch +- whonix 等 + +#### Tor浏览器的未来 #### + +Tor浏览器是前途无量的。也许第一个该类应用程序的实现是非常出色的,但Tor浏览器必须加大对支持、伸缩性、以及对近期的攻击进行数据安全的研究的投入。这个应用程序是未来的需要。 + +#### 下载免费的电子书 #### + +非官方的Tor私密浏览指南: + +[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] + +### 结论 ### + +如果您工作的部门不允许您访问某网站,或者如果您不希望别人知道您的私人事务,或您不想向NSA提供您的个人数字足迹,那么Tor浏览器在目前是必须的。 + +**注意**: Tor浏览器提供的安全性不能抵御病毒、木马或其他类似这样的安全威胁。写这篇文章的目的也不是希望通过在互联网上隐藏我们的身份来放纵非法活动。这篇文章纯粹是为了教学的目的,作者和Tecmint均不会为任何非法的使用负责。这是用户自己的责任。 + +Tor浏览器是一个非常不错的应用,您值得尝试!这就是我要说的全部了,我还会在这里写一些您感兴趣的文章,所以请继续关注。别忘了在留言区提供给我们您有价值的反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ + +作者:[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]:https://www.torproject.org/download/download-easy.html.en +[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi +[3]:http://www.tecmint.com/install-vuze-torrent-client-in-linux/ \ 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 deleted file mode 100644 index 1c6a039920..0000000000 --- a/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md +++ /dev/null @@ -1,206 +0,0 @@ -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 70c29cbc75fbca204b058b57b068fd63e752f9fb Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Tue, 7 Jul 2015 15:00:40 -0500 Subject: [PATCH 074/113] =?UTF-8?q?Update=20and=20rename=2020150612=20Linu?= =?UTF-8?q?x=5FLogo--A=20Command=20Line=20Tool=20to=20Print=20Color=20ANSI?= =?UTF-8?q?=20Logos=20of=20Linux=20Distributions.md=20to=20[=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=AD]20150612=20Linux=5FLogo--A=20Command=20Line?= =?UTF-8?q?=20Tool=20to=20Print=20Color=20ANSI=20Logos=20of=20Linux=20Dist?= =?UTF-8?q?ributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译此文 --- ...Line Tool to Print Color ANSI Logos of Linux Distributions.md} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename sources/tech/{20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md => [翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md} (99%) diff --git a/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md similarity index 99% rename from sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md rename to sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md index 6cdc510092..cd502ac0a9 100644 --- a/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md +++ b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -1,3 +1,4 @@ +[translating by KevinSJ] Linux_Logo – A Command Line Tool to Print Color ANSI Logos of Linux Distributions ================================================================================ linuxlogo or linux_logo is a Linux command line utility that generates a color ANSI picture of Distribution logo with a few system information. @@ -180,4 +181,4 @@ via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ \ No newline at end of file +[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ From 71c19d7b7272d6f2dde8b9f7ab52c69f0245f6e3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 15:17:44 +0800 Subject: [PATCH 075/113] =?UTF-8?q?20150709-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s--Linus Torvalds Answers Your Question.md | 184 ++++++++++++++++++ ...ata1 file continuously growing in MySQL.md | 114 +++++++++++ 2 files changed, 298 insertions(+) create mode 100644 sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md create mode 100644 sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md new file mode 100644 index 0000000000..e723658787 --- /dev/null +++ b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md @@ -0,0 +1,184 @@ +Interviews: Linus Torvalds Answers Your Question +================================================================================ +Last Thursday you had a chance to [ask Linus Torvalds][1] about programming, hardware, and all things Linux. You can read his answers to those questions below. If you'd like to see what he had to say the last time we sat down with him, [you can do so here][2]. + +**Productivity** +by DoofusOfDeath + +> You've somehow managed to originate two insanely useful pieces of software: Linux, and Git. Do you think there's anything in your work habits, your approach to choosing projects, etc., that have helped you achieve that level of productivity? Or is it just the traditional combination of talent, effort, and luck? + +**Linus**: I'm sure it's pretty much always that "talent, effort and luck". I'll leave it to others to debate how much of each... + +I'd love to point out some magical work habit that makes it all happen, but I doubt there really is any. Especially as the work habits I had wrt the kernel and Git have been so different. + +With Git, I think it was a lot about coming at a problem with fresh eyes (not having ever really bought into the traditional SCM mindset), and really trying to think about the issues, and spending a fair amount of time thinking about what the real problems were and what I wanted the design to be. And then the initial self-hosting code took about a day to write (ok, that was "self-hosting" in only the weakest sense, but still). + +And with Linux, obviously, things were very different - the big designs came from the outside, and it took half a year to host itself, and it hadn't even started out as a kernel to begin with. Clearly not a lot of thinking ahead and planning involved ;). So very different circumstances indeed. + +What both the kernel and Git have, and what I think is really important (and I guess that counts as a "work habit"), is a maintainer that stuck to it, and was responsive, responsible and sane. Too many projects falter because they don't have people that stick with them, or have people who have an agenda that doesn't match reality or the user expectations. + +But it's very important to point out that for Git, that maintainer was not me. Junio Hamano really should get pretty much all the credit for Git. Credit where credit is due. I'll take credit for the initial implementation and design of Git - it may not be perfect, but ten years on it still is very solid and very clearly the same basic design. But I'll take even _more_ credit for recognizing that Junio had his head screwed on right, and was the person to drive the project. And all the rest of the credit goes to him. + +Of course, that kind of segues into something else the kernel and Git do have in common: while I still maintain the kernel, I did end up finding a lot of smart people to maintain all the different parts of it. So while one important work habit is that "stick to it" persistence that you need to really take a project from a not-quite-usable prototype to something bigger and better, another important work-habit is probably to also "let go" and not try to own and control the project too much. Let other people really help you - guide the process but don't get in their way. + +**init system** +by lorinc + +> There wasn't a decent unix-like kernel, you wrote one which ultimately became the most used. There wasn't a decent version control software, you wrote one which ultimately became the most love. Do you think we already have a decent init system, or do you have plan to write one that will ultimately settle the world on that hot topic? + +**Linus**: You can say the word "systemd", It's not a four-letter word. Seven letters. Count them. + +I have to say, I don't really get the hatred of systemd. I think it improves a lot on the state of init, and no, I don't see myself getting into that whole area. + +Yeah, it may have a few odd corners here and there, and I'm sure you'll find things to despise. That happens in every project. I'm not a huge fan of the binary logging, for example. But that's just an example. I much prefer systemd's infrastructure for starting services over traditional init, and I think that's a much bigger design decision. + +Yeah, I've had some personality issues with some of the maintainers, but that's about how you handle bug reports and accept blame (or not) for when things go wrong. If people thought that meant that I dislike systemd, I will have to disappoint you guys. + +**Can Valve change the Linux gaming market?** +by Anonymous Coward + +> Do you think Valve is capable of making Linux a primary choice for gamers? + +**Linus**: "Primary"? Probably not where it's even aiming. I think consoles (and all those handheld and various mobile platforms that "real gamers" seem to dismiss as toys) are likely much more primary, and will stay so. + +I think Valve wants to make sure they can control their own future, and Linux and ValveOS is probably partly to explore a more "console-like" Valve experience (ie the whole "get a box set up for a single main purpose", as opposed to a more PC-like experience), and partly as a "second source" against Microsoft, who is a competitor in the console area. Keeping your infrastructure suppliers honest by making sure you have alternatives sounds like a good strategy, and particularly so when those suppliers may be competing with you directly elsewhere. + +So I don't think the aim is really "primary". "Solid alternative" is I think the aim. Of course, let's see where it goes after that. + +But I really have not been involved. People like Greg and the actual graphics driver guys have been in much more direct contact with Valve. I think it's great to see gaming on Linux, but at the same time, I'm personally not really much of a gamer. + +**The future of RT-Linux?** +by nurhussein + +> According to Thomas Gleixner, [the future of the realtime patchset to Linux is in doubt][2], as it is difficult to secure funding from interested parties on this functionality even though it is both useful and important: What are your thoughts on this, and what do you think we need to do to get more support behind the RT patchset, especially considering Linux's increasing use in embedded systems where realtime functionality is undoubtedly useful. + +**Linus**: So I think this is one of those things where the markets decide how important rtLinux ends up being, and I suspect there are more than enough companies who end up wanting and using rtLinux that the project isn't really going anywhere. The complaints by Thomas were - I think - a wake-up call to the companies who end up wanting the extended hard realtime patches. + +So I suspect there are companies and groups like OSADL that end up funding and helping with rtLinux, and that it isn't going away. + +**Rigor and developments** +by hcs_$reboot + +> The most complex program running on a machine is arguably its OS, especially the kernel. Linux (kernel) reached the top level in terms of performance, reliability and versatility. You have been criticized quite a few times for some virulent mails addressed to developers. Do you think Linux would be where it is without managing the project with an iron fist? To go further, do you think some other main OSS project would benefit from a more rigorous management approach? + +**Linus**: One of the nice things about open source is how it allows people to really concentrate on what they are good at, and it has been a huge advantage for Linux that we've had people who are interested in the marketing side and selling Linux, as well as the legal side etc. + +And that is all in addition, of course, to the original "we're motivated by the technology" people like me. And even within that "we're motivated by technology" group, you most certainly don't need to find _everything_ interesting, you can find the area you are passionate about and really care about and want to work on. + +That's _fundamentally_ how open source works. + +Now, if somebody is passionate about some "good management" thing, go wild, and try to get involved, and try to manage things. It's not what _I_ am interested in, but hey, the proof is in the pudding - anybody who thinks they have a new rigorous management approach that they think will help some part of the process, go wild. + +Now, I personally suspect that it wouldn't work - not only are tech people an ornery lot to begin with (that whole "herding cats" thing), just look at all the crazy arguments on the internet. And ask yourself what actually holds an open source project like the kernel together? I think you need to be very oriented towards the purely technical solutions, simply because then you have tangible and real issues you can discuss (and argue about) with fairly clear-cut hard answers. It's the only thing people can really agree on in the big picture. + +So the Linux approach to "management" has been to put technology first. That's rigorous enough for me. But as mentioned, it's a free-for-all. Anybody can come in and try to do better. Really. + +And btw, it's worth noting that there are obviously specific smaller development teams where other management models work fine. Most of the individual developers are parts of teams inside particular companies, and within the confines of that company, there may well be a very strict rigorous management model. Similarly, within the confines of a particular productization effort there may be particular goals and models for that particular team that transcend that general "technical issues" thing. + +Just to give a concrete example, the "development kernel" tree that I maintain works fundamentally differently and with very different rules from the "stable tree" that Greg does, which in turn is maintained very differently from what a distribution team within a Linux company does inside its maintenance kernel team. + +So there's certainly room for different approaches to managing those very different groups. But do I think you can "rigorously manage" people on the internet? No. + +**Functional languages?** +by EmeraldBot + +> While historically you've been a C and Assembly guy (and the odd shell scripting and such), what do you think of functional languages such as Lisp, Closure, Haskell, etc? Do you see any advantages to them, or do you view them as frivolous and impractical? If you decide to do so, thanks for taking the time to answer my question! You're a legend at what you do, and I think it's awesome that the significantly less interesting me can ask you a question like this. + +**Linus**: I may be a fan of C (with a certain fondness for assembly, just because it's so close to the machine), but that's very much about a certain context. I work at a level where those languages make sense. I certainly don't think that tools like Haskell etc are "frivolous and impractical" in general, although on a kernel level (or in a source control management system) I suspect they kind of are. + +Many moons ago I worked on sparse (the C parser and analyzer), and one of my coworkers was a Haskell fan, and did incredible example transformations in very simple (well, to him) code - stuff that is just nasty to write in C because it's pretty high-level, there's tons of memory management, and you're really talking about implementing fairly abstract and high-level rules with pattern matching etc. + +So I'm definitely not a functional language kind of guy - it's not how I learnt programming, and it really isn't very relevant to what I do, and I wouldn't recognize Haskell code if it bit me in the ass and called me names. But no, I wouldn't call them frivolous. + +**Critical software to the use of Linux** +by TWX + +> Mr. Torvalds, For many uses of Linux such as on the desktop, other software beyond the kernel and the base GNU tools are required. What other projects would you like to see given priority, and what would you like to see implemented or improved? Admittedly I thought most about X-Windows when asking this question; but I don't doubt that other daemons or systems can be just as important to the user experience. Thank you for your efforts all these years. + +**Linus**: Hey, I don't really have any particular project I would want to champion, largely because we all have so different requirements on the desktop. There's just no single thing that stands out as being hugely more important than others to me. + +What I do wish particularly desktop developers cared about is "consistency of experience". And by that I don't mean some kind of enforced visual consistency between different applications to make things "look coherent". No, I'm just talking about the pain and uncertainty users go through with upgrades, and understanding that while your project may be the most important project to *you* (because it's what you do), to your users, your project is likely just a fairly small and irrelevant part of their experience, and it's not very central at all, and they've learnt the quirks about that thing they don't even care about, and you really shouldn't break their expectations. Because it turns out that that is how you really make people hate their desktop. + +This is not at all Linux-specific, of course - just look at the less than enthusiastic reception that other operating system redesigns have received. But I really wish that we hadn't had *both* of the major Linux desktop environments have to learn this (well, I hope they learnt) the hard way, and both of them ending up blaming their users rather than themselves. + +**"anykernel"-style portable drivers?** +by staalmannen + +> What do you think about the "anykernel" concept (invented by another Finn btw) used in NetBSD? Basically, they have modularized the code so that a driver can be built either in a monolithic kernel or for user space without source code changes ( rumpkernel.org ). The drivers are highly portable and used in Genode os (L4 type kernels), minix etc... Would this be possible or desirable for Linux? Apparently there is one attempt called "libos"... + +**Linus**: So I have bad experiences with "portable" drivers. Writing drivers to some common environment tends to force some ridiculously nasty impedance matching abstractions that just get in the way and make things really hard to read and modify. It gets particularly nasty when everybody ends up having complicated - and differently so - driver subsystems to handle a lot of commonalities for a certain class of drivers (say a network driver, or a USB driver), and the different operating systems really have very different approaches and locking rules etc. + +I haven't seen anykernel drivers, but from past experience my reaction to "portable device drivers" is to run away, screaming like little girl. As they say in Swedish "Bränt barn luktar illa". + +**Processor Architecture** +by swv3752 + +> Several years ago, you were employed by Transmeta designing the Crusoe processor. I understand you are quite knowledgeable about cpu architecture. What are your thoughts on the Current Intel and AMD x86 CPUs particularly in comparison with ARM and IBM's Power8 CPUs? Where do you see the advantages of each one? + +**Linus**: I'm no CPU architect, I just play one on TV. + +But yes, I've been close to the CPU both as part of my kernel work, and as part of a processor company, and working at that level for a long time just means that you end up having fairly strong opinions. One of the things that my experiences at Transmeta convinced me of, for example, was that there's definitely very much a limit to what software should care about. I loved working at Transmeta, I loved the whole startup company environment, I loved working with really smart people, but in the end I ended up absolutely *not* loving to work with overly simple hardware (I also didn't love the whole IPO process, and what that did to the company culture, but that's a different thing). + +Because there's only so much that software can do to compensate. + +Something similar happened with my kernel work on the alpha architecture, which also started out as being an overly simplified implementation in the name of being small and supposedly running really fast. While I really started out liking the alpha architecture for being so clean, I ended up detesting how fragile the architecture implementations were (and by the time that got fixed in the 21264, I had given up on alpha). + +So I've come to absolutely detest CPU's that need a lot of compiler smarts or special tuning to go fast. Life is too short to waste on in-order CPU's, or on hardware designers who think software should take care of the pieces that they find to be too complicated to handle themselves, and as a result just left undone. "Weak memory ordering" is just another example. + +Thankfully, most of the industry these days seems to agree. Yes, there are still in-order cores, but nobody tries to make excuses for them any more: they are for the truly cheap and low-end market. + +I tend to really like the modern Intel cores in particular, which tend to take that "let's not be stupid" really to heart. With the kernel being so threaded, I end up caring a lot about things like memory ordering etc, and the Intel big-core CPU's tend to be in a class of their own there. As a software person who cares about performance and looks at instruction profiles etc, it's just so *nice* to see that the CPU doesn't have some crazy glass jaw where you have to be very careful. + +**GPU kernels** +by maraist + +> Is there any inspiration that a GPU based kernel / scheduler has for you? How might Linux be improved to better take advantage of GPU-type batch execution models. Given that you worked transmeta and JIT compiled host-targeted runtimes. GPUs 1,000-thread schedulers seem like the next great paradigm for the exact type of machines that Linux does best on. + +**Linus**: I don't think we'll see the kernel ever treat GPU threads the way we treat CPU threads. Not with the current model of GPU's (and that model doesn't really seem to be changing all that much any more). + +Yes, GPU's are getting much better, and now generally have virtual memory and the ability to preempt execution, and you could run an OS on them. But the scheduling latencies are pretty high, and the threads are not really "independent" (ie they tend to share a lot of state - like the virtual address space and a large shared register set), so GPU "threads" don't tend to work like CPU threads. You'd schedule them all-or-nothing, so if you were to switch processes, you'd treat the GPU as one entity where you switch all the threads at once. + +So it really wouldn't look like a thousand threads to the kernel. The GPU would still be scheduled as one single entity (or maybe a couple of entities depending on how the GPU is partitioned). The fact that that single entity works by doing a lot of things in massive parallelism is kind of immaterial for the kernel that doesn't end up seeing that parallelism as separate threads. + +**alleged danger of Artificial Intelligence** +by peter303 + +> Some computer experts like Marvin Minsky, Larry Page, Ray Kuzweil think A.I. will be a great gift to Mankind. Others like Bill Joy and Elon Musk are fearful of potential danger. Where do you stand, Linus? + +**Linus**: I just don't see the thing to be fearful of. + +We'll get AI, and it will almost certainly be through something very much like recurrent neural networks. And the thing is, since that kind of AI will need training, it won't be "reliable" in the traditional computer sense. It's not the old rule-based prolog days, when people thought they'd *understand* what the actual decisions were in an AI. + +And that all makes it very interesting, of course, but it also makes it hard to productize. Which will very much limit where you'll actually find those neural networks, and what kinds of network sizes and inputs and outputs they'll have. + +So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. + +The whole "Singularity" kind of event? Yeah, it's science fiction, and not very good SciFi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really.. + +It's like Moore's law - yeah, it's very impressive when something can (almost) be plotted on an exponential curve for a long time. Very impressive indeed when it's over many decades. But it's _still_ just the beginning of the "S curve". Anybody who thinks any different is just deluding themselves. There are no unending exponentials. + +**Is the kernel basically a finished project?** +by NaCh0 + +> Aside from adding drivers and refactoring algorithms when performance limits are discovered, is there anything left for the kernel? Maybe it's a failure of tech journalism but we never hear about the next big thing in kernel land anymore. + +**Linus**: I don't think there's much of a "next big thing" in the kernel. + +I wouldn't say that there is nothing but drivers (and architectures are kind of "CPU drivers) and improving scalability left, because I'm constantly amazed by how many new things people figure out are still good ideas. But they tend to still be pretty incremental improvements. An OS kernel doesn't look *that* radically different from what it was 40 years ago, and that's fine. I think radical new ideas are often overrated, and the thing that really matters in the end is that plodding detail work. That's how technology evolves. + +And judging by how our kernel releases are going, there's no end in sight for that "plodding detail work". And it's still as interesting as it ever was. + +-------------------------------------------------------------------------------- + +via: http://linux.slashdot.org/story/15/06/30/0058243/interviews-linus-torvalds-answers-your-question + +作者:[samzenpus][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:samzenpus@slashdot.org +[1]:http://interviews.slashdot.org/story/15/06/24/1718247/interview-ask-linus-torvalds-a-question +[2]:http://meta.slashdot.org/story/12/10/11/0030249/linus-torvalds-answers-your-questions +[3]:https://lwn.net/Articles/604695/ \ No newline at end of file diff --git a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md new file mode 100644 index 0000000000..92094a3315 --- /dev/null +++ b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -0,0 +1,114 @@ +Why is the ibdata1 file continuously growing in MySQL? +================================================================================ +![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) + +We receive this question about the ibdata1 file in MySQL very often in [Percona Support][1]. + +The panic starts when the monitoring server sends an alert about the storage of the MySQL server – saying that the disk is about to get filled. + +After some research you realize that most of the disk space is used by the InnoDB’s shared tablespace ibdata1. You have [innodb_file_per_table][2] enabled, so the question is: + +### What is stored in ibdata1? ### + +When you have innodb_file_per_table enabled, the tables are stored in their own tablespace but the shared tablespace is still used to store other InnoDB’s internal data: + +- data dictionary aka metadata of InnoDB tables +- change buffer +- doublewrite buffer +- undo logs + +Some of them can be configured on [Percona Server][3] to avoid becoming too large. For example you can set a maximum size for change buffer with [innodb_ibuf_max_size][4] or store the doublewrite buffer on a separate file with [innodb_doublewrite_file][5]. + +In MySQL 5.6 you can also create external UNDO tablespaces so they will be in their own files instead of stored inside ibdata1. Check following [documentation link][6]. + +### What is causing the ibdata1 to grow that fast? ### + +Usually the first command that we need to run when there is a MySQL problem is: + + SHOW ENGINE INNODB STATUSG + +That will show us very valuable information. We start checking the **TRANSACTIONS** section and we find this: + + ---TRANSACTION 36E, ACTIVE 1256288 sec + MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root + show engine innodb status + Trx read view will not see trx with id >= 36F, sees < 36F + +This is the most common reason, a pretty old transaction created 14 days ago. The status is **ACTIVE**, that means InnoDB has created a snapshot of the data so it needs to maintain old pages in **undo** to be able to provide a consistent view of the database since that transaction was started. If your database is heavily write loaded that means lots of undo pages are being stored. + +If you don’t find any long-running transaction you can also monitor another variable from the INNODB STATUS, the “**History list length.**” It shows the number of pending purge operations. In this case the problem is usually caused because the purge thread (or master thread in older versions) is not capable to process undo records with the same speed as they come in. + +### How can I check what is being stored in the ibdata1? ### + +Unfortunately MySQL doesn’t provide information of what is being stored on that ibdata1 shared tablespace but there are two tools that will be very helpful. First a modified version of innochecksum made by Mark Callaghan and published in [this bug report][7]. + +It is pretty easy to use: + + # ./innochecksum /var/lib/mysql/ibdata1 + 0 bad checksum + 13 FIL_PAGE_INDEX + 19272 FIL_PAGE_UNDO_LOG + 230 FIL_PAGE_INODE + 1 FIL_PAGE_IBUF_FREE_LIST + 892 FIL_PAGE_TYPE_ALLOCATED + 2 FIL_PAGE_IBUF_BITMAP + 195 FIL_PAGE_TYPE_SYS + 1 FIL_PAGE_TYPE_TRX_SYS + 1 FIL_PAGE_TYPE_FSP_HDR + 1 FIL_PAGE_TYPE_XDES + 0 FIL_PAGE_TYPE_BLOB + 0 FIL_PAGE_TYPE_ZBLOB + 0 other + 3 max index_id + +It has 19272 UNDO_LOG pages from a total of 20608. **That’s the 93% of the tablespace**. + +The second way to check the content of a tablespace are the [InnoDB Ruby Tools][8] made by Jeremy Cole. It is a more advanced tool to examine the internals of InnoDB. For example we can use the space-summary parameter to get a list with every page and its data type. We can use standard Unix tools to get the number of **UNDO_LOG** pages: + + # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l + 19272 + +Altough in this particular case innochecksum is faster and easier to use I recommend you to play with Jeremy’s tools to learn more about the data distribution inside InnoDB and its internals. + +OK, now we know where the problem is. The next question: + +### How can I solve the problem? ### + +The answer to this question is easy. If you can still commit that query, do it. If not you’ll have to kill the thread to start the rollback process. That will just stop ibdata1 from growing but it is clear that your software has a bug or someone made a mistake. Now that you know how to identify where is the problem you need to find who or what is causing it using your own debugging tools or the general query log. + +If the problem is caused by the purge thread then the solution is usually to upgrade to a newer version where you can use a dedicated purge thread instead of the master thread. More information on the following [documentation link][9]. + +### Is there any way to recover the used space? ### + +No, it is not possible at least in an easy and fast way. InnoDB tablespaces never shrink… see the following [10-year old bug report][10] recently updated by James Day (thanks): + +When you delete some rows, the pages are marked as deleted to reuse later but the space is never recovered. The only way is to start the database with fresh ibdata1. To do that you would need to take a full logical backup with mysqldump. Then stop MySQL and remove all the databases, ib_logfile* and ibdata* files. When you start MySQL again it will create a new fresh shared tablespace. Then, recover the logical dump. + +### Summary ### + +When the ibdata1 file is growing too fast within MySQL it is usually caused by a long running transaction that we have forgotten about. Try to solve the problem as fast as possible (commiting or killing a transaction) because you won’t be able to recover the wasted disk space without the painfully slow mysqldump process. + +Monitoring the database to avoid these kind of problems is also very recommended. Our [MySQL Monitoring Plugins][11] includes a Nagios script that can alert you if it finds a too old running transaction. + +-------------------------------------------------------------------------------- + +via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ + +作者:[Miguel Angel Nieto][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.percona.com/blog/author/miguelangelnieto/ +[1]:https://www.percona.com/products/mysql-support +[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table +[3]:https://www.percona.com/software/percona-server +[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size +[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file +[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace +[7]:http://bugs.mysql.com/bug.php?id=57611 +[8]:https://github.com/jeremycole/innodb_ruby +[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html +[10]:http://bugs.mysql.com/bug.php?id=1341 +[11]:https://www.percona.com/software/percona-monitoring-plugins \ No newline at end of file From 7d982a5bed74ed4c25ecffebc7cfa275170eef68 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 15:55:02 +0800 Subject: [PATCH 076/113] =?UTF-8?q?20150709-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... tools for monitoring your Linux system.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/talk/20150709 command line tools for monitoring your Linux system.md diff --git a/sources/talk/20150709 command line tools for monitoring your Linux system.md b/sources/talk/20150709 command line tools for monitoring your Linux system.md new file mode 100644 index 0000000000..012591d74f --- /dev/null +++ b/sources/talk/20150709 command line tools for monitoring your Linux system.md @@ -0,0 +1,79 @@ +7 command line tools for monitoring your Linux system +================================================================================ +**Here is a selection of basic command line tools that will make your exploration and optimization in Linux easier. ** + +![Image courtesy Meltys-stock](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-1-100591899-orig.png) + +### Dive on in ### + +One of the great things about Linux is how deeply you can dive into the system to explore how it works and to look for opportunities to fine tune performance or diagnose problems. Here is a selection of basic command line tools that will make your exploration and optimization easier. Most of these commands are already built into your Linux system, but in case they aren’t, just Google “install”, the command name, and the name of your distro and you’ll find which package needs installing (note that some commands are bundled with other commands in a package that has a different name from the one you’re looking for). If you have any other tools you use, let me know for our next Linux Tools roundup. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-2-100591901-orig.png) + +### How we did it ### + +FYI: The screenshots in this collection were created on [Debian Linux 8.1][1] (“Jessie”) running in a virtual machine under [Oracle VirtualBox 4.3.28][2] under [OS X 10.10.3][3] (“Yosemite”). See my next slideshow “[How to install Debian Linux in a VirtualBox VM][4]” for a tutorial on how to build your own Debian VM. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-3-100591902-orig.png) + +### Top command ### + +One of the simpler Linux system monitoring tools, the **top command** comes with pretty much every flavor of Linux. This is the default display, but pressing the “z” key switches the display to color. Other hot keys and command line switches control things such as the display of summary and memory information (the second through fourth lines), sorting the list according to various criteria, killing tasks, and so on (you can find the complete list at [here][5]). + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-4-100591904-orig.png) + +### htop ### + +Htop is a more sophisticated alternative to top. Wikipedia: “Users often deploy htop in cases where Unix top does not provide enough information about the systems processes, for example when trying to find minor memory leaks in applications. Htop is also popularly used interactively as a system monitor. Compared to top, it provides a more convenient, cursor-controlled interface for sending signals to processes.” (For more detail go [here][6].) + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-5-100591903-orig.png) + +### Vmstat ### + +Vmstat is a simpler tool for monitoring your Linux system performance statistics but that makes it highly suitable for use in shell scripts. Fire up your regex-fu and you can do some amazing things with vmstat and cron jobs. “The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case” (go [here][7] for more info.). + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-6-100591905-orig.png) + +### ps ### + +The ps command shows a list of running processes. In this case, I’ve used the “-e”switch to show everything, that is, all processes running (I’ve scrolled back to the top of the output otherwise the column names wouldn’t be visible). This command has a lot of switches that allow you to format the output as needed. Add a little of the aforementioned regex-fu and you’ve got a powerful tool. Go [here][8] for the full details. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-7-100591906-orig.png) + +### Pstree ### + +Pstree “shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.”This is a really useful tool as the tree helps you sort out which process is dependent on which process (go [here][9]). + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-8-100591907-orig.png) + +### pmap ### + +Understanding just how an app uses memory is often crucial in debugging, and the pmap produces just such information when given a process ID (PID). The screenshot shows the medium weight output generated by using the “-x”switch. You can get pmap to produce even more detailed information using the “-X”switch but you’ll need a much wider terminal window. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-9-100591900-orig.png) + +### iostat ### + +A crucial factor in your Linux system’s performance is processor and storage usage, which are what the iostat command reports on. As with the ps command, iostat has loads of switches that allow you to select the output format you need as well as sample performance over a time period and then repeat that sampling a number of times before reporting. See [here][10]. + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/2937219/linux/7-command-line-tools-for-monitoring-your-linux-system.html + +作者:[Mark Gibbs][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.networkworld.com/author/Mark-Gibbs/ +[1]:https://www.debian.org/releases/stable/ +[2]:https://www.virtualbox.org/ +[3]:http://www.apple.com/osx/ +[4]:http://www.networkworld.com/article/2937148/how-to-install-debian-linux-8-1-in-a-virtualbox-vm +[5]:http://linux.die.net/man/1/top +[6]:http://linux.die.net/man/1/htop +[7]:http://linuxcommand.org/man_pages/vmstat8.html +[8]:http://linux.die.net/man/1/ps +[9]:http://linux.die.net/man/1/pstree +[10]:http://linux.die.net/man/1/iostat \ No newline at end of file From 434e295d22351af1d9b33825b09a37924b25de02 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 16:00:34 +0800 Subject: [PATCH 077/113] =?UTF-8?q?20150709-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Believe in AI Singularity Are on Drugs.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md new file mode 100644 index 0000000000..22b2ad0f01 --- /dev/null +++ b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -0,0 +1,33 @@ +Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs +================================================================================ +*As usual, his comments should not be taken literally* + +![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) + +**AI is a very hot topic right now, and many high profile people, including Elon Musk, the head of Tesla, have said that we're going to get sentient AIs soon and that it's going to be a dangerous threshold. It seems that Linus Torvalds doesn't feel the same way, and he thinks that it's just bad Sci-Fi.** + +The idea of AIs turning on their human creators is not something new, but recently the so-called AI singularity has been discussed, and people like Elon Musk and Stephen Hawking expressed concerns about the possibility of creating a monster. And it's not just them, forums and comments sections are full of alarmist people who don't know what to believe or who take for granted the opinions of much smarter people. + +As it turns out, Linus Torvalds, the creator of the Linux project, has a completely different opinion on this matter. In fact, he says that nothing like this will happen, and we have a much better reason to believe him. AI means that someone wrote its code, and Linus knows the power and the obstacles of writing an AI code. He's much likely to guess what's involved and to understands why an AI won't be a threat. + +### Linus Torvalds and AIs ### + +Linus Torvalds answered some questions from the community on [slashdot.org][1], and all his ideas were very interesting. He talked about the [future of gaming and Valve][2], but he also tackled stuff like AI. He's usually asked stuff about the kernel or open source, but he has opinions on other topics as well. As a matter a fact, the AI subject is something that he can actually talk about as a programmer. + +"So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. The whole 'Singularity' kind of event? Yeah, it's science fiction, and not very good Sci-Fi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really" wrote Linus on Slashdot. + +It's your choice whether to believe Elon Musk or Linus, but if betting were involved, I would put my money on Linus. + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373.shtml + +作者:[Silviu Stahie][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie +[1]:http://classic.slashdot.org/story/15/06/30/0058243 +[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml \ No newline at end of file From 2003c8d0601731d57f554157e7d1db0abc375da5 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 16:26:16 +0800 Subject: [PATCH 078/113] =?UTF-8?q?20150709-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Google Hangouts Desktop Client In Linux.md | 67 +++++++++++ ... failure status due to previous errors'.md | 36 ++++++ ...w to install a Brother printer on Linux.md | 109 ++++++++++++++++++ ...abs in a GNOME terminal on Ubuntu 15.04.md | 38 ++++++ 4 files changed, 250 insertions(+) create mode 100644 sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md create mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md create mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md create mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md diff --git a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md new file mode 100644 index 0000000000..f7026f3d14 --- /dev/null +++ b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -0,0 +1,67 @@ +Install Google Hangouts Desktop Client In Linux +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) + +Earlier, we have seen how to [install Facebook Messenger in Linux][1] and [WhatsApp desktop client in Linux][2]. Both of these were unofficial apps. I have one more unofficial app for today and it is [Google Hangouts][3]. + +Of course, you can use Google Hangouts in the web browser but it is more fun to use the desktop client than the web browser one. Curious? Let’s see how to **install Google Hangouts desktop client in Linux** and how to use it. + +### Install Google Hangouts in Linux ### + +We are going to use an open source project called [yakyak][4] which is unofficial Google Hangouts client for Linux, Windows and OS X. I’ll show you how to use yakyak in Ubuntu but I believe that you can use the same method to use it in other Linux distributions. Before we see how to use it, let’s first take a look at main features of yakyak: + +- Send and receive chat messages +- Create and change conversations (rename, add people) +- Leave and/or delete conversation +- Desktop notifications +- Toggle notifications on/off +- Drag-drop, copy-paste or attach-button for image upload. +- Hangupsbot sync room aware (actual user pics) +- Shows inline images +- History scrollback + +Sounds good enough? Download the installation files from the link below: + +- [Download Google Hangout client yakyak][5] + +The downloaded file would be compressed. Extract it and you will see a directory like linux-x64 or linux-x32 based on your system. Go in to this directory and you should see a file named yakyak. Double click on it to run it. + +![Run Google Hangout in Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_3.jpeg) + +You’ll have to enter your Google Account credentials of course. + +![Set up Google Hangouts in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_2.jpeg) + +Once you are through, you’ll see a screen like the one below where you can chat with your Google contacts. + +![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) + +If you want to show profile pictures of the contacts, you can select View->Show conversation thumbnails. + +![Google hangouts thumbnails](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) + +You’ll also get desktop notification for new messages. + +![desktop notifications for Google Hangouts in Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_1.jpeg) + +### Worth a try? ### + +I let you give it a try and decide whether or not it is worth to **install Google Hangouts client in Linux**. If you want official apps, take a look at these [instant messaging applications with native Linux clients][6]. Don’t forget to share your experience with Google Hangouts in Linux. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-google-hangouts-linux/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/facebook-messenger-linux/ +[2]:http://itsfoss.com/whatsapp-linux-desktop/ +[3]:http://www.google.com/+/learnmore/hangouts/ +[4]:https://github.com/yakyak/yakyak +[5]:https://github.com/yakyak/yakyak +[6]:http://itsfoss.com/best-messaging-apps-linux/ \ No newline at end of file diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md new file mode 100644 index 0000000000..c970637b4d --- /dev/null +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -0,0 +1,36 @@ +Linux FAQs with Answers--How to fix “tar: Exiting with failure status due to previous errors” +================================================================================ +> **Question**: When I try to create an archive using tar command, it fails in the middle, and throws an error saying: "tar: Exiting with failure status due to previous errors." What causes this error, and how can I solve this error? + +![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) + +If you encounter the following error while running tar command, the most likely reason is that you do not have read permission on one of the files you are trying to archive with tar. + + tar: Exiting with failure status due to previous errors + +Then how can we pin down the file(s) causing the errors, or identify any other cause? + +The tar command should actually print out what those "previous errors" are, but you can easily miss printed error messages if you run tar in verbose mode (e.g., -cvf). To catch error messages more easily, you can filter out tar's stdout messages as follows. + + $ tar cvzfz backup.tgz my_program/ > /dev/null + +You will then see only error messages sent by tar to stderr. + + tar: my_program/src/lib/.conf.db.~lock~: Cannot open: Permission denied + tar: Exiting with failure status due to previous errors + +As you can see in the above example, the cause for the errors is indeed "denied read permission." + +To solve the problem, simply adjust the permission of the problematic file (or remove it), and re-run tar. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md new file mode 100644 index 0000000000..dd10d5c8dd --- /dev/null +++ b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md @@ -0,0 +1,109 @@ +Linux FAQs with Answers--How to install a Brother printer on Linux +================================================================================ +> **Question**: I have a Brother HL-2270DW laser printer, and want to print documents from my Linux box using this printer. How can I install an appropriate Brother printer driver on my Linux computer, and use it? + +Brother is well known for its affordable [compact laser printer lineup][1]. You can get a high-quality WiFi/duplex-capable laser printer for less than 200USD, and the price keeps going down. On top of that, they provide reasonably good Linux support, so you can download and install their printer driver on your Linux computer. I bought [HL-2270DW][2] model more than a year ago, and I have been more than happy with its performance and reliability. + +Here is how to install and configure a Brother printer driver on Linux. In this tutorial, I am demonstrating the installation of a USB driver for Brother HL-2270DW laser printer. So first connect your printer to a Linux computer via USB cable. + +### Preparation ### + +In this preparation step, go to the official [Brother support website][3], and search for the driver of your Brother printer by typing printer model name (e.g., HL-2270DW). + +![](https://farm1.staticflickr.com/301/18970034829_6f3a48d817_c.jpg) + +Once you go to the download page for your Brother printer, choose your Linux platform. For Debian, Ubuntu or their derivatives, choose "Linux (deb)". For Fedora, CentOS or RHEL, choose "Linux (rpm)". + +![](https://farm1.staticflickr.com/380/18535558583_cb43240f8a_c.jpg) + +On the next page, you will find a LPR driver as well as CUPS wrapper driver for your printer. The former is a command-line driver, while the latter allows you to configure and manage your printer via web-based administration interface. Especially the CUPS-based GUI is quite useful for (local or remote) printer maintenance. It is recommended that you install both drivers. So click on "Driver Install Tool" and download the installer file. + +![](https://farm1.staticflickr.com/329/19130013736_1850b0d61e_c.jpg) + +Before proceeding to run the installer file, you need to do one additional step if you are using a 64-bit Linux system. + +Since Brother printer drivers are developed for 32-bit Linux, you need to install necessary 32-bit libraries on 64-bit Linux as follows. + +On older Debian (6.0 or earlier) or Ubuntu (11.04 or earlier), install the following package. + + $ sudo apt-get install ia32-libs + +On newer Debian or Ubuntu which has introduced multiarch, you can install the following package instead: + + $ sudo apt-get install lib32z1 lib32ncurses5 + +which replaces ia32-libs package. Or, you can install just: + + $ sudo apt-get install lib32stdc++6 + +If you are using a Red Hat based Linux, you can install: + + $ sudo yum install glibc.i686 + +### Driver Installation ### + +Now go ahead and extract a downloaded driver installer file. + + $ gunzip linux-brprinter-installer-2.0.0-1.gz + +Next, run the driver installer file as follows. + + $ sudo sh ./linux-brprinter-installer-2.0.0-1 + +You will be prompted to type a printer model name. Type the model name of your printer, for example "HL-2270DW". + +![](https://farm1.staticflickr.com/292/18535599323_1a94f6dae5_b.jpg) + +After agreeing to GPL license agreement, accept default answers to any subsequent questions. + +![](https://farm1.staticflickr.com/526/19130014316_5835939501_b.jpg) + +Now LPR/CUPS printer drivers are installed. Proceed to configure your printer next. + +### Printer Configuration ### + +We are going to configure and manage a Brother via CUPS-based web management interface. + +First, verify that CUPS daemon is running successfully. + + $ sudo netstat -nap | grep 631 + +Open a web browser window, and go to http://localhost:631. You will see the following CUPS printer management interface. + +![](https://farm1.staticflickr.com/324/18968588688_202086fc72_c.jpg) + +Go to "Administration" tab, and click on "Manage Printers" under Printers section. + +![](https://farm1.staticflickr.com/484/18533632074_0526cccb86_c.jpg) + +You must see your printer (HL-2270DW) listed in the next page. Click on the printer name. +![](https://farm1.staticflickr.com/501/19159651111_95f6937693_c.jpg) + +In the dropdown menu titled "Administration", choose "Set As Server Default" option. This will make your printer system-wide default. + +![](https://farm1.staticflickr.com/472/19150412212_b37987c359_c.jpg) + +When asked to authenticate yourself, type in your Linux login information. + +![](https://farm1.staticflickr.com/511/18968590168_807e807f73_c.jpg) + +Now the basic configuration step is mostly done. To test print, open any document viewer application (e.g., PDF viwer), and print it. You will see "HL-2270DW" listed and chosen by default in printer setting. + +![](https://farm4.staticflickr.com/3872/18970034679_6d41d75bf9_c.jpg) + +Print should work now. You can see the printer status and manage printer jobs via the same CUPS web interface. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-brother-printer-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/brother_printers +[2]:http://xmodulo.com/go/hl_2270dw +[3]:http://support.brother.com/ \ No newline at end of file diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md new file mode 100644 index 0000000000..a9a53bf8b1 --- /dev/null +++ b/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md @@ -0,0 +1,38 @@ +Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04 +================================================================================ +> **Question**: I used to be able to open multiple tabs inside gnome-terminal on my Ubuntu desktop. On Ubuntu 15.04, however, I can no longer open a new tab in my terminal window. How can I open tabs in gnome-terminal on Ubuntu 15.04? + +On Ubuntu 14.10 or earlier, gnome-terminal allowed you to open either a new terminal or a tab inside a terminal window. However, starting with Ubuntu 15.04, gnome-terminal has removed "New Tab" menu option. This is actually not a bug, but a feature that attempts to unify new tab and new window. GNOME 3.12 has introduced a [single "Open Terminal" option][1]. The ability to open a new terminal tab has been migrated from the terminal menu to Preferences. + +![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) + +### Open Tabs via Preferences ### + +To be able to open a new tab in new gnome-terminal of Ubuntu 15.04, go to "Edit" -> "Preferences", and change "Open new terminals in: Window" to "Open new terminals in: Tab". + +![](https://farm1.staticflickr.com/329/19256530766_ff692b83bc_b.jpg) + +Now if you open a new terminal via menu, it will automatically open a new tab inside the terminal. + +![](https://farm4.staticflickr.com/3820/18662051223_3296fde8e4_b.jpg) + +### Open Tabs via a Keyboard Shortcut ### + +If you do not want to change Preferences, you can hold down to "invert" Preferences setting temporarily. For example, under the default Preferences, if you hold down and click on "New Terminal", it will open a new tab, not a terminal. + +Alternatively, you can simply use a keyboard shortcut to open a new tab in a terminal. + +In my view, this UI change in gnome-terminal is not quite an improvement. For example, you are no longer able to customize the name of individual terminal tabs. This feature is useful when you have many tabs open in a terminal. With the default tab name fixed to the current prompt (whose length can grow quickly), you easily cannot see the whole prompt string in the limited tab name space. Hope this feature will become available soon. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://worldofgnome.org/opening-a-new-terminal-tabwindow-in-gnome-3-12/ \ No newline at end of file From 8a19114515317827ba43a5647ae47d436d974fdf Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 9 Jul 2015 19:06:01 +0800 Subject: [PATCH 079/113] Update 20150709 Why is the ibdata1 file continuously growing in MySQL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 --- ...09 Why is the ibdata1 file continuously growing in MySQL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md index 92094a3315..2fcf9353bb 100644 --- a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md +++ b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -1,3 +1,4 @@ +wyangsun 翻译中 Why is the ibdata1 file continuously growing in MySQL? ================================================================================ ![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) @@ -111,4 +112,4 @@ via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuousl [8]:https://github.com/jeremycole/innodb_ruby [9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html [10]:http://bugs.mysql.com/bug.php?id=1341 -[11]:https://www.percona.com/software/percona-monitoring-plugins \ No newline at end of file +[11]:https://www.percona.com/software/percona-monitoring-plugins From b3c0a231df14fbf854af9c0c94c12f5a4262dbf3 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 9 Jul 2015 23:52:09 +0800 Subject: [PATCH 080/113] PUB:20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0 @geekpi --- ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 240 ++++++++++++++++++ ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 239 ----------------- 2 files changed, 240 insertions(+), 239 deletions(-) create mode 100644 published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md delete mode 100644 translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md diff --git a/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..67727abe22 --- /dev/null +++ b/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -0,0 +1,240 @@ +在 RHEL/CentOS 7.0 中安装 LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) +================================================================================ + +跳过 LAMP 的介绍,因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到 Apache 2.4 的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0 中安装和配置 LAMP:Linux、Apache、 MariaDB、 PHP/PhpMyAdmin。 + +![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) + +*在 RHEL/CentOS 7.0 中安装 LAMP* + +#### 前置要求 #### + +根据使用的发行版是 RHEL 还是 CentOS 7.0,按照下面的链接来进行最小化的系统安装,网络使用静态 IP。 + +**对于 RHEL 7.0** + +- [RHEL 7.0 安装过程][1] +- [在 RHEL 7.0 中注册和启用订阅仓库][2] + +**对于 CentOS 7.0** + +- [CentOS 7.0 安装过程][3] + +### 第一步:使用基本配置安装apache ### + +1、在完成最小化系统安装,并[在 RHEL/CentOS 7.0 上配置静态 IP][4] 后,就可以使用下面的命令从官方仓库安装最新的 Apache 2.4 httpd 服务了。 + + # yum install httpd + +![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) + +*安装 apache 服务* + +2、安装完成后,使用下面的命令来管理apache守护进程,因为 RHEL 和 CentOS 7.0 都将 init 脚本从 SysV 升级到了systemd,所以同时你还可以使用 SysV 脚本和 Apache 脚本来管理服务。 + + # systemctl status|start|stop|restart|reload httpd + + 或者 + + # service httpd status|start|stop|restart|reload + + 或者 + + # apachectl configtest| graceful + +![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) + +*启动apache服务* + +3、在使用 systemd 初始化脚本来启动 apache 服务后,要用 `firewall-cmd` 打开 RHEL/CentOS 7.0 防火墙规则, 这是通过 [firewalld][7] 守护进程管理 iptables 的默认命令。** + + # firewall-cmd --add-service=http + +**注意**:上面的命令会在系统重启或者 firewalld 服务重启后失效,因为它是即时的规则,它不会永久生效。要使 iptables 规则在 fiewalld 中持久化,使用 `--permanent` 选项并重启 firewalld 服务来生效。(LCTT 译注:也可以不重启 firewalld 服务,而是再执行一遍不带 ` --permanent` 选项的命令。) + + # firewall-cmd --permanent --add-service=http + # systemctl restart firewalld + +![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) + +*在 CentOS 7 中启用防火墙* + +下面是 firewalld 其他的重要选项: + + # firewall-cmd --state + # firewall-cmd --list-all + # firewall-cmd --list-interfaces + # firewall-cmd --get-service + # firewall-cmd --query-service service_name + # firewall-cmd --add-port=8080/tcp + +4、要验证 apache 的功能,打开一个远程浏览器并使用 http 协议访问你服务器的 IP 地址(http://server_IP), 应该会显示下图中的默认页面。 + +![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) + +*Apache 默认页* + +5、现在 apache 的根地址在 `/var/www/html`,该目录中没有提供任何索引文件。如果你想要看见根目录下的文件夹列表,打开 apache 欢迎配置文件并设置 `` 下 `Indexes` 前的状态从`-`到`+`,下面的截图就是一个例子。 + + # nano /etc/httpd/conf.d/welcome.conf + +![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) + +*Apache 目录列出* + +6、关闭文件,重启 apache 服务来使设置生效,重载页面来看最终效果。 + + # systemctl restart httpd + +![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) + +*Apache 索引文件* + +### 第二步:为 Apache 安装 php5 支持 ### + +7、在为 apache 安装 php 支持之前,使用下面的命令的得到所有可用的php模块和扩展。 + + # yum search php + +![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) + +在 CentOS 7 上安装 PHP* + +8、根据你所要使用的应用类型,安装上述列表中所需的 PHP 模块。对于 PHP 中的基本的 MariaDB 支持和 PhpMyAdmin,你需要安装如下模块。 + + # yum install php php-mysql php-pdo php-gd php-mbstring + +![Install PHP Modules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-Modules-in-CentOS-7.png) + +*安装 PHP 模块* + +![Install PHP mbstring Module](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-mbstring-in-CentOs-7.png) + +*安装 PHP mbstring 模块* + +9、 要在你的浏览器上显示 PHP 的全部信息,用 root 账号执行如下命令在 Apache 的文档根目录下创建一个 `info.php` 文件,然后重启 httpd 服务,并在你的浏览器里面访问 http://server_IP/info.php 。 + + # echo "" > /var/www/html/info.php + # systemctl restart httpd + +![Check PHP Info in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Check-PHP-Info-in-CentOS-7.png) + +*查看 CentOS 7 上的 PHP 信息* + +10、如果你得到一个 PHP 的日期和时区错误,打开配置文件 `php.ini`,取消 `date.timezone` 语句的注释,加上你的实际时区参数,然后重启 Apache 守护进程。 + + # nano /etc/php.ini + +找到并如下修改`date.timezone`,参考 [PHP 支持的时区列表][5]。(LCTT 译注:对于中国,可以使用 Asia/Shanghai、Asia/Chongqing 等,但是不建议使用向后兼容而保留的 PRC。) + + date.timezone = Continent/City + +![Set Timezone in PHP](http://www.tecmint.com/wp-content/uploads/2014/07/Set-Time-Zone-in-CentOS.png) + +*设置 PHP 的时区* + +###第三步:安装和配置 MariaDB 数据库 ### + +11、 Red Hat Enterprise Linux/CentOS 7.0 使用 MariaDB 替换 MySQL 为默认数据库管理系统。使用如下命令安装 MariaDB 数据库。 + + # yum install mariadb-server mariadb + +![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) + +*在 CentOS 7中安装 MariaDB* + +12、安装 MariaDB 后,启动数据库守护进程并使用 mysql_secure_installation 脚本来保护数据库(设置数据库的 root 密码、禁止远程 root 登录、移除测试数据库、移除匿名用户等)。 + + # systemctl start mariadb + # mysql_secure_installation + +![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) + +*启动 MariaDB 数据库* + +![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) + +*MariaDB 安全设置* + +13、要测试数据库功能,使用 root 账户登录 MariaDB 并用 quit 退出。 + + mysql -u root -p + MariaDB > SHOW VARIABLES; + MariaDB > quit + +![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) + +*连接 MariaDB 数据库* + +### 第四步:安装 PhpMyAdmin ### + +14、 RHEL 7.0 或者 CentOS 7.0 仓库默认没有提供 PhpMyAdmin 二进制安装包。如果你不适应使用 MySQL 命令行来管理你的数据库,你可以通过下面的命令启用 CentOS 7.0 rpmforge 仓库来安装 PhpMyAdmin。 + + # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm + +启用 rpmforge 仓库后,下面安装 PhpMyAdmin。 + + # yum install phpmyadmin + +![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) + +*启用 RPMForge 仓库* + +15、下面配置 PhpMyAdmin 的 `phpmyadmin.conf` 来允许远程连接,它位于 Apache 的 `conf.d` 目录下,并注释掉下面的行。 + + # nano /etc/httpd/conf.d/phpmyadmin.conf + +使用#来注释掉下列行。 + + # Order Deny,Allow + # Deny from all + # Allow from 127.0.0.1 + +![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) + +*允许远程 PhpMyAdmin 访问* + +16、 要使用 cookie 验证来登录 PhpMyAdmin,像下面的截图那样使用[生成的秘密字符串][6]来添加一个 blowfish 字符串到 `config.inc.php` 文件中,重启 apache 服务并打开 URL:http://server_IP/phpmyadmin/。 + + # nano /etc/httpd/conf.d/phpmyadmin.conf + # systemctl restart httpd + +![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) + +*在 PhpMyAdmin 中添加 Blowfish* + +![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) + +*PhpMyAdmin 面板* + +### 第五步:在系统范围内启用 LAMP ### + +17、 如果你需要在重启后自动运行 MariaDB 和 Apache 服务,你需要在系统级地启用它们。 + + # systemctl enable mariadb + # systemctl enable httpd + +![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) + +*系统级启用服务* + +这就是在 Red Hat Enterprise 7.0 或者 CentOS 7.0 中安装 LAMP 的过程。在 CentOS/RHEL 7.0 上关于 LAMP 的系列文章接下来将会讨论在 Apache 中创建虚拟主机,生成 SSL 证书、密钥和添加 SSL 事务支持。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-lamp-in-centos-7/ + +作者:[Matei Cezar][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/cezarmatei/ +[1]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ +[2]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/ +[3]:http://www.tecmint.com/centos-7-installation/ +[4]:https://linux.cn/article-3977-1.html +[5]:http://php.net/manual/en/timezones.php +[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator +[7]:https://linux.cn/article-4425-1.html diff --git a/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md deleted file mode 100644 index 5057c2e416..0000000000 --- a/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md +++ /dev/null @@ -1,239 +0,0 @@ -在RHEL/CentOS 7.0中安装LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) -================================================================================ -跳过LAMP的介绍因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到Apache 2.4的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0中安装和配置LAMP-Linux Apache、 MariaDB、 PHP、PhpMyAdmin。 - -![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) - -在RHEL/CentOS 7.0中安装LAMP - -#### 要求 #### - -根据使用的发行版,RHEL 或者 CentOS 7.0使用下面的链接来执行最小的系统安装,网络使用静态ip - -**对于RHEL 7.0** - -- [RHEL 7.0安装过程][1] -- [在RHEL 7.0中注册和启用订阅仓库][2] - -**对于 CentOS 7.0** - -- [CentOS 7.0 安装过程][3] - -### 第一步: 使用基本配置安装apache ### - -**1. 在执行最小系统安装并配置[在RHEL/CentOS 7.0中配置静态ip][4]**就可以从使用下面的命令从官方仓库安装最新的Apache 2.4 httpd服务。 - - # yum install httpd - -![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) - -安装apache服务 - -**2. 安装安城后,使用下面的命令来管理apache守护进程,因为RHEL and CentOS 7.0都将init脚本从SysV升级到了systemd - 你也可以同事使用SysV和Apache脚本来管理服务。** - - # systemctl status|start|stop|restart|reload httpd - - 或者 - - # service httpd status|start|stop|restart|reload - - 或者 - - # apachectl configtest| graceful - -![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) - -启动apache服务 - -**3. 下一步使用systemd初始化脚本来启动apache服务并用firewall-cmd打开RHEL/CentOS 7.0防火墙规则, 这是通过firewalld守护进程管理iptables的默认命令。** - - # firewall-cmd --add-service=http - -**注意**:上面的命令会在系统重启或者firewalld服务重启后失效,因为它是即时的规则,它不会永久生效。要使iptables规则在fiewwall中持久化,使用-permanent选项并重启firewalld服务来生效。 - - # firewall-cmd --permanent --add-service=http - # systemctl restart firewalld - -![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) - -在CentOS 7中启用Firewall - -下面是firewalld其他的重要选项: - - # firewall-cmd --state - # firewall-cmd --list-all - # firewall-cmd --list-interfaces - # firewall-cmd --get-service - # firewall-cmd --query-service service_name - # firewall-cmd --add-port=8080/tcp - -**4. 要验证apache的功能,打开一个远程浏览器并使用http协议输入你服务器的ip地址(http://server_IP), 应该会显示下图中的默认页面。** - -![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) - -Apache默认页 - -**5. 现在apache的根地址在/var/www/html,该目录中没有提供任何index文件。如果你想要看见根目录下的文件夹列表,打开apache欢迎配置文件并设置 下Indexes前的状态从-到+,下面的截图就是一个例子。** - - # nano /etc/httpd/conf.d/welcome.conf - -![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) - -Apache目录列出 - -**6. 关闭文件,重启apache服务来使设置生效,重载页面来看最终效果。** - - # systemctl restart httpd - -![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) - -Apache Index 文件 - -### 第二步: 为Apache安装php5支持 ### - - -**7. 在为apache安装php支持之前,使用下面的命令的得到所有可用的php模块和扩展。** - - # yum search php - -![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) - -在 - -**8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.** - - # yum install php php-mysql php-pdo php-gd php-mbstring - -![Install PHP Modules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-Modules-in-CentOS-7.png) - -Install PHP Modules - -![Install PHP mbstring Module](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-mbstring-in-CentOs-7.png) - -Install PHP mbstring Module - -**9. To get a full information list on PHP from your browser, create a info.php file on Apache Document Root using the following command from root account, restart httpd service and direct your browser to the http://server_IP/info.php address.** - - # echo "" > /var/www/html/info.php - # systemctl restart httpd - -![Check PHP Info in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Check-PHP-Info-in-CentOS-7.png) - -Check PHP Info in CentOS 7 - -**10. If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment date.timezone statement, append your physical location and restart Apache daemon.** - - # nano /etc/php.ini - -Locate and change date.timezone line to look like this, using [PHP Supported Timezones list][5]. - - date.timezone = Continent/City - -![Set Timezone in PHP](http://www.tecmint.com/wp-content/uploads/2014/07/Set-Time-Zone-in-CentOS.png) - -Set Timezone in PHP - -### Step 3: Install and Configure MariaDB Database ### - -**11. Red Hat Enterprise Linux/CentOS 7.0 switched from MySQL to MariaDB for its default database management system. To install MariaDB database use the following command.** - - # yum install mariadb-server mariadb - -![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) - -在CentOS 7中安装PHP - -***12. 安装MariaDB后,开启数据库守护进程并使用mysql_secure_installation脚本来保护数据库(设置root密码、禁止远程root登录、移除测试数据库、移除匿名用户)** - - # systemctl start mariadb - # mysql_secure_installation - -![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) - -启动MariaDB数据库 - -![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) - -MySQL安全设置 - -**13. 要测试数据库功能,使用root账户登录MariaDB并用quit退出。** - - mysql -u root -p - MariaDB > SHOW VARIABLES; - MariaDB > quit - -![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) - -连接MySQL数据库 - -### 第四步: 安装PhpMyAdmin ### - -**14. RHEL 7.0 或者 CentOS 7.0仓库默认没有提供PhpMyAdmin二进制安装包。如果你不适应使用MySQL命令行来管理你的数据库,你可以通过下面的命令启用CentOS 7.0 rpmforge仓库来安装PhpMyAdmin。** - - # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm - -启用rpmforge仓库后,下面安装PhpMyAdmin。 - - # yum install phpmyadmin - -![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) - -启用RPMForge仓库 - -**15. 下面配置PhpMyAdmin的phpmyadmin.conf来允许远程连接,它位于Apache conf.d目录下,并注释掉下面的行。** - - # nano /etc/httpd/conf.d/phpmyadmin.conf - -使用#来注释掉行。 - - # Order Deny,Allow - # Deny from all - # Allow from 127.0.0.1 - -![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) - -允许远程PhpMyAdmin访问 - -**16. 要使用cookie验证来登录PhpMyAdmin,像下面的截图那样使用[生成字符串][6]添加一个blowfish字符串到config.inc.php文件下,重启apache服务并打开URL:http://server_IP/phpmyadmin/。** - - # nano /etc/httpd/conf.d/phpmyadmin.conf - # systemctl restart httpd - -![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) - -在PhpMyAdmin中添加Blowfish - -![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) - -PhpMyAdmin面板 - -### 第五步: 系统范围启用LAMP ### - -**17. 如果你需要在重启后自动运行MariaDB和Apache服务,你需要系统级地启用它们。** - - # systemctl enable mariadb - # systemctl enable httpd - -![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) - -系统级启用服务 - -这就是在Red Hat Enterprise 7.0或者CentOS 7.0中安装LAMP的过程。CentOS/RHEL 7.0上关于LAMP洗系列文章将会讨论在Apache中创建虚拟主机,生成SSL证书、密钥和添加SSL事物支持。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-lamp-in-centos-7/ - -作者:[Matei Cezar][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/cezarmatei/ -[1]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ -[2]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/ -[3]:http://www.tecmint.com/centos-7-installation/ -[4]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/ -[5]:http://php.net/manual/en/timezones.php -[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator From ca38157bce669f7c963c2f6186bc1f1421bb19d1 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 10 Jul 2015 06:29:14 +0800 Subject: [PATCH 081/113] Update 20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md --- ... Believe in AI Singularity Are on Drugs.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md index 22b2ad0f01..e43c7792a8 100644 --- a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md +++ b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -1,22 +1,22 @@ -Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs +Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 ================================================================================ -*As usual, his comments should not be taken literally* +*像往常一样, 他的评论不能只看字面意思* ![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) -**AI is a very hot topic right now, and many high profile people, including Elon Musk, the head of Tesla, have said that we're going to get sentient AIs soon and that it's going to be a dangerous threshold. It seems that Linus Torvalds doesn't feel the same way, and he thinks that it's just bad Sci-Fi.** +**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** -The idea of AIs turning on their human creators is not something new, but recently the so-called AI singularity has been discussed, and people like Elon Musk and Stephen Hawking expressed concerns about the possibility of creating a monster. And it's not just them, forums and comments sections are full of alarmist people who don't know what to believe or who take for granted the opinions of much smarter people. +人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 -As it turns out, Linus Torvalds, the creator of the Linux project, has a completely different opinion on this matter. In fact, he says that nothing like this will happen, and we have a much better reason to believe him. AI means that someone wrote its code, and Linus knows the power and the obstacles of writing an AI code. He's much likely to guess what's involved and to understands why an AI won't be a threat. +事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 -### Linus Torvalds and AIs ### +### Linus Torvalds与人工智能 ### -Linus Torvalds answered some questions from the community on [slashdot.org][1], and all his ideas were very interesting. He talked about the [future of gaming and Valve][2], but he also tackled stuff like AI. He's usually asked stuff about the kernel or open source, but he has opinions on other topics as well. As a matter a fact, the AI subject is something that he can actually talk about as a programmer. +Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 -"So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. The whole 'Singularity' kind of event? Yeah, it's science fiction, and not very good Sci-Fi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really" wrote Linus on Slashdot. +“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 -It's your choice whether to believe Elon Musk or Linus, but if betting were involved, I would put my money on Linus. +选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 -------------------------------------------------------------------------------- @@ -30,4 +30,4 @@ via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an [a]:http://news.softpedia.com/editors/browse/silviu-stahie [1]:http://classic.slashdot.org/story/15/06/30/0058243 -[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml \ No newline at end of file +[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml From db5eba785fea69bca9e166ebb4985b7d8779f123 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 10 Jul 2015 06:32:38 +0800 Subject: [PATCH 082/113] translated --- ... Believe in AI Singularity Are on Drugs.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md new file mode 100644 index 0000000000..d2ff0a1eda --- /dev/null +++ b/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -0,0 +1,33 @@ +Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 +================================================================================ +*像往常一样, 他的评论不能只看字面意思* + +![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) + +**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** + +人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 + +事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 + +### Linus Torvalds与人工智能 ### + +Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 + +“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 + +选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373.shtml + +作者:[Silviu Stahie][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie +[1]:http://classic.slashdot.org/story/15/06/30/0058243 +[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml From 8772f216d556546687b1170a9b764663da20079b Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 10 Jul 2015 06:33:31 +0800 Subject: [PATCH 083/113] Delete 20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md --- ... Believe in AI Singularity Are on Drugs.md | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md deleted file mode 100644 index e43c7792a8..0000000000 --- a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md +++ /dev/null @@ -1,33 +0,0 @@ -Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 -================================================================================ -*像往常一样, 他的评论不能只看字面意思* - -![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) - -**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** - -人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 - -事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 - -### Linus Torvalds与人工智能 ### - -Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 - -“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 - -选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373.shtml - -作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie -[1]:http://classic.slashdot.org/story/15/06/30/0058243 -[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml From 9e14e474ed242ec30fd642ed076d0c77126dfa55 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 9 Jul 2015 18:08:42 -0500 Subject: [PATCH 084/113] =?UTF-8?q?Update=20[=E7=BF=BB=E8=AF=91=E4=B8=AD]2?= =?UTF-8?q?0150612=20Linux=5FLogo--A=20Command=20Line=20Tool=20to=20Print?= =?UTF-8?q?=20Color=20ANSI=20Logos=20of=20Linux=20Distributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nt Color ANSI Logos of Linux Distributions.md | 145 +++++++++--------- 1 file changed, 72 insertions(+), 73 deletions(-) diff --git a/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md index cd502ac0a9..e9a27aff00 100644 --- a/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md +++ b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -1,181 +1,180 @@ -[translating by KevinSJ] -Linux_Logo – A Command Line Tool to Print Color ANSI Logos of Linux Distributions +Linux_Logo – 输出彩色 ANSI Linux 发行版徽标的命令行工具 ================================================================================ -linuxlogo or linux_logo is a Linux command line utility that generates a color ANSI picture of Distribution logo with a few system information. +linuxlogo 或 linux_logo 是一款在Linux命令行下生成附带系统信息的彩色 ANSI 发行版徽标的工具。 -![Linux_Logo - Prints Color ANSI Logs of Linux Distro](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) -Linux_Logo – Prints Color ANSI Logs of Linux Distro +![Linux_Logo – 输出彩色 ANSI Linux 发行版徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) -This utility obtains System Information from /proc Filesystem. linuxlogo is capable of showing color ANSI image of various logos other than the host distribution logo. +Linux_Logo – 输出彩色 ANSI Linux 发行版徽标 -The System information associated with logo includes – Linux Kernel Version, Time when Kernel was last Compiled, Number/core of processor, Speed, Manufacturer and processor Generation. It also show information about total physical RAM. +这个小工具可以从 /proc 文件系统中获取系统信息并可以显示包括主机发行版在内的其他很多发行版的徽标。 -It is worth mentioning here that screenfetch is another tool of similar kind, which shows distribution logo and a more detailed and formatted system inform http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ation. We have already covered screenfetch long ago, which you may refer at: +与徽标一同显示的系统信息包括 – Linux 内核版本,最近一次编译Linux内核的时间,处理器/核心数量,速度,制造商,以及哪一代处理器。它还能显示总共的物理内存大小。 -- [ScreenFetch – Generates Linux System Information][15] +值得一提的是,screenfetch是一个拥有类似功能的工具,它也能显示发行版徽标,同时还提供更加详细美观的系统信息。我们之前已经介绍过这个工具,你可以参考一下链接: +- [ScreenFetch – Generates Linux System Information][1] -linux_logo and Screenfetch should not be compared to each other. While the output of screenfetch is more formatted and detailed, where linux_logo produce maximum number of color ANSI diagram, and option to format the output. -linux_logo is written primarily in C programming Language, which displays linux logo in an X Window System and hence User Interface X11 aka X Window System should be installed. The software is released under GNU General Public License Version 2.0. +linux_logo 和 Screenfetch 并不能相提并论。尽管 screenfetch 的输出较为整洁并提供更多细节, linux_logo 则提供了更多的彩色 ANSI 图标, 并且提供了格式化输出的选项。 -For the purpose of this article, we’re using following testing environment to test the linux_logo utility. +linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统中因此需要安装图形界面 X11 或 X 系统。这个软件使用GNU 2.0协议。 - Operating System : Debian Jessie - Processor : i3 / x86_64 +本文中,我们将使用以下环境测试 linux_logo 工具。 -### Installing Linux Logo Utility in Linux ### + 操作系统 : Debian Jessie + 处理器 : i3 / x86_64 -**1. The linuxlogo package (stable version 5.11) is available to install from default package repository under all Linux distributions using apt, yum or dnf package manager as shown below.** +### 在 Linux 中安装 Linux Logo工具 ### - # apt-get install linux_logo [On APT based Systems] - # yum install linux_logo [On Yum based Systems] - # dnf install linux_logo [On DNF based Systems] - OR - # dnf install linux_logo.x86_64 [For 64-bit architecture] +**1. linuxlogo软件包 ( 5.11 稳定版) 可通过如下方式使用 apt, yum,或 dnf 在所有发行版中使用默认的软件仓库进行安装** -**2. Once linuxlogo package has been installed, you can run the command `linuxlogo` to get the default logo for the distribution you are using..** + # apt-get install linux_logo [用于基于 Apt 的系统] (译者注:Ubuntu中,该软件包名为linuxlogo) + # yum install linux_logo [用于基于 Yum 的系统] + # dnf install linux_logo [用于基于 Dnf 的系统] + 或 + # dnf install linux_logo.x86_64 [用于 64 位系统] + +**2. 装好linuxlogo软件包之后,你可以使用命令 `linuxlogo` 来获取你当前使用的发行版的默认徽标..** # linux_logo - OR + 或 # linuxlogo -![Get Default OS Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) +![获取默认系统徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) -Get Default OS Logo +获取默认系统徽标 -**3. Use the option `[-a]`, not to print any fancy color. Useful if viewing linux_logo over black and white terminal.** +**3. 使用 `[-a]` 选项可以输出没有颜色的徽标。当在黑白终端里使用 linux_logo 时,这个选项会很有用。** # linux_logo -a -![Black and White Linux Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) +![黑白 Linux 徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) -Black and White Linux Logo +黑白 Linux 徽标 -**4. Use option `[-l]` to print LOGO only and exclude all other System Information.** +**4. 使用 `[-l]` 选项可以仅输出徽标而不包含系统信息。** -# linux_logo -l + # linux_logo -l -![Print Distribution Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) +![输出发行版徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) -Print Distribution Logo +输出发行版徽标 -**5. The `[-u]` switch will display system uptime.** +**5. `[-u]` 选项可以显示系统运行时间。** # linux_logo -u -![Print System Uptime](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) +![输出系统运行时间](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) -Print System Uptime +输出系统运行时间 -**6. If you are interested in Load Average, use option `[-y]`. You may use more than one option at a time.** +**6. 如果你对系统平均负载感兴趣,可以使用 `[-y]` 选项。你可以同时使用多个选项。** # linux_logo -y -![Print System Load Average](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) +![输出系统平均负载](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) -Print System Load Average +输出系统平均负载 -For more options and help on them, you may like to run. +如需查看更多选项并获取相关帮助,你可以使用如下命令。 # linux_logo -h -![Linuxlogo Options and Help](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) +![Linuxlogo 选项及帮助](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) -Linuxlogo Options and Help +Linuxlogo选项及帮助 -**7. There are a lots of built-in Logos for various Linux distributions. You may see all those logos using option `-L list` switch.** +**7. 此工具内置了很多不同发行版的徽标。你可以使用 `[-L list]` 选项查看在这些徽标的列表。** # linux_logo -L list -![List of Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) +![Linux 徽标列表](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) -List of Linux Logos +Linux 徽标列表 -Now you want to print any of the logo from the list, you may use `-L NUM` or `-L NAME` to display selected logo. +如果你想输出这个列表中的任意徽标,可以使用 `-L NUM` 或 `-L NAME` 来显示想要选中的图标。 -- -L NUM – will print logo with number NUM (deprecated). -- -L NAME – will print the logo with name NAME. +- -L NUM – 会输出列表中序号为 NUM 的图标 (不推荐). +- -L NAME – 会输出列表中名为 NAME 的图标。 -For example, to display AIX Logo, you may use command as: +例如,如果想要显示 AIX 的徽标,你可以使用如下命令 # linux_logo -L 1 - OR + 或 # linux_logo -L aix -![Print AIX Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) +![输出 AIX 图标](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) -Print AIX Logo +输出 AIX 图标 -**Notice**: The `-L 1` in the command where 1 is the number at which AIX logo appears in the list, where `-L aix` is the name at which AIX logo appears in the list. +**注**: 命令中的使用 `-L 1` 是因为 AIX 徽标在列表中的编号是1,而使用 `-L aix` 则是因为 AIX 徽标在列表中的名称为 aix -Similarly, you may print any logo using these options, few examples to see.. +同样的,你还可以使用这些选项输出任何图标,以下是一些例子.. # linux_logo -L 27 # linux_logo -L 21 -![Various Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) +![各种 Linux 徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) -Various Linux Logos +各种 Linux 徽标 -This way, you can use any of the logos just by using the number or name, that is against it. +你可以通过徽标对应的编号或名字使用任意徽标 -### Some Useful Tricks of Linux_logo ### +### 一些使用 Linux_logo 的建议和提示### -**8. You may like to print your Linux distribution logo at login. To print default logo at login you may add the below line at the end of `~/.bashrc` file.** +**8. 你可以在登录界面输出你的 Linux 发行版徽标。要输出默认徽标,你可以在 ` ~/.bashrc`` 文件的最后添加以下内容。** if [ -f /usr/bin/linux_logo ]; then linux_logo; fi -**Notice**: If there isn’t any` ~/.bashrc` file, you may need to create one under user home directory. +**注**: 如没有` ~/.bashrc` 文件,你需要在当前用户的 home 目录下新建一个。 -**9. After adding above line, just logout and re-login again to see the default logo of your Linux distribution.** +**9. 在添加以上内容后,你只需要注销并重新登录即可看到你的发行版的默认徽标** ![Print Logo on User Login](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Logo-on-Login.png) -Print Logo on User Login +在用户登录时输出徽标 -Also note, that you may print any logo, after login, simply by adding the below line. +其实你也可以在登录后输出任意图标,只需加入以下内容 if [ -f /usr/bin/linux_logo ]; then linux_logo -L num; fi -**Important**: Don’t forget to replace num with the number that is against the logo, you want to use. +**重要**: 不要忘了将 num 替换成你想使用的图标。 **10. You can also print your own logo by simply specifying the location of the logo as shown below.** # linux_logo -D /path/to/ASCII/logo -**11. Print logo on Network Login.** +**11. 在远程登录时输出图标。** # /usr/local/bin/linux_logo > /etc/issue.net -You may like to use ASCII logo if there is no support for color filled ANSI Logo as: +如果你想使用 ASCII 徽标而不是含有颜色的 ANSI 徽标,则使用如下命令 # /usr/local/bin/linux_logo -a > /etc/issue.net -**12. Create a Penguin port – A set of port to answer connection. To create Penguin port Add the below line to file /etc/services file.** +**12. 创建一个 Penguin 端口 - 用于回应连接的端口。要创建 Penguin 端口, 则需在 /etc/services 文件中加入以下内容 ** penguin 4444/tcp penguin -Here ‘4444‘ is the port number which is currently free and not used by any resource. You may use a different port. - -Also add the below line to file /etc/inetd.conf file. +这里的 `4444` 是一个未被任何其他资源使用的空闲端口。你也可以使用其他端口。 +你还需要在 /etc/inetd.conf中加入以下内容 penguin stream tcp nowait root /usr/local/bin/linux_logo -Restart the service inetd as: +并使用以下命令重启 inetd 服务 # killall -HUP inetd -Moreover linux_logo can be used in bootup script to fool the attacker as well as you can play a prank with your friend. This is a nice tool and I might use it in some of my scripts to get output as per distribution basis. +linux_logo 还可以用做启动脚本来愚弄攻击者或对你朋友使用恶作剧。这是一个我经常在我的脚本中用来获取不同发行版输出的好工具。 -Try it once and you won’t regret. Let us know what you think of this utility and how it can be useful for you. Keep Connected! Keep Commenting. Like and share us and help us get spread. +试过一次后,你就不会忘记的。让我们知道你对这个工具的想法及它对你的作用吧。 不要忘记给评论、点赞或分享! -------------------------------------------------------------------------------- via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ 作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[KevSJ](https://github.com/KevSJ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3830845ed38f7f10f9dd96a809550fb395fafba8 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 9 Jul 2015 18:10:22 -0500 Subject: [PATCH 085/113] =?UTF-8?q?Rename=20sources/tech/[=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=AD]20150612=20Linux=5FLogo--A=20Command=20Line?= =?UTF-8?q?=20Tool=20to=20Print=20Color=20ANSI=20Logos=20of=20Linux=20Dist?= =?UTF-8?q?ributions.md=20to=20translated/tech/20150612=20Linux=5FLogo--A?= =?UTF-8?q?=20Command=20Line=20Tool=20to=20Print=20Color=20ANSI=20Logos=20?= =?UTF-8?q?of=20Linux=20Distributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...and Line Tool to Print Color ANSI Logos of Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md => translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md (100%) diff --git a/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md similarity index 100% rename from sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md rename to translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md From 0a96d876f37224118143ff07a5b2cb1f281ef3c9 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 9 Jul 2015 18:42:23 -0500 Subject: [PATCH 086/113] translation complete --- ...abs in a GNOME terminal on Ubuntu 15.04.md | 38 ------------------- ...abs in a GNOME terminal on Ubuntu 15.04.md | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md create mode 100644 translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md deleted file mode 100644 index a9a53bf8b1..0000000000 --- a/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md +++ /dev/null @@ -1,38 +0,0 @@ -Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04 -================================================================================ -> **Question**: I used to be able to open multiple tabs inside gnome-terminal on my Ubuntu desktop. On Ubuntu 15.04, however, I can no longer open a new tab in my terminal window. How can I open tabs in gnome-terminal on Ubuntu 15.04? - -On Ubuntu 14.10 or earlier, gnome-terminal allowed you to open either a new terminal or a tab inside a terminal window. However, starting with Ubuntu 15.04, gnome-terminal has removed "New Tab" menu option. This is actually not a bug, but a feature that attempts to unify new tab and new window. GNOME 3.12 has introduced a [single "Open Terminal" option][1]. The ability to open a new terminal tab has been migrated from the terminal menu to Preferences. - -![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) - -### Open Tabs via Preferences ### - -To be able to open a new tab in new gnome-terminal of Ubuntu 15.04, go to "Edit" -> "Preferences", and change "Open new terminals in: Window" to "Open new terminals in: Tab". - -![](https://farm1.staticflickr.com/329/19256530766_ff692b83bc_b.jpg) - -Now if you open a new terminal via menu, it will automatically open a new tab inside the terminal. - -![](https://farm4.staticflickr.com/3820/18662051223_3296fde8e4_b.jpg) - -### Open Tabs via a Keyboard Shortcut ### - -If you do not want to change Preferences, you can hold down to "invert" Preferences setting temporarily. For example, under the default Preferences, if you hold down and click on "New Terminal", it will open a new tab, not a terminal. - -Alternatively, you can simply use a keyboard shortcut to open a new tab in a terminal. - -In my view, this UI change in gnome-terminal is not quite an improvement. For example, you are no longer able to customize the name of individual terminal tabs. This feature is useful when you have many tabs open in a terminal. With the default tab name fixed to the current prompt (whose length can grow quickly), you easily cannot see the whole prompt string in the limited tab name space. Hope this feature will become available soon. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://worldofgnome.org/opening-a-new-terminal-tabwindow-in-gnome-3-12/ \ No newline at end of file diff --git a/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md new file mode 100644 index 0000000000..80b07097d0 --- /dev/null +++ b/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md @@ -0,0 +1,38 @@ +Linux 答疑--如何在 Ubuntu 15.04 的 GNOME 终端中开启多个标签 +================================================================================ +> **问**: 我以前可以在我的 Ubuntu 台式机中的 gnome-terminal 中开启多个标签。但升到 Ubuntu 15.04 后,我就无法再在 gnome-terminal 窗口中打开新标签了。要怎样做才能在 Ubuntu 15.04 的 gnome-terminal 中打开标签呢? + +在 Ubuntu 14.10 或之前的版本中,gnome-terminal 允许你在终端窗口中开启一个新标签或一个终端窗口。但从 Ubuntu 15.04开始,gnome-terminal 移除了“新标签”选项。这实际上并不是一个 bug,而是一个合并新标签和新窗口的举措。GNOME 3.12 引入了 [单独的“开启终端”选项][1]。开启新终端标签的功能从终端菜单移动到了首选项中。 + +![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) + +### 偏好设置中的开启新标签 ### + +要在 Ubuntu 15.04 的 gnome-terminal中开启新标签,选择“编辑” -> “首选项",并把“开启新终端:窗口”改为“开启新终端:标签”。 + +![](https://farm1.staticflickr.com/329/19256530766_ff692b83bc_b.jpg) + +如果现在你通过菜单开启新终端,就会显示在当前终端中的一个新标签页中。 + +![](https://farm4.staticflickr.com/3820/18662051223_3296fde8e4_b.jpg) + +### 通过键盘快捷键开启标签 ### + +如果你不想更改首选项,你可以按住 临时改变设置。比如,在默认情况下,在点击“新终端”的同时按住 ,终端就会在新标签中打开而不是开启新的终端。 + +另外,你还可以使用键盘快捷键 在终端中开启新标签。 + +在我看来,gnome-terminal 此番在 UI 上的改变并非一个进步。比如,你无法自定义终端中各个标签的标题了。当你在一个终端中打开了多个标签时,这个功能会很有用。而如果终端名称保持默认标题(并不断变长)时,你就不能在有限的标题空间里看见终端的标题了。希望能被尽早加入这个功能。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html + +作者:[Dan Nanni][a] +译者:[KevSJ](https://github.com/KevSJ) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://worldofgnome.org/opening-a-new-terminal-tabwindow-in-gnome-3-12/ From 1c6f1e57e66427c2195718ef7d5589f656c05bc6 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 10 Jul 2015 08:57:55 +0800 Subject: [PATCH 087/113] [Translated]20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md --- ...nd to Quickly Navigate Linux Filesystem.md | 224 ------------------ ...nd to Quickly Navigate Linux Filesystem.md | 221 +++++++++++++++++ 2 files changed, 221 insertions(+), 224 deletions(-) delete mode 100644 sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md create mode 100644 translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md 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 deleted file mode 100644 index ac4f53cf6f..0000000000 --- a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md +++ /dev/null @@ -1,224 +0,0 @@ -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. - -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/ diff --git a/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md new file mode 100644 index 0000000000..546a4b0baf --- /dev/null +++ b/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -0,0 +1,221 @@ +Autojump – 一个高级的‘cd’命令用以快速浏览 Linux 文件系统 +================================================================================ +对于那些主要通过控制台或终端使用 Linux 命令行来工作的 Linux 用户来说,他们真切地感受到了 Linux 的强大。 然而在 Linux 的分层文件系统中进行浏览有时或许是一件头疼的事,尤其是对于那些新手来说。 + +现在,有一个用 Python 写的名为 `autojump` 的 Linux 命令行实用程序,它是 Linux ‘[cd][1]’命令的高级版本。 + +![Autojump 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) + +Autojump – 浏览 Linux 文件系统的最快方式 + +这个应用原本由 Joël Schaerer 编写,现在由 +William Ting 维护。 + +Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行更轻松的目录浏览。与传统的 `cd` 命令相比,autojump 能够更加快速地浏览至目的目录。 + +#### autojump 的特色 #### + +- 免费且开源的应用,在 GPL V3 协议下发布。 +- 自主学习的应用,从用户的浏览习惯中学习。 +- 更快速地浏览。不必包含子目录的名称。 +- 对于大多数的标准 Linux 发行版本,能够在软件仓库中下载得到,它们包括 Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora。 +- 也能在其他平台中使用,例如 OS X(使用 Homebrew) 和 Windows (通过 Clink 来实现) +- 使用 autojump 你可以跳至任何特定的目录或一个子目录。你还可以打开文件管理器来到达某个目录,并查看你在某个目录中所待时间的统计数据。 + +#### 前提 #### + +- 版本号不低于 2.6 的 Python + +### 第 1 步: 做一次全局系统升级 ### + +1. 以 **root** 用户的身份,做一次系统更新或升级,以此保证你安装有最新版本的 Python。 + + # 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] + +**注** : 这里特别提醒,在基于 YUM 或 DNF 的系统中,更新和升级执行相同的行动,大多数时间里它们是通用的,这点与基于 APT 的系统不同。 + +### 第 2 步: 下载和安装 Autojump ### + +2. 正如前面所言,在大多数的 Linux 发行版本的软件仓库中, autojump 都可获取到。通过包管理器你就可以安装它。但若你想从源代码开始来安装它,你需要克隆源代码并执行 python 脚本,如下面所示: + +#### 从源代码安装 #### + +若没有安装 git,请安装它。我们需要使用它来克隆 git 仓库。 + + # apt-get install git [APT based systems] + # yum install git [YUM based systems] + # dnf install git [DNF based systems] + +一旦安装完 git,以常规用户身份登录,然后像下面那样来克隆 autojump: + + $ git clone git://github.com/joelthelion/autojump.git + +接着,使用 `cd` 命令切换到下载目录。 + + $ cd autojump + +下载,赋予脚本文件可执行权限,并以 root 用户身份来运行安装脚本。 + + # chmod 755 install.py + # ./install.py + +#### 从软件仓库中安装 #### + +3. 假如你不想麻烦,你可以以 **root** 用户身份从软件仓库中直接安装它: + +在 Debian, Ubuntu, Mint 及类似系统中安装 autojump : + + # apt-get install autojump (注: 这里原文为 autojumo, 应该为 autojump) + +为了在 Fedora, CentOS, RedHat 及类似系统中安装 autojump, 你需要启用 [EPEL 软件仓库][2]。 + + # yum install epel-release + # yum install autojump + OR + # dnf install autojump + +### 第 3 步: 安装后的配置 ### + +4. 在 Debian 及其衍生系统 (Ubuntu, Mint,…) 中, 激活 autojump 应用是非常重要的。 + +为了暂时激活 autojump 应用,即直到你关闭当前会话或打开一个新的会话之前让 autojump 均有效,你需要以常规用户身份运行下面的命令: + + $ source /usr/share/autojump/autojump.sh on startup + +为了使得 autojump 在 BASH shell 中永久有效,你需要运行下面的命令。 + + $ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc + +### 第 4 步: Autojump 的预测试和使用 ### + +5. 如先前所言, autojump 将只跳到先前 `cd` 命令到过的目录。所以在我们开始测试之前,我们要使用 `cd` 切换到一些目录中去,并创建一些目录。下面是我所执行的命令。 + + $ 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 + +现在,我们已经切换到过上面所列的目录,并为了测试创建了一些目录,一切准备就绪,让我们开始吧。 + +**需要记住的一点** : `j` 是 autojump 的一个包装,你可以使用 j 来代替 autojump, 相反亦可。 + +6. 使用 -v 选项查看安装的 autojump 的版本。 + + $ j -v + or + $ autojump -v + +![查看 Autojump 的版本](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) + +查看 Autojump 的版本 + +7. 跳到先前到过的目录 ‘/var/www‘。 + + $ j www + +![跳到目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) + +跳到目录 + +8. 跳到先前到过的子目录‘/home/avi/autojump-test/b‘ 而不键入子目录的全名。 + + $ jc b + +![跳到子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) + +跳到子目录 + +9. 使用下面的命令,你就可以从命令行打开一个文件管理器,例如 GNOME Nautilus ,而不是跳到一个目录。 + + $ jo www + +![跳到目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) + +跳到目录 + +![在文件管理器中打开目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) + +在文件管理器中打开目录 + +你也可以在一个文件管理器中打开一个子目录。 + + $ jco c + +![打开子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) + +打开子目录 + +![在文件管理器中打开子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) + +在文件管理器中打开子目录 + +10. 查看每个文件夹的关键权重和在所有目录权重中的总关键权重的相关统计数据。文件夹的关键权重代表在这个文件夹中所花的总时间。 目录权重是列表中目录的数目。(注: 在这一句中,我觉得原文中的 if 应该为 is) + + $ j --stat + +![查看目录统计数据](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) + +查看目录统计数据 + +**提醒** : autojump 存储其运行日志和错误日志的地方是文件夹 `~/.local/share/autojump/`。千万不要重写这些文件,否则你将失去你所有的统计状态结果。 + + $ ls -l ~/.local/share/autojump/ + +![Autojump 的日志](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) + +Autojump 的日志 + +11. 假如需要,你只需运行下面的命令就可以查看帮助 : + + $ j --help + +![Autojump 的帮助和选项](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) + +Autojump 的帮助和选项 + +### 功能需求和已知的冲突 ### + +- autojump 只能让你跳到那些你已经用 `cd` 到过的目录。一旦你用 `cd` 切换到一个特定的目录,这个行为就会被记录到 autojump 的数据库中,这样 autojump 才能工作。不管怎样,在你设定了 autojump 后,你不能跳到那些你没有用 `cd` 到过的目录。 +- 你不能跳到名称以破折号 (-) 开头的目录。或许你可以考虑阅读我的有关[操作文件或目录][3] 的文章,尤其是有关操作那些以‘-‘ 或其他特殊字符开头的文件和目录的内容。 +- 在 BASH shell 中,autojump 通过修改 `$PROMPT_COMMAND` 环境变量来跟踪目录的行为,所以强烈建议不要去重写 `$PROMPT_COMMAND` 这个环境变量。若你需要添加其他的命令到现存的 `$PROMPT_COMMAND` 环境变量中,请添加到`$PROMPT_COMMAND` 环境变量的最后。 + +### 结论: ### + +假如你是一个命令行用户, autojump 是你必备的实用程序。它可以简化许多事情。它是一个在命令行中浏览 Linux 目录的绝佳的程序。请自行尝试它,并在下面的评论框中让我知晓你宝贵的反馈。保持联系,保持分享。喜爱并分享,帮助我们更好地传播。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ + +作者:[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/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 6d6ecbb8ede8c24897f1586a9f9f7dba3d944985 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 10 Jul 2015 09:01:57 +0800 Subject: [PATCH 088/113] Update 20150709 Install Google Hangouts Desktop Client In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- ...0150709 Install Google Hangouts Desktop Client In Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md index f7026f3d14..426f0c0ffc 100644 --- a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md +++ b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -1,3 +1,5 @@ +FSSlc translating + Install Google Hangouts Desktop Client In Linux ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) @@ -64,4 +66,4 @@ via: http://itsfoss.com/install-google-hangouts-linux/ [3]:http://www.google.com/+/learnmore/hangouts/ [4]:https://github.com/yakyak/yakyak [5]:https://github.com/yakyak/yakyak -[6]:http://itsfoss.com/best-messaging-apps-linux/ \ No newline at end of file +[6]:http://itsfoss.com/best-messaging-apps-linux/ From 4cc642e74b7572f6fda93b487f96c155b977d3d1 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 10 Jul 2015 11:11:26 +0800 Subject: [PATCH 089/113] PUB:20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @martin2011qi 干得好! --- ...e Who Believe in AI Singularity Are on Drugs.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/news => published}/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md (66%) diff --git a/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md similarity index 66% rename from translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md rename to published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md index d2ff0a1eda..727da304a0 100644 --- a/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md +++ b/published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -4,19 +4,19 @@ Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 ![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) -**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** +**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的CEO埃隆·马斯克就曾表示有情感的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** -人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 +人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是哪个提出建议的人更聪明。 -事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 +事实证明Linux项目创始人Linus Torvalds在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 ### Linus Torvalds与人工智能 ### -Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 +Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是关注一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 -“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 +“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?” Linus在Slashdot写道。 -选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 +选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把钱投给Linus。 -------------------------------------------------------------------------------- @@ -24,7 +24,7 @@ via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an 作者:[Silviu Stahie][a] 译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 47b7d5bb78b088a93bd531eea1ab8320bc044348 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Fri, 10 Jul 2015 14:02:14 +0800 Subject: [PATCH 090/113] Update 20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md --- ...-Exiting with failure status due to previous errors'.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index c970637b4d..6090119cb4 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -1,7 +1,6 @@ -Linux FAQs with Answers--How to fix “tar: Exiting with failure status due to previous errors” +Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors") ================================================================================ -> **Question**: When I try to create an archive using tar command, it fails in the middle, and throws an error saying: "tar: Exiting with failure status due to previous errors." What causes this error, and how can I solve this error? - +> **问题**: 当我想试着用tar命令来创建一个压缩文件时,总在执行过程中失败,并且抛出一个错误说明"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors"). 什么导致这个错误的发生,要如何解决? ![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) If you encounter the following error while running tar command, the most likely reason is that you do not have read permission on one of the files you are trying to archive with tar. @@ -33,4 +32,4 @@ via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-erro 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 87c79b22fd4d7c44d03b8a32831e6ca10fd12c5e Mon Sep 17 00:00:00 2001 From: Love-xuan Date: Fri, 10 Jul 2015 14:51:35 +0800 Subject: [PATCH 091/113] Love-xuan translating --- ...nimated Wallpaper Adds Live Backgrounds To Linux Distros.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md index 92eff36326..03be3a27ff 100644 --- a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md +++ b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md @@ -1,3 +1,4 @@ +Translating by Love-xuan Animated Wallpaper Adds Live Backgrounds To Linux Distros ================================================================================ **We know a lot of you love having a stylish Ubuntu desktop to show off.** @@ -110,4 +111,4 @@ via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:http://www.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu -[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu \ No newline at end of file +[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu From b18fa8f2a9ceebe3ad9c6aba5a685b1960851f3e Mon Sep 17 00:00:00 2001 From: XLCYun Date: Fri, 10 Jul 2015 14:59:56 +0800 Subject: [PATCH 092/113] Update 20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md --- ...ith failure status due to previous errors'.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index 6090119cb4..af8f8d4b48 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -3,31 +3,29 @@ Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败 > **问题**: 当我想试着用tar命令来创建一个压缩文件时,总在执行过程中失败,并且抛出一个错误说明"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors"). 什么导致这个错误的发生,要如何解决? ![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) -If you encounter the following error while running tar command, the most likely reason is that you do not have read permission on one of the files you are trying to archive with tar. +如果当你执行tar命令时,遇到了下面的错误,那么最有可能的原因是对于你想用tar命令压缩的某个文件中,你并不具备其读权限。 tar: Exiting with failure status due to previous errors -Then how can we pin down the file(s) causing the errors, or identify any other cause? +那么我们要如何确定引起错误的这个(些)文件呢?或者如何确定其它的错误根源? -The tar command should actually print out what those "previous errors" are, but you can easily miss printed error messages if you run tar in verbose mode (e.g., -cvf). To catch error messages more easily, you can filter out tar's stdout messages as follows. +事实上tar命令应该会打印出所谓的“上一个错误”("previous errors")到底是什么错误,但是如果你让tar运行在详细模式(即verbose mode,例如, -cvf),那么你会很容易错失这些信息。要找到这些信息,你可以像下面那样,把tar的标准输出(stdout)信息过滤掉。 $ tar cvzfz backup.tgz my_program/ > /dev/null -You will then see only error messages sent by tar to stderr. +然后你会看到tar输出的标准错误(stderr)信息。 tar: my_program/src/lib/.conf.db.~lock~: Cannot open: Permission denied tar: Exiting with failure status due to previous errors -As you can see in the above example, the cause for the errors is indeed "denied read permission." - -To solve the problem, simply adjust the permission of the problematic file (or remove it), and re-run tar. - +你可以从上面的例子中看到,引起错误的原因的确是“读权限不允许”(denied read permission.) +要解决这个问题,只要简单地更改出问题的文件的权限即可(或将其移除),然后重新执行tar命令。 -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[XLCYun(袖里藏云)](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3547a7dfc069003aa8d63642965a687f32726a8d Mon Sep 17 00:00:00 2001 From: XLCYun Date: Fri, 10 Jul 2015 15:07:44 +0800 Subject: [PATCH 093/113] Update 20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md --- ...tar--Exiting with failure status due to previous errors'.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index af8f8d4b48..4b6b3b0fca 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -19,7 +19,8 @@ Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败 tar: Exiting with failure status due to previous errors 你可以从上面的例子中看到,引起错误的原因的确是“读权限不允许”(denied read permission.) -要解决这个问题,只要简单地更改出问题的文件的权限即可(或将其移除),然后重新执行tar命令。 +要解决这个问题,只要简单地更改(或移除)问题文件的权限,然后重新执行tar命令即可。 + -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html From 60e3296abb6756b78b8d8304bfeea17ad51bd2cc Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 10 Jul 2015 17:48:15 +0800 Subject: [PATCH 094/113] Translating by ZTinoZ --- ...0709 command line tools for monitoring your Linux system.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150709 command line tools for monitoring your Linux system.md b/sources/talk/20150709 command line tools for monitoring your Linux system.md index 012591d74f..7d91a1dcaf 100644 --- a/sources/talk/20150709 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 command line tools for monitoring your Linux system.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ 7 command line tools for monitoring your Linux system ================================================================================ **Here is a selection of basic command line tools that will make your exploration and optimization in Linux easier. ** @@ -76,4 +77,4 @@ via: http://www.networkworld.com/article/2937219/linux/7-command-line-tools-for- [7]:http://linuxcommand.org/man_pages/vmstat8.html [8]:http://linux.die.net/man/1/ps [9]:http://linux.die.net/man/1/pstree -[10]:http://linux.die.net/man/1/iostat \ No newline at end of file +[10]:http://linux.die.net/man/1/iostat From ee7a200b10196e6f590252594467867c1778ab98 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 10 Jul 2015 20:13:16 +0800 Subject: [PATCH 095/113] =?UTF-8?q?=E8=A1=A5=E5=85=85=20PR=EF=BC=8C?= =?UTF-8?q?=E5=BF=98=E8=AE=B0=E7=A7=BB=E5=8A=A8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun --- ...x 'tar--Exiting with failure status due to previous errors'.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md (100%) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md similarity index 100% rename from sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md rename to translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md From 7c04a87fdd3862b215906d542010f5f601cda433 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Jul 2015 22:53:48 +0800 Subject: [PATCH 096/113] translating --- ...with Answers--How to install a Brother printer on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md index dd10d5c8dd..5089cfd96b 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md @@ -1,3 +1,5 @@ +translating----geekpi + Linux FAQs with Answers--How to install a Brother printer on Linux ================================================================================ > **Question**: I have a Brother HL-2270DW laser printer, and want to print documents from my Linux box using this printer. How can I install an appropriate Brother printer driver on my Linux computer, and use it? @@ -106,4 +108,4 @@ via: http://ask.xmodulo.com/install-brother-printer-linux.html [a]:http://ask.xmodulo.com/author/nanni [1]:http://xmodulo.com/go/brother_printers [2]:http://xmodulo.com/go/hl_2270dw -[3]:http://support.brother.com/ \ No newline at end of file +[3]:http://support.brother.com/ From 1d36bc5337762609f628e7a0065cc513ea4aba94 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 11 Jul 2015 10:15:16 +0800 Subject: [PATCH 097/113] translated --- ...w to install a Brother printer on Linux.md | 111 ------------------ ...w to install a Brother printer on Linux.md | 108 +++++++++++++++++ 2 files changed, 108 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md create mode 100644 translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md deleted file mode 100644 index 5089cfd96b..0000000000 --- a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md +++ /dev/null @@ -1,111 +0,0 @@ -translating----geekpi - -Linux FAQs with Answers--How to install a Brother printer on Linux -================================================================================ -> **Question**: I have a Brother HL-2270DW laser printer, and want to print documents from my Linux box using this printer. How can I install an appropriate Brother printer driver on my Linux computer, and use it? - -Brother is well known for its affordable [compact laser printer lineup][1]. You can get a high-quality WiFi/duplex-capable laser printer for less than 200USD, and the price keeps going down. On top of that, they provide reasonably good Linux support, so you can download and install their printer driver on your Linux computer. I bought [HL-2270DW][2] model more than a year ago, and I have been more than happy with its performance and reliability. - -Here is how to install and configure a Brother printer driver on Linux. In this tutorial, I am demonstrating the installation of a USB driver for Brother HL-2270DW laser printer. So first connect your printer to a Linux computer via USB cable. - -### Preparation ### - -In this preparation step, go to the official [Brother support website][3], and search for the driver of your Brother printer by typing printer model name (e.g., HL-2270DW). - -![](https://farm1.staticflickr.com/301/18970034829_6f3a48d817_c.jpg) - -Once you go to the download page for your Brother printer, choose your Linux platform. For Debian, Ubuntu or their derivatives, choose "Linux (deb)". For Fedora, CentOS or RHEL, choose "Linux (rpm)". - -![](https://farm1.staticflickr.com/380/18535558583_cb43240f8a_c.jpg) - -On the next page, you will find a LPR driver as well as CUPS wrapper driver for your printer. The former is a command-line driver, while the latter allows you to configure and manage your printer via web-based administration interface. Especially the CUPS-based GUI is quite useful for (local or remote) printer maintenance. It is recommended that you install both drivers. So click on "Driver Install Tool" and download the installer file. - -![](https://farm1.staticflickr.com/329/19130013736_1850b0d61e_c.jpg) - -Before proceeding to run the installer file, you need to do one additional step if you are using a 64-bit Linux system. - -Since Brother printer drivers are developed for 32-bit Linux, you need to install necessary 32-bit libraries on 64-bit Linux as follows. - -On older Debian (6.0 or earlier) or Ubuntu (11.04 or earlier), install the following package. - - $ sudo apt-get install ia32-libs - -On newer Debian or Ubuntu which has introduced multiarch, you can install the following package instead: - - $ sudo apt-get install lib32z1 lib32ncurses5 - -which replaces ia32-libs package. Or, you can install just: - - $ sudo apt-get install lib32stdc++6 - -If you are using a Red Hat based Linux, you can install: - - $ sudo yum install glibc.i686 - -### Driver Installation ### - -Now go ahead and extract a downloaded driver installer file. - - $ gunzip linux-brprinter-installer-2.0.0-1.gz - -Next, run the driver installer file as follows. - - $ sudo sh ./linux-brprinter-installer-2.0.0-1 - -You will be prompted to type a printer model name. Type the model name of your printer, for example "HL-2270DW". - -![](https://farm1.staticflickr.com/292/18535599323_1a94f6dae5_b.jpg) - -After agreeing to GPL license agreement, accept default answers to any subsequent questions. - -![](https://farm1.staticflickr.com/526/19130014316_5835939501_b.jpg) - -Now LPR/CUPS printer drivers are installed. Proceed to configure your printer next. - -### Printer Configuration ### - -We are going to configure and manage a Brother via CUPS-based web management interface. - -First, verify that CUPS daemon is running successfully. - - $ sudo netstat -nap | grep 631 - -Open a web browser window, and go to http://localhost:631. You will see the following CUPS printer management interface. - -![](https://farm1.staticflickr.com/324/18968588688_202086fc72_c.jpg) - -Go to "Administration" tab, and click on "Manage Printers" under Printers section. - -![](https://farm1.staticflickr.com/484/18533632074_0526cccb86_c.jpg) - -You must see your printer (HL-2270DW) listed in the next page. Click on the printer name. -![](https://farm1.staticflickr.com/501/19159651111_95f6937693_c.jpg) - -In the dropdown menu titled "Administration", choose "Set As Server Default" option. This will make your printer system-wide default. - -![](https://farm1.staticflickr.com/472/19150412212_b37987c359_c.jpg) - -When asked to authenticate yourself, type in your Linux login information. - -![](https://farm1.staticflickr.com/511/18968590168_807e807f73_c.jpg) - -Now the basic configuration step is mostly done. To test print, open any document viewer application (e.g., PDF viwer), and print it. You will see "HL-2270DW" listed and chosen by default in printer setting. - -![](https://farm4.staticflickr.com/3872/18970034679_6d41d75bf9_c.jpg) - -Print should work now. You can see the printer status and manage printer jobs via the same CUPS web interface. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/install-brother-printer-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/go/brother_printers -[2]:http://xmodulo.com/go/hl_2270dw -[3]:http://support.brother.com/ diff --git a/translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md new file mode 100644 index 0000000000..ad90ec75a4 --- /dev/null +++ b/translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md @@ -0,0 +1,108 @@ +Linux有问必答-- 如何为在Linux中安装兄弟打印机 +================================================================================ +> **提问**: 我有一台兄弟HL-2270DW激光打印机,我想从我的Linux机器上答应文档。我该如何在我的电脑上安装合适的驱动并使用它? + +兄弟牌以买得起的[紧凑型激光打印机][1]而闻名。你可以用低于200美元的价格得到高质量的WiFi/双工激光打印机,而且价格还在下降。最棒的是,它们还提供良好的Linux支持,因此你可以在Linux中下载并安装它们的打印机驱动。我在一年前买了台[HL-2270DW][2],我对它的性能和可靠性都很满意。 + +下面是如何在Linux中安装和配置兄弟打印机驱动。本篇教程中,我会演示安装HL-2270DW激光打印机的USB驱动。首先通过USB线连接你的打印机到Linux上。 + +### 准备 ### + +在准备阶段,进入[兄弟官方支持网站][3],输入你的型号(比如:HL-2270DW)搜索你的兄弟打印机型号。 + +![](https://farm1.staticflickr.com/301/18970034829_6f3a48d817_c.jpg) + +进入下面页面后,选择你的Linux平台。对于Debian、Ubuntu或者其他衍生版,选择“Linux (deb)”。对于Fedora、CentOS或者RHEL选择“Linux (rpm)”。 + +![](https://farm1.staticflickr.com/380/18535558583_cb43240f8a_c.jpg) + +下一页,你会找到你打印机的LPR驱动和CUPS包装器驱动。前者是命令行驱动后者允许你通过网页管理和配置你的打印机。尤其是基于CUPS的GUI对(本地、远程)打印机维护非常有用。建议你安装这两个驱动。点击“Driver Install Tool”下载安装文件。 + +![](https://farm1.staticflickr.com/329/19130013736_1850b0d61e_c.jpg) + +运行安装文件之前,你需要在64位的Linux系统上做另外一件事情。 + +因为兄弟打印机驱动是为32位的Linux系统开发的,因此你需要按照下面的方法安装32位的库。 + +在早期的Debian(6.0或者更早期)或者Ubuntu(11.04或者更早期),安装下面的包。 + + $ sudo apt-get install ia32-libs + +对于已经引入多架构的新的Debian或者Ubuntu而言,你可以安装下面的包: + + $ sudo apt-get install lib32z1 lib32ncurses5 + +上面的包代替了ia32-libs包。或者你只需要安装: + + $ sudo apt-get install lib32stdc++6 + +如果你使用的是基于Red Hat的Linux,你可以安装: + + $ sudo yum install glibc.i686 + +### 驱动安装 ### + +现在解压下载的驱动文件。 + + $ gunzip linux-brprinter-installer-2.0.0-1.gz + +接下来像下面这样运行安装文件。 + + $ sudo sh ./linux-brprinter-installer-2.0.0-1 + +你会被要求输入打印机的型号。输入你打印机的型号,比如“HL-2270DW”。 + +![](https://farm1.staticflickr.com/292/18535599323_1a94f6dae5_b.jpg) + +同意GPL协议直呼,接受接下来的任何默认问题。 + +![](https://farm1.staticflickr.com/526/19130014316_5835939501_b.jpg) + +现在LPR/CUPS打印机驱动已经安装好了。接下来要配置你的打印机了。 + +### 打印机配置 ### + +我接下来就要通过基于CUPS的网页管理和配置兄弟打印机了。 + +首先验证CUPS守护进程已经启动。 + + $ sudo netstat -nap | grep 631 + +打开一个浏览器输入http://localhost:631。你会下面的打印机管理界面。 + +![](https://farm1.staticflickr.com/324/18968588688_202086fc72_c.jpg) + +进入“Administration”选项卡,点击打印机选项下的“Manage Printers”。 + +![](https://farm1.staticflickr.com/484/18533632074_0526cccb86_c.jpg) + +你一定在下面的页面中看到了你的打印机(HL-2270DW)。点击打印机名。 + +在下拉菜单“Administration”中,选择“Set As Server Default”。这会设置你的打印机位系统默认打印机。 + +![](https://farm1.staticflickr.com/472/19150412212_b37987c359_c.jpg) + +当被要求验证时,输入你的Linux登录信息。 + +![](https://farm1.staticflickr.com/511/18968590168_807e807f73_c.jpg) + +现在基础配置已经基本完成了。为了测试打印,打开任何文档浏览程序(比如:PDF浏览器)并打印。你会看到“HL-2270DW”被列出并被作为默认的打印机设置。 + +![](https://farm4.staticflickr.com/3872/18970034679_6d41d75bf9_c.jpg) + +打印机应该可以工作了。你可以通过CUPS的网页看到打印机状态和管理打印机任务。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-brother-printer-linux.html + +作者:[Dan Nanni][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/brother_printers +[2]:http://xmodulo.com/go/hl_2270dw +[3]:http://support.brother.com/ From 13495e4204e2e95d945a99b5711fffbb45668309 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sat, 11 Jul 2015 13:45:37 +0800 Subject: [PATCH 098/113] Delete 20150401 ZMap Documentation.md --- sources/tech/20150401 ZMap Documentation.md | 745 -------------------- 1 file changed, 745 deletions(-) delete mode 100644 sources/tech/20150401 ZMap Documentation.md diff --git a/sources/tech/20150401 ZMap Documentation.md b/sources/tech/20150401 ZMap Documentation.md deleted file mode 100644 index b773fb4aaf..0000000000 --- a/sources/tech/20150401 ZMap Documentation.md +++ /dev/null @@ -1,745 +0,0 @@ -translating... - -ZMap Documentation -================================================================================ -1. Getting Started with ZMap -1. Scanning Best Practices -1. Command Line Arguments -1. Additional Information - 1. TCP SYN Probe Module - 1. ICMP Echo Probe Module - 1. UDP Probe Module - 1. Configuration Files - 1. Verbosity - 1. Results Output - 1. Blacklisting - 1. Rate Limiting and Sampling - 1. Sending Multiple Probes -1. Extending ZMap - 1. Sample Applications - 1. Writing Probe and Output Modules - ----------- - -### Getting Started with ZMap ### - -ZMap is designed to perform comprehensive scans of the IPv4 address space or large portions of it. While ZMap is a powerful tool for researchers, please keep in mind that by running ZMap, you are potentially scanning the ENTIRE IPv4 address space at over 1.4 million packets per second. Before performing even small scans, we encourage users to contact their local network administrators and consult our list of scanning best practices. - -By default, ZMap will perform a TCP SYN scan on the specified port at the maximum rate possible. A more conservative configuration that will scan 10,000 random addresses on port 80 at a maximum 10 Mbps can be run as follows: - - $ zmap --bandwidth=10M --target-port=80 --max-targets=10000 --output-file=results.csv - -Or more concisely specified as: - - $ zmap -B 10M -p 80 -n 10000 -o results.csv - -ZMap can also be used to scan specific subnets or CIDR blocks. For example, to scan only 10.0.0.0/8 and 192.168.0.0/16 on port 80, run: - - zmap -p 80 -o results.csv 10.0.0.0/8 192.168.0.0/16 - -If the scan started successfully, ZMap will output status updates every one second similar to the following: - - 0% (1h51m left); send: 28777 562 Kp/s (560 Kp/s avg); recv: 1192 248 p/s (231 p/s avg); hits: 0.04% - 0% (1h51m left); send: 34320 554 Kp/s (559 Kp/s avg); recv: 1442 249 p/s (234 p/s avg); hits: 0.04% - 0% (1h50m left); send: 39676 535 Kp/s (555 Kp/s avg); recv: 1663 220 p/s (232 p/s avg); hits: 0.04% - 0% (1h50m left); send: 45372 570 Kp/s (557 Kp/s avg); recv: 1890 226 p/s (232 p/s avg); hits: 0.04% - -These updates provide information about the current state of the scan and are of the following form: %-complete (est time remaining); packets-sent curr-send-rate (avg-send-rate); recv: packets-recv recv-rate (avg-recv-rate); hits: hit-rate - -If you do not know the scan rate that your network can support, you may want to experiment with different scan rates or bandwidth limits to find the fastest rate that your network can support before you see decreased results. - -By default, ZMap will output the list of distinct IP addresses that responded successfully (e.g. with a SYN ACK packet) similar to the following. There are several additional formats (e.g. JSON and Redis) for outputting results as well as options for producing programmatically parsable scan statistics. As wells, additional output fields can be specified and the results can be filtered using an output filter. - - 115.237.116.119 - 23.9.117.80 - 207.118.204.141 - 217.120.143.111 - 50.195.22.82 - -We strongly encourage you to use a blacklist file, to exclude both reserved/unallocated IP space (e.g. multicast, RFC1918), as well as networks that request to be excluded from your scans. By default, ZMap will utilize a simple blacklist file containing reserved and unallocated addresses located at `/etc/zmap/blacklist.conf`. If you find yourself specifying certain settings, such as your maximum bandwidth or blacklist file every time you run ZMap, you can specify these in `/etc/zmap/zmap.conf` or use a custom configuration file. - -If you are attempting to troubleshoot scan related issues, there are several options to help debug. First, it is possible can perform a dry run scan in order to see the packets that would be sent over the network by adding the `--dryrun` flag. As well, it is possible to change the logging verbosity by setting the `--verbosity=n` flag. - ----------- - -### Scanning Best Practices ### - -We offer these suggestions for researchers conducting Internet-wide scans as guidelines for good Internet citizenship. - -- Coordinate closely with local network administrators to reduce risks and handle inquiries -- Verify that scans will not overwhelm the local network or upstream provider -- Signal the benign nature of the scans in web pages and DNS entries of the source addresses -- Clearly explain the purpose and scope of the scans in all communications -- Provide a simple means of opting out and honor requests promptly -- Conduct scans no larger or more frequent than is necessary for research objectives -- Spread scan traffic over time or source addresses when feasible - -It should go without saying that scan researchers should refrain from exploiting vulnerabilities or accessing protected resources, and should comply with any special legal requirements in their jurisdictions. - ----------- - -### Command Line Arguments ### - -#### Common Options #### - -These options are the most common options when performing a simple scan. We note that some options are dependent on the probe module or output module used (e.g. target port is not used when performing an ICMP Echo Scan). - - -**-p, --target-port=port** - -TCP port number to scan (e.g. 443) - -**-o, --output-file=name** - -Write results to this file. Use - for stdout - -**-b, --blacklist-file=path** - -File of subnets to exclude, in CIDR notation (e.g. 192.168.0.0/16), one-per line. It is recommended you use this to exclude RFC 1918 addresses, multicast, IANA reserved space, and other IANA special-purpose addresses. An example blacklist file is provided in conf/blacklist.example for this purpose. - -#### Scan Options #### - -**-n, --max-targets=n** - -Cap the number of targets to probe. This can either be a number (e.g. `-n 1000`) or a percentage (e.g. `-n 0.1%`) of the scannable address space (after excluding blacklist) - -**-N, --max-results=n** - -Exit after receiving this many results - -**-t, --max-runtime=secs** - -Cap the length of time for sending packets - -**-r, --rate=pps** - -Set the send rate in packets/sec - -**-B, --bandwidth=bps** - -Set the send rate in bits/second (supports suffixes G, M, and K (e.g. `-B 10M` for 10 mbps). This overrides the `--rate` flag. - -**-c, --cooldown-time=secs** - -How long to continue receiving after sending has completed (default=8) - -**-e, --seed=n** - -Seed used to select address permutation. Use this if you want to scan addresses in the same order for multiple ZMap runs. - -**--shards=n** - -Split the scan up into N shards/partitions among different instances of zmap (default=1). When sharding, `--seed` is required - -**--shard=n** - -Set which shard to scan (default=0). Shards are indexed in the range [0, N), where N is the total number of shards. When sharding `--seed` is required. - -**-T, --sender-threads=n** - -Threads used to send packets (default=1) - -**-P, --probes=n** - -Number of probes to send to each IP (default=1) - -**-d, --dryrun** - -Print out each packet to stdout instead of sending it (useful for debugging) - -#### Network Options #### - -**-s, --source-port=port|range** - -Source port(s) to send packets from - -**-S, --source-ip=ip|range** - -Source address(es) to send packets from. Either single IP or range (e.g. 10.0.0.1-10.0.0.9) - -**-G, --gateway-mac=addr** - -Gateway MAC address to send packets to (in case auto-detection does not work) - -**-i, --interface=name** - -Network interface to use - -#### Probe Options #### - -ZMap allows users to specify and write their own probe modules for use with ZMap. Probe modules are responsible for generating probe packets to send, and processing responses from hosts. - -**--list-probe-modules** - -List available probe modules (e.g. tcp_synscan) - -**-M, --probe-module=name** - -Select probe module (default=tcp_synscan) - -**--probe-args=args** - -Arguments to pass to probe module - -**--list-output-fields** - -List the fields the selected probe module can send to the output module - -#### Output Options #### - -ZMap allows users to specify and write their own output modules for use with ZMap. Output modules are responsible for processing the fieldsets returned by the probe module, and outputing them to the user. Users can specify output fields, and write filters over the output fields. - -**--list-output-modules** - -List available output modules (e.g. tcp_synscan) - -**-O, --output-module=name** - -Select output module (default=csv) - -**--output-args=args** - -Arguments to pass to output module - -**-f, --output-fields=fields** - -Comma-separated list of fields to output - -**--output-filter** - -Specify an output filter over the fields defined by the probe module - -#### Additional Options #### - -**-C, --config=filename** - -Read a configuration file, which can specify any other options. - -**-q, --quiet** - -Do not print status updates once per second - -**-g, --summary** - -Print configuration and summary of results at the end of the scan - -**-v, --verbosity=n** - -Level of log detail (0-5, default=3) - -**-h, --help** - -Print help and exit - -**-V, --version** - -Print version and exit - ----------- - -### Additional Information ### - -#### TCP SYN Scans #### - -When performing a TCP SYN scan, ZMap requires a single target port and supports specifying a range of source ports from which the scan will originate. - -**-p, --target-port=port** - -TCP port number to scan (e.g. 443) - -**-s, --source-port=port|range** - -Source port(s) for scan packets (e.g. 40000-50000) - -**Warning!** ZMap relies on the Linux kernel to respond to SYN/ACK packets with RST packets in order to close connections opened by the scanner. This occurs because ZMap sends packets at the Ethernet layer in order to reduce overhead otherwise incurred in the kernel from tracking open TCP connections and performing route lookups. As such, if you have a firewall rule that tracks established connections such as a netfilter rule similar to `-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT`, this will block SYN/ACK packets from reaching the kernel. This will not prevent ZMap from recording responses, but it will prevent RST packets from being sent back, ultimately using up a connection on the scanned host until your connection times out. We strongly recommend that you select a set of unused ports on your scanning host which can be allowed access in your firewall and specifying this port range when executing ZMap, with the `-s` flag (e.g. `-s '50000-60000'`). - -#### ICMP Echo Request Scans #### - -While ZMap performs TCP SYN scans by default, it also supports ICMP echo request scans in which an ICMP echo request packet is sent to each host and the type of ICMP response received in reply is denoted. An ICMP scan can be performed by selecting the icmp_echoscan scan module similar to the following: - - $ zmap --probe-module=icmp_echoscan - -#### UDP Datagram Scans #### - -ZMap additionally supports UDP probes, where it will send out an arbitrary UDP datagram to each host, and receive either UDP or ICMP Unreachable responses. ZMap supports four different methods of setting the UDP payload through the --probe-args command-line option. These are 'text' for ASCII-printable payloads, 'hex' for hexadecimal payloads set on the command-line, 'file' for payloads contained in an external file, and 'template' for payloads that require dynamic field generation. In order to obtain the UDP response, make sure that you specify 'data' as one of the fields to report with the -f option. - -The example below will send the two bytes 'ST', a PCAnwywhere 'status' request, to UDP port 5632. - - $ zmap -M udp -p 5632 --probe-args=text:ST -N 100 -f saddr,data -o - - -The example below will send the byte '0x02', a SQL Server 'client broadcast' request, to UDP port 1434. - - $ zmap -M udp -p 1434 --probe-args=hex:02 -N 100 -f saddr,data -o - - -The example below will send a NetBIOS status request to UDP port 137. This uses a payload file that is included with the ZMap distribution. - - $ zmap -M udp -p 1434 --probe-args=file:netbios_137.pkt -N 100 -f saddr,data -o - - -The example below will send a SIP 'OPTIONS' request to UDP port 5060. This uses a template file that is included with the ZMap distribution. - - $ zmap -M udp -p 1434 --probe-args=file:sip_options.tpl -N 100 -f saddr,data -o - - -UDP payload templates are still experimental. You may encounter crashes when more using more than one send thread (-T) and there is a significant decrease in performance compared to static payloads. A template is simply a payload file that contains one or more field specifiers enclosed in a ${} sequence. Some protocols, notably SIP, require the payload to reflect the source and destination of the packet. Other protocols, such as portmapper and DNS, contain fields that should be randomized per request or risk being dropped by multi-homed systems scanned by ZMap. - -The payload template below will send a SIP OPTIONS request to every destination: - - OPTIONS sip:${RAND_ALPHA=8}@${DADDR} SIP/2.0 - Via: SIP/2.0/UDP ${SADDR}:${SPORT};branch=${RAND_ALPHA=6}.${RAND_DIGIT=10};rport;alias - From: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT};tag=${RAND_DIGIT=8} - To: sip:${RAND_ALPHA=8}@${DADDR} - Call-ID: ${RAND_DIGIT=10}@${SADDR} - CSeq: 1 OPTIONS - Contact: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT} - Content-Length: 0 - Max-Forwards: 20 - User-Agent: ${RAND_ALPHA=8} - Accept: text/plain - -In the example above, note that line endings are \r\n and the end of this request must contain \r\n\r\n for most SIP implementations to correcly process it. A working example is included in the examples/udp-payloads directory of the ZMap source tree (sip_options.tpl). - -The following template fields are currently implemented: - - -- **SADDR**: Source IP address in dotted-quad format -- **SADDR_N**: Source IP address in network byte order -- **DADDR**: Destination IP address in dotted-quad format -- **DADDR_N**: Destination IP address in network byte order -- **SPORT**: Source port in ascii format -- **SPORT_N**: Source port in network byte order -- **DPORT**: Destination port in ascii format -- **DPORT_N**: Destination port in network byte order -- **RAND_BYTE**: Random bytes (0-255), length specified with =(length) parameter -- **RAND_DIGIT**: Random digits from 0-9, length specified with =(length) parameter -- **RAND_ALPHA**: Random mixed-case letters from A-Z, length specified with =(length) parameter -- **RAND_ALPHANUM**: Random mixed-case letters from A-Z and digits from 0-9, length specified with =(length) parameter - -### Configuration Files ### - -ZMap supports configuration files instead of requiring all options to be specified on the command-line. A configuration can be created by specifying one long-name option and the value per line such as: - - interface "eth1" - source-ip 1.1.1.4-1.1.1.8 - gateway-mac b4:23:f9:28:fa:2d # upstream gateway - cooldown-time 300 # seconds - blacklist-file /etc/zmap/blacklist.conf - output-file ~/zmap-output - quiet - summary - -ZMap can then be run with a configuration file and specifying any additional necessary parameters: - - $ zmap --config=~/.zmap.conf --target-port=443 - -### Verbosity ### - -There are several types of on-screen output that ZMap produces. By default, ZMap will print out basic progress information similar to the following every 1 second. This can be disabled by setting the `--quiet` flag. - - 0:01 12%; send: 10000 done (15.1 Kp/s avg); recv: 144 143 p/s (141 p/s avg); hits: 1.44% - -ZMap also prints out informational messages during scanner configuration such as the following, which can be controlled with the `--verbosity` argument. - - Aug 11 16:16:12.813 [INFO] zmap: started - Aug 11 16:16:12.817 [DEBUG] zmap: no interface provided. will use eth0 - Aug 11 16:17:03.971 [DEBUG] cyclic: primitive root: 3489180582 - Aug 11 16:17:03.971 [DEBUG] cyclic: starting point: 46588 - Aug 11 16:17:03.975 [DEBUG] blacklist: 3717595507 addresses allowed to be scanned - Aug 11 16:17:03.975 [DEBUG] send: will send from 1 address on 28233 source ports - Aug 11 16:17:03.975 [DEBUG] send: using bandwidth 10000000 bits/s, rate set to 14880 pkt/s - Aug 11 16:17:03.985 [DEBUG] recv: thread started - -ZMap also supports printing out a grep-able summary at the end of the scan, similar to below, which can be invoked with the `--summary` flag. - - cnf target-port 443 - cnf source-port-range-begin 32768 - cnf source-port-range-end 61000 - cnf source-addr-range-begin 1.1.1.4 - cnf source-addr-range-end 1.1.1.8 - cnf maximum-packets 4294967295 - cnf maximum-runtime 0 - cnf permutation-seed 0 - cnf cooldown-period 300 - cnf send-interface eth1 - cnf rate 45000 - env nprocessors 16 - exc send-start-time Fri Jan 18 01:47:35 2013 - exc send-end-time Sat Jan 19 00:47:07 2013 - exc recv-start-time Fri Jan 18 01:47:35 2013 - exc recv-end-time Sat Jan 19 00:52:07 2013 - exc sent 3722335150 - exc blacklisted 572632145 - exc first-scanned 1318129262 - exc hit-rate 0.874102 - exc synack-received-unique 32537000 - exc synack-received-total 36689941 - exc synack-cooldown-received-unique 193 - exc synack-cooldown-received-total 1543 - exc rst-received-unique 141901021 - exc rst-received-total 166779002 - adv source-port-secret 37952 - adv permutation-gen 4215763218 - -### Results Output ### - -ZMap can produce results in several formats through the use of **output modules**. By default, ZMap only supports **csv** output, however support for **redis** and **json** can be compiled in. The results sent to these output modules may be filtered using an **output filter**. The fields the output module writes are specified by the user. By default, ZMap will return results in csv format and if no output file is specified, ZMap will not produce specific results. It is also possible to write your own output module; see Writing Output Modules for information. - -**-o, --output-file=p** - -File to write output to - -**-O, --output-module=p** - -Invoke a custom output module - - -**-f, --output-fields=p** - -Comma-separated list of fields to output - -**--output-filter=filter** - -Specify an output filter over fields for a given probe - -**--list-output-modules** - -Lists available output modules - -**--list-output-fields** - -List available output fields for a given probe - -#### Output Fields #### - -ZMap has a variety of fields it can output beyond IP address. These fields can be viewed for a given probe module by running with the `--list-output-fields` flag. - - $ zmap --probe-module="tcp_synscan" --list-output-fields - saddr string: source IP address of response - saddr-raw int: network order integer form of source IP address - daddr string: destination IP address of response - daddr-raw int: network order integer form of destination IP address - ipid int: IP identification number of response - ttl int: time-to-live of response packet - sport int: TCP source port - dport int: TCP destination port - seqnum int: TCP sequence number - acknum int: TCP acknowledgement number - window int: TCP window - classification string: packet classification - success int: is response considered success - repeat int: is response a repeat response from host - cooldown int: Was response received during the cooldown period - timestamp-str string: timestamp of when response arrived in ISO8601 format. - timestamp-ts int: timestamp of when response arrived in seconds since Epoch - timestamp-us int: microsecond part of timestamp (e.g. microseconds since 'timestamp-ts') - -To select which fields to output, any combination of the output fields can be specified as a comma-separated list using the `--output-fields=fields` or `-f` flags. Example: - - $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv - -#### Filtering Output #### - -Results generated by a probe module can be filtered before being passed to the output module. Filters are defined over the output fields of a probe module. Filters are written in a simple filtering language, similar to SQL, and are passed to ZMap using the **--output-filter** option. Output filters are commonly used to filter out duplicate results, or to only pass only sucessful responses to the output module. - -Filter expressions are of the form ` `. The type of `` must be either a string or unsigned integer literal, and match the type of ``. The valid operations for integer comparisons are `= !=, <, >, <=, >=`. The operations for string comparisons are =, !=. The `--list-output-fields` flag will print what fields and types are available for the selected probe module, and then exit. - -Compound filter expressions may be constructed by combining filter expressions using parenthesis to specify order of operations, the `&&` (logical AND) and `||` (logical OR) operators. - -**Examples** - -Write a filter for only successful, non-duplicate responses - - --output-filter="success = 1 && repeat = 0" - -Filter for packets that have classification RST and a TTL greater than 10, or for packets with classification SYNACK - - --output-filter="(classification = rst && ttl > 10) || classification = synack" - -#### CSV #### - -The csv module will produce a comma-separated value file of the output fields requested. For example, the following command produces the following CSV in a file called `output.csv`. - - $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv - ----------- - - response, saddr, daddr, sport, dport, seq, ack, in_cooldown, is_repeat, timestamp - synack, 159.174.153.144, 10.0.0.9, 80, 40555, 3050964427, 3515084203, 0, 0,2013-08-15 18:55:47.681 - rst, 141.209.175.1, 10.0.0.9, 80, 40136, 0, 3272553764, 0, 0,2013-08-15 18:55:47.683 - rst, 72.36.213.231, 10.0.0.9, 80, 56642, 0, 2037447916, 0, 0,2013-08-15 18:55:47.691 - rst, 148.8.49.150, 10.0.0.9, 80, 41672, 0, 1135824975, 0, 0,2013-08-15 18:55:47.692 - rst, 50.165.166.206, 10.0.0.9, 80, 38858, 0, 535206863, 0, 0,2013-08-15 18:55:47.694 - rst, 65.55.203.135, 10.0.0.9, 80, 50008, 0, 4071709905, 0, 0,2013-08-15 18:55:47.700 - synack, 50.57.166.186, 10.0.0.9, 80, 60650, 2813653162, 993314545, 0, 0,2013-08-15 18:55:47.704 - synack, 152.75.208.114, 10.0.0.9, 80, 52498, 460383682, 4040786862, 0, 0,2013-08-15 18:55:47.707 - synack, 23.72.138.74, 10.0.0.9, 80, 33480, 810393698, 486476355, 0, 0,2013-08-15 18:55:47.710 - -#### Redis #### - -The redis output module allows addresses to be added to a Redis queue instead of being saved to file which ultimately allows ZMap to be incorporated with post processing tools. - -**Heads Up!** ZMap does not build with Redis support by default. If you are building ZMap from source, you can build with Redis support by running CMake with `-DWITH_REDIS=ON`. - -### Blacklisting and Whitelisting ### - -ZMap supports both blacklisting and whitelisting network prefixes. If ZMap is not provided with blacklist or whitelist parameters, ZMap will scan all IPv4 addresses (including local, reserved, and multicast addresses). If a blacklist file is specified, network prefixes in the blacklisted segments will not be scanned; if a whitelist file is provided, only network prefixes in the whitelist file will be scanned. A whitelist and blacklist file can be used in coordination; the blacklist has priority over the whitelist (e.g. if you have whitelisted 10.0.0.0/8 and blacklisted 10.1.0.0/16, then 10.1.0.0/16 will not be scanned). Whitelist and blacklist files can be specified on the command-line as follows: - -**-b, --blacklist-file=path** - -File of subnets to blacklist in CIDR notation, e.g. 192.168.0.0/16 - -**-w, --whitelist-file=path** - -File of subnets to limit scan to in CIDR notation, e.g. 192.168.0.0/16 - -Blacklist files should be formatted with a single network prefix in CIDR notation per line. Comments are allowed using the `#` character. Example: - - # From IANA IPv4 Special-Purpose Address Registry - # http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml - # Updated 2013-05-22 - - 0.0.0.0/8 # RFC1122: "This host on this network" - 10.0.0.0/8 # RFC1918: Private-Use - 100.64.0.0/10 # RFC6598: Shared Address Space - 127.0.0.0/8 # RFC1122: Loopback - 169.254.0.0/16 # RFC3927: Link Local - 172.16.0.0/12 # RFC1918: Private-Use - 192.0.0.0/24 # RFC6890: IETF Protocol Assignments - 192.0.2.0/24 # RFC5737: Documentation (TEST-NET-1) - 192.88.99.0/24 # RFC3068: 6to4 Relay Anycast - 192.168.0.0/16 # RFC1918: Private-Use - 192.18.0.0/15 # RFC2544: Benchmarking - 198.51.100.0/24 # RFC5737: Documentation (TEST-NET-2) - 203.0.113.0/24 # RFC5737: Documentation (TEST-NET-3) - 240.0.0.0/4 # RFC1112: Reserved - 255.255.255.255/32 # RFC0919: Limited Broadcast - - # From IANA Multicast Address Space Registry - # http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml - # Updated 2013-06-25 - - 224.0.0.0/4 # RFC5771: Multicast/Reserved - -If you are looking to scan only a random portion of the internet, checkout Sampling, instead of using whitelisting and blacklisting. - -**Heads Up!** The default ZMap configuration uses the blacklist file at `/etc/zmap/blacklist.conf`, which contains locally scoped address space and reserved IP ranges. The default configuration can be changed by editing `/etc/zmap/zmap.conf`. - -### Rate Limiting and Sampling ### - -By default, ZMap will scan at the fastest rate that your network adaptor supports. In our experiences on commodity hardware, this is generally around 95-98% of the theoretical speed of gigabit Ethernet, which may be faster than your upstream provider can handle. ZMap will not automatically adjust its send-rate based on your upstream provider. You may need to manually adjust your send-rate to reduce packet drops and incorrect results. - -**-r, --rate=pps** - -Set maximum send rate in packets/sec - -**-B, --bandwidth=bps** - -Set send rate in bits/sec (supports suffixes G, M, and K). This overrides the --rate flag. - -ZMap also allows random sampling of the IPv4 address space by specifying max-targets and/or max-runtime. Because hosts are scanned in a random permutation generated per scan instantiation, limiting a scan to n hosts will perform a random sampling of n hosts. Command-line options: - -**-n, --max-targets=n** - -Cap number of targets to probe - -**-N, --max-results=n** - -Cap number of results (exit after receiving this many positive results) - -**-t, --max-runtime=s** - -Cap length of time for sending packets (in seconds) - -**-s, --seed=n** - -Seed used to select address permutation. Specify the same seed in order to scan addresses in the same order for different ZMap runs. - -For example, if you wanted to scan the same one million hosts on the Internet for multiple scans, you could set a predetermined seed and cap the number of scanned hosts similar to the following: - - zmap -p 443 -s 3 -n 1000000 -o results - -In order to determine which one million hosts were going to be scanned, you could run the scan in dry-run mode which will print out the packets that would be sent instead of performing the actual scan. - - zmap -p 443 -s 3 -n 1000000 --dryrun | grep daddr - | awk -F'daddr: ' '{print $2}' | sed 's/ |.*//;' - -### Sending Multiple Packets ### - -ZMap supports sending multiple probes to each host. Increasing this number both increases scan time and hosts reached. However, we find that the increase in scan time (~100% per additional probe) greatly outweighs the increase in hosts reached (~1% per additional probe). - -**-P, --probes=n** - -The number of unique probes to send to each IP (default=1) - ----------- - -### Sample Applications ### - -ZMap is designed for initiating contact with a large number of hosts and finding ones that respond positively. However, we realize that many users will want to perform follow-up processing, such as performing an application level handshake. For example, users who perform a TCP SYN scan on port 80 might want to perform a simple GET request and users who scan port 443 may be interested in completing a TLS handshake. - -#### Banner Grab #### - -We have included a sample application, banner-grab, with ZMap that enables users to receive messages from listening TCP servers. Banner-grab connects to the provided servers, optionally sends a message, and prints out the first message received from the server. This tool can be used to fetch banners such as HTTP server responses to specific commands, telnet login prompts, or SSH server strings. - -This example finds 1000 servers listening on port 80, and sends a simple GET request to each, storing their base-64 encoded responses in http-banners.out - - $ zmap -p 80 -N 1000 -B 10M -o - | ./banner-grab-tcp -p 80 -c 500 -d ./http-req > out - -For more details on using `banner-grab`, see the README file in `examples/banner-grab`. - -**Heads Up!** ZMap and banner-grab can have significant performance and accuracy impact on one another if run simultaneously (as in the example). Make sure not to let ZMap saturate banner-grab-tcp's concurrent connections, otherwise banner-grab will fall behind reading stdin, causing ZMap to block on writing stdout. We recommend using a slower scanning rate with ZMap, and increasing the concurrency of banner-grab-tcp to no more than 3000 (Note that > 1000 concurrent connections requires you to use `ulimit -SHn 100000` and `ulimit -HHn 100000` to increase the maximum file descriptors per process). These parameters will of course be dependent on your server performance, and hit-rate; we encourage developers to experiment with small samples before running a large scan. - -#### Forge Socket #### - -We have also included a form of banner-grab, called forge-socket, that reuses the SYN-ACK sent from the server for the connection that ultimately fetches the banner. In `banner-grab-tcp`, ZMap sends a SYN to each server, and listening servers respond with a SYN+ACK. The ZMap host's kernel receives this, and sends a RST, as no active connection is associated with that packet. The banner-grab program must then create a new TCP connection to the same server to fetch data from it. - -In forge-socket, we utilize a kernel module by the same name, that allows us to create a connection with arbitrary TCP parameters. This enables us to suppress the kernel's RST packet, and instead create a socket that will reuse the SYN+ACK's parameters, and send and receive data through this socket as we would any normally connected socket. - -To use forge-socket, you will need the forge-socket kernel module, available from [github][1]. You should git clone `git@github.com:ewust/forge_socket.git` in the ZMap root source directory, and then cd into the forge_socket directory, and run make. Install the kernel module with `insmod forge_socket.ko` as root. - -You must also tell the kernel not to send RST packets. An easy way to disable RST packets system wide is to use **iptables**. `iptables -A OUTPUT -p tcp -m tcp --tcp-flgas RST,RST RST,RST -j DROP` as root will do this, though you may also add an optional --dport X to limit this to the port (X) you are scanning. To remove this after your scan completes, you can run `iptables -D OUTPUT -p tcp -m tcp --tcp-flags RST,RST RST,RST -j DROP` as root. - -Now you should be able to build the forge-socket ZMap example program. To run it, you must use the **extended_file** ZMap output module: - - $ zmap -p 80 -N 1000 -B 10M -O extended_file -o - | \ - ./forge-socket -c 500 -d ./http-req > ./http-banners.out - -See the README in `examples/forge-socket` for more details. - ----------- - -### Writing Probe and Output Modules ### - -ZMap can be extended to support different types of scanning through **probe modules** and additional types of results **output through** output modules. Registered probe and output modules can be listed through the command-line interface: - -**--list-probe-modules** - -Lists installed probe modules - -**--list-output-modules** - -Lists installed output modules - -#### Output Modules #### - -ZMap output and post-processing can be extended by implementing and registering **output modules** with the scanner. Output modules receive a callback for every received response packet. While the default provided modules provide simple output, these modules are also capable of performing additional post-processing (e.g. tracking duplicates or outputting numbers in terms of AS instead of IP address) - -Output modules are created by defining a new output_module struct and registering it in [output_modules.c][2]: - - typedef struct output_module { - const char *name; // how is output module referenced in the CLI - unsigned update_interval; // how often is update called in seconds - - output_init_cb init; // called at scanner initialization - output_update_cb start; // called at the beginning of scanner - output_update_cb update; // called every update_interval seconds - output_update_cb close; // called at scanner termination - - output_packet_cb process_ip; // called when a response is received - - const char *helptext; // Printed when --list-output-modules is called - - } output_module_t; - -Output modules must have a name, which is how they are referenced on the command-line and generally implement `success_ip` and oftentimes `other_ip` callback. The process_ip callback is called for every response packet that is received and passed through the output filter by the current **probe module**. The response may or may not be considered a success (e.g. it could be a TCP RST). These callbacks must define functions that match the `output_packet_cb` definition: - - int (*output_packet_cb) ( - - ipaddr_n_t saddr, // IP address of scanned host in network-order - ipaddr_n_t daddr, // destination IP address in network-order - - const char* response_type, // send-module classification of packet - - int is_repeat, // {0: first response from host, 1: subsequent responses} - int in_cooldown, // {0: not in cooldown state, 1: scanner in cooldown state} - - const u_char* packet, // pointer to struct iphdr of IP packet - size_t packet_len // length of packet in bytes - ); - -An output module can also register callbacks to be executed at scanner initialization (tasks such as opening an output file), start of the scan (tasks such as documenting blacklisted addresses), during regular intervals during the scan (tasks such as progress updates), and close (tasks such as closing any open file descriptors). These callbacks are provided with complete access to the scan configuration and current state: - - int (*output_update_cb)(struct state_conf*, struct state_send*, struct state_recv*); - -which are defined in [output_modules.h][3]. An example is available at [src/output_modules/module_csv.c][4]. - -#### Probe Modules #### - -Packets are constructed using probe modules which allow abstracted packet creation and response classification. ZMap comes with two scan modules by default: `tcp_synscan` and `icmp_echoscan`. By default, ZMap uses `tcp_synscan`, which sends TCP SYN packets, and classifies responses from each host as open (received SYN+ACK) or closed (received RST). ZMap also allows developers to write their own probe modules for use with ZMap, using the following API. - -Each type of scan is implemented by developing and registering the necessary callbacks in a `send_module_t` struct: - - typedef struct probe_module { - const char *name; // how scan is invoked on command-line - size_t packet_length; // how long is probe packet (must be static size) - - const char *pcap_filter; // PCAP filter for collecting responses - size_t pcap_snaplen; // maximum number of bytes for libpcap to capture - - uint8_t port_args; // set to 1 if ZMap requires a --target-port be - // specified by the user - - probe_global_init_cb global_initialize; // called once at scanner initialization - probe_thread_init_cb thread_initialize; // called once for each thread packet buffer - probe_make_packet_cb make_packet; // called once per host to update packet - probe_validate_packet_cb validate_packet; // called once per received packet, - // return 0 if packet is invalid, - // non-zero otherwise. - - probe_print_packet_cb print_packet; // called per packet if in dry-run mode - probe_classify_packet_cb process_packet; // called by receiver to classify response - probe_close_cb close; // called at scanner termination - - fielddef_t *fields // Definitions of the fields specific to this module - int numfields // Number of fields - - } probe_module_t; - -At scanner initialization, `global_initialize` is called once and can be utilized to perform any necessary global configuration or initialization. However, `global_initialize` does not have access to the packet buffer which is thread-specific. Instead, `thread_initialize` is called at the initialization of each sender thread and is provided with access to the buffer that will be used for constructing probe packets along with global source and destination values. This callback should be used to construct the host agnostic packet structure such that only specific values (e.g. destination host and checksum) need to be be updated for each host. For example, the Ethernet header will not change between headers (minus checksum which is calculated in hardware by the NIC) and therefore can be defined ahead of time in order to reduce overhead at scan time. - -The `make_packet` callback is called for each host that is scanned to allow the **probe module** to update host specific values and is provided with IP address values, an opaque validation string, and probe number (shown below). The probe module is responsible for placing as much of the verification string into the probe, in such a way that when a valid response is returned by a server, the probe module can verify that it is present. For example, for a TCP SYN scan, the tcp_synscan probe module can use the TCP source port and sequence number to store the validation string. Response packets (SYN+ACKs) will contain the expected values in the destination port and acknowledgement number. - - int make_packet( - void *packetbuf, // packet buffer - ipaddr_n_t src_ip, // source IP in network-order - ipaddr_n_t dst_ip, // destination IP in network-order - uint32_t *validation, // validation string to place in probe - int probe_num // if sending multiple probes per host, - // this will be which probe number for this - // host we are currently sending - ); - -Scan modules must also define `pcap_filter`, `validate_packet`, and `process_packet`. Only packets that match the PCAP filter will be considered by the scanner. For example, in the case of a TCP SYN scan, we only want to investigate TCP SYN/ACK or TCP RST packets and would utilize a filter similar to `tcp && tcp[13] & 4 != 0 || tcp[13] == 18`. The `validate_packet` function will be called for every packet that fulfills this PCAP filter. If the validation returns non-zero, the `process_packet` function will be called, and will populate a fieldset using fields defined in `fields` with data from the packet. For example, the following code processes a packet for the TCP synscan probe module. - - void synscan_process_packet(const u_char *packet, uint32_t len, fieldset_t *fs) - { - struct iphdr *ip_hdr = (struct iphdr *)&packet[sizeof(struct ethhdr)]; - struct tcphdr *tcp = (struct tcphdr*)((char *)ip_hdr - + (sizeof(struct iphdr))); - - fs_add_uint64(fs, "sport", (uint64_t) ntohs(tcp->source)); - fs_add_uint64(fs, "dport", (uint64_t) ntohs(tcp->dest)); - fs_add_uint64(fs, "seqnum", (uint64_t) ntohl(tcp->seq)); - fs_add_uint64(fs, "acknum", (uint64_t) ntohl(tcp->ack_seq)); - fs_add_uint64(fs, "window", (uint64_t) ntohs(tcp->window)); - - if (tcp->rst) { // RST packet - fs_add_string(fs, "classification", (char*) "rst", 0); - fs_add_uint64(fs, "success", 0); - } else { // SYNACK packet - fs_add_string(fs, "classification", (char*) "synack", 0); - fs_add_uint64(fs, "success", 1); - } - } - --------------------------------------------------------------------------------- - -via: https://zmap.io/documentation.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:https://github.com/ewust/forge_socket/ -[2]:https://github.com/zmap/zmap/blob/v1.0.0/src/output_modules/output_modules.c -[3]:https://github.com/zmap/zmap/blob/master/src/output_modules/output_modules.h -[4]:https://github.com/zmap/zmap/blob/master/src/output_modules/module_csv.c From 8d9469bc09ba353ee78c50ff970db364a05afcd8 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sat, 11 Jul 2015 13:46:25 +0800 Subject: [PATCH 099/113] Create 20150401 ZMap Documentation.md --- .../tech/20150401 ZMap Documentation.md | 743 ++++++++++++++++++ 1 file changed, 743 insertions(+) create mode 100644 translated/tech/20150401 ZMap Documentation.md diff --git a/translated/tech/20150401 ZMap Documentation.md b/translated/tech/20150401 ZMap Documentation.md new file mode 100644 index 0000000000..fbfa912181 --- /dev/null +++ b/translated/tech/20150401 ZMap Documentation.md @@ -0,0 +1,743 @@ +ZMap 文档 +================================================================================ +1. 初识 ZMap +1. 最佳扫描习惯 +1. 命令行参数 +1. 附加信息 + 1. TCP SYN 探测模块 + 1. ICMP Echo 探测模块 + 1. UDP 探测模块 + 1. 配置文件 + 1. 详细 + 1. 结果输出 + 1. 黑名单 + 1. 速度限制与抽样 + 1. 发送多个探测 +1. ZMap 扩展 + 1. 示例应用程序 + 1. 编写探测和输出模块 + +---------- + +### 初识 ZMap ### + +ZMap被设计用来针对IPv4所有地址或其中的大部分实施综合扫描的工具。ZMap是研究者手中的利器,但在运行ZMap时,请注意,您很有可能正在以每秒140万个包的速度扫描整个IPv4地址空间 。我们建议用户在实施即使小范围扫描之前,也联系一下本地网络的管理员并参考我们列举的最佳扫描习惯。 + +默认情况下,ZMap会对于指定端口实施尽可能大速率的TCP SYN扫描。较为保守的情况下,对10,000个随机的地址的80端口以10Mbps的速度扫描,如下所示: + + $ zmap --bandwidth=10M --target-port=80 --max-targets=10000 --output-file=results.csv + +或者更加简洁地写成: + + $ zmap -B 10M -p 80 -n 10000 -o results.csv + +ZMap也可用于扫描特定子网或CIDR地址块。例如,仅扫描10.0.0.0/8和192.168.0.0/16的80端口,运行指令如下: + + zmap -p 80 -o results.csv 10.0.0.0/8 192.168.0.0/16 + +如果扫描进行的顺利,ZMap会每秒输出类似以下内容的状态更新: + + 0% (1h51m left); send: 28777 562 Kp/s (560 Kp/s avg); recv: 1192 248 p/s (231 p/s avg); hits: 0.04% + 0% (1h51m left); send: 34320 554 Kp/s (559 Kp/s avg); recv: 1442 249 p/s (234 p/s avg); hits: 0.04% + 0% (1h50m left); send: 39676 535 Kp/s (555 Kp/s avg); recv: 1663 220 p/s (232 p/s avg); hits: 0.04% + 0% (1h50m left); send: 45372 570 Kp/s (557 Kp/s avg); recv: 1890 226 p/s (232 p/s avg); hits: 0.04% + +这些更新信息提供了扫描的即时状态并表示成:完成进度% (剩余时间); send: 发出包的数量 即时速率 (平均发送速率); recv: 接收包的数量 接收率 (平均接收率); hits: 成功率 + +如果您不知道您所在网络支持的扫描速率,您可能要尝试不同的扫描速率和带宽限制直到扫描效果开始下降,借此找出当前网络能够支持的最快速度。 + +默认情况下,ZMap会输出不同IP地址的列表(例如,SYN ACK数据包的情况)像下面这样。还有几种附加的格式(如,JSON和Redis)作为其输出结果,以及生成程序可解析的扫描统计选项。 同样,可以指定附加的输出字段并使用输出过滤来过滤输出的结果。 + + 115.237.116.119 + 23.9.117.80 + 207.118.204.141 + 217.120.143.111 + 50.195.22.82 + +我们强烈建议您使用黑名单文件,以排除预留的/未分配的IP地址空间(如,组播地址,RFC1918),以及网络中需要排除在您扫描之外的地址。默认情况下,ZMap将采用位于 `/etc/zmap/blacklist.conf`的这个简单的黑名单文件中所包含的预留和未分配地址。如果您需要某些特定设置,比如每次运行ZMap时的最大带宽或黑名单文件,您可以在文件`/etc/zmap/zmap.conf`中指定或使用自定义配置文件。 + +如果您正试图解决扫描的相关问题,有几个选项可以帮助您调试。首先,您可以通过添加`--dryrun`实施预扫,以此来分析包可能会发送到网络的何处。此外,还可以通过设置'--verbosity=n`来更改日志详细程度。 + +---------- + +### 最佳扫描习惯 ### + +我们为针对互联网进行扫描的研究者提供了一些建议,以此来引导养成良好的互联网合作氛围 + +- 密切协同本地的网络管理员,以减少风险和调查 +- 确认扫描不会使本地网络或上游供应商瘫痪 +- 标记出在扫描中呈良性的网页和DNS条目的源地址 +- 明确注明扫描中所有连接的目的和范围 +- 提供一个简单的退出方法并及时响应请求 +- 实施扫描时,不使用比研究对象需求更大的扫描范围或更快的扫描频率 +- 如果可以通过时间或源地址来传播扫描流量 + +即使不声明,使用扫描的研究者也应该避免利用漏洞或访问受保护的资源,并遵守其辖区内任何特殊的法律规定。 + +---------- + +### 命令行参数 ### + +#### 通用选项 #### + +这些选项是实施简单扫描时最常用的选项。我们注意到某些选项取决于所使用的探测模块或输出模块(如,在实施ICMP Echo扫描时是不需要使用目的端口的)。 + + +**-p, --target-port=port** + +用来扫描的TCP端口号(例如,443) + +**-o, --output-file=name** + +使用标准输出将结果写入该文件。 + +**-b, --blacklist-file=path** + +文件中被排除的子网使用CIDR表示法(如192.168.0.0/16),一个一行。建议您使用此方法排除RFC 1918地址,组播地址,IANA预留空间等IANA专用地址。在conf/blacklist.example中提供了一个以此为目的示例黑名单文件。 + +#### 扫描选项 #### + +**-n, --max-targets=n** + +限制探测目标的数量。后面跟的可以是一个数字(例如'-n 1000`)或百分比(例如,`-n 0.1%`)当然都是针对可扫描地址空间而言的(不包括黑名单) + +**-N, --max-results=n** + +收到多少结果后退出 + +**-t, --max-runtime=secs** + +限制发送报文的时间 + +**-r, --rate=pps** + +设置传输速率,以包/秒为单位 + +**-B, --bandwidth=bps** + +以比特/秒设置传输速率(支持使用后缀G,M或K(如`-B 10M`就是速度10 mbps)的。设置会覆盖`--rate`。 + +**-c, --cooldown-time=secs** + +发送完成后多久继续接收(默认值= 8) + +**-e, --seed=n** + +地址排序种子。如果要用多个ZMap以相同的顺序扫描地址,那么就可以使用这个参数。 + +**--shards=n** + +将扫描分片/区在使其可多个ZMap中执行(默认值= 1)。启用分片时,`--seed`参数是必需的。 + +**--shard=n** + +选择扫描的分片(默认值= 0)。n的范围在[0,N),其中N为碎片的总数。启用分片时,`--seed`参数是必需的。 + +**-T, --sender-threads=n** + +用于发送数据包的线程数(默认值= 1) + +**-P, --probes=n** + +发送到每个IP的探测数(默认值= 1) + +**-d, --dryrun** + +用标准输出打印出每个包,而不是将其发送(用于调试) + +#### 网络选项 #### + +**-s, --source-port=port|range** + +发送数据包的源端口 + +**-S, --source-ip=ip|range** + +发送数据包的源地址。可以仅仅是一个IP,也可以是一个范围(如,10.0.0.1-10.0.0.9) + +**-G, --gateway-mac=addr** + +数据包发送到的网关MAC地址(用以防止自动检测不工作的情况) + +**-i, --interface=name** + +使用的网络接口 + +#### 探测选项 #### + +ZMap允许用户指定并添加自己所需要探测的模块。 探测模块的职责就是生成主机回复的响应包。 + +**--list-probe-modules** + +列出可用探测模块(如tcp_synscan) + +**-M, --probe-module=name** + +选择探探测模块(默认值= tcp_synscan) + +**--probe-args=args** + +向模块传递参数 + +**--list-output-fields** + +列出可用的输出模块 + +#### 输出选项 #### + +ZMap允许用户选择指定的输出模块。输出模块负责处理由探测模块返回的字段,并将它们交给用户。用户可以指定输出的范围,并过滤相应字段。 + +**--list-output-modules** + +列出可用输出模块(如tcp_synscan) + +**-O, --output-module=name** + +选择输出模块(默认值为csv) + +**--output-args=args** + +传递给输出模块的参数 + +**-f, --output-fields=fields** + +输出列表,以逗号分割 + +**--output-filter** + +通过指定相应的探测模块来过滤输出字段 + +#### 附加选项 #### + +**-C, --config=filename** + +加载配置文件,可以指定其他路径。 + +**-q, --quiet** + +不再是每秒刷新输出 + +**-g, --summary** + +在扫描结束后打印配置和结果汇总信息 + +**-v, --verbosity=n** + +日志详细程度(0-5,默认值= 3) + +**-h, --help** + +打印帮助并退出 + +**-V, --version** + +打印版本并退出 + +---------- + +### 附加信息 ### + +#### TCP SYN 扫描 #### + +在执行TCP SYN扫描时,ZMap需要指定一个目标端口和以供扫描的源端口范围。 + +**-p, --target-port=port** + +扫描的TCP端口(例如 443) + +**-s, --source-port=port|range** + +发送扫描数据包的源端口(例如 40000-50000) + +**警示!** ZMAP基于Linux内核使用SYN/ACK包应答,RST包关闭扫描打开的连接。ZMap是在Ethernet层完成包的发送的,这样做时为了减少跟踪打开的TCP连接和路由寻路带来的内核开销。因此,如果您有跟踪连接建立的防火墙规则,如netfilter的规则类似于`-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT`,将阻止SYN/ACK包到达内核。这不会妨碍到ZMap记录应答,但它会阻止RST包被送回,最终连接会在超时后断开。我们强烈建议您在执行ZMap时,选择一组主机上未使用且防火墙允许访问的端口,加在`-s`后(如 `-s '50000-60000' ` )。 + +#### ICMP Echo 请求扫描 #### + +虽然在默认情况下ZMap执行的是TCP SYN扫描,但它也支持使用ICMP echo请求扫描。在这种扫描方式下ICMP echo请求包被发送到每个主机,并以收到ICMP 应答包作为答复。实施ICMP扫描可以通过选择icmp_echoscan扫描模块来执行,如下: + + $ zmap --probe-module=icmp_echoscan + +#### UDP 数据报扫描 #### + +ZMap还额外支持UDP探测,它会发出任意UDP数据报给每个主机,并能在无论UDP或是ICMP任何一个不可达的情况下接受应答。ZMap支持通过使用--probe-args命令行选择四种不同的UDP payload方式。这些都有可列印payload的‘文本’,用于命令行的十六进制payload的‘hex’,外部文件中包含payload的‘file’,和需要动态区域生成的payload的‘template’。为了得到UDP响应,请使用-f参数确保您指定的“data”领域处于汇报范围。 + +下面的例子将发送两个字节'ST',即PC的'status'请求,到UDP端口5632。 + + $ zmap -M udp -p 5632 --probe-args=text:ST -N 100 -f saddr,data -o - + +下面的例子将发送字节“0X02”,即SQL服务器的 'client broadcast'请求,到UDP端口1434。 + + $ zmap -M udp -p 1434 --probe-args=hex:02 -N 100 -f saddr,data -o - + +下面的例子将发送一个NetBIOS状态请求到UDP端口137。使用一个ZMap自带的payload文件。 + + $ zmap -M udp -p 1434 --probe-args=file:netbios_137.pkt -N 100 -f saddr,data -o - + +下面的例子将发送SIP的'OPTIONS'请求到UDP端口5060。使用附ZMap自带的模板文件。 + + $ zmap -M udp -p 1434 --probe-args=file:sip_options.tpl -N 100 -f saddr,data -o - + +UDP payload 模板仍处于实验阶段。当您在更多的使用一个以上的发送线程(-T)时可能会遇到崩溃和一个明显的相比静态payload性能降低的表现。模板仅仅是一个由一个或多个使用$ {}将字段说明封装成序列构成的payload文件。某些协议,特别是SIP,需要payload来反射包中的源和目的地址。其他协议,如端口映射和DNS,包含范围伴随每一次请求随机生成或Zamp扫描的多宿主系统将会抛出危险警告。 + +以下的payload模板将发送SIP OPTIONS请求到每一个目的地: + + OPTIONS sip:${RAND_ALPHA=8}@${DADDR} SIP/2.0 + Via: SIP/2.0/UDP ${SADDR}:${SPORT};branch=${RAND_ALPHA=6}.${RAND_DIGIT=10};rport;alias + From: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT};tag=${RAND_DIGIT=8} + To: sip:${RAND_ALPHA=8}@${DADDR} + Call-ID: ${RAND_DIGIT=10}@${SADDR} + CSeq: 1 OPTIONS + Contact: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT} + Content-Length: 0 + Max-Forwards: 20 + User-Agent: ${RAND_ALPHA=8} + Accept: text/plain + +就像在上面的例子中展示的那样,对于大多数SIP正常的实现会在在每行行末添加\r\n,并且在请求的末尾一定包含\r\n\r\n。一个可以使用的在ZMap的examples/udp-payloads目录下的例子 (sip_options.tpl). + +下面的字段正在如今的模板中实施: + + +- **SADDR**: 源IP地址的点分十进制格式 +- **SADDR_N**: 源IP地址的网络字节序格式 +- **DADDR**: 目的IP地址的点分十进制格式 +- **DADDR_N**: 目的IP地址的网络字节序格式 +- **SPORT**: 源端口的ascii格式 +- **SPORT_N**: 源端口的网络字节序格式 +- **DPORT**: 目的端口的ascii格式 +- **DPORT_N**: 目的端口的网络字节序格式 +- **RAND_BYTE**: 随机字节(0-255),长度由=(长度) 参数决定 +- **RAND_DIGIT**: 随机数字0-9,长度由=(长度) 参数决定 +- **RAND_ALPHA**: 随机大写字母A-Z,长度由=(长度) 参数决定 +- **RAND_ALPHANUM**: 随机大写字母A-Z和随机数字0-9,长度由=(长度) 参数决定 + +### 配置文件 ### + +ZMap支持使用配置文件代替在命令行上指定所有的需求选项。配置中可以通过每行指定一个长名称的选项和对应的值来创建: + + interface "eth1" + source-ip 1.1.1.4-1.1.1.8 + gateway-mac b4:23:f9:28:fa:2d # upstream gateway + cooldown-time 300 # seconds + blacklist-file /etc/zmap/blacklist.conf + output-file ~/zmap-output + quiet + summary + +然后ZMap就可以按照配置文件和一些必要的附加参数运行了: + + $ zmap --config=~/.zmap.conf --target-port=443 + +### 详细 ### + +ZMap可以在屏幕上生成多种类型的输出。默认情况下,Zmap将每隔1秒打印出相似的基本进度信息。可以通过设置`--quiet`来禁用。 + + 0:01 12%; send: 10000 done (15.1 Kp/s avg); recv: 144 143 p/s (141 p/s avg); hits: 1.44% + +ZMap同样也可以根据扫描配置打印如下消息,可以通过'--verbosity`参数加以控制。 + + Aug 11 16:16:12.813 [INFO] zmap: started + Aug 11 16:16:12.817 [DEBUG] zmap: no interface provided. will use eth0 + Aug 11 16:17:03.971 [DEBUG] cyclic: primitive root: 3489180582 + Aug 11 16:17:03.971 [DEBUG] cyclic: starting point: 46588 + Aug 11 16:17:03.975 [DEBUG] blacklist: 3717595507 addresses allowed to be scanned + Aug 11 16:17:03.975 [DEBUG] send: will send from 1 address on 28233 source ports + Aug 11 16:17:03.975 [DEBUG] send: using bandwidth 10000000 bits/s, rate set to 14880 pkt/s + Aug 11 16:17:03.985 [DEBUG] recv: thread started + +ZMap还支持在扫描之后打印出一个的可grep的汇总信息,类似于下面这样,可以通过调用`--summary`来实现。 + + cnf target-port 443 + cnf source-port-range-begin 32768 + cnf source-port-range-end 61000 + cnf source-addr-range-begin 1.1.1.4 + cnf source-addr-range-end 1.1.1.8 + cnf maximum-packets 4294967295 + cnf maximum-runtime 0 + cnf permutation-seed 0 + cnf cooldown-period 300 + cnf send-interface eth1 + cnf rate 45000 + env nprocessors 16 + exc send-start-time Fri Jan 18 01:47:35 2013 + exc send-end-time Sat Jan 19 00:47:07 2013 + exc recv-start-time Fri Jan 18 01:47:35 2013 + exc recv-end-time Sat Jan 19 00:52:07 2013 + exc sent 3722335150 + exc blacklisted 572632145 + exc first-scanned 1318129262 + exc hit-rate 0.874102 + exc synack-received-unique 32537000 + exc synack-received-total 36689941 + exc synack-cooldown-received-unique 193 + exc synack-cooldown-received-total 1543 + exc rst-received-unique 141901021 + exc rst-received-total 166779002 + adv source-port-secret 37952 + adv permutation-gen 4215763218 + +### 结果输出 ### + +ZMap可以通过**输出模块**生成不同格式的结果。默认情况下,ZMap只支持**csv**的输出,但是可以通过编译支持**redis**和**json** 。可以使用**输出过滤**来过滤这些发送到输出模块上的结果。输出模块的范围由用户指定。默认情况如果没有指定输出文件,ZMap将以csv格式返回结果,ZMap不会产生特定结果。也可以编写自己的输出模块;请参阅编写输出模块。 + +**-o, --output-file=p** + +输出写入文件地址 + +**-O, --output-module=p** + +调用自定义输出模块 + + +**-f, --output-fields=p** + +输出以逗号分隔各字段的列表 + +**--output-filter=filter** + +在给定的探测区域实施输出过滤 + +**--list-output-modules** + +列出可用输出模块 + +**--list-output-fields** + +列出可用的给定探测区域 + +#### 输出字段 #### + +ZMap有很多区域,它可以基于IP地址输出。这些区域可以通过在给定探测模块上运行`--list-output-fields`来查看。 + + $ zmap --probe-module="tcp_synscan" --list-output-fields + saddr string: 应答包中的源IP地址 + saddr-raw int: 网络提供的整形形式的源IP地址 + daddr string: 应答包中的目的IP地址 + daddr-raw int: 网络提供的整形形式的目的IP地址 + ipid int: 应答包中的IP识别号 + ttl int: 应答包中的ttl(存活时间)值 + sport int: TCP 源端口 + dport int: TCP 目的端口 + seqnum int: TCP 序列号 + acknum int: TCP Ack号 + window int: TCP 窗口 + classification string: 包类型 + success int: 是应答包成功 + repeat int: 是否是来自主机的重复响应 + cooldown int: 是否是在冷却时间内收到的响应 + timestamp-str string: 响应抵达时的时间戳使用ISO8601格式 + timestamp-ts int: 响应抵达时的时间戳使用纪元开始的秒数 + timestamp-us int: 时间戳的微秒部分(例如 从'timestamp-ts'的几微秒) + +可以通过使用`--output-fields=fields`或`-f`来选择选择输出字段,任意组合的输出字段可以被指定为逗号分隔的列表。例如: + + $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv + +#### 过滤输出 #### + +在传到输出模块之前,探测模块生成的结果可以先过滤。过滤被实施在探测模块的输出字段上。过滤使用简单的过滤语法写成,类似于SQL,通过ZMap的**--output-filter**选项来实施。输出过滤通常用于过滤掉重复的结果或仅传输成功的响应到输出模块。 + +过滤表达式的形式为`<字段名> <操作> <值>`。`<值>`的类型必须是一个字符串或一串无符号整数并且匹配`<字段名>`类型。对于整数比较有效的操作是`= !=, <, >, <=, >=`。字符串比较的操作是=,!=。`--list-output-fields`会打印那些可供探测模块选择的字段和类型,然后退出。 + +复合型的过滤操作,可以通过使用`&&`(逻辑与)和`||`(逻辑或)这样的运算符来组合出特殊的过滤操作。 + +**示例** + +书写一则过滤仅显示成功,过滤重复应答 + + --output-filter="success = 1 && repeat = 0" + +过滤出包中含RST并且TTL大于10的分类,或者包中含SYNACK的分类 + + --output-filter="(classification = rst && ttl > 10) || classification = synack" + +#### CSV #### + +csv模块将会生成以逗号分隔各输出请求字段的文件。例如,以下的指令将生成下面的CSV至名为`output.csv`的文件。 + + $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv + +---------- + + 响应, 源地址, 目的地址, 源端口, 目的端口, 序列号, 应答, 是否是冷却模式, 是否重复, 时间戳 + synack, 159.174.153.144, 10.0.0.9, 80, 40555, 3050964427, 3515084203, 0, 0,2013-08-15 18:55:47.681 + rst, 141.209.175.1, 10.0.0.9, 80, 40136, 0, 3272553764, 0, 0,2013-08-15 18:55:47.683 + rst, 72.36.213.231, 10.0.0.9, 80, 56642, 0, 2037447916, 0, 0,2013-08-15 18:55:47.691 + rst, 148.8.49.150, 10.0.0.9, 80, 41672, 0, 1135824975, 0, 0,2013-08-15 18:55:47.692 + rst, 50.165.166.206, 10.0.0.9, 80, 38858, 0, 535206863, 0, 0,2013-08-15 18:55:47.694 + rst, 65.55.203.135, 10.0.0.9, 80, 50008, 0, 4071709905, 0, 0,2013-08-15 18:55:47.700 + synack, 50.57.166.186, 10.0.0.9, 80, 60650, 2813653162, 993314545, 0, 0,2013-08-15 18:55:47.704 + synack, 152.75.208.114, 10.0.0.9, 80, 52498, 460383682, 4040786862, 0, 0,2013-08-15 18:55:47.707 + synack, 23.72.138.74, 10.0.0.9, 80, 33480, 810393698, 486476355, 0, 0,2013-08-15 18:55:47.710 + +#### Redis #### + +Redis的输出模块允许地址被添加到一个Redis的队列,不是被保存到文件,允许ZMap将它与之后的处理工具结合使用。 + +**注意!** ZMap默认不会编译Redis功能。如果您想要将Redis功能编译进ZMap源码中,可以在CMake的时候加上`-DWITH_REDIS=ON`。 + +### 黑名单和白名单 ### + +ZMap同时支持对网络前缀做黑名单和白名单。如果ZMap不加黑名单和白名单参数,他将会扫描所有的IPv4地址(包括本地的,保留的以及组播地址)。如果指定了黑名单文件,那么在黑名单中的网络前缀将不再扫描;如果指定了白名单文件,只有那些网络前缀在白名单内的才会扫描。白名单和黑名单文件可以协同使用;黑名单运用于白名单上(例如:如果您在白名单中指定了10.0.0.0/8并在黑名单中指定了10.1.0.0/16,那么10.1.0.0/16将不会扫描)。白名单和黑名单文件可以在命令行中指定,如下所示: + +**-b, --blacklist-file=path** + +文件用于记录黑名单子网,以CIDR(无类域间路由)的表示法,例如192.168.0.0/16 + +**-w, --whitelist-file=path** + +文件用于记录限制扫描的子网,以CIDR的表示法,例如192.168.0.0/16 + +黑名单文件的每行都需要以CIDR的表示格式书写一个单一的网络前缀。允许使用`#`加以备注。例如: + + # IANA(英特网编号管理局)记录的用于特殊目的的IPv4地址 + # http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml + # 更新于2013-05-22 + + 0.0.0.0/8 # RFC1122: 网络中的所有主机 + 10.0.0.0/8 # RFC1918: 私有地址 + 100.64.0.0/10 # RFC6598: 共享地址空间 + 127.0.0.0/8 # RFC1122: 回环地址 + 169.254.0.0/16 # RFC3927: 本地链路地址 + 172.16.0.0/12 # RFC1918: 私有地址 + 192.0.0.0/24 # RFC6890: IETF协议预留 + 192.0.2.0/24 # RFC5737: 测试地址 + 192.88.99.0/24 # RFC3068: IPv6转换到IPv4的任意播 + 192.168.0.0/16 # RFC1918: 私有地址 + 192.18.0.0/15 # RFC2544: 检测地址 + 198.51.100.0/24 # RFC5737: 测试地址 + 203.0.113.0/24 # RFC5737: 测试地址 + 240.0.0.0/4 # RFC1112: 预留地址 + 255.255.255.255/32 # RFC0919: 广播地址 + + # IANA记录的用于组播的地址空间 + # http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml + # 更新于2013-06-25 + + 224.0.0.0/4 # RFC5771: 组播/预留地址ed + +如果您只是想扫描因特网中随机的一部分地址,使用采样检出,来代替使用白名单和黑名单。 + +**注意!**ZMap默认设置使用`/etc/zmap/blacklist.conf`作为黑名单文件,其中包含有本地的地址空间和预留的IP空间。通过编辑`/etc/zmap/zmap.conf`可以改变默认的配置。 + +### 速度限制与抽样 ### + +默认情况下,ZMap将以您当前网络所能支持的最快速度扫描。以我们对于常用硬件的经验,这普遍是理论上Gbit以太网速度的95-98%,这可能比您的上游提供商可处理的速度还要快。ZMap是不会自动的根据您的上游提供商来调整发送速率的。您可能需要手动的调整发送速率来减少丢包和错误结果。 + +**-r, --rate=pps** + +设置最大发送速率以包/秒为单位 + +**-B, --bandwidth=bps** + +设置发送速率以比特/秒(支持G,M和K后缀)。也同样作用于--rate的参数。 + +ZMap同样支持对IPv4地址空间进行指定最大目标数和/或最长运行时间的随机采样。由于针对主机的扫描是通过随机排序生成的实例,限制扫描的主机个数为N就会随机抽选N个主机。命令选项如下: + +**-n, --max-targets=n** + +探测目标上限数量 + +**-N, --max-results=n** + +结果上限数量(累积收到这么多结果后推出) + +**-t, --max-runtime=s** + +发送数据包时间长度上限(以秒为单位) + +**-s, --seed=n** + +种子用以选择地址的排列方式。使用不同ZMap执行扫描操作时将种子设成相同的值可以保证相同的扫描顺序。 + +举个例子,如果您想要多次扫描同样的一百万个互联网主机,您可以设定排序种子和扫描主机的上限数量,大致如下所示: + + zmap -p 443 -s 3 -n 1000000 -o results + +为了确定哪一百万主机将要被扫描,您可以执行预扫,只列印数据包而非发送,并非真的实施扫描。 + + zmap -p 443 -s 3 -n 1000000 --dryrun | grep daddr + | awk -F'daddr: ' '{print $2}' | sed 's/ |.*//;' + +### 发送多个数据包 ### + +ZMap支持想每个主机发送多个扫描。增加这个数量既增加了扫描时间又增加了到达的主机数量。然而,我们发现,增加扫描时间(每个额外扫描的增加近100%)远远大于到达的主机数量(每个额外扫描的增加近1%)。 + +**-P, --probes=n** + +向每个IP发出的独立扫描个数(默认值=1) + +---------- + +### 示例应用程序 ### + +ZMap专为向大量主机发启连接并寻找那些正确响应而设计。然而,我们意识到许多用户需要执行一些后续处理,如执行应用程序级别的握手。例如,用户在80端口实施TCP SYN扫描可能只是想要实施一个简单的GET请求,还有用户扫描443端口可能是对TLS握手如何完成感兴趣。 + +#### Banner获取 #### + +我们收录了一个示例程序,banner-grab,伴随ZMap使用可以让用户从监听状态的TCP服务器上接收到消息。Banner-grab连接到服务上,任意的发送一个消息,然后打印出收到的第一个消息。这个工具可以用来获取banners例如HTTP服务的回复的具体指令,telnet登陆提示,或SSH服务的字符串。 + +这个例子寻找了1000个监听80端口的服务器,并向每个发送一个简单的GET请求,存储他们的64位编码响应至http-banners.out + + $ zmap -p 80 -N 1000 -B 10M -o - | ./banner-grab-tcp -p 80 -c 500 -d ./http-req > out + +如果想知道更多使用`banner-grab`的细节,可以参考`examples/banner-grab`中的README文件。 + +**注意!** ZMap和banner-grab(如例子中)同时运行可能会比较显著的影响对方的表现和精度。确保不让ZMap充满banner-grab-tcp的并发连接,不然banner-grab将会落后于标准输入的读入,导致屏蔽编写标准输出。我们推荐使用较慢扫描速率的ZMap,同时提升banner-grab-tcp的并发性至3000以内(注意 并发连接>1000需要您使用`ulimit -SHn 100000`和`ulimit -HHn 100000`来增加每个问进程的最大文件描述)。当然,这些参数取决于您服务器的性能,连接成功率(hit-rate);我们鼓励开发者在运行大型扫描之前先进行小样本的试验。 + +#### 建立套接字 #### + +我们也收录了另一种形式的banner-grab,就是forge-socket, 重复利用服务器发出的SYN-ACK,连接并最终取得banner。在`banner-grab-tcp`中,ZMap向每个服务器发送一个SYN,并监听服务器发回的带有SYN+ACK的应答。运行ZMap主机的内核接受应答后发送RST,因为有没有处于活动状态的连接与该包关联。程序banner-grab必须在这之后创建一个新的TCP连接到从服务器获取数据。 + +在forge-socket中,我们以同样的名字利用内核模块,这使我们可以创建任意参数的TCP连接。这样可以抑制内核的RST包,并且通过创建套接字取代它可以重用SYN+ACK的参数,通过这个套接字收发数据和我们平时使用的连接套接字并没有什么不同。 + +要使用forge-socket,您需要forge-socket内核模块,从[github][1]上可以获得。您需要git clone `git@github.com:ewust/forge_socket.git`至ZMap源码根目录,然后cd进入forge_socket 目录,运行make。以root身份安装带有`insmod forge_socket.ko` 的内核模块。 + +您也需要告知内核不要发送RST包。一个简单的在全系统禁用RST包的方法是**iptables**。以root身份运行`iptables -A OUTPUT -p tcp -m tcp --tcp-flgas RST,RST RST,RST -j DROP`即可,当然您也可以加上一项--dport X将禁用局限于所扫描的端口(X)上。扫描完成后移除这项设置,以root身份运行`iptables -D OUTPUT -p tcp -m tcp --tcp-flags RST,RST RST,RST -j DROP`即可。 + +现在应该可以建立forge-socket的ZMap示例程序了。运行需要使用**extended_file**ZMap输出模块: + + $ zmap -p 80 -N 1000 -B 10M -O extended_file -o - | \ + ./forge-socket -c 500 -d ./http-req > ./http-banners.out + +详细内容可以参考`examples/forge-socket`目录下的README。 + +---------- + +### 编写探测和输出模块 ### + +ZMap可以通过**probe modules**扩展支持不同类型的扫描,通过**output modules**追加不同类型的输出结果。注册过的探测和输出模块可以在命令行中列出: + +**--list-probe-modules** + +列出安装过的探测模块 + +**--list-output-modules** + +列出安装过的输出模块 + +#### 输出模块 #### + +ZMap的输出和输出后处理可以通过执行和注册扫描的**output modules**来扩展。输出模块在接收每一个应答包时都会收到一个回调。然而提供的默认模块仅提供简单的输出,这些模块同样支持扩展扫描后处理(例如:重复跟踪或输出AS号码来代替IP地址) + +通过定义一个新的output_module机构体来创建输出模块,并在[output_modules.c][2]中注册: + + typedef struct output_module { + const char *name; // 在命令行如何引出输出模块 + unsigned update_interval; // 以秒为单位的更新间隔 + + output_init_cb init; // 在扫描初始化的时候调用 + output_update_cb start; // 在开始的扫描的时候调用 + output_update_cb update; // 每次更新间隔调用,秒为单位 + output_update_cb close; // 扫描终止后调用 + + output_packet_cb process_ip; // 接收到应答时调用 + + const char *helptext; // 会在--list-output-modules时打印在屏幕啥 + + } output_module_t; + +输出模块必须有名称,通过名称可以在命令行、普遍实施的`success_ip`和常见的`other_ip`回调中使用模块。process_ip的回调由每个收到的或经由**probe module**过滤的应答包调用。应答是否被认定为成功并不确定(比如,他可以是一个TCP的RST)。这些回调必须定义匹配`output_packet_cb`定义的函数: + + int (*output_packet_cb) ( + + ipaddr_n_t saddr, // network-order格式的扫描主机IP地址 + ipaddr_n_t daddr, // network-order格式的目的IP地址 + + const char* response_type, // 发送模块的数据包分类 + + int is_repeat, // {0: 主机的第一个应答, 1: 后续的应答} + int in_cooldown, // {0: 非冷却状态, 1: 扫描处于冷却中} + + const u_char* packet, // 指向结构体iphdr中IP包的指针 + size_t packet_len // 包的长度以字节为单位 + ); + +输出模块还可以通过注册回调执行在扫描初始化的时候(诸如打开输出文件的任务),扫描开始阶段(诸如记录黑名单的任务),在常规间隔实施(诸如程序升级的任务)在关闭的时候(诸如关掉所有打开的文件描述符。这些回调提供完整的扫描配置入口和实时状态: + + int (*output_update_cb)(struct state_conf*, struct state_send*, struct state_recv*); + +被定义在[output_modules.h][3]中。在[src/output_modules/module_csv.c][4]中有可用示例。 + +#### 探测模块 #### + +数据包由探测模块构造,由此可以创建抽象包并对应答分类。ZMap默认拥有两个扫描模块:`tcp_synscan`和`icmp_echoscan`。默认情况下,ZMap使用`tcp_synscan`来发送TCP SYN包并对每个主机的并对每个主机的响应分类,如打开时(收到SYN+ACK)或关闭时(收到RST)。ZMap允许开发者编写自己的ZMap探测模块,使用如下的API: + +任何类型的扫描的实施都需要在`send_module_t`结构体内开发和注册必要的回调: + + typedef struct probe_module { + const char *name; // 如何在命令行调用扫描 + size_t packet_length; // 探测包有多长(必须是静态的) + + const char *pcap_filter; // 对收到的响应实施PCAP过滤 + size_t pcap_snaplen; // maximum number of bytes for libpcap to capture + + uint8_t port_args; // 设为1,如果需要使用ZMap的--target-port + // 用户指定 + + probe_global_init_cb global_initialize; // 在扫描初始化会时被调用一次 + probe_thread_init_cb thread_initialize; // 每个包缓存区的线程中被调用一次 + probe_make_packet_cb make_packet; // 每个主机更新包的时候被调用一次 + probe_validate_packet_cb validate_packet; // 每收到一个包被调用一次, + // 如果包无效返回0, + // 非零则覆盖。 + + probe_print_packet_cb print_packet; // 如果在dry-run模式下被每个包都调用 + probe_classify_packet_cb process_packet; // 由区分响应的接收器调用 + probe_close_cb close; // 扫描终止后被调用 + + fielddef_t *fields // 该模块指定的区域的定义 + int numfields // 区域的数量 + + } probe_module_t; + +在扫描操作初始化时会调用一次`global_initialize`,可以用来实施一些必要的全局配置和初始化操作。然而,`global_initialize`并不能访问报缓冲区,那里由线程指定。用以代替的,`thread_initialize`在每个发送线程初始化的时候被调用,提供对于缓冲区的访问,可以用来构建探测包和全局的源和目的值。此回调应用于构建宿主不可知分组结构,甚至只有特定值(如:目的主机和校验和),需要随着每个主机更新。例如,以太网头部信息在交换时不会变更(减去校验和是由NIC硬件计算的)因此可以事先定义以减少扫描时间开销。 + +调用回调参数`make_packet是为了让被扫描的主机允许**probe module**更新主机指定的值,同时提供IP地址、一个非透明的验证字符串和探测数目(如下所示)。探测模块负责在探测中放置尽可能多的验证字符串,以至于当服务器返回的应答为空时,探测模块也能验证它的当前状态。例如,针对TCP SYN扫描,tcp_synscan探测模块会使用TCP源端口和序列号的格式存储验证字符串。响应包(SYN+ACKs)将包含预期的值包含目的端口和确认号。 + + int make_packet( + void *packetbuf, // 包的缓冲区 + ipaddr_n_t src_ip, // network-order格式源IP + ipaddr_n_t dst_ip, // network-order格式目的IP + uint32_t *validation, // 探测中的确认字符串 + int probe_num // 如果向每个主机发送多重探测, + // 该值为对于主机我们 + // 正在实施的探测数目 + ); + +扫描模块也应该定义`pcap_filter`、`validate_packet`和`process_packet`。只有符合PCAP过滤的包才会被扫描。举个例子,在一个TCP SYN扫描的情况下,我们只想要调查TCP SYN / ACK或RST TCP数据包,并利用类似`tcp && tcp[13] & 4 != 0 || tcp[13] == 18`的过滤方法。`validate_packet`函数将会被每个满足PCAP过滤条件的包调用。如果验证返回的值非零,将会调用`process_packet`函数,并使用包中被定义成的`fields`字段和数据填充字段集。如下代码为TCP synscan探测模块处理了一个数据包。 + + void synscan_process_packet(const u_char *packet, uint32_t len, fieldset_t *fs) + { + struct iphdr *ip_hdr = (struct iphdr *)&packet[sizeof(struct ethhdr)]; + struct tcphdr *tcp = (struct tcphdr*)((char *)ip_hdr + + (sizeof(struct iphdr))); + + fs_add_uint64(fs, "sport", (uint64_t) ntohs(tcp->source)); + fs_add_uint64(fs, "dport", (uint64_t) ntohs(tcp->dest)); + fs_add_uint64(fs, "seqnum", (uint64_t) ntohl(tcp->seq)); + fs_add_uint64(fs, "acknum", (uint64_t) ntohl(tcp->ack_seq)); + fs_add_uint64(fs, "window", (uint64_t) ntohs(tcp->window)); + + if (tcp->rst) { // RST packet + fs_add_string(fs, "classification", (char*) "rst", 0); + fs_add_uint64(fs, "success", 0); + } else { // SYNACK packet + fs_add_string(fs, "classification", (char*) "synack", 0); + fs_add_uint64(fs, "success", 1); + } + } + +-------------------------------------------------------------------------------- + +via: https://zmap.io/documentation.html + +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:https://github.com/ewust/forge_socket/ +[2]:https://github.com/zmap/zmap/blob/v1.0.0/src/output_modules/output_modules.c +[3]:https://github.com/zmap/zmap/blob/master/src/output_modules/output_modules.h +[4]:https://github.com/zmap/zmap/blob/master/src/output_modules/module_csv.c From c51e4a7f6d290cd84de5c756827629c83e85dd78 Mon Sep 17 00:00:00 2001 From: Love-xuan Date: Sat, 11 Jul 2015 14:00:26 +0800 Subject: [PATCH 100/113] translated --- ... Adds Live Backgrounds To Linux Distros.md | 114 ------------------ ... Adds Live Backgrounds To Linux Distros.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 114 deletions(-) delete mode 100644 sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md create mode 100644 translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md diff --git a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md deleted file mode 100644 index 03be3a27ff..0000000000 --- a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md +++ /dev/null @@ -1,114 +0,0 @@ -Translating by Love-xuan -Animated Wallpaper Adds Live Backgrounds To Linux Distros -================================================================================ -**We know a lot of you love having a stylish Ubuntu desktop to show off.** - -![Live Wallpaper](http://i.imgur.com/9JIUw5p.gif) - -Live Wallpaper - -And as Linux makes it so easy to create a stunning workspace with a minimal effort, that’s understandable! - -Today, we’re highlighting — [re-highlighting][2] for those of you with long memories — a free, open-source tool that can add extra bling your OS screenshots and screencasts. - -It’s called **Live Wallpaper** and (as you can probably guess) it will replace the standard static desktop background with an animated alternative powered by OpenGL. - -And the best bit: it can be installed in Ubuntu very easily. - -### Animated Wallpaper Themes ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/animated-wallpaper-ubuntu-750x383.jpg) - -Live Wallpaper is not the only app of this type, but it is one of the the best. - -It comes with a number of different themes out of the box. - -These range from the subtle (‘noise’) to frenetic (‘nexus’), and caters to everything in between. There’s even the obligatory clock wallpaper inspired by the welcome screen of the Ubuntu Phone: - -- Circles — Clock inspired by Ubuntu Phone with ‘evolving circle’ aura -- Galaxy — Spinning galaxy that can be resized/repositioned -- Gradient Clock — A polar clock overlaid on basic gradient -- Nexus — Brightly colored particles fire across screen -- Noise — A bokeh design similar to the iOS dynamic wallpaper -- Photoslide — Grid of photos from folder (default ~/Photos) animate in/out - -Live Wallpaper is **fully open-source** so there’s nothing to stop imaginative artists with the know-how (and patience) from creating some slick themes of their own. - -### Settings & Features ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-gui-settings.jpg) - -Each theme can be configured or customised in some way, though certain themes have more options than others. - -For example, in Nexus (pictured above) you can change the number and colour of the the pulse particles, their size, and their frequency. - -The preferences app also provides a set of **general options** that will apply to all themes. These include: - -- Setting live wallpaper to run on log-in -- Setting a custom background that the animation sits on -- Adjusting the FPS (including option to show FPS on screen) -- Specifying the multi-monitor behaviour - -With so many options available it should be easy to create a background set up that suits you. - -### Drawbacks ### - -#### No Desktop Icons #### - -You can’t add, open or edit files or folders on the desktop while Live Wallpaper is ‘On’. - -The Preferences app does list an option that will, supposedly, let you do this. It may work on really older releases but in our testing, on Ubuntu 14.10, it does nothing. - -One workaround that seems to work for some users of the app on Ubuntu is setting a .png image as the custom background. It doesn’t have to be a transparent .png, simply a .png. - -#### Resource Usage #### - -Animated wallpapers use more system resources than standard background images. - -We’re not talking about 50% load at all times —at least not with this app in our testing— but those on low-power devices and laptops will want to use apps like this cautiously. Use a [system monitoring tool][2] to keep an eye on CPU and GPU load. - -#### Quitting the app #### - -The biggest “bug” for me is the absolute lack of “quit” option. - -Sure, the animated wallpaper can be turned off from the Indicator Applet and the Preferences tool but quitting the app entirely, quitting the indicator applet? Nope. To do that I have to use the ‘pkill livewallpaper’ command in the Terminal. - -### How to Install Live Wallpaper in Ubuntu 14.04 LTS + ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/terminal-command-750x146.jpg) - -To install Live Wallpaper in Ubuntu 14.04 LTS and above you will first need to add the official PPA for the app to your Software Sources. - -The quickest way to do this is using the Terminal: - - sudo add-apt-repository ppa:fyrmir/livewallpaper-daily - - sudo apt-get update && sudo apt-get install livewallpaper - -You should also install the indicator applet, which lets you quickly and easily turn on/off the animated wallpaper and switch theme from the menu area, and the GUI settings tool so that you can configure each theme based on your tastes. - - sudo apt-get install livewallpaper-config livewallpaper-indicator - -When everything has installed you will be able to launch the app and its preferences tool from the Unity Dash. - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-app-launcher.png) - -Annoyingly, the Indicator Applet won’t automatically open after you install it. It does add itself to the start up list, so a quick log out > log in will get it to show. - -### Summary ### - -If you fancy breathing life into a dull desktop, give it a spin — and let us know what you think of it and what animated wallpapers you’d love to see added! - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds-to-linux-distros - -作者:[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]:http://www.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu -[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu diff --git a/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md new file mode 100644 index 0000000000..2d845ce804 --- /dev/null +++ b/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md @@ -0,0 +1,110 @@ +Translating by Love-xuan +动态壁纸给linux发行版添加活力背景 +================================================================================ +**我们知道你想拥有一个有格调的ubuntu桌面来炫耀一下 :)** + +![Live Wallpaper](http://i.imgur.com/9JIUw5p.gif) + +Live Wallpaper + +在linxu上费一点点劲搭建一个出色的工作环境是很简单的。 +今天,我们着重来探讨[重新着重探讨][2]长驻你脑海中那些东西 - 一款自由,开源,能够给你的截图增添光彩的工具。 + +它叫 **Live Wallpaper** (正如你猜的那样) ,它用由OpenGL驱动的一款动态桌面背景来代替标准的静态桌面背景。 + +最好的一点是:在ubuntu上安装它很容易。 + +### 动态壁纸主题 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/animated-wallpaper-ubuntu-750x383.jpg) + +Live Wallpaper 不是此类软件唯一的一款,但它是最好的一款之一。 + +它附带很多不同的开箱即用的主题。 + +从精细的(‘noise’)到狂热的 (‘nexus’),包罗万象,甚至有受到Ubuntu Phone欢迎屏幕启发的obligatory锁屏壁纸。 + +- Circles — 带着‘evolving circle’风格的时钟,灵感来自于Ubuntu Phone +- Galaxy — 支持自定义大小,位置的星系 +- Gradient Clock — 覆盖基本梯度的时钟 +- Nexus — 亮色粒子火花穿越屏幕 +- Noise — 类似于iOS动态壁纸的Bokeh设计 +- Photoslide — 由文件夹(默认为 ~/Photos)内照片构成的动态网格相册 + +Live Wallpaper **完全开源** ,所以没有什么能够阻挡天马行空的艺术家用提供的做法(当然还有耐心)来创造他们自己的精美主题。 + +### 设置 & 特点 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-gui-settings.jpg) + +虽然某些主题与其它主题相比有更多的选项,但每款主题都可以通过某些方式来配置或者定制。 + +例如, Nexus主题中 (上图所示) 你可以更改脉冲粒子的数量,颜色,大小和出现频率。 + +首选项提供了 **通用选项** 适用于所有主题,包括: + +- 设置登陆界面的动态壁纸 +- 自定义动画背景 +- 调节 FPS (包括在屏幕上显示FPS) +- 指定多显示器行为 + +有如此多的选项,diy适用于你自己的桌面背景是很容易的。 + +### 缺陷 ### + +#### 没有桌面图标 #### +Live Wallpaper在运行时,你无法在桌面添加,打开或者是编辑文件和文件夹。 + +首选项程序提供了一个选项来让你这样做(只是猜测)。也许是它只能在老版本中使用,在我们的测试中-测试环境为Ununtu 14.10,它并没有用。 +在测试中发现当把桌面壁纸设置成格式为png的图片文件时,这个选项有用,不需要是透明的png图片文件,只要是png图片文件就行了。 + +#### 资源占用 #### + +动态壁纸与标准的壁纸相比要消耗更多的系统资源。 + +我们并不是说任何时候都会消耗大量资源,但至少在我们的测试中是这样,所以低配置机器和笔记本用户要谨慎使用这款软件。可以使用 [系统监视器][2] 来追踪CPU 和GPU的负载。 + +#### 退出程序 #### + +对我来说最大的“bug”绝对是没有“退出”选项。 + +当然,Sure, 动态壁纸可以通过托盘图标和首选项完全退出,那退出托盘图标呢?没办法。只能在终端执行命令‘pkill livewallpaper’。 + +### 怎么在 Ubuntu 14.04 LTS +上安装 Live Wallpaper ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/terminal-command-750x146.jpg) + +要想在Ubuntu 14.04 LTS 和更高版本中安装 Live Wallpaper,你首先需要把官方PPA添加进你的软件源。 +最快的方法是在终端中执行下列命令: + + sudo add-apt-repository ppa:fyrmir/livewallpaper-daily + + sudo apt-get update && sudo apt-get install livewallpaper + +你还需要安装 indicator applet, 这样可以方便快速的打开或是关闭动态壁纸,从菜单选择主题,另外图形配置工具可以让你基于你自己的口味来配置每款主题。 + + sudo apt-get install livewallpaper-config livewallpaper-indicator + +所有都安装好之后你就可以通过Unity Dash来启动它和它的首选项工具了。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-app-launcher.png) + +让人不爽的是,安装完成后,程序不会自动打开托盘图标,而仅仅将它自己加入自动启动项,所以,快速来个注消 > 登陆它就会出现啦。 + +### 总结 ### + +如果你正处在无聊呆板的桌面中,幻想有一个更有活力的生活,不防试试。另外,告诉我们你想看到什么样的动态壁纸! + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds-to-linux-distros + +作者:[Joey-Elijah Sneddon][a] +译者:[Love-xuan](https://github.com/Love-xuan) +校对:[校对者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.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu +[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu From c0e50d3d75478b6b3eb6b4b3ed2e2d66ea456a2d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 11 Jul 2015 15:46:15 +0800 Subject: [PATCH 101/113] =?UTF-8?q?=E8=A1=A5=E5=85=85=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Love-xuan --- ...7 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{ => share}/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md (100%) diff --git a/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md similarity index 100% rename from translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md rename to translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md From 08ad730415a676749a5cd9dcc9b933c939f6e90c Mon Sep 17 00:00:00 2001 From: KS Date: Sun, 12 Jul 2015 12:54:48 +0800 Subject: [PATCH 102/113] Create 20150709 Why is the ibdata1 file continuously growing in MySQL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 --- ...ata1 file continuously growing in MySQL.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md new file mode 100644 index 0000000000..2632f3f173 --- /dev/null +++ b/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -0,0 +1,114 @@ +为什么mysql里的ibdata1文件不断的增长? +================================================================================ +![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) + +我们在[Percona支持][1]经常收到关于MySQL的ibdata1文件的这个问题。 + +当监控服务器发送一个关于MySQL服务器存储的报警恐慌就开始了 - 就是说磁盘快要满了。 + +一番调查后你意识到大多数地盘空间被InnDB的共享表空间ibdata1使用。你已经启用了[innodb_file_per_table][2],所以问题是: + +### ibdata1存了什么? ### + +当你启用了innodb_file_per_table,表被存储在他们自己的表空间里,但是共享表空间仍然在存储其他InnoDB的内部数据: + +- 数据字典也就是InnoDB表的元数据 +- 交换缓冲区 +- 双写缓冲区 +- 撤销日志 + +在[Percona服务器][3]上有一些是可以被配置来避免增长过大的。例如你可以通过[innodb_ibuf_max_size][4]设置最大交换缓冲区或设置[innodb_doublewrite_file][5]存储双写缓冲区到一个分离的文件。 + +MySQL 5.6版中你也可以创建额外的撤销表空间所以他们将会有他们自己的文件来替代存储到ibdata1。照着[文档链接][6]检查。 + +### 什么引起ibdata1增长迅速? ### + +当MySQL出现问题通常我们需要执行的第一个命令是: + + SHOW ENGINE INNODB STATUSG(这里我觉得应该是STATUS/G) + +这将展示给我们一些很有价值的信息。我们开始检查**事务**部分,然后我们会发现这个: + + ---TRANSACTION 36E, ACTIVE 1256288 sec + MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root + show engine innodb status + Trx read view will not see trx with id >= 36F, sees < 36F + +这是一个最常见的原因,一个14天前创建的相当老的老事务。这个状态是**活动的**,这意味着InnoDB已经创建了一个快照数据,所以需要在**撤销**日志中维护旧页面,以保障数据库的一致性视图,直到事务开始。如果你的数据库是写负载大,那就意味着大量的撤销页已经被存储了。 + +如果你找不到任何长时间运行的事务,你也可以监控INNODB状态中的其他的变量,“**历史记录列表长度**”展示了一些等待清除操作。这种情况下问题经常发生,因为清除线程(或者老版本的主线程)不能以这些记录进来的速度处理撤销。 + +### 我怎么检查什么被存储到了ibdata1里了? ### + +很不幸MySQL不提供什么被存储到ibdata1共享表空间的信息但是有两个工具将会很有帮助。第一个是马克·卡拉汉制作的一个修订版本的innochecksum并且发布在[这个漏洞报告][7]。 + +它相当易于使用: + + # ./innochecksum /var/lib/mysql/ibdata1 + 0 bad checksum + 13 FIL_PAGE_INDEX + 19272 FIL_PAGE_UNDO_LOG + 230 FIL_PAGE_INODE + 1 FIL_PAGE_IBUF_FREE_LIST + 892 FIL_PAGE_TYPE_ALLOCATED + 2 FIL_PAGE_IBUF_BITMAP + 195 FIL_PAGE_TYPE_SYS + 1 FIL_PAGE_TYPE_TRX_SYS + 1 FIL_PAGE_TYPE_FSP_HDR + 1 FIL_PAGE_TYPE_XDES + 0 FIL_PAGE_TYPE_BLOB + 0 FIL_PAGE_TYPE_ZBLOB + 0 other + 3 max index_id + +全部的20608中有19272个撤销日志页。**这是表空间的93%**。 + +第二个检查表空间内容的方式是杰里米科尔制作的[InnoDB Ruby工具][8]。它是个更先进的工具来检查InnoDB的内部结构。例如我们可以使用space-summary参数来得到每个页面及其数据类型的列表。我们可以使用标准的Unix工具**撤销日志**页的数量: + + # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l + 19272 + +尽管这种特殊的情况innochedcksum更快更容易使用,我推荐你使用杰里米的工具去学习更多的InnoDB内部数据分布和内部结构。 + +好,现在我们知道问题所在。下一个问题: + +### 我能怎么解决问题? ### + +这个问题的答案很简单。如果你还能提交语句,就做吧。如果不能你必须要杀掉进程开始回滚进程。那将停止ibdata1的增长但是很清楚你的软件有一个漏洞或者出了一些错误。现在你知道如何去鉴定问题所在,你需要使用你自己的调试工具或普通语句日志找出谁或者什么引起的问题。 + +如果问题发生在清除线程,解决方法通常是升级到新版本,新版中使用一个独立的清除线程替代主线程。更多信息查看[文档链接][9] + +### 有什么方法恢复已使用的空间么? ### + +没有,目前不可能有一个容易并且快速的方法。InnoDB表空间从不收缩...见[10年老漏洞报告][10]最新更新自詹姆斯(谢谢): + +当你删除一些行,这个页被标为已删除稍后重用,但是这个空间从不会被恢复。只有一种方式来启动数据库使用新的ibdata1。做这个你应该需要使用mysqldump做一个逻辑全备份。然后停止MySQL并删除所有数据库、ib_logfile*、ibdata1*文件。当你再启动MySQL的时候将会创建一个新的共享表空间。然后恢复逻辑仓库。 + +### 总结 ### + +当ibdata1文件增长太快,通常是MySQL里长时间运行的被遗忘的事务引起的。尝试去解决问题越快越好(提交或者杀死事务)因为没有痛苦缓慢的mysqldump执行你不能恢复浪费的磁盘空间。 + +监控数据库避免这些问题也是非常推荐的。我们的[MySQL监控插件][11]包括一个Nagios脚本,如果发现了一个太老的运行事务它可以提醒你。 + +-------------------------------------------------------------------------------- + +via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ + +作者:[Miguel Angel Nieto][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.percona.com/blog/author/miguelangelnieto/ +[1]:https://www.percona.com/products/mysql-support +[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table +[3]:https://www.percona.com/software/percona-server +[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size +[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file +[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace +[7]:http://bugs.mysql.com/bug.php?id=57611 +[8]:https://github.com/jeremycole/innodb_ruby +[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html +[10]:http://bugs.mysql.com/bug.php?id=1341 +[11]:https://www.percona.com/software/percona-monitoring-plugins From 3dd7d0b76a5efe87405fc5120b08cf08ba2f27eb Mon Sep 17 00:00:00 2001 From: KS Date: Sun, 12 Jul 2015 12:55:23 +0800 Subject: [PATCH 103/113] Delete 20150709 Why is the ibdata1 file continuously growing in MySQL.md --- ...ata1 file continuously growing in MySQL.md | 115 ------------------ 1 file changed, 115 deletions(-) delete mode 100644 sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md deleted file mode 100644 index 2fcf9353bb..0000000000 --- a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md +++ /dev/null @@ -1,115 +0,0 @@ -wyangsun 翻译中 -Why is the ibdata1 file continuously growing in MySQL? -================================================================================ -![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) - -We receive this question about the ibdata1 file in MySQL very often in [Percona Support][1]. - -The panic starts when the monitoring server sends an alert about the storage of the MySQL server – saying that the disk is about to get filled. - -After some research you realize that most of the disk space is used by the InnoDB’s shared tablespace ibdata1. You have [innodb_file_per_table][2] enabled, so the question is: - -### What is stored in ibdata1? ### - -When you have innodb_file_per_table enabled, the tables are stored in their own tablespace but the shared tablespace is still used to store other InnoDB’s internal data: - -- data dictionary aka metadata of InnoDB tables -- change buffer -- doublewrite buffer -- undo logs - -Some of them can be configured on [Percona Server][3] to avoid becoming too large. For example you can set a maximum size for change buffer with [innodb_ibuf_max_size][4] or store the doublewrite buffer on a separate file with [innodb_doublewrite_file][5]. - -In MySQL 5.6 you can also create external UNDO tablespaces so they will be in their own files instead of stored inside ibdata1. Check following [documentation link][6]. - -### What is causing the ibdata1 to grow that fast? ### - -Usually the first command that we need to run when there is a MySQL problem is: - - SHOW ENGINE INNODB STATUSG - -That will show us very valuable information. We start checking the **TRANSACTIONS** section and we find this: - - ---TRANSACTION 36E, ACTIVE 1256288 sec - MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root - show engine innodb status - Trx read view will not see trx with id >= 36F, sees < 36F - -This is the most common reason, a pretty old transaction created 14 days ago. The status is **ACTIVE**, that means InnoDB has created a snapshot of the data so it needs to maintain old pages in **undo** to be able to provide a consistent view of the database since that transaction was started. If your database is heavily write loaded that means lots of undo pages are being stored. - -If you don’t find any long-running transaction you can also monitor another variable from the INNODB STATUS, the “**History list length.**” It shows the number of pending purge operations. In this case the problem is usually caused because the purge thread (or master thread in older versions) is not capable to process undo records with the same speed as they come in. - -### How can I check what is being stored in the ibdata1? ### - -Unfortunately MySQL doesn’t provide information of what is being stored on that ibdata1 shared tablespace but there are two tools that will be very helpful. First a modified version of innochecksum made by Mark Callaghan and published in [this bug report][7]. - -It is pretty easy to use: - - # ./innochecksum /var/lib/mysql/ibdata1 - 0 bad checksum - 13 FIL_PAGE_INDEX - 19272 FIL_PAGE_UNDO_LOG - 230 FIL_PAGE_INODE - 1 FIL_PAGE_IBUF_FREE_LIST - 892 FIL_PAGE_TYPE_ALLOCATED - 2 FIL_PAGE_IBUF_BITMAP - 195 FIL_PAGE_TYPE_SYS - 1 FIL_PAGE_TYPE_TRX_SYS - 1 FIL_PAGE_TYPE_FSP_HDR - 1 FIL_PAGE_TYPE_XDES - 0 FIL_PAGE_TYPE_BLOB - 0 FIL_PAGE_TYPE_ZBLOB - 0 other - 3 max index_id - -It has 19272 UNDO_LOG pages from a total of 20608. **That’s the 93% of the tablespace**. - -The second way to check the content of a tablespace are the [InnoDB Ruby Tools][8] made by Jeremy Cole. It is a more advanced tool to examine the internals of InnoDB. For example we can use the space-summary parameter to get a list with every page and its data type. We can use standard Unix tools to get the number of **UNDO_LOG** pages: - - # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l - 19272 - -Altough in this particular case innochecksum is faster and easier to use I recommend you to play with Jeremy’s tools to learn more about the data distribution inside InnoDB and its internals. - -OK, now we know where the problem is. The next question: - -### How can I solve the problem? ### - -The answer to this question is easy. If you can still commit that query, do it. If not you’ll have to kill the thread to start the rollback process. That will just stop ibdata1 from growing but it is clear that your software has a bug or someone made a mistake. Now that you know how to identify where is the problem you need to find who or what is causing it using your own debugging tools or the general query log. - -If the problem is caused by the purge thread then the solution is usually to upgrade to a newer version where you can use a dedicated purge thread instead of the master thread. More information on the following [documentation link][9]. - -### Is there any way to recover the used space? ### - -No, it is not possible at least in an easy and fast way. InnoDB tablespaces never shrink… see the following [10-year old bug report][10] recently updated by James Day (thanks): - -When you delete some rows, the pages are marked as deleted to reuse later but the space is never recovered. The only way is to start the database with fresh ibdata1. To do that you would need to take a full logical backup with mysqldump. Then stop MySQL and remove all the databases, ib_logfile* and ibdata* files. When you start MySQL again it will create a new fresh shared tablespace. Then, recover the logical dump. - -### Summary ### - -When the ibdata1 file is growing too fast within MySQL it is usually caused by a long running transaction that we have forgotten about. Try to solve the problem as fast as possible (commiting or killing a transaction) because you won’t be able to recover the wasted disk space without the painfully slow mysqldump process. - -Monitoring the database to avoid these kind of problems is also very recommended. Our [MySQL Monitoring Plugins][11] includes a Nagios script that can alert you if it finds a too old running transaction. - --------------------------------------------------------------------------------- - -via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ - -作者:[Miguel Angel Nieto][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.percona.com/blog/author/miguelangelnieto/ -[1]:https://www.percona.com/products/mysql-support -[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table -[3]:https://www.percona.com/software/percona-server -[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size -[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file -[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace -[7]:http://bugs.mysql.com/bug.php?id=57611 -[8]:https://github.com/jeremycole/innodb_ruby -[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html -[10]:http://bugs.mysql.com/bug.php?id=1341 -[11]:https://www.percona.com/software/percona-monitoring-plugins From 46032c4da877dce0a15a83730f83a6a248159631 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 12 Jul 2015 15:50:07 +0800 Subject: [PATCH 104/113] [Translated]20150709 Install Google Hangouts Desktop Client In Linux.md --- ...Google Hangouts Desktop Client In Linux.md | 69 ------------------- ...Google Hangouts Desktop Client In Linux.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 69 deletions(-) delete mode 100644 sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md create mode 100644 translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md diff --git a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md deleted file mode 100644 index 426f0c0ffc..0000000000 --- a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md +++ /dev/null @@ -1,69 +0,0 @@ -FSSlc translating - -Install Google Hangouts Desktop Client In Linux -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) - -Earlier, we have seen how to [install Facebook Messenger in Linux][1] and [WhatsApp desktop client in Linux][2]. Both of these were unofficial apps. I have one more unofficial app for today and it is [Google Hangouts][3]. - -Of course, you can use Google Hangouts in the web browser but it is more fun to use the desktop client than the web browser one. Curious? Let’s see how to **install Google Hangouts desktop client in Linux** and how to use it. - -### Install Google Hangouts in Linux ### - -We are going to use an open source project called [yakyak][4] which is unofficial Google Hangouts client for Linux, Windows and OS X. I’ll show you how to use yakyak in Ubuntu but I believe that you can use the same method to use it in other Linux distributions. Before we see how to use it, let’s first take a look at main features of yakyak: - -- Send and receive chat messages -- Create and change conversations (rename, add people) -- Leave and/or delete conversation -- Desktop notifications -- Toggle notifications on/off -- Drag-drop, copy-paste or attach-button for image upload. -- Hangupsbot sync room aware (actual user pics) -- Shows inline images -- History scrollback - -Sounds good enough? Download the installation files from the link below: - -- [Download Google Hangout client yakyak][5] - -The downloaded file would be compressed. Extract it and you will see a directory like linux-x64 or linux-x32 based on your system. Go in to this directory and you should see a file named yakyak. Double click on it to run it. - -![Run Google Hangout in Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_3.jpeg) - -You’ll have to enter your Google Account credentials of course. - -![Set up Google Hangouts in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_2.jpeg) - -Once you are through, you’ll see a screen like the one below where you can chat with your Google contacts. - -![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) - -If you want to show profile pictures of the contacts, you can select View->Show conversation thumbnails. - -![Google hangouts thumbnails](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) - -You’ll also get desktop notification for new messages. - -![desktop notifications for Google Hangouts in Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_1.jpeg) - -### Worth a try? ### - -I let you give it a try and decide whether or not it is worth to **install Google Hangouts client in Linux**. If you want official apps, take a look at these [instant messaging applications with native Linux clients][6]. Don’t forget to share your experience with Google Hangouts in Linux. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-google-hangouts-linux/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://itsfoss.com/facebook-messenger-linux/ -[2]:http://itsfoss.com/whatsapp-linux-desktop/ -[3]:http://www.google.com/+/learnmore/hangouts/ -[4]:https://github.com/yakyak/yakyak -[5]:https://github.com/yakyak/yakyak -[6]:http://itsfoss.com/best-messaging-apps-linux/ diff --git a/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md new file mode 100644 index 0000000000..e8257cbedf --- /dev/null +++ b/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -0,0 +1,67 @@ +在 Linux 中安装 Google 环聊桌面客户端 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) + +先前,我们已经介绍了如何[在 Linux 中安装 Facebook Messenger][1] 和[WhatsApp 桌面客户端][2]。这些应用都是非官方的应用。今天,我将为你推荐另一款非官方的应用,它就是 [Google 环聊][3] + +当然,你可以在 Web 浏览器中使用 Google 环聊,但相比于此,使用桌面客户端会更加有趣。好奇吗?那就跟着我看看如何 **在 Linux 中安装 Google 环聊** 以及如何使用它把。 + +### 在 Linux 中安装 Google 环聊 ### + +我们将使用一个名为 [yakyak][4] 的开源项目,它是一个针对 Linux,Windows 和 OS X 平台的非官方 Google 环聊客户端。我将向你展示如何在 Ubuntu 中使用 yakyak,但我相信在其他的 Linux 发行版本中,你可以使用同样的方法来使用它。在了解如何使用它之前,让我们先看看 yakyak 的主要特点: + +- 发送和接受聊天信息 +- 创建和更改对话 (重命名, 添加人物) +- 离开或删除对话 +- 桌面提醒通知 +- 打开或关闭通知 +- 针对图片上传,支持拖放,复制粘贴或使用上传按钮 +- Hangupsbot 房间同步(实际的用户图片) (注: 这里翻译不到位,希望改善一下) +- 展示行内图片 +- 历史回放 + +听起来不错吧,你可以从下面的链接下载到该软件的安装文件: + +- [下载 Google 环聊客户端 yakyak][5] + +下载的文件是压缩的。解压后,你将看到一个名称类似于 linux-x64 或 linux-x32 的目录,其名称取决于你的系统。进入这个目录,你应该可以看到一个名为 yakyak 的文件。双击这个文件来启动它。 + +![在 Linux 中运行 Run Google 环聊](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_3.jpeg) + +当然,你需要键入你的 Google 账号来认证。 + +![在 Ubuntu 中设置 Google 环聊](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_2.jpeg) + +一旦你通过认证后,你将看到如下的画面,在这里你可以和你的 Google 联系人进行聊天。 + +![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) + +假如你想看看对话的配置图,你可以选择 `查看-> 展示对话缩略图` + +![Google 环聊缩略图](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) + +当有新的信息时,你将得到桌面提醒。 + +![在 Ubuntu 中 Google 环聊的桌面提醒](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_1.jpeg) + +### 值得一试吗? ### + +我让你尝试一下,并决定 **在 Linux 中安装 Google 环聊客户端** 是否值得。若你想要官方的应用,你可以看看这些 [拥有原生 Linux 客户端的即时消息应用程序][6]。不要忘记分享你在 Linux 中使用 Google 环聊的体验。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-google-hangouts-linux/ + +作者:[Abhishek][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/facebook-messenger-linux/ +[2]:http://itsfoss.com/whatsapp-linux-desktop/ +[3]:http://www.google.com/+/learnmore/hangouts/ +[4]:https://github.com/yakyak/yakyak +[5]:https://github.com/yakyak/yakyak +[6]:http://itsfoss.com/best-messaging-apps-linux/ From 963fac2322cc5cee4b63c6c9aae96bac4510215c Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 12 Jul 2015 15:55:59 +0800 Subject: [PATCH 105/113] Update 20150629 Backup with these DeDuplicating Encryption Tools.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- ...150629 Backup with these DeDuplicating Encryption Tools.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md index c6fe06832a..ba4777996b 100644 --- a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md +++ b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md @@ -1,3 +1,5 @@ +FSSlc Translating + 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. @@ -155,4 +157,4 @@ via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html [3]:http://obnam.org/ [4]:http://duplicity.nongnu.org/ [5]:http://zbackup.org/ -[6]:https://bup.github.io/ \ No newline at end of file +[6]:https://bup.github.io/ From 4a44cd8c1d710de0e0a4089d7f7da7a786710868 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 12 Jul 2015 22:52:58 +0800 Subject: [PATCH 106/113] PUB:20150527 How to Develop Own Custom Linux Distribution From Scratch @wwy-hust --- ... Custom Linux Distribution From Scratch.md | 93 +++++++++++++++++++ ... Custom Linux Distribution From Scratch.md | 65 ------------- 2 files changed, 93 insertions(+), 65 deletions(-) create mode 100644 published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md delete mode 100644 translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md diff --git a/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md new file mode 100644 index 0000000000..3bf454a476 --- /dev/null +++ b/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md @@ -0,0 +1,93 @@ +LFS中文版手册发布:如何打造自己的 Linux 发行版 +================================================================================ +您是否想过打造您自己的 Linux 发行版?每个 Linux 用户在他们使用 Linux 的过程中都想过做一个他们自己的发行版,至少一次。我也不例外,作为一个 Linux 菜鸟,我也考虑过开发一个自己的 Linux 发行版。从头开发一个 Linux 发行版这件事情被称作 Linux From Scratch (LFS)。 + +在开始之前,我总结了一些有关 LFS 的内容,如下: + +**1. 那些想要打造他们自己的 Linux 发行版的人应该了解打造一个 Linux 发行版(打造意味着从头开始)与配置一个已有的 Linux 发行版的不同** + +如果您只是想调整下启动屏幕、定制登录页面以及拥有更好的外观和使用体验。您可以选择任何一个 Linux 发行版并且按照您的喜好进行个性化配置。此外,有许多配置工具可以帮助您。 + +如果您想打包所有必须的文件、引导加载器和内核,并选择什么该被包括进来,然后依靠自己编译这一切东西。那么您需要的就是 Linux From Scratch (LFS)。 + +**注意**:如果您只想要定制 Linux 系统的外表和体验,这个指南并不适合您。但如果您真的想打造一个 Linux 发行版,并且向了解怎么开始以及一些其他的信息,那么这个指南正是为您而写。 + +**2. 打造一个 Linux 发行版(LFS)的好处** + +- 您将了解 Linux 系统的内部工作机制 +- 您将开发一个灵活的适应您需求的系统 +- 您开发的系统(LFS)将会非常紧凑,因为您对该包含/不该包含什么拥有绝对的掌控 +- 您开发的系统(LFS)在安全性上会更好 + +**3. 打造一个Linux发行版(LFS)的坏处** + +打造一个 Linux 系统意味着将所有需要的东西放在一起并且编译之。这需要许多查阅、耐心和时间。而且您需要一个可用的 Linux 系统和足够的磁盘空间来打造 LFS。 + +**4. 有趣的是,Gentoo/GNU Linux 在某种意义上最接近于 LFS。Gentoo 和 LFS 都是完全从源码编译的定制的 Linux 系统** + +**5. 您应该是一个有经验的Linux用户,对编译包、解决依赖有相当的了解,并且是个 shell 脚本的专家。** + +了解一门编程语言(最好是 C 语言)将会使事情变得容易些。但哪怕您是一个新手,只要您是一个优秀的学习者,可以很快的掌握知识,您也可以开始。最重要的是不要在 LFS 过程中丢失您的热情。 + +如果您不够坚定,恐怕会在 LFS 进行到一半时放弃。 + +**6. 现在您需要一步一步的指导来打造一个 Linux 。LFS 手册是打造 LFS 的官方指南。我们的合作站点 tradepub 也为我们的读者制作了 LFS 的指南,这同样是免费的。 ### + +您可以从下面的链接下载 Linux From Scratch 的电子书: + +[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] + +下载: [Linux From Scratch][1] + +**7. 当前 LFS 的版本是 7.7,分为 systemd 版本和非 systemd 版本** + +LFS 的官方网站是: http://www.linuxfromscratch.org/ + +您可以在官网在线浏览 LFS 以及类似 BLFS 这样的相关项目的手册,也可以下载不同格式的版本。 + +- LFS (非 systemd 版本): + - PDF 版本: http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-7.7.pdf + - 单一 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-7.7-NOCHUNKS.html + - 打包的多页 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-7.7.tar.bz2 +- LFS (systemd 版本): + - PDF 版本: http://www.linuxfromscratch.org/lfs/downloads/7.7-systemd/LFS-BOOK-7.7-systemd.pdf + - 单一 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/7.7-systemd/LFS-BOOK-7.7-systemd-NOCHUNKS.html + - 打包的多页 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/7.7-systemd/LFS-BOOK-7.7-systemd.tar.bz2 + +**8. Linux 中国/LCTT 翻译了一份 LFS 手册(7.7,systemd 版本)** + +经过 LCTT 成员的努力,我们终于完成了对 LFS 7.7 systemd 版本手册的翻译。 + +手册在线访问地址:https://linux.cn/lfs/LFS-BOOK-7.7-systemd/index.html 。 + +其它格式的版本稍后推出。 + +感谢参与翻译的成员: wxy, ictlyh, dongfengweixiao, zpl1025, H-mudcup, Yuking-net, kevinSJ 。 + + +### 关于:Linux From Scratch ### + +这本手册是由 LFS 的项目领头人 Gerard Beekmans 创作的, Matthew Burgess 和 Bruse Dubbs 参与编辑,两人都是LFS 项目的联合领导人。这本书内容很广泛,有 338 页之多。 + +手册中内容包括:介绍 LFS、准备构建、构建 LFS、建立启动脚本、使 LFS 可以引导,以及附录。其中涵盖了您想知道的 LFS 项目中的所有东西。 + +这本手册还给出了编译一个包的预估时间。预估的时间以编译第一个包的时间作为参考。所有的东西都以易于理解的方式呈现,甚至对于新手来说也是这样。 + +如果您有充裕的时间并且真正对构建自己的 Linux 发行版感兴趣,那么您绝对不会错过下载这个电子书(免费下载)的机会。您需要做的,便是照着这本手册在一个工作的 Linux 系统(任何 Linux 发行版,足够的磁盘空间即可)中开始构建您自己的 Linux 系统,付出时间和热情。 + +如果 Linux 使您着迷,如果您想自己动手构建一个自己的 Linux 发行版,这便是现阶段您应该知道的全部了,其他的信息您可以参考上面链接的手册中的内容。 + +请让我了解您阅读/使用这本手册的经历,这本详尽的 LFS 指南的使用是否足够简单?如果您已经构建了一个 LFS 并且想给我们的读者一些建议,欢迎留言和反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ + +作者:[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://tecmint.tradepub.com/free/w_linu01/prgm.cgi diff --git a/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md deleted file mode 100644 index 059f07b195..0000000000 --- a/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md +++ /dev/null @@ -1,65 +0,0 @@ -δԼLinuxа -================================================================================ -ǷԼLinuxа棿ÿLinuxûʹLinuxĹжһԼķа棬һΡҲ⣬ΪһLinuxҲǹһԼLinuxа档һLinuxа汻Linux From Scratch (LFS) - -ڿʼ֮ǰܽһЩLFSݣ£ - -### 1. ЩҪԼLinuxаӦ˽һLinuxа棨ζŴͷʼһеLinuxаIJͬ ### - -ֻĻʾƵ¼Լӵиõʹ顣ѡκһLinuxа沢ҰϲýиԻá⣬ù߿԰ - -бļboot-loadersںˣѡʲôñȻԼһжôҪLinux From Scratch (LFS) - -**ע**ֻҪLinuxϵͳ飬ָϲʺһLinuxа棬˽ôʼԼһЩϢôָΪд - -### 2. һLinuxа棨LFSĺô ### - -- ˽Linuxϵͳڲ -- һӦϵͳ -- ϵͳLFSdzգΪԸð/ðʲôӵоԵƿ -- ϵͳLFSڰȫϻ - -### 3. һLinuxа棨LFSĻ ### - -һLinuxϵͳζŽҪĶһұ֮Ҫġĺʱ䡣ҪһõLinuxϵͳ㹻Ĵ̿ռLinuxϵͳ - -### 4. ȤǣGentoo/GNU LinuxijӽLFSGentooLFSȫԴĶƵLinuxϵͳ ### - -### 5. ӦһоLinuxûԱ൱˽⣬Ǹshellűרҡ˽һűԣCãʹЩһֻ֣ҪһѧϰߣԺ֪ܿʶҲԿʼҪDzҪLFSжʧ顣 ### - -ᶨ»LFSеһʱ - -### 6. ҪһһָһLinuxLFSǴLinuxĹٷָϡǵĴվtradepubҲΪǵĶLFSָϣͬѵġ ### - -ԴLinux From Scratch鼮 - -[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] - -: [Linux From Scratch][1] - -### ڣLinux From Scratch ### - -ⱾLFSĿͷGerard BeekmansģMatthew BurgessBruse Dubbs༭˶LFSĿ쵼ˡⱾݺܹ㷺338ҳ - -ݰLFS׼LinuxLFSűʹLFS͸¼к֪LFSĿж - -Ȿ黹˱һԤʱ䡣ԤʱԱһʱΪοеĶķʽ֣˵ - -гԣʱ䲢ԹԼLinuxаȤôԲ飨أĻᡣҪģⱾһLinuxϵͳκLinuxа棬㹻Ĵ̿ռ伴ɣпʼԼLinuxϵͳʱ顣 - -LinuxʹԣԼֹһԼLinuxа棬ֽ׶Ӧ֪ȫˣϢԲοӵеݡ - -˽Ķ/ʹⱾľⱾ꾡LFSָϵʹǷ㹻򵥣ѾһLFSǵĶһЩ飬ӭԺͷ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ - -ߣ[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://tecmint.tradepub.com/free/w_linu01/prgm.cgi From bc16956f1b457536f4ff6093de902a02ba88d59e Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 12 Jul 2015 23:39:07 +0800 Subject: [PATCH 107/113] PUB:20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal @FSSlc --- ...put Rainbow Of Colors in Linux Terminal.md | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) rename {translated/tech => published}/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md (75%) diff --git a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md similarity index 75% rename from translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md rename to published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md index 4ce0ef80d0..b454f6f5aa 100644 --- a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md +++ b/published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -1,26 +1,26 @@ -Lolcat – 一个在 Linux 终端中输出彩虹特效的命令行工具 +Lolcat :一个在 Linux 终端中输出彩虹特效的命令行工具 ================================================================================ 那些相信 Linux 命令行是单调无聊且没有任何乐趣的人们,你们错了,这里有一些有关 Linux 的文章,它们展示着 Linux 是如何的有趣和“淘气” 。 -- [20 个有趣的 Linux 命令或在终端中 Linux 是有趣的][1] -- [6 个有趣的好玩 Linux 命令(在终端中的乐趣)][2] -- [在 Linux 终端中的乐趣 – 把玩文字和字符计数][3] +- [Linux命令及Linux终端的20个趣事][1] +- [终端中的乐趣:6个有趣的Linux命令行工具][2] +- [Linux终端的乐趣之把玩字词计数][3] -在本文中,我将讨论一个名为“lolcat”的应用 – 它在终端中生成彩虹般的颜色。 +在本文中,我将讨论一个名为“lolcat”的小工具 – 它可以在终端中生成彩虹般的颜色。 ![为终端生成彩虹般颜色的输出的 Lolcat 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) -为终端生成彩虹般颜色的输出的 Lolcat 命令 +*为终端生成彩虹般颜色的输出的 Lolcat 命令* #### 何为 lolcat ? #### -Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 原本用于在 Linux 终端中为文本添加彩虹般的色彩。 +Lolcat 是一个针对 Linux,BSD 和 OSX 平台的工具,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 主要用于在 Linux 终端中为文本添加彩虹般的色彩。 ### 在 Linux 中安装 Lolcat ### -**1. Lolcat 应用在许多 Linux 发行版本的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** +**1. Lolcat 工具在许多 Linux 发行版的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** -由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中安装有最新版本的 RUBY 是必须的。 +由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中必须安装有最新版本的 RUBY。 # apt-get install ruby [在基于 APT 的系统中] # yum install ruby [在基于 Yum 的系统中] @@ -53,7 +53,7 @@ Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat ![Lolcat 的帮助文档](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) -Lolcat 的帮助文档 +*Lolcat 的帮助文档* **4. 接着, 通过管道连接 lolcat 和其他命令,例如 ps, date 和 cal:** @@ -63,15 +63,15 @@ Lolcat 的帮助文档 ![ps 命令的输出](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) -ps 命令的输出 +*ps 命令的输出* ![Date 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) -Date 的输出 +*Date 的输出* ![Calendar 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) -Calendar 的输出 +*Calendar 的输出* **5. 使用 lolcat 来展示一个脚本文件的代码:** @@ -79,18 +79,18 @@ Calendar 的输出 ![用 lolcat 来展示代码](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) -用 lolcat 来展示代码 +*用 lolcat 来展示代码* -**6. 通过管道连接 lolcat 和 figlet 命令。Figlet 是一个展示由常规的屏幕字符组成的巨大字符串的应用。我们可以通过管道将 figlet 的输出连接到 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 来得到这个软件包: +**注**: 注意, ❤ 是一个 unicode 字符。要安装 figlet,你需要像下面那样使用 yum 和 apt 来得到这个软件包: # apt-get figlet # yum install figlet @@ -102,7 +102,7 @@ Calendar 的输出 ![动的文本](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) -动的文本 +*动的文本* 这里选项 `-a` 指的是 Animation(动画), `-d` 指的是 duration(持续时间)。在上面的例子中,持续 500 次动画。 @@ -112,7 +112,7 @@ Calendar 的输出 ![多彩地显示文件](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) -多彩地显示文件 +*多彩地显示文件* **9. 通过管道连接 lolcat 和 cowsay。cowsay 是一个可配置的正在思考或说话的奶牛,这个程序也支持其他的动物。** @@ -136,15 +136,15 @@ Calendar 的输出 skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey turtle tux unipony unipony-smaller vader vader-koala www -通过管道连接 lolcat 和 cowsay 后的输出,并且使用了‘gnu’cowfile。 +通过管道连接 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 的 Cowsay* -**注**: 你可以在管道中使用 lolcat 和其他任何命令来在终端中得到彩色的输出。 +**注**: 你可以在将 lolcat 和其他任何命令用管道连接起来在终端中得到彩色的输出。 **10. 你可以为最常用的命令创建别名来使得命令的输出呈现出彩虹般的色彩。你可以像下面那样为 ‘ls -l‘ 命令创建别名,这个命令输出一个目录中包含内容的列表。** @@ -153,23 +153,24 @@ Calendar 的输出 ![多彩的 Alias 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) -多彩的 Alias 命令 +*多彩的 Alias 命令* -你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你必须添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并确保登出后再重新登录来使得更改生效。 +你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你需要添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并登出后再重新登录来使得更改生效。 + +现在就是这些了。我想知道你是否曾经注意过 lolcat 这个工具?你是否喜欢这篇文章?欢迎在下面的评论环节中给出你的建议和反馈。喜欢并分享我们,帮助我们传播。 -现在就是这些了。我想知道你是否曾经注意过 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) +校对:[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-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/ +[1]:https://linux.cn/article-2831-1.html +[2]:https://linux.cn/article-4128-1.html +[3]:https://linux.cn/article-4088-1.html [4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file From d62fdff6ff274628ff1d41aba3674a11a8dcfa37 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 13 Jul 2015 18:47:51 +0800 Subject: [PATCH 108/113] =?UTF-8?q?20150713-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rogram Problem Detected In Ubuntu 14.04.md | 82 +++++++++++ .../20150713 How to manage Vim plugins.md | 139 ++++++++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md create mode 100644 sources/tech/20150713 How to manage Vim plugins.md diff --git a/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md b/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md new file mode 100644 index 0000000000..4a91a6aeb3 --- /dev/null +++ b/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md @@ -0,0 +1,82 @@ +How To Fix System Program Problem Detected In Ubuntu 14.04 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg) + +For the last couple of weeks, (almost) every time I was greeted with **system program problem detected on startup in Ubuntu 15.04**. I ignored it for sometime but it was quite annoying after a certain point. You won’t be too happy as well if you are greeted by a pop-up displaying this every time you boot in to the system: + +> System program problem detected +> +> Do you want to report the problem now? +> +> ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_Program_Problem_Detected.png) + +I know if you are an Ubuntu user you might have faced this annoying pop-up sometimes for sure. In this post we are going to see what to do with “system program problem detected” report in Ubuntu 14.04 and 15.04. + +### What to do with “system program problem detected” error in Ubuntu? ### + +#### So what exactly is this notifier all about? #### + +Basically, this notifies you of a crash in your system. Don’t panic by the word ‘crash’. It’s not a major issue and your system is very much usable. It just that some program crashed some time in the past and Ubuntu wants you to decide whether or not you want to report this crash report to developers so that they could fix this issue. + +#### So, we click on Report problem and it will vanish? #### + +No, not really. Even if you click on report problem, you’ll be ultimately greeted with a pop up like this: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png) + +[Sorry, Ubuntu has experienced an internal error][1] is the apport that will further open a web browser and then you can file a bug report by logging or creating an account with [Launchpad][2]. You see, it is a complicated procedure which will take around four steps to complete. + +#### But, I want to help developers and let them know of the bugs! #### + +That’s very thoughtful of you and the right thing to do. But there are two issues here. First, there are high chances that the bug would have already been reported. Second, even if you take the pain of reporting the crash, it’s not a guarantee that you won’t see it again. + +#### So, you suggesting to not report the crash? #### + +Yes and no. Report the crash when you see it the first time, if you want. You can see the crashing program under “Show Details” in the above picture. But if you see it repetitively or if you do not want to report the bug, I advise you to get rid of the system crash once and for all. + +### Fix “system program problem detected” error in Ubuntu ### + +The crash reports are stored in /var/crash directory in Ubuntu. If you look in to this directory, you should see some files ending with crash. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg) + +What I suggest is that you delete these crash reports. Open a terminal and use the following command: + + sudo rm /var/crash/* + +This will delete all the content of directory /var/crash. This way you won’t be annoyed by the pop up for the programs crash that happened in the past. But if a programs crashes again, you’ll again see system program problem detected error. You can either remove the crash reports again, like we just did, or you can disable the Apport (debug tool) and permanently get rid of the pop-ups. + +#### Permanently get rid of system error pop up in Ubuntu #### + +If you do this, you’ll never be notified about any program crash that happens in the system. If you ask my view, I would say it’s not that bad a thing unless you are willing to file bug reports. If you have no intention of filing a bug report, the crash notifications and their absence will make no difference. + +To disable the Apport and get rid of system crash report completely, open a terminal and use the following command to edit the Apport settings file: + + gksu gedit /etc/default/apport + +The content of the file is: + + # set this to 0 to disable apport, or to 1 to enable it + # you can temporarily override this with + # sudo service apport start force_start=1 + enabled=1 + +Change the **enabled=1** to **enabled=0**. Save and close the file. You won’t see any pop up for crash reports after doing this. Obvious to point out that if you want to enable the crash reports again, you just need to change the same file and put enabled as 1 again. + +#### Did it work for you? #### + +I hope this tutorial helped you to fix system program problem detected in Ubuntu 14.04 and Ubuntu 15.04. Let me know if this tip helped you to get rid of this annoyance. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/ +[2]:https://launchpad.net/ \ No newline at end of file diff --git a/sources/tech/20150713 How to manage Vim plugins.md b/sources/tech/20150713 How to manage Vim plugins.md new file mode 100644 index 0000000000..7462414916 --- /dev/null +++ b/sources/tech/20150713 How to manage Vim plugins.md @@ -0,0 +1,139 @@ +How to manage Vim plugins +================================================================================ +Vim is a versatile, lightweight text editor on Linux. While its initial learning curve can be overwhelming for an average Linux user, its benefits are completely worthy. As far as the functionality goes, Vim is fully customizable by means of plugins. Due to its high level of configuration, though, you need to spend some time with its plugin system to be able to personalize Vim in an effective way. Luckily, we have several tools that make our life with Vim plugins easier. The one I use on a daily basis is Vundle. + +### What is Vundle? ### + +[Vundle][1], which stands for Vim Bundle, is a Vim plugin manager. Vundle allows you to install, update, search and clean up Vim plugins very easily. It can also manage your runtime and help with tags. In this tutorial, I am going to show how to install and use Vundle. + +### Installing Vundle ### + +First, [install Git][2] if you don't have it on your Linux system. + +Next, create a directory where Vim plugins will be downloaded and installed. By default, this directory is located at ~/.vim/bundle + + $ mkdir -p ~/.vim/bundle + +Now go ahead and install Vundle as follows. Note that Vundle itself is another Vim plugin. Thus we install Vundle under ~/.vim/bundle we created earlier. + + $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +### Configuring Vundle ### + +Now set up you .vimrc file as follows: + + set nocompatible " This is required + filetype off " This is required + + " Here you set up the runtime path + set rtp+=~/.vim/bundle/Vundle.vim + + " Initialize vundle + call vundle#begin() + + " This should always be the first + Plugin 'gmarik/Vundle.vim' + + " This examples are from https://github.com/gmarik/Vundle.vim README + Plugin 'tpope/vim-fugitive' + + " Plugin from http://vim-scripts.org/vim/scripts.html + Plugin 'L9' + + "Git plugin not hosted on GitHub + Plugin 'git://git.wincent.com/command-t.git' + + "git repos on your local machine (i.e. when working on your own plugin) + Plugin 'file:///home/gmarik/path/to/plugin' + + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + + " Avoid a name conflict with L9 + Plugin 'user/L9', {'name': 'newL9'} + + "Every Plugin should be before this line + + call vundle#end() " required + +Let me explain the above configuration a bit. By default, Vundle downloads and installs Vim plugins from github.com or vim-scripts.org. You can modify the default behavior. + +To install from Github: + + Plugin 'user/plugin' + +To install from http://vim-scripts.org/vim/scripts.html: + + Plugin 'plugin_name' + +To install from another git repo: + + Plugin 'git://git.another_repo.com/plugin' + +To install from a local file: + + Plugin 'file:///home/user/path/to/plugin' + +Also you can customize others such as the runtime path of you plugins, which is really useful if you are programming a plugin yourself, or just want to load it from another directory that is not ~/.vim. + + Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'} + +If you have plugins with the same names, you can rename you plugin so that it doesn't conflict. + + Plugin 'user/plugin', {'name': 'newPlugin'} + +### Using Vum Commands ### + +Once you have set up you plugins with Vundle, you can use it to to install, update, search and clean unused plugins using several Vundle commands. + +#### Installing a new plugin #### + +The PluginInstall command will install all plugins listed in your .vimrc file. You can also install just one specific plugin by passing its name. + + :PluginInstall + :PluginInstall + +![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) + +#### Cleaning up an unused plugin #### + +If you have any unused plugin, you can remove it by using the PluginClean command. + + :PluginClean + +![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) + +#### Searching for a plugin #### + +If you want to install a plugin from a plugin list provided, search functionality can be useful. + +:PluginSearch + +![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg) + +While searching, you can install, clean, research or reload the same list on the interactive split. Installing plugins won't load your plugins automatically. To do so, add them to you .vimrc file. + +### Conclusion ### + +Vim is an amazing tool. It can not only be a great default text editor that can make your work flow faster and smoother, but also be turned into an IDE for almost any programming language available. Vundle can be a big help in personalizing the powerful Vim environment quickly and easily. + +Note that there are several sites that allow you to find the right Vim plugins for you. Always check [http://www.vim-scripts.org][3], Github or [http://www.vimawesome.com][4] for new scripts or plugins. Also remember to use the help provider for you plugin. + +Keep rocking with your favorite text editor! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/manage-vim-plugins.html + +作者:[Christopher Valerio][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/valerio +[1]:https://github.com/VundleVim/Vundle.vim +[2]:http://ask.xmodulo.com/install-git-linux.html +[3]:http://www.vim-scripts.org/ +[4]:http://www.vimawesome.com/ \ No newline at end of file From 55a111bdbafb63f6577d8339c3bcec8b8ea59910 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 14 Jul 2015 10:39:43 +0800 Subject: [PATCH 109/113] =?UTF-8?q?20150714-1=20=E9=80=89=E9=A2=98=20RAID?= =?UTF-8?q?=20=E4=B8=93=E9=A2=98=20struggling=20=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... RAID, Concepts of RAID and RAID Levels.md | 143 ++++++++ ...wo Devices' Using 'mdadm' Tool in Linux.md | 218 ++++++++++++ ... (Mirroring) using 'Two Disks' in Linux.md | 212 ++++++++++++ ...iping with Distributed Parity) in Linux.md | 285 ++++++++++++++++ ...ith Double Distributed Parity) in Linux.md | 320 ++++++++++++++++++ ...ing Up RAID 10 or 1+0 (Nested) in Linux.md | 275 +++++++++++++++ ...Array and Removing Failed Disks in Raid.md | 179 ++++++++++ 7 files changed, 1632 insertions(+) create mode 100644 sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md create mode 100644 sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md create mode 100644 sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md create mode 100644 sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md create mode 100644 sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md create mode 100644 sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md create mode 100644 sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md diff --git a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md new file mode 100644 index 0000000000..6d902f7576 --- /dev/null +++ b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md @@ -0,0 +1,143 @@ +Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 +================================================================================ +RAID is a Redundant Array of Inexpensive disks, but nowadays it is called Redundant Array of Independent drives. Earlier it is used to be very costly to buy even a smaller size of disk, but nowadays we can buy a large size of disk with the same amount like before. Raid is just a collection of disks in a pool to become a logical volume. + +![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) + +Understanding RAID Setups in Linux + +Raid contains groups or sets or Arrays. A combine of drivers make a group of disks to form a RAID Array or RAID set. It can be a minimum of 2 number of disk connected to a raid controller and make a logical volume or more drives can be in a group. Only one Raid level can be applied in a group of disks. Raid are used when we need excellent performance. According to our selected raid level, performance will differ. Saving our data by fault tolerance & high availability. + +This series will be titled Preparation for the setting up RAID ‘s through Parts 1-9 and covers the following topics. + +- Part 1: Introduction to RAID, Concepts of RAID and RAID Levels +- Part 2: How to setup RAID0 (Stripe) in Linux +- Part 3: How to setup RAID1 (Mirror) in Linux +- Part 4: How to setup RAID5 (Striping with Distributed Parity) in Linux +- Part 5: How to setup RAID6 (Striping with Double Distributed Parity) in Linux +- Part 6: Setting Up RAID 10 or 1+0 (Nested) in Linux +- Part 7: Growing an Existing RAID Array and Removing Failed Disks in Raid +- Part 8: Recovering (Rebuilding) failed drives in RAID +- Part 9: Managing RAID in Linux + +This is the Part 1 of a 9-tutorial series, here we will cover the introduction of RAID, Concepts of RAID and RAID Levels that are required for the setting up RAID in Linux. + +### Software RAID and Hardware RAID ### + +Software RAID have low performance, because of consuming resource from hosts. Raid software need to load for read data from software raid volumes. Before loading raid software, OS need to get boot to load the raid software. No need of Physical hardware in software raids. Zero cost investment. + +Hardware RAID have high performance. They are dedicated RAID Controller which is Physically built using PCI express cards. It won’t use the host resource. They have NVRAM for cache to read and write. Stores cache while rebuild even if there is power-failure, it will store the cache using battery power backups. Very costly investments needed for a large scale. + +Hardware RAID Card will look like below: + +![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) + +Hardware RAID + +#### Featured Concepts of RAID #### + +- Parity method in raid regenerate the lost content from parity saved information’s. RAID 5, RAID 6 Based on Parity. +- Stripe is sharing data randomly to multiple disk. This won’t have full data in a single disk. If we use 3 disks half of our data will be in each disks. +- Mirroring is used in RAID 1 and RAID 10. Mirroring is making a copy of same data. In RAID 1 it will save the same content to the other disk too. +- Hot spare is just a spare drive in our server which can automatically replace the failed drives. If any one of the drive failed in our array this hot spare drive will be used and rebuild automatically. +- Chunks are just a size of data which can be minimum from 4KB and more. By defining chunk size we can increase the I/O performance. + +RAID’s are in various Levels. Here we will see only the RAID Levels which is used mostly in real environment. + +- RAID0 = Striping +- RAID1 = Mirroring +- RAID5 = Single Disk Distributed Parity +- RAID6 = Double Disk Distributed Parity +- RAID10 = Combine of Mirror & Stripe. (Nested RAID) + +RAID are managed using mdadm package in most of the Linux distributions. Let us get a Brief look into each RAID Levels. + +#### RAID 0 (or) Striping #### + +Striping have a excellent performance. In Raid 0 (Striping) the data will be written to disk using shared method. Half of the content will be in one disk and another half will be written to other disk. + +Let us assume we have 2 Disk drives, for example, if we write data “TECMINT” to logical volume it will be saved as ‘T‘ will be saved in first disk and ‘E‘ will be saved in Second disk and ‘C‘ will be saved in First disk and again ‘M‘ will be saved in Second disk and it continues in round-robin process. + +In this situation if any one of the drive fails we will loose our data, because with half of data from one of the disk can’t use to rebuilt the raid. But while comparing to Write Speed and performance RAID 0 is Excellent. We need at least minimum 2 disks to create a RAID 0 (Striping). If you need your valuable data don’t use this RAID LEVEL. + +- High Performance. +- There is Zero Capacity Loss in RAID 0 +- Zero Fault Tolerance. +- Write and Reading will be good performance. + +#### RAID 1 (or) Mirroring #### + +Mirroring have a good performance. Mirroring can make a copy of same data what we have. Assuming we have two numbers of 2TB Hard drives, total there we have 4TB, but in mirroring while the drives are behind the RAID Controller to form a Logical drive Only we can see the 2TB of logical drive. + +While we save any data, it will write to both 2TB Drives. Minimum two drives are needed to create a RAID 1 or Mirror. If a disk failure occurred we can reproduce the raid set by replacing a new disk. If any one of the disk fails in RAID 1, we can get the data from other one as there was a copy of same content in the other disk. So there is zero data loss. + +- Good Performance. +- Here Half of the Space will be lost in total capacity. +- Full Fault Tolerance. +- Rebuilt will be faster. +- Writing Performance will be slow. +- Reading will be good. +- Can be used for operating systems and database for small scale. + +#### RAID 5 (or) Distributed Parity #### + +RAID 5 is mostly used in enterprise levels. RAID 5 work by distributed parity method. Parity info will be used to rebuild the data. It rebuilds from the information left on the remaining good drives. This will protect our data from drive failure. + +Assume we have 4 drives, if one drive fails and while we replace the failed drive we can rebuild the replaced drive from parity informations. Parity information’s are Stored in all 4 drives, if we have 4 numbers of 1TB hard-drive. The parity information will be stored in 256GB in each drivers and other 768GB in each drives will be defined for Users. RAID 5 can be survive from a single Drive failure, If drives fails more than 1 will cause loss of data’s. + +- Excellent Performance +- Reading will be extremely very good in speed. +- Writing will be Average, slow if we won’t use a Hardware RAID Controller. +- Rebuild from Parity information from all drives. +- Full Fault Tolerance. +- 1 Disk Space will be under Parity. +- Can be used in file servers, web servers, very important backups. + +#### RAID 6 Two Parity Distributed Disk #### + +RAID 6 is same as RAID 5 with two parity distributed system. Mostly used in a large number of arrays. We need minimum 4 Drives, even if there 2 Drive fails we can rebuild the data while replacing new drives. + +Very slower than RAID 5, because it writes data to all 4 drivers at same time. Will be average in speed while we using a Hardware RAID Controller. If we have 6 numbers of 1TB hard-drives 4 drives will be used for data and 2 drives will be used for Parity. + +- Poor Performance. +- Read Performance will be good. +- Write Performance will be Poor if we not using a Hardware RAID Controller. +- Rebuild from 2 Parity Drives. +- Full Fault tolerance. +- 2 Disks space will be under Parity. +- Can be Used in Large Arrays. +- Can be use in backup purpose, video streaming, used in large scale. + +#### RAID 10 (or) Mirror & Stripe #### + +RAID 10 can be called as 1+0 or 0+1. This will do both works of Mirror & Striping. Mirror will be first and stripe will be the second in RAID 10. Stripe will be the first and mirror will be the second in RAID 01. RAID 10 is better comparing to 01. + +Assume, we have 4 Number of drives. While I’m writing some data to my logical volume it will be saved under All 4 drives using mirror and stripe methods. + +If I’m writing a data “TECMINT” in RAID 10 it will save the data as follow. First “T” will write to both disks and second “E” will write to both disk, this step will be used for all data write. It will make a copy of every data to other disk too. + +Same time it will use the RAID 0 method and write data as follow “T” will write to first disk and “E” will write to second disk. Again “C” will write to first Disk and “M” to second disk. + +- Good read and write performance. +- Here Half of the Space will be lost in total capacity. +- Fault Tolerance. +- Fast rebuild from copying data. +- Can be used in Database storage for high performance and availability. + +### Conclusion ### + +In this article we have seen what is RAID and which levels are mostly used in RAID in real environment. Hope you have learned the write-up about RAID. For RAID setup one must know about the basic Knowledge about RAID. The above content will fulfil basic understanding about RAID. + +In the next upcoming articles I’m going to cover how to setup and create a RAID using Various Levels, Growing a RAID Group (Array) and Troubleshooting with failed Drives and much more. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/understanding-raid-setup-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md new file mode 100644 index 0000000000..e3bcf09799 --- /dev/null +++ b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md @@ -0,0 +1,218 @@ +Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 +================================================================================ +RAID is Redundant Array of Inexpensive disks, used for high availability and reliability in large scale environments, where data need to be protected than normal use. Raid is just a collection of disks in a pool to become a logical volume and contains an array. A combine drivers makes an array or called as set of (group). + +RAID can be created, if there are minimum 2 number of disk connected to a raid controller and make a logical volume or more drives can be added in an array according to defined RAID Levels. Software Raid are available without using Physical hardware those are called as software raid. Software Raid will be named as Poor man raid. + +![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) + +Setup RAID0 in Linux + +Main concept of using RAID is to save data from Single point of failure, means if we using a single disk to store the data and if it’s failed, then there is no chance of getting our data back, to stop the data loss we need a fault tolerance method. So, that we can use some collection of disk to form a RAID set. + +#### What is Stripe in RAID 0? #### + +Stripe is striping data across multiple disk at the same time by dividing the contents. Assume we have two disks and if we save content to logical volume it will be saved under both two physical disks by dividing the content. For better performance RAID 0 will be used, but we can’t get the data if one of the drive fails. So, it isn’t a good practice to use RAID 0. The only solution is to install operating system with RAID0 applied logical volumes to safe your important files. + +- RAID 0 has High Performance. +- Zero Capacity Loss in RAID 0. No Space will be wasted. +- Zero Fault Tolerance ( Can’t get back the data if any one of disk fails). +- Write and Reading will be Excellent. + +#### Requirements #### + +Minimum number of disks are allowed to create RAID 0 is 2, but you can add more disk but the order should be twice as 2, 4, 6, 8. If you have a Physical RAID card with enough ports, you can add more disks. + +Here we are not using a Hardware raid, this setup depends only on Software RAID. If we have a physical hardware raid card we can access it from it’s utility UI. Some motherboard by default in-build with RAID feature, there UI can be accessed using Ctrl+I keys. + +If you’re new to RAID setups, please read our earlier article, where we’ve covered some basic introduction of about RAID. + +- [Introduction to RAID and RAID Concepts][1] + +**My Server Setup** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.225 + Two Disks : 20 GB each + +This article is Part 2 of a 9-tutorial RAID series, here in this part, we are going to see how we can create and setup Software RAID0 or striping in Linux systems or servers using two 20GB disks named sdb and sdc. + +### Step 1: Updating System and Installing mdadm for Managing RAID ### + +1. Before setting up RAID0 in Linux, let’s do a system update and then install ‘mdadm‘ package. The mdadm is a small program, which will allow us to configure and manage RAID devices in Linux. + + # yum clean all && yum update + # yum install mdadm -y + +![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) + +Install mdadm Tool + +### Step 2: Verify Attached Two 20GB Drives ### + +2. Before creating RAID 0, make sure to verify that the attached two hard drives are detected or not, using the following command. + + # ls -l /dev | grep sd + +![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) + +Check Hard Drives + +3. Once the new hard drives detected, it’s time to check whether the attached drives are already using any existing raid with the help of following ‘mdadm’ command. + + # mdadm --examine /dev/sd[b-c] + +![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) + +Check RAID Devices + +In the above output, we come to know that none of the RAID have been applied to these two sdb and sdc drives. + +### Step 3: Creating Partitions for RAID ### + +4. Now create sdb and sdc partitions for raid, with the help of following fdisk command. Here, I will show how to create partition on sdb drive. + + # fdisk /dev/sdb + +Follow below instructions for creating partitions. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Next select the partition number as 1. +- Give the default value by just pressing two times Enter key. +- Next press ‘P‘ to print the defined partition. + +![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) + +Create Partitions + +Follow below instructions for creating Linux raid auto on partitions. + +- Press ‘L‘ to list all available types. +- Type ‘t‘to choose the partitions. +- Choose ‘fd‘ for Linux raid auto and press Enter to apply. +- Then again use ‘P‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) + +Create RAID Partitions in Linux + +**Note**: Please follow same above instructions to create partition on sdc drive now. + +5. After creating partitions, verify both the drivers are correctly defined for RAID using following command. + + # mdadm --examine /dev/sd[b-c] + # mdadm --examine /dev/sd[b-c]1 + +![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) + +Verify RAID Partitions + +### Step 4: Creating RAID md Devices ### + +6. Now create md device (i.e. /dev/md0) and apply raid level using below command. + + # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 + # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 + +- -C – create +- -l – level +- -n – No of raid-devices + +7. Once md device has been created, now verify the status of RAID Level, Devices and Array used, with the help of following series of commands as shown. + + # cat /proc/mdstat + +![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) + +Verify RAID Level + + # mdadm -E /dev/sd[b-c]1 + +![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) + +Verify RAID Device + + # mdadm --detail /dev/md0 + +![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) + +Verify RAID Array + +### Step 5: Assiging RAID Devices to Filesystem ### + +8. Create a ext4 filesystem for a RAID device /dev/md0 and mount it under /dev/raid0. + + # mkfs.ext4 /dev/md0 + +![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) + +Create ext4 Filesystem + +9. Once ext4 filesystem has been created for Raid device, now create a mount point directory (i.e. /mnt/raid0) and mount the device /dev/md0 under it. + + # mkdir /mnt/raid0 + # mount /dev/md0 /mnt/raid0/ + +10. Next, verify that the device /dev/md0 is mounted under /mnt/raid0 directory using df command. + + # df -h + +11. Next, create a file called ‘tecmint.txt‘ under the mount point /mnt/raid0, add some content to the created file and view the content of a file and directory. + + # touch /mnt/raid0/tecmint.txt + # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt + # cat /mnt/raid0/tecmint.txt + # ls -l /mnt/raid0/ + +![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) + +Verify Mount Device + +12. Once you’ve verified mount points, it’s time to create an fstab entry in /etc/fstab file. + + # vim /etc/fstab + +Add the following entry as described. May vary according to your mount location and filesystem you using. + + /dev/md0 /mnt/raid0 ext4 deaults 0 0 + +![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) + +Add Device to Fstab + +13. Run mount ‘-a‘ to check if there is any error in fstab entry. + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) + +Check Errors in Fstab + +### Step 6: Saving RAID Configurations ### + +14. Finally, save the raid configuration to one of the file to keep the configurations for future use. Again we use ‘mdadm’ command with ‘-s‘ (scan) and ‘-v‘ (verbose) options as shown. + + # mdadm -E -s -v >> /etc/mdadm.conf + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # cat /etc/mdadm.conf + +![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) + +Save RAID Configurations + +That’s it, we have seen here, how to configure RAID0 striping with raid levels by using two hard disks. In next article, we will see how to setup RAID5. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid0-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md new file mode 100644 index 0000000000..927a8c49f1 --- /dev/null +++ b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -0,0 +1,212 @@ +Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 +================================================================================ +RAID Mirroring means an exact clone (or mirror) of the same data writing to two drives. A minimum two number of disks are more required in an array to create RAID1 and it’s useful only, when read performance or reliability is more precise than the data storage capacity. + +![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) + +Setup Raid1 in Linux + +Mirrors are created to protect against data loss due to disk failure. Each disk in a mirror involves an exact copy of the data. When one disk fails, the same data can be retrieved from other functioning disk. However, the failed drive can be replaced from the running computer without any user interruption. + +### Features of RAID 1 ### + +- Mirror has Good Performance. +- 50% of space will be lost. Means if we have two disk with 500GB size total, it will be 1TB but in Mirroring it will only show us 500GB. +- No data loss in Mirroring if one disk fails, because we have the same content in both disks. +- Reading will be good than writing data to drive. + +#### Requirements #### + +Minimum Two number of disks are allowed to create RAID 1, but you can add more disks by using twice as 2, 4, 6, 8. To add more disks, your system must have a RAID physical adapter (hardware card). + +Here we’re using software raid not a Hardware raid, if your system has an inbuilt physical hardware raid card you can access it from it’s utility UI or using Ctrl+I key. + +Read Also: [Basic Concepts of RAID in Linux][1] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.226 + Hostname : rd1.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + +This article will guide you through a step-by-step instructions on how to setup a software RAID 1 or Mirror using mdadm (creates and manages raid) on Linux Platform. Although the same instructions also works on other Linux distributions such as RedHat, CentOS, Fedora, etc. + +### Step 1: Installing Prerequisites and Examine Drives ### + +1. As I said above, we’re using mdadm utility for creating and managing RAID in Linux. So, let’s install the mdadm software package on Linux using yum or apt-get package manager tool. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. Once ‘mdadm‘ package has been installed, we need to examine our disk drives whether there is already any raid configured using the following command. + + # mdadm -E /dev/sd[b-c] + +![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) + +Check RAID on Disks + +As you see from the above screen, that there is no any super-block detected yet, means no RAID defined. + +### Step 2: Drive Partitioning for RAID ### + +3. As I mentioned above, that we’re using minimum two partitions /dev/sdb and /dev/sdc for creating RAID1. Let’s create partitions on these two drives using ‘fdisk‘ command and change the type to raid during partition creation. + + # fdisk /dev/sdb + +Follow the below instructions + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Next select the partition number as 1. +- Give the default full size by just pressing two times Enter key. +- Next press ‘p‘ to print the defined partition. +- Press ‘L‘ to list all available types. +- Type ‘t‘to choose the partitions. +- Choose ‘fd‘ for Linux raid auto and press Enter to apply. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) + +Create Disk Partitions + +After ‘/dev/sdb‘ partition has been created, next follow the same instructions to create new partition on /dev/sdc drive. + + # fdisk /dev/sdc + +![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) + +Create Second Partitions + +4. Once both the partitions are created successfully, verify the changes on both sdb & sdc drive using the same ‘mdadm‘ command and also confirm the RAID type as shown in the following screen grabs. + + # mdadm -E /dev/sd[b-c] + +![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) + +Verify Partitions Changes + +![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) + +Check RAID Type + +**Note**: As you see in the above picture, there is no any defined RAID on the sdb1 and sdc1 drives so far, that’s the reason we are getting as no super-blocks detected. + +### Step 3: Creating RAID1 Devices ### + +5. Next create RAID1 Device called ‘/dev/md0‘ using the following command and verity it. + + # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 + # cat /proc/mdstat + +![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) + +Create RAID Device + +6. Next check the raid devices type and raid array using following commands. + + # mdadm -E /dev/sd[b-c]1 + # mdadm --detail /dev/md0 + +![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) + +Check RAID Device type + +![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) + +Check RAID Device Array + +From the above pictures, one can easily understand that raid1 have been created and using /dev/sdb1 and /dev/sdc1 partitions and also you can see the status as resyncing. + +### Step 4: Creating File System on RAID Device ### + +7. Create file system using ext4 for md0 and mount under /mnt/raid1. + + # mkfs.ext4 /dev/md0 + +![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) + +Create RAID Device Filesystem + +8. Next, mount the newly created filesystem under ‘/mnt/raid1‘ and create some files and verify the contents under mount point. + + # mkdir /mnt/raid1 + # mount /dev/md0 /mnt/raid1/ + # touch /mnt/raid1/tecmint.txt + # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt + +![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) + +Mount Raid Device + +9. To auto-mount RAID1 on system reboot, you need to make an entry in fstab file. Open ‘/etc/fstab‘ file and add the following line at the bottom of the file. + + /dev/md0 /mnt/raid1 ext4 defaults 0 0 + +![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) + +Raid Automount Device + +10. Run ‘mount -a‘ to check whether there are any errors in fstab entry. + + # mount -av + +![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) + +Check Errors in fstab + +11. Next, save the raid configuration manually to ‘mdadm.conf‘ file using the below command. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) + +Save Raid Configuration + +The above configuration file is read by the system at the reboots and load the RAID devices. + +### Step 5: Verify Data After Disk Failure ### + +12. Our main purpose is, even after any of hard disk fail or crash our data needs to be available. Let’s see what will happen when any of disk disk is unavailable in array. + + # mdadm --detail /dev/md0 + +![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) + +Raid Device Verify + +In the above image, we can see there are 2 devices available in our RAID and Active Devices are 2. Now let us see what will happen when a disk plugged out (removed sdc disk) or fails. + + # ls -l /dev | grep sd + # mdadm --detail /dev/md0 + +![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) + +Test RAID Devices + +Now in the above image, you can see that one of our drive is lost. I unplugged one of the drive from my Virtual machine. Now let us check our precious data. + + # cd /mnt/raid1/ + # cat tecmint.txt + +![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) + +Verify RAID Data + +Did you see our data is still available. From this we come to know the advantage of RAID 1 (mirror). In next article, we will see how to setup a RAID 5 striping with distributed Parity. Hope this helps you to understand how the RAID 1 (Mirror) Works. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid1-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md new file mode 100644 index 0000000000..acd284045f --- /dev/null +++ b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md @@ -0,0 +1,285 @@ +Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 +================================================================================ +In RAID 5, data strips across multiple drives with distributed parity. The striping with distributed parity means it will split the parity information and stripe data over the multiple disks, which will have good data redundancy. + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/setup-raid-5-in-linux.jpg) + +Setup Raid 5 in Linux + +For RAID Level it should have at least three hard drives or more. RAID 5 are being used in the large scale production environment where it’s cost effective and provide performance as well as redundancy. + +#### What is Parity? #### + +Parity is a simplest common method of detecting errors in data storage. Parity stores information in each disks, Let’s say we have 4 disks, in 4 disks one disk space will be split to all disks to store the parity information’s. If any one of the disks fails still we can get the data by rebuilding from parity information after replacing the failed disk. + +#### Pros and Cons of RAID 5 #### + +- Gives better performance +- Support Redundancy and Fault tolerance. +- Support hot spare options. +- Will loose a single disk capacity for using parity information. +- No data loss if a single disk fails. We can rebuilt from parity after replacing the failed disk. +- Suits for transaction oriented environment as the reading will be faster. +- Due to parity overhead, writing will be slow. +- Rebuild takes long time. + +#### Requirements #### + +Minimum 3 hard drives are required to create Raid 5, but you can add more disks, only if you’ve a dedicated hardware raid controller with multi ports. Here, we are using software RAID and ‘mdadm‘ package to create raid. + +mdadm is a package which allow us to configure and manage RAID devices in Linux. By default there is no configuration file is available for RAID, we must save the configuration file after creating and configuring RAID setup in separate file called mdadm.conf. + +Before moving further, I suggest you to go through the following articles for understanding the basics of RAID in Linux. + +- [Basic Concepts of RAID in Linux – Part 1][1] +- [Creating RAID 0 (Stripe) in Linux – Part 2][2] +- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.227 + Hostname : rd5.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + +This article is a Part 4 of a 9-tutorial RAID series, here we are going to setup a software RAID 5 with distributed parity in Linux systems or servers using three 20GB disks named /dev/sdb, /dev/sdc and /dev/sdd. + +### Step 1: Installing mdadm and Verify Drives ### + +1. As we said earlier, that we’re using CentOS 6.5 Final release for this raid setup, but same steps can be followed for RAID setup in any Linux based distributions. + + # lsb_release -a + # ifconfig | grep inet + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/CentOS-6.5-Summary.png) + +CentOS 6.5 Summary + +2. If you’re following our raid series, we assume that you’ve already installed ‘mdadm‘ package, if not, use the following command according to your Linux distribution to install the package. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +3. After the ‘mdadm‘ package installation, let’s list the three 20GB disks which we have added in our system using ‘fdisk‘ command. + + # fdisk -l | grep sd + +![Install mdadm Tool in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Install-mdadm-Tool.png) + +Install mdadm Tool + +4. Now it’s time to examine the attached three drives for any existing RAID blocks on these drives using following command. + + # mdadm -E /dev/sd[b-d] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + +![Examine Drives For Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-Drives-For-Raid.png) + +Examine Drives For Raid + +**Note**: From the above image illustrated that there is no any super-block detected yet. So, there is no RAID defined in all three drives. Let us start to create one now. + +### Step 2: Partitioning the Disks for RAID ### + +5. First and foremost, we have to partition the disks (/dev/sdb, /dev/sdc and /dev/sdd) before adding to a RAID, So let us define the partition using ‘fdisk’ command, before forwarding to the next steps. + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + +#### Create /dev/sdb Partition #### + +Please follow the below instructions to create partition on /dev/sdb drive. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. Here we are choosing Primary because there is no partitions defined yet. +- Then choose ‘1‘ to be the first partition. By default it will be 1. +- Here for cylinder size we don’t have to choose the specified size because we need the whole partition for RAID so just Press Enter two times to choose the default full size. +- Next press ‘p‘ to print the created partition. +- Change the Type, If we need to know the every available types Press ‘L‘. +- Here, we are selecting ‘fd‘ as my type is RAID. +- Next press ‘p‘ to print the defined partition. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition1.png) + +Create sdb Partition + +**Note**: We have to follow the steps mentioned above to create partitions for sdc & sdd drives too. + +#### Create /dev/sdc Partition #### + +Now partition the sdc and sdd drives by following the steps given in the screenshot or you can follow above steps. + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition1.png) + +Create sdc Partition + +#### Create /dev/sdd Partition #### + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition1.png) + +Create sdd Partition + +6. After creating partitions, check for changes in all three drives sdb, sdc, & sdd. + + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + + or + + # mdadm -E /dev/sd[b-c] + +![Check Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Changes-on-Partitions.png) + +Check Partition Changes + +**Note**: In the above pic. depict the type is fd i.e. for RAID. + +7. Now Check for the RAID blocks in newly created partitions. If no super-blocks detected, than we can move forward to create a new RAID 5 setup on these drives. + +![Check Raid on Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-Partitions.png) + +Check Raid on Partition + +### Step 3: Creating md device md0 ### + +8. Now create a Raid device ‘md0‘ (i.e. /dev/md0) and include raid level on all newly created partitions (sdb1, sdc1 and sdd1) using below command. + + # mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 + + or + + # mdadm -C /dev/md0 -l=5 -n=3 /dev/sd[b-d]1 + +9. After creating raid device, check and verify the RAID, devices included and RAID Level from the mdstat output. + + # cat /proc/mdstat + +![Verify Raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Device.png) + +Verify Raid Device + +If you want to monitor the current building process, you can use ‘watch‘ command, just pass through the ‘cat /proc/mdstat‘ with watch command which will refresh screen every 1 second. + + # watch -n1 cat /proc/mdstat + +![Monitor Raid Process](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Raid-Process.png) + +Monitor Raid 5 Process + +![Raid 5 Process Summary](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Process-Summary.png) + +Raid 5 Process Summary + +10. After creation of raid, Verify the raid devices using the following command. + + # mdadm -E /dev/sd[b-d]1 + +![Verify Raid Level](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Level.png) + +Verify Raid Level + +**Note**: The Output of the above command will be little long as it prints the information of all three drives. + +11. Next, verify the RAID array to assume that the devices which we’ve included in the RAID level are running and started to re-sync. + + # mdadm --detail /dev/md0 + +![Verify Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Array.png) + +Verify Raid Array + +### Step 4: Creating file system for md0 ### + +12. Create a file system for ‘md0‘ device using ext4 before mounting. + + # mkfs.ext4 /dev/md0 + +![Create md0 Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md0-Filesystem.png) + +Create md0 Filesystem + +13. Now create a directory under ‘/mnt‘ then mount the created filesystem under /mnt/raid5 and check the files under mount point, you will see lost+found directory. + + # mkdir /mnt/raid5 + # mount /dev/md0 /mnt/raid5/ + # ls -l /mnt/raid5/ + +14. Create few files under mount point /mnt/raid5 and append some text in any one of the file to verify the content. + + # touch /mnt/raid5/raid5_tecmint_{1..5} + # ls -l /mnt/raid5/ + # echo "tecmint raid setups" > /mnt/raid5/raid5_tecmint_1 + # cat /mnt/raid5/raid5_tecmint_1 + # cat /proc/mdstat + +![Mount Raid 5 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-Raid-Device.png) + +Mount Raid Device + +15. We need to add entry in fstab, else will not display our mount point after system reboot. To add an entry, we should edit the fstab file and append the following line as shown below. The mount point will differ according to your environment. + + # vim /etc/fstab + + /dev/md0 /mnt/raid5 ext4 defaults 0 0 + +![Raid 5 Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Device-Automount.png) + +Raid 5 Automount + +16. Next, run ‘mount -av‘ command to check whether any errors in fstab entry. + + # mount -av + +![Check Fstab Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Fstab-Errors.png) + +Check Fstab Errors + +### Step 5: Save Raid 5 Configuration ### + +17. As mentioned earlier in requirement section, by default RAID don’t have a config file. We have to save it manually. If this step is not followed RAID device will not be in md0, it will be in some other random number. + +So, we must have to save the configuration before system reboot. If the configuration is saved it will be loaded to the kernel during the system reboot and RAID will also gets loaded. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid 5 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid-5-Configuration.png) + +Save Raid 5 Configuration + +Note: Saving the configuration will keep the RAID level stable in md0 device. + +### Step 6: Adding Spare Drives ### + +18. What the use of adding a spare drive? its very useful if we have a spare drive, if any one of the disk fails in our array, this spare drive will get active and rebuild the process and sync the data from other disk, so we can see a redundancy here. + +For more instructions on how to add spare drive and check Raid 5 fault tolerance, read #Step 6 and #Step 7 in the following article. + +- [Add Spare Drive to Raid 5 Setup][4] + +### Conclusion ### + +Here, in this article, we have seen how to setup a RAID 5 using three number of disks. Later in my upcoming articles, we will see how to troubleshoot when a disk fails in RAID 5 and how to replace for recovery. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-5-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ +[3]:http://www.tecmint.com/create-raid1-in-linux/ +[4]:http://www.tecmint.com/create-raid-6-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md new file mode 100644 index 0000000000..2ad6a33227 --- /dev/null +++ b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md @@ -0,0 +1,320 @@ +Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux – Part 5 +================================================================================ +RAID 6 is upgraded version of RAID 5, where it has two distributed parity which provides fault tolerance even after two drives fails. Mission critical system still operational incase of two concurrent disks failures. It’s alike RAID 5, but provides more robust, because it uses one more disk for parity. + +In our earlier article, we’ve seen distributed parity in RAID 5, but in this article we will going to see RAID 6 with double distributed parity. Don’t expect extra performance than any other RAID, if so we have to install a dedicated RAID Controller too. Here in RAID 6 even if we loose our 2 disks we can get the data back by replacing a spare drive and build it from parity. + +![Setup RAID 6 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Setup-RAID-6-in-Linux.jpg) + +Setup RAID 6 in Linux + +To setup a RAID 6, minimum 4 numbers of disks or more in a set are required. RAID 6 have multiple disks even in some set it may be have some bunch of disks, while reading, it will read from all the drives, so reading would be faster whereas writing would be poor because it has to stripe over multiple disks. + +Now, many of us comes to conclusion, why we need to use RAID 6, when it doesn’t perform like any other RAID. Hmm… those who raise this question need to know that, if they need high fault tolerance choose RAID 6. In every higher environments with high availability for database, they use RAID 6 because database is the most important and need to be safe in any cost, also it can be useful for video streaming environments. + +#### Pros and Cons of RAID 6 #### + +- Performance are good. +- RAID 6 is expensive, as it requires two independent drives are used for parity functions. +- Will loose a two disks capacity for using parity information (double parity). +- No data loss, even after two disk fails. We can rebuilt from parity after replacing the failed disk. +- Reading will be better than RAID 5, because it reads from multiple disk, But writing performance will be very poor without dedicated RAID Controller. + +#### Requirements #### + +Minimum 4 numbers of disks are required to create a RAID 6. If you want to add more disks, you can, but you must have dedicated raid controller. In software RAID, we will won’t get better performance in RAID 6. So we need a physical RAID controller. + +Those who are new to RAID setup, we recommend to go through RAID articles below. + +- [Basic Concepts of RAID in Linux – Part 1][1] +- [Creating Software RAID 0 (Stripe) in Linux – Part 2][2] +- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.228 + Hostname : rd6.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + Disk 4 [20GB] : /dev/sde + +This article is a Part 5 of a 9-tutorial RAID series, here we are going to see how we can create and setup Software RAID 6 or Striping with Double Distributed Parity in Linux systems or servers using four 20GB disks named /dev/sdb, /dev/sdc, /dev/sdd and /dev/sde. + +### Step 1: Installing mdadm Tool and Examine Drives ### + +1. If you’re following our last two Raid articles (Part 2 and Part 3), where we’ve already shown how to install ‘mdadm‘ tool. If you’re new to this article, let me explain that ‘mdadm‘ is a tool to create and manage Raid in Linux systems, let’s install the tool using following command according to your Linux distribution. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. After installing the tool, now it’s time to verify the attached four drives that we are going to use for raid creation using the following ‘fdisk‘ command. + + # fdisk -l | grep sd + +![Check Hard Disk in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Linux-Disks.png) + +Check Disks in Linux + +3. Before creating a RAID drives, always examine our disk drives whether there is any RAID is already created on the disks. + + # mdadm -E /dev/sd[b-e] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd /dev/sde + +![Check Raid on Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Disk-Raid.png) + +Check Raid on Disk + +**Note**: In the above image depicts that there is no any super-block detected or no RAID is defined in four disk drives. We may move further to start creating RAID 6. + +### Step 2: Drive Partitioning for RAID 6 ### + +4. Now create partitions for raid on ‘/dev/sdb‘, ‘/dev/sdc‘, ‘/dev/sdd‘ and ‘/dev/sde‘ with the help of following fdisk command. Here, we will show how to create partition on sdb drive and later same steps to be followed for rest of the drives. + +**Create /dev/sdb Partition** + + # fdisk /dev/sdb + +Please follow the instructions as shown below for creating partition. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Next choose the partition number as 1. +- Define the default value by just pressing two times Enter key. +- Next press ‘P‘ to print the defined partition. +- Press ‘L‘ to list all available types. +- Type ‘t‘ to choose the partitions. +- Choose ‘fd‘ for Linux raid auto and press Enter to apply. +- Then again use ‘P‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition.png) + +Create /dev/sdb Partition + +**Create /dev/sdb Partition** + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition.png) + +Create /dev/sdc Partition + +**Create /dev/sdd Partition** + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition.png) + +Create /dev/sdd Partition + +**Create /dev/sde Partition** + + # fdisk /dev/sde + +![Create sde Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sde-Partition.png) + +Create /dev/sde Partition + +5. After creating partitions, it’s always good habit to examine the drives for super-blocks. If super-blocks does not exist than we can go head to create a new RAID setup. + + # mdadm -E /dev/sd[b-e]1 + + + or + + # mdadm --examine /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 + +![Check Raid on New Partitions](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-New-Partitions.png) + +Check Raid on New Partitions + +### Step 3: Creating md device (RAID) ### + +6. Now it’s time to create Raid device ‘md0‘ (i.e. /dev/md0) and apply raid level on all newly created partitions and confirm the raid using following commands. + + # mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 + # cat /proc/mdstat + +![Create Raid 6 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Create-Raid-6-Device.png) + +Create Raid 6 Device + +7. You can also check the current process of raid using watch command as shown in the screen grab below. + + # watch -n1 cat /proc/mdstat + +![Check Raid 6 Process](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Process.png) + +Check Raid 6 Process + +8. Verify the raid devices using the following command. + +# mdadm -E /dev/sd[b-e]1 + +**Note**:: The above command will be display the information of the four disks, which is quite long so not possible to post the output or screen grab here. + +9. Next, verify the RAID array to confirm that the re-syncing is started. + + # mdadm --detail /dev/md0 + +![Check Raid 6 Array](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Array.png) + +Check Raid 6 Array + +### Step 4: Creating FileSystem on Raid Device ### + +10. Create a filesystem using ext4 for ‘/dev/md0‘ and mount it under /mnt/raid5. Here we’ve used ext4, but you can use any type of filesystem as per your choice. + + # mkfs.ext4 /dev/md0 + +![Create File System on Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Create-File-System-on-Raid.png) + +Create File System on Raid 6 + +11. Mount the created filesystem under /mnt/raid6 and verify the files under mount point, we can see lost+found directory. + + # mkdir /mnt/raid6 + # mount /dev/md0 /mnt/raid6/ + # ls -l /mnt/raid6/ + +12. Create some files under mount point and append some text in any one of the file to verify the content. + + # touch /mnt/raid6/raid6_test.txt + # ls -l /mnt/raid6/ + # echo "tecmint raid setups" > /mnt/raid6/raid6_test.txt + # cat /mnt/raid6/raid6_test.txt + +![Verify Raid Content](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Content.png) + +Verify Raid Content + +13. Add an entry in /etc/fstab to auto mount the device at the system startup and append the below entry, mount point may differ according to your environment. + + # vim /etc/fstab + + /dev/md0 /mnt/raid6 ext4 defaults 0 0 + +![Automount Raid 6 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Automount-Raid-Device.png) + +Automount Raid 6 Device + +14. Next, execute ‘mount -a‘ command to verify whether there is any error in fstab entry. + + # mount -av + +![Verify Raid Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Automount-Raid-Devices.png) + +Verify Raid Automount + +### Step 5: Save RAID 6 Configuration ### + +15. Please note by default RAID don’t have a config file. We have to save it by manually using below command and then verify the status of device ‘/dev/md0‘. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # mdadm --detail /dev/md0 + +![Save Raid 6 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Status.png) + +Save Raid 6 Configuration + +![Check Raid 6 Status](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Status.png) + +Check Raid 6 Status + +### Step 6: Adding a Spare Drives ### + +16. Now it has 4 disks and there are two parity information’s available. In some cases, if any one of the disk fails we can get the data, because there is double parity in RAID 6. + +May be if the second disk fails, we can add a new one before loosing third disk. It is possible to add a spare drive while creating our RAID set, But I have not defined the spare drive while creating our raid set. But, we can add a spare drive after any drive failure or while creating the RAID set. Now we have already created the RAID set now let me add a spare drive for demonstration. + +For the demonstration purpose, I’ve hot-plugged a new HDD disk (i.e. /dev/sdf), let’s verify the attached disk. + + # ls -l /dev/ | grep sd + +![Check New Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-New-Disk.png) + +Check New Disk + +17. Now again confirm the new attached disk for any raid is already configured or not using the same mdadm command. + + # mdadm --examine /dev/sdf + +![Check Raid on New Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-New-Disk.png) + +Check Raid on New Disk + +**Note**: As usual, like we’ve created partitions for four disks earlier, similarly we’ve to create new partition on the new plugged disk using fdisk command. + + # fdisk /dev/sdf + +![Create sdf Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-Partition-on-sdf.png) + +Create /dev/sdf Partition + +18. Again after creating new partition on /dev/sdf, confirm the raid on the partition, include the spare drive to the /dev/md0 raid device and verify the added device. + + # mdadm --examine /dev/sdf + # mdadm --examine /dev/sdf1 + # mdadm --add /dev/md0 /dev/sdf1 + # mdadm --detail /dev/md0 + +![Verify Raid on sdf Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-on-sdf.png) + +Verify Raid on sdf Partition + +![Add sdf Partition to Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Add-sdf-Partition-to-Raid.png) + +Add sdf Partition to Raid + +![Verify sdf Partition Details](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-sdf-Details.png) + +Verify sdf Partition Details + +### Step 7: Check Raid 6 Fault Tolerance ### + +19. Now, let us check whether spare drive works automatically, if anyone of the disk fails in our Array. For testing, I’ve personally marked one of the drive is failed. + +Here, we’re going to mark /dev/sdd1 as failed drive. + + # mdadm --manage --fail /dev/md0 /dev/sdd1 + +![Check Raid 6 Fault Tolerance](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Failover.png) + +Check Raid 6 Fault Tolerance + +20. Let me get the details of RAID set now and check whether our spare started to sync. + + # mdadm --detail /dev/md0 + +![Check Auto Raid Syncing](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Auto-Raid-Syncing.png) + +Check Auto Raid Syncing + +**Hurray!** Here, we can see the spare got activated and started rebuilding process. At the bottom we can see the faulty drive /dev/sdd1 listed as faulty. We can monitor build process using following command. + + # cat /proc/mdstat + +![Raid 6 Auto Syncing](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-6-Auto-Syncing.png) + +Raid 6 Auto Syncing + +### Conclusion: ### + +Here, we have seen how to setup RAID 6 using four disks. This RAID level is one of the expensive setup with high redundancy. We will see how to setup a Nested RAID 10 and much more in the next articles. Till then, stay connected with TECMINT. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-6-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ +[3]:http://www.tecmint.com/create-raid1-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md new file mode 100644 index 0000000000..c021771ad2 --- /dev/null +++ b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md @@ -0,0 +1,275 @@ +Setting Up RAID 10 or 1+0 (Nested) in Linux – Part 6 +================================================================================ +RAID 10 is a combine of RAID 0 and RAID 1 to form a RAID 10. To setup Raid 10, we need at least 4 number of disks. In our earlier articles, we’ve seen how to setup a RAID 0 and RAID 1 with minimum 2 number of disks. + +Here we will use both RAID 0 and RAID 1 to perform a Raid 10 setup with minimum of 4 drives. Assume, that we’ve some data saved to logical volume, which is created with RAID 10. Just for an example, if we are saving a data “apple” this will be saved under all 4 disk by this following method. + +![Create Raid 10 in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/raid10.jpg) + +Create Raid 10 in Linux + +Using RAID 0 it will save as “A” in first disk and “p” in the second disk, then again “p” in first disk and “l” in second disk. Then “e” in first disk, like this it will continue the Round robin process to save the data. From this we come to know that RAID 0 will write the half of the data to first disk and other half of the data to second disk. + +In RAID 1 method, same data will be written to other 2 disks as follows. “A” will write to both first and second disks, “P” will write to both disk, Again other “P” will write to both the disks. Thus using RAID 1 it will write to both the disks. This will continue in round robin process. + +Now you all came to know that how RAID 10 works by combining of both RAID 0 and RAID 1. If we have 4 number of 20 GB size disks, it will be 80 GB in total, but we will get only 40 GB of Storage capacity, the half of total capacity will be lost for building RAID 10. + +#### Pros and Cons of RAID 5 #### + +- Gives better performance. +- We will loose two of the disk capacity in RAID 10. +- Reading and writing will be very good, because it will write and read to all those 4 disk at the same time. +- It can be used for Database solutions, which needs a high I/O disk writes. + +#### Requirements #### + +In RAID 10, we need minimum of 4 disks, the first 2 disks for RAID 0 and other 2 Disks for RAID 1. Like I said before, RAID 10 is just a Combine of RAID 0 & 1. If we need to extended the RAID group, we must increase the disk by minimum 4 disks. + +**My Server Setup** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.229 + Hostname : rd10.tecmintlocal.com + Disk 1 [20GB] : /dev/sdd + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + Disk 4 [20GB] : /dev/sde + +There are two ways to setup RAID 10, but here I’m going to show you both methods, but I prefer you to follow the first method, which makes the work lot easier for setting up a RAID 10. + +### Method 1: Setting Up Raid 10 ### + +1. First, verify that all the 4 added disks are detected or not using the following command. + + # ls -l /dev | grep sd + +2. Once the four disks are detected, it’s time to check for the drives whether there is already any raid existed before creating a new one. + + # mdadm -E /dev/sd[b-e] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd /dev/sde + +![Verify 4 Added Disks](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-4-Added-Disks.png) + +Verify 4 Added Disks + +**Note**: In the above output, you see there isn’t any super-block detected yet, that means there is no RAID defined in all 4 drives. + +#### Step 1: Drive Partitioning for RAID #### + +3. Now create a new partition on all 4 disks (/dev/sdb, /dev/sdc, /dev/sdd and /dev/sde) using the ‘fdisk’ tool. + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + # fdisk /dev/sde + +**Create /dev/sdb Partition** + +Let me show you how to partition one of the disk (/dev/sdb) using fdisk, this steps will be the same for all the other disks too. + + # fdisk /dev/sdb + +Please use the below steps for creating a new partition on /dev/sdb drive. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Then choose ‘1‘ to be the first partition. +- Next press ‘p‘ to print the created partition. +- Change the Type, If we need to know the every available types Press ‘L‘. +- Here, we are selecting ‘fd‘ as my type is RAID. +- Next press ‘p‘ to print the defined partition. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Disk sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Disk-sdb-Partition.png) + +Disk sdb Partition + +**Note**: Please use the above same instructions for creating partitions on other disks (sdc, sdd sdd sde). + +4. After creating all 4 partitions, again you need to examine the drives for any already existing raid using the following command. + + # mdadm -E /dev/sd[b-e] + # mdadm -E /dev/sd[b-e]1 + + OR + + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd /dev/sde + # mdadm --examine /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 + +![Check All Disks for Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Check-All-Disks-for-Raid.png) + +Check All Disks for Raid + +**Note**: The above outputs shows that there isn’t any super-block detected on all four newly created partitions, that means we can move forward to create RAID 10 on these drives. + +#### Step 2: Creating ‘md’ RAID Device #### + +5. Now it’s time to create a ‘md’ (i.e. /dev/md0) device, using ‘mdadm’ raid management tool. Before, creating device, your system must have ‘mdadm’ tool installed, if not install it first. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +Once ‘mdadm’ tool installed, you can now create a ‘md’ raid device using the following command. + + # mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 + +6. Next verify the newly created raid device using the ‘cat’ command. + + # cat /proc/mdstat + +![Create md raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md-raid-Device.png) + +Create md raid Device + +7. Next, examine all the 4 drives using the below command. The output of the below command will be long as it displays the information of all 4 disks. + + # mdadm --examine /dev/sd[b-e]1 + +8. Next, check the details of Raid Array with the help of following command. + + # mdadm --detail /dev/md0 + +![Check Raid Array Details](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Array-Details.png) + +Check Raid Array Details + +**Note**: You see in the above results, that the status of Raid was active and re-syncing. + +#### Step 3: Creating Filesystem #### + +9. Create a file system using ext4 for ‘md0′ and mount it under ‘/mnt/raid10‘. Here, I’ve used ext4, but you can use any filesystem type if you want. + + # mkfs.ext4 /dev/md0 + +![Create md Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md-Filesystem.png) + +Create md Filesystem + +10. After creating filesystem, mount the created file-system under ‘/mnt/raid10‘ and list the contents of the mount point using ‘ls -l’ command. + + # mkdir /mnt/raid10 + # mount /dev/md0 /mnt/raid10/ + # ls -l /mnt/raid10/ + +Next, add some files under mount point and append some text in any one of the file and check the content. + + # touch /mnt/raid10/raid10_files.txt + # ls -l /mnt/raid10/ + # echo "raid 10 setup with 4 disks" > /mnt/raid10/raid10_files.txt + # cat /mnt/raid10/raid10_files.txt + +![Mount md Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-md-Device.png) + +Mount md Device + +11. For automounting, open the ‘/etc/fstab‘ file and append the below entry in fstab, may be mount point will differ according to your environment. Save and quit using wq!. + + # vim /etc/fstab + + /dev/md0 /mnt/raid10 ext4 defaults 0 0 + +![AutoMount md Device](http://www.tecmint.com/wp-content/uploads/2014/11/AutoMount-md-Device.png) + +AutoMount md Device + +12. Next, verify the ‘/etc/fstab‘ file for any errors before restarting the system using ‘mount -a‘ command. + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Errors-in-Fstab.png) + +Check Errors in Fstab + +#### Step 4: Save RAID Configuration #### + +13. By default RAID don’t have a config file, so we need to save it manually after making all the above steps, to preserve these settings during system boot. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid10 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid10-Configuration.png) + +Save Raid10 Configuration + +That’s it, we have created RAID 10 using method 1, this method is the easier one. Now let’s move forward to setup RAID 10 using method 2. + +### Method 2: Creating RAID 10 ### + +1. In method 2, we have to define 2 sets of RAID 1 and then we need to define a RAID 0 using those created RAID 1 sets. Here, what we will do is to first create 2 mirrors (RAID1) and then striping over RAID0. + +First, list the disks which are all available for creating RAID 10. + + # ls -l /dev | grep sd + +![List 4 Devices](http://www.tecmint.com/wp-content/uploads/2014/11/List-4-Devices.png) + +List 4 Devices + +2. Partition the all 4 disks using ‘fdisk’ command. For partitioning, you can follow #step 3 above. + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + # fdisk /dev/sde + +3. After partitioning all 4 disks, now examine the disks for any existing raid blocks. + + # mdadm --examine /dev/sd[b-e] + # mdadm --examine /dev/sd[b-e]1 + +![Examine 4 Disks](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-4-Disks.png) + +Examine 4 Disks + +#### Step 1: Creating RAID 1 #### + +4. First let me create 2 sets of RAID 1 using 4 disks ‘sdb1′ and ‘sdc1′ and other set using ‘sdd1′ & ‘sde1′. + + # mdadm --create /dev/md1 --metadata=1.2 --level=1 --raid-devices=2 /dev/sd[b-c]1 + # mdadm --create /dev/md2 --metadata=1.2 --level=1 --raid-devices=2 /dev/sd[d-e]1 + # cat /proc/mdstat + +![Creating Raid 1](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-1.png) + +Creating Raid 1 + +![Check Details of Raid 1](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-1.png) + +Check Details of Raid 1 + +#### Step 2: Creating RAID 0 #### + +5. Next, create the RAID 0 using md1 and md2 devices. + + # mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/md1 /dev/md2 + # cat /proc/mdstat + +![Creating Raid 0](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-0.png) + +Creating Raid 0 + +#### Step 3: Save RAID Configuration #### + +6. We need to save the Configuration under ‘/etc/mdadm.conf‘ to load all raid devices in every reboot times. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +After this, we need to follow #step 3 Creating file system of method 1. + +That’s it! we have created RAID 1+0 using method 2. We will loose two disks space here, but the performance will be excellent compared to any other raid setups. + +### Conclusion ### + +Here we have created RAID 10 using two methods. RAID 10 has good performance and redundancy too. Hope this helps you to understand about RAID 10 Nested Raid level. Let us see how to grow an existing raid array and much more in my upcoming articles. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-10-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md new file mode 100644 index 0000000000..fffa6fb419 --- /dev/null +++ b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md @@ -0,0 +1,179 @@ +Growing an Existing RAID Array and Removing Failed Disks in Raid – Part 7 +================================================================================ +Every newbies will get confuse of the word array. Array is just a collection of disks. In other words, we can call array as a set or group. Just like a set of eggs containing 6 numbers. Likewise RAID Array contains number of disks, it may be 2, 4, 6, 8, 12, 16 etc. Hope now you know what Array is. + +Here we will see how to grow (extend) an existing array or raid group. For example, if we are using 2 disks in an array to form a raid 1 set, and in some situation if we need more space in that group, we can extend the size of an array using mdadm –grow command, just by adding one of the disk to the existing array. After growing (adding disk to an existing array), we will see how to remove one of the failed disk from array. + +![Grow Raid Array in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Growing-Raid-Array.jpg) + +Growing Raid Array and Removing Failed Disks + +Assume that one of the disk is little weak and need to remove that disk, till it fails let it under use, but we need to add one of the spare drive and grow the mirror before it fails, because we need to save our data. While the weak disk fails we can remove it from array this is the concept we are going to see in this topic. + +#### Features of RAID Growth #### + +- We can grow (extend) the size of any raid set. +- We can remove the faulty disk after growing raid array with new disk. +- We can grow raid array without any downtime. + +Requirements + +- To grow an RAID array, we need an existing RAID set (Array). +- We need extra disks to grow the Array. +- Here I’m using 1 disk to grow the existing array. + +Before we learn about growing and recovering of Array, we have to know about the basics of RAID levels and setups. Follow the below links to know about those setups. + +- [Understanding Basic RAID Concepts – Part 1][1] +- [Creating a Software Raid 0 in Linux – Part 2][2] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.230 + Hostname : grow.tecmintlocal.com + 2 Existing Disks : 1 GB + 1 Additional Disk : 1 GB + +Here, my already existing RAID has 2 number of disks with each size is 1GB and we are now adding one more disk whose size is 1GB to our existing raid array. + +### Growing an Existing RAID Array ### + +1. Before growing an array, first list the existing Raid array using the following command. + + # mdadm --detail /dev/md0 + +![Check Existing Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Existing-Raid-Array.png) + +Check Existing Raid Array + +**Note**: The above output shows that I’ve already has two disks in Raid array with raid1 level. Now here we are adding one more disk to an existing array, + +2. Now let’s add the new disk “sdd” and create a partition using ‘fdisk‘ command. + + # fdisk /dev/sdd + +Please use the below instructions to create a partition on /dev/sdd drive. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Then choose ‘1‘ to be the first partition. +- Next press ‘p‘ to print the created partition. +- Here, we are selecting ‘fd‘ as my type is RAID. +- Next press ‘p‘ to print the defined partition. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Create-New-sdd-Partition.png) + +Create New sdd Partition + +3. Once new sdd partition created, you can verify it using below command. + + # ls -l /dev/ | grep sd + +![Confirm sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-sdd-Partition.png) + +Confirm sdd Partition + +4. Next, examine the newly created disk for any existing raid, before adding to the array. + + # mdadm --examine /dev/sdd1 + +![Check Raid on sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-sdd-Partition.png) + +Check Raid on sdd Partition + +**Note**: The above output shows that the disk has no super-blocks detected, means we can move forward to add a new disk to an existing array. + +4. To add the new partition /dev/sdd1 in existing array md0, use the following command. + + # mdadm --manage /dev/md0 --add /dev/sdd1 + +![Add Disk To Raid-Array](http://www.tecmint.com/wp-content/uploads/2014/11/Add-Disk-To-Raid-Array.png) + +Add Disk To Raid-Array + +5. Once the new disk has been added, check for the added disk in our array using. + + # mdadm --detail /dev/md0 + +![Confirm Disk Added to Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-Disk-Added-To-Raid.png) + +Confirm Disk Added to Raid + +**Note**: In the above output, you can see the drive has been added as a spare. Here, we already having 2 disks in the array, but what we are expecting is 3 devices in array for that we need to grow the array. + +6. To grow the array we have to use the below command. + + # mdadm --grow --raid-devices=3 /dev/md0 + +![Grow Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Grow-Raid-Array.png) + +Grow Raid Array + +Now we can see the third disk (sdd1) has been added to array, after adding third disk it will sync the data from other two disks. + + # mdadm --detail /dev/md0 + +![Confirm Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-Raid-Array.png) + +Confirm Raid Array + +**Note**: For large size disk it will take hours to sync the contents. Here I have used 1GB virtual disk, so its done very quickly within seconds. + +### Removing Disks from Array ### + +7. After the data has been synced to new disk ‘sdd1‘ from other two disks, that means all three disks now have same contents. + +As I told earlier let’s assume that one of the disk is weak and needs to be removed, before it fails. So, now assume disk ‘sdc1‘ is weak and needs to be removed from an existing array. + +Before removing a disk we have to mark the disk as failed one, then only we can able to remove it. + + # mdadm --fail /dev/md0 /dev/sdc1 + # mdadm --detail /dev/md0 + +![Disk Fail in Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Disk-Fail-in-Raid-Array.png) + +Disk Fail in Raid Array + +From the above output, we clearly see that the disk was marked as faulty at the bottom. Even its faulty, we can see the raid devices are 3, failed 1 and state was degraded. + +Now we have to remove the faulty drive from the array and grow the array with 2 devices, so that the raid devices will be set to 2 devices as before. + + # mdadm --remove /dev/md0 /dev/sdc1 + +![Remove Disk in Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Remove-Disk-in-Raid-Array.png) + +Remove Disk in Raid Array + +8. Once the faulty drive is removed, now we’ve to grow the raid array using 2 disks. + + # mdadm --grow --raid-devices=2 /dev/md0 + # mdadm --detail /dev/md0 + +![Grow Disks in Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Grow-Disks-in-Raid-Array.png) + +Grow Disks in Raid Array + +From the about output, you can see that our array having only 2 devices. If you need to grow the array again, follow the same steps as described above. If you need to add a drive as spare, mark it as spare so that if the disk fails, it will automatically active and rebuild. + +### Conclusion ### + +In the article, we’ve seen how to grow an existing raid set and how to remove a faulty disk from an array after re-syncing the existing contents. All these steps can be done without any downtime. During data syncing, system users, files and applications will not get affected in any case. + +In next, article I will show you how to manage the RAID, till then stay tuned to updates and don’t forget to add your comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/grow-raid-array-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ \ No newline at end of file From 2baef60dbc0fe0d3f8c232674d6f84c8805c5395 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 14:43:42 +0800 Subject: [PATCH 110/113] Update 20150713 How to manage Vim plugins.md --- sources/tech/20150713 How to manage Vim plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150713 How to manage Vim plugins.md b/sources/tech/20150713 How to manage Vim plugins.md index 7462414916..147f89b0b7 100644 --- a/sources/tech/20150713 How to manage Vim plugins.md +++ b/sources/tech/20150713 How to manage Vim plugins.md @@ -1,3 +1,4 @@ +XLCYun 翻译中 How to manage Vim plugins ================================================================================ Vim is a versatile, lightweight text editor on Linux. While its initial learning curve can be overwhelming for an average Linux user, its benefits are completely worthy. As far as the functionality goes, Vim is fully customizable by means of plugins. Due to its high level of configuration, though, you need to spend some time with its plugin system to be able to personalize Vim in an effective way. Luckily, we have several tools that make our life with Vim plugins easier. The one I use on a daily basis is Vundle. @@ -136,4 +137,4 @@ via: http://xmodulo.com/manage-vim-plugins.html [1]:https://github.com/VundleVim/Vundle.vim [2]:http://ask.xmodulo.com/install-git-linux.html [3]:http://www.vim-scripts.org/ -[4]:http://www.vimawesome.com/ \ No newline at end of file +[4]:http://www.vimawesome.com/ From 0a8f38260be9c417e0ea3be00c6d374da0f32e8f Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Tue, 14 Jul 2015 15:27:28 +0800 Subject: [PATCH 111/113] Delete 20150407 10 Truly Amusing Easter Eggs in Linux.md --- ...7 10 Truly Amusing Easter Eggs in Linux.md | 155 ------------------ 1 file changed, 155 deletions(-) delete mode 100644 sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md 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 deleted file mode 100644 index f8322fb1af..0000000000 --- a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ /dev/null @@ -1,155 +0,0 @@ -Translating by H-mudcup -10 Truly Amusing Easter Eggs in Linux -================================================================================ -![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) -The programmer working on Adventure slipped a secret feature into the game. Instead of getting upset about it, Atari decided to give these sorts of “secret features” a name -- “Easter Eggs” because… you know… you hunt for them. Image credit: Wikipedia. - -Back in 1979, a video game was being developed for the Atari 2600 -- [Adventure][1]. - -The programmer working on Adventure slipped a secret feature into the game which, when the user moved an “invisible square” to a particular wall, allowed entry into a “secret room”. That room contained a simple phrase: “Created by [Warren Robinett][2]”. - -Atari had a policy against putting author credits in their games, so this intrepid programmer put his John Hancock on the game by being, well, sneaky. Atari only found out about the “secret room” after Warren Robinett had left the company. Instead of getting upset about it, Atari decided to give these sorts of “secret features” a name -- “Easter Eggs” because… you know… you hunt for them -- and declared that they would be putting more of these “Easter Eggs” in future games. - -This wasn’t the first such “hidden feature” built into a piece of software (that distinction goes to an operating system for the [PDP-10][3] from 1966, but this was the first time it was given a name. And it was the first time it really grabbed the attention of most computer users and gamers. - -Linux (and Linux related software) has not been left out. Some truly amusing Easter Eggs have been created for our beloved operating system over the years. Here are some of my personal favorites -- with how to achieve them. - -You’ll notice, rather quickly, that most of these are experienced via a terminal. That’s on purpose. Because terminals are cool. [I should also take this moment to say that if you try to run an application I list, and you do not have it installed, it will not work. You should install it first. Because… computers.] - -### Arch : Pac-Man in pacman ### - -We’re going to start with one just for the [Arch Linux][4] fans out there. You can add a [Pac-Man][5]-esque character to your progress bars in “[pacman][6]” (the Arch package manager). Why this isn’t enabled by default is beyond me. - -To do this you’ll want to edit “/etc/pacman.conf” in your favorite text editor. Under the “# Misc options” section, remove the “#” in front of “Color” and add the line “ILoveCandy”. Because Pac-Man loves candy. - -That’s it! Next time you fire up a terminal and run pacman, you’ll help the little yellow guy get some lunch (or at least some candy). - -### GNU Emacs : Tetris and such ### - -![emacs Tetris](http://www.linux.com/images/stories/41373/emacsTetris.jpg) -I don’t like emacs. Not even a little bit. But it does play Tetris. - -I have a confession to make: I don’t like [emacs][7]. Not even a little bit. - -Some things fill my heart with gladness. Some things take away all my sadness. Some things ease my troubles. That’s [not what emacs does][8]. - -But it does play Tetris. And that’s not nothing. Here’s how: - -Step 1) Launch emacs. (When in doubt, type “emacs”.) - -Step 2) Hit Escape then X on your keyboard. - -Step 3) Type “tetris” and hit Enter. - -Bored of Tetris? Try “pong”, “snake” and a whole host of other little games (and novelties). Take a look in “/usr/share/emacs/*/lisp/play” for the full list. - -### Animals Saying Things ### - -The Linux world has a long and glorious history of animals saying things in a terminal. Here are the ones that are the most important to know by heart. - -On a Debian-based distro? Try typing “apt-get moo". - -![apt-get moo](http://www.linux.com/images/stories/41373/AptGetMoo.jpg) -apt-get moo - -Simple, sure. But it’s a talking cow. So we like it. Then try “aptitude moo”. It will inform you that “There are no Easter Eggs in this program”. - -If there’s one thing you should know about [aptitude][9], it’s that it’s a dirty, filthy liar. If aptitude were wearing pants, the fire could be seen from space. Add a “-v” option to that same command. Keep adding more v’s until you force aptitude to come clean. - -![](http://www.linux.com/images/stories/41373/AptitudeMoo.jpg) -I think we can all agree, that this is probably the most important feature in aptitude. - -I think we can all agree, that this is probably the most important feature in aptitude. But what if you want to put your own words into the mouth of a cow? That’s where “cowsay” comes in. - -And, don’t let the name “cowsay” fool you. You can put words into so much more than just a cow. Like an elephant, Calvin, Beavis and even the Ghostbusters logo. Just do a “cowsay -l” from the terminal to get a complete list of options. - -![](http://www.linux.com/images/stories/41373/cowsay.jpg) -You can put words into so much more than just a cow. - -Want to get really tricky? You can pipe the output of other applications into cowsay. Try “fortune | cowsay”. Lots of fun can be had. - -### Sudo Insult Me Please ### - -Raise your hand if you’ve always wanted your computer to insult you when you do something wrong. Hell. I know I have. Try this: - -Type “sudo visudo” to open the “sudoers” file. In the top of that file you’ll likely see a few lines that start with “Defaults”. At the bottom of that list add “Defaults insults” and save the file. - -Now, whenever you mistype your sudo password, your system will lob insults at you. Confidence boosting phrases such as “Listen, burrito brains, I don’t have time to listen to this trash.”, “Are you on drugs?” and “You’re mind just hasn’t been the same since the electro-shocks, has it?”. - -This one has the side-effect of being a rather fun thing to set on a co-worker's computer. - -### Firefox is cheeky ### - -Here’s one that isn’t done from the Terminal! Huzzah! - -Open up Firefox. In the URL bar type “about:about”. That will give you a list of all of the “about” pages in Firefox. Nothing too fancy there, right? - -Now try “about:mozilla” and you’ll be greeted with a quote from the “[Book of Mozilla][10]” -- the holy book of web browsing. One of my other favorites, “about:robots”, is also quite excellent. - -![](http://www.linux.com/images/stories/41373/About-Mozilla550.jpg) -The “Book of Mozilla” -- the holy book of web browsing. - -### Carefully Crafted Calendar Concoctions ### - -Tired of the boring old [Gregorian Calendar][11]? Ready to mix things up a little bit? Try typing “ddate”. This will print the current date on the [Discordian Calendar][12]. You will be greeted by something that looks like this: - -“Today is Sweetmorn, the 18th day of Discord in the YOLD 3181” - -I hear what you’re saying, “But, this isn’t an Easter Egg!” Shush. I’ll call it an Easter Egg if I want to. - -### Instant l33t Hacker Mode ### - -Want to feel like you’re a super-hacker from a movie? Try setting nmap into “[Script Kiddie][13]” mode (by adding “-oS”) and all of the output will be rendered in the most 3l33t [h@x0r-y way][14] possible. - -Example: “nmap -oS - google.com” - -Do it. You know you want to. Angelina Jolie would be [super impressed][15]. - -### The lolcat Rainbow ### - -Having awesome Easter Eggs and goodies in your Linux terminal is fine and dandy… but what if you want it to have a little more… pizazz? Enter: lolcat. Take the text output of any program and pipe it through lolcat to super-duper-rainbow-ize it. - -![](http://www.linux.com/images/stories/41373/lolcat.jpg) -Take the text output of any program and pipe it through lolcat to super-duper-rainbow-ize it. - -### Cursor Chasing Critter ### - -![oneko cat](http://www.linux.com/images/stories/41373/onekocat.jpg) -“Oneko” -- the Linux port of the classic “Neko”. - -“Oneko” -- the Linux port of the classic “[Neko][16]”. -And that brings us to “oneko” -- the Linux port of the classic “Neko”. Basically a little cat that chases your cursor around the screen. - -While this may not qualify as an “Easter Egg” in the strictest sense of the word, it’s still fun. And it feels Easter Egg-y. - -You can also use different options (such as “oneko -dog”) to use a little dog instead of a cat and a few other tweaks and options. Lots of possibilities for annoying co-workers with this one. - -There you have it! A list of my favorite Linux Easter Eggs (and things of that ilk). Feel free to add your own favorite in the comments section below. Because this is the Internet. And you can do that sort of thing. - --------------------------------------------------------------------------------- - -via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs- - -作者:[Bryan Lunduke][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.linux.com/community/forums/person/56734 -[1]:http://en.wikipedia.org/wiki/Adventure_(Atari_2600) -[2]:http://en.wikipedia.org/wiki/Warren_Robinett -[3]:http://en.wikipedia.org/wiki/PDP-10 -[4]:http://en.wikipedia.org/wiki/Arch_Linux -[5]:http://en.wikipedia.org/wiki/Pac-Man -[6]:http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs-#Pacman -[7]:http://en.wikipedia.org/wiki/GNU_Emacs -[8]:https://www.youtube.com/watch?v=AQ4NAZPi2js -[9]:https://wiki.debian.org/Aptitude -[10]:http://en.wikipedia.org/wiki/The_Book_of_Mozilla -[11]:http://en.wikipedia.org/wiki/Gregorian_calendar -[12]:http://en.wikipedia.org/wiki/Discordian_calendar -[13]:http://nmap.org/book/output-formats-script-kiddie.html -[14]:http://nmap.org/book/output-formats-script-kiddie.html -[15]:https://www.youtube.com/watch?v=Ql1uLyuWra8 -[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29 From 6e5c0c14a2bbf5e53397a882727e531299b33b79 Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Tue, 14 Jul 2015 15:28:41 +0800 Subject: [PATCH 112/113] Create 20150407 10 Truly Amusing Easter Eggs in Linux.md --- ...7 10 Truly Amusing Easter Eggs in Linux.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md diff --git a/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md new file mode 100644 index 0000000000..4f783d829c --- /dev/null +++ b/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -0,0 +1,155 @@ +Translating by H-mudcup + +Linux上绝对有趣的10个彩蛋 +================================================================================ +![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) +制作 Adventure 的程序员悄悄的把一个秘密的功能塞进了游戏里。Atari 并没有对此感到生气,而是给这类“秘密功能”起了个名字——“彩蛋”,因为——你懂的——你会像找复活节彩蛋一样寻找它们。图片来自: Wikipedia。 + +在1979年的时候,公司为 Atari 2600 开发了一个电子游戏——[Adventure][1]。 + +制作 Adventure 的程序员悄悄的把这样的一个功能放进了游戏里,当用户把一个“隐形方块”移动到特定的一面墙上时,会让用户进入一个“密室”。那个房间里只有一句话:“Created by [Warren Robinett][2]”——意思是,由 [Warren Robinett][2] 创建。 + +Atari 有一项反对作者将自己的名字放进他们的游戏里的政策,所以这个无畏的程序员只能偷偷的把自己的名字放进游戏里。Atari 在 Warren Robinett 离开公司之后才发现这个“密室”。Atari 并没有对此感到生气,而是给这类“秘密功能”起了个名字——“彩蛋”,因为——你懂的——你会寻找它们。Atari 还宣布将在之后的游戏中加入更多的“彩蛋”。 + +这种软件里的“隐藏功能”并不是第一次出现(这类特性的首次出现是在1966年[PDP-10][3]的操作系统上),但这是它第一次有了名字,同时也是第一次真正的被众多电脑用户和游戏玩家所注意。 + +Linux(以及和Linux相关的软件)并没有被遗忘。这些年来,人们为这个倍受喜爱的操作系统创作了很多非常有趣的彩蛋。下面将介绍我个人最喜爱的彩蛋——以及如何得到它们。 + +你将迅速意识到这些彩蛋大多需要通过终端才能体验到。这是故意的。因为终端比较酷。【我应该借此机机会提醒你一下,如果你想运行我所列出的应用,然而你却还没有安装它们,你是绝对无法运行成功的。你应该先安装好它们的。因为……毕竟只是计算机。】 + +### Arch : 包管理器(pacman)里的吃豆人(Pac-Man) ### + +为了广大的 [Arch Linux][4] 粉丝,我们将以此开篇。你们可以将“[pacman][6]” (Arch 的包管理器)的进度条变成吃豆人吃豆的样子。别问我为什么这不是默认设置。 + +你需要在你最喜欢的文本编辑器里编辑“/etc/pacman.conf”文件。在“# Misc options”区下面,删除“Color”前的“#”,添加一行“ILoveCandy”。因为吃豆人喜欢糖豆。 + +没错,这样就行了!下次你在终端里运行pacman管理器时,你就会让这个黄颜色的小家伙吃到些午餐(至少能吃些糖豆)。 + +### GNU Emacs : 俄罗斯方块(Tetris)以及…… ### + +![emacs Tetris](http://www.linux.com/images/stories/41373/emacsTetris.jpg) +我不喜欢 emacs。一点也不喜欢。但是它确实能玩俄罗斯方块。 + +我要坦白一件事:我不喜欢[emacs][7]。一点也不喜欢。 + +有些东西让我满心欢喜。有些东西能带走我所有伤痛。有些东西能解决我的烦恼。这些[绝对跟 emacs 无关][8]。 + +但是它确实能玩俄罗斯方块。这可不是件小事。方法如下: + +第一步)打开 emacs。(有疑问,输入“emacs”。) + +第二步)按下键盘上的Esc和X键。 + +第三步)输入“tetris”然后按下“Enter”。 + +玩腻了俄罗斯方块?试试“pong”、“snake”还有其他一堆小游戏(或奇怪的东西)。在“/usr/share/emacs/*/lisp/play”文件中可以看见完整的清单。 + +### 动物说话了 ### + +让动物在终端里说话在 Linux 世界里有着悠久而辉煌的历史。下面这些真的是最应该知道的。 + +在用基于 Debian 的发行版?试试输入“apt-get moo"。 + +![apt-get moo](http://www.linux.com/images/stories/41373/AptGetMoo.jpg) +apt-get moo + +简单?的确。但这是只会说话的牛。所以惹我们喜欢。再试试“aptitude moo”。他会告诉你“There are no Easter Eggs in this program(这个程序里没有彩蛋)”。 + +关于 [aptitude][9] 有一件事你一定要知道,它是个肮脏、下流的骗子。如果 aptitude 是匹诺曹,那它的鼻子能刺穿月球。在这条命令中添加“-v”选项。不停的添加 v,直到它被逼得投降。 + +![](http://www.linux.com/images/stories/41373/AptitudeMoo.jpg) +我猜大家都同意,这是 aptitude 中最重要的功能。 + +我猜大家都同意,这是 aptitude 中最重要的功能。但是万一你想把自己的话让一头牛说出来怎么办?这时我们就需要“cowsay”了。 + +还有,别让“cowsay(牛说)”这个名字把你给骗了。你可以让你的话从各种东西的嘴里说出来。比如一头大象,Calvin,Beavis 甚至可以是Ghostbusters(捉鬼敢死队)的标志。只需在终端输入“cowsay -l”就能看到所有选项的列表。 + +![](http://www.linux.com/images/stories/41373/cowsay.jpg) +你可以让你的话从各种东西的嘴里说出来 + +想玩高端点的?你可以用管道把其他应用的输出放到 cowsay 中。试试“fortune | cowsay”。非常有趣。 + +### Sudo 请无情的侮辱我 ### + +当你做错事时希望你的电脑骂你的人请举手。反正,我这样想过。试试这个: + +输入“sudo visudo”以打开“sudoers”文件。在文件的开头你很可能会看见几行以“Defaults”开头的文字。在那几行后面添加“Defaults insults”并保存文件。 + +现在,只要你输错了你的 sudo 密码,你的系统就会骂你。这些提高自信的语句包括“听着,煎饼脑袋,我可没时间听这些垃圾。”,“你吃错药了吧?”以及“你被电过以后大脑就跟以前不太一样了是不是?” + +把这个设在同事的电脑上会有非常有趣。 + +### Firefox 是个厚脸皮 ### + +这一个不需要终端!太棒了! + +打开火狐浏览器。在地址栏填上“about:about”。你将得到火狐浏览器中所有的“about”页。一点也不炫酷,是不是? + +现在试试“about:mozilla”,浏览器就会回应你一条从“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经——里引用的话。我的另一个最爱是“about:robots”,这个也很有趣。 + +![](http://www.linux.com/images/stories/41373/About-Mozilla550.jpg) +“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经。 + +### 精心调制的混搭日历 ### + +是否厌倦了千百年不变的 [Gregorian Calendar(罗马教历)][11]?准备好乱入了吗?试试输入“ddate”。这样会把当前日历以[Discordian Calendar(不和教历)][12]的方式显示出来。你会遇见这样的语句: + +“今天是Sweetmorn(甜美的清晨),3181年Discord(不和)季的第18天。” + +我听见你在说什么了,“但这根本不是什么彩蛋!”嘘~,闭嘴。只要我想,我就可以把它叫做彩蛋。 + +### 快速进入黑客行话模式 ### + +想不想尝试一下电影里超级黑客的感觉?试试(通过添加“-oS”)把扫描器设置成“[Script Kiddie][13]”模式。然后所有的输出都会变成最3l33t的[黑客范][14]。 + +例如: “nmap -oS - google.com” + +赶快试试。我知道你有多想这么做。你一定会让安吉丽娜·朱莉(Angelina Jolie)[印象深刻][15] +### lolcat彩虹 ### + +在你的Linux终端里有很多彩蛋真真是极好的……但是如果你还想要变得……更有魅力些怎么办?输入:lolcat。把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。 + +![](http://www.linux.com/images/stories/41373/lolcat.jpg) +把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。 + +### 追光标的小家伙 ### + +![oneko cat](http://www.linux.com/images/stories/41373/onekocat.jpg) +“Oneko” -- 经典 “Neko”的Linux端口。 + +“Oneko” -- 经典 “[Neko][16]”的Linux端口。 . +接下来是“Oneko” -- 经典 “[Neko][16]”的Linux端口。基本上就是个满屏幕追着你的光标跑的小猫。 + +虽然严格来它并不算是“彩蛋”,它还是很有趣的。而且感觉上也是很彩蛋的。 + +你还可以用不同的选项(比如“oneko -dog”)把小猫替代成小狗,或是调成其他样式。用这个对付讨厌的同事有着无限的可能。 + +There you have it! A list of my favorite Linux Easter Eggs (and things of that ilk). Feel free to add your own favorite in the comments section below. Because this is the Internet. And you can do that sort of thing.就是这些了!一个我最喜欢的Linux彩蛋(或是类似东西)的清单。请尽情的的在下面的评论区留下你的最爱。因为这是互联网。你就能做这些事。 + +-------------------------------------------------------------------------------- + +via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs- + +作者:[Bryan Lunduke][a] +译者:[H-mudcup](https://github.com/H-mudcup) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/56734 +[1]:http://en.wikipedia.org/wiki/Adventure_(Atari_2600) +[2]:http://en.wikipedia.org/wiki/Warren_Robinett +[3]:http://en.wikipedia.org/wiki/PDP-10 +[4]:http://en.wikipedia.org/wiki/Arch_Linux +[5]:http://en.wikipedia.org/wiki/Pac-Man +[6]:http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs-#Pacman +[7]:http://en.wikipedia.org/wiki/GNU_Emacs +[8]:https://www.youtube.com/watch?v=AQ4NAZPi2js +[9]:https://wiki.debian.org/Aptitude +[10]:http://en.wikipedia.org/wiki/The_Book_of_Mozilla +[11]:http://en.wikipedia.org/wiki/Gregorian_calendar +[12]:http://en.wikipedia.org/wiki/Discordian_calendar +[13]:http://nmap.org/book/output-formats-script-kiddie.html +[14]:http://nmap.org/book/output-formats-script-kiddie.html +[15]:https://www.youtube.com/watch?v=Ql1uLyuWra8 +[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29 From e35b2ef058de81e904bac2e0eea16d4c81c33b90 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 14 Jul 2015 15:49:47 +0800 Subject: [PATCH 113/113] =?UTF-8?q?RAID=20=E4=B8=93=E9=A2=98=E6=96=87?= =?UTF-8?q?=E7=AB=A0=20struggling=20=E5=85=A8=E9=83=A8=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 - Introduction to RAID, Concepts of RAID and RAID Levels.md | 1 + ...AID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md | 1 + ...- Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md | 1 + ...reating RAID 5 (Striping with Distributed Parity) in Linux.md | 1 + ...Level 6 (Striping with Double Distributed Parity) in Linux.md | 1 + .../RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md | 1 + ...g an Existing RAID Array and Removing Failed Disks in Raid.md | 1 + 7 files changed, 7 insertions(+) diff --git a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md index 6d902f7576..0f393fd7c4 100644 --- a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md +++ b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md @@ -1,3 +1,4 @@ +struggling 翻译中 Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 ================================================================================ RAID is a Redundant Array of Inexpensive disks, but nowadays it is called Redundant Array of Independent drives. Earlier it is used to be very costly to buy even a smaller size of disk, but nowadays we can buy a large size of disk with the same amount like before. Raid is just a collection of disks in a pool to become a logical volume. diff --git a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md index e3bcf09799..8057e4828e 100644 --- a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md +++ b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 ================================================================================ RAID is Redundant Array of Inexpensive disks, used for high availability and reliability in large scale environments, where data need to be protected than normal use. Raid is just a collection of disks in a pool to become a logical volume and contains an array. A combine drivers makes an array or called as set of (group). diff --git a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md index 927a8c49f1..4acfe4366b 100644 --- a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md +++ b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 ================================================================================ RAID Mirroring means an exact clone (or mirror) of the same data writing to two drives. A minimum two number of disks are more required in an array to create RAID1 and it’s useful only, when read performance or reliability is more precise than the data storage capacity. diff --git a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md index acd284045f..dafdf514aa 100644 --- a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md +++ b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 ================================================================================ In RAID 5, data strips across multiple drives with distributed parity. The striping with distributed parity means it will split the parity information and stripe data over the multiple disks, which will have good data redundancy. diff --git a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md index 2ad6a33227..ea1d5993c0 100644 --- a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md +++ b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux – Part 5 ================================================================================ RAID 6 is upgraded version of RAID 5, where it has two distributed parity which provides fault tolerance even after two drives fails. Mission critical system still operational incase of two concurrent disks failures. It’s alike RAID 5, but provides more robust, because it uses one more disk for parity. diff --git a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md index c021771ad2..a08903e00e 100644 --- a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md +++ b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Setting Up RAID 10 or 1+0 (Nested) in Linux – Part 6 ================================================================================ RAID 10 is a combine of RAID 0 and RAID 1 to form a RAID 10. To setup Raid 10, we need at least 4 number of disks. In our earlier articles, we’ve seen how to setup a RAID 0 and RAID 1 with minimum 2 number of disks. diff --git a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md index fffa6fb419..76039f4371 100644 --- a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md +++ b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md @@ -1,3 +1,4 @@ +struggling 翻译中 Growing an Existing RAID Array and Removing Failed Disks in Raid – Part 7 ================================================================================ Every newbies will get confuse of the word array. Array is just a collection of disks. In other words, we can call array as a set or group. Just like a set of eggs containing 6 numbers. Likewise RAID Array contains number of disks, it may be 2, 4, 6, 8, 12, 16 etc. Hope now you know what Array is.