<?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>infoinfi.com - Information Infinite &#187; Linux</title>
	<atom:link href="http://www.infoinfi.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.infoinfi.com</link>
	<description>A blog full of Informations and happenings</description>
	<lastBuildDate>Thu, 01 Jul 2010 07:40:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Basic asterisk setup</title>
		<link>http://www.infoinfi.com/2009/01/23/basic-asterisk-setup/</link>
		<comments>http://www.infoinfi.com/2009/01/23/basic-asterisk-setup/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 14:36:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[asterisk configuration]]></category>
		<category><![CDATA[asterisk settings]]></category>
		<category><![CDATA[asterisk-1.4.22]]></category>
		<category><![CDATA[basic asterisk setup]]></category>
		<category><![CDATA[linux sip calls]]></category>
		<category><![CDATA[linux telephony]]></category>
		<category><![CDATA[linux voip]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://172.42.102.211/joo/wordpress/?p=22</guid>
		<description><![CDATA[Am going to guide you how to install, configure,run and to make sip call to speak between two different users/computers .
first download and install the windows based softphone called xlite from http://www.counterpath.com/
download and install the following package if it does not exist in your linux box. the asterisk installation will fail if any of the [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://s7.addthis.com/js/152/addthis_widget.js" type="text/javascript"></script>Am going to guide you how to install, configure,run and to make sip call to speak between two different users/computers .</p>
<p>first download and install the windows based softphone called xlite from http://www.counterpath.com/</p>
<p>download and install the following package if it does not exist in your linux box. the asterisk installation will fail if any of the following packages does not exist in the machine.</p>
<p><span style="font-weight: bold;">Packages:</span></p>
<p>gcc<br />
<span style="font-weight: bold;">cpp</span><br />
<span style="font-weight: bold;">glibc-headers</span><br />
<span style="font-weight: bold;">glibc-devel</span><br />
<span style="font-weight: bold;">glibc-kernheaders</span><br />
<span style="font-weight: bold;">gcc-c++</span><br />
<span style="font-weight: bold;">libstdc++-devel</span><br />
<span style="font-weight: bold;">libtermcap-devel</span></p>
<p>Hope you have all the packages mentioned above.</p>
<p>lets start.<br />
go to the linux machine. create a directory as your choice. here am creating under /usr/local/</p>
<p>command:<br />
<span style="font-weight: bold;">mkdir /usr/local/asterisk</span></p>
<p>go to the newly created directory</p>
<p>command:<br />
<span style="font-weight: bold;">cd /usr/local/asterisk/</span></p>
<p>then am downloading the asterisk package from www.asterisk.org</p>
<p>command:<br />
<span style="font-weight: bold;">wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.22.tar.gz</span></p>
<p>once the download completed , unpack the package.</p>
<p>command:<br />
<span style="font-weight: bold;">tar -xvzf ./asterisk-1.4.22.tar.gz</span></p>
<p>note: in the above command the file name is the name of the file which we downloaded before.</p>
<p>once the unpack completed, the package is unpacked into the directory /usr/local/asterisk/ as a folder named asterisk-1.4.22. that is /usr/local/asterisk/asterisk-1.4.22/</p>
<p>now you need to jump into the newly created directory.</p>
<p>command:<br />
<span style="font-weight: bold;">cd asterisk-1.4.22</span></p>
<p>the final step is to compile the package.</p>
<p>commands:</p>
<p><span style="font-weight: bold;">make clean</span><br />
<span style="font-weight: bold;">./configure</span><br />
<span style="font-weight: bold;">make </span><br />
<span style="font-weight: bold;">make install</span><br />
<span style="font-weight: bold;">make samples</span><br />
<span style="font-weight: bold;">make progdocs</span></p>
<p>note: above listed are six different commands and it needs to be executed one by one.</p>
<p>now almost done. the package is successfully installed. hopefully <img src='http://www.infoinfi.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>now, to make the basic asterisk to run, we need to edit the two configuration files located in /etc/asterisk/</p>
<p>the file names are (with full absolute path)</p>
<p>/etc/asterisk/sip.conf<br />
/etc/asterisk/extensions.conf</p>
<p>first we are going to edit the sip.conf file.</p>
<p>command:<br />
<span style="font-weight: bold;">vi /etc/asterisk/sip.conf</span></p>
<p>go to the bottom of the file and paste the following configuration. this configuration actually creating the sip user accounts. the first line <span style="font-weight: bold;">[thiyagu]</span> is the user name. here i used my name <span style="font-weight: bold;">thiyagu</span> as the username.</p>
<p>the third line which is <span style="font-weight: bold;">secret=thi123</span> is the place where you need to key in your desired password. here i used the password <span style="font-weight: bold;">thi123.</span> am creating two users in the name of <span style="font-weight: bold;">thiyagu</span> and <span style="font-weight: bold;">jack</span></p>
<p><span style="font-weight: bold;">[thiyagu]</span><br />
type=friend<br />
<span style="font-weight: bold;">secret=thi123</span><br />
qualify=yes<br />
nat=no<br />
host=dynamic<br />
canreinvite=no<br />
context=internal<br />
<span style="font-weight: bold;"><br />
[jack]</span><br />
type=friend<br />
<span style="font-weight: bold;">secret=jack123</span><br />
qualify=yes<br />
nat=no<br />
host=dynamic<br />
canreinvite=no<br />
context=internal</p>
<p>the sip.conf is now completed. the next one is extensions.conf. the file is under /etc/asterisk/<br />
here we are going to create the extension numbers for each users which we created before.<br />
am assigning the extension number 100 for user thiyagu and 1o1 for jack</p>
<p>command:<br />
<span style="font-weight: bold;">vi /etc/asterisk/extensions.conf</span></p>
<p>go to the bottom of the file and paste the following config.</p>
<p>[internal]<br />
include =&gt; outbound<br />
exten =&gt; 100,1,Dial(SIP/thiyagu,20,tr)<br />
exten =&gt; 101,1,Dial(SIP/jack,20,tr)</p>
<p>thats it . you are done. <img src='http://www.infoinfi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>now run the asterisk executable</p>
<p>command:<br />
/usr/sbin/asterisk -vvvvc</p>
<p>it should run without any errors. Configure the username we created under sip.conf in xlite softphone in two different machines and call each other.</p>
<p>Have Fun</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infoinfi.com/2009/01/23/basic-asterisk-setup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Send email with attachment from linux command line using UUENCODE</title>
		<link>http://www.infoinfi.com/2009/01/23/send-email-with-attachment-from-linux-command-line-using-uuencode/</link>
		<comments>http://www.infoinfi.com/2009/01/23/send-email-with-attachment-from-linux-command-line-using-uuencode/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 14:32:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux attachments]]></category>
		<category><![CDATA[linux command email]]></category>
		<category><![CDATA[linux command line]]></category>
		<category><![CDATA[linux email]]></category>
		<category><![CDATA[uuencode]]></category>
		<category><![CDATA[uuencode attachment]]></category>

		<guid isPermaLink="false">http://172.42.102.211/joo/wordpress/?p=17</guid>
		<description><![CDATA[After reading this you can able to send mails with attachments from linux command prompt  
Let’s start,

Scenario 1:
You need to send a email from the linux command prompt with the log file attached.
The log file name is myprogram.log and located in /var/log/myprogram.log
The log need to be send to someone@mycompany.com
Make sure your linux box having [...]]]></description>
			<content:encoded><![CDATA[<p>After reading this you can able to send mails with attachments from linux command prompt <img src='http://www.infoinfi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p class="MsoNormal">Let’s start,</p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-weight: bold;">Scenario 1:</span></p>
<p class="MsoNormal">You need to send a email from the linux command prompt with the log file attached.</p>
<p class="MsoNormal">The log file name is myprogram.log and located in /var/log/myprogram.log</p>
<p class="MsoNormal">The log need to be send to someone@mycompany.com</p>
<p class="MsoNormal">Make sure your linux box having the &#8220;<span style="font-weight: bold;">uuencode</span>&#8221; tool installed. Also you need a &#8220;Mail Transport Agent&#8221;. in this example am using &#8220;mail&#8221; (like mutt,mailx)</p>
<p class="MsoNormal">
<p class="MsoNormal" style="font-weight: bold;">Step 1:</p>
<p class="MsoNormal">Am creating a file automail.sh</p>
<p class="MsoNormal">Command:</p>
<p class="MsoNormal">vi automail.sh</p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-weight: bold;">Step 2:</span></p>
<p class="MsoNormal">Am adding the following script to the newly opened file</p>
<p class="MsoNormal">#!/bin/bash</p>
<p class="MsoNormal">MYFILE=/var/log/myprogram.log</p>
<p class="MsoNormal" style="color: #cc0000; font-weight: bold;">(echo &#8220;Please find the attached log&#8221;; uuencode $MYFILE myprogram.log;) | mail -s &#8220;My Program log&#8221; someone@mycompany.com</p>
<p class="MsoNormal">(above script highlighted in red is a full single line)</p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-weight: bold;">Step 3:</span></p>
<p class="MsoNormal">Save the file and exit from vi editor</p>
<p class="MsoNormal">
<p class="MsoNormal" style="font-weight: bold;">Step 4:</p>
<p class="MsoNormal">Change the permission of the file to executable</p>
<p class="MsoNormal">Command:</p>
<p class="MsoNormal">chmod 700 ./automail.sh (assuming the file in current directory and the login use is root)</p>
<p class="MsoNormal">That’s it. This script will send the log file attached in the email with subject &#8220;My Program log&#8221; and the body of the message &#8220;Please find the attached log&#8221;</p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-weight: bold;">Scenario 2:</span></p>
<p class="MsoNormal">You need to send a log file emailed to your boss every day from the linux command prompt.</p>
<p class="MsoNormal">The log file name is not same every day. The log file name stored in the following format myprogram_2008_03_28.log, next day myprogram_2008_03_29.log and so</p>
<p class="MsoNormal">on.</p>
<p class="MsoNormal">In this example, we are sending the log in the same day when it generated.</p>
<p class="MsoNormal">Let’s start,</p>
<p class="MsoNormal">
<p class="MsoNormal" style="font-weight: bold;">Step 1:</p>
<p class="MsoNormal">Am creating a file automail-random.sh</p>
<p class="MsoNormal">Command:</p>
<p class="MsoNormal">vi automail-random.sh</p>
<p class="MsoNormal">
<p class="MsoNormal" style="font-weight: bold;">Step 2:</p>
<p class="MsoNormal">
<p class="MsoNormal">Am adding the following script to the newly opened file</p>
<p class="MsoNormal">
<p class="MsoNormal">#!/bin/bash</p>
<p class="MsoNormal">NDATE=$(date +%Y-%m-%d)</p>
<p class="MsoNormal">MYFILE=/var/log/myprogram_$NDATE.log</p>
<p class="MsoNormal" style="font-weight: bold; color: #cc0000;">(echo &#8220;Please find the attached log&#8221;; uuencode $MYFILE myprogram_$NDATE.log;) | mail -s &#8220;My Program log&#8221; someone@mycompany.com</p>
<p class="MsoNormal">
<p class="MsoNormal">(above script highlighted in red is a full single line)</p>
<p class="MsoNormal" style="font-weight: bold;">
<p class="MsoNormal" style="font-weight: bold;">Step 3:</p>
<p class="MsoNormal">Save the file and exit from vi editor</p>
<p class="MsoNormal">
<p class="MsoNormal" style="font-weight: bold;">Step 4:</p>
<p class="MsoNormal">Change the permission of the file to executable</p>
<p class="MsoNormal">Command:</p>
<p class="MsoNormal">chmod 700 ./automail-random.sh (assuming the file in current directory and the login use is root)</p>
<p class="MsoNormal">
<p class="MsoNormal">That’s it. This script will send the log file attached in the email everyday with subject &#8220;My Program log&#8221; and the body of the message &#8220;Please find the attached log&#8221;</p>
<p class="MsoNormal">Wait a minute.</p>
<p class="MsoNormal">What happen if the file does not exist? No NUKE. The program simply fails to execute.</p>
<p class="MsoNormal">To avoid this, add the &#8220;if&#8221; condition to the program and validating the file can overcome the trouble.</p>
<p class="MsoNormal">The final program with the &#8220;if&#8221; condition below.</p>
<p class="MsoNormal">
<p class="MsoNormal">#!/bin/bash</p>
<p class="MsoNormal">NDATE=$(date +%Y-%m-%d)</p>
<p class="MsoNormal">MYFILE=/var/log/myprogram_$NDATE.log</p>
<p class="MsoNormal">if [ -f $MYFILE ]; then</p>
<p class="MsoNormal" style="font-weight: bold; color: #cc0000;">(echo &#8220;Please find the attached log&#8221;; uuencode $MYFILE myprogram_$NDATE.log;) | mail -s &#8220;My Program log&#8221; someone@mycompany.com</p>
<p class="MsoNormal">(above script highlighted in red is a full single line)</p>
<p class="MsoNormal">else</p>
<p class="MsoNormal">mails -s &#8220;Log File is not Generated or Not found&#8221; someone@mycompany.com &lt; /dev/null</p>
<p class="MsoNormal">fi</p>
<p class="MsoNormal">
<p class="MsoNormal">#&#8212;&#8211;END&#8212;&#8211;#</p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">HAVE FUN&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.infoinfi.com/2009/01/23/send-email-with-attachment-from-linux-command-line-using-uuencode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
