<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Walker News &#187; Linux</title>
	<atom:link href="http://www.walkernews.net/category/software/operating-system/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.walkernews.net</link>
	<description>A capsule of walker's experience in life...</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:29:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Red Hat Enterprise Linux Swap Size Recommendation</title>
		<link>http://www.walkernews.net/2010/05/02/red-hat-enterprise-linux-swap-size-recommendation/</link>
		<comments>http://www.walkernews.net/2010/05/02/red-hat-enterprise-linux-swap-size-recommendation/#comments</comments>
		<pubDate>Sun, 02 May 2010 15:22:34 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=4468</guid>
		<description><![CDATA[How much the size of Linux swap partition should be allocated? ]]></description>
			<content:encoded><![CDATA[Are you looking for the recommended Linux swap partition size for a server with huge amount of RAM installed? Well, I have just stumbled upon one of such recommendation from RHEL documentation while I was actually looking for reference of previous topic.<br />
<span id="more-4468"></span><br />
Some of you, especially the veterans, might know there is this good old formula that suggest swap space size should be at least 1.5 times (some even said 2 times) of the RAM installed.<br />
<br />Nowadays, most of the brand new servers easily come with few tens to hundred gigabytes of RAM installed. Apparently, the required Linux swap file system size will be darn huge if to apply this formula and you wonder is this really needed and justified.<br />
<br />With reference to <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.5/html/Installation_Guide/ch04s19s04s02.html" target="_blank">RHEL 5.5 installation guide</a>, the new study suggests that the amount of swap space needed by a system is much depends on the memory workload running on that system.<br />
<br />This sound reasonable but not practical, as it is not easy to gauge memory workload before the system is running. Thus, the RHEL engineers suggest their own recommended swap space:<br />
<ul>
<li>Min. 2GB of swap space for system installed with 4GB of RAM or less</li>
<li>Min. 4GB of swap space for system installed with 4GB to 16GB of RAM</li>
<li>Min. 8GB of swap space for system installed with 16GB to 64GB of RAM</li>
<li>Min. 16GB of swap space for system installed with 64GB to 256GB of RAM</li>
<li>Min. 32GB of swap space for system installed with 256GB to 512GB of RAM</li>
</ul>
<br />In addition, the swap space should be spanned across multiple disk drives for the performance&#8217;s sake. <br />
<br />Although the reference is made for RHEL 5.5 running on x86, AMD64, and Intel64 system, I think it is worth for reference or applied with little adjustment if you&#8217;re not working with RHEL. But for CentOS users, you probably know that this reference should works too :-)<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2009/05/11/how-to-use-putty-generated-rsa-key-to-login-linux-openssh-server/" title="How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?">How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/04/06/how-to-fix-scp-and-ssh-login-prompt-is-very-slow-in-linux/" title="How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux">How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux</a></li><li><a href="http://www.walkernews.net/2009/02/08/using-ibm-db2-monitoring-tool-db2pd-to-document-database-server-profile/" title="Using IBM DB2 Monitoring Tool db2pd To Document Database Server Profile">Using IBM DB2 Monitoring Tool db2pd To Document Database Server Profile</a></li><li><a href="http://www.walkernews.net/2008/07/05/how-to-read-iso-image-file-in-linux/" title="How To Read ISO Image File In Linux">How To Read ISO Image File In Linux</a></li><li><a href="http://www.walkernews.net/2011/09/15/direct-download-windows-8-developer-preview-iso-image-files/" title="Direct Download Windows 8 Developer Preview ISO Image Files">Direct Download Windows 8 Developer Preview ISO Image Files</a></li><li><a href="http://www.walkernews.net/2011/07/17/how-to-receive-earthquake-alert-on-facebook-or-rss-feed-reader/" title="How To Receive Earthquake Alert On Facebook Or RSS Feed Reader?">How To Receive Earthquake Alert On Facebook Or RSS Feed Reader?</a></li><li><a href="http://www.walkernews.net/2011/06/20/use-google-public-dns-to-access-blocked-websites/" title="Use Google Public DNS To Access Blocked Websites">Use Google Public DNS To Access Blocked Websites</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2010/05/02/red-hat-enterprise-linux-swap-size-recommendation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Use ps Command To Find Top CPU And Memory Usage Of Processes?</title>
		<link>http://www.walkernews.net/2010/04/14/how-to-use-ps-command-to-find-top-cpu-and-memory-usage-of-processes/</link>
		<comments>http://www.walkernews.net/2010/04/14/how-to-use-ps-command-to-find-top-cpu-and-memory-usage-of-processes/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 17:54:34 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux Command]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=4413</guid>
		<description><![CDATA[Useful tips about how the ps command option switches are used to assist system administrator find out which running processes with top CPU and memory usage.]]></description>
			<content:encoded><![CDATA[The Linux system is slow because of high CPU utilization and memory is running low? Now, how to use the ps command to find out what are the running processes with top CPU and memory usage?<br />
<span id="more-4413"></span><br />
Well, there are no short of command line tools and GUI programs to find these out. But I think the ps command is one of the top 10 Linux commands and thus believe that most of UNIX/Linux users have came across ps command in the first day of UNIX/Linux introduction class.<br />
<br />But, how many users bother to type man ps and vet through the lengthy manual page for the available option switches?<br />
<br /><span class="subhead2">Customize the ps command output for the subject</span><br />
<br />I have tested this in RHEL5 Linux command prompt:<br />
<pre>
ps -eo <em>SFS</em> --sort <em>SFS</em>
</pre>
<br />where the <em>SFS</em> (short for Standard Format Specifiers) can be one or more of the following keywords. Take note that not all of these SFS are available for sorting, e.g. time.<br />
<ul>
<li><code>pid</code> to display the process ID of the process.<br />
&nbsp;</li>
<li><code>start</code> to display the time of command was started.<br />
&nbsp;</li>
<li><code>time</code> is an alias of cputime and is better alternative to bsdtime; to display the cumulative CPU time (user and system) in [dd-]hh:mm:ss format.<br />
&nbsp;</li>
<li><code>rss</code> to display the process&#8217;s Resident Set Size (RSS) in KB. RSS is regarded as non-swapped physical memory taken by a process.<br />
&nbsp;</li>
<li><code>vsz</code> to display virtual memory size of the process in KB, excluding the device mappings.<br />
&nbsp;</li>
<li><code>cmd</code> to display the running command or process and its specified arguments.<br />
&nbsp;</li>
<li><code>comm</code> to display the running command or process but exclude its specified arguments.</li>
</ul>
<br /><span class="subhead2">The ps command example</span><br />
<br />To find out top processes in term of physical memory usage in Linux system, type this:<br />
<pre>
ps -eo pid,rss,comm --sort rss
</pre>
<br />As the standard format specifiers <code>time</code> is not available for sorting, it is a bit troublesome if uses ps command to find top CPU usage of processes. E.g. to find Linux processes that use more than 5 minutes of CPU time: <br />
<pre>
ps -eo pid,time,comm | grep -v 00:0[0-5]
</pre>
<br />Other than the 7 standard format specifiers mentioned above for used with -o option switch of ps command, there are many more (e.g. cputime, bsdtime, etc) covered in <code>man ps</code> that might be interesting and useful to you.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2010/02/24/how-to-change-linux-command-prompt-color/" title="How To Change Linux Command Prompt Color?">How To Change Linux Command Prompt Color?</a></li><li><a href="http://www.walkernews.net/2010/02/23/how-to-display-date-and-time-in-linux-history-command-output/" title="How To Display Date And Time In Linux History Command Output?">How To Display Date And Time In Linux History Command Output?</a></li><li><a href="http://www.walkernews.net/2009/03/11/get-linux-ls-command-to-show-file-timestamp-in-detail-of-seconds/" title="Get Linux Ls Command To Show File Timestamp In Detail Of Seconds">Get Linux Ls Command To Show File Timestamp In Detail Of Seconds</a></li><li><a href="http://www.walkernews.net/2009/02/02/using-linux-awk-regular-expression-to-read-big-log-file/" title="Using Linux Awk Regular Expression To Read Big Log File">Using Linux Awk Regular Expression To Read Big Log File</a></li><li><a href="http://www.walkernews.net/2008/12/04/customize-linux-command-prompt-to-differentiate-between-live-and-test-servers/" title="Customize Linux Command Prompt To Differentiate Between Live And Test Servers">Customize Linux Command Prompt To Differentiate Between Live And Test Servers</a></li><li><a href="http://www.walkernews.net/2008/08/30/gnu-date-generates-consistent-unix-epoch-time-between-time-zones/" title="GNU Date Generates Consistent UNIX Epoch Time Between Time Zones">GNU Date Generates Consistent UNIX Epoch Time Between Time Zones</a></li><li><a href="http://www.walkernews.net/2008/07/06/how-to-create-iso-image-of-directory-or-filesystem-in-linux/" title="How To Create An ISO Image Of Directory / Filesystem In Linux">How To Create An ISO Image Of Directory / Filesystem In Linux</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2010/04/14/how-to-use-ps-command-to-find-top-cpu-and-memory-usage-of-processes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Change Linux Command Prompt Color?</title>
		<link>http://www.walkernews.net/2010/02/24/how-to-change-linux-command-prompt-color/</link>
		<comments>http://www.walkernews.net/2010/02/24/how-to-change-linux-command-prompt-color/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:09:06 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux Command]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=4123</guid>
		<description><![CDATA[Can you customize the Linux Command Prompt message and color for different users? Yes, why not.]]></description>
			<content:encoded><![CDATA[The trick to customize Linux command prompt color and message is kinda useful for system administrator or developer who has access to live and testing servers. The difference of Linux prompt color and message between production server and staging server could alert users which system they are working on.<br />
<span id="more-4123"></span><br />
<span class="subhead2">The tips to customize Linux command prompt color</span><br />
<br /><img src="http://www.walkernews.net/wp-content/uploads/2010/02/Linux-Command-Prompt-Color.gif" alt="The color chart of IBM is useful for system administrator to easily customize the Linux system command prompt color with valid color code." title="The color chart of IBM is useful for system administrator to easily customize the Linux system command prompt color with valid color code." width="486" height="335" /><br />
<br />With reference to <a href="http://www.ibm.com/developerworks/linux/library/l-tip-prompt/" target="_blank" rel="bookmark">IBM Tip: Prompt magic</a> and the nice color chart, I have applied the following Linux system prompt customization to /etc/profile on all Linux production servers (hopefully someone who do remote access to any one of these live systems will be vividly alerted that this is not a staging or testing server):<br />
<pre>
export PS1="\[[\e[<span style="color:#00F;font-weight:bold;">1</span>;<span style="color:#F00;font-weight:bold;">33</span>m\]\u@\[\e[<span style="color:#00F;font-weight:bold;">1</span>;<span style="color:#F00;font-weight:bold;">36;41</span>m\]\H\[\e[0m\] \W] "
</pre>
<br />If you are not happy with the Linux system prompt color I choose, just change the number in red to other color code, with reference to the color chart above, where 30-37 is foreground color code (text color) and 40-47 is background color code. <br />
<br />The number in blue can be either 0 or 1, where 0 means to reset the Linux system prompt settings to default value (e.g. foreground, background, and boldness) and 1 means to print text with bold font type.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2010/04/14/how-to-use-ps-command-to-find-top-cpu-and-memory-usage-of-processes/" title="How To Use ps Command To Find Top CPU And Memory Usage Of Processes?">How To Use ps Command To Find Top CPU And Memory Usage Of Processes?</a></li><li><a href="http://www.walkernews.net/2010/02/23/how-to-display-date-and-time-in-linux-history-command-output/" title="How To Display Date And Time In Linux History Command Output?">How To Display Date And Time In Linux History Command Output?</a></li><li><a href="http://www.walkernews.net/2009/03/11/get-linux-ls-command-to-show-file-timestamp-in-detail-of-seconds/" title="Get Linux Ls Command To Show File Timestamp In Detail Of Seconds">Get Linux Ls Command To Show File Timestamp In Detail Of Seconds</a></li><li><a href="http://www.walkernews.net/2009/02/02/using-linux-awk-regular-expression-to-read-big-log-file/" title="Using Linux Awk Regular Expression To Read Big Log File">Using Linux Awk Regular Expression To Read Big Log File</a></li><li><a href="http://www.walkernews.net/2008/12/04/customize-linux-command-prompt-to-differentiate-between-live-and-test-servers/" title="Customize Linux Command Prompt To Differentiate Between Live And Test Servers">Customize Linux Command Prompt To Differentiate Between Live And Test Servers</a></li><li><a href="http://www.walkernews.net/2008/08/30/gnu-date-generates-consistent-unix-epoch-time-between-time-zones/" title="GNU Date Generates Consistent UNIX Epoch Time Between Time Zones">GNU Date Generates Consistent UNIX Epoch Time Between Time Zones</a></li><li><a href="http://www.walkernews.net/2008/07/06/how-to-create-iso-image-of-directory-or-filesystem-in-linux/" title="How To Create An ISO Image Of Directory / Filesystem In Linux">How To Create An ISO Image Of Directory / Filesystem In Linux</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2010/02/24/how-to-change-linux-command-prompt-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Display Date And Time In Linux History Command Output?</title>
		<link>http://www.walkernews.net/2010/02/23/how-to-display-date-and-time-in-linux-history-command-output/</link>
		<comments>http://www.walkernews.net/2010/02/23/how-to-display-date-and-time-in-linux-history-command-output/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 13:44:12 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux Command]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=4116</guid>
		<description><![CDATA[The tips to display timestamp in Linux history command output.]]></description>
			<content:encoded><![CDATA[There is a trick to display timestamp in Linux history command output. With this feature turned on, one can easily understand or review what commands have been executed, on which date at what time, in the Linux system in question.<br />
<span id="more-4116"></span><br />
By default, however, the history command is not enabled to display date and time of each command executed in Red Hat, as with most Linux distributions.<br />
<br />Anyway, it is not complicated to turn on the chronological feature of history command in Linux; even a novice can do it in no time.<br />
<br /><span class="subhead2">The trick to display timestamp in Linux history command output</span><br />
<br /><img src="http://www.walkernews.net/wp-content/uploads/2010/02/Linux-History-Command-With-Timestamp.jpg" alt="Configure shell variable HISTTIMEFORMAT to display timestamp of each executed command in the Linux history command output." title="Configure shell variable HISTTIMEFORMAT to display timestamp of each executed command in the Linux history command output." width="493" height="116" /><br />
<br />To include standard timestamp format in history command output, as shown in above screenshot, all you have to do is login as root to open <span class="fpath">/etc/profile</span> with vi editor (or any Linux text file editor you&#8217;re comfortable with) and add this following line:<br />
<pre>
export HISTTIMEFORMAT='%F %T >> '
</pre>
<br />This single magic command line exports the shell environment variable HISTTIMEFORMAT globally, so that every Linux users will able to see their respective command execution history with date and time information.<br />
<br />If you are not system administrator or not a root user in Linux system but would like to see timestamp in history command output, just add that magic line in your own account profile, for example the <span class="fpath">$HOME/.bash_profile</span> if you&#8217;re using Bash Shell. You should able to see the timestamp in history command output after logout and login (or if you execute <code>export HISTTIMEFORMAT='%F %T >> '</code> in command line).<br />
<br />The value of HISTTIMEFORMAT is a format string used by strftime. If you like to further customize the date/time format in history command output, just run <code>man 3 strftime</code> to get detail of timestamp string format that is valid for HISTTIMEFORMAT.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2010/04/14/how-to-use-ps-command-to-find-top-cpu-and-memory-usage-of-processes/" title="How To Use ps Command To Find Top CPU And Memory Usage Of Processes?">How To Use ps Command To Find Top CPU And Memory Usage Of Processes?</a></li><li><a href="http://www.walkernews.net/2010/02/24/how-to-change-linux-command-prompt-color/" title="How To Change Linux Command Prompt Color?">How To Change Linux Command Prompt Color?</a></li><li><a href="http://www.walkernews.net/2009/03/11/get-linux-ls-command-to-show-file-timestamp-in-detail-of-seconds/" title="Get Linux Ls Command To Show File Timestamp In Detail Of Seconds">Get Linux Ls Command To Show File Timestamp In Detail Of Seconds</a></li><li><a href="http://www.walkernews.net/2009/02/02/using-linux-awk-regular-expression-to-read-big-log-file/" title="Using Linux Awk Regular Expression To Read Big Log File">Using Linux Awk Regular Expression To Read Big Log File</a></li><li><a href="http://www.walkernews.net/2008/12/04/customize-linux-command-prompt-to-differentiate-between-live-and-test-servers/" title="Customize Linux Command Prompt To Differentiate Between Live And Test Servers">Customize Linux Command Prompt To Differentiate Between Live And Test Servers</a></li><li><a href="http://www.walkernews.net/2008/08/30/gnu-date-generates-consistent-unix-epoch-time-between-time-zones/" title="GNU Date Generates Consistent UNIX Epoch Time Between Time Zones">GNU Date Generates Consistent UNIX Epoch Time Between Time Zones</a></li><li><a href="http://www.walkernews.net/2008/07/06/how-to-create-iso-image-of-directory-or-filesystem-in-linux/" title="How To Create An ISO Image Of Directory / Filesystem In Linux">How To Create An ISO Image Of Directory / Filesystem In Linux</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2010/02/23/how-to-display-date-and-time-in-linux-history-command-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customize Linux Command Prompt To Differentiate Between Live And Test Servers</title>
		<link>http://www.walkernews.net/2008/12/04/customize-linux-command-prompt-to-differentiate-between-live-and-test-servers/</link>
		<comments>http://www.walkernews.net/2008/12/04/customize-linux-command-prompt-to-differentiate-between-live-and-test-servers/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 18:34:27 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[Environment Variable]]></category>
		<category><![CDATA[Linux Command]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=1535</guid>
		<description><![CDATA[It's possible to customize Linux command shell prompt with $PS1 environment variable, which could be useful to identity a live or test server you're working on.]]></description>
			<content:encoded><![CDATA[It&#8217;s not uncommon a <a href="http://www.walkernews.net/2008/11/21/how-to-check-what-kernel-build-options-enabled-in-the-linux-kernel/" title="How could system administrator check the Linux kernel build options configure for the server?" rel="bookmark">Linux administrator</a> initiate <a href="http://www.walkernews.net/2007/08/23/how-to-copy-file-over-remote-desktop-connection/" title="How to copy files from Remote Desktop session to local computer." rel="bookmark">remote connection</a> to test server and live servers concurrently, especially when migrating settings or data from test server to production machine.<br />
<span id="more-1535"></span><br />
To avoid any mistakes that could bring disaster, sysadmin has to be very alert on which <!--wgadh3-->remote session he/she is working on. Otherwise, settings that should be applied in test server may accidentally deploy to live server before UAT passed, or vice-versa.<br />
<br />If you&#8217;re such a sysadmin who deal with <a href="http://www.walkernews.net/2007/03/29/brighten-linux-ls-command-output-with-ls_colors/" title="How to brighten the text appears in Linux command shell prompt?" rel="bookmark">Linux command</a> shell at most of time, isn&#8217;t it better to customize the command shell prompt of test server. For example, change the colour of the Linux command shell prompt to appear with outstanding visual effect, so that you could easily identify a test server and live server when switching <a href="http://www.walkernews.net/2007/07/30/setup-remote-desktop-port-forwarding/" title="How to configure Putty to support SSH port forwarding for Remote Desktop?" rel="bookmark">Putty</a> windows.<br />
<br /><span class="subhead">How to change colour of Linux command shell prompt?</span><br />
<br /><img style="float:left;margin:0 5px 0 0;" src="http://www.walkernews.net/wp-content/uploads/2008/12/linux-command-prompt.jpg" alt="How to change the colour of Linux command shell prompt and highlight it?" title="How to change the colour of Linux command shell prompt and highlight it?" width="248" height="175" class="size-full wp-image-1538" />Linux command shell prompt is defined by $PS1 environment variable, which the variable content can be viewed by executing <code>echo $PS1</code> or <code>env | grep PS1</code> or <code>set | grep PS1</code>.<br />
<br />By default, Red Hat Linux define $PS1 as <span class="fpath">[\u@\h \W]\$</span>, which means the Linux command shell prompt appears with pattern <span class="fpath">[user@hostname directory]</span>.<br />
<br />So, we have to insert the terminal colour code into the $PS1 environment variable. For example, execute this command (or append it to <span class="fpath">.bash_profile</span>):<br />
<pre>
export PS1="\\e[1;33;44m[\u@\h \W]\$\\e[m "
</pre>
<br />not only change colour of text but also highlight the text of Linux command shell prompt, as shown in the screenshot (above).<br />
<br />As you could compare the original and tweaked $PS1 variable value, the different is the prefix<br />
<pre>
\\e[1;33;44m
</pre>
<br />and the suffix<br />
<pre>
\\e[m
</pre>
<br />Where the <code>\\e[</code> indicate the start of &#8220;colour code&#8221; and <code>m</code> character is to indicate the end of &#8220;colour code&#8221;.<br />
<br />The suffix <code>\\e[m</code> simply tells Linux command shell to stop using the earlier &#8220;colour code&#8221; and revert it back to original terminal colour.<br />
<br />The &#8220;colour code&#8221; can be in one of these patterns &#8211; <span class="fpath">x;y</span> (to change the colour of text only) or <span class="fpath">x;y;z</span> (to change the colour of text and highlight it).<br />
<br />Some of the valid x;y colour code are 0;30 (black), 0;31 (red), 0;32 (green), 0;33 (brown), 0;34 (blue), 0;35 (purple), 0;36 (cyan), 0;37 (light gray), 1;31 (light red), 1;32 (light green), 1;33 (yellow), 1;34 (light blue), 1;35 (pink), 1;36 (light cyan), 1;37 (white).<br />
<br />And the <span class="fpath">z</span> value can be ranging from 40 up to 47, inclusively. For example, 40 is black, 41 is red, 42 is green, etc.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2008/07/05/how-to-read-iso-image-file-in-linux/" title="How To Read ISO Image File In Linux">How To Read ISO Image File In Linux</a></li><li><a href="http://www.walkernews.net/2009/03/11/get-linux-ls-command-to-show-file-timestamp-in-detail-of-seconds/" title="Get Linux Ls Command To Show File Timestamp In Detail Of Seconds">Get Linux Ls Command To Show File Timestamp In Detail Of Seconds</a></li><li><a href="http://www.walkernews.net/2009/02/02/using-linux-awk-regular-expression-to-read-big-log-file/" title="Using Linux Awk Regular Expression To Read Big Log File">Using Linux Awk Regular Expression To Read Big Log File</a></li><li><a href="http://www.walkernews.net/2009/05/11/how-to-use-putty-generated-rsa-key-to-login-linux-openssh-server/" title="How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?">How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/05/10/red-hat-linux-5-man-page-displays-weird-characters/" title="Red Hat Linux 5 Man Page Displays Weird Characters">Red Hat Linux 5 Man Page Displays Weird Characters</a></li><li><a href="http://www.walkernews.net/2009/05/03/how-to-create-putty-based-rsa-public-key-for-openssh-server/" title="How To Create Putty-based RSA Public-key For OpenSSH Server?">How To Create Putty-based RSA Public-key For OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/05/02/how-to-regenerate-putty-based-rsa-public-key-from-its-private-key/" title="How To Regenerate Putty-based RSA Public-key From Its Private-key?">How To Regenerate Putty-based RSA Public-key From Its Private-key?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2008/12/04/customize-linux-command-prompt-to-differentiate-between-live-and-test-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Check What Kernel Build Options Enabled In The Linux Kernel?</title>
		<link>http://www.walkernews.net/2008/11/21/how-to-check-what-kernel-build-options-enabled-in-the-linux-kernel/</link>
		<comments>http://www.walkernews.net/2008/11/21/how-to-check-what-kernel-build-options-enabled-in-the-linux-kernel/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 16:41:07 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[KnowHow]]></category>
		<category><![CDATA[Linux Kernel]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=1433</guid>
		<description><![CDATA[Do you what Kernel Build Options are enabled or used to compile the Linux kernel on your system? How to check it out if a Linux program requires a specific Kernel Build Option to run?]]></description>
			<content:encoded><![CDATA[Linux Kernel Build Options is the list of optional Linux kernel features that a system engineer can explicitly turn on or off during kernel compilation.<br />
<span id="more-1433"></span><br />
By selectively enabling Kernel Build Options, Linux administrator can build an optimized Linux kernel for <!--wgadh3-->a specific system crafted for particular purpose (e.g. Linux firewall, router, database server, etc).<br />
<br />Now, how could you tell what are the Kernel Build Options enabled in the Linux kernel running on production server, if you did not build it?<br />
<br />My ex-co phoned me just now and asked how could he check or confirm his <a href="http://www.walkernews.net/2008/01/15/how-to-install-rhel4-in-hp-netserver-lh3000/" title="How to install RHEL 4 in HP NetServer LH 3000 that using Megaraid SCSI driver?" rel="bookmark">Red Hat Enterprise Linux</a> server supports the &#8220;secret&#8221; Linux magic SysRq key, which requires CONFIG_MAGIC_SYSRQ option enabled at kernel compile time.<br />
<blockquote>
The magic SysRq key is a key combination using the SysRq key (Print Screen) that allows user to perform low-level commands regardless of the Linux kernel&#8217;s state (hang or panic).
</blockquote>
<br />Since it&#8217;s a standard RHEL installation, I suggested him to take a look on Linux kernel configuration file that installed to <span class="fpath">/boot</span> partition.<br />
<blockquote>
It&#8217;s a (recommended) practice of copying Linux kernel configuration file to <span class="fpath">/boot</span> partition each time after the kernel image is compiled and installed to this partition, to serve purpose of documentation and reference.
</blockquote>
<br />In his RHEL 4 server, there two config files exists in <span class="fpath">/boot</span> partition, one for SMP and another one is setup for non-SMP kernel compilation.<br />
<br />For accuracy, execute <code>uname -r</code> to print the kernel release and look for the corresponding config file of kernel release reported by <span class="fpath">uname -r</span> command (as shown in the screenshot):<br />
<br /><div style="max-width:500px;"><img src="http://www.walkernews.net/wp-content/uploads/2008/11/linux-kernel-build-option.jpg" alt="How to verify some specific Linux Kernel Build Options are enabled for the running Linux kernel?" title="How to verify some specific Linux Kernel Build Options are enabled for the running Linux kernel?" width="351" height="97" class="size-full wp-image-1435" /></div><sup>How to verify some specific Linux Kernel Build Options are enabled for the running Linux kernel?</sup><br />
<br />In this case, the correct Linux kernel configuration to look for is <span class="fpath">/boot/config-2.6.9-42.ELsmp</span> and this command confirms that his RHEL4 kernel supports the magic SysRq key:<br />
<pre>
cat /boot/config-2.6.9-42.ELsmp | grep CONFIG_MAGIC_SYSRQ
</pre>
<br />He can enable or disable this supported feature by manipulating <span class="fpath">/proc/sys/kernel/sysrq</span> or <span class="fpath">kernel.sysrq</span>.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2008/11/20/how-to-fix-telnet-rejection-error-of-name-or-service-not-known-illegal-seek/" title="How To Fix Telnet Rejection Error of Name or Service Not Known: Illegal Seek">How To Fix Telnet Rejection Error of Name or Service Not Known: Illegal Seek</a></li><li><a href="http://www.walkernews.net/2008/11/19/how-to-install-and-start-telnet-server-in-red-hat-linux/" title="How To Install And Start Telnet Server In Red Hat Linux?">How To Install And Start Telnet Server In Red Hat Linux?</a></li><li><a href="http://www.walkernews.net/2009/03/18/how-to-allow-root-login-to-telnet-server-in-linux/" title="How To Allow Root Login To Telnet Server In Linux?">How To Allow Root Login To Telnet Server In Linux?</a></li><li><a href="http://www.walkernews.net/2009/02/08/using-ibm-db2-monitoring-tool-db2pd-to-document-database-server-profile/" title="Using IBM DB2 Monitoring Tool db2pd To Document Database Server Profile">Using IBM DB2 Monitoring Tool db2pd To Document Database Server Profile</a></li><li><a href="http://www.walkernews.net/2009/02/02/using-linux-awk-regular-expression-to-read-big-log-file/" title="Using Linux Awk Regular Expression To Read Big Log File">Using Linux Awk Regular Expression To Read Big Log File</a></li><li><a href="http://www.walkernews.net/2008/11/06/linux-how-to-backup-and-restore-directory-with-tar-over-ssh-connection/" title="Linux: How To Backup And Restore Directory With Tar Over SSH Connection?">Linux: How To Backup And Restore Directory With Tar Over SSH Connection?</a></li><li><a href="http://www.walkernews.net/2009/05/11/how-to-use-putty-generated-rsa-key-to-login-linux-openssh-server/" title="How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?">How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2008/11/21/how-to-check-what-kernel-build-options-enabled-in-the-linux-kernel/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Fix Telnet Rejection Error of Name or Service Not Known: Illegal Seek</title>
		<link>http://www.walkernews.net/2008/11/20/how-to-fix-telnet-rejection-error-of-name-or-service-not-known-illegal-seek/</link>
		<comments>http://www.walkernews.net/2008/11/20/how-to-fix-telnet-rejection-error-of-name-or-service-not-known-illegal-seek/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 17:16:08 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[KnowHow]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[Remote Access]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[Telnet]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=1411</guid>
		<description><![CDATA[What happen if you telnet clients unable to remote access Linux server, with an error message that says "Name or service not known: illegal seek".]]></description>
			<content:encoded><![CDATA[We all know that telnet is a good remote access protocol in the old days. Now, we prefer <a href="http://www.walkernews.net/2007/07/22/ssh-port-forwarding-local-vs-remote/" title="SSH Local Port Forwarding VS Remote Port Forwarding" rel="bookmark">SSH protocol</a> because SSH is a secure protocol, i.e. it’s not easy to hack.<br />
<span id="more-1411"></span><br />
However, for some reasons, telnet server still installed for some (Microsoft Windows) users who <!--wgadh3-->desperately need remote access facility. (Maybe telnet server will go into history when Windows start to bundle <a href="http://www.walkernews.net/2008/06/05/configure-putty-to-support-password-less-ssh-login/" title="Configure Putty to support non-interactive or password-less SSH login" rel="bookmark">Putty</a> or its own SSH client).<br />
<br />So, this is what happen here, that we have to <a href="http://www.walkernews.net/2008/11/19/how-to-install-and-start-telnet-server-in-red-hat-linux/" title="How to install and enable telnet server in Red Hat Linux?" rel="bookmark">install and enable the insecure telnet server</a> on all <a href="http://www.walkernews.net/2008/01/15/how-to-install-rhel4-in-hp-netserver-lh3000/" title="How to install RHEL4 in my bloody HP NetServer LH3000" rel="bookmark">Red Hat Enterprise Linux</a> servers, for obvious reason.<br />
<br />Problem happen today when one user reported that he cannot telnet to the server, with an rejection error message that said &#8220;GetAddrInfo: <em>&lt;hostname&gt;</em>: Success. Name or service not known: Illegal seek&#8221; (as seen in the following screenshot taken when I telnet to localhost in a SSH session):<br />
<br /><img style="float:left;margin:0 5px 0 0;" src="http://www.walkernews.net/wp-content/uploads/2008/11/telnet-error.jpg" alt="Linux telnet server rejected client connection with error message saying Name or service not known: Illegal seek." title="Linux telnet server rejected client connection with error message saying Name or service not known: Illegal seek." width="350" height="122" class="size-full wp-image-1414" />How to fix this so-called &#8220;Name or service not known: Illegal seek&#8221; error (replied by the telnet daemon)?<br />
<br />Well, I guess this has something to do with DNS resolution. It was working fine until we changed the Linux hostname on yesterday. The hostname is not registered to <a href="http://www.walkernews.net/2007/06/29/how-to-setup-tinydns-server-for-soho/" title="How to setup TinyDNS server in 3 minutes." rel="bookmark">DNS servers</a> that defined in <span class="fpath">/etc/resolv.conf</span> file and there is no hostname-to-IP mapping in <span class="fpath">/etc/hosts</span> file as well.<br />
<br />So, to try out the possible solution, I <span class="subhead2">add in hostname-to-IP mapping in <span class="fpath">/etc/hosts</span> file, and it works</span>:<br />
<pre>
192.168.20.21      WalkerNews      WalkerNews.net
</pre>
<br />[ assuming the hostname is <a href="http://www.walkernews.net/" title="WalkerNews.net - A capsule of Walker experience in life." rel="bookmark">WalkerNews</a> and its IP address is 192.168.20.21]<br />
<br />I am not sure (because I haven&#8217;t tried) the problem will be fixed, if I remove the hostname-IP mapping in <span class="fpath">/etc/hosts</span> and register the hostname-IP to DNS servers that defined in <span class="fpath">/etc/resolv.conf</span> file. (I bet this will work, too).<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2009/03/18/how-to-allow-root-login-to-telnet-server-in-linux/" title="How To Allow Root Login To Telnet Server In Linux?">How To Allow Root Login To Telnet Server In Linux?</a></li><li><a href="http://www.walkernews.net/2008/11/19/how-to-install-and-start-telnet-server-in-red-hat-linux/" title="How To Install And Start Telnet Server In Red Hat Linux?">How To Install And Start Telnet Server In Red Hat Linux?</a></li><li><a href="http://www.walkernews.net/2008/11/21/how-to-check-what-kernel-build-options-enabled-in-the-linux-kernel/" title="How To Check What Kernel Build Options Enabled In The Linux Kernel?">How To Check What Kernel Build Options Enabled In The Linux Kernel?</a></li><li><a href="http://www.walkernews.net/2009/05/11/how-to-use-putty-generated-rsa-key-to-login-linux-openssh-server/" title="How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?">How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/05/03/how-to-create-putty-based-rsa-public-key-for-openssh-server/" title="How To Create Putty-based RSA Public-key For OpenSSH Server?">How To Create Putty-based RSA Public-key For OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/04/06/how-to-fix-scp-and-ssh-login-prompt-is-very-slow-in-linux/" title="How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux">How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux</a></li><li><a href="http://www.walkernews.net/2009/04/03/how-to-restart-vnc-server-after-vnc-service-hangs-or-stops-unexpectedly/" title="How To Restart VNC Server After VNC Service Hangs or Stops Unexpectedly?">How To Restart VNC Server After VNC Service Hangs or Stops Unexpectedly?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2008/11/20/how-to-fix-telnet-rejection-error-of-name-or-service-not-known-illegal-seek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

