<?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>Myblog&#039;s Blog</title>
	<atom:link href="http://naveenbos.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://naveenbos.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 25 Oct 2011 08:00:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='naveenbos.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Myblog&#039;s Blog</title>
		<link>http://naveenbos.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://naveenbos.wordpress.com/osd.xml" title="Myblog&#039;s Blog" />
	<atom:link rel='hub' href='http://naveenbos.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Checkbox selection with php and html and a report generation with mysql</title>
		<link>http://naveenbos.wordpress.com/2011/10/25/checkbox-selection-with-php-and-html-and-a-report-generation-with-mysql/</link>
		<comments>http://naveenbos.wordpress.com/2011/10/25/checkbox-selection-with-php-and-html-and-a-report-generation-with-mysql/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 07:55:21 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/?p=29</guid>
		<description><![CDATA[&#60;div id=&#8221;divtoprint&#8221;&#62; &#60;form action=&#8221;Checkbox.php&#8221; method=&#8221;GET&#8221;&#62; &#60;table  style=&#8221;table-layout: fixed;margin-left: 2em;margin-right: 2em;&#8221;&#62;&#60;tr&#62;&#60;th&#62;SELECT&#60;/th&#62;&#60;th&#62;NAME&#60;/th&#62;&#60;th&#62;ADDRESS&#60;/th&#62;&#60;th&#62;EMAIL&#60;/th&#62;&#60;th&#62;TELEPHONE&#60;/th&#62;&#60;th&#62;PROBLEM&#60;/th&#62;&#60;th&#62;REPLY&#60;/th&#62;&#60;th&#62;TYPE&#60;/th&#62;&#60;th&#62;OTHER&#60;/th&#62;&#60;/tr&#62; &#60;?php include (&#8220;database.php&#8221;); $qry = &#8220;Select * from query where $option like &#8216;%$content%&#8217; and date_problem between &#8216;$from&#8217; and &#8216;$to&#8217; &#8220;; $result=mysql_query($qry); while ($row =mysql_fetch_array($result)) { $id=$row['id']; //echo $id; ?&#62; &#60;tr&#62;&#60;?echo &#8220;&#60;td&#62;&#60;input type=\&#8221;checkbox\&#8221; name=\&#8221;checkbox[]\&#8221; id=\&#8221;checkbox[]\&#8221;  value=\&#8221;".$row['id'].&#8221;\&#8221; /&#62;&#60;/td&#62;&#8221;;?&#62; &#60;td&#62;&#60;? echo $row['name'];?&#62;&#60;/td&#62; &#60;td&#62;&#60;? echo $row['address'];?&#62;&#60;/td&#62; &#60;td&#62;&#60;? echo $row['email'];?&#62;&#60;/td&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=29&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&lt;div id=&#8221;divtoprint&#8221;&gt;<br />
&lt;form action=&#8221;Checkbox.php&#8221; method=&#8221;GET&#8221;&gt;<br />
&lt;table  style=&#8221;table-layout: fixed;margin-left: 2em;margin-right: 2em;&#8221;&gt;&lt;tr&gt;&lt;th&gt;SELECT&lt;/th&gt;&lt;th&gt;NAME&lt;/th&gt;&lt;th&gt;ADDRESS&lt;/th&gt;&lt;th&gt;EMAIL&lt;/th&gt;&lt;th&gt;TELEPHONE&lt;/th&gt;&lt;th&gt;PROBLEM&lt;/th&gt;&lt;th&gt;REPLY&lt;/th&gt;&lt;th&gt;TYPE&lt;/th&gt;&lt;th&gt;OTHER&lt;/th&gt;&lt;/tr&gt;</p>
<p>&lt;?php</p>
<p>include (&#8220;database.php&#8221;);</p>
<p>$qry = &#8220;Select * from query where $option like &#8216;%$content%&#8217; and date_problem between &#8216;$from&#8217; and &#8216;$to&#8217; &#8220;;<br />
$result=mysql_query($qry);</p>
<p>while ($row =mysql_fetch_array($result))<br />
{<br />
$id=$row['id'];<br />
//echo $id;<br />
?&gt;</p>
<p>&lt;tr&gt;&lt;?echo &#8220;&lt;td&gt;&lt;input type=\&#8221;checkbox\&#8221; name=\&#8221;checkbox[]\&#8221; id=\&#8221;checkbox[]\&#8221;  value=\&#8221;".$row['id'].&#8221;\&#8221; /&gt;&lt;/td&gt;&#8221;;?&gt;<br />
&lt;td&gt;&lt;? echo $row['name'];?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;? echo $row['address'];?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;? echo $row['email'];?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;? echo $row['telephone'];?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;? echo $row['problem'];?&gt;&lt;/td&gt;<br />
&lt;td style=&#8221;overflow:hidden;&#8221;&gt;&lt;? echo $row['reply_query'];?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;? echo $row['type'];?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;? echo $row['other'];?&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;?php<br />
}</p>
<p>?&gt;<br />
in checkbox.php</p>
<p>&lt;?php</p>
<p>require(&#8216;mysql_report.php&#8217;);</p>
<p>$checkbox = $_GET['checkbox'];<br />
$connection = mysql_connect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;asdfgh&#8221;);<br />
mysql_select_db(&#8220;Tree_help&#8221;);<br />
//echo &#8220;there&#8221;;<br />
$sql=&#8221;SELECT name,address,email,problem,type,other,reply_query FROM query where&#8221;;<br />
//echo &#8220;here&#8221;;<br />
//echo var_dump($checkbox);</p>
<p>$i = 1;<br />
foreach ($checkbox as $value)<br />
{<br />
if($i&lt;count($checkbox))<br />
{<br />
$sql=$sql.&#8221; id = \&#8221;".$value.&#8221;\&#8221; OR&#8221;;<br />
$i++;<br />
}<br />
else<br />
{<br />
$sql=$sql.&#8221; id = \&#8221;".$value.&#8221;\&#8221;";<br />
}<br />
//echo $value;<br />
//echo $sql;<br />
//$result = mysql_query($sql);<br />
//echo $sql;<br />
//while ($row = mysql_fetch_array($result))<br />
//{<br />
//echo $row['name'].&#8221;&lt;br&gt;&#8221;;<br />
//}</p>
<p>// close the connection<br />
//}<br />
//mysql_close($connection);</p>
<p>}<br />
//echo $sql;</p>
<p>$pdf = new PDF(&#8216;L&#8217;,'pt&#8217;,'A4&#8242;);<br />
$pdf-&gt;SetFont(&#8216;Arial&#8217;,&#8221;,12);<br />
$pdf-&gt;connect(&#8216;localhost&#8217;,'root&#8217;,'asdfgh&#8217;,'Tree_help&#8217;);<br />
$attr = array(&#8216;titleFontSize&#8217;=&gt;18, &#8216;titleText&#8217;=&gt;&#8217;Treehealth Report&#8217;);</p>
<p>$qry=$pdf-&gt;mysql_report($sql,$dump=false,$attr=array());</p>
<p>$pdf-&gt;Output();<br />
//$countCheck = count($_POST['checkbox']);</p>
<p>?&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=29&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2011/10/25/checkbox-selection-with-php-and-html-and-a-report-generation-with-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
		<item>
		<title>Previous search in php using sessions</title>
		<link>http://naveenbos.wordpress.com/2011/07/08/previous-search-in-php-using-sessions/</link>
		<comments>http://naveenbos.wordpress.com/2011/07/08/previous-search-in-php-using-sessions/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 06:44:57 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/?p=23</guid>
		<description><![CDATA[we got the previous searched items from a text area http://stackoverflow.com/questions/5754957/how-to-add-visited-pages-urls-into-a-session-array<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=23&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>we got the previous searched items from a text area</p>
<p>http://stackoverflow.com/questions/5754957/how-to-add-visited-pages-urls-into-a-session-array</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=23&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2011/07/08/previous-search-in-php-using-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
		<item>
		<title>Toggle div using CSS and Jquery</title>
		<link>http://naveenbos.wordpress.com/2011/05/27/toggle-div-using-css-and-jquery-2/</link>
		<comments>http://naveenbos.wordpress.com/2011/05/27/toggle-div-using-css-and-jquery-2/#comments</comments>
		<pubDate>Fri, 27 May 2011 08:40:22 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/?p=24</guid>
		<description><![CDATA[http://www.sohtanaka.com/web-design/easy-toggle-jquery-tutorial/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=24&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>http://www.sohtanaka.com/web-design/easy-toggle-jquery-tutorial/</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=24&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2011/05/27/toggle-div-using-css-and-jquery-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
		<item>
		<title>Toggle div using CSS and Jquery</title>
		<link>http://naveenbos.wordpress.com/2011/05/27/toggle-div-using-css-and-jquery/</link>
		<comments>http://naveenbos.wordpress.com/2011/05/27/toggle-div-using-css-and-jquery/#comments</comments>
		<pubDate>Fri, 27 May 2011 08:37:26 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/?p=21</guid>
		<description><![CDATA[http://www.sohtanaka.com/web-design/easy-toggle-jquery-tutorial/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=21&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://www.sohtanaka.com/web-design/easy-toggle-jquery-tutorial/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=21&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2011/05/27/toggle-div-using-css-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
		<item>
		<title>shell</title>
		<link>http://naveenbos.wordpress.com/2010/04/30/shell/</link>
		<comments>http://naveenbos.wordpress.com/2010/04/30/shell/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 06:29:15 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/2010/04/30/shell/</guid>
		<description><![CDATA[http://zetcode.com/tutorials/pyqt4/ http://www.cahilig.net/2008/07/04/how-setup-lan-dns-server-using-bind9-under-debian-and-ubuntu-linux (for dns server setting) http://docs.python.org/distutils/setupscript.html https://wiki.ubuntu.com/PackagingGuide/Python http://linuxgazette.net/133/cherian.html http://twistedmatrix.com/documents/current/core/howto/servers.html http://en.wikibooks.org/wiki/Bourne_Shell_Scripting/Redirection Using the GNU Compiler Collection (GCC) Gnu Make Example for downloading and making software (qc-usb) Shell Scripting Byte of Python python-twisted tutorial subversion Book debian packaging using distutils debian packaging guide (for python) Linux From Scratch Book Wget List for LFS6.5 how to setup [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=16&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="post-body entry-content"><a class="external free" title="http://zetcode.com/tutorials/pyqt4/" rel="nofollow" href="http://zetcode.com/tutorials/pyqt4/">http://zetcode.com/tutorials/pyqt4/</a></p>
</div>
<div class="post-footer">
<div class="post-footer-line post-footer-line-1"><span class="post-author vcard"><br />
</span><span class="post-icons"><span class="item-control blog-admin pid-1261034499"><a title="Edit Post" href="http://www.blogger.com/post-edit.g?blogID=7366258948420632812&amp;postID=8017455420274535522"><br />
</a><br />
</span><br />
</span></div>
<div class="post-footer-line post-footer-line-2"><span class="post-labels"><br />
</span></div>
<div class="post-footer-line post-footer-line-3"><span class="post-location"><br />
</span></div>
</div>
<div class="post-outer">
<div class="post hentry uncustomized-post-template"><a name="1945889524468821174"></a></p>
<div class="post-body entry-content">
<p><a class="external free" title="http://www.cahilig.net/2008/07/04/how-setup-lan-dns-server-using-bind9-under-debian-and-ubuntu-linux" rel="nofollow" href="http://www.cahilig.net/2008/07/04/how-setup-lan-dns-server-using-bind9-under-debian-and-ubuntu-linux">http://www.cahilig.net/2008/07/04/how-setup-lan-dns-server-using-bind9-under-debian-and-ubuntu-linux</a> (for dns server setting)</p>
<p><a class="external free" title="http://docs.python.org/distutils/setupscript.html" rel="nofollow" href="http://docs.python.org/distutils/setupscript.html">http://docs.python.org/distutils/setupscript.html</a></p>
<p><a class="external free" title="https://wiki.ubuntu.com/PackagingGuide/Python" rel="nofollow" href="https://wiki.ubuntu.com/PackagingGuide/Python">https://wiki.ubuntu.com/PackagingGuide/Python</a></p>
<p><a class="external free" title="http://linuxgazette.net/133/cherian.html" rel="nofollow" href="http://linuxgazette.net/133/cherian.html">http://linuxgazette.net/133/cherian.html</a></p>
<p><a class="external free" title="http://twistedmatrix.com/documents/current/core/howto/servers.html" rel="nofollow" href="http://twistedmatrix.com/documents/current/core/howto/servers.html">http://twistedmatrix.com/documents/current/core/howto/servers.html</a></p>
<p><a class="external free" title="http://en.wikibooks.org/wiki/Bourne_Shell_Scripting/Redirection" rel="nofollow" href="http://en.wikibooks.org/wiki/Bourne_Shell_Scripting/Redirection">http://en.wikibooks.org/wiki/Bourne_Shell_Scripting/Redirection</a></p>
</div>
<div class="post-footer">
<div class="post-footer-line post-footer-line-3"><span class="post-location"><br />
</span></div>
</div>
</div>
</div>
<div class="post-outer">
<div class="post hentry uncustomized-post-template"><a name="7096799130731328235"></a></p>
<div class="post-body entry-content">
<ul>
<li> <a class="external text" title="http://gcc.gnu.org/onlinedocs/gcc-3.4.5/gcc.pdf" rel="nofollow" href="http://gcc.gnu.org/onlinedocs/gcc-3.4.5/gcc.pdf">Using the GNU Compiler Collection (GCC)</a></li>
<li> <a class="external text" title="http://www.gnu.org/software/make/manual/make.pdf" rel="nofollow" href="http://www.gnu.org/software/make/manual/make.pdf">Gnu Make</a></li>
<li><a class="external text" title="http://sourceforge.net/projects/qce-ga/files/qc-usb/0.6.6/qc-usb-0.6.6.tar.gz/download" rel="nofollow" href="http://sourceforge.net/projects/qce-ga/files/qc-usb/0.6.6/qc-usb-0.6.6.tar.gz/download">Example for downloading and making software (qc-usb)</a></li>
<li><a class="external text" title="http://www.esearchbook.com/files/30/eSearchBook.1192110892.Beginning%20Shell%20Scripting.pdf" rel="nofollow" href="http://www.esearchbook.com/files/30/eSearchBook.1192110892.Beginning%20Shell%20Scripting.pdf">Shell Scripting</a></li>
<li><a class="external text" title="http://www.ibiblio.org/g2swap/byteofpython/files/120/byteofpython_120.pdf" rel="nofollow" href="http://www.ibiblio.org/g2swap/byteofpython/files/120/byteofpython_120.pdf">Byte of Python</a></li>
<li><a class="external text" title="http://www.zoteca.com/information/wp/twistedusenix.pdf" rel="nofollow" href="http://www.zoteca.com/information/wp/twistedusenix.pdf">python-twisted tutorial</a></li>
<li><a class="external text" title="http://svnbook.red-bean.com/en/1.5/svn-book.pdf" rel="nofollow" href="http://svnbook.red-bean.com/en/1.5/svn-book.pdf">subversion Book</a></li>
<li> <a class="external text" title="http://docs.python.org/distutils/index.html" rel="nofollow" href="http://docs.python.org/distutils/index.html">debian packaging using distutils</a></li>
<li> <a class="external text" title="https://wiki.ubuntu.com/PackagingGuide/Python" rel="nofollow" href="https://wiki.ubuntu.com/PackagingGuide/Python">debian packaging guide (for python)</a></li>
<li> <a class="external text" title="http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-6.5.pdf" rel="nofollow" href="http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-6.5.pdf">Linux From Scratch Book</a></li>
<li> <a class="external text" title="http://www.linuxfromscratch.org/lfs/downloads/6.5/LFS-BOOK-6.5-wget-list" rel="nofollow" href="http://www.linuxfromscratch.org/lfs/downloads/6.5/LFS-BOOK-6.5-wget-list">Wget List for LFS6.5</a></li>
<li><a class="external text" title="http://www.cahilig.net/2008/07/04/how-setup-lan-dns-server-using-bind9-under-debian-and-ubuntu-linux" rel="nofollow" href="http://www.cahilig.net/2008/07/04/how-setup-lan-dns-server-using-bind9-under-debian-and-ubuntu-linux">how to setup DNS LAN</a></li>
</ul>
</div>
<div class="post-footer">
<div class="post-footer-line post-footer-line-1"><span class="post-author vcard"><br />
</span><span class="post-icons"><span class="item-control blog-admin pid-1261034499"><a title="Edit Post" href="http://www.blogger.com/post-edit.g?blogID=7366258948420632812&amp;postID=7096799130731328235"><br />
</a><br />
</span><br />
</span></div>
<div class="post-footer-line post-footer-line-2"><span class="post-labels"><br />
</span></div>
<div class="post-footer-line post-footer-line-3"><span class="post-location"><br />
</span></div>
</div>
</div>
</div>
<div class="post-outer">
<div class="post hentry uncustomized-post-template"><a name="1023561605354245802"></a></p>
<div class="post-body entry-content"><a class="external text" title="http://www.oucs.ox.ac.uk/documentation/userguides/c/l922.pdf" rel="nofollow" href="http://www.oucs.ox.ac.uk/documentation/userguides/c/l922.pdf">Programing in C (K&amp;R)</a></p>
</div>
<div class="post-footer">
<div class="post-footer-line post-footer-line-1"><span class="post-author vcard"><br />
</span><span class="post-icons"><span class="item-control blog-admin pid-1261034499"><a title="Edit Post" href="http://www.blogger.com/post-edit.g?blogID=7366258948420632812&amp;postID=1023561605354245802"><br />
</a><br />
</span><br />
</span></div>
<div class="post-footer-line post-footer-line-2"><span class="post-labels"><br />
</span></div>
<div class="post-footer-line post-footer-line-3"><span class="post-location"><br />
</span></div>
</div>
</div>
</div>
<div class="post-outer">
<div class="post hentry uncustomized-post-template"><a name="4517871229066493165"></a></p>
<h3 class="post-title entry-title"><a href="http://naveenboss.blogspot.com/">shell terminal</a></h3>
<div class="post-body entry-content"><!-- 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	--></p>
<p style="margin-bottom:0;"><span style="font-size:large;"><strong>Shell in my terminal</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo &#8220;$LINES&#8221;</p>
<p style="margin-bottom:0;">24</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo &#8220;$COLUMNS&#8221;</p>
<p style="margin-bottom:0;">80</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $PS1</p>
<p style="margin-bottom:0;">\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>FOR getting ENVIRONMENTAL VARIABLES</strong></span></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ env</p>
<p style="margin-bottom:0;">GPG_AGENT_INFO=/tmp/seahorse-auOGIL/S.gpg-agent:2903:1</p>
<p style="margin-bottom:0;">SHELL=/bin/bash</p>
<p style="margin-bottom:0;">DESKTOP_STARTUP_ID=</p>
<p style="margin-bottom:0;">TERM=xterm</p>
<p style="margin-bottom:0;">GTK_RC_FILES=/etc/gtk/gtkrc:/home/catfoss/.gtkrc-1.2-gnome2</p>
<p style="margin-bottom:0;">WINDOWID=54549658</p>
<p style="margin-bottom:0;">USER=catfoss</p>
<p style="margin-bottom:0;">LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:</p>
<p style="margin-bottom:0;">SSH_AUTH_SOCK=/tmp/keyring-qzx8xA/ssh</p>
<p style="margin-bottom:0;">GNOME_KEYRING_SOCKET=/tmp/keyring-qzx8xA/socket</p>
<p style="margin-bottom:0;">SESSION_MANAGER=local/catfoss4:/tmp/.ICE-unix/2848</p>
<p style="margin-bottom:0;">USERNAME=catfoss</p>
<p style="margin-bottom:0;">DESKTOP_SESSION=default</p>
<p style="margin-bottom:0;">PATH=/usr/local/bin:/usr/bin:/bin:/usr/games</p>
<p style="margin-bottom:0;">GDM_XSERVER_LOCATION=local</p>
<p style="margin-bottom:0;">PWD=/home/catfoss</p>
<p style="margin-bottom:0;">LANG=en_US.UTF-8</p>
<p style="margin-bottom:0;">GNOME_KEYRING_PID=2847</p>
<p style="margin-bottom:0;">GDM_LANG=en_US.UTF-8</p>
<p style="margin-bottom:0;">GDMSESSION=default</p>
<p style="margin-bottom:0;">HISTCONTROL=ignoreboth</p>
<p style="margin-bottom:0;">HOME=/home/catfoss</p>
<p style="margin-bottom:0;">SHLVL=1</p>
<p style="margin-bottom:0;">GNOME_DESKTOP_SESSION_ID=Default</p>
<p style="margin-bottom:0;">LOGNAME=catfoss</p>
<p style="margin-bottom:0;">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</p>
<p style="margin-bottom:0;">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-pd9mFs3Wzv,guid=b3581362d8a77a956e3b74a74b2854d2</p>
<p style="margin-bottom:0;">WINDOWPATH=7</p>
<p style="margin-bottom:0;">DISPLAY=:0.0</p>
<p style="margin-bottom:0;">COLORTERM=gnome-terminal</p>
<p style="margin-bottom:0;">XAUTHORITY=/home/catfoss/.Xauthority</p>
<p style="margin-bottom:0;">_=/usr/bin/env</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>SHELLsh-3.2$ exit CHANGING</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ sh</p>
<p style="margin-bottom:0;">sh-3.2$</p>
<p style="margin-bottom:0;">sh-3.2$ exit</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ naveen=&#8221;hai&#8221;</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $naveen</p>
<p style="margin-bottom:0;">hai</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">space is used in the shell   for command</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ x=10</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $x</p>
<p style="margin-bottom:0;">10</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ xn=Rani</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $xn</p>
<p style="margin-bottom:0;">Rani</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ a=5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ b=6</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $(($a+$b))</p>
<p style="margin-bottom:0;">11</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ x=20</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ y=5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $(($x/$y))</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ x=20</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ y=5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ z=$x/$y</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $((z))</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">echo `expr  $x  + $y`</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">IF ANY OPERATION IS FAILED WE CAN USE THIS</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls</p>
<p style="margin-bottom:0;">a              ch                                    mithun.jpg</p>
<p style="margin-bottom:0;">aaa.py         circle.c                              naveen.py</p>
<p style="margin-bottom:0;">aa.py          circular1.c                           naveenpython.odt</p>
<p style="margin-bottom:0;">a.c            circular.c                            naveen.ui</p>
<p style="margin-bottom:0;">a.out          client                                pointer.c</p>
<p style="margin-bottom:0;">a.py           client.txt                            QueueinC Files</p>
<p style="margin-bottom:0;">arraystruct.c  client.txt~                           QueueinC.htm</p>
<p style="margin-bottom:0;">athulya.odt    c.py                                  Ramsanwishescopy.jpg</p>
<p style="margin-bottom:0;">athu.py        ctutor-1.pdf                          r.c</p>
<p style="margin-bottom:0;">attr.html      Desktop                               rocks.gif</p>
<p style="margin-bottom:0;">a.txt          d.py                                  shell termin.odt</p>
<p style="margin-bottom:0;">bbb.py         EID12copy.jpg                         sort1.c</p>
<p style="margin-bottom:0;">b.py           EID23copy.jpg                         stack2</p>
<p style="margin-bottom:0;">b.pyc          EIDMailanchi.jpg                      struct.c</p>
<p style="margin-bottom:0;">b.txt          EidMubarak890.jpg                     structu.c</p>
<p style="margin-bottom:0;">c              EssentialC-1.pdf                      summary Files</p>
<p style="margin-bottom:0;">cal1.py        file:                                 summary.html</p>
<p style="margin-bottom:0;">cal1.py~       g                                     test1.py</p>
<p style="margin-bottom:0;">cal1.ui        getattr Files                         test.py</p>
<p style="margin-bottom:0;">cal3.py        getattr.html                          test.py~</p>
<p style="margin-bottom:0;">cal3.py~       kernal.odt                            test.ui</p>
<p style="margin-bottom:0;">cal3.ui        list1.c                               untitled.ui</p>
<p style="margin-bottom:0;">cal.py         list.c                                vi.txt</p>
<p style="margin-bottom:0;">cal.py~        Menus and Toolbars in wxPython        z</p>
<p style="margin-bottom:0;">cal.ui         Menus and Toolbars in wxPython Files  z.txt</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ rm b.c</p>
<p style="margin-bottom:0;">rm: cannot remove `b.c&#8217;: No such file or directory</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $?</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ lss</p>
<p style="margin-bottom:0;">bash: lss: command not found</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $?</p>
<p style="margin-bottom:0;">127</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cp r.c /</p>
<p style="margin-bottom:0;">cp: cannot create regular file `/r.c&#8217;: Permission denied</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $?</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>EXAMPLE</strong></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ vim a.sh</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">echo &#8220;your first name please:&#8221;</p>
<p style="margin-bottom:0;">read fname</p>
<p style="margin-bottom:0;">echo &#8220;hello $fname,Lets be a frnd!&#8221;</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash a.sh</p>
<p style="margin-bottom:0;">your first name please:</p>
<p style="margin-bottom:0;">sah</p>
<p style="margin-bottom:0;">hello sah,Lets be a frnd!</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo `expr 2 + 3`</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo $(expr 2 + 3)</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls *.c</p>
<p style="margin-bottom:0;">a.c            circle.c     circular.c  list.c     r.c      struct.c</p>
<p style="margin-bottom:0;">arraystruct.c  circular1.c  list1.c     pointer.c  sort1.c  structu.c</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls c.*</p>
<p style="margin-bottom:0;">c.py</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls a*.*</p>
<p style="margin-bottom:0;">aaa.py  a.c    a.py           a.sh         athu.py    a.txt</p>
<p style="margin-bottom:0;">aa.py   a.out  arraystruct.c  athulya.odt  attr.html</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls a*.c</p>
<p style="margin-bottom:0;">a.c  arraystruct.c</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls ?.*</p>
<p style="margin-bottom:0;">a.c  a.out  a.py  a.sh  a.txt  b.py  b.pyc  b.txt  c.py  d.py  r.c  z.txt</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls a*.c</p>
<p style="margin-bottom:0;">a.c  arraystruct.c</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls ?.c</p>
<p style="margin-bottom:0;">a.c  r.c</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">deterministic finite automata</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ ls [a,b]*</p>
<p style="margin-bottom:0;">a       aa.py  a.out  arraystruct.c  athulya.odt  attr.html  bbb.py  b.pyc</p>
<p style="margin-bottom:0;">aaa.py  a.c    a.py   a.sh           athu.py      a.txt      b.py    b.txt</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat &gt;test1</p>
<p style="margin-bottom:0;">/home(then press ctrl+d)catfoss@catfoss4:~$ cat test1</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ sort</p>
<p style="margin-bottom:0;">bos</p>
<p style="margin-bottom:0;">navee</p>
<p style="margin-bottom:0;">bos</p>
<p style="margin-bottom:0;">navee</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat &gt;te</p>
<p style="margin-bottom:0;">naveen</p>
<p style="margin-bottom:0;">unnicatfoss@catfoss4:~$ sort</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ sort</p>
<p style="margin-bottom:0;">naveen</p>
<p style="margin-bottom:0;">unni</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">dmesg:for system usage information</p>
<p style="margin-bottom:0;">tail -n (no.)</p>
<p style="margin-bottom:0;">or</p>
<p style="margin-bottom:0;">tail -n</p>
<p style="margin-bottom:0;">head -n</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>SORTING</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">ps -e | head -16 | tail -15 | sort -k 4 &gt; list</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>BC arbitrary precision calculator language</strong></span></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bc</p>
<p style="margin-bottom:0;">bc 1.06.94</p>
<p style="margin-bottom:0;">Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.</p>
<p style="margin-bottom:0;">This is free software with ABSOLUTELY NO WARRANTY.</p>
<p style="margin-bottom:0;">For details type `warranty&#8217;.</p>
<p style="margin-bottom:0;">3+5</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">4+2</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">4==4</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">4&lt;2&gt;</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">4!=3</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Bitwise and &amp;&amp; if two bit are one answer is one</p>
<p style="margin-bottom:0;"><strong>PGM IN SHELL(USING IF ..ELSE)</strong></p>
<p style="margin-bottom:0;">if [ $1 -eq $2 ]</p>
<p style="margin-bottom:0;">then</p>
<p style="margin-bottom:0;">echo &#8220;same&#8221;</p>
<p style="margin-bottom:0;">else</p>
<p style="margin-bottom:0;">if [ $1 -gt $2 ]</p>
<p style="margin-bottom:0;">then</p>
<p style="margin-bottom:0;">echo &#8220;greater&#8221;</p>
<p style="margin-bottom:0;">else</p>
<p style="margin-bottom:0;">echo &#8220;less&#8221;</p>
<p style="margin-bottom:0;">fi</p>
<p style="margin-bottom:0;">fi</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ vim fil</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash fil</p>
<p style="margin-bottom:0;">same</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash fil 3 4</p>
<p style="margin-bottom:0;">less</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash fil 4 3</p>
<p style="margin-bottom:0;">greater</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash fil 4 4</p>
<p style="margin-bottom:0;">same</p>
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>FOR LOOP</strong></span></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ for i in 1 2 3 4 5</p>
<p style="margin-bottom:0;">&gt; do</p>
<p style="margin-bottom:0;">&gt; echo $i</p>
<p style="margin-bottom:0;">&gt; done</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>EX:</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ for (( i=0; i&lt;=5; i++ ))</p>
<p style="margin-bottom:0;">&gt; do</p>
<p style="margin-bottom:0;">&gt; echo $i</p>
<p style="margin-bottom:0;">&gt; done</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>PGM</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">for (( i=1; i&lt;=4; i++ ))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">for (( j=1; j&lt;=4; j++ ))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">echo -n $i</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">echo &#8220;&#8221;</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ vim bn.sh</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash bn.sh</p>
<p style="margin-bottom:0;">1111</p>
<p style="margin-bottom:0;">2222</p>
<p style="margin-bottom:0;">3333</p>
<p style="margin-bottom:0;">4444</p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>for colour change</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">atfoss@catfoss4:~$ echo -e &#8220;33[43m"</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo -e "33[49m"</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>WHILE LOOP</strong></p>
<p style="margin-bottom:0;"><strong>catfoss@catfoss4:~$ bos=1 </strong></p>
<p style="margin-bottom:0;"><strong>catfoss@catfoss4:~$ while [ $bos -lt 10 ] </strong></p>
<p style="margin-bottom:0;"><strong>&gt; do </strong></p>
<p style="margin-bottom:0;"><strong>&gt; echo $bos </strong></p>
<p style="margin-bottom:0;"><strong>&gt; bos=`expr $bos + 1` </strong></p>
<p style="margin-bottom:0;"><strong>&gt; done </strong></p>
<p style="margin-bottom:0;"><strong>1 </strong></p>
<p style="margin-bottom:0;"><strong>2 </strong></p>
<p style="margin-bottom:0;"><strong>3 </strong></p>
<p style="margin-bottom:0;"><strong>4 </strong></p>
<p style="margin-bottom:0;"><strong>5 </strong></p>
<p style="margin-bottom:0;"><strong>6 </strong></p>
<p style="margin-bottom:0;"><strong>7 </strong></p>
<p style="margin-bottom:0;"><strong>8 </strong></p>
<p style="margin-bottom:0;"><strong>9 </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>STEP WAVE FORM</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">for (( i = 0; i &lt;= 9; i++ ))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">for (( j = 1 ; j &lt;= i; j++ ))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">echo -e -n &#8220;33[46m     "</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">echo -e -n "33[49m"</p>
<p style="margin-bottom:0;">echo</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>CHESSBOARD </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">for (( i=1; i&lt;=9; i++ ))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">for (( j=1; j&lt;=9; j++ ))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">a=`expr $i + $j`</p>
<p style="margin-bottom:0;">b=`expr $a % 2`</p>
<p style="margin-bottom:0;">if [ $b  -eq 0 ];</p>
<p style="margin-bottom:0;">then</p>
<p style="margin-bottom:0;">echo -e -n &#8220;33[43m  "</p>
<p style="margin-bottom:0;">else</p>
<p style="margin-bottom:0;">echo -e -n "33[46m  "</p>
<p style="margin-bottom:0;">fi</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">echo -e -n "33[49m"</p>
<p style="margin-bottom:0;">echo</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat &gt; tr</p>
<p style="margin-bottom:0;">echo $#</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr 1 2 3 4  5</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr 1 2 3 4  5 6</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr 1</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr 1 1 1 1 1 1 1 1</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ if [ -z $linda ]</p>
<p style="margin-bottom:0;">&gt; then</p>
<p style="margin-bottom:0;">&gt; echo &#8220;null&#8221;</p>
<p style="margin-bottom:0;">&gt; fi</p>
<p style="margin-bottom:0;">null</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">high level</p>
<p style="margin-bottom:0;">low level</p>
<p style="margin-bottom:0;">machine code</p>
<p style="margin-bottom:0;">microcode</p>
<p style="margin-bottom:0;">assembly language</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>c is a middle level language,it can operate both high level and low level languages</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>CASE CONDITION</strong></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ re=&#8221;hello&#8221;</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ case $re in</p>
<p style="margin-bottom:0;">&gt; &#8220;world&#8221;)echo &#8220;1&#8243;;;</p>
<p style="margin-bottom:0;">&gt; &#8220;hello&#8221;)echo &#8220;2&#8243;;;</p>
<p style="margin-bottom:0;">&gt; esac</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>FUN</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ fun()</p>
<p style="margin-bottom:0;">&gt; {</p>
<p style="margin-bottom:0;">&gt; echo &#8220;hello&#8221;</p>
<p style="margin-bottom:0;">&gt; cal</p>
<p style="margin-bottom:0;">&gt; date</p>
<p style="margin-bottom:0;">&gt; }</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ fun</p>
<p style="margin-bottom:0;">hello</p>
<p style="margin-bottom:0;">December 2009</p>
<p style="margin-bottom:0;">Su Mo Tu We Th Fr Sa</p>
<p style="margin-bottom:0;">1  2  3  4  5</p>
<p style="margin-bottom:0;">6  7  8  9 10 11 12</p>
<p style="margin-bottom:0;">13 14 15 16 17 18 19</p>
<p style="margin-bottom:0;">20 21 22 23 24 25 26</p>
<p style="margin-bottom:0;">27 28 29 30 31</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Fri Dec 18 12:14:26 IST 2009</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>RECURSION</strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ fun()</p>
<p style="margin-bottom:0;">&gt; {</p>
<p style="margin-bottom:0;">&gt; if [ $var -eq 0 ]</p>
<p style="margin-bottom:0;">&gt; then</p>
<p style="margin-bottom:0;">&gt; echo &#8220;ok&#8221;</p>
<p style="margin-bottom:0;">&gt; else var=`expr $var &#8211; 1`</p>
<p style="margin-bottom:0;">&gt; echo $var</p>
<p style="margin-bottom:0;">&gt; fun</p>
<p style="margin-bottom:0;">&gt; fi</p>
<p style="margin-bottom:0;">&gt; }</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ var=5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ fun</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">ok</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>FOR DEBUGED OUT PUT</strong></p>
<p style="margin-bottom:0;">bash -x tr</p>
<p style="margin-bottom:0;"><strong>EX:</strong>catfoss@catfoss4:~$ vim tr</p>
<p style="margin-bottom:0;">var=5</p>
<p style="margin-bottom:0;">echo $var</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr</p>
<p style="margin-bottom:0;">tr: line 1: var: command not found</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash -x tr</p>
<p style="margin-bottom:0;">+ var =5</p>
<p style="margin-bottom:0;">tr: line 1: var: command not found</p>
<p style="margin-bottom:0;">+ echo</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ vim tr</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash tr</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ bash -x tr</p>
<p style="margin-bottom:0;">+ var=5</p>
<p style="margin-bottom:0;">+ echo 5</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ zenity &#8211;info &#8211;text=&#8221;hello world&#8221;</p>
<p style="margin-bottom:0;">zenity is used for user interfaces</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>ZENITY(1)                                                            ZENITY(1) </strong></span></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">NAME</p>
<p style="margin-bottom:0;">zenity &#8211; display GTK+ dialogs</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">SYNOPSIS</p>
<p style="margin-bottom:0;">zenity [options]</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">DESCRIPTION</p>
<p style="margin-bottom:0;">zenity  is a program that will display GTK+ dialogs, and return (either</p>
<p style="margin-bottom:0;">in the return code, or on standard output) the users input. This allows</p>
<p style="margin-bottom:0;">you to present information, and ask for information from the user, from</p>
<p style="margin-bottom:0;">all manner of shell scripts.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">For example, zenity &#8211;question will return either 0 or 1, depending  on</p>
<p style="margin-bottom:0;">whether  the  user  pressed OK or Cancel. zenity &#8211;entry will output on</p>
<p style="margin-bottom:0;">standard output what the user typed into the text entry field.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Comprehensive documentation is available in  the  GNOME  Help  Browser,</p>
<p style="margin-bottom:0;">under GNOME/Utilities.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">OPTIONS</p>
<p style="margin-bottom:0;">This  program  follows  the  usual  GNU  command line syntax, with long</p>
<p style="margin-bottom:0;">options starting with two dashes (‘-’).</p>
<p style="margin-bottom:0;">Dialog options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;calendar</p>
<p style="margin-bottom:0;">Display calendar dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;entry</p>
<p style="margin-bottom:0;">Display text entry dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;error</p>
<p style="margin-bottom:0;">Display error dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;file-selection</p>
<p style="margin-bottom:0;">Display file selection dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;info Display info dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;list Display list dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;notification</p>
<p style="margin-bottom:0;">Display notification icon</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;progress</p>
<p style="margin-bottom:0;">Display progress indication dialog</p>
<p style="margin-bottom:0;">&#8211;question</p>
<p style="margin-bottom:0;">Display question dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text-info</p>
<p style="margin-bottom:0;">Display text information dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;warning</p>
<p style="margin-bottom:0;">Display warning dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;scale</p>
<p style="margin-bottom:0;">Display scale dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">General options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;title=TITLE</p>
<p style="margin-bottom:0;">Set the dialog title</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;window-icon=ICONPATH</p>
<p style="margin-bottom:0;">Set the window icon</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;width=WIDTH</p>
<p style="margin-bottom:0;">Set the dialog width</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;height=HEIGHT</p>
<p style="margin-bottom:0;">Set the dialog height</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Calendar options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;day=INT</p>
<p style="margin-bottom:0;">Set the calendar day</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;month=INT</p>
<p style="margin-bottom:0;">Set the calendar month</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;year=INT</p>
<p style="margin-bottom:0;">Set the calendar year</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;date-format=PATTERN</p>
<p style="margin-bottom:0;">Set the format for the returned date</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Text entry options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;entry-text=STRING</p>
<p style="margin-bottom:0;">Set the entry text</p>
<p style="margin-bottom:0;">&#8211;hide-text</p>
<p style="margin-bottom:0;">Hide the entry text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Error options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;no-wrap</p>
<p style="margin-bottom:0;">Do not enable text wrapping</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">File selection options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;filename=FILENAME</p>
<p style="margin-bottom:0;">Set the filename</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;multiple</p>
<p style="margin-bottom:0;">Allow selection of multiple filenames in file selection dialog</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;directory</p>
<p style="margin-bottom:0;">Activate directory-only selection</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;save Activate save mode</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;separator=SEPARATOR</p>
<p style="margin-bottom:0;">Specify separator character when returning multiple filenames</p>
<p style="margin-bottom:0;">&#8211;confirm-overwrite</p>
<p style="margin-bottom:0;">Confirm file selection if filename already exists</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Info options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;no-wrap</p>
<p style="margin-bottom:0;">Do not enable text wrapping</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">List options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;column=STRING</p>
<p style="margin-bottom:0;">Set the column header</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;checklist</p>
<p style="margin-bottom:0;">Use check boxes for first column</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;radiolist</p>
<p style="margin-bottom:0;">Use radio buttons for first column</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;separator=STRING</p>
<p style="margin-bottom:0;">Set output separator character</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;multiple</p>
<p style="margin-bottom:0;">Allow multiple rows to be selected</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;editable</p>
<p style="margin-bottom:0;">Allow changes to text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;print-column=STRING</p>
<p style="margin-bottom:0;">Specify what column to print to standard output. The default  is</p>
<p style="margin-bottom:0;">to  return  the  first  column.  ’ALL’  may be used to print all</p>
<p style="margin-bottom:0;">columns.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;hide-column=NUMBER</p>
<p style="margin-bottom:0;">Hide a specific column</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Notification options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the notification text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;listen</p>
<p style="margin-bottom:0;">Listen for commands on stdin</p>
<p style="margin-bottom:0;">Progress options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;percentage=INT</p>
<p style="margin-bottom:0;">Set initial percentage</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;auto-close</p>
<p style="margin-bottom:0;">Close dialog when 100% has been reached</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;auto-kill</p>
<p style="margin-bottom:0;">Kill parent process if cancel button is pressed</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;pulsate</p>
<p style="margin-bottom:0;">Pulsate progress bar</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Question options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;no-wrap</p>
<p style="margin-bottom:0;">Do not enable text wrapping Text options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;filename=FILENAME</p>
<p style="margin-bottom:0;">Open file</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;editable</p>
<p style="margin-bottom:0;">Allow changes to text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Warning options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;no-wrap</p>
<p style="margin-bottom:0;">Do not enable text wrapping</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Scale options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;text=STRING</p>
<p style="margin-bottom:0;">Set the dialog text</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;value=VALUE</p>
<p style="margin-bottom:0;">Set initial value</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;min-value=VALUE</p>
<p style="margin-bottom:0;">Set minimum value</p>
<p style="margin-bottom:0;">&#8211;step=VALUE</p>
<p style="margin-bottom:0;">Set step size</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;print-partial</p>
<p style="margin-bottom:0;">Print partial values</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;hide-value</p>
<p style="margin-bottom:0;">Hide value</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Miscellaneous options</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">-?, &#8211;help</p>
<p style="margin-bottom:0;">Show summary of options.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;about</p>
<p style="margin-bottom:0;">Display an about dialog.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">&#8211;version</p>
<p style="margin-bottom:0;">Show version of program.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Also the standard GTK+ options are accepted.</p>
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>USING AWK</strong></span></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo &#8220;1 nav dd&#8221;</p>
<p style="margin-bottom:0;">1 nav dd</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ echo &#8220;1 nav dd&#8221; | awk &#8216;{ print $2 }&#8217;</p>
<p style="margin-bottom:0;">nav</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat fi</p>
<p style="margin-bottom:0;">1 asa f 22</p>
<p style="margin-bottom:0;">2 sds m 44</p>
<p style="margin-bottom:0;">3 ere f 55</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ vim fi</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216;{ if ($1 &gt;23) { print $2 } }&#8217; fi</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat fi</p>
<p style="margin-bottom:0;">1 asa f 22</p>
<p style="margin-bottom:0;">2 sds m 44</p>
<p style="margin-bottom:0;">3 ere f 55</p>
<p style="margin-bottom:0;">4 saj m 22</p>
<p style="margin-bottom:0;">5 bos m 22</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216;{ if ($1 &gt;23) { print $2 } }&#8217; fi</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216;{ if ($4 &gt;23) { print $2 } }&#8217; fi</p>
<p style="margin-bottom:0;">sds</p>
<p style="margin-bottom:0;">ere</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216;{ if ($3 ==m) { print $2 } }&#8217; fi</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216;{ if ($3 == &#8220;m&#8221;) { print $2 } }&#8217; fi</p>
<p style="margin-bottom:0;">sds</p>
<p style="margin-bottom:0;">saj</p>
<p style="margin-bottom:0;">bos</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">FOR FINDING “A”ONLY</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { print $2 } &#8216; fi | awk &#8216;/^a/ { print $1 }&#8217;</p>
<p style="margin-bottom:0;">asa</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat file</p>
<p style="margin-bottom:0;">1 aparna f 21</p>
<p style="margin-bottom:0;">2 murad m 23</p>
<p style="margin-bottom:0;">3 unni m 21</p>
<p style="margin-bottom:0;">4 priya f 24</p>
<p style="margin-bottom:0;">5 fathima f 22</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { print $1  $2}&#8217; file | awk &#8216; /.a$/ { print $1  $2 }&#8217;1aparna</p>
<p style="margin-bottom:0;">4priya</p>
<p style="margin-bottom:0;">5fathima</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { print $2  $1}&#8217; file | awk &#8216; /^a/ { print $1  $2 }&#8217;</p>
<p style="margin-bottom:0;">aparna1</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { print $2 }&#8217; file | awk &#8216; /^a/ { print $1   }&#8217;</p>
<p style="margin-bottom:0;">aparna</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">@catfoss4:~$ awk &#8216;{ if ($3==&#8221;m&#8221;)  { print $3  $2}}&#8217; file</p>
<p style="margin-bottom:0;">mmurad</p>
<p style="margin-bottom:0;">munni</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { print $2 }&#8217; file | awk &#8216; /^a/ { print $1   }&#8217;</p>
<p style="margin-bottom:0;">aparna</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { print $1  $2}&#8217; file | awk &#8216; /a[a-z]*a/ { print $1  $2 }&#8217;</p>
<p style="margin-bottom:0;">1aparna</p>
<p style="margin-bottom:0;">5fathima</p>
<p style="margin-bottom:0;"><strong>EXACTLY  1 A</strong></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216;{ if ($3==&#8221;m&#8221;)  { print $2 &#8221; &#8221; $3}}&#8217; file |awk &#8216;/a+/ { print $1}&#8217;</p>
<p style="margin-bottom:0;">murad</p>
<p style="margin-bottom:0;"><strong>AT LEAST ONE M</strong></p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; { if ($3==&#8221;m&#8221;)  print $1  $2     }&#8217; file | awk &#8216; /m/ { print $1  $2 }&#8217;</p>
<p style="margin-bottom:0;">2murad</p>
<p style="margin-bottom:0;">6mnemeshm</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk &#8216; {if ($3 == &#8220;m&#8221;)  { print $2&#8243; &#8220;$1 } }&#8217; file | awk &#8216; /^[b-z]*a[b-z]* / { print $2&#8243; &#8220;$1 }&#8217;</p>
<p style="margin-bottom:0;">2 murad</p>
<p style="margin-bottom:0;"><strong>AWK</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat &gt;cod</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print $2</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">^C</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat cod</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print $2</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk -f cod file</p>
<p style="margin-bottom:0;">aparna</p>
<p style="margin-bottom:0;">murad</p>
<p style="margin-bottom:0;">unni</p>
<p style="margin-bottom:0;">priya</p>
<p style="margin-bottom:0;">fathima</p>
<p style="margin-bottom:0;">maaanemeshm</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat cod</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">for (i=0;i&lt;10;i++)&gt;</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print i</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk -f cod file</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">7</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">9</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">7</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">9</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">7</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">9</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">7</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">9</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">7</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">9</p>
<p style="margin-bottom:0;">0</p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">3</p>
<p style="margin-bottom:0;">4</p>
<p style="margin-bottom:0;">5</p>
<p style="margin-bottom:0;">6</p>
<p style="margin-bottom:0;">7</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">9</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">BINARY TO HEX</p>
<p style="margin-bottom:0;">echo &#8220;enter the no&#8221;</p>
<p style="margin-bottom:0;">read n</p>
<p style="margin-bottom:0;">dec=`echo &#8220;obase=10;ibase=2; &#8221; $n |bc`</p>
<p style="margin-bottom:0;">hex=`echo &#8220;obase=16;ibase=2; &#8221; $n |bc`</p>
<p style="margin-bottom:0;">oct=`echo &#8220;obase=8;ibase=2; &#8220;$n |bc`</p>
<p style="margin-bottom:0;">echo &#8220;$n is $dec&#8221;</p>
<p style="margin-bottom:0;">echo &#8220;$n is $hex&#8221;</p>
<p style="margin-bottom:0;">echo &#8220;$n is $oct&#8221;</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>USING AWK BINARY TO HEX CONVERSION</strong></p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">alpha=&#8221;123456789ABCDEF&#8221;</p>
<p style="margin-bottom:0;">binary=$1</p>
<p style="margin-bottom:0;">base= $2</p>
<p style="margin-bottom:0;">decimal=0</p>
<p style="margin-bottom:0;">print &#8220;binary=&#8221;$1&#8243;, base=&#8221;$2</p>
<p style="margin-bottom:0;">inex=0</p>
<p style="margin-bottom:0;">if (base != 2 )</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">while ( binary &gt;= 1 )</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">decmal=decmal+((binary % 10) * (2 ^ inex))</p>
<p style="margin-bottom:0;">binary=int(binary/10)</p>
<p style="margin-bottom:0;">inex=inex+1</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">if ( base == 10 )</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print decmal &#8220;(base 10)&#8221;</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">else if ( base &lt;= 16 )</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">if ( decmal == 0 )</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print decmal</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">else</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">fin=&#8221;"</p>
<p style="margin-bottom:0;">while ( decmal &gt;= 1 )</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print decmal</p>
<p style="margin-bottom:0;">print base</p>
<p style="margin-bottom:0;">fin=substr(alpha,decmal%base,1) fin</p>
<p style="margin-bottom:0;">x=decmal % base</p>
<p style="margin-bottom:0;">print &#8220;x&#8221;x</p>
<p style="margin-bottom:0;">decmal=int(decmal/base)</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">print fin &#8220;(base&#8221;base&#8221;)&#8221;</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">else</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print &#8220;invalid base&#8221;</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">else</p>
<p style="margin-bottom:0;">{</p>
<p style="margin-bottom:0;">print binary</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>ANS:</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ awk -f  conn dfg</p>
<p style="margin-bottom:0;">binary=1010, base=10</p>
<p style="margin-bottom:0;">10(base 10)</p>
<p style="margin-bottom:0;">binary=1011, base=8</p>
<p style="margin-bottom:0;">21</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">x5</p>
<p style="margin-bottom:0;">2</p>
<p style="margin-bottom:0;">8</p>
<p style="margin-bottom:0;">x2</p>
<p style="margin-bottom:0;">25(base8)</p>
<p style="margin-bottom:0;">binary=1010, base=16</p>
<p style="margin-bottom:0;">10</p>
<p style="margin-bottom:0;">16</p>
<p style="margin-bottom:0;">x10</p>
<p style="margin-bottom:0;">A(base16)</p>
<p style="margin-bottom:0;">binary=, base= 0</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">catfoss@catfoss4:~$ cat /etc/fstab</p>
<p style="margin-bottom:0;"># /etc/fstab: static file system information.</p>
<p style="margin-bottom:0;">#</p>
<p style="margin-bottom:0;">#</p>
<p style="margin-bottom:0;">proc            /proc           proc    defaults        0       0</p>
<p style="margin-bottom:0;">/dev/sda7       /               ext3    errors=remount-ro 0       1</p>
<p style="margin-bottom:0;">/dev/sda6       none            swap    sw              0       0</p>
<p style="margin-bottom:0;">/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">FOR MASH INSTALLATION</p>
<p style="margin-bottom:0;">fist download the mash version from space-kerala.com,then extract the folder,right click the folder then extract</p>
<p style="margin-bottom:0;">from the <a href="mailto:catfoss@catfoss4cd">catfoss@catfoss4cd</a> Desktop,cd mash</p>
<p style="margin-bottom:0;">then type ./configure</p>
<p style="margin-bottom:0;">then type make</p>
<p style="margin-bottom:0;">then type cd bin</p>
<p style="margin-bottom:0;">then ./maash</p>
<p style="margin-bottom:0;">for adding extra to the file cmds.c type last portion of that our name like</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">pritntf  (stderr ,”\naveen  -Display my name .\n”); then save the file</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-size:medium;"><strong>palindrome</strong></span></p>
<p style="margin-bottom:0;">for ((k=1;k&lt;5;k++))&gt;</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">for ((l=5;l&gt;=k;l&#8211;))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">echo -n &#8221; &#8220;</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">for ((m=1;m&lt;=k;m++))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">echo -en &#8220;$m&#8221;</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">for ((n=k-1;n&gt;0;n&#8211;))</p>
<p style="margin-bottom:0;">do</p>
<p style="margin-bottom:0;">echo -en &#8220;$n&#8221;</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;">echo &#8221; &#8220;</p>
<p style="margin-bottom:0;">done</p>
<p style="margin-bottom:0;"><strong>ANS</strong></p>
<p style="margin-bottom:0;">1</p>
<p style="margin-bottom:0;">121</p>
<p style="margin-bottom:0;">12321</p>
<p style="margin-bottom:0;">1234321</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">while true</p>
<p style="margin-bottom:0;">&gt; do</p>
<p style="margin-bottom:0;">&gt; eject</p>
<p style="margin-bottom:0;">&gt; sleep 1</p>
<p style="margin-bottom:0;">&gt; eject -t</p>
<p style="margin-bottom:0;">&gt; done</p>
</div>
<div class="post-footer">
<div class="post-footer-line post-footer-line-1"><span class="post-author vcard"><br />
</span><span class="post-icons"><span class="item-control blog-admin pid-1261034499"><a title="Edit Post" href="http://www.blogger.com/post-edit.g?blogID=7366258948420632812&amp;postID=4517871229066493165"><br />
</a><br />
</span><br />
</span></div>
<div class="post-footer-line post-footer-line-2"><span class="post-labels"><br />
</span></div>
<div class="post-footer-line post-footer-line-3"><span class="post-location"><br />
</span></div>
</div>
</div>
</div>
<h2 class="date-header">Tuesday, February 2, 2010</h2>
<div class="post-outer">
<div class="post hentry uncustomized-post-template"><a name="7099685305403941248"></a></p>
<h3 class="post-title entry-title"><a href="http://naveenboss.blogspot.com/">serveradmn</a></h3>
<div class="post-body entry-content">http://tldp.org/LDP/nag2/x-087-2-appl.remote.html</p>
<p>1. TCPDUMP DOWNLOAD:</p>
<p>To download TCPdump:</p>
<p>#apt-get install tcpdump<br />
To see the TCPdump dependencies:</p>
<p>#apt-cache depends tcpdump<br />
tcpdump<br />
Depends: libc6<br />
Depends: libpcap0.8<br />
Depends: libssl0.9.8</p>
<p>To see the installed TCPdump version:</p>
<p>#apt-cache policy tcpdump<br />
tcpdump:<br />
Installed: 3.9.4-2ubuntu0.1<br />
Candidate: 3.9.4-2ubuntu0.1<br />
Version table:<br />
*** 3.9.4-2ubuntu0.1 0<br />
500 http://security.ubuntu.com dapper-security/main Packages<br />
100 /var/lib/dpkg/status<br />
3.9.4-2 0<br />
500 http://ch.archive.ubuntu.com dapper/main Packages</p>
<p>2. TCPDUMP USE</p>
<p>To display the Standard TCPdump output:</p>
<p>#tcpdump<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes</p>
<p>21:57:29.004426 IP 192.168.1.2.1034 &gt; valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
21:57:31.228013 arp who-has 192.168.1.2 tell 192.168.1.1<br />
21:57:31.228020 arp reply 192.168.1.2 is-at 00:04:75:22:22:22 (oui Unknown)<br />
21:57:38.035382 IP 192.168.1.2.1034 &gt; valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
21:57:38.613206 IP valve-68-142-64-164.phx3.llnw.net.27014 &gt; 192.168.1.2.1034: UDP, length 36</p>
<p>To display the verbose output:</p>
<p>#tcpdump -v<br />
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes</p>
<p>22:00:11.625995<br />
IP (tos 0&#215;0, ttl 128, id 30917, offset 0, flags [none], proto: UDP<br />
(17), length: 81) 192.168.1.2.1034 &gt;<br />
valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
22:00:20.691903<br />
IP (tos 0&#215;0, ttl 128, id 31026, offset 0, flags [none], proto: UDP<br />
(17), length: 81) 192.168.1.2.1034 &gt;<br />
valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
22:00:21.230970<br />
IP (tos 0&#215;0, ttl 114, id 4373, offset 0, flags [none], proto: UDP (17),<br />
length: 64) valve-68-142-64-164.phx3.llnw.net.27014 &gt;<br />
192.168.1.2.1034: UDP, length 36<br />
22:00:26.201715 arp who-has 192.168.1.2 tell 192.168.1.1<br />
22:00:26.201726 arp reply 192.168.1.2 is-at 00:04:11:11:11:11 (oui Unknown)<br />
22:00:29.706020<br />
IP (tos 0&#215;0, ttl 128, id 31133, offset 0, flags [none], proto: UDP<br />
(17), length: 81) 192.168.1.2.1034 &gt;<br />
valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
22:00:38.751355<br />
IP (tos 0&#215;0, ttl 128, id 31256, offset 0, flags [none], proto: UDP<br />
(17), length: 81) 192.168.1.2.1034 &gt;<br />
valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53</p>
<p>Network interfaces available for the capture:</p>
<p>#tcpdump -D<br />
1.eth0<br />
2.any (Pseudo-device that captures on all interfaces)<br />
3.lo</p>
<p>To display numerical addresses rather than symbolic (DNS) addresses:</p>
<p>#tcpdump -n<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes</p>
<p>22:02:36.111595 IP 192.168.1.2.1034 &gt; 68.142.64.164.27014: UDP, length 53<br />
22:02:36.669853 IP 68.142.64.164.27014 &gt; 192.168.1.2.1034: UDP, length 36<br />
22:02:41.702977 arp who-has 192.168.1.2 tell 192.168.1.1<br />
22:02:41.702984 arp reply 192.168.1.2 is-at 00:04:11:11:11:11<br />
22:02:45.106515 IP 192.168.1.2.1034 &gt; 68.142.64.164.27014: UDP, length 53<br />
22:02:50.392139 IP 192.168.1.2.138 &gt; 192.168.1.255.138: NBT UDP PACKET(138)<br />
22:02:54.139658 IP 192.168.1.2.1034 &gt; 68.142.64.164.27014: UDP, length 53<br />
22:02:57.866958 IP 125.175.131.58.3608 &gt; 192.168.1.2.9501: S 3275472679:3275472679(0) win 65535</p>
<p>To display the quick output:</p>
<p>#tcpdump -q<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes</p>
<p>22:03:55.594839 IP a213-22-130-46.cpe.netcabo.pt.3546 &gt; 192.168.1.2.9501: tcp 0<br />
22:03:55.698827 IP 192.168.1.2.9501 &gt; a213-22-130-46.cpe.netcabo.pt.3546: tcp 0<br />
22:03:56.068088 IP a213-22-130-46.cpe.netcabo.pt.3546 &gt; 192.168.1.2.9501: tcp 0<br />
22:03:56.068096 IP 192.168.1.2.9501 &gt; a213-22-130-46.cpe.netcabo.pt.3546: tcp 0<br />
22:03:57.362863 IP 192.168.1.2.1034 &gt; valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
22:03:57.964397 IP valve-68-142-64-164.phx3.llnw.net.27014 &gt; 192.168.1.2.1034: UDP, length 36<br />
22:04:06.406521 IP 192.168.1.2.1034 &gt; valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53<br />
22:04:15.393757 IP 192.168.1.2.1034 &gt; valve-68-142-64-164.phx3.llnw.net.27014: UDP, length 53</p>
<p>Capture the traffic of a particular interface:</p>
<p>tcpdump -i eth0<br />
To capture the UDP traffic:</p>
<p>#tcpdump udp<br />
To capture the TCP port 80 traffic:</p>
<p>#tcpdump port http<br />
To capture the traffic from a filter stored in a file:</p>
<p>#tcpdump -F file_name<br />
To create a file where the filter is configured (here the TCP 80 port)</p>
<p>#vim file_name<br />
port 80<br />
To stop the capture after 20 packets:</p>
<p>#tcpdump -c 20<br />
To send the capture output in a file instead of directly on the screen:</p>
<p>#tcpdump -w capture.log<br />
To read a capture file:</p>
<p>#tcpdump -r capture.log<br />
reading from file capture.log, link-type EN10MB (Ethernet)</p>
<p>09:33:51.977522 IP 192.168.1.36.40332 &gt; rr.knams.wikimedia.org.www: P 1548302662:1548303275(613) ack 148796145 win 16527<br />
09:33:52.031729 IP rr.knams.wikimedia.org.www &gt; 192.168.1.36.40332: . ack 613 win 86<br />
09:33:52.034414 IP rr.knams.wikimedia.org.www &gt; 192.168.1.36.40332: P 1:511(510) ack 613 win86<br />
09:33:52.034786 IP 192.168.1.36.40332 &gt; rr.knams.wikimedia.org.www: . ack 511 win 16527</p>
<p>The<br />
captured data isn&#8217;t stored in plain text so you cannot read it with a<br />
text editor, you have to use a special tool like TCPdump (see above) or<br />
Wireshark (Formerly Ethereal) which provides a graphical interface.</p>
<p>The capture.log file is opened with Wireshark.</p>
<p>To display the packets having &#8220;www.openmaniak.com&#8221; as their source or destination address:</p>
<p>#tcpdump host www.openmaniak.com<br />
To display the FTP packets coming from 192.168.1.100 to 192.168.1.2:</p>
<p>#tcpdump src 192.168.1.100 and dst 192.168.1.2 and port ftp<br />
To display the packets content:</p>
<p>#tcpdump -A<br />
Packets<br />
capture during a FTP connection. The FTP password can be easily<br />
intercepted because it is sent in clear text to the server.</p>
<p>tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on ath0, link-type EN10MB (Ethernet), capture size 96 bytes<br />
20:53:24.872785 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: S 4155598838:4155598838(0) win 5840<br />
&#8230;.g&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
&#8230;&#8230;&#8230;&#8230;<br />
20:53:24.879473 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: . ack 1228937421 win 183<br />
&#8230;.g.I@&#8230;&#8230;&#8230;&#8230;.<br />
&#8230;&#8230;..<br />
20:53:24.881654 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: . ack 43 win 183<br />
&#8230;.g.I@&#8230;&#8230;.8&#8230;..<br />
&#8230;&#8230;EN<br />
20:53:26.402046 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: P 0:10(10) ack 43 win 183<br />
&#8230;.g.I@&#8230;&#8230;`$&#8230;..<br />
&#8230;=..ENUSER teddybear</p>
<p>20:53:26.403802 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: . ack 76 win 183<br />
&#8230;.h.I@&#8230;&#8230;&#8230;&#8230;.<br />
&#8230;&gt;..E^<br />
20:53:29.169036 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: P 10:25(15) ack 76 win 183<br />
&#8230;.h.I@&#8230;&#8230;#c&#8230;..<br />
&#8230;&#8230;E^PASS wakeup</p>
<p>20:53:29.171553 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: . ack 96 win 183<br />
&#8230;.h.I@.,&#8230;&#8230;&#8230;..<br />
&#8230;&#8230;Ez<br />
20:53:29.171649 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: P 25:31(6) ack 96 win 183<br />
&#8230;.h.I@.,&#8230;&#8230;&#8230;..<br />
&#8230;&#8230;EzSYST</p>
<p>20:53:29.211607 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: . ack 115 win 183<br />
&#8230;.h.I@.?&#8230;..j&#8230;..<br />
&#8230;&#8230;Ez<br />
20:53:31.367619 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: P 31:37(6) ack 115 win 183<br />
&#8230;.h.I@.?&#8230;&#8230;&#8230;..<br />
&#8230;&#8230;EzQUIT</p>
<p>20:53:31.369316 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: . ack 155 win 183<br />
&#8230;.h.I@.g&#8230;&#8230;&#8230;..<br />
&#8230;&#8230;E.<br />
20:53:31.369759 IP ubuntu.local.40205 &gt; 192.168.1.2.ftp: F 37:37(0) ack 156 win 183<br />
&#8230;.h.I@.h&#8230;..e&#8230;..<br />
&#8230;&#8230;E.</p>
<p>We see in this capture the FTP username (teddybear) and password (wakeup).</p>
<p>route add default\gw 192.168.150.1<br />
/etc/resolv.config  set name server for DNS address<br />
FIRST INSTALL IPCALC<br />
catfoss11:~# ipcalc 192.168.150.13<br />
Address:   192.168.150.13       11000000.10101000.10010110. 00001101<br />
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000<br />
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111<br />
=&gt;<br />
Network:   192.168.150.0/24     11000000.10101000.10010110. 00000000<br />
HostMin:   192.168.150.1        11000000.10101000.10010110. 00000001<br />
HostMax:   192.168.150.254      11000000.10101000.10010110. 11111110<br />
Broadcast: 192.168.150.255      11000000.10101000.10010110. 11111111<br />
Hosts/Net: 254                   Class C, Private Internet</p>
<p>catfoss11:~# route<br />
Kernel IP routing table<br />
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface<br />
192.168.150.0   *               255.255.255.0   U     0      0        0 eth0<br />
default         192.168.150.1   0.0.0.0         UG    0      0        0 eth0</p>
<p>catfoss11:~# cat /etc/hostname<br />
catfoss11<br />
catfoss11:~# cat /etc/hosts<br />
127.0.0.1 localhost<br />
127.0.1.1 catfoss11</p>
<p># The following lines are desirable for IPv6 capable hosts<br />
::1 localhost ip6-localhost ip6-loopback<br />
fe00::0 ip6-localnet<br />
ff00::0 ip6-mcastprefix<br />
ff02::1 ip6-allnodes<br />
ff02::2 ip6-allrouters<br />
ff02::3 ip6-allhosts<br />
catfoss11:~# vim /etc/hosts(for setting the ip address with names)<br />
catfoss11:~# cat /proc/sys/net/ipv4/ip_forward<br />
0<br />
if it is set to 1,this make the s/m dump ruter(vim/proc/sys/net/ipv4/ip_forward )<br />
catfoss11:~# echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
catfoss11:~# cat /proc/sys/net/ipv4/ip_forward<br />
1</p>
<p>NAT :-it is known as network address translation</p>
<p>pre routing&#8212;&gt;routing&#8212;&#8212;&#8211;&gt;post routing</p>
<p>catfoss11:~# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</p>
<p>-A is used for append the nat.<br />
it places centers address to routers address</p>
<p>catfoss11:~# iptables -L<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>catfoss11:~# iptables -t nat -L<br />
Chain PREROUTING (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain POSTROUTING (policy ACCEPT)<br />
target     prot opt source               destination<br />
MASQUERADE  all  &#8212;  anywhere             anywhere</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>catfoss11:~# iptables -t  mangle -L<br />
Chain PREROUTING (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain POSTROUTING (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>iptables[-t table] command[pattern] action<br />
there are 3 tables filter,nat,mangle<br />
for adding a rule iptables[-t table] command -A chain [rule]<br />
for deleting -D, iptables[-t table] command -D chain [rule] index<br />
Deleting an entire chain iptables -t nat -F chain</p>
<p>for internet in the lan<br />
we need DNS IP<br />
is in same family then need a provider inthat we need an ip-forwording and masqurade</p>
<p>action<br />
snat,masquride,DNAT,DEDIRECT<br />
source nat,destination</p>
<p>iptables -t nat -A postrouting -p tcp -s 192.168.150.27</p>
<p>-s for source<br />
-p for protocol<br />
-A for postrouting  packets coming from 192.168.150.27 after postrouting perform the action<br />
packets going to 192.168.150.182 having the utp protocol after post routing<br />
iptables<br />
-t nat -A post routing -o etho -j masquride(if the packets are going<br />
through the etho at the time of post routing masquride</p>
<p>ls *a* for finding starting files with a<br />
inthe noteless press ctrl +s</p>
<p>all pkts coming from 192.1               going through   eth0 do  action while free routimg<br />
iptables -t nat -A postrouting -o eth0</p>
<p>iptables -t nat -A postrouting -p!tcp -s!192.168.0.0/16</p>
<p>iptables -t nat -A postrouting -ptcp -s192.168.150.2 &#8211;sport 12345:12356 -d 123.123.123.123&#8211;dport 22<br />
the packets coming from 192.168.150.2 is 12345 to 12356 port is goning to destination ip 123<br />
port no.of http is 80</p>
<p>iptables -t nat cmnd pattern -j MASQUERADE: change center to out going  n/w interface<br />
-j masquerde used for changing the source port id<br />
iptables -t nat cmnd pattern-jSNAT &#8211;to-source 123.123.123.123<br />
change the address of the center to source 123.123.123.123<br />
SNAT is static masquerede is dynamic<br />
static is very fast<br />
iptables<br />
-t nat cmnd pattern -j DNAT &#8211;to-destination 123.123.123.123:22 change<br />
recipient addr. to 123.123.123.123 and port to 22</p>
<p>DNAT is used for pre routing<br />
iptables -t nat cmnd pattern-j redirect &#8211;to-port 8080</p>
<p>FOR CHANGING A BROWSER TO ANY S/M<br />
catfoss11:~# iptables -t nat -A OUTPUT -s 192.168.150.13 -j DNAT &#8211;to-destination 192.168.150.182<br />
for changing in the correct mode means in the above step we done the changes the browser to to the destination ip<br />
catfoss11:~# iptables -t nat -D OUTPUT -s 192.168.150.13 -j DNAT &#8211;to-destination 192.168.150.182</p>
<p>catfoss11:~# iptables -t nat -n -L<br />
catfoss11:~# iptables -t nat -F</p>
<p>catfoss11:~# telnet 192.168.150.13 80<br />
Trying 192.168.150.13&#8230;<br />
Connected to 192.168.150.13.<br />
Escape character is &#8216;^]&#8217;.<br />
GET / HTTP</p>
<p>HTTP/1.1 200 OK<br />
Date: Wed, 13 Jan 2010 12:49:30 GMT<br />
Server: Apache/2.2.14 (Debian)<br />
Last-Modified: Wed, 13 Jan 2010 10:05:09 GMT<br />
ETag: &#8220;1df1c-183-47d08e7cc9f40&#8243;<br />
Accept-Ranges: bytes<br />
Content-Length: 387<br />
Vary: Accept-Encoding<br />
Connection: close<br />
Content-Type: text/html</p>
<p><a><br />
</a></p>
<h1><a>WELCOME!</a></h1>
<p><a><br />
<img src="http://www.naveenboss.blogspot.com/avatar.png" alt="" /></a></p>
<p><a href="http://www.naveenboss.blogspot.com/MEA%20engg.%20COLLEGE.jpg">mea engg.college</a></p>
<p>CATFOSS</p>
<p><a href="http://192.168.150.27/">rakesh</a><br />
<a href="http://192.168.150.12/">vidya</a><br />
<a href="http://192.168.150.26/">linda</a><br />
<a href="http://192.168.150.11/">anu</a></p>
<p><a href="http://192.168.150.180/wiki">wiki </a></p>
<p>Connection closed by foreign host.<br />
for changing the<br />
catfoss11:~# iptables -t nat -A PREROUTING -p tcp &#8211;dport 6000 -j REDIRECT &#8211;to-ports 80<br />
catfoss11:~# iptables -t nat -A OUTPUT -p tcp &#8211;dport 6000 -j REDIRECT &#8211;to-ports 80<br />
catfoss11:~# netstat<br />
Active Internet connections (w/o servers)</p>
<p>python</p>
<p>&gt;&gt;&gt; ord<br />
&gt;&gt;&gt; ord(&#8220;a&#8221;)<br />
97<br />
&gt;&gt;&gt; ord(&#8220;n&#8221;)<br />
110</p>
<p>server</p>
<p>&gt;&gt;&gt; import socket</p>
<p>&gt;&gt;&gt; ord</p>
<p>&gt;&gt;&gt; s=socket(AF_INET,SOCK_DGRAM)<br />
&gt;&gt;&gt; s.bind((&#8220;127.0.0.1&#8243;,9000 ))<br />
&gt;&gt;&gt; while True:<br />
&#8230;     s.recvfrom (10)<br />
&#8230;<br />
(&#8216;catfoss&#8217;, (&#8217;127.0.0.1&#8242;, 57420))</p>
<p>(&#8216;iam naveen&#8217;, (&#8217;127.0.0.1&#8242;, 57420))</p>
<p>client</p>
<p>&gt;&gt;&gt; from  socket import*<br />
&gt;&gt;&gt; c=socket (AF_INET,SOCK_DGRAM)<br />
&gt;&gt;&gt; c</p>
<p>&gt;&gt;&gt; k=&#8221;catfoss&#8221;<br />
&gt;&gt;&gt; c.sendto (k,(&#8220;127.0.0.1&#8243;,9000 ))<br />
7<br />
&gt;&gt;&gt; k=&#8221;iam naveenbos&#8221;<br />
&gt;&gt;&gt; c.sendto (k,(&#8220;127.0.0.1&#8243;,9000 ))<br />
13</p>
<p>catfoss11:~# iptables -t nat -A PREROUTING -p UDP -s 192.168.150.27 &#8211;dport 6000 -j REDIRECT &#8211;to-ports 8000</p>
<p>FIRE WALL</p>
<p>drop: the packet will get but we can not take it<br />
rejaect means the packet willnot take<br />
shorewall<br />
Shoreline Firewall, netfilter configurator &#8211; common files<br />
Shorewall allows firewall/gateway requirements to be described using<br />
entries in a set of configuration files. It reads those configuration<br />
files and, with the help of the iptables utility, configures<br />
netfilter to match these requirements.</p>
<p>Shorewall supports a wide range of router/firewall/gateway applications,<br />
traffic shaping and almost every type of VPN.</p>
<p>This package contains files needed by both the Perl-based and<br />
shell-based compilers.</p>
<p>filter:<br />
This  is  the default table (if no -t option is passed).  It<br />
contains the built-in chains INPUT (for packets destined  to<br />
local  sockets),  FORWARD  (for packets being routed through<br />
the box), and OUTPUT (for locally-generated packets).</p>
<p>nat:<br />
This table is consulted when a packet  that  creates  a  new<br />
connection  is encountered.  It consists of three built-ins:<br />
PREROUTING (for altering packets as soon as they  come  in),<br />
OUTPUT  (for altering locally-generated packets before rout‐<br />
ing), and POSTROUTING (for  altering  packets  as  they  are<br />
about to go out).<br />
mangle:<br />
This table is used for specialized packet alteration.  Until<br />
kernel 2.4.17 it had two built-in  chains:  PREROUTING  (for<br />
altering  incoming  packets  before routing) and OUTPUT (for<br />
altering locally-generated packets before  routing).   Since<br />
kernel  2.4.18,  three  other  built-in chains are also sup‐<br />
ported: INPUT (for packets coming into the box itself), FOR‐<br />
WARD  (for  altering  packets being routed through the box),<br />
and POSTROUTING (for altering packets as they are  about  to<br />
go out).<br />
raw:<br />
This  table  is  used mainly for configuring exemptions from<br />
connection tracking in combination with the NOTRACK  target.<br />
It registers at the netfilter hooks with higher priority and<br />
is thus called before ip_conntrack, or any other IP  tables.<br />
It  provides  the following built-in chains: PREROUTING (for<br />
packets arriving via  any  network  interface)  OUTPUT  (for<br />
packets generated by local processes)</p>
<p>ufw(uniqe fire wall)</p>
<p>ufw status (enable or disable)<br />
ufw enable (for enabling the fire wall)<br />
iptables -X &#8211;delete chain<br />
gufw: graphical version means the editor(vim)</p>
<p>catfoss11:~# iptables -N na<br />
catfoss11:~# iptables -L<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain na (0 references)<br />
target     prot opt source               destination<br />
catfoss11:~# vim b<br />
catfoss11:~# iptables-save<br />
# Generated by iptables-save v1.4.2 on Thu Jan 14 13:09:49 2010<br />
*filter<br />
:INPUT ACCEPT [301:56519]<br />
:FORWARD ACCEPT [0:0]<br />
:OUTPUT ACCEPT [9:523]<br />
:na &#8211; [0:0]<br />
COMMIT<br />
# Completed on Thu Jan 14 13:09:49 2010<br />
# Generated by iptables-save v1.4.2 on Thu Jan 14 13:09:49 2010<br />
*nat<br />
 <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> REROUTING ACCEPT [157:33864]<br />
 <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> OSTROUTING ACCEPT [8:467]<br />
:OUTPUT ACCEPT [8:467]<br />
COMMIT<br />
# Completed on Thu Jan 14 13:09:49 2010<br />
catfoss11:~# iptables-save &gt;b<br />
catfoss11:~# vim b<br />
catfoss11:~# iptables -X<br />
catfoss11:~# iptables -L<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
catfoss11:~# iptables-restore a<br />
Can&#8217;t open a: No such file or directory<br />
catfoss11:~# iptables-restore b<br />
catfoss11:~# iptables -L<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain na (0 references)<br />
target     prot opt source               destination</p>
<p>filter</p>
<p>input ,(for go to firewall)<br />
output (signals from fire wall),<br />
forward(inside the firewall sym)filters packets protected from firewall</p>
<p>catfoss11:~# iptables -A INPUT -m conntrack &#8211;ctstate ESTABLISHED,RELATED -j ACCEPT</p>
<p>-j ACCEPT ( is a rule)<br />
-A INPUT (is achain)<br />
state  :4 states<br />
ctstate(conntrack)<br />
1.NEW<br />
2.RELATED (connection is new but is related to udp)<br />
3.established    allredy established<br />
4.invalid connection</p>
<p>related established &#8212;allow<br />
-m<br />
conntrack is a switch it is used for enabling the &#8211;ctstste,it allows<br />
filter matching based on connection state of the packet</p>
<p>for secure shell connection enabling<br />
catfoss11:~# iptables -A INPUT -p tcp &#8211;dport ssh -j ACCEPT</p>
<p>ssh,telnet ,http had default ports<br />
enabling<br />
catfoss11:~# iptables -A INPUT -p tcp &#8211;dport 80  -j ACCEPT<br />
catfoss11:~# iptables -A INPUT -p tcp &#8211;dport www  -j ACCEPT</p>
<p>catfoss11:~# iptables -A INPUT  -j DROP<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     all  &#8212;  anywhere             anywhere            ctstate RELATED,ESTABLISHED<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:ssh<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:www<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:www<br />
DROP       all  &#8212;  anywhere             anywhere</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>ACDEPT is highest priority than the DROP</p>
<p>catfoss11:~# iptables -I INPUT 1 -i lo -j ACCEPT<br />
catfoss11:~# iptables -L<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     all  &#8212;  anywhere             anywhere<br />
ACCEPT     all  &#8212;  anywhere             anywhere            ctstate RELATED,ESTABLISHED<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:ssh<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:www<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:www<br />
DROP       all  &#8212;  anywhere             anywhere<br />
ACCEPT     all  &#8212;  anywhere             anywhere</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
catfoss11:~# ping 127.0.0.1<br />
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.<br />
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.073 ms<br />
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.066 ms<br />
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.070 ms<br />
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.069 ms<br />
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.070 ms<br />
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.071 ms</p>
<p>catfoss11:~# iptables -L -v<br />
Chain INPUT (policy ACCEPT 341 packets, 67411 bytes)<br />
pkts bytes target     prot opt in     out     source               destination<br />
16  1340 ACCEPT     all  &#8212;  lo     any     anywhere             anywhere<br />
10   744 ACCEPT     all  &#8212;  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED<br />
0     0 ACCEPT     tcp  &#8212;  any    any     anywhere             anywhere            tcp dpt:ssh<br />
0     0 ACCEPT     tcp  &#8212;  any    any     anywhere             anywhere            tcp dpt:www<br />
0     0 ACCEPT     tcp  &#8212;  any    any     anywhere             anywhere            tcp dpt:www<br />
139 27107 DROP       all  &#8212;  any    any     anywhere             anywhere<br />
0     0 ACCEPT     all  &#8212;  127.0.0.1 any     anywhere             anywhere</p>
<p>Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)<br />
pkts bytes target     prot opt in     out     source               destination</p>
<p>Chain OUTPUT (policy ACCEPT 104 packets, 8035 bytes)<br />
pkts bytes target     prot opt in     out     source               destination</p>
<p>-j<br />
accept<br />
reject(return packets to sender)<br />
drop<br />
log(store the inform.about packet)<br />
for accepting server is not possible because need server root pwd<br />
catfoss11:~# ssh 192.168.150.182<br />
The authenticity of host &#8217;192.168.150.182 (192.168.150.182)&#8217; can&#8217;t be established.<br />
RSA key fingerprint is 0e:c8:8d:59:fd:45:f8:6b:15:39:ab:d3:75:c0:78:3a.<br />
Are you sure you want to continue connecting (yes/no)? yes<br />
Warning: Permanently added &#8217;192.168.150.182&#8242; (RSA) to the list of known hosts.<br />
root@192.168.150.182&#8242;s password:</p>
<p>catfoss11:/etc/network# cat interfaces<br />
# This file describes the network interfaces available on your system<br />
# and how to activate them. For more information, see interfaces(5).</p>
<p># The loopback network interface<br />
auto lo<br />
iface lo inet loopback</p>
<p>iface eth0 inet static<br />
address 192.168.150.13<br />
netmask 255.255.255.0<br />
gateway 192.168.150.1</p>
<p>auto eth0</p>
<p>chandni@catfoss11:~$ str=&#8221;naveen&#8221;<br />
chandni@catfoss11:~$ zenity &#8211;info &#8211;text=$str</p>
<p>16/07/07<br />
I learned today how to block a website using iptables command. You just have to type the following</p>
<p>iptables -I INPUT -s -d 0/0 -j DROP</p>
<p>I blocked orkut by using</p>
<p>iptables -I INPUT -s www.orkut.com -d 0/0 -j DROP</p>
<p>It<br />
is recommended to use IP addresses instead of hostname. But I used<br />
hostname, so that my roommates have no difficulty in deleting the rule.</p>
<p>To know all the possible IP addresses of a website, use</p>
<p>host</p>
<p>Most<br />
of the times it&#8217;ll give more than one addresses, so you have to define<br />
a rule for every IP address using the same syntax and it is highly<br />
recommended to use IP addresses than the hostname.<br />
To delete the rule, the syntax is same. You have to only replace I with D</p>
<p>iptables -D INPUT -s -d 0/0 -j DROP</p>
<p>In my case I used</p>
<p>iptables -D INPUT -s www.orkut.com -d 0/0 -j DROP</p>
<p>I<br />
also edited my /etc/rc.d/rc.local file so that this rule will<br />
automatically load during boot time. I also edited one entry there. I<br />
deleted the line</p>
<p>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</p>
<p>This<br />
line was for enabling my computer to forward the ip packets from other<br />
computer to internet using my computer as gateway. So instead of<br />
setting the value of ip_forward by echo command, I edited the Linux<br />
kernel config file: /etc/sysctl.conf<br />
and set the following value</p>
<p>net.ipv4.ip_forward = 1</p>
<p>I searched a lot for iptables. There were many useful sites. The one that helped me most is</p>
<p>http://www.yolinux.com/TUTORIALS/</p>
<p>or</p>
<p>iptables -A OUTPUT -d www.orkut.com  -j DROP<br />
catfoss:~# iptables  -A FORWARD -s orkut.com -o eth0 -j REJECT(in server)</p>
<p>for using server from client</p>
<p>catfoss11:~# ssh server@192.168.150.2<br />
server@192.168.150.2&#8242;s password:<br />
Permission denied, please try again.<br />
server@192.168.150.2&#8242;s password:<br />
Linux catfoss 2.6.26-2-xen-686 #1 SMP Sun Jun 21 09:15:17 UTC 2009 i686</p>
<p>The programs included with the Debian GNU/Linux system are free software;<br />
the exact distribution terms for each program are described in the<br />
individual files in /usr/share/doc/*/copyright.</p>
<p>Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent<br />
permitted by applicable law.<br />
You have mail.<br />
server@catfoss:~$ su -<br />
Password:<br />
catfoss:~# iptables -I INPUT -s www.orkut.com -j DROP<br />
catfoss:~# www-browser orkut.com</p>
</div>
<div class="post-footer">
<div class="post-footer-line post-footer-line-1"><span class="post-author vcard"><br />
</span><a href="http://naveenboss.blogspot.com/">links</a></div>
</div>
</div>
</div>
<div class="post-body entry-content"><!-- 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	--></p>
<p style="margin-bottom:0;"><strong>Printer configuration </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong><a href="http://www.linuxprinting.org/%7Etill/printing-tutorial/tut.html#1_1_1">http://www.linuxprinting.org/~till/printing-tutorial/tut.html#1_1_1</a></strong></p>
<p style="margin-bottom:0;"><strong><a href="http://forums.debian.net/viewtopic.php?t=10438">http://forums.debian.net/viewtopic.php?t=10438</a></strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>xen</strong></p>
<p style="margin-bottom:0;"><strong><a href="http://wiki.debian.org/Xen#Installationonlenny">http://wiki.debian.org/Xen#Installationonlenny</a></strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>xen-list-images(for testing images in the server) </strong></p>
<p style="margin-bottom:0;"><strong>xen-create-image </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>http://wiki.xensource.com/xenwiki/XenNetworking </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>catfoss11:~# less /etc/init.d/cups </strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong><a href="http://www.debianhelp.co.uk/dhcp.htm">http://www.debianhelp.co.uk/dhcp.htm</a></strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong><a href="http://tldp.org/HOWTO/DHCP/index.html">http://tldp.org/HOWTO/DHCP/index.html</a></strong></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=16&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2010/04/30/shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>

		<media:content url="http://www.naveenboss.blogspot.com/avatar.png" medium="image" />
	</item>
		<item>
		<title>django application</title>
		<link>http://naveenbos.wordpress.com/2010/04/30/django-application/</link>
		<comments>http://naveenbos.wordpress.com/2010/04/30/django-application/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 05:35:21 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/2010/04/30/django-application/</guid>
		<description><![CDATA[root@catfoss-desktop:/# home/catfoss/django-trunk/django/bin/django-admin.py startproject secprojcatfoss@catfoss-desktop:/secproj$ python manage.py startapp web then create data base in mysql edit settings .pymysql&#62; create user &#8216;djangosec&#8217;@'localhost&#8217; identified by&#8217;123&#8242;;Query OK, 0 rows affected (0.00 sec) mysql&#62; exitByeroot@catfoss-desktop:/home/catfoss/firstproject#&#160; mysql -pEnter password: Welcome to the MySQL monitor.&#160; Commands end with ; or \g.Your MySQL connection id is 755Server version: 5.1.37-1ubuntu5.1 (Ubuntu) Type &#8216;help;&#8217; or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=12&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>root@catfoss-desktop:/# home/catfoss/django-trunk/django/bin/django-admin.py startproject secproj<br />catfoss@catfoss-desktop:/secproj$ python manage.py startapp web</p>
<p>then create data base in mysql</p>
<p>edit settings .py<br />mysql&gt; create user &#8216;djangosec&#8217;@'localhost&#8217; identified by&#8217;123&#8242;;<br />Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql&gt; exit<br />Bye<br />root@catfoss-desktop:/home/catfoss/firstproject#&nbsp; mysql -p<br />Enter password: <br />Welcome to the MySQL monitor.&nbsp; Commands end with ; or \g.<br />Your MySQL connection id is 755<br />Server version: 5.1.37-1ubuntu5.1 (Ubuntu)</p>
<p>Type &#8216;help;&#8217; or &#8216;\h&#8217; for help. Type &#8216;\c&#8217; to clear the current input statement.</p>
<p>mysql&gt; grant all on*.*to &#8216;djangosec&#8217;@'localhost&#8217;;<br />Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql&gt; exit<br />Bye<br />root@catfoss-desktop:/home/catfoss/firstproject# mysql -u djangosec -p<br />Enter password: <br />Welcome to the MySQL monitor.&nbsp; Commands end with ; or \g.<br />Your MySQL connection id is 756<br />Server version: 5.1.37-1ubuntu5.1 (Ubuntu)</p>
<p>Type &#8216;help;&#8217; or &#8216;\h&#8217; for help. Type &#8216;\c&#8217; to clear the current input statement.</p>
<p>mysql&gt; create database secweb;<br />Query OK, 1 row affected (0.00 sec)</p>
<p>in settings.py we put like these<br />DATABASES = {<br />&nbsp;&nbsp;&nbsp; &#8216;default&#8217;: {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;ENGINE&#8217;: &#8216;django.db.backends.mysql&#8217;, # Add &#8216;postgresql_psycopg2&#8242;, &#8216;postgresql&#8217;, &#8216;mysql&#8217;, &#8216;sqlite3&#8242; or &#8216;oracle&#8217;.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;NAME&#8217;: &#8216;secweb&#8217;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Or path to database file if using sqlite3.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;USER&#8217;: &#8216;djangosec&#8217;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Not used with sqlite3.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;PASSWORD&#8217;: &#8217;123&#8242;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Not used with sqlite3.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;HOST&#8217;: &#8221;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set to empty string for localhost. Not used with sqlite3.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;PORT&#8217;: &#8221;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set to empty string for default. Not used with sqlite3.<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
<p>give path where the folder we created<br />TEMPLATE_DIRS = (&#8216;/secproj/&#8217;<br />&nbsp;&nbsp;&nbsp; # Put strings here, like &#8220;/home/html/django_templates&#8221; or &#8220;C:/www/django/templates&#8221;.<br />&nbsp;&nbsp;&nbsp; # Always use forward slashes, even on Windows.<br />&nbsp;&nbsp;&nbsp; # Don&#8217;t forget to use absolute paths, not relative paths.<br />)</p>
<p>INSTALLED_APPS = (<br />&nbsp;&nbsp;&nbsp; &#8216;django.contrib.auth&#8217;,<br />&nbsp;&nbsp;&nbsp; &#8216;django.contrib.contenttypes&#8217;,<br />&nbsp;&nbsp;&nbsp; &#8216;django.contrib.sessions&#8217;,<br />&nbsp;&nbsp;&nbsp; &#8216;django.contrib.sites&#8217;,<br />&nbsp;&nbsp;&nbsp; &#8216;django.contrib.messages&#8217;,<br />&nbsp;&nbsp;&nbsp; # Uncomment the next line to enable the admin:<br />&nbsp;&nbsp;&nbsp; &#8216;django.contrib.admin&#8217;,<br />&nbsp;&nbsp;&nbsp; &#8216;secproj.web&#8217;<br />)</p>
<p>then&nbsp; create templates directory <br />mkdir templates</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>go to secproj folder and edit urls.py</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>from django.conf.urls.defaults import *</p>
<p># Uncomment the next two lines to enable the admin:<br />from django.contrib import admin<br />admin.autodiscover()</p>
<p>urlpatterns = patterns(&#8221;,<br />&nbsp;&nbsp;&nbsp; # Example:<br />&nbsp;&nbsp;&nbsp;&nbsp; (r&#8217;^secproj/&#8217;, include(&#8216;secproj.web.urls&#8217;)),</p>
<p>&nbsp;&nbsp;&nbsp; # Uncomment the admin/doc line below and add &#8216;django.contrib.admindocs&#8217; <br />&nbsp;&nbsp;&nbsp; # to INSTALLED_APPS to enable admin documentation:<br />&nbsp;&nbsp;&nbsp; # (r&#8217;^admin/doc/&#8217;, include(&#8216;django.contrib.admindocs.urls&#8217;)),</p>
<p>&nbsp;&nbsp;&nbsp; # Uncomment the next line to enable the admin:<br />&nbsp;&nbsp;&nbsp;&nbsp; (r&#8217;^admin/&#8217;, include(admin.site.urls)),<br />)</p>
<p>catfoss@catfoss-desktop:/secproj$ cd templates<br />catfoss@catfoss-desktop:/secproj/templates$ mkdir web<br />catfoss@catfoss-desktop:/secproj/templates$ touch base.html<br />catfoss@catfoss-desktop:/secproj/templates$ cd ..<br />catfoss@catfoss-desktop:/secproj/web$ touch admin.py<br />catfoss@catfoss-desktop:/secproj/web$ touch urls.py</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />secproj/web urls.py<br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>from django.conf.urls.defaults import *</p>
<p>urlpatterns = patterns(&#8216;secproj.web.views&#8217;,</p>
<p>&nbsp;&nbsp;&nbsp; url(r&#8217;^student/$&#8217;, &#8216;syudent&#8217;, name=&#8217;student&#8217;),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />secproj/web /models.py</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>from django.db import models<br />from django.utils.translation import gettext as _</p>
<p>class Student(models.Model):<br />&nbsp;&nbsp;&nbsp; fname = models.CharField(_(&#8220;First Name&#8221;),max_length=30,unique=True)<br />&nbsp;&nbsp;&nbsp; lname = models.CharField(_(&#8220;Last Name&#8221;),max_length=30,blank=True,null=True)<br />&nbsp;&nbsp;&nbsp; age = models.IntegerField(_(&#8220;Age&#8221;))<br />&nbsp;&nbsp;&nbsp; address = models.CharField(_(&#8220;Address&#8221;),max_length=200,blank=True,null=True)<br />&nbsp;&nbsp;&nbsp; GENDER_CHOICES = (<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&#8216;M&#8217;, &#8216;Male&#8217;),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&#8216;F&#8217;, &#8216;Female&#8217;),<br />&nbsp;&nbsp;&nbsp;&nbsp; )<br />&nbsp;&nbsp;&nbsp; gender = models.CharField(max_length=1, choices=GENDER_CHOICES)<br />&nbsp;&nbsp;&nbsp; email = models.EmailField()<br />&nbsp;&nbsp;&nbsp; mark&nbsp; = models.IntegerField(_(&#8220;Mark&#8221;))</p>
<p># Create your models here.<br />def __unicode__(self):<br />&nbsp;&nbsp;&nbsp; return _(u&#8221;%(fname)s %(lname)s %(age)s %(address)s %(mark)s&#8221;) %{ &#8216;fname&#8217; :self.fname,&#8217;lname&#8217; : self.lname, &#8216;age&#8217; : self.age,&#8217;address&#8217; : self.address, &#8216;mark&#8217; : self.mark&nbsp; }</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />secproj/web /views.py<br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p># Create your views here.<br />from secproj.web.models import *<br />from django.http import HttpResponse, Http404,HttpResponseRedirect<br />from django.http import HttpResponseNotFound<br />from django.shortcuts import render_to_response, get_object_or_404<br />from django.template import Context,loader,RequestContext</p>
<p>def student(request):<br />&nbsp;&nbsp;&nbsp; &#8220;&#8221;"a view to show all persons&#8221;"&#8221;<br />&nbsp;&nbsp;&nbsp; student=Student.objects.all()<br />&nbsp;&nbsp;&nbsp; return render_to_response(&#8216;web/student.html&#8217;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context_instance=RequestContext(request,{&#8216;student&#8217;: student}))</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=12&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2010/04/30/django-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
		<item>
		<title>django notes</title>
		<link>http://naveenbos.wordpress.com/2010/04/30/django-notes/</link>
		<comments>http://naveenbos.wordpress.com/2010/04/30/django-notes/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 05:25:33 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://naveenbos.wordpress.com/?p=5</guid>
		<description><![CDATA[webserver:- apache,nginx,cheroker,lighthttpd Virtual hosting one web server had many domain names,by virtualhosting, ssh,scp version control, we need subversion,mercurial,git,bazaar setting up email bug/issue tracker ssh http://bitbucket.org change -test, save, commit, push -repos-update,pull,remote linux version control is git hg push hg commit -m &#8216;added hello Kochi&#8217; hg pull centrslized version control :- have centralized repostory pbm:-no internet [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=5&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { so-language: zxx } -->webserver:-</p>
<p>apache,nginx,cheroker,lighthttpd</p>
<p>Virtual hosting</p>
<p>one web server had many domain names,by virtualhosting,</p>
<p>ssh,scp</p>
<p>version control,</p>
<p>we need</p>
<p>subversion,mercurial,git,bazaar</p>
<p>setting up email</p>
<p>bug/issue tracker</p>
<p>ssh</p>
<p><a href="http://bitbucket.org/">http://bitbucket.org</a></p>
<p>change -test,</p>
<p>save,</p>
<p>commit,</p>
<p>push -repos-update,pull,remote</p>
<p>linux version control is git</p>
<p>hg push</p>
<p>hg commit -m &#8216;added hello Kochi&#8217;</p>
<p>hg pull</p>
<p>centrslized version control :- have centralized repostory</p>
<p>pbm:-no internet connection,commit rights</p>
<p>distributed version controll:-mercurial,git</p>
<p>create an account in bit bucket.com,naveenbos,pswd catfoss</p>
<p>touch index.html</p>
<p>write code</p>
<p>hg init create repos.</p>
<p>Then the bitbucket</p>
<p>name catfoss</p>
<p>home page of catfoss</p>
<p>hg add index.html</p>
<p>hg status</p>
<p>then we push it into site</p>
<p>hg commit -m &#8216;added index.html&#8217;</p>
<p>hg push <a href="http://bitbucket.org/">http://bitbucket.org/</a><a href="http://bitbucket.org/">root/catfoss</a></p>
<p>mkdir catfosstemp</p>
<p>hg clone <a href="http://bitbucket.org/root/catfoss">http://bitbucket.org/root/catfoss</a></p>
<p>catfoss@catfoss-desktop:~$ mk dir catfoss</p>
<p>mk: command not found</p>
<p>catfoss@catfoss-desktop:~$ mkdir catfoss</p>
<p>catfoss@catfoss-desktop:~$ cd catfoss/</p>
<p>catfoss@catfoss-desktop:~/catfoss$ hg clone http://bitbucket.org/lawgon /catfossabort: &#8216;http://bitbucket.org/lawgon&#8217; does not appear to be an hg repository!</p>
<p>catfoss@catfoss-desktop:~/catfoss$ hg clone http://bitbucket.org/lawgon/catfossdestination directory: catfoss</p>
<p>requesting all changes</p>
<p>adding changesets</p>
<p>adding manifests</p>
<p>adding file changes</p>
<p>added 1 changesets with 1 changes to 1 files</p>
<p>updating working directory</p>
<p>1 files updated, 0 files merged, 0 files removed, 0 files unresolved</p>
<p>catfoss@catfoss-desktop:~/catfoss$ ls</p>
<p>catfoss</p>
<p>catfoss@catfoss-desktop:~/catfoss$ cd catfoss/</p>
<p>catfoss@catfoss-desktop:~/catfoss/catfoss$ ls</p>
<p>index.html</p>
<p>catfoss@catfoss-desktop:~/catfoss/catfoss$ ls</p>
<p>index.html  naveen.html</p>
<p>catfoss@catfoss-desktop:~/catfoss/catfoss$ hg add naveen.html</p>
<p>catfoss@catfoss-desktop:~/catfoss/catfoss$ hg status</p>
<p>A naveen.html</p>
<p>? index.html~</p>
<p>catfoss@catfoss-desktop:~/catfoss/catfoss$ hg push -f</p>
<p>pushing to http://bitbucket.org/lawgon/catfoss</p>
<p>searching for changes</p>
<p>http authorization required</p>
<p>realm: Bitbucket.org HTTP</p>
<p>user: naveenbos</p>
<p>password:</p>
<p>adding changesets</p>
<p>adding manifests</p>
<p>adding file changes</p>
<p>added 1 changesets with 1 changes to 1 files (+1 heads)</p>
<p>bb/acl: naveenbos is allowed. accepted payload.</p>
<p>quota: 4.9 MB in use, 1.0 GB available (0.48% used)</p>
<p>rm -rf catfoss   for removing directory</p>
<p>catfoss@catfoss-desktop:~/catfoss$ hg merge 48</p>
<p>1 files updated, 0 files merged, 0 files removed, 0 files unresolved</p>
<p>(branch merge, don&#8217;t forget to commit)</p>
<p>catfoss@catfoss-desktop:~/catfoss$ hg commit -m &#8216;merge 48&#8242; -u naveenbos</p>
<p>dns</p>
<p><a href="http://www.everydns.com/">http://www.everydns.com/</a></p>
<p>/etc/nginx</p>
<p>ngnix.conf</p>
<p>catfoss@catfoss-desktop:~$ cd /etc/nginx/</p>
<p>catfoss@catfoss-desktop:/etc/nginx$ ls</p>
<p>conf.d  fastcgi_params  koi-utf  koi-win  mime.types  nginx.conf  sites-available  sites-enabled  win-utf</p>
<p>catfoss@catfoss-desktop:/etc/nginx$ cd sites-available/</p>
<p>catfoss@catfoss-desktop:/etc/nginx/sites-available$ ls</p>
<p>default</p>
<p>ln -s /etc/nginx/sites-available/catfoss /etc/nginx/foss</p>
<p>then</p>
<p>/etc/init.d/nginx restart</p>
<p><strong>20/4/2010</strong></p>
<p>1.choose a name  :like   &#8212; mysite.catfoss</p>
<p>2.point DNS to your server 127.0.0.1</p>
<p>3.Add virtual host to webserver</p>
<p>4.make the site</p>
<p>vim/etc/init.d/hosts in this file add naveen.web</p>
<p>that name is our localhost then take the browser and give <a href="http://naveen.web/">http://naveen.web</a></p>
<p>]root@catfoss-desktop:/# rm /etc/apache2/sites-available/default</p>
<p>root@catfoss-desktop:/# ls /etc/apache2/sites-available/default</p>
<p>ls: cannot access /etc/apache2/sites-available/default: No such file or directory</p>
<p>root@catfoss-desktop:/# ls /etc/apache2/sites-available/</p>
<p>default-ssl</p>
<p>root@catfoss-desktop:/# rm /etc/apache2/sites-available/</p>
<p>rm: cannot remove `/etc/apache2/sites-available/&#8217;: Is a directory</p>
<p>root@catfoss-desktop:/# rm /etc/apache2/sites-available/default-ssl</p>
<p>root@catfoss-desktop:/# ln -s /etc/apache2/sites-available/naveen.web /etc/ap</p>
<p>apache2/    apm/        apparmor/   apparmor.d/ apport/     apt/</p>
<p>root@catfoss-desktop:/# ln -s /etc/apache2/sites-available/naveen.web /etc/apache2/sites-enabled/naveen.web</p>
<p>root@catfoss-desktop:/# vim /etc/apache2/sites-enabled/</p>
<p>000-default  naveen.web</p>
<p>root@catfoss-desktop:/# vim /etc/apache2/sites-enabled/naveen.web</p>
<p>root@catfoss-desktop:/# rm /etc/apache2/sites-enabled/000-default</p>
<p>root@catfoss-desktop:/# ln -s /etc/apache2/sites-available/naveen.web /etc/apache2/sites-enabled/naveen.web</p>
<p>ln: creating symbolic link `/etc/apache2/sites-enabled/naveen.web&#8217;: File exists</p>
<p>root@catfoss-desktop:/#  /etc/apache2/restrat</p>
<p>bash: /etc/apache2/restrat: No such file or directory</p>
<p>root@catfoss-desktop:/#  /etc/init.d/apache2 restrt</p>
<p>* Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}</p>
<p>root@catfoss-desktop:/#  /etc/init.d/apache2 restart</p>
<p>* Restarting web server apache2                                                apache2: Could not reliably determine the server&#8217;s fully qualified domain name, using 127.0.1.1 for ServerName</p>
<p>[Tue Apr 20 10:25:18 2010] [warn] NameVirtualHost *:80 has no VirtualHosts</p>
<p>&#8230; waiting apache2: Could not reliably determine the server&#8217;s fully qualified domain name, using 127.0.1.1 for ServerName</p>
<p>[Tue Apr 20 10:25:19 2010] [warn] NameVirtualHost *:80 has no VirtualHosts</p>
<p>[ OK ]</p>
<p>/etc/hosts</p>
<p>127.0.0.1       localhost</p>
<p>127.0.0.1       naveen.web</p>
<p>127.0.0.1	bos</p>
<p>127.0.1.1       catfoss-desktop</p>
<p># The following lines are desirable for IPv6 capable hosts</p>
<p>::1     localhost ip6-localhost ip6-loopback</p>
<p>fe00::0 ip6-localnet</p>
<p>ff00::0 ip6-mcastprefix</p>
<p>ff02::1 ip6-allnodes</p>
<p>ff02::2 ip6-allrouters</p>
<p>ff02::3 ip6-allhosts</p>
<p>~</p>
<p>root@catfoss-desktop:/# vim /etc/nginx/sites-available/cv</p>
<p>server {</p>
<p>listen   80;</p>
<p>server_name bos;</p>
<p>location / {</p>
<p>root   /home/catfoss/;</p>
<p>}</p>
<p>}</p>
<p>~</p>
<p>root@catfoss-desktop:/# ln -s /etc/nginx/sites-available/cv /etc/nginx/sites-enabled/cv</p>
<p>root@catfoss-desktop:/# /etc/init.d/nginx restart</p>
<p><a href="http://www.linuxjournal.com/article/10108">http://www.linuxjournal.com/article/10108</a></p>
<p><a href="http://www.amk.ca/python/howto/regex/regex.html#SECTIONooo7200000000000000000">http://www.amk.ca/python/howto/regex/regex.html#SECTIONooo7200000000000000000</a></p>
<p><a href="http://workaround.org/ispmail/lenny">http://workaround.org/ispmail/lenny</a></p>
<p>&gt;&gt;&gt; import urllib</p>
<p>&gt;&gt;&gt; import re</p>
<p>&gt;&gt;&gt; pat = re.compile(r&#8217;html&#8217;)</p>
<p>&gt;&gt;&gt; st = urllib.urlopen(&#8216;http://au-kbc.in&#8217;)</p>
<p>&gt;&gt;&gt; m = pat.findall(st.read())</p>
<p>&gt;&gt;&gt; len(m)</p>
<p>21</p>
<p>import urllib</p>
<p>import math</p>
<p>page=urllib.urlopen(&#8216;http://google.com/&#8217;).read()</p>
<p>print page.count(&#8220;html&#8221;)</p>
<p>catfoss@catfoss-desktop:~$ python test.py</p>
<p>5</p>
<p><a href="http://workaround.org/ispmail/lenny/configure-dovecot">http://workaround.org/ispmail/lenny/configure-dovecot</a></p>
<p>templates</p>
<p>models</p>
<p>urls</p>
<p>views</p>
<p>database</p>
<p><strong>21/4/2010</strong></p>
<p><span style="font-size:medium;"><strong>django</strong></span></p>
<p><span style="font-size:medium;"><a href="http://docs.djangoproject.com/en/1.1/topics/install/#installing-development-version"><span style="font-size:small;">http://docs.djangoproject.com/en/1.1/topics/install/#installing-development-version</span></a></span></p>
<p><span style="font-size:small;">for installing django we use this command</span></p>
<pre><span style="font-size:medium;"><a href="http://workaround.org/ispmail/lenny/configure-dovecot"><span style="font-size:small;">svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk</span></a></span></pre>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss# ln -s /home/catfoss/django-trunk/django/ /usr/lib/python2.6/dist-packages/ </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss# /home/catfoss/django-trunk/django/bin/django-admin.py startproject firstproject </span></p>
<p><span style="font-size:small;">startproject project name</span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss# cd firstproject/ </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# ls </span></p>
<p><span style="font-size:small;">__init__.py  manage.py  settings.py  urls.py </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# python manage.py startapp web </span></p>
<p><span style="font-size:small;">You have new mail in /var/mail/root </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# ls </span></p>
<p><span style="font-size:small;">__init__.py  __init__.pyc  manage.py  settings.py  settings.pyc  urls.py  web </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# cd web/ </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject/web# ls </span></p>
<p><span style="font-size:small;">__init__.py  models.py  tests.py  views.py </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject/web# ls </span></p>
<p><span style="font-size:small;">__init__.py  models.py  tests.py  views.py </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# ls </span></p>
<p><span style="font-size:small;">__init__.py  __init__.pyc  manage.py  settings.py  settings.pyc  urls.py  web </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# gedit settings.py </span></p>
<p><span style="font-size:small;">inthe stting .py </span></p>
<p><span style="font-size:small;">weuse the python so we need mysqldb</span></p>
<p><span style="font-size:small;">&gt;&gt;&gt; import MySQLdb </span></p>
<p><span style="font-size:small;">in postgers sql it is psycopgz</span></p>
<p><span style="font-size:small;">inthe urls.py file edit it like this</span></p>
<p><span style="font-size:small;">from django.conf.urls.defaults import * </span></p>
<p><span style="font-size:small;"># Uncomment the next two lines to enable the admin: </span></p>
<p><span style="font-size:small;">from django.contrib import admin </span></p>
<p><span style="font-size:small;">admin.autodiscover() </span></p>
<p><span style="font-size:small;">urlpatterns = patterns(&#8221;, </span></p>
<p><span style="font-size:small;"># Example: </span></p>
<p><span style="font-size:small;">(r&#8217;^firstproject/&#8217;, include(&#8216;firstproject.web.urls&#8217;)), </span></p>
<p><span style="font-size:small;"># Uncomment the admin/doc line below and add &#8216;django.contrib.admindocs&#8217; </span></p>
<p><span style="font-size:small;"># to INSTALLED_APPS to enable admin documentation: </span></p>
<p><span style="font-size:small;"># (r&#8217;^admin/doc/&#8217;, include(&#8216;django.contrib.admindocs.urls&#8217;)), </span></p>
<p><span style="font-size:small;"># Uncomment the next line to enable the admin: </span></p>
<p><span style="font-size:small;">(r&#8217;^admin/&#8217;, include(admin.site.urls)), </span></p>
<p><span style="font-size:small;">)</span></p>
<p><span style="font-size:small;">type it like this we get like this</span></p>
<p><span style="font-size:small;">create folder templates</span></p>
<p><span style="font-size:small;"><strong>root@catfoss-desktop:/home/catfoss/firstproject# python manage.py runserver </strong></span></p>
<p><span style="font-size:small;">Validating models&#8230; </span></p>
<p><span style="font-size:small;">0 errors found </span></p>
<p><span style="font-size:small;">Django version 1.2 beta 1 SVN-13009, using settings &#8216;firstproject.settings&#8217; </span></p>
<p><span style="font-size:small;">Development server is running at http://127.0.0.1:8000/ </span></p>
<p><span style="font-size:small;">Quit the server with CONTROL-C. </span></p>
<p><span style="font-size:small;">[21/Apr/2010 00:57:12] &#8220;GET / HTTP/1.1&#8243; 500 58339 </span></p>
<p><span style="font-size:small;">[21/Apr/2010 00:58:19] &#8220;GET / HTTP/1.1&#8243; 404 1959 </span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/home/catfoss/firstproject# python manage.py syncdb </span></p>
<p><span style="font-size:small;">Creating table django_session </span></p>
<p><span style="font-size:small;">Creating table django_admin_log </span></p>
<p><span style="font-size:small;">Creating table django_site </span></p>
<p><span style="font-size:small;">Creating table auth_permission </span></p>
<p><span style="font-size:small;">Creating table auth_group_permissions </span></p>
<p><span style="font-size:small;">Creating table auth_group </span></p>
<p><span style="font-size:small;">Creating table auth_user_user_permissions </span></p>
<p><span style="font-size:small;">Creating table auth_user_groups </span></p>
<p><span style="font-size:small;">Creating table auth_user </span></p>
<p><span style="font-size:small;">Creating table auth_message </span></p>
<p><span style="font-size:small;">Creating table django_content_type </span></p>
<p><span style="font-size:small;">You just installed Django&#8217;s auth system, which means you don&#8217;t have any superusers defined. </span></p>
<p><span style="font-size:small;">Would you like to create one now? (yes/no): yes </span></p>
<p><span style="font-size:small;">Username (Leave blank to use &#8216;root&#8217;): </span></p>
<p><span style="font-size:small;">E-mail address: naveen.bos@gmail.com </span></p>
<p><span style="font-size:small;">Password: </span></p>
<p><span style="font-size:small;">Password (again): </span></p>
<p><span style="font-size:small;">Superuser created successfully. </span></p>
<p><span style="font-size:small;">Installing index for admin.LogEntry model </span></p>
<p><span style="font-size:small;">Installing index for auth.Permission model </span></p>
<p><span style="font-size:small;">Installing index for auth.Group_permissions model </span></p>
<p><span style="font-size:small;">Installing index for auth.User_user_permissions model </span></p>
<p><span style="font-size:small;">Installing index for auth.User_groups model </span></p>
<p><span style="font-size:small;">Installing index for auth.Message model </span></p>
<p><span style="font-size:small;">No fixtures found. </span></p>
<p><span style="font-size:small;">You have new mail in /var/mail/root </span></p>
<p><span style="font-size:small;">where touch admin.py</span></p>
<p><span style="font-size:small;">im the admin.py<br />
</span></p>
<p><span style="font-size:small;">from django.contrib import admin </span></p>
<p><span style="font-size:small;">from firstproject.web.models import * </span></p>
<p><span style="font-size:small;">admin.site.register(Person)</span></p>
<p><span style="font-size:small;">inthe web folder we create models.py</span></p>
<p><span style="font-size:small;">from django.db import models </span></p>
<p><span style="font-size:small;">from django.utils.translation import gettext as _ </span></p>
<p><span style="font-size:small;"># Create your models here. </span></p>
<p><span style="font-size:small;">class Person(models.Model): </span></p>
<p><span style="font-size:small;">fname = models.CharField(_(&#8220;First Name&#8221;),max_length=30,unique=True) </span></p>
<p><span style="font-size:small;">lname = models.CharField(_(&#8220;Last Name&#8221;),max_length=30,blank=True) </span></p>
<p><span style="font-size:small;">age = models.IntegerField(_(&#8220;Age&#8221;)) </span></p>
<p><span style="font-size:small;">def __unicode__(self): </span></p>
<p><span style="font-size:small;">return _(u&#8221;%(fname)s %(lname)s %(age)s&#8221;) %{ &#8216;fname&#8217; :self.fname,&#8217;lname&#8217; : self.lname, &#8216;age&#8217; : self.age}</span></p>
<p><span style="font-size:medium;"><a href="http://docs.djangoproject.com/en/dev/ref/models/fields/"><span style="font-size:small;">http://docs.djangoproject.com/en/dev/ref/models/fields/</span></a></span></p>
<p><span style="font-size:small;">views.py</span></p>
<p><span style="font-size:small;"># Create your views here. </span></p>
<p><span style="font-size:small;">from firstproject.web.models import * </span></p>
<p><span style="font-size:small;">from django.http import HttpResponse, Http404,HttpResponseRedirect </span></p>
<p><span style="font-size:small;">from django.http import HttpResponseNotFound </span></p>
<p><span style="font-size:small;">from django.shortcuts import render_to_response, get_object_or_404 </span></p>
<p><span style="font-size:small;">from django.template import Context,loader,RequestContext </span></p>
<p><span style="font-size:small;">def persons(request): </span></p>
<p><span style="font-size:small;">&#8220;&#8221;"a view to show all persons&#8221;"&#8221; </span></p>
<p><span style="font-size:small;">persons=Person.objects.all() </span></p>
<p><span style="font-size:small;">return render_to_response(&#8216;web/persons.html&#8217;, </span></p>
<p><span style="font-size:small;">context_instance=RequestContext(request,{&#8216;persons&#8217;: persons}))</span></p>
<p><span style="font-size:small;">admin.py</span></p>
<p><span style="font-size:small;">from django.db import models </span></p>
<p><span style="font-size:small;">from django.utils.translation import gettext as _ </span></p>
<p><span style="font-size:small;"># Create your models here. </span></p>
<p><span style="font-size:small;">class Person(models.Model): </span></p>
<p><span style="font-size:small;">fname = models.CharField(_(&#8220;First Name&#8221;),max_length=30,unique=True) </span></p>
<p><span style="font-size:small;">lname = models.CharField(_(&#8220;Last Name&#8221;),max_length=30,blank=True,null=True) </span></p>
<p><span style="font-size:small;">age = models.IntegerField(_(&#8220;Age&#8221;)) </span></p>
<p><span style="font-size:small;">def __unicode__(self): </span></p>
<p><span style="font-size:small;">return _(u&#8221;%(fname)s %(lname)s %(age)s&#8221;) %{ &#8216;fname&#8217; :self.fname,&#8217;lname&#8217; : self.lname, &#8216;age&#8217; : self.age} </span></p>
<p><span style="font-size:small;">class Address(models.Model): </span></p>
<p><span style="font-size:small;">address = models.CharField(_(&#8220;Address&#8221;),max_length=200,blank=True,null=True) </span></p>
<p><span style="font-size:small;">phno = models.CharField(_(&#8220;Phno&#8221;),max_length=15,blank=True,null=True) </span></p>
<p><span style="font-size:small;">def __unicode__(self): </span></p>
<p><span style="font-size:small;">return _(u&#8221;%(address)s %(phno)s &#8220;) %{  &#8216;address&#8217; : self.address, &#8216;phno&#8217; : self.phno, } </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ mkdir templates </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ touch base.html </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ cd templates/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates$ touch base.html </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates$ mkdir web </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates$ cd web/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates/web$ touch persons.html</span></p>
<p><span style="font-size:small;">base.html</span></p>
<p><span style="font-size:small;">&lt;html&gt;&lt;head&gt;&lt;title&gt;Welcome to person&lt;/title&gt; </span></p>
<p><span style="font-size:small;">&lt;/head&gt; </span></p>
<p><span style="font-size:small;">&lt;body&gt; </span></p>
<p><span style="font-size:small;">{% block centercontent %} </span></p>
<p><span style="font-size:small;">{% endblock %} </span></p>
<p><span style="font-size:small;">&lt;p&gt;This is a test site for django&lt;/p&gt; </span></p>
<p><span style="font-size:small;">&lt;/body&gt; </span></p>
<p><span style="font-size:small;">&lt;/html&gt;</span></p>
<p><span style="font-size:small;">persons.html</span></p>
<p><span style="font-size:small;">{% extends &#8216;base.html&#8217; %} </span></p>
<p><span style="font-size:small;">{% block centercontent %} </span></p>
<p><span style="font-size:small;">&lt;ul&gt; </span></p>
<p><span style="font-size:small;">{% for person in persons %} </span></p>
<p><span style="font-size:small;">&lt;li&gt;{{ person.fname }}&lt;/li&gt; </span></p>
<p><span style="font-size:small;">{% endfor %} </span></p>
<p><span style="font-size:small;">&lt;/ul&gt; </span></p>
<p><span style="font-size:small;">{% endblock %}</span></p>
<p><span style="font-size:small;">views.py</span></p>
<p><span style="font-size:small;"># Create your views here. </span></p>
<p><span style="font-size:small;">from firstproject.web.models import * </span></p>
<p><span style="font-size:small;">from django.http import HttpResponse, Http404,HttpResponseRedirect </span></p>
<p><span style="font-size:small;">from django.http import HttpResponseNotFound </span></p>
<p><span style="font-size:small;">from django.shortcuts import render_to_response, get_object_or_404 </span></p>
<p><span style="font-size:small;">from django.template import Context,loader,RequestContext </span></p>
<p><span style="font-size:small;">def persons(request): </span></p>
<p><span style="font-size:small;">&#8220;&#8221;"a view to show all persons&#8221;"&#8221; </span></p>
<p><span style="font-size:small;">persons=Person.objects.all() </span></p>
<p><span style="font-size:small;">return render_to_response(&#8216;web/persons.html&#8217;, </span></p>
<p><span style="font-size:small;">context_instance=RequestContext(request,{&#8216;persons&#8217;: persons}))</span></p>
<p><span style="font-size:small;">install  mod-wsgi</span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~$ mkdir media </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~$ cd media/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/media$ mkdir image </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/media$ cd .. </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~$ chown -R www-data:www-data media/ </span></p>
<p><span style="font-size:small;">chown: changing ownership of `media/image&#8217;: Operation not permitted </span></p>
<p><span style="font-size:small;">chown: changing ownership of `media/&#8217;: Operation not permitted </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~$ sudo chown -R www-data:www-data media/ </span></p>
<p><span style="font-size:small;">[sudo] password for catfoss: </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~$ ls -a /media/ </span></p>
<p><span style="font-size:small;">.  ..  cdrom  cdrom0 </span></p>
<p><span style="font-size:small;"><span style="font-size:medium;"><strong>day-5</strong></span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>django returns</p>
<p>working over firstproj:</p>
<p>at setting.py:</p>
<p>MEDIA_ROOT = &#8216;/home/mur/media&#8217;<br />
MEDIA_URL = &#8216;<a href="http://firstproj.web/sitemedia/%27">http://firstproj.web/sitemedia/&#8217;</a></p>
<p>insert at models.py:</p>
<p>class Picture(models.Model):<br />
name = models.CharField(_(&#8221; Name&#8221;),max_length=30,unique=True)<br />
photo = models.ImageField(_(&#8220;Photo&#8221;),upload_to=&#8217;images/&#8217;,blank=True,null=True)</p>
<p>def __unicode__(self):<br />
return _(u&#8221;%(name)s&#8221;) %{&#8216;name&#8217;: self.name}</p>
<p>insert at admin.py:</p>
<p>admin.site.register(Picture)</p>
<p>insert at view.py:</p>
<p>def pictures(request):<br />
&#8220;&#8221;"a view to show all pictures&#8221;"&#8221;<br />
pictures=Picture.objects.all()<br />
return render_to_response(&#8216;web/pictures.html&#8217;,<br />
context_instance=RequestContext(request,{&#8216;pictures&#8217;: pictures}))</p>
<p>insert at urls.py</p>
<p>url(r&#8217;^pictures/$&#8217;, &#8216;pictures&#8217;, name=&#8217;pictures&#8217;),</p>
<p>create a new file at templetes/web/ named pictures.html</p>
<p>{% extends &#8216;base.html&#8217; %}<br />
{% block centercontent %}<br />
&lt;ul&gt;<br />
{% for picture in pictures %}<br />
&lt;li&gt;&lt;img src={{picture.photo.url}}/&gt;{{ picture.name }}&lt;/li&gt;<br />
{% endfor %}<br />
&lt;/ul&gt;<br />
{% endblock %}</p>
<p></span></p>
<p><span style="font-size:small;"><strong>create a file in the catfoss fistproject,apache django.wsgi</strong></span></p>
<p><span style="font-size:small;">import os, sys </span></p>
<p><span style="font-size:small;">sys.path.append(&#8216;/home/catfoss/&#8217;) </span></p>
<p><span style="font-size:small;">os.environ['DJANGO_SETTINGS_MODULES'] = &#8216;firstproject.settings&#8217; </span></p>
<p><span style="font-size:small;">import django.core.handlers.wsgi </span></p>
<p><span style="font-size:small;">application = django.core.handlers.wsgi.WSGIHandler()</span></p>
<p><span style="font-size:small;">root@catfoss-desktop:/var/log/apache2# tail -f access.log </span></p>
<p><span style="font-size:small;">edit the settings.py in media url like these</span></p>
<p><span style="font-size:small;">MEDIA_URL = &#8216;http://naveen.web/smedia/&#8217; </span></p>
<p><span style="font-size:small;"># URL prefix for admin media &#8212; CSS, JavaScript and images. Make sure to use a </span></p>
<p><span style="font-size:small;"># trailing slash. </span></p>
<p><span style="font-size:small;"># Examples: &#8220;http://foo.com/media/&#8221;, &#8220;/media/&#8221;. </span></p>
<p><span style="font-size:small;">ADMIN_MEDIA_PREFIX = &#8216;/media/&#8217; </span></p>
<p><span style="font-size:small;"><a href="http://dpaste.com/">http://dpaste.com</a></span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ hg init </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ hg add urls.py </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ hg add models.py </span></p>
<p><span style="font-size:small;">models.py: No such file or directory </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ hg add web/models.py </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ cd web/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/web$ hg add admin.py </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/web$ hg add views.py </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/web$ hg add tests.py </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/web$ hg add __init__.py </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/web$ cd .. </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject$ cd templates/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates$ cd web/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates/web$ hg add person </span></p>
<p><span style="font-size:small;">person.html    person.html~   persons.html   persons.html~ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates/web$ hg add person.html </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates/web$ hg add persons.html </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates/web$ cd .. </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates$ cd web/ </span></p>
<p><span style="font-size:small;">catfoss@catfoss-desktop:~/firstproject/templates/web$ hg add pictures.html </span></p>
<p><span style="font-size:small;"><strong>for finding the encrypted password </strong></span></p>
<p><span style="font-size:small;"><strong>perl -MMIME::Base64 -e \<br />
&#8216;print encode_base64(&#8220;john\@example.comjohn\@example.compassword&#8221;)&#8217;;</strong></span></p>
<p><span style="font-size:small;"><strong>ubuntu repostories changes</strong></span></p>
<p><span style="font-size:small;"><strong><a href="https://help.ubuntu.com/community/Repositories/Ubuntu#CD-ROM/DVD">https://help.ubuntu.com/community/Repositories/Ubuntu#CD-ROM/DVD</a></strong></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=5&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2010/04/30/django-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://naveenbos.wordpress.com/2009/11/18/hello-world/</link>
		<comments>http://naveenbos.wordpress.com/2009/11/18/hello-world/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 09:46:59 +0000</pubDate>
		<dc:creator>naveenbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=1&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/naveenbos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/naveenbos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/naveenbos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/naveenbos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/naveenbos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/naveenbos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/naveenbos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/naveenbos.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=naveenbos.wordpress.com&amp;blog=10558005&amp;post=1&amp;subd=naveenbos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://naveenbos.wordpress.com/2009/11/18/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7e23b49a79d594f1ed4f9897de42fc4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">naveenbos</media:title>
		</media:content>
	</item>
	</channel>
</rss>
