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

<channel>
	<title>» DoYourself.org &#187; Linux</title>
	<atom:link href="http://www.doyourself.org/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doyourself.org</link>
	<description>Did you know ?</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:00:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Steps to add Open DNS in Ubuntu Linux</title>
		<link>http://www.doyourself.org/linux/814-steps-to-add-open-dns-in-ubuntu-linux/</link>
		<comments>http://www.doyourself.org/linux/814-steps-to-add-open-dns-in-ubuntu-linux/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 23:54:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=814</guid>
		<description><![CDATA[Today I faced some DNS issues with my new computer after installing Ubuntu in it. After some basic troubleshooting steps I assigned Open DNS address to my network adapter and the issue is resolved. Open DNS is a smart way to make our browsing fast and reliable. As the name suggests this DNS service is [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Today I faced some DNS issues with my new computer after installing  Ubuntu in it. After some basic troubleshooting steps I assigned Open DNS  address to my network adapter and the issue is  resolved. Open DNS is a  smart way to make our browsing fast and reliable. As the name suggests  this DNS service is absolutely free and worth a try. Before go to open  DNS we need to know a little bit about DNS. As we know DNS is used to  convert the domain name of of website to its IP address. For any  communication your computer should know the mac address and IP address  of the destination (Here web server). MAC address can be obtained from  ARP table and if the user type the IP address of the web server computer  knows both. If the user type the domain name of the website your  computer don&#8217;t know the IP address of the destination and the  communication will not happen. Here the DNS server helps. DNS helps to  resolve the domain name to IP convertion issue and send the destination  IP address to the computer.</p>
<p>So it is understood that every  computer which connects to the Internet should know the DNS server  address. There are many DNS servers available including your ISP&#8217;s  DNS  server.  Here I am presenting the steps to assign Open DNS in Ubuntu  linux.</p>
<p>To know the stpes to assign DNS address in Windows computer click on the link below.</p>
<p><a href="http://www.corenetworkz.com/2009/07/how-to-configure-dns-address-from.html">How to configure DNS address in Windows computer</a></p>
<h2>Assign Open DNS in Ubuntu</h2>
<p>The steps to set open DNS in Ubuntu are:</p>
<p>1.   Right click on the network symbol</p>
<p>You can see the network icon on the right hand top of the screen.<br />
<a href="http://img145.imageshack.us/i/screenshotoanusd.png/"><img src="http://img145.imageshack.us/img145/9796/screenshotoanusd.png" border="0" alt="Enable Open DNS in Ubuntu Linux" /></a></p>
<p>2. Click on the Edit Connection</p>
<p>3. Now the active network connection window will be opened.</p>
<p><a href="http://img19.imageshack.us/i/screenshot1obh.png/"><img src="http://img19.imageshack.us/img19/6077/screenshot1obh.png" border="0" alt="Set Open DNS in Ubuntu" /></a></p>
<p>If your computer is connected with an ethernet cable you will get the standard name eth0.</p>
<p>4. Select the connection and click on Edit button</p>
<p>5. On the Edit window click on IPv4 Settings tab</p>
<p><a href="http://img213.imageshack.us/i/screenshot2e.png/"><img src="http://img213.imageshack.us/img213/1364/screenshot2e.png" border="0" alt="Edit the connection to set DNS address in Ubuntu" /></a></p>
<p>Now on DNS Server enter the Open DNS addresses.</p>
<p>The Open DNS addresses are :</p>
<p>i.     208.67.222.222<br />
ii.    208.67.220.220</p>
<p>Now click Apply and reboot your computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/814-steps-to-add-open-dns-in-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to bing dyanmic IP to a subdomain</title>
		<link>http://www.doyourself.org/networking/790-how-to-bing-dyanmic-ip-to-a-subdomain/</link>
		<comments>http://www.doyourself.org/networking/790-how-to-bing-dyanmic-ip-to-a-subdomain/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 23:43:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=790</guid>
		<description><![CDATA[We have a server with dedicated IP address in my company&#8217;s headquarter. There&#8217;re a couple of branches at other locations. We need to setup servers in each branch and allow accessing to those servers through dedicated subdomain name. But we do not have static IP for those branches, so it&#8217;s not possible to bind any [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>We have a server with dedicated IP address in my company&#8217;s headquarter.  There&#8217;re a couple of branches at other locations. We need to setup  servers in each branch and allow accessing to those servers through  dedicated subdomain name. But we do not have static IP for those  branches, so it&#8217;s not possible to bind any IP in our DNS server at  headquarter.</p>
<p>If you have the same need as we are, here&#8217;s what we did to resolve the problem.</p>
<p>Basically  we need to setup DNS Update service at branch site to perform remote  DNS update to headquarter to update IP of subdomains used by branch site  periodically, so headquarter&#8217;s DNS will always know the correct IP of  each branch server.</p>
<p>For example, our main domain is  infolexllc.com, and we need to setup a branch server at New York which  will be called ny.infolexllc.com, here&#8217;s what we do at servers at both  ends (both CentOS 5.X):</p>
<p>At branch site(where only dynamic IP is available):<br />
1. Install NS Update:</p>
<pre>yum install bind-utils</pre>
<p>2. Create folder to hold related files and scripts:</p>
<pre>mkdir /root/nsupdate
cd /root/nsupdate</pre>
<p>3. create key files for NS update</p>
<pre>dnssec-keygen -a HMAC-MD5 -b 512 -n USER ny.infolexllc.com
Kny.infolexllc.com.+157+47223</pre>
<p>4. You should have two new files created under the current folder:</p>
<pre>Kny.infolexllc.com.+157+47223.key  Kny.infolexllc.com.+157+47223.private
5. create a new shell file: donsupdate.sh:
<div id="codeContent">
<ol>
<li>#!/bin/sh</li>
<li></li>
<li>cd /root/nsupdate</li>
<li></li>
<li>HOST=ny.infolexllc.com.</li>
<li></li>
<li>#Get branch site's IP</li>
<li></li>
<li>IPADDR=`links -source http://whatismyipaddress.com/ |grep -o 'Your IP address is [0-9.]*'|cut -d : -f 2|awk '{print $5}'`</li>
<li>NSUFILE=./nsupdate</li>
<li>FLAGFILE=./nsupdate.flag</li>
<li></li>
<li>if [ "" = "$IPADDR" ]; then</li>
<li> echo Error detecting current  I will exit.</li>
<li> exit 0;</li>
<li>else</li>
<li> echo Detected IP address is:$IPADDR</li>
<li>fi</li>
<li></li>
<li>FLAG=`date +%H`:$IPADDR</li>
<li></li>
<li>if [ -a $FLAGFILE ]; then</li>
<li> FLAG_IN_FILE=`cat $FLAGFILE`</li>
<li>fi</li>
<li></li>
<li>if [ "$FLAG" == "$FLAG_IN_FILE" ]; then</li>
<li> #Flag is same, skip it</li>
<li></li>
<li> echo IP is not changed in the passwd hour, so I will skip</li>
<li> exit 0;</li>
<li>else</li>
<li> echo IP has been changed or one hour has been passed, save the flag and do update...</li>
<li> echo $FLAG &gt; $FLAGFILE</li>
<li>fi</li>
<li></li>
<li>#change infolexllc.com to your head quarter site's domain name</li>
<li></li>
<li>HQ_DOMAIN_NAME=infolexllc.com</li>
<li>echo "server $HQ_DOMAIN_NAME" &gt; $NSUFILE</li>
<li>echo "zone infolexllc.com" &gt;&gt; $NSUFILE</li>
<li>echo "update delete $HOST A" &gt;&gt; $NSUFILE</li>
<li>echo "update add $HOST 84600 A $IPADDR" &gt;&gt; $NSUFILE</li>
<li>echo "show" &gt;&gt; $NSUFILE</li>
<li>echo "send" &gt;&gt; $NSUFILE</li>
<li>nsupdate -k ./Kny.infolexllc.com.+157+47223.private -d $NSUFILE</li>
</ol>

Make sure you change value of the script based-on your own environment.
6. Open the newly generated key file Kny.infolexllc.com.+157+47223.key
<pre>ny.infolexllc.com. IN KEY 0 3 157 QLwMCWdqUJ/ZOsOsdF4Dj/mYD2XwmqSrPL540JE3dwG7FXZwrJulOp16 Y0SySnfOo7+5s1mhZhUiAHxVOSoXnQ==</pre>
<p>Remember the key string started from QlwMC.. all the way to the ending ==<br />
<span style="font-weight: bold;"><br />
On headquarter server:</span><br />
7. Modify named comnfiguration to allow remote DNS update from ny.infolexllc.com</p>
<p>Open /etc/named.conf<br />
Find zone "infolexllc.com" {<br />
Insert the following section in the configuration file before the zone:<br />
key ny.infolexllc.com.{<br />
algorithm hmac-md5;<br />
secret "QLwMCWdqUJ/ZOsOsdF4Dj/mYD2XwmqSrPL540JE3dwG7FXZwrJulOp16 Y0SySnfOo7+5s1mhZhUiAHxVOSoXnQ==";<br />
};</p>
<p>Insert the following lines at end of the infolexllc.com zone:<br />
allow-update {<br />
key  ny.infolexllc.com. ;<br />
};</p>
<p>Restart DNS server:</p>
<pre>/etc/init.d/named restart</pre>
<p>Now the headquarter DNS server should allow remote DNS update from ny.infolexllc.com</p>
<p><span style="font-weight: bold;">On branch server:</span><br />
8. Test DNS update script:<br />
run</p>
<pre>donsupdate.sh</pre>
<p>You should see messages like below:</p>
<pre>
Detected IP address is:123.123.123.123
IP has been changed or one hour has been passed, save the flag and do update...
Creating key...
before getaddrinfo()
Outgoing update query:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: UPDATE, status: NOERROR, id:      0
;; flags: ; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
;; UPDATE SECTION:
ny.infolexllc.com. 0 ANY A
ny.infolexllc.com. 84600 IN A 123.123.123.123

Reply from update query:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: UPDATE, status: NOERROR, id:  25321
;; flags: qr ; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 1
;; TSIG PSEUDOSECTION:
ny.infolexllc.com. 0 ANY TSIG hmac-md5.sig-alg.reg.int. 123123123123 300 16 ABCabcABCabc123+12aBcde== 25321 NOERROR 0
</pre>
<p>The status: NOERROR indicates a succeful update.<br />
If you see any other error in status, go check /var/log/messages on head quarter server to find clue.</p>
<p>9. Test the new domain:</p>
<pre>ping ny.infolexllc.com</pre>
<p>You should see the new domain can be resolved to the dynamic IP currently assigned to branch server.</p>
<p>10.<br />
Once update script is working, you can create a cron job on branch<br />
server to run the script every 10 minutes. The script itself will check<br />
if IP has not been changed in the past hour, it will skip remote update.</p>
<p>I've<br />
done this for our branch servers several times. It works very well so<br />
far. I hope this set up can help resolving your problem. Feel free to<br />
let me know f you have any feedback or question.</p>
<p>Cheers!</p>
</div>
</pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1345px; width: 1px; height: 1px; overflow: hidden;">Make sure you change value of the script based-on your own environment.<br />
6. Open the newly generated key file Kny.infolexllc.com.+157+47223.key</p>
<pre>ny.infolexllc.com. IN KEY 0 3 157 QLwMCWdqUJ/ZOsOsdF4Dj/mYD2XwmqSrPL540JE3dwG7FXZwrJulOp16 Y0SySnfOo7+5s1mhZhUiAHxVOSoXnQ==</pre>
<p>Remember the key string started from QlwMC.. all the way to the ending ==<br />
<span style="font-weight: bold;"><br />
On headquarter server:</span><br />
7. Modify named comnfiguration to allow remote DNS update from ny.infolexllc.com</p>
<p>Open /etc/named.conf<br />
Find zone &#8220;infolexllc.com&#8221; {<br />
Insert the following section in the configuration file before the zone:<br />
key ny.infolexllc.com.{<br />
algorithm hmac-md5;<br />
secret &#8220;QLwMCWdqUJ/ZOsOsdF4Dj/mYD2XwmqSrPL540JE3dwG7FXZwrJulOp16 Y0SySnfOo7+5s1mhZhUiAHxVOSoXnQ==&#8221;;<br />
};</p>
<p>Insert the following lines at end of the infolexllc.com zone:<br />
allow-update {<br />
key  ny.infolexllc.com. ;<br />
};</p>
<p>Restart DNS server:</p>
<pre>/etc/init.d/named restart</pre>
<p>Now the headquarter DNS server should allow remote DNS update from ny.infolexllc.com</p>
<p><span style="font-weight: bold;">On branch server:</span><br />
8. Test DNS update script:<br />
run</p>
<pre>donsupdate.sh</pre>
<p>You should see messages like below:</p>
<pre>
Detected IP address is:123.123.123.123
IP has been changed or one hour has been passed, save the flag and do update...
Creating key...
before getaddrinfo()
Outgoing update query:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: UPDATE, status: NOERROR, id:      0
;; flags: ; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
;; UPDATE SECTION:
ny.infolexllc.com. 0 ANY A
ny.infolexllc.com. 84600 IN A 123.123.123.123

Reply from update query:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: UPDATE, status: NOERROR, id:  25321
;; flags: qr ; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 1
;; TSIG PSEUDOSECTION:
ny.infolexllc.com. 0 ANY TSIG hmac-md5.sig-alg.reg.int. 123123123123 300 16 ABCabcABCabc123+12aBcde== 25321 NOERROR 0
</pre>
<p>The status: NOERROR indicates a succeful update.<br />
If you see any other error in status, go check /var/log/messages on head quarter server to find clue.</p>
<p>9. Test the new domain:</p>
<pre>ping ny.infolexllc.com</pre>
<p>You should see the new domain can be resolved to the dynamic IP currently assigned to branch server.</p>
<p>10.  Once update script is working, you can create a cron job on branch  server to run the script every 10 minutes. The script itself will check  if IP has not been changed in the past hour, it will skip remote update.</p>
<p>I&#8217;ve  done this for our branch servers several times. It works very well so  far. I hope this set up can help resolving your problem. Feel free to  let me know f you have any feedback or question.</p>
<p>Cheers!</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/networking/790-how-to-bing-dyanmic-ip-to-a-subdomain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoders in FFmpeg</title>
		<link>http://www.doyourself.org/ffmpeg/587-howto-easily-enable-mp3-mpeg4-aac-and-other-restricted-encoders-in-ffmpeg/</link>
		<comments>http://www.doyourself.org/ffmpeg/587-howto-easily-enable-mp3-mpeg4-aac-and-other-restricted-encoders-in-ffmpeg/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:31:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FFMPEG]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=587</guid>
		<description><![CDATA[A common question is &#8220;why doesn&#8217;t the repository FFmpeg convert to mp3, aac, mpeg4, etc?&#8221;. Ubuntu doesn&#8217;t make it very clear to the general user as to why to repo FFmpeg is so limited or how to fix this issue. This is reflected in the number of forum questions relating to this topic. Why is [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>A common question is &#8220;why doesn&#8217;t the repository FFmpeg convert to mp3,  aac, mpeg4, etc?&#8221;.  Ubuntu doesn&#8217;t make it very clear to the general  user as to why to repo FFmpeg is so limited or how to fix this issue.   This is reflected in the number of forum questions relating to this  topic.</p>
<p><span style="font-size: medium;"><span style="color: #cc6600;">Why is FFmpeg from the repository so limited?</span></span><br />
Legal reasons.  Some software is limited due to geographical differences  in software patents, legal restrictions on free speech, and  restrictions on certain technologies.  Ubuntu sidesteps these legal  restrictions by not including some restricted packages by default.   Users must install these packages on their own.  See <a href="https://help.ubuntu.com/community/RestrictedFormats" target="_blank">Restricted Formats Ubuntu Community Documentation</a> and <a href="http://ffmpeg.org/legal.html" target="_blank">FFmpeg License and Legal Considerations</a> for more details.</p>
<p><span style="font-size: medium;"><span style="color: #cc6600;">How do I fix FFmpeg?</span></span><br />
There are several options:</p>
<blockquote><p>A. Compile FFmpeg yourself<br />
B. Install the <em>unstripped</em> or <em>extra</em> libraries<br />
C. Medibuntu</p></blockquote>
<p><span style="font-size: medium;"><span style="color: #cc6600;">A. Compiling FFmpeg yourself (for all Ubuntu versions)</span></span><br />
The official FFmpeg answer is to compile it yourself, giving you the  power to get what you want with the bug-fixes, enhancements, and  benefits of the most recent FFmpeg revision.  This is an excellent  solution and is explained here:</p>
<p><a href="http://www.doyourself.org/ffmpeg/592-howto-install-and-use-the-latest-ffmpeg-and-x264/" target="_blank">HOWTO: Install and use the latest FFmpeg and x264</a></p>
<p>This is the option that I personally use, and although it is not too  hard, compiling may not be for everyone for a variety of reasons.  Off  to the other options&#8230;</p>
<p><span style="font-size: medium;"><span style="color: #cc6600;">B. Installing the <em>unstripped</em> or <em>extra</em> libraries</span></span><br />
This is the quickest option for most users.  FFmpeg from the repository  does not include many restricted encoders, formats, and codecs which may  include: H.263, aac (libfaac), mp3 (libmp3lame), H.264 (libx264), xvid  (libxvid), and mpeg4.  You can fix this by installing the <em>unstripped</em> or <em>extra</em> (Ubuntu Karmic renamed <em>unstripped</em> to <em>extra</em>) FFmpeg libraries that will enable these restricted encoders.  Open up Terminal and enter:</p>
<p><strong>Ubuntu Lucid Lynx 10.04 &amp; Ubuntu Karmic Koala 9.10</strong></p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo apt-get install ffmpeg libavcodec-extra-52</pre>
</div>
<blockquote><p><strong>Note:</strong> <span style="color: #ff6600;">The <strong>libavcodec-extra-52</strong> package for Lucid and Karmic do not support AAC or AMR formats.  I recommend using <strong>libavcodec-extra-52</strong> from the Medibuntu repository.  See option <strong>C. Medibuntu</strong>.</span></p></blockquote>
<p><strong>Ubuntu Jaunty Jackalope 9.04</strong></p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo apt-get install ffmpeg libavcodec-unstripped-52</pre>
</div>
<p><strong>Ubuntu Intrepid Ibex 8.10</strong></p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo apt-get install ffmpeg libavcodec-unstripped-51</pre>
</div>
<p>Alternatively, you can search for these packages in the Synaptic Package Manager.</p>
<p><span style="font-size: medium;"><span style="color: #cc6600;">C. Medibuntu</span></span><br />
This option is available for <strong>Ubuntu Lucid Lynx 10.04</strong>, <strong>Ubuntu Karmic Koala 9.10</strong> and <strong>Ubuntu Hardy Heron 8.04</strong>.  <a href="http://medibuntu.org/" target="_blank">Medibuntu</a> is a third-party repository that contains packages that are unable to  be included in the official Ubuntu repositories.  To install FFmpeg from  Medibuntu open Terminal (Applications -&gt; Accessories -&gt; Terminal)  and run the following:</p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list &amp;&amp; sudo apt-get -q update &amp;&amp; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring &amp;&amp; sudo apt-get -q update</pre>
</div>
<p>This huge command (adapted from <a href="https://help.ubuntu.com/community/Medibuntu" target="_blank">Medibuntu &#8211; Community Ubuntu Documentation</a>) will install the repository information to your computer then update and authenticate the new repository.  Now install FFmpeg:</p>
<p><strong>Ubuntu Lucid Lynx 10.04 &amp; Ubuntu Karmic Koala 9.10</strong></p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo apt-get install ffmpeg libavcodec-extra-52</pre>
</div>
<p><strong>Ubuntu Hardy Heron 8.04</strong></p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo apt-get install ffmpeg</pre>
</div>
<p>That&#8217;s it.  Now you have a non-crippled version of FFmpeg.  See some usage examples at the <a href="http://www.doyourself.org/ffmpeg/588-ffmpeg-x264-encoding-guide/" target="_blank">FFmpeg x264 encoding guide</a>.</p>
<p><span style="font-size: medium;"><span style="color: #cc6600;">Undoing Changes Made By This Guide</span></span><br />
<strong>B. Uninstalling the <em>unstripped</em> or <em>extra</em> libraries</strong></p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo apt-get remove ffmpeg libavcodec-*-5*</pre>
</div>
<p><strong>C. Uninstalling FFmpeg and the Medibuntu Repository</strong></p>
<div>Code:</div>
<pre dir="ltr">sudo apt-get autoremove ffmpeg medibuntu-keyring &amp;&amp; sudo rm /etc/apt/sources.list.d/medibuntu.list</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/ffmpeg/587-howto-easily-enable-mp3-mpeg4-aac-and-other-restricted-encoders-in-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux KVM: OpenBSD Guest Hangs At Starting tty Flags</title>
		<link>http://www.doyourself.org/linux/572-linux-kvm-openbsd-guest-hangs-at-starting-tty-flags/</link>
		<comments>http://www.doyourself.org/linux/572-linux-kvm-openbsd-guest-hangs-at-starting-tty-flags/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:16:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[KVM]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=572</guid>
		<description><![CDATA[OpenBSD version 4.5 and above made changes in kernel which prevents booting OpenBSD using KVM technology. OpenBSD 4.4 runs with mbbios enabled. However, due to some sort of bug in KVM it does not boot and hangs while displaying a message which read as &#8220;Starting tty flags&#8221;. The workaround is to disable mpbios. This may [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>OpenBSD version 4.5 and above made  changes in kernel which prevents booting OpenBSD using KVM technology.  OpenBSD 4.4 runs with mbbios enabled. However, due to some sort of bug  in KVM it does not boot and hangs while displaying a message which read  as &#8220;Starting tty flags&#8221;. The workaround is to disable mpbios. This may  or may not happen with your installation, but if it hanged, use the  following procedure.</p>
<h2>Step # 1: Boot OpenBSD With -c Option</h2>
<div><img src="http://c.cyberciti.biz/cbzcache/3rdparty/openbsd_logo_sm.png" border="0" alt="" /></div>
<p>At boot&gt; prompt type the following command:</p>
<pre>bsd -c
disable mpbios
quit</pre>
<p>Sample session:</p>
<div id="attachment_8354"><a rel="attachment wp-att-8354" href="http://www.doyourself.org/?attachment_id=8354"><img title="OpenBSD KVM Hangs at setting tty flags workaround" src="http://files.cyberciti.biz/uploads/faq/2010/07/openbsd-setting-tty-flags-hangs.png" alt="Fig.01: OpenBSD KVM Hangs at setting tty flags workaround" width="599" height="343" /></a>Fig.01: OpenBSD KVM Hangs at setting tty flags workaround</p>
</div>
<p>Now OpenBSD will boot without any problem. Login as root and type the following command to disable mpbios permanently:</p>
<pre># config -ef /bsd
disable mpbios
quit</pre>
<p>Sample session:</p>
<div id="attachment_8355"><a rel="attachment wp-att-8355" href="http://www.doyourself.org/?attachment_id=8355"><img title="Disabling mpbios for OpenBSD running under Linux KVM" src="http://files.cyberciti.biz/uploads/faq/2010/07/openbsd-disable-mpbios-for-kvm.png" alt="Fig.02: Disabling mpbios for OpenBSD running under Linux KVM" width="559" height="320" /></a>Fig.02: Disabling mpbios for OpenBSD running under Linux KVM</p>
</div>
<div><img src="http://c.cyberciti.biz/cbzcache/3rdparty/kvm-logo.png" border="0" alt="" /></div>
<p>Now you can use OpenBSD without any problem. Please note that this  problem only occured under RHEL 5.5 64bit (KVM83) running OpenBSD 4.7  64bit guest. The config command can be used to build kernel compilation  directories or modify a kernel. In this case you&#8217;ve modified the kernel  to boot without mpbios support. The mpbios driver extracts configuration  information from the BIOS on multiprocessor systems that conform to the  Intel MultiProcessor Specification. See <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=config&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html" target="_blank">config and </a><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=mpbios&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html" target="_blank">mpbios</a> man page for further information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/572-linux-kvm-openbsd-guest-hangs-at-starting-tty-flags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Find Wireless Driver Chipset Information</title>
		<link>http://www.doyourself.org/linux/566-linux-find-wireless-driver-chipset-information/</link>
		<comments>http://www.doyourself.org/linux/566-linux-find-wireless-driver-chipset-information/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:12:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=566</guid>
		<description><![CDATA[How do I find out Wireless driver chipset information under Linux? How do I get wireless card chipeset information without opening my systems? The simplest command to get this information is to use the lspci command: lspci lspci &#124; less lspci &#124; grep -i intel lspci &#124; grep -i wireless Sample outputs: 0c:00.0 Network controller: [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>How do I find out Wireless driver  chipset information under Linux? How do I get wireless card chipeset  information without opening my systems?</p>
<p>The simplest command to get this information is to use the lspci command:</p>
<pre>lspci
lspci | less
lspci | grep -i intel
lspci | grep -i wireless</pre>
<p>Sample outputs:</p>
<pre>0c:00.0 Network controller: Intel Corporation PRO/Wireless 5300 AGN [Shiloh] Network Connection
</pre>
<p>Note down 0c:00.0 and enter the following command:<br />
<code>lspci -vv -s 0c:00.0</code><br />
Sample outputs:</p>
<pre>0c:00.0 Network controller: Intel Corporation PRO/Wireless 5300 AGN [Shiloh] Network Connection
	Subsystem: Intel Corporation Device 1121
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast &gt;TAbort- SERR-
	Kernel driver in use: <strong>iwlagn</strong>
	Kernel modules: iwlagn
</pre>
<p>To get driver information type:<br />
<code>modinfo iwlagn</code><br />
Sample outputs:</p>
<pre>filename:       /lib/modules/2.6.32-23-generic-pae/kernel/drivers/net/wireless/iwlwifi/iwlagn.ko
alias:          iwl4965
license:        GPL
author:         Copyright(c) 2003-2009 Intel Corporation
version:        1.3.27k
description:    Intel(R) Wireless WiFi Link AGN driver for Linux
firmware:       iwlwifi-4965-2.ucode
firmware:       iwlwifi-5150-2.ucode
firmware:       iwlwifi-5000-2.ucode
firmware:       iwlwifi-6050-4.ucode
firmware:       iwlwifi-6000-4.ucode
srcversion:     BB501FCC68D0C8213107D3B
alias:          pci:v00008086d00000084sv*sd*bc*sc*i*
alias:          pci:v00008086d00000083sv*sd*bc*sc*i*
alias:          pci:v00008086d00000089sv*sd*bc*sc*i*
alias:          pci:v00008086d00000088sv*sd*bc*sc*i*
alias:          pci:v00008086d00000087sv*sd*bc*sc*i*
alias:          pci:v00008086d00000086sv*sd*bc*sc*i*
alias:          pci:v00008086d00004239sv*sd*bc*sc*i*
alias:          pci:v00008086d00004238sv*sd*bc*sc*i*
alias:          pci:v00008086d0000422Csv*sd*bc*sc*i*
alias:          pci:v00008086d0000422Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000008Esv*sd*bc*sc*i*
alias:          pci:v00008086d0000008Dsv*sd*bc*sc*i*
alias:          pci:v00008086d0000423Dsv*sd*bc*sc*i*
alias:          pci:v00008086d0000423Csv*sd*bc*sc*i*
alias:          pci:v00008086d0000423Bsv*sd00001011bc*sc*i*
alias:          pci:v00008086d0000423Asv*sd00001021bc*sc*i*
alias:          pci:v00008086d0000423Asv*sd00001001bc*sc*i*
alias:          pci:v00008086d00004237sv*sd*bc*sc*i*
alias:          pci:v00008086d00004236sv*sd*bc*sc*i*
alias:          pci:v00008086d00004235sv*sd*bc*sc*i*
alias:          pci:v00008086d00004232sv*sd*bc*sc*i*
alias:          pci:v00008086d00004237sv*sd00001216bc*sc*i*
alias:          pci:v00008086d00004232sv*sd00001326bc*sc*i*
alias:          pci:v00008086d00004232sv*sd00001306bc*sc*i*
alias:          pci:v00008086d00004232sv*sd00001206bc*sc*i*
alias:          pci:v00008086d00004232sv*sd00001305bc*sc*i*
alias:          pci:v00008086d00004232sv*sd00001205bc*sc*i*
alias:          pci:v00008086d00004230sv*sd*bc*sc*i*
alias:          pci:v00008086d00004229sv*sd*bc*sc*i*
depends:        iwlcore,mac80211,cfg80211
vermagic:       2.6.32-23-generic-pae SMP mod_unload modversions 586TSC
parm:           swcrypto50:using software crypto engine (default 0 [hardware])
 (bool)
parm:           queues_num50:number of hw queues in 50xx series (int)
parm:           11n_disable50:disable 50XX 11n functionality (int)
parm:           amsdu_size_8K50:enable 8K amsdu size in 50XX series (int)
parm:           fw_restart50:restart firmware in case of error (int)
parm:           antenna:select antenna (1=Main, 2=Aux, default 0 [both]) (int)
parm:           swcrypto:using crypto in software (default 0 [hardware]) (int)
parm:           disable_hw_scan:disable hardware scanning (default 0) (int)
parm:           queues_num:number of hw queues. (int)
parm:           11n_disable:disable 11n functionality (int)
parm:           amsdu_size_8K:enable 8K amsdu size (int)
parm:           fw_restart4965:restart firmware in case of error (int)
</pre>
<p>Finally, you can run the following to get info about vendor &amp; product code:<br />
<code>lspci -n -s 0c:00.0 </code><br />
Sample outputs:</p>
<pre>0c:00.0 0280: 8086:4235</pre>
<p>Where,</p>
<ul>
<li>0280 &#8211;  Network controller:</li>
<li>8086:4235 &#8211; Intel Corporation Ultimate N WiFi Link 5300</li>
</ul>
<p>Or the all in one following option:<br />
<code>$ lspci -nn -s 0c:00.0 </code><br />
Sample outputs:</p>
<pre>0c:00.0 Network controller [0280]: Intel Corporation Ultimate N WiFi Link 5300 [8086:</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/566-linux-find-wireless-driver-chipset-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: Setup SSH To Tunnel VNC Traffic Though Internet</title>
		<link>http://www.doyourself.org/linux/560-linux-setup-ssh-to-tunnel-vnc-traffic-though-internet/</link>
		<comments>http://www.doyourself.org/linux/560-linux-setup-ssh-to-tunnel-vnc-traffic-though-internet/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:11:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=560</guid>
		<description><![CDATA[have UNIX workstation and Linux server at work and Ubuntu desktop at home. It is recommended that I use ssh tunnel the VNC protocol for secure communication. How do I access my UNIX workstation desktop here at home over the Internet using ssh? VNC can be accessed over the Internet using ssh protocol. This will [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>have UNIX workstation and Linux server at work and Ubuntu desktop at  home. It is recommended that I use ssh tunnel the VNC protocol for  secure communication. How do I access my UNIX workstation desktop here  at home over the Internet using ssh?</p>
<p>VNC can be accessed over the Internet using ssh protocol. This will improve security as traffic will be encrypted.</p>
<h2>Sample Setup</h2>
<pre>                                       pc22.nixcraft.in
 +----------------+                   +-----------------+
 | Laptop @ Home  |---&gt; Internet ---&gt; | UNIX PC @ Work  |
 +----------------+                   +-----------------+
                                       vncserver port 5901
OR

 +----------------+                   +-----------------+
 | Laptop @ Home  |---&gt; Internet ---&gt; | Router/firewall |
 +----------------+                   | port forwarding |
                                      +-----------------+
                                            | fw.nixcraft.in ssh/tcp22
                                            |
                                          ///\\\
                                          //   \\
                                          /      \
                                       +-----------------+
                                       | UNIX/Linux /OS X|
                                       | at work         |
                                       +-----------------+
                                       pc22.nixcraft.in
                                       vncserver @ port 5901
</pre>
<p>Your work pc may be directly connected to the Internet. Otherwise  most offices have a router and firewall installed. You need to make sure  your firewall allows port forwarding for TCP port 22 to your UNIX / OS X  /  workstation or server called pc22.nixcraft.in.  It works as follows:</p>
<pre> +------------+
 | SSH Client |-------&gt; Internet ssh connection with encryption
 | with       |                         |
 | vncviewer  |                         |
 +------------+                         |
                                       \|/
                             +------------------------+
                             | SSH server at port 22  |
                             | Vncserver at port 5501 |
                             +------------------------+
</pre>
<p>You connect from your local ssh client (localhost) to your ssh server  (pc22.nixcraft.in) installed at your work UNIX pc with port forwarding  at router / firewall level. I&#8217;m assuming that port forwarding is  correctly configured at your office. Now, open the terminal and type the  following command:</p>
<pre>ssh  -N -f -L 5000:localhost:5901 vivek@pc22.nixcraft.i</pre>
<p>The above command will start an ssh connection to pc22.nixcraft.in  and also listen on port 5000 on localhost and forward vnc connection to  port 5901 on pc22.nixcraft.in. Usaully local and remote port numbers are  same to avoid confusion:</p>
<pre>ssh  -N -f -L 5901:localhost:5901 vivek@pc22.nixcraft.i</pre>
<p>Now, you can use vncviewer at your home as follows:<br />
<code>vncviewer localhost:5901</code><br />
You can also use GUI tool and set VNC server location to  localhost:5901</p>
<div id="attachment_8385"><a rel="attachment wp-att-8385" href="http://www.doyourself.org/?attachment_id=8385"><img title="UNIX: Setup ssh to tunnel VNC traffic over the Internet" src="http://files.cyberciti.biz/uploads/faq/2010/07/vnc-ssh-linux-vncviewer-client.png" alt="Fig.01: Setup ssh to tunnel VNC traffic over the Internet" width="457" height="410" /></a>Fig.01: Setup ssh to tunnel VNC traffic over the Internet</p>
</div>
<p>Once connected you will get desktop login windows or last session window as follows:</p>
<div id="attachment_8386"><a rel="attachment wp-att-8386" href="http://www.doyourself.org/?attachment_id=8386"><img title="Using VNC with more secure SSH tunnel" src="http://files.cyberciti.biz/uploads/faq/2010/07/Linux-Vnc-Remote-Desktop-Viewer.png" alt="Fig.02: VNC in action and more secure using SSH" width="599" height="430" /></a>Fig.02: VNC in action and more secure using SSH</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/560-linux-setup-ssh-to-tunnel-vnc-traffic-though-internet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search a drive for large files in Linux</title>
		<link>http://www.doyourself.org/linux/556-search-a-drive-for-large-files-in-linux/</link>
		<comments>http://www.doyourself.org/linux/556-search-a-drive-for-large-files-in-linux/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 08:29:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[a]]></category>
		<category><![CDATA[drive]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[in]]></category>
		<category><![CDATA[large]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=556</guid>
		<description><![CDATA[Q. How do I find out all large files in a directory? A. There is no single command that can be used to list all large files. But, with the help of find command and shell pipes, you can easily list all large files. Linux List All Large Files To finds all files over 50,000KB [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><span>Q. </span>How do I find out all large files in a directory?<br />
<span></span><br />
<span>A.</span> There is no single command that can be used to list all large files. But, with the help of <a href="http://www.cyberciti.biz/tips/tag/find-command">find command</a> and shell pipes, you can easily list all large files.</p>
<h2>Linux List All Large Files</h2>
<p>To finds all files over 50,000KB (50MB+) in size and display their names, along with size, use following syntax:</p>
<h3>Syntax for <span>RedHat / CentOS / Fedora</span> Linux</h3>
<p><code>find {/path/to/directory/} -type f -size +{size-in-kb}k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }' </code><br />
Search or find big files Linux (50MB) in current directory, enter:<br />
<code>$ find . -type f -size +50000k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }' </code><br />
Search in my /var/log  directory:<br />
<code># find /var/log -type f -size +100000k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }' </code></p>
<h3>Syntax for <span>Debian / Ubuntu</span> Linux</h3>
<p><code>find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} ; | awk '{ print $8 ": " $5 }' </code><br />
Search in current directory:<br />
<code>$ find . -type f -size +10000k -exec ls -lh {} ; | awk '{ print $8 ": " $5 }'</code><br />
Sample output:</p>
<pre>./.kde/share/apps/akregator/Archive/http___blogs.msdn.com_MainFeed.aspx?Type=AllBlogs.mk4: 91M./out/out.tar.gz: 828M./.cache/tracker/file-meta.db: 101M./ubuntu-8.04-desktop-i386.iso: 700M./vivek/out/mp3/Eric: 230M</pre>
<p>Above commands will lists files that are are greater than 10,000<br />
kilobytes in size. To list all files in your home directory tree less<br />
than 500 bytes in size, type:<br />
<code>$ find $HOME -size -500b </code><br />
OR<br />
<code>$ find ~ -size -500b </code></p>
<p>To list all files on the system whose size is exactly 20 512-byte blocks, type:<br />
<code># find / -size 20</code></p>
<h2>Perl hack: To display large files</h2>
<p>Jonathan has contributed following perl code print out stars and the<br />
length of the stars show the usage of each folder / file from smallest<br />
to largest on the box:</p>
<pre> du -k | <a href="http://perldoc.perl.org/functions/sort.html"><span>sort</span></a> -n | perl -<span>ne</span> <span>'if ( /^(d+)s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf  ("%6.1ft%st%25s  %sn",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'</span></pre>
<h3>ls command: finding the largest files in a directory</h3>
<p>You can also use ls command:<br />
<code>$ ls -lS<br />
$ ls -lS | less<br />
$ ls -lS | head +10</code></p>
<h3>ls command: finding the smallest files in a directory</h3>
<p>Use ls command as follows:<br />
<code>$ ls -lSr<br />
$ ls -lSr | less<br />
$ ls -lSr | tail -10</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/556-search-a-drive-for-large-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find r57 and c99 Shells Hidden Inside PHP and TXT Files</title>
		<link>http://www.doyourself.org/linux/555-find-r57-and-c99-shells-hidden-inside-php-and-txt-files/</link>
		<comments>http://www.doyourself.org/linux/555-find-r57-and-c99-shells-hidden-inside-php-and-txt-files/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 06:09:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[and]]></category>
		<category><![CDATA[c99]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[Hidden]]></category>
		<category><![CDATA[Inside]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[r57]]></category>
		<category><![CDATA[Shells]]></category>
		<category><![CDATA[TXT]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=555</guid>
		<description><![CDATA[When malicious intruders compromise a web server, thereâ€™s an excellent chance a famous Russian PHP script, r57shell, will follow. The r57shell PHP script gives the intruder a number of capabilities, including, but not limited to: downloading files, uploading files, creating backdoors, setting up a spam relay, forging email, bouncing a connection to decrease the risk [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When malicious intruders compromise a web server, thereâ€™s an<br />
excellent chance a famous Russian PHP script, r57shell, will follow.<br />
The r57shell PHP script gives the intruder a number of capabilities,<br />
including, but not limited to: downloading files, uploading files,<br />
creating backdoors, setting up a spam relay, forging email, bouncing a<br />
connection to decrease the risk of being caught, and even taking<br />
control of SQL databases. All these functions become readily available<br />
through an easy to use web interface, but now you can fight back.</p>
<p><span></span></p>
<p>A Turkish member on a forum I participate in released this nifty little bash command, but first, make sure you execute <em>updatedb</em> so <em>find</em> has an up to date image to search:</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">find /var/www/  -name "*".php  -type f -print0  | xargs -0 grep r57 | uniq -c  | sort -u  | cut -d":" -f1  | awk '{print "rm -rf " $2}' | uniq</pre>
<p>You can also search regular text (.txt) files:</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">find /var/www/  -name "*".txt  -type f -print0  | xargs -0 grep r57 | uniq -c  | sort -u  | cut -d":" -f1  | awk '{print "rm -rf " $2}' | uniq</pre>
<p>Or even cleverly disguised GIF image files:</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">find /var/www/  -name "*".gif  -type f -print0  | xargs -0 grep r57 | uniq -c  | sort -u  | cut -d":" -f1  | awk '{print "rm -rf " $2}' | uniq</pre>
<p>The command might appear scary, or even malicious to an inexperienced Linux admin, but hereâ€™s the break down.</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">find /var/www/</pre>
<p><em>find</em> is a must know command when dealing with Linux. <em>Find</em> is whatâ€™s used to perform command line file searches. The path <em>/var/www</em> is the directory <em>find</em> will search, in addition to all directories contained within <em>www</em>, but nothing above. For example, <em>/var/mail</em> is not searched. If your publicly accessible files are not contained in <em>/var/www</em>, then youâ€™ll obviously need to replace <em>/var/www</em> with the correct path.</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">-name "*".php  -type f -print0</pre>
<p>This portion of the command tells <em>find</em> to search file names (not directories) ending in .php. Anything else is ignored.</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">| xargs -0 grep r57</pre>
<p>The pipe symbol ( | ) tells Linux to take the results of the first<br />
command (the PHP files we searched for), and pass them along to the<br />
second command, <em>xargs</em>. At this point, all located files are<br />
searched for any mention of r57, not just the file names, but the<br />
actual content within the files.</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">| uniq -c  | sort -u</pre>
<p><em>uniq</em> will prevent duplicate results from displaying. The<br />
command is smart enough to know when multiple instances are found in a<br />
single file, resulting in a single mention instead of potentially<br />
hundreds, flooding your console with repeated messages. The <em>-c</em> parameter tells <em>uniq</em> to count the number of consecutive lines that were combined. <em>sort</em> will take the unordered results, and display them in some type of orderly fashion.</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">| cut -d":" -f1</pre>
<p><em>cut</em> will prevent the line of code that contains r57 from<br />
showing up in the results. The output is just a simple mention of the<br />
filename or names, and how many occurrences. Thereâ€™s no need to display<br />
the actual code if your intentions are to remove the malicious files.</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">| awk '{print "rm -rf " $2}'</pre>
<p><em>awk</em>, a programming language in itself, is a very powerful command with many beneficial uses. In this command, <em>awk</em> is instructed to print <em>rm -rf</em> with the file path and file name appended. Hereâ€™s an example output:</p>
<blockquote><p><em>rm -rf /var/www/users/domain.com/images/uploads/r57shell.php</em></p>
</blockquote>
<p><em>rm -rf</em> is used to delete files without asking questions. The, â€œ<em>are you sure you want to delete â€¦</em>â€ is skipped, so be careful when using the <em>-rf</em> switch, itâ€™s very destructive if used without care. Notice the <em>print</em><br />
portion &#8211; this means the command is only printed, not carried out. Once<br />
youâ€™ve confirmed all the found files are malicious, you can easily dumb<br />
the results into a file, make the file executable, and delete the<br />
plague in one shot instead of manually deleting individual files one by<br />
one.</p>
<p>Another popular tool is the c99shell, which I also recommend searching for. Just change three characters:</p>
<pre style="border: 1px inset;margin: 0px;padding: 6px;overflow: auto;width: 550px;height: 40px;text-align: left">find /var/www/  -name "*".php  -type f -print0  | xargs -0 grep c99 | uniq -c  | sort -u  | cut -d":" -f1  | awk '{print "rm -rf " $2}' | uniq</pre>
<p>If youâ€™re interested in seeing an example of the c99shell interface, hereâ€™s a rooted site:</p>
<p>http://www.iett.gov.tr/en/kitap/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/555-find-r57-and-c99-shells-hidden-inside-php-and-txt-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crontab every five minutes</title>
		<link>http://www.doyourself.org/linux/554-crontab-every-five-minutes/</link>
		<comments>http://www.doyourself.org/linux/554-crontab-every-five-minutes/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 22:31:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Crontab:]]></category>
		<category><![CDATA[Every]]></category>
		<category><![CDATA[five]]></category>
		<category><![CDATA[minutes]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=554</guid>
		<description><![CDATA[Well, i want to schedules to run one of my file every 5 minutes. Then what would be the best choose. Yes, CRON. I can schedule my cron to run that file every five minutes to execute my desired results. Thats why i want to make a note on this regards. To edit the crontab [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><em>Well, i want to schedules to run one of my file every 5 minutes. Then what would be the best choose. Yes, CRON.<br />
I can schedule my cron to run that file every five minutes to execute<br />
my desired results. Thats why i want to make a note on this regards.</em></p>
<p>To <strong>edit</strong> the crontab i use the following command:</p>
<blockquote><p>$ crontab -e</p>
</blockquote>
<p>To<strong> list</strong> my currnet crontab</p>
<blockquote><p>$ crontab -l</p>
</blockquote>
<p>The following is the format entries in a crontab must be. Note all lines starting with # are ignored, comments.</p>
<p>So in terminal print â€˜Helloâ€™ every 5 minutes.. </p>
<div class="code">
<pre><span class="comment"># MIN   HOUR   MDAY  MON  DOW   COMMAND </span>   */5     *      *     *    *    echo 'Hello' </pre>
</div>
<blockquote><pre>MIN	Minute 	 0-60HOUR	Hour [24-hour clock] 	0-23MDAY	Day of Month 	1-31MON	Month 	1-12 OR jan,feb,mar,apr ...DOW	Day of Week 	0-6 ORsun,mon,tue,wed,thu,fri,satCOMMAND	Command to be run 	Any valid command-line</pre>
</blockquote>
<p>Examples</p>
<p>Here are a few examples, to see what some entries look like.</p>
<blockquote><p>#Run command at 7:00am each weekday [mon-fri]<br />
00 07 * * 1-5 mail_pager.script â€˜Wake Upâ€™</p>
</blockquote>
<blockquote><p>#Run command on 1st of each month, at 5:30pm<br />
30 17 1 * * pay_rent.script</p>
</blockquote>
<blockquote><p>#Run command at 8:00am,10:00am and 2:00pm every day<br />
00 8,10,14 * * * do_something.script</p>
</blockquote>
<blockquote><p>#Run command every 5 minutes during market hours<br />
*/5 6-13 * * mon-fri get_stock_quote.script</p>
</blockquote>
<blockquote><p>#Run command every 3-hours while awake<br />
0 7-23/3 * * * drink_water.script</p>
</blockquote>
<p><strong>Special Characters in Crontab</strong></p>
<p>You can use an </p>
<blockquote><p>asterisk</p>
</blockquote>
<p> in any category to mean for every item, such as every day or every month.</p>
<p>You can use commas in any category to specify multiple values. For example: mon,wed,fri</p>
<p>You can use dashes to specify ranges. For example: mon-fri, or 9-17</p>
<p>You can use forward slash to specify a repeating range. For example: */5 for every five minutes, hours, days<br />
Special Entries</p>
<p>There are several special entries, some which are just shortcuts, that you can use instead of specifying the full cron entry.</p>
<p>The most useful of these is probably @reboot which allows you to run<br />
a command each time the computer gets reboot. This could be useful if<br />
you want to start up a server or daemon under a particular user, or if<br />
you do not have access to the rc.d/init.d files.</p>
<p><strong>Example Usage:</strong></p>
<blockquote><p># restart freevo servers<br />
@reboot freevo webserver start<br />
@reboot freevo recordserver start</p>
</blockquote>
<p><strong>The complete list:</strong></p>
<table style="margin-left: 25px" cellpadding="4" cellspacing="1">
<tbody>
<tr bgcolor="#eeeeee">
<th>Entry</th>
<th>Description</th>
<th>Equivalent To</th>
</tr>
<tr>
<td>@reboot      </td>
<td>  Run once, at startup. </td>
<td>None</td>
</tr>
<tr>
<td>@yearly      </td>
<td>  Run once a year   </td>
<td>0 0 1 1 * </td>
</tr>
<tr>
<td>@annually    </td>
<td>  (same as @yearly) </td>
<td>0 0 1 1 * </td>
</tr>
<tr>
<td>@monthly     </td>
<td>  Run once a month  </td>
<td>0 0 1 * * </td>
</tr>
<tr>
<td>@weekly      </td>
<td>  Run once a week   </td>
<td>0 0 * * 0 </td>
</tr>
<tr>
<td>@daily       </td>
<td>  Run once a day    </td>
<td>0 0 * * * </td>
</tr>
<tr>
<td>@midnight    </td>
<td>  (same as @daily)  </td>
<td>0 0 * * * </td>
</tr>
<tr>
<td>@hourly      </td>
<td>  Run once an hour  </td>
<td>0 * * * * </td>
</tr>
</tbody>
</table>
<p><strong>Miscelleanous Issues</strong></p>
<p><strong>Script Output</strong><br />
If there is any output from your script or command it will be sent to<br />
that userâ€™s e-mail account, on that box. Using the default mailer which<br />
must be setup properly.</p>
<p>You can set the variable MAILTO in the crontab to specify a separate e-mail address to use. For example:<br />
MAILTO=â€admin@mydomain.comâ€</p>
<p>Redirect Output to /dev/null<br />
You can redirect the output from a cron script to /dev/null which just<br />
throws it away. By redirecting to /dev/null you will not receive<br />
anything from the script, even if it is throwing errors.<br />
* * * * * /script/every_minute.pl &gt; /dev/null 2&gt;&amp;1</p>
<p><strong>Missed Schedule Time</strong><br />
Cron does not run a command if it was missed. Your computer must be<br />
running for cron to run the job at the time it is scheduled. For<br />
example, if you have a 1:00am scheduled job and your computer was off<br />
at that time, it will not run the missed job in the morning when you<br />
turn it on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/554-crontab-every-five-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Crontab: 15 Awesome Cron Job Examples</title>
		<link>http://www.doyourself.org/linux/553-linux-crontab-15-awesome-cron-job-examples/</link>
		<comments>http://www.doyourself.org/linux/553-linux-crontab-15-awesome-cron-job-examples/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 22:26:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[15]]></category>
		<category><![CDATA[Awesome:]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Crontab:]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Job]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=553</guid>
		<description><![CDATA[Linux Crontab Guide An experienced Linux sysadmin knows the importance of running the routine maintenance jobs in the background automatically. Linux Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis. This article is part of the on-going series. In this article, let [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Linux Crontab Guide<br />
An experienced Linux sysadmin knows the importance of running the routine maintenance jobs in the background automatically.</p>
<p>Linux Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis.</p>
<p>This article is part of the on-going series.  In this article, let us review 15 awesome examples of crontab job scheduling.</p>
<h3>Linux Crontab Format</h3>
<pre>MIN HOUR DOM MON DOW CMD</pre>
<p>Table: Crontab Fields and Allowed Ranges (Linux Crontab Syntax)<br />
Field<br />
Description<br />
Allowed Value</p>
<table summary="Cron fields table" align="center" border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
</tr>
<tr>
<td>MIN</td>
<td>Minute field</td>
<td>0 to 59</td>
</tr>
<tr>
<td>HOUR</td>
<td>Hour field</td>
<td>0 to 23</td>
</tr>
<tr>
<td>DOM</td>
<td>Day of Month</td>
<td>1-31</td>
</tr>
<tr>
<td>MON</td>
<td>Month field</td>
<td>1-12</td>
</tr>
<tr>
<td>DOW</td>
<td>Day Of Week</td>
<td>0-6</td>
</tr>
<tr>
<td>CMD</td>
<td>Command</td>
<td>Any command to be executed.</td>
</tr>
</tbody>
</table>
<h3>1. Scheduling a Job For a Specific Time Every Day</h3>
<p>The basic usage of cron is to execute a job in a specific time as<br />
shown below. This will execute the Full backup shell script<br />
(full-backup) on 10th June 08:30 AM.</p>
<p>Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.</p>
<pre>30 08 10 06 * /home/ramesh/full-backup</pre>
<ul>
<li>30 â€“ 30th Minute</li>
<li>08 â€“ 08 AM</li>
<li>10 â€“ 10th Day</li>
<li>06 â€“ 6th Month (June)</li>
<li>* â€“ Every day of the week</li>
</ul>
<h3>2. Schedule a Job For More Than One Instance (e.g. Twice a Day)</h3>
<p>The following script take a incremental backup twice a day every day.</p>
<p>This example executes the specified incremental backup shell script<br />
(incremental-backup) at 11:00 and 16:00 on every day. The comma<br />
separated value in a field specifies that the command needs to be<br />
executed in all the mentioned time.</p>
<pre>00 11,16 * * * /home/ramesh/bin/incremental-backup</pre>
<ul>
<li>00 â€“ 0th Minute (Top of the hour)</li>
<li>11,16 â€“ 11 AM and 4 PM</li>
<li>* â€“ Every day</li>
<li>* â€“ Every month</li>
<li>* â€“ Every day of the week</li>
</ul>
<h3>3. Schedule a Job for Specific Range of Time (e.g. Only on Weekdays)</h3>
<p>If you wanted a job to be scheduled for every hour with in a specific range of time then use the following.</p>
<div style="margin-left: 2px;margin-top: 10px;margin-bottom: 10px">
<p>        <!-- AD BLOCK --></p>
<p>        <!-- END AD BLOCK --></p></div>
<h4>Cron Job everyday during working hours</h4>
<p>This example checks the status of the database everyday (including weekends) during the working hours 9 a.m â€“ 6 p.m</p>
<pre>00 09-18 * * * /home/ramesh/bin/check-db-status</pre>
<ul>
<li>00 â€“ 0th Minute (Top of the hour)</li>
<li>09-18 â€“ 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm</li>
<li>* â€“ Every day</li>
<li>* â€“ Every month</li>
<li>* â€“ Every day of the week</li>
</ul>
<h4>Cron Job every weekday during working hours</h4>
<p>This example checks the status of the database every weekday (i.e excluding Sat and Sun) during the working hours 9 a.m â€“ 6 p.m.</p>
<pre>00 09-18 * * 1-5 /home/ramesh/bin/check-db-status</pre>
<ul>
<li>00 â€“ 0th Minute (Top of the hour)</li>
<li>09-18 â€“ 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm</li>
<li>* â€“ Every day</li>
<li>* â€“ Every month</li>
<li>1-5 -Mon, Tue, Wed, Thu and Fri (Every Weekday)</li>
</ul>
<h3>4. How to View Crontab Entries?</h3>
<h4>View Current Logged-In Userâ€™s Crontab entries</h4>
<p>To view your crontab entries type crontab -l from your unix account as shown below.</p>
<pre>ramesh@dev-db$ crontab -l@yearly /home/ramesh/annual-maintenance*/10 * * * * /home/ramesh/check-disk-space

[Note: This displays crontab of the current logged in user]</pre>
<h4>View Root Crontab entries</h4>
<p>Login as root user (su â€“ root) and do crontab -l as shown below.</p>
<pre>root@dev-db# crontab -lno crontab for root</pre>
<h4>Crontab HowTo: View Other Linux Userâ€™s Crontabs entries</h4>
<p>To view crontab entries of other Linux users, login to root and use -u {username} -l as shown below.</p>
<pre>root@dev-db# crontab -u sathiya -l@monthly /home/sathiya/monthly-backup00 09-18 * * * /home/sathiya/check-db-status</pre>
<h3>5. How to Edit Crontab Entries?</h3>
<h4>Edit Current Logged-In Userâ€™s Crontab entries</h4>
<p>To edit a crontab entries, use crontab -e as shown below. By default this will edit the current logged-in users crontab.</p>
<pre>ramesh@dev-db$ crontab -e@yearly /home/ramesh/centos/bin/annual-maintenance*/10 * * * * /home/ramesh/debian/bin/check-disk-space~"/tmp/crontab.XXXXyjWkHw" 2L, 83C

[Note: This will open the crontab file in Vim editor for editing.Please note cron created a temporary /tmp/crontab.XX... ]</pre>
<p>When you save the above temporary file with :wq, it will save the<br />
crontab and display the following message indicating the crontab is<br />
successfully modified.</p>
<pre>~"crontab.XXXXyjWkHw" 2L, 83C writtencrontab: installing new crontab</pre>
<h4>Edit Root Crontab entries</h4>
<p>Login as root user (su â€“ root) and do crontab -e as shown below.</p>
<pre>root@dev-db# crontab -e</pre>
<h4>Edit Other Linux Userâ€™s Crontab File entries</h4>
<p>To edit crontab entries of other Linux users, login to root and use -u {username} -e as shown below.</p>
<pre>root@dev-db# crontab -u sathiya -e@monthly /home/sathiya/fedora/bin/monthly-backup00 09-18 * * * /home/sathiya/ubuntu/bin/check-db-status~~~"/tmp/crontab.XXXXyjWkHw" 2L, 83C</pre>
<h3>6. Schedule a Job for Every Minute Using Cron.</h3>
<p>Ideally you may not have a requirement to schedule a job every<br />
minute. But understanding this example will will help you understand<br />
the other examples mentioned below in this article.</p>
<pre>* * * * * CMD</pre>
<p>The * means all the possible unit â€” i.e every minute of every hour<br />
through out the year. More than using this * directly, you will find it<br />
very useful in the following cases.</p>
<ul>
<li>When you specify */5 in minute field means every 5 minutes.</li>
<li>When you specify 0-10/2 in minute field mean every 2 minutes in the first 10 minute.</li>
<li>Thus the above convention can be used for all the other 4 fields.</li>
</ul>
<h3>7. Schedule a Background Cron Job For Every 10 Minutes.</h3>
<p>Use the following, if you want to check the disk space every 10 minutes.</p>
<pre>*/10 * * * * /home/ramesh/check-disk-space</pre>
<p>It executes the specified command check-disk-space every 10 minutes<br />
through out the year. But you may have a requirement of executing the<br />
command only during office hours or vice versa. The above examples<br />
shows how to do those things.</p>
<p>Instead of specifying values in the 5 fields, we can specify it using a single keyword as mentioned below.</p>
<p>There are special cases in which instead of the above 5 fields you can<br />
use @ followed by a keyword â€” such as reboot, midnight, yearly, hourly.</p>
<p>Table: Cron special keywords and its meaning<br />
Keyword<br />
Equivalent</p>
<table summary="Cron special keywords" align="center" border="1" cellpadding="0" cellspacing="0" width="173">
<tbody>
<tr>
</tr>
<tr>
<td>@yearly</td>
<td>0 0 1 1 *</td>
</tr>
<tr>
<td>@daily</td>
<td>0 0 * * *</td>
</tr>
<tr>
<td>@hourly</td>
<td>0 * * * *</td>
</tr>
<tr>
<td>@reboot</td>
<td>Run at startup.</td>
</tr>
</tbody>
</table>
<h3>8. Schedule a Job For First Minute of Every Year using @yearly</h3>
<p>If you want a job to be executed on the first minute of every year, then you can use the @yearly cron keyword as shown below.</p>
<p>This will execute the system annual maintenance using annual-maintenance shell script at 00:00 on Jan 1st for every year.</p>
<pre>@yearly /home/ramesh/red-hat/bin/annual-maintenance</pre>
<h3>9. Schedule a Cron Job Beginning of Every Month using @monthly</h3>
<p>It is as similar as the @yearly as above. But executes the command monthly once using @monthly cron keyword.</p>
<p>This will execute the shell script tape-backup at 00:00 on 1st of every month.</p>
<pre>@monthly /home/ramesh/suse/bin/tape-backup</pre>
<h3>10. Schedule a Background Job Every Day using @daily</h3>
<p>Using the @daily cron keyword, this will do a daily log file cleanup using cleanup-logs shell scriptat 00:00 on every day.</p>
<pre>@daily /home/ramesh/arch-linux/bin/cleanup-logs "day started"</pre>
<h3>11. How to Execute a Linux Command After Every Reboot using @reboot?</h3>
<p>Using the @reboot cron keyword, this will execute the specified command once after the machine got booted every time.</p>
<pre>@reboot CMD</pre>
<h3>12. How to Disable/Redirect the Crontab Mail Output using MAIL keyword?</h3>
<p>By default crontab sends the job output to the user who scheduled<br />
the job. If you want to redirect the output to a specific user, add or<br />
update the MAIL variable in the crontab as shown below.</p>
<pre>ramesh@dev-db$ crontab -lMAIL="ramesh"

@yearly /home/ramesh/annual-maintenance*/10 * * * * /home/ramesh/check-disk-space

[Note: Crontab of the current logged in user with MAIL variable]</pre>
<p>
If you wanted the mail not to be sent to anywhere, i.e to stop the<br />
crontab output to be emailed, add or update the MAIL variable in the<br />
crontab as shown below.</p>
<pre>MAIL=""</pre>
<h3>13. How to Execute a Linux Cron Jobs Every Second Using Crontab.</h3>
<p>You cannot schedule a every-second cronjob. Because in cron the<br />
minimum unit you can specify is minute. In a typical scenario, there is<br />
no reason for most of us to run any job every second in the system.</p>
<div>
</div>
<h3>14. Specify PATH Variable in the Crontab</h3>
<p>All the above examples we specified absolute path of the Linux command or the shell-script that needs to be executed.</p>
<p>For example, instead of specifying /home/ramesh/tape-backup, if you<br />
want to just specify tape-backup, then add the path /home/ramesh to the<br />
PATH variable in the crontab as shown below.</p>
<pre>ramesh@dev-db$ crontab -l

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/home/ramesh

@yearly annual-maintenance*/10 * * * * check-disk-space

[Note: Crontab of the current logged in user with PATH variable]</pre>
<h3>15. Installing Crontab From a Cron File</h3>
<p>Instead of directly editing the crontab file, you can also add all<br />
the entries to a cron-file first. Once you have all thoese entries in<br />
the file, you can upload or install them to the cron as shown below.</p>
<pre>ramesh@dev-db$ crontab -lno crontab for ramesh

$ cat cron-file.txt@yearly /home/ramesh/annual-maintenance*/10 * * * * /home/ramesh/check-disk-space

ramesh@dev-db$ crontab cron-file.txt

ramesh@dev-db$ crontab -l@yearly /home/ramesh/annual-maintenance*/10 * * * * /home/ramesh/check-disk-space</pre>
<p>Note: This will install the cron-file.txt to your crontab, which<br />
will also remove your old cron entries. So, please be careful while<br />
uploading cron entries from a cron-file.txt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/linux/553-linux-crontab-15-awesome-cron-job-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

