<?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>MemoSoup &#187; file</title>
	<atom:link href="http://www.memosoup.com/tag/file/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Perl: get file checksum</title>
		<link>http://www.memosoup.com/20100608/perl-get-file-checksum.html</link>
		<comments>http://www.memosoup.com/20100608/perl-get-file-checksum.html#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:12:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[md5]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=286</guid>
		<description><![CDATA[use Digest::MD5;
use IO::File;

my $chk = Digest::MD5-&#62;new&#40;&#41;;

foreach my $file &#40;@ARGV&#41;
&#123;
&#160; &#160; $chk-&#62;addfile&#40;IO::File-&#62;new&#40;$file&#41;&#41;;

&#160; &#160; print &#34;$file -&#62; &#34;,$chk-&#62;hexdigest,&#34;\n&#34;;
&#125;
<p>The additional details could be found on [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">use</span> Digest<span style="color: #339933;">::</span><span style="color: #006600;">MD5</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">File</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$chk</span> <span style="color: #339933;">=</span> Digest<span style="color: #339933;">::</span><span style="color: #006600;">MD5</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #000000; font-weight: bold;">ARGV</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$chk</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">addfile</span><span style="color: #009900;">&#40;</span>IO<span style="color: #339933;">::</span><span style="color: #006600;">File</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$file -&gt; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$chk</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">hexdigest</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>The additional details could be found on <a href="http://www.ibm.com/developerworks/aix/library/au-satsystemvalidity/index.html?S_TACT=105AGX99">IBM site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20100608/perl-get-file-checksum.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle: file needs recovery (offline mode)</title>
		<link>http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html</link>
		<comments>http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html#comments</comments>
		<pubDate>Thu, 01 Oct 2009 11:00:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[recover]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=188</guid>
		<description><![CDATA[select d.file# f#, d.name, d.status, h.status
from v$datafile d, v$datafile_header h
where d.file# = h.file#
and &#40;d.status not in &#40;'SYSTEM','ONLINE'&#41; or h.status != 'ONLINE' &#41;;
<p>If there are such files, the recovery is necessary:</p>

restore the file from the backup
recover datafile &#8216;&#038;the_file_name&#8217; ;
alter database datafile &#8216;&#038;the_file_name&#8217; online;

<p>Another possibility (if there are a lot of files):</p>

restore the files from the backup
recover tablespace [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">select</span> d.<span style="color: #0000FF;">file</span># f#, d.<span style="color: #202020;">name</span>, d.<span style="color: #202020;">status</span>, h.<span style="color: #202020;">status</span><br />
<span style="color: #0000FF;">from</span> v$datafile d, v$datafile_header h<br />
<span style="color: #0000FF;">where</span> d.<span style="color: #0000FF;">file</span># <span style="color: #808080;">=</span> h.<span style="color: #0000FF;">file</span>#<br />
and <span style="color: #808080;">&#40;</span>d.<span style="color: #202020;">status</span> not in <span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'SYSTEM'</span>,<span style="color: #FF0000;">'ONLINE'</span><span style="color: #808080;">&#41;</span> or h.<span style="color: #202020;">status</span> <span style="color: #808080;">!=</span> <span style="color: #FF0000;">'ONLINE'</span> <span style="color: #808080;">&#41;</span>;</div></div>
<p>If there are such files, the recovery is necessary:</p>
<ol>
<li>restore the file from the backup</li>
<li>recover datafile &#8216;&#038;the_file_name&#8217; ;</li>
<li>alter database datafile &#8216;&#038;the_file_name&#8217; online;</li>
</ol>
<p>Another possibility (if there are a lot of files):</p>
<ol>
<li>restore the files from the backup</li>
<li>recover tablespace &#8216;&#038;tbs_name&#8217; ;</li>
<li>alter tablespace &#8216;&#038;tbs_name&#8217; online;</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix: get the file date</title>
		<link>http://www.memosoup.com/20090918/unix-get-the-file-date.html</link>
		<comments>http://www.memosoup.com/20090918/unix-get-the-file-date.html#comments</comments>
		<pubDate>Fri, 18 Sep 2009 15:08:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=132</guid>
		<description><![CDATA[ls -1 &#124; cpio -o &#124; cpio -ivt &#124; awk '{print $NF, $(NF-1), $(NF-4), $(NF-3) }'
<p>Warning: I/O expensive for the large files!</p>
<p>Perl:</p>
@a = localtime&#40;&#40;stat&#40;$my_file&#41;&#41;&#91;9&#93;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cpio</span> <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cpio</span> <span style="color: #660033;">-ivt</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF, $(NF-1), $(NF-4), $(NF-3) }'</span></div></div>
<p><strong>Warning: </strong>I/O expensive for the large files!</p>
<p><strong>Perl:</strong></p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">@a</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/localtime.html"><span style="color: #000066;">localtime</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/stat.html"><span style="color: #000066;">stat</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$my_file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span><br />
<a href="http://perldoc.perl.org/functions/printf.html"><span style="color: #000066;">printf</span></a> <span style="color: #ff0000;">&quot;%02d%02d%02d&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090918/unix-get-the-file-date.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
