Merge pull request #5 from LCTT/master

Update personal repo
This commit is contained in:
Jack Nie 2014-07-16 11:08:05 +08:00
commit 12702828b7
18 changed files with 952 additions and 92 deletions

View File

@ -1,14 +1,17 @@
在Linux终端中加速目录导航
自动补完不算什么,一键直达目录才是终极神器!
================================================================================
与在命令行中导航目录一样令人称道的是很少有比一遍又一遍重复”cd ls cd ls cd ls……“更令人沮丧的事情了。如果你不是百分百确定你想要进入的下一个目录的名字那么你不得不使用ls来确认然后使用cd来进入你想要进的那一个。所幸的是现在大量的终端和shell语言提供了强大的自动补全功能来处理该问题。但是你仍然需要一直疯狂地敲击制表键来干这事。如果你和我一样懒惰你就会对autojump十分痴迷。自动跳转是一个命令行工具它允许你可以直接跳转到你喜爱的目录而不用管你现在身在何处。
在命令行中切换目录是最常用的操作不过很少有比一遍又一遍重复“cd ls cd ls cd ls ……”更令人沮丧的事情了。如果你不是百分百确定你想要进入的下一个目录的名字那么你不得不使用ls来确认然后使用cd来进入你想要进的那一个。所幸的是现在大量的终端和shell语言提供了强大的自动补全功能来处理该问题。但是你仍然需要一直疯狂地敲击TAB键来干这事。如果你和我一样懒惰你一定会对autojump感到惊喜。
autojump是一个命令行工具它允许你可以直接跳转到你喜爱的目录而不用管你现在身在何处。
### 在Linux上安装autojump ###
在Ubuntu或Debian上autojump
在Ubuntu或Debian上安装autojump
$ sudo apt-get install autojump
要在CentOS或Fedora上安装autojump请使用yum命令。在CentOS上你需要先[启用EPEL仓库][1]。
要在CentOS或Fedora上安装autojump请使用yum命令。在CentOS上你需要先[启用EPEL仓库][1]才行
$ sudo yum install autojump
@ -20,11 +23,11 @@
### autojump的基本用法 ###
autojump的工作方式很简单它会在你每次启动命令时记录你当前位置并把它添加进它自身的数据库中。样,某些目录比其它一些目录添加的次数多,这些目录一般就代表你最重要的目录,而它们的“weight”也会增大。
autojump的工作方式很简单它会在你每次启动命令时记录你当前位置并把它添加进它自身的数据库中。样,某些目录比其它一些目录添加的次数多,这些目录一般就代表你最重要的目录,而它们的“权重”也会增大。
从那儿,你可以使用下面的语法来直接跳转到这些目录:
现在不管你在哪个目录,你都可以使用下面的语法来直接跳转到这些目录:
autojump [name or partial name of the directory]
autojump [目录的名字或名字的一部分]
注意你不需要输入完整的名称因为autojump会检索它的数据库并返回最可能的结果。
@ -38,9 +41,9 @@ autojump的工作方式很简单它会在你每次启动命令时记录你当
如果你也很讨厌打字那么我推荐你为autojump起个别名或者使用默认的别名。
$ j [name or partial name of the directory]
$ j [目录的名字或名字的一部分]
另外一个引人注目的功能是autojump支持
另外一个引人注目的功能是autojump支持zsh和自动补完。如果你不确认哪里是不是你要跳转的地方敲击TAB键就会列出完整路径。
还是同样的例子,输入:
@ -48,29 +51,29 @@ autojump的工作方式很简单它会在你每次启动命令时记录你当
然后敲击tab键将会返回/root/home/doc或者/root/home/ddl。
最后,对于高级用户,你可以访问目录数据库,并修改它的内容。它使得使用下面的命令来手动添加一个目录成为可能
最后,对于高级用户,你可以访问目录数据库,并修改它的内容。可以使用下面的命令来手动添加一个目录
$ autojump -a [directory]
$ autojump -a [目录]
如果你突然想要把它变成你的最爱和使用最频繁的文件夹你可以通过命令的内部参数来手工增加它的weight
如果你突然想要把当前目录变成你的最爱和使用最频繁的文件夹,你可以在该目录通过命令的参数 i 来手工增加它的权重
$ autojump -i [weight]
$ autojump -i [权重]
这将使得该目录更可能被选择跳转。相反的例子是使用内部参数来减少weight
这将使得该目录更可能被选择跳转。相反的例子是在该目录使用参数 d 来减少权重
$ autojump -d [weight]
$ autojump -d [权重]
要跟踪所有这些改变,输入:
$ autojump -s
这会显示数据库中的统计数据,然而
这会显示数据库中的统计数据。而以下
$ autojump --purge
上面的命令将会把不再存在的目录从数据库移除。
命令将会把不再存在的目录从数据库移除。
简言之autojump将会受到所有命令行高级用户的欢迎。不管你是在ssh进一台服务器还是仅仅想要追随复古潮流敲更少的键来减少导航时间总是件好事。如果你真的热衷于此类工具你也肯定会看看[Fasd][3],它应该会很称职
简言之autojump将会受到所有命令行高级用户的欢迎。不管你是在ssh进一台服务器还是仅仅想要追随复古潮流敲更少的键来减少导航时间总是件好事。如果你真的热衷于此类工具你也肯定也想看看[Fasd][3],它应该会给你一个惊喜,我们下次再介绍它
你觉得autojump怎么样你会经常用它么发表一下你的评论吧。
@ -78,7 +81,7 @@ autojump的工作方式很简单它会在你每次启动命令时记录你当
via: http://xmodulo.com/2014/06/speed-up-directory-navigation-linux-terminal.html
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
译者:[GOLinux](https://github.com/GOLinux) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,39 @@
五个超赞的字符艺术生成器!
================================================================================
![](http://www.efytimes.com/admin/useradmin/photo/nin511907PM712014.jpg)
ASCII是一个非常吸引人的字符编码系统在计算机通讯设备以及其他设备中通过它来用代码表示字符。新生代的人可能会觉得它已经过时了但是那些熟悉它的人会懂得ASCII是多么的独特。我们在这里为你准备了五个超赞的ASCII字符艺术生成器。
### 1.[GlassGiant ASCII Art][1] ###
这个小程序可以把图片转换成ASCII文字艺术一堆胡乱堆在一起的文字数字和符号看上去没有任何意义直到你往后站一步去看完整的画面。它也没有什么实际的用途只是看上去非常简洁灵巧。
### 2.[ASCII Art Generator][2] ###
ASCII字符艺术是一种在电脑上把可打印字符作为图片元素来拼接展现一幅图像的艺术活动。你所需要做的只是上传你的图片然后它会帮你转成ASCII字符艺术。
### 3.[Ascii.mastervb][3] ###
ASCII字符艺术来源于7比特ASCII字符标准。ASCII字符艺术曾经在7080年代很流行。在那个时候计算机系统都还是基于字符的。这个程序可以非常快地把图片转换成ASCII字符。
### 4.[IMG2TXT][4] ###
这个脚本可以将GIF,JPG或PNG的链接转换成ASCII字符或是带颜色的HTML。
### 5.[picascii][5] ###
它可以把图片转换成ASCII文本或是HTML。要做转换你只需要输入链接地址或是选择一张你电脑上的图片gif/jpeg/png
--------------------------------------------------------------------------------
via: http://www.efytimes.com/e1/fullnews.asp?edid=142480
译者:[zpl1025](https://github.com/zpl1025) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://glassgiant.com/ascii/
[2]:http://www.ascii-art-generator.org/
[3]:http://ascii.mastervb.net/
[4]:http://www.degraeve.com/img2txt.php
[5]:http://picascii.com/

View File

@ -1,31 +0,0 @@
[su-kaiyao]翻译中
Canonical and Ubuntu Helped Munich Save Millions of Dollars by Ditching Microsoft Products
================================================================================
![](http://i1-news.softpedia-static.com/images/news2/Canonical-and-Ubuntu-Helped-Munich-Save-Millions-of-Dollars-By-Ditching-Microsoft-Products-450571-2.jpg)
**The City of Munich has become one of the most prominent examples of a city administration that switched from Microsoft products to open source, and it looks like Canonical and Ubuntu were an instrumental part of that change.**
The City of Munich managed to shake off the Microsoft dependency, but it took a lot of work and it wasn't cheap. The benefits of moving from Microsoft products to open source might look expensive, but the costs are significantly lower than an upgrade, and it will prove to be a lot cheaper in the future.
Moving from a proprietary solution to an open source one is not all that simple when you have a city the size of Munich. It has 22 organizational units and each of those units has its own IT department, not to mention different versions of the applications.
The local authorities couldn't just adopt a Linux distribution on the fly. The first try was made with Debian back in 2006, but that particular OS didn't have a predictable release schedule. This is how the new LiMux was born, an operating system based on Ubuntu.
“The LiMux/open source project was a long and iterative one, but after a few years of running such a large Linux base, we realized Ubuntu was the platform that could satisfy our requirements best. By combining the low costs and freedom of open source software with ongoing support for the hardware and applications we need, it was one of the critical elements to the success of this project. Most important was the backing of our politicians throughout the project,” [said][1] Peter Hofmann, project manager for the City of Munich.
This tremendous project helped Munich save €10 million ($13.6 million) by 2013, but that is if we take into consideration only the upgrade costs. That sum might be a lot bigger if we could quantify the official support for the software and other hidden costs.
Right now, in Munich, there are 14,000 PCs that are running LiMux and that number is still increasing. It's very likely that other German cities will do the same in the future, especially the ones neighboring Munich.
It took the authorities of Munich 13 years to finish the transition, but in the end they managed to save a lot of money and prove that Linux is actually a very good and free solution for the IT infrastructure of an entire city.
--------------------------------------------------------------------------------
via: http://news.softpedia.com/news/Canonical-and-Ubuntu-Helped-Munich-Save-Millions-of-Dollars-By-Ditching-Microsoft-Products-450571.shtml
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://insights.ubuntu.com/2014/07/07/ubuntu-and-open-source-help-the-city-of-munich-save-millions/

View File

@ -1,3 +1,4 @@
zpl1025
HTG Explains: What is Unix and Why Does It Matter?
================================================================================
![](http://cdn.howtogeek.com/wp-content/uploads/2014/02/ken-thompson-and-dennis-richie-at-pdp-11.jpg)

View File

@ -1,40 +0,0 @@
zpl1025
Here Are 5 Amazing Ascii Art Generators!
================================================================================
![](http://www.efytimes.com/admin/useradmin/photo/nin511907PM712014.jpg)
ASCII is a very fascinating character-encoding scheme wherein codes represent text in computers, communications equipment, and other devices that use text. The next gen might call it old-school but those familiar with the concept know how unique ASCII really is. Here we have compiled a list of 5 amazing ASCII art generators for you.
### 1.[GlassGiant ASCII Art][1] ###
This little program converts your picture to ASCII text art - a jumble of letters, numbers and symbols that do not appear to have any significance until you step back and look at the whole picture. It has no practical purpose, other than the neat factor.
### 2.[ASCII Art Generator][2] ###
ASCII art is an art movement that utilises computers for presentation and consists of pictures pieced together from printable characters. All you need to do id upload your image and it will convert it to ascii art.
### 3.[Ascii.mastervb][3] ###
ASCII Art is created from a 7-bit ASCII characters standard. ASCII Art was popular in 70-80s. In that time, computer OS was still text based. This application can convert images to ascii really quick.
### 4.[IMG2TXT][4] ###
This script takes the URL of a GIF, JPG, or PNG image and converts that image into ASCII text or colored HTML.
### 5.[picascii][5] ###
Convert a picture into ASCII TEXT,HTML. In order to convert a picture, you just need to enter an url or select a picture from your computer (gif,jpeg,png).
--------------------------------------------------------------------------------
via: http://www.efytimes.com/e1/fullnews.asp?edid=142480
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://glassgiant.com/ascii/
[2]:http://www.ascii-art-generator.org/
[3]:http://ascii.mastervb.net/
[4]:http://www.degraeve.com/img2txt.php
[5]:http://picascii.com/

View File

@ -1,3 +1,4 @@
Love-xuan 翻译中
How to Install Lightweight Budgie Desktop in Ubuntu 14.04
================================================================================
**If you follow us over on Twitter you may have caught a glimpse of a screenshot we shared recently, along with the invitation to name the desktop environment pictured. **

View File

@ -1,4 +1,3 @@
Love-xuan翻译中
How to use systemd for system administration on Debian
================================================================================
Soon enough, hardly any Linux user will be able to escape the ever growing grasp that systemd imposes on Linux, unless they manually opt out. systemd has created more technical, emotional, and social issues than any other piece of software as of late. This predominantly came to show in the [heated discussions][1] also dubbed as the 'Init Wars', that occupied parts of the Debian developer body for months. While the Debian Technical Comittee finally decided to include systemd in Debian 8 "Jessie", there were efforts to [supersede the decision][2] by a General Resolution, and even threats to the health of developers in favor of systemd.

View File

@ -1,3 +1,5 @@
[su-kaiyao]翻译中
[Quick Tip] Set Default Browser on Debian/Ubuntu Using Terminal
================================================================================
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/07/Browsers-790x436.jpg)
@ -23,4 +25,4 @@ via: http://www.unixmen.com/quick-tip-set-default-browser-debianubuntu-using-ter
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,88 @@
Command Line Tuesdays Part Five
================================================================================
Yes, youve guessed what time it is! Its time to rrrrrrrrummmbleeeee! And this time, well learn how to work with commands. So without further ado, lets get to business.
Mr Shotts states that until now, we worked with a few mysterious commands, arguments and options, and today is the day we shed a little light upon that mystery. Well learn the following commands and what they do: type, which, help and man. But first, lets learn…
### …what are commands? ###
All great things come in fours, and its the same with commands. We can split them up into four categories:
**1) An executable program:** a command can be an executable program. If youve traveled across your file system in the previous lessons like you were supposed to, you probably visited the /usr/bin folder. Youve seen quite a number of familiar names like transmission-gtk, deluge-gtk etc. Whats less important for us novices currently is that programs there can be compiled binaries or programs written in scripting languages. Point is, since they are executable programs, you can run them. Try it. Navigate to it, list the files inside, pick one and run it simply by typing its name.
**2) A command built into the shell:** bash provides a number of commands internally called shell builtins. The cd command, for example, is a shell builtin, mr Shotts says.
**3) A shell function:** miniature shell script, built into the environment. For the time being, well just mention it, as it will be covered in the following weeks.
**4) An alias:** commands you can define yourself, using other commands. Also coming in the following lessons.
Now, its useful to know what type of command were dealing with. And we can find out using…
### …type ###
You can use **type + command** to inspect what kind of command is the command youd like to use. You do it by simply typing: type command and youll get an output. For example:
![type mkdir](https://news.opensuse.org/wp-content/uploads/2014/07/Zaslonska-slika-2014-07-15-091448.png)
or
![type ls](https://news.opensuse.org/wp-content/uploads/2014/07/Zaslonska-slika-2014-07-15-091640.png)
…where we can see that the ls command is actually an alias of _ls!
### which ###
Sometimes (but rarely on a desktop system, though) there are more versions of one executable installed on a machine. To find out the exact location of a given executable, we can use command which. Additionally, it only works with executable programs.
![which transmission-gtk](https://news.opensuse.org/wp-content/uploads/2014/07/Zaslonska-slika-2014-07-15-092052.png)
Now, mostly every command has documentation that comes with it. So youre somewhere doing your CLI thing, no access to the internet so you cant bug geekos on the forums or IRC, and you need to find out how to exactly use a command. You can do it two ways. First being…
### …help ###
help command works with shell builtins (the second category we have mentioned above). So you can pick a shell builtin, like cd, for example, and simply type help cd. Youll get a helpful page printed out in your terminal, so go ahead and read what cd has to offer. It shows in what ways you can use the command, what options you can use (its in square brackets, which means they are optional! Also, if theres a vertical separator inside the square brackets, it means the options mentioned are mutually exclusive. Dont use them together!)
### help ###
help works only for the shell builtins. But most executables work with help. As far as usage goes, its similar to help, but you have to type help after the command you want to inspect. For example, transmission-gtk help. Try it out, and see what options you can use with that executable etc.
### man ###
Most executables come with a formal documentation page. You can inspect it using the man command. You just enter man program, and see what it prints out. Pick any program on your computer, and try it out. For example, lets try man transmission-gtk. You get a file opened, split into categories. It gives you information what the program is, what it does, how you can use it etc., but it doesnt offer examples, as its not a tutorial.
And were stoping to a halt there.
Id like to take a minute and thank everyone commenting and contributing to this section. You make this series vastly better, and I hope that with your help, us noobs will be able to use the CLI basics by the end of summer (just in time for 13.2 :) ). You guys are the best. Newbie users like me, who are feeling lost, stick with it. It will pay off in the end!
And Id also like to add a formal heads up: part six will not come next Tuesday, as Ill sadly be away, so well see/hear each other in 14 days, on July 29th. And until then…
### …have a lot of fun! ###
--------------------------------------------------------------------------------
via: https://news.opensuse.org/2014/07/15/command-line-tuesdays-part-five/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:
[2]:
[3]:
[4]:
[5]:
[6]:
[7]:
[8]:
[9]:
[10]:
[11]:
[12]:
[13]:
[14]:
[15]:
[16]:
[17]:
[18]:
[19]:
[20]:

View File

@ -0,0 +1,101 @@
5 Simple Ways To Make Cinnamon Feel at Home on Ubuntu
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/des.jpg)
**The latest stable release of the popular Cinnamon desktop environment is [once again available for Ubuntu users to install][1].**
And while its good to go out of the box (or rather PPA) there are a handful of small tweaks you can make to get an even better experience.
If you dont have Cinnamon installed in Ubuntu head on over to our previous article about it.
### Change the Mint Menu Icon ###
The Mint Menu is one of the standout features of Cinnamon. Its a simple, fast and familiar way to search, open and organise your applications. By default the menu uses the Linux Mint logo on the launcher item. Since youre running the DE on Ubuntu rather than Mint you may prefer the menu to use Ubuntus familiar orange circle of friends logo instead. How? Its easy.
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/min-menu.jpg)
To change the Cinnamon menu icon to the Ubuntu emblem right click on the applet and select Configure. In the Settings window that appears check Use a custom icon and enter the following to use the Ubuntu logo:
/usr/share/icons/ubuntu-mono-dark/actions/24/package-supported.svg
You can use any supported image type. Just enter the path to the icon in the field, or click the box at the end to open a file picker.
### Try Out Cinnamon Themes ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/cinnamon-themes-zukitwo.jpg)
Like GNOME Shell Cinnamon also supports custom themes. And by that I dont mean just GTK themes for apps and window decoration, but visual styles that theme the shell as a whole — panel, menu, applets, and so on.
Cinnamon themes can be browsed, downloaded and enabled without leaving the desktop — no downloads or manual installation required. Open the Appearance pane of the Cinnamon Settings tool and select the Online Themes tab to get started.
Below are a handful of our favourite themes.
- [**Android Holo**][2] — Android 4.x style theme
- [**Zukitwo**][3] — Sleek, stylish and light
- [**Minty**][4] — Dark theme with bold green accents
- [**Metro**][5] — Based on the visual style of Windows 8.x
### Find Your Perfect Layout ###
Unity may insist that its app launcher stay bolted firmly to the side of the screen, but Cinnamon has no such qualms about letting you rearrange the desktop layout to suit your own style.
Panels can be added, edited and moved manually, or by selecting one of three preset layouts:
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/traditional.jpg)
Open `Settings > Panel > Layout Options > Panel Layout` and select from one of the following:
- Traditional this is the default layout, with a panel at the bottom of the screen
- Flipped like traditional, but with panel on top of the screen
- Classic two panels, one at the top, one at the bottom
You will need to log out or restart Cinnamon before your selected changes will take effect.
### Add Panel Applets ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/weather-applet.png)
Cinnamon embraces extensibility with the same gusto as GNOME Shell. A wealth of community add-ons and applets offering extra features and functionality, such as weather, system monitors and window management tools, are available to browse, install and enable straight form the desktop.
Right click on the panel you wish to add an applet to and select …Add Applets to the Panel. Some notable applets to check out:
- [**Weather**][6] - does what it forecasts (ho ho)
- [**Stark Menu**][7] - Clone of the Windows 7 Start Menu
- [**Screenshot**][8] — Easy way to grab screenshots with delays
### Change Date Format ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/applet.jpg)
Cinnamons time and date applet is handy if, like me, youre prone to never remembering the date.
But it defaults to only showing the time in the 24 hour clock format. The good news is that we can tweak the time format of the clock applet fairly easily.
Right click and select the Configure option. In the settings window that appears tick the box listed beside “Use a custom date format“. Next, use an online generator tool to generate a date/time format suited to you, or use one of the presets listed below by copying and pasting the bit marked in bold:
- **%B %e, %I:%M %p** (July 13, 7:19 PM)
- **%m/%d/%Y** (07/13/2014)
- **%l:%M %p** (7:19 PM)
Changes are applied immediately, and if you make a mistake you can uncheck the custom date format option to return to the default settings.
### Going Further ###
These are just a handful of customisation choices available in Cinnamon, but we think theyre a good springboard for exploring more. Let us know what your favourite Cinnamon tweaks are in the comments section below, on Facebook or via Google+.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/07/5-things-installing-cinnamon-ubuntu
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.omgubuntu.co.uk/2014/07/new-cinnamon-ubuntu-14-04-ppa-stable
[2]:http://cinnamon-spices.linuxmint.com/themes/view/122
[3]:http://cinnamon-spices.linuxmint.com/themes/view/219
[4]:http://cinnamon-spices.linuxmint.com/themes/view/25
[5]:http://cinnamon-spices.linuxmint.com/themes/view/188
[6]:http://cinnamon-spices.linuxmint.com/applets/view/17
[7]:http://cinnamon-spices.linuxmint.com/applets/view/168
[8]:http://cinnamon-spices.linuxmint.com/applets/view/35

View File

@ -0,0 +1,197 @@
7 dmesg Commands for Troubleshooting and Collecting Information of Linux Systems
================================================================================
The dmesg command displays the messages from the kernel ring buffer. A system passes multiple runlevel from where we can get lot of information like system architecture, cpu, attached device, RAM etc. When computer boots up, a kernel (core of an operating system) is loaded into memory. During that period number of messages are being displayed where we can see hardware devices detected by kernel.
![dmesg Command Examples](http://www.tecmint.com/wp-content/uploads/2014/07/dmesg-Command-Examples.png)
dmesg Command Examples
The messages are very important in terms of diagnosing purpose in case of device failure. When we connect or disconnect hardware device on the system, with the help of dmesg command we come to know detected or disconnected information on the fly. The dmesg command is available on most **Linux and Unix** based Operating System.
Lets throw some light on most famous tool called dmesg command with their practical examples as discussed below. The exact syntax of dmesg as follows.
# dmseg [options...]
### 1. List all loaded Drivers in Kernel ###
We can use text-manipulation tools i.e. **more**, **tail**, **less** or **grep** with dmesg command. As output of dmesg log wont fit on a single page, using dmesg with pipe more or less command will display logs in a single page.
[root@tecmint.com ~]# dmesg | more
[root@tecmint.com ~]# dmesg | less
#### Sample Output ####
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.11.0-13-generic (buildd@aatxe) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) ) #20-Ubuntu SMP Wed Oct 23 17:26:33 UTC 2013
(Ubuntu 3.11.0-13.20-generic 3.11.6)
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] NSC Geode by NSC
[ 0.000000] Cyrix CyrixInstead
[ 0.000000] Centaur CentaurHauls
[ 0.000000] Transmeta GenuineTMx86
[ 0.000000] Transmeta TransmetaCPU
[ 0.000000] UMC UMC UMC UMC
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007dc08bff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007dc08c00-0x000000007dc5cbff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000007dc5cc00-0x000000007dc5ebff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000007dc5ec00-0x000000007fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fed003ff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fed20000-0x00000000fed9ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000feefffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000ffb00000-0x00000000ffffffff] reserved
[ 0.000000] NX (Execute Disable) protection: active
.....
### 2. List all Detected Devices ###
To discover which hard disks has been detected by kernel, you can search for the keyword “**sda**” along with “**grep**” like shown below.
[root@tecmint.com ~]# dmesg | grep sda
[ 1.280971] sd 2:0:0:0: [sda] 488281250 512-byte logical blocks: (250 GB/232 GiB)
[ 1.281014] sd 2:0:0:0: [sda] Write Protect is off
[ 1.281016] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.281039] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.359585] sda: sda1 sda2 < sda5 sda6 sda7 sda8 >
[ 1.360052] sd 2:0:0:0: [sda] Attached SCSI disk
[ 2.347887] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 22.928440] Adding 3905532k swap on /dev/sda6. Priority:-1 extents:1 across:3905532k FS
[ 23.950543] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 24.134016] EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: (null)
[ 24.330762] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: (null)
[ 24.561015] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)
**NOTE**: The sda first SATA hard drive, sdb is the second SATA hard drive and so on. Search with hda or hdb in the case of IDE hard drive.
### 3. Print Only First 20 Lines of Output ###
The head along with dmesg will show starting lines i.e. dmesg | head -20 will print only 20 lines from the starting point.
[root@tecmint.com ~]# dmesg | head -20
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.11.0-13-generic (buildd@aatxe) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) ) #20-Ubuntu SMP Wed Oct 23 17:26:33 UTC 2013 (Ubuntu 3.11.0-13.20-generic 3.11.6)
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] NSC Geode by NSC
[ 0.000000] Cyrix CyrixInstead
[ 0.000000] Centaur CentaurHauls
[ 0.000000] Transmeta GenuineTMx86
[ 0.000000] Transmeta TransmetaCPU
[ 0.000000] UMC UMC UMC UMC
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007dc08bff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007dc08c00-0x000000007dc5cbff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000007dc5cc00-0x000000007dc5ebff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000007dc5ec00-0x000000007fffffff] reserved
### 4. Print Only Last 20 Lines of Output ###
The tail along with dmesg command will print only 20 last lines, this is useful in case we insert removable device.
[root@tecmint.com ~]# dmesg | tail -20
parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
ppdev: user-space parallel port driver
EXT4-fs (sda1): mounted filesystem with ordered data mode
Adding 2097144k swap on /dev/sda2. Priority:-1 extents:1 across:2097144k
readahead-disable-service: delaying service auditd
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
Slow work thread pool: Starting up
Slow work thread pool: Ready
FS-Cache: Loaded
CacheFiles: Loaded
CacheFiles: Security denies permission to nominate security context: error -95
eth0: no IPv6 routers present
type=1305 audit(1398268784.593:18630): audit_enabled=0 old=1 auid=4294967295 ses=4294967295 res=1
readahead-collector: starting delayed service auditd
readahead-collector: sorting
readahead-collector: finished
### 5. Search Detected Device or Particular String ###
Its difficult to search particular string due to length of dmesg output. So, filter the lines with are having string like **usb** **dma** **tty** and **memory** etc. The **-i** option instruct to [grep command][1] to ignore the case (upper or lower case letters).
[root@tecmint.com log]# dmesg | grep -i usb
[root@tecmint.com log]# dmesg | grep -i dma
[root@tecmint.com log]# dmesg | grep -i tty
[root@tecmint.com log]# dmesg | grep -i memory
#### Sample Output ####
[ 0.000000] Scanning 1 areas for low memory corruption
[ 0.000000] initial memory mapped: [mem 0x00000000-0x01ffffff]
[ 0.000000] Base memory trampoline at [c009b000] 9b000 size 16384
[ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[ 0.000000] init_memory_mapping: [mem 0x37800000-0x379fffff]
[ 0.000000] init_memory_mapping: [mem 0x34000000-0x377fffff]
[ 0.000000] init_memory_mapping: [mem 0x00100000-0x33ffffff]
[ 0.000000] init_memory_mapping: [mem 0x37a00000-0x37bfdfff]
[ 0.000000] Early memory node ranges
[ 0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x000effff]
[ 0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] Memory: 2003288K/2059928K available (6352K kernel code, 607K rwdata, 2640K rodata, 880K init, 908K bss, 56640K reserved, 1146920K highmem)
[ 0.000000] virtual kernel memory layout:
[ 0.004291] Initializing cgroup subsys memory
[ 0.004609] Freeing SMP alternatives memory: 28K (c1a3e000 - c1a45000)
[ 0.899622] Freeing initrd memory: 23616K (f51d0000 - f68e0000)
[ 0.899813] Scanning for low memory corruption every 60 seconds
[ 0.946323] agpgart-intel 0000:00:00.0: detected 32768K stolen memory
[ 1.360318] Freeing unused kernel memory: 880K (c1962000 - c1a3e000)
[ 1.429066] [drm] Memory usable by graphics device = 2048M
### 6. Clear dmesg Buffer Logs ###
Yes, we can clear dmesg logs if required with below command. It will clear dmesg ring buffer message logs till you executed the command below. Still you can view logs stored in **/var/log/dmesg** files. If you connect any device will generate dmesg output.
[root@tecmint.com log]# dmesg -c
### 7. Monitoring dmesg in Real Time ###
Some distro allows command tail -f /var/log/dmesg as well for real time dmesg monitoring.
[root@tecmint.com log]# watch "dmesg | tail -20"
**Conclusion**: The dmesg command is useful as dmesg records all the system changes done or occur in real time. As always you can man dmesg to get more information.
----------
![](http://1.gravatar.com/avatar/36c7c25164c3455f2f711b01e395de0d?s=80&d=blank&r=G)
Narad Shrestha
- [Twitter profile][t]
- [Facebook profile][f]
- [Google+ profile][g]
He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/dmesg-commands/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.tecmint.com/12-practical-examples-of-linux-grep-command/
[t]:http://twitter.com/@nrdshrestha
[f]:http://facebook.com/narad.shrestha.9
[g]:http://plus.google.com/104542109955805873615?rel=author

View File

@ -0,0 +1,117 @@
How to analyze Squid logs with SARG log analyzer on CentOS
================================================================================
In a [previous tutorial][1], we show how to configure a transparent proxy with Squid on CentOS. Squid provides many useful features, but analyzing a raw Squid log file is not straightfoward. For example, how could you analyze the time stamps and the number of hits in the following Squid log?
1404788984.429 1162 172.17.1.23 TCP_MISS/302 436 GET http://facebook.com/ - DIRECT/173.252.110.27 text/html
1404788985.046 12416 172.17.1.23 TCP_MISS/200 4169 CONNECT stats.pusher.com:443 - DIRECT/173.255.223.127 -
1404788986.124 174 172.17.1.23 TCP_MISS/200 955 POST http://ocsp.digicert.com/ - DIRECT/117.18.237.29 application/ocsp-response
1404788989.738 342 172.17.1.23 TCP_MISS/200 3890 CONNECT www.google.com:443 - DIRECT/74.125.200.106 -
1404788989.757 226 172.17.1.23 TCP_MISS/200 942 POST http://clients1.google.com/ocsp - DIRECT/74.125.200.113 application/ocsp-response
1404788990.839 3939 172.17.1.23 TCP_MISS/200 78944 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
1404788990.846 2148 172.17.1.23 TCP_MISS/200 118947 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
1404788990.849 2151 172.17.1.23 TCP_MISS/200 76809 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
1404788991.140 611 172.17.1.23 TCP_MISS/200 110073 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35
SARG (or Squid Analysis Report Generator) is a web based tool that creates reports from Squid logs. SARG provides an easy-to-understand view of network traffic handled by Squid, and it is very easy to set up and maintain. In the following tutorial, we show **how to set up SARG on a CentOS platform**.
We start the process by installing necessary dependencies using yum.
# yum install gcc make wget httpd crond
Necessary services are started and loaded at startup.
# service httpd start; service crond start
# chkconfig httpd on; chkconfig crond on
Now we download and extract SARG.
# wget http://downloads.sourceforge.net/project/sarg/sarg/sarg-2.3.8/sarg-2.3.8.tar.gz?
# tar zxvf sarg-2.3.8.tar.gz
# cd sarg-2.3.8
**NOTE**: For 64-bit Linux, the source code in log.c needs to be patched as follows.
1506c1506
< if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,nbytes,code,elap_time,smartfilter)<=0) {
---
> if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,(int64_t)nbytes,code,elap_time,smartfilter)<=0) {
1513c1513
< fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,user,ip,url,nbytes,code,elap_time,smartfilter);
---
> fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,user,ip,url,(int64_t)nbytes,code,elap_time,smartfilter);
1564c1564
< printf("LEN=\t%"PRIi64"\n",nbytes);
---
> printf("LEN=\t%"PRIi64"\n",(int64_t)nbytes);
Go ahead and build/install SARG as follows.
# ./configure
# make
# make install
After SARG is installed, the configuration file can be modified to match your requirements. The following is one example of SARG configuration.
# vim /usr/local/etc/sarg.conf
----------
access_log /var/log/squid/access.log
temporary_dir /tmp
output_dir /var/www/html/squid-reports
date_format e ## We use Europian DD-MM-YYYY format here ##
## we dont want multiple reports for single day/week/month ##
overwrite_report yes
Now it's time for a test run. We run sarg command in debug mode to find whether there is any error.
# sarg -x
If all goes well, sarg should analyze Squid logs, and create reports in /var/www/html/squid-reports. The reports should be visible in a web browser using the address http://<server-IP>/squid-reports/
![](https://farm3.staticflickr.com/2931/14631403935_4ff34e07b9_z.jpg)
![](https://farm4.staticflickr.com/3901/14629281644_fec31014c5_z.jpg)
SARG can be used to create daily, weekly and monthly reports. Time range can be specified using the "-d" parameter with possible values in the form of day-n, week-n or month-n, where n is the number of days/weeks/months to jump backward. For example, with week-1, SARG will generate a report for the previous week. With day-2, SARG will prepare reports for the previous two days.
As a demonstration, we will prepare a cron job to run SARG daily.
# vim /etc/cron.daily/sarg
----------
#!/bin/sh
/usr/local/bin/sarg -d day-1
The file needs a execution permission.
# chmod 755 /usr/local/bin/sarg
Now SARG should prepare daily reports about Squid-managed traffic. These reports can easily be accessed from the SARG web interface.
To sum up, SARG is a web based tool that analyzes Squid logs and presents the analysis in an informative way. System admins can leverage SARG to monitor what sites are being accessed, and to keep track of top visited sites and top users. This tutorial covers a working configuration for SARG. You can customize the configuration even further to match your requirements.
Hope this helps.­­­­
----------
[Sarmed Rahman][w]
- [Twitter profile][t]
- [LinkedIn profile][l]
Sarmed Rahman is an IT professional in the Internet Industry in Bangladesh. He writes tutorial articles on technology every now and then from a belief that knowledge grows through sharing. During his free time, he loves gaming and spending time with his friends.
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/07/analyze-squid-logs-sarg-log-analyzer-centos.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/2014/06/squid-transparent-web-proxy-centos-rhel.html
[w]:http://amar-linux.blogspot.com/
[t]:http://twitter.com/SarmedRahman
[l]:http://www.linkedin.com/in/sarmedrahman

View File

@ -0,0 +1,91 @@
How to check RPM package dependencies on Fedora, CentOS or RHEL
================================================================================
A typical RPM package on Red Hat-based systems requires all its dependent packages be installed to function properly. For end users, the complexity of such RPM dependency is hidden by package managers (e.g., yum or DNF) during package install/upgrade/removal process. However, if you are a sysadmin or a RPM maintainer, you need to be well-versed in RPM dependencies to maintain run-time environment for the system or roll out up-to-date RPM specs.
In this tutorial, I am going to show **how to check RPM package dependencies**. Depending on whether a package is installed or not, there are several ways to identify its RPM dependencies.
### Method One ###
One way to find out RPM dependencies for a particular package is to use rpm command. The following command lists all dependent packages for a target package.
$ rpm -qR <package-name>
![](https://farm6.staticflickr.com/5512/14659620723_4a36970efc_o.png)
Note that this command will work only if the target package is already **installed**. If you want to check package dependencies for any **uninstalled** package, you first need to download the RPM package locally (no need to install it).
To download a RPM package without installing it, use a command-line utility called `yumdownloader`. Install yumdownloader as follows.
$ sudo yum install yum-utils
Now let's check RPM depenencies of a uninstalled package (e.g., tcpdump). First download the package in the current folder with yumdownloader:
$ yumdownloader --destdir=. tcpdump
Then use rpm command with "-qpR" options to list dependencies of the downloaded package.
# rpm -qpR tcpdump-4.4.0-2.fc19.i686.rpm
### Method Two ###
You can also get a list of dependencies for a RPM package using repoquery tool. repoquery works whether or not a target package is installed. This tool is included in yum-utils package.
$ sudo yum install yum-utils
To show all required packages for a particular package:
$ repoquery --requires --resolve <package-name>
![](https://farm3.staticflickr.com/2935/14453103778_05db349b19_o.png)
For repoquery to work, your computer needs network connectivity since repoquery pulls information from Yum repositories.
### Method Three ###
The third method to show RPM package dependencies is to use rpmreaper tool. Originally this tool is developed to clean up unnecessary packages and their dependencies on RPM-based systems. rpmreaper has an ncurses-based intuitive interface for browsing installed packages and their dependency trees.
To install rpmrepater, use yum command. On CentOS, you need to [set up EPEL repo][1] first.
$ sudo yum install rpmreaper
To browser RPM dependency trees, simply run:
$ rpmreaper
![](https://farm4.staticflickr.com/3838/14636456131_99a3c26945_z.jpg)
The rpmrepater interface will show you a list of all installed packages. You can navigate the list using up/down arrow keys. Press "r" on a highlighted package to show its dependencies. You can expand the whole dependency tree by recursively pressing "r" keys on individual dependent packages. The "L" flag indicates that a given package is a "leaf", meaning that no other package depends on this package. The "o" flag implies that a given package is in the middle of dependency chain. Pressing "b" on such a package will show you what other packages require the highlighted package.
### Method Four ###
Another way to show package dependencies on RPM-based systems is to use rpmdep which is a command-line tool for generating a full package dependency graph of any installed RPM package. The tool analyzes RPM dependencies, and produce partially ordered package lists from topological sorting. The output of this tool can be fed into dotty graph visualization tool to generate a dependency graph image.
To install rpmdep and dotty on Fedora:
$ sudo yum install rpmorphan graphviz
To install the same tools on CentOS:
$ wget http://downloads.sourceforge.net/project/rpmorphan/rpmorphan/1.14/rpmorphan-1.14-1.noarch.rpm
$ sudo rpm -ivh rpmorphan-1.14-1.noarch.rpm
$ sudo yum install graphviz
To generate and plot a dependency graph of a particular installed package (e.g., gzip):
$ rpmdep.pl -dot gzip.dot gzip
$ dot -Tpng -o output.png gzip.dot
![](https://farm4.staticflickr.com/3918/14453050980_53de4e8277_z.jpg)
So far in this tutorial, I demonstrate several ways to check what other packages a given RPM package relies on. If you want to know more about .deb package dependencies for Debian-based systems, you can refer to [this guide][2] instead.
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/07/check-rpm-package-dependencies-fedora-centos-rhel.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
[2]:http://xmodulo.com/2013/07/how-to-check-package-dependencies-on-ubuntu-or-debian.html

View File

@ -0,0 +1,182 @@
Install “Android 4.4 KitKat” to Run Favourite Games and Applications in Linux
================================================================================
**Android (x86)** is a project which aims to port Android system to Intel x86 processors to let users install it easily on any computer, the way they do this is by taking android source code, patching it to work on Intel x86 processors and some laptops and tablets.
![Install Android 4.4 KitKat in Linux](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-4.4-KitKat.jpg)
Install Android 4.4 KitKat in Linux
A few days ago, the project released “Android KitKat 4.4 RC2”, and today we will explain how to install it on VirtualBox, there is a problem that the mouse pointer doesnt work in android in VirtualBox, but you may use this guide to install it beside other systems as a main system and the mouse should work I guess, otherwise well use the keyboard.
### Step 1: Install VirtualBox in Linux ###
**1.** VirtualBox is available to install easily via official repositories in most Linux distributions, to install it on Ubuntu run.
$ sudo apt-get install virtualbox
For other Linux distributions like **RHEL, CentOS and Fedora**, use the following article to install Virtualbox.
- [Install VirtualBox in RHEL, CentOS and Fedora][1]
### Step 2: Download and Install Android 4.4 KitKat in Virtualbox ###
**2.** This is an easy step, just download **Android 4.4 x86 Kit Kat** file from the [androud Sourceforge.net][2] project.
**3.** To install **Android 4.4 kitkat** on VirtualBox, you need first to boot from the .iso image that you downloaded, to do so, open **VirtualBox**, Click on new to create a new virtual machine, and choose the settings as follow.
![Create New Virtual Machine](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-01.png)
Create New Virtual Machine
**4.** Then it will ask you to choose a Memory size for the machine, Android 4.4 kitkat needs 1GB of RAM to work perfectly, but I will choose 512MB since I only have 1GB of RAM on my computer.
![Set Memory to New Machine](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-02.png)
Set Memory to New Machine
**5.** Now select “Create a virtual hard drive now” to create a new one.
![Create Virtual Hard Drive](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-03.png)
Create Virtual Hard Drive
**6.** It will now ask you for the type of the new virtual hard drive, select **VDI**.
![Select Hard Drive Type](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-04.png)
Select Hard Drive Type
![Select Storage Type](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-05.png)
Select Storage Type
**7.** Now choose the size of the virtual hard drive, you may choose any size you want, no less than **4GB** so the system can be installed correctly beside any future apps that you want to install.
![Set Size for Virtual Drive](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-32.png)
Set Size for Virtual Drive
**8.** Now thats your first virtual machine is created, now to boot from the **.iso** file that you downloaded, select the virtual machine from the list on the left, click on **Settings**, and go for “**storage**”, do as follow and select the **.iso** image of **android 4.4 kitkat RC2**.
![Select Android KitKat ISO](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-06.png)
Select Android KitKat ISO
**9.** Click on **OK**, and start the machine to boot the .iso image, choose “**Installation**” to start installing the system on the virtual machine.
![Select to Install Android Kit Kat](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-07.png)
Select to Install Android Kit Kat
**10.** Please select a partition to install Android-x86.
![Select Partition Drive](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-08.png)
Select Partition Drive
**11.** Now you will be prompted **cfdisk** which is a partitioning tool that we will use to create a new hard drive, so we can install android 4.4 on it, Click on “**New**”.
![Create New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-09.png)
Create New Partition
**12.** Choose “**Primary**” as partition type.
![Choose Primary Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-10.png)
Choose Primary Partition
**13.** Next, select the size of the partition.
![Select Size of Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-11.png)
Select Size of Partition
**14.** Now, we have to make the new hard drive bootable in order to be able to write changes to the disk, click on “**Bootable**” to give the bootable flag to the new partition, you wont notice any changes in fact but the bootable flag will be given to that partition.
![Make Partition Bootable](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-12.png)
Make Partition Bootable
**15.** After that, click on “**Write**” to write the changes to the hard drive.
![Apply Changes to Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-13.png)
Apply Changes to Partition
**16.** It will ask you if you are sure, write “**yes**” and click on **Enter**.
![Confirm Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-14.png)
Confirm Partition Changes
**17.** Now thats our new hard drive is created, now click on **Quit** and you will see something like this, select the partition that you created before in order to install android on it and hit **Enter**.
![Choose Partition to Install Android](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-15.png)
Choose Partition to Install Android
**18.** Choose “**ext3**” as a filesystem for the hard drive and format.
![Select Ext3 Partition Type](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-16.png)
Select Ext3 Partition Type
![Format Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-17.png)
Format Partition
**19.** You will be asked now if you want to install GRUB bootloader, of course you will select **Yes**, because if you dont, you wont be able to boot the new system, so choose “**Yes**” and hit **Enter**.
![Install Boot Loader GRUB](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-18.png)
Install Boot Loader GRUB
**20.** Finally, you will be asked if you want to make the **/system** partition writeable, choose Yes, it will help in a lot of things later after you install the system.
![Make Partition Writeable](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-19.png)
Make Partition Writeable
**21.** The installer will start its mission… after the installer finishes the job, choose Reboot, in my test, the “Run-Android x86” didnt work for me, so you have to reboot.
![Android Kit Kat Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-20.png)
Android Kit Kat Installation
**22.** Now thats we installed **Android 4.4 KitKat RC2** on our hard drive, the problem is now that VirtualBox will keep loading the **.iso** image file instead of booting from the virtual hard drive, so to fix this problem, go to **Settings**, under “**storage**” select the **.iso** file and remove it from the booting menu.
![Remove Android Kit Kat Image](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-21.png)
Remove Android Kit Kat Image
**23.** Now you can start the virtual machine with the installed android system.
![Start Android Kit Kat System](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-23.png)
Start Android Kit Kat System
![Android Splash Screen](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-24.png)
Android Splash Screen
**24.** Now you will start a wizard to configure some things before you start using **Android**. You will see a screen like this, Now the problem is, that the Mouse doesnt work in **android 4.4 KitKat**, that means that well be using our skills in keyboard, first choose the **language** you want using the **Up** and **Down** keys in the keyboard, and to go the next step, hit the **Right** arrow key and click **Enter**.
![Android Welcome Screen](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-31.png)
Android Welcome Screen
![Select WiFi Network](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-25.png)
Select WiFi Network
![Create Android Google Account](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-26.png)
Create Android Google Account
![Sign in Google Account](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-27.png)
Sign in Google Account
![Set Date and Time](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-28.png)
Set Date and Time
![Enter Your Details](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-29.png)
Enter Your Details
![Android 4.4 Kit Kat Home Screen](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Android-Kit-Kat-in-Linux-30.jpeg)
Android 4.4 Kit Kat Home Screen
Installing **Android x86** will be good for you if you dont have a smartphone and you want to use the **Play Store** apps easily, have you ever tried to install android x86? What was the results? Do you think that android may become a “**real operation system**” targeting PCs in the feature?
----------
![](http://1.gravatar.com/avatar/1374d0df45065e405e1b059d2fca04ff?s=80&d=blank&r=G)
[Hanny Helal][3]
A Linux & Foss user since 2010, working on many projects in the field of Free Software.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-android-kitkat-in-linux/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/
[2]:http://sourceforge.net/projects/android-x86/
[3]:http://www.tecmint.com/

View File

@ -0,0 +1,42 @@
Linux FAQs with Answers--How to define PATH environment variable for sudo commands
================================================================================
> **Question**: I built and installed a program in /usr/local/bin. The program requires root privilege to run. But when I try to run the program with sudo, I get "sudo: XXXXX: command not found" error. Somehow /usr/local/bin is not included in the PATH environment variable. How can I fix this problem?
When you run a program with sudo, the program is executed with a new, minimum environment for security reasons. That is, not all the environment variables you define are inherited to sudo commands. In case of PATH environment variable, it is reset to a new "default" PATH variable when sudo is used. So if the new default PATH variable does not include the folder where your program is, you will get "command not found" error with sudo.
To customize the default PATH variable for sudo session, open /etc/sudoers file with a text editor, and look for "secure_path". The value defined in "secure_path" will be used as the default PATH variable when you execute sudo commands.
So add any necessary path (e.g., /usr/local/bin) to "secure_path", and it will be passed to sudo commands.
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
This change will be effective immediately.
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/define-path-environment-variable-sudo-commands.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:
[2]:
[3]:
[4]:
[5]:
[6]:
[7]:
[8]:
[9]:
[10]:
[11]:
[12]:
[13]:
[14]:
[15]:
[16]:
[17]:
[18]:
[19]:
[20]:

View File

@ -0,0 +1,40 @@
Simple Dock GNOME Shell Extension Puts Your Fave Apps On The Desktop
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/screenshot_815_1.jpg)
**I love GNOME Shell, but what I dont love is having to rustle through a hidden screen to get at my favourite applications or switch between those I have running. **
It may make me sound awesomely retro, like a UX luddite, or like someone who has become far too accustomed to the usability of Unity but I, like many of you reading this, like having an app launcher/switcher accessible on the desktop. Its a familiar, fast way of working.
GNOME Shell is, by design, different. It tucks everything out of the way from the messaging centre and notifications, to workspaces and the apps list. Its a minimal aesthetic that makes sense: help users focus on what matters.
But for me, my desktop needs to be more than a glorified picture frame.
### The Beauty of GNOME Shell ###
Despite my own preferences, the decision to hide apps is part of the beauty of GNOME Shell. It ships with a default desktop experience that is user friendly, sane and predictable — but also thoroughly extensible. Because of this theres a huge array of add-ons catering to every need, niche and want, including traditional app menus, desktop docks and even an Ubuntu Unity Dash clone!
In this article Im just focusing on one add-on that caters to my needs: the aptly named **Simple Dock**. Simple Dock takes the GNOME Shell apps grid and favourites bar and puts it slap bang where I want it: on the desktop.
For now it only supports being positioned on the bottom of the screen, and only offers a minimal set of settings. While minimal, I feel these cover all of my needs:
- ntelligent auto hide
- Minimise/restore application windows
- Drag-and-drop favourites
- Button to launch activities overlay
Want it? Providing youre running GNOME Shell on Ubuntu 13.10 or above you can. Just head on over to the GNOME Extensions page linked to below in a supported browser (Firefox, GNOME Web, etc.) then slide the on-page switch from off to on.
- [Simple Dock on GNOME Shell Extensions][1]
To adjust the settings of Simple Dock hit the cog icon on the GNOME Extensions webpage listing for it or through a desktop application like GNOME Tweak Tool.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/07/simple-dock-gnome-shell-extension
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://extensions.gnome.org/extension/815/simple-dock/

View File

@ -0,0 +1,26 @@
放弃微软产品规范和ubuntu帮助慕尼黑省下数百万美元
=================================================
![jpg](https://camo.githubusercontent.com/fb9de25222893332a72f8d632cdeb70725e827ee/687474703a2f2f69312d6e6577732e736f667470656469612d7374617469632e636f6d2f696d616765732f6e657773322f43616e6f6e6963616c2d616e642d5562756e74752d48656c7065642d4d756e6963682d536176652d4d696c6c696f6e732d6f662d446f6c6c6172732d42792d4469746368696e672d4d6963726f736f66742d50726f64756374732d3435303537312d322e6a7067)
慕尼黑这座城市已经成为了从微软产品转向开源的最突出的城市管理案例之一而且规范和ubuntu为这次变革起了很大的作用
慕尼黑成功脱离了微软的依赖,但是他们为这次摆脱付出了价值不菲的代价。从微软产品转向开源的好处看起来似乎很昂贵,但是转变的成本比之后的产品升级显著要低,不仅如此,在未来,我们会发现这种做法更便宜
当你在像慕尼黑城市这种大城市尝试从一个专有解决方法转向开源的时候这可并不容易。因为慕尼黑拥有22个组织单位每个单位都有自己的IT部门更不要说各部门之间不同版本的应用程序
地方政府不能只采用一个Linux发行版本。第一次的尝试是在2006年伴随着Debian的回归但是特定的操作系统并没有一个可预测的发布时间表。这就是新操作系统LiMux产生的原因一个基于ubuntu的操作系统
“LiMux/开源项目是漫长而又反复的但是经过几年时间运行这种大型Linux我们意识到ubuntu才是最能满足我们需求的平台。通过结合开源软件的低成本和自由加以对我们需要的硬件和应用程序的持续支持这种做法才是这个项目成功的关键因素之一。当然最终要还有我们的政治家在项目始终给予的高度支持。”慕尼黑项目经理Peter Hofmann说道
截至2013年如果只考虑升级成本的话这个项目帮助慕尼黑节省了€1000万1360万美元。如果我们能过量化官方支持软件和其余隐藏成本的话这个数额显得有些多
眼下慕尼黑14000台PC机运行着LiMux而且数量还在持续增长。这很有可能影响其余德国城市在未来也这么做尤其是慕尼黑的邻国
慕尼黑当局采用了13年才完成这次变革但是最终事实证明这样做可以省下一大笔资金而且证明了Linux实际上是整个城市IT基础设施又好有免费的解决方案
----
via: http://news.softpedia.com/news/Canonical-and-Ubuntu-Helped-Munich-Save-Millions-of-Dollars-By-Ditching-Microsoft-Products-450571.shtml
译者译者ID 校对校对者ID
本文由 LCTT 原创翻译Linux中国 荣誉推出

View File

@ -1,3 +1,4 @@
@@ -1,63 +0,0 @@
Linux基础如何在命令行中查看目录的大小
=====================================================================
这是写给Liunx新用户的一系列文章中的第一篇在这系列文章我将会写一些对新用户来说非常好用的**Linux基础命令**。
@ -61,3 +62,4 @@ via: http://www.unixmen.com/linux-basics-find-size-directory-commands/
译者:[cvsher](https://github.com/cvsher) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出