<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux For All &#187; Script</title>
	<atom:link href="http://www.linux4all.in/category/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linux4all.in</link>
	<description>Making Linux Usable For All From Newbies To Techies</description>
	<lastBuildDate>Thu, 18 Feb 2010 19:07:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Breaking News Alert On Your Linux Machine</title>
		<link>http://www.linux4all.in/2008/12/05/create-a-breaking-news-alert-ticker-on-linux/</link>
		<comments>http://www.linux4all.in/2008/12/05/create-a-breaking-news-alert-ticker-on-linux/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 15:26:20 +0000</pubDate>
		<dc:creator>Kunal Gautam</dc:creator>
				<category><![CDATA[Featured Post]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Alert]]></category>
		<category><![CDATA[breaking news alert box on your linux machine]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux breaking news ticker]]></category>
		<category><![CDATA[linux news ticker]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://linux.tech-nologic.info/?p=66</guid>
		<description><![CDATA[A shell script for Breaking news alert on Linux Box]]></description>
			<content:encoded><![CDATA[<p>For the past few days, I&#8217;ve been disconnected from T.V. and I couldn&#8217;t keep up with the buzz around. Visiting web portals frequently for updates didn&#8217;t seem feasible either. The tickers provided by many web portals could&#8217;ve been used, but, unfortunately almost all of them are incompatible with Linux, the beautiful OS.This was the very reason behind me venturing out to code a <strong>Breaking News Alert for Linux Machines.</strong> And, proudly, I was successful in that.<em> According to the theory that states, &#8220;anything good and useful is to be shared&#8221;, here, I share the source code and instructions to create a <strong>custom Breaking News Alert </strong></em><em><strong>for your Linux Machine/</strong></em><em><strong>Linux News Ticker </strong></em></p>
<p><strong> </strong><br />
<span id="more-66"></span></p>
<h2>Source Code</h2>
<p>In the sample code below, I&#8217;ve used  <a title="Daily News &amp; Analysis" href="http://www.dnaindia.com/" target="_blank">DNAIndia</a> <a title="DNA Latest News Feed" href="http://www.dnaindia.com/syndication/rss,catid-0.xml" target="_blank">Latest News Feed<br />
</a><strong>Here is the code for GNOME Desktop Environment</strong><br />
Download it From <a href="http://linux.tech-nologic.info/wp-content/uploads/2008/12/gnome.sh">Here</a> in a textt File</p>
<blockquote><p>#!/bin/bash<br />
mkdir -p /tmp/dnadata<br />
cd /tmp/dnadata<br />
rm -rf news-latest*<br />
wget http://www.dnaindia.com/services/rss/news-latest.xml<br />
if [[ "$(echo  $(md5sum news-latest.xml | sed -e 's:news-latest.xml::g'))" == "$(echo  $(md5sum check.xml | sed -e 's:check.xml::g'))" ]]<br />
then<br />
echo &#8220;same news&#8221;</p>
<p>else</p>
<p>cat news-latest.xml | grep &#8220;pubDate&#8221; | sed -e &#8216;s:&lt;pubDate&gt;::g&#8217; | sed -e &#8216;s:&lt;/pubDate&gt;::g&#8217; | head -n 3 | tail -n 1 &gt; 1<br />
cat news-latest.xml | grep &#8220;title&#8221; | sed -e &#8216;s:&lt;title&gt;::g&#8217; | sed -e &#8216;s:&lt;/title&gt;::g&#8217; | head -n 3 | tail -n 1 &gt; 2<br />
cat news-latest.xml | grep &#8220;description&#8221; | sed -e &#8216;s:&lt;description&gt;::g&#8217; | sed -e &#8216;s:&lt;/description&gt;::g&#8217; | head -n 3 | tail -n 1 &gt; 3<br />
zenity &#8211;display :0 &#8211;title=&#8221;$(echo $(cat 2))&#8221; &#8211;info &#8211;text=&#8221;$(echo $(cat 3)) n n n n News as on $(echo $(cat 1))&#8221;<br />
fi<br />
cat news-latest.xml &gt; check.xml</p></blockquote>
<p><strong>Here Is Coding For KDE</strong></p>
<p>Download it From <a href="http://linux.tech-nologic.info/wp-content/uploads/2008/12/kde.sh">Here</a> in a text File</p>
<blockquote><p>#!/bin/bash<br />
mkdir -p /tmp/dnadata<br />
cd /tmp/dnadata<br />
rm -rf news-latest*<br />
wget http://www.dnaindia.com/services/rss/news-latest.xml<br />
if [[ "$(echo  $(md5sum news-latest.xml | sed -e 's:news-latest.xml::g'))" == "$(echo  $(md5sum check.xml | sed -e 's:check.xml::g'))" ]]<br />
then<br />
echo &#8220;same news&#8221;</p>
<p>else<br />
cat news-latest.xml | grep &#8220;pubDate&#8221; | sed -e &#8216;s:&lt;pubDate&gt;::g&#8217; | sed -e &#8216;s:&lt;/pubDate&gt;::g&#8217; | head -n 3 | tail -n 1 &gt; 1<br />
cat news-latest.xml | grep &#8220;title&#8221; | sed -e &#8216;s:&lt;title&gt;::g&#8217; | sed -e &#8216;s:&lt;/title&gt;::g&#8217; | head -n 3 | tail -n 1 &gt; 2<br />
cat news-latest.xml | grep &#8220;description&#8221; | sed -e &#8216;s:&lt;description&gt;::g&#8217; | sed -e &#8216;s:&lt;/description&gt;::g&#8217; | head -n 3 | tail -n 1 &gt; 3<br />
kdialog &#8211;display :0 &#8211;title=&#8221;$(echo $(cat 2))&#8221; &#8211;msgbox=&#8221;$(echo $(cat 3)) n n n n News as on $(echo $(cat 1))&#8221;<br />
fi<br />
cat news-latest.xml &gt; check.xml</p></blockquote>
<p>___<br />
<em>Please Note : As My Linux Box Is out of Disk Space . I&#8217;m Unable to check the KDE Script . But I hope it will run Fine . If any one can Confirm please Drop a Comment</em><br />
___</p>
<ul>
<li><strong>Save the Above Script in a File and add it to cron job</strong></li>
</ul>
<p>To add a cron job use following command<br />
<em>[You need to know VI or VIM for this]</em></p>
<blockquote><p>crontab -eu username</p></blockquote>
<p>replace username with your desired username<br />
and add following entry [ which will check every one minute ]</p>
<blockquote><p>*/1 * * * * /bin/bash   /path/to/the/file/script &amp;&gt; /dev/null</p></blockquote>
<p><em><strong>The above command is set to execute every minute.</strong></em></p>
<p>Here is Screen Shot of The Script</p>
<div id="attachment_103" class="wp-caption alignnone" style="width: 430px"><img class="size-full wp-image-103" title="breaking_news" src="http://linux.tech-nologic.info/wp-content/uploads/2008/12/breaking_news.jpeg" alt="breaking_news" width="420" height="234" /><p class="wp-caption-text">Breaking News Aleart ScreenShot </p></div>
<h2>Short Description about the Script</h2>
<p>This script downloads the specified RSS feed and checks against any old versions of the same. If a change is observed , the script extracts the relevant information from the feed and sends the output to different files. These are then displayed using the ALERT command.<br />
<em>PS. This script needs an active Internet connection for its successful execution. (Duh!!)</em></p>
<p>You can use any other news feed for your <strong>Breaking News Alert Box/Live News Ticker on your Linux Machine</strong>. If you&#8217;re stuck with that or need help/guidance with regard to the code, kindly drop a comment with your original email, so that I could personally respond to you.</p>
<p style="text-align: right;">Special Thanks To <a title="Only Fresh Thoughts and Insights blogged." href="http://aravindjose.com/blog/" target="_blank">Aravind Jose T.</a> for helping me to pep-up this post !!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux4all.in/2008/12/05/create-a-breaking-news-alert-ticker-on-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Update Your Linux Box Status to Twitter</title>
		<link>http://www.linux4all.in/2008/08/20/update-your-linux-box-status-to-twitter/</link>
		<comments>http://www.linux4all.in/2008/08/20/update-your-linux-box-status-to-twitter/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 15:56:38 +0000</pubDate>
		<dc:creator>Kunal Gautam</dc:creator>
				<category><![CDATA[Editorial]]></category>
		<category><![CDATA[Featured Post]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://linux.tech-nologic.info/?p=22</guid>
		<description><![CDATA[A short Guide on How to post your PC Uptime or Service status on Twitter. This will help a System Admin to monitor his Server from remote location ]]></description>
			<content:encoded><![CDATA[<p>From few days my PC has started twitting ! Ya you heard right my PC is twitting now days. Its really a great thing to get your PC status through twitter . <span id="more-22"></span> Please note that there may be different method of doing the following . I&#8217;ve dove what I liked.  Step First Register a Twitter account for your PC .  Step Two Create a shell script for twitter API <img src='http://www.linux4all.in/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  [ need curl to be installed on your Linux Box ]</p>
<blockquote><p>#!/bin/bash curl -u username:password -d status=&#8221;$*&#8221; http://twitter.com/statuses/update.xml</p></blockquote>
<p>Replace the above user name and password with your own credential  Step Three  Set a cron job [ cron job will run your script after every specific time ]  to set cron job just log into superuser mode and pass following command [ this command checked on Redhat,Fedora Core and Suse]</p>
<blockquote><p>#crontab -eu root</p></blockquote>
<p>and after that command add the following lines into your cron job</p>
<blockquote><p>*/10 * * * *   /bin/sh /path/to/your/twitter/script.sh My PC uptime is $(uptime)</p></blockquote>
<p>If you need any sort of help or to get a customized output please feel free to leave comment  and save the cron job and restart the cron job  To restart cron job in REDHAT and FEDORA CORE</p>
<blockquote><p># service crond restart</p></blockquote>
<p>For Suse [ I've tested this on suse 11 ]</p>
<blockquote><p># service cron restart</p></blockquote>
<p>So now Your PC will update its status over twitter every 10 mins to change. If your want your PC to send his update every one hour use following</p>
<blockquote><p>* */1 * * *   /bin/sh /path/to/your/twitter/script.sh My PC uptime is $(uptime)</p></blockquote>
<p>The Following Expectation have been taken from the author to the reader !!!</p>
<p>1)You might be running Fedora , Redhat or Suse [ altough I've not tested on ubuntu / debian the process may be same ]</p>
<p>2)You know basic vi / vim operation !! you need this knowledge to know how to save a file !!</p>
<p>3)you know basic of crontab . BTW if you dont know I will explain it just leave your comments <img src='http://www.linux4all.in/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>4)User should not abuse the service of twitter for this !! <img src='http://www.linux4all.in/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /> </p>
<p>5)User Will add a cron job for deleting root mails too or have any other solutions [ you will get a mail in inbox everytime when a cronjob is executed ]</p>
<p>Special Thanks to Anoj Ramaswamy Sundar for http://anojrs.blogspot.com/2008/03/twittering-from-command-line.html This is base of the whole article without which it was not possible to write this article <img src='http://www.linux4all.in/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   apart from getting only uptime you can even know your server status <img src='http://www.linux4all.in/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /> </p>
<blockquote><p>*/10 * * * *   /bin/sh /path/to/your/twitter/script.sh $(service mysql status)</p></blockquote>
<p>above will publish mysql status [ replace mysql with mysqld in fedora and redhat ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux4all.in/2008/08/20/update-your-linux-box-status-to-twitter/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Creating Your own Yum Repository</title>
		<link>http://www.linux4all.in/2008/06/13/creating-your-own-yum-repository/</link>
		<comments>http://www.linux4all.in/2008/06/13/creating-your-own-yum-repository/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 18:28:52 +0000</pubDate>
		<dc:creator>Kunal Gautam</dc:creator>
				<category><![CDATA[Editorial]]></category>
		<category><![CDATA[Featured Post]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://linux.tech-nologic.info/?p=11</guid>
		<description><![CDATA[Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages.Install A Yum based repository on your Linux Box using this guide :)]]></description>
			<content:encoded><![CDATA[<p><strong>YUM</strong> or Yellowdog Updater Modified is an interactive, automated update program which can be used for maintaining system using rpm. Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages.<br />
Yum makes it easier to maintain groups of machines without having to manually update each one using rpm.<br />
<span id="more-11"></span><br />
<strong>What is a Repository ?</strong><br />
A repository is a collection of list of rpm[s]. It contain various information regarding the rpm like its dependencies etc.</p>
<p><strong>Why to use Yum if I can install RPM using rpm command?</strong><br />
Well if you want to install RPM you have to make sure that its dependencies are also installed . But this is not in the case of YUM you can simply install package with its dependencies. YUM take care of your all install things . Also update feature is not available in the rpm installation method but it is available in yum.</p>
<p><strong>Here are some key features of &#8220;Yum&#8221;:</strong><br />
• Multiple Repositories<br />
• Simple config file<br />
• Correct dependency calculation<br />
• Fast operation<br />
• rpm-consistent behavior<br />
• comps.xml group support, including multiple repository groups<br />
• Simple interface</p>
<p style="text-align: center;"><strong>Starting With Creating Your Own Repository [Server Side Configuration]</strong></p>
<p><strong>Step First : Check Prequisites</strong><br />
-Have Your Distro CD/DVD</p>
<p>-Check if you have free space on your Hard Disk or not [Total space required vary from Distro to Distro]</p>
<p><strong>Step Two : Copy Disc to Hard Disk</strong><br />
First mount your CD/DVD  and copy it to hard disk<br />
cp -avr /cd/dvd/mount/point/   /destination/directory/</p>
<p><strong>Step Three : Intalling CreateRepo Package</strong><br />
Now go to your directory where you copied the files and search for createrepo-*.rpm file * may be different from version to version and system architecture<br />
Install that rpm using rpm command<br />
install using following command<br />
rpm -ivh &#8211;aid createrepo-*.rpm</p>
<p>Repeat this step with your all you cd .<br />
Note:- If you want install Repository on your network thrugh ftp or http upload in their respective default directories i.e /var/ftp/pub for ftp server and /var/www/html for http server.</p>
<p><strong>Step four: Run createrepo</strong><br />
Go to the directory where you copied the file and run the createrepo command<br />
createrepo -v .<br />
[please note that “.” {dot} after that command as we are in present directory ]</p>
<p>Now you have done all thing.<br />
Now we will see Client side setting</p>
<p style="text-align: center;"><strong>Client Side Setting For YUM</strong></p>
<p>Create a repo file in /etc/yum.repos.d/ directory [ you can name anything to ur file make sure a .repo extension is added later on]<br />
vim /etc/yum.repos.d/my.repo</p>
<p>add following date in that file</p>
<blockquote><p>[Myrepo]<br />
name=Any name you want to put<br />
baseurl=file:///destination/directory/<br />
enabled=1<br />
gpgcheck=0</p></blockquote>
<p>The first line is alias given for your repository . This help to indicate/find that from which repository the package is available.<br />
Second line is name which you can put any thing<br />
Next comes baseurl<br />
base url supports different protocols like file:// ftp:// httpd:// etc. if you are running repository from local pc then give absolute path after file:// . for ftp give ftp://server_ip_or_domain/pub_dir_or_accessable_dir or http://server_ip_or_domain/dir<br />
next line is enabled this specify if yum should enable that repo server for installtion or not 1 is for enable and 0 is for disable<br />
gpgcheck is for checking gpg key. as I don’t required it so I disabled it if you enabled it then you hav to add one more line after that<br />
gpgkey=/your/path/to/key</p>
<p>after this save that repo file and run following command<br />
yum clean all [ will clean yum database ]<br />
yum list [will list the files / packages available on that directory ]</p>
<p>If you find some difficulty in using it please feel free to contact us</p>
<p><em><strong>Note:- SElinux or Firewall may conflict sometimes [ for ftp and http service ]<br />
Note:- I used RHEL server 5 edition . This process is same for RHEL 4,5 FC [versions I don’t know]</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux4all.in/2008/06/13/creating-your-own-yum-repository/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Introduction</title>
		<link>http://www.linux4all.in/2008/05/04/introduction/</link>
		<comments>http://www.linux4all.in/2008/05/04/introduction/#comments</comments>
		<pubDate>Sun, 04 May 2008 04:00:38 +0000</pubDate>
		<dc:creator>Kunal Gautam</dc:creator>
				<category><![CDATA[Editorial]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://linux.tech-nologic.info/?p=3</guid>
		<description><![CDATA[Well this is being great pleasure to announce that <a title="Tech-Nologic networks" href="http://tech-nologic.info/" target="_blank">Tech-Nologic Network</a> Launched its new blog “Linux For All”. This blog is dedicated to all info on Linux.

Linux is a UNIX like Operating system available under GNU Project. More detail on its History and Other things can be found at <a title="Wikipedia &#124;&#124; Linux" href="http://en.wikipedia.org/wiki/Linux" target="_blank">Wikipedia</a>.]]></description>
			<content:encoded><![CDATA[<p>Well this is being great pleasure to announce that <a title="Tech-Nologic networks" href="http://tech-nologic.info/" target="_blank">Tech-Nologic Network</a> Launched its new blog “<strong>Linux For All</strong>”. This blog is dedicated to all info on Linux.</p>
<p>Linux is a UNIX like Operating system available under GNU Project. More detail on its History and Other things can be found at <a title="Wikipedia || Linux" href="http://en.wikipedia.org/wiki/Linux" target="_blank">Wikipedia</a>.</p>
<p>Main aim of this blog is to provide information on Linux to newbie’s as well as to techies. The main source of inspiration for me is <a href="http://sathyasays.com/" target="_blank">Mr. Sathyajith Bhat</a> . This website is being inaugurated by him on Sunday, 04th of May 2008.</p>
<p>I’d also like to thank <a title="Life Of Rajesh" href="http://lifeofrajesh.com/" target="_blank">Mr. Rajesh Pandey</a> for suggesting me the Title for our Blog i.e “<strong>Linux For All</strong>”. We would like to thanks again to Mr Sathyajith for Giving us cool Description as “<strong>Making Linux Usable For All From Newbies To Techies</strong> ”.</p>
<p>Finally last but not least you will find this blog really useful and resourceful .</p>
<p>Hoping for all your kindness and mails.</p>
<p>Kunal Gautam<br />
Site Admin<br />
<a href="http://tech-nologic.info/">Tech-Nologic Networks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux4all.in/2008/05/04/introduction/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
