<?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>fengcool.com &#187; Linux</title>
	<atom:link href="http://www.fengcool.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fengcool.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 31 May 2010 02:22:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>cp file always getting overwrite prompt?</title>
		<link>http://www.fengcool.com/2009/11/cp-file-always-getting-overwrite-prompt/</link>
		<comments>http://www.fengcool.com/2009/11/cp-file-always-getting-overwrite-prompt/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 05:32:09 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cp]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=133</guid>
		<description><![CDATA[linux cp cannot remove overwrite prompt. force no prompt when copy a file.]]></description>
			<content:encoded><![CDATA[<p>wondering why always getting overwrite prompt when use &#8220;cp&#8221; command with &#8220;-f&#8221; option</p>
<p>try this,</p>
<p>1. login as root</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></td></tr></table></div>

<p>2. comment out this line</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#alias cp='cp -i'</span></pre></td></tr></table></div>

<p>3. logout and login again</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2009%2F11%2Fcp-file-always-getting-overwrite-prompt%2F&amp;linkname=cp%20file%20always%20getting%20overwrite%20prompt%3F"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2009/11/cp-file-always-getting-overwrite-prompt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rsync server and client &#8211; backup your server files</title>
		<link>http://www.fengcool.com/2009/07/rsync_server_and_client_backup_server_file/</link>
		<comments>http://www.fengcool.com/2009/07/rsync_server_and_client_backup_server_file/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 17:28:53 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[rsync client]]></category>
		<category><![CDATA[rsync server]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=112</guid>
		<description><![CDATA[rsync can synchronizes files and directories from one server to another. It's perfectly for backup or create a mirror site purpose.]]></description>
			<content:encoded><![CDATA[<p>rsync can synchronizes files and directories from one server to another. It&#8217;s perfectly for backup or create a mirror site purpose.</p>
<p>This tutorial shows you step by step to create a rsync server and client server.</p>
<p>First of all, you must have rsync installed. For fedora, rsync should be included by default. If you don&#8217;t have it, run</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> rsync</pre></td></tr></table></div>

<p><strong>Setup rsync server</strong></p>
<p>Create rsync configuration file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> rsyncd
<span style="color: #7a0874; font-weight: bold;">cd</span> rsyncd
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsyncd.conf
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsyncd.motd
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsyncd.user
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> rsyncd.user</pre></td></tr></table></div>

<p>edit rsyncd.user file:<br />
vi /etc/rsyncd.user</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">my_rsync_user_1:user_1_password</pre></td></tr></table></div>

<p>edit rsyncd.conf file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">pid <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>rsyncd.pid
<span style="color: #007800;">port</span>=<span style="color: #000000;">873</span>
<span style="color: #007800;">uid</span>=root
<span style="color: #007800;">gid</span>=root
use <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">chroot</span></span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #007800;">only</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># limit access to LANS</span>
hosts <span style="color: #007800;">allow</span>=192.168.2.0<span style="color: #000000; font-weight: bold;">/</span>255.255.255.0   <span style="color: #666666; font-style: italic;">#default, listen to lan server</span>
host <span style="color: #007800;">deny</span>=<span style="color: #000000; font-weight: bold;">*</span>
&nbsp;
max <span style="color: #007800;">connections</span>=<span style="color: #000000;">5</span>
motd <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsyncd<span style="color: #000000; font-weight: bold;">/</span>rsyncd.motd
&nbsp;
log <span style="color: #007800;">format</span>=<span style="color: #000000; font-weight: bold;">%</span>t<span style="color: #000000; font-weight: bold;">%</span>a<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>f<span style="color: #000000; font-weight: bold;">%</span>b
syslog <span style="color: #007800;">facility</span>=local3
<span style="color: #007800;">timeout</span>=<span style="color: #000000;">300</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>profile_1<span style="color: #7a0874; font-weight: bold;">&#93;</span>          <span style="color: #666666; font-style: italic;">#profile name</span>
path = <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>directory
ignore errors
<span style="color: #c20cb9; font-weight: bold;">read</span> only = <span style="color: #c20cb9; font-weight: bold;">false</span>
list = <span style="color: #c20cb9; font-weight: bold;">false</span>
hosts allow = 66.66.66.66   <span style="color: #666666; font-style: italic;">#listen to client server which use public ip</span>
hosts deny = 0.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span>
auth <span style="color: #c20cb9; font-weight: bold;">users</span> = my_rsync_user_1
secrets <span style="color: #c20cb9; font-weight: bold;">file</span> = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsyncd<span style="color: #000000; font-weight: bold;">/</span>rsyncd.user
&nbsp;
<span style="color: #666666; font-style: italic;">#[profile_1]          #another profile name</span>
<span style="color: #666666; font-style: italic;">#path = /path/to/backup/directory/2</span>
<span style="color: #666666; font-style: italic;">#ignore errors</span>
<span style="color: #666666; font-style: italic;">#read only = false</span>
<span style="color: #666666; font-style: italic;">#list = false</span>
<span style="color: #666666; font-style: italic;">#hosts allow = 88.88.88.88   #listen to client server which use public ip</span>
<span style="color: #666666; font-style: italic;">#hosts deny = 0.0.0.0/32</span>
<span style="color: #666666; font-style: italic;">#auth users = my_rsync_user_2</span>
<span style="color: #666666; font-style: italic;">#secrets file = /etc/rsyncd/rsyncd.user</span></pre></td></tr></table></div>

<p>Next, create init start up script<br />
vi /etc/init.d/rsyncd</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Startup script for rsyncd daemon</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 35 90 10</span>
<span style="color: #666666; font-style: italic;"># description: Server data for sync to other server</span>
<span style="color: #666666; font-style: italic;"># processname rsync</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Source function library</span>
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
&nbsp;
<span style="color: #007800;">prog</span>=rsync
<span style="color: #007800;">conf</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsyncd<span style="color: #000000; font-weight: bold;">/</span>rsyncd.conf
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Starting rsync daemon: &quot;</span>
        daemon <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prog</span> <span style="color: #660033;">--daemon</span> <span style="color: #660033;">--config</span>=<span style="color: #007800;">$conf</span>
        <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span>
        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RETVAL</span> = <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prog</span>
        <span style="color: #000000; font-weight: bold;">;;</span>
    stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Shutting down <span style="color: #007800;">$prog</span>: &quot;</span>
        killproc <span style="color: #660033;">-d</span> <span style="color: #000000;">60</span> <span style="color: #007800;">$prog</span>
        <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span>
        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RETVAL</span> = <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prog</span>
        <span style="color: #000000; font-weight: bold;">;;</span>
    status<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        status <span style="color: #007800;">$prog</span>
        <span style="color: #000000; font-weight: bold;">;;</span>
    restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        $<span style="color: #000000;">0</span> stop
        $<span style="color: #000000;">0</span> start
        <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 {start|stop|restart|status}&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>make /etc/init.d/rsyncd executable, and register this service</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>rsyncd 
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>chkconfig <span style="color: #660033;">--add</span> rsyncd
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>service rsyncd start</pre></td></tr></table></div>

<p><strong>Setup rsync client</strong></p>
<p>first, of course you must have rsync installed on client server</p>
<p>make rsync password file</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> rsync
<span style="color: #7a0874; font-weight: bold;">cd</span> rsync
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsync.pwd
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> rsync.pwd</pre></td></tr></table></div>

<p>vi /etc/rsync/rsync.pwd</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">user_1_password</pre></td></tr></table></div>

<p>execute this command to start synchronize file to server</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-vrtLogp</span> <span style="color: #660033;">--progress</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>be<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/*</span> my_rsync_user_1<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>SERVER_IP<span style="color: #7a0874; font-weight: bold;">&#93;</span>::profile_1 <span style="color: #660033;">--password-file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsync<span style="color: #000000; font-weight: bold;">/</span>rsync.pwd</pre></td></tr></table></div>

<p>where [SERVER_IP] is rsync server IP</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2009%2F07%2Frsync_server_and_client_backup_server_file%2F&amp;linkname=Rsync%20server%20and%20client%20%26%238211%3B%20backup%20your%20server%20files"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2009/07/rsync_server_and_client_backup_server_file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple helloworld c++ program to test noexec tmp partition</title>
		<link>http://www.fengcool.com/2008/12/simple-helloworld-c-program-to-test-noexec-tmp-partition/</link>
		<comments>http://www.fengcool.com/2008/12/simple-helloworld-c-program-to-test-noexec-tmp-partition/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 16:46:28 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=61</guid>
		<description><![CDATA[c++ helloworld for linux to test secured noexec /tmp partition]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;iostream&gt;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  std<span style="color: #008080;">::</span><span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Hello world, compiled with g++ on linux&quot;</span> <span style="color: #000080;">&lt;&lt;</span> std<span style="color: #008080;">::</span><span style="color: #007788;">endl</span><span style="color: #008080;">;</span>
  <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>compile this and move to your secured tmp partition and execute it. If you get a permission error, tmp partition is mounted correctly with noexec.</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2008%2F12%2Fsimple-helloworld-c-program-to-test-noexec-tmp-partition%2F&amp;linkname=Simple%20helloworld%20c%2B%2B%20program%20to%20test%20noexec%20tmp%20partition"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2008/12/simple-helloworld-c-program-to-test-noexec-tmp-partition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download all file recursively from ftp server</title>
		<link>http://www.fengcool.com/2008/11/download-all-file-recursively-from-ftp-server/</link>
		<comments>http://www.fengcool.com/2008/11/download-all-file-recursively-from-ftp-server/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 20:52:27 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[download recursive]]></category>
		<category><![CDATA[ftp server]]></category>
		<category><![CDATA[ncftp]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/2008/11/download-all-file-recursively-from-ftp-server/</guid>
		<description><![CDATA[ncftpget is able to let you download entire ftp directory and sub directories from remote ftp server.
Install ncftp client

1
yum install ncftp

Start downloading

1
ncftpget -R -v -u &#34;username&#34;  -p &#34;userpassword&#34; ftp.someserver.com /home/save_at_here /downloads

where,

-R : download all subdirectories and files (recusive)
-v : verbose, show download activity
-u : ftp server user name
-p : ftp server user login (if [...]]]></description>
			<content:encoded><![CDATA[<p>ncftpget is able to let you download entire ftp directory and sub directories from remote ftp server.</p>
<p><strong>Install ncftp client</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> ncftp</pre></td></tr></table></div>

<p><strong>Start downloading</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">ncftpget <span style="color: #660033;">-R</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-u</span> <span style="color: #ff0000;">&quot;username&quot;</span>  <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;userpassword&quot;</span> ftp.someserver.com <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>save_at_here <span style="color: #000000; font-weight: bold;">/</span>downloads</pre></td></tr></table></div>

<p>where,</p>
<ul>
<li>-R : download all subdirectories and files (recusive)</li>
<li>-v : verbose, show download activity</li>
<li>-u : ftp server user name</li>
<li>-p : ftp server user login (if skipped, will prompt to ask password)</li>
<li>ftp.someserver.com : ftp server domain or IP</li>
<li>/home/save_at_here : all downloaded file will save in this directory</li>
<li>/downloads : remote ftp server directory you wish to copy</li>
</ul>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2008%2F11%2Fdownload-all-file-recursively-from-ftp-server%2F&amp;linkname=Download%20all%20file%20recursively%20from%20ftp%20server"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2008/11/download-all-file-recursively-from-ftp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup MySQL databases to remote server using mysql-zrm</title>
		<link>http://www.fengcool.com/2008/11/backup-mysql-to-remote-server-using-mysql-zrm/</link>
		<comments>http://www.fengcool.com/2008/11/backup-mysql-to-remote-server-using-mysql-zrm/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 04:45:17 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql-zrm]]></category>
		<category><![CDATA[zrm]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=57</guid>
		<description><![CDATA[using mysql-zrm to backup a large databases from a client server. A step by step tutorial teach you the best way to backup your MySQL database.]]></description>
			<content:encoded><![CDATA[<p>Recently I use mysql-zrm to backup a large databases from a client server. I can backup all databases or a set of database or maybe some of tables with one line linux command. Pretty easy to use.</p>
<p>You may imagine that mysql-zrm is a strong management tool of mysql, mysqldump and mysqlhotcopy.  The key benifits for me are : I can backup all databases at once with my databases are automatically created if a new client comes; mysql-zrm is able to save compressed data to different folder, so I can keep saved data up to seven days (you may do it one month or maybe one year); It also has a scheduler to do your task every certain time you want.</p>
<p><strong>Installation:</strong></p>
<p>1. login to your backup server</p>
<p>2. Download rpm from http://www.zmanda.com/download-zrm.php</p>
<p>3. If you don&#8217;t have Perl installed, run &#8221; yum install perl &#8221;</p>
<p>4. run &#8221; rpm -ivh MySQL-zrm-2.0-1.noarch.rpm &#8221;</p>
<p>5. &#8220;  vi /etc/mysql-zrm/mysql-zrm.conf &#8221; update following parameters in file</p>
<p>backup-mode=logical [ ideally raw for myisam engine and logical for innodb. but I recommend using logical for default. Because when I use raw for default value, and if there is table with innodb engine exist, zrm will prompt me password for mysql@(server_ip) which have no idea about linux mysql user login ]</p>
<p>destination=/home/mybackup_dir  [ specify where backup files will be stored]</p>
<p><strong>Start backup:</strong></p>
<p>mysql-zrm &#8211;action backup &#8211;host xxx.xxx.xxx.xxx &#8211;user aabb &#8211;password ccdd  &#8211;backup-set abcd</p>
<p>where<br />
&#8211;host is remote server IP for MySQL<br />
&#8211;user is remote MySQL server  user login<br />
&#8211;password is remote MySQL server  user login password<br />
&#8211;backup-set is backup folder name</p>
<p><strong>Result:</strong></p>
<p>after running the command, you will get backup file in the path look like this</p>
<p>/home/mybackup_dir/abcd/20081128195236</p>
<p><strong>Restore database to local server:</strong></p>
<p>/usr/bin/mysql-zrm-restore &#8211;user=1122 &#8211;password=2233 &#8211;source-directory=/home/mybackup_dir/abcd/20081128195236<br />
check out your backup server MySQL database. <img src='http://www.fengcool.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2008%2F11%2Fbackup-mysql-to-remote-server-using-mysql-zrm%2F&amp;linkname=Backup%20MySQL%20databases%20to%20remote%20server%20using%20mysql-zrm"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2008/11/backup-mysql-to-remote-server-using-mysql-zrm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Server Security Checklist</title>
		<link>http://www.fengcool.com/2008/11/linux-server-security-checklist/</link>
		<comments>http://www.fengcool.com/2008/11/linux-server-security-checklist/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 22:17:25 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=54</guid>
		<description><![CDATA[A checklist of steps needed to secure a Linux server]]></description>
			<content:encoded><![CDATA[<ul>
<li>Firewall (apf/csf and bfd)</li>
<li>Secure tmp partition (noexec)</li>
<li>rootkit scanning</li>
<li>PHP hardening</li>
<li>Apache hardening</li>
<li>Mod-security</li>
<li>Shell login notification</li>
</ul>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2008%2F11%2Flinux-server-security-checklist%2F&amp;linkname=Linux%20Server%20Security%20Checklist"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2008/11/linux-server-security-checklist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting High Memory Usage</title>
		<link>http://www.fengcool.com/2008/05/troubleshooting-high-memory-usage/</link>
		<comments>http://www.fengcool.com/2008/05/troubleshooting-high-memory-usage/#comments</comments>
		<pubDate>Fri, 30 May 2008 17:11:10 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=34</guid>
		<description><![CDATA[How to troubleshooting high memory usage on CentOS, list Apache, MySQL and other process memory usage]]></description>
			<content:encoded><![CDATA[<p>First of all, this post is nowhere near a complete reference for linux memory usage and troubleshooting high memory usage. It only has the steps I&#8217;d taken to troubleshoot  my own server when it gets overloaded by increased traffic. It happens once a while, and usually I can fix it by tuning some Apache, MySQL and other config setting.</p>
<p>1. using top command</p>
<p>After executing top command, press &#8220;Shift&#8221; + &#8220;&gt;&#8221; and look at &#8220;RES&#8221; column. The RES column is the most reliable indicator of the real memory usage of that process.</p>
<p><a title="top result" href="http://www.fengcool.com/wp-content/uploads/2008/05/top.png" target="_blank">top result<br />
</a></p>
<p>2.  ps axu &#8211;sort:rss</p>
<p>show memory usage sorted by lowest memory usages first.</p>
<p>A general Apache which serves static html page should consume less than 10MB per process.<br />
For heavily serving PHP pages, in my case it uses 18MB-39MB each httpd process.</p>
<p>mysqld has a memory usage of 120MB in my case. I can tell that the query cache settings worked as planned.</p>
<p>ps aux &#8211;sort -vsz | head -25<br />
Top memory hogs</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2008%2F05%2Ftroubleshooting-high-memory-usage%2F&amp;linkname=Troubleshooting%20High%20Memory%20Usage"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2008/05/troubleshooting-high-memory-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check Linux Versions &#8211; common commands part1</title>
		<link>http://www.fengcool.com/2008/03/check-linux-versions-common-commands-part1/</link>
		<comments>http://www.fengcool.com/2008/03/check-linux-versions-common-commands-part1/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 16:32:56 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux commands]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/2008/03/check-linux-version-linux-common-commands-1/</guid>
		<description><![CDATA[Linux commands to check Linux version, kernel version, php version, mysql verison and others on Linux server]]></description>
			<content:encoded><![CDATA[<ul>
<li>Check Linux Kernel version:</li>
</ul>
<p>uname -a</p>
<ul>
<li>Check Linux version</li>
</ul>
<p><span id="intelliTxt"> cat /proc/version</span></p>
<ul>
<li>Check Redhat based Linux version</li>
</ul>
<p>cat /etc/redhat-release</p>
<ul>
<li>Check PHP version on Linux server</li>
</ul>
<p>php -v</p>
<ul>
<li>Check mysql version on linux server</li>
</ul>
<p>mysql -V</p>
<ul>
<li>Check apache version on linux server</li>
</ul>
<p>httpd -v</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2008%2F03%2Fcheck-linux-versions-common-commands-part1%2F&amp;linkname=Check%20Linux%20Versions%20%26%238211%3B%20common%20commands%20part1"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2008/03/check-linux-versions-common-commands-part1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install VMware Tools for Fedora 8 in VMware 6.0.2</title>
		<link>http://www.fengcool.com/2007/11/install-vmware-tools-for-fedora-8-in-vmware-602/</link>
		<comments>http://www.fengcool.com/2007/11/install-vmware-tools-for-fedora-8-in-vmware-602/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 22:23:02 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/2007/11/install-vmware-tools-for-fedora-8-in-vmware-602/</guid>
		<description><![CDATA[step by step guide of how to install VMware Tools for Fedora 8 in VMware 6.0.2]]></description>
			<content:encoded><![CDATA[<ol>
<li>Click VM-&gt; install VMware  tools</li>
<li>In Fedora 8 terminal window, copy WMwareTools-6.0.2-59284.tar.gz into your home folder</li>
<li>unzip it. gzip -d WMwareTools-6.0.2-59284.tar.gz | tar -xvf WMwareTools-6.0.2-59284.tar</li>
<li>run vmware-install.pl</li>
</ol>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2007%2F11%2Finstall-vmware-tools-for-fedora-8-in-vmware-602%2F&amp;linkname=Install%20VMware%20Tools%20for%20Fedora%208%20in%20VMware%206.0.2"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2007/11/install-vmware-tools-for-fedora-8-in-vmware-602/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Injection vulnerability on Plesk 8.2.0</title>
		<link>http://www.fengcool.com/2007/09/sql-injection-vulnerability-on-plesk-820/</link>
		<comments>http://www.fengcool.com/2007/09/sql-injection-vulnerability-on-plesk-820/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 18:58:48 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/2007/09/sql-injection-vulnerability-on-plesk-820/</guid>
		<description><![CDATA[SQL Injection vulnerability on Plesk 8.2.0 Plesk 8.0.x Plesk 8.1.0]]></description>
			<content:encoded><![CDATA[<p>I just read this one from SWsoft forum.</p>
<p>There is a SQL injection vulnerable security hole exists on Plesk 8.x.x. Yes, it&#8217;s even on 8.2.0, which is the latest stable version.</p>
<p>It&#8217;s <code>/usr/local/psa/admin/plib/class.Session.php.</code></p>
<p>Here&#8217;s the <a target="_blank" href="http://kb.swsoft.com/en/2169">fix</a>.</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2007%2F09%2Fsql-injection-vulnerability-on-plesk-820%2F&amp;linkname=SQL%20Injection%20vulnerability%20on%20Plesk%208.2.0"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2007/09/sql-injection-vulnerability-on-plesk-820/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
