<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Useful Tips for GNU/Linux Operating System</title>
	<atom:link href="http://miteshjlinuxtips.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://miteshjlinuxtips.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 28 Jun 2011 12:51:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='miteshjlinuxtips.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Useful Tips for GNU/Linux Operating System</title>
		<link>http://miteshjlinuxtips.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://miteshjlinuxtips.wordpress.com/osd.xml" title="Useful Tips for GNU/Linux Operating System" />
	<atom:link rel='hub' href='http://miteshjlinuxtips.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Video Cutter: Video Cutting using Mencoder</title>
		<link>http://miteshjlinuxtips.wordpress.com/2011/06/26/video-cutter-video-cutting-using-mencoder/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2011/06/26/video-cutter-video-cutting-using-mencoder/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 19:13:38 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=311</guid>
		<description><![CDATA[I have written a perl script, then can split/cut parts from a video file. #!/usr/bin/perl -w #=============================================================================== # # FILE: video_cutter.pl # # USAGE: ./video_cutter.pl [options] &#60;input_video_file&#62; # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Mitesh Singh Jat (mitesh), &#60;mitesh[at]yahoo-inc[dot]com&#62; # VERSION: 1.0 # CREATED: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=311&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have written a perl script, then can split/cut parts from a video file.</p>
<pre style="color:#000000;background-color:#ffffff;"><b>#!/usr/bin/perl -w</b>
<i><span style="color:#808080;">#===============================================================================</span></i>
<i><span style="color:#808080;">#</span></i>
<i><span style="color:#808080;">#         FILE:  video_cutter.pl</span></i>
<i><span style="color:#808080;">#</span></i>
<i><span style="color:#808080;">#        USAGE:  ./video_cutter.pl [options] &lt;input_video_file&gt;</span></i>
<i><span style="color:#808080;">#</span></i>
<i><span style="color:#808080;">#  DESCRIPTION:  </span></i>
<i><span style="color:#808080;">#</span></i>
<i><span style="color:#808080;">#      OPTIONS:  ---</span></i>
<i><span style="color:#808080;"># REQUIREMENTS:  ---</span></i>
<i><span style="color:#808080;">#         BUGS:  ---</span></i>
<i><span style="color:#808080;">#        NOTES:  ---</span></i>
<i><span style="color:#808080;">#       AUTHOR:  Mitesh Singh Jat (mitesh), &lt;mitesh[at]yahoo-inc[dot]com&gt;</span></i>
<i><span style="color:#808080;">#      VERSION:  1.0</span></i>
<i><span style="color:#808080;">#      CREATED:  06/26/2011 03:57:55 PM IST</span></i>
<i><span style="color:#808080;">#     REVISION:  ---</span></i>
<i><span style="color:#808080;">#===============================================================================</span></i>

<b>use</b> <b>strict</b>;
<b>use</b> <b>warnings</b>;

<b>use</b> <span style="color:#000080;">Getopt::Std</span>;

<b>sub </b><span style="color:#000080;">usage</span>()
{
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">USAGE: </span><span style="color:#c00000;">$0</span><span style="color:#dd0000;"> [options] &lt;input_video_file&gt;</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">          -c &lt;conf_file&gt;    default  /base_dir/input_video_file/video_cutter.conf</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">                            Start_time(hh:mm:ss),End_time(hh:mm:ss)</span><span style="color:#ff00ff;">\n\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">          -o &lt;out_dir&gt;      default  /base_dir/input_video_file/</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
}

<b>sub </b><span style="color:#000080;">hms_to_seconds</span>()
{
   <b>my</b> <span style="color:#800000;">$end_sec</span> = <span style="color:#0000ff;">0</span>;
   <b>my</b> (<span style="color:#800000;">$h</span>, <span style="color:#800000;">$m</span>, <span style="color:#800000;">$s</span>) = <span style="color:#000080;">split</span>(<b><span style="color:#008000;">/</span></b><span style="color:#008000;">:</span><b><span style="color:#008000;">/</span></b>, <span style="color:#c00000;">$_</span>[<span style="color:#0000ff;">0</span>]);
   <span style="color:#800000;">$s</span> = <span style="color:#000080;">defined</span>(<span style="color:#800000;">$s</span>) ? <span style="color:#800000;">$s</span> : <span style="color:#0000ff;">0</span>;
   <span style="color:#800000;">$end_sec</span> += <span style="color:#800000;">$s</span>;
   <span style="color:#800000;">$m</span> = <span style="color:#000080;">defined</span>(<span style="color:#800000;">$m</span>) ? <span style="color:#800000;">$m</span> : <span style="color:#0000ff;">0</span>;
   <span style="color:#800000;">$end_sec</span> += (<span style="color:#0000ff;">60</span> <b><span style="color:#008000;">*</span></b> <span style="color:#800000;">$m</span>);
   <span style="color:#800000;">$h</span> = <span style="color:#000080;">defined</span>(<span style="color:#800000;">$h</span>) ? <span style="color:#800000;">$h</span> : <span style="color:#0000ff;">0</span>;
   <span style="color:#800000;">$end_sec</span> += (<span style="color:#0000ff;">3600</span> <b><span style="color:#008000;">*</span></b> <span style="color:#800000;">$h</span>);
   <b>return</b>(<span style="color:#800000;">$end_sec</span>);
}

<b>my</b> <span style="color:#800000;">%opts</span>;
getopt(<b><span style="color:#008000;">'</span></b><span style="color:#ff6c6c;">o:c:</span><b><span style="color:#008000;">'</span></b>, \<span style="color:#800000;">%opts</span>);

<b>foreach</b> <b>my</b> <span style="color:#800000;">$opt</span> (<span style="color:#000080;">sort</span> <span style="color:#000080;">keys</span> <span style="color:#800000;">%opts</span>)
{
   <b>if</b> (!<span style="color:#000080;">defined</span>(<span style="color:#800000;">$opts</span>{<span style="color:#800000;">$opt</span>}))
   {
       <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: Requires value for option '</span><span style="color:#800000;">$opt</span><b><span style="color:#008000;">'</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
       &amp;usage();
       <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
   }
}

<b>if</b> (<span style="color:#c00000;">@ARGV</span> != <span style="color:#0000ff;">1</span>)
{
   &amp;usage();
   <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
}

<b>my</b> <span style="color:#800000;">$input_video_file</span> = <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$ARGV</span><span style="color:#dd0000;">[0]</span><b><span style="color:#008000;">"</span></b>;
<b>my</b> <span style="color:#800000;">$out_dir</span> = <b><span style="color:#008000;">`</span></b><span style="color:#dd0000;">dirname </span><span style="color:#800000;">$input_video_file</span><b><span style="color:#008000;">`</span></b>;
<span style="color:#000080;">chomp</span>(<span style="color:#800000;">$out_dir</span>);
<b>my</b> <span style="color:#800000;">$conf_file</span> = <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$out_dir</span><span style="color:#dd0000;">/video_cutter.conf</span><b><span style="color:#008000;">"</span></b>;

<b>if</b> (<span style="color:#000080;">defined</span>(<span style="color:#800000;">$opts</span>{<b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">c</span><b><span style="color:#008000;">"</span></b>}))
{
   <span style="color:#800000;">$conf_file</span> = <span style="color:#800000;">$opts</span>{<b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">c</span><b><span style="color:#008000;">"</span></b>};
}
<b>if</b> (<span style="color:#000080;">defined</span>(<span style="color:#800000;">$opts</span>{<b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">o</span><b><span style="color:#008000;">"</span></b>}))
{
   <span style="color:#800000;">$out_dir</span> = <span style="color:#800000;">$opts</span>{<b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">o</span><b><span style="color:#008000;">"</span></b>};
}

<b>unless</b> (<b><span style="color:#008000;">-f</span></b> <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$input_video_file</span><b><span style="color:#008000;">"</span></b>)
{
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: Input video file '</span><span style="color:#800000;">$input_video_file</span><b><span style="color:#008000;">'</span></b><span style="color:#dd0000;"> is not present</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
}
<b>unless</b> (<b><span style="color:#008000;">-f</span></b> <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$conf_file</span><b><span style="color:#008000;">"</span></b>)
{
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: split conf file '</span><span style="color:#800000;">$conf_file</span><b><span style="color:#008000;">'</span></b><span style="color:#dd0000;"> is not present</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
}
<b>unless</b> (<b><span style="color:#008000;">-d</span></b> <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$out_dir</span><b><span style="color:#008000;">"</span></b>)
{
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: out dir '</span><span style="color:#800000;">$out_dir</span><b><span style="color:#008000;">'</span></b><span style="color:#dd0000;"> is not present</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
}
<b>unless</b> (<b><span style="color:#008000;">-w</span></b> <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$out_dir</span><b><span style="color:#008000;">"</span></b>)
{
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: out dir '</span><span style="color:#800000;">$out_dir</span><b><span style="color:#008000;">'</span></b><span style="color:#dd0000;"> is not writable</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
}

<b>my</b> <span style="color:#800000;">$mencoder</span> = <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">/usr/local/bin/mencoder</span><b><span style="color:#008000;">"</span></b>;
<b>unless</b> (<b><span style="color:#008000;">-x</span></b> <span style="color:#800000;">$mencoder</span>)
{
   <span style="color:#800000;">$mencoder</span> = <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">/usr/bin/mencoder</span><b><span style="color:#008000;">"</span></b>;
}
<b>unless</b> (<b><span style="color:#008000;">-x</span></b> <span style="color:#800000;">$mencoder</span>)
{
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: please install mencoder</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">sudo apt-get install mencoder</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">exit</span>(-<span style="color:#0000ff;">1</span>);
}

<span style="color:#000080;">open</span>(CFH, <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$conf_file</span><b><span style="color:#008000;">"</span></b>) <b><span style="color:#008000;">or</span></b> <span style="color:#000080;">die</span>(<b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: Cannot open '</span><span style="color:#800000;">$conf_file</span><b><span style="color:#008000;">'</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>);
<b>my</b> <span style="color:#800000;">$line</span>;
<b>my</b> <span style="color:#800000;">$nline</span> = <span style="color:#0000ff;">0</span>;
<b>my</b> <span style="color:#800000;">$nsplit</span> = <span style="color:#0000ff;">0</span>;
<b>my</b> <span style="color:#800000;">$split_name</span> = <b><span style="color:#008000;">`</span></b><span style="color:#dd0000;">basename </span><span style="color:#800000;">$input_video_file</span><b><span style="color:#008000;">`</span></b>;
<span style="color:#000080;">chomp</span>(<span style="color:#800000;">$split_name</span>);
<span style="color:#800000;">$split_name</span> =~ <b><span style="color:#008000;">s/</span></b><span style="color:#008000;">\.</span><span style="color:#ff00ff;">[^</span><span style="color:#008080;">.</span><span style="color:#ff00ff;">]*$</span><b><span style="color:#008000;">//</span></b>;
<b>my</b> <span style="color:#800000;">$split_ext</span> = <span style="color:#800000;">$input_video_file</span>;
<span style="color:#800000;">$split_ext</span> =~ <b><span style="color:#008000;">s/</span></b><span style="color:#008000;">.</span><span style="color:#ff00ff;">*</span><span style="color:#008000;">\.</span><span style="color:#ff00ff;">([^</span><span style="color:#008080;">.</span><span style="color:#ff00ff;">]*)$</span><b><span style="color:#008000;">/</span></b><span style="color:#c00000;">$1</span><b><span style="color:#008000;">/</span></b>;
<b>my</b> <span style="color:#800000;">$success</span> = <span style="color:#0000ff;">0</span>;
<b>while</b> (<span style="color:#800000;">$line</span> = <b>&lt;CFH&gt;</b>)
{
   <span style="color:#000080;">chomp</span>(<span style="color:#800000;">$line</span>);
   <span style="color:#800000;">$nline</span>++;
   <b>next</b> <b>if</b> (<span style="color:#800000;">$line</span> =~ <b><span style="color:#008000;">m/</span></b><span style="color:#ff00ff;">^</span><span style="color:#008000;">#</span><b><span style="color:#008000;">/</span></b>);
   <b>my</b> (<span style="color:#800000;">$start_time</span>, <span style="color:#800000;">$end_time</span>) = <span style="color:#000080;">split</span>(<b><span style="color:#008000;">/</span></b><span style="color:#008000;">,</span><b><span style="color:#008000;">/</span></b>, <span style="color:#800000;">$line</span>);
   <b>next</b> <b>if</b> (!<span style="color:#000080;">defined</span>(<span style="color:#800000;">$end_time</span>));
   <b>my</b> <span style="color:#800000;">$start_sec</span> = &amp;hms_to_seconds(<span style="color:#800000;">$start_time</span>);
   <b>my</b> <span style="color:#800000;">$end_sec</span> = &amp;hms_to_seconds(<span style="color:#800000;">$end_time</span>);
   <b>if</b> (<span style="color:#800000;">$start_sec</span> &gt;= <span style="color:#800000;">$end_sec</span>)
   {
       <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: </span><span style="color:#800000;">$start_sec</span><span style="color:#dd0000;"> &gt;= </span><span style="color:#800000;">$end_sec</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
       <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">    </span><span style="color:#800000;">$start_time</span><span style="color:#dd0000;"> &gt;= </span><span style="color:#800000;">$end_time</span><span style="color:#dd0000;"> ... skipping for line no </span><span style="color:#800000;">$nline</span><span style="color:#dd0000;"> ...</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
       <b>next</b>;
   }
   <span style="color:#800000;">$end_sec</span> -= <span style="color:#800000;">$start_sec</span>;
   <b>my</b> <span style="color:#800000;">$cmd</span> = <span style="color:#000080;">sprintf</span>(<b><span style="color:#008000;">"</span></b><span style="color:#800000;">%s</span><span style="color:#dd0000;"> -ss </span><span style="color:#800000;">%d</span><span style="color:#dd0000;"> -endpos </span><span style="color:#800000;">%d</span><span style="color:#dd0000;"> -ovc copy -oac copy -o </span><span style="color:#800000;">%s</span><span style="color:#dd0000;">/</span><span style="color:#800000;">%s_%03d</span><span style="color:#dd0000;">.</span><span style="color:#800000;">%s</span><span style="color:#dd0000;"> </span><span style="color:#800000;">%s</span><b><span style="color:#008000;">"</span></b>,
           <span style="color:#800000;">$mencoder</span>, <span style="color:#800000;">$start_sec</span>, <span style="color:#800000;">$end_sec</span>, <span style="color:#800000;">$out_dir</span>, <span style="color:#800000;">$split_name</span>, <span style="color:#800000;">$nsplit</span>,
           <span style="color:#800000;">$split_ext</span>, <span style="color:#800000;">$input_video_file</span>);
   <span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\n\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">-</span><b><span style="color:#008000;">"</span></b> x <span style="color:#0000ff;">80</span> . <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;;
   <span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#800000;">$cmd</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   <span style="color:#000080;">system</span>(<b><span style="color:#008000;">"</span></b><span style="color:#800000;">$cmd</span><b><span style="color:#008000;">"</span></b>);
   <b>if</b> (<span style="color:#c00000;">$?</span> != <span style="color:#0000ff;">0</span>)
   {
       <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#c00000;">$0</span><span style="color:#dd0000;">: failed to create </span><span style="color:#800000;">$nsplit</span><span style="color:#dd0000;"> split for line no </span><span style="color:#800000;">$nline</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
       <span style="color:#000080;">print</span> STDERR <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\t</span><span style="color:#800000;">$cmd</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
   }
   <b>else</b>
   {
       <span style="color:#000080;">print</span> STDOUT <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">Created </span><span style="color:#800000;">$nsplit</span><span style="color:#dd0000;"> split for line </span><span style="color:#800000;">$nline</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
       <span style="color:#800000;">$success</span>++;
   }
   <span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">-</span><b><span style="color:#008000;">"</span></b> x <span style="color:#0000ff;">80</span> . <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;;
   <span style="color:#800000;">$nsplit</span>++;
}

<span style="color:#000080;">close</span>(CFH);

<span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;
<span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">=</span><b><span style="color:#008000;">"</span></b> x <span style="color:#0000ff;">80</span> . <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;;
<span style="color:#000080;">printf</span>(<b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">Total lines = </span><span style="color:#800000;">%d</span><span style="color:#dd0000;">,   Success = </span><span style="color:#800000;">%d</span><span style="color:#dd0000;">/</span><span style="color:#800000;">%d</span><span style="color:#dd0000;">,  Failure = </span><span style="color:#800000;">%d</span><span style="color:#dd0000;">/</span><span style="color:#800000;">%d</span><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>,
       <span style="color:#800000;">$nline</span>, <span style="color:#800000;">$success</span>, <span style="color:#800000;">$nsplit</span>,
       <span style="color:#800000;">$nsplit</span> - <span style="color:#800000;">$success</span>, <span style="color:#800000;">$nsplit</span>);
<span style="color:#000080;">print</span> <b><span style="color:#008000;">"</span></b><span style="color:#dd0000;">=</span><b><span style="color:#008000;">"</span></b> x <span style="color:#0000ff;">80</span> . <b><span style="color:#008000;">"</span></b><span style="color:#ff00ff;">\n</span><b><span style="color:#008000;">"</span></b>;;

<span style="color:#000080;">exit</span>(<span style="color:#0000ff;">0</span>);
</pre>
<p>Please place the above perl script (<span style="color:rgb(204,0,0);">video_cutter.pl</span>) in any directory present in <span style="color:rgb(102,0,0);">$PATH</span>.</p>
<p><b>Sample Run:</b> </p>
<p>Usage of the above script.</p>
<pre>$<span style="color:rgb(0,102,0);"> video_cutter.pl </span>
<span style="color:rgb(0,0,153);">USAGE: /home/mitesh/Programming/Perl/WCS/video_cutter.pl [options] </span>
         -c     default  /base_dir/input_video_file/video_cutter.conf
                           Start_time(hh:mm:ss),End_time(hh:mm:ss)

         -o       default  /base_dir/input_video_file/
</pre>
<p>Content of a sample config file, specifying the split timings.<br />
This will create 3 splits, of 0s-90s, 140s-210s, and 240s-End.</p>
<pre>$<span style="color:rgb(0,102,0);"> cat test_video.conf </span>
<span style="color:rgb(0,0,153);">00:00:00,00:01:30</span>
<span style="color:rgb(0,0,153);">00:02:20,00:03:30</span>
<span style="color:rgb(0,0,153);">00:04:00,59:59:00</span>
</pre>
<p>Now, it will create the three split files in ~/Video/test/ directory.</p>
<pre>$ <span style="color:rgb(0,102,0);font-weight:bold;">video_cutter.pl -c test_video.conf -o ~/Video/test test_video.vob </span>

<span style="color:rgb(0,0,153);">--------------------------------------------------------------------------------</span>
<span style="color:rgb(0,0,153);">/usr/local/bin/mencoder -ss 0 -endpos 90 -ovc copy -oac copy -o /home/mitesh/Video/test/test_video_000.vob test_video.vob</span>
<span style="color:rgb(0,0,153);">MEncoder 1.0rc4-4.4.5 (C) 2000-2010 MPlayer Team</span>
<span style="color:rgb(0,0,153);">...</span>
<span style="color:rgb(0,0,153);">...</span>
<span style="color:rgb(0,0,153);">...</span>
<span style="color:rgb(0,0,153);">Created 2 split for line 3</span>
<span style="color:rgb(0,0,153);">--------------------------------------------------------------------------------</span>

<span style="color:rgb(0,0,153);">================================================================================</span>
<span style="color:rgb(0,0,153);">Total lines = 3,   Success = 3/3,  Failure = 0/3</span>
<span style="color:rgb(0,0,153);">================================================================================</span>
$ <span style="color:rgb(0,102,0);">ls -l ~/Video/test/*.vob</span>
<span style="color:rgb(0,0,153);">-rw-r--r-- 1 mitesh mitesh   7519672 Jun 27 00:31 /home/mitesh/Video/test/test_video_000.vob</span>
<span style="color:rgb(0,0,153);">-rw-r--r-- 1 mitesh mitesh   5844598 Jun 27 00:31 /home/mitesh/Video/test/test_video_001.vob</span>
<span style="color:rgb(0,0,153);">-rw-r--r-- 1 mitesh mitesh 570855360 Jun 27 00:30 /home/mitesh/Video/test/test_video_002.vob</span>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/311/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=311&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2011/06/26/video-cutter-video-cutting-using-mencoder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>CPU Frequency Scaling</title>
		<link>http://miteshjlinuxtips.wordpress.com/2011/05/24/cpu-frequency-scaling/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2011/05/24/cpu-frequency-scaling/#comments</comments>
		<pubDate>Tue, 24 May 2011 09:16:55 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[cpu]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=306</guid>
		<description><![CDATA[I have written a small shell script to increase or decrease CPU frequency. By default, it shows current CPU Frequency Scaling Governor. This can be changed only by root user. So this script needs to be run as root user or sudo as root, while changing the CPU Frequency Scaling governor. #!/bin/bash available_governors=$(cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors \ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=306&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have written a small shell script to increase or decrease CPU frequency. By default, it shows current CPU Frequency Scaling Governor. This can be changed only by root user. So this script needs to be run as root user or sudo as root, while changing the CPU Frequency Scaling governor.</p>
<pre style="color:#000000;background-color:#ffffff;"><i><span style="color:#808080;">#!/bin/bash</span></i>

<span style="color:#008000;">available_governors=$(</span><b><span style="color:#cc00cc;">cat</span></b> /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors \
            <b>|</b> <b><span style="color:#cc00cc;">head</span></b> -1 <b>|</b> <b><span style="color:#cc00cc;">sed</span></b> -e <span style="color:#dd0000;">'s/ \([a-zA-Z0-9]\)/|\1/g'</span> -e <span style="color:#dd0000;">'s/ $//'</span><span style="color:#008000;">)</span>
<b>if</b><b><span style="color:#880088;"> [</span></b> <span style="color:#008000;">$#</span> <span style="color:#008000;">-ne</span> 1<b><span style="color:#880088;"> ]</span></b>
<b>then</b>

   <b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"USAGE: </span><span style="color:#008000;">$0</span><span style="color:#dd0000;"> [</span><span style="color:#008000;">$available_governors</span><span style="color:#dd0000;">]"</span>
<b>fi</b>

<b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"Command line to change CPU Scaling."</span>
<b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"                    - By Mitesh Singh Jat"</span>
<b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">""</span>

<i><span style="color:#808080;">## CPU Governor path</span></i>
<i><span style="color:#808080;">#/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor</span></i>
<b>function</b><b><span style="color:#ff00ff;"> current_cpu_governor ()</span></b>
<b>{</b>
   <b><span style="color:#880088;">echo</span></b> -n <span style="color:#dd0000;">"Current CPU Scaling Governor is: "</span>
   <span style="color:#008000;">cpu_scaling_governor=</span><span style="color:#dd0000;">"NOT SET"</span>
   <b>for</b> governor <b>in</b> <span style="color:#008000;">$(</span><b><span style="color:#cc00cc;">ls</span></b> /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor<span style="color:#008000;">)</span>
   <b>do</b>
       <span style="color:#008000;">cpu_scaling_governor=$(</span><b><span style="color:#cc00cc;">cat</span></b> <span style="color:#008000;">$governor)</span>
   <b>done</b>
   <b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"</span><span style="color:#008000;">$cpu_scaling_governor</span><span style="color:#dd0000;">"</span>
<b>}</b>

current_cpu_governor;

<i><span style="color:#808080;">## Exit, if no governor is provided</span></i>
<span style="color:#008000;">new_governor=</span><span style="color:#dd0000;">""</span>
<b>if</b><b><span style="color:#880088;"> [</span></b> <span style="color:#008000;">$#</span> <span style="color:#008000;">-eq</span> 0<b><span style="color:#880088;"> ]</span></b>
<b>then</b>
   <b><span style="color:#880088;">exit</span></b> 0
<b>else</b>
   <span style="color:#008000;">new_governor=</span><span style="color:#dd0000;">"</span><span style="color:#008000;">$1</span><span style="color:#dd0000;">"</span>
<b>fi</b>

<i><span style="color:#808080;">## Run as root always</span></i>
<span style="color:#008000;">user_id=</span><b>`</b><b><span style="color:#cc00cc;">whoami</span></b><b>`</b>
<b>if [[</b> <span style="color:#dd0000;">"</span><span style="color:#008000;">$user_id</span><span style="color:#dd0000;">"</span> <span style="color:#008000;">!=</span> <span style="color:#dd0000;">"root"</span><b> ]]</b>
<b>then</b>
   <b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"</span><span style="color:#008000;">$0</span><span style="color:#dd0000;">: please run this script as root user."</span>
   <b><span style="color:#880088;">exit</span></b>
<b>fi</b> 

<b>if</b><b><span style="color:#880088;"> [</span></b> <span style="color:#008000;">-z</span> <span style="color:#008000;">$(</span><b><span style="color:#880088;">echo</span></b> <span style="color:#008000;">$available_governors</span> <b>|</b> <b><span style="color:#cc00cc;">sed</span></b> -e <span style="color:#dd0000;">'s/^/|/'</span> -e <span style="color:#dd0000;">'s/$/|/'</span> <b>|</b> <b><span style="color:#cc00cc;">grep</span></b> <span style="color:#dd0000;">"|</span><span style="color:#008000;">$new_governor</span><span style="color:#dd0000;">|"</span><span style="color:#008000;">)</span><b><span style="color:#880088;"> ]</span></b>
<b>then</b>
   <b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"Sorry, this mode '</span><span style="color:#008000;">$new_governor</span><span style="color:#dd0000;">' is not supported."</span>
   <b><span style="color:#880088;">exit</span></b> 1
<b>else</b>
   <b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"Setting CPU into '</span><span style="color:#008000;">$new_governor</span><span style="color:#dd0000;">' Mode..."</span>
<b>fi</b>
<i><span style="color:#808080;">## Now set cpu governor to the given mode</span></i>
<b>for</b> governor <b>in</b> <span style="color:#008000;">$(</span><b><span style="color:#cc00cc;">ls</span></b> /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor<span style="color:#008000;">)</span>
<b>do</b>
   <b><span style="color:#880088;">echo</span></b> <span style="color:#dd0000;">"</span><span style="color:#008000;">$new_governor</span><span style="color:#dd0000;">"</span> <b><span style="color:#223388;">&gt;</span></b> <span style="color:#008000;">$governor</span>
<b>done</b>
current_cpu_governor;

<b><span style="color:#880088;">exit</span></b> 0
</pre>
<p><b> <span style="font-style:italic;">Sample Run </span></b></p>
<pre>Getting current CPU Frequency Scaling Governor
$ <span style="color:rgb(0,102,0);">cd /path/where/cpu_scaling.sh/is/copied/</span>
$<span style="color:rgb(0,102,0);"> ./cpu_scaling.sh</span>
<span style="color:rgb(0,0,153);">USAGE: ./cpu_scaling.sh [</span><span><span style="color:rgb(0,0,153);">powersave|conservative|ondemand|userspace|performance</span></span><span style="color:rgb(0,0,153);">]</span>
<span style="color:rgb(0,0,153);">Command line to change CPU Scaling.</span>
<span style="color:rgb(0,0,153);">                   - By Mitesh Singh Jat</span>

<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: ondemand</span>

Increasing CPU frequency (Please run as root).
$<span style="color:rgb(0,102,0);"> ./cpu_scaling.sh performance</span>
<span style="color:rgb(0,0,153);">Command line to change CPU Scaling.</span>
<span style="color:rgb(0,0,153);">                   - By Mitesh Singh Jat</span>

<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: ondemand</span>
<span style="color:rgb(0,0,153);font-weight:bold;">./cpu_scaling.sh: please run this script as root user.</span>
$<span style="color:rgb(0,102,0);"> sudo ./cpu_scaling.sh <span style="font-weight:bold;">performance</span></span>
[sudo] password for mitesh:
<span style="color:rgb(0,0,153);">Command line to change CPU Scaling.</span>
<span style="color:rgb(0,0,153);">                   - By Mitesh Singh Jat</span>

<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: ondemand</span>
<span style="color:rgb(0,0,153);">Setting CPU into Performance Mode...</span>
<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: performance</span>
$<span style="color:rgb(0,102,0);"> ./cpu_scaling.sh</span>
<span style="color:rgb(0,0,153);">USAGE: ./cpu_scaling.sh [powersave|conservative|ondemand|userspace|performance]</span>
<span style="color:rgb(0,0,153);">Command line to change CPU Scaling.</span>
<span style="color:rgb(0,0,153);">                   - By Mitesh Singh Jat</span>

<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: performance</span>

Decreasing CPU frequency
$<span style="color:rgb(0,102,0);"> sudo ./cpu_scaling.sh <span style="font-weight:bold;">ondemand</span></span>
<span style="color:rgb(0,0,153);">Command line to change CPU Scaling.</span>
<span style="color:rgb(0,0,153);">                   - By Mitesh Singh Jat</span>

<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: performance</span>
<span style="color:rgb(0,0,153);">Setting CPU into OnDemand Mode...</span>
<span style="color:rgb(0,0,153);">Current CPU Scaling Governor is: ondemand</span>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/306/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=306&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2011/05/24/cpu-frequency-scaling/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Playing only Audio from a Video File</title>
		<link>http://miteshjlinuxtips.wordpress.com/2011/03/11/playing-only-audio-from-a-video-file/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2011/03/11/playing-only-audio-from-a-video-file/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 08:32:06 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mplayer]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=300</guid>
		<description><![CDATA[If you want to play only audio from a video file (say xyz.avi), please provide -vo null in mplayer, given as: $ mplayer -vo null xyz.avi<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=300&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to play only audio from a video file (say <em>xyz.avi</em>),<br />
please provide <strong>-vo null</strong> in <strong>mplayer</strong>, given as:<br />
<code><br />
<span style="color:#008000;"> $ mplayer -vo null xyz.avi</span><br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/300/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/300/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=300&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2011/03/11/playing-only-audio-from-a-video-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Speeding up Linux File System (ext3) Performance</title>
		<link>http://miteshjlinuxtips.wordpress.com/2011/03/09/speeding-up-hard-disk-performance/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2011/03/09/speeding-up-hard-disk-performance/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 08:42:50 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[fstab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=290</guid>
		<description><![CDATA[We can increase ext3 performance, hence increasing Hard Disk performance by ~40%, and decrease power consumption by Hard Disk, if we provide &#8220;noatime,nodiratime&#8221; options during partition mounting. Actually what happens is: whenever a file/directory is accessed, its atime &#8220;access time&#8221; is updated with epoch. These two options prevent these not-so-useful disk accesses. Hence performance improvement. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=290&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We can increase <em>ext3</em> performance, hence increasing Hard Disk performance by ~40%, and decrease power consumption by Hard Disk, if we provide &#8220;<em>noatime,nodiratime</em>&#8221; options during partition mounting. Actually what happens is: whenever a file/directory is accessed, its <em>atime</em> &#8220;access time&#8221; is updated with <strong>epoch</strong>. These two options prevent these not-so-useful disk accesses. Hence<br />
performance improvement.</p>
<p>The sample mount point (<em>/home</em>) entry in <em>/etc/fstab</em> may look like:</p>
<pre>
$ <span style="color:#006600;">cat /etc/fstab | grep home</span>
<span style="color:#000099;">/dev/sda2 /home           ext3    defaults,noatime,nodiratime        0       0</span>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=290&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2011/03/09/speeding-up-hard-disk-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows XP in Grub 2</title>
		<link>http://miteshjlinuxtips.wordpress.com/2011/02/24/283/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2011/02/24/283/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 05:30:15 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[boot]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=283</guid>
		<description><![CDATA[When I installed Debian 6.0 (Squeeze) on my laptop, I found that Debian Installer had not added Windows XP entry in the GRUB 2. You might also face same issue, then you can add following lines in /boot/grub/grub.cfg ## (1) Windows XP in /dev/sda1 menuentry "Windows XP" { set root=(hd0,1) chainloader +1 } Here are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=283&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I installed Debian 6.0 (Squeeze) on my laptop, I found that Debian Installer had not added Windows XP entry in the GRUB 2. You might also face same issue, then you can add following lines in <em>/boot/grub/grub.cfg </em></p>
<blockquote>
<pre>## (1) Windows XP in /dev/sda1
menuentry "Windows XP" {
    set root=(hd0,1)
    chainloader +1
}</pre>
</blockquote>
<p>Here are few tips how to set <strong>root</strong> in the grub.cfg</p>
<blockquote>
<pre># DEVICE NAME CONVERSIONS
#
#  Linux           Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/sda        (hd0)
#  /dev/sdb2       (hd1,2)
#  /dev/sda3       (hd0,3)
#</pre>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/283/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=283&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2011/02/24/283/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Cleaning of Temporary Install Files in Ubuntu/Debian</title>
		<link>http://miteshjlinuxtips.wordpress.com/2010/02/02/cleaning-of-temporary-install-files-in-ubuntudebian/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2010/02/02/cleaning-of-temporary-install-files-in-ubuntudebian/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 15:33:35 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[apt]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=280</guid>
		<description><![CDATA[Cleaning of Temporary Install Files in Ubuntu/Debian can be done by giving following commands: $ sudo apt-get autoclean; sudo apt-get autoremove<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=280&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Cleaning of Temporary Install Files in Ubuntu/Debian can be done by giving<br />
following commands:</p>
<p><span style="color:rgb(0,102,0);">$ sudo apt-get autoclean; sudo apt-get autoremove</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/280/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=280&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2010/02/02/cleaning-of-temporary-install-files-in-ubuntudebian/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>How to change boot order in GRUB2?</title>
		<link>http://miteshjlinuxtips.wordpress.com/2009/12/15/how-to-change-boot-order-in-grub2/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2009/12/15/how-to-change-boot-order-in-grub2/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 11:29:22 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[boot]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=270</guid>
		<description><![CDATA[With Ubuntu 9.10 (Karmic Koala), GRUB2 is the default boot loader. How to change boot order in GRUB2? 1. $ cat /etc/grub/grub.cfg see the order of the wanted kernel. Starts from 0. 2. $ vi /etc/default/grub change GRUB_DEFAULT=0 value to wanted kernel 3. run $ update-grub to update 4. reboot and check with $ uname [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=270&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Ubuntu 9.10 (Karmic Koala), GRUB2 is the default boot loader.<br />
How to change boot order in GRUB2?</p>
<p>1.</p>
<pre>
<span style="color:rgb(0,128,0);font-size:10pt;">
$ cat /etc/grub/grub.cfg
</span>
</pre>
<p>see the order of the wanted kernel. Starts from 0.</p>
<p>2.</p>
<pre>
<span style="color:rgb(0,128,0);font-size:10pt;">
$ vi /etc/default/grub
</span>
</pre>
<p>change GRUB_DEFAULT=0 value to wanted kernel</p>
<p>3. run</p>
<pre>
<span style="color:rgb(0,128,0);font-size:10pt;">
$ update-grub
 </span>
</pre>
<p>to update</p>
<p>4. reboot and check with</p>
<pre>
<span style="color:rgb(0,102,0);font-size:10pt;">
$ uname -r </span>
</pre>
<p>to see if correct kernel selected.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/270/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=270&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2009/12/15/how-to-change-boot-order-in-grub2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Find Biggest Files/Directories</title>
		<link>http://miteshjlinuxtips.wordpress.com/2009/12/07/find-biggest-filesdirectories/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2009/12/07/find-biggest-filesdirectories/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 07:12:08 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[find]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=266</guid>
		<description><![CDATA[If you want to find files which are consuming significant amount of disk space, please use the following commands. Since ls does not give correct size on disk, better to use du command. $ du /path/to/dir &#124; sort -nr I hope above command will give you the proper result you wanted. Note: The above command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=266&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to find files which are consuming significant amount of disk space,<br />
please use the following commands.<br />
<font face="Bitstream Vera Sans"></p>
<p>Since <i><b>ls </b></i>does not give correct size on disk, better to<br />
use <i><b>du</b></i> command.</p>
<pre>
</font><font color="#006600"><tt>$ du /path/to/dir | sort -nr
</pre>
<p>
</tt></font><font color="#006600"><font color="#000000">I hope above<br />
command will give you the proper result you wanted.</p>
<p>Note: The above command may take large time, depending on<br />
number of files in <b>/path/to/dir</b> . You can use depth(say 2) in<br />
that dir.</p>
<pre>
</font></font><font color="#006600"><tt>$ du --max-depth=2 /path/to/dir | sort -nr</tt></font>
</pre>
<p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=266&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2009/12/07/find-biggest-filesdirectories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Newer Yahoo! Messenger Protocol on Pidgin on Debian Lenny 5.0</title>
		<link>http://miteshjlinuxtips.wordpress.com/2009/11/17/newer-yahoo-messenger-protocol-on-pidgin-on-debian-lenny-5-0/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2009/11/17/newer-yahoo-messenger-protocol-on-pidgin-on-debian-lenny-5-0/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 12:07:19 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Pidgin]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=262</guid>
		<description><![CDATA[Yahoo! has changed authentication method of Yahoo! messenger protocol, which is not supported in Pidgin (Version = 2.5.7) supports newer Yahoo! Messenger Protocol. But Debian 5.0 Lenny repository has older pidgin (2.4.3). We can install newer pidgin, in the following steps: ## download latest pidgin from pidgin.im (at this time 2.6.3 is latest) $ wget [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=262&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yahoo! has changed authentication method of Yahoo! messenger protocol, which is not supported in Pidgin (Version = 2.5.7) supports newer Yahoo! Messenger Protocol. But Debian 5.0 Lenny repository has older pidgin (2.4.3). We can install newer pidgin, in the following steps:</p>
<pre>
## download latest pidgin from pidgin.im (at this time 2.6.3 is latest)
<span style="color:rgb(0,102,0);">$ wget http://sourceforge.net/projects/pidgin/files/Pidgin/pidgin-2.6.3.tar.bz2</span>

## extract files using <a href="http://miteshjlinuxtips.wordpress.com/2008/05/07/creation-of-tar-and-compressed-file-tar-ball-in-one-go/">tar</a>
<span style="color:rgb(0,102,0);">$ tar -zxvf pidgin-2.6.3.tar.bz2</span>

<span style="color:rgb(0,102,0);">$ cd pidgin-2.6.3</span>

## Configure, Compile, and make
<span style="color:rgb(0,102,0);">$ ./configure --disable-screensaver --disable-vv --disable-avahi --disable-tcl --disable-tk --prefix=/usr </span>
<span style="color:rgb(0,102,0);">$ make</span>
<span style="color:rgb(0,102,0);">$ sudo make install</span>
</pre>
<p>Now you can use newer pidgin with newer Yahoo! Messenger. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Enjoy Yahoo!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=262&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2009/11/17/newer-yahoo-messenger-protocol-on-pidgin-on-debian-lenny-5-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
		<item>
		<title>Find Files Created Between 2 Times</title>
		<link>http://miteshjlinuxtips.wordpress.com/2009/11/17/find-files-created-between-2-times/</link>
		<comments>http://miteshjlinuxtips.wordpress.com/2009/11/17/find-files-created-between-2-times/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 06:24:19 +0000</pubDate>
		<dc:creator>miteshsjat</dc:creator>
				<category><![CDATA[find]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://miteshjlinuxtips.wordpress.com/?p=257</guid>
		<description><![CDATA[In order to find files created between two times (start hour and end hour). The required hours are hours from current time. For example, Current time = 2 PM = 14:00 If you want file created between 9 AM and 12 PM today, the start hour and end hour are: Start Hour = (14 &#8211; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=257&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In order to find files created between two times (start hour and end hour). The required hours are hours from current time. For example,</p>
<p>Current time           = 2 PM  = 14:00</p>
<p>If you want file created between 9 AM and 12 PM today, the start hour and end hour are:</p>
<p>Start Hour               = (14 &#8211; 9)  = 5<br />
End Hour                 = (14 &#8211; 12) = 2</p>
<p>Hence required command is:</p>
<pre>
$ <span style="color:rgb(0,102,0);"> ./find_files_between_times.pl /path/to/dir 5 2
</span>
</pre>
<p>The Perl script which does this is given below:-<br />
<code></p>
<pre>
<span style="font-weight:bold;color:#000000;">#!/usr/bin/perl -w</span>
<span style="font-style:italic;color:#808080;">#===============================================================================</span>
<span style="font-style:italic;color:#808080;">#</span>
<span style="font-style:italic;color:#808080;">#         FILE:  find_files_between_times.pl</span>
<span style="font-style:italic;color:#808080;">#</span>
<span style="font-style:italic;color:#808080;">#        USAGE:  ./find_files_between_times.pl &lt;dir&gt; &lt;start_hour&gt; &lt;end_hour&gt;</span>
<span style="font-style:italic;color:#808080;">#</span>
<span style="font-style:italic;color:#808080;">#  DESCRIPTION:  </span>
<span style="font-style:italic;color:#808080;">#</span>
<span style="font-style:italic;color:#808080;">#      OPTIONS:  ---</span>
<span style="font-style:italic;color:#808080;"># REQUIREMENTS:  ---</span>
<span style="font-style:italic;color:#808080;">#         BUGS:  ---</span>
<span style="font-style:italic;color:#808080;">#        NOTES:  ---</span>
<span style="font-style:italic;color:#808080;">#       AUTHOR:  Mitesh Singh Jat (mitesh), &lt;mitesh[at]yahoo-inc[dot]com&gt;</span>
<span style="font-style:italic;color:#808080;">#      COMPANY:  Yahoo Inc, India</span>
<span style="font-style:italic;color:#808080;">#      VERSION:  1.0</span>
<span style="font-style:italic;color:#808080;">#      CREATED:  11/13/2009 10:00:02 PM IST</span>
<span style="font-style:italic;color:#808080;">#     REVISION:  ---</span>
<span style="font-style:italic;color:#808080;">#===============================================================================</span>

<span style="font-weight:bold;color:#000000;">use</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#000000;">strict</span><span style="color:#000000;">;</span>
<span style="font-weight:bold;color:#000000;">use</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#000000;">warnings</span><span style="color:#000000;">;</span>

<span style="font-weight:bold;color:#000000;">if</span><span style="color:#000000;"> (</span><span style="color:#c00000;">@ARGV</span><span style="color:#000000;"> != </span><span style="color:#0000ff;">3</span><span style="color:#000000;">)</span>
<span style="color:#000000;">{</span>
<span style="color:#000000;">    </span><span style="color:#000080;">print</span><span style="color:#000000;"> STDERR </span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#dd0000;">Usage: </span><span style="color:#c00000;">$0</span><span style="color:#dd0000;"> &lt;dir&gt; &lt;start_hour&gt; &lt;end_hour&gt;</span><span style="color:#ff00ff;">\n</span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#000000;">;</span>
<span style="color:#000000;">    </span><span style="color:#000080;">exit</span><span style="color:#000000;">(-</span><span style="color:#0000ff;">1</span><span style="color:#000000;">);</span>
<span style="color:#000000;">}</span>

<span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> </span><span style="color:#800000;">$dir</span><span style="color:#000000;"> = </span><span style="color:#c00000;">$ARGV</span><span style="color:#000000;">[</span><span style="color:#0000ff;">0</span><span style="color:#000000;">];</span>
<span style="font-style:italic;color:#808080;">## Calculate current_hour - given_hour</span>
<span style="font-style:italic;color:#808080;">#my $start_time = `/bin/date "+\%H"`;</span>
<span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> </span><span style="color:#800000;">$start_time</span><span style="color:#000000;"> = </span><span style="color:#c00000;">$ARGV</span><span style="color:#000000;">[</span><span style="color:#0000ff;">1</span><span style="color:#000000;">];</span>
<span style="font-style:italic;color:#808080;">#chomp($start_time);</span>
<span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> </span><span style="color:#800000;">$end_time</span><span style="color:#000000;"> = </span><span style="color:#c00000;">$ARGV</span><span style="color:#000000;">[</span><span style="color:#0000ff;">2</span><span style="color:#000000;">];</span>
<span style="color:#800000;">$end_time</span><span style="color:#000000;"> = </span><span style="color:#000080;">time</span><span style="color:#000000;"> - (</span><span style="color:#800000;">$end_time</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#008000;">*</span><span style="color:#000000;"> </span><span style="color:#0000ff;">60</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#008000;">*</span><span style="color:#000000;"> </span><span style="color:#0000ff;">60</span><span style="color:#000000;">);</span>
<span style="font-style:italic;color:#808080;">#$end_time = $start_time - $end_time;</span>
<span style="font-style:italic;color:#808080;">#$start_time = $start_time - $ARGV[0];</span>

<span style="font-weight:bold;color:#000000;">if</span><span style="color:#000000;"> (</span><span style="color:#800000;">$start_time</span><span style="color:#000000;"> &gt; </span><span style="color:#800000;">$end_time</span><span style="color:#000000;">)</span>
<span style="color:#000000;">{</span>
<span style="color:#000000;">    (</span><span style="color:#800000;">$start_time</span><span style="color:#000000;">, </span><span style="color:#800000;">$end_time</span><span style="color:#000000;">) = (</span><span style="color:#800000;">$end_time</span><span style="color:#000000;">, </span><span style="color:#800000;">$start_time</span><span style="color:#000000;">);</span>
<span style="color:#000000;">}</span>

<span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> </span><span style="color:#800000;">$cmd</span><span style="color:#000000;"> = </span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#dd0000;">find </span><span style="color:#800000;">$dir</span><span style="color:#dd0000;"> -ctime -</span><span style="color:#800000;">$start_time</span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#000000;">;</span>
<span style="color:#000080;">print</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#dd0000;">Running </span><span style="color:#800000;">$cmd</span><span style="color:#ff00ff;">\n</span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#000000;">;</span>
<span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> </span><span style="color:#800000;">@files</span><span style="color:#000000;"> = </span><span style="font-weight:bold;color:#008000;">`</span><span style="color:#800000;">$cmd</span><span style="font-weight:bold;color:#008000;">`</span><span style="color:#000000;">;</span>
<span style="font-weight:bold;color:#000000;">foreach</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> </span><span style="color:#800000;">$file</span><span style="color:#000000;"> (</span><span style="color:#800000;">@files</span><span style="color:#000000;">) </span><span style="font-style:italic;color:#808080;"># (`find $dir -ctime $start_time`)</span>
<span style="color:#000000;">{</span>
<span style="color:#000000;">    </span><span style="color:#000080;">chomp</span><span style="color:#000000;">(</span><span style="color:#800000;">$file</span><span style="color:#000000;">);</span>
<span style="color:#000000;">    </span><span style="font-weight:bold;color:#000000;">my</span><span style="color:#000000;"> (</span><span style="color:#800000;">$dev</span><span style="color:#000000;">,</span><span style="color:#800000;">$ino</span><span style="color:#000000;">,</span><span style="color:#800000;">$mode</span><span style="color:#000000;">,</span><span style="color:#800000;">$nlink</span><span style="color:#000000;">,</span><span style="color:#800000;">$uid</span><span style="color:#000000;">,</span><span style="color:#800000;">$gid</span><span style="color:#000000;">,</span><span style="color:#800000;">$rdev</span><span style="color:#000000;">,</span><span style="color:#800000;">$size</span><span style="color:#000000;">,</span>
<span style="color:#000000;">                           </span><span style="color:#800000;">$atime</span><span style="color:#000000;">,</span><span style="color:#800000;">$mtime</span><span style="color:#000000;">,</span><span style="color:#800000;">$ctime</span><span style="color:#000000;">,</span><span style="color:#800000;">$blksize</span><span style="color:#000000;">,</span><span style="color:#800000;">$blocks</span><span style="color:#000000;">) </span>
<span style="color:#000000;">        = </span><span style="color:#000080;">stat</span><span style="color:#000000;">(</span><span style="color:#800000;">$file</span><span style="color:#000000;">);</span>

<span style="color:#000000;">    </span><span style="font-weight:bold;color:#000000;">if</span><span style="color:#000000;"> (</span><span style="color:#800000;">$ctime</span><span style="color:#000000;"> &gt; </span><span style="color:#800000;">$end_time</span><span style="color:#000000;">)</span>
<span style="color:#000000;">    {</span>
<span style="color:#000000;">        </span><span style="font-weight:bold;color:#000000;">next</span><span style="color:#000000;">;</span>
<span style="color:#000000;">    }</span>
<span style="color:#000000;">    </span><span style="color:#000080;">print</span><span style="color:#000000;"> </span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#800000;">$file</span><span style="color:#ff00ff;">\n</span><span style="font-weight:bold;color:#008000;">"</span><span style="color:#000000;">;</span>
<span style="color:#000000;">}</span>

<span style="color:#000080;">exit</span><span style="color:#000000;">(</span><span style="color:#0000ff;">0</span><span style="color:#000000;">);</span>
</pre>
<p></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miteshjlinuxtips.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miteshjlinuxtips.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miteshjlinuxtips.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miteshjlinuxtips.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miteshjlinuxtips.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miteshjlinuxtips.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miteshjlinuxtips.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miteshjlinuxtips.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miteshjlinuxtips.wordpress.com&amp;blog=7857485&amp;post=257&amp;subd=miteshjlinuxtips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miteshjlinuxtips.wordpress.com/2009/11/17/find-files-created-between-2-times/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/86a692cbaedb3f0cf6bfecd08a9497dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miteshsjat</media:title>
		</media:content>
	</item>
	</channel>
</rss>
