<?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/category/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>Plesk common shell commands</title>
		<link>http://www.fengcool.com/2009/06/plesk-common-shell-commands/</link>
		<comments>http://www.fengcool.com/2009/06/plesk-common-shell-commands/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 18:02:40 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=79</guid>
		<description><![CDATA[Plesk common shell commands]]></description>
			<content:encoded><![CDATA[<p>Reload vhost.conf for single domain</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;">/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name<span style="color: #000066; font-weight:bold;">=</span></pre></td></tr></table></div>

<p>Update AWStats for only 1 domain in Plesk</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;">/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">you-domain.com</span></pre></td></tr></table></div>

<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%2F06%2Fplesk-common-shell-commands%2F&amp;linkname=Plesk%20common%20shell%20commands"><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/06/plesk-common-shell-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup newly modified files</title>
		<link>http://www.fengcool.com/2009/02/backup-newly-modified-files/</link>
		<comments>http://www.fengcool.com/2009/02/backup-newly-modified-files/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 03:27:03 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup files]]></category>
		<category><![CDATA[modified files]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=70</guid>
		<description><![CDATA[backup new modified files, avoid doing full backup]]></description>
			<content:encoded><![CDATA[<p>My server backups over 20GB files everyday. It takes hours to tar those huge amount of files. I think this kind of stupid task is harmful to hard driver. One more stupid issue is that over 99% of files are not modified since last backup. So, here is the command to let me backup newly modified files only.</p>
<p>tar -zcvf /save/to/file.tar /filePath/*  &#8211;newer-mtime &#8216;1 days ago&#8217;</p>
<p>You may want to change &#8220;1 days ago&#8221; to 2 days, or 5 days.</p>
<p>By the way, it&#8217;s better to do full backup monthly or bi-monthly.  <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%2F2009%2F02%2Fbackup-newly-modified-files%2F&amp;linkname=Backup%20newly%20modified%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/02/backup-newly-modified-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux &#8211; delete files which modified time older than 7 days</title>
		<link>http://www.fengcool.com/2009/02/linux-delete-files-which-modified-time-older-than-7-days/</link>
		<comments>http://www.fengcool.com/2009/02/linux-delete-files-which-modified-time-older-than-7-days/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 03:13:24 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[delete files]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[modified time]]></category>
		<category><![CDATA[rm]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=68</guid>
		<description><![CDATA[delete files which modified time older than 7 days]]></description>
			<content:encoded><![CDATA[<p>find /filePath/* -mtime +7 -delete</p>
<p>or </p>
<p>find /filePath/* -mtime +7 -exec rm {} \;</p>
<p>Where &#8220;-mtime&#8221; parameter will look for file modified time older than &#8220;+7&#8243; days. You may want to change &#8220;+7&#8243; to longer days, for example &#8220;+30&#8243; days, &#8220;+90&#8243; days</p>
<p>&#8220;-exec&#8221; parameter allows you to call another command. The &#8220;{} \;&#8221; is required at the end.</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%2F02%2Flinux-delete-files-which-modified-time-older-than-7-days%2F&amp;linkname=Linux%20%26%238211%3B%20delete%20files%20which%20modified%20time%20older%20than%207%20days"><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/02/linux-delete-files-which-modified-time-older-than-7-days/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ffmpeg &#8211; capture screenshot from a video file</title>
		<link>http://www.fengcool.com/2008/12/ffmpeg-capture-screenshot-from-a-video-file/</link>
		<comments>http://www.fengcool.com/2008/12/ffmpeg-capture-screenshot-from-a-video-file/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 02:53:58 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=64</guid>
		<description><![CDATA[a linux command to capture screenshot from a video file using ffmpeg]]></description>
			<content:encoded><![CDATA[
<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;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">/</span>my_video_file_dir<span style="color: #000000; font-weight: bold;">/</span>video.flv <span style="color: #660033;">-y</span> <span style="color: #660033;">-f</span> image2 <span style="color: #660033;">-ss</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-sameq</span> <span style="color: #660033;">-t</span> <span style="color: #000000;">0.001</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">320</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">240</span> <span style="color: #000000; font-weight: bold;">/</span>image_dir<span style="color: #000000; font-weight: bold;">/</span>screenshot.jpg</pre></td></tr></table></div>

<p>320*240 : image dimension is 320 pixels width and 240 pixels height<br />
-ss 8 : screenshot will be taken at 8 second after video starts.</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%2Fffmpeg-capture-screenshot-from-a-video-file%2F&amp;linkname=ffmpeg%20%26%238211%3B%20capture%20screenshot%20from%20a%20video%20file"><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/ffmpeg-capture-screenshot-from-a-video-file/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Linux ffmpeg audio conversion &#8211; MP3 to FLV</title>
		<link>http://www.fengcool.com/2008/12/linux-ffmpeg-audio-conversion-mp3-to-flv/</link>
		<comments>http://www.fengcool.com/2008/12/linux-ffmpeg-audio-conversion-mp3-to-flv/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 04:18:59 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[flv convertion]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=63</guid>
		<description><![CDATA[Want to play MP3 files on your website? The best and most common way is using flash video file which compress audio and video better for internet use like YouTube. Here is the instruction I used ffmpeg to convert MP3 to FLV file.
ffmpeg &#8211; a program that allow convert audio in numerous formats.
Installing ffmpeg
edit / [...]]]></description>
			<content:encoded><![CDATA[<p>Want to play MP3 files on your website? The best and most common way is using flash video file which compress audio and video better for internet use like YouTube. Here is the instruction I used ffmpeg to convert MP3 to FLV file.</p>
<p><strong>ffmpeg</strong> &#8211; a program that allow convert audio in numerous formats.</p>
<p><strong>Installing ffmpeg</strong><br />
edit / etc/yum.repos.d/CentOS-Base.repo , add following lines at the end of file</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>dag<span style="">&#93;</span></span>
<span style="color: #000099;">name</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">Dag RPM Repository for Centos</span>
<span style="color: #000099;">baseurl</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">http://apt.sw.be/redhat/el$releasever/en/$basearch/dag</span>
<span style="color: #000099;">enabled</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span></pre></td></tr></table></div>

<p>run this command</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> <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span></pre></td></tr></table></div>

<p><strong>Convert MP3 to FLV</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;"><span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-y</span> <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>song.mp3 <span style="color: #660033;">-f</span> flv <span style="color: #660033;">-acodec</span> mp3 <span style="color: #660033;">-ab</span> <span style="color: #000000;">64</span> <span style="color: #660033;">-ac</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>song.flv</pre></td></tr></table></div>

<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%2Flinux-ffmpeg-audio-conversion-mp3-to-flv%2F&amp;linkname=Linux%20ffmpeg%20audio%20conversion%20%26%238211%3B%20MP3%20to%20FLV"><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/linux-ffmpeg-audio-conversion-mp3-to-flv/feed/</wfw:commentRss>
		<slash:comments>0</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>Synchronize linux date and time using ntpdate</title>
		<link>http://www.fengcool.com/2008/12/synchronize-linux-date-and-time-using-ntpdate/</link>
		<comments>http://www.fengcool.com/2008/12/synchronize-linux-date-and-time-using-ntpdate/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 17:15:13 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux time]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[ntpdate]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/2008/12/synchronize-linux-date-and-time-using-ntpdate/</guid>
		<description><![CDATA[ntpdate synchronize and set computers&#8217; date and time via Network Time Protocol (NTP) server(s).

1
/usr/sbin/ntpdate -u 0.fedora.pool.ntp.org

0.fedora.pool.ntp.org is NTP server. If this server is not working, find another one.
]]></description>
			<content:encoded><![CDATA[<p><strong>ntpdate</strong> synchronize and set computers&#8217; date and time via <a title="Network Time Protocol" href="http://en.wikipedia.org/wiki/Network_Time_Protocol">Network Time Protocol</a> (NTP) server(s).</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: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>ntpdate <span style="color: #660033;">-u</span> 0.fedora.pool.ntp.org</pre></td></tr></table></div>

<p>0.fedora.pool.ntp.org is NTP server. If this server is not working, find another one.</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%2Fsynchronize-linux-date-and-time-using-ntpdate%2F&amp;linkname=Synchronize%20linux%20date%20and%20time%20using%20ntpdate"><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/synchronize-linux-date-and-time-using-ntpdate/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>
	</channel>
</rss>
