<?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>rajaseelan.com &#187; How To</title>
	<atom:link href="http://rajaseelan.com/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://rajaseelan.com</link>
	<description>junk food for the brain ...</description>
	<lastBuildDate>Tue, 28 Jul 2009 16:37:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Generate Files with Random Content and Size in Bash</title>
		<link>http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/</link>
		<comments>http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 16:37:17 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=244</guid>
		<description><![CDATA[Occasionally you need to generate a bunch of random files with random content, usually for testing compression, user quotas or miscellaneous stuff.
Here&#8217;s one way, using the bash shell and a few handy linux utilities.

The bash $RANDOM function. It generates a random number between 0 &#8211; 32767.
Linux DD utility, to output files.
/dev/(h&#124;s)da, your hard drive in [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally you need to generate a bunch of random files with random content, usually for testing compression, user quotas or miscellaneous stuff.</p>
<p>Here&#8217;s one way, using the bash shell and a few handy linux utilities.</p>
<ol>
<li>The bash <code>$RANDOM</code> function. It generates a random number between 0 &#8211; 32767.</li>
<li>Linux <code>DD</code> utility, to output files.</li>
<li><code>/dev/(h|s)da</code>, your hard drive in linux.</li>
<li>All wrapped in a bash <code>while</code> loop.</li>
</ol>
<p>So lets start. First define a bash variable with the number of files we wish to create, lets say 10.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #007800;">no_of_files</span>=<span style="color: #000000;">10</span></pre>
</div>
</div>
<p>Then we&#8217;ll assign the a bash variable for the counter.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #007800;">counter</span>=<span style="color: #000000;">1</span></pre>
</div>
</div>
<p>As for the <code>dd</code> command, this creates a file with random content from your hard disk. (Mine&#8217;s <code>/dev/sda</code>)  which is 1KB in size. The <code>count</code> switch tells dd to repeat  1024 bytes 1 time, thus the 1Kb file size. <code>skip</code> makes <code>dd</code> skip an <em>x</em> amount of bytes before reading further. Since this requires raw access to your hard drive, you&#8217;ll have to run this as root unfortunately. <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">dd bs=1024 count=1 skip=0 if=/dev/sda of=random-file</pre>
</div>
</div>
<p>So now imagine, if we let bash assign the count and skip random numbers, we get random file contents. (Light bulbs flashing eh?)</p>
<p>Of course, all of it will be written to a single file called random-file in my case. To add just slight amount of variety, we can add the counter variable that we will use in our <code>while</code> loop as an extension. The <code>dd</code> command will now be:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">count</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$RANDOM</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">skip</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$RANDOM</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #007800;">of</span>=random-file.<span style="color: #007800;">$counter</span></pre>
</div>
</div>
<p>Finally, we will wrap it up in a bash while loop like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #007800;">no_of_files</span>=<span style="color: #000000;">10</span>;
<span style="color: #007800;">counter</span>=<span style="color: #000000;">1</span>;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$counter</span> <span style="color: #660033;">-le</span> <span style="color: #007800;">$no_of_files</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;
 <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> Creating <span style="color: #c20cb9; font-weight: bold;">file</span> no <span style="color: #007800;">$counter</span>;
  <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">count</span>=<span style="color: #007800;">$RANDOM</span> <span style="color: #007800;">skip</span>=<span style="color: #007800;">$RANDOM</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #007800;">of</span>=random-file.<span style="color: #007800;">$counter</span>;
  <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;counter += 1&quot;</span>;
 <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>When you run it, you will get output like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">Creating file no 1
16614+0 records in
16614+0 records out
17012736 bytes (17 MB) copied, 0.29308 s, 58.0 MB/s
Creating file no 2
14456+0 records in
14456+0 records out
14802944 bytes (15 MB) copied, 0.100101 s, 148 MB/s
.................
Creating file no 10
25224+0 records in
25224+0 records out
25829376 bytes (26 MB) copied, 0.492113 s, 52.5 MB/s</pre>
</div>
</div>
<p>when you do a directory listing, you&#8217;ll see this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[root@atreides rd-test]# ls -lh
total 226M
-rw-r--r-- 1 root root 17M 2009-07-29 00:25 random-file.1
-rw-r--r-- 1 root root 25M 2009-07-29 00:25 random-file.10
-rw-r--r-- 1 root root 15M 2009-07-29 00:25 random-file.2
-rw-r--r-- 1 root root 20M 2009-07-29 00:25 random-file.3
-rw-r--r-- 1 root root 21M 2009-07-29 00:25 random-file.4
-rw-r--r-- 1 root root 30M 2009-07-29 00:25 random-file.5
-rw-r--r-- 1 root root 22M 2009-07-29 00:25 random-file.6
-rw-r--r-- 1 root root 27M 2009-07-29 00:25 random-file.7
-rw-r--r-- 1 root root 25M 2009-07-29 00:25 random-file.8
-rw-r--r-- 1 root root 29M 2009-07-29 00:25 random-file.9</pre>
</div>
</div>
<p>For more info, refer to the $RANDOM function from the <a target="blank" href="http://tldp.org/LDP/abs/html/randomvar.html">Advanced Bash Scripting Guide.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Enable Flash in Google Chrome for Fedora 11 i686</title>
		<link>http://rajaseelan.com/2009/07/27/how-to-enable-flash-in-google-chrome-for-fedora-11-i686/</link>
		<comments>http://rajaseelan.com/2009/07/27/how-to-enable-flash-in-google-chrome-for-fedora-11-i686/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 15:45:41 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fedora 11]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash-plugin]]></category>
		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=240</guid>
		<description><![CDATA[So you&#8217;ve installed the latest development builds of Chromium for Fedora Linux. The only thing lacking is that youtube is not loading. If not, what are you waiting for? Refer to one of my previous posts.
First make sure you install the Adobe yum repository.
As root:-


rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm


Then install the flash plugin.


yum install flash-plugin.i386


The flash plugin [...]]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;ve installed the latest development builds of Chromium for Fedora Linux. The only thing lacking is that youtube is not loading. If not, what are you waiting for? Refer to one of my <a href="http://rajaseelan.com/2009/07/04/how-to-install-google-chrome-in-fedora-10-or-fedora-11/">previous posts</a>.</p>
<p>First make sure you install the Adobe yum repository.</p>
<p>As root:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm</pre>
</div>
</div>
<p>Then install the flash plugin.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">yum install flash-plugin.i386</pre>
</div>
</div>
<p>The flash plugin will be installed in <code>/usr/lib/flash-plugin/libflashplayer.so</code></p>
<p>Chrome plugins are supposed to be located in <code>/usr/lib/chromium-browser/plugins</code>. So lets create a symbolic link, so that whenever your Adobe flash plugin is updated, your Chrome automatically gets the latest version.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">n -sv /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/chromium-browser/plugins/libflashplayer.so</pre>
</div>
</div>
<p>Now start your Chrome browser from the command line, with the <code>--enable-plugins</code> switch. This will enable the flash plugin. </p>
<p>Here&#8217;s a screenshot of me watching a video from youtube on chrome:-</p>
<div id="attachment_241" class="wp-caption aligncenter" style="width: 310px"><a href="http://rajaseelan.com/wp-content/uploads/2009/07/chromium-flash-in-action.png"><img src="http://rajaseelan.com/wp-content/uploads/2009/07/chromium-flash-in-action-300x211.png" alt="Flash Player in Google Chrome for Linux" title="Flash Player in Google Chrome for Linux" width="300" height="211" class="size-medium wp-image-241" /></a>
<p class="wp-caption-text">Flash Player in Google Chrome for Linux</p>
</div>
<p>Say goodbye to geek productivity once this is done <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/27/how-to-enable-flash-in-google-chrome-for-fedora-11-i686/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Configure a Caching-Only Name Server in a Chroot Environment for Fedora 11</title>
		<link>http://rajaseelan.com/2009/07/18/configure-a-caching-only-name-server-in-a-chroot-environment-for-fedora-11/</link>
		<comments>http://rajaseelan.com/2009/07/18/configure-a-caching-only-name-server-in-a-chroot-environment-for-fedora-11/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 12:39:35 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[caching-nameserver]]></category>
		<category><![CDATA[caching-only]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fedora 11]]></category>
		<category><![CDATA[named]]></category>
		<category><![CDATA[nameserver]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=231</guid>
		<description><![CDATA[Having a caching only name-server on your local Machine speeds up your browsing. Here&#8217;s how to set up a slightly more secure caching server using ISC Bind in Fedora 11.

Install bind and bind-chroot packages


# yum install bind bind-chroot



Edit your /etc/sysconfig/named file.


# vim /etc/sysconfig/named


Add the following line:


ROOTDIR=&#34;/var/named/chroot&#34;



Edit your /etc/named.conf file.


# vim /etc/named.conf



Change the following line:


listen-on port [...]]]></description>
			<content:encoded><![CDATA[<p>Having a caching only name-server on your local Machine speeds up your browsing. Here&#8217;s how to set up a slightly more secure caching server using ISC Bind in Fedora 11.</p>
<ol>
<li>Install <code>bind</code> and <code>bind-chroot</code> packages
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># yum install bind bind-chroot</pre>
</div>
</div>
</li>
<li>Edit your <code>/etc/sysconfig/named file.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># vim /etc/sysconfig/named</pre>
</div>
</div>
<p>Add the following line:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">ROOTDIR=&quot;/var/named/chroot&quot;</pre>
</div>
</div>
<p></code></li>
<li>Edit your <code>/etc/named.conf</code> file.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># vim /etc/named.conf</pre>
</div>
</div>
</li>
<li>Change the following line:
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">listen-on port 53 { 127.0.0.1; };</pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">listen-on port 53 { any; };</pre>
</div>
</div>
<p>This allows the bind daemon to listen on all your network IPs, not just your loopback(127.0.0.1) address.</li>
<li>Change this line:
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">allow-query     { localhost; };</pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">allow-query     { 192.168.0.0/24; };</pre>
</div>
</div>
<p>You now allow all the machines in your home LAN to use your DNS server.
</li>
<li>Make sure it starts at boot time.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># chkconfig named on</pre>
</div>
</div>
<p>Restart your DNS server.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># service named restart</pre>
</div>
</div>
</li>
<li>Make sure its listening on the correct ports.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># netstat -ntupl | grep named</pre>
</div>
</div>
<p>In my case, the DNS server IP is 192.168.0.10. So, as seen here, the line <code>udp        0      0 192.168.0.10:53       0.0.0.0:*      2851/named</code> shows it is listening correctly.</li>
<li>Then test your server from another machine in your network. Most probably another linux box or laptop.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># dig @192.168.0.10 google.com</pre>
</div>
</div>
<p>The dig command, with the &#8216;@&#8217; instructs it to get the IP address for google.com from your newly set up server. On my machine, it looked like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[root@atreides ~]# dig @192.168.0.10 google.com
&nbsp;
; &lt; &lt;&gt;&gt; DiG 9.6.1-RedHat-9.6.1-2.fc11 &lt; &lt;&gt;&gt; @192.168.0.10 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt; &lt;- opcode: QUERY, status: NOERROR, id: 6515
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 0
&nbsp;
;; QUESTION SECTION:
;google.com.			IN	A
&nbsp;
;; ANSWER SECTION:
google.com.		300	IN	A	74.125.127.100
google.com.		300	IN	A	74.125.45.100
google.com.		300	IN	A	74.125.67.100
&nbsp;
;; AUTHORITY SECTION:
google.com.		171853	IN	NS	ns3.google.com.
google.com.		171853	IN	NS	ns1.google.com.
google.com.		171853	IN	NS	ns2.google.com.
google.com.		171853	IN	NS	ns4.google.com.
&nbsp;
;; Query time: 82 msec
;; SERVER: 192.168.0.10#53(192.168.0.10)
;; WHEN: Sat Jul 18 20:14:59 2009
;; MSG SIZE  rcvd: 148</pre>
</div>
</div>
<p>Note the <code>SERVER:</code> line. that shows you the answer for the query came from my DNS server (192.168.0.10).
</pre>
</li>
<li>Finally, set up your <code>/etc/resolv.conf</code> accordingly.
<p>On the server:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">nameserver 127.0.0.1</pre>
</div>
</div>
<p>And on all your other machines:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">nameserver 192.168.0.10</pre>
</div>
</div>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/18/configure-a-caching-only-name-server-in-a-chroot-environment-for-fedora-11/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Change Your MAC Address in Linux</title>
		<link>http://rajaseelan.com/2009/07/16/change-your-mac-address-in-linux/</link>
		<comments>http://rajaseelan.com/2009/07/16/change-your-mac-address-in-linux/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 08:38:58 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[hwaddr]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=227</guid>
		<description><![CDATA[Some times it necessary to change your network MAC address on your linux box.
Unlike Windows, which requires some registry editing or even specialized tools, its just a command line away in Linux.
For example, lets change the MAC address of your first netwrok card, usually called eth0.
Let&#8217;s swith to being the root user and view the [...]]]></description>
			<content:encoded><![CDATA[<p>Some times it necessary to change your network MAC address on your linux box.</p>
<p>Unlike Windows, which requires some registry editing or even specialized tools, its just a command line away in Linux.</p>
<p>For example, lets change the MAC address of your first netwrok card, usually called <code>eth0</code>.</p>
<p>Let&#8217;s swith to being the root user and view the current MAC address:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">ifconfig eth0</pre>
</div>
</div>
<p>You should get something similiar:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[root@rhel-5new ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:2C:D2:B5
          inet addr:192.168.0.108  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe2c:d2b5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20545 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18348 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10083277 (9.6 MiB)  TX bytes:7489363 (7.1 MiB)
          Interrupt:11 Base address:0xd020</pre>
</div>
</div>
<p>The MAC address is listed next to the <code>HWAddr</code> column, which is <code>08:00:27:2C:D2:B5</code> in this case.</p>
<p>We&#8217;ll change it. First shutdown the network interface.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">ifconfig eth0 down</pre>
</div>
</div>
<p>Now change it to say, <code>08:00:27:2C:D2:B4</code>.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">ifconfig eth0 hw ether 00:00:27:2c:d2:b4</pre>
</div>
</div>
<p>Bring the interface back up.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">ifconfig eth0 up</pre>
</div>
</div>
<p>Finally, lets have a look at the new mac address.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[root@rhel-5new ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:00:27:2C:D2:B4
          inet addr:192.168.0.108  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::200:27ff:fe2c:d2b4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20957 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18642 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10146055 (9.6 MiB)  TX bytes:7520724 (7.1 MiB)
          Interrupt:11 Base address:0xd020</pre>
</div>
</div>
<p>You can see that the HWaddr field now reports <code>00:00:27:2C:D2:B4</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/16/change-your-mac-address-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check Your Spelling in Linux using the Command Line</title>
		<link>http://rajaseelan.com/2009/07/15/check-your-spelling-in-linux-using-the-command-line/</link>
		<comments>http://rajaseelan.com/2009/07/15/check-your-spelling-in-linux-using-the-command-line/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 07:51:18 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[aspell]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[ispell]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[spell check]]></category>
		<category><![CDATA[spellcheck]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=216</guid>
		<description><![CDATA[You can do a spell check on from the command line in Linux. 
First, make sure you have aspell installed. In Fedora, just yum install it.


$ yum install aspell


You&#8217;ll also need a dictionary, from which aspell can search for words.
A yum search aspell will give you a list.


[raja@atreides visilon]$ yum search aspell
-----------------------------------------------------------
aspell-af.i586 : Afrikaans dictionaries [...]]]></description>
			<content:encoded><![CDATA[<p>You can do a spell check on from the command line in Linux. </p>
<p>First, make sure you have <a href="http://aspell.net/">aspell</a> installed. In Fedora, just <code>yum install</code> it.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">$ yum install aspell</pre>
</div>
</div>
<p>You&#8217;ll also need a dictionary, from which aspell can search for words.<br />
A <code>yum search aspell</code> will give you a list.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides visilon]$ yum search aspell
-----------------------------------------------------------
aspell-af.i586 : Afrikaans dictionaries for Aspell
aspell-bg.i586 : Bulgarian dictionaries for Aspell
aspell-br.i586 : Breton dictionaries for Aspell
aspell-ca.i586 : Catalan dictionaries for Aspell
aspell-cs.i586 : Czech dictionaries for Aspell
aspell-cy.i586 : Welsh dictionaries for Aspell
aspell-da.i586 : Danish dictionaries for Aspell
aspell-de.i586 : German dictionaries for Aspell
aspell-el.i586 : Greek dictionaries for Aspell
aspell-en.i586 : English dictionaries for Aspell
aspell-es.i586 : Spanish dictionaries for Aspell
aspell-fr.i586 : French dictionaries for Aspell
aspell-ga.i586 : Irish dictionaries for Aspell
aspell-gl.i586 : Galician dictionaries for Aspell
aspell-hr.i586 : Croatian dictionaries for Aspell
aspell-id.i586 : Indonesian dictionaries for Aspell
aspell-is.i586 : Icelandic dictionaries for Aspell
aspell-it.i586 : Italian dictionaries for Aspell
aspell-no.i586 : Norwegian dictionaries for Aspell
aspell-pl.i586 : Polish dictionaries for Aspell
aspell-pt.i586 : Portuguese dictionaries for Aspell
aspell-ru.i586 : Russian dictionaries for Aspell
aspell-sl.i586 : Slovenian dictionaries for Aspell
aspell-sr.i586 : Serbian dictionaries for Aspell
aspell-sv.i586 : Swedish dictionaries for Aspell
aspell-fo.i586 : Faeroese dictionaries for Aspell
aspell-gd.i586 : Gaelic dictionaries for Aspell
aspell-nl.i586 : Dutch dictionaries for Aspell
aspell-ar.i586 : Arabic dictionary for Aspell
aspell-bn.i586 : GNU Aspell Bengali Dictionary Package
aspell-gu.i586 : GNU Aspell Gujarati Dictionary Package
aspell-he.i586 : Hebrew dictionary for Aspell
aspell-hi.i586 : GNU Aspell Hindi Dictionary Package
aspell-ml.i586 : GNU Aspell Malayalam Dictionary Package
aspell-mr.i586 : GNU Aspell Marathi Dictionary Package
aspell-or.i586 : GNU Aspell Oriya Dictionary Package
aspell-pa.i586 : GNU Aspell Punjabi Dictionary Package
aspell-sk.i586 : Slovak dictionaries for Aspell
aspell-ta.i586 : GNU Aspell Tamil Dictionary Package
aspell-te.i586 : GNU Aspell Telugu Dictionary Package</pre>
</div>
</div>
<p>That&#8217;s a lot of languages. I&#8217;ll just install the English dictionaries.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">yum install aspell-en.i586</pre>
</div>
</div>
<p>Now the fun part. Checking your spelling via command line.<br />
Just type <code>aspell -a</code> and it will give you a prompt. I&#8217;ll intentionally type a misspelled word and see what it returns:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides visilon]$ aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.6)
psychatrist
&amp; psychatrist 5 0: psychiatrist, psychiatrists, psychiatrist's, psychiatry's, psychiatric</pre>
</div>
</div>
<p>I spelt &#8216;psychiatrist&#8217; wrongly, and it gave me back a few suggested corrections. (Ok I admit, I didn&#8217;t know how to spell it in the first place. <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  )</p>
<p>Lets see what happens when you give it a correctly spelled word:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides visilon]$ aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.6)
disapprove
*</pre>
</div>
</div>
<p>Yes, it returns an asterisk(*), showing you&#8217;re spelling is correct.<br />
Press <code>Ctrl + D</code> when you&#8217;re done, to bring you back to the command line.</p>
<p>If you have a text file, you could check that using aspell as well. For example, here&#8217;s some sample text:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">Mary had a little lamb. It's fleede was whote as snow.</pre>
</div>
</div>
<p>We&#8217;ll save it as <code>mary.txt</code> and run aspell like this to check the file:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">aspell check mary.txt</pre>
</div>
</div>
<p>You&#8217;ll get a interface like this, highlighting every misspelled word, with the suggested actions.</p>
<div id="attachment_217" class="wp-caption aligncenter" style="width: 310px"><a target="blank" href="http://rajaseelan.com/wp-content/uploads/2009/07/aspell-in-action.png"><img src="http://rajaseelan.com/wp-content/uploads/2009/07/aspell-in-action-300x186.png" alt="Aspell in action" title="Aspell in action" width="300" height="186" class="size-medium wp-image-217" /></a>
<p class="wp-caption-text">Aspell in action</p>
</div>
<p>When done with the checking, aspell will exit, saving the previous copy with a <code>.bak</code> extension. <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/15/check-your-spelling-in-linux-using-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Mass Rename Files in Linux</title>
		<link>http://rajaseelan.com/2009/07/12/how-to-mass-rename-files-in-linux/</link>
		<comments>http://rajaseelan.com/2009/07/12/how-to-mass-rename-files-in-linux/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 14:12:15 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[mass rename]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=203</guid>
		<description><![CDATA[When entrusted with the chore of renaming multiple file, the convenience of a script shines. After all, we ain&#8217;t robots designed to do just one thing. Today, I&#8217;ll show one method of renaming files, using a for loop in bash.
First, the task we are going to do:
We have a list of files:


[raja@atreides test]$ ls
data_file_1  [...]]]></description>
			<content:encoded><![CDATA[<p>When entrusted with the chore of renaming multiple file, the convenience of a script shines. After all, we ain&#8217;t robots designed to do just one thing. Today, I&#8217;ll show one method of renaming files, using a <strong>for loop</strong> in bash.</p>
<p>First, the task we are going to do:</p>
<p>We have a list of files:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ ls
data_file_1   data_file_2  data_file_4  data_file_6  data_file_8
data_file_10  data_file_3  data_file_5  data_file_7  data_file_9</pre>
</div>
</div>
<p>We have been instructed to replace the underscores (<strong>_</strong>) in the file names with hyphens (<strong>-</strong>).</p>
<p>A menial task not really suited for humans. We&#8217;ll start building a script for this, one piece at a time.</p>
<ol>
<li>Check which type of shell you are using.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">echo $SHELL</pre>
</div>
</div>
<p>As I am using bash scripting, make sure the result is <code>/bin/bash</code></li>
<li>List out all the file that you wish to rename
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">$ ls data_file_*</pre>
</div>
</div>
<p>It should give you output like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ ls data_file_*
data_file_1   data_file_2  data_file_4  data_file_6  data_file_8
data_file_10  data_file_3  data_file_5  data_file_7  data_file_9</pre>
</div>
</div>
</li>
<li>Lets display each one of this in a for loop.
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>What this for loop does is take each of the file names given by the <code>ls</code> command and store it in the <code>$file_name</code> bash variable. You&#8217;ll see this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; done
The file: data_file_1
The file: data_file_10
The file: data_file_2
The file: data_file_3
The file: data_file_4
The file: data_file_5
The file: data_file_6
The file: data_file_7
The file: data_file_8
The file: data_file_9</pre>
</div>
</div>
</li>
<li>Now that we&#8217;ve stored the file names in variables, we can use the <code>sed</code> command to edit it, replacing the underscores with a hyphen. I&#8217;ll <code>echo</code> the file name and pipe it to sed, to make sure it replaces the file name, and not modify the files itself.
<p>I used the sed replace command, <code>s</code> with a global option behind, the <code>g</code>, to make sure it replaces all occurrences of the underscore. Without the &#8216;g&#8217;, sed will only replace the first underscore and ignore the rest.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file_name</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_/-/g'</span> ; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>When you run this command in your console, you will see this output:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; echo $file_name | sed 's/_/-/g' ; done
The file: data_file_1
data-file-1
The file: data_file_10
data-file-10
The file: data_file_2
data-file-2
The file: data_file_3
data-file-3
The file: data_file_4
data-file-4
The file: data_file_5
data-file-5
The file: data_file_6
data-file-6
The file: data_file_7
data-file-7
The file: data_file_8
data-file-8
The file: data_file_9
data-file-9</pre>
</div>
</div>
</li>
<li>Of course, all this script is doing right now is editing the file name in the $file_name variable itself. Even though you can see what the modified file name will look like, we have not actually renamed the files on your hard disk yet. (This can be a good method of testing your sed-fu, before you really do it <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</li>
<li>In order to actually rename the file, I&#8217;ll put the results of sed&#8217;s transformation in a variable called <code>$new_file_name</code>.I&#8217;ll also print this out to the terminal, so you can see the changes that are about to take place.
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #007800;">new_file_name</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file_name</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_/-/g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New name:&quot;</span> <span style="color: #007800;">$new_file_name</span> ; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>You&#8217;ll then see this being output on the terminal:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; new_file_name=$(echo $file_name | sed 's/_/-/g'); echo &quot;New name:&quot; $new_file_name ; done
The file: data_file_1
New name: data-file-1
The file: data_file_10
New name: data-file-10
The file: data_file_2
New name: data-file-2
The file: data_file_3
New name: data-file-3
The file: data_file_4
New name: data-file-4
The file: data_file_5
New name: data-file-5
The file: data_file_6
New name: data-file-6
The file: data_file_7
New name: data-file-7
The file: data_file_8
New name: data-file-8
The file: data_file_9
New name: data-file-9</pre>
</div>
</div>
</li>
<li> Now that we&#8217;ve got both the old AND new file names, nicely stored in variables, its time to actually rename them using the <code>mv</code> command. The syntax for renaming is <code>mv current_file_name new_file_name</code>. I think you&#8217;re starting to see where these variables come in handy. <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #007800;">new_file_name</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file_name</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_/-/g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New name:&quot;</span> <span style="color: #007800;">$new_file_name</span> ; <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">$file_name</span> <span style="color: #007800;">$new_file_name</span>; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>I&#8217;ve added a <code>-v</code> to the <code>mv</code>, so it displays what it is changing. As I always say, a little more verbosity is always good, especially on the terminal. Your final output will be something like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; new_file_name=$(echo $file_name | sed 's/_/-/g'); echo &quot;New name:&quot; $new_file_name ; mv -v $file_name $new_file_name; done
The file: data_file_1
New name: data-file-1
`data_file_1' -&gt; `data-file-1'
The file: data_file_10
New name: data-file-10
`data_file_10' -&gt; `data-file-10'
The file: data_file_2
New name: data-file-2
`data_file_2' -&gt; `data-file-2'
The file: data_file_3
New name: data-file-3
`data_file_3' -&gt; `data-file-3'
The file: data_file_4
New name: data-file-4
`data_file_4' -&gt; `data-file-4'
The file: data_file_5
New name: data-file-5
`data_file_5' -&gt; `data-file-5'
The file: data_file_6
New name: data-file-6
`data_file_6' -&gt; `data-file-6'
The file: data_file_7
New name: data-file-7
`data_file_7' -&gt; `data-file-7'
The file: data_file_8
New name: data-file-8
`data_file_8' -&gt; `data-file-8'
The file: data_file_9
New name: data-file-9
`data_file_9' -&gt; `data-file-9'</pre>
</div>
</div>
<p>An <code>ls</code> will reveal that all files have really been changed this time.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ ls
data-file-1   data-file-2  data-file-4  data-file-6  data-file-8
data-file-10  data-file-3  data-file-5  data-file-7  data-file-9</pre>
</div>
</div>
<p>This should give you an idea on how to mass rename files. Of course there are probably better ways. Please do comment if you know some.
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/12/how-to-mass-rename-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to install a Dynamic DNS client for Fedora Linux</title>
		<link>http://rajaseelan.com/2009/07/10/how-to-install-a-dynamic-dns-client-for-fedora-linux/</link>
		<comments>http://rajaseelan.com/2009/07/10/how-to-install-a-dynamic-dns-client-for-fedora-linux/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 14:56:36 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[dynamic dns]]></category>
		<category><![CDATA[dyndns]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[inadyn]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=197</guid>
		<description><![CDATA[Many people use dynamic dns for different purposes. I use it to give my home machine a public presence. I choose DynDNS for my needs. Its a leader in this segment and have been around for a long time.
First, you&#8217;ll need to register for a free account at their site. Once you&#8217;ve chosen a domain [...]]]></description>
			<content:encoded><![CDATA[<p>Many people use <a href="http://en.wikipedia.org/wiki/Dynamic_DNS">dynamic dns</a> for different purposes. I use it to give my home machine a public presence. I choose <a href="http://www.dyndns.com/">DynDNS</a> for my needs. Its a leader in this segment and have been around for a long time.</p>
<p>First, you&#8217;ll need to register for a free account at their site. Once you&#8217;ve chosen a domain name and setup your details, you&#8217;ll need a dynamic dns client to update your IP, which probably changes every time you sign on to your ISP.</p>
<p>I use <a href="http://inadyn-mt.sourceforge.net">inadyn</a>, a free dynamic dns update client that works in linux.</p>
<p>The Inadyn package name is <code>inadyn-mt</code>. Install inadyn using yum:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">yum install inadyn-mt</pre>
</div>
</div>
<p>Then edit the <code>/etc/inadyn.conf</code> file with your details.</p>
<p>Then turn on the service.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">service inadyn start</pre>
</div>
</div>
<p>Check <code>/var/log/messages</code>. you should get some entires showing whether you edited the config file properly, and the update was successful.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">Jul 10 22:50:43 atom INADYN[8251]: Fri Jul 10 22:50:43 2009: I:INADYN: Alias 'your-hostname.dyndns.org' to IP '12.34.56.78' updated successfully.</pre>
</div>
</div>
<p>Once you know the client works, dont forget to turn it on permanently on startup.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">chkconfig inadyn on</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/10/how-to-install-a-dynamic-dns-client-for-fedora-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to print usernames with a userid greater than 500</title>
		<link>http://rajaseelan.com/2009/07/09/how-to-print-usernames-with-a-userid-greater-than-500/</link>
		<comments>http://rajaseelan.com/2009/07/09/how-to-print-usernames-with-a-userid-greater-than-500/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 13:37:53 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[uid]]></category>
		<category><![CDATA[usernames]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=100</guid>
		<description><![CDATA[Occasionally, you need to print out a list of usernames, greater than a certain user id. This is usually useful an a slightly larger setup, or when you want to chain more commands to certain users.
Use the awk command.


awk -F&#34;:&#34; ' $3 &#62; 200  {print $1} '  /etc/passwd


]]></description>
			<content:encoded><![CDATA[<p>Occasionally, you need to print out a list of usernames, greater than a certain <em>user id</em>. This is usually useful an a slightly larger setup, or when you want to chain more commands to certain users.</p>
<p>Use the awk command.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">awk -F&quot;:&quot; ' $3 &gt; 200  {print $1} '  /etc/passwd</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/09/how-to-print-usernames-with-a-userid-greater-than-500/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 CLI ways to determine which rpm package has a program you wish to install in Fedora Linux</title>
		<link>http://rajaseelan.com/2009/07/08/2-cli-ways-to-determine-which-rpm-package-has-a-program-you-wish-to-install-in-fedora-linux/</link>
		<comments>http://rajaseelan.com/2009/07/08/2-cli-ways-to-determine-which-rpm-package-has-a-program-you-wish-to-install-in-fedora-linux/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 18:11:07 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[provides]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[yum.]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=177</guid>
		<description><![CDATA[There are 2 ways I know of to search for a particular program to install in Linux. As usual, I&#8217;ll be focusing on the Command Line Interface (CLI).
So, you&#8217;ve heard about the versatile port scanning tool called nmap and want to install it in Fedora Linux. The only problem is, you don&#8217;t know if it [...]]]></description>
			<content:encoded><![CDATA[<p>There are 2 ways I know of to search for a particular program to install in Linux. As usual, I&#8217;ll be focusing on the Command Line Interface (CLI).</p>
<p>So, you&#8217;ve heard about the versatile port scanning tool called <a href="http://nmap.org/">nmap</a> and want to install it in Fedora Linux. The only problem is, you don&#8217;t know if it has been pre-packaged and is available as an rpm binary. No worries, all you need to do is search for using <code>yum</code>.</p>
<p>Use the yum search command.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">yum search nmap</pre>
</div>
</div>
<p>Based on its output, you know there are packages available, and all you need to do is <code>yum install nmap</code></p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides ~]$ yum search nmap
Loaded plugins: fastestmirror, presto, refresh-packagekit
================================ Matched: nmap =================================
nmap.i586 : Network exploration tool and security scanner
nmap-frontend.i586 : the GTK+ frontend for nmap
onesixtyone.i586 : An efficient SNMP scanner
perl-Nmap-Parser.noarch : Parse nmap scan data with perl
psad.i586 : Port Scan Attack Detector (psad) watches for suspect traffic</pre>
</div>
</div>
<p>Or, you might know that its called <code>nmap</code>, and want to search through you yum repositories to find if any of the available rpms have a file called nmap. To do that, use the <code>yum provides */
<program_name> command. e.g.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">yum provides */nmap</pre>
</div>
</div>
<p>Look at what it gives:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides ~]$ yum provides */nmap
Loaded plugins: fastestmirror, presto, refresh-packagekit
2:nmap-4.76-4.fc11.i586 : Network exploration tool and security scanner
Repo        : fedora
Matched from:
Filename    : /usr/share/nmap
Filename    : /usr/bin/nmap</pre>
</div>
</div>
<p>From this, you know that the <code>nmap-4.76-4.fc11.i586</code> rpm contains these files, and by installing it, you get nmap.</program_name></code></p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/08/2-cli-ways-to-determine-which-rpm-package-has-a-program-you-wish-to-install-in-fedora-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable USB Devices for VirtualBox Guests in Fedora 11</title>
		<link>http://rajaseelan.com/2009/07/06/how-to-enable-usb-devices-for-virtualbox-guests-in-fedora-11/</link>
		<comments>http://rajaseelan.com/2009/07/06/how-to-enable-usb-devices-for-virtualbox-guests-in-fedora-11/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 17:44:06 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fedora 11]]></category>
		<category><![CDATA[linux liferea howto]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=160</guid>
		<description><![CDATA[By default, guest hosts running in VirtualBox on Fedora 11 cannot mount or see usb devices plugged into your machine. A few tweaks are necessary for USB support to work.

Edit your /etc/rc.sysinit file, change line no 26 from


mount -n -t usbfs /proc/bus/usb /proc/bus/usb


to


mount -t usbfs -o remount,devgid=$(awk -F: '/^vboxusers:/{print $3}' /etc/gr    oup),devmode=664 [...]]]></description>
			<content:encoded><![CDATA[<p>By default, guest hosts running in VirtualBox on Fedora 11 cannot mount or see usb devices plugged into your machine. A few tweaks are necessary for USB support to work.</p>
<ol>
<li>Edit your /etc/rc.sysinit file, change line no 26 from
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">mount -n -t usbfs /proc/bus/usb /proc/bus/usb</pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">mount -t usbfs -o remount,devgid=$(awk -F: '/^vboxusers:/{print $3}' /etc/gr    oup),devmode=664 /proc/bus/usb /proc/bus/usb</pre>
</div>
</div>
<p>So, your <code>/etc/rc.sysinit</code> should change from:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"> <span style="color: #000000;">23</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
 <span style="color: #000000;">24</span>         modprobe usbcore <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-t</span> usbfs <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb     <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb
 <span style="color: #000000;">25</span> <span style="color: #000000; font-weight: bold;">else</span>
 <span style="color: #000000;">26</span>        <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-t</span> usbfs <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb
 <span style="color: #000000;">27</span> <span style="color: #000000; font-weight: bold;">fi</span></pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"> <span style="color: #000000;">24</span>         modprobe usbcore <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-t</span> usbfs <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb     <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb
 <span style="color: #000000;">25</span> <span style="color: #000000; font-weight: bold;">else</span>
 <span style="color: #000000;">26</span> <span style="color: #666666; font-style: italic;">#       mount -n -t usbfs /proc/bus/usb /proc/bus/usb</span>
 <span style="color: #000000;">27</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> usbfs <span style="color: #660033;">-o</span> remount,<span style="color: #007800;">devgid</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">awk</span> -F: <span style="color: #ff0000;">'/^vboxusers:/{print $3}'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>gr    oup<span style="color: #7a0874; font-weight: bold;">&#41;</span>,<span style="color: #007800;">devmode</span>=<span style="color: #000000;">664</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>usb
 <span style="color: #000000;">28</span> <span style="color: #000000; font-weight: bold;">fi</span></pre>
</div>
</div>
</li>
<li>Next, edit your <code>/etc/udev/rules.d/10-vboxdrv.rules</code>. Change line number 1 from
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">KERNEL==&quot;vboxdrv&quot;, NAME=&quot;vboxdrv&quot;, OWNER=&quot;root&quot;, GROUP=&quot;root&quot;, MODE=&quot;0600&quot;</pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">KERNEL==&quot;vboxdrv&quot;, NAME=&quot;vboxdrv&quot;, OWNER=&quot;root&quot;, GROUP=&quot;root&quot;, MODE=&quot;0660&quot;</pre>
</div>
</div>
</li>
<li>Reboot your machine. You should now be able to mount you usb devices.</li>
</ol>
<p>The following screenshot shows some of the USB devices can allow my guest machine to view.</p>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 310px"><img src="http://rajaseelan.com/wp-content/uploads/2009/07/virtualbox-usb-opt-300x187.jpg" alt="The USB devices available for VirtualBox Guests" title="virtualbox-usb-opt" width="300" height="187" class="size-medium wp-image-164" />
<p class="wp-caption-text">The USB devices available for VirtualBox Guests</p>
</div>
<p>Devices like my USB Flash Drive are still blurred out. In order to get them to work, I need to install the VirtualBox Guest Additions first.</p>
<p>Source:</p>
<p><a href="http://forums.virtualbox.org/viewtopic.php?f=7&#038;t=18759#p81148">VirtualBox Community Forum</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/06/how-to-enable-usb-devices-for-virtualbox-guests-in-fedora-11/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
