<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3504183359607196635</id><updated>2012-02-17T06:14:24.528+05:30</updated><category term='linux'/><category term='time pass'/><category term='news reviews'/><category term='tools'/><category term='songs'/><category term='admin'/><category term='career and personality dev'/><category term='wifi'/><category term='perl'/><category term='Pictures'/><category term='wireless tools'/><category term='videos'/><category term='c and related'/><category term='scripts'/><category term='networking'/><title type='text'>Phaneedra Balaji</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>65</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8518827469201892792</id><published>2011-11-22T20:27:00.001+05:30</published><updated>2011-11-22T20:28:13.757+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>DNS(dnsmasq) on Fedora machine</title><content type='html'>&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Steps to Install and configure local DNS(dnsmasq) on Fedora machine&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;==============================&lt;/span&gt;&lt;wbr style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;/wbr&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;=====================&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Server side&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;~~~~~~~~&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;1, Download the dnsmasq software package from site&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.thekelleys.org.uk/dnsmasq/" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" target="_blank"&gt;http://www.thekelleys.org.uk/&lt;wbr&gt;&lt;/wbr&gt;dnsmasq/&lt;/a&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Untar it and compile it&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # tar -zxvf &lt;dnsmasq-***.tar.gz&gt;&lt;/dnsmasq-***.tar.gz&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # cd &lt;dnsmasq-***&gt;&lt;/dnsmasq-***&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # make&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or you can simply do&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # yum install dnsmasq&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;2, Start service&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # /etc/init.d/dnsmasq start&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;3, Append domain name and dhcp range information in /etc/dnsmasq.conf file&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For example:&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expand-hosts&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domain=&lt;domain name=""&gt;&lt;/domain&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dhcp-range=192.169.1.1,192.&lt;/span&gt;&lt;wbr style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;/wbr&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;169.1.100,168h&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;4, Append the dns entries in /etc/hosts file&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For example&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 192.169.1.1 testhost1&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 192.169.1.2 testhost2&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;5, Stop the iptables&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #service iptables stop&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;6, Restart the dnsmasq service&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # /etc/init.d/dnsmasq restart&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Client side&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;~~~~~~~~&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;1, Change nameserver IP address in /etc/resolv.conf file, Remove existing nameserver IP addresses and give the IP address of machine which is running dnsmasq&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;2, Send dns request&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # host testhost1&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;It will give you the corresponding IP address you have configured in /etc/hosts file in dnsmasq server configuration.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;br style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;For further clarifications you can visit&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.enterprisenetworkingplanet.com/netos/article.php/10951_3377351_1" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" target="_blank"&gt;http://www.&lt;wbr&gt;&lt;/wbr&gt;enterprisenetworkingplanet.&lt;wbr&gt;&lt;/wbr&gt;com/netos/article.php/10951_&lt;wbr&gt;&lt;/wbr&gt;3377351_1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8518827469201892792?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8518827469201892792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8518827469201892792&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8518827469201892792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8518827469201892792'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/11/dnsdnsmasq-on-fedora-machine.html' title='DNS(dnsmasq) on Fedora machine'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3084268506285380676</id><published>2011-10-10T18:24:00.000+05:30</published><updated>2011-10-10T18:24:43.339+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='wifi'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Basic WIFI packets and its functionality.</title><content type='html'>&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'normal Helvetica', Arial, Verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;b&gt;There is 3 types of frames exists&lt;/b&gt;&lt;/h3&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin: 0px; padding: 0px;"&gt;&lt;b&gt;1) management frames&amp;nbsp;&lt;/b&gt;&lt;/h3&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin: 0px; padding: 0px;"&gt;&lt;b&gt;2) control frames&lt;/b&gt;&lt;/h3&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin: 0px; padding: 0px;"&gt;&lt;b&gt;3) data frames&lt;/b&gt;&lt;/h3&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin: 0px; padding: 0px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/h3&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin: 0px; padding: 0px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/h3&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin: 0px; padding: 0px;"&gt;&lt;b&gt;Management Frames&lt;/b&gt;&lt;/h3&gt;&lt;div style="margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;802.11 management frames enable stations to establish and maintain communications. The following are common 802.11 management frame subtypes:&lt;/div&gt;&lt;ul style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Authentication frame&lt;/strong&gt;: 802.11 authentication is a process whereby the access point either accepts or rejects the identity of a radio NIC. The NIC begins the process by sending an authentication frame containing its identity to the access point. With open system authentication (the default), the radio NIC sends only one authentication frame, and the access point responds with an authentication frame as a response indicating acceptance (or rejection). With the optional shared key authentication, the radio NIC sends an initial authentication frame, and the access point responds with an authentication frame containing challenge text. The radio NIC must send an encrypted version of the challenge text (using its WEP key) in an authentication frame back to the access point. The access point ensures that the radio NIC has the correct WEP key (which is the basis for authentication) by seeing whether the challenge text recovered after decryption is the same that was sent previously. Based on the results of this comparison, the access point replies to the radio NIC with an authentication frame signifying the result of authentication.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Deauthentication frame&lt;/strong&gt;: A station sends a deauthentication frame to another station if it wishes to terminate secure communications.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Association request frame:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;802.11 association enables the access point to allocate resources for and synchronize with a radio NIC. A NIC begins the association process by sending an association request to an access point. This frame carries information about the NIC (e.g., supported data rates) and the SSID of the network it wishes to associate with. After receiving the association request, the access point considers associating with the NIC, and (if accepted) reserves memory space and establishes an association ID for the NIC.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Association response frame&lt;/strong&gt;: An access point sends an association response frame containing an acceptance or rejection notice to the radio NIC requesting association. If the access point accepts the radio NIC, the frame includes information regarding the association, such as association ID and supported data rates. If the outcome of the association is positive, the radio NIC can utilize the access point to communicate with other NICs on the network and systems on the distribution (i.e., Ethernet) side of the access point.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Reassociation request frame&lt;/strong&gt;: If a radio NIC roams away from the currently associated access point and finds another access point having a stronger beacon signal, the radio NIC will send a reassociation frame to the new access point. The new access point then coordinates the forwarding of data frames that may still be in the buffer of the previous access point waiting for transmission to the radio NIC.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Reassociation response frame&lt;/strong&gt;: An access point sends a reassociation response frame containing an acceptance or rejection notice to the radio NIC requesting reassociation. Similar to the association process, the frame includes information regarding the association, such as association ID and supported data rates.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Disassociation frame&lt;/strong&gt;: A station sends a disassociation frame to another station if it wishes to terminate the association. For example, a radio NIC that is shut down gracefully can send a disassociation frame to alert the access point that the NIC is powering off. The access point can then relinquish memory allocations and remove the radio NIC from the association table.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Beacon frame&lt;/strong&gt;: The access point periodically sends a beacon frame to announce its presence and relay information, such as timestamp, SSID, and other parameters regarding the access point to radio NICs that are within range. Radio NICs continually scan all 802.11 radio channels and listen to beacons as the basis for choosing which access point is best to associate with.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Probe request frame&lt;/strong&gt;: A station sends a probe request frame when it needs to obtain information from another station. For example, a radio NIC would send a probe request to determine which access points are within range.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;P&lt;strong&gt;robe response frame&lt;/strong&gt;: A station will respond with a probe response frame, containing capability information, supported data rates, etc., when after it receives a probe request frame.&lt;/li&gt;&lt;/ul&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Control Frames&lt;/h3&gt;&lt;div style="margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;802.11 control frames assist in the delivery of data frames between stations. The following are common 802.11 control frame subtypes:&lt;/div&gt;&lt;ul style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Request to Send (RTS) frame&lt;/strong&gt;: The RTS/CTS function is optional and reduces frame collisions present when hidden stations have associations with the same access point. A station sends a RTS frame to another station as the first phase of a two-way handshake necessary before sending a data frame.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Clear to Send (CTS) frame&lt;/strong&gt;: A station responds to a RTS with a CTS frame, providing clearance for the requesting station to send a data frame. The CTS includes a time value that causes all other stations (including hidden stations) to hold off transmission of frames for a time period necessary for the requesting station to send its frame. This minimizes collisions among hidden stations, which can result in higher throughput if you implement it properly.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li style="list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;Acknowledgement (ACK) frame&lt;/strong&gt;: After receiving a data frame, the receiving station will utilize an error checking processes to detect the presence of errors. The receiving station will send an ACK frame to the sending station if no errors are found. If the sending station doesn't receive an ACK after a period of time, the sending station will retransmit the frame.&lt;/li&gt;&lt;/ul&gt;&lt;h3 style="font-size: 12px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Data Frames&lt;/h3&gt;&lt;div style="margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Of course the main purpose of having a wireless LAN is to transport data. 802.11 defines a data frame type that carries packets from higher layers, such as web pages, printer control data, etc., within the body of the frame. When viewing 802.11 data frames with a packet analyzer, you can generally observe the contents of the frame body to see what packets that the 802.11 data frames are transporting.&lt;/div&gt;&lt;div style="margin: 0px 0px 15px; padding: 0px;"&gt;--TBD-- other info added soon.. &lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3084268506285380676?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3084268506285380676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3084268506285380676&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3084268506285380676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3084268506285380676'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/10/basic-wifi-packets-and-its.html' title='Basic WIFI packets and its functionality.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5208759700283806372</id><published>2011-08-08T09:57:00.000+05:30</published><updated>2011-08-08T14:42:21.960+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Basics of screen command in linux</title><content type='html'>Hi,&lt;br /&gt;When you working on remote machine, you may come across with the situation, like, run a program or script for couple of hour or days. But when you logout of your local machine then your program automatically get killed because of loss of your session(Assigned shell gets terminated). So linux provides you to use &lt;span style="font-weight: bold;"&gt;"screen"&lt;/span&gt; command which allows you to make your program independent of shell. So even when you logout remotely even your program runs. Here the steps follows.&lt;br /&gt;Log in to remote machine.&lt;br /&gt;First check out "screen" is available in your remote machine.&lt;br /&gt;If not present, use "apt-get install screen" cmd in ubuntu and install.&lt;br /&gt;After successful installation.&lt;br /&gt;Start ur program using below command.&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;#screen &lt;program&gt;&lt;/program&gt;&lt;/span&gt;&lt;br /&gt;Now ur program running in foreground only.&lt;br /&gt;Now send detach signal by sending &lt;span style="font-weight: bold;"&gt;"Ctrl+a d"&lt;/span&gt; signal. Now your process will detached from your shell and running in background.&lt;br /&gt;Now can logout from remote machine, process will run in remote machine without any effect.&lt;br /&gt;Now after some time or even after some days, log in to remote machine and run &lt;span style="font-weight: bold; font-style: italic;"&gt;"screen -ls"&lt;/span&gt;. It will display all process running by using screen.&lt;br /&gt;For attaching your process to shell run &lt;span style="font-weight: bold;"&gt;"screen -r &lt;screen-id from="" screen="" ls=""&gt;"&lt;/screen-id&gt;&lt;/span&gt;. Now your process will come foreground.&lt;br /&gt;If multiple process are running using screens then&lt;span style="font-weight: bold;"&gt; "screen -r &lt;screen id=""&gt;&lt;/screen&gt;&lt;/span&gt;" below given example.&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 0);"&gt;[root@local.host ~]#screen -ls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 0);"&gt;There are screens on:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 0);"&gt;    29383.pts-7.localhost    (Detached)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 0);"&gt;    31899.pts-9.localhost    (Detached)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 0);"&gt;2 Sockets in /var/run/screen/S-root.&lt;/span&gt;&lt;br /&gt;These 29383, 31899 are pids of screens so&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0); font-style: italic;"&gt;[root@local.host ~]# ps -ef |grep SCR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0); font-style: italic;"&gt;root     10787 15582  0 14:43 pts/9    00:00:00 grep SCR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0); font-style: italic;"&gt;root     29383     1  0 14:21 ?        00:00:00 SCREEN process1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0); font-style: italic;"&gt;root     31899     1  0 14:39 ?        00:00:00 SCREEN process2&lt;/span&gt;&lt;br /&gt;To bring process to foreground&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 0);"&gt;[root@local.host ~]#screen -r &lt;/span&gt;&lt;span style="color: rgb(51, 0, 0); font-style: italic;"&gt;29383&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Now SCREEN process1 process comes to foreground.&lt;/span&gt;&lt;br /&gt;So what are you looking for, give a try....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5208759700283806372?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5208759700283806372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5208759700283806372&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5208759700283806372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5208759700283806372'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/08/basics-of-screen-command-in-linux.html' title='Basics of screen command in linux'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3289156171129499985</id><published>2011-07-20T11:27:00.000+05:30</published><updated>2011-07-20T12:15:16.302+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Change order of packets in pcap file</title><content type='html'>Hi all, I have found new cap edit tool by which you can reorder the  packets in pcap file. Not only ordering but also changing fields,  fragmenting packets and adding vlan headers and so many other options.  It has nice GUI will provide you user friendly experience.&lt;br /&gt;Here is the GUI screen shot&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-OUvxWyfbnHk/TiZ2Y4JIGuI/AAAAAAAAEPo/a57VAx_HhIo/s1600/capedit.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/-OUvxWyfbnHk/TiZ2Y4JIGuI/AAAAAAAAEPo/a57VAx_HhIo/s320/capedit.png" alt="" id="BLOGGER_PHOTO_ID_5631318553832987362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Steps to install.&lt;br /&gt;just check out the code from net&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#svn co  svn+http://code.google.com/p/packetsquare-capedit/source/browse/#svn/branches/0.0.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#cd svn/branches/0.0.1/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#make&lt;/span&gt;&lt;br /&gt;If you get any gtk+2 not installed issue then install gtk libs.&lt;br /&gt;In ubuntu simply run below command&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;apt-get install libgtk2.0-dev&lt;/span&gt;&lt;br /&gt;After successful installation, install capedit tool.&lt;br /&gt;Once compiled you can run tool by simply typing below command.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;./capedit&lt;/span&gt;&lt;br /&gt;This tool is very usefull when your are working with protocol stacks...&lt;br /&gt;&lt;br /&gt;Ok, just dig and explore more. Happy crafting packets :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3289156171129499985?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3289156171129499985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3289156171129499985&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3289156171129499985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3289156171129499985'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/07/change-order-of-packets-in-pcap-file.html' title='Change order of packets in pcap file'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-OUvxWyfbnHk/TiZ2Y4JIGuI/AAAAAAAAEPo/a57VAx_HhIo/s72-c/capedit.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-333791780452787969</id><published>2011-07-01T15:18:00.000+05:30</published><updated>2011-07-01T15:27:58.721+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>cmds grouping in expect script if we are expecting on same patron</title><content type='html'>Hi, below script is just to explain a data variable that can be used as list. So each value in the list are send to spawned program. This is helpful only if you are expecting on same string.&lt;br /&gt;#!/usr/bin/expect -f&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set force_conservative 0  ;# set to 1 to force conservative mode even if&lt;br /&gt;              ;# script wasn't run conservatively originally&lt;br /&gt;if {$force_conservative} {&lt;br /&gt;    set send_slow {1 .1}&lt;br /&gt;    proc send {ignore arg} {&lt;br /&gt;        sleep .1&lt;br /&gt;        exp_send -s -- $arg&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set timeout -1&lt;br /&gt;set data "ls&lt;br /&gt;date&lt;br /&gt;ls -ltr&lt;br /&gt;bla&lt;br /&gt;bla&lt;br /&gt;bla&lt;br /&gt;exit"&lt;br /&gt;&lt;br /&gt;#Spwan the new bash shell&lt;br /&gt;spawn bash&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;match_max 100000&lt;br /&gt;&lt;br /&gt;foreach line [split $data \n] {&lt;br /&gt;expect "root@phaneedra:/home/phaneedra#"&lt;br /&gt;send -- "$line\r"&lt;br /&gt;sleep 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Above foreach will split each line (each element) from data and copies to line variable. Now our script will look for "root@phaneedra:/home/phaneedra#" this and when ever it occurs send first and then next cmds.&lt;br /&gt;&lt;br /&gt;This is just for example so it may not make much sense. But use full to test Cli interacting applications where expecting string patron not changed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-333791780452787969?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/333791780452787969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=333791780452787969&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/333791780452787969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/333791780452787969'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/07/cmds-grouping-in-expect-script-if-we.html' title='cmds grouping in expect script if we are expecting on same patron'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-6030462929055604838</id><published>2011-06-30T11:07:00.000+05:30</published><updated>2011-07-01T11:17:27.572+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Writing simple perl module and using it.</title><content type='html'>package Mymodule; &lt;span style="font-style: italic; color: rgb(51, 204, 255);"&gt;#Mymodule is the module name used in ur script&lt;/span&gt;&lt;br /&gt;use strict; &lt;span style="font-style: italic; color: rgb(51, 204, 255);"&gt;# This pragma forces you to declare you'r variables&lt;/span&gt;&lt;br /&gt;use warnings;&lt;span style="font-style: italic; color: rgb(51, 204, 255);"&gt;#This pragma turns on optional warnings&lt;/span&gt;&lt;br /&gt;use base "Exporter";&lt;span style="font-style: italic; color: rgb(51, 204, 255);"&gt;#The Exporter is standard module available in perl,it knows how to export functions and variables&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 204, 255);"&gt;#our module uses that export mechanism by inheriting using use base&lt;/span&gt;&lt;br /&gt;our @EXPORT = qw(add mul $test); &lt;span style="font-style: italic; color: rgb(51, 204, 255);"&gt;# our global scope.  qw notation is telling perl to create a list separated by spaces   &lt;/span&gt;&lt;br /&gt;#our @EXPORT = qw(add,$sum);   &lt;br /&gt;#our @EXPORT = qw(mul,$mul);   &lt;br /&gt;#our @EXPORT = qw/sub/;     &lt;br /&gt;#our @EXPORT = qw($test);&lt;br /&gt;our $test = 'yes';&lt;br /&gt;my $sum;&lt;br /&gt;my $mul;&lt;br /&gt;    sub add&lt;br /&gt;    {&lt;br /&gt;         $a = $_[0];&lt;br /&gt;          $b = $_[1];&lt;br /&gt;         $sum = $a + $b;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;   sub mul&lt;br /&gt;   {&lt;br /&gt;        $a = $_[0];&lt;br /&gt;        $b = $_[1];&lt;br /&gt;        $mul = $a * $b;&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;1;&lt;span style="color: rgb(51, 204, 255); font-style: italic;"&gt;#This is the last line in module. Return values by which app knows module ran properly&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Application to use above perl module&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;use Mymodule;&lt;br /&gt;my $sum = add(2,3);&lt;br /&gt;my $mul = mul(2,3);&lt;br /&gt;print "sum is: $sum\n";&lt;br /&gt;print "multiplication is: $mul\n";&lt;br /&gt;if ($sum == 5)&lt;br /&gt;{&lt;br /&gt;print"$test\n";&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-6030462929055604838?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/6030462929055604838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=6030462929055604838&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6030462929055604838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6030462929055604838'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/06/writing-simple-perl-module-and-using-it.html' title='Writing simple perl module and using it.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-969102193223652334</id><published>2011-06-28T12:23:00.001+05:30</published><updated>2011-06-28T12:23:59.188+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>kernel crash debugging Tip: how to know which line in your code caused the crash</title><content type='html'>Use "objdump" utility with option "-S" on your object file (.o) which  dumps the disassembly of your object file along with source code. it  displays each line and the corresponding disassembly.&lt;br /&gt;&lt;br /&gt;Example:  following is an instance of kernel crash which shows the crash happened  at address 0x58 in init_module() function which of size 0x8c and the  module name is domu_share:&lt;br /&gt;&lt;br /&gt;root@PVHVM-domU:~/tets_programs/page_share_interdomain# dmesg -c&lt;br /&gt;[ 2463.297489] BUG: unable to handle kernel paging request at 000000003bd28000&lt;br /&gt;[ 2463.297495] IP: [&lt;ffffffffa002f0d8&gt;] &lt;b&gt;&lt;span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 102);"&gt;init_module+0x58/0x8c&lt;/span&gt; &lt;/b&gt;[&lt;b&gt;&lt;i&gt;domu_share&lt;/i&gt;&lt;/b&gt;]&lt;br /&gt;[ 2463.297503] PGD 3bdb3067 PUD 36f56067 PMD 0&lt;br /&gt;[ 2463.297506] Oops: 0002 [#1] SMP&lt;br /&gt;[ 2463.297508] last sysfs file: /sys/devices/pci0000:00/0000:00:01.2/usb1/1-0:1.0/uevent&lt;br /&gt;[ 2463.297512] CPU 0&lt;br /&gt;=========&lt;br /&gt;&lt;br /&gt;Now do objdump of domu_share.o and redirect to a file (as sometimes the objdump can be very big)&lt;br /&gt;# objdump -S domu_share.o &amp;gt; my_objdump&lt;br /&gt;&lt;br /&gt;Now  look for the init_module function in "my_objdump" and from the base  address of the function, go 0x58 bytes further and check the line to  which the address belongs to. that is where the crash happened exactly.&lt;br /&gt;&lt;br /&gt;The section of code which caused the crash is as below&lt;br /&gt;&lt;br /&gt;int init_module(void)&lt;br /&gt;{&lt;br /&gt; &lt;b style="background-color: rgb(255, 255, 0);"&gt;80&lt;/b&gt;:    55                      push   %rbp   &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;------ 80  (actually 0x80) is the base address of the init_module();&lt;br /&gt;  81:   48 89 e5                mov    %rsp,%rbp&lt;br /&gt; 84:   e8 00 00 00 00          callq  89 &lt;init_module+0x9&gt;&lt;br /&gt;*       that is several physically contiguous pages long, and doesn't zero&lt;br /&gt;.....&lt;br /&gt;.....&lt;span style="background-color: rgb(255, 255, 0);"&gt; /* crash is at 0x58 of init_module; so go to 0x80+0x58 = 0xd8 */&lt;/span&gt;&lt;br /&gt;      sring = (struct as_sring*) page;&lt;br /&gt; a6:   48 63 d0                movslq %eax,%rdx&lt;br /&gt;&lt;b&gt;&lt;br /&gt;     SHARED_RING_INIT(sring);&lt;/b&gt;&lt;br /&gt; a9:   be 2f 00 00 00          mov    $0x2f,%esi&lt;br /&gt; ae:   48 8d 7a 11             lea    0x11(%rdx),%rdi&lt;br /&gt;  b2:   c7 42 08 00 00 00 00    movl   $0x0,0x8(%rdx)&lt;br /&gt; b9:   c7 02 00 00 00 00       movl   $0x0,(%rdx)&lt;br /&gt; bf:   c7 42 0c 01 00 00 00    movl   $0x1,0xc(%rdx)&lt;br /&gt; c6:   c7 42 04 01 00 00 00    movl   $0x1,0x4(%rdx)&lt;br /&gt;  cd:   40 f6 c7 01             test   $0x1,%dil&lt;br /&gt; d1:   0f 85 f1 00 00 00       jne    1c8 &lt;init_module+0x148&gt;&lt;br /&gt;&lt;b&gt;  d7:   40 f6 c7 02             test   $0x2,%dil&lt;/b&gt;   &lt;i style="color: rgb(102, 102, 102);"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;----- here is where the crash happened&lt;br /&gt;                                                                                 and this assembly belongs to&lt;br /&gt;                                                                                SHARED_RING_INIT(sring);&lt;/i&gt;&lt;br /&gt;  db:   0f 85 ff 00 00 00       jne    1e0 &lt;init_module+0x160&gt;&lt;br /&gt;==============&lt;br /&gt;&lt;br /&gt;So, have a look at SHARED_RING_INIT(sring) which caused the crash.&lt;/init_module+0x160&gt;&lt;/init_module+0x148&gt;&lt;/init_module+0x9&gt;&lt;/ffffffffa002f0d8&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-969102193223652334?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/969102193223652334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=969102193223652334&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/969102193223652334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/969102193223652334'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/06/kernel-crash-debugging-tip-how-to-know.html' title='kernel crash debugging Tip: how to know which line in your code caused the crash'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-7947152890339042089</id><published>2011-04-13T17:25:00.000+05:30</published><updated>2011-04-13T17:41:25.788+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>tcpdump presentation</title><content type='html'>&lt;iframe src="https://docs.google.com/present/embed?id=dhd8pxb6_73057rmhwcm" frameborder="0" height="342" width="410"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-7947152890339042089?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/7947152890339042089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=7947152890339042089&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7947152890339042089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7947152890339042089'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/04/tcpdump-presentation.html' title='tcpdump presentation'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-7942461276156984458</id><published>2011-02-11T15:48:00.000+05:30</published><updated>2011-02-11T15:53:05.630+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='time pass'/><title type='text'>Balyya interview with NDTV</title><content type='html'>Listen.... nobody plays with balayya.....&lt;br /&gt;Pretty old new but worth watching.&lt;br /&gt;&lt;br /&gt;&lt;iframe title="YouTube video player" src="http://www.youtube.com/embed/0GJCgcA8YBM" frameborder="0" height="390" width="480"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-7942461276156984458?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/7942461276156984458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=7942461276156984458&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7942461276156984458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7942461276156984458'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/02/balyya-interview-with-ndtv.html' title='Balyya interview with NDTV'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/0GJCgcA8YBM/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5810854448218549397</id><published>2011-02-09T14:47:00.000+05:30</published><updated>2011-02-09T15:29:48.001+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>SSH login without using password.</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Aim&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;:-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.&lt;br /&gt;How to do it&lt;br /&gt;&lt;br /&gt;First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Steps :-&lt;/span&gt;&lt;br /&gt;a@A:~&amp;gt; ssh-keygen -t rsa&lt;br /&gt;Generating public/private rsa key pair.&lt;br /&gt;Enter file in which to save the key (/home/a/.ssh/id_rsa):&lt;br /&gt;Created directory '/home/a/.ssh'.&lt;br /&gt;Enter passphrase (empty for no passphrase):&lt;br /&gt;Enter same passphrase again:&lt;br /&gt;Your identification has been saved in /home/a/.ssh/id_rsa.&lt;br /&gt;Your public key has been saved in /home/a/.ssh/id_rsa.pub.&lt;br /&gt;The key fingerprint is:&lt;br /&gt;3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A&lt;br /&gt;&lt;br /&gt;Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):&lt;br /&gt;&lt;br /&gt;a@A:~&amp;gt; ssh b@B mkdir -p .ssh&lt;br /&gt;b@B's password:&lt;br /&gt;&lt;br /&gt;Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:&lt;br /&gt;&lt;br /&gt;a@A:~&amp;gt; cat .ssh/id_rsa.pub | ssh b@B 'cat &gt;&gt; .ssh/authorized_keys'&lt;br /&gt;b@B's password:&lt;br /&gt;&lt;br /&gt;From now on you can log into B as b from A as a without password:&lt;br /&gt;&lt;br /&gt;a@A:~&amp;gt; ssh b@B hostname&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:&lt;br /&gt;&lt;br /&gt;  * Put the public key in .ssh/authorized_keys2&lt;br /&gt;  * Change the permissions of .ssh to 700&lt;br /&gt;  * Change the permissions of .ssh/authorized_keys2 to 640&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5810854448218549397?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5810854448218549397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5810854448218549397&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5810854448218549397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5810854448218549397'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/02/ssh-login-without-using-password.html' title='SSH login without using password.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8068382741874634263</id><published>2011-02-09T14:41:00.000+05:30</published><updated>2011-02-09T14:45:57.218+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Using expect script inside shell script</title><content type='html'>Written small sample shell script which contains expect script, which connect to ftp server.&lt;br /&gt;&lt;br /&gt;SCRIPT:-&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;echo "shell script starting"&lt;br /&gt;ls &lt;br /&gt;sleep 2&lt;br /&gt;pwd&lt;br /&gt;sleep 2&lt;br /&gt;clear&lt;br /&gt;echo "expect is starting"&lt;br /&gt;expect -c "&lt;br /&gt;spawn ftp 192.168.0.250&lt;br /&gt;          expect ":"&lt;br /&gt;          send \"user_name\r\"&lt;br /&gt;          sleep 1&lt;br /&gt;          expect "Password:"&lt;br /&gt;          send \"user_passed\r\"&lt;br /&gt;          sleep 1&lt;br /&gt;          expect "ftp\*"&lt;br /&gt;          send \"bye\r\"&lt;br /&gt;          sleep 1&lt;br /&gt;expect eof"&lt;br /&gt;echo "expect ended bash script follows"&lt;br /&gt;ls -l&lt;br /&gt;sleep 1&lt;br /&gt;pwd &lt;br /&gt;sleep 2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8068382741874634263?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8068382741874634263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8068382741874634263&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8068382741874634263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8068382741874634263'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2011/02/using-expect-script-inside-shell-script.html' title='Using expect script inside shell script'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8442756576533765851</id><published>2010-12-30T12:02:00.000+05:30</published><updated>2010-12-30T12:07:40.538+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>linux device driver intros from veda hyd</title><content type='html'>&lt;font style="font-weight: bold;"&gt;Linux device driver intro 1&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height="390" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/1hG3a1UnJ70&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/1hG3a1UnJ70&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="390" width="640"&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Linux device driver intro 2&lt;/font&gt;&lt;br /&gt;&lt;object height="390" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/YZ0GokG2V_Y&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/YZ0GokG2V_Y&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="390" width="640"&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Linux device driver intro 3&lt;/font&gt;&lt;br /&gt;&lt;object height="390" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4lDIjYiIezI&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/4lDIjYiIezI&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="390" width="640"&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8442756576533765851?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8442756576533765851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8442756576533765851&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8442756576533765851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8442756576533765851'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/12/linux-device-driver-intros-from-veda.html' title='linux device driver intros from veda hyd'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-2665517009762976141</id><published>2010-11-26T11:50:00.000+05:30</published><updated>2011-02-09T14:33:59.898+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Directory watcher</title><content type='html'>Directory watcher will update update.txt file with what are the file or directories removed or added from previous run of script.&lt;br /&gt;&lt;br /&gt;This is totally shell script.&lt;br /&gt;First copy with dir_watcher name and give execution permissions and run as "./dir_watcher dir_path"&lt;br /&gt;&lt;br /&gt;For the first time runs. It takes snapshot of ur directory structure which was provided in cmd.&lt;br /&gt;When second time runs it will take snapshot of directory and if any new files or dir are added then those updates will be written in to update.txt in parent directory.&lt;br /&gt;If dir path not mentioned it will take present dir.&lt;br /&gt;&lt;br /&gt;Note:- It won't give information of updated files.&lt;br /&gt;Put this script in crontab so it will run periodically and updates log file with changes.&lt;br /&gt;ex:- 0 12 * * *  sh /bin/dir_watcher /home/balu/project/&lt;br /&gt;So, every day at 12 noon it will run and updates the update.txt file in  "/home/balu/project/"&lt;br /&gt;&lt;br /&gt;&lt;iframe width=100% height=560px frameborder=0 src=https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=false&amp;embedded=true&amp;srcid=0B7Ay36JvOMKFM2JiMTBmOWUtZThlMi00ZDFkLWFkNzEtZjM5MjU2OTkzZDA4&amp;authkey=CL3lwfIK&amp;hl=en&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-2665517009762976141?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/2665517009762976141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=2665517009762976141&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2665517009762976141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2665517009762976141'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/11/directory-watcher.html' title='Directory watcher'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-1913920608761134860</id><published>2010-11-03T11:29:00.000+05:30</published><updated>2011-02-09T14:33:59.899+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Use cmd line arguments for expect script.</title><content type='html'>Below I have given a small example to get a file from ftp server. This code was written using expect.&lt;br /&gt;Usage:- HOST PROMPT$ expect ftp_get_file.exp &amp;lt; IP &amp;gt; &amp;lt; user_name  &amp;gt; &amp;lt; password &amp;gt; &amp;lt; file_to_get &amp;gt;&lt;br /&gt;&lt;br /&gt;EX:-&lt;br /&gt;#!/usr/bin/expect -f &amp;lt; IP &amp;gt;&lt;br /&gt;set ip [lrange $argv 0 0]&lt;br /&gt;set username [lrange $argv 1 1]&lt;br /&gt;set password [lrange $argv 2 2]&lt;br /&gt;set file [lrange $argv 3 3]&lt;br /&gt;set timeout -1&lt;br /&gt;#Spwan the Cfm1 Util stub&lt;br /&gt;spawn ftp $ip&lt;br /&gt;expect ":"&lt;br /&gt;send -- "$username\r"&lt;br /&gt;sleep 1&lt;br /&gt;expect "Password:"&lt;br /&gt;send -- "$password\r"&lt;br /&gt;sleep 2&lt;br /&gt;expect "&gt;"&lt;br /&gt;send -- "bi\r"&lt;br /&gt;sleep 1&lt;br /&gt;expect "&gt;"&lt;br /&gt;send -- "ha\r"&lt;br /&gt;sleep 1&lt;br /&gt;expect "&gt;"&lt;br /&gt;send -- "mget $file\r"&lt;br /&gt;sleep 2&lt;br /&gt;expect "?"&lt;br /&gt;send -- "y\r"&lt;br /&gt;sleep 1&lt;br /&gt;expect "&gt;"&lt;br /&gt;send -- "by\r"&lt;br /&gt;sleep 1&lt;br /&gt;expect eof&lt;br /&gt;&lt;br /&gt;NOTE:- If ur password contain any special character then use "\" in front of those characters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-1913920608761134860?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/1913920608761134860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=1913920608761134860&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1913920608761134860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1913920608761134860'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/11/use-cmd-line-arguments-for-expect.html' title='Use cmd line arguments for expect script.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-4412138821581125391</id><published>2010-10-08T12:09:00.000+05:30</published><updated>2011-02-09T14:33:59.900+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Expect scritp runs multiple cmds taking as a variable</title><content type='html'>Hi as part of unit testing i have written a expect script that expects same things but i need to send some list of cmds. For the first time i have written in the sequence of expect, send, sleep and then for the second and go on. But script is very lengthy if i want to see execution flow of cmds i need to scroll down to entire script.&lt;br /&gt;So i find an alternate solution where i kept all my cmds in one varible and split on newline (i used newline, can be changed) and send these cmds one by one using for.&lt;br /&gt;Below script is small example which will explain what i have done. Pretty simple logic and very basic too.&lt;br /&gt;Have a look......&lt;br /&gt;&lt;br /&gt;#!/usr/bin/expect -f&lt;br /&gt;set data "ls&lt;br /&gt;pwd&lt;br /&gt;cd ..&lt;br /&gt;ls&lt;br /&gt;pwd&lt;br /&gt;cd ..&lt;br /&gt;pwd&lt;br /&gt;ls&lt;br /&gt;cd /etc&lt;br /&gt;pwd&lt;br /&gt;ls&lt;br /&gt;cd /home/baluenigma&lt;br /&gt;exit"&lt;br /&gt;&lt;br /&gt;#Spwan the Cfm1 Util stub&lt;br /&gt;spawn /bin/bash&lt;br /&gt;match_max 100000&lt;br /&gt;&lt;br /&gt;foreach line [split $data \n] {&lt;br /&gt;expect "[baluenigma@192.168.2.79 *]#"&lt;br /&gt;send -- "$line\r"&lt;br /&gt;sleep 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Above data is varible which holds all cmds which need to be executed.&lt;br /&gt;Foreach is used to read data varible and split on newline char and line varible takes that value. Now expect cmd expects "[baluenigma@192.168.2.79 *]#" here '*' used because pwd will change when i used cd cmds which are in data variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-4412138821581125391?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/4412138821581125391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=4412138821581125391&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4412138821581125391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4412138821581125391'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/10/expect-scritp-runs-multiple-cmds-taking.html' title='Expect scritp runs multiple cmds taking as a variable'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5435439197204663548</id><published>2010-10-05T09:42:00.000+05:30</published><updated>2011-02-09T14:33:59.901+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Flv to 3gp converter</title><content type='html'>First of all I was installed ffmpeg on my centos 5.1 using yum.&lt;br /&gt;If you don't have then simply run "yum install ffmpeg*".&lt;br /&gt;Now to convert flv into 3gp, ffmpeg should contain h263 vedio codes generally it has and amrnb audio codes. In my case i don't have this audio code which was &lt;a href="http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2"&gt;downloaded.&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/a&gt; Compiled and installed without any problem.&lt;br /&gt;Create a file /bin/fl23gp and write below code.&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;br /&gt;#!/bin/bash&lt;br /&gt;echo "flv 2 3gb Convertion"&lt;br /&gt;echo ""&lt;br /&gt;if (($# ==0))&lt;br /&gt;then&lt;br /&gt;        echo "Usage: flvto3gp [flv files] ..."&lt;br /&gt;        exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;while (($# !=0 ))&lt;br /&gt;do&lt;br /&gt; ffmpeg -i $1 -s 176x144 -vcodec h263 -r 25 -b 200 -ab 6.7k -sameq -acodec libopencore_amrnb -ac 1 -ar 8000 ${1//.flv/.3gp}&lt;br /&gt;        shift&lt;br /&gt;done&lt;br /&gt;echo "Finished flv-to-3gp convertion"&lt;br /&gt;echo "\" Enjoy  \""&lt;br /&gt;echo ""&lt;br /&gt;------------------------------------------------------------------------------------------------------------&lt;br /&gt;Run "chmod 777 /bin/flv23gp" .&lt;br /&gt;&lt;br /&gt;"ffmpeg -formats | grep amr" will return what are audio codes preset with amr. Which was mentioned in /bin/flv3mp3 file for -acodec as "libopencore_amrnb" .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5435439197204663548?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5435439197204663548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5435439197204663548&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5435439197204663548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5435439197204663548'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/10/flv-to-3gp-converter.html' title='Flv to 3gp converter'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8757694296814445184</id><published>2010-08-26T13:04:00.000+05:30</published><updated>2011-02-09T14:33:59.901+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Including IP address of your pc in linux prompt</title><content type='html'>When working remote machine using teminals it some times make quite confusing which teminal is connected to which machine. One way is setting tittle to teminal makes confortable but we can make linux prompt to display IP dynamic by adding code in /etc/bashrc.&lt;br /&gt;&lt;br /&gt;Code :-&lt;br /&gt;&lt;br /&gt;#------ display ip in &lt;span class="il"&gt;prompt&lt;/span&gt; -----&lt;br /&gt;#Generally eth0 interface is used&lt;br /&gt;ip=`ifconfig eth0 2&gt;/dev/nul |grep "inet addr" | cut -d ':' -f2| cut -d ' ' -f1`&lt;br /&gt;&lt;div class="im"&gt;#echo "--$ip--"&lt;br /&gt;if [ -z $ip ]&lt;br /&gt;then&lt;br /&gt;&lt;/div&gt;      #If not eth0 check for eth1&lt;br /&gt;    ip=`ifconfig eth1 2&gt;/dev/nul |grep "inet addr" | cut -d ':' -f2| cut -d ' ' -f1`&lt;br /&gt;&lt;div class="im"&gt;     #echo "--$ip--"&lt;br /&gt;    if [ -z $ip ]&lt;br /&gt;    then&lt;br /&gt;&lt;/div&gt;          # Both interfaces are not available&lt;br /&gt;        ip="localhost"&lt;br /&gt;    fi&lt;br /&gt;&lt;div class="im"&gt;fi&lt;br /&gt;#`PS1="[\u@\$ip \W]\$"`&lt;br /&gt;#export PS1="[\u@\$ip \W]\$"&lt;br /&gt;user_id=`id -u`&lt;br /&gt;if [ $user_id -eq "0" ]&lt;br /&gt;then&lt;br /&gt;&lt;/div&gt;     #for root users&lt;div class="im"&gt;&lt;br /&gt;     export PS1="[\u@\$ip \W]# "&lt;br /&gt;else&lt;br /&gt;&lt;/div&gt;     #For normal users&lt;br /&gt;    export PS1="[\u@\$ip \W]\$ "&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------&lt;br /&gt;Add above code in /etc/bashrc. Open new terminal to see the change.&lt;br /&gt;&lt;br /&gt;In above i have useded eth0 and eth1 interfaces only because most PCs uses it. we can chane it to ath0 or ath1 or wlan0 depending on ur requirement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8757694296814445184?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8757694296814445184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8757694296814445184&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8757694296814445184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8757694296814445184'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/08/incliding-ip-address-of-your-pc-in.html' title='Including IP address of your pc in linux prompt'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3787312525495268938</id><published>2010-07-28T10:02:00.000+05:30</published><updated>2011-02-09T14:33:59.902+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Code to display your pc ip in linux prompt</title><content type='html'>Usually i do ssh connections to 2 or more machines. While switching form one teminal to other i use ifconfig to find to which pc it connected or i use to set title for teminals manully. But I feel there should be something else i can do, thought of putting ip in prompt itslef.&lt;br /&gt;&lt;br /&gt;i have add code mentioned below in /etc/bashrc to effect it for all users.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;code&lt;/span&gt;&lt;br /&gt;#------ display ip in prompt -----&lt;br /&gt;#Generally eth0 interface is used&lt;br /&gt;ip=`ifconfig eth0 2&gt;/dev/null |grep "inet addr" | cut -d ':' -f2| cut -d ' ' -f1`&lt;br /&gt;#echo "--$ip--"&lt;br /&gt;if [ -z $ip ]&lt;br /&gt;then&lt;br /&gt;     #If not eth0 check for eth1&lt;br /&gt;     ip=`ifconfig eth1 2&gt;/dev/null |grep "inet addr" | cut -d ':' -f2| cut -d ' ' -f1`&lt;br /&gt;     #echo "--$ip--"&lt;br /&gt;     if [ -z $ip ]&lt;br /&gt;     then&lt;br /&gt;           # Both interfaces are not available&lt;br /&gt;           ip="localhost"&lt;br /&gt;    fi&lt;br /&gt;fi&lt;br /&gt;#`PS1="[\u@\$ip \W]\$"`&lt;br /&gt;#export PS1="[\u@\$ip \W]\$"&lt;br /&gt;user_id=`id -u`&lt;br /&gt;if [ $user_id -eq "0" ]&lt;br /&gt;then&lt;br /&gt;    #for root users&lt;br /&gt;     export PS1="[\u@\$ip \W]# "&lt;br /&gt;else&lt;br /&gt;    #For normal users&lt;br /&gt;    export PS1="[\u@\$ip \W]\$ "&lt;br /&gt;fi&lt;br /&gt;#clear&lt;br /&gt;#----- end ---&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3787312525495268938?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3787312525495268938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3787312525495268938&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3787312525495268938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3787312525495268938'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/07/code-to-display-your-pc-ip-in-linux.html' title='Code to display your pc ip in linux prompt'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-89660838140039980</id><published>2010-07-27T10:08:00.000+05:30</published><updated>2010-07-27T15:03:27.064+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='news reviews'/><title type='text'>govt should take first step to advertise about percolation pit</title><content type='html'>yesterday i have read in some paper saying ground water levels are very low and saying every home should have percolation pit (inkudu gunta). Ofcource its true every home, apartments ... should have. But my point is before saying to people why govt not implimenting it in govt offices like police stations, bus stands, railway statons and you know many more govt offices. Because from small village to meto citys. every place you find the places and there will free space available to do this. .....&lt;br /&gt;Iam not pointing out govt rules but they have money and place, why they are not taking initiation.&lt;br /&gt;May be our its time is now to show them...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-89660838140039980?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/89660838140039980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=89660838140039980&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/89660838140039980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/89660838140039980'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/07/govt-should-take-first-step-to-adverise.html' title='govt should take first step to advertise about percolation pit'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-7972357597935938379</id><published>2010-07-15T10:43:00.000+05:30</published><updated>2010-07-15T10:44:01.453+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><title type='text'>A True Creation Of Human Being Simply Speechless!!!!</title><content type='html'>&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/JPIvp2zkUYQ&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xd0d0d0&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/JPIvp2zkUYQ&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xd0d0d0&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-7972357597935938379?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/7972357597935938379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=7972357597935938379&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7972357597935938379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7972357597935938379'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/07/true-creation-of-human-being-simply.html' title='A True Creation Of Human Being Simply Speechless!!!!'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-2133042759408703874</id><published>2010-06-30T12:28:00.000+05:30</published><updated>2010-06-30T13:11:53.823+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='news reviews'/><title type='text'>Who dare to join in CRPF if this continues....</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Chronology of major recent Naxal attacks in the country.&lt;/span&gt;&lt;br /&gt;Starting from&lt;br /&gt;June 29, 2008: Maoists attack a boat on Balimela reservoir in Orissa carrying four anti-Naxalite police officials and 60 Greyhound commandos, killing 38 troops.&lt;br /&gt;&lt;br /&gt;July 16, 2008: 21 policemen killed when a police van is blown up in a landmine blast in Malkangiri district of Orissa.&lt;br /&gt;&lt;br /&gt;April 13, 2009: 10 paramilitary troops killed in eastern Orissa when Maoists attack a bauxite mine in Koraput district.&lt;br /&gt;&lt;br /&gt;April 22, 2009: Maoists hijack a train with at least 300 people on board in Jharkhand and force it to Latehar district before fleeing.&lt;br /&gt;&lt;br /&gt;May 22, 2009: Maoists kill 16 policemen in the jungles of Gadchiroli district in Maharashtra.&lt;br /&gt;&lt;br /&gt;June 10, 2009: Nine policemen, including CRPF troops and officers, ambushed by Maoists during a routine patrol in Saranda jungles in Jharkhand.&lt;br /&gt;&lt;br /&gt;June 13, 2009: Naxals launch two landmine and bomb attacks in a small town close to Bokaro, killing 10 policemen and injuring several others.&lt;br /&gt;&lt;br /&gt;June 16, 2009: Maoists kill 11 police officers in a landmine attack followed by armed assault. In a separate attack, four policemen were killed and two others seriously injured when Maoists ambush them at Beherakhand in Palamau district.&lt;br /&gt;&lt;br /&gt;June 23, 2009: A group of motorcycle-borne armed Naxal rebels open fire on Lakhisarai district court premises in Bihar and free four of their comrades including the self-style Zonal Commander of Ranchi.&lt;br /&gt;&lt;br /&gt;July 18, 2009: Naxalites kill a villager in Bastar and in a separate incident torch a vehicle engaged in road construction work in Bijapur district of Chhattisgarh.&lt;br /&gt;&lt;br /&gt;July 27, 2009: Six persons killed when Naxals trigger a landmine blast at Dantewada district in Chhattisgarh.&lt;br /&gt;&lt;br /&gt;July 31, 2009: A special police officer and another person killed by Naxals in Bijapur district.&lt;br /&gt;&lt;br /&gt;Sep 4, 2009: Naxals kill four villagers in a forest in Aaded village in Chhattisgarh's Bijapur district.&lt;br /&gt;&lt;br /&gt;Sep 26, 2009: Naxals kill BJP MP from Balaghat Baliram Kashyap's sons at Pairaguda village in Jagdalpur (Chhattisgarh).&lt;br /&gt;&lt;br /&gt;Sep 30, 2009: Naxalites set ablaze Gram Panchayat offices at Korchi and Belgaon in Gadchiroli district of Maharashtra.&lt;br /&gt;Oct 8, 2009: 17 policemen killed when Maoists ambushed them at Laheri police station in Gadchiroli district of Maharashtra.&lt;br /&gt;&lt;br /&gt;Feb 15, 2010: 24 personnel of the Eastern Frontier Rifles (EFR) killed as Maoists attack their camp in Silda in West Midnapore district of West Bengal.&lt;br /&gt;&lt;br /&gt;April 4, 2010: Maoists trigger a landmine blast killing 11 security personnel of the elite anti-naxal force Special Operations Group (SOG) in Koraput district of Orrisa.&lt;br /&gt;&lt;br /&gt;April 6, 2010: 75 CRPF personnel and a Chhattisgarh police official killed in a naxal attack in Dantewada district.&lt;br /&gt;&lt;br /&gt;May 8, 2010: Eight CRPF jawans were killed when Naxals blow up a bullet-proof vehicle in Bijapur district of Chhhattisgarh.&lt;br /&gt;&lt;br /&gt;June 29, 2010: At least 15 CRPF personnel killed in a Naxal ambush in Naraynpur district of Chhattisgarh.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Are these people are &lt;span&gt;Naxals or terrorists?????&lt;br /&gt;What ever ..... One thing is our government (its not about ruling party all politicians )  failed not only once and may be waiting for world records keeping innocent jawans in fields with out proper intelligent reports.. If this continues like this no one will dare to join in CRPF or BSF .....&lt;br /&gt;&lt;br /&gt;I feel shame on our great biggest democratic country.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kn"&gt;&lt;/span&gt;&lt;span id=":8t"&gt;No animal afraid of seeing same kind of animal except humans&lt;/span&gt;&lt;span&gt;. Still we are humans mmmmmmmmmmmmmm... :-)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-2133042759408703874?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/2133042759408703874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=2133042759408703874&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2133042759408703874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2133042759408703874'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/who-dare-to-join-in-crpf-if-this.html' title='Who dare to join in CRPF if this continues....'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-1926870029205847207</id><published>2010-06-22T13:43:00.000+05:30</published><updated>2010-06-22T13:47:44.403+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Ostinato packet generater</title><content type='html'>If your looking for GUI based packet generator then  Ostinato is one of the best option.&lt;br /&gt;Just have a look at this video explains Ostinato how to ....&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="540" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/On64lQYEFlY&amp;color1=0xb1b1b1&amp;color2=0xd0d0d0&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/On64lQYEFlY&amp;color1=0xb1b1b1&amp;color2=0xd0d0d0&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="540" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;For further details &lt;a href="http://code.google.com/p/ostinato/wiki/UserGuide"&gt;click here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-1926870029205847207?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/1926870029205847207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=1926870029205847207&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1926870029205847207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1926870029205847207'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/ostinato-packet-generater.html' title='Ostinato packet generater'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-6878929166330972573</id><published>2010-06-21T12:55:00.001+05:30</published><updated>2010-06-21T12:55:36.743+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='songs'/><title type='text'>Old Hindi songs</title><content type='html'>&lt;object width="300" height="170"&gt; &lt;param name="movie" value="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17669_QN8IS&amp;autoload=true"&gt;&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt; &lt;embed src="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17669_QN8IS&amp;autoload=true" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="170"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;BR&gt; &lt;B&gt; &lt;a href=http://mydatanest.com&gt;&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-6878929166330972573?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/6878929166330972573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=6878929166330972573&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6878929166330972573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6878929166330972573'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/old-hindi-songs.html' title='Old Hindi songs'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-6984293848526120</id><published>2010-06-20T16:34:00.000+05:30</published><updated>2010-06-20T16:35:02.660+05:30</updated><title type='text'>Devotional</title><content type='html'>&lt;object width="300" height="170"&gt; &lt;param name="movie" value="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17506_B7ppQ&amp;autoload=true"&gt;&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt; &lt;embed src="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17506_B7ppQ&amp;autoload=true" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="170"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;BR&gt; &lt;B&gt; &lt;a href=http://mydatanest.com&gt;&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-6984293848526120?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/6984293848526120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=6984293848526120&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6984293848526120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6984293848526120'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/devotional.html' title='Devotional'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8277521877610322190</id><published>2010-06-20T15:53:00.000+05:30</published><updated>2010-06-20T15:54:30.530+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='songs'/><title type='text'>telugu</title><content type='html'>&lt;object width="300" height="170"&gt; &lt;param name="movie" value="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17511_RBv8i&amp;autoload=true"&gt;&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt; &lt;embed src="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17511_RBv8i&amp;autoload=true" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="170"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;BR&gt; &lt;B&gt; &lt;a href=http://mydatanest.com&gt; &lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8277521877610322190?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8277521877610322190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8277521877610322190&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8277521877610322190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8277521877610322190'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/telugu_9828.html' title='telugu'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5857699581994679854</id><published>2010-06-20T15:51:00.000+05:30</published><updated>2010-06-20T15:58:23.088+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='songs'/><title type='text'>telugu_old...</title><content type='html'>&lt;object width="300" height="170"&gt; &lt;param name="movie" value="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17512_33c2G&amp;autoload=true"&gt;&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt; &lt;embed src="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17512_33c2G&amp;autoload=true" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="170"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;BR&gt; &lt;B&gt; &lt;a href=http://mydatanest.com&gt;&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5857699581994679854?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5857699581994679854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5857699581994679854&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5857699581994679854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5857699581994679854'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/teluguold.html' title='telugu_old...'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8624135443799933107</id><published>2010-06-20T15:33:00.000+05:30</published><updated>2010-06-20T17:18:14.448+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='songs'/><title type='text'>english</title><content type='html'>&lt;object width="300" height="170"&gt; &lt;param name="movie" value="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17508_8M2Ws&amp;autoload=true"&gt;&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt; &lt;embed src="http://www.mdn.fm/flash/xspf_player.swf?playlist_url=http://www.mdn.fm/Player/exportPlaylist/17508_8M2Ws&amp;autoload=true" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="170"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;BR&gt; &lt;B&gt; &lt;a href=http://mydatanest.com&gt;&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8624135443799933107?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8624135443799933107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8624135443799933107&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8624135443799933107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8624135443799933107'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/english_20.html' title='english'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-7067662119549469648</id><published>2010-06-15T14:38:00.000+05:30</published><updated>2010-06-15T14:45:54.158+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Installation of bugzilla on centos 5.1</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Take backup from server(For bugzilla ugrading)  :&lt;/span&gt;&lt;br /&gt;In server take mysql backup&lt;br /&gt;mysqldump -u user_name  -p user_passwd bugs &gt; bugs_backup.spl&lt;br /&gt;`bugs_backup.spl` file contains all bugzilla bugs backup.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Mysql Configuration:&lt;/span&gt;&lt;br /&gt;yum install mysql mysql-devel mysql-server&lt;br /&gt;&lt;br /&gt;chech mysql is running or not. if not runing /etc/init.d/mysqld start&lt;br /&gt;&lt;br /&gt;/usr/bin/mysqladmin -u admin_user password 'admin_password'&lt;br /&gt;mysql -u root_user -p root_passwd&lt;br /&gt;mysql&gt;CREATE USER 'bugs'@'localhost' IDENTIFIED BY 'bugzilla_db_passwd';&lt;br /&gt;mysql&gt;create database bugs;&lt;br /&gt;mysql&gt; show databases;&lt;br /&gt;mysql&gt; GRANT ALL ON *.* TO bugs@localhost IDENTIFIED BY "bugzilla_db_passwd";&lt;br /&gt;mysql&gt;quit&lt;br /&gt;&lt;br /&gt;Now bugs database i created and a dbuser created with name 'bugs' for bugzilla access.&lt;br /&gt;---------------------------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Bugzilla Installation:&lt;/span&gt;&lt;br /&gt;mkdir /bugs&lt;br /&gt;&lt;br /&gt;download bugzilla latest version (here i used bugzilla 3.2 version)&lt;br /&gt;mv bugzilla-3.2.tar.gz /bugs&lt;br /&gt;&lt;br /&gt;yum install gd-devel&lt;br /&gt;yum install ImageMagick-perl ImageMagick-devel&lt;br /&gt;&lt;br /&gt;perl -MCPAN -e 'install "Bundle::Bugzilla"' (Follow bellow steps. if any options is not mentioned for inputs just press enter)&lt;br /&gt;&lt;br /&gt;Are you ready for manual configuration? [yes] yes&lt;br /&gt;CPAN build and cache directory? [/home/phaneendra.gb/.cpan] /bugs&lt;br /&gt;(1) Africa&lt;br /&gt;(2) Asia&lt;br /&gt;(3) Australasia&lt;br /&gt;(4) Central America&lt;br /&gt;(5) Europe&lt;br /&gt;(6) North America&lt;br /&gt;(7) Oceania&lt;br /&gt;(8) South America&lt;br /&gt;Select your continent (or several nearby continents) [] 4&lt;br /&gt;(1) ftp://mirrors.ucr.ac.cr/CPAN/&lt;br /&gt;Select as many URLs as you like (by number),&lt;br /&gt;put them on one line, separated by blanks, e.g. '1 4 5' [] 1&lt;br /&gt;&lt;br /&gt;perl ./checksetup.pl --check-modules  (install all required modules)&lt;br /&gt;&lt;br /&gt;Enter a username to be validated: root_user&lt;br /&gt;Enter this user's password: root_password&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;perl ./checksetup.pl --check-modules (run 2 or 3 times check all modules installed)&lt;br /&gt;perl ./checksetup.pl&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Bugzilla Configutration:&lt;/span&gt;&lt;br /&gt;in   vi /bugs/bugzilla-3.2/localconfig check for following fields&lt;br /&gt;----------------------------------------&lt;br /&gt;$create_htaccess = 1;&lt;br /&gt;$webservergroup = 'user_group';&lt;br /&gt;$db_driver = 'mysql';&lt;br /&gt;$db_host = 'localhost';&lt;br /&gt;$db_name = 'bugs';&lt;br /&gt;$db_user = 'bugs';&lt;br /&gt;$db_pass = 'bugzilla_db_passwd';&lt;br /&gt;(other thing leave as it is)&lt;br /&gt;----------------------------------------&lt;br /&gt;&lt;br /&gt;perl ./checksetup.pl&lt;br /&gt;Enter the e-mail address of the administrator:bug_admin@oc.com&lt;br /&gt;Enter the real name of the administrator: bug_admin&lt;br /&gt;Enter a password for the administrator account: bug_passwd&lt;br /&gt;Please retype the password to verify: bug_passwd&lt;br /&gt;&lt;br /&gt;added mysql user to user_group&lt;br /&gt;vi /etc/httpd/conf/httpd.conf (at the end add the following lines)&lt;br /&gt;-----------------------------------------&lt;br /&gt;Alias /bugs  /bugs/ui/bugzilla-3.2&lt;br /&gt;&lt;directory bugzilla="" ui="" 2=""&gt;&lt;br /&gt;       AuthType Basic&lt;br /&gt;       AuthName "bugzilla Repository"&lt;br /&gt;       AuthPAM_Enabled on&lt;br /&gt;       Require group ocusers&lt;br /&gt;       Require valid-user&lt;br /&gt;AddHandler cgi-script .cgi&lt;br /&gt;Options +Indexes +ExecCGI&lt;br /&gt;DirectoryIndex index.cgi&lt;br /&gt;AllowOverride Limit&lt;br /&gt;&lt;/directory&gt;&lt;br /&gt;-----------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-7067662119549469648?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/7067662119549469648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=7067662119549469648&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7067662119549469648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7067662119549469648'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/installation-of-bugzilla-on-centos-51.html' title='Installation of bugzilla on centos 5.1'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-803017197511056998</id><published>2010-06-03T21:03:00.000+05:30</published><updated>2010-06-03T21:08:10.514+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>network packets headers</title><content type='html'>&lt;div style="text-align: center;"&gt;Ethernet packet header&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/TAfLlYyZEsI/AAAAAAAABEo/OQHbMRIFp8k/s1600/EthernetHeaderStructure.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 59px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/TAfLlYyZEsI/AAAAAAAABEo/OQHbMRIFp8k/s320/EthernetHeaderStructure.png" alt="" id="BLOGGER_PHOTO_ID_5478571314888905410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;IP header &lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_a3vWkw3wrUY/TAfLprlXdyI/AAAAAAAABEw/kN3672Gxoc4/s1600/IPv4DatagramFormat.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 116px;" src="http://3.bp.blogspot.com/_a3vWkw3wrUY/TAfLprlXdyI/AAAAAAAABEw/kN3672Gxoc4/s320/IPv4DatagramFormat.png" alt="" id="BLOGGER_PHOTO_ID_5478571388654024482" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;TCP header&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/TAfLtaXr44I/AAAAAAAABE4/KXE5SsMyPL8/s1600/TCPPacketStructure.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 151px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/TAfLtaXr44I/AAAAAAAABE4/KXE5SsMyPL8/s320/TCPPacketStructure.png" alt="" id="BLOGGER_PHOTO_ID_5478571452752716674" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;UDP header&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_a3vWkw3wrUY/TAfLxZxShqI/AAAAAAAABFA/VFIhubs1Ubo/s1600/UDPPacketStructure.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 66px;" src="http://1.bp.blogspot.com/_a3vWkw3wrUY/TAfLxZxShqI/AAAAAAAABFA/VFIhubs1Ubo/s320/UDPPacketStructure.png" alt="" id="BLOGGER_PHOTO_ID_5478571521311147682" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-803017197511056998?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/803017197511056998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=803017197511056998&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/803017197511056998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/803017197511056998'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/network-packets-headers.html' title='network packets headers'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_a3vWkw3wrUY/TAfLlYyZEsI/AAAAAAAABEo/OQHbMRIFp8k/s72-c/EthernetHeaderStructure.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-9128603947762726401</id><published>2010-06-03T16:01:00.001+05:30</published><updated>2010-06-03T16:05:33.674+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>youtube downloader</title><content type='html'>#!/usr/bin/env python&lt;br&gt;#&lt;br&gt;# Copyright (c) 2006-2008 Ricardo Garcia Gonzalez&lt;br&gt;#&lt;br&gt;# Permission is hereby granted, free of charge, to any person obtaining a&lt;br&gt;# copy of this software and associated documentation files (the "Software"),&lt;br&gt;# to deal in the Software without restriction, including without limitation&lt;br&gt;# the rights to use, copy, modify, merge, publish, distribute, sublicense,&lt;br&gt;# and/or sell copies of the Software, and to permit persons to whom the&lt;br&gt;# Software is furnished to do so, subject to the following conditions:&lt;br&gt;# &lt;br&gt;# The above copyright notice and this permission notice shall be included&lt;br&gt;# in all copies or substantial portions of the Software.&lt;br&gt;# &lt;br&gt;# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br&gt;# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br&gt;# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL&lt;br&gt;# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR&lt;br&gt;# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,&lt;br&gt;# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR&lt;br&gt;# OTHER DEALINGS IN THE SOFTWARE.&lt;br&gt;# &lt;br&gt;# Except as contained in this notice, the name(s) of the above copyright&lt;br&gt;# holders shall not be used in advertising or otherwise to promote the&lt;br&gt;# sale, use or other dealings in this Software without prior written&lt;br&gt;# authorization.&lt;br&gt;#&lt;br&gt;import getpass&lt;br&gt;import httplib&lt;br&gt;import math&lt;br&gt;import netrc&lt;br&gt;import optparse&lt;br&gt;import os&lt;br&gt;import re&lt;br&gt;import socket&lt;br&gt;import string&lt;br&gt;import sys&lt;br&gt;import time&lt;br&gt;import urllib2&lt;br&gt;&lt;br&gt;# Global constants&lt;br&gt;const_1k = 1024&lt;br&gt;const_initial_block_size = 10 * const_1k&lt;br&gt;const_epsilon = 0.0001&lt;br&gt;const_timeout = 120&lt;br&gt;&lt;br&gt;const_video_url_str = 'http://www.youtube.com/watch?v=%s'&lt;br&gt;const_video_url_re = re.compile(r'^((?:http://)?(?:\w+\.)?youtube\.com/(?:v/|(?:watch(?:\.php)?)?\?(?:.+&amp;amp;)?v=))?([0-9A-Za-z_-]+)(?(1)[&amp;amp;/].*)?$')&lt;br&gt;const_login_url_str = 'http://www.youtube.com/login?next=/watch%%3Fv%%3D%s'&lt;br&gt;const_login_post_str = 'current_form=loginForm&amp;amp;next=%%2Fwatch%%3Fv%%3D%s&amp;amp;username=%s&amp;amp;password=%s&amp;amp;action_login=Log+In'&lt;br&gt;const_age_url_str = 'http://www.youtube.com/verify_age?next_url=/watch%%3Fv%%3D%s'&lt;br&gt;const_age_post_str = 'next_url=%%2Fwatch%%3Fv%%3D%s&amp;amp;action_confirm=Confirm'&lt;br&gt;const_url_t_param_re = re.compile(r', "t": "([^"]+)"')&lt;br&gt;const_video_url_real_str = 'http://www.youtube.com/get_video?video_id=%s&amp;amp;t=%s'&lt;br&gt;const_video_title_re = re.compile(r'&amp;lt;title&amp;gt;YouTube - ([^&amp;lt;]*)&amp;lt;/title&amp;gt;', re.M | re.I)&lt;br&gt;&lt;br&gt;# Print error message, followed by standard advice information, and then exit&lt;br&gt;def error_advice_exit(error_text):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Error: %s.\n' % error_text)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Try again several times. It may be a temporary problem.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Other typical problems:\n\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('* Video no longer exists.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('* Video requires age confirmation but you did not provide an account.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('* You provided the account data, but it is not valid.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('* The connection was cut suddenly for some reason.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('* YouTube changed their system, and the program no longer works.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('\nTry to confirm you are able to view the video using a web browser.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Use the same video URL and account information, if needed, with this program.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('When using a proxy, make sure http_proxy has http://host:port format.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Try again several times and contact me if the problem persists.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('\n')&lt;br&gt;&lt;br&gt;# Wrapper to create custom requests with typical headers&lt;br&gt;def request_create(url, data=None):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;retval = urllib2.Request(url)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if data is not None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;retval.add_data(data)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;# Try to mimic Firefox, at least a little bit&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;retval.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;retval.add_header('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;retval.add_header('Accept', 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;retval.add_header('Accept-Language', 'en-us,en;q=0.5')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return retval&lt;br&gt;&lt;br&gt;# Perform a request, process headers and return response&lt;br&gt;def perform_request(url, data=None):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;request = request_create(url, data)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;response = urllib2.urlopen(request)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return response&lt;br&gt;&lt;br&gt;# Conditional print&lt;br&gt;def cond_print(str):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;global cmdl_opts&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if not (cmdl_opts.quiet or cmdl_opts.get_url):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stdout.write(str)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stdout.flush()&lt;br&gt;&lt;br&gt;# Title string normalization&lt;br&gt;def title_string_norm(title):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;title = ''.join((x in string.ascii_letters or x in string.digits) and x or ' ' for x in title)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;title = '_'.join(title.split())&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;title = title.lower()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return title&lt;br&gt;&lt;br&gt;# Generic download step&lt;br&gt;def download_step(return_data_flag, step_title, step_error, url, post_data=None):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('%s... ' % step_title)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;data = perform_request(url, post_data).read()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('done.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if return_data_flag:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return data&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return None&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except (urllib2.URLError, ValueError, httplib.HTTPException, TypeError, socket.error):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('failed.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;error_advice_exit(step_error)&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except KeyboardInterrupt:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('\n')&lt;br&gt;&lt;br&gt;# Generic extract step&lt;br&gt;def extract_step(step_title, step_error, regexp, data):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('%s... ' % step_title)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;match = regexp.search(data)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if match is None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('failed.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;error_advice_exit(step_error)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;extracted_data = match.group(1)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('done.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return extracted_data&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except KeyboardInterrupt:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('\n')&lt;br&gt;&lt;br&gt;# Calculate new block size based on previous block size&lt;br&gt;def new_block_size(before, after, bytes):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new_min = max(bytes / 2.0, 1.0)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new_max = max(bytes * 2.0, 1.0)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dif = after - before&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if dif &amp;lt; const_epsilon:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return int(new_max)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rate = bytes / dif&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if rate &amp;gt; new_max:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return int(new_max)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if rate &amp;lt; new_min:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return int(new_min)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return int(rate)&lt;br&gt;&lt;br&gt;# Get optimum 1k exponent to represent a number of bytes&lt;br&gt;def optimum_k_exp(num_bytes):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;global const_1k&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if num_bytes == 0:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return long(math.log(num_bytes, const_1k))&lt;br&gt;&lt;br&gt;# Get optimum representation of number of bytes&lt;br&gt;def format_bytes(num_bytes):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;global const_1k&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;exp = optimum_k_exp(num_bytes)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;suffix = 'bkMGTPEZY'[exp]&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if exp == 0:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return '%s%s' % (num_bytes, suffix)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;converted = float(num_bytes) / float(const_1k**exp)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return '%.2f%s' % (converted, suffix)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except IndexError:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: internal error formatting number of bytes.')&lt;br&gt;&lt;br&gt;# Calculate ETA and return it in string format as MM:SS&lt;br&gt;def calc_eta(start, now, total, current):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dif = now - start&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if current == 0 or dif &amp;lt; const_epsilon:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return '--:--'&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rate = float(current) / dif&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;eta = long((total - current) / rate)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(eta_mins, eta_secs) = divmod(eta, 60)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if eta_mins &amp;gt; 99:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return '--:--'&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return '%02d:%02d' % (eta_mins, eta_secs)&lt;br&gt;&lt;br&gt;# Calculate speed and return it in string format&lt;br&gt;def calc_speed(start, now, bytes):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dif = now - start&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if bytes == 0 or dif &amp;lt; const_epsilon:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 'N/A b'&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return format_bytes(float(bytes) / dif)&lt;br&gt;&lt;br&gt;&lt;br&gt;# Title string minimal transformation&lt;br&gt;def title_string_touch(title):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return title.replace(os.sep, '%')&lt;br&gt;&lt;br&gt;# Create the command line options parser and parse command line&lt;br&gt;cmdl_usage = 'usage: %prog [options] video_url'&lt;br&gt;cmdl_version = '2008.01.24'&lt;br&gt;cmdl_parser = optparse.OptionParser(usage=cmdl_usage, version=cmdl_version, conflict_handler='resolve')&lt;br&gt;cmdl_parser.add_option('-h', '--help', action='help', help='print this help text and exit')&lt;br&gt;cmdl_parser.add_option('-v', '--version', action='version', help='print program version and exit')&lt;br&gt;cmdl_parser.add_option('-u', '--username', dest='username', metavar='USERNAME', help='account username')&lt;br&gt;cmdl_parser.add_option('-p', '--password', dest='password', metavar='PASSWORD', help='account password')&lt;br&gt;cmdl_parser.add_option('-o', '--output', dest='outfile', metavar='FILE', help='output video file name')&lt;br&gt;cmdl_parser.add_option('-q', '--quiet', action='store_true', dest='quiet', help='activates quiet mode')&lt;br&gt;cmdl_parser.add_option('-s', '--simulate', action='store_true', dest='simulate', help='do not download video')&lt;br&gt;cmdl_parser.add_option('-t', '--title', action='store_true', dest='use_title', help='use title in file name')&lt;br&gt;cmdl_parser.add_option('-l', '--literal', action='store_true', dest='use_literal', help='use literal title in file name')&lt;br&gt;cmdl_parser.add_option('-n', '--netrc', action='store_true', dest='use_netrc', help='use .netrc authentication data')&lt;br&gt;cmdl_parser.add_option('-g', '--get-url', action='store_true', dest='get_url', help='print final video URL only')&lt;br&gt;cmdl_parser.add_option('-2', '--title-too', action='store_true', dest='get_title', help='used with -g, print title too')&lt;br&gt;(cmdl_opts, cmdl_args) = cmdl_parser.parse_args()&lt;br&gt;&lt;br&gt;# Set socket timeout&lt;br&gt;socket.setdefaulttimeout(const_timeout)&lt;br&gt;&lt;br&gt;# Get video URL&lt;br&gt;if len(cmdl_args) != 1:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cmdl_parser.print_help()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('\n')&lt;br&gt;video_url_cmdl = cmdl_args[0]&lt;br&gt;&lt;br&gt;# Verify video URL format and convert to "standard" format&lt;br&gt;video_url_mo = const_video_url_re.match(video_url_cmdl)&lt;br&gt;if video_url_mo is None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: URL does not seem to be a youtube video URL. If it is, report a bug.')&lt;br&gt;video_url_id = video_url_mo.group(2)&lt;br&gt;video_url = const_video_url_str % video_url_id&lt;br&gt;&lt;br&gt;# Check conflicting options&lt;br&gt;if cmdl_opts.outfile is not None and (cmdl_opts.simulate or cmdl_opts.get_url):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Warning: video file name given but will not be used.\n')&lt;br&gt;&lt;br&gt;if cmdl_opts.outfile is not None and (cmdl_opts.use_title or cmdl_opts.use_literal):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: using the video title conflicts with using a given file name.')&lt;br&gt;&lt;br&gt;if cmdl_opts.use_title and cmdl_opts.use_literal:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: cannot use title and literal title at the same time.')&lt;br&gt;&lt;br&gt;if cmdl_opts.quiet and cmdl_opts.get_url:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: cannot be quiet and print final URL at the same time.')&lt;br&gt;&lt;br&gt;# Incorrect option formatting&lt;br&gt;if cmdl_opts.username is None and cmdl_opts.password is not None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: password give but username is missing.')&lt;br&gt;&lt;br&gt;if cmdl_opts.use_netrc and (cmdl_opts.username is not None or cmdl_opts.password is not None):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: cannot use netrc and username/password at the same time.')&lt;br&gt;&lt;br&gt;if cmdl_opts.get_url is None and cmdl_opts.get_title is not None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: getting title requires getting URL.')&lt;br&gt;&lt;br&gt;# Get account information if any&lt;br&gt;account_username = None&lt;br&gt;account_password = None&lt;br&gt;&lt;br&gt;if cmdl_opts.use_netrc:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;info = netrc.netrc().authenticators('youtube')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if info is None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: no authenticators for machine youtube.')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;account_username = info[0]&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;account_password = info[2]&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except IOError:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: unable to read .netrc file.')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except netrc.NetrcParseError:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: unable to parse .netrc file.')&lt;br&gt;else:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;account_username = cmdl_opts.username&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if account_username is not None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if cmdl_opts.password is None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;account_password = getpass.getpass('Type YouTube password and press return: ')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;else:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;account_password = cmdl_opts.password&lt;br&gt;&lt;br&gt;# Get output file name &lt;br&gt;if cmdl_opts.outfile is None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_filename = '%s.flv' % video_url_id&lt;br&gt;else:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_filename = cmdl_opts.outfile&lt;br&gt;&lt;br&gt;# Install cookie and proxy handlers&lt;br&gt;urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()))&lt;br&gt;urllib2.install_opener(urllib2.build_opener(urllib2.HTTPCookieProcessor()))&lt;br&gt;&lt;br&gt;# Log in and confirm age if needed&lt;br&gt;if account_username is not None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;url = const_login_url_str % video_url_id&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;post = const_login_post_str % (video_url_id, account_username, account_password)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;download_step(False, 'Logging in', 'unable to log in', url, post)&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;url = const_age_url_str % video_url_id&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;post = const_age_post_str % video_url_id&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;download_step(False, 'Confirming age', 'unable to confirm age', url, post)&lt;br&gt;&lt;br&gt;# Retrieve video webpage&lt;br&gt;video_webpage = download_step(True, 'Retrieving video webpage', 'unable to retrieve video webpage', video_url)&lt;br&gt;&lt;br&gt;# Extract video title if needed&lt;br&gt;if cmdl_opts.use_title or cmdl_opts.use_literal or cmdl_opts.get_title:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_title = extract_step('Extracting video title', 'unable to extract video title', const_video_title_re, video_webpage)&lt;br&gt;&lt;br&gt;# Extract needed video URL parameters&lt;br&gt;video_url_t_param = extract_step('Extracting URL "t" parameter', 'unable to extract URL "t" parameter', const_url_t_param_re, video_webpage)&lt;br&gt;video_url_real = const_video_url_real_str % (video_url_id, video_url_t_param)&lt;br&gt;&lt;br&gt;# Rebuild filename if needed&lt;br&gt;if cmdl_opts.use_title or cmdl_opts.use_literal:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if cmdl_opts.use_title:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;prefix = title_string_norm(video_title)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;else:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;prefix = title_string_touch(video_title)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_filename = '%s-%s.flv' % (prefix, video_url_id)&lt;br&gt;&lt;br&gt;# Check name&lt;br&gt;if not video_filename.lower().endswith('.flv'):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.stderr.write('Warning: video file name does not end in .flv\n')&lt;br&gt;&lt;br&gt;# Retrieve video data&lt;br&gt;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('Requesting video file... ')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_data = perform_request(video_url_real)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('done.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('Video data found at %s\n' % video_data.geturl())&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if cmdl_opts.get_title:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;print video_title&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if cmdl_opts.get_url:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;print video_data.geturl()&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if cmdl_opts.simulate or cmdl_opts.get_url:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit()&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_file = open(video_filename, 'wb')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except (IOError, OSError):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('Error: unable to open "%s" for writing.' % video_filename)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_len = long(video_data.info()['Content-length'])&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_len_str = format_bytes(video_len)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;except KeyError:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_len = None&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_len_str = 'N/A'&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;byte_counter = 0&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;block_size = const_initial_block_size&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;start_time = time.time()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while True:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if video_len is not None:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;percent = float(byte_counter) / float(video_len) * 100.0&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;percent_str = '%.1f' % percent&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;eta_str = calc_eta(start_time, time.time(), video_len, byte_counter)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;else:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;percent_str = '---.-'&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;eta_str = '--:--'&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;counter = format_bytes(byte_counter)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;speed_str = calc_speed(start_time, time.time(), byte_counter)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('\rRetrieving video data: %5s%% (%8s of %s) at %8s/s ETA %s ' % (percent_str, counter, video_len_str, speed_str, eta_str))&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;before = time.time()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_block = video_data.read(block_size)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;after = time.time()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dl_bytes = len(video_block)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if dl_bytes == 0:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;byte_counter += dl_bytes&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_file.write(video_block)&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;block_size = new_block_size(before, after, dl_bytes)&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if video_len is not None and byte_counter != video_len:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;error_advice_exit('server did not send the expected amount of data')&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;video_file.close()&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('done.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('Video data saved to %s\n' % video_filename)&lt;br&gt;&lt;br&gt;except (urllib2.URLError, ValueError, httplib.HTTPException, TypeError, socket.error):&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cond_print('failed.\n')&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;error_advice_exit('unable to download video data')&lt;br&gt;&lt;br&gt;except KeyboardInterrupt:&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sys.exit('\n')&lt;br&gt;&lt;br&gt;# Finish&lt;br&gt;sys.exit()&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-9128603947762726401?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/9128603947762726401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=9128603947762726401&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9128603947762726401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9128603947762726401'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/youtube-downloader.html' title='youtube downloader'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-4048340604493906616</id><published>2010-06-03T11:23:00.000+05:30</published><updated>2010-06-03T13:05:38.872+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>Socket programing</title><content type='html'>&lt;a href="http://net.pku.edu.cn/%7Ecourse/cs501/2010/code/BSD_Socket.t/sockets.pdf" class="style1" target="_blank"&gt;Source&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://net.pku.edu.cn/%7Ecourse/cs501/2010/code/BSD_Socket.t/sockets.pdf" height="556" width="100%"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-4048340604493906616?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/4048340604493906616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=4048340604493906616&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4048340604493906616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4048340604493906616'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/socket-programing.html' title='Socket programing'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-2641990649299183479</id><published>2010-06-03T11:18:00.000+05:30</published><updated>2010-06-03T13:06:09.763+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux Perf and Tuning Guidelines from IBM</title><content type='html'>&lt;a href="http://www.redbooks.ibm.com/redpapers/pdfs/redp4285.pdf" class="style1" target="_blank"&gt;Source&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://www.redbooks.ibm.com/redpapers/pdfs/redp4285.pdf" height="556" width="100%"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-2641990649299183479?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/2641990649299183479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=2641990649299183479&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2641990649299183479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2641990649299183479'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/06/linux-perf-and-tuning-guidelines.html' title='Linux Perf and Tuning Guidelines from IBM'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3630373921334479577</id><published>2010-05-27T19:57:00.000+05:30</published><updated>2010-05-27T20:11:57.646+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Installing OS in VMware and accessing from VM Client</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="font-size:130%;"&gt;VMware&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Download VMware vsphere client and install on windows machine. You may get error with .NET framework upgrade it 2.0 will resolve the issue. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Or &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Connect to ESX4.0 server using browse it will have a link to download VMware Vsphere client, download and install it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now Open the VMsphere client provide server IP and user/password credentials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/S_6Bs35SgVI/AAAAAAAABCo/0nsIScuCEzA/s1600/vmsphere.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/S_6Bs35SgVI/AAAAAAAABCo/0nsIScuCEzA/s320/vmsphere.JPG" alt="" id="BLOGGER_PHOTO_ID_5475956804847567186" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;u&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;Install new OS in VMware:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now VMware VMsphere client will open. Page looks like &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6B8RFK0dI/AAAAAAAABCw/jmG7ApZftv4/s1600/new_vertual_machine.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 237px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6B8RFK0dI/AAAAAAAABCw/jmG7ApZftv4/s320/new_vertual_machine.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957069306319314" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Right click on IP as shown in image and select “new virtual machine”. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_a3vWkw3wrUY/S_6CAsjOZ_I/AAAAAAAABC4/5nq6gdqO7Bw/s1600/new_vertual_machine_step1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 178px;" src="http://1.bp.blogspot.com/_a3vWkw3wrUY/S_6CAsjOZ_I/AAAAAAAABC4/5nq6gdqO7Bw/s320/new_vertual_machine_step1.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957145399617522" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now click on next button. If any specific system require are preset then choose “custom”.&lt;span style=""&gt;  &lt;/span&gt;I choose “Typical” and then next.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6DWE8X7eI/AAAAAAAABD4/kIcVJXFClIc/s1600/new_vertual_machine_step2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 170px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6DWE8X7eI/AAAAAAAABD4/kIcVJXFClIc/s320/new_vertual_machine_step2.JPG" alt="" id="BLOGGER_PHOTO_ID_5475958612236430818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CIN1XL1I/AAAAAAAABDI/nSoPHRQOO_w/s1600/new_vertual_machine_step3.JPG"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now provide name for image. Here “centos_second” name was chosen.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CIN1XL1I/AAAAAAAABDI/nSoPHRQOO_w/s1600/new_vertual_machine_step3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 239px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CIN1XL1I/AAAAAAAABDI/nSoPHRQOO_w/s320/new_vertual_machine_step3.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957274593144658" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now simply click on next button. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CLOmrU9I/AAAAAAAABDQ/Hxmx0u97emM/s1600/new_vertual_machine_step4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 239px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CLOmrU9I/AAAAAAAABDQ/Hxmx0u97emM/s320/new_vertual_machine_step4.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957326339593170" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Here select the type of OS is going to be installed. Centos is comes under linux and the version dropdown selected as “Other Linux (32-bit).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_a3vWkw3wrUY/S_6CO6e9DtI/AAAAAAAABDY/X9nGD5ZGr9I/s1600/new_vertual_machine_step5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 241px;" src="http://1.bp.blogspot.com/_a3vWkw3wrUY/S_6CO6e9DtI/AAAAAAAABDY/X9nGD5ZGr9I/s320/new_vertual_machine_step5.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957389657968338" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;   &lt;/span&gt;Virtual disk size should provide how much space required OS and workspace. Click on next .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_a3vWkw3wrUY/S_6CSGWQjfI/AAAAAAAABDg/EQMEIUX6WdY/s1600/new_vertual_machine_step6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 171px;" src="http://1.bp.blogspot.com/_a3vWkw3wrUY/S_6CSGWQjfI/AAAAAAAABDg/EQMEIUX6WdY/s320/new_vertual_machine_step6.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957444382330354" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now select the “Edit the…” check box and click on continue.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CVdDqyxI/AAAAAAAABDo/ylb8NCHqIf4/s1600/new_vertual_machine_step7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 273px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/S_6CVdDqyxI/AAAAAAAABDo/ylb8NCHqIf4/s320/new_vertual_machine_step7.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957502017981202" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Select the New CD/DVD (adding) from left panel. On right side select one of the options for device type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;Client device:-&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; If Installation source DVD is at client machines drive , select client machine .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;Host device:-&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; If&lt;span style=""&gt;  &lt;/span&gt;Installation source DVD is at servers drive, select “Host Device” automatically gets the location.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;Datastore ISO:- &lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Select the location of ISO image location in sever.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Click on finish button.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now in the left panel, there will be VM image point for Centos with name what earlier provided.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;See the below screenshot,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Right click on the point created with name specified earlier and move mouse over the power option and select power on option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now status of the operation will show at the bottom panel (Not shown in screenshot). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Again right click on the CENTOS_51 and select “Open console”&lt;span style=""&gt;  &lt;/span&gt;to open terminal.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;In terminal see the booting operation, if booting sequence is not in the order that you specified where source of installation (image) then change the boot sequence. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;To change boot sequence click alt+ctrl+insert to reboot the machine and press “f2” or correspond key to enter in to boot sequence and change the boot sequence, save and exit. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_a3vWkw3wrUY/S_6CYEuO_0I/AAAAAAAABDw/whEZz7LOsdQ/s1600/power_on.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 315px;" src="http://3.bp.blogspot.com/_a3vWkw3wrUY/S_6CYEuO_0I/AAAAAAAABDw/whEZz7LOsdQ/s320/power_on.JPG" alt="" id="BLOGGER_PHOTO_ID_5475957547025235778" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now system boot from DVD or image. From her onwards road will be clear as simple as normal installation. After installation normal GUI comes and do your operation. Do power off from right option where we use to power on the OS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;If already one instance is installed with centos_1 and need to install same OS with same configuration say centos_2. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now the procedure is:- Assumed that centos_1 is installed and working fine. Now create instance with centos_2 from “New Virtual Machine” option after finished this. Installing OS from CD or DVD.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;SSH to VMware server&lt;span style=""&gt;  &lt;/span&gt;and go to source directory where all vmdk files will be stored file will be centos_1/centos_1-flat.vmdk&lt;span style=""&gt;  &lt;/span&gt;and size will be same as size mentioned while installing copy this file into centos_2/ this directory and rename to centos_2-flat.vmdk.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Now from client power on the centos_2 it will straightaway works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3630373921334479577?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3630373921334479577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3630373921334479577&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3630373921334479577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3630373921334479577'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/05/installing-os-in-vmware-and-accessing.html' title='Installing OS in VMware and accessing from VM Client'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_a3vWkw3wrUY/S_6Bs35SgVI/AAAAAAAABCo/0nsIScuCEzA/s72-c/vmsphere.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-925244505039224577</id><published>2010-05-25T11:31:00.000+05:30</published><updated>2010-05-25T11:38:12.239+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Testing and types of testing</title><content type='html'>&lt;span style="font-weight: bold;font-size:180%;" &gt;Software Testing:-&lt;/span&gt;&lt;br /&gt;It is the process used to help identify the correctness, completeness, security and quality of developed computer software.&lt;br /&gt;Basically testing is of two types say black box and white box&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;Black box testing:-&lt;/span&gt;&lt;br /&gt;Black box being an external view of the test object.&lt;br /&gt;Types of black box testing&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;I)functional testing:- &lt;/span&gt;In this type of testing, the software is tested for the functional requirements. The tests are written in order to check if the application behaves as expected. Although functional testing is often done toward the end of the development cycle, it can and should, be started much earlier. Individual components and processes can be tested early on, even before it's possible to do functional testing on the entire system. Functional testing covers how well the system executes the functions it is supposed to execute including user commands, data manipulation, searches and business processes, user screens, and integrations. Functional testing covers the obvious surface type of functions, as well as the back-end operations (such as security and how upgrades affect the system).&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;II)Stress testing:- &lt;/span&gt;Stress test is repeated until a level of stress is reached that is higher than expected to be present at a customer site. Race conditions and memory leaks are often found under stress testing.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;III) Load testing :-&lt;/span&gt; Load testing does not aim to break the system by overwhelming it, but instead tries to keep the system constantly humming like a well-oiled machine.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IV) Ad-hoc:-&lt;/span&gt;This type of testing is done without any formal Test Plan.&lt;br /&gt;V)Exploratory testing:- This testing is similar to the ad-hoc testing and is done in order to learn/explore the application. Yet it doesn't get much respect in our field. It can be considered as “Scientific Thinking” at real time&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;VI)Usability testing:- &lt;/span&gt;This testing is also called as ‘Testing for User-Friendliness’. This testing is done if User Interface of the application stands an important consideration and needs to be specific for the specific type of user.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;VII) Smoke test:-&lt;/span&gt; This type of testing is also called &lt;span style="font-style: italic; font-weight: bold;"&gt;sanity testing &lt;/span&gt;and is done in order to check if the application is ready for further major testing.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;VIII)Recovery test:-&lt;/span&gt; Recovery testing is basically done in order to check how fast and better the application can recover against any type of crash or hardware failure etc.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IX)Volume test:- &lt;/span&gt;Volume testing is done against the efficiency of the application. Huge amount of data is processed through the application (which is being tested) in order to check the extreme limitations of the system.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;X)Domain test:-&lt;/span&gt; Domain testing is the most frequently described test technique. Some authors write only about domain testing when they write about test design. The basic notion is that you take the huge space of possible tests of an individual variable and subdivide it into subsets that are (in some way) equivalent. Then you test a representative from each subset.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XI)Scenario test:-&lt;/span&gt; Scenario tests are realistic, credible and motivating to stakeholders, challenging for the program and easy to evaluate for the tester. They provide meaningful combinations of functions and variables rather than the more artificial combinations you get with domain testing or combinatorial test design.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XII)Regression test:- &lt;/span&gt;Regression testing is a style of testing that focuses on retesting after changes are made. In traditional regression testing, we reuse the same tests (the regression tests). In risk-oriented regression testing, we test the same areas as before, but we use different (increasingly complex) tests. Traditional regression tests are often partially automated. These note focus on traditional regression.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XIII) User acceptance test:-&lt;/span&gt; In this type of testing, the software is handed over to the user in order to find out if the software meets the user expectations and works as it is expected to. In software development, &lt;span style="font-weight: bold;"&gt;user acceptance testing &lt;/span&gt;(UAT) - also called beta testing.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XIV)Alpha test:-&lt;/span&gt; In this type of testing, the users are invited at the development center where they use the application and the developers note every particular input or action carried out by the user. Any type of abnormal behavior of the system is noted and rectified by the developers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;White box testing:-&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;white box being an internal view&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;I)Unit testing:&lt;/span&gt;-The developer carries out unit testing in order to check if the particular module or unit of code is working fine. The Unit Testing comes at the very basic level as it is carried out as and when the unit of the code is developed or a particular functionality is built. Unit testing deals with testing a unit as a whole.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;II)Static and dynamic analysis:-&lt;/span&gt; Static analysis involves going through the code in order to find out any possible defect in the code. Dynamic analysis involves executing the code and analyzing the output.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;III)Statement coverage:-&lt;/span&gt; In this type of testing the code is executed in such a manner that every statement of the application is executed at least once. It helps in assuring that all the statements execute without any side effect.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IV)Branch coverage:-&lt;/span&gt;  No software application can be written in a continuous mode of coding, at some point we need to branch out the code in order to perform a particular functionality. Branch coverage testing helps in validating of all the branches in the code and making sure that no branching leads to abnormal behavior of the application.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;V)Security testing:-&lt;/span&gt; Security testing is carried out in order to find out how well the system can protect itself from unauthorized access, hacking – cracking, any code damage etc. which deals with the code of application. This type of testing needs sophisticated testing techniques.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;VI)Mutation testing:- &lt;/span&gt;A kind of testing in which, the application is tested for the code that was modified after fixing a particular bug/defect. It also helps in finding out which code and which strategy of coding can help in developing the functionality effectively.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.testingbrain.com/"&gt;Source and reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-925244505039224577?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/925244505039224577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=925244505039224577&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/925244505039224577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/925244505039224577'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/05/testing-and-types-of-testing.html' title='Testing and types of testing'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8400103898589762554</id><published>2010-05-13T12:29:00.000+05:30</published><updated>2010-05-13T12:34:28.385+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Interactive map of linux</title><content type='html'>http://www.makelinux.net/kernel_map?src=ldd3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8400103898589762554?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8400103898589762554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8400103898589762554&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8400103898589762554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8400103898589762554'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/05/interactive-map-of-linux.html' title='Interactive map of linux'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8634361301421858924</id><published>2010-04-30T12:28:00.000+05:30</published><updated>2010-07-23T10:35:22.722+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Installation and usage of netperf</title><content type='html'>As name implies netperf is used to estimate network performance in various respects using tcp and udp. There is lot of &lt;a href="http://www.cs.kent.edu/%7Efarrell/dist/ref/Netperf.html"&gt;help&lt;/a&gt; available in net, just do a simple search is enough.&lt;br /&gt;&lt;br /&gt;What ever iam providing here is a simple installation procedure and a small examples.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$wget ftp://ftp.netperf.org/netperf/netperf-2.4.5.tar.bz2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$./configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$make&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;$su&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#make install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a latest version is availabel but i got some issues after installation and went back to this version insted of debugging. (Lack of time).&lt;br /&gt;&lt;br /&gt;For simple test run&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#netserver&lt;/span&gt;&lt;br /&gt;This will run netperf server, this first time run at local machine.&lt;br /&gt;&lt;br /&gt;Now run&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#netperf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to localhost.localdomain (127.0.0.1) port 0 AF_INET&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Recv         Send           Send                          &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Socket   Socket      Message    Elapsed              &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Size       Size          Size               Time             Throughput  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;bytes      bytes        bytes             secs.           10^6bits/sec  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; 87380    16384      16384            10.01             3684.63  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now these are the statistics when server and client are running on same machine.&lt;br /&gt;Lets try on remote machine(192.168.2.190).&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[root@remote net]#&lt;span style="font-style: italic;"&gt;netserver&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Starting netserver at port 12865&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now server is ready and starting client at local machien is required.&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;[root@localhost net]#  netperf -H 192.168.2.196&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.2.196 (192.168.2.196) port 0 AF_INET&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Recv             Send           Send                          &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Socket       Socket      Message          Elapsed              &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Size             Size             Size                     Time            Throughput  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;bytes          bytes        bytes                  secs.            10^6bits/sec  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; 87380        16384      16384                10.23                  94.15 &lt;/span&gt;  &lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Oh!! throughput 94.15 ofcource expected value will be less compared to localhost.&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;There is lot of options available with &lt;a href="http://www.cs.kent.edu/%7Efarrell/dist/ref/Netperf.html#0.2.2Z141Z1.SUJSTF.8R2DBD.I"&gt;this&lt;/a&gt;.&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8634361301421858924?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8634361301421858924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8634361301421858924&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8634361301421858924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8634361301421858924'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/04/installation-and-usage-of-netperf.html' title='Installation and usage of netperf'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5895994354851073038</id><published>2010-03-06T18:04:00.001+05:30</published><updated>2010-03-06T18:04:59.605+05:30</updated><title type='text'>Dead Donkey.. Nice one...</title><content type='html'>&lt;b&gt;&lt;u&gt;The Dead Donkey!!&lt;/u&gt;&lt;/b&gt; &lt;br&gt;&lt;div class="gmail_quote"&gt;&lt;div class="gmail_quote"&gt;&lt;div bgcolor="#ffffff" text="#000000"&gt;&lt;div&gt;&lt;div class="h5"&gt;   &lt;br&gt; City boy, Raj, moved to the village and bought a donkey from an old farmer for Rs.1000. The farmer agreed to deliver the donkey the next day. &lt;br&gt; The next day the farmer drove up and said, &amp;quot;Sorry Raj-ji, but I have some bad news. The donkey died while I was bringing him here.&amp;quot; &lt;br&gt; Raj replied: &amp;quot;Well then, just give me my money back.&amp;quot; &lt;br&gt; The farmer said: &amp;quot;Can&amp;#39;t do that either. I went and spent it already.&amp;quot; &lt;br&gt; Raj said: &amp;quot;OK then, just unload the donkey.&amp;quot; &lt;br&gt; The farmer asked: &amp;quot;What you are going to do with a dead donkey?!&amp;quot; &lt;br&gt; Raj: &amp;quot;I&amp;#39;m going to raffle him off.&amp;quot; (Note: Raffle is like lottery - a group of people draw lots each paying the same amount for a ticket and there is a big prize for the people who win.) &lt;br&gt; Farmer: &amp;quot;You can&amp;#39;t raffle off a dead donkey!&amp;quot; &lt;br&gt; Raj: &amp;quot;Sure I can. Watch me. I just won&amp;#39;t tell anybody he&amp;#39;s dead.&amp;quot; &lt;br&gt; A month later the farmer met up with Raj and asked, &amp;quot;What happened with that dead donkey?&amp;quot; &lt;br&gt; Raj: &amp;quot;I raffled him off. I sold 500 tickets at Rs.10 each and made a profit of Rs.4990 with the donkey worth Rs.1000 as the prize.&amp;quot; &lt;br&gt; Farmer: &amp;quot;Didn&amp;#39;t anyone complain?&amp;quot; &lt;br&gt; Raj: &amp;quot;Just the guy who won. So I gave him back his Rs.10&amp;quot; &lt;br&gt;   &lt;br&gt; &lt;/div&gt;&lt;/div&gt;&lt;b&gt;Moral of the story - No situation is so bad that it cannot be turned around. You need to just think hard, sorry! smart .&lt;/b&gt; &lt;/div&gt;  &lt;/div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5895994354851073038?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5895994354851073038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5895994354851073038&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5895994354851073038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5895994354851073038'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/03/dead-donkey-nice-one.html' title='Dead Donkey.. Nice one...'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-4453762242035327458</id><published>2010-02-10T17:55:00.000+05:30</published><updated>2010-02-10T20:55:00.785+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Install cpulimit</title><content type='html'>&lt;h2&gt;Install cpulimit&lt;/h2&gt; &lt;p&gt;Type the following commands to install latest stable release:&lt;br /&gt;&lt;code&gt;# cd /tmp&lt;br /&gt;# wget '&lt;a href="http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz" target="_blank"&gt;http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz&lt;/a&gt;'&lt;br /&gt;# tar -zxvf cpulimit-1.1.tar.gz&lt;br /&gt;# cd cpulimit-1.1&lt;br /&gt;# make&lt;br /&gt;# cp cpulimit /usr/local/sbin/&lt;br /&gt;# rm -rf cpulimit*&lt;/code&gt;&lt;/p&gt; &lt;h3&gt;A note about Debian / Ubuntu Linux users&lt;/h3&gt; &lt;p&gt;Type the following command to install cpulimit:&lt;br /&gt;&lt;code&gt;$ sudo apt-get update&lt;br /&gt;$ sudo apt-get install cpulimit&lt;/code&gt;&lt;/p&gt; &lt;h2&gt;How do I use cpulimit?&lt;/h2&gt; &lt;p&gt;To limit CPU usage of the process called firefox to 30%, enter:&lt;br /&gt;&lt;code&gt;# cpulimit -e firefox -l 30&lt;/code&gt;&lt;br /&gt;To limit CPU usage of the process to 30% by using its PID, enter:&lt;br /&gt;&lt;code&gt;# cpulimit -p 1313 -l 30&lt;/code&gt;&lt;br /&gt;To find out PID of the process use any of the following:&lt;br /&gt;&lt;code&gt;# ps aux | less&lt;br /&gt;# &lt;a href="http://www.cyberciti.biz/faq/tag/ps-command/" target="_blank"&gt;ps aux&lt;/a&gt; | grep firefox&lt;br /&gt;# &lt;a href="http://www.cyberciti.biz/faq/tag/pgrep-command/" target="_blank"&gt;pgrep&lt;/a&gt; -u vivek php-cgi&lt;br /&gt;# pgrep lighttpd&lt;/code&gt;&lt;br /&gt;You can also use absolute path name of the executable, enter:&lt;br /&gt;&lt;code&gt;# cpulimit -P /opt/firefox/firebox -l 30&lt;/code&gt;&lt;br /&gt;Where,&lt;/p&gt; &lt;ul&gt;&lt;li&gt;-p : Process PID.&lt;/li&gt;&lt;li&gt;-e : Process name.&lt;/li&gt;&lt;li&gt;-l : percentage of CPU allowed from 0 to 100. &lt;/li&gt;&lt;li&gt;-P: absolute path name of the executable program file.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-4453762242035327458?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/4453762242035327458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=4453762242035327458&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4453762242035327458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4453762242035327458'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/02/install-cpulimit.html' title='Install cpulimit'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3849555233560514572</id><published>2010-02-01T21:12:00.001+05:30</published><updated>2010-02-01T21:15:20.026+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='time pass'/><title type='text'>Interesting Charts</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2-n-XQEI/AAAAAAAAApA/mXX3ac3HfeU/s1600-h/8.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 310px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2-n-XQEI/AAAAAAAAApA/mXX3ac3HfeU/s320/8.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301556211957826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2-BD1lAI/AAAAAAAAAo4/deCxcuYBcfI/s1600-h/7.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 294px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2-BD1lAI/AAAAAAAAAo4/deCxcuYBcfI/s320/7.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301545765934082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_a3vWkw3wrUY/S2b297G_rEI/AAAAAAAAAow/FTs4Mg_c9VQ/s1600-h/6.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 300px;" src="http://3.bp.blogspot.com/_a3vWkw3wrUY/S2b297G_rEI/AAAAAAAAAow/FTs4Mg_c9VQ/s320/6.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301544168565826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2h_dWgCI/AAAAAAAAAoo/UzHIQoOIylE/s1600-h/5.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 299px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2h_dWgCI/AAAAAAAAAoo/UzHIQoOIylE/s320/5.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301064299741218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_a3vWkw3wrUY/S2b2hWftg-I/AAAAAAAAAog/iTWx3N3g0Ok/s1600-h/4.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 302px;" src="http://3.bp.blogspot.com/_a3vWkw3wrUY/S2b2hWftg-I/AAAAAAAAAog/iTWx3N3g0Ok/s320/4.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301053303784418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2hCqtTII/AAAAAAAAAoY/6NQZD_syHrc/s1600-h/3.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 288px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2hCqtTII/AAAAAAAAAoY/6NQZD_syHrc/s320/3.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301047981198466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/S2b2go9F13I/AAAAAAAAAoQ/4WxRSvrGSeU/s1600-h/2.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 300px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/S2b2go9F13I/AAAAAAAAAoQ/4WxRSvrGSeU/s320/2.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301041078982514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_a3vWkw3wrUY/S2b2gHsyr0I/AAAAAAAAAoI/arggzQ22Xl8/s1600-h/1.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 315px;" src="http://3.bp.blogspot.com/_a3vWkw3wrUY/S2b2gHsyr0I/AAAAAAAAAoI/arggzQ22Xl8/s320/1.jpeg" alt="" id="BLOGGER_PHOTO_ID_5433301032152248130" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3849555233560514572?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3849555233560514572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3849555233560514572&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3849555233560514572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3849555233560514572'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/02/interesting-charts_01.html' title='Interesting Charts'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_a3vWkw3wrUY/S2b2-n-XQEI/AAAAAAAAApA/mXX3ac3HfeU/s72-c/8.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8064626693363139086</id><published>2010-01-25T17:32:00.000+05:30</published><updated>2010-01-25T17:52:51.634+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pictures'/><category scheme='http://www.blogger.com/atom/ns#' term='time pass'/><title type='text'>Hights in advertisement</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Happy to Help&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_a3vWkw3wrUY/S12I1iYbyoI/AAAAAAAAAoA/KJdhX8bqzmQ/s1600-h/voda.jpg"&gt;&lt;img style="cursor: pointer; width: 420px; height: 236px;" src="http://1.bp.blogspot.com/_a3vWkw3wrUY/S12I1iYbyoI/AAAAAAAAAoA/KJdhX8bqzmQ/s320/voda.jpg" alt="" id="BLOGGER_PHOTO_ID_5430647179022420610" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8064626693363139086?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8064626693363139086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8064626693363139086&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8064626693363139086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8064626693363139086'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/01/hights-in-advertisement.html' title='Hights in advertisement'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_a3vWkw3wrUY/S12I1iYbyoI/AAAAAAAAAoA/KJdhX8bqzmQ/s72-c/voda.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-6720123860349181580</id><published>2010-01-23T21:23:00.000+05:30</published><updated>2010-01-23T21:25:31.721+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><title type='text'>megan fox video</title><content type='html'>&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/ssOJQXdwmrI&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/ssOJQXdwmrI&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-6720123860349181580?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/6720123860349181580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=6720123860349181580&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6720123860349181580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6720123860349181580'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/01/megan-fox-video.html' title='megan fox video'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-9103820168444467762</id><published>2010-01-23T14:10:00.000+05:30</published><updated>2010-01-23T21:21:25.378+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='time pass'/><title type='text'>Management Lesson</title><content type='html'>&lt;div class="gmail_quote"&gt;&lt;div bg text="#000000" style="color:#ffffff;"&gt;&lt;div class="gmail_quote"&gt;&lt;div link="blue" vlink="purple" lang="EN-US"&gt;&lt;div&gt; &lt;p style="text-align: center;" align="center"&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-family:Cambria;color:red;"&gt;&lt;span style="font-weight: bold; font-style: italic;font-family:Cambria;color:red;"  &gt;Management Lesson&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;One fine day, a bus driver went to the bus garage, started his bus, and drove off along the route. No problems for the first few stops - a few people got on, a few got off, and things went generally well. &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;At the next stop, however, a big hulk of a guy got on. Six feet eight, built like a wrestler, arms hanging down to the ground. He glared at the driver and said, "Big John doesn't pay!" and sat down at the back. &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;Did I mention that the driver was five feet three, thin, and basically week? Well, he was. Naturally, he didn't argue with Big John, but he wasn't happy about it. The next day the same thing happened - Big John got on again, made a show of refusing to pay, and sat down.  And the next day, and the next. &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;This grated on the bus driver, who started losing sleep over the way Big John was taking advantage of him. Finally he could stand it no longer. He signed up for body building courses, karate, judo, and all that good stuff. &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;By the end of the summer, he had become quite strong; what's more, he felt really good about himself. So on the next Monday, when Big John once again got on the bus and said, "Big John doesn't pay!" &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;The driver stood up, glared back at the passenger, and screamed, &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-family:Cambria;color:red;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:red;"  &gt;"And why not?"&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt;With a surprised look on his face, Big John replied, &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-family:Cambria;color:red;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:red;"  &gt;"Big John has a bus pass."&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-family:Cambria;color:fuchsia;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:fuchsia;"  &gt;Management Lesson: &lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;span style="font-family:Cambria;color:blue;"&gt;&lt;span style="font-weight: bold;font-family:Cambria;color:blue;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-family:Cambria;color:fuchsia;"&gt;&lt;span style="font-weight: bold; font-style: italic;font-family:Cambria;color:fuchsia;"  &gt;"Be sure there is a problem in the first place&lt;span style="text-decoration: none;"&gt; &lt;/span&gt;before working hard to solve one."&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-9103820168444467762?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/9103820168444467762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=9103820168444467762&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9103820168444467762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9103820168444467762'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/01/management-lesson.html' title='Management Lesson'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8794507123420213753</id><published>2010-01-22T16:10:00.000+05:30</published><updated>2010-01-23T21:26:33.367+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><category scheme='http://www.blogger.com/atom/ns#' term='time pass'/><title type='text'>telugu best comedy sceens with top heros</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Take one:-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="325" height="244"&gt;&lt;param name="movie" value="http://www.youtube.com/v/jXhtCIiv0gM&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/jXhtCIiv0gM&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="325" height="244"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Take two:-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="325" height="244"&gt;&lt;param name="movie" value="http://www.youtube.com/v/HWVGQogged8&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/HWVGQogged8&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="325" height="244"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Take threee:-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="325" height="244"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xEi1CbejFMw&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/xEi1CbejFMw&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="325" height="244"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8794507123420213753?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8794507123420213753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8794507123420213753&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8794507123420213753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8794507123420213753'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/01/vidos.html' title='telugu best comedy sceens with top heros'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-6640730483047633298</id><published>2010-01-22T16:04:00.000+05:30</published><updated>2010-01-22T16:05:04.285+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='time pass'/><title type='text'>Murphy's laws on girls</title><content type='html'>1. If u think a girl is beautiful, she'll always have a boyfriend to confirm that.&lt;br /&gt; &lt;br /&gt;2. The nicer she is...the quicker u will be dumped!!!!!&lt;br /&gt; &lt;br /&gt;3. The more the makeup, worse the looks...&lt;br /&gt; &lt;br /&gt;4. "99% of the girls in this world are beautiful. Remaining 1% would always be in your company."............ .....100% true.&lt;br /&gt; &lt;br /&gt;5. The guy standing next to a beautiful girl can never be her brother.&lt;br /&gt; &lt;br /&gt;6. If by any chance the girl you like, likes you too, she will let you know in about 10 years from now ,when you are committed..&lt;br /&gt; &lt;br /&gt;7. The more you ignore a girl, the more she'll want to be friends with you.&lt;br /&gt; &lt;br /&gt;8. Theory of relativity......&lt;br /&gt;The more u run towards a hot chick....the more she goes away from u...&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;9. Rule 1: Even if you got her out alone... Just when you are about to let her know about your feelings...she will spot a long lost friend (I guess from Kumbh ka Mela)&lt;br /&gt;Corollary to rule 1: The more desperate you are to tell your feelings to a girl on a private chat, the more probability the long lost friend she discovered is a handsome superman, who beats you in everything 9:1&lt;br /&gt;Axiom 1: The more dedicated you are to the girl, the longer it takes before things work out, but ultimately it will (some smile for the guys).&lt;br /&gt; &lt;br /&gt;10. The day the chick you really like comes and speaks to you will be the day when-&lt;br /&gt; &lt;br /&gt;a. You are dressed badly&lt;br /&gt;b. You forgot to brush your teeth for the first time in your life&lt;br /&gt;c. Have a bad hair day.&lt;br /&gt; &lt;br /&gt;11. All the good girls are either nuns or married. The rest go around with u and ruin your money, health and leave u a total wreck.&lt;br /&gt; &lt;br /&gt;12. The more seriously u like a girl...the more seriously her dad will hate u.&lt;br /&gt; &lt;br /&gt;13. The love you shower a girl with is directly proportional to the number of bullets her dad will be showering at you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-6640730483047633298?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/6640730483047633298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=6640730483047633298&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6640730483047633298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6640730483047633298'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2010/01/murphys-laws-on-girls.html' title='Murphy&apos;s laws on girls'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8410887249564585706</id><published>2009-12-14T12:25:00.000+05:30</published><updated>2009-12-23T20:45:36.247+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='news reviews'/><title type='text'>Why people wants TELANGANA</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_a3vWkw3wrUY/SzI0DqRXLAI/AAAAAAAAAMI/qLYXeqNVYys/s1600-h/Truth+please+read.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 211px; height: 320px;" src="http://2.bp.blogspot.com/_a3vWkw3wrUY/SzI0DqRXLAI/AAAAAAAAAMI/qLYXeqNVYys/s320/Truth+please+read.jpg" alt="" id="BLOGGER_PHOTO_ID_5418450539171490818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Telangana was a separate state until 1956. There were certain rules while merging it with Andhra like Mulki rules, Presidential orders, Six Principles, GO610, 6th Zone etc as Telangana people were not interested in merging. None of these conditions were followed in last 50 years in combined AP. Telangana people waited patiently for last 50 years. Nothing happened but this discrimination increased. IT IS THE DUTY OF ALL TELANGANA PEOPLE to see that our next generations don’t suffer the similar fate.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Discrimination of Telangana is MULTI-FOLD&lt;br /&gt;1) Water&lt;br /&gt;2) Jobs&lt;br /&gt;3) Derogatory remarks about Telanganites&lt;br /&gt;4) Development and Revenue generated&lt;br /&gt;5) Political Power&lt;br /&gt;6) Hyderabad&lt;/p&gt; &lt;p&gt;&lt;br /&gt;TELANGANA&lt;br /&gt;If Telangana is created, none of Non-Telangana people will have any problem for their business or houses or jobs if they are already living in Telangana/Hyderabad. Few Non-Telangana politicians for their Real estate business interests and other personal gains, opposing Telangana state.&lt;br /&gt;Naxalism is just a reason for the other area leaders to oppose Telangana. Telangana will have more benefits even with Naxalism if separate state is created, because we need IRRIGATION WATER, we need JOBS, we need DEVELOPMENT, we need RESPECT for Telangana culture and people. WE ARE ASKING FOR OUR RIGHTFUL SHARE OF THESE, not somebody’s share of water/jobs etc&lt;/p&gt;  &lt;p&gt;&lt;br /&gt;WATER&lt;br /&gt;Two major rivers Krishna Godavari pass through Telangana and there is no major irrigation project in Telangana. Total irrigated area in entire Telangana is lessthan what’s there in Guntur dist. alone. Height of discrimination: Projects built on Telangana land for the benefit of Non-Telangana areas. AP major irrigation minister Ponnala Lakshmaiah constituency doesn’t have drinking water also forget about irrigation water, but he takes water from Pothireddypadu (Telangana) to Rayalaseema 400 KM away&lt;/p&gt;  &lt;p&gt;&lt;br /&gt;JOBS&lt;br /&gt;Govt. jobs (though 20-30%) are important as they control the rest of all other jobs (70-80%). They decide which area to develop, who should be promoted, where an industry/infrastructure should be developed, who should get govt benefits etc.&lt;br /&gt;Any state govt. office in Hyderabad like secretariat, irrigation, R&amp;amp;B, police, home ministry, high court is filled with 90 of Non-Telangana employees. None of them make any project proposal in Telangana and won’t release funds to Telangana areas. This is due to recommendations and political dominations of non-Telangana leaders&lt;/p&gt;  &lt;div&gt;&lt;br /&gt;DEROGATORY REMARKS ABOUT TELANGANITES&lt;br /&gt;Non-Telangana people make very derogatory remarks about Telanganites in movies. Just because they dominate entire Telugu Film Industry doesn’t mean, they should do such things. Other thing they say Telangana people are lazy. I strongly object this comment. Generally, it’s the hard working people who migrate for better earning and quality living. Migrated people compare with some local lazy guy and say Telangana people are lazy. Lazy people are there everywhere, usually lower 20% in any region falls in this. If you go to Non-Telangana area they will be there in equal numbers. DON’T COMPARE A MIGRATED PERSON WITH LOCAL PERSON.&lt;/div&gt;  &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;br /&gt;DEVELOPMENT AND REVENUE GENERATED&lt;br /&gt;Even before merging Telangana with Andhra, it had surplus revenue generated in Hyd state. Now Telangana contributes 60% total revenue/tax generated for AP and most of this is spent in non-Telangana areas. There is no major industry, development in Telangana apart from what’s there in Hyd. No development corridors(like Coastal corridor), major ports, irrigation water which benefit locals. Even for the development of Hyderabad, it’s the TELANGANA people who lost their land &amp;amp; water for roads, road expansions, airport projects, SEZs projects and GOT NOTHING in return.&lt;br /&gt;For the people who say Non-Telangana people invested/developed Hyderabad, they did it for their business gains, NOT FOR DEVELOPING TELANGANA and they are getting their profits for it. Even for building any of these major projects its 90% Telangana labour who worked on this.&lt;/div&gt;  &lt;p&gt;POLITICAL POWER&lt;br /&gt;It is one of the important factors for any area development. In the combined AP history of last 53 years, Andhra CMs ruled for 24 years, Rayalseema CMs rules for 22 years and Telangana CMs for 6 years. In this 6 years, 3 Telangana CM were used as make-shift arrangements while changing some of non-Telangana CMs. Telangana CMs never got power as CM and were never allowed to be CM by other area leaders. Each ruled for hardly a year or so before they were removed. Somuch discrimination wouldn’t had occurred, if Telangana CMs were also allowed to rule. If Non-Telangana CMs are smarter/brighter, why they never developed anything in Telangana area? Why no govt jobs/benefits/water projects in Telangana?&lt;/p&gt;  HYDERABAD&lt;br /&gt;Hyderabad is the capital of Telangana from 400 years. It’s all surrounded by Telangana districts on all sides. Hyderabad is not like Chandigarh on the boarder of two states to make it Union Territory. It’s the hard work and tax collected from Telangana people by Nizams over 400 years, Hyderabad is built. HIGH COURT, ASSEMBLY, OSMANIA HOSPITAL/UNIVERSITY, HUSSAIN SAGAR, KACHEGUDA, BEGUMPET AIRPORT, all of these were built by Telangana people.&lt;br /&gt;When Andhra separated from Madras state, it didn’t get Chennai. When Gujrat separated from Maharastra, they didn’t get Mumbai. Similarly Hyderabad belongs to Telangana people.&lt;br /&gt;Investments made by Non-Telangana people in Hyderabad much less compared to what they invested in Bangalore. And many Telugus live and do business in Bangalore, so they need Bangalore?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8410887249564585706?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8410887249564585706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8410887249564585706&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8410887249564585706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8410887249564585706'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/12/why-people-wants-telangana.html' title='Why people wants TELANGANA'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_a3vWkw3wrUY/SzI0DqRXLAI/AAAAAAAAAMI/qLYXeqNVYys/s72-c/Truth+please+read.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-1441377257463969003</id><published>2009-11-03T11:12:00.000+05:30</published><updated>2009-11-03T11:16:20.794+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless tools'/><title type='text'>Installation and usage of fakeap tool</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Installation and usage of fakeap tool:&lt;/span&gt;&lt;br /&gt;Download fakeap-0.3.2-1.0.rh7.rf.noarch.rpm, hostapd-0.6.9.tar.gz.&lt;br /&gt;Install bridge-utils-1.1-2 rpm.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Installing hostapd:-&lt;/span&gt;&lt;br /&gt;Untar  hostapd-0.6.9.tar.gz.&lt;br /&gt;cd hostapd-0.6.9/hostapd/&lt;br /&gt;copy the defconfig file with the name .config (hidden file).&lt;br /&gt;cp defconfig .config&lt;br /&gt;&lt;br /&gt;Uncommon CONFIG_DRIVER_MADWIFI=y and CFLAGS += -I../../madwifi&lt;br /&gt;Change CFLAGS path to the path where madwifi source code exit. In my case it is  CFL CFLAGS += -I/home/softwares/madwifi-0.9.4/&lt;br /&gt;and make , make install.&lt;br /&gt;&lt;br /&gt;Now for fakeap simply say 'rpm -ivh fakeap-0.3.2-1.0.rh7.rf.noarch.rpm.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Using fakeap tool:-&lt;/span&gt;&lt;br /&gt;#rmmod ath_pci&lt;br /&gt;#modprob ath_pci autocreate=ap&lt;br /&gt;#ifconfig ath0 0.0.0.0 up&lt;br /&gt;#ifconfig eth0 0.0.0.0 up&lt;br /&gt;#brctl addbr br0&lt;br /&gt;#brctl addif br0 ath0&lt;br /&gt;#brctl addif br0 eth0&lt;br /&gt;#wlanconfig ath create wlandev wifi0 wlanmode monitor&lt;br /&gt;#ifconfig ath1 up&lt;br /&gt;vi madwifi.conf add below lines&lt;br /&gt;#--------------------------------------------------&lt;br /&gt;# Configuration File for WPA-PSK&lt;br /&gt;interface=ath0&lt;br /&gt;bridge=br0&lt;br /&gt;driver=madwifi&lt;br /&gt;logger_syslog=-1&lt;br /&gt;logger_syslog_level=2&lt;br /&gt;logger_stdout=-1&lt;br /&gt;logger_stdout_level=2&lt;br /&gt;debug=0&lt;br /&gt;dump_file=/tmp/hostapd.dump&lt;br /&gt;ctrl_interface=/var/run/hostapd&lt;br /&gt;ctrl_interface_group=0&lt;br /&gt;ssid=test_ssid&lt;br /&gt;macaddr_acl=0&lt;br /&gt;auth_algs=3&lt;br /&gt;wpa=3&lt;br /&gt;wpa_passphrase=XXXXXXXXXXX&lt;br /&gt;wpa_key_mgmt=WPA-PSK&lt;br /&gt;wpa_pairwise=TKIP CCMP&lt;br /&gt;#---------------------------------------------------&lt;br /&gt;&lt;br /&gt;#./hostapd -B madwifi.conf&lt;br /&gt;#perl /usr/bin/fakap&lt;br /&gt;It will print the help.&lt;br /&gt;ex usage:-&lt;br /&gt;perl /usr/bin/fakeap --interface ath0  --words /usr/share/doc/fakeap-0.3.2/lists/stefan-wordlist.txt --vendors /usr/share/doc/fakeap-0.3.2/lists/stefan-maclist.txt --channel 6 -sleep 0.01&lt;br /&gt;Using other pc open wireshark on wifi interface with monitor mode and check for beacon packets with different ssids and mac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-1441377257463969003?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/1441377257463969003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=1441377257463969003&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1441377257463969003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1441377257463969003'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/11/installation-and-usage-of-fakeap-tool.html' title='Installation and usage of fakeap tool'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5138058334830303384</id><published>2009-10-26T09:59:00.001+05:30</published><updated>2009-10-26T09:59:33.584+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>downloading linux iso using torrents.</title><content type='html'>In google search for you torrents iso link for source.&lt;br /&gt;I have searched for ubuntu and downloaded "ubuntu-9.04-desktop-i386.iso.torrent" its around 24 KB.&lt;br /&gt;&lt;br /&gt;If you don't have torrent downloader in linux&lt;br /&gt;http://sourceforge.net/projects/azureus/files/vuze/vuze-4.2.0.8/Vuze_4.2.0.8_linux.tar.bz2/download&lt;br /&gt;tar -jxvf Vuze_4.2.0.8_linux.tar.bz2&lt;br /&gt;cd vuze/&lt;br /&gt;./azureus &amp;&lt;br /&gt;It open vuze window&lt;br /&gt;(This tool available for windows also)&lt;br /&gt;It will open GUI for vuze.&lt;br /&gt;Press ctrl+o or chose file -&gt; open-&gt; torrent file.&lt;br /&gt;Click on "add file", browse and select torrent file which you already downloaded.&lt;br /&gt;Now torrent starts downloading file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5138058334830303384?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5138058334830303384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5138058334830303384&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5138058334830303384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5138058334830303384'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/10/downloading-linux-iso-using-torrents.html' title='downloading linux iso using torrents.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-2751642353210801886</id><published>2009-10-13T11:35:00.000+05:30</published><updated>2009-10-13T11:41:53.006+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><title type='text'>configure Bugzilla with gmail smtp</title><content type='html'>This article explains how to use GMAIL SMTP(TLS AUTH) to send bugzilla alerts.&lt;br /&gt;     Bugzilla supports following methods to send mail alerts :       &lt;ul&gt;&lt;li&gt;sendmail&lt;/li&gt;&lt;li&gt;SMTP&lt;/li&gt;&lt;/ul&gt;       For SMTP method BugZilla uses &lt;a href="http://search.cpan.org/%7Erjbs/Email-Send-2.194/lib/Email/Send/SMTP.pm"&gt;Email::Send::SMTP&lt;/a&gt; Perl module. GMAIL SMTP uses &lt;a href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer"&gt;TLS&lt;/a&gt; ( &lt;b&gt;T&lt;/b&gt;&lt;i&gt;ransport&lt;/i&gt; &lt;b&gt;L&lt;/b&gt;&lt;i&gt;ayer&lt;/i&gt; &lt;b&gt;S&lt;/b&gt;&lt;i&gt;ecurity&lt;/i&gt; ) as authentication method, so Email::Send::SMTP can not be used for the same.&lt;br /&gt;     We need to use another perl module &lt;a href="http://search.cpan.org/%7Efayland/Email-Send-SMTP-TLS-0.03/lib/Email/Send/SMTP/TLS.pm"&gt;Email::Send::SMTP::TLS&lt;/a&gt;.&lt;br /&gt;     First step would be to install Email::Send::SMTP::TLS from CPAN. use following steps to do so :       &lt;ul&gt;&lt;li&gt;using CPAN SHELL&lt;/li&gt;         Lanch CPAN shell as follows&lt;br /&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;#cpan&lt;br /&gt;capn&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="functions"&gt;install&lt;/code&gt; &lt;code class="plain"&gt;Email::Send::SMTP::TLS&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;cpan shell might ask you to install additional modules, install them.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;compiling from source&lt;/li&gt;        Download source from &lt;a href="http://search.cpan.org/%7Efayland/Email-Send-SMTP-TLS-0.03/lib/Email/Send/SMTP/TLS.pm"&gt;HERE&lt;/a&gt; and execute following commands&lt;br /&gt;&lt;div class="code"&gt;         &lt;div class="syntaxhighlighter" id="highlighter_179614"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;1.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="functions"&gt;tar&lt;/code&gt; &lt;code class="plain"&gt;zxvf Email-Send-SMTP-TLS-0.03.&lt;/code&gt;&lt;code class="functions"&gt;tar&lt;/code&gt;&lt;code class="plain"&gt;.gz&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;2.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="functions"&gt;cd&lt;/code&gt; &lt;code class="plain"&gt;Email-Send-SMTP-TLS-0.03&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;3.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="plain"&gt;./configure&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;4.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="functions"&gt;make&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;5.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="functions"&gt;make&lt;/code&gt; &lt;code class="functions"&gt;install&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;        &lt;/div&gt;&lt;/ul&gt;       Once Email:Send::SMTP::TLS is installed, BugZilla should have &lt;i&gt;SMTP::TLS&lt;/i&gt; method to send alerts. This can be verified by logging in as admin to BugZilla and going to &lt;b&gt;Administration -&gt; Parameters -&gt; Email&lt;/b&gt;       &lt;div class="code"&gt;        &lt;img src="http://www.dawood.in/images/bugzilla_tls_method.png" /&gt;       &lt;/div&gt; Now we need tweak BugZilla code. carefully execute following instructions and don't forget to backup files before you modify.&lt;br /&gt;     Go to your BugZilla installation directory and execute following command       &lt;div class="syntaxhighlighter" id="highlighter_360100"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;1.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="functions"&gt;cd&lt;/code&gt; &lt;code class="plain"&gt;Bugzilla&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;       Open &lt;i&gt;Mailer.pm&lt;/i&gt; file.       &lt;span style="color: rgb(255, 0, 0);"&gt;      &lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Search for following code( should be on line # 57)       &lt;/span&gt;&lt;div class="syntaxhighlighter" id="highlighter_544724"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;1.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;sub&lt;/code&gt; &lt;code class="plain"&gt;MessageToMTA {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;       &lt;span style="color: rgb(102, 102, 102);"&gt;add following line after it       &lt;/span&gt;&lt;div class="syntaxhighlighter" id="highlighter_645668"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;1.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;my&lt;/code&gt; &lt;code class="plain"&gt;(&lt;/code&gt;&lt;code class="variable"&gt;$smtp_server&lt;/code&gt;&lt;code class="plain"&gt;,&lt;/code&gt;&lt;code class="variable"&gt;$smtp_port&lt;/code&gt;&lt;code class="plain"&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;       &lt;span style="font-size:9;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;search for following if block         &lt;div class="syntaxhighlighter" id="highlighter_359621"&gt;&lt;div class="bar"&gt;&lt;div class="toolbar"&gt;&lt;a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="http://www.dawood.in/bugzilla_alerts_using_gmail.html#viewSource"&gt;&lt;/a&gt;&lt;a class="item about" style="width: 16px; height: 16px; color: rgb(255, 102, 102);" title="?" href="http://www.dawood.in/bugzilla_alerts_using_gmail.html#about"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="color: rgb(255, 0, 0);" class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;1.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;if&lt;/code&gt; &lt;code class="plain"&gt;(&lt;/code&gt;&lt;code class="variable"&gt;$method&lt;/code&gt; &lt;code class="plain"&gt;eq &lt;/code&gt;&lt;code class="string"&gt;"SMTP"&lt;/code&gt;&lt;code class="plain"&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;       and change it to               &lt;div style="color: rgb(255, 0, 0);" class="syntaxhighlighter" id="highlighter_818237"&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;01.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px ! important;"&gt;&lt;code class="keyword"&gt;if&lt;/code&gt; &lt;code class="plain"&gt;(&lt;/code&gt;&lt;code class="variable"&gt;$method&lt;/code&gt; &lt;code class="plain"&gt;eq &lt;/code&gt;&lt;code class="string"&gt;"SMTP"&lt;/code&gt; &lt;code class="plain"&gt;|| &lt;/code&gt;&lt;code class="variable"&gt;$method&lt;/code&gt; &lt;code class="plain"&gt;eq &lt;/code&gt;&lt;code class="string"&gt;"SMTP::TLS"&lt;/code&gt;&lt;code class="plain"&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;02.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;    &lt;/code&gt;&lt;span class="block" style="margin-left: 24px ! important;"&gt;&lt;code class="plain"&gt;(&lt;/code&gt;&lt;code class="variable"&gt;$smtp_server&lt;/code&gt;&lt;code class="plain"&gt;,&lt;/code&gt;&lt;code class="variable"&gt;$smtp_port&lt;/code&gt;&lt;code class="plain"&gt;) = &lt;/code&gt;&lt;code class="functions"&gt;split&lt;/code&gt; &lt;code class="plain"&gt;/:/,Bugzilla-&gt;params-&gt;{&lt;/code&gt;&lt;code class="string"&gt;"smtpserver"&lt;/code&gt;&lt;code class="plain"&gt;};&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;03.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;            &lt;/code&gt;&lt;span class="block" style="margin-left: 72px ! important;"&gt;&lt;code class="functions"&gt;push&lt;/code&gt; &lt;code class="variable"&gt;@args&lt;/code&gt;&lt;code class="plain"&gt;, &lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;04.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;                &lt;/code&gt;&lt;span class="block" style="margin-left: 96px ! important;"&gt;&lt;code class="plain"&gt;Host  =&gt; &lt;/code&gt;&lt;code class="variable"&gt;$smtp_server&lt;/code&gt;&lt;code class="plain"&gt;,&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;05.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;                &lt;/code&gt;&lt;span class="block" style="margin-left: 96px ! important;"&gt;&lt;code class="plain"&gt;User =&gt; Bugzilla-&gt;params-&gt;{&lt;/code&gt;&lt;code class="string"&gt;"smtp_username"&lt;/code&gt;&lt;code class="plain"&gt;},&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;06.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;                &lt;/code&gt;&lt;span class="block" style="margin-left: 96px ! important;"&gt;&lt;code class="plain"&gt;Password =&gt; Bugzilla-&gt;params-&gt;{&lt;/code&gt;&lt;code class="string"&gt;"smtp_password"&lt;/code&gt;&lt;code class="plain"&gt;},&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;07.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;                &lt;/code&gt;&lt;span class="block" style="margin-left: 96px ! important;"&gt;&lt;code class="plain"&gt;Hello =&gt; &lt;/code&gt;&lt;code class="variable"&gt;$hostname&lt;/code&gt;&lt;code class="plain"&gt;, &lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;08.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;                &lt;/code&gt;&lt;span class="block" style="margin-left: 96px ! important;"&gt;&lt;code class="plain"&gt;Debug =&gt; Bugzilla-&gt;params-&gt;{&lt;/code&gt;&lt;code class="string"&gt;'smtp_debug'&lt;/code&gt;&lt;code class="plain"&gt;};&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;09.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;            &lt;/code&gt;&lt;span class="block" style="margin-left: 72px ! important;"&gt;&lt;code class="functions"&gt;push&lt;/code&gt; &lt;code class="variable"&gt;@args&lt;/code&gt;&lt;code class="plain"&gt;, Port =&gt; &lt;/code&gt;&lt;code class="variable"&gt;$smtp_port&lt;/code&gt; &lt;code class="keyword"&gt;if&lt;/code&gt;&lt;code class="plain"&gt;(&lt;/code&gt;&lt;code class="variable"&gt;$smtp_port&lt;/code&gt;&lt;code class="plain"&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;10.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;        &lt;/code&gt;&lt;span class="block" style="margin-left: 48px ! important;"&gt;&lt;code class="plain"&gt;}   &lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;       Now we need to do settings in bugzilla parameters.&lt;br /&gt;     Login as administrator to Bugzilla and go to Administration -&gt; Parameters -&gt; Email and do following settings&lt;br /&gt;     1. Select &lt;b&gt;SMTP::TLS&lt;/b&gt; as &lt;b&gt;mail_delivery_method&lt;/b&gt;       &lt;div class="code"&gt;        &lt;img src="http://www.dawood.in/images/bugzilla_tls_method.png" /&gt;       &lt;/div&gt;       2. Enter your gmail address in &lt;b&gt;mailfrom&lt;/b&gt;       &lt;div class="code"&gt;        &lt;img src="http://www.dawood.in/images/bugzilla_tls_mail_from.png" /&gt;       &lt;/div&gt;       3. Enter &lt;b&gt;smtp.gmail.com:587&lt;/b&gt; in &lt;b&gt;smtpserver&lt;/b&gt;       &lt;div class="code"&gt;        &lt;img src="http://www.dawood.in/images/bugzilla_tls_smtpserver.png" /&gt;       &lt;/div&gt;       4. Enter &lt;b&gt;you@gmail.com&lt;/b&gt; in &lt;b&gt;smtp_username&lt;/b&gt;       &lt;div class="code"&gt;        &lt;img src="http://www.dawood.in/images/bugzilla_tls_smtpuser.png" /&gt;       &lt;/div&gt;       5. Enter gmail password in &lt;b&gt;smtp_password&lt;/b&gt;       &lt;div class="code"&gt;        &lt;img src="http://www.dawood.in/images/bugzilla_tls_smtppass.png" /&gt;       &lt;/div&gt;&lt;br /&gt;It will work pretty good.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-2751642353210801886?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/2751642353210801886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=2751642353210801886&amp;isPopup=true' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2751642353210801886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2751642353210801886'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/10/configure-bugzilla-with-gmail-smtp.html' title='configure Bugzilla with gmail smtp'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-2454395676086479354</id><published>2009-10-07T18:13:00.000+05:30</published><updated>2009-10-13T11:42:08.606+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><title type='text'>Install vpnclient on centos 5.1 and perforce</title><content type='html'>&lt;span style="font-weight: bold;"&gt;INSTALL VPNCLIENT&lt;/span&gt;&lt;br /&gt;download vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz file&lt;br /&gt;tar -zxvf vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz&lt;br /&gt;cd vpnclient&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; ./vpn_install&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; /etc/init.d/vpnclient_init start&lt;/span&gt;&lt;br /&gt;copy cust.pcf (your vpn profile file to connect to your client) to /etc/opt/cisco-vpnclient/Profiles/.&lt;br /&gt;To connect to your customer type&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#vpnclient connect cust  &lt;/span&gt;&lt;br /&gt;Above cust is the name of the pcf file you copied to /etc/opt/cisco-vpnclient/Profiles/.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;INSTALL PERFORCE&lt;/span&gt;&lt;br /&gt;download p4v from &lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;span style="font-size:12;"&gt;&lt;a href="http://www.perforce.com/perforce/downloads/index.html" target="_blank"&gt;http://www.perforce.com/&lt;wbr&gt;perforce/downloads/index.html&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;tar -zxvf p4v.tgz&lt;br /&gt;cd  p4v-2009.1.212209&lt;br /&gt;directly you can access perforce here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-2454395676086479354?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/2454395676086479354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=2454395676086479354&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2454395676086479354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2454395676086479354'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/10/install-vpnclient-on-centos-51-and.html' title='Install vpnclient on centos 5.1 and perforce'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-9091356690424541904</id><published>2009-09-09T12:47:00.000+05:30</published><updated>2009-09-09T17:07:56.389+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless tools'/><title type='text'>network tools for wireless and wired</title><content type='html'>&lt;a href="http://www.security-freak.net/videos.html"&gt;Security tube &lt;/a&gt;contains group of tools characterized by the name "&lt;strong&gt;Tutorials on commonly used  Security Tools"&lt;/strong&gt; for wireless and wired networks. It provided video explanation for each tool. So what are you waiting for.............&lt;br /&gt;&lt;br /&gt;Other than this you can find some other &lt;a href="http://www.wi-foo.com/index-3.html"&gt;tools&lt;/a&gt; which are available. &lt;a href="http://www.wi-foo.com/index-3.html"&gt;have look...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-9091356690424541904?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/9091356690424541904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=9091356690424541904&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9091356690424541904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9091356690424541904'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/09/network-tools-for-wireless-and-wired.html' title='network tools for wireless and wired'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-7380608630204758464</id><published>2009-09-08T14:26:00.000+05:30</published><updated>2010-02-01T21:04:55.720+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless tools'/><title type='text'>how to install madwifi driver for linux with and with out resend packets option.</title><content type='html'>&lt;div class="snap_preview"&gt;&lt;span style="font-style: italic;"&gt;Madwifi&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;driver is basically written for Atheros chipsets and it supports most&lt;br /&gt;It is a open source but depends on &lt;span style="font-size:85%;"&gt;&lt;strong&gt;the proprietary Hardware Abstraction Layer (HAL).&lt;/strong&gt;&lt;/span&gt;&lt;h2&gt;&lt;strong&gt;Download and Check&lt;/strong&gt;&lt;/h2&gt; &lt;p&gt;&lt;code&gt;$ &lt;strong&gt;wget http://ufpr.dl.sourceforge.net/sourceforge/madwifi/madwifi-0.9.4.tar.bz2&lt;/strong&gt;&lt;br /&gt;$ tar -zxvf madwifi-0.9.4.tar.bz2&lt;br /&gt;$ cd madwifi-0.9.4/&lt;br /&gt;$ cd scripts/&lt;br /&gt;$ ./madwifi-unload.bash&lt;br /&gt;$ ./find-madwifi-modules.sh $(uname -r)&lt;br /&gt;$ cd ..&lt;/code&gt;&lt;br /&gt;&lt;span id="more-178"&gt;&lt;/span&gt;&lt;/p&gt; &lt;h2&gt;&lt;strong&gt;Build and comment&lt;/strong&gt;&lt;/h2&gt; &lt;p&gt;&lt;code&gt;$ make&lt;/code&gt;&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;Checking requirements… ok.&lt;br /&gt;Checking kernel configuration… ok.&lt;br /&gt;make -C /lib/modules/2.6.18-92.1.13.el5/build SUBDIRS=/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4 modules&lt;br /&gt;make[1]: Entering directory `/usr/src/kernels/2.6.18-92.1.13.el5-i686′&lt;br /&gt;CC [M]  /home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/ath/if_ath.o&lt;br /&gt;In file included from &lt;command&gt;:1:&lt;br /&gt;/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/ath/../include/compat.h:140: error: redefinition of ’skb_end_pointer’&lt;br /&gt;….&lt;br /&gt;….&lt;br /&gt;….&lt;br /&gt;make[3]: *** [/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/ath/if_ath.o] Error 1&lt;br /&gt;make[2]: *** [/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/ath Error 2&lt;br /&gt;make[1]: *** [_module_/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4] Error 2&lt;br /&gt;make[1]: Leaving directory `/usr/src/kernels/2.6.18-92.1.13.el5-i686′&lt;br /&gt;make: *** [modules] Error 2&lt;/command&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;code&gt; $ cd include&lt;br /&gt;$ cp compat.h compat.h.old&lt;br /&gt;$ vim compat.h&lt;br /&gt;$ diff -U 3 -dHrN -- compat.h compat.h.old&lt;br /&gt;$cat compat.h.diff&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;     — compat.h 2009-03-19 02:02:49.000000000 -0400&lt;br /&gt;+++ compat.h.old 2009-03-18 19:09:37.000000000 -0400&lt;br /&gt;@@ -134,7 +134,7 @@&lt;br /&gt;#define IRQF_SHARED SA_SHIRQ&lt;br /&gt;#endif&lt;br /&gt;-/* #if LINUX_VERSION_CODE &lt;&gt;mac.raw = skb-&gt;data;&lt;br /&gt;}&lt;br /&gt;-#endif */&lt;br /&gt;+#endif&lt;br /&gt;#if LINUX_VERSION_CODE &lt;&gt;&lt;code&gt;$ cd ../&lt;br /&gt;$ make&lt;/code&gt;&lt;p&gt;&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;Checking requirements… ok.&lt;br /&gt;Checking kernel configuration… ok.&lt;br /&gt;make -C /lib/modules/2.6.18-92.1.13.el5/build SUBDIRS=/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4 modules&lt;br /&gt;make[1]: Entering directory `/usr/src/kernels/2.6.18-92.1.13.el5-i686′&lt;br /&gt;CC [M]  /home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/ath/if_ath.o&lt;br /&gt;…&lt;br /&gt;…&lt;br /&gt;…&lt;br /&gt;make[1]: Entering directory `/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/tools’&lt;br /&gt;gcc -o athstats -g -O2 -Wall -I. -I../hal -I.. -I../ath  athstats.c&lt;br /&gt;gcc -o 80211stats -g -O2 -Wall -I. -I../hal -I..  80211stats.c&lt;br /&gt;gcc -o athkey -g -O2 -Wall -I. -I../hal -I..  athkey.c&lt;br /&gt;gcc -o athchans -g -O2 -Wall -I. -I../hal -I..  athchans.c&lt;br /&gt;gcc -o athctrl -g -O2 -Wall -I. -I../hal -I..  athctrl.c&lt;br /&gt;gcc -o athdebug -g -O2 -Wall -I. -I../hal -I..  athdebug.c&lt;br /&gt;gcc -o 80211debug -g -O2 -Wall -I. -I../hal -I..  80211debug.c&lt;br /&gt;gcc -o wlanconfig -g -O2 -Wall -I. -I../hal -I..  wlanconfig.c&lt;br /&gt;gcc -o ath_info -g -O2 -Wall ath_info.c&lt;br /&gt;make[1]: Leaving directory `/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/tools’&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;code&gt;# make install&lt;/code&gt;&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;sh scripts/find-madwifi-modules.sh 2.6.18-92.1.13.el5&lt;br /&gt;for i in ath/ ath_hal/ ath_rate/ net80211/; do \&lt;br /&gt;make -C $i install || exit 1; \&lt;br /&gt;done&lt;br /&gt;…&lt;br /&gt;…&lt;br /&gt;…&lt;br /&gt;install -d /usr/local/man/man8&lt;br /&gt;install -m 0644 man/*.8 /usr/local/man/man8&lt;br /&gt;make[1]: Leaving directory `/home/rafa/0_Down/1_Source/WireLess/madwifi-0.9.4/tools’&lt;/p&gt;&lt;/blockquote&gt; &lt;h2&gt;&lt;strong&gt;Configuration and re-boot&lt;/strong&gt;&lt;/h2&gt; &lt;p&gt;&lt;code&gt;# modprob ath_pci&lt;/code&gt;&lt;br /&gt;# iwconfig&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;lo        no wireless extensions.&lt;/p&gt; &lt;p&gt;eth1      no wireless extensions.&lt;/p&gt; &lt;p&gt;eth2      no wireless extensions.&lt;/p&gt; &lt;p&gt;sit0      no wireless extensions.&lt;/p&gt; &lt;p&gt;wifi0     no wireless extensions.&lt;/p&gt; &lt;p&gt;ath0      IEEE 802.11b  ESSID:”"&lt;/p&gt; &lt;p&gt;Mode:Managed  Channel:0  Access Point: Not-Associated&lt;br /&gt;Bit Rate:0 kb/s   Tx-Power:0 dBm   Sensitivity=1/1&lt;br /&gt;Retry:off   RTS thr:off   Fragment thr:off&lt;br /&gt;Encryption key:off&lt;br /&gt;Power Management:off&lt;br /&gt;Link Quality=0/70  Signal level=-256 dBm  Noise level=-256 dBm&lt;br /&gt;Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0&lt;br /&gt;Tx excessive retries:0  Invalid misc:0   Missed beacon:0&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;code&gt;# ifconfig ath0 up&lt;br /&gt;# wlanconfig ath0 list scan&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;show all available bssid's&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;--------------------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;If your doing protocol test and you want to have control how many packets are going from your wifi interface. You need to do simple two steps before compiling.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;step 1:-&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In madwifi-0.9.4/ath/if_athvar.h file change  line '#define  ATH_TXMAXTRY 11' to  '#define  ATH_TXMAXTRY 1'.&lt;/p&gt;&lt;p&gt;step 2:-&lt;/p&gt;&lt;p&gt;In madwifi-0.9.4/ath/if_ath.c file change line 'sc -&gt; sc_mrretry = ath_hal_setupxtxdesc(ath, NULL, 0,0,0,0,0,0);' with 'sc-&gt; sc_mrretry=0'.&lt;/p&gt;&lt;p&gt;In place of '0' you can write FALSE and add macro for it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now start compilation.&lt;/p&gt;&lt;p&gt;--------------------------------------------------------------------------------------------&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-7380608630204758464?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/7380608630204758464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=7380608630204758464&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7380608630204758464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/7380608630204758464'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/09/installing-madwifi-driver-for-linux.html' title='how to install madwifi driver for linux with and with out resend packets option.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-4870808584627367374</id><published>2009-09-08T12:56:00.000+05:30</published><updated>2010-02-02T20:51:52.844+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless tools'/><title type='text'>installing pcap2air and other airbase tools for wifi</title><content type='html'>To work with airbase wifi tools we need to have lorcon.&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;Lorcon is a bookshop specializing in frame insertion for 802.11 (Wi-Fi standard) and is on suite that supports &lt;/span&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;the Airbase.&lt;/span&gt; &lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;&lt;/span&gt; The suite is created in C + + and is formed by applications, Airware-test, fuzz-e pcap2air,&lt;/span&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;pcap-match, pcap-tac, pcap-wepcrypt, prism-strip simple-replay.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;Currently, some programs use functions Airbase Lorcon bookstores that are considered obsolete (Deprecated).&lt;/span&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;We'll see how to modify the code to fit the new libraries.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download and install Lorcon (SVN):&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ svn co https://802.11ninja.net/svn/lorcon/trunk/&lt;br /&gt;&lt;br /&gt;(If svn client is not isntalled on your machine just do #yum install subversion)&lt;br /&gt;&lt;br /&gt;$ cd trunk/&lt;br /&gt;$ ./configure&lt;br /&gt;$ make&lt;br /&gt;# make install&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;strong&gt;Download Airbase&lt;/strong&gt; 2.40: &lt;a href="http://72.14.203.132/translate_c?hl=en&amp;amp;sl=es&amp;amp;u=http://www.802.11mercenary.net/downloads/&amp;amp;prev=/search%3Fq%3Dinstallation%2Bprocedure%2Bfor%2Bairbase%2Bpcap2air%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26hs%3DWFv&amp;amp;rurl=translate.google.co.in&amp;amp;usg=ALkJrhg5yyp_P-R1MUbmwV_pUsvjddHNeg"&gt;http://www.802.11mercenary.net/downloads/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;strong&gt;Files to modify:&lt;/strong&gt;&lt;/span&gt; &lt;p&gt; &lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;airbase-svn-223/80211fp/jc-CTS-printer/src/boring.cpp&lt;/span&gt; airbase-svn-223/80211fp/jc-CTS-printer/src/boring.cpp&lt;/span&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;airbase-svn-223/80211fp/jc-duration-printer/src/duration_pcap_preprocessor.cpp&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;airbase-svn-223/libs/lib802finger/src/station-lister.cpp:&lt;/span&gt; airbase-svn-223/libs/lib802finger/src/station-lister.cpp:&lt;/span&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;airbase-svn-223/tools/pcap2air/boring.cpp:&lt;/span&gt; airbase-svn-223/tools/pcap2air/boring.cpp:&lt;/span&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;airbase-svn-223/tools/simple-replay/boring.cpp&lt;/span&gt; airbase-svn-223/tools/simple-replay/boring.cpp&lt;/span&gt;&lt;br /&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;airbase-svn-223/tools/fuzz-e/boring.cpp&lt;/span&gt; airbase-svn-223/tools/fuzz-e/boring.cpp&lt;/span&gt; &lt;/p&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;strong&gt;To modify:&lt;/strong&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="" onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;&lt;/span&gt;We just replace these lines of code file containing:&lt;/span&gt; &lt;/p&gt;&lt;p&gt; &lt;code&gt;tx80211_setmode&lt;/code&gt; &lt;/p&gt; &lt;p&gt; &lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;&lt;/span&gt;By:&lt;/span&gt; &lt;/p&gt;&lt;p&gt; &lt;code&gt;tx80211_setfunctionalmode&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;strong&gt;Installing Airbase-release-2.40:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br /&gt;$ tar -zxvf airbase-release-2.40.tar.gz&lt;br /&gt;$ cd airbase-svn-223&lt;br /&gt;$ cd libs/libairware/&lt;br /&gt;$ make&lt;br /&gt;# make install&lt;br /&gt;$ cd ../../tools/&lt;br /&gt;$ ./build.sh&lt;br /&gt;# ./install.sh&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;# ln -s /usr/local/bin/airbase/* /usr/sbin/&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;If any tools complain about missing shared library liborcon-1.0.0.so then&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;cp /usr/local/lib/liborcon-1.0.0.so /usr/lib&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;Now bellow airbase tools will be available&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;Airware-test&lt;/span&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;fuzz-e&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.security-freak.net/tools/amit/pcap2air-airbase/pcap2air-airbase_controller.swf"&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;pcap2air&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;pcap-match&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;pcap-tac&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;pcap-wepcrypt&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;prism-strip&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;simple-replay&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span onmouseover="_tipon(this)" onmouseout="_tipoff()"&gt;&lt;span class="google-src-text" style="direction: ltr; text-align: left;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-4870808584627367374?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/4870808584627367374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=4870808584627367374&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4870808584627367374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/4870808584627367374'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/09/installing-pcap2air-and-other-airbase.html' title='installing pcap2air and other airbase tools for wifi'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3490035062695888462</id><published>2009-08-28T18:19:00.000+05:30</published><updated>2009-09-02T11:49:11.076+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>how to install windows after linux installed.</title><content type='html'>I have seen so many are getting problem of installing windows on machine which has linux already installed.&lt;br /&gt;Here are simple steps to install.&lt;br /&gt;(Please take backup of your imp date before doing this)&lt;br /&gt;&lt;br /&gt;On linux shell do fdisk -l&lt;br /&gt;&lt;br /&gt;shows you all disks. &lt;br /&gt;Free one of the partition.&lt;br /&gt;&lt;br /&gt;Restart the system install windows on that partition. (make sure of partition on which window are installing).&lt;br /&gt;&lt;br /&gt;Now if you reboot, only windows will come. (expected result).&lt;br /&gt;&lt;br /&gt;Now put linux boot able CD or DVD and restart.&lt;br /&gt;Boot from the CD or DVD.&lt;br /&gt;at prompt boot:...&lt;br /&gt;type "linux rescue" (without quotes) and enter.(according to centOS)&lt;br /&gt;Follow steps will lead to shall prompt.&lt;br /&gt;&lt;br /&gt;Now mount your boot partition if you have boot as separate partition, if root partition itself contain boot then mount root partition.&lt;br /&gt;&lt;br /&gt;ex: mount /dev/sda2 /mnt/temp&lt;br /&gt;cd /mnt/temp&lt;br /&gt; &lt;br /&gt;Now open menu.lst (probably it is in /root/boot/grub/menu.lst or /boot/grub.lst)&lt;br /&gt;Add bellow lines&lt;br /&gt;&lt;br /&gt; title  Windows xp&lt;br /&gt; root  (hda0,0)&lt;br /&gt; makeactive&lt;br /&gt; chainloader +1&lt;br /&gt;&lt;br /&gt;Here depending on your partion you need to modify the parameters.&lt;br /&gt;Title :- Name you want to see at boot menu list.&lt;br /&gt;root :- It is the partition where menu.lst present. Genrally grub list all disks as "hda" even you have sata hard disk.One more thing is fdisk -l list partitions staring index from 1 to ...&lt;br /&gt;ex:- sad1, sda2....&lt;br /&gt;but grub will take hda0, hda1, hda2 .....&lt;br /&gt;So, if for example boot partion is sda3 you need to give "root  (hda2, 0)".&lt;br /&gt;Other two paramets doesn't change.&lt;br /&gt;&lt;br /&gt;Now at shall enter grub command.&lt;br /&gt;ex:&lt;br /&gt;sh#grub&lt;br /&gt;grub&gt; root (hda0)&lt;br /&gt;grub&gt; setup (had0)&lt;br /&gt;grub&gt; quit&lt;br /&gt;sh#reboot&lt;br /&gt;&lt;br /&gt;After reboot in boot from list, it will show liux and windows.&lt;br /&gt;Now choose from which you want to boot.&lt;br /&gt;Enjoy.............&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3490035062695888462?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3490035062695888462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3490035062695888462&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3490035062695888462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3490035062695888462'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/how-to-install-windows-after-linux.html' title='how to install windows after linux installed.'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8622180429158848488</id><published>2009-08-20T13:04:00.000+05:30</published><updated>2010-02-04T13:01:18.704+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c and related'/><title type='text'>commands i use while programing</title><content type='html'>VIM  :-&lt;br /&gt;&lt;br /&gt;:set nonu  -remove line numbers&lt;br /&gt;:sp file_name             ctrl+ww to switch between split sreen&lt;br /&gt;:$   --------------------- go to end of file                          &lt;br /&gt;:1  ---------------------- go to starting of file 1 number specifies line number&lt;br /&gt;:%s/OLD/NEW/g       --  replace OLD string with NEW string globally (g) and in total file %s&lt;br /&gt;:%s/^/NEW/g       --  every line at the starting NEW string will be added.&lt;br /&gt;1,30s/rr/aa/gi      ----1,30 represent 1 to 30 lines s stands for string rr serch string pattern and aa is replace string g is globally i is case insenditive&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ctags * should be enabled at comd prompt&lt;br /&gt;cntl + ] goto function defination&lt;br /&gt;cntl + o come back&lt;br /&gt;cscope -R                 --- cntl+d exit ,tab to move to bellow cmds&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Enabling and running core dump:&lt;/span&gt;&lt;br /&gt;add below two line in bashrc file and restart shell.&lt;br /&gt;ulimit -c unlimited&lt;br /&gt;echo &lt;span class="il"&gt;core&lt;/span&gt;.%e.%p.%s.%t &gt; /proc/sys/kernel/core_pattern&lt;br /&gt;Now if any core dump file is generated run the below command with proper file name.&lt;br /&gt;gcc executable coredump.xxx&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CMDS:-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;route                     --gives route details for ur terminal&lt;br /&gt;route add default gw &lt;gateway&gt; to add default gateway in route table.&lt;br /&gt;nm obj_file  | grep function_name_to_find&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;diff file1 file2          --- list lines differed&lt;br /&gt;vi -t functionname  goes to that function. (ctags * must be used)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;svn:&lt;br /&gt;&lt;br /&gt;svn co svn+ssh://phaneendra@&lt;ip&gt;/repos/project&lt;br /&gt;&lt;br /&gt;svn add dir1 dir2 file1 ....&lt;br /&gt;svn ci&lt;br /&gt;&lt;br /&gt;svn import dir/file svn+ssh://phaneendra@&lt;ip&gt;/repos/project&lt;br /&gt;&lt;br /&gt;svn diff&lt;br /&gt;&lt;br /&gt;svn ci file_name&lt;br /&gt;&lt;br /&gt;if you want to changes code base user name or in some situations your useradmin changed you user name. Now you want to checkin code which your checked out with different name.&lt;br /&gt;now you have two options&lt;br /&gt;1)&lt;br /&gt;Checkout with your new name and see diffs between the code you modified(checked out with old name) and make changed to new check out code base and then check in. (off-course very very bad idea)&lt;br /&gt;&lt;br /&gt;2)Best way is use bellow command at trunk (main directory of checkout code)&lt;br /&gt;&lt;br /&gt;svn switch svn+ssh://old_user_name@ip/repos/trunk svn+ssh://new_user_name@ip/repos/trunk --relocate&lt;br /&gt;it asks for new user password provide it. Your work is done.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;to open .chm files in ubuntu &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# apt-get install gnochm&lt;br /&gt;&lt;br /&gt;$ gnochm file.chm&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cross compilation:-&lt;/span&gt;&lt;br /&gt;source env-setup &lt;client_board_modal&gt; /usr/local/&lt;client_name&gt;/&lt;client_soft_sdk&gt;&lt;br /&gt;This environment variable should be executed before cross compiling or put it in bashrc file and open new terminal and start working.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;wed :-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;http://cscope.sourceforge.net/large_projects.html&lt;br /&gt;http://www.network-theory.co.uk/  (for gcc and valgring)&lt;br /&gt;http://www.experts-exchange.com/Programming/System/Linux/&lt;br /&gt;http://www.securitytube.net/Programming-Video-List.aspx&lt;/ip&gt;&lt;/ip&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8622180429158848488?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8622180429158848488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8622180429158848488&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8622180429158848488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8622180429158848488'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/commands-i-use-while-programing.html' title='commands i use while programing'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-8419465403232605678</id><published>2009-08-20T12:52:00.000+05:30</published><updated>2009-08-20T12:58:55.853+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Learn perl easy part5</title><content type='html'>perl &lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy.html"&gt;1&lt;/a&gt; &lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part2.html"&gt;2&lt;/a&gt; &lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part3.html"&gt;3&lt;/a&gt; &lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part4.html"&gt;4&lt;/a&gt; &lt;br /&gt;What is a Subroutine?&lt;br /&gt;&lt;br /&gt;We have been using a form of subroutines all along. Perl functions are basically built in subroutines. You call them (or "invoke") a function by typing its name, and giving it one or more arguments.&lt;br /&gt;&lt;br /&gt;Example: Length&lt;br /&gt;&lt;br /&gt;        my $seq = 'ATGCAAATGCCA';    &lt;br /&gt;&lt;br /&gt;        my $seq_length = length $seq;  ## OR&lt;br /&gt;        my $seq_length = length($seq);&lt;br /&gt;&lt;br /&gt;        # $seq_length now contains 12&lt;br /&gt;&lt;br /&gt;Perl gives you the opportunity to define your own functions, called "subroutines". In the simplest sense, subroutines are named blocks of code that can be reused as many times as you wish.&lt;br /&gt;&lt;br /&gt;Example: A very basic subroutine&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  sub Hello {&lt;br /&gt;      print "Hello World!!\n";&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  print "Sometimes I just want to shout ";&lt;br /&gt;  Hello(); #or &amp;Hello;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Example: Some simple subroutines&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  sub hypotenuse {&lt;br /&gt;     my ($a,$b) = @_;&lt;br /&gt;     return sqrt($a**2 + $b**2);&lt;br /&gt;  }&lt;br /&gt;  sub E {&lt;br /&gt;      return 2.71828182845905;&lt;br /&gt;  }&lt;br /&gt; #########&lt;br /&gt;&lt;br /&gt;  $y = 3;&lt;br /&gt;  $x = hypotenuse($y,4);&lt;br /&gt;  # $x now contains 5&lt;br /&gt;&lt;br /&gt;  $x = hypotenuse((3*$y),12);&lt;br /&gt;  # $x now contains 15  &lt;br /&gt;&lt;br /&gt;  $value_e = E();&lt;br /&gt;  # $value_e now contains 2.71828182845905&lt;br /&gt;&lt;br /&gt;This way of using subroutines makes them look suspiciously like functions. Note: Unlike a function, you must use parentheses when calling a subroutine in this manner, even if you are giving it no arguments.&lt;br /&gt;The Magic Array - @_&lt;br /&gt;&lt;br /&gt;Perhaps the most important concept to understand is that values are passed to the subroutine in the default array @_. This array springs magically into existence, and contains the list of values that you gave to subroutine (within the parentheses).&lt;br /&gt;&lt;br /&gt;Example: The magic of @_&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  sub Add_two_numbers {&lt;br /&gt;     my ($number1) = shift;  # get first argument from @_ and put it in  $number1&lt;br /&gt;     my ($number2) = shift;  # get second argument from @_ and put it in $number2&lt;br /&gt;&lt;br /&gt;     my $sum = $number1 + $number2;&lt;br /&gt;     return $sum;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  sub Add_two_numbers_2 {&lt;br /&gt;     my ($number1,$number2) = @_;&lt;br /&gt;     my $sum = $number1 + $number2;&lt;br /&gt;     return $sum;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  sub Add_two_numbers_arcane {&lt;br /&gt;     return ($_[0] + $_[1]);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Some Subroutine Notes&lt;br /&gt;&lt;br /&gt;    * Use a name for your subroutine that makes sense to you. Avoid using names that Perl already uses (like "length" or "print"), unless you really like making yourself miserable.&lt;br /&gt;    * If you don't give a return statement, the subroutine will return the last value calculated.&lt;br /&gt;    * You may have multiple return statements. The first one that is executed will exit the subroutine&lt;br /&gt;&lt;br /&gt;      Example: A more complex subroutine with different returns&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;          sub Number_Examiner {&lt;br /&gt;            my $number = shift;&lt;br /&gt;&lt;br /&gt;            unless ($number =~ /^\d+$/){&lt;br /&gt;              return "You sure this is a number?";&lt;br /&gt;            }&lt;br /&gt;            if ($number &gt;= 100){&lt;br /&gt;              return "Big Number!";&lt;br /&gt;            }&lt;br /&gt;            elsif ($number &gt; 50){&lt;br /&gt;              return "Bigger than 50!;&lt;br /&gt;            }&lt;br /&gt;            else {&lt;br /&gt;              return "Wee Little Number";&lt;br /&gt;            }&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;    * You can return either a single value or a list of values. You can, if you wish, return nothing. Remember to use your subroutine in a way that reflects the number of values you expect to get back.&lt;br /&gt;&lt;br /&gt;      Example: Know what you expect&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;          my ($value1,$value2,$value3) = ReturnThreeValues();  &lt;br /&gt;          # if you are expecting three values back, make space for them.&lt;br /&gt;          my (@values) = ReturnThreeValues();     # another way to do it&lt;br /&gt;&lt;br /&gt;          my ($value1,$value2) = ReturnThreeValues();&lt;br /&gt;          # the last value is lost, gone, vanished, DOA...  You may have&lt;br /&gt;            wanted to do this.&lt;br /&gt;&lt;br /&gt;      "my" Variables&lt;br /&gt;&lt;br /&gt;      Variables that you use in a subroutine should be made private to that subroutine with the my operator. This avoids accidentally overwriting similarly-named variables in the main program. If you already included use strict at the top of your program, perl will check that all variables are introduced with my.&lt;br /&gt;&lt;br /&gt;      Why Use My?&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;           my $var = "Boo!";&lt;br /&gt;           Scary();    &lt;br /&gt;           print "$var\n";&lt;br /&gt;&lt;br /&gt;           sub Scary{&lt;br /&gt;             print "$var\n";&lt;br /&gt;             $var = "Eeek!";&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           # The results:&lt;br /&gt;             Boo!&lt;br /&gt;             Eeek!&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;      Variables made private with my only exist within a block (curly braces). The subroutine body is a block, so the my variables only exist within the body of the subroutine.&lt;br /&gt;&lt;br /&gt;      You can make scalars, arrays and hashes private. If you apply my() to a list, it makes each member of the list private.&lt;br /&gt;&lt;br /&gt;       {  # start a block&lt;br /&gt;          my $scalar;  # $scalar is private&lt;br /&gt;          my @array;   # now @array is private&lt;br /&gt;          my %hash;    # %hash is private&lt;br /&gt;&lt;br /&gt;          # same thing, but in one swell foop&lt;br /&gt;          my ($scalar,@array,%hash);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lectuer 7:&lt;br /&gt;&lt;br /&gt;   1. Using a Module&lt;br /&gt;   2. Getting Module Documentation&lt;br /&gt;   3. Installing Modules&lt;br /&gt;   4. More About Importing&lt;br /&gt;   5. Where are Modules Installed?&lt;br /&gt;   6. The Anatomy of a Module&lt;br /&gt;   7. Exporting Variables &amp; Functions from Modules&lt;br /&gt;   8. Using Object-Oriented Modules&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using a Module&lt;br /&gt;&lt;br /&gt;A module is a package of useful subroutines and variables that someone has put together. Modules extend the ability of Perl.&lt;br /&gt;Example 1: The File::Basename Module&lt;br /&gt;&lt;br /&gt;The File::Basename module is a standard module that is distributed with Perl. When you load the File::Basename module, you get two new functions, basename and dirname.&lt;br /&gt;&lt;br /&gt;basename takes a long UNIX path name and returns the file name at the end. dirname takes a long UNIX path name and returns the directory part.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  #!/usr/bin/perl&lt;br /&gt;  # file: basename.pl&lt;br /&gt;  &lt;br /&gt;  use strict;&lt;br /&gt;  use File::Basename;&lt;br /&gt;&lt;br /&gt;  my $path = '/bush_home/bush1/lstein/C1829.fa';&lt;br /&gt;  my $base = basename($path);&lt;br /&gt;  my $dir  = dirname($path);&lt;br /&gt;&lt;br /&gt;  print "The base is $base and the directory is $dir.\n";&lt;br /&gt;&lt;br /&gt;The output of this program is:&lt;br /&gt;&lt;br /&gt;    The base is C1829.fa and the directory is /bush_home/bush1/lstein.&lt;br /&gt;&lt;br /&gt;The use function loads up the module named File::Basename and imports the two functions. If you didn't use use, then the program would print an error:&lt;br /&gt;&lt;br /&gt;    Undefined subroutine &amp;main::basename called at basename.pl line 8.&lt;br /&gt;&lt;br /&gt;Example 2: The Env Module&lt;br /&gt;&lt;br /&gt;The Env module is a standard module that provides access to the environment variables. When you load it, it imports a set of scalar variables corresponding to your environment.&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file env.pl&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use Env;&lt;br /&gt;&lt;br /&gt;print "My home is $HOME\n";&lt;br /&gt;print "My path is $PATH\n";&lt;br /&gt;print "My username is $USER\n";&lt;br /&gt;&lt;br /&gt;When this runs, the output is:&lt;br /&gt;&lt;br /&gt;    My home is /bush_home/bush1/lstein&lt;br /&gt;    My path is /net/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/bush_home/bush1/lstein/bin:.&lt;br /&gt;    My username is lstein&lt;br /&gt;&lt;br /&gt;Controlling What Gets Imported&lt;br /&gt;&lt;br /&gt;Each module will automatically import a different set of variables and subroutines when you use it. You can control what gets imported by providing use with a list of what to import.&lt;br /&gt;&lt;br /&gt;By default the Env module will import all the environment variables. You can make it import only some:&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file env2.pl&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use Env '$HOME','$PATH';&lt;br /&gt;&lt;br /&gt;print "My home is $HOME\n";&lt;br /&gt;print "My path is $PATH\n"; &lt;br /&gt;print "My username is $USER\n";&lt;br /&gt;&lt;br /&gt;    Global symbol "$USER" requires explicit package name at env2.pl line 9.&lt;br /&gt;    Execution of env2.pl aborted due to compilation errors.&lt;br /&gt;&lt;br /&gt;You can import scalars, hashes, arrays and functions by giving a list of strings containing the variable or function names. This line imports a scalar named $PATH, an array named @PATH, and a function named printenv.&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use Env '$PATH','@PATH','printenv';&lt;br /&gt;  &lt;br /&gt;print join "\n",@PATH;&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;    /net/bin&lt;br /&gt;    /usr/bin&lt;br /&gt;    /bin&lt;br /&gt;    /usr/local/bin&lt;br /&gt;    /usr/X11R6/bin&lt;br /&gt;    /bush_home/bush1/lstein/bin&lt;br /&gt;    .&lt;br /&gt;&lt;br /&gt;You will often see the qw() operator used to reduce typing:&lt;br /&gt;&lt;br /&gt;use TestModule qw($PATH $HOME @PATH printenv);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finding out What Modules are Installed&lt;br /&gt;&lt;br /&gt;Here are some tricks for finding out what Modules are installed.&lt;br /&gt;Preinstalled Modules&lt;br /&gt;&lt;br /&gt;To find out what modules come with perl, look in Appendix A of Perl 5 Pocket Reference. From the command line, use the perldoc command from the UNIX shell. All the Perl documentation is available with this command:&lt;br /&gt;&lt;br /&gt;    % perldoc perlmodlib&lt;br /&gt;    PERLMODLIB(1)  User Contributed Perl Documentation  PERLMODLIB(1)&lt;br /&gt;&lt;br /&gt;    NAME&lt;br /&gt;           perlmodlib - constructing new Perl modules and finding&lt;br /&gt;           existing ones&lt;br /&gt;&lt;br /&gt;    DESCRIPTION&lt;br /&gt;    THE PERL MODULE LIBRARY&lt;br /&gt;           Many modules are included the Perl distribution.  These&lt;br /&gt;           are described below, and all end in .pm.  You may discover&lt;br /&gt;    ...&lt;br /&gt;           Standard Modules&lt;br /&gt;&lt;br /&gt;           Standard, bundled modules are all expected to behave in a&lt;br /&gt;           well-defined manner with respect to namespace pollution&lt;br /&gt;           because they use the Exporter module.  See their own docu-&lt;br /&gt;           mentation for details.&lt;br /&gt;&lt;br /&gt;           AnyDBM_File Provide framework for multiple DBMs&lt;br /&gt;&lt;br /&gt;           AutoLoader  Load subroutines only on demand&lt;br /&gt;&lt;br /&gt;           AutoSplit   Split a package for autoloading&lt;br /&gt;&lt;br /&gt;           B           The Perl Compiler&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;To learn more about a module, run perldoc with the module's name:&lt;br /&gt;&lt;br /&gt;    % perldoc File::Basename&lt;br /&gt;&lt;br /&gt;    NAME&lt;br /&gt;           fileparse - split a pathname into pieces&lt;br /&gt;&lt;br /&gt;           basename - extract just the filename from a path&lt;br /&gt;&lt;br /&gt;           dirname - extract just the directory from a path&lt;br /&gt;&lt;br /&gt;    SYNOPSIS&lt;br /&gt;               use File::Basename;&lt;br /&gt;&lt;br /&gt;               ($name,$path,$suffix) = fileparse($fullname,@suffixlist)&lt;br /&gt;               fileparse_set_fstype($os_string);&lt;br /&gt;               $basename = basename($fullname,@suffixlist);&lt;br /&gt;               $dirname = dirname($fullname);&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;Optional Modules that You May Have Installed&lt;br /&gt;&lt;br /&gt;perldoc perllocal will list the names of locally installed modules.&lt;br /&gt;&lt;br /&gt;    % perldoc perllocal&lt;br /&gt;           Thu Apr 27 16:01:31 2000: "Module" the DBI manpage&lt;br /&gt;&lt;br /&gt;           o   "installed into: /usr/lib/perl5/site_perl"&lt;br /&gt;&lt;br /&gt;           o   "LINKTYPE: dynamic"&lt;br /&gt;&lt;br /&gt;           o   "VERSION: 1.13"&lt;br /&gt;&lt;br /&gt;           o   "EXE_FILES: dbish dbiproxy"&lt;br /&gt;&lt;br /&gt;           Thu Apr 27 16:01:41 2000: "Module" the Data::ShowTable&lt;br /&gt;           manpage&lt;br /&gt;&lt;br /&gt;           o   "installed into: /usr/lib/perl5/site_perl"&lt;br /&gt;&lt;br /&gt;           o   "LINKTYPE: dynamic"&lt;br /&gt;&lt;br /&gt;           o   "VERSION: 3.3"&lt;br /&gt;&lt;br /&gt;           o   "EXE_FILES: showtable"&lt;br /&gt;&lt;br /&gt;           Tue May 16 18:26:27 2000: "Module" the Image::Magick man-&lt;br /&gt;           page&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Installing Modules&lt;br /&gt;&lt;br /&gt;You can find thousands of Perl Modules on CPAN, the Comprehensive Perl Archive Network:&lt;br /&gt;&lt;br /&gt;    http://www.cpan.org &lt;br /&gt;&lt;br /&gt;Installing Modules Manually&lt;br /&gt;&lt;br /&gt;Search for the module on CPAN using the keyword search. When you find it, download the .tar.gz module. Then install it like this:&lt;br /&gt;&lt;br /&gt;    % tar zxvf bioperl-0.7.1.tar.gz&lt;br /&gt;    bioperl-0.7.1/&lt;br /&gt;    bioperl-0.7.1/Bio/&lt;br /&gt;    bioperl-0.7.1/Bio/DB/&lt;br /&gt;    bioperl-0.7.1/Bio/DB/Ace.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/GDB.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/GenBank.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/GenPept.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/NCBIHelper.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/RandomAccessI.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/SeqI.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/SwissProt.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/UpdateableSeqI.pm&lt;br /&gt;    bioperl-0.7.1/Bio/DB/WebDBSeqI.pm&lt;br /&gt;    bioperl-0.7.1/Bio/AlignIO.pm&lt;br /&gt;&lt;br /&gt;    %  perl Makefile.PL&lt;br /&gt;    Generated sub tests. go make show_tests to see available subtests&lt;br /&gt;    ...&lt;br /&gt;    Writing Makefile for Bio&lt;br /&gt;&lt;br /&gt;    % make&lt;br /&gt;    cp Bio/Tools/Genscan.pm blib/lib/Bio/Tools/Genscan.pm&lt;br /&gt;    cp Bio/Root/Err.pm blib/lib/Bio/Root/Err.pm&lt;br /&gt;    cp Bio/Annotation/Reference.pm blib/lib/Bio/Annotation/Reference.pm&lt;br /&gt;    cp bioback.pod blib/lib/bioback.pod&lt;br /&gt;    cp Bio/AlignIO/fasta.pm blib/lib/Bio/AlignIO/fasta.pm&lt;br /&gt;    cp Bio/Location/NarrowestCoordPolicy.pm blib/lib/Bio/Location/NarrowestCoordPolicy.pm&lt;br /&gt;    cp Bio/AlignIO/clustalw.pm blib/lib/Bio/AlignIO/clustalw.pm&lt;br /&gt;    cp Bio/Tools/Blast/Run/postclient.pl blib/lib/Bio/Tools/Blast/Run/postclient.pl&lt;br /&gt;    cp Bio/LiveSeq/Intron.pm blib/lib/Bio/LiveSeq/Intron.pm&lt;br /&gt;    ...&lt;br /&gt;    Manifying blib/man3/Bio::LiveSeq::Exon.3&lt;br /&gt;    Manifying blib/man3/Bio::Location::CoordinatePolicyI.3&lt;br /&gt;    Manifying blib/man3/Bio::SeqFeature::Similarity.3&lt;br /&gt;&lt;br /&gt;    % make test&lt;br /&gt;    PERL_DL_NONLAZY=1 /net/bin/perl -Iblib/arch -Iblib/lib -I/net/lib/perl5/5.6.1/i686-linux -I/net/lib/perl5/5.6.1 -e 'use Test::Harness qw(&amp;runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t&lt;br /&gt;    t/AAChange..........ok                                                       &lt;br /&gt;    t/AAReverseMutate...ok                                                       &lt;br /&gt;    t/AlignIO...........ok                                                       &lt;br /&gt;    t/Allele............ok&lt;br /&gt;    ...&lt;br /&gt;    t/WWW...............ok                                                       &lt;br /&gt;    All tests successful, 95 subtests skipped.&lt;br /&gt;    Files=60, Tests=1011, 35 wallclock secs (25.47 cusr +  1.60 csys = 27.07 CPU)&lt;br /&gt;&lt;br /&gt;    % make install&lt;br /&gt;    Installing /net/lib/perl5/site_perl/5.6.1/bioback.pod&lt;br /&gt;    Installing /net/lib/perl5/site_perl/5.6.1/biostart.pod&lt;br /&gt;    Installing /net/lib/perl5/site_perl/5.6.1/biodesign.pod&lt;br /&gt;    Installing /net/lib/perl5/site_perl/5.6.1/bptutorial.pl&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;If you have an older version of the tar program, you may need to replace the first step with this:&lt;br /&gt;&lt;br /&gt;    % gunzip -c bioperl-0.7.1.tar.gz | tar xvf -&lt;br /&gt;&lt;br /&gt;Installing Modules Using the CPAN Shell&lt;br /&gt;&lt;br /&gt;Perl has a CPAN module installer built into it. You run it like this:&lt;br /&gt;&lt;br /&gt;    % perl -MCPAN -e shell&lt;br /&gt;&lt;br /&gt;    cpan shell -- CPAN exploration and modules installation (v1.59_54)&lt;br /&gt;    ReadLine support enabled&lt;br /&gt;&lt;br /&gt;    cpan&gt;&lt;br /&gt;&lt;br /&gt;From this shell, there are commands for searching for modules, downloading them, and installing them.&lt;br /&gt;&lt;br /&gt;[The first time you run the CPAN shell, it will ask you a lot of configuration questions. Generally, you can just hit return to accept the defaults. The only trick comes when it asks you to select CPAN mirrors to download from. Choose any ones that are in your general area on the Internet and it will work fine.]&lt;br /&gt;&lt;br /&gt;Here is an example of searching for the Text::Wrap program and installing it:&lt;br /&gt;&lt;br /&gt;    cpan&gt; i /Wrap/&lt;br /&gt;    Going to read /bush_home/bush1/lstein/.cpan/sources/authors/01mailrc.txt.gz&lt;br /&gt;    CPAN: Compress::Zlib loaded ok&lt;br /&gt;    Going to read /bush_home/bush1/lstein/.cpan/sources/modules/02packages.details.txt.gz&lt;br /&gt;      Database was generated on Tue, 16 Oct 2001 22:32:59 GMT&lt;br /&gt;    CPAN: HTTP::Date loaded ok&lt;br /&gt;    Going to read /bush_home/bush1/lstein/.cpan/sources/modules/03modlist.data.gz&lt;br /&gt;    Distribution    B/BI/BINKLEY/CGI-PrintWrapper-0.8.tar.gz&lt;br /&gt;    Distribution    C/CH/CHARDIN/MailQuoteWrap0.01.tgz&lt;br /&gt;    Distribution    C/CJ/CJM/Text-Wrapper-1.000.tar.gz&lt;br /&gt;    ...&lt;br /&gt;    Module          Text::NWrap     (G/GA/GABOR/Text-Format0.52+NWrap0.11.tar.gz)&lt;br /&gt;    Module          Text::Quickwrap (Contact Author Ivan  Panchenko )&lt;br /&gt;    Module          Text::Wrap      (M/MU/MUIR/modules/Text-Tabs+Wrap-2001.0929.tar.gz)&lt;br /&gt;    Module          Text::Wrap::Hyphenate (Contact Author Mark-Jason Dominus )&lt;br /&gt;    Module          Text::WrapProp  (J/JB/JBRIGGS/Text-WrapProp-0.03.tar.gz)&lt;br /&gt;    Module          Text::Wrapper   (C/CJ/CJM/Text-Wrapper-1.000.tar.gz)&lt;br /&gt;    Module          XML::XSLT::Wrapper (M/MU/MULL/XML-XSLT-Wrapper-0.32.tar.gz)&lt;br /&gt;    41 items found&lt;br /&gt;&lt;br /&gt;    cpan&gt; install Text::Wrap&lt;br /&gt;    Running install for module Text::Wrap&lt;br /&gt;    Running make for M/MU/MUIR/modules/Text-Tabs+Wrap-2001.0929.tar.gz&lt;br /&gt;    CPAN: LWP::UserAgent loaded ok&lt;br /&gt;    Fetching with LWP:&lt;br /&gt;      ftp://archive.progeny.com/CPAN/authors/id/M/MU/MUIR/modules/Text-Tabs+Wrap-2001.0929.tar.gz&lt;br /&gt;    CPAN: MD5 loaded ok&lt;br /&gt;    Fetching with LWP:&lt;br /&gt;      ftp://archive.progeny.com/CPAN/authors/id/M/MU/MUIR/modules/CHECKSUMS&lt;br /&gt;    Checksum for /bush_home/bush1/lstein/.cpan/sources/authors/id/M/MU/MUIR/modules/Text-Tabs+Wrap-2001.0929.tar.gz ok&lt;br /&gt;    Scanning cache /bush_home/bush1/lstein/.cpan/build for sizes&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/MANIFEST&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/CHANGELOG&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/Makefile.PL&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/t/&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/t/fill.t&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/t/tabs.t&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/t/wrap.t&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/README&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/lib/&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/lib/Text/&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/lib/Text/Wrap.pm&lt;br /&gt;    Text-Tabs+Wrap-2001.0929/lib/Text/Tabs.pm&lt;br /&gt;&lt;br /&gt;      CPAN.pm: Going to build M/MU/MUIR/modules/Text-Tabs+Wrap-2001.0929.tar.gz&lt;br /&gt;&lt;br /&gt;    Checking if your kit is complete...&lt;br /&gt;    Looks good&lt;br /&gt;    Writing Makefile for Text&lt;br /&gt;    cp lib/Text/Wrap.pm blib/lib/Text/Wrap.pm&lt;br /&gt;    cp lib/Text/Tabs.pm blib/lib/Text/Tabs.pm&lt;br /&gt;    Manifying blib/man3/Text::Wrap.3&lt;br /&gt;    Manifying blib/man3/Text::Tabs.3&lt;br /&gt;      /usr/bin/make  -- OK&lt;br /&gt;    Running make test&lt;br /&gt;    PERL_DL_NONLAZY=1 /net/bin/perl -Iblib/arch -Iblib/lib -I/net/lib/perl5/5.6.1/i686-linux -I/net/lib/perl5/5.6.1 -e 'use Test::Harness qw(&amp;runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t&lt;br /&gt;    t/fill..............ok&lt;br /&gt;    t/tabs..............ok&lt;br /&gt;    t/wrap..............ok&lt;br /&gt;    All tests successful.&lt;br /&gt;    Files=3, Tests=37,  0 wallclock secs ( 0.20 cusr +  0.00 csys =  0.20 CPU)&lt;br /&gt;      /usr/bin/make test -- OK&lt;br /&gt;    Running make install&lt;br /&gt;    Installing /net/lib/perl5/5.6.1/Text/Wrap.pm&lt;br /&gt;    Installing /net/man/man3/Text::Wrap.3&lt;br /&gt;    Installing /net/man/man3/Text::Tabs.3&lt;br /&gt;    Writing /net/lib/perl5/5.6.1/i686-linux/auto/Text/.packlist&lt;br /&gt;    Appending installation info to /net/lib/perl5/5.6.1/i686-linux/perllocal.pod&lt;br /&gt;      /usr/bin/make install UNINST=1 -- OK&lt;br /&gt;&lt;br /&gt;    cpan&gt; quit&lt;br /&gt;    Lockfile removed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More About Importing&lt;br /&gt;&lt;br /&gt;Recall that each module has a default list of functions and variables to import. Some modules import many functions by default, others import none. Most import some.&lt;br /&gt;&lt;br /&gt;Modules that have a lot of functions and variables to import frequently put them into groups. Groups can be specified using the ":group" syntax.&lt;br /&gt;&lt;br /&gt;For example, the CGI::Pretty module has a group called ":standard", which imports a bunch of standard functions for creating HTML pages.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  #!/usr/bin/perl&lt;br /&gt;  # file: html.pl&lt;br /&gt;  &lt;br /&gt;  use strict;&lt;br /&gt;  use CGI::Pretty qw(:standard);&lt;br /&gt;&lt;br /&gt;  print h1('This is a level one header');&lt;br /&gt;  print p('This is a paragraph.');&lt;br /&gt;  print p('Here is some',i('italicized'),'text.');&lt;br /&gt;&lt;br /&gt;      % html.pl &lt;br /&gt;    &lt;h1&gt;&lt;br /&gt;     This is a level one header&lt;br /&gt;    &lt;/h1&gt;&lt;br /&gt;    &lt;p&gt;&lt;br /&gt;     This is a paragraph.&lt;br /&gt;    &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;&lt;br /&gt;     Here is some &lt;i&gt;italicized&lt;/i&gt; text.&lt;br /&gt;    &lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;The module's documentation will tell you what function groups are defined. To import the default functions, plus optional ones, use the group ":DEFAULT".&lt;br /&gt;&lt;br /&gt;  use CGI::Pretty qw(:DEFAULT :standard start_html);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Where are Modules Installed?&lt;br /&gt;&lt;br /&gt;Module files end with the extension .pm. If the module name is a simple one, like Env, then Perl will look for a file named Env.pm. If the module name is separated by :: sections, Perl will treat the :: characters like directories. So it will look for the module File::Basename in the file File/Basename.pm&lt;br /&gt;&lt;br /&gt;Perl searches for module files in a set of directories specified by the Perl library path. This is set when Perl is first installed. You can find out what directories Perl will search for modules in by issuing perl -V from the command line:&lt;br /&gt;&lt;br /&gt;     % perl -V&lt;br /&gt;     Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:&lt;br /&gt;      Platform:&lt;br /&gt;        osname=linux, osvers=2.4.2-2smp, archname=i686-linux&lt;br /&gt;     ...&lt;br /&gt;      Compiled at Oct 11 2001 11:08:37&lt;br /&gt;      @INC:&lt;br /&gt;        /usr/lib/perl5/5.6.1/i686-linux&lt;br /&gt;        /usr/lib/perl5/5.6.1&lt;br /&gt;        /usr/lib/perl5/site_perl/5.6.1/i686-linux&lt;br /&gt;        /usr/lib/perl5/site_perl/5.6.1&lt;br /&gt;        /usr/lib/perl5/site_perl&lt;br /&gt;        .&lt;br /&gt;&lt;br /&gt;You can modify this path to search in other locations by placing the use lib command somewhere at the top of your script:&lt;br /&gt;&lt;br /&gt;  #!/usr/bin/perl&lt;br /&gt;  &lt;br /&gt;  use lib '/home/lstein/lib';&lt;br /&gt;  use MyModule;&lt;br /&gt;  ...&lt;br /&gt;&lt;br /&gt;This tells Perl to look in /home/lstein/lib for the module MyModule before it looks in the usual places. Now you can install module files in this directory and Perl will find them.&lt;br /&gt;&lt;br /&gt;The Anatomy of a Module File&lt;br /&gt;&lt;br /&gt;Here is a very simple module file named "MySequence.pm":&lt;br /&gt;&lt;br /&gt;package MySequence;&lt;br /&gt;#file: MySequence.pm&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;our $EcoRI = 'ggatcc';&lt;br /&gt;&lt;br /&gt;sub reversec {&lt;br /&gt;  my $sequence = shift;&lt;br /&gt;  $sequence = reverse $sequence;&lt;br /&gt;  $sequence =~ tr/gatcGATC/ctagCTAG/;&lt;br /&gt;  return $sequence;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub seqlen {&lt;br /&gt;  my $sequence = shift;&lt;br /&gt;  $sequence =~ s/[^gatcnGATCN]//g;&lt;br /&gt;  return length $sequence;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;1;&lt;br /&gt;&lt;br /&gt;A module begins with the keyword package and ends with "1;". package gives the module a name, and the 1; is a true value that tells Perl that the module compiled completely without crashing.&lt;br /&gt;&lt;br /&gt;The our keyword declares a variable to be global to the module. It is similar to my, but the variable can be shared with other programs and modules ("my" variables cannot be shared outside the current file, subroutine or block). This will let us use the variable in other programs that depend on this module.&lt;br /&gt;&lt;br /&gt;To install this module, just put it in the Perl module path somewhere, or in the current directory.&lt;br /&gt;Using the MySequence.pm Module&lt;br /&gt;&lt;br /&gt;Using this module is very simple:&lt;br /&gt;&lt;br /&gt;  #!/usr/bin/perl&lt;br /&gt;  #file: sequence.pl&lt;br /&gt;&lt;br /&gt;  use strict;&lt;br /&gt;  use MySequence;&lt;br /&gt;&lt;br /&gt;  my $sequence = 'gattccggatttccaaagggttcccaatttggg';&lt;br /&gt;  my $complement = MySequence::reversec($sequence);&lt;br /&gt;&lt;br /&gt;  print "original   = $sequence\n";&lt;br /&gt;  print "complement = $complement\n";&lt;br /&gt;&lt;br /&gt;    % sequence.pl&lt;br /&gt;    original   = gattccggatttccaaagggttcccaatttggg&lt;br /&gt;    complement = cccaaattgggaaccctttggaaatccggaatc&lt;br /&gt;&lt;br /&gt;Unless you explicitly export variables or functions, the calling function must explicitly qualify each MySequence function by using the notation:&lt;br /&gt;&lt;br /&gt;    MySequence::function_name&lt;br /&gt;&lt;br /&gt;For a non-exported variable, the notation looks like this:&lt;br /&gt;&lt;br /&gt;    $MySequence::EcoRI&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Exporting Variables and Functions from Modules&lt;br /&gt;&lt;br /&gt;To make your module export variables and/or functions like a "real" module, use the Exporter module.&lt;br /&gt;&lt;br /&gt;package MySequence;&lt;br /&gt;#file: MySequence.pm&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use base 'Exporter';&lt;br /&gt;&lt;br /&gt;our @EXPORT    = qw(reversec seqlen);&lt;br /&gt;our @EXPORT_OK = qw($EcoRI);&lt;br /&gt;&lt;br /&gt;our $EcoRI = 'ggatcc';&lt;br /&gt;&lt;br /&gt;sub reversec {&lt;br /&gt;  my $sequence = shift;&lt;br /&gt;  $sequence = reverse $sequence;&lt;br /&gt;  $sequence =~ tr/gatcGATC/ctagCTAG/;&lt;br /&gt;  return $sequence;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub seqlen {&lt;br /&gt;  my $sequence = shift;&lt;br /&gt;  $sequence =~ s/[^gatcnGATCN]//g;&lt;br /&gt;  return length $sequence;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;1;&lt;br /&gt;&lt;br /&gt;The use base 'Exporter' line tells Perl that this module is a type of "Exporter" module. As we will see later, this is a way for modules to inherit properties from other modules. The Exporter module (standard in Perl) knows how to export variables and functions.&lt;br /&gt;&lt;br /&gt;The our @EXPORT = qw(reversec seqlen) line tells Perl to export the functions reversec and seqlen automatically. The our @EXPORT_OK = qw($EcoRI) tells Perl that it is OK for the user to import the $EcoRI variable, but not to export it automatically.&lt;br /&gt;&lt;br /&gt;The qw() notation is telling Perl to create a list separated by spaces. These lines are equivalent to the slightly uglier:&lt;br /&gt;&lt;br /&gt;    our @EXPORT    = ('reversec','seqlen');&lt;br /&gt;&lt;br /&gt;Using the Better MySequence.pm Module&lt;br /&gt;&lt;br /&gt;Now the module exports its reversec and seqlen functions automatically:&lt;br /&gt;&lt;br /&gt;  #!/usr/bin/perl&lt;br /&gt;  #file: sequence2.pl&lt;br /&gt;&lt;br /&gt;  use strict;&lt;br /&gt;  use MySequence;&lt;br /&gt;&lt;br /&gt;  my $sequence = 'gattccggatttccaaagggttcccaatttggg';&lt;br /&gt;  my $complement = reversec($sequence);&lt;br /&gt;&lt;br /&gt;  print "original   = $sequence\n";&lt;br /&gt;  print "complement = $complement\n";&lt;br /&gt;&lt;br /&gt;The calling program can also get at the value of the $EcoRI variable, but he has to ask for it explicitly:&lt;br /&gt;&lt;br /&gt;  #!/usr/bin/perl&lt;br /&gt;  #file: sequence3.pl&lt;br /&gt;&lt;br /&gt;  use strict;&lt;br /&gt;  use MySequence qw(:DEFAULT $EcoRI);&lt;br /&gt;&lt;br /&gt;  my $sequence = 'gattccggatttccaaagggttcccaatttggg';&lt;br /&gt;  my $complement = reversec($sequence);&lt;br /&gt;&lt;br /&gt;  print "original   = $sequence\n";&lt;br /&gt;  print "complement = $complement\n";&lt;br /&gt;&lt;br /&gt;  if ($complement =~ /$EcoRI/) {&lt;br /&gt;    print "Contains an EcoRI site.\n";&lt;br /&gt;  } else {&lt;br /&gt;    print "Doesn't contain an EcoRI site.\n";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Note that we must now import the :DEFAULT group in order to get the default reversec and seqlen functions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Object-Oriented Modules&lt;br /&gt;&lt;br /&gt;Some modules are object-oriented. Instead of importing a series of subroutines that are called directly, these modules define a series of object types that you can create and use. We will talk about object-oriented syntax in greater detail in the Perl References and Objects lecture. Here we will just show an example:&lt;br /&gt;The Math::Complex Module&lt;br /&gt;&lt;br /&gt;The Math::Complex module is a standard module that implements complex numbers. You work with it by creating one or more Math::Complex objects. You can then manipulate these objects mathematically by adding them, subtracting them, multiplying, and so on. Here is a brief example:&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file: complex.pl&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use Math::Complex;&lt;br /&gt;&lt;br /&gt;my $a = Math::Complex-&gt;make(5,6);&lt;br /&gt;my $b = Math::Complex-&gt;make(10,20);&lt;br /&gt;my $c = $a * $b;&lt;br /&gt;&lt;br /&gt;print "$a * $b = $c\n";&lt;br /&gt;&lt;br /&gt;We load the Math::Complex module with use, but now instead of calling imported subroutines, we create two objects named $a and $b. Both are created by calling Math::Complex-&gt;make() with two arguments. The first argument is the real part of the complex number, and the second is the imaginary part. The return value from make() is the complex number object. We multiply the two numbers together and store the result in $c. Finally, we print out all three values. The script's output is:&lt;br /&gt;&lt;br /&gt;51% perl complex.pl&lt;br /&gt;5+6i * 10+20i = -70+160i&lt;br /&gt;&lt;br /&gt;Object Syntax&lt;br /&gt;&lt;br /&gt;The call to make() uses Perl's object-oriented syntax. Read it as meaning "invoke the make() subroutine that is located inside the Math::Complex package." The call is similar, but not quite equivalent, to this:&lt;br /&gt;&lt;br /&gt;Math::Complex::make(10,20)&lt;br /&gt;&lt;br /&gt;The difference is that the object-oriented syntax tells Perl to pass the name of the module as an implicit first argument to make(). Therefore, Math::Complex-&gt;make(10,20) is almost exactly equivalent to this:&lt;br /&gt;&lt;br /&gt;Math::Complex::make('Math::Complex',10,20)&lt;br /&gt;&lt;br /&gt;If you are using object-oriented modules, you will never have to worry about this extra argument. If you are writing object-oriented modules, the necessity for the extra argument will make sense to you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-8419465403232605678?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/8419465403232605678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=8419465403232605678&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8419465403232605678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/8419465403232605678'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part5.html' title='Learn perl easy part5'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-1020251847179876141</id><published>2009-08-20T12:51:00.001+05:30</published><updated>2009-08-20T12:51:36.149+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Learn perl easy part4</title><content type='html'>Filehandles&lt;br /&gt;&lt;br /&gt;You can create your own filehandles using the open function, read and/or write to them, and then clean up using close.&lt;br /&gt;open&lt;br /&gt;&lt;br /&gt;open opens a file for reading and/or writing, and associates a filehandle with it. You can choose any name for the filehandle, but the convention is to make it all caps. In the examples, we use FILEHANDLE.&lt;br /&gt;open a file for reading open FILEHANDLE,"cosmids.fasta" alternative form: open FILEHANDLE,"&lt;cosmids.fasta"&lt;br /&gt;&lt;br /&gt;open a file for writing open FILEHANDLE,"&gt;cosmids.fasta"&lt;br /&gt;&lt;br /&gt;open a file for appending open FILEHANDLE,"&gt;&gt;cosmids.fasta'&lt;br /&gt;&lt;br /&gt;open a file for reading and writing open FILEHANDLE,"+&lt;cosmids.fasta"&lt;br /&gt;Catching Open Failures&lt;br /&gt;&lt;br /&gt;It's common for open to fail. Maybe the file doesn't exist, or you don't have permissions to read or create it. Always check open's return value, which is TRUE if the operation succeeded, FALSE otherwise:&lt;br /&gt;&lt;br /&gt;    $result = open COSMIDS,"cosmids.fasta";&lt;br /&gt;    die "Can't open cosmids file: $!\n" unless $result;&lt;br /&gt;&lt;br /&gt;When an error occurs, the $! variable holds a descriptive string containing a description of the error, such as "file not found".&lt;br /&gt;&lt;br /&gt;There is a compact idiom for accomplishing this in one step:&lt;br /&gt;&lt;br /&gt;    open COSMIDS,"cosmids.fasta" or die "Can't open cosmids file: $!\n";&lt;br /&gt;&lt;br /&gt;Using a Filehandle&lt;br /&gt;&lt;br /&gt;Once you've created a filehandle, you can read from it or write to it, just as if it were STDIN or STDOUT. This code reads from file "text.in" and copies lines to "text.out":&lt;br /&gt;&lt;br /&gt; open IN,"text.in"    or die "Can't open input file: $!\n";&lt;br /&gt; open OUT,"&gt;text.out" or die "Can't open output file: $!\n";&lt;br /&gt;&lt;br /&gt; while ($line = &lt;IN&gt;) {&lt;br /&gt;   print OUT $line;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Closing a Filehandle&lt;br /&gt;&lt;br /&gt;When you are done with a filehandle, you should close it. This will also happen automatically when your program ends, or if you reuse the same filehandle name.&lt;br /&gt;&lt;br /&gt;    close IN or warn "Errors while closing filehandle: $!";&lt;br /&gt;&lt;br /&gt;Some errors, like filesystem full, only occur when you close the filehandle, so you should check for errors in the same way you do when you open a filehandle.&lt;br /&gt;&lt;br /&gt;The Magic of &lt;&gt;&lt;br /&gt;&lt;br /&gt;The bare &lt;&gt; function when used without any explicit filehandle is magical. It reads from each of the files on the command line as if they were one single large file. If no file is given on the command line, then &lt;&gt; reads from standard input.&lt;br /&gt;&lt;br /&gt;This sounds weird, but it is extremely useful.&lt;br /&gt;A Practical Example of &lt;&gt;&lt;br /&gt;&lt;br /&gt;Count the number of lines and bytes in a series of files. If no file is specified, count from standard input (like wc does).&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;  #!/usr/local/bin/perl&lt;br /&gt;  # file: wc.pl&lt;br /&gt;  ($bytes,$lines) = (0,0);&lt;br /&gt;&lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    $bytes += length($_);&lt;br /&gt;    $lines++;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  print "LINES: $lines\n";&lt;br /&gt;  print "BYTES: $bytes\n";&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;    (~/grant) 79% wc.pl progress.txt&lt;br /&gt;    LINES: 102&lt;br /&gt;    BYTES: 5688&lt;br /&gt;&lt;br /&gt;    (~/grant) 80% wc.pl progress.txt resources.txt specific_aims &lt;br /&gt;    LINES: 481&lt;br /&gt;    BYTES: 24733&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Globals and Functions that Affect I/O&lt;br /&gt;&lt;br /&gt;Several built-in globals affect input and output:&lt;br /&gt;$/      The input record separator. The value of this global is used by &lt;FILE&gt; to determine where the end of a line is. Normally "\n".&lt;br /&gt;&lt;br /&gt;$\      The record output string. Whatever this is set to will appear at the end of everything printed by print. Normally empty.&lt;br /&gt;&lt;br /&gt;$,      The output field separator. Appears between all items printed with the print function. Normally empty. $"      The output list separator. Interpolated between all items of an array when an array is interpolated into a double-quoted string. Normally a space. $.       The line count. When reading from &lt;&gt;, this will be set to the line number of the "virtual file".&lt;br /&gt;&lt;br /&gt;Example use of Input Record Separator&lt;br /&gt;&lt;br /&gt;Say you have a text file containing records in the following interesting format:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&gt;gi|5340860|gb|AI793144.1|AI793144 on36f02.y5 NCI_CGAP_Lu5 Homo sapiens cDNA clone&lt;br /&gt;CAAACAGCCCCCGATAACGCTACGTGAGCTGGGCCCTGGGCCTGAGGCAGAAAACGGACGGAAGAAAAGG&lt;br /&gt;TCTGGCCGGAGATGGGTCTCACTCTGTCACCCAGACTGGAGTGCAGTGAGTGGTGCGATCATAGCTTACT&lt;br /&gt;GCAGCCTGAAACTCCTGGGCTCAAGTGATCTTCTCGCCTCAGCCTCCTGAGTAGCTGGAGCTACAGGAAT&lt;br /&gt;GAGCATAGATGAACAATGTTGCATCACGCTTGACATCACCGGNGCTTCTTTCCAGTGTGGATTTGCTCAT&lt;br /&gt;GTAAAATGAGGTGTGAGCTCTGCCTGAAAGCTTTTCCATATGCATCACATTTGCAGGGCTTTTCTCCAGT&lt;br /&gt;GTGGGTTCTTTGGTGTCTCAAAAGATGTGAGCTGTTACTGAAAGCTTTCCCACACACATCACACTCATAG&lt;br /&gt;GGCTTCTCTCTACCGTGGATTCGCTGGTGTCCAACAAGAGCTGAACTGTATCTGAAGGCCTTTCCACGCT&lt;br /&gt;TGTCACATTCATATAGTTTCTTTCCACTGTGGATTNTCTGGTGACAGAAGAGGCCCAAGCACTAGCTAAA&lt;br /&gt;GCTNTTCCCTCACTCACTACACTGCTATGGCTTCTCTTCAGTATGAACTCTGATGTTGTCTCAGATATGA&lt;br /&gt;ACTCAGAGAGGATNTCCCACAATCATTACACTGGTATGGTTCCTTTTCGTGTGAGTTCTCTGGTGTCNAA&lt;br /&gt;ATACATCTGAGCTGTGATGAAAGAACTTNCCACACTCACTACATTGGGAAGG&lt;br /&gt;&lt;br /&gt;&gt;gi|4306680|gb|AI451833.1|AI451833 mx13e08.y1 Soares mouse NML Mus musculus cDNA clone&lt;br /&gt;TGAATGTATGCAGTGCGGAAAGACATTCACTTCTGGCCACTGTGCCAGAAGACATTTAGGGACTCACAGT&lt;br /&gt;GGAGCCTGGCCTTACAAATGTGAAGTGTGTGGGAAAGCTTATCCCTACGTCTATTCCCTTCGAAACCACA&lt;br /&gt;AAAAAAGTCACAACGAAGAAAAACTTTATGAATGTAAACAATGTGGGAAAGCCTTTAAATACATTTCTTC&lt;br /&gt;CTTACGCAACCACGAGACTACTCACACTGGAGAGAAGCCCTATGAATGTAAGGAATGTGGGAAAGCCTTT&lt;br /&gt;AGTTGTTCCAGTTACATTCAAAATCACATGAGAACACACAAAAGGCAGTCCTATGAATGTAAGGAGTGTG&lt;br /&gt;GTAAGGTGTTCTCATATTCCAAAAGTCTTCGGAGACACATGACTACACATAGTTAATTAGAGAGGGATAG&lt;br /&gt;TTNTAAGTATAATTTAAATATATAAAAGAGCTCTACACATTCTAGCTCCTCATTAAGAAACAAAAAATTT&lt;br /&gt;CACACTGGAAAACGAGCCTATGAATGCAGTATGTGTGCCAAAGTCTCAGTACATGCCACAGT&lt;br /&gt;&lt;br /&gt;&gt;gi|3400733|gb|AI074089.1|AI074089 oq97c08.x1 NCI_CGAP_Co12 Homo sapiens cDNA clone&lt;br /&gt;GAATCTTCTGGGTCCTCTTTATTAAGAGCCCTCTGCCTTCCCAGGGGAGGGAAGCAAATCCTTCAGGGCC&lt;br /&gt;CCCAGAGTTCCTGCACCCCATATCATGGGTGAGTCCTACCAGCCACAGAGCCACCCGTCACCGTGGAGAG&lt;br /&gt;GCTTAAGCTGCACTCAGAGCTCCCCCCGGGCATGCCGAATGTAGTGTTGATGCAGCCCTGCTTCCTGAGC&lt;br /&gt;AAAGTCCTGACCGCACTCTGTGCAGGCGAAGGTGCCAGGAGGGGCACGGACCTCATGCATCTGGCGGTGC&lt;br /&gt;CGCCTCAGAGAAACAGCCTGCCCAAAGGTCTTGCCACAGTCAGGACAAGGGAAGGTGGGCTGGGCAGTAG&lt;br /&gt;TGGTTGCAACCGGCAGGGTGGGCTTGGCGGCTGGACCGTGGCTGCGCTGGTGGGTGATTAGGGCTTTGGA&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;If you use standard &lt;&gt;, you will get a line at a time, and have to figure out where one record ends and a new one starts. However, if you set the input record separator to "&gt;", then each time you read a "line", you will read all the way to the next "&gt;" symbol. Throw away the first record (which is empty), keep the others.&lt;br /&gt;&lt;br /&gt;  #!/usr/local/bin/perl&lt;br /&gt;  # file: get_fasta_records.pl&lt;br /&gt;&lt;br /&gt;  $/ = '&gt;';&lt;br /&gt;&lt;br /&gt;  &lt;&gt;;  # throw away the first record (will be empty)&lt;br /&gt;&lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    chomp;&lt;br /&gt;    # split up lines of the record.  The first line&lt;br /&gt;    # is the sequence ID.  The second and subsequent lines&lt;br /&gt;    # are the sequence&lt;br /&gt;    my ($id,@sequence) = split "\n";&lt;br /&gt;    my $sequence = join '',@sequence; # reassemble the sequence&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Special Uses of the Input Record Separator&lt;br /&gt;&lt;br /&gt;The input record separator has two special cases.&lt;br /&gt;Paragraph Mode&lt;br /&gt;&lt;br /&gt;If the input record separator ($/) is set to the empty string ("") it goes into paragraph mode. Each &lt;&gt; will read up to the next blank line. Multiple blank lines will be skipped over. This is good for reading text separated into paragraphs.&lt;br /&gt;Slurp Mode&lt;br /&gt;&lt;br /&gt;If the input record separator is set to the undefined value (undef) then it goes into slurp mode. The &lt;&gt; operator will read its entire input into a single scalar.&lt;br /&gt;&lt;br /&gt;Here's how to read the entire file cosmids.fasta into a scalar variable:&lt;br /&gt;&lt;br /&gt;  open IN,"cosmids.fasta" or die "Can't open cosmids.fasta: $!\n";&lt;br /&gt;  $/ = undef;&lt;br /&gt;&lt;br /&gt;  $data = &lt;IN&gt;;  # data slurp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regular Expressions&lt;br /&gt;&lt;br /&gt;A regular expression is a string template against which you can match a piece of text. They are something like shell wildcard expressions, but much more powerful.&lt;br /&gt;Examples of Regular Expressions&lt;br /&gt;&lt;br /&gt;This bit of code loops through each line of a file. Finds all lines containing an EcoRI site, and bumps up a counter:&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl -w&lt;br /&gt;#file: EcoRI1.pl&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;my $filename = "example.fasta";&lt;br /&gt;open (FASTA , "$filename") or print "$filename does not exist\n";&lt;br /&gt;my $sites;&lt;br /&gt;&lt;br /&gt;while (my $line = &lt;FASTA&gt;) {&lt;br /&gt;  chomp $line;&lt;br /&gt;&lt;br /&gt;  if ($line =~ /GAATTC/){ &lt;br /&gt;    print "Found an EcoRI site!\n";&lt;br /&gt;    $sites++;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ($sites){&lt;br /&gt;  print "$sites EcoRI sites total\n";&lt;br /&gt;}else{&lt;br /&gt;  print "No EcoRI sites were found\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#note: if $sites is declared inside while loop you would not be able to&lt;br /&gt;#print it outside the loop&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;~]$ ./EcoRI1.pl&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;34 EcoRI sites total&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This Works Too!&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:EcoRI2.pl&lt;br /&gt;&lt;br /&gt;while ( &lt;FASTA&gt; ) {&lt;br /&gt;  chomp;&lt;br /&gt;  if ($_ = /GAATTC/){&lt;br /&gt;    print "Found an EcoRI site!\n";&lt;br /&gt;    $sites++;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;~]$ ./EcoRI1.pl&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;34 EcoRI sites total&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This Also Works&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:EcoRI.pl&lt;br /&gt;&lt;br /&gt;while ( &lt;FASTA&gt; ) {&lt;br /&gt;  chomp;&lt;br /&gt;  if (/GAATTC/){  			&lt;br /&gt;    print "Found an EcoRI site!\n";&lt;br /&gt;    $sites++;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;By default, a regular expression examines $_ and returns a TRUE if it matches, FALSE otherwise.&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;~]$ ./EcoRI1.pl&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;Found an EcoRI site!&lt;br /&gt;34 EcoRI sites total&lt;br /&gt;&lt;br /&gt;This does the same thing, but counts one type of methylation site (Pu-C-X-G) instead:&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:methy.pl&lt;br /&gt;&lt;br /&gt;while (&lt;FASTA&gt;) {&lt;br /&gt;  	chomp;&lt;br /&gt; 	  &lt;br /&gt;  	if (/[GA]C.?G/){    #What Happens If Your File Is Not All In CAPS&lt;br /&gt;    	#print "Found a Methylation Site!\n";&lt;br /&gt;    	$sites++;&lt;br /&gt;  	}&lt;br /&gt;}&lt;br /&gt;if ($sites){&lt;br /&gt;	print "$sites Methylation Sites total\n";&lt;br /&gt;}else{&lt;br /&gt;	print "No Methylation Sites were found\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;~]$ ./methy.pl&lt;br /&gt;723 Methylation Sites total&lt;br /&gt;&lt;br /&gt;Regular Expression Variable&lt;br /&gt;&lt;br /&gt;A regular expression is normally delimited by two slashes ("/"). Everything between the slashes is a pattern to match. Patterns can be made up of the following Atoms:&lt;br /&gt;&lt;br /&gt;   1. Ordinary characters: a-z, A-Z, 0-9 and some punctuation. These match themselves.&lt;br /&gt;&lt;br /&gt;   2. The "." character, which matches everything except the newline.&lt;br /&gt;&lt;br /&gt;   3. A bracket list of characters, such as [AaGgCcTtNn], [A-F0-9], or [^A-Z] (the last means anything BUT A-Z).&lt;br /&gt;&lt;br /&gt;   4. Certain predefined character sets: \d The digits [0-9] \w A word character [A-Za-z_0-9] \s White space [ \t\n\r] \D A non-digit \W A non-word \S Non-whitespace&lt;br /&gt;   5. Anchors: ^ Matches the beginning of the string $ Matches the end of the string \b Matches a word boundary (between a \w and a \W) &lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;    * /g..t/ matches "gaat", "goat", and "gotta get a goat" (twice)&lt;br /&gt;&lt;br /&gt;    * /g[gatc][gatc]t/ matches "gaat", "gttt", "gatt", and "gotta get an agatt" (once)&lt;br /&gt;&lt;br /&gt;    * /\d\d\d-\d\d\d\d/ matches 376-8380, and 5128-8181, but not 055-98-2818.&lt;br /&gt;&lt;br /&gt;    * /^\d\d\d-\d\d\d\d/ matches 376-8380 and 376-83801, but not 5128-8181.&lt;br /&gt;&lt;br /&gt;    * /^\d\d\d-\d\d\d\d$/ only matches telephone numbers.&lt;br /&gt;&lt;br /&gt;    * /\bcat/ matches "cat", "catsup" and "more catsup please" but not "scat".&lt;br /&gt;&lt;br /&gt;    * /\bcat\b/ only text containing the word "cat".&lt;br /&gt;&lt;br /&gt;Quantifiers&lt;br /&gt;&lt;br /&gt;By default, an atom matches once. This can be modified by following the atom with a quantifier:&lt;br /&gt;? atom matches zero or exactly once* atom matches zero or more times + atom matches one or more times {3} atom matches exactly three times {2,4} atom matches between two and four times, inclusive {4,} atom matches at least four times&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;    * /goa?t/ matches "goat" and "got". Also any text that contains these words.&lt;br /&gt;    * /g.+t/ matches "goat", "goot", and "grant", among others.&lt;br /&gt;    * /g.*t/ matches "gt", "goat", "goot", and "grant", among others.&lt;br /&gt;    * /^\d{3}-\d{4}$/ matches US telephone numbers (no extra text allowed. &lt;br /&gt;&lt;br /&gt;Alternatives and Grouping&lt;br /&gt;&lt;br /&gt;A set of alternative patterns can be specified with the | symbol:&lt;br /&gt;&lt;br /&gt;    /wolf|sheep/;   # matches "wolf" or "sheep"&lt;br /&gt;&lt;br /&gt;    /big bad (wolf|sheep)/;   # matches "big bad wolf" or "big bad sheep"&lt;br /&gt;&lt;br /&gt;You can combine parenthesis and quantifiers to quantify entire subpatterns:&lt;br /&gt;&lt;br /&gt;    /Who's afraid of the big (bad )?wolf\?/;&lt;br /&gt;    # matches "Who's afraid of the big bad wolf?" and&lt;br /&gt;    #         "Who's afraid of the big wolf?"&lt;br /&gt;&lt;br /&gt;This also shows how to literally match the special characters -- put a backslash (\) in front of them.&lt;br /&gt;Specifying the String to Match&lt;br /&gt;&lt;br /&gt;Regular expressions will attempt to match $_ by default. To specify another string variable, use the =~ (binding) operator:&lt;br /&gt;&lt;br /&gt;    $h = "Who's afraid of Virginia Woolf?";&lt;br /&gt;    print "I'm afraid!\n" if $h =~ /Woo?lf/;&lt;br /&gt;&lt;br /&gt;There's also an equivalent "not match" operator !~, which reverses the sense of the match:&lt;br /&gt;&lt;br /&gt;    $h = "Who's afraid of Virginia Woolf?";&lt;br /&gt;    print "I'm not afraid!\n" if $h !~ /Woo?lf/;&lt;br /&gt;&lt;br /&gt;Using a Different Delimiter&lt;br /&gt;&lt;br /&gt;If you want to match slashes in the pattern, you can backslash them:&lt;br /&gt;&lt;br /&gt;    $file = '/usr/local/blast/cosmids.fasta';&lt;br /&gt;    print "local file" if $file =~ /^\/usr\/local/;&lt;br /&gt;&lt;br /&gt;This is ugly, so you can specify any match delimiter with the m (match) operator:&lt;br /&gt;&lt;br /&gt;    $file = '/usr/local/blast/cosmids.fasta';&lt;br /&gt;    print "local file" if $file =~ m!^/usr/local!;&lt;br /&gt;&lt;br /&gt;The punctuation character that follows the m becomes the delimiter. In fact // is just an abbreviation for m//. Almost any punctuation character will work:&lt;br /&gt;&lt;br /&gt;    * m!^/usr/local!&lt;br /&gt;    * m#^/usr/local#&lt;br /&gt;    * m@^/usr/local@&lt;br /&gt;    * m,^/usr/local,&lt;br /&gt;    * m{^/usr/local}&lt;br /&gt;    * m[^/usr/local] &lt;br /&gt;&lt;br /&gt;The last two examples show that you can use left-right bracket pairs as well.&lt;br /&gt;Matching with a Variable Pattern&lt;br /&gt;&lt;br /&gt;You can use a scalar variable for all or part of a regular expression. For example:&lt;br /&gt;&lt;br /&gt;    $pattern = '/usr/local';&lt;br /&gt;    print "matches" if $file =~ /^$pattern/;&lt;br /&gt;&lt;br /&gt;See the o flag for important information about using variables inside patterns.&lt;br /&gt;&lt;br /&gt;Subpatterns&lt;br /&gt;&lt;br /&gt;You can extract and manipulate subpatterns in regular expressions.&lt;br /&gt;&lt;br /&gt;To designate a subpattern, surround its part of the pattern with parenthesis (same as with the grouping operator). This example has just one subpattern, (.+) :&lt;br /&gt;&lt;br /&gt; /Who's afraid of the big bad w(.+)f/&lt;br /&gt;&lt;br /&gt;Matching Subpatterns&lt;br /&gt;&lt;br /&gt;Once a subpattern matches, you can refer to it later within the same regular expression. The first subpattern becomes \1, the second \2, the third \3, and so on.&lt;br /&gt;&lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    chomp;&lt;br /&gt;    print "I'm scared!\n" if /Who's afraid of the big bad w(.)\1f/&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;This loop will print "I'm scared!" for the following matching lines:&lt;br /&gt;&lt;br /&gt;    * Who's afraid of the big bad woof&lt;br /&gt;    * Who's afraid of the big bad weef&lt;br /&gt;    * Who's afraid of the big bad waaf &lt;br /&gt;&lt;br /&gt;but not&lt;br /&gt;&lt;br /&gt;    * Who's afraid of the big bad wolf&lt;br /&gt;    * Who's afraid of the big bad wife &lt;br /&gt;&lt;br /&gt;In a similar vein, /\b(\w+)s love \1 food\b/ will match "dogs love dog food", but not "dogs love monkey food".&lt;br /&gt;Using Subpatterns Outside the Regular Expression Match&lt;br /&gt;&lt;br /&gt;Outside the regular expression match statement, the matched subpatterns (if any) can be found the variables $1, $2, $3, and so forth.&lt;br /&gt;&lt;br /&gt;Example. Extract 50 base pairs upstream and 25 base pairs downstream of the TATTAT consensus transcription start site:&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    chomp;&lt;br /&gt;    next unless /(.{50})TATTAT(.{25})/;&lt;br /&gt;    my $upstream = $1;&lt;br /&gt;    my $downstream = $2;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Extracting Subpatterns Using Arrays&lt;br /&gt;&lt;br /&gt;If you assign a regular expression match to an array, it will return a list of all the subpatterns that matched. Alternative implementation of previous example:&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    chomp;&lt;br /&gt;    my ($upstream,$downstream) = /(.{50})TATTAT(.{25})/;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;If the regular expression doesn't match at all, then it returns an empty list. Since an empty list is FALSE, you can use it in a logical test:&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    chomp;&lt;br /&gt;    next unless my($upstream,$downstream) = /(.{50})TATTAT(.{25})/;&lt;br /&gt;    print "upstream = $upstream\n";&lt;br /&gt;    print "downstream = $downstream\n";  &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Grouping without Making Subpatterns&lt;br /&gt;&lt;br /&gt;Because parentheses are used both for grouping (a|ab|c) and for matching subpatterns, you may match subpatterns that don't want to. To avoid this, group with (?:pattern):&lt;br /&gt;&lt;br /&gt;/big bad (?:wolf|sheep)/;&lt;br /&gt;&lt;br /&gt;# matches "big bad wolf" or "big bad sheep",&lt;br /&gt;# but doesn't extract a subpattern.&lt;br /&gt;&lt;br /&gt;Subpatterns and Greediness&lt;br /&gt;&lt;br /&gt;By default, regular expressions are "greedy". They try to match as much as they can. For example:&lt;br /&gt;&lt;br /&gt;$h = 'The fox ate my box of doughnuts';&lt;br /&gt;$h =~ /(f.+x)/;&lt;br /&gt;$subpattern = $1;&lt;br /&gt;&lt;br /&gt;Because of the greediness of the match, $subpattern will contain "fox ate my box" rather than just "fox".&lt;br /&gt;&lt;br /&gt;To match the minimum number of times, put a ? after the qualifier, like this:&lt;br /&gt;&lt;br /&gt;$h = 'The fox ate my box of doughnuts';&lt;br /&gt;$h =~ /(f.+?x)/;&lt;br /&gt;$subpattern = $1;&lt;br /&gt;&lt;br /&gt;Now $subpattern will contain "fox". This is called lazy matching.&lt;br /&gt;&lt;br /&gt;Lazy matching works with any quantifier, such as +?, *? and {2,50}?.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;String Substitution&lt;br /&gt;&lt;br /&gt;String substitution allows you to replace a pattern or character range with another one using the s/// and tr/// functions.&lt;br /&gt;The s/// Function&lt;br /&gt;&lt;br /&gt;s/// has two parts: the regular expression and the string to replace it with: s/expression/replacement/.&lt;br /&gt;&lt;br /&gt;$h = "Who's afraid of the big bad wolf?";&lt;br /&gt;$i = "He had a wife.";&lt;br /&gt;&lt;br /&gt;$h =~ s/w.+f/goat/;  # yields "Who's afraid of the big bad goat?"&lt;br /&gt;$i =~ s/w.+f/goat/;  # yields "He had a goate."&lt;br /&gt;&lt;br /&gt;If you extract pattern matches, you can use them in the replacement part of the substitution:&lt;br /&gt;&lt;br /&gt;$h = "Who's afraid of the big bad wolf?";&lt;br /&gt;&lt;br /&gt;$h =~ s/(\w+) (\w+) wolf/$2 $1 wolf/;&lt;br /&gt;# yields "Who's afraid of the bad big wolf?"&lt;br /&gt;&lt;br /&gt;Default Substitution Variable&lt;br /&gt;&lt;br /&gt;If you don't bind a variable with =~, then s/// operates on $_ just as the match does.&lt;br /&gt;Using a Variable in the Substitution Part&lt;br /&gt;&lt;br /&gt;Yes you can:&lt;br /&gt;&lt;br /&gt;$h = "Who's afraid of the big bad wolf?";&lt;br /&gt;$animal = 'hyena';&lt;br /&gt;$h =~ s/(\w+) (\w+) wolf/$2 $1 $animal/;&lt;br /&gt;# yields "Who's afraid of the bad big hyena?"&lt;br /&gt;&lt;br /&gt;Using Different Delimiters&lt;br /&gt;&lt;br /&gt;The s/// function can use alternative delimiters, including parentheses and bracket pairs. For example:&lt;br /&gt;&lt;br /&gt;$h = "Who's afraid of the big bad wolf?";&lt;br /&gt;&lt;br /&gt;$h =~ s!(\w+) (\w+) wolf!$2 $1 wolf!;   # using ! as delimiter&lt;br /&gt;&lt;br /&gt;$h =~ s{(\w+) (\w+) wolf}{$2 $1 wolf};  # using {} as delimiter&lt;br /&gt;&lt;br /&gt;Translating Character Ranges&lt;br /&gt;&lt;br /&gt;The tr/// function allows you to translate one set of characters into another. Specify the source set in the first part of the function, and the destination set in the second part:&lt;br /&gt;&lt;br /&gt;$h = "Who's afraid of the big bad wolf?";&lt;br /&gt;$h =~ tr/ao/AO/; # yields "WhO's AfrAid Of the big bAd wOlf?";&lt;br /&gt;&lt;br /&gt;Like s///, the tr/// function operates on $_ if not otherwise specified.&lt;br /&gt;&lt;br /&gt;tr/// returns the number of characters transformed, which is sometimes handy for counting the number of a particular character without actually changing the string.&lt;br /&gt;&lt;br /&gt;This example counts N's in a series of DNA sequences:&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  while (&lt;&gt;) {&lt;br /&gt;    chomp;   # assume one sequence per line&lt;br /&gt;    my $count = tr/Nn/Nn/;&lt;br /&gt;    print "Sequence $_ contains $count Ns\n";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;(~) 50% count_Ns.pl sequence_list.txt&lt;br /&gt;Sequence 1 contains 0 Ns&lt;br /&gt;Sequence 2 contains 3 Ns&lt;br /&gt;Sequence 3 contains 1 Ns&lt;br /&gt;Sequence 4 contains 0 Ns&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regular Expression Options&lt;br /&gt;&lt;br /&gt;Regular expression matches and substitutions have a whole set of options which you can toggle on by appending one or more of the i, m, s, g, e or x modifiers to the end of the operation. See Programming Perl Page 153 for more information. Some example:&lt;br /&gt;&lt;br /&gt;$string = 'Big Bad WOLF!';&lt;br /&gt;print "There's a wolf in the closet!" if $string =~ /wolf/i;&lt;br /&gt;# i is used for a case insensitive match&lt;br /&gt;&lt;br /&gt;i Case insensitive match.&lt;br /&gt;&lt;br /&gt;g Global match (see below).&lt;br /&gt;&lt;br /&gt;e Evalute right side of s/// as an expression.&lt;br /&gt;&lt;br /&gt;o Only compile variable patterns once (see below).&lt;br /&gt;&lt;br /&gt;m Treat string as multiple lines. ^ and $ will match at start and end of internal lines, as well as at beginning and end of whole string. Use \A and \Z to match beginning and end of whole string when this is turned on.&lt;br /&gt;&lt;br /&gt;s Treat string as a single line. "." will match any character at all, including newline.&lt;br /&gt;&lt;br /&gt;x Allow extra whitespace and comments in pattern.&lt;br /&gt;Global Matches&lt;br /&gt;&lt;br /&gt;Adding the g modifier to the pattern causes the match to be global. Called in a scalar context (such as an if or while statement), it will match as many times as it can.&lt;br /&gt;&lt;br /&gt;This will match all codons in a DNA sequence, printing them out on separate lines:&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;  $sequence = 'GTTGCCTGAAATGGCGGAACCTTGAA';&lt;br /&gt;  while ( $sequence =~ /(.{3})/g ) {&lt;br /&gt;    print $1,"\n";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;GTT&lt;br /&gt;GCC&lt;br /&gt;TGA&lt;br /&gt;AAT&lt;br /&gt;GGC&lt;br /&gt;GGA&lt;br /&gt;ACC&lt;br /&gt;TTG&lt;br /&gt;&lt;br /&gt;If you perform a global match in a list context (e.g. assign its result to an array), then you get a list of all the subpatterns that matched from left to right. This code fragment gets arrays of codons in three reading frames:&lt;br /&gt;&lt;br /&gt;@frame1 = $sequence =~ /(.{3})/g;&lt;br /&gt;@frame2 = substr($sequence,1) =~ /(.{3})/g;&lt;br /&gt;@frame3 = substr($sequence,2) =~ /(.{3})/g;&lt;br /&gt;&lt;br /&gt;The position of the most recent match can be determined by using the pos function.&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:pos.pl&lt;br /&gt;my $seq = "XXGGATCCXX";&lt;br /&gt;&lt;br /&gt;if ( $seq =~ /(GGATCC)/gi ){&lt;br /&gt;        my $pos = pos($seq);&lt;br /&gt;        print "Our Sequence: $seq\n";&lt;br /&gt;        print '$pos = ', "1st postion after the match: $pos\n";&lt;br /&gt;        print '$pos - length($1) = 1st postion of the match: ',($pos-length($1)),"\n";&lt;br /&gt;        print '($pos - length($1))-1 = 1st postion before the the match: ',($pos-length($1)-1),"\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;~]$ ./pos.pl&lt;br /&gt;Our Sequence: XXGGATCCXX&lt;br /&gt;$pos = 1st postion after the match: 8&lt;br /&gt;$pos - length($&amp;) = 1st postion of the match: 2&lt;br /&gt;($pos - length($&amp;))-1 = 1st postion before the the match: 1&lt;br /&gt;&lt;br /&gt;Variable Interpolation and the "o" Modifier&lt;br /&gt;&lt;br /&gt;If you use a variable inside a pattern template, as in /$pattern/ be aware that there is a small performance penalty each time Perl encounters a pattern it hasn't seen before. If $pattern doesn't change over the life of the program, then use the o ("once") modifier to tell Perl that the variable won't change. The program will run faster:&lt;br /&gt;&lt;br /&gt;$codon = '.{3}';&lt;br /&gt;@frame1 = $sequence =~ /($codon)/og;&lt;br /&gt;&lt;br /&gt;Testings Your Regular Expressions&lt;br /&gt;&lt;br /&gt;To be sure that you are getting what you think you want you can use the following "Magic" Perl Automatic Match Variables $&amp;, $`, and $'&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:matchTest.pl&lt;br /&gt;&lt;br /&gt;if ("Hello there, neighbor" =~ /\s(\w+),/){&lt;br /&gt;        print "That actually matched '$&amp;'.\n";&lt;br /&gt;        print "That was ($`) ($&amp;) ($').\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;That actually matched ' there,'.&lt;br /&gt;That was (Hello) ( there,) ( neighbor).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regular Expression Options&lt;br /&gt;&lt;br /&gt;Regular expression matches and substitutions have a whole set of options which you can toggle on by appending one or more of the i, m, s, g, e or x modifiers to the end of the operation. See Programming Perl Page 153 for more information. Some example:&lt;br /&gt;&lt;br /&gt;$string = 'Big Bad WOLF!';&lt;br /&gt;print "There's a wolf in the closet!" if $string =~ /wolf/i;&lt;br /&gt;# i is used for a case insensitive match&lt;br /&gt;&lt;br /&gt;i Case insensitive match.&lt;br /&gt;&lt;br /&gt;g Global match (see below).&lt;br /&gt;&lt;br /&gt;e Evalute right side of s/// as an expression.&lt;br /&gt;&lt;br /&gt;o Only compile variable patterns once (see below).&lt;br /&gt;&lt;br /&gt;m Treat string as multiple lines. ^ and $ will match at start and end of internal lines, as well as at beginning and end of whole string. Use \A and \Z to match beginning and end of whole string when this is turned on.&lt;br /&gt;&lt;br /&gt;s Treat string as a single line. "." will match any character at all, including newline.&lt;br /&gt;&lt;br /&gt;x Allow extra whitespace and comments in pattern.&lt;br /&gt;Global Matches&lt;br /&gt;&lt;br /&gt;Adding the g modifier to the pattern causes the match to be global. Called in a scalar context (such as an if or while statement), it will match as many times as it can.&lt;br /&gt;&lt;br /&gt;This will match all codons in a DNA sequence, printing them out on separate lines:&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;  $sequence = 'GTTGCCTGAAATGGCGGAACCTTGAA';&lt;br /&gt;  while ( $sequence =~ /(.{3})/g ) {&lt;br /&gt;    print $1,"\n";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;GTT&lt;br /&gt;GCC&lt;br /&gt;TGA&lt;br /&gt;AAT&lt;br /&gt;GGC&lt;br /&gt;GGA&lt;br /&gt;ACC&lt;br /&gt;TTG&lt;br /&gt;&lt;br /&gt;If you perform a global match in a list context (e.g. assign its result to an array), then you get a list of all the subpatterns that matched from left to right. This code fragment gets arrays of codons in three reading frames:&lt;br /&gt;&lt;br /&gt;@frame1 = $sequence =~ /(.{3})/g;&lt;br /&gt;@frame2 = substr($sequence,1) =~ /(.{3})/g;&lt;br /&gt;@frame3 = substr($sequence,2) =~ /(.{3})/g;&lt;br /&gt;&lt;br /&gt;The position of the most recent match can be determined by using the pos function.&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:pos.pl&lt;br /&gt;my $seq = "XXGGATCCXX";&lt;br /&gt;&lt;br /&gt;if ( $seq =~ /(GGATCC)/gi ){&lt;br /&gt;        my $pos = pos($seq);&lt;br /&gt;        print "Our Sequence: $seq\n";&lt;br /&gt;        print '$pos = ', "1st postion after the match: $pos\n";&lt;br /&gt;        print '$pos - length($1) = 1st postion of the match: ',($pos-length($1)),"\n";&lt;br /&gt;        print '($pos - length($1))-1 = 1st postion before the the match: ',($pos-length($1)-1),"\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;~]$ ./pos.pl&lt;br /&gt;Our Sequence: XXGGATCCXX&lt;br /&gt;$pos = 1st postion after the match: 8&lt;br /&gt;$pos - length($&amp;) = 1st postion of the match: 2&lt;br /&gt;($pos - length($&amp;))-1 = 1st postion before the the match: 1&lt;br /&gt;&lt;br /&gt;Variable Interpolation and the "o" Modifier&lt;br /&gt;&lt;br /&gt;If you use a variable inside a pattern template, as in /$pattern/ be aware that there is a small performance penalty each time Perl encounters a pattern it hasn't seen before. If $pattern doesn't change over the life of the program, then use the o ("once") modifier to tell Perl that the variable won't change. The program will run faster:&lt;br /&gt;&lt;br /&gt;$codon = '.{3}';&lt;br /&gt;@frame1 = $sequence =~ /($codon)/og;&lt;br /&gt;&lt;br /&gt;Testings Your Regular Expressions&lt;br /&gt;&lt;br /&gt;To be sure that you are getting what you think you want you can use the following "Magic" Perl Automatic Match Variables $&amp;, $`, and $'&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;#file:matchTest.pl&lt;br /&gt;&lt;br /&gt;if ("Hello there, neighbor" =~ /\s(\w+),/){&lt;br /&gt;        print "That actually matched '$&amp;'.\n";&lt;br /&gt;        print "That was ($`) ($&amp;) ($').\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;That actually matched ' there,'.&lt;br /&gt;That was (Hello) ( there,) ( neighbor).&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-1020251847179876141?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/1020251847179876141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=1020251847179876141&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1020251847179876141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1020251847179876141'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part4.html' title='Learn perl easy part4'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5634759259101232926</id><published>2009-08-20T12:48:00.000+05:30</published><updated>2009-08-20T12:50:49.385+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Learn perl easy part3</title><content type='html'>&lt;h2&gt;&lt;a name="arraylist"&gt;An Array Is a List of Values&lt;/a&gt;&lt;/h2&gt;  For example a list with the number 3.14 as the first element, the string 'abA' as the second element, and the number 65065 as the third element. &lt;br /&gt;&lt;h2&gt;&lt;a name="syntax"&gt;"Literal Representation"&lt;/a&gt;&lt;/h2&gt;  We write the list as above as &lt;pre&gt;(3.14, 'abA', 65065)&lt;br /&gt;&lt;/pre&gt; If $pi = 3.14 and $s = 'abA' we can also write &lt;pre&gt;($pi, $s, 65065)&lt;br /&gt;&lt;/pre&gt; We can also do integer ranges: &lt;pre&gt;(-1..5)&lt;br /&gt;&lt;/pre&gt; shorthand for &lt;pre&gt;(-1, 0, 1, 2, 3, 4, 5)&lt;br /&gt;&lt;/pre&gt; Counting down not allowed! &lt;h2&gt;&lt;a name="assignment"&gt;Array Variables and Assignment&lt;/a&gt;&lt;/h2&gt; &lt;pre&gt;my $x = 65065;&lt;br /&gt;my @x = ($pi, 'abA', $x);&lt;br /&gt;my @y = (-1..5);&lt;br /&gt;my @z = ($x, $pi, @x, @y);&lt;br /&gt;my ($first, @rest) = @z;&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="elements"&gt;Getting at Array Elements&lt;/a&gt;&lt;/h2&gt; &lt;pre&gt;$z[0]      # 65065&lt;br /&gt;$z[0] = 2;&lt;br /&gt;$z[0]      # 2&lt;br /&gt;$z[$#z];   # 5&lt;br /&gt;&lt;/pre&gt; Skip "slices" for now.  &lt;h2&gt;&lt;a name="pushetc"&gt;Push, Pop, Shift, Unshift&lt;/a&gt;&lt;/h2&gt;  &lt;i&gt;Add&lt;/i&gt; 9 to the &lt;i&gt;end&lt;/i&gt; of @z; &lt;pre&gt;push @z, 9;&lt;br /&gt;&lt;/pre&gt; Take the 9 off the end of @z, and then take the 5 off the end: &lt;pre&gt;my $end1 = pop @z;&lt;br /&gt;my $end2 = pop @z;&lt;br /&gt;&lt;/pre&gt;  &lt;i&gt;Add&lt;/i&gt; 9 to the &lt;i&gt;beginning&lt;/i&gt; of @z; &lt;pre&gt;unshift @z, 9;&lt;br /&gt;&lt;/pre&gt; Take the 9 off the beginning of @z, and then take the 3.14 off the beginning: &lt;pre&gt;my $b1 = shift @z;&lt;br /&gt;my $b2 = shift @z;&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="reversing"&gt;Reverse&lt;/a&gt;&lt;/h2&gt;  &lt;pre&gt;my @zr = reverse @z;&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="sorting"&gt;Sorting&lt;/a&gt;&lt;/h2&gt;  Alphabetically: &lt;pre&gt;my @zs = sort @z;&lt;br /&gt;&lt;/pre&gt; Numerically: &lt;pre&gt;my @q = sort { $a &lt;=&gt; $b } (-1, 3, -20)&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="split"&gt;Split and Join&lt;/a&gt;&lt;/h2&gt;  &lt;pre&gt;my @q = split /\d+/, 'abd1234deff0exx'&lt;br /&gt;# ('abd', 'deff', 'exx');&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="reading"&gt;Swallowing Whole Files in a Single Gulp&lt;/a&gt;&lt;/h2&gt;  &lt;pre&gt;my @i = &lt;&gt;;&lt;br /&gt;chomp @i;&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="scalarandarray"&gt;Array and Scalar Context&lt;/a&gt;&lt;/h2&gt;  The notion of array and scalar context is unique to perl. Usually you can remain unaware of it, but it comes up in reverse, and can be used to get the size of an array.  &lt;pre&gt;print reverse 'ab'; # prints ab!!! (reverse in array context)&lt;br /&gt;$ba = reverse 'ab'; # $ba contains 'ba' (reverse in scalar context)&lt;br /&gt;print scalar reverse 'ab'; # prints ba&lt;br /&gt;print scalar @z; # print the size of @z&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a name="hash"&gt;A Hash Is a Lookup Table&lt;/a&gt;&lt;/h2&gt;  A hash is a lookup table.  We use  a key to find an associated value.  &lt;pre&gt;my %translate;&lt;br /&gt;$translate{'atg'} = 'M';&lt;br /&gt;$translate{'taa'} = '*';&lt;br /&gt;$translate{'ctt'} = 'K';  # oops&lt;br /&gt;$translate{'ctt'} = 'L';  # fixed&lt;br /&gt;print $translate{'atg'};&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="keys"&gt;Getting All Keys&lt;/a&gt;&lt;/h2&gt;  &lt;pre&gt;keys %translate&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="delete"&gt;Removing Key, Value Pairs&lt;/a&gt;&lt;/h2&gt;  &lt;pre&gt;delete $translate{'taa'};&lt;br /&gt;keys %translate;&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="init"&gt;Initializing From a List&lt;/a&gt;&lt;/h2&gt;  &lt;pre&gt;%translate = ( 'atg' =&gt; 'M',&lt;br /&gt;              'taa' =&gt; '*',&lt;br /&gt;              'ctt' =&gt; 'L',&lt;br /&gt;              'cct' =&gt; 'P', );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Basic Loops&lt;/h1&gt;  &lt;p&gt;  Loops let you execute the same statements over and over again.  &lt;/p&gt;&lt;hr /&gt;  &lt;h2&gt;&lt;i&gt;while&lt;/i&gt; Loops&lt;/h2&gt;  &lt;p&gt;  A &lt;i&gt;while&lt;/i&gt; loop has a condition at the top.  The code within the body will execute until the code becomes false.  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; &lt;br /&gt; while ( &lt;i class="code"&gt;TEST&lt;/i&gt; ) {&lt;br /&gt;    &lt;i class="code"&gt;Code to execute&lt;/i&gt;&lt;br /&gt; } continue {&lt;br /&gt;    &lt;i class="code"&gt;Optional code to execute at the end of each loop&lt;/i&gt;&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;/p&gt;&lt;h3&gt;Example: Count the number of times "potato" appears in a list&lt;/h3&gt;  &lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  #!/usr/local/bin/perl&lt;br /&gt; # file: spud_counter.pl&lt;br /&gt;&lt;br /&gt; $count = 0;&lt;br /&gt;&lt;br /&gt; while ( $word = shift ) { # read from command line&lt;br /&gt;   if ($word eq 'potato') {&lt;br /&gt;      print "Found a potato!\n";&lt;br /&gt;      $count++;&lt;br /&gt;   } else {&lt;br /&gt;      print "$word is not a potato\n";&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; print "Potato count: $count\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt; &lt;pre&gt;(~) 51% &lt;b&gt;spud_counter.pl potato potato tomato potato boysenberry&lt;/b&gt;&lt;br /&gt;Found a potato!&lt;br /&gt;Found a potato!&lt;br /&gt;tomato is not a potato&lt;br /&gt;Found a potato!&lt;br /&gt;boysenberry is not a potato&lt;br /&gt;Potato count: 3&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;hr /&gt;  &lt;h3&gt;Another Example: Count Upward from 1 to 5&lt;/h3&gt;  &lt;p&gt;  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  #!/usr/local/bin/perl&lt;br /&gt; # file: count_up.pl&lt;br /&gt;&lt;br /&gt; $count = 1;&lt;br /&gt; while ( $count &lt;= 5 ) {&lt;br /&gt;    print "count: $count\n";&lt;br /&gt;    $count++;&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt; &lt;pre&gt;(~) 51% &lt;b&gt;count_up.pl&lt;/b&gt;&lt;br /&gt;count: 1&lt;br /&gt;count: 2&lt;br /&gt;count: 3&lt;br /&gt;count: 4&lt;br /&gt;count: 5&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;h3&gt;Yet Another Example: Count Down from 5 to 1&lt;/h3&gt;  &lt;p&gt;  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  #!/usr/local/bin/perl&lt;br /&gt; # file: count_down.pl&lt;br /&gt;&lt;br /&gt; $count = 6;&lt;br /&gt; while ( --$count &gt; 0 ) {&lt;br /&gt;    print "count: $count\n";&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt; &lt;pre&gt;(~) 51% &lt;b&gt;count_down.pl&lt;/b&gt;&lt;br /&gt;count: 5&lt;br /&gt;count: 4&lt;br /&gt;count: 3&lt;br /&gt;count: 2&lt;br /&gt;count: 1&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;h3&gt;The &lt;i&gt;continue&lt;/i&gt; Block&lt;/h3&gt;  &lt;p&gt;  &lt;i&gt;while&lt;/i&gt; loops can have an optional &lt;i&gt;continue&lt;/i&gt; block containing code that is executed at the end of each loop, just before jumping back to the test at the top:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  #!/usr/local/bin/perl&lt;br /&gt; # file: count_up.pl&lt;br /&gt;&lt;br /&gt; $count = 1;&lt;br /&gt; while ( $count &lt;= 5 ) {&lt;br /&gt;    print "count: $count\n";&lt;br /&gt; } continue {&lt;br /&gt;      $count++;&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;i&gt;continue&lt;/i&gt; blocks will make more sense after we consider loop control variables.  &lt;/p&gt;&lt;hr /&gt;  &lt;h2&gt;The &lt;i&gt;until&lt;/i&gt; Loop&lt;/h2&gt;  &lt;p&gt;  Sometimes you want to loop until some condition becomes true, rather than until some condition becomes false.  The &lt;i&gt;until&lt;/i&gt; loop is easier to read than the equivalent &lt;i&gt;while (!TEST)&lt;/i&gt;.  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  my $counter = 5;&lt;br /&gt; until ( $counter &lt; 0 ) {&lt;br /&gt;    print $counter--,"\n";&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;hr /&gt;  &lt;h2&gt;&lt;i&gt;foreach&lt;/i&gt; Loops&lt;/h2&gt;  &lt;p&gt;  &lt;i&gt;foreach&lt;/i&gt; will process each element of an array or list:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; &lt;br /&gt; foreach $loop_variable ('item1','item2','item3') {&lt;br /&gt;    print $loop_variable,"\n";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @array = ('item1','item2','item3');&lt;br /&gt; foreach $loop_variable (@array) { # same thing, but with an array&lt;br /&gt;    print $loop_variable,"\n";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @array = ('item1','item2','item3');&lt;br /&gt; foreach  (@array) { # same difference&lt;br /&gt;    print $_,"\n";&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  The last example is interesting.  It shows that if you don't explicitly give &lt;i&gt;foreach&lt;/i&gt; a loop variable, the special scalar variable &lt;i&gt;$_&lt;/i&gt; is used.  &lt;/p&gt;&lt;h3&gt;Changing Values with the &lt;i&gt;foreach&lt;/i&gt; Loop&lt;/h3&gt;  &lt;p&gt;  If you modify the loop variable in a &lt;i&gt;foreach&lt;/i&gt; loop, the underlying array value will change!  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  @h = (1..5);  # make an array containing numbers between 1 and 5&lt;br /&gt; foreach $variable (@h) {&lt;br /&gt;    $variable .= ' potato';&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; print join("\n",@h),"\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;1 potato&lt;br /&gt;2 potato&lt;br /&gt;3 potato&lt;br /&gt;4 potato&lt;br /&gt;5 potato&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;p&gt;  This works with the automatic &lt;b&gt;$_&lt;/b&gt; variable too:  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  @h = ('CCCTTT','AAAACCCC','GAGAGAGA');&lt;br /&gt; foreach (@h) {&lt;br /&gt;    ($_ = reverse $_) =~ tr/GATC/CTAG/;&lt;br /&gt;    print "$_\n";&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h1&gt;Advanced Loops&lt;/h1&gt;  &lt;h2&gt;The &lt;i&gt;for&lt;/i&gt; Loop&lt;/h2&gt;  &lt;p&gt;  Consider the standard while loop:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  &lt;i class="code"&gt;initialization code&lt;/i&gt;&lt;br /&gt; while ( &lt;i class="code"&gt;Test code&lt;/i&gt; ) {&lt;br /&gt;    &lt;i class="code"&gt;Code to execute in body&lt;/i&gt;&lt;br /&gt; } continue {&lt;br /&gt;    &lt;i class="code"&gt;Update code&lt;/i&gt;&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  This can be generalized into the concise &lt;i&gt;for&lt;/i&gt; loop:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; &lt;br /&gt; for ( &lt;i class="code"&gt;initialization code&lt;/i&gt;; &lt;i class="code"&gt;test code&lt;/i&gt;; &lt;i class="code"&gt;update code&lt;/i&gt; ) {&lt;br /&gt;    &lt;i class="code"&gt;body code&lt;/i&gt;&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  When the loop is first entered, the code at &lt;i&gt;initialization&lt;/i&gt; is executed.  Each time through the loop, the test at &lt;i&gt;test&lt;/i&gt; is executed and the loop stops if it returns false.  After the execution of each loop, the code at &lt;i&gt;update&lt;/i&gt; is performed.  &lt;/p&gt;&lt;p&gt;  Compare the process of counting from 1 to 5:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  # with a while loop&lt;br /&gt; $count = 1;&lt;br /&gt; while ( $count &lt;= 5 ) {&lt;br /&gt;   print $count,"\n";&lt;br /&gt; } continue {&lt;br /&gt;    $count++;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; # with a for loop&lt;br /&gt; for ( my $count=1; $count&lt;=5; $count++ ) {&lt;br /&gt;    print $count,"\n";&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  Notice how we use &lt;i&gt;my&lt;/i&gt; to make $count local to the for loop.  &lt;/p&gt;&lt;h2&gt;Fancy for() Loops&lt;/h2&gt;  &lt;p&gt;  Any of the three &lt;i&gt;for&lt;/i&gt; components are optional.  You can even leave them all off to get an infinite loop:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  for (;;) {&lt;br /&gt;   print "Somebody help me!  I can't stop!\n";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; # equivalent to:&lt;br /&gt; while (1) {&lt;br /&gt;   print "Somebody help me!  I can't stop!\n"; &lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  Any of the components can be a list.  This is usually used to initialize several variables at once:  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  # read until the "end" line or 10 lines, whichever&lt;br /&gt; # comes first....&lt;br /&gt; for (my $done=0,my $i=1; $i&lt;10 and !$done; $i++) {&lt;br /&gt;   my $line = &lt;stdin&gt;;&lt;br /&gt;   chomp $line;&lt;br /&gt;   $done++ if $line eq 'end';&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h1&gt;Loop Control&lt;/h1&gt;  &lt;p&gt;  The &lt;b&gt;next&lt;/b&gt;, &lt;b&gt;last&lt;/b&gt;, and &lt;b&gt;redo&lt;/b&gt; statements allow you to change the flow of control in the loop mid-stream, as it were.  You can use these three statements in &lt;b&gt;while&lt;/b&gt; loops, &lt;b&gt;until&lt;/b&gt; loops, and &lt;b&gt;for&lt;/b&gt; and &lt;b&gt;foreach&lt;/b&gt; loops, but not in the &lt;b&gt;do-until&lt;/b&gt; and &lt;b&gt;do-while&lt;/b&gt; variants.  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;h2&gt;next&lt;/h2&gt;  &lt;p&gt;  The &lt;b&gt;next&lt;/b&gt; statement causes the rest of the loop to be skipped and control to pass back to the conditional test at the top.  If there's a &lt;b&gt;continue&lt;/b&gt; block, it is executed before control returns to the top of the loop.  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  $done = 0;&lt;br /&gt; while (!$done) {&lt;br /&gt;   $line = &lt;stdin&gt;;&lt;br /&gt;   chomp $line;&lt;br /&gt;   next if $line eq 'SKIP';&lt;br /&gt;   print $line,"\n";&lt;br /&gt; } continue {&lt;br /&gt;   $done++ if $line eq 'END';&lt;br /&gt; } &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;last&lt;/h2&gt;  &lt;p&gt;  The &lt;b&gt;last&lt;/b&gt; statement causes the loop to terminate prematurely, even if the loop conditional is still true:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  while ( $line = &lt;stdin&gt; ) {&lt;br /&gt;   chomp $line;&lt;br /&gt;   last if $line eq 'END';&lt;br /&gt;   print $line,"\n";&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;redo&lt;/h2&gt;  &lt;p&gt;  The &lt;b&gt;redo&lt;/b&gt; statement is rarely used.  It causes flow of control to jump to the top of the loop, like &lt;b&gt;next&lt;/b&gt;.  However, the &lt;b&gt;continue&lt;/b&gt; block, if any, is not executed.  In a &lt;b&gt;for&lt;/b&gt; loop, the update expression is not executed.  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;  for (my $i=0; $i&lt;10; $i++) {&lt;br /&gt;   chomp ($line = &lt;stdin&gt;);&lt;br /&gt;   redo if $line eq 'SKIP'; # $i won't get incremented in this case&lt;br /&gt;   print "Read line $i\n"; &lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Nested Loops&lt;/h2&gt;  &lt;p&gt;  If you have two or more nested loops, &lt;b&gt;next&lt;/b&gt;, &lt;b&gt;last&lt;/b&gt; and &lt;b&gt;redo&lt;/b&gt; always apply to the innermost loop.  You can change this by explicitly labeling the loop block and referring to the label in the loop control statement:  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; XLOOP:&lt;br /&gt; for (my $x=0; $x&lt;10; $x++) {&lt;br /&gt;   for (my $y=0; $i&lt;100; $y++) {&lt;br /&gt;     next XLOOP unless $array[$x][$y] &gt; 0;&lt;br /&gt;     print "($x,$y) = $array[$x][$y]\n";&lt;br /&gt;   }&lt;br /&gt; }&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h1&gt;Basic I/O&lt;/h1&gt;  &lt;p&gt;  I/O means input/output, and is necessary to get computer programs to talk to the rest of the world.  &lt;/p&gt;&lt;h2&gt;The STDIN, STDOUT and STDERR Filehandles&lt;/h2&gt;  &lt;p&gt;  Every Perl scripts starts out with three connections to the outside world:  &lt;/p&gt;STDIN   Standard input, used to read input.  Initially connected to the       keyboard, but can be changed from shell using redirection (&lt;)       or pipe (|).       &lt;p&gt;   &lt;/p&gt;STDOUT   Standard output, used to write data out.  Initially connected to        the terminal, but can be redirected to a file or other program       from the shell using redirection or pipes.       &lt;p&gt;   &lt;/p&gt;STDERR   Standard error, used for diagnostic messages.  Initially       connected to the terminal, etc.   &lt;p&gt;  In addition to these three filehandles, you can create your own.  &lt;/p&gt;&lt;h2&gt;Reading Data from STDIN&lt;/h2&gt;  &lt;p&gt;  To read a line of data into your program use the angle bracket function:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; $line = &lt;stdin&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;stdin&gt; will read one line of input from standard input and return it as the function result.  You usually will assign the result to a scalar variable.  The newline is not removed line automatically; you have to do that yourself with &lt;b&gt;chomp&lt;/b&gt;:  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; print "Type your name: ";&lt;br /&gt;$name = &lt;stdin&gt;&lt;br /&gt;chomp $name;&lt;br /&gt;if ($name eq 'Jim Watson') {&lt;br /&gt;   print "Hail great master!";&lt;br /&gt;else {&lt;br /&gt;   print "Hello $name\n";&lt;br /&gt;}&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  The read/chomp sequence is often abbreviated as:  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;chomp($name = &lt;stdin&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;h3&gt;The Input Loop&lt;/h3&gt;  At the "end of file" (or when the user presses ^D to end input) &lt;stdin&gt; will return whatever's left, which may or may not include a newline.  Thereafter, &lt;stdin&gt; will return the undefined value.  &lt;p&gt;  This leads typical input loop:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; while ( $line = &lt;stdin&gt; ) {&lt;br /&gt;  chomp $line;&lt;br /&gt;  # now do something with $line...&lt;br /&gt;}&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  The &lt;b&gt;while&lt;/b&gt; loop will read one line of text after another.  At the end of input, the angle-bracket operator returns undef and the &lt;b&gt;while&lt;/b&gt; loop terminates.  Remember that even blank lines are TRUE, because they consist of a single newline character.  &lt;/p&gt;&lt;h3&gt;The Default Input Variable&lt;/h3&gt;  &lt;p&gt;  If you don't assign the result of the angle-bracket operator to a scalar variable, it will default to the special scalar variable &lt;b&gt;$_&lt;/b&gt;.  This scalar is the default for a number of other functions, including &lt;b&gt;chomp&lt;/b&gt; and the regular expression match.  &lt;/p&gt;&lt;p&gt;  This example prepends the line number to its input.  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; #!/usr/local/bin/perl&lt;br /&gt;# file: add_line_numbers.pl&lt;br /&gt;&lt;br /&gt;$line_number = 0;&lt;br /&gt;while ( &lt;stdin&gt; ) {&lt;br /&gt;  chomp;&lt;br /&gt;  print $line_number++,": ",$_,"\n";&lt;br /&gt;}&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt; &lt;pre&gt;(~) 50% &lt;b&gt;add_line_numbers.pl &lt;people.txt&lt;/b&gt;&lt;br /&gt;0: Gabor Marth              gmarth@watson.wustl.edu &lt;br /&gt;1: Genome Sequencing Center&lt;br /&gt;2: Washington University School of Medicine&lt;br /&gt;3: 4444 Forest Park Blvd.&lt;br /&gt;4: St. Louis, MO 63108&lt;br /&gt;5: 314 286-1839&lt;br /&gt;6: 314 286-1810 (fax)&lt;br /&gt;7: Dates: Oct 17-23&lt;br /&gt;8:&lt;br /&gt;9: Sean Eddy		 eddy@genetics.wustl.edu&lt;br /&gt;10: Assistant professor&lt;br /&gt;11: Department of Genetics&lt;br /&gt;12: Washington University School of Medicine&lt;br /&gt;13: 660 S. Euclid Ave.&lt;br /&gt;14: St. Louis, Mo. 63110&lt;br /&gt;15: 314 362-7666&lt;br /&gt;16: 314 362-7855 (fax)&lt;br /&gt;17: Dates: Oct 20-22&lt;br /&gt;18:&lt;br /&gt;19: Warren Gish		 gish@sapiens.wustl.edu&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;h3&gt;Assigning to an Array&lt;/h3&gt;  &lt;p&gt;  Normally you assign the angle-bracket function to a scalar variable, getting a line of input.  What if you assign to an array?  You get &lt;b&gt;all&lt;/b&gt; the lines from the input file or terminal, one per array element!!!  &lt;/p&gt;&lt;p&gt;  It is convenient to pass this array to &lt;b&gt;chomp&lt;/b&gt;, which will remove  the newline from each member of the array.  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; @lines = &lt;stdin&gt;  # get all lines&lt;br /&gt;chomp @lines;           # remove all newlines&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  Or you can do both things in one elegant operation:  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;chomp(@lines = &lt;stdin&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;hr /&gt;  &lt;h2&gt;Output&lt;/h2&gt;  &lt;p&gt;  The &lt;b&gt;print&lt;/b&gt; function writes data to output.  In its full form, it  takes a filehandle as its first argument, followed by a list of scalars to print:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;print FILEHANDLE $data1,$data2,$data3,...&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;p&gt;  Notice there is no comma between FILEHANDLE and the data arguments. If FILEHANDLE is omitted it defaults to STDOUT (this can be changed). So these are equivalent:  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;print STDOUT "Hello world\n";&lt;br /&gt;print "Hello world\n";&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  To print to standard error:  &lt;blockquote&gt;&lt;pre&gt;print STDERR "Does not compute.\n";&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5634759259101232926?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5634759259101232926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5634759259101232926&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5634759259101232926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5634759259101232926'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part3.html' title='Learn perl easy part3'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-5687717490893119194</id><published>2009-08-20T10:48:00.000+05:30</published><updated>2009-08-20T12:02:12.625+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='career and personality dev'/><title type='text'>Fundamental Techniques in Handling People</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Don'ts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  1. Don't criticize, condemn or complain.&lt;br /&gt;  2. Give honest and sincere appreciation.&lt;br /&gt;  3. Arouse in the other person an eager want.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Six ways to make people like you&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  1. Become genuinely interested in other people.&lt;br /&gt;  2. Smile.&lt;br /&gt;  3. Remember that a person's name is to that person the sweetest and most        important sound in any language.&lt;br /&gt;  4. Be a good listener. Encourage others to talk about themselves.&lt;br /&gt;  5. Talk in terms of the other person's interests.&lt;br /&gt;  6. Make the other person feel important - and do it sincerely.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Win people to your way of thinking&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  1. The only way to get the best of an argument is to avoid it.&lt;br /&gt;  2. Show respect for the other person's opinions. Never say, "You're wrong."&lt;br /&gt;  3. If you are wrong, admit it quickly and emphatically.&lt;br /&gt;  4. Begin in a friendly way.&lt;br /&gt;  5. Get the other person saying "yes, yes" immediately.&lt;br /&gt;  6. Let the other person do a great deal of the talking.&lt;br /&gt;  7. Let the other person feel that the idea is his or hers.&lt;br /&gt;  8. Try honestly to see things from the other person's point of view.&lt;br /&gt;  9. Be sympathetic with the other person's ideas and desires.&lt;br /&gt; 10. Appeal to the nobler motives.&lt;br /&gt; 11. Dramatize your ideas.&lt;br /&gt; 12. Throw down a challenge.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Be a Leader: &lt;/span&gt;How to Change People Without Giving Offense or Arousing Resentment&lt;br /&gt;A leader's job often includes changing your people's attitudes and behavior. Some suggestions to accomplish this:&lt;br /&gt;&lt;br /&gt;  1. Begin with praise and honest appreciation.&lt;br /&gt;  2. Call attention to people's mistakes indirectly.&lt;br /&gt;  3. Talk about your own mistakes before criticizing the other person.&lt;br /&gt;  4. Ask questions instead of giving direct orders.&lt;br /&gt;  5. Let the other person save face.&lt;br /&gt;  6. Praise the slightest improvement and praise every improvement. Be "hearty in your approbation and lavish in your praise."&lt;br /&gt;  7. Give the other person a fine reputation to live up to.&lt;br /&gt;  8. Use encouragement. Make the fault seem easy to correct.&lt;br /&gt;  9. Make the other person happy about doing the thing you suggest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-5687717490893119194?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/5687717490893119194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=5687717490893119194&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5687717490893119194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/5687717490893119194'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/fundamental-techniques-in-handling.html' title='Fundamental Techniques in Handling People'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-1929349041990430163</id><published>2009-08-18T13:48:00.001+05:30</published><updated>2009-08-20T12:01:07.818+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c and related'/><title type='text'>Creating shared and static libraries</title><content type='html'>&lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;How to create a shared and a static library with gcc. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="western"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="western"&gt;&lt;span style="font-size:130%;"&gt;&lt;i&gt;&lt;b&gt;The code for the library you want to build&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;This is the code that goes will be in the library. It is one single function that takes two doubles and calculates their avg value and returns it. &lt;/span&gt; &lt;/p&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;calc_avg.c &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;//#include &lt;stdio.h&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;br /&gt;&lt;a name="mean"&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;double &lt;b&gt;avg&lt;/b&gt;(double a, double b)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;return (a+b) / 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;h3 class="western" style="margin-left: 0.06in;"&gt; &lt;a name="calc_mean_h"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;The header file &lt;/span&gt; &lt;/h3&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;Of course, we need a header file. &lt;/span&gt;&lt;/p&gt;&lt;p class="western"&gt;/* it is very basic example so i don't have any other prototypes or declarations.&lt;br /&gt;&lt;/p&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;calc_avg.h &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;double avg(double, double);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3 class="western" style="margin-left: 0.06in; font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Build &lt;/span&gt;&lt;span style="font-size:100%;"&gt;the static library &lt;/span&gt; &lt;/h3&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;A static library is basically a set of &lt;b&gt;object files&lt;/b&gt; that were copied into a single file. This single file is the static library. The static file is created with the &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;archiver (ar)&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. &lt;/span&gt; &lt;/p&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;First, calc_avg.c is turned into an object file: &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;gcc &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-c&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; calc_avg.c &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-o&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; calc_avg.o&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;Then, the archiver (ar) is invoked to produce a static library (named libavg.a) out of the object file calc_avg.o. &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;ar&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;  rcs libavg.a      calc_avg.o&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;Note: the library must start with the three letters &lt;i&gt;lib&lt;/i&gt; and have the suffix &lt;b&gt;.a&lt;/b&gt;. &lt;/span&gt; &lt;/p&gt; &lt;h3 class="western" style="margin-left: 0.06in;"&gt;&lt;a name="shared"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Creating the shared library &lt;/span&gt; &lt;/h3&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;As with static libraries, an object file is created. The &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-fPIC&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; option tells gcc to create position independant code which is necessary for shared libraries. Note also, that the object file created for the static library will be overwritten. That's not bad, however, because we have a static library that already contains the needed object file. &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;gcc &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-c&lt;/span&gt;&lt;/u&gt;&lt;/span&gt; &lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-fPIC&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; calc_avg.c -o calc_avg.o    &lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;Due to some reason, gcc will compliance: &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;cc1: warning: -fPIC ignored for target (all code is position independent)&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;It looks like -fPIC is not necessary on x86, but according to manuals , it's needed, so I use it too. &lt;/span&gt; &lt;/p&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;Now, the shared library is created using bellow command&lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;gcc &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-shared&lt;/span&gt;&lt;/u&gt;&lt;/span&gt; &lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-Wl&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;,-soname,libavg.so.1 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-o&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; libavg.so.1.0.1  calc_avg.o&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;Note: the library must start with the three letter &lt;b&gt;lib&lt;/b&gt; and ends with .so for shared library. &lt;/span&gt; &lt;/p&gt; &lt;h2 class="western" style="margin-left: 0.06in; font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;The programm using the library &lt;/i&gt;&lt;/span&gt; &lt;/h2&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;This is the program that uses the &lt;b&gt;calc_avg&lt;/b&gt; library. Once, we will link it against the static library and once against the shared library. &lt;/span&gt; &lt;/p&gt; &lt;p class="western"&gt;&lt;span style="font-size:85%;"&gt;main.c &lt;/span&gt; &lt;/p&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;#include &lt;stdio.h&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;#include "&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;calc_avg.h&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;int main(int argc, char* argv[]) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;double value1, value2, result;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;value1 = 3;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;value2 = 12;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;result  = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;avg&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(value1, value2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;printf("The avg of %3.2f and %3.2f is %3.2f\n", value1, value2, result);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;return 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;h3 class="western" style="margin-left: 0.06in; font-weight: bold;"&gt; &lt;span style="font-size:100%;"&gt;Linking against static library &lt;/span&gt; &lt;/h3&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;gcc &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-static&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; main.c &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-L&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-l&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;avg &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-o&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; statically_linked&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;Note: the first three letters (the &lt;b&gt;lib&lt;/b&gt;) must not be specified, as well as the suffix (&lt;b&gt;.a&lt;/b&gt;) &lt;/span&gt; &lt;/p&gt; &lt;h3 class="western" style="margin-left: 0.06in; font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Linking against shared library &lt;/span&gt; &lt;/h3&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;gcc main.c &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-o&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; dynamically_linked &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-L&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;-l&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;avg&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt; &lt;span style="font-size:85%;"&gt;Note: the first three letters (the &lt;b&gt;lib&lt;/b&gt;) must not be specified, as well as the suffix (&lt;b&gt;.so&lt;/b&gt;) &lt;/span&gt; &lt;/p&gt; &lt;h3 class="western" style="margin-left: 0.06in; font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Executing the dynamically linked programm &lt;/span&gt; &lt;/h3&gt; &lt;pre class="western"&gt;&lt;span style="font-size:85%;"&gt;LD_LIBRARY_PATH=.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;./dynamically_linked&lt;/span&gt;&lt;/pre&gt;&lt;p class="western"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-1929349041990430163?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/1929349041990430163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=1929349041990430163&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1929349041990430163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1929349041990430163'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/creating-shared-and-static-libraries.html' title='Creating shared and static libraries'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-76461018436908522</id><published>2009-08-06T15:57:00.001+05:30</published><updated>2009-08-20T12:00:45.324+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c and related'/><title type='text'>encrypt and decrypt Your file</title><content type='html'>Well, iam writing some text files and saving in my pc and all my friends have access it. so, i thought to have some security for it. You can find more advanced tools for files and folders to lock. But this program just gives very minimal sequrity.&lt;br /&gt;you can encrypt your file with four digit key and when ever you want you can retrive it with that key.&lt;br /&gt;If your programer you can break this key with in a minute itself.( i said it gives minimal security.&lt;br /&gt;let see code------&lt;br /&gt;&lt;pre&gt;&lt;stdio.h&gt;&lt;string.h&gt;&lt;fcntl.h&gt;&lt;malloc.h&gt;&lt;stdlib.h&gt;&lt;termios.h&gt;&lt;stdio.h&gt;&lt;string.h&gt;&lt;fcntl.h&gt;&lt;malloc.h&gt;&lt;stdlib.h&gt;&lt;termios.h&gt;&lt;br /&gt;#include "stdio.h"&lt;br /&gt;#include "string.h"&lt;br /&gt;#include "fcntl.h"&lt;br /&gt;#include "malloc.h"&lt;br /&gt;#include "stdlib.h"&lt;br /&gt;#include "termios.h"&lt;br /&gt;&lt;br /&gt;/* if you get any error above include change double codes to less than and grater than*/&lt;br /&gt;#define MAX_CHAR 10&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void create_write_to_file(char *file_name, char *out_file);&lt;br /&gt;void manuply_pin(char *pin1,char *pin);&lt;br /&gt;char take_input(char *file_name,int *fd);&lt;br /&gt;void read_pin(char *pin1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;typedef struct string_l&lt;br /&gt;{&lt;br /&gt;char ten_chars[MAX_CHAR];&lt;br /&gt;struct string_l *pnext;&lt;br /&gt;}string_link_t;&lt;br /&gt;&lt;br /&gt;string_link_t  *phead;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;char pin1[4]={0},&lt;br /&gt;    pin[10]={0},&lt;br /&gt;    i=0,&lt;br /&gt;    len=10,&lt;br /&gt;    enc_or_dec=-1,&lt;br /&gt;    flag = 1;&lt;br /&gt;char file_name[31],&lt;br /&gt;    out_file[33],&lt;br /&gt;    temp_string[11]={0};&lt;br /&gt;int fd;&lt;br /&gt;string_link_t *ptemp, *pmove;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;read_pin(pin1);&lt;br /&gt;manuply_pin(pin1,pin);&lt;br /&gt;enc_or_dec=take_input(file_name,&amp;amp;fd);&lt;br /&gt;&lt;br /&gt;lseek(fd,0,SEEK_SET);&lt;br /&gt;flag = 1  ;&lt;br /&gt;len = 10;&lt;br /&gt;while( len == 10 &amp;amp;&amp;amp; flag == 1)&lt;br /&gt;{&lt;br /&gt;   len = read(fd,temp_string,MAX_CHAR);&lt;br /&gt;&lt;br /&gt;   if(len &lt;= 0)        {            break;        }        else if(len &lt; flag =" 0;" ptemp =" (string_link_t"&gt;pnext = NULL;&lt;br /&gt;   if(!ptemp)&lt;br /&gt;   {&lt;br /&gt;       printf("CRITICAL ERROR CON'T PROCEED \n");&lt;br /&gt;       exit(0);&lt;br /&gt;   }&lt;br /&gt;   if(!phead)&lt;br /&gt;   {&lt;br /&gt;       phead = ptemp;&lt;br /&gt;       pmove = ptemp;&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;       pmove-&gt;pnext = ptemp;&lt;br /&gt;       pmove = ptemp;&lt;br /&gt;   }&lt;br /&gt;   memcpy(ptemp-&gt;ten_chars,temp_string,10);&lt;br /&gt;   for(i=0; i&lt;10; enc_or_dec ="="&gt;ten_chars[i] =  ptemp-&gt;ten_chars[i] + pin[i];&lt;br /&gt;           }&lt;br /&gt;           else if(enc_or_dec == '2')&lt;br /&gt;           {&lt;br /&gt;               ptemp-&gt;ten_chars[i] =  ptemp-&gt;ten_chars[i] - pin[i];&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       else&lt;br /&gt;       {&lt;br /&gt;           if(enc_or_dec == '1')&lt;br /&gt;           {&lt;br /&gt;              ptemp-&gt;ten_chars[i] =  ' ' + pin[i];&lt;br /&gt;           }&lt;br /&gt;           else if(enc_or_dec == '2')&lt;br /&gt;           {&lt;br /&gt;               ptemp-&gt;ten_chars[i] =  ' ' - pin[i];&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           flag = 0;&lt;br /&gt;       }&lt;br /&gt;   &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;create_write_to_file(file_name, out_file);&lt;br /&gt;close(fd);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;char take_input(char *file_name,int *fd)&lt;br /&gt;{&lt;br /&gt;char enc_or_dec=-1;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;printf("enter 1 for encryption 2 for decription\n");&lt;br /&gt;__fpurge(stdin);&lt;br /&gt;scanf("%c",&amp;amp;enc_or_dec);&lt;br /&gt;}&lt;br /&gt;while(!(enc_or_dec == '1'|| enc_or_dec == '2'));&lt;br /&gt;&lt;br /&gt;printf("enter file name(Max 30 char): \n");&lt;br /&gt;scanf("%s",file_name);&lt;br /&gt;&lt;br /&gt;*fd=open(file_name,O_RDONLY);&lt;br /&gt;if(*fd &lt; len="0," i="0;" len="(int)" i="0;"&gt; '9')&lt;br /&gt;{&lt;br /&gt;   printf("pin contain illigal digits\n try again \n");&lt;br /&gt;   goto enter_pin;&lt;br /&gt;}&lt;br /&gt;i++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;read_password(char *pin1)&lt;br /&gt;{&lt;br /&gt;struct termios cuset,newset;&lt;br /&gt;char ch;&lt;br /&gt;char ii=0;&lt;br /&gt;/*Disable echo and canonical mode of processing***/&lt;br /&gt;tcgetattr(0,&amp;amp;cuset);&lt;br /&gt;newset = cuset;&lt;br /&gt;//newset.c_lflag &amp;amp;= ~ICANON;&lt;br /&gt;newset.c_lflag &amp;amp;= ~ECHO;&lt;br /&gt;tcsetattr(0,TCSANOW,&amp;amp;newset);&lt;br /&gt;//setbuf(stdin,NULL);&lt;br /&gt;//setbuf(stdout,NULL);&lt;br /&gt;__fpurge(stdin);&lt;br /&gt;while( ( ch=getchar() ) != '\n' )&lt;br /&gt;{&lt;br /&gt;    if(ii&lt;4) fd1="-1;" flag =" 1;" fd1 =" open(out_file,O_WRONLY" flag ="=" flag =" 0;" ptemp =" phead;"&gt;ten_chars,MAX_CHAR);&lt;br /&gt;   pfree = ptemp;&lt;br /&gt;   ptemp = ptemp-&gt;pnext;&lt;br /&gt;   free(pfree);&lt;br /&gt;}&lt;br /&gt;close(fd1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void manuply_pin(char *pin1,char *pin)&lt;br /&gt;{&lt;br /&gt;pin[0] =  pin1[0] + pin1[1] + pin1[2] + pin1[3];&lt;br /&gt;pin[1] =  pin1[0] + pin1[1] + pin1[2] - pin1[3];&lt;br /&gt;pin[2] =  pin1[0] + pin1[1] - pin1[2] + pin1[3];&lt;br /&gt;pin[3] =  pin1[0] + pin1[1] - pin1[2] - pin1[3];&lt;br /&gt;pin[4] = -pin1[0] + pin1[1] + pin1[2] - pin1[3];&lt;br /&gt;pin[5] = -pin1[0] - pin1[1] + pin1[2] + pin1[3];&lt;br /&gt;pin[6] = -pin1[0] - pin1[1] - pin1[2] + pin1[3];&lt;br /&gt;pin[7] = -pin1[0] - pin1[1] - pin1[2] + pin1[3];&lt;br /&gt;pin[8] =  pin1[0] - pin1[1] - pin1[2] - pin1[3];&lt;br /&gt;pin[9] = -pin1[0] - pin1[1] + pin1[2] - pin1[3];&lt;br /&gt;}&lt;/termios.h&gt;&lt;/stdlib.h&gt;&lt;/malloc.h&gt;&lt;/fcntl.h&gt;&lt;/string.h&gt;&lt;/stdio.h&gt;&lt;/termios.h&gt;&lt;/stdlib.h&gt;&lt;/malloc.h&gt;&lt;/fcntl.h&gt;&lt;/string.h&gt;&lt;/stdio.h&gt;&lt;/pre&gt; so now point is how to use it.&lt;br /&gt;save this file with some name say enc_dec.c&lt;br /&gt;$gcc -o enc_dec enc_dec.c  (in linux)&lt;br /&gt;you wil get &lt;span style="font-weight: bold;"&gt;enc_dec&lt;/span&gt; executable&lt;br /&gt;now you have secret.txt&lt;br /&gt;&lt;br /&gt;now run&lt;br /&gt;./&lt;span style="font-weight: bold;"&gt;enc_dec&lt;br /&gt;&lt;/span&gt;enter 4 digit pin no:&lt;span style="font-weight: bold;"&gt;****&lt;br /&gt;&lt;/span&gt;enter 1 for encryption 2 for decription&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;1&lt;br /&gt;enter file name(Max 30 char):&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;secret.txt&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;output file name&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;secret.enq&lt;br /&gt;output file is secret.enq&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;so now you can do this on secret again with diff key.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;for &lt;/span&gt;reverse&lt;br /&gt;./&lt;span style="font-weight: bold;"&gt;enc_dec&lt;br /&gt;&lt;/span&gt;enter 4 digit pin no:&lt;span style="font-weight: bold;"&gt;****&lt;/span&gt; (enter same pin)&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;enter 1 for encryption 2 for decription&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;2&lt;br /&gt;enter file name(Max 30 char):&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;secret.enq&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;output file name&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;secret.txt&lt;br /&gt;output file is secret.txt&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;if you applied keys multiple order then you should follow stack rule.&lt;br /&gt;first key must use last and last one used first only.&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-76461018436908522?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/76461018436908522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=76461018436908522&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/76461018436908522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/76461018436908522'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/files-with-security.html' title='encrypt and decrypt Your file'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-1151501075447762535</id><published>2009-08-06T11:14:00.000+05:30</published><updated>2009-08-20T12:02:26.135+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='career and personality dev'/><title type='text'>career path</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_a3vWkw3wrUY/SnpueENf_yI/AAAAAAAAAKk/kunJjQDmjSY/s1600-h/97317,xcitefun-path-finder.jpg.gif"&gt;Bellow picture will give some idea about education structure (covered mostly important) other than this you find lost lets see and explore.&lt;img style="cursor: pointer; width: 318px; height: 320px;" src="http://4.bp.blogspot.com/_a3vWkw3wrUY/SnpueENf_yI/AAAAAAAAAKk/kunJjQDmjSY/s320/97317,xcitefun-path-finder.jpg.gif" alt="" id="BLOGGER_PHOTO_ID_5366723368770862882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;All the best.&lt;br /&gt;&lt;img src="file:///tmp/moz-screenshot.jpg" alt="" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-1151501075447762535?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/1151501075447762535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=1151501075447762535&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1151501075447762535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/1151501075447762535'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/career-path.html' title='career path'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_a3vWkw3wrUY/SnpueENf_yI/AAAAAAAAAKk/kunJjQDmjSY/s72-c/97317,xcitefun-path-finder.jpg.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-2948157442171270310</id><published>2009-08-05T19:38:00.000+05:30</published><updated>2009-08-20T12:01:25.053+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Learn perl easy part2</title><content type='html'>&lt;h1&gt;Variables&lt;/h1&gt;  &lt;p&gt;  A variable is a symbolic placeholder for a value, a lot like the variables in algebra. Perl has several built-in variable types:  &lt;/p&gt;Scalars: &lt;b&gt;$variable_name&lt;/b&gt;  A single-valued variable, always preceded by a $ sign.  &lt;p&gt;  &lt;/p&gt;Arrays: &lt;b&gt;@array_name&lt;/b&gt;  A multi-valued variable indexed by integer, preceded by an @  sign.  &lt;p&gt;  &lt;/p&gt;Hashes: &lt;b&gt;%hash_name&lt;/b&gt;  A multi-valued variable indexed by string, preceded by a % sign.  &lt;p&gt;  &lt;/p&gt;Filehandle: &lt;b&gt;FILEHANDLE_NAME&lt;/b&gt;  A file to read and/or write from. Filehandles have no special  prefix, but are usually written in all uppercase.   We discuss arrays, hashes and filehandles later.  &lt;h2&gt;Scalar Variables&lt;/h2&gt;  &lt;p&gt;  Scalar variables have names beginning with $. The name must begin with a letter or underscore, and can contain as many letters, numbers or underscores as you like. These are all valid scalars:  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;$foo  &lt;/li&gt;&lt;li&gt;$The_Big_Bad_Wolf  &lt;/li&gt;&lt;li&gt;$R2D2  &lt;/li&gt;&lt;li&gt;$_____A23  &lt;/li&gt;&lt;li&gt;$Once_Upon_a_Midnight_Dreary_While_I_Pondered_Weak_and_Weary &lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;  You assign values to a scalar variable using the &lt;b&gt;=&lt;/b&gt; operator (not to be confused with &lt;b&gt;==&lt;/b&gt;, which is numeric comparison). You  read from scalar variables by using them wherever a value would go. &lt;/p&gt;&lt;p&gt;  A scalar variable can contain strings, floating point numbers, integers, and more esoteric things. You don't have to predeclare scalars. A scalar that once held a string can be reused to hold a number, and vice-versa:  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;$p = 'Potato'; # $p now holds the string "potato"&lt;br /&gt;$bushels = 3; # $bushels holds the value 3&lt;br /&gt;$potatoes_per_bushel = 80; # $potatoes_per_bushel contains 80;&lt;br /&gt;&lt;br /&gt;$total_potatoes = $bushels * $potatoes_per_bushel; # 240&lt;br /&gt;&lt;br /&gt;print "I have $total_potatoes $p\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;I have 240 Potato&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;h2&gt;Scalar Variable String Interpolation&lt;/h2&gt;  &lt;p&gt;  The example above shows one of the interesting features of double-quoted strings. If you place a scalar variable inside a double  quoted string, it will be interpolated into the string. With a single-quoted string, no interpolation occurs.  &lt;/p&gt;&lt;p&gt;  To prevent interpolation, place a backslash in front of the variable:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;print "I have \$total_potatoes \$p\n";&lt;br /&gt;&lt;br /&gt;# prints: I have $total_potatoes $p&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Operations on Scalar Variables&lt;/h2&gt;  &lt;p&gt;  You can use a scalar in any string or numeric expression like $hypotenuse = sqrt($x**2 + $y**2) or $name = $first_name . ' ' . $last_name. There are also numerous shortcuts that combine an operation with an assignment:  &lt;/p&gt;&lt;b&gt;$a++&lt;/b&gt;  Increment $a by one  &lt;p&gt;  &lt;/p&gt;&lt;b&gt;$a--&lt;/b&gt;  Decrement $a by one  &lt;p&gt;  &lt;/p&gt;&lt;b&gt;$a += $b&lt;/b&gt;  Modify $a by adding $b to it.  &lt;p&gt;  &lt;/p&gt;&lt;b&gt;$a -= $b&lt;/b&gt;  Modify $a by subtracting $b from it.  &lt;p&gt;  &lt;/p&gt;&lt;b&gt;$a *= $b&lt;/b&gt;  Modify $a by multiplying $b to it.  &lt;p&gt;  &lt;/p&gt;&lt;b&gt;$a /= $b&lt;/b&gt;  Modify $a by dividing it by $b.  &lt;p&gt;  &lt;/p&gt;&lt;b&gt;$a .= $b&lt;/b&gt;  Modify the &lt;b&gt;string&lt;/b&gt; in $a by appending $b to it.  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;  &lt;/p&gt;&lt;p class="caption"&gt; Example Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; $potatoes_per_bushel = 80; # $potatoes_per_bushel contains 80;&lt;br /&gt;&lt;br /&gt;$p = 'one';&lt;br /&gt;$p .= ' '; # append a space&lt;br /&gt;$p .= 'potato'; # append "potato"&lt;br /&gt;&lt;br /&gt;$bushels = 3;&lt;br /&gt;$bushels *= $potatoes_per_bushel; # multiply&lt;br /&gt;&lt;br /&gt;print "From $p come $bushels.\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;From one potato come 240.&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;h2&gt;Preincrement vs postincrement&lt;/h2&gt;  &lt;p&gt;  The increment (++) operator can be placed before or after the variable name, and in either case, the effect on the variable is to bump it up by one. However, when you put the operator before the variable name, the value of the expression as a whole is the value of the variable after the operation (preincrement). If you put the operator after the  variable name, the value of the expression is the value of the variable &lt;b&gt;before&lt;/b&gt; it was incremented:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; $potatoes = 80; # $potatoes holds 80&lt;br /&gt;&lt;br /&gt;$onions = ++$potatoes; # $onions holds 81, $potatoes holds 81&lt;br /&gt;&lt;br /&gt;$parsnips = $potatoes++; # parsnips holds 81, $potatoes holds 82&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  The decrement (--) operator works the same way.  &lt;/p&gt;&lt;h2&gt;Weird Perl Assignment Idioms&lt;/h2&gt;  &lt;p&gt;  &lt;/p&gt;&lt;h3&gt;Modify a Value and Save the Original in One Operation&lt;/h3&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; $potatoes = 80; # $potatoes holds 80&lt;br /&gt;($onions = $potatoes) += 10;&lt;br /&gt;&lt;br /&gt;# $onions now 90, and $potatoes still 80&lt;br /&gt;&lt;br /&gt;$sequence = 'GAGTCTTTTGGG';&lt;br /&gt;($reversec = reverse $sequence) =~ tr/GATC/CTAG/;&lt;br /&gt;# reverse reverses a string&lt;br /&gt;# tr/// translates one set of characters into another&lt;br /&gt;&lt;br /&gt;# $sequence holds 'GAGTCTTTTGGG'&lt;br /&gt;# $reversec holds 'CCCAAAAGACTC'&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3&gt;Swap the Values of Two Variables&lt;/h3&gt;  &lt;p&gt;  Here's a simple way to swap the values of two variables in one fast step:  &lt;/p&gt;  &lt;pre&gt; ($onions,$potatoes) = ($potatoes,$onions);&lt;br /&gt;&lt;br /&gt;# $onions now holds the original value of $potatoes, and vice-versa&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Rotate the Values of Three Variables&lt;/h3&gt;  &lt;pre&gt; ($onions,$potatoes,$turnips) = ($potatoes,$turnips,$onions);&lt;br /&gt;&lt;br /&gt;# $onions &lt;- $potatoes # $potatoes &lt;- $turnips # $turnips &lt;- $onions&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;Processing Command Line Arguments&lt;/h1&gt;  &lt;p&gt;  When a Perl script is run, its command-line arguments (if any) are stored in an automatic array called &lt;b&gt;@ARGV&lt;/b&gt;. You'll learn how to manipulate this array later. For now, just know that you can call the &lt;b&gt;shift&lt;/b&gt; function repeatedly from the main part of the script to retrieve the command line arguments one by one.  &lt;/p&gt;&lt;h2&gt;Printing the Command Line Argument&lt;/h2&gt;  &lt;p&gt;  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file: echo.pl&lt;br /&gt;&lt;br /&gt;$argument = shift;&lt;br /&gt;print "The first argument was $argument.\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt;  &lt;blockquote&gt; &lt;pre&gt;(~) 50% &lt;b&gt;chmod +x echo.pl&lt;/b&gt;&lt;br /&gt;(~) 51% &lt;b&gt;echo.pl tuna&lt;/b&gt;&lt;br /&gt;The first argument was tuna.&lt;br /&gt;(~) 52% &lt;b&gt;echo.pl tuna fish&lt;/b&gt;&lt;br /&gt;The first argument was tuna.&lt;br /&gt;(~) 53% &lt;b&gt;echo.pl 'tuna fish'&lt;/b&gt;&lt;br /&gt;The first argument was tuna fish.&lt;br /&gt;(~) 53% &lt;b&gt;echo.pl&lt;/b&gt;&lt;br /&gt;The first argument was .&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;h2&gt;Computing the Hypotenuse of a Right Triangle&lt;/h2&gt;  &lt;p&gt;  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file: hypotenuse.pl&lt;br /&gt;&lt;br /&gt;$x = shift;&lt;br /&gt;$y = shift;&lt;br /&gt;$x&gt;0 and $y&gt;0 or die "Must provide two positive numbers";&lt;br /&gt;&lt;br /&gt;print "Hypotenuse=",sqrt($x**2+$y**2),"\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt;  &lt;blockquote&gt; &lt;pre&gt;(~) 82% hypotenuse.pl&lt;br /&gt;Must provide two positive numbers at hypotenuse.pl line 6.&lt;br /&gt;(~) 83% hypotenuse.pl 1&lt;br /&gt;Must provide two positive numbers at hypotenuse.pl line 6.&lt;br /&gt;(~) 84% hypotenuse.pl 3 4&lt;br /&gt;Hypotenuse=5&lt;br /&gt;(~) 85% hypotenuse.pl 20 18&lt;br /&gt;Hypotenuse=26.9072480941474&lt;br /&gt;(~) 86% hypotenuse.pl -20 18&lt;br /&gt;Must provide two positive numbers at hypotenuse.pl line 6.&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;h1&gt;&lt;span style="font-size:100%;"&gt;Basic I/O&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;&lt;span style="font-size:100%;"&gt;  I/O means "Input/Output". It's how your program communicates with the world.  &lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style="font-size:100%;"&gt;Output&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;  The &lt;b&gt;print()&lt;/b&gt; function does it all:  &lt;/p&gt;&lt;p class="caption"&gt; Code: &lt;/p&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file: print.pl&lt;br /&gt;&lt;br /&gt;$sidekick = 100;&lt;br /&gt;print "Maxwell Smart's sidekick is ",$sidekick-1,".\n";&lt;br /&gt;print "If she had a twin, her twin might be called ",2*($sidekick-1),".\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt;  &lt;blockquote&gt; &lt;pre&gt;(~) 50% &lt;b&gt;chmod +x print.pl&lt;/b&gt;&lt;br /&gt;(~) 51% &lt;b&gt;print.pl&lt;/b&gt;&lt;br /&gt;Maxwell Smart's sidekick is 99.&lt;br /&gt;If she had a twin, her twin might be called 198.&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;p&gt;  We will learn later how to print to a file rather than the terminal.  &lt;/p&gt;&lt;h2&gt;Input&lt;/h2&gt;  &lt;p&gt;  The &lt;b&gt;&lt;&gt;&lt;/b&gt; operator does input. It reads a line of input from the terminal. At the point that &lt;&gt; appears, the script will stop and wait for the user to type of line of input. Then &lt;&gt; will copy the input line into a variable.  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# file: dog_years.pl&lt;br /&gt;&lt;br /&gt;print "Enter your age: ";&lt;br /&gt;$age = &lt;&gt;;&lt;br /&gt;print "Your age in dog years is ",$age/7,"\n";&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt;  &lt;blockquote&gt; &lt;pre&gt;(~) 50% &lt;b&gt;dog_years.pl&lt;/b&gt;&lt;br /&gt;Enter your age: 42&lt;br /&gt;Your age in dog years is 6&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;p&gt;  We will learn later how to take input from a file rather than the terminal.  &lt;/p&gt;&lt;h2&gt;The chomp() Function&lt;/h2&gt;  &lt;p&gt;  When &lt;&gt; reads a line of input, the &lt;b&gt;newline&lt;/b&gt; character at the end is included. Because of this, the program below doesn't do exactly what you expect:  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;print "Enter your name: ";&lt;br /&gt;$name = &lt;&gt;;&lt;br /&gt;print "Hello $name, happy to meet you!\n";&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt;  &lt;blockquote&gt; &lt;pre&gt; % &lt;b&gt;hello.pl&lt;/b&gt;&lt;br /&gt;Enter your name: &lt;b&gt;Lincoln&lt;/b&gt;&lt;br /&gt;Hello Lincoln&lt;br /&gt;, happy to meet you!&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;  &lt;p&gt;  If you want to get rid of the newline there, you can &lt;b&gt;chomp()&lt;/b&gt; it off. &lt;b&gt;chomp()&lt;/b&gt; will remove the terminal newline, if there is one, and do nothing if there isn't.  &lt;/p&gt;&lt;p&gt;  This program works right:  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;print "Enter your name: ";&lt;br /&gt;$name = &lt;&gt;;&lt;br /&gt;chomp $name;&lt;br /&gt;print "Hello $name, happy to meet you!\n";&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p class="caption"&gt; Output: &lt;/p&gt;  &lt;blockquote&gt; &lt;pre&gt; % &lt;b&gt;hello.pl&lt;/b&gt;&lt;br /&gt;Enter your name: &lt;b&gt;Lincoln&lt;/b&gt;&lt;br /&gt;Hello Lincoln, happy to meet you!&lt;br /&gt;&lt;/pre&gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;h1&gt;&lt;span style="font-size:100%;"&gt;Numeric Comparisons&lt;/span&gt;&lt;/h1&gt;&lt;br /&gt;&lt;pre&gt;$a = 4 == 4; # TRUE $a = 4 == 2 + 2; # TRUE $a = 4 == $b; # depends on what $b is&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;$a = 4 != 4; # FALSE $a = 4 != 2 + 2; # FALSE $a = 4 != $b; # depends on what $b is&lt;br /&gt;&lt;br /&gt;$a = 4 &gt; 3; # TRUE $a = 4 &lt; a =" 4"&gt; $b; # depends on what $b is&lt;br /&gt;&lt;br /&gt;$a = 4 &gt;= 3; # TRUE $a = 4 &gt;= 4; # TRUE $a = 4 &lt;= $b; # depends on what $b is  $result = $a &lt;=&gt; $b&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;  $result is  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;-1&lt;/b&gt; if the left side is less than the right side  &lt;/li&gt;&lt;li&gt;&lt;b&gt;0&lt;/b&gt; if the left side equals the right side  &lt;/li&gt;&lt;li&gt;&lt;b&gt;+1&lt;/b&gt; if the left side is greater than the right side &lt;/li&gt;&lt;/ul&gt;  &lt;b&gt;NB:&lt;/b&gt; &lt;=&gt; is really useful in conjunction with the sort() function.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;&lt;span style="font-size:78%;"&gt;String Comparisons&lt;/span&gt;&lt;/h1&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;$a = 'fred' eq 'fred'; # TRUE $a = 'fred and lucy' eq 'fred' . ' and ' . 'lucy'; # TRUE $a = 'fred' eq $b; # depends on what $b is&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;  &lt;span style=";font-size:78%;color:red;"  &gt;&lt;b&gt;== is for numeric comparison.  eq is for string comparison.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;$a = 'fred' == 'lucy'; # WRONG WRONG WRONG!&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;$a = 'fred' ne 'fred'; # FALSE $a = 'fred' ne 'lucy'; # TRUE $a = 'fred' eq $b; # depends on what $b is&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;Use gt, lt, ge, ne for "Greater than", "Less than", "Greater or Equal" etc.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;$a ='fred' gt 'lucy'; # FALSE $a ='fred' lt 'lucy'; # TRUE    $a ='Lucy' lt 'lucy'; # TRUE    $a ='Lucy' lt 'fred'; # TRUE !!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;&lt;span style="font-size:78%;"&gt;Use &lt;b&gt;cmp&lt;/b&gt; to Compare Two Strings&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;$result = $a cmp $b&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size:78%;"&gt;  $result is  &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;-1&lt;/b&gt; if the left side is less than the right side  &lt;/li&gt;&lt;li&gt;&lt;b&gt;0&lt;/b&gt; if the left side equals the right side  &lt;/li&gt;&lt;li&gt;&lt;b&gt;+1&lt;/b&gt; if the left side is greater than the right side &lt;/li&gt;&lt;/ul&gt;  &lt;b&gt;NB:&lt;/b&gt; &lt;i&gt;cmp&lt;/i&gt; is really useful in the sort() function.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;If-Else Statements&lt;/h1&gt;  &lt;p&gt;  Use &lt;b&gt;else&lt;/b&gt; blocks for either/or constructions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;if ($a == $b) {&lt;br /&gt;print "a equals b\n";&lt;br /&gt;$a += $b;&lt;br /&gt;} else {&lt;br /&gt;print "a does not equal b\n";&lt;br /&gt;die "Operation aborted!";&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;You can string tests together using &lt;b&gt;elsif&lt;/b&gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if ($a &gt; 100) {&lt;br /&gt; die "a is too large\n";&lt;br /&gt;} elsif ($a &lt;&gt;&lt;br /&gt;&lt;h1&gt;Logical Operators&lt;/h1&gt;  &lt;p&gt;  &lt;/p&gt;&lt;p&gt;  To combine comparisons, use the &lt;b&gt;and&lt;/b&gt;, &lt;b&gt;or&lt;/b&gt; and &lt;b&gt;not&lt;/b&gt; logical operators.  In some scripts, you might see their cryptic cousins, &lt;b&gt;&amp;amp;&amp;amp;&lt;/b&gt;, &lt;b&gt;||&lt;/b&gt; and &lt;b&gt;!&lt;/b&gt;:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table border="1"&gt;   &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Lower precedence&lt;/th&gt;     &lt;th&gt;Higher precedence&lt;/th&gt;   &lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt; &lt;th&gt;$a and $b&lt;/th&gt; &lt;th&gt;$a &amp;amp;&amp;amp; $b&lt;/th&gt;       &lt;td&gt;TRUE if $a AND $b are TRUE&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt; &lt;th&gt;$a or $b&lt;/th&gt;  &lt;th&gt;$a || $b&lt;/th&gt;               &lt;td&gt;TRUE if either $a OR $b are TRUE&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt; &lt;th&gt;not $a&lt;/th&gt;    &lt;th&gt;!$b&lt;/th&gt;                    &lt;td&gt;TRUE if $a is FALSE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;if ($a &lt;&gt; 0) {&lt;br /&gt;print "a is the right size\n";&lt;br /&gt;} else {&lt;br /&gt;die "out of bounds error, operation aborted!";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ($a &lt;&gt; 0) {&lt;br /&gt;print "a is the right size\n";&lt;br /&gt;} else {&lt;br /&gt;die "out of bounds error, operation aborted!";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ($a &gt;= 100 or $a &lt;= 0) {  die "out of bounds error, operation aborted!"; }  if ($a &gt;= 100 || $a &lt;= 0) {  die "out of bounds error, operation aborted!"; }  &lt;/pre&gt;&lt;h2&gt;To Reverse Truth, use not or !&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;$ok = ($a &lt;&gt; 0);&lt;br /&gt;print "a is too small\n" if not $ok;&lt;br /&gt;&lt;br /&gt;# same as this:&lt;br /&gt;print "a is too small\n" unless $ok;&lt;br /&gt;&lt;br /&gt;# and this:&lt;br /&gt;print "a is too small\n" if !$ok;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;and vs &amp;amp;&amp;amp;, or vs ||&lt;/h2&gt;  &lt;p&gt;  &amp;amp;&amp;amp; has higher precedence than &lt;b&gt;and&lt;/b&gt;.  || has higher precedence than &lt;b&gt;or&lt;/b&gt;.  This is an issue in assignments:  &lt;/p&gt;&lt;p&gt;  Low precedence operation:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;$ok = $a &lt;&gt; 0;&lt;br /&gt;# This doesn't mean:&lt;br /&gt;$ok = ($a &lt;&gt; 0);&lt;br /&gt;&lt;br /&gt;# but:&lt;br /&gt;($ok = $a &lt;&gt; 0;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;High precedence operation:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; $ok = $a &lt;&gt; 0;&lt;br /&gt;# This does mean&lt;br /&gt;$ok = ($a &lt;&gt; 0);&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;The "or die" Idiom&lt;/h1&gt;  &lt;p&gt;  The &lt;b&gt;or&lt;/b&gt;, and || operators short circuit.  If what is on the left is true, then what is on the right is never evaluated, because it doesn't need to be.&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;$a = 10;   $b = 99&lt;br /&gt;$a &lt;&gt;&lt;br /&gt;&lt;h2&gt;The die() Function Aborts Execution with an Error Message&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;die "\$a is the wrong size" unless ($a &lt;&gt; 0);&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;You Combine them Idiomatically Like This&lt;/h2&gt;&lt;pre&gt;($a &lt;&gt; 0) or die "\$a is the wrong size";&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;You can use "and" in the Same Way&lt;/h2&gt;  &lt;p&gt;  If what is on the left of the "and" is FALSE, then Perl doesn't evaluate what's on the right, because it doesn't need to.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;$a &lt;&gt;&lt;h1&gt;File Tests&lt;/h1&gt;  &lt;p&gt;  A bunch of operators are used to check whether files exist, directories exist, files are readable, etc.  &lt;/p&gt;-e &lt;filename&gt;            file exists       &lt;p&gt;   &lt;/p&gt;-r &lt;filename&gt;            file is readable       &lt;p&gt;   &lt;/p&gt;-x &lt;filename&gt;            file is executable       &lt;p&gt;   &lt;/p&gt;-w &lt;filename&gt;           file is writable       &lt;p&gt;   &lt;/p&gt;-d &lt;filename&gt;           filename is a directory&lt;br /&gt;&lt;pre&gt; -w "./fasta.out" or die "Can't write to file";&lt;br /&gt;&lt;br /&gt;print "This file is executable\n" if -x "/usr/bin/perl";&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h1&gt;Simple Pattern Matches&lt;/h1&gt;  &lt;p&gt;  To test whether a variable matches a string, use the =~ operator:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;$a = 'gatttccaa';&lt;br /&gt;print "contains three t's" if $a =~ /ttt/;&lt;br /&gt;print "contains an EcoRI site" if $a =~ /gaattc/&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Some Simple Regular Expression Components&lt;/h2&gt;  &lt;p&gt;  Some symbols between the // are special:  &lt;/p&gt;^        Matches the beginning of the string.       &lt;p&gt;   &lt;/p&gt;$         Matches the end of the string.       &lt;p&gt;   &lt;/p&gt;\w       Matches any single word character (e.g. a-z, A-Z, 0-9).       &lt;p&gt;   &lt;/p&gt;\w+     Matches one or more word characters.       &lt;p&gt;   &lt;/p&gt;\d        Matches a single digit.       &lt;p&gt;   &lt;/p&gt;\d+     Matches one or more digits.&lt;br /&gt;&lt;pre&gt;$a = '367-8380';&lt;br /&gt;print "This is an OK telephone number.\n" if $a =~ /^\d\d\d-\d\d\d\d$/;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h1&gt;What is False?&lt;/h1&gt;  &lt;p&gt;  The number 0, the string "0", the empty string, the empty list and undefined are all False.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Distinguishing Between the Empty String and 0&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;$a = '';&lt;br /&gt;$b = 0;&lt;br /&gt;&lt;br /&gt;$result = $a eq '';  # TRUE&lt;br /&gt;$result = $b eq '';  # FALSE&lt;br /&gt;$result = length $a &gt; 0; # FALSE&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Distinguishing Between the Empty String and undef&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;$a = undef;&lt;br /&gt;$b = '';&lt;br /&gt;&lt;br /&gt;$result = defined $a;  # FALSE&lt;br /&gt;$result = defined $b;  # TRUE&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;strict and -w&lt;/h1&gt;  &lt;p&gt;  Because you don't have to predeclare variables in Perl, there is a big problem with typos:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;$value = 42;&lt;br /&gt;print "Value is OK\n" if $valu &lt;&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h2&gt;The -w Switch Will Warn of Uninitialized Variables&lt;/h2&gt;  &lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;&lt;br /&gt;$value = 42;&lt;br /&gt;print "Value is OK\n" if $valu &lt;&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;% &lt;b&gt;perl uninit.pl&lt;/b&gt;&lt;br /&gt;Name "main::valu" used only once: possible typo at uninit.pl line 4.&lt;br /&gt;Name "main::value" used only once: possible typo at uninit.pl line 3.&lt;br /&gt;Use of uninitialized value in numeric gt (&gt;) at uninit.pl line 4.&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;h2&gt;"use strict"&lt;/h2&gt;  &lt;p&gt;  The "use strict" pragma forces you to predeclare all variables using "my":  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;$value = 42;&lt;br /&gt;print "Value is OK\n" if $valu &lt;&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;% &lt;b&gt;perl uninit.pl&lt;/b&gt;&lt;br /&gt;Global symbol "$value" requires explicit package name at uninit.pl line 4.&lt;br /&gt;Global symbol "$valu" requires explicit package name at uninit.pl line 5.&lt;br /&gt;Execution of uninit.pl aborted due to compilation errors.&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;$value = 42;&lt;br /&gt;print "Value is OK\n" if $value &lt;&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;% &lt;b&gt;perl uninit.pl&lt;/b&gt;&lt;br /&gt;Global symbol "$value" requires explicit package name at uninit.pl line 4.&lt;br /&gt;Execution of uninit.pl aborted due to compilation errors.&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;p&gt;  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;my $value = 42;&lt;br /&gt;print "Value is OK\n" if $value &lt;&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;% &lt;b&gt;perl uninit.pl&lt;/b&gt;&lt;br /&gt;Value is OK&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  &lt;h2&gt;Using my&lt;/h2&gt;  You can use "my" on a single variable, or on a list of variables:  &lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;my $value = 42;&lt;br /&gt;my $a;&lt;br /&gt;my ($c,$d,$e,$f);&lt;br /&gt;my ($first,$second) = (1,2);&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/filename&gt;&lt;/filename&gt;&lt;/filename&gt;&lt;/filename&gt;&lt;/filename&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-2948157442171270310?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/2948157442171270310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=2948157442171270310&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2948157442171270310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/2948157442171270310'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part2.html' title='Learn perl easy part2'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-6157772843811484633</id><published>2009-08-05T18:25:00.000+05:30</published><updated>2009-08-20T12:01:38.612+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Learn perl easy part 1</title><content type='html'>&lt;div style="text-align: left;"&gt;perl :&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part2.html"&gt;&lt;/a&gt;&lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part2.html"&gt;Learn perl easy 2&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 style="font-weight: normal;"&gt;  &lt;b&gt;&lt;span style="font-size:85%;"&gt;1)Print a Message to the Terminal&lt;/span&gt;&lt;/b&gt; &lt;/h2&gt; &lt;span style="font-size:85%;"&gt;#&lt;b&gt;vi &lt;/b&gt;&lt;/span&gt;&lt;b&gt;message.pl&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;print "When that Aprill with his shoures soote\n";&lt;br /&gt;print "The droghte of March ath perced to the roote,\n";&lt;br /&gt;print "And bathed every veyne in swich licour\n";&lt;br /&gt;print "Of which vertu engendered is the flour...\n";&lt;br /&gt;:x&lt;br /&gt;&lt;br /&gt;getting out put:&lt;br /&gt;#&lt;b&gt;perl message.pl&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;When that Aprill with his shoures soote&lt;br /&gt;The droghte of March ath perced to the roote,&lt;br /&gt;And bathed every veyne in swich licour&lt;br /&gt;Of which vertu engendered is the flour...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;2) math operations&lt;/b&gt;&lt;br /&gt;#vi  math.pl&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;print "2 + 2 =", 2+2, "\n";&lt;br /&gt;print "log(1e23)= ", log(1e23), "\n";&lt;br /&gt;print "2 * sin(3.1414)= ", 2 * sin(3.1414), "\n";&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;b&gt;#perl math.pl&lt;/b&gt;&lt;br /&gt;2 + 2 =4&lt;br /&gt;log(1e23)= 52.9594571388631&lt;br /&gt;2 * sin(3.1414)= 0.000385307177203065&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;3)&lt;/b&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt; Run a System Command&lt;/b&gt;&lt;br /&gt;#vi system.pl&lt;br /&gt;&lt;/span&gt;system "ls";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style="font-size:78%;"&gt;4)Return the Time of Day&lt;/span&gt;&lt;/h2&gt;$time = localtime;&lt;br /&gt;&lt;pre&gt;print "The time is now $time\n"; //even in double codes $time will prints time and day of month&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;RUNNING PERL IS OF TWO OPTIONS&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;option 1)perl time.pl&lt;br /&gt;&lt;br /&gt;option 2)vi time.pl&lt;br /&gt;#!/usr/bin/perl         // add this line at first&lt;br /&gt;        # file: time.pl         // optional&lt;br /&gt;        $time = localtime;&lt;br /&gt;        print "The time is now $time\n";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#chmod +x time.pl&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;#./time.pl&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;&lt;span style="font-size:78%;"&gt;Useful Perl Command-Line Options&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:78%;"&gt;  You can call Perl with a few command-line options to help catch errors:  &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt;-c&lt;/b&gt;         &lt;/span&gt;Perform a syntax check, but don't run.  &lt;p&gt;  &lt;/p&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt;-w&lt;/b&gt;&lt;/span&gt;        Turn on verbose warnings.  &lt;p&gt;  &lt;/p&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;b&gt;-d&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;         Turn on the Perl debugger. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;like &lt;i&gt;perl -cw  time.pl &lt;/i&gt;or simply add &lt;i&gt;#!/usr/bin/perl -w&lt;/i&gt; line at beginning of the program.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;PERL STATEMENTS:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;statement is a command that is recognized by the Perl interpreter and executed. Statements are terminated by the semicolon character (;). They are also usually separated by a newline character to enhance readability.&lt;br /&gt;&lt;br /&gt;EXAMPLE&lt;br /&gt;&lt;pre&gt;$sum = 2 + 2; # this is a statement&lt;br /&gt;&lt;br /&gt;$f = &lt;stdin&gt;; $g = $f++; # these are two statements&lt;br /&gt;&lt;br /&gt;$g = $f&lt;br /&gt;&lt;br /&gt;/&lt;br /&gt;$sum; # this is one statement, spread across 3 lines&lt;/stdin&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;blocks&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;{ # block starts&lt;br /&gt;my $EcoRI = 'GAATTC';&lt;br /&gt;my $sequence = &lt;stdin&gt;;&lt;br /&gt;print "Sequence contains an EcoRI site" if $sequence=~/$EcoRI/;&lt;br /&gt;} # block ends&lt;br /&gt;&lt;br /&gt;my $sequence2 = &lt;stdin&gt;;&lt;br /&gt;if (length($sequence) &lt; length = ",length($sequence),"&gt;&lt;/stdin&gt;&lt;/stdin&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style="font-size:78%;"&gt;Labeled Blocks&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;&lt;span style="font-size:78%;"&gt;  You can also attach a label to a block of statements like this:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;READ_SEQUENCE: { #this is my lable&lt;br /&gt;$sequence = &lt;stdin&gt;&lt;br /&gt;print "length = ",length($sequence),"\n";&lt;br /&gt;}&lt;br /&gt;This is sometimes useful for controlling nested loops.&lt;br /&gt;&lt;br /&gt;&lt;/stdin&gt;&lt;/pre&gt;&lt;h1&gt;&lt;span style="font-size:78%;"&gt;Literals&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;  &lt;i&gt;Literals&lt;/i&gt; are constant values that you embed directly in the program code. Perl supports both &lt;i&gt;string literals&lt;/i&gt; and &lt;i&gt;numeric literals&lt;/i&gt;.  &lt;/p&gt;The difference between single and double-quoted strings is that variables and certain special escape codes are interpolated into double quoted strings, but not in single-quoted ones.&lt;br /&gt;&lt;br /&gt;\040  Octal character (octal 040 is the space character)&lt;br /&gt;\0x2a  Hexadecimal character (hex 2A is the "*" character)&lt;br /&gt;\cA  Control character (This is the ^A character) &lt;br /&gt;\u  Uppercase next character &lt;br /&gt;\l  Lowercase next character &lt;br /&gt;\U  Uppercase everything until \E &lt;br /&gt;\L  Lowercase everything until \E &lt;br /&gt;\Q  Quote non-word characters until \E &lt;br /&gt;\E  End \U, \L or \Q operation&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ex:-&lt;br /&gt;&lt;br /&gt;"She cried \"Oh dear! The parakeet has flown the coop!\"";&lt;br /&gt;# evaluates to: She cried "Oh dear! The parakeet has flown the coop!"&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Numeric Literals&lt;/h2&gt;  &lt;p&gt;  You can refer to numeric values using integers, floating point numbers, scientific notation, hexadecimal notation, and octal. With some help from the Math::Complex module, you can refer to complex numbers as well:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;-1.23; # a negative floating point number&lt;br /&gt;1_000_000; # you can use _ to improve readability&lt;br /&gt;1.23E45; # scientific notation&lt;br /&gt;0x7b; # hexadecimal notation (decimal 123)&lt;br /&gt;0173; # octal notation (decimal 123)&lt;br /&gt;use Math::Complex; # bring in the Math::Complex module&lt;br /&gt;&lt;br /&gt;12+3*i; # complex number 12 + 3i&lt;/pre&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Backtick Strings&lt;/h2&gt;  &lt;p&gt;  You can also enclose a string in backtics (`). This has the unusual property of executing whatever is inside the string as a Unix system command, and returning its output:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;`ls -l`;&lt;br /&gt;# evaluates to a string containing the output of running the&lt;br /&gt;# &lt;b&gt;ls -l&lt;/b&gt; command&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Lists&lt;/h2&gt;  &lt;p&gt;  The last type of literal that Perl recognizes is the &lt;i&gt;list&lt;/i&gt;, which is multiple values strung together using the comma operator (,)  and enclosed by parentheses. Lists are closely related to &lt;i&gt;arrays&lt;/i&gt;, which we talk about later.&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;like:-&lt;br /&gt;('one', 'two', 'three', 1, 2, 3, 4.2);&lt;br /&gt;# this is 7-member list contains a mixure of strings, integers&lt;br /&gt;# and floats&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;br /&gt;operators :&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2 style="font-weight: normal;"&gt;&lt;span style="font-size:78%;"&gt;Numeric &amp;amp; String Operators.&lt;/span&gt;&lt;/h2&gt;&lt;h2 style="font-weight: normal;"&gt;&lt;span style="font-size:78%;"&gt;The "." operator acts on strings. The "!" operator acts on strings and numbers. The rest act on numbers.&lt;/span&gt;&lt;br /&gt;&lt;/h2&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;table border="1"&gt;  &lt;tbody&gt;&lt;tr&gt; &lt;th&gt;Operator&lt;/th&gt; &lt;th&gt;Description &lt;/th&gt;&lt;th&gt;Example&lt;/th&gt; &lt;th&gt;Result&lt;/th&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;.&lt;/th&gt; &lt;td&gt;String concatenate&lt;/td&gt; &lt;td&gt;'Teddy' . 'Bear'&lt;/td&gt; &lt;td&gt;TeddyBear&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;=&lt;/th&gt; &lt;td&gt;Assignment&lt;/td&gt; &lt;td&gt;$a = 'Teddy'&lt;/td&gt; &lt;td&gt;$a variable contains 'Teddy'&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;+&lt;/th&gt; &lt;td&gt;Addition&lt;/td&gt; &lt;td&gt;3+2&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;-&lt;/th&gt; &lt;td&gt;Subtraction&lt;/td&gt; &lt;td&gt;3-2&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;-&lt;/th&gt; &lt;td&gt;Negation&lt;/td&gt; &lt;td&gt;-2&lt;/td&gt; &lt;td&gt;-2&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;!&lt;/th&gt; &lt;td&gt;Not&lt;/td&gt; &lt;td&gt;!1&lt;/td&gt; &lt;td&gt;0&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;*&lt;/th&gt; &lt;td&gt;Multiplication&lt;/td&gt; &lt;td&gt;3*2&lt;/td&gt; &lt;td&gt;6&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;/&lt;/th&gt; &lt;td&gt;Division&lt;/td&gt; &lt;td&gt;3/2&lt;/td&gt; &lt;td&gt;1.5&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;%&lt;/th&gt; &lt;td&gt;Modulus&lt;/td&gt; &lt;td&gt;3%2&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;**&lt;/th&gt; &lt;td&gt;Exponentiation&lt;/td&gt; &lt;td&gt;3**2&lt;/td&gt; &lt;td&gt;9&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;&lt;filehandle&gt;&lt;/filehandle&gt;&lt;br /&gt;&lt;/th&gt; &lt;td&gt;File input&lt;/td&gt; &lt;td&gt;&lt;stdin&gt;&lt;/stdin&gt;&lt;br /&gt;&lt;/td&gt; &lt;td&gt;Read a line of input from standard input&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;&gt;&gt;&lt;/th&gt; &lt;td&gt;Right bit shift&lt;/td&gt; &lt;td&gt;3&gt;&gt;2&lt;/td&gt; &lt;td&gt;0 (binary 11&gt;&gt;2=00)&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;&lt;&lt;&lt;/th&gt; &lt;td&gt;Left bit shift&lt;/td&gt; &lt;td&gt;3&lt;&lt;2&lt;/td&gt; &lt;td&gt;12 (binary 11&lt;&lt;2=1100)&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;|&lt;/th&gt; &lt;td&gt;Bitwise OR&lt;/td&gt; &lt;td&gt;3|2&lt;/td&gt; &lt;td&gt;3 (binary 11|10=11&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;&amp;amp;&lt;/th&gt; &lt;td&gt;Bitwise AND&lt;/td&gt; &lt;td&gt;3&amp;amp;2&lt;/td&gt; &lt;td&gt;2 (binary 11&amp;amp;10=10&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;^&lt;/th&gt; &lt;td&gt;Bitwise XOR&lt;/td&gt; &lt;td&gt;3^2&lt;/td&gt; &lt;td&gt;1 (binary 11^10=01&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Logical Operators&lt;/h2&gt;  &lt;p&gt;  These operators compare strings or numbers, returning TRUE or FALSE: &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table border="1"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;th colspan="2"&gt;Numeric Comparison&lt;/th&gt; &lt;th colspan="2"&gt;String Comparison&lt;/th&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 == 2&lt;/th&gt; &lt;td&gt;equal to&lt;/td&gt; &lt;th&gt;'Teddy' eq 'Bear'&lt;/th&gt; &lt;td&gt;equal to&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 != 2&lt;/th&gt; &lt;td&gt;not equal to&lt;/td&gt; &lt;th&gt;'Teddy' ne 'Bear'&lt;/th&gt; &lt;td&gt;not equal to&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 &lt;&gt; &lt;/th&gt;&lt;td&gt;less than&lt;/td&gt; &lt;th&gt;'Teddy' lt 'Bear'&lt;/th&gt; &lt;td&gt;less than&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 &gt; 2&lt;/th&gt; &lt;td&gt;greater than&lt;/td&gt; &lt;th&gt;'Teddy' gt 'Bear'&lt;/th&gt; &lt;td&gt;greater than&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 &lt;= 2&lt;/th&gt; &lt;td&gt;less or equal&lt;/td&gt;&lt;th&gt;'Teddy' le 'Bear'&lt;/th&gt; &lt;td&gt;less than or equal&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 &gt;= 2&lt;/th&gt; &lt;td&gt;greater than or equal&lt;/td&gt;&lt;th&gt;'Teddy' ge 'Bear'&lt;/th&gt; &lt;td&gt;greater than or equal&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;3 &lt;=&gt; 2&lt;/th&gt; &lt;td&gt;compare&lt;/td&gt;&lt;th&gt;'Teddy' cmp 'Bear'&lt;/th&gt; &lt;td&gt;compare&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;th&gt;&lt;br /&gt;&lt;/th&gt; &lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;th&gt;'Teddy' =~ /Bear/&lt;/th&gt; &lt;td&gt;pattern match&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  The &lt;b&gt;&lt;=&gt;&lt;/b&gt; and &lt;b&gt;cmp&lt;/b&gt; operators return:  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;-1&lt;/b&gt; if the left side is less than the right side  &lt;/li&gt;&lt;li&gt;&lt;b&gt;0&lt;/b&gt; if the left side equals the right side  &lt;/li&gt;&lt;li&gt;&lt;b&gt;+1&lt;/b&gt; if the left side is greater than the right side &lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;File Operators&lt;/h2&gt;  &lt;p&gt;  Perl has special &lt;i&gt;file operators&lt;/i&gt; that can be used to query the file system. These operators generally return TRUE or FALSE.  &lt;/p&gt;&lt;p&gt;  Example:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt;print "Is a directory!\n" if -d '/usr/home';&lt;br /&gt;print "File exists!\n" if -e '/usr/home/lstein/test.txt';&lt;br /&gt;print "File is plain text!\n" if -T '/usr/home/lstein/test.txt';&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  There are many of these operators. Here are some of the most useful ones:  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table border="1" height="240" width="600"&gt;  &lt;tbody&gt;&lt;tr&gt; &lt;th&gt;-e filename&lt;/th&gt; &lt;td&gt;file exists&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-r filename&lt;/th&gt; &lt;td&gt;file is readable&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-w filename&lt;/th&gt; &lt;td&gt;file is writable&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-x filename&lt;/th&gt; &lt;td&gt;file is executable&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-z filename&lt;/th&gt; &lt;td&gt;file has zero size&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-s filename&lt;/th&gt; &lt;td&gt;file has nonzero size (returns size)&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-d filename&lt;/th&gt; &lt;td&gt;file is a directory&lt;/td&gt;   &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-T filename&lt;/th&gt; &lt;td&gt;file is a text file&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-B filename&lt;/th&gt; &lt;td&gt;file is a binary file&lt;/td&gt;   &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-M filename&lt;/th&gt; &lt;td&gt;age of file in days since script launched&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;th&gt;-A filename&lt;/th&gt; &lt;td&gt;same for access time&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h1&gt;Functions&lt;/h1&gt;  &lt;p&gt;  In addition to its operators, Perl has many &lt;i&gt;functions&lt;/i&gt;. Functions have a human-readable name, such as &lt;b&gt;print&lt;/b&gt; and take one or more arguments passed as a list. A function may return no value, a single value (AKA "scalar"), or a list (AKA "array"). You can enclose the argument list in parentheses, or leave the parentheses off.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;  A few examples:  &lt;/p&gt;&lt;table class="zeroBorder" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code"&gt;&lt;pre&gt; # The function is print. Its argument is a string.&lt;br /&gt;# The effect is to print the string to the terminal.&lt;br /&gt;print "The rain in Spain falls mainly on the plain.\n";&lt;br /&gt;&lt;br /&gt;# Same thing, with parentheses.&lt;br /&gt;print("The rain in Spain falls mainly on the plain.\n");&lt;br /&gt;&lt;br /&gt;# You can pass a list to print. It will print each argument.&lt;br /&gt;# This prints out "The rain in Spain falls 6 times in the plain."&lt;br /&gt;print "The rain in Spain falls ",2*4-2," times in the plain.\n";&lt;br /&gt;&lt;br /&gt;# Same thing, but with parentheses.&lt;br /&gt;print ("The rain in Spain falls ",2*4-2," times in the plain.\n");&lt;br /&gt;&lt;br /&gt;# The length function calculates the length of a string,&lt;br /&gt;# yielding 45.&lt;br /&gt;length "The rain in Spain falls mainly on the plain.\n";&lt;br /&gt;&lt;br /&gt;# The split function splits a string based on a delimiter pattern&lt;br /&gt;# yielding the list ('The','rain in Spain','falls mainly','on the plain.')&lt;br /&gt;split '/','The/rain in Spain/falls mainly/on the plain.';&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Often Used Functions (alphabetic listing)&lt;/h2&gt;  &lt;p&gt;  For specific information on a function, use &lt;b&gt;perldoc -f &lt;i&gt;function_name&lt;/i&gt;&lt;/b&gt; to get a concise summary.  &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;table border="1"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;th align="left"&gt;abs&lt;/th&gt; &lt;td&gt;absolute value&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;chdir&lt;/th&gt; &lt;td&gt;change current directory&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;chmod&lt;/th&gt; &lt;td&gt;change permissions of file/directory&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;chomp&lt;/th&gt; &lt;td&gt;remove terminal newline from string variable&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;chop&lt;/th&gt; &lt;td&gt;remove last character from string variable&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;chown&lt;/th&gt; &lt;td&gt;change ownership of file/directory&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;close&lt;/th&gt; &lt;td&gt;close a file handle&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;closedir&lt;/th&gt; &lt;td&gt;close a directory handle&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;cos&lt;/th&gt; &lt;td&gt;cosine&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;defined&lt;/th&gt; &lt;td&gt;test whether variable is defined&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;delete&lt;/th&gt; &lt;td&gt;delete a key from a hash&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;die&lt;/th&gt; &lt;td&gt;exit with an error message&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;each&lt;/th&gt; &lt;td&gt;iterate through keys &amp;amp; values of a hash&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;eof&lt;/th&gt; &lt;td&gt;test a filehandle for end of file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;eval&lt;/th&gt; &lt;td&gt;evaluate a string as a perl expression&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;exec&lt;/th&gt; &lt;td&gt;quit Perl and execute a system command&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;exists&lt;/th&gt; &lt;td&gt;test that a hash key exists&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;exit&lt;/th&gt; &lt;td&gt;exit from the Perl script&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;glob&lt;/th&gt; &lt;td&gt;expand a directory listing using shell wildcards&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;gmtime&lt;/th&gt; &lt;td&gt;current time in GMT&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;grep&lt;/th&gt; &lt;td&gt;filter an array for entries that meet a criterion&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;index&lt;/th&gt; &lt;td&gt;find location of a substring inside a larger string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;int&lt;/th&gt; &lt;td&gt;throw away the fractional part of a floating point number&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;join&lt;/th&gt; &lt;td&gt;join an array together into a string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;keys&lt;/th&gt; &lt;td&gt;return the keys of a hash&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;kill&lt;/th&gt; &lt;td&gt;send a signal to one or more processes&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;last&lt;/th&gt; &lt;td&gt;exit enclosing loop&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;lc&lt;/th&gt; &lt;td&gt;convert string to lowercase&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;lcfirst&lt;/th&gt; &lt;td&gt;lowercase first character of string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;length&lt;/th&gt; &lt;td&gt;find length of string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;local&lt;/th&gt; &lt;td&gt;temporarily replace the value of a global variable&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;localtime&lt;/th&gt; &lt;td&gt;return time in local timezone&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;log&lt;/th&gt; &lt;td&gt;natural logarithm&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;m//&lt;/th&gt; &lt;td&gt;pattern match operation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;map&lt;/th&gt; &lt;td&gt;perform on operation on each member of array or list&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;mkdir&lt;/th&gt; &lt;td&gt;make a new directory&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;my&lt;/th&gt; &lt;td&gt;create a local variable&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;next&lt;/th&gt; &lt;td&gt;jump to the top of enclosing loop&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;open&lt;/th&gt; &lt;td&gt;open a file for reading or writing&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;opendir&lt;/th&gt; &lt;td&gt;open a directory for listing&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;pack&lt;/th&gt; &lt;td&gt;pack a list into a compact binary representation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;package&lt;/th&gt; &lt;td&gt;create a new namespace for a module&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;pop&lt;/th&gt; &lt;td&gt;pop the last item off the end of an array&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;print&lt;/th&gt; &lt;td&gt;print to terminal or a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;printf&lt;/th&gt; &lt;td&gt;formatted print to a terminal or file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;push&lt;/th&gt; &lt;td&gt;push a value onto the end of an array&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;q/STRING/&lt;/th&gt; &lt;td&gt;generalized single-quote operation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;qq/STRING/&lt;/th&gt; &lt;td&gt;generalized double-quote operation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;qx/STRING/&lt;/th&gt; &lt;td&gt;generalized backtick operation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;qw/STRING/&lt;/th&gt; &lt;td&gt;turn a space-delimited string of words into a list&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;rand&lt;/th&gt; &lt;td&gt;random number generator&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;read&lt;/th&gt; &lt;td&gt;read binary data from a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;readdir&lt;/th&gt; &lt;td&gt;read the contents of a directory&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;readline&lt;/th&gt; &lt;td&gt;read a line from a text file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;readlink&lt;/th&gt; &lt;td&gt;determine the target of a symbolic link&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;redo&lt;/th&gt; &lt;td&gt;restart a loop from the top&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;ref&lt;/th&gt; &lt;td&gt;return the type of a variable reference&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;rename&lt;/th&gt; &lt;td&gt;rename or move a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;require&lt;/th&gt; &lt;td&gt;load functions defined in a library file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;return&lt;/th&gt; &lt;td&gt;return a value from a user-defined subroutine&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;reverse&lt;/th&gt; &lt;td&gt;reverse a string or list&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;rewinddir&lt;/th&gt; &lt;td&gt;rewind a directory handle to the beginning&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;rindex&lt;/th&gt; &lt;td&gt;find a substring in a larger string, from right to left&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;rmdir&lt;/th&gt; &lt;td&gt;remove a directory&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;s///&lt;/th&gt; &lt;td&gt;pattern substitution operation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;scalar&lt;/th&gt; &lt;td&gt;force an expression to be treated as a scalar&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;seek&lt;/th&gt; &lt;td&gt;reposition a filehandle to an arbitrary point in a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;select&lt;/th&gt; &lt;td&gt;make a filehandle the default for output&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;shift&lt;/th&gt; &lt;td&gt;shift a value off the beginning of an array&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;sin&lt;/th&gt; &lt;td&gt;sine&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;sleep&lt;/th&gt; &lt;td&gt;put the script to sleep for a while&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;sort&lt;/th&gt; &lt;td&gt;sort an array or list by user-specified criteria&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;splice&lt;/th&gt; &lt;td&gt;insert/delete array items&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;split&lt;/th&gt; &lt;td&gt;split a string into pieces according to a pattern&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;sprintf&lt;/th&gt; &lt;td&gt;formatted string creation&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;sqrt&lt;/th&gt; &lt;td&gt;square root&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;stat&lt;/th&gt; &lt;td&gt;get information about a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;sub&lt;/th&gt; &lt;td&gt;define a subroutine&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;substr&lt;/th&gt; &lt;td&gt;extract a substring from a string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;symlink&lt;/th&gt; &lt;td&gt;create a symbolic link&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;system&lt;/th&gt; &lt;td&gt;execute an operating system command, then return to Perl&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;tell&lt;/th&gt; &lt;td&gt;return the position of a filehandle within a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;tie&lt;/th&gt; &lt;td&gt;associate a variable with a database&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;time&lt;/th&gt; &lt;td&gt;return number of seconds since January 1, 1970&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;tr///&lt;/th&gt; &lt;td&gt;replace characters in a string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;truncate&lt;/th&gt; &lt;td&gt;truncate a file (make it smaller)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;uc&lt;/th&gt; &lt;td&gt;uppercase a string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;ucfirst&lt;/th&gt; &lt;td&gt;uppercase first character of a string&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;umask&lt;/th&gt; &lt;td&gt;change file creation mask&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;undef&lt;/th&gt; &lt;td&gt;undefine (remove) a variable&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;unlink&lt;/th&gt; &lt;td&gt;delete a file&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;unpack&lt;/th&gt; &lt;td&gt;the reverse of pack&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;untie&lt;/th&gt; &lt;td&gt;the reverse of tie&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;unshift&lt;/th&gt; &lt;td&gt;move a value onto the beginning of an array&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;use&lt;/th&gt; &lt;td&gt;import variables and functions from a library module&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;values&lt;/th&gt; &lt;td&gt;return the values of a hash variable&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;wantarray&lt;/th&gt; &lt;td&gt;return true in an array context&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;warn&lt;/th&gt; &lt;td&gt;print a warning to standard error&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th align="left"&gt;write&lt;/th&gt; &lt;td&gt;formatted report generation&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;  &lt;/p&gt;&lt;h2&gt;Creating Your Own Functions&lt;/h2&gt;  &lt;p&gt;  You can define your own functions or redefine the built-in ones using the &lt;b&gt;sub&lt;/b&gt; function. This is described in more detail in a later.&lt;br /&gt;&lt;/p&gt;&lt;p style="text-align: right;"&gt;&lt;a href="http://baluenigma.blogspot.com/2009/08/learn-perl-easy-part2.html"&gt;&lt;span style="text-decoration: underline;"&gt;Learn perl easy part 2&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-6157772843811484633?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/6157772843811484633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=6157772843811484633&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6157772843811484633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/6157772843811484633'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/08/learn-perl-easy.html' title='Learn perl easy part 1'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-3417758214535329829</id><published>2009-07-31T10:45:00.000+05:30</published><updated>2009-08-20T11:59:52.663+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Access contol list (ACL)</title><content type='html'>I went to bellow two link and i feel its an excellent explanation,&lt;br /&gt;follow bellow links&lt;br /&gt;&lt;br /&gt;&lt;a href="http://linuxcommando.blogspot.com/2007/12/basic-linux-permission-model-lets-you.html"&gt;http://linuxcommando.blogspot.com/2007/12/basic-linux-permission-model-lets-you.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://linuxcommando.blogspot.com/2008/01/part-2-how-to-work-with-access-control.html"&gt;http://linuxcommando.blogspot.com/2008/01/part-2-how-to-work-with-access-control.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-3417758214535329829?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/3417758214535329829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=3417758214535329829&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3417758214535329829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/3417758214535329829'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/07/access-contol-list-acl.html' title='Access contol list (ACL)'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3504183359607196635.post-9047140351804858691</id><published>2009-07-30T20:38:00.000+05:30</published><updated>2009-08-20T11:50:44.467+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>chattr, lsattr linux command usage and examples</title><content type='html'>&lt;p&gt;Take a scenario with Linux server and share SUDO access with several administrators.  The problem is that sometimes files are getting clobbered when other admins are running installs, updates or try to clean up disk space on the server.&lt;/p&gt;&lt;p&gt;Now you need to save your files or make other admins to know about your files.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now you may thinks of sticky bit but it works between owner and group but not between users.&lt;br /&gt;&lt;/p&gt;so ....&lt;br /&gt;&lt;br /&gt;chattr is what compares to&lt;strong&gt;&lt;/strong&gt; &lt;strong&gt;chmod&lt;/strong&gt; but has a few extra features.  The one that would work for his problem is the &lt;strong&gt;+ i&lt;/strong&gt; attribute.  When you run the command &lt;strong&gt;chattr + i /filename&lt;/strong&gt; it makes the file “Immutable”  but it sets the file permission so that it can’t be modified or deleted even by root.  For example if someone logs in as root and runs my favorite command “&lt;strong&gt;rm -rf *&lt;/strong&gt;” the files set with &lt;strong&gt;+ i&lt;/strong&gt; would still be on the disk.&lt;br /&gt;(now if u want to remove use &lt;span style="font-weight: bold;"&gt;-i&lt;/span&gt; in the place)&lt;br /&gt;&lt;p&gt;&lt;span id="more-81"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;I use this to protect the important files on the Linux servers.  You can use it on the /etc/passwd file, various configuration files, you can even use it for log files.  If you really know your system, and want to harden it, you can even use it on the /sbin, /bin, /usr/sbin, /usr/lib and other sensitive directories.&lt;/p&gt; &lt;p&gt;I have only used it for protecting directories a few times and I have a script that I run that will perform a few tasks and make the files editable.  After I finish running updates or installing new software.  I then run the script again and it “locks” all the files again.&lt;/p&gt; &lt;p&gt;I also use this for protecting the configuration and log files I create with the scripts that I write.  You can use the &lt;strong&gt;+a&lt;/strong&gt; attribute which makes the file append only.&lt;/p&gt; &lt;p&gt;So if you have privilege access (root or sudo) to a Linux server that has the ext2/ext3 type file system you can use the following commands:&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;To prevent a user or root from accidentally modifying or deleting a file.&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;# chattr +i /file_name&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;or&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To prevent a user, root or a process from deleting a file but still be able to write to it.&lt;em&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;# chattr +a /log_file&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;  &lt;p&gt;see &lt;strong&gt;[Ex. man chattr] &lt;/strong&gt;more help.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Before changing attribute lsattr shows&lt;/p&gt;&lt;p&gt;--------------- ./temp&lt;br /&gt;--------------- ./temp2&lt;br /&gt;--------------- ./temp3&lt;br /&gt;&lt;/p&gt;&lt;p&gt;now do&lt;br /&gt;&lt;/p&gt;&lt;p&gt;chattr +i temp&lt;/p&gt;&lt;p&gt;do lsattr&lt;br /&gt;&lt;/p&gt;&lt;p&gt;----i---------- ./temp&lt;/p&gt;&lt;p&gt;--------------- ./temp2&lt;br /&gt;--------------- ./temp3&lt;/p&gt;&lt;p&gt;and we have lot more&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There are some other valid bits that chattr can set (see "man   chattr"):&lt;/p&gt;    &lt;p&gt;a = append-only mode&lt;br /&gt; c = compressed storage&lt;br /&gt; d = dump-omitted (omit this file, when using the dump   command)&lt;br /&gt; j = journaled&lt;br /&gt; s = secret (zero out all its bits, if you delete the file)&lt;br /&gt; S = synchronous-written&lt;br /&gt; u = undeletable&lt;/p&gt;&lt;p&gt;Enjoy&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3504183359607196635-9047140351804858691?l=baluenigma.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://baluenigma.blogspot.com/feeds/9047140351804858691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3504183359607196635&amp;postID=9047140351804858691&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9047140351804858691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3504183359607196635/posts/default/9047140351804858691'/><link rel='alternate' type='text/html' href='http://baluenigma.blogspot.com/2009/07/linux-chattr-lsattr-usage-examples.html' title='chattr, lsattr linux command usage and examples'/><author><name>balaji phaneedra kumar</name><uri>http://www.blogger.com/profile/06871230759659928885</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_a3vWkw3wrUY/TAiFtLsbiqI/AAAAAAAABFM/zTitoXKl2l0/S220/dsc00804.jpg'/></author><thr:total>0</thr:total></entry></feed>
