<?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>i4MK</title>
	<atom:link href="http://i4mk.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://i4mk.wordpress.com</link>
	<description>NOT just another blog... Enjoy IT!</description>
	<lastBuildDate>Sat, 28 Jan 2012 22:01:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='i4mk.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>i4MK</title>
		<link>http://i4mk.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://i4mk.wordpress.com/osd.xml" title="i4MK" />
	<atom:link rel='hub' href='http://i4mk.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Ruby/Unix: Killing process using a tmp file&#8230;</title>
		<link>http://i4mk.wordpress.com/2012/01/28/rubyunix-killing-process-using-a-tmp-file/</link>
		<comments>http://i4mk.wordpress.com/2012/01/28/rubyunix-killing-process-using-a-tmp-file/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 22:00:53 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[pid]]></category>
		<category><![CDATA[process id]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[temporary file]]></category>
		<category><![CDATA[tmp file]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=686</guid>
		<description><![CDATA[The following script kills all skype processes, using a mix of ruby and shell commands. If there are active Skype processes on your system, one by one, the script will save the process ID (PID) on a temporary file and then kill it. #!/usr/bin/env ruby d=`date "+%d%m%Y"` myFile=`echo $HOME"/skypePID_tmp#{d}"` myFile.strip! numOfPID=`ps -e &#124; grep -i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=686&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following script kills all skype processes, using a mix of ruby and shell commands.<br />
If there are active Skype processes on your system, one by one, the script will save the process ID (PID) on a temporary file and then kill it.</p>
<pre>
#!/usr/bin/env ruby
d=`date "+%d%m%Y"`
myFile=`echo $HOME"/skypePID_tmp#{d}"`
myFile.strip!
numOfPID=`ps -e | grep -i skype | wc -l`
numOfPID = numOfPID.to_i
while (numOfPID &gt; 0)
        <strong># saving PID on a tmp file:</strong>
        system "ps -e | grep -i skype &gt; #{myFile}"
        <strong># opening file:</strong>
        File.open(myFile, 'r+') do |f|
                <strong># reading PID from file:</strong>
                line = f.gets
                pid = line[0,5]
                pid.strip!
                <strong># killing process:</strong>
                system "kill -9 #{pid}"
                puts 'Process ID ' &lt;&lt; pid &lt;&lt; &#039; killed!&#039;
        end
        numOfPID -= 1
        sleep(0.2)
        <strong># removing file:</strong>
        system "rm #{myFile}"
end
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/686/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=686&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2012/01/28/rubyunix-killing-process-using-a-tmp-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>How to find tables and columns in Oracle Databases</title>
		<link>http://i4mk.wordpress.com/2012/01/25/find-tables-and-columns-in-oracle/</link>
		<comments>http://i4mk.wordpress.com/2012/01/25/find-tables-and-columns-in-oracle/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 14:07:05 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[all columns]]></category>
		<category><![CDATA[all tables]]></category>
		<category><![CDATA[column name]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle tables]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=675</guid>
		<description><![CDATA[Very often is necessary to find tables in a database, that corresponds to a specific pattern and there are specific Oracle Database tables which describe that information: ALL_TABLES – list of all tables in the current database that are accessible to the current user; ALL_TAB_COLUMNS – list of all columns in the database that are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=675&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Very often is necessary to find tables in a database, that corresponds to a specific pattern and there are specific Oracle Database tables which describe that information:</p>
<p><strong>ALL_TABLES</strong> – list of all tables in the current database that are accessible to the current user;<br />
<strong>ALL_TAB_COLUMNS</strong> – list of all columns in the database that are accessible to the current user;</p>
<ul>
<li>Find all Tables that have PATTERN in the table name:</li>
</ul>
<pre>SELECT TABLE_NAME FROM  ALL_TABLES
WHERE TABLE_NAME LIKE '%PATTERN%';</pre>
<ul>
<li>Find all tables that have at least one column that matches a specific PATTERN in the column name:</li>
</ul>
<pre>SELECT TABLE_NAME, COLUMN_NAME FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME LIKE '%PATTERN%';</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/675/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=675&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2012/01/25/find-tables-and-columns-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Minus</title>
		<link>http://i4mk.wordpress.com/2012/01/25/oracle-minus/</link>
		<comments>http://i4mk.wordpress.com/2012/01/25/oracle-minus/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 12:33:40 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[column name]]></category>
		<category><![CDATA[cursors]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle minus]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[sql statements]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=665</guid>
		<description><![CDATA[The sql minus operator is used between two SQL statements and returns only rows returned by the first query but not by the second: SELECT column_name FROM table_name1 MINUS SELECT column_name FROM table_name2; Very useful, for instance to make a comparison between two tables and insert the values on the second table that do not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=665&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The sql minus operator is used between two SQL statements and returns only rows returned by the first query but not by the second:</p>
<pre>
<em>SELECT column_name FROM table_name1</em>
<em>MINUS</em>
<em>SELECT column_name FROM table_name2;</em>
</pre>
<p>Very useful, for instance to make a comparison between two tables and insert the values on the second table that do not exist in the 1st one. For e.g.:</p>
<pre>
declare

cursor c1 is
SELECT emp_name FROM employers
MINUS
SELECT emp_name FROM employers_bck;

begin
    for val in c1 loop
        insert into employers_backup(emp_name, inserted_date)
        values (val.emp_name, sysdate);
    end loop;
    commit;
end;
/
</pre>
<p>It could also be done by using <a href="http://i4mk.wordpress.com/2011/10/23/571/" target="_blank">cursors with parameters</a>, passing the <em>emp_name</em> from <em>employers</em> table as a parameter, and then inserting the non-existent employers from <em>employers</em> table, in the <em>employers_bck</em> table.</p>
<p>But this approach is very bad regarding performance. So in these situations is very recommended to use SQL Minus as shown above.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/665/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=665&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2012/01/25/oracle-minus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix: Pipes</title>
		<link>http://i4mk.wordpress.com/2012/01/25/unix-pipes/</link>
		<comments>http://i4mk.wordpress.com/2012/01/25/unix-pipes/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 11:48:58 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[temporary storage]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=659</guid>
		<description><![CDATA[A pipe is a temporary storage place where the output of one command is stored and then it&#8217;s passed as input to the 2nd command. So, with pipes is possible to connect the output of one program to the input of another, without any temporary file. It is used to run two or more commands [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=659&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">A pipe is a temporary storage place where the output of one command is stored and then it&#8217;s passed as input to the 2nd command.</p>
<p style="text-align:justify;">So, with pipes is possible to connect the output of one program to the input of another, without any temporary file.<br />
It is used to run two or more commands at the same time, from the same command line.</p>
<p style="text-align:justify;">For e.g.: <em>$ ls / -R | wc –l</em></p>
<p style="text-align:justify;">The command above give us the number of files in our system.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/659/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/659/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/659/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=659&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2012/01/25/unix-pipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix: Output redirection</title>
		<link>http://i4mk.wordpress.com/2012/01/24/unix-output-redirection/</link>
		<comments>http://i4mk.wordpress.com/2012/01/24/unix-output-redirection/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 15:23:42 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[chars]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[lt]]></category>
		<category><![CDATA[output redirection]]></category>
		<category><![CDATA[reading input]]></category>
		<category><![CDATA[stuff]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[unix commands]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=650</guid>
		<description><![CDATA[Following up on Unix stuff for begginers&#8230; Usually, unix commands take input from keyboard and show outputs on the standard output, the screen. For e.g.: $ ls But it is possible to send the output to a file, using the following syntax: linux-command &#62; filename For e.g.: $ cal &#62; test If the file already exist, it will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=650&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://i4mk.wordpress.com/category/unix/" target="_blank">Following up on Unix stuff for begginers&#8230;</a></p>
<p>Usually, unix commands take input from keyboard and show outputs on the standard output, the screen.<br />
For e.g.: $ <em>ls</em></p>
<p>But it is possible to <strong>send the output to a file</strong>, using the following <span style="text-decoration:underline;">syntax</span>:<br />
<em>linux-command &gt; filename</em></p>
<p>For e.g.: $ <em>cal &gt; test</em></p>
<p><span style="text-decoration:underline;">If the file already exist, it will be overwritten</span>, else a new file will be created.<br />
To fix this problem and <strong>append the output to the end of the file</strong>, it&#8217;s used the following <span style="text-decoration:underline;">syntax</span>: <em>linux-command &gt;&gt; filename</em></p>
<p>For e.g.: $ <em>w &gt;&gt; appendTest</em></p>
<p><span style="text-decoration:underline;">If file doesn&#8217;t exist, it&#8217;s created a new file</span>.</p>
<p>Is also possible to<strong> get input from file</strong>.<br />
<span style="text-decoration:underline;">Syntax</span>: <em>linux-command &lt; filename</em></p>
<p>For e.g.:</p>
<pre>$ <em>cat &gt; test this is some text. this is more text.</em>

<em>Ctrl+D to save</em>

<em> $ tr "a-z" "A-Z" &lt; test &gt; uppercaseText</em>

<em> $ cat uppercaseText</em>
<em> THIS IS SOME TEXT.</em>
<em> THIS IS MORE TEXT.</em></pre>
<p>This last example, get a text file as input and transforms all lowercase chars within it, to uppercase. Then its output is redirected and saved to a new file (&#8220;uppercaseTest&#8221;).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/650/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=650&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2012/01/24/unix-output-redirection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating a backup table from another&#8230; (ORACLE)</title>
		<link>http://i4mk.wordpress.com/2011/12/06/creating-a-backup-table-from-another-oracle/</link>
		<comments>http://i4mk.wordpress.com/2011/12/06/creating-a-backup-table-from-another-oracle/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 23:05:23 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[backup table]]></category>
		<category><![CDATA[create table]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=646</guid>
		<description><![CDATA[Imagine that you need to do a risky operation on your production Database (DB). Since you can loose all your data, a good thing to do is to create a backup table with all columns and important records. You can do it, with the following sql statement: CREATE TABLE my_NEW_Backup_Table AS ( SELECT * FROM [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=646&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Imagine that you need to do a risky operation on your production Database (DB).<br />
Since you can loose all your data, a good thing to do is to create a backup table with all columns and important records.</p>
<p>You can do it, with the following sql statement:</p>
<pre>CREATE TABLE my_NEW_Backup_Table AS
( SELECT * FROM OLD_TABLE WHERE CLAUSE);</pre>
<p>Simple and very useful! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/646/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=646&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2011/12/06/creating-a-backup-table-from-another-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL #1</title>
		<link>http://i4mk.wordpress.com/2011/12/02/mysql-1/</link>
		<comments>http://i4mk.wordpress.com/2011/12/02/mysql-1/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 23:53:32 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=632</guid>
		<description><![CDATA[MySQL is the world&#8217;s most popular open source Relational Database Management System (RDBMS). It is a popular choice for use in Web Applications because it is secure, robust, fast, Multi-Platform and very important these days: free! Perfect for small to medium applications. Some useful commands to start: mysqladmin -u root -ppassword create databasename # Creates a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=632&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>MySQL</strong> is the world&#8217;s most popular open source Relational Database Management System (RDBMS).<br />
It is a popular choice for use in Web Applications because it is <strong>secure</strong>, <strong>robust</strong>, <strong>fast</strong>, <strong>Multi-Platform</strong> and very important these days: <strong>free</strong>!<br />
Perfect for small to medium applications.</p>
<p>Some useful commands to start:</p>
<ul>
<li><em>mysqladmin -u root -ppassword create databasename</em> # <span style="text-decoration:underline;">Creates a new database</span></li>
<li><em>mysql -u root -p</em> # <span style="text-decoration:underline;">Command used to connect to MySQL (The password request will be prompted)</span></li>
<li><em>mysql -u root -ppassword_name</em> # <span style="text-decoration:underline;">Command used to connect to MySQL (no space between the -p and the password)</span></li>
<li><em>mysql -u root -ppassword database_name</em> # <span style="text-decoration:underline;">Command used to connect with MySQL and start using a database</span></li>
<li><em>mysql -u root &#8211;password=password_name database_name</em> # <span style="text-decoration:underline;">Command</span><span style="text-decoration:underline;"> used to connect with MySQL and start using a database</span></li>
<li><em>CREATE DATABASE database_name; </em># <span style="text-decoration:underline;">Allows to create a database</span></li>
<li><em>SHOW DATABASES;</em> # <span style="text-decoration:underline;">S</span><span style="text-decoration:underline;">how all Databases</span></li>
<li><em>USE database_name;</em> # <span style="text-decoration:underline;">Allows</span><span style="text-decoration:underline;"> us to change database</span></li>
<li><em>SELECT DATABASE();</em> # <span style="text-decoration:underline;">Tells</span><span style="text-decoration:underline;"> which database is currently being used</span></li>
<li><em>\q;</em> # This command <span style="text-decoration:underline;">allows us to exit from the Database</span>;</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/632/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=632&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2011/12/02/mysql-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Validations with Regexps (Ruby)</title>
		<link>http://i4mk.wordpress.com/2011/12/01/regexps-for-validations-ruby/</link>
		<comments>http://i4mk.wordpress.com/2011/12/01/regexps-for-validations-ruby/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 01:31:44 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[email]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[validate if numeric]]></category>
		<category><![CDATA[validate if valid email]]></category>
		<category><![CDATA[validations]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=622</guid>
		<description><![CDATA[For those who don&#8217;t know what a regexp (regular expression) is: A regexp is a pattern or a set of rules, that can be used to match against a String. One way to create a regular expression in Ruby, is to put the pattern between 2 slashes, like this: /pattern/ There are many tutorials on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=622&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For those who don&#8217;t know what a regexp (regular expression) is: A regexp is a pattern or a set of rules, that can be used to match against a String.</p>
<p>One way to create a regular expression in Ruby, is to put the pattern between 2 slashes, like this: /pattern/<br />
There are many tutorials on internet where you can learn more about Regular Expressions, and its power: the regexp wild cards!<br />
For instance, <a href="http://www.rubyist.net/~slagell/ruby/regexp.html" target="_blank">here</a>.<br />
Just Google it!<br />
Google is your friend! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Imagine that you need to make a validation of an email field, to make sure the user inserts a valid email, or you need to verify if a specific field is numeric?</p>
<p>Regular Expressions can help you doing that:</p>
<ul>
<li><a href="http://rubular.com/r/g7jqSKhftI" target="_blank">To validate a numeric field (it accept negative and decimal values)</a>: ^[+|-]?(\d)+((\.)(\d)+)?$</li>
<li><a href="http://rubular.com/r/D4jblmd8Cs" target="_blank">To get a valid email</a>: ^[\w\.-]+@[\w\.-]+\.(\w){2,6}$</li>
</ul>
<p>You can play with Regular Expressions on this fantastic website: <a href="http://rubular.com/" target="_blank">Rubular.com</a><br />
Or use this Ruby program to test the above patterns and make your validations:</p>
<pre>def isNumeric?(str)
  pattern = /^[+|-]?(\d)+((\.)(\d)+)?$/
  matches = pattern.match(str)
  !matches.nil?
end

def isValidEmail?(str)
  pattern = /^[\w\.-]+@[\w\.-]+\.(\w){2,6}$/
  matches = pattern.match(str)
  !matches.nil?
end

def numericProg
  repeat = true
  while repeat
    puts
    print 'Digit something: '
    STDOUT.flush
    myStr = gets.chomp
    if isNumeric?(myStr)
      puts "My String is numeric."
      puts
    else
      puts "Not numeric."
      puts
    end
    begin
      print 'Try again(s/n): '
      STDOUT.flush
      ans = gets.chomp
      if ans.downcase == "n"
        repeat = false
      end
    end while (ans.downcase != "n" &amp;&amp; ans.downcase != "s")
  end
end

def emailProg
  repeat = true
  while repeat
    puts
    print 'Digit an email: '
    STDOUT.flush
    myStr = gets.chomp
    if isValidEmail?(myStr)
      puts "It is a valid email! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> "
      puts
    else
      puts "It isn\'t a valid email! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> "
      puts
    end
    begin
      print 'Try again(s/n): '
      STDOUT.flush
      ans = gets.chomp
      if ans.downcase == "n"
        repeat = false
      end
    end while (ans.downcase != "n" &amp;&amp; ans.downcase != "s")
  end
end

def menu
  begin
    puts
    puts '(1) Validate if it is numeric'
    puts '(2) Validate Email'
    puts '(3) Exit'
    puts

    print 'Choose an option: '
    STDOUT.flush
    ans = gets.chomp
    if ans == "1"
      numericProg
      menu
    elsif ans == "2"
      emailProg
      menu
    elsif ans == "3"
      puts 'i4mk.wordpress.com is cool!'
      exit
    end
  end while (ans != "1" &amp;&amp; ans != "2" &amp;&amp; ans != "3")
end

menu</pre>
<p>Have fun with Regexp! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/622/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=622&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2011/12/01/regexps-for-validations-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>
	</item>
		<item>
		<title>IT Private Jokes #8</title>
		<link>http://i4mk.wordpress.com/2011/11/05/it-private-jokes-8/</link>
		<comments>http://i4mk.wordpress.com/2011/11/05/it-private-jokes-8/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 12:37:37 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[humor]]></category>
		<category><![CDATA[IT private Jokes]]></category>
		<category><![CDATA[Berlusconi]]></category>
		<category><![CDATA[Crisis]]></category>
		<category><![CDATA[Economy]]></category>
		<category><![CDATA[EU]]></category>
		<category><![CDATA[Europe]]></category>
		<category><![CDATA[Greece]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Italy]]></category>
		<category><![CDATA[jokes]]></category>
		<category><![CDATA[Papandreou]]></category>
		<category><![CDATA[Steve Jobs]]></category>
		<category><![CDATA[usa]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=612</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=612&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://i4mk.files.wordpress.com/2011/11/rip-steve-jobs.jpg"><img class="aligncenter size-full wp-image-613" title="RIP Steve Jobs" src="http://i4mk.files.wordpress.com/2011/11/rip-steve-jobs.jpg?w=510" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/612/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=612&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2011/11/05/it-private-jokes-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>

		<media:content url="http://i4mk.files.wordpress.com/2011/11/rip-steve-jobs.jpg" medium="image">
			<media:title type="html">RIP Steve Jobs</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP CLI example</title>
		<link>http://i4mk.wordpress.com/2011/10/29/php-cli-example/</link>
		<comments>http://i4mk.wordpress.com/2011/10/29/php-cli-example/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 12:57:26 +0000</pubDate>
		<dc:creator>mrkarvalhovsky</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[php cli]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://i4mk.wordpress.com/?p=595</guid>
		<description><![CDATA[PHP CLI is a short for PHP Command Line Interface and is intended for anybody who wants to write PHP Scripts, from the command line, that don&#8217;t require a web server, such as Apache. PHP CLI example: #!/usr/bin/php &#60;&#60;?php echo "\nNumber of Arguments: " . $_SERVER["argc"]."\n\n"; #Getting arguments from the command line echo "Getting Arguments [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=595&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>PHP <strong>CLI</strong> is a short for <strong>PHP Command Line Interface</strong> and is intended for anybody who wants to write PHP Scripts, from the command line, that don&#8217;t require a web server, such as Apache.</p>
<ul>
<li><strong>PHP CLI example</strong>:</li>
</ul>
<pre>#!/usr/bin/php
&lt;&lt;?php
echo "\nNumber of Arguments: " . $_SERVER["argc"]."\n\n";

<strong>#Getting arguments from the command line</strong>
echo "Getting Arguments (the 1st argument is the script itself):
1st arg: " . $_SERVER["argv"][0].
"\n2nd Arg: " . $_SERVER["argv"][1];

<strong>#Reading arguments from the command line</strong>
echo "\n\nReading from the standard input:";
echo "What's your name?\n";
$name = fread(STDIN, 50); # read up to 50 characters or a newline
echo "Hello " . $name ."\n";

#Simple countdown to execute something
echo "Countdown (10..1):\n";
	for($i=10; $i&gt;0; $i--)
	{
		echo $i . "\n";
		sleep(1);
	}
	echo "BUM!!!\n\n";
?&gt;</pre>
<ul>
<li><strong>Output:</strong></li>
</ul>
<p><a href="http://i4mk.files.wordpress.com/2011/10/php_cli_app.png"><img class="aligncenter size-full wp-image-596" title="php_CLI_app" src="http://i4mk.files.wordpress.com/2011/10/php_cli_app.png?w=510" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/i4mk.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/i4mk.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/i4mk.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/i4mk.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/i4mk.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/i4mk.wordpress.com/595/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/i4mk.wordpress.com/595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/i4mk.wordpress.com/595/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=i4mk.wordpress.com&amp;blog=10592199&amp;post=595&amp;subd=i4mk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://i4mk.wordpress.com/2011/10/29/php-cli-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59d746552416ad073066848ad92a9f11?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mrkarvalhovsky</media:title>
		</media:content>

		<media:content url="http://i4mk.files.wordpress.com/2011/10/php_cli_app.png" medium="image">
			<media:title type="html">php_CLI_app</media:title>
		</media:content>
	</item>
	</channel>
</rss>
