<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Linux Ask!</title>
	
	<link>http://www.linuxask.com</link>
	<description>Linux Ask! is a Q &amp; A web site specific for Linux related questions such as how to use common Linux commands.</description>
	<lastBuildDate>Wed, 08 Sep 2010 16:01:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/linuxask" /><feedburner:info uri="linuxask" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/</creativeCommons:license><item>
		<title>Generate UUID in PHP</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/VUZcKQxbyHA/generate-uuid-in-php</link>
		<comments>http://www.linuxask.com/questions/generate-uuid-in-php#comments</comments>
		<pubDate>Wed, 08 Sep 2010 16:01:59 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2234</guid>
		<description><![CDATA[Generate UUID in PHP
Answer:
To generate UUID in PHP, you can try the script below:
&#60;?php

function uuid($prefix = '') {
    $chars = md5(uniqid(mt_rand(), true));
    $uuid  = substr($chars,0,8) . '-';
    $uuid .= substr($chars,8,4) . '-';
    $uuid .= substr($chars,12,4) . '-';
    $uuid .= [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/generate-uuid-in-linux' rel='bookmark' title='Permanent Link: Generate UUID in Linux'>Generate UUID in Linux</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-list-all-the-uuid-of-my-hard-disks' rel='bookmark' title='Permanent Link: How to list all the UUID of my hard disks'>How to list all the UUID of my hard disks</a></li>
<li><a href='http://www.linuxask.com/questions/mount-a-filesystem-by-uuid-in-linux' rel='bookmark' title='Permanent Link: Mount a filesystem by UUID in Linux'>Mount a filesystem by UUID in Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Generate UUID in PHP</p>
<p><strong>Answer:</strong></p>
<p>To generate <strong>UUID </strong>in PHP, you can try the script below:</p>
<pre><code>&lt;?php

function uuid($prefix = '') {
    $chars = md5(uniqid(mt_rand(), true));
    $uuid  = substr($chars,0,8) . '-';
    $uuid .= substr($chars,8,4) . '-';
    $uuid .= substr($chars,12,4) . '-';
    $uuid .= substr($chars,16,4) . '-';
    $uuid .= substr($chars,20,12);
    return $prefix . $uuid;
}

echo uuid();
</code></pre>
<p>It shows something like the following when executed:</p>
<p><code>c664b9b4-6c44-c8d9-acf9-93ef0e11e435</code></p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/generate-uuid-in-linux' rel='bookmark' title='Permanent Link: Generate UUID in Linux'>Generate UUID in Linux</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-list-all-the-uuid-of-my-hard-disks' rel='bookmark' title='Permanent Link: How to list all the UUID of my hard disks'>How to list all the UUID of my hard disks</a></li>
<li><a href='http://www.linuxask.com/questions/mount-a-filesystem-by-uuid-in-linux' rel='bookmark' title='Permanent Link: Mount a filesystem by UUID in Linux'>Mount a filesystem by UUID in Linux</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/VUZcKQxbyHA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/generate-uuid-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/generate-uuid-in-php</feedburner:origLink></item>
		<item>
		<title>A command that do nothing</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/ngysSPJ0GuA/a-command-that-do-nothing</link>
		<comments>http://www.linuxask.com/questions/a-command-that-do-nothing#comments</comments>
		<pubDate>Tue, 07 Sep 2010 13:11:05 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[gnu]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2258</guid>
		<description><![CDATA[A command that do nothing
Answer:
In GNU/Linux, there is a command that do nothing, unsuccessfully - the false command.
E.g.
# false
It is common to set the user shell to /bin/false if you don't want the user to login.
Reference: http://www.gnu.org/software/coreutils/manual/html_node/false-invocation.html


Related posts:How to resume a partially-downloaded file using wget
How to avoid SQL injection in PHP?
How to find where a [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/how-to-resume-a-partially-downloaded-file-using-wget' rel='bookmark' title='Permanent Link: How to resume a partially-downloaded file using wget'>How to resume a partially-downloaded file using wget</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-avoid-sql-injection-in-php' rel='bookmark' title='Permanent Link: How to avoid SQL injection in PHP?'>How to avoid SQL injection in PHP?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-find-where-a-command-is-stored-in-linux' rel='bookmark' title='Permanent Link: How to find where a command is stored in Linux'>How to find where a command is stored in Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A command that do nothing</p>
<p><strong>Answer:</strong></p>
<p>In GNU/Linux, there is a command that do nothing, unsuccessfully - the <strong>false </strong>command.</p>
<p>E.g.</p>
<pre><code># false</code></pre>
<p>It is common to set the user shell to <strong>/bin/false</strong> if you don't want the user to login.</p>
<p>Reference: <a href="http://www.gnu.org/software/coreutils/manual/html_node/false-invocation.html">http://www.gnu.org/software/coreutils/manual/html_node/false-invocation.html</a></p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/how-to-resume-a-partially-downloaded-file-using-wget' rel='bookmark' title='Permanent Link: How to resume a partially-downloaded file using wget'>How to resume a partially-downloaded file using wget</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-avoid-sql-injection-in-php' rel='bookmark' title='Permanent Link: How to avoid SQL injection in PHP?'>How to avoid SQL injection in PHP?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-find-where-a-command-is-stored-in-linux' rel='bookmark' title='Permanent Link: How to find where a command is stored in Linux'>How to find where a command is stored in Linux</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/ngysSPJ0GuA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/a-command-that-do-nothing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/a-command-that-do-nothing</feedburner:origLink></item>
		<item>
		<title>Clone an object in PHP</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/S5U2YJFFrz4/clone-an-object-in-php</link>
		<comments>http://www.linuxask.com/questions/clone-an-object-in-php#comments</comments>
		<pubDate>Mon, 06 Sep 2010 16:01:28 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2223</guid>
		<description><![CDATA[Clone an object in PHP
Answer:
It is easy to clone an object in PHP, using the following method.
&#60;?php

    $obj = new stdClass();
    $obj->foo = "foo";
    $obj->bar = "bar";

    $new_obj = clone $obj;
    var_dump ( new_obj );

It will print out...
object(stdClass)#2 (2) {
 [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/convert-array-to-object-in-php' rel='bookmark' title='Permanent Link: Convert array to object in PHP'>Convert array to object in PHP</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-avoid-sql-injection-in-php' rel='bookmark' title='Permanent Link: How to avoid SQL injection in PHP?'>How to avoid SQL injection in PHP?</a></li>
<li><a href='http://www.linuxask.com/questions/speedup-sed-search-and-replace' rel='bookmark' title='Permanent Link: Speedup sed search and replace'>Speedup sed search and replace</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Clone an object in PHP</p>
<p><strong>Answer:</strong></p>
<p>It is easy to <strong>clone an object</strong> in PHP, using the following method.</p>
<pre><code>&lt;?php

    $obj = new stdClass();
    $obj->foo = "foo";
    $obj->bar = "bar";

    $new_obj = clone $obj;
    var_dump ( new_obj );
</code></pre>
<p>It will print out...</p>
<pre><code>object(stdClass)#2 (2) {
  ["foo"]=>
  string(3) "foo"
  ["bar"]=>
  string(3) "bar"
}</code></pre>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/convert-array-to-object-in-php' rel='bookmark' title='Permanent Link: Convert array to object in PHP'>Convert array to object in PHP</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-avoid-sql-injection-in-php' rel='bookmark' title='Permanent Link: How to avoid SQL injection in PHP?'>How to avoid SQL injection in PHP?</a></li>
<li><a href='http://www.linuxask.com/questions/speedup-sed-search-and-replace' rel='bookmark' title='Permanent Link: Speedup sed search and replace'>Speedup sed search and replace</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/S5U2YJFFrz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/clone-an-object-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/clone-an-object-in-php</feedburner:origLink></item>
		<item>
		<title>Filter a list using grep in Perl</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/-4KYE__Jmrs/filter-a-list-using-grep-in-perl</link>
		<comments>http://www.linuxask.com/questions/filter-a-list-using-grep-in-perl#comments</comments>
		<pubDate>Sun, 05 Sep 2010 15:54:19 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2230</guid>
		<description><![CDATA[Filter a list using grep in Perl
Answer:
The Perl's grep function is very useful for list filtering.
E.g.  Array filtering
my @new = grep {$_ > 1} (1,2,3);

# @new contains 2, 3 only



Related posts:A simple array in Perl
List all the installed Perl modules
Array reference in Perl



Related posts:<ol><li><a href='http://www.linuxask.com/questions/a-simple-array-in-perl' rel='bookmark' title='Permanent Link: A simple array in Perl'>A simple array in Perl</a></li>
<li><a href='http://www.linuxask.com/questions/list-all-the-installed-perl-modules' rel='bookmark' title='Permanent Link: List all the installed Perl modules'>List all the installed Perl modules</a></li>
<li><a href='http://www.linuxask.com/questions/array-reference-in-perl' rel='bookmark' title='Permanent Link: Array reference in Perl'>Array reference in Perl</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Filter a list using grep in Perl</p>
<p><strong>Answer:</strong></p>
<p>The Perl's <strong>grep</strong> function is very useful for list filtering.</p>
<p>E.g.  <strong>Array filtering</strong></p>
<pre><code>my @new = grep {$_ > 1} (1,2,3);

# @new contains 2, 3 only
</code></pre>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/a-simple-array-in-perl' rel='bookmark' title='Permanent Link: A simple array in Perl'>A simple array in Perl</a></li>
<li><a href='http://www.linuxask.com/questions/list-all-the-installed-perl-modules' rel='bookmark' title='Permanent Link: List all the installed Perl modules'>List all the installed Perl modules</a></li>
<li><a href='http://www.linuxask.com/questions/array-reference-in-perl' rel='bookmark' title='Permanent Link: Array reference in Perl'>Array reference in Perl</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/-4KYE__Jmrs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/filter-a-list-using-grep-in-perl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/filter-a-list-using-grep-in-perl</feedburner:origLink></item>
		<item>
		<title>Yum repository mirror for old CentOS’ versions</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/ImEEZYXjh7Y/yum-repository-mirror-for-old-centos-versions</link>
		<comments>http://www.linuxask.com/questions/yum-repository-mirror-for-old-centos-versions#comments</comments>
		<pubDate>Sat, 04 Sep 2010 16:18:03 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2280</guid>
		<description><![CDATA[Yum repository mirror for old CentOS' versions
Answer:
Most CentOS' mirrors don't host full mirror of Yum repository for all versions of CentOS. If you are using older version of CentOS, you might one-day found the yum update is broken since the mirror no longer contains the files you needed.
In this case, you can modify the file [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/mirror-a-web-site-using-wget' rel='bookmark' title='Permanent Link: Mirror a web site using wget'>Mirror a web site using wget</a></li>
<li><a href='http://www.linuxask.com/questions/install-sun-java-jdk-in-ubuntu-10-04' rel='bookmark' title='Permanent Link: Install sun-java-jdk in Ubuntu 10.04'>Install sun-java-jdk in Ubuntu 10.04</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-mirror-a-directory-to-a-remote-server-over-ssh' rel='bookmark' title='Permanent Link: How to mirror a directory to a remote server over SSH?'>How to mirror a directory to a remote server over SSH?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Yum repository mirror for old CentOS' versions</p>
<p><strong>Answer:</strong></p>
<p>Most <strong>CentOS</strong>' mirrors don't host full mirror of <strong>Yum </strong>repository for all versions of CentOS. If you are using older version of CentOS, you might one-day found the yum update is broken since the mirror no longer contains the files you needed.</p>
<p>In this case, you can modify the file<strong> /etc/yum.repos.d/CentOS-Base.repo</strong> and change all paths point to the following:</p>
<pre><code>..
baseurl=http://vault.centos.org/...
..</code></pre>
<p>Then do a <strong>yum update</strong> to reflect the changes.</p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/mirror-a-web-site-using-wget' rel='bookmark' title='Permanent Link: Mirror a web site using wget'>Mirror a web site using wget</a></li>
<li><a href='http://www.linuxask.com/questions/install-sun-java-jdk-in-ubuntu-10-04' rel='bookmark' title='Permanent Link: Install sun-java-jdk in Ubuntu 10.04'>Install sun-java-jdk in Ubuntu 10.04</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-mirror-a-directory-to-a-remote-server-over-ssh' rel='bookmark' title='Permanent Link: How to mirror a directory to a remote server over SSH?'>How to mirror a directory to a remote server over SSH?</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/ImEEZYXjh7Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/yum-repository-mirror-for-old-centos-versions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/yum-repository-mirror-for-old-centos-versions</feedburner:origLink></item>
		<item>
		<title>Create an array containing a range of elements in PHP</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/qBPE23xElE0/create-an-array-containing-a-range-of-elements-in-php</link>
		<comments>http://www.linuxask.com/questions/create-an-array-containing-a-range-of-elements-in-php#comments</comments>
		<pubDate>Fri, 03 Sep 2010 14:13:47 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2224</guid>
		<description><![CDATA[Create an array containing a range of elements in PHP
Answer:
It is easy to create an array using the range() function, e.g.
&#60;?php

foreach (range(0, 10) as $number) {
        echo $number, " ";
}


It shows following when executed:
0 1 2 3 4 5 6 7 8 9 10


Related posts:A simple array in [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/a-simple-array-in-perl' rel='bookmark' title='Permanent Link: A simple array in Perl'>A simple array in Perl</a></li>
<li><a href='http://www.linuxask.com/questions/sort-an-array-by-key-in-php' rel='bookmark' title='Permanent Link: Sort an array by key in PHP'>Sort an array by key in PHP</a></li>
<li><a href='http://www.linuxask.com/questions/convert-array-to-object-in-php' rel='bookmark' title='Permanent Link: Convert array to object in PHP'>Convert array to object in PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Create an array containing a range of elements in PHP</p>
<p><strong>Answer:</strong></p>
<p>It is easy to create an array using the <strong>range()</strong> function, e.g.</p>
<pre><code>&lt;?php

foreach (range(0, 10) as $number) {
        echo $number, " ";
}

</code></pre>
<p>It shows following when executed:</p>
<p><code>0 1 2 3 4 5 6 7 8 9 10</code></p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/a-simple-array-in-perl' rel='bookmark' title='Permanent Link: A simple array in Perl'>A simple array in Perl</a></li>
<li><a href='http://www.linuxask.com/questions/sort-an-array-by-key-in-php' rel='bookmark' title='Permanent Link: Sort an array by key in PHP'>Sort an array by key in PHP</a></li>
<li><a href='http://www.linuxask.com/questions/convert-array-to-object-in-php' rel='bookmark' title='Permanent Link: Convert array to object in PHP'>Convert array to object in PHP</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/qBPE23xElE0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/create-an-array-containing-a-range-of-elements-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/create-an-array-containing-a-range-of-elements-in-php</feedburner:origLink></item>
		<item>
		<title>Simple try catch block in Perl</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/SVFH44LN-Ec/simple-try-catch-block-in-perl</link>
		<comments>http://www.linuxask.com/questions/simple-try-catch-block-in-perl#comments</comments>
		<pubDate>Thu, 02 Sep 2010 14:31:08 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2235</guid>
		<description><![CDATA[Simple try catch block in Perl
Answer:
Perl don't have try/catch statement by default, but you can simulate using the following way:
eval {
    print 1/0;
};

if ($@) {
    print "Error message: $@";
};

When executed, it shows:
Error message: Illegal division by zero at test.pl line 7.


Related posts:Run Perl with useful warnings
A simple array in [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/run-perl-with-useful-warnings' rel='bookmark' title='Permanent Link: Run Perl with useful warnings'>Run Perl with useful warnings</a></li>
<li><a href='http://www.linuxask.com/questions/a-simple-array-in-perl' rel='bookmark' title='Permanent Link: A simple array in Perl'>A simple array in Perl</a></li>
<li><a href='http://www.linuxask.com/questions/wide-character-in-print-warning-in-perl' rel='bookmark' title='Permanent Link: Wide character in print&#8230; warning in Perl'>Wide character in print&#8230; warning in Perl</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Simple try catch block in Perl</p>
<p><strong>Answer:</strong></p>
<p>Perl don't have <strong>try/catch</strong> statement by default, but you can simulate using the following way:</p>
<pre><code>eval {
    print 1/0;
};

if ($@) {
    print "Error message: $@";
};
</code></pre>
<p>When executed, it shows:</p>
<p><code>Error message: Illegal division by zero at test.pl line 7.</code></p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/run-perl-with-useful-warnings' rel='bookmark' title='Permanent Link: Run Perl with useful warnings'>Run Perl with useful warnings</a></li>
<li><a href='http://www.linuxask.com/questions/a-simple-array-in-perl' rel='bookmark' title='Permanent Link: A simple array in Perl'>A simple array in Perl</a></li>
<li><a href='http://www.linuxask.com/questions/wide-character-in-print-warning-in-perl' rel='bookmark' title='Permanent Link: Wide character in print&#8230; warning in Perl'>Wide character in print&#8230; warning in Perl</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/SVFH44LN-Ec" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/simple-try-catch-block-in-perl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/simple-try-catch-block-in-perl</feedburner:origLink></item>
		<item>
		<title>Can’t connect to local MySQL server through socket</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/Wx14-svfN1U/cant-connect-to-local-mysql-server-through-socket</link>
		<comments>http://www.linuxask.com/questions/cant-connect-to-local-mysql-server-through-socket#comments</comments>
		<pubDate>Wed, 01 Sep 2010 14:16:00 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2245</guid>
		<description><![CDATA[Can't connect to local MySQL server through socket
Answer:
Sometimes when you type the mysql command, it shows:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 
The cause of this problem is the MySQL socket file is not in the default location, e.g. /tmp/mysql.sock
To fix, edit the MySQL configurations, e.g. /etc/my.cnf, add the following lines
[client]
socket=/tmp/mysql.sock



Related posts:How [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/how-to-connect-mysql-without-using-password' rel='bookmark' title='Permanent Link: How to connect MySQL without using password'>How to connect MySQL without using password</a></li>
<li><a href='http://www.linuxask.com/questions/block-a-client-from-connecting-to-mysql-if-too-many-errors' rel='bookmark' title='Permanent Link: Block a client from connecting to MySQL if too many errors'>Block a client from connecting to MySQL if too many errors</a></li>
<li><a href='http://www.linuxask.com/questions/set-the-maximum-allowed-number-of-connections-in-mysql' rel='bookmark' title='Permanent Link: Set the maximum allowed number of connections in MySQL'>Set the maximum allowed number of connections in MySQL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Can't connect to local MySQL server through socket</p>
<p><strong>Answer:</strong></p>
<p>Sometimes when you type the <b>mysql</b> command, it shows:</p>
<p><code>Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) </code></p>
<p>The cause of this problem is the MySQL socket file is not in the default location, e.g. <strong>/tmp/mysql.sock</strong></p>
<p>To fix, edit the MySQL configurations, e.g. <strong>/etc/my.cnf</strong>, add the following lines</p>
<pre><code>[client]
socket=/tmp/mysql.sock
</code></pre>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/how-to-connect-mysql-without-using-password' rel='bookmark' title='Permanent Link: How to connect MySQL without using password'>How to connect MySQL without using password</a></li>
<li><a href='http://www.linuxask.com/questions/block-a-client-from-connecting-to-mysql-if-too-many-errors' rel='bookmark' title='Permanent Link: Block a client from connecting to MySQL if too many errors'>Block a client from connecting to MySQL if too many errors</a></li>
<li><a href='http://www.linuxask.com/questions/set-the-maximum-allowed-number-of-connections-in-mysql' rel='bookmark' title='Permanent Link: Set the maximum allowed number of connections in MySQL'>Set the maximum allowed number of connections in MySQL</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/Wx14-svfN1U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/cant-connect-to-local-mysql-server-through-socket/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/cant-connect-to-local-mysql-server-through-socket</feedburner:origLink></item>
		<item>
		<title>Add a User in Linux</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/Gu7mqnEPYIY/add-a-user-in-linux</link>
		<comments>http://www.linuxask.com/questions/add-a-user-in-linux#comments</comments>
		<pubDate>Tue, 31 Aug 2010 07:30:18 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2021</guid>
		<description><![CDATA[Add a User in Linux
Answer:
Add a User in Linux, just use the useradd command:
# sudo useradd -d /home/john -m john
The above command will create the user john and create a home directory which is at /home/john


Related posts:How to delete a folder in Linux recursively?
Display current login user information
Using system directory stack with pushd &#38; popd



Related posts:<ol><li><a href='http://www.linuxask.com/questions/how-to-delete-a-folder-in-linux-recursively' rel='bookmark' title='Permanent Link: How to delete a folder in Linux recursively?'>How to delete a folder in Linux recursively?</a></li>
<li><a href='http://www.linuxask.com/questions/display-current-login-user-information' rel='bookmark' title='Permanent Link: Display current login user information'>Display current login user information</a></li>
<li><a href='http://www.linuxask.com/questions/using-system-directory-stack-with-pushd-popd' rel='bookmark' title='Permanent Link: Using system directory stack with pushd &amp; popd'>Using system directory stack with pushd &amp; popd</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Add a User in Linux</p>
<p><strong>Answer:</strong></p>
<p>Add a User in Linux, just use the <strong>useradd</strong> command:</p>
<p><code># sudo useradd -d /home/john -m john</code></p>
<p>The above command will create the user <strong>john </strong>and create a home directory which is at <strong>/home/john</strong></p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/how-to-delete-a-folder-in-linux-recursively' rel='bookmark' title='Permanent Link: How to delete a folder in Linux recursively?'>How to delete a folder in Linux recursively?</a></li>
<li><a href='http://www.linuxask.com/questions/display-current-login-user-information' rel='bookmark' title='Permanent Link: Display current login user information'>Display current login user information</a></li>
<li><a href='http://www.linuxask.com/questions/using-system-directory-stack-with-pushd-popd' rel='bookmark' title='Permanent Link: Using system directory stack with pushd &amp; popd'>Using system directory stack with pushd &amp; popd</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/Gu7mqnEPYIY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/add-a-user-in-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/add-a-user-in-linux</feedburner:origLink></item>
		<item>
		<title>Fix the warning of: Remote Host Identification Has Changed error and solution</title>
		<link>http://feedproxy.google.com/~r/linuxask/~3/ffMxGqLGJ2A/fix-the-warning-of-remote-host-identification-has-changed-error-and-solution</link>
		<comments>http://www.linuxask.com/questions/fix-the-warning-of-remote-host-identification-has-changed-error-and-solution#comments</comments>
		<pubDate>Mon, 30 Aug 2010 17:12:16 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Basic Linux]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2149</guid>
		<description><![CDATA[Fix the warning of: Remote Host Identification Has Changed error and solution
Answer:
You might experience this error, especially when you are connecting to a remote Linux machine which has just got re-installed.
To solve this, enter the command:
# ssh-keygen -R 192.168.2.36
Where 192.168.2.36 is the IP you are connecting.


Related posts:Solving the warning message &#8220;Xdebug MUST be loaded as [...]


Related posts:<ol><li><a href='http://www.linuxask.com/questions/solving-the-warning-message-xdebug-must-be-loaded-as-a-zend-extension' rel='bookmark' title='Permanent Link: Solving the warning message &#8220;Xdebug MUST be loaded as a Zend extension&#8221;'>Solving the warning message &#8220;Xdebug MUST be loaded as a Zend extension&#8221;</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-transfer-your-identity-pub-to-the-remote-machine%e2%80%99s-authorized_keys' rel='bookmark' title='Permanent Link: How to transfer your identity.pub to the remote machine’s authorized_keys?'>How to transfer your identity.pub to the remote machine’s authorized_keys?</a></li>
<li><a href='http://www.linuxask.com/questions/running-a-command-on-the-remote-server' rel='bookmark' title='Permanent Link: Running a command on the remote server'>Running a command on the remote server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Fix the warning of: Remote Host Identification Has Changed error and solution</p>
<p><strong>Answer:</strong></p>
<p>You might experience this error, especially when you are connecting to a remote Linux machine which has just got <strong>re-installed</strong>.</p>
<p>To solve this, enter the command:</p>
<p><code># ssh-keygen -R 192.168.2.36</code></p>
<p>Where <strong>192.168.2.36</strong> is the IP you are connecting.</p>


<p>Related posts:<ol><li><a href='http://www.linuxask.com/questions/solving-the-warning-message-xdebug-must-be-loaded-as-a-zend-extension' rel='bookmark' title='Permanent Link: Solving the warning message &#8220;Xdebug MUST be loaded as a Zend extension&#8221;'>Solving the warning message &#8220;Xdebug MUST be loaded as a Zend extension&#8221;</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-transfer-your-identity-pub-to-the-remote-machine%e2%80%99s-authorized_keys' rel='bookmark' title='Permanent Link: How to transfer your identity.pub to the remote machine’s authorized_keys?'>How to transfer your identity.pub to the remote machine’s authorized_keys?</a></li>
<li><a href='http://www.linuxask.com/questions/running-a-command-on-the-remote-server' rel='bookmark' title='Permanent Link: Running a command on the remote server'>Running a command on the remote server</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/linuxask/~4/ffMxGqLGJ2A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/fix-the-warning-of-remote-host-identification-has-changed-error-and-solution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxask.com/questions/fix-the-warning-of-remote-host-identification-has-changed-error-and-solution</feedburner:origLink></item>
	</channel>
</rss>
