<?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:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Programming Ideas, Logics, Tips and Tricks &#187; linux</title>
	<atom:link href="http://www.sajithmr.me/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Sat, 07 Apr 2012 16:30:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Jmail++ , My Final Year Project</title>
		<link>http://www.sajithmr.me/jmail-my-final-year-project</link>
		<comments>http://www.sajithmr.me/jmail-my-final-year-project#comments</comments>
		<pubDate>Mon, 14 Apr 2008 11:24:05 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[jmail]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[pop3]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/jmail-my-final-year-project/</guid>
		<description><![CDATA[I am writing this topic in sajithmr.com, because i am getting a lot of queries regarding this project from the place I submitted , ProjectGuidance.com , 3 years back. It was a new Webmail Service Idea Developed in JSP . Here is the link. http://www.projectguidance.com/guidance/details/id/36676649 . There are more than 400 replies and most of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/04/logo.jpg" alt="Jmail++ Logo" style="margin: 10px; float: left" />I am writing this topic in sajithmr.com, because  i am getting a lot of queries regarding this project  from the place I submitted , <a href="http://www.projectguidance.com">ProjectGuidance.com</a> ,  3 years back.  It was a new Webmail Service Idea Developed in JSP . Here is the link. <a href="http://www.projectguidance.com/guidance/details/id/36676649" title="A new Webmail - JSP">http://www.projectguidance.com/guidance/details/id/36676649</a> .</p>
<p>There are more than 400 replies and most of its content is &#8220;please send me the project report to my email address&#8221;.</p>
<blockquote><p>jMail++ is a webmail written in JSP. You can create new Account here like yahoo, gmail etc&#8230;The Session is handled by Single page Auto Invalidate Method..That will increase Your Mail Security. A simple 4 entry Registration process is required.. And your Password will be handle using RSA Encryption method&#8230;There is a Fast Search Mechanism included with Google APIs. The Very Important and Unique Feature is You can Check Your Rediff, Hotmail , Gmail account from this Webmail without login into the respective sites. It means this Webpage act as an Email Client Also (Like OutLook Express). The Protocols (SMTP,POP3) all are implement from Scrach without any API&#8217;s&#8230;Its is a Pure JSP Project.</p></blockquote>
<p>This was the post on <a href="http://www.projectguidance.com">ProjectGuidance.com</a></p>
<p>Here i included the full project report as zip file.</p>
<p><a href="http://www.sajithmr.com/downloads/Jmail-Project-Report.zip" title="Jmail Project Report">Jmail-Project-Report.zip</a></p>
<p><a href="http://www.sajithmr.com/downloads/Jmail-Project-Report.zip" title="Jmail Project Report"><img src="http://www.sajithmr.com/wp-content/uploads/2008/04/winzip_180x180.thumbnail.gif" alt="OpenID Integration PHP" width="73" height="73" /></a></p>
<p>See screen short of this project:</p>
<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/04/homescreen.jpg" alt="Jmail Screen Shot 1" /><br />
(Screenshot 1)</p>
<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/04/composescreen.jpg" alt="Jmail Screen Shot 2" /><br />
(Screen shot 2)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/jmail-my-final-year-project/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>The Tale of Tail (Unix Command)</title>
		<link>http://www.sajithmr.me/tail</link>
		<comments>http://www.sajithmr.me/tail#comments</comments>
		<pubDate>Thu, 06 Mar 2008 15:44:57 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bottom]]></category>
		<category><![CDATA[follow]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[tail]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/tail/</guid>
		<description><![CDATA[The most interesting and useful command i ever used is tail in unix. As the name indicate its duty is to show the last lines of a particular file. When take the case of log files such as error logs, always we have to know the last lines or last updations instead of reading from [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/03/pink_tail.jpg" alt="Unix Tail Function" /></p>
<p><strong><font size="5">T</font></strong>he most interesting and useful command i ever used is <strong>tail</strong> in <strong>unix</strong>. As the name indicate its duty is to show the last lines of a particular file. When take the case of log files such as error logs, always we have to know the last lines or last updations instead of reading from top to bottom or search a full text file.</p>
<p>for its option try this tail &#8211;help</p>
<p><font color="#008000"><strong>tail</strong></font> -n 10 <font color="#ff0000">error.log </font></p>
<p>shows last 10 lines of error.log</p>
<p>The very interesting option is -f , means open the file and follow the last lines.</p>
<p>This is very useful for debugging purpose. For example if you want to check error.log lively, use this option</p>
<p><font color="#008000"><strong>tail</strong></font> -f <font color="#ff0000">error.log</font></p>
<p>it displays last lines and also automatically updates when any changes happens in error.log file. So you can check other operation by tailing and following a particular file .</p>
<p>Try today itself. You will be very much interested, thats my guarantee <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(There is also a similar function &#8216;head&#8217;, you can guess what its use,  google it for more)</p>
<p>Regards</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/tail/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mount NTFS File System in Ubuntu (debian)</title>
		<link>http://www.sajithmr.me/mount-ntfs-file-system-in-ubuntu-debian</link>
		<comments>http://www.sajithmr.me/mount-ntfs-file-system-in-ubuntu-debian#comments</comments>
		<pubDate>Wed, 06 Feb 2008 04:46:55 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/mount-ntfs-file-system-in-ubuntu-debian/</guid>
		<description><![CDATA[Steps: 1) sudo apt-get install ntfs-3g Installs ntfs-3g library 2) sudo fdisk -l Shows all the disk drives 3) sudo mkdir /media/windowsC Create a directory for mounting your NTFS file system 4) sudo cp /etc/fstab /etc/fstab.bak Take a backup of old conf file 5) gksudo gedit /etc/fstab Edit the configuration file 6) /dev/sda2 /media/windowsC ntfs-3g [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sajithmr.me/wp-content/uploads/2008/02/ntfs-1.jpg"><img class="alignnone size-full wp-image-873" title="ntfs-1" src="http://www.sajithmr.me/wp-content/uploads/2008/02/ntfs-1.jpg" alt="" width="300" height="225" /></a></p>
<p>Steps:</p>
<p><span style="color: #99cc00;"><strong> 1) sudo apt-get install ntfs-3g</strong></span></p>
<p><span style="color: #99cc00;"><strong> </strong><span style="color: #000000;">Installs  ntfs-3g library</span></span><br />
<strong><span style="color: #99cc00;"> 2) sudo fdisk -l</span></strong></p>
<p>Shows all the disk drives<br />
<strong><span style="color: #99cc00;">3) sudo mkdir /media/windowsC</span></strong></p>
<p>Create a directory for mounting your NTFS file system</p>
<p><a title="Ubuntu logo" href="http://www.sajithmr.com/wp-content/uploads/2008/02/small-ubuntu.jpg"><img src="http://www.sajithmr.com/wp-content/uploads/2008/02/small-ubuntu.jpg" alt="Ubuntu logo" /></a><br />
<span style="color: #99cc00;"><strong>4) sudo cp /etc/fstab /etc/fstab.bak</strong></span></p>
<p>Take a backup of old conf file</p>
<p><span style="color: #99cc00;"><strong>5) gksudo gedit /etc/fstab</strong></span></p>
<p>Edit the configuration file</p>
<p><strong><span style="color: #99cc00;"> 6) /dev/sda2    /media/windowsC    ntfs-3g    defaults,locale=en_US.utf8    0    0</span></strong></p>
<p>Add the above line to the end of that file. (Here sda2 is the ntfs partition, getting from fdisk -l )</p>
<p>Restart ubuntu and you can see the ntfs filesystem mounted on  <strong><span style="color: #99cc00;">/media/windowsC</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/mount-ntfs-file-system-in-ubuntu-debian/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Please Backup Your Mysql !!!</title>
		<link>http://www.sajithmr.me/please-backup-your-mysql</link>
		<comments>http://www.sajithmr.me/please-backup-your-mysql#comments</comments>
		<pubDate>Fri, 26 Oct 2007 06:01:26 +0000</pubDate>
		<dc:creator>sanil</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[scp]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/please-backup-your-mysql/</guid>
		<description><![CDATA[One day , while i am viewing my website, i got the error message is that, your mysql table has been corrupted. I wonder what happened to my database. I used phpmyadmin for its repair. But no use. Gone is gone !!! All this happened only because of the lack perfect backup of mysql database. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-814" title="mysql_100x52-64" src="http://www.sajithmr.me/wp-content/uploads/2007/10/mysql_100x52-64.gif" alt="mysql_100x52-64" width="100" height="52" /></p>
<p>One day , while i am viewing my website, i got the error message is that, your mysql table has been corrupted. I wonder what happened to my database. I used phpmyadmin for its repair. But no use. Gone is gone !!!</p>
<p>All this happened only because of the lack perfect backup of mysql database. You can backup your mysql database in some simple step. I think you know the mysql command mysqldump. This will create an sql file for your database. See example,</p>
<p><strong>mysqldump</strong> -u&lt;your_db_username&gt; -p&lt;your_db_password&gt; databasename &gt; /path/to/backup.sql</p>
<p>If you want to save this sql backup in a remote server, use<strong> scp</strong> command</p>
<p>scp /path/to/bakup.sql  <a href="mailto:root@yourserverip:/path/to/remote/server">root@yourserverip:/path/to/remote/server</a></p>
<p>This will ask  for your current useraccount&#8217;s password and remote server password. Thus your backup file is saved to a remote server</p>
<p>If you want to take backup periodically , add this command to your cron and execute as you wish , daily, weekly or monthly .</p>
<p>Go and enjoy programming , dont worry about backup, its already taken <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/please-backup-your-mysql/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trac Installation</title>
		<link>http://www.sajithmr.me/trac-installation</link>
		<comments>http://www.sajithmr.me/trac-installation#comments</comments>
		<pubDate>Sat, 20 Oct 2007 08:00:34 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[Setting Permission]]></category>
		<category><![CDATA[Setting trac Authentication]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[Trac Installation]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/trac-installation/</guid>
		<description><![CDATA[Trac is an issue tracking system with wiki support. It also provide interface to subversion. It can be used as Web Subversion. Installation of trac &#62; use apt-get install trac or yum install trac depends on your operating system. user this link for more installation help :http://trac.edgewall.org/wiki/TracDownload After the installation, you have to setup the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-816" title="trac_logo" src="http://www.sajithmr.me/wp-content/uploads/2007/10/trac_logo.png" alt="trac_logo" width="236" height="73" /></p>
<p>Trac is an issue tracking system with wiki support. It also provide interface to subversion. It can be used as Web Subversion.</p>
<p><span style="color: #808000;"><strong>Installation of trac &gt;</strong></span></p>
<p>use<br />
<span style="color: #ff6600;">apt-get install trac </span><br />
or<br />
<span style="color: #ff6600;">yum install trac<br />
</span><br />
depends on your operating system.</p>
<p>user this link for more installation help :<a href="http://trac.edgewall.org/wiki/TracDownload" target="_blank">http://trac.edgewall.org/wiki/TracDownload</a></p>
<p>After the installation, you have to setup the trac Environment Directory. For that create a folder any where in you system.</p>
<p>(<span style="color: #ff6600;">mkdir myenv</span>) and give full permission to that environment (<span style="color: #ff6600;">chmod -R 777 myenv</span>)</p>
<p>To make this directory as your trac environment , use the following command.</p>
<p><span style="color: #ff6600;">trac-admin /path/to/myenv initenv</span></p>
<p>It will ask for name of your project, mysql connection string, type of subverstion, repository path, and template of your trac.</p>
<p>1) Provide a name for your project</p>
<p>2) If you are not using mysql, the trac by default use Sqlite database . Just enter the option for blank</p>
<p>3) Enter type of subversion there. Just type &#8216;svn&#8217; if you are using svn subversion.</p>
<p>4) Enter the path to your repository</p>
<p>5) Leave the template option blank. Lets change that later.</p>
<p>Now your trac environment is ready.</p>
<p>You can change the above configuration form the <span style="color: #0000ff;">trac.ini</span> file in the trac environment folder.</p>
<p>Some useful links :<a href="http://trac.edgewall.org/wiki/TracAdmin" target="_blank"> </a></p>
<p><a href="http://trac.edgewall.org/wiki/TracAdmin" target="_blank">http://trac.edgewall.org/wiki/TracAdmin</a><br />
<a href="http://trac.edgewall.org/wiki/TracIni" target="_blank">http://trac.edgewall.org/wiki/TracIni</a><br />
<a href="http://trac.edgewall.org/wiki/TracEnvironment" target="_blank">http://trac.edgewall.org/wiki/TracEnvironment</a></p>
<p>Now lets start trac as standalone . (There are two more option to start trac)</p>
<p><a href="http://trac.edgewall.org/wiki/TracStandalone" target="_blank">http://trac.edgewall.org/wiki/TracStandalone</a></p>
<p>For that you can use tracd</p>
<p>eg: <span style="color: #ff6600;">tracd -p 8080 /path/to/projectenv</span></p>
<p>here -p is your portnumber.</p>
<p>If you want to set your hostname also use,</p>
<p><span style="color: #ff6600;">tracd &#8211;hostname=localhost -p 8080 /path/to/project</span></p>
<p>For starting tracd as a daemon , use -d option<br />
eg: <span style="color: #ff6600;">tracd -d -p 8080 /path/to/projectenv</span></p>
<p>if you want to add more than one project through a single port , use</p>
<p><span style="color: #ff6600;">tracd -p 8080 /path/to/project1 /path/to/project2</span></p>
<p>another way to start multiple project trac is :</p>
<p><span style="color: #ff6600;"> tracd -p 8080 -e /path/to/parentenv</span></p>
<p><span id="more-93"></span></p>
<p><span style="color: #339966;"><strong>Setting trac Authentication &gt;&gt;&gt;<br />
</strong></span><br />
<span style="color: #ff6600;">tracd -p 8080 &#8211;auth /path/to/project1env,/path/to/users.htdigest,mycompany.com /path/to/project1env</span></p>
<p>where users.htdigest is the password digest file of user accounts, and mycompany.com is the realm which set when creating the password digest.</p>
<p>How can i create the  users.htdigest file.</p>
<p>this link will help you for that :<a href="http://httpd.apache.org/docs/2.0/programs/htdigest.html" target="_blank"> http://httpd.apache.org/docs/2.0/programs/htdigest.html</a></p>
<p>the command for creating user htdigest file is :</p>
<p><span style="color: #ff6600;">htdigest [ -c ] passwdfile realm username</span></p>
<p>where -c option is for creating new file, by overwriting old one (if exists)</p>
<p>for adding more users avoid the -c part</p>
<p><span style="color: #99cc00;"><strong>Setting Permission &gt;&gt;</strong></span></p>
<p><span style="color: #ff6600;">trac-admin /path/to/projenv permission add bob TRAC_ADMIN</span></p>
<p>For giving permission to users you can use this link:</p>
<p><a href="http://trac.edgewall.org/wiki/TracPermissions" target="_blank">http://trac.edgewall.org/wiki/TracPermissions</a><br />
<a href="http://lists.nexusformat.org/pipermail/nexus-developers/2006/000696.html" target="_blank"> http://lists.nexusformat.org/pipermail/nexus-developers/2006/000696.html</a></p>
<p>Mail me for any queris to: admin@sajithmr.com</p>
<p>Thanks and Regards<br />
Sajith.M.R</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/trac-installation/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SVN &#8211; Subversion</title>
		<link>http://www.sajithmr.me/svn-subversion</link>
		<comments>http://www.sajithmr.me/svn-subversion#comments</comments>
		<pubDate>Fri, 19 Oct 2007 06:50:07 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/svn-subversion/</guid>
		<description><![CDATA[Setup Subversion (svn) &#62;&#62; Depends on your linux version use package managers apt-get install subversion or yum install subversion How can i create respository ? Create a folder which you want to make as repository. svnadmin create /path/to/folder If you check the folder after this comment, you can see some files there viz conf dav [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-826" title="svn1" src="http://www.sajithmr.me/wp-content/uploads/2007/10/svn1-300x225.png" alt="svn1" width="300" height="225" /></p>
<p><strong>Setup Subversion (svn) &gt;&gt;<br />
</strong><br />
Depends on your linux version use package managers<br />
apt-get install subversion<br />
or<br />
yum install subversion</p>
<p><span style="color: #ff6600;"><strong>How can i create respository ?</strong></span></p>
<p>Create a folder which you want to make as repository.</p>
<p>svnadmin create  /path/to/folder</p>
<p>If you check the folder after this comment, you can see some files there viz<br />
conf  dav  db  format  hooks  locks  README.txt</p>
<p>Your Repository is okay now.  For more <a title="Tigris Subversion" href="http://subversion.tigris.org/project_packages.html" target="_blank">http://subversion.tigris.org/project_packages.html</a></p>
<p><strong><span style="color: #ff6600;">How can i set a port and host for checkin/checkout and commit the project , simply add contents to respository ?</span></strong></p>
<p>You can use svnserve for this purpose.</p>
<p>svnserve -d -r /path/to/repository</p>
<p>This will listen the default port 3690. You can access this repository via svn://hostname.com</p>
<p>You can use options &#8211;listen-port and &#8211;listen-host for changing the port and host .</p>
<p>Then the svn checkout action will be like this : svn checkout svn://host.example.com/project1</p>
<p><span style="color: #ff6600;"><strong>How can I set Authentication to this repository ??</strong></span></p>
<p>You can see a conf directory in your repository folder. There you can see three files<br />
authz,  passwd,  svnserve.conf</p>
<p>edit svnserve.conf</p>
<p>Uncomment the following for setting access control:</p>
<p>anon-access = read  // This means anybody can read the repository (checkout)<br />
auth-access = write  // Only authorized member can write / update repository</p>
<p>anon-access = none  // This means only authorized member can read the repository</p>
<p><span id="more-85"></span><br />
<span style="color: #ff6600;"><strong> How can i set Access Control ? </strong></span></p>
<p>uncomment the following line</p>
<p>password-db = passwd</p>
<p>where userfile is the file which contains username and passwords for the repository</p>
<p>eg of passwd :</p>
<p>[users]<br />
sajith = pass123<br />
jilmon = mypassword<br />
vivian = passworrd<br />
balu   = testpass</p>
<p>Then come to the last part of configuration file. It is</p>
<p>authz-db = authz (svnserve.conf)</p>
<p>lets see what is inside authz</p>
<p>eg:</p>
<p>folder wise permission</p>
<p>[/]<br />
sajith = rw<br />
vivian = r<br />
jilmon = r<br />
balu = rw</p>
<p>(above permission is for whole the repository)<br />
You can use * for all</p>
<p>eg:<br />
[/]<br />
* = rw</p>
<p>For more : <a href="http://svnbook.red-bean.com/en/1.0/ch06s03.html" target="_blank">http://svnbook.red-bean.com/en/1.0/ch06s03.html</a></p>
<p>A sample svn client : <a title="Tortoise SVN" href="http://tortoisesvn.tigris.org/" target="_blank">http://tortoisesvn.tigris.org/</a></p>
<p><img src="http://www.sajithmr.com/wp-content/uploads/2007/10/svn.png" alt="svn subversion" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/svn-subversion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do OS programming…Get the essence of programming</title>
		<link>http://www.sajithmr.me/do-os-programming%e2%80%a6get-the-essence-of-programming-2</link>
		<comments>http://www.sajithmr.me/do-os-programming%e2%80%a6get-the-essence-of-programming-2#comments</comments>
		<pubDate>Fri, 15 Jun 2007 14:04:08 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/?p=18</guid>
		<description><![CDATA[Operating system level programming has a different taste than any other programming. It is very simple to understand the operating systems layers if you do os programming in linux. You can start that with system calls such as fork, pipe, memget, kill etc . For example, you know pipe. In linux command prompt ‘&#124;’ is [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-741" title="osprogramming.thumbnail" src="http://www.sajithmr.me/wp-content/uploads/2007/06/osprogramming.thumbnail.jpg" alt="osprogramming.thumbnail" width="81" height="96" /></p>
<p>Operating system level programming has a different taste than any other<br />
programming. It is very simple to understand the operating systems layers if<br />
you do os programming in linux. You can start that with system calls such as<br />
fork, pipe, memget, kill etc .</p>
<p>For example, you know pipe. In linux command prompt ‘|’<br />
is using for pipe. For example ls is the command for list the directory …<br />
ls | more means ?? It means give the output of ls command to more command. “more”<br />
command’s input will be the output of “ls” command. Here the<br />
output and input are piped. Standard input and output are changed.<br />
(“more” command is using for showing page by page data)</p>
<p>Example Code:</p>
<p>Click read more for sample code</p>
<p><span id="more-18"></span></p><pre class="crayon-plain-tag"><code>#include 
#include 
#include 
#include 

int main(){

pid_t pid;
int rv;
int commpipe[2]; /* This holds the fd for the input &amp;amp; output of the pipe
*/

/* Setup communication pipeline first */
if(pipe(commpipe)){
fprintf(stderr,&quot;Pipe error!\n&quot;);
exit(1);
}

/* Attempt to fork and check for errors */
if( (pid=fork()) == -1){
fprintf(stderr,&quot;Fork error. Exiting.\n&quot;); /* something went wrong
*/
exit(1);
}

if(pid){
/* A positive (non-negative) PID indicates the parent process */
dup2(commpipe[1],1); /* Replace stdout with out side of the pipe */
close(commpipe[0]); /* Close unused side of pipe (in side) */
setvbuf(stdout,(char*)NULL,_IONBF,0); /* Set non-buffered output on stdout */
sleep(2);
printf(&quot;Hello\n&quot;);
sleep(2);
printf(&quot;Goodbye\n&quot;);
sleep(2);
printf(&quot;exit\n&quot;);
wait(&amp;amp;rv); /* Wait for child process to end */
fprintf(stderr,&quot;Child exited with a %d value\n&quot;,rv);
}
else{
/* A zero PID indicates that this is the child process */
//dup2(commpipe[0],0); /* Replace stdin with the in side of the pipe */
close(commpipe[1]); /* Close unused side of pipe (out side) */
/* Replace the child fork with a new process */
if(execl(&quot;child&quot;,&quot;child&quot;,NULL) == -1){
fprintf(stderr,&quot;execl Error!&quot;);
exit(1);
}
}
return 0;
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/do-os-programming%e2%80%a6get-the-essence-of-programming-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

