<?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>A Waage Blog &#187; Networking</title>
	<atom:link href="http://qugstart.com/blog/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://qugstart.com/blog</link>
	<description>Ruby, Rails, Life</description>
	<lastBuildDate>Thu, 10 Nov 2011 00:35:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CentOS NFS How-to Guide: Exporting and Mounting a NFS Drive</title>
		<link>http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/</link>
		<comments>http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 02:22:16 +0000</pubDate>
		<dc:creator>Andrew Waage</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[portmap]]></category>

		<guid isPermaLink="false">http://qugstart.com/blog/?p=62</guid>
		<description><![CDATA[This guide shows you how to start an NFS service on one (host) machine, export the NFS drive, and then connect to that NFS drive from a client machine.
## On the NFS host machine:
#Start Portmap service if needed.
#NFS uses portmap and a bunch of ports (that you can set in /etc/sysconfig/nfs) if you want.
See this [...]]]></description>
			<content:encoded><![CDATA[<p>This guide shows you how to start an NFS service on one (host) machine, export the NFS drive, and then connect to that NFS drive from a client machine.</p>
<p>## On the NFS host machine:</p>
<p>#Start Portmap service if needed.<br />
#NFS uses portmap and a bunch of ports (that you can set in /etc/sysconfig/nfs) if you want.<br />
See this <a href="http://pario.no/2008/01/15/allow-nfs-through-iptables-on-a-redhat-system/">link for more details on NFS ports</a>.</p>
<p>#Start portmap service</p>
<pre lang='bash' class='prettyprint'>
service portmap status
service portmap start (if needed)
</pre>
<p>#Start NFS</p>
<pre lang='bash' class='prettyprint'>
service nfs start
</pre>
<p>#Edit /etc/exports<br />
#Reference: https://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-nfs-server-export.html</p>
<p>Format is (select the options you want):<br />
 [Directory to export] [Hosts to allow](options)</p>
<pre lang='bash' class='prettyprint'>
/home/just_testing 192.168.0.0/24(rw,async,wdelay,root_squash)
</pre>
<p>#Run exportfs to refresh NFS exports</p>
<pre lang='bash' class='prettyprint'>
exportfs -av
</pre>
<p>Be sure the proper ports are open on iptables<br />
Reference: http://pario.no/2008/01/15/allow-nfs-through-iptables-on-a-redhat-system/</p>
<p>## Now on your NFS client machine:<br />
Start portmap</p>
<pre lang='bash' class='prettyprint'>
service portmap start
</pre>
<p>Create a mount point and mount the NFS drive. Remember to use your own server&#8217;s IP address:</p>
<pre lang='bash' class='prettyprint'>
mkdir /mnt/nfs-usbdisk
mount 192.168.0.2:/home/just_testing /mnt/nfs-usbdisk
</pre>
<p>Voila ! Tail your logs if you have any problems !</p>
]]></content:encoded>
			<wfw:commentRss>http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolve a hostname from an IP address in Ruby (Reverse-DNS)</title>
		<link>http://qugstart.com/blog/ruby-and-rails/resolve-a-hostname-from-an-ip-address-in-ruby-reverse-dns/</link>
		<comments>http://qugstart.com/blog/ruby-and-rails/resolve-a-hostname-from-an-ip-address-in-ruby-reverse-dns/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 21:47:43 +0000</pubDate>
		<dc:creator>Andrew Waage</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[getaddrinfo]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[nslookup]]></category>
		<category><![CDATA[resolve]]></category>
		<category><![CDATA[reverse dns]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">http://qugstart.com/blog/?p=10</guid>
		<description><![CDATA[It sounds easy, but I tried a lot of things before finding the solution I used.
I tried using:
`host 66.249.67.49` or
`nslookup 66.249.67.49`

These were fine, but it seems a bit hacky to use the shell. Also, it would require some sort of parsing to get the hostname that I want.
Browsing the web, I found a couple solutions [...]]]></description>
			<content:encoded><![CDATA[<p>It sounds easy, but I tried a lot of things before finding the solution I used.</p>
<p>I tried using:</p>
<pre lang="ruby" class="prettyprint">`host 66.249.67.49` or
`nslookup 66.249.67.49`
</pre>
<p>These were fine, but it seems a bit hacky to use the shell. Also, it would require some sort of parsing to get the hostname that I want.</p>
<p>Browsing the web, I found a couple solutions that almost worked.</p>
<pre lang="ruby" class="prettyprint">s = Socket.getaddrinfo('66.249.67.49',nil)
hostname = s[0][2]
</pre>
<p>This solution worked in IRB, worked in console, but for some reason would not work when I was running my mongrel server and trying to perform the exact same method call from a web-browser. ( I still don&#8217;t know why).</p>
<p>Digging around a bit more, I came up with this simple solution:</p>
<pre lang="ruby" class="prettyprint">host = Resolv.new.getname('66.249.67.49')
</pre>
<p>Is it really that easy?? Give it a shot and let me know your thoughts !!</p>
]]></content:encoded>
			<wfw:commentRss>http://qugstart.com/blog/ruby-and-rails/resolve-a-hostname-from-an-ip-address-in-ruby-reverse-dns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

